commit stringlengths 40 40 | old_file stringlengths 4 118 | new_file stringlengths 4 118 | old_contents stringlengths 0 2.94k | new_contents stringlengths 1 4.43k | subject stringlengths 15 444 | message stringlengths 16 3.45k | lang stringclasses 1
value | license stringclasses 13
values | repos stringlengths 5 43.2k | prompt stringlengths 17 4.58k | response stringlengths 1 4.43k | prompt_tagged stringlengths 58 4.62k | response_tagged stringlengths 1 4.43k | text stringlengths 132 7.29k | text_tagged stringlengths 173 7.33k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
d4ed2619bb7f1d49df7a6add98309de5f2201a8d | tests/destination_finder_test.py | tests/destination_finder_test.py | import unittest
import datetime
import json
import sys
sys.path.append('..')
import sabre_dev_studio
import sabre_dev_studio.sabre_exceptions as sabre_exceptions
'''
requires config.json in the same directory for api authentication
{
"sabre_client_id": -----,
"sabre_client_secret": -----
}
'''
class TestBasicDest... | Fix destination finder test to actually produce results | Fix destination finder test to actually produce results
| Python | mit | Jamil/sabre_dev_studio | Fix destination finder test to actually produce results | import unittest
import datetime
import json
import sys
sys.path.append('..')
import sabre_dev_studio
import sabre_dev_studio.sabre_exceptions as sabre_exceptions
'''
requires config.json in the same directory for api authentication
{
"sabre_client_id": -----,
"sabre_client_secret": -----
}
'''
class TestBasicDest... | <commit_before><commit_msg>Fix destination finder test to actually produce results<commit_after> | import unittest
import datetime
import json
import sys
sys.path.append('..')
import sabre_dev_studio
import sabre_dev_studio.sabre_exceptions as sabre_exceptions
'''
requires config.json in the same directory for api authentication
{
"sabre_client_id": -----,
"sabre_client_secret": -----
}
'''
class TestBasicDest... | Fix destination finder test to actually produce resultsimport unittest
import datetime
import json
import sys
sys.path.append('..')
import sabre_dev_studio
import sabre_dev_studio.sabre_exceptions as sabre_exceptions
'''
requires config.json in the same directory for api authentication
{
"sabre_client_id": -----,
... | <commit_before><commit_msg>Fix destination finder test to actually produce results<commit_after>import unittest
import datetime
import json
import sys
sys.path.append('..')
import sabre_dev_studio
import sabre_dev_studio.sabre_exceptions as sabre_exceptions
'''
requires config.json in the same directory for api authe... | |
0448c74dd655dcc871fd870c6785295973ba4139 | examples/kiwilist.py | examples/kiwilist.py | import gtk
from kiwi.ui.widgets.list import Column, List, SequentialColumn
class Person:
"""The parameters need to be of the same name of the column headers"""
def __init__(self, name, age, city, present):
(self.name, self.age,
self.city, self.present) = name, age, city, present
def __re... | Add a small kiwi list example | Add a small kiwi list example
| Python | lgpl-2.1 | Schevo/kiwi,Schevo/kiwi,Schevo/kiwi | Add a small kiwi list example | import gtk
from kiwi.ui.widgets.list import Column, List, SequentialColumn
class Person:
"""The parameters need to be of the same name of the column headers"""
def __init__(self, name, age, city, present):
(self.name, self.age,
self.city, self.present) = name, age, city, present
def __re... | <commit_before><commit_msg>Add a small kiwi list example<commit_after> | import gtk
from kiwi.ui.widgets.list import Column, List, SequentialColumn
class Person:
"""The parameters need to be of the same name of the column headers"""
def __init__(self, name, age, city, present):
(self.name, self.age,
self.city, self.present) = name, age, city, present
def __re... | Add a small kiwi list exampleimport gtk
from kiwi.ui.widgets.list import Column, List, SequentialColumn
class Person:
"""The parameters need to be of the same name of the column headers"""
def __init__(self, name, age, city, present):
(self.name, self.age,
self.city, self.present) = name, age... | <commit_before><commit_msg>Add a small kiwi list example<commit_after>import gtk
from kiwi.ui.widgets.list import Column, List, SequentialColumn
class Person:
"""The parameters need to be of the same name of the column headers"""
def __init__(self, name, age, city, present):
(self.name, self.age,
... | |
feebfc2d084227a015521de2fe4eea31db1fb09d | examples/list_dir.py | examples/list_dir.py | import asyncio
import ampdclient
MPD_HOST = '192.168.1.5'
MPD_PORT = 6600
def onchange(message):
print('Message received ' + str(message))
@asyncio.coroutine
def start():
mpd_client = yield from ampdclient.connect(MPD_HOST, MPD_PORT)
mpd_client.cb_onchange = onchange
resp = yield from mpd_client.... | Add example for listing directory | Add example for listing directory
| Python | apache-2.0 | PierreRust/ampdclient | Add example for listing directory | import asyncio
import ampdclient
MPD_HOST = '192.168.1.5'
MPD_PORT = 6600
def onchange(message):
print('Message received ' + str(message))
@asyncio.coroutine
def start():
mpd_client = yield from ampdclient.connect(MPD_HOST, MPD_PORT)
mpd_client.cb_onchange = onchange
resp = yield from mpd_client.... | <commit_before><commit_msg>Add example for listing directory<commit_after> | import asyncio
import ampdclient
MPD_HOST = '192.168.1.5'
MPD_PORT = 6600
def onchange(message):
print('Message received ' + str(message))
@asyncio.coroutine
def start():
mpd_client = yield from ampdclient.connect(MPD_HOST, MPD_PORT)
mpd_client.cb_onchange = onchange
resp = yield from mpd_client.... | Add example for listing directoryimport asyncio
import ampdclient
MPD_HOST = '192.168.1.5'
MPD_PORT = 6600
def onchange(message):
print('Message received ' + str(message))
@asyncio.coroutine
def start():
mpd_client = yield from ampdclient.connect(MPD_HOST, MPD_PORT)
mpd_client.cb_onchange = onchange
... | <commit_before><commit_msg>Add example for listing directory<commit_after>import asyncio
import ampdclient
MPD_HOST = '192.168.1.5'
MPD_PORT = 6600
def onchange(message):
print('Message received ' + str(message))
@asyncio.coroutine
def start():
mpd_client = yield from ampdclient.connect(MPD_HOST, MPD_PORT... | |
ad5181b36a51a0ac2ab4aaec829359711afdeda9 | tests/test_executors.py | tests/test_executors.py | import asyncio
import concurrent.futures
from uvloop import _testbase as tb
def fib(n):
if n < 2:
return 1
return fib(n - 2) + fib(n - 1)
class _TestExecutors:
def run_pool_test(self, pool_factory):
async def run():
pool = pool_factory()
with pool:
... | Add tests for process/thread pool executors | tests: Add tests for process/thread pool executors
| Python | apache-2.0 | 1st1/uvloop,MagicStack/uvloop,MagicStack/uvloop | tests: Add tests for process/thread pool executors | import asyncio
import concurrent.futures
from uvloop import _testbase as tb
def fib(n):
if n < 2:
return 1
return fib(n - 2) + fib(n - 1)
class _TestExecutors:
def run_pool_test(self, pool_factory):
async def run():
pool = pool_factory()
with pool:
... | <commit_before><commit_msg>tests: Add tests for process/thread pool executors<commit_after> | import asyncio
import concurrent.futures
from uvloop import _testbase as tb
def fib(n):
if n < 2:
return 1
return fib(n - 2) + fib(n - 1)
class _TestExecutors:
def run_pool_test(self, pool_factory):
async def run():
pool = pool_factory()
with pool:
... | tests: Add tests for process/thread pool executorsimport asyncio
import concurrent.futures
from uvloop import _testbase as tb
def fib(n):
if n < 2:
return 1
return fib(n - 2) + fib(n - 1)
class _TestExecutors:
def run_pool_test(self, pool_factory):
async def run():
pool = p... | <commit_before><commit_msg>tests: Add tests for process/thread pool executors<commit_after>import asyncio
import concurrent.futures
from uvloop import _testbase as tb
def fib(n):
if n < 2:
return 1
return fib(n - 2) + fib(n - 1)
class _TestExecutors:
def run_pool_test(self, pool_factory):
... | |
3e483c2dcfd89227d9a2c56578a6532439b8fca4 | core/data/DataTransformer.py | core/data/DataTransformer.py | """
DataTransformer
:Authors:
Berend Klein Haneveld
"""
from vtk import vtkImageReslice
class DataTransformer(object):
"""DataTransformer is a class that can transform a given dataset"""
def __init__(self):
super(DataTransformer, self).__init__()
def TransformImageData(self, imageData, transform):
"""
:t... | Add a simple transform helper class. | Add a simple transform helper class.
| Python | mit | berendkleinhaneveld/Registrationshop,berendkleinhaneveld/Registrationshop | Add a simple transform helper class. | """
DataTransformer
:Authors:
Berend Klein Haneveld
"""
from vtk import vtkImageReslice
class DataTransformer(object):
"""DataTransformer is a class that can transform a given dataset"""
def __init__(self):
super(DataTransformer, self).__init__()
def TransformImageData(self, imageData, transform):
"""
:t... | <commit_before><commit_msg>Add a simple transform helper class.<commit_after> | """
DataTransformer
:Authors:
Berend Klein Haneveld
"""
from vtk import vtkImageReslice
class DataTransformer(object):
"""DataTransformer is a class that can transform a given dataset"""
def __init__(self):
super(DataTransformer, self).__init__()
def TransformImageData(self, imageData, transform):
"""
:t... | Add a simple transform helper class."""
DataTransformer
:Authors:
Berend Klein Haneveld
"""
from vtk import vtkImageReslice
class DataTransformer(object):
"""DataTransformer is a class that can transform a given dataset"""
def __init__(self):
super(DataTransformer, self).__init__()
def TransformImageData(sel... | <commit_before><commit_msg>Add a simple transform helper class.<commit_after>"""
DataTransformer
:Authors:
Berend Klein Haneveld
"""
from vtk import vtkImageReslice
class DataTransformer(object):
"""DataTransformer is a class that can transform a given dataset"""
def __init__(self):
super(DataTransformer, self... | |
1b1bc020f3e37c10072ed45271e92348a8e2fcad | pi/plot_temperature.py | pi/plot_temperature.py | import datetime
import matplotlib.pyplot as pyplot
import os
import re
import sys
def main():
"""Main."""
if sys.version_info.major <= 2:
print('Use Python 3')
return
lines = []
for file_name in sorted(os.listdir('.{}temperatures'.format(os.sep))):
if file_name.endswith('csv')... | Add script to plot temperatures | Add script to plot temperatures
| Python | mit | bskari/eclipse-2017-hab,bskari/eclipse-2017-hab | Add script to plot temperatures | import datetime
import matplotlib.pyplot as pyplot
import os
import re
import sys
def main():
"""Main."""
if sys.version_info.major <= 2:
print('Use Python 3')
return
lines = []
for file_name in sorted(os.listdir('.{}temperatures'.format(os.sep))):
if file_name.endswith('csv')... | <commit_before><commit_msg>Add script to plot temperatures<commit_after> | import datetime
import matplotlib.pyplot as pyplot
import os
import re
import sys
def main():
"""Main."""
if sys.version_info.major <= 2:
print('Use Python 3')
return
lines = []
for file_name in sorted(os.listdir('.{}temperatures'.format(os.sep))):
if file_name.endswith('csv')... | Add script to plot temperaturesimport datetime
import matplotlib.pyplot as pyplot
import os
import re
import sys
def main():
"""Main."""
if sys.version_info.major <= 2:
print('Use Python 3')
return
lines = []
for file_name in sorted(os.listdir('.{}temperatures'.format(os.sep))):
... | <commit_before><commit_msg>Add script to plot temperatures<commit_after>import datetime
import matplotlib.pyplot as pyplot
import os
import re
import sys
def main():
"""Main."""
if sys.version_info.major <= 2:
print('Use Python 3')
return
lines = []
for file_name in sorted(os.listdir(... | |
90aebb2fe3c4605798148adbff57deedba0ad175 | test_user_operations.py | test_user_operations.py | import unittest
import user
from users import UserDatabase
class FakeDatabaseSession:
def __init__(self):
self.didCommit = False
self.things = [ ]
def commit(self):
self.didCommit = True
def add(self, thingToAdd):
self.things.append(thingToAdd)
class FakeDatabase:
def _... | Add some unit tests for common user operations | Add some unit tests for common user operations
| Python | bsd-2-clause | peterhajas/LivingDex,peterhajas/LivingDex,peterhajas/LivingDex,peterhajas/LivingDex | Add some unit tests for common user operations | import unittest
import user
from users import UserDatabase
class FakeDatabaseSession:
def __init__(self):
self.didCommit = False
self.things = [ ]
def commit(self):
self.didCommit = True
def add(self, thingToAdd):
self.things.append(thingToAdd)
class FakeDatabase:
def _... | <commit_before><commit_msg>Add some unit tests for common user operations<commit_after> | import unittest
import user
from users import UserDatabase
class FakeDatabaseSession:
def __init__(self):
self.didCommit = False
self.things = [ ]
def commit(self):
self.didCommit = True
def add(self, thingToAdd):
self.things.append(thingToAdd)
class FakeDatabase:
def _... | Add some unit tests for common user operationsimport unittest
import user
from users import UserDatabase
class FakeDatabaseSession:
def __init__(self):
self.didCommit = False
self.things = [ ]
def commit(self):
self.didCommit = True
def add(self, thingToAdd):
self.things.app... | <commit_before><commit_msg>Add some unit tests for common user operations<commit_after>import unittest
import user
from users import UserDatabase
class FakeDatabaseSession:
def __init__(self):
self.didCommit = False
self.things = [ ]
def commit(self):
self.didCommit = True
def add(s... | |
4ff2635c54d59b4dbeaff87f369c0046f35e159a | tests.py | tests.py | from django.core.exceptions import ImproperlyConfigured
from django_mailgun import MailgunBackend
from pytest import raises
def test_configuration():
with raises(ImproperlyConfigured):
MailgunBackend()
| Add super simple test case | Add super simple test case
| Python | mit | vangale/django-mailgun,rollokb/django-mailgun,BradWhittington/django-mailgun | Add super simple test case | from django.core.exceptions import ImproperlyConfigured
from django_mailgun import MailgunBackend
from pytest import raises
def test_configuration():
with raises(ImproperlyConfigured):
MailgunBackend()
| <commit_before><commit_msg>Add super simple test case<commit_after> | from django.core.exceptions import ImproperlyConfigured
from django_mailgun import MailgunBackend
from pytest import raises
def test_configuration():
with raises(ImproperlyConfigured):
MailgunBackend()
| Add super simple test casefrom django.core.exceptions import ImproperlyConfigured
from django_mailgun import MailgunBackend
from pytest import raises
def test_configuration():
with raises(ImproperlyConfigured):
MailgunBackend()
| <commit_before><commit_msg>Add super simple test case<commit_after>from django.core.exceptions import ImproperlyConfigured
from django_mailgun import MailgunBackend
from pytest import raises
def test_configuration():
with raises(ImproperlyConfigured):
MailgunBackend()
| |
328525f8435f8c97545f8d4fea85173e480f11f2 | setup.py | setup.py | # -*- coding: utf-8 -*-
import os
from setuptools import setup
def read(fname):
try:
return open(os.path.join(os.path.dirname(__file__), fname)).read()
except:
return ''
setup(
name='todoist-python',
version='0.2.4',
packages=['todoist', 'todoist.managers'],
author='Doist Team'... | # -*- coding: utf-8 -*-
import os
from setuptools import setup
def read(fname):
try:
return open(os.path.join(os.path.dirname(__file__), fname)).read()
except:
return ''
setup(
name='todoist-python',
version='0.2.5',
packages=['todoist', 'todoist.managers'],
author='Doist Team'... | Update the PyPI version to 0.2.5. | Update the PyPI version to 0.2.5.
| Python | mit | electronick1/todoist-python,Doist/todoist-python | # -*- coding: utf-8 -*-
import os
from setuptools import setup
def read(fname):
try:
return open(os.path.join(os.path.dirname(__file__), fname)).read()
except:
return ''
setup(
name='todoist-python',
version='0.2.4',
packages=['todoist', 'todoist.managers'],
author='Doist Team'... | # -*- coding: utf-8 -*-
import os
from setuptools import setup
def read(fname):
try:
return open(os.path.join(os.path.dirname(__file__), fname)).read()
except:
return ''
setup(
name='todoist-python',
version='0.2.5',
packages=['todoist', 'todoist.managers'],
author='Doist Team'... | <commit_before># -*- coding: utf-8 -*-
import os
from setuptools import setup
def read(fname):
try:
return open(os.path.join(os.path.dirname(__file__), fname)).read()
except:
return ''
setup(
name='todoist-python',
version='0.2.4',
packages=['todoist', 'todoist.managers'],
auth... | # -*- coding: utf-8 -*-
import os
from setuptools import setup
def read(fname):
try:
return open(os.path.join(os.path.dirname(__file__), fname)).read()
except:
return ''
setup(
name='todoist-python',
version='0.2.5',
packages=['todoist', 'todoist.managers'],
author='Doist Team'... | # -*- coding: utf-8 -*-
import os
from setuptools import setup
def read(fname):
try:
return open(os.path.join(os.path.dirname(__file__), fname)).read()
except:
return ''
setup(
name='todoist-python',
version='0.2.4',
packages=['todoist', 'todoist.managers'],
author='Doist Team'... | <commit_before># -*- coding: utf-8 -*-
import os
from setuptools import setup
def read(fname):
try:
return open(os.path.join(os.path.dirname(__file__), fname)).read()
except:
return ''
setup(
name='todoist-python',
version='0.2.4',
packages=['todoist', 'todoist.managers'],
auth... |
b00fef938e2fac4599bb22ef110038d76dc88f79 | setup.py | setup.py | from setuptools import setup
setup(
name='tox-travis',
description='Seamless integration of Tox into Travis CI',
long_description=open('README.rst', 'rb').read().decode('utf-8'),
author='Ryan Hiebert',
author_email='[email protected]',
url='https://github.com/ryanhiebert/tox-travis',
lic... | from setuptools import setup
def fread(fn):
return open(fn, 'rb').read().decode('utf-8')
setup(
name='tox-travis',
description='Seamless integration of Tox into Travis CI',
long_description=fread('README.rst') + '\n\n' + fread('HISTORY.rst'),
author='Ryan Hiebert',
author_email='ryan@ryanhieb... | Append HISTORY to long description on PyPI | Append HISTORY to long description on PyPI
| Python | mit | rpkilby/tox-travis,ryanhiebert/tox-travis,tox-dev/tox-travis | from setuptools import setup
setup(
name='tox-travis',
description='Seamless integration of Tox into Travis CI',
long_description=open('README.rst', 'rb').read().decode('utf-8'),
author='Ryan Hiebert',
author_email='[email protected]',
url='https://github.com/ryanhiebert/tox-travis',
lic... | from setuptools import setup
def fread(fn):
return open(fn, 'rb').read().decode('utf-8')
setup(
name='tox-travis',
description='Seamless integration of Tox into Travis CI',
long_description=fread('README.rst') + '\n\n' + fread('HISTORY.rst'),
author='Ryan Hiebert',
author_email='ryan@ryanhieb... | <commit_before>from setuptools import setup
setup(
name='tox-travis',
description='Seamless integration of Tox into Travis CI',
long_description=open('README.rst', 'rb').read().decode('utf-8'),
author='Ryan Hiebert',
author_email='[email protected]',
url='https://github.com/ryanhiebert/tox-t... | from setuptools import setup
def fread(fn):
return open(fn, 'rb').read().decode('utf-8')
setup(
name='tox-travis',
description='Seamless integration of Tox into Travis CI',
long_description=fread('README.rst') + '\n\n' + fread('HISTORY.rst'),
author='Ryan Hiebert',
author_email='ryan@ryanhieb... | from setuptools import setup
setup(
name='tox-travis',
description='Seamless integration of Tox into Travis CI',
long_description=open('README.rst', 'rb').read().decode('utf-8'),
author='Ryan Hiebert',
author_email='[email protected]',
url='https://github.com/ryanhiebert/tox-travis',
lic... | <commit_before>from setuptools import setup
setup(
name='tox-travis',
description='Seamless integration of Tox into Travis CI',
long_description=open('README.rst', 'rb').read().decode('utf-8'),
author='Ryan Hiebert',
author_email='[email protected]',
url='https://github.com/ryanhiebert/tox-t... |
daa7273b00056d5748687eba525a8715e6228a6a | test/dataset_test.py | test/dataset_test.py | import numpy as np
import theanets
class TestDataset:
def setUp(self):
self.dataset = theanets.dataset.Dataset(
np.arange(101)[:, None],
label='foo',
batches=4,
size=10,
)
def test_setup(self):
assert self.dataset.label == 'foo'
... | Add tests for dataset class. | Add tests for dataset class.
| Python | mit | chrinide/theanets,lmjohns3/theanets,devdoer/theanets | Add tests for dataset class. | import numpy as np
import theanets
class TestDataset:
def setUp(self):
self.dataset = theanets.dataset.Dataset(
np.arange(101)[:, None],
label='foo',
batches=4,
size=10,
)
def test_setup(self):
assert self.dataset.label == 'foo'
... | <commit_before><commit_msg>Add tests for dataset class.<commit_after> | import numpy as np
import theanets
class TestDataset:
def setUp(self):
self.dataset = theanets.dataset.Dataset(
np.arange(101)[:, None],
label='foo',
batches=4,
size=10,
)
def test_setup(self):
assert self.dataset.label == 'foo'
... | Add tests for dataset class.import numpy as np
import theanets
class TestDataset:
def setUp(self):
self.dataset = theanets.dataset.Dataset(
np.arange(101)[:, None],
label='foo',
batches=4,
size=10,
)
def test_setup(self):
assert self.dat... | <commit_before><commit_msg>Add tests for dataset class.<commit_after>import numpy as np
import theanets
class TestDataset:
def setUp(self):
self.dataset = theanets.dataset.Dataset(
np.arange(101)[:, None],
label='foo',
batches=4,
size=10,
)
def ... | |
5f0e8dccb11f889cbc217ab7ce1408b978da8ef0 | bin/deskew-and-unpaper.py | bin/deskew-and-unpaper.py | #!/usr/bin/env python
# This script walks through all files under the current directory,
# looking for those called page-001.png, page-002.png, etc. (If a
# version called page-001.rotated.png, etc. is also present, that us
# used as in put in preference.) For each page the script uses
# "convert -deskew '40%'" and ... | Add a helper script to deskew and unpaper scanned pages | Add a helper script to deskew and unpaper scanned pages
| Python | agpl-3.0 | ken-muturi/pombola,hzj123/56th,mysociety/pombola,geoffkilpin/pombola,ken-muturi/pombola,mysociety/pombola,hzj123/56th,geoffkilpin/pombola,ken-muturi/pombola,patricmutwiri/pombola,patricmutwiri/pombola,hzj123/56th,geoffkilpin/pombola,patricmutwiri/pombola,ken-muturi/pombola,mysociety/pombola,hzj123/56th,mysociety/pombol... | Add a helper script to deskew and unpaper scanned pages | #!/usr/bin/env python
# This script walks through all files under the current directory,
# looking for those called page-001.png, page-002.png, etc. (If a
# version called page-001.rotated.png, etc. is also present, that us
# used as in put in preference.) For each page the script uses
# "convert -deskew '40%'" and ... | <commit_before><commit_msg>Add a helper script to deskew and unpaper scanned pages<commit_after> | #!/usr/bin/env python
# This script walks through all files under the current directory,
# looking for those called page-001.png, page-002.png, etc. (If a
# version called page-001.rotated.png, etc. is also present, that us
# used as in put in preference.) For each page the script uses
# "convert -deskew '40%'" and ... | Add a helper script to deskew and unpaper scanned pages#!/usr/bin/env python
# This script walks through all files under the current directory,
# looking for those called page-001.png, page-002.png, etc. (If a
# version called page-001.rotated.png, etc. is also present, that us
# used as in put in preference.) For e... | <commit_before><commit_msg>Add a helper script to deskew and unpaper scanned pages<commit_after>#!/usr/bin/env python
# This script walks through all files under the current directory,
# looking for those called page-001.png, page-002.png, etc. (If a
# version called page-001.rotated.png, etc. is also present, that u... | |
632bc12fee8a709f1bc0600085001c4e91c077ac | storage/test/test_kv_storages_read_only.py | storage/test/test_kv_storages_read_only.py | import pytest
from storage.kv_store_leveldb import KeyValueStorageLeveldb
from storage.kv_store_rocksdb import KeyValueStorageRocksdb
from storage.kv_store import KeyValueStorage
i = 0
@pytest.yield_fixture(scope="function", params=['rocksdb', 'leveldb'])
def kv(request, tempdir) -> KeyValueStorage:
global i
... | Add test of read-only mode for key-value DB storages. | Add test of read-only mode for key-value DB storages.
Signed-off-by: Sergey Shilov <[email protected]>
| Python | apache-2.0 | evernym/zeno,evernym/plenum | Add test of read-only mode for key-value DB storages.
Signed-off-by: Sergey Shilov <[email protected]> | import pytest
from storage.kv_store_leveldb import KeyValueStorageLeveldb
from storage.kv_store_rocksdb import KeyValueStorageRocksdb
from storage.kv_store import KeyValueStorage
i = 0
@pytest.yield_fixture(scope="function", params=['rocksdb', 'leveldb'])
def kv(request, tempdir) -> KeyValueStorage:
global i
... | <commit_before><commit_msg>Add test of read-only mode for key-value DB storages.
Signed-off-by: Sergey Shilov <[email protected]><commit_after> | import pytest
from storage.kv_store_leveldb import KeyValueStorageLeveldb
from storage.kv_store_rocksdb import KeyValueStorageRocksdb
from storage.kv_store import KeyValueStorage
i = 0
@pytest.yield_fixture(scope="function", params=['rocksdb', 'leveldb'])
def kv(request, tempdir) -> KeyValueStorage:
global i
... | Add test of read-only mode for key-value DB storages.
Signed-off-by: Sergey Shilov <[email protected]>import pytest
from storage.kv_store_leveldb import KeyValueStorageLeveldb
from storage.kv_store_rocksdb import KeyValueStorageRocksdb
from storage.kv_store import KeyValueStorage... | <commit_before><commit_msg>Add test of read-only mode for key-value DB storages.
Signed-off-by: Sergey Shilov <[email protected]><commit_after>import pytest
from storage.kv_store_leveldb import KeyValueStorageLeveldb
from storage.kv_store_rocksdb import KeyValueStorageRocksdb
fro... | |
a6293fd84b1b393f5a2ed00f07131dc13371554b | viewer_examples/plugins/collection_plugin.py | viewer_examples/plugins/collection_plugin.py | """
=================
Collection plugin
=================
Demo of a CollectionViewer for viewing collections of images with the
`autolevel` rank filter connected as a plugin.
"""
from skimage import data
from skimage.filter import rank
from skimage.morphology import disk
from skimage.viewer import CollectionViewer
f... | Add example of connecting plugins to CollectionViewer | Add example of connecting plugins to CollectionViewer
| Python | bsd-3-clause | juliusbierk/scikit-image,rjeli/scikit-image,Hiyorimi/scikit-image,michaelaye/scikit-image,ofgulban/scikit-image,chintak/scikit-image,vighneshbirodkar/scikit-image,jwiggins/scikit-image,vighneshbirodkar/scikit-image,dpshelio/scikit-image,robintw/scikit-image,ClinicalGraphics/scikit-image,michaelpacer/scikit-image,almark... | Add example of connecting plugins to CollectionViewer | """
=================
Collection plugin
=================
Demo of a CollectionViewer for viewing collections of images with the
`autolevel` rank filter connected as a plugin.
"""
from skimage import data
from skimage.filter import rank
from skimage.morphology import disk
from skimage.viewer import CollectionViewer
f... | <commit_before><commit_msg>Add example of connecting plugins to CollectionViewer<commit_after> | """
=================
Collection plugin
=================
Demo of a CollectionViewer for viewing collections of images with the
`autolevel` rank filter connected as a plugin.
"""
from skimage import data
from skimage.filter import rank
from skimage.morphology import disk
from skimage.viewer import CollectionViewer
f... | Add example of connecting plugins to CollectionViewer"""
=================
Collection plugin
=================
Demo of a CollectionViewer for viewing collections of images with the
`autolevel` rank filter connected as a plugin.
"""
from skimage import data
from skimage.filter import rank
from skimage.morphology impor... | <commit_before><commit_msg>Add example of connecting plugins to CollectionViewer<commit_after>"""
=================
Collection plugin
=================
Demo of a CollectionViewer for viewing collections of images with the
`autolevel` rank filter connected as a plugin.
"""
from skimage import data
from skimage.filter ... | |
09472f2cffb5fdd8481508d5a434ef9f1b1cd1a8 | code/python/knub/thesis/word2vec_converter.py | code/python/knub/thesis/word2vec_converter.py | import argparse
import logging
from gensim.models import Word2Vec
logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO)
if __name__ == "__main__":
parser = argparse.ArgumentParser("Convert word2vec model from binary to txt")
parser.add_argument("model", type=str)
arg... | Add word2vec binary to txt format converter | Add word2vec binary to txt format converter
| Python | apache-2.0 | knub/master-thesis,knub/master-thesis,knub/master-thesis,knub/master-thesis | Add word2vec binary to txt format converter | import argparse
import logging
from gensim.models import Word2Vec
logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO)
if __name__ == "__main__":
parser = argparse.ArgumentParser("Convert word2vec model from binary to txt")
parser.add_argument("model", type=str)
arg... | <commit_before><commit_msg>Add word2vec binary to txt format converter<commit_after> | import argparse
import logging
from gensim.models import Word2Vec
logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO)
if __name__ == "__main__":
parser = argparse.ArgumentParser("Convert word2vec model from binary to txt")
parser.add_argument("model", type=str)
arg... | Add word2vec binary to txt format converterimport argparse
import logging
from gensim.models import Word2Vec
logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO)
if __name__ == "__main__":
parser = argparse.ArgumentParser("Convert word2vec model from binary to txt")
par... | <commit_before><commit_msg>Add word2vec binary to txt format converter<commit_after>import argparse
import logging
from gensim.models import Word2Vec
logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO)
if __name__ == "__main__":
parser = argparse.ArgumentParser("Convert wo... | |
d6f2ee46ea9b56eae5769b51cff48b1c434b829c | tests/unit/sts/god_scheduler_test.py | tests/unit/sts/god_scheduler_test.py | # Copyright 2011-2013 Colin Scott
#
# 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 wri... | Add simple test for GodScheduler | Add simple test for GodScheduler
| Python | apache-2.0 | jmiserez/sts,ucb-sts/sts,ucb-sts/sts,jmiserez/sts | Add simple test for GodScheduler | # Copyright 2011-2013 Colin Scott
#
# 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 wri... | <commit_before><commit_msg>Add simple test for GodScheduler<commit_after> | # Copyright 2011-2013 Colin Scott
#
# 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 wri... | Add simple test for GodScheduler# Copyright 2011-2013 Colin Scott
#
# 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 ap... | <commit_before><commit_msg>Add simple test for GodScheduler<commit_after># Copyright 2011-2013 Colin Scott
#
# 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/licen... | |
b635112d3613d47247ac22390786aaaffcd2a3fd | examples/upsidedownternet.py | examples/upsidedownternet.py | import Image, cStringIO
def response(context, flow):
if flow.response.headers["content-type"] == ["image/png"]:
s = cStringIO.StringIO(flow.response.content)
img = Image.open(s)
img = img.rotate(180)
s2 = cStringIO.StringIO()
img.save(s2, "png")
flow.response.content ... | Add an example script that turns all PNGs upside down. | Add an example script that turns all PNGs upside down.
| Python | mit | dxq-git/mitmproxy,Kriechi/mitmproxy,tekii/mitmproxy,gzzhanghao/mitmproxy,ADemonisis/mitmproxy,ParthGanatra/mitmproxy,ZeYt/mitmproxy,vhaupert/mitmproxy,scriptmediala/mitmproxy,cortesi/mitmproxy,jvillacorta/mitmproxy,syjzwjj/mitmproxy,azureplus/mitmproxy,StevenVanAcker/mitmproxy,mitmproxy/mitmproxy,ccccccccccc/mitmproxy,... | Add an example script that turns all PNGs upside down. | import Image, cStringIO
def response(context, flow):
if flow.response.headers["content-type"] == ["image/png"]:
s = cStringIO.StringIO(flow.response.content)
img = Image.open(s)
img = img.rotate(180)
s2 = cStringIO.StringIO()
img.save(s2, "png")
flow.response.content ... | <commit_before><commit_msg>Add an example script that turns all PNGs upside down.<commit_after> | import Image, cStringIO
def response(context, flow):
if flow.response.headers["content-type"] == ["image/png"]:
s = cStringIO.StringIO(flow.response.content)
img = Image.open(s)
img = img.rotate(180)
s2 = cStringIO.StringIO()
img.save(s2, "png")
flow.response.content ... | Add an example script that turns all PNGs upside down.import Image, cStringIO
def response(context, flow):
if flow.response.headers["content-type"] == ["image/png"]:
s = cStringIO.StringIO(flow.response.content)
img = Image.open(s)
img = img.rotate(180)
s2 = cStringIO.StringIO()
... | <commit_before><commit_msg>Add an example script that turns all PNGs upside down.<commit_after>import Image, cStringIO
def response(context, flow):
if flow.response.headers["content-type"] == ["image/png"]:
s = cStringIO.StringIO(flow.response.content)
img = Image.open(s)
img = img.rotate(18... | |
c145b2cc08b3bbf0d2506afb58116e1a0c2dc4fc | tests/core_tests.py | tests/core_tests.py | from graffiti import core
from graffiti import util
def test_schema():
assert "fn" in core.schema(1)
fn = lambda x: 1
assert core.schema(fn) == util.fninfo(fn)
def t():
return 1
t._schema = { "schema": 1 }
assert core.schema(t) == { "schema": 1 }
def test_dependencies():
g = {
... | Add tests for core graph functions | Add tests for core graph functions
| Python | mit | SegFaultAX/graffiti | Add tests for core graph functions | from graffiti import core
from graffiti import util
def test_schema():
assert "fn" in core.schema(1)
fn = lambda x: 1
assert core.schema(fn) == util.fninfo(fn)
def t():
return 1
t._schema = { "schema": 1 }
assert core.schema(t) == { "schema": 1 }
def test_dependencies():
g = {
... | <commit_before><commit_msg>Add tests for core graph functions<commit_after> | from graffiti import core
from graffiti import util
def test_schema():
assert "fn" in core.schema(1)
fn = lambda x: 1
assert core.schema(fn) == util.fninfo(fn)
def t():
return 1
t._schema = { "schema": 1 }
assert core.schema(t) == { "schema": 1 }
def test_dependencies():
g = {
... | Add tests for core graph functionsfrom graffiti import core
from graffiti import util
def test_schema():
assert "fn" in core.schema(1)
fn = lambda x: 1
assert core.schema(fn) == util.fninfo(fn)
def t():
return 1
t._schema = { "schema": 1 }
assert core.schema(t) == { "schema": 1 }
def... | <commit_before><commit_msg>Add tests for core graph functions<commit_after>from graffiti import core
from graffiti import util
def test_schema():
assert "fn" in core.schema(1)
fn = lambda x: 1
assert core.schema(fn) == util.fninfo(fn)
def t():
return 1
t._schema = { "schema": 1 }
asse... | |
41f6c1c27fb8d3c63d8bb51471a24dcf9d59c1fb | tests/test_api.py | tests/test_api.py | import unittest
from flask import current_app, request, abort, jsonify, g, url_for
from api.api import *
from api.models import User
class TestApi(unittest.TestCase):
def setUp(self):
pass
@unittest.skip("")
def test_login(self):
pass
@unittest.skip("")
def test_register(self):... | Add test methods for api end point methods | Add test methods for api end point methods
| Python | mit | EdwinKato/bucket-list,EdwinKato/bucket-list,EdwinKato/bucket-list,EdwinKato/bucket-list,EdwinKato/bucket-list | Add test methods for api end point methods | import unittest
from flask import current_app, request, abort, jsonify, g, url_for
from api.api import *
from api.models import User
class TestApi(unittest.TestCase):
def setUp(self):
pass
@unittest.skip("")
def test_login(self):
pass
@unittest.skip("")
def test_register(self):... | <commit_before><commit_msg>Add test methods for api end point methods<commit_after> | import unittest
from flask import current_app, request, abort, jsonify, g, url_for
from api.api import *
from api.models import User
class TestApi(unittest.TestCase):
def setUp(self):
pass
@unittest.skip("")
def test_login(self):
pass
@unittest.skip("")
def test_register(self):... | Add test methods for api end point methodsimport unittest
from flask import current_app, request, abort, jsonify, g, url_for
from api.api import *
from api.models import User
class TestApi(unittest.TestCase):
def setUp(self):
pass
@unittest.skip("")
def test_login(self):
pass
@unit... | <commit_before><commit_msg>Add test methods for api end point methods<commit_after>import unittest
from flask import current_app, request, abort, jsonify, g, url_for
from api.api import *
from api.models import User
class TestApi(unittest.TestCase):
def setUp(self):
pass
@unittest.skip("")
def ... | |
954c92db789cf5bde4752c9b46b2c3a549820d75 | tests/test_api.py | tests/test_api.py | import mock
import unittest
from testrail.api import API
from testrail.helper import TestRailError
import copy
import ast
class TestHTTPMethod(unittest.TestCase):
def setUp(self):
self.client = API()
@mock.patch('testrail.api.requests.get')
def test_get_ok(self, mock_get):
mock_response =... | Add basic low level HTTP get tests. | Add basic low level HTTP get tests.
| Python | mit | travispavek/testrail-python,travispavek/testrail | Add basic low level HTTP get tests. | import mock
import unittest
from testrail.api import API
from testrail.helper import TestRailError
import copy
import ast
class TestHTTPMethod(unittest.TestCase):
def setUp(self):
self.client = API()
@mock.patch('testrail.api.requests.get')
def test_get_ok(self, mock_get):
mock_response =... | <commit_before><commit_msg>Add basic low level HTTP get tests.<commit_after> | import mock
import unittest
from testrail.api import API
from testrail.helper import TestRailError
import copy
import ast
class TestHTTPMethod(unittest.TestCase):
def setUp(self):
self.client = API()
@mock.patch('testrail.api.requests.get')
def test_get_ok(self, mock_get):
mock_response =... | Add basic low level HTTP get tests.import mock
import unittest
from testrail.api import API
from testrail.helper import TestRailError
import copy
import ast
class TestHTTPMethod(unittest.TestCase):
def setUp(self):
self.client = API()
@mock.patch('testrail.api.requests.get')
def test_get_ok(self,... | <commit_before><commit_msg>Add basic low level HTTP get tests.<commit_after>import mock
import unittest
from testrail.api import API
from testrail.helper import TestRailError
import copy
import ast
class TestHTTPMethod(unittest.TestCase):
def setUp(self):
self.client = API()
@mock.patch('testrail.api... | |
503f651e8d0e6aa8ffeabfa0108fe21b4fa73787 | udpPinger.py | udpPinger.py | #!/usr/bin/env python
import sys, socket, time
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
if len(sys.argv) > 1:
interval = float(eval(sys.argv[1]))
else:
interval = 1.0
if len(sys.argv) > 2:
size = int(eval(sys.argv[2]))
else:
size = 1420
s.settimeout(interval)
try:
while True:
... | Add python script for testing with. | Add python script for testing with.
| Python | bsd-3-clause | DanielCasner/esp8266-udp-throughput-test,DanielCasner/esp8266-udp-throughput-test,DanielCasner/esp8266-udp-throughput-test | Add python script for testing with. | #!/usr/bin/env python
import sys, socket, time
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
if len(sys.argv) > 1:
interval = float(eval(sys.argv[1]))
else:
interval = 1.0
if len(sys.argv) > 2:
size = int(eval(sys.argv[2]))
else:
size = 1420
s.settimeout(interval)
try:
while True:
... | <commit_before><commit_msg>Add python script for testing with.<commit_after> | #!/usr/bin/env python
import sys, socket, time
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
if len(sys.argv) > 1:
interval = float(eval(sys.argv[1]))
else:
interval = 1.0
if len(sys.argv) > 2:
size = int(eval(sys.argv[2]))
else:
size = 1420
s.settimeout(interval)
try:
while True:
... | Add python script for testing with.#!/usr/bin/env python
import sys, socket, time
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
if len(sys.argv) > 1:
interval = float(eval(sys.argv[1]))
else:
interval = 1.0
if len(sys.argv) > 2:
size = int(eval(sys.argv[2]))
else:
size = 1420
s.settimeout(int... | <commit_before><commit_msg>Add python script for testing with.<commit_after>#!/usr/bin/env python
import sys, socket, time
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
if len(sys.argv) > 1:
interval = float(eval(sys.argv[1]))
else:
interval = 1.0
if len(sys.argv) > 2:
size = int(eval(sys.argv[2])... | |
4e6773000326076f13f5d9eaa0c95103fe8511e4 | scripts/process_logs.py | scripts/process_logs.py | #!/usr/bin/python3
import sys
import collections
sums = collections.defaultdict(lambda: 0)
lens = collections.defaultdict(lambda: 0)
def mva(n_a, s_lb, s_a, avg_len, clients, z):
n_centers = n_a + 2
V = [2] + [1 / n_a] * n_a + [1]
S = [s_lb] + [s_a] * n_a + [z]
is_delay = [False] * (n_centers - 1) + ... | Add script to process log outputs and do Mean Value Analysis (MVA). | Add script to process log outputs and do Mean Value Analysis (MVA).
| Python | mit | gpoesia/autocomplete,gpoesia/autocomplete,gpoesia/autocomplete,gpoesia/autocomplete | Add script to process log outputs and do Mean Value Analysis (MVA). | #!/usr/bin/python3
import sys
import collections
sums = collections.defaultdict(lambda: 0)
lens = collections.defaultdict(lambda: 0)
def mva(n_a, s_lb, s_a, avg_len, clients, z):
n_centers = n_a + 2
V = [2] + [1 / n_a] * n_a + [1]
S = [s_lb] + [s_a] * n_a + [z]
is_delay = [False] * (n_centers - 1) + ... | <commit_before><commit_msg>Add script to process log outputs and do Mean Value Analysis (MVA).<commit_after> | #!/usr/bin/python3
import sys
import collections
sums = collections.defaultdict(lambda: 0)
lens = collections.defaultdict(lambda: 0)
def mva(n_a, s_lb, s_a, avg_len, clients, z):
n_centers = n_a + 2
V = [2] + [1 / n_a] * n_a + [1]
S = [s_lb] + [s_a] * n_a + [z]
is_delay = [False] * (n_centers - 1) + ... | Add script to process log outputs and do Mean Value Analysis (MVA).#!/usr/bin/python3
import sys
import collections
sums = collections.defaultdict(lambda: 0)
lens = collections.defaultdict(lambda: 0)
def mva(n_a, s_lb, s_a, avg_len, clients, z):
n_centers = n_a + 2
V = [2] + [1 / n_a] * n_a + [1]
S = [s_... | <commit_before><commit_msg>Add script to process log outputs and do Mean Value Analysis (MVA).<commit_after>#!/usr/bin/python3
import sys
import collections
sums = collections.defaultdict(lambda: 0)
lens = collections.defaultdict(lambda: 0)
def mva(n_a, s_lb, s_a, avg_len, clients, z):
n_centers = n_a + 2
V ... | |
f6303b46ee4b7a648bef01f8c6a171c4e1573cee | Scripts/process_files.py | Scripts/process_files.py | import os
from subprocess import call
inputpath = 'originals'
outputpath = 'segmentations'
for filename in os.listdir(inputpath):
current = os.path.join(inputpath, filename)
if os.path.isfile(current):
call([segment_exe, current, result])
| Add skeleton of python script to process multiple images. | Add skeleton of python script to process multiple images.
| Python | apache-2.0 | HackTheStacks/darwin-notes-image-processing,HackTheStacks/darwin-notes-image-processing | Add skeleton of python script to process multiple images. | import os
from subprocess import call
inputpath = 'originals'
outputpath = 'segmentations'
for filename in os.listdir(inputpath):
current = os.path.join(inputpath, filename)
if os.path.isfile(current):
call([segment_exe, current, result])
| <commit_before><commit_msg>Add skeleton of python script to process multiple images.<commit_after> | import os
from subprocess import call
inputpath = 'originals'
outputpath = 'segmentations'
for filename in os.listdir(inputpath):
current = os.path.join(inputpath, filename)
if os.path.isfile(current):
call([segment_exe, current, result])
| Add skeleton of python script to process multiple images.import os
from subprocess import call
inputpath = 'originals'
outputpath = 'segmentations'
for filename in os.listdir(inputpath):
current = os.path.join(inputpath, filename)
if os.path.isfile(current):
call([segment_exe, current, result])
| <commit_before><commit_msg>Add skeleton of python script to process multiple images.<commit_after>import os
from subprocess import call
inputpath = 'originals'
outputpath = 'segmentations'
for filename in os.listdir(inputpath):
current = os.path.join(inputpath, filename)
if os.path.isfile(current):
ca... | |
a06c38b486264477e2dd741badd4a2936e80299f | tests/io/open_append.py | tests/io/open_append.py | import sys
try:
import _os as os
except ImportError:
import os
if not hasattr(os, "unlink"):
print("SKIP")
sys.exit()
try:
os.unlink("testfile")
except OSError:
pass
# Should create a file
f = open("testfile", "a")
f.write("foo")
f.close()
f = open("testfile")
print(f.read())
f.close()
f = ... | Add testcase for open(..., "a"). | tests: Add testcase for open(..., "a").
| Python | mit | orionrobots/micropython,ChuckM/micropython,adafruit/circuitpython,martinribelotta/micropython,Peetz0r/micropython-esp32,mpalomer/micropython,Peetz0r/micropython-esp32,tuc-osg/micropython,SHA2017-badge/micropython-esp32,ceramos/micropython,deshipu/micropython,TDAbboud/micropython,puuu/micropython,hiway/micropython,first... | tests: Add testcase for open(..., "a"). | import sys
try:
import _os as os
except ImportError:
import os
if not hasattr(os, "unlink"):
print("SKIP")
sys.exit()
try:
os.unlink("testfile")
except OSError:
pass
# Should create a file
f = open("testfile", "a")
f.write("foo")
f.close()
f = open("testfile")
print(f.read())
f.close()
f = ... | <commit_before><commit_msg>tests: Add testcase for open(..., "a").<commit_after> | import sys
try:
import _os as os
except ImportError:
import os
if not hasattr(os, "unlink"):
print("SKIP")
sys.exit()
try:
os.unlink("testfile")
except OSError:
pass
# Should create a file
f = open("testfile", "a")
f.write("foo")
f.close()
f = open("testfile")
print(f.read())
f.close()
f = ... | tests: Add testcase for open(..., "a").import sys
try:
import _os as os
except ImportError:
import os
if not hasattr(os, "unlink"):
print("SKIP")
sys.exit()
try:
os.unlink("testfile")
except OSError:
pass
# Should create a file
f = open("testfile", "a")
f.write("foo")
f.close()
f = open("tes... | <commit_before><commit_msg>tests: Add testcase for open(..., "a").<commit_after>import sys
try:
import _os as os
except ImportError:
import os
if not hasattr(os, "unlink"):
print("SKIP")
sys.exit()
try:
os.unlink("testfile")
except OSError:
pass
# Should create a file
f = open("testfile", "a"... | |
0336f446393618ba6ab30f4d6ee8f8295e97a87e | csunplugged/resources/migrations/0010_auto_20171121_2304.py | csunplugged/resources/migrations/0010_auto_20171121_2304.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-11-21 23:04
from __future__ import unicode_literals
import django.contrib.postgres.fields
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('resources', '0009_auto_20171020_1005'),
]
ope... | Update Resource migrations to reflect model changes | Update Resource migrations to reflect model changes
| Python | mit | uccser/cs-unplugged,uccser/cs-unplugged,uccser/cs-unplugged,uccser/cs-unplugged | Update Resource migrations to reflect model changes | # -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-11-21 23:04
from __future__ import unicode_literals
import django.contrib.postgres.fields
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('resources', '0009_auto_20171020_1005'),
]
ope... | <commit_before><commit_msg>Update Resource migrations to reflect model changes<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-11-21 23:04
from __future__ import unicode_literals
import django.contrib.postgres.fields
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('resources', '0009_auto_20171020_1005'),
]
ope... | Update Resource migrations to reflect model changes# -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-11-21 23:04
from __future__ import unicode_literals
import django.contrib.postgres.fields
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('res... | <commit_before><commit_msg>Update Resource migrations to reflect model changes<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-11-21 23:04
from __future__ import unicode_literals
import django.contrib.postgres.fields
from django.db import migrations, models
class Migration(migrations.Migrat... | |
962ae6e810964a00f825d6f29ec9caa1a2996d3c | tests/test_bot_support.py | tests/test_bot_support.py | import pytest
from .test_bot import TestBot
class TestBotSupport(TestBot):
@pytest.mark.parametrize('url,result', [
('https://google.com', ['https://google.com']),
('google.com', ['google.com']),
('google.com/search?q=instabot', ['google.com/search?q=instabot']),
('https://google... | Add test on extract urls method | Add test on extract urls method
| Python | apache-2.0 | ohld/instabot,instagrambot/instabot,instagrambot/instabot | Add test on extract urls method | import pytest
from .test_bot import TestBot
class TestBotSupport(TestBot):
@pytest.mark.parametrize('url,result', [
('https://google.com', ['https://google.com']),
('google.com', ['google.com']),
('google.com/search?q=instabot', ['google.com/search?q=instabot']),
('https://google... | <commit_before><commit_msg>Add test on extract urls method<commit_after> | import pytest
from .test_bot import TestBot
class TestBotSupport(TestBot):
@pytest.mark.parametrize('url,result', [
('https://google.com', ['https://google.com']),
('google.com', ['google.com']),
('google.com/search?q=instabot', ['google.com/search?q=instabot']),
('https://google... | Add test on extract urls methodimport pytest
from .test_bot import TestBot
class TestBotSupport(TestBot):
@pytest.mark.parametrize('url,result', [
('https://google.com', ['https://google.com']),
('google.com', ['google.com']),
('google.com/search?q=instabot', ['google.com/search?q=instab... | <commit_before><commit_msg>Add test on extract urls method<commit_after>import pytest
from .test_bot import TestBot
class TestBotSupport(TestBot):
@pytest.mark.parametrize('url,result', [
('https://google.com', ['https://google.com']),
('google.com', ['google.com']),
('google.com/search?... | |
1b7341748cc98fcb0505cf03081b92f955279d79 | tests/test_mako_engine.py | tests/test_mako_engine.py | #!/usr/bin/env python
from __future__ import print_function
import unittest
import engines
HANDLE = 'mako'
class TestStringTemplate(unittest.TestCase):
def setUp(self):
try:
import mako
except ImportError:
self.skipTest("mako module not available")
def test_vali... | Add tests to mako engine. | Add tests to mako engine.
| Python | mit | blubberdiblub/eztemplate | Add tests to mako engine. | #!/usr/bin/env python
from __future__ import print_function
import unittest
import engines
HANDLE = 'mako'
class TestStringTemplate(unittest.TestCase):
def setUp(self):
try:
import mako
except ImportError:
self.skipTest("mako module not available")
def test_vali... | <commit_before><commit_msg>Add tests to mako engine.<commit_after> | #!/usr/bin/env python
from __future__ import print_function
import unittest
import engines
HANDLE = 'mako'
class TestStringTemplate(unittest.TestCase):
def setUp(self):
try:
import mako
except ImportError:
self.skipTest("mako module not available")
def test_vali... | Add tests to mako engine.#!/usr/bin/env python
from __future__ import print_function
import unittest
import engines
HANDLE = 'mako'
class TestStringTemplate(unittest.TestCase):
def setUp(self):
try:
import mako
except ImportError:
self.skipTest("mako module not avail... | <commit_before><commit_msg>Add tests to mako engine.<commit_after>#!/usr/bin/env python
from __future__ import print_function
import unittest
import engines
HANDLE = 'mako'
class TestStringTemplate(unittest.TestCase):
def setUp(self):
try:
import mako
except ImportError:
... | |
c349f9a1e199b3909f7f071f25d7c3d8e6d1347d | tests/unit/test_public.py | tests/unit/test_public.py | # Import libnacl libs
import libnacl.public
# Import python libs
import unittest
class TestPublic(unittest.TestCase):
'''
'''
def test_secretkey(self):
'''
'''
msg = 'You\'ve got two empty halves of coconut and you\'re bangin\' \'em together.'
bob = libnacl.public.SecretKey... | Add high level tests for public key encryption | Add high level tests for public key encryption
| Python | apache-2.0 | RaetProtocol/libnacl,coinkite/libnacl,saltstack/libnacl,johnttan/libnacl,cachedout/libnacl,mindw/libnacl | Add high level tests for public key encryption | # Import libnacl libs
import libnacl.public
# Import python libs
import unittest
class TestPublic(unittest.TestCase):
'''
'''
def test_secretkey(self):
'''
'''
msg = 'You\'ve got two empty halves of coconut and you\'re bangin\' \'em together.'
bob = libnacl.public.SecretKey... | <commit_before><commit_msg>Add high level tests for public key encryption<commit_after> | # Import libnacl libs
import libnacl.public
# Import python libs
import unittest
class TestPublic(unittest.TestCase):
'''
'''
def test_secretkey(self):
'''
'''
msg = 'You\'ve got two empty halves of coconut and you\'re bangin\' \'em together.'
bob = libnacl.public.SecretKey... | Add high level tests for public key encryption# Import libnacl libs
import libnacl.public
# Import python libs
import unittest
class TestPublic(unittest.TestCase):
'''
'''
def test_secretkey(self):
'''
'''
msg = 'You\'ve got two empty halves of coconut and you\'re bangin\' \'em tog... | <commit_before><commit_msg>Add high level tests for public key encryption<commit_after># Import libnacl libs
import libnacl.public
# Import python libs
import unittest
class TestPublic(unittest.TestCase):
'''
'''
def test_secretkey(self):
'''
'''
msg = 'You\'ve got two empty halves... | |
3f5d30b3dd47336be009091e47c20dca265414bf | find-non-ascii-char.py | find-non-ascii-char.py | #!/usr/bin/python3
import string
import sys
import io
asciichars = string.whitespace + string.ascii_letters + string.digits + string.punctuation
reset = '\x1b[0m'
txt_black_bold = '\x1b[30m'
on_yellow = '\x1b[43m'
def print_line(line):
in_non_ascii = False
o = ''
for c in line:
if c not in ascii... | Add script to find none ASCII char in file. | Add script to find none ASCII char in file.
| Python | mit | shoma/python.tools | Add script to find none ASCII char in file. | #!/usr/bin/python3
import string
import sys
import io
asciichars = string.whitespace + string.ascii_letters + string.digits + string.punctuation
reset = '\x1b[0m'
txt_black_bold = '\x1b[30m'
on_yellow = '\x1b[43m'
def print_line(line):
in_non_ascii = False
o = ''
for c in line:
if c not in ascii... | <commit_before><commit_msg>Add script to find none ASCII char in file.<commit_after> | #!/usr/bin/python3
import string
import sys
import io
asciichars = string.whitespace + string.ascii_letters + string.digits + string.punctuation
reset = '\x1b[0m'
txt_black_bold = '\x1b[30m'
on_yellow = '\x1b[43m'
def print_line(line):
in_non_ascii = False
o = ''
for c in line:
if c not in ascii... | Add script to find none ASCII char in file.#!/usr/bin/python3
import string
import sys
import io
asciichars = string.whitespace + string.ascii_letters + string.digits + string.punctuation
reset = '\x1b[0m'
txt_black_bold = '\x1b[30m'
on_yellow = '\x1b[43m'
def print_line(line):
in_non_ascii = False
o = ''
... | <commit_before><commit_msg>Add script to find none ASCII char in file.<commit_after>#!/usr/bin/python3
import string
import sys
import io
asciichars = string.whitespace + string.ascii_letters + string.digits + string.punctuation
reset = '\x1b[0m'
txt_black_bold = '\x1b[30m'
on_yellow = '\x1b[43m'
def print_line(lin... | |
c5ca7990aa3eb1abbc14e69e6a7a849db508968e | tools/virtualizer_diff.py | tools/virtualizer_diff.py | #!/usr/bin/env python
# Copyright 2017 Janos Czentye <[email protected]>
#
# 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 ... | Add helper script to create virtualizer diff | Add helper script to create virtualizer diff
| Python | apache-2.0 | hsnlab/escape,5GExchange/escape,5GExchange/escape,5GExchange/escape,hsnlab/escape,hsnlab/escape,5GExchange/escape,5GExchange/escape,hsnlab/escape,hsnlab/escape,5GExchange/escape,hsnlab/escape | Add helper script to create virtualizer diff | #!/usr/bin/env python
# Copyright 2017 Janos Czentye <[email protected]>
#
# 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 ... | <commit_before><commit_msg>Add helper script to create virtualizer diff<commit_after> | #!/usr/bin/env python
# Copyright 2017 Janos Czentye <[email protected]>
#
# 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 ... | Add helper script to create virtualizer diff#!/usr/bin/env python
# Copyright 2017 Janos Czentye <[email protected]>
#
# 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.o... | <commit_before><commit_msg>Add helper script to create virtualizer diff<commit_after>#!/usr/bin/env python
# Copyright 2017 Janos Czentye <[email protected]>
#
# 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 o... | |
96a93627d6e72e2e04bfc2e7f6fdc67f53623288 | mikrotik_config_parser.py | mikrotik_config_parser.py | import ConfigParser
from mikrotik_device import MtDevice
class Config(object):
def __init__(self):
self.config = ConfigParser.ConfigParser()
self.config.read('config.ini')
def get_ftp(self):
ftp = {'host' : self.config.get('ftp', 'host'),
'port' : self.config.get('ftp... | Add ini file parser and fill up backup commands | Add ini file parser and fill up backup commands
| Python | mit | voronovim/mikrotik-api-tools | Add ini file parser and fill up backup commands | import ConfigParser
from mikrotik_device import MtDevice
class Config(object):
def __init__(self):
self.config = ConfigParser.ConfigParser()
self.config.read('config.ini')
def get_ftp(self):
ftp = {'host' : self.config.get('ftp', 'host'),
'port' : self.config.get('ftp... | <commit_before><commit_msg>Add ini file parser and fill up backup commands<commit_after> | import ConfigParser
from mikrotik_device import MtDevice
class Config(object):
def __init__(self):
self.config = ConfigParser.ConfigParser()
self.config.read('config.ini')
def get_ftp(self):
ftp = {'host' : self.config.get('ftp', 'host'),
'port' : self.config.get('ftp... | Add ini file parser and fill up backup commandsimport ConfigParser
from mikrotik_device import MtDevice
class Config(object):
def __init__(self):
self.config = ConfigParser.ConfigParser()
self.config.read('config.ini')
def get_ftp(self):
ftp = {'host' : self.config.get('ftp', 'host'... | <commit_before><commit_msg>Add ini file parser and fill up backup commands<commit_after>import ConfigParser
from mikrotik_device import MtDevice
class Config(object):
def __init__(self):
self.config = ConfigParser.ConfigParser()
self.config.read('config.ini')
def get_ftp(self):
ftp ... | |
be5f12fcafe2e382ec65fef864340ae8c13fa4ea | tests/unit/modules/inspect_collector_test.py | tests/unit/modules/inspect_collector_test.py | # -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Bo Maryniuk <[email protected]>`
'''
# Import Python Libs
from __future__ import absolute_import
# Import Salt Testing Libs
from salttesting import TestCase, skipIf
from salttesting.mock import (
MagicMock,
patch,
NO_MOCK,
NO_MOCK_REASON
)
from salt.module... | Add initial unit test for inspectlib.collector.Inspector | Add initial unit test for inspectlib.collector.Inspector
| Python | apache-2.0 | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | Add initial unit test for inspectlib.collector.Inspector | # -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Bo Maryniuk <[email protected]>`
'''
# Import Python Libs
from __future__ import absolute_import
# Import Salt Testing Libs
from salttesting import TestCase, skipIf
from salttesting.mock import (
MagicMock,
patch,
NO_MOCK,
NO_MOCK_REASON
)
from salt.module... | <commit_before><commit_msg>Add initial unit test for inspectlib.collector.Inspector<commit_after> | # -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Bo Maryniuk <[email protected]>`
'''
# Import Python Libs
from __future__ import absolute_import
# Import Salt Testing Libs
from salttesting import TestCase, skipIf
from salttesting.mock import (
MagicMock,
patch,
NO_MOCK,
NO_MOCK_REASON
)
from salt.module... | Add initial unit test for inspectlib.collector.Inspector# -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Bo Maryniuk <[email protected]>`
'''
# Import Python Libs
from __future__ import absolute_import
# Import Salt Testing Libs
from salttesting import TestCase, skipIf
from salttesting.mock import (
MagicMock,
pa... | <commit_before><commit_msg>Add initial unit test for inspectlib.collector.Inspector<commit_after># -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Bo Maryniuk <[email protected]>`
'''
# Import Python Libs
from __future__ import absolute_import
# Import Salt Testing Libs
from salttesting import TestCase, skipIf
from saltte... | |
4f2743ed845185de718763df6d26db390ee2eb48 | test_putget.py | test_putget.py | from multiprocessing import Process, Queue
q = Queue()
iterations = 10000000
def produce(q):
for i in range(iterations):
q.put(i)
if __name__ == "__main__":
t = Process(target=produce, args=(q,))
t.start()
previous = -1
for i in range(iterations):
m = q.get()
if m !... | Add equivalent put/get test in python. | Add equivalent put/get test in python.
| Python | mit | abwilson/L3,abwilson/L3,tempbottle/L3,tempbottle/L3 | Add equivalent put/get test in python. | from multiprocessing import Process, Queue
q = Queue()
iterations = 10000000
def produce(q):
for i in range(iterations):
q.put(i)
if __name__ == "__main__":
t = Process(target=produce, args=(q,))
t.start()
previous = -1
for i in range(iterations):
m = q.get()
if m !... | <commit_before><commit_msg>Add equivalent put/get test in python.<commit_after> | from multiprocessing import Process, Queue
q = Queue()
iterations = 10000000
def produce(q):
for i in range(iterations):
q.put(i)
if __name__ == "__main__":
t = Process(target=produce, args=(q,))
t.start()
previous = -1
for i in range(iterations):
m = q.get()
if m !... | Add equivalent put/get test in python.from multiprocessing import Process, Queue
q = Queue()
iterations = 10000000
def produce(q):
for i in range(iterations):
q.put(i)
if __name__ == "__main__":
t = Process(target=produce, args=(q,))
t.start()
previous = -1
for i in range(iteration... | <commit_before><commit_msg>Add equivalent put/get test in python.<commit_after>from multiprocessing import Process, Queue
q = Queue()
iterations = 10000000
def produce(q):
for i in range(iterations):
q.put(i)
if __name__ == "__main__":
t = Process(target=produce, args=(q,))
t.start()
p... | |
5f912542a555621cd259265a5029ee4da15de972 | tests/utils.py | tests/utils.py | from django.contrib.sessions.middleware import SessionMiddleware
def add_session_to_request(request):
# Annotate a request object with a session.
middleware = SessionMiddleware()
middleware.process_request(request)
request.session.save()
return request
def setup_view(view, request, *args, **kwar... | Add test helpers! Yes, we've gotten this deep into it. | Add test helpers! Yes, we've gotten this deep into it.
| Python | apache-2.0 | hello-base/web,hello-base/web,hello-base/web,hello-base/web | Add test helpers! Yes, we've gotten this deep into it. | from django.contrib.sessions.middleware import SessionMiddleware
def add_session_to_request(request):
# Annotate a request object with a session.
middleware = SessionMiddleware()
middleware.process_request(request)
request.session.save()
return request
def setup_view(view, request, *args, **kwar... | <commit_before><commit_msg>Add test helpers! Yes, we've gotten this deep into it.<commit_after> | from django.contrib.sessions.middleware import SessionMiddleware
def add_session_to_request(request):
# Annotate a request object with a session.
middleware = SessionMiddleware()
middleware.process_request(request)
request.session.save()
return request
def setup_view(view, request, *args, **kwar... | Add test helpers! Yes, we've gotten this deep into it.from django.contrib.sessions.middleware import SessionMiddleware
def add_session_to_request(request):
# Annotate a request object with a session.
middleware = SessionMiddleware()
middleware.process_request(request)
request.session.save()
return... | <commit_before><commit_msg>Add test helpers! Yes, we've gotten this deep into it.<commit_after>from django.contrib.sessions.middleware import SessionMiddleware
def add_session_to_request(request):
# Annotate a request object with a session.
middleware = SessionMiddleware()
middleware.process_request(reque... | |
f305a445b0e018a4140d5e28cd0a68ba450e7d87 | tests/unit/test_default_semantic_action.py | tests/unit/test_default_semantic_action.py | # -*- coding: utf-8 -*-
#######################################################################
# Name: test_default_semantic_action
# Purpose: Default semantic action is applied during semantic analysis
# if no action is given for node type. Default action converts
# terminals to strings, remove St... | Test for default semantic action | Test for default semantic action
| Python | mit | leiyangyou/Arpeggio,leiyangyou/Arpeggio | Test for default semantic action | # -*- coding: utf-8 -*-
#######################################################################
# Name: test_default_semantic_action
# Purpose: Default semantic action is applied during semantic analysis
# if no action is given for node type. Default action converts
# terminals to strings, remove St... | <commit_before><commit_msg>Test for default semantic action<commit_after> | # -*- coding: utf-8 -*-
#######################################################################
# Name: test_default_semantic_action
# Purpose: Default semantic action is applied during semantic analysis
# if no action is given for node type. Default action converts
# terminals to strings, remove St... | Test for default semantic action# -*- coding: utf-8 -*-
#######################################################################
# Name: test_default_semantic_action
# Purpose: Default semantic action is applied during semantic analysis
# if no action is given for node type. Default action converts
# ... | <commit_before><commit_msg>Test for default semantic action<commit_after># -*- coding: utf-8 -*-
#######################################################################
# Name: test_default_semantic_action
# Purpose: Default semantic action is applied during semantic analysis
# if no action is given for node ... | |
46fa2821f988dded52ca6086db2beada3ea5eea3 | examples/set_explore_group_configuration.py | examples/set_explore_group_configuration.py | #!/usr/bin/env python
#
# Set the group configuration in explore.
#
import os
import sys
sys.path.insert(0, os.path.join(os.path.dirname(os.path.realpath(sys.argv[0])), '..'))
from sdcclient import SdcClient
#
# Parse arguments
#
if len(sys.argv) != 2:
print 'usage: %s <sysdig-token>' % sys.argv[0]
print 'You... | Set default explore group configuration for a user | Set default explore group configuration for a user
| Python | mit | draios/python-sdc-client,draios/python-sdc-client | Set default explore group configuration for a user | #!/usr/bin/env python
#
# Set the group configuration in explore.
#
import os
import sys
sys.path.insert(0, os.path.join(os.path.dirname(os.path.realpath(sys.argv[0])), '..'))
from sdcclient import SdcClient
#
# Parse arguments
#
if len(sys.argv) != 2:
print 'usage: %s <sysdig-token>' % sys.argv[0]
print 'You... | <commit_before><commit_msg>Set default explore group configuration for a user<commit_after> | #!/usr/bin/env python
#
# Set the group configuration in explore.
#
import os
import sys
sys.path.insert(0, os.path.join(os.path.dirname(os.path.realpath(sys.argv[0])), '..'))
from sdcclient import SdcClient
#
# Parse arguments
#
if len(sys.argv) != 2:
print 'usage: %s <sysdig-token>' % sys.argv[0]
print 'You... | Set default explore group configuration for a user#!/usr/bin/env python
#
# Set the group configuration in explore.
#
import os
import sys
sys.path.insert(0, os.path.join(os.path.dirname(os.path.realpath(sys.argv[0])), '..'))
from sdcclient import SdcClient
#
# Parse arguments
#
if len(sys.argv) != 2:
print 'usag... | <commit_before><commit_msg>Set default explore group configuration for a user<commit_after>#!/usr/bin/env python
#
# Set the group configuration in explore.
#
import os
import sys
sys.path.insert(0, os.path.join(os.path.dirname(os.path.realpath(sys.argv[0])), '..'))
from sdcclient import SdcClient
#
# Parse arguments... | |
e9e4d4af705c2c6785ddd63f5e6e94ef2e675a83 | tests/integration/modules/test_autoruns.py | tests/integration/modules/test_autoruns.py | # -*- coding: utf-8 -*-
# Import Python libs
from __future__ import absolute_import
# Import Salt Testing libs
from tests.support.case import ModuleCase
from tests.support.unit import skipIf
# Import Salt libs
import salt.utils
@skipIf(not salt.utils.is_windows(), 'windows tests only')
class AutoRunsModuleTest(Mod... | Add autoruns.list integration test for Windows | Add autoruns.list integration test for Windows
| Python | apache-2.0 | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | Add autoruns.list integration test for Windows | # -*- coding: utf-8 -*-
# Import Python libs
from __future__ import absolute_import
# Import Salt Testing libs
from tests.support.case import ModuleCase
from tests.support.unit import skipIf
# Import Salt libs
import salt.utils
@skipIf(not salt.utils.is_windows(), 'windows tests only')
class AutoRunsModuleTest(Mod... | <commit_before><commit_msg>Add autoruns.list integration test for Windows<commit_after> | # -*- coding: utf-8 -*-
# Import Python libs
from __future__ import absolute_import
# Import Salt Testing libs
from tests.support.case import ModuleCase
from tests.support.unit import skipIf
# Import Salt libs
import salt.utils
@skipIf(not salt.utils.is_windows(), 'windows tests only')
class AutoRunsModuleTest(Mod... | Add autoruns.list integration test for Windows# -*- coding: utf-8 -*-
# Import Python libs
from __future__ import absolute_import
# Import Salt Testing libs
from tests.support.case import ModuleCase
from tests.support.unit import skipIf
# Import Salt libs
import salt.utils
@skipIf(not salt.utils.is_windows(), 'win... | <commit_before><commit_msg>Add autoruns.list integration test for Windows<commit_after># -*- coding: utf-8 -*-
# Import Python libs
from __future__ import absolute_import
# Import Salt Testing libs
from tests.support.case import ModuleCase
from tests.support.unit import skipIf
# Import Salt libs
import salt.utils
... | |
4f66b1662f3b4513bc3ea2eb3d684fc9b60fa9b3 | bidb/utils/subprocess.py | bidb/utils/subprocess.py | from __future__ import absolute_import
import subprocess
def check_output2(args, stdin=None):
p = subprocess.Popen(
args,
stdout=subprocess.PIPE,
stdin=subprocess.PIPE,
stderr=subprocess.STDOUT,
)
out, _ = p.communicate(input=stdin)
retcode = p.wait()
if retcode:... | Add our own check_output2 wrapper | Add our own check_output2 wrapper
Signed-off-by: Chris Lamb <[email protected]>
| Python | agpl-3.0 | lamby/buildinfo.debian.net,lamby/buildinfo.debian.net | Add our own check_output2 wrapper
Signed-off-by: Chris Lamb <[email protected]> | from __future__ import absolute_import
import subprocess
def check_output2(args, stdin=None):
p = subprocess.Popen(
args,
stdout=subprocess.PIPE,
stdin=subprocess.PIPE,
stderr=subprocess.STDOUT,
)
out, _ = p.communicate(input=stdin)
retcode = p.wait()
if retcode:... | <commit_before><commit_msg>Add our own check_output2 wrapper
Signed-off-by: Chris Lamb <[email protected]><commit_after> | from __future__ import absolute_import
import subprocess
def check_output2(args, stdin=None):
p = subprocess.Popen(
args,
stdout=subprocess.PIPE,
stdin=subprocess.PIPE,
stderr=subprocess.STDOUT,
)
out, _ = p.communicate(input=stdin)
retcode = p.wait()
if retcode:... | Add our own check_output2 wrapper
Signed-off-by: Chris Lamb <[email protected]>from __future__ import absolute_import
import subprocess
def check_output2(args, stdin=None):
p = subprocess.Popen(
args,
stdout=subprocess.PIPE,
stdin=subprocess.PIPE,
... | <commit_before><commit_msg>Add our own check_output2 wrapper
Signed-off-by: Chris Lamb <[email protected]><commit_after>from __future__ import absolute_import
import subprocess
def check_output2(args, stdin=None):
p = subprocess.Popen(
args,
stdout=subprocess.PIP... | |
e262a10e9a0027e8126032551cae8b6c0816ff22 | build/extra_gitignore.py | build/extra_gitignore.py | #!/usr/bin/env python
# Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All c... | Add script for appending entries to .gitignore. | Add script for appending entries to .gitignore.
TBR=kjellander
Review URL: https://webrtc-codereview.appspot.com/1629004
Cr-Mirrored-From: https://chromium.googlesource.com/external/webrtc
Cr-Mirrored-Commit: b69cc15467456a070333ff00f886f27ca391b85b
| Python | bsd-3-clause | sippet/webrtc,sippet/webrtc,sippet/webrtc,sippet/webrtc,sippet/webrtc,sippet/webrtc | Add script for appending entries to .gitignore.
TBR=kjellander
Review URL: https://webrtc-codereview.appspot.com/1629004
Cr-Mirrored-From: https://chromium.googlesource.com/external/webrtc
Cr-Mirrored-Commit: b69cc15467456a070333ff00f886f27ca391b85b | #!/usr/bin/env python
# Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All c... | <commit_before><commit_msg>Add script for appending entries to .gitignore.
TBR=kjellander
Review URL: https://webrtc-codereview.appspot.com/1629004
Cr-Mirrored-From: https://chromium.googlesource.com/external/webrtc
Cr-Mirrored-Commit: b69cc15467456a070333ff00f886f27ca391b85b<commit_after> | #!/usr/bin/env python
# Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All c... | Add script for appending entries to .gitignore.
TBR=kjellander
Review URL: https://webrtc-codereview.appspot.com/1629004
Cr-Mirrored-From: https://chromium.googlesource.com/external/webrtc
Cr-Mirrored-Commit: b69cc15467456a070333ff00f886f27ca391b85b#!/usr/bin/env python
# Copyright (c) 2012 The WebRTC project author... | <commit_before><commit_msg>Add script for appending entries to .gitignore.
TBR=kjellander
Review URL: https://webrtc-codereview.appspot.com/1629004
Cr-Mirrored-From: https://chromium.googlesource.com/external/webrtc
Cr-Mirrored-Commit: b69cc15467456a070333ff00f886f27ca391b85b<commit_after>#!/usr/bin/env python
# Cop... | |
ea4a77d171e818dede62978ced6a4f1b1b5a2d51 | mzalendo/core/kenya_import_scripts/import_constituency_county_map.py | mzalendo/core/kenya_import_scripts/import_constituency_county_map.py | # Takes Paul's Excel file of constituencies to counties and
# imports this into the db.
import sys
import os
os.environ['DJANGO_SETTINGS_MODULE'] = 'mzalendo.settings'
import csv
from django.template.defaultfilters import slugify
# Horrible boilerplate - there must be a better way :)
sys.path.append(
os.path.a... | Add script to sort out counties as constituency parent places. | Add script to sort out counties as constituency parent places.
| Python | agpl-3.0 | mysociety/pombola,geoffkilpin/pombola,Hutspace/odekro,hzj123/56th,mysociety/pombola,hzj123/56th,ken-muturi/pombola,hzj123/56th,patricmutwiri/pombola,geoffkilpin/pombola,Hutspace/odekro,patricmutwiri/pombola,mysociety/pombola,patricmutwiri/pombola,ken-muturi/pombola,patricmutwiri/pombola,Hutspace/odekro,geoffkilpin/pomb... | Add script to sort out counties as constituency parent places. | # Takes Paul's Excel file of constituencies to counties and
# imports this into the db.
import sys
import os
os.environ['DJANGO_SETTINGS_MODULE'] = 'mzalendo.settings'
import csv
from django.template.defaultfilters import slugify
# Horrible boilerplate - there must be a better way :)
sys.path.append(
os.path.a... | <commit_before><commit_msg>Add script to sort out counties as constituency parent places.<commit_after> | # Takes Paul's Excel file of constituencies to counties and
# imports this into the db.
import sys
import os
os.environ['DJANGO_SETTINGS_MODULE'] = 'mzalendo.settings'
import csv
from django.template.defaultfilters import slugify
# Horrible boilerplate - there must be a better way :)
sys.path.append(
os.path.a... | Add script to sort out counties as constituency parent places.# Takes Paul's Excel file of constituencies to counties and
# imports this into the db.
import sys
import os
os.environ['DJANGO_SETTINGS_MODULE'] = 'mzalendo.settings'
import csv
from django.template.defaultfilters import slugify
# Horrible boilerplate ... | <commit_before><commit_msg>Add script to sort out counties as constituency parent places.<commit_after># Takes Paul's Excel file of constituencies to counties and
# imports this into the db.
import sys
import os
os.environ['DJANGO_SETTINGS_MODULE'] = 'mzalendo.settings'
import csv
from django.template.defaultfilter... | |
b7e2391e6627d7884be7def6af9f78a2184ec484 | Snippets/cmap-format.py | Snippets/cmap-format.py | #! /usr/bin/env python
# Sample script to convert legacy cmap subtables to format-4
# subtables. Note that this is rarely what one needs. You
# probably need to just drop the legacy subtables if the font
# already has a format-4 subtable.
#
# Other times, you would need to convert a non-Unicode cmap
# legacy subtabl... | Add script for cmap subtable format conversion | [Snippets] Add script for cmap subtable format conversion
Fixes https://github.com/behdad/fonttools/issues/340
| Python | mit | fonttools/fonttools,googlefonts/fonttools | [Snippets] Add script for cmap subtable format conversion
Fixes https://github.com/behdad/fonttools/issues/340 | #! /usr/bin/env python
# Sample script to convert legacy cmap subtables to format-4
# subtables. Note that this is rarely what one needs. You
# probably need to just drop the legacy subtables if the font
# already has a format-4 subtable.
#
# Other times, you would need to convert a non-Unicode cmap
# legacy subtabl... | <commit_before><commit_msg>[Snippets] Add script for cmap subtable format conversion
Fixes https://github.com/behdad/fonttools/issues/340<commit_after> | #! /usr/bin/env python
# Sample script to convert legacy cmap subtables to format-4
# subtables. Note that this is rarely what one needs. You
# probably need to just drop the legacy subtables if the font
# already has a format-4 subtable.
#
# Other times, you would need to convert a non-Unicode cmap
# legacy subtabl... | [Snippets] Add script for cmap subtable format conversion
Fixes https://github.com/behdad/fonttools/issues/340#! /usr/bin/env python
# Sample script to convert legacy cmap subtables to format-4
# subtables. Note that this is rarely what one needs. You
# probably need to just drop the legacy subtables if the font
# ... | <commit_before><commit_msg>[Snippets] Add script for cmap subtable format conversion
Fixes https://github.com/behdad/fonttools/issues/340<commit_after>#! /usr/bin/env python
# Sample script to convert legacy cmap subtables to format-4
# subtables. Note that this is rarely what one needs. You
# probably need to just... | |
721565636b84a1a2bf7d2c89cca2b8206b6530a2 | recipe-server/normandy/recipes/migrations/0046_reset_signatures.py | recipe-server/normandy/recipes/migrations/0046_reset_signatures.py | """
Removes signatures, so they can be easily recreated during deployment.
This migration is intended to be used between "eras" of signatures. As
the serialization format of recipes changes, the signatures need to
also change. This could be handled automatically, but it is easier to
deploy if we just remove everything... | Add another signature reset migration. | recipe-server: Add another signature reset migration.
| Python | mpl-2.0 | mozilla/normandy,mozilla/normandy,mozilla/normandy,mozilla/normandy | recipe-server: Add another signature reset migration. | """
Removes signatures, so they can be easily recreated during deployment.
This migration is intended to be used between "eras" of signatures. As
the serialization format of recipes changes, the signatures need to
also change. This could be handled automatically, but it is easier to
deploy if we just remove everything... | <commit_before><commit_msg>recipe-server: Add another signature reset migration.<commit_after> | """
Removes signatures, so they can be easily recreated during deployment.
This migration is intended to be used between "eras" of signatures. As
the serialization format of recipes changes, the signatures need to
also change. This could be handled automatically, but it is easier to
deploy if we just remove everything... | recipe-server: Add another signature reset migration."""
Removes signatures, so they can be easily recreated during deployment.
This migration is intended to be used between "eras" of signatures. As
the serialization format of recipes changes, the signatures need to
also change. This could be handled automatically, bu... | <commit_before><commit_msg>recipe-server: Add another signature reset migration.<commit_after>"""
Removes signatures, so they can be easily recreated during deployment.
This migration is intended to be used between "eras" of signatures. As
the serialization format of recipes changes, the signatures need to
also change... | |
d98d4b41c2ecab5a61f975e1b23b8e06709d4d3f | registries/serializers.py | registries/serializers.py | from rest_framework import serializers
from registries.models import Organization
from gwells.models import ProvinceState
class DrillerListSerializer(serializers.ModelSerializer):
province_state = serializers.ReadOnlyField()
class Meta:
model = Organization
# Using all fields for now
... | Add simple driller list serializer | Add simple driller list serializer
| Python | apache-2.0 | rstens/gwells,bcgov/gwells,rstens/gwells,rstens/gwells,rstens/gwells,bcgov/gwells,bcgov/gwells,bcgov/gwells | Add simple driller list serializer | from rest_framework import serializers
from registries.models import Organization
from gwells.models import ProvinceState
class DrillerListSerializer(serializers.ModelSerializer):
province_state = serializers.ReadOnlyField()
class Meta:
model = Organization
# Using all fields for now
... | <commit_before><commit_msg>Add simple driller list serializer<commit_after> | from rest_framework import serializers
from registries.models import Organization
from gwells.models import ProvinceState
class DrillerListSerializer(serializers.ModelSerializer):
province_state = serializers.ReadOnlyField()
class Meta:
model = Organization
# Using all fields for now
... | Add simple driller list serializerfrom rest_framework import serializers
from registries.models import Organization
from gwells.models import ProvinceState
class DrillerListSerializer(serializers.ModelSerializer):
province_state = serializers.ReadOnlyField()
class Meta:
model = Organization
#... | <commit_before><commit_msg>Add simple driller list serializer<commit_after>from rest_framework import serializers
from registries.models import Organization
from gwells.models import ProvinceState
class DrillerListSerializer(serializers.ModelSerializer):
province_state = serializers.ReadOnlyField()
class Meta... | |
452282391f356366d208bd408e5d9b7315b6d98d | polygraph/types/tests/test_input_object.py | polygraph/types/tests/test_input_object.py | from unittest import TestCase
from polygraph.exceptions import PolygraphSchemaError
from polygraph.types.input_object import (
InputObject,
InputValue,
validate_input_object_schema,
)
from polygraph.types.lazy_type import LazyType
from polygraph.types.scalar import String
from polygraph.types.tests.helper ... | Add unit tests around InputObject | Add unit tests around InputObject
| Python | mit | polygraph-python/polygraph | Add unit tests around InputObject | from unittest import TestCase
from polygraph.exceptions import PolygraphSchemaError
from polygraph.types.input_object import (
InputObject,
InputValue,
validate_input_object_schema,
)
from polygraph.types.lazy_type import LazyType
from polygraph.types.scalar import String
from polygraph.types.tests.helper ... | <commit_before><commit_msg>Add unit tests around InputObject<commit_after> | from unittest import TestCase
from polygraph.exceptions import PolygraphSchemaError
from polygraph.types.input_object import (
InputObject,
InputValue,
validate_input_object_schema,
)
from polygraph.types.lazy_type import LazyType
from polygraph.types.scalar import String
from polygraph.types.tests.helper ... | Add unit tests around InputObjectfrom unittest import TestCase
from polygraph.exceptions import PolygraphSchemaError
from polygraph.types.input_object import (
InputObject,
InputValue,
validate_input_object_schema,
)
from polygraph.types.lazy_type import LazyType
from polygraph.types.scalar import String
f... | <commit_before><commit_msg>Add unit tests around InputObject<commit_after>from unittest import TestCase
from polygraph.exceptions import PolygraphSchemaError
from polygraph.types.input_object import (
InputObject,
InputValue,
validate_input_object_schema,
)
from polygraph.types.lazy_type import LazyType
fr... | |
10ddce342da23c3702c1c0def4534d37cf6769b7 | tests/test_threading.py | tests/test_threading.py | from unittest import TestCase
from pydatajson.threading_helper import apply_threading
class ThreadingTests(TestCase):
def test_threading(self):
elements = [1, 2, 3, 4]
def function(x):
return x ** 2
result = apply_threading(elements, function, 3)
self.assertEqual(r... | Test case que pase por threading | Test case que pase por threading
| Python | mit | datosgobar/pydatajson,datosgobar/pydatajson | Test case que pase por threading | from unittest import TestCase
from pydatajson.threading_helper import apply_threading
class ThreadingTests(TestCase):
def test_threading(self):
elements = [1, 2, 3, 4]
def function(x):
return x ** 2
result = apply_threading(elements, function, 3)
self.assertEqual(r... | <commit_before><commit_msg>Test case que pase por threading<commit_after> | from unittest import TestCase
from pydatajson.threading_helper import apply_threading
class ThreadingTests(TestCase):
def test_threading(self):
elements = [1, 2, 3, 4]
def function(x):
return x ** 2
result = apply_threading(elements, function, 3)
self.assertEqual(r... | Test case que pase por threadingfrom unittest import TestCase
from pydatajson.threading_helper import apply_threading
class ThreadingTests(TestCase):
def test_threading(self):
elements = [1, 2, 3, 4]
def function(x):
return x ** 2
result = apply_threading(elements, function... | <commit_before><commit_msg>Test case que pase por threading<commit_after>from unittest import TestCase
from pydatajson.threading_helper import apply_threading
class ThreadingTests(TestCase):
def test_threading(self):
elements = [1, 2, 3, 4]
def function(x):
return x ** 2
re... | |
4871896765889576eb0ef2c97d94810f50ffe9d4 | datasciencebox/tests/salt/test_mesos.py | datasciencebox/tests/salt/test_mesos.py | import pytest
import requests
import utils
def setup_module(module):
utils.invoke('install', 'mesos')
@utils.vagranttest
def test_salt_formulas():
project = utils.get_test_project()
kwargs = {'test': 'true', '--out': 'json', '--out-indent': '-1'}
out = project.salt('state.sls', args=['cdh5.zookee... | Add basic tests for mesos | Add basic tests for mesos
| Python | apache-2.0 | danielfrg/datasciencebox,danielfrg/datasciencebox,danielfrg/datasciencebox,danielfrg/datasciencebox | Add basic tests for mesos | import pytest
import requests
import utils
def setup_module(module):
utils.invoke('install', 'mesos')
@utils.vagranttest
def test_salt_formulas():
project = utils.get_test_project()
kwargs = {'test': 'true', '--out': 'json', '--out-indent': '-1'}
out = project.salt('state.sls', args=['cdh5.zookee... | <commit_before><commit_msg>Add basic tests for mesos<commit_after> | import pytest
import requests
import utils
def setup_module(module):
utils.invoke('install', 'mesos')
@utils.vagranttest
def test_salt_formulas():
project = utils.get_test_project()
kwargs = {'test': 'true', '--out': 'json', '--out-indent': '-1'}
out = project.salt('state.sls', args=['cdh5.zookee... | Add basic tests for mesosimport pytest
import requests
import utils
def setup_module(module):
utils.invoke('install', 'mesos')
@utils.vagranttest
def test_salt_formulas():
project = utils.get_test_project()
kwargs = {'test': 'true', '--out': 'json', '--out-indent': '-1'}
out = project.salt('state... | <commit_before><commit_msg>Add basic tests for mesos<commit_after>import pytest
import requests
import utils
def setup_module(module):
utils.invoke('install', 'mesos')
@utils.vagranttest
def test_salt_formulas():
project = utils.get_test_project()
kwargs = {'test': 'true', '--out': 'json', '--out-ind... | |
a6a701778d615f57be78db494c6adfed10d55c9f | tools/dartium/download_multivm.py | tools/dartium/download_multivm.py | #!/usr/bin/python
# Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
"""Download archived multivm or dartium builds.
Usage: download_multivm.py revision ... | Add multivm archive download script for buildbot use. | Add multivm archive download script for buildbot use.
BUG=
[email protected]
Review URL: https://codereview.chromium.org//291153010
git-svn-id: c93d8a2297af3b929165606efe145742a534bc71@36513 260f80e4-7a28-3924-810f-c04153c831b5
| Python | bsd-3-clause | dartino/dart-sdk,dart-lang/sdk,dartino/dart-sdk,dart-lang/sdk,dart-archive/dart-sdk,dart-archive/dart-sdk,dart-archive/dart-sdk,dart-archive/dart-sdk,dart-archive/dart-sdk,dartino/dart-sdk,dart-lang/sdk,dart-lang/sdk,dartino/dart-sdk,dart-lang/sdk,dartino/dart-sdk,dart-archive/dart-sdk,dart-lang/sdk,dartino/dart-sdk,da... | Add multivm archive download script for buildbot use.
BUG=
[email protected]
Review URL: https://codereview.chromium.org//291153010
git-svn-id: c93d8a2297af3b929165606efe145742a534bc71@36513 260f80e4-7a28-3924-810f-c04153c831b5 | #!/usr/bin/python
# Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
"""Download archived multivm or dartium builds.
Usage: download_multivm.py revision ... | <commit_before><commit_msg>Add multivm archive download script for buildbot use.
BUG=
[email protected]
Review URL: https://codereview.chromium.org//291153010
git-svn-id: c93d8a2297af3b929165606efe145742a534bc71@36513 260f80e4-7a28-3924-810f-c04153c831b5<commit_after> | #!/usr/bin/python
# Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
"""Download archived multivm or dartium builds.
Usage: download_multivm.py revision ... | Add multivm archive download script for buildbot use.
BUG=
[email protected]
Review URL: https://codereview.chromium.org//291153010
git-svn-id: c93d8a2297af3b929165606efe145742a534bc71@36513 260f80e4-7a28-3924-810f-c04153c831b5#!/usr/bin/python
# Copyright (c) 2014, the Dart project authors. Please see the AUTHOR... | <commit_before><commit_msg>Add multivm archive download script for buildbot use.
BUG=
[email protected]
Review URL: https://codereview.chromium.org//291153010
git-svn-id: c93d8a2297af3b929165606efe145742a534bc71@36513 260f80e4-7a28-3924-810f-c04153c831b5<commit_after>#!/usr/bin/python
# Copyright (c) 2014, the Dar... | |
8b5163b3048f73af86b736f2285408d39698923f | create_output_folders.py | create_output_folders.py | import logging
import os
from settings import CONVERSIONS, LOGGING_FORMAT, OUTPUT_PATH
logger = logging.getLogger(__name__)
def main():
"""
Create the output folder for each of the conversion types.
"""
for xsl_file_name, output_folder, checker in CONVERSIONS:
# Get the conversion output folder.
output_pa... | Add output folder creation script | Add output folder creation script
| Python | mit | AustralianAntarcticDataCentre/metadata_xml_convert,AustralianAntarcticDataCentre/metadata_xml_convert | Add output folder creation script | import logging
import os
from settings import CONVERSIONS, LOGGING_FORMAT, OUTPUT_PATH
logger = logging.getLogger(__name__)
def main():
"""
Create the output folder for each of the conversion types.
"""
for xsl_file_name, output_folder, checker in CONVERSIONS:
# Get the conversion output folder.
output_pa... | <commit_before><commit_msg>Add output folder creation script<commit_after> | import logging
import os
from settings import CONVERSIONS, LOGGING_FORMAT, OUTPUT_PATH
logger = logging.getLogger(__name__)
def main():
"""
Create the output folder for each of the conversion types.
"""
for xsl_file_name, output_folder, checker in CONVERSIONS:
# Get the conversion output folder.
output_pa... | Add output folder creation scriptimport logging
import os
from settings import CONVERSIONS, LOGGING_FORMAT, OUTPUT_PATH
logger = logging.getLogger(__name__)
def main():
"""
Create the output folder for each of the conversion types.
"""
for xsl_file_name, output_folder, checker in CONVERSIONS:
# Get the conv... | <commit_before><commit_msg>Add output folder creation script<commit_after>import logging
import os
from settings import CONVERSIONS, LOGGING_FORMAT, OUTPUT_PATH
logger = logging.getLogger(__name__)
def main():
"""
Create the output folder for each of the conversion types.
"""
for xsl_file_name, output_folder,... | |
cc201158ebaa2d3e6fc75bc3e9a56ef10ba5a28a | test/time_relight.py | test/time_relight.py | import mclevel
from timeit import timeit
#import logging
#logging.basicConfig(level=logging.INFO)
path = "testfiles\\AnvilWorld"
world = mclevel.fromFile(path)
print "Relight: %d chunks in %.02f seconds" % (world.chunkCount, timeit(lambda: world.generateLights(world.allChunks), number=1))
| Add test to measure time taken for level.generateLights | Debug: Add test to measure time taken for level.generateLights
| Python | isc | mcedit/pymclevel,mcedit/pymclevel,ahh2131/mchisel,ahh2131/mchisel,arruda/pymclevel,arruda/pymclevel | Debug: Add test to measure time taken for level.generateLights | import mclevel
from timeit import timeit
#import logging
#logging.basicConfig(level=logging.INFO)
path = "testfiles\\AnvilWorld"
world = mclevel.fromFile(path)
print "Relight: %d chunks in %.02f seconds" % (world.chunkCount, timeit(lambda: world.generateLights(world.allChunks), number=1))
| <commit_before><commit_msg>Debug: Add test to measure time taken for level.generateLights<commit_after> | import mclevel
from timeit import timeit
#import logging
#logging.basicConfig(level=logging.INFO)
path = "testfiles\\AnvilWorld"
world = mclevel.fromFile(path)
print "Relight: %d chunks in %.02f seconds" % (world.chunkCount, timeit(lambda: world.generateLights(world.allChunks), number=1))
| Debug: Add test to measure time taken for level.generateLightsimport mclevel
from timeit import timeit
#import logging
#logging.basicConfig(level=logging.INFO)
path = "testfiles\\AnvilWorld"
world = mclevel.fromFile(path)
print "Relight: %d chunks in %.02f seconds" % (world.chunkCount, timeit(lambda: world.generateL... | <commit_before><commit_msg>Debug: Add test to measure time taken for level.generateLights<commit_after>import mclevel
from timeit import timeit
#import logging
#logging.basicConfig(level=logging.INFO)
path = "testfiles\\AnvilWorld"
world = mclevel.fromFile(path)
print "Relight: %d chunks in %.02f seconds" % (world.c... | |
e6168d3c73c6de591d2f7646c71cde27f66578ac | a3/visualize.py | a3/visualize.py | import seaborn as sns
from .utils import get_path
class Visualizer(object):
"""
Visualize training and validation loss
"""
@classmethod
def visualize_training(cls, tr, savefig=None, show=False):
sns.plt.plot(tr.data.Epoch.tolist(), tr.data["Training Loss"].tolist(), label="Training Loss")
... | Add barebones visualization of loss | Add barebones visualization of loss
| Python | apache-2.0 | arizona-phonological-imaging-lab/autotres,arizona-phonological-imaging-lab/autotres | Add barebones visualization of loss | import seaborn as sns
from .utils import get_path
class Visualizer(object):
"""
Visualize training and validation loss
"""
@classmethod
def visualize_training(cls, tr, savefig=None, show=False):
sns.plt.plot(tr.data.Epoch.tolist(), tr.data["Training Loss"].tolist(), label="Training Loss")
... | <commit_before><commit_msg>Add barebones visualization of loss<commit_after> | import seaborn as sns
from .utils import get_path
class Visualizer(object):
"""
Visualize training and validation loss
"""
@classmethod
def visualize_training(cls, tr, savefig=None, show=False):
sns.plt.plot(tr.data.Epoch.tolist(), tr.data["Training Loss"].tolist(), label="Training Loss")
... | Add barebones visualization of lossimport seaborn as sns
from .utils import get_path
class Visualizer(object):
"""
Visualize training and validation loss
"""
@classmethod
def visualize_training(cls, tr, savefig=None, show=False):
sns.plt.plot(tr.data.Epoch.tolist(), tr.data["Training Loss"... | <commit_before><commit_msg>Add barebones visualization of loss<commit_after>import seaborn as sns
from .utils import get_path
class Visualizer(object):
"""
Visualize training and validation loss
"""
@classmethod
def visualize_training(cls, tr, savefig=None, show=False):
sns.plt.plot(tr.dat... | |
9124f1cf2bc02e39cd215a465d1680f6a4fdd696 | ObjectTracking/streamer.py | ObjectTracking/streamer.py | from SimpleCV import *
import time
import serial
cam = JpegStreamCamera('http://192.168.1.6:8080/videofeed')
disp=Display()
ser=serial.Serial('/dev/ttyACM2', 9600)
alpha = 0.8
time.sleep(1)
previous_z = 200;
while True:
img = cam.getImage()
myLayer = DrawingLayer((img.width,img.height))
disk_img = img.hueD... | Use to make close loop test on single axis | Use to make close loop test on single axis
| Python | mit | baptistelabat/robokite,baptistelabat/robokite,baptistelabat/robokite,baptistelabat/robokite,baptistelabat/robokite,baptistelabat/robokite,baptistelabat/robokite,baptistelabat/robokite | Use to make close loop test on single axis | from SimpleCV import *
import time
import serial
cam = JpegStreamCamera('http://192.168.1.6:8080/videofeed')
disp=Display()
ser=serial.Serial('/dev/ttyACM2', 9600)
alpha = 0.8
time.sleep(1)
previous_z = 200;
while True:
img = cam.getImage()
myLayer = DrawingLayer((img.width,img.height))
disk_img = img.hueD... | <commit_before><commit_msg>Use to make close loop test on single axis<commit_after> | from SimpleCV import *
import time
import serial
cam = JpegStreamCamera('http://192.168.1.6:8080/videofeed')
disp=Display()
ser=serial.Serial('/dev/ttyACM2', 9600)
alpha = 0.8
time.sleep(1)
previous_z = 200;
while True:
img = cam.getImage()
myLayer = DrawingLayer((img.width,img.height))
disk_img = img.hueD... | Use to make close loop test on single axisfrom SimpleCV import *
import time
import serial
cam = JpegStreamCamera('http://192.168.1.6:8080/videofeed')
disp=Display()
ser=serial.Serial('/dev/ttyACM2', 9600)
alpha = 0.8
time.sleep(1)
previous_z = 200;
while True:
img = cam.getImage()
myLayer = DrawingLayer((img.... | <commit_before><commit_msg>Use to make close loop test on single axis<commit_after>from SimpleCV import *
import time
import serial
cam = JpegStreamCamera('http://192.168.1.6:8080/videofeed')
disp=Display()
ser=serial.Serial('/dev/ttyACM2', 9600)
alpha = 0.8
time.sleep(1)
previous_z = 200;
while True:
img = cam.ge... | |
8bdc8418b0093c44947022d3649593f77c471fea | tests/test_compat.py | tests/test_compat.py | from auth_tkt import compat
from unittest import TestCase
class Base64DecodeTestCase(TestCase):
def test_returns_decoded_string(self):
self.assertEqual(
compat.base64decode('ZGVjb2RlZA=='), 'decoded')
class Base64EncodeTestCase(TestCase):
def test_encodes_passed_string(self):
s... | Add tests for compat module | Add tests for compat module
| Python | mit | yola/auth_tkt | Add tests for compat module | from auth_tkt import compat
from unittest import TestCase
class Base64DecodeTestCase(TestCase):
def test_returns_decoded_string(self):
self.assertEqual(
compat.base64decode('ZGVjb2RlZA=='), 'decoded')
class Base64EncodeTestCase(TestCase):
def test_encodes_passed_string(self):
s... | <commit_before><commit_msg>Add tests for compat module<commit_after> | from auth_tkt import compat
from unittest import TestCase
class Base64DecodeTestCase(TestCase):
def test_returns_decoded_string(self):
self.assertEqual(
compat.base64decode('ZGVjb2RlZA=='), 'decoded')
class Base64EncodeTestCase(TestCase):
def test_encodes_passed_string(self):
s... | Add tests for compat modulefrom auth_tkt import compat
from unittest import TestCase
class Base64DecodeTestCase(TestCase):
def test_returns_decoded_string(self):
self.assertEqual(
compat.base64decode('ZGVjb2RlZA=='), 'decoded')
class Base64EncodeTestCase(TestCase):
def test_encodes_pas... | <commit_before><commit_msg>Add tests for compat module<commit_after>from auth_tkt import compat
from unittest import TestCase
class Base64DecodeTestCase(TestCase):
def test_returns_decoded_string(self):
self.assertEqual(
compat.base64decode('ZGVjb2RlZA=='), 'decoded')
class Base64EncodeTest... | |
8509659e77b63f2467b0b98064433e083ac32187 | tinman/transforms.py | tinman/transforms.py | """
Tornado Output Transforming Classes
"""
from tornado import web
class StripBlankLines(web.OutputTransform):
def transform_first_chunk(self, status_code, headers, chunk, finishing):
content_type = headers.get("Content-Type", "").split(";")[0]
if content_type.split('/')[0] == 'text':
... | Add a blank line stripping transform | Add a blank line stripping transform
| Python | bsd-3-clause | gmr/tinman,lucius-feng/tinman,lucius-feng/tinman,lucius-feng/tinman,gmr/tinman | Add a blank line stripping transform | """
Tornado Output Transforming Classes
"""
from tornado import web
class StripBlankLines(web.OutputTransform):
def transform_first_chunk(self, status_code, headers, chunk, finishing):
content_type = headers.get("Content-Type", "").split(";")[0]
if content_type.split('/')[0] == 'text':
... | <commit_before><commit_msg>Add a blank line stripping transform<commit_after> | """
Tornado Output Transforming Classes
"""
from tornado import web
class StripBlankLines(web.OutputTransform):
def transform_first_chunk(self, status_code, headers, chunk, finishing):
content_type = headers.get("Content-Type", "").split(";")[0]
if content_type.split('/')[0] == 'text':
... | Add a blank line stripping transform"""
Tornado Output Transforming Classes
"""
from tornado import web
class StripBlankLines(web.OutputTransform):
def transform_first_chunk(self, status_code, headers, chunk, finishing):
content_type = headers.get("Content-Type", "").split(";")[0]
if content_typ... | <commit_before><commit_msg>Add a blank line stripping transform<commit_after>"""
Tornado Output Transforming Classes
"""
from tornado import web
class StripBlankLines(web.OutputTransform):
def transform_first_chunk(self, status_code, headers, chunk, finishing):
content_type = headers.get("Content-Type",... | |
d2546864c9c0579b68050ade87a440f392aa6e27 | class_hierarchy.py | class_hierarchy.py |
SIZES = {'small', 'medium', 'insanely massive'}
class PhysicalThing(object):
""" Base class for physical object
"""
def __init__(self, *args, **kwargs):
""" Validate and set attrs
"""
size = kwargs.pop('size', None)
if size and size not in SIZES:
raise ValueError('Invalid size!')
sel... | Add class hierarchy w multiple inheritance | Add class hierarchy w multiple inheritance
| Python | mit | oldhill/halloween,oldhill/halloween,oldhill/halloween,oldhill/halloween | Add class hierarchy w multiple inheritance |
SIZES = {'small', 'medium', 'insanely massive'}
class PhysicalThing(object):
""" Base class for physical object
"""
def __init__(self, *args, **kwargs):
""" Validate and set attrs
"""
size = kwargs.pop('size', None)
if size and size not in SIZES:
raise ValueError('Invalid size!')
sel... | <commit_before><commit_msg>Add class hierarchy w multiple inheritance<commit_after> |
SIZES = {'small', 'medium', 'insanely massive'}
class PhysicalThing(object):
""" Base class for physical object
"""
def __init__(self, *args, **kwargs):
""" Validate and set attrs
"""
size = kwargs.pop('size', None)
if size and size not in SIZES:
raise ValueError('Invalid size!')
sel... | Add class hierarchy w multiple inheritance
SIZES = {'small', 'medium', 'insanely massive'}
class PhysicalThing(object):
""" Base class for physical object
"""
def __init__(self, *args, **kwargs):
""" Validate and set attrs
"""
size = kwargs.pop('size', None)
if size and size not in SIZES:
... | <commit_before><commit_msg>Add class hierarchy w multiple inheritance<commit_after>
SIZES = {'small', 'medium', 'insanely massive'}
class PhysicalThing(object):
""" Base class for physical object
"""
def __init__(self, *args, **kwargs):
""" Validate and set attrs
"""
size = kwargs.pop('size', None)... | |
df7c5c2def8341d73a109426d5289b2e705995ca | ceph_deploy/tests/parser/test_calamari.py | ceph_deploy/tests/parser/test_calamari.py | import pytest
from ceph_deploy.cli import get_parser
class TestParserCalamari(object):
def setup(self):
self.parser = get_parser()
def test_calamari_help(self, capsys):
with pytest.raises(SystemExit):
self.parser.parse_args('calamari --help'.split())
out, err = capsys.re... | Add argparse tests for ceph-deploy calamari | [RM-11742] Add argparse tests for ceph-deploy calamari
Signed-off-by: Travis Rhoden <[email protected]>
| Python | mit | osynge/ceph-deploy,shenhequnying/ceph-deploy,SUSE/ceph-deploy-to-be-deleted,isyippee/ceph-deploy,ghxandsky/ceph-deploy,shenhequnying/ceph-deploy,imzhulei/ceph-deploy,SUSE/ceph-deploy-to-be-deleted,imzhulei/ceph-deploy,Vicente-Cheng/ceph-deploy,ceph/ceph-deploy,osynge/ceph-deploy,zhouyuan/ceph-deploy,branto1/ceph-deploy... | [RM-11742] Add argparse tests for ceph-deploy calamari
Signed-off-by: Travis Rhoden <[email protected]> | import pytest
from ceph_deploy.cli import get_parser
class TestParserCalamari(object):
def setup(self):
self.parser = get_parser()
def test_calamari_help(self, capsys):
with pytest.raises(SystemExit):
self.parser.parse_args('calamari --help'.split())
out, err = capsys.re... | <commit_before><commit_msg>[RM-11742] Add argparse tests for ceph-deploy calamari
Signed-off-by: Travis Rhoden <[email protected]><commit_after> | import pytest
from ceph_deploy.cli import get_parser
class TestParserCalamari(object):
def setup(self):
self.parser = get_parser()
def test_calamari_help(self, capsys):
with pytest.raises(SystemExit):
self.parser.parse_args('calamari --help'.split())
out, err = capsys.re... | [RM-11742] Add argparse tests for ceph-deploy calamari
Signed-off-by: Travis Rhoden <[email protected]>import pytest
from ceph_deploy.cli import get_parser
class TestParserCalamari(object):
def setup(self):
self.parser = get_parser()
def test_calamari_help(self, c... | <commit_before><commit_msg>[RM-11742] Add argparse tests for ceph-deploy calamari
Signed-off-by: Travis Rhoden <[email protected]><commit_after>import pytest
from ceph_deploy.cli import get_parser
class TestParserCalamari(object):
def setup(self):
self.parser = get_par... | |
d40fe9a9739ed7da4a47492124715bf6b720ae1d | rally-jobs/plugins/test_relative_import/zzz.py | rally-jobs/plugins/test_relative_import/zzz.py | # This module is used just for test that relative imports work well
def some_very_important_function():
return 42
| # 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 u... | Add Apache 2.0 license to source file | Add Apache 2.0 license to source file
As per OpenStack licensing guide lines [1]:
[H102 H103] Newly contributed Source Code should be licensed under
the Apache 2.0 license.
[H104] Files with no code shouldn't contain any license header nor
comments, and must be left completely empty.
[1] http://docs.openstack.org/dev... | Python | apache-2.0 | openstack/rally,openstack/rally,openstack/rally,yeming233/rally,yeming233/rally,openstack/rally | # This module is used just for test that relative imports work well
def some_very_important_function():
return 42
Add Apache 2.0 license to source file
As per OpenStack licensing guide lines [1]:
[H102 H103] Newly contributed Source Code should be licensed under
the Apache 2.0 license.
[H104] Files with no code ... | # 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 u... | <commit_before># This module is used just for test that relative imports work well
def some_very_important_function():
return 42
<commit_msg>Add Apache 2.0 license to source file
As per OpenStack licensing guide lines [1]:
[H102 H103] Newly contributed Source Code should be licensed under
the Apache 2.0 license.... | # 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 u... | # This module is used just for test that relative imports work well
def some_very_important_function():
return 42
Add Apache 2.0 license to source file
As per OpenStack licensing guide lines [1]:
[H102 H103] Newly contributed Source Code should be licensed under
the Apache 2.0 license.
[H104] Files with no code ... | <commit_before># This module is used just for test that relative imports work well
def some_very_important_function():
return 42
<commit_msg>Add Apache 2.0 license to source file
As per OpenStack licensing guide lines [1]:
[H102 H103] Newly contributed Source Code should be licensed under
the Apache 2.0 license.... |
7dbbef88fedc07ee8cddf690b8c42785ee7241bd | astropy_helpers/sphinx/setup_package.py | astropy_helpers/sphinx/setup_package.py | # Licensed under a 3-clause BSD style license - see LICENSE.rst
def get_package_data():
# Install the theme files
return {
'astropy_helpers.sphinx': [
'ext/templates/*/*',
'themes/bootstrap-astropy/*.*',
'themes/bootstrap-astropy/static/*.*']}
| # Licensed under a 3-clause BSD style license - see LICENSE.rst
def get_package_data():
# Install the theme files
return {
'astropy_helpers.sphinx': [
'ext/templates/*/*',
'local/*.inv',
'themes/bootstrap-astropy/*.*',
'themes/bootstrap-astropy/static/*.*... | Make sure .inv file gets installed | Make sure .inv file gets installed | Python | bsd-3-clause | Cadair/astropy-helpers,bsipocz/astropy-helpers,embray/astropy_helpers,Cadair/astropy-helpers,embray/astropy_helpers,dpshelio/astropy-helpers,larrybradley/astropy-helpers,astropy/astropy-helpers,embray/astropy_helpers,astropy/astropy-helpers,bsipocz/astropy-helpers,larrybradley/astropy-helpers,embray/astropy_helpers,bsi... | # Licensed under a 3-clause BSD style license - see LICENSE.rst
def get_package_data():
# Install the theme files
return {
'astropy_helpers.sphinx': [
'ext/templates/*/*',
'themes/bootstrap-astropy/*.*',
'themes/bootstrap-astropy/static/*.*']}
Make sure .inv file get... | # Licensed under a 3-clause BSD style license - see LICENSE.rst
def get_package_data():
# Install the theme files
return {
'astropy_helpers.sphinx': [
'ext/templates/*/*',
'local/*.inv',
'themes/bootstrap-astropy/*.*',
'themes/bootstrap-astropy/static/*.*... | <commit_before># Licensed under a 3-clause BSD style license - see LICENSE.rst
def get_package_data():
# Install the theme files
return {
'astropy_helpers.sphinx': [
'ext/templates/*/*',
'themes/bootstrap-astropy/*.*',
'themes/bootstrap-astropy/static/*.*']}
<commit_... | # Licensed under a 3-clause BSD style license - see LICENSE.rst
def get_package_data():
# Install the theme files
return {
'astropy_helpers.sphinx': [
'ext/templates/*/*',
'local/*.inv',
'themes/bootstrap-astropy/*.*',
'themes/bootstrap-astropy/static/*.*... | # Licensed under a 3-clause BSD style license - see LICENSE.rst
def get_package_data():
# Install the theme files
return {
'astropy_helpers.sphinx': [
'ext/templates/*/*',
'themes/bootstrap-astropy/*.*',
'themes/bootstrap-astropy/static/*.*']}
Make sure .inv file get... | <commit_before># Licensed under a 3-clause BSD style license - see LICENSE.rst
def get_package_data():
# Install the theme files
return {
'astropy_helpers.sphinx': [
'ext/templates/*/*',
'themes/bootstrap-astropy/*.*',
'themes/bootstrap-astropy/static/*.*']}
<commit_... |
4ae27811595ce3c53670df441429bcf4cace4e15 | StockIndicators/StockIndicators.py | StockIndicators/StockIndicators.py | #!flask/bin/python
from flask import Blueprint, jsonify
api_si = Blueprint('api_si', __name__)
@api_si.route("/stock_indicators")
def get_stock_indicators():
return jsonify(stock_indicators=[
{"username": "alice", "user_id": 1},
{"username": "bob", "user_id": 2}
])
| Implement blueprints on stock indicators | Implement blueprints on stock indicators | Python | mit | z0rkuM/stockbros,z0rkuM/stockbros,z0rkuM/stockbros,z0rkuM/stockbros | Implement blueprints on stock indicators | #!flask/bin/python
from flask import Blueprint, jsonify
api_si = Blueprint('api_si', __name__)
@api_si.route("/stock_indicators")
def get_stock_indicators():
return jsonify(stock_indicators=[
{"username": "alice", "user_id": 1},
{"username": "bob", "user_id": 2}
])
| <commit_before><commit_msg>Implement blueprints on stock indicators<commit_after> | #!flask/bin/python
from flask import Blueprint, jsonify
api_si = Blueprint('api_si', __name__)
@api_si.route("/stock_indicators")
def get_stock_indicators():
return jsonify(stock_indicators=[
{"username": "alice", "user_id": 1},
{"username": "bob", "user_id": 2}
])
| Implement blueprints on stock indicators#!flask/bin/python
from flask import Blueprint, jsonify
api_si = Blueprint('api_si', __name__)
@api_si.route("/stock_indicators")
def get_stock_indicators():
return jsonify(stock_indicators=[
{"username": "alice", "user_id": 1},
{"username": "bob", "user_id"... | <commit_before><commit_msg>Implement blueprints on stock indicators<commit_after>#!flask/bin/python
from flask import Blueprint, jsonify
api_si = Blueprint('api_si', __name__)
@api_si.route("/stock_indicators")
def get_stock_indicators():
return jsonify(stock_indicators=[
{"username": "alice", "user_id": ... | |
7d17358e514ad988b2619b8c364338a2058b400b | flocker/volume/script.py | flocker/volume/script.py | # Copyright Hybrid Logic Ltd. See LICENSE file for details.
"""The command-line ``flocker-volume`` tool."""
import sys
from twisted.python.usage import Options
from twisted.python.filepath import FilePath
from twisted.internet.task import react
from twisted.internet.defer import succeed
from .service import Volume... | # Copyright Hybrid Logic Ltd. See LICENSE file for details.
"""The command-line ``flocker-volume`` tool."""
import sys
from twisted.python.usage import Options
from twisted.python.filepath import FilePath
from twisted.internet.task import react
from twisted.internet.defer import succeed
from .service import Volume... | Address review comment: More useful help output. | Address review comment: More useful help output.
| Python | apache-2.0 | wallnerryan/flocker-profiles,mbrukman/flocker,adamtheturtle/flocker,jml/flocker,mbrukman/flocker,Azulinho/flocker,lukemarsden/flocker,adamtheturtle/flocker,w4ngyi/flocker,lukemarsden/flocker,runcom/flocker,agonzalezro/flocker,1d4Nf6/flocker,AndyHuu/flocker,w4ngyi/flocker,moypray/flocker,achanda/flocker,w4ngyi/flocker,h... | # Copyright Hybrid Logic Ltd. See LICENSE file for details.
"""The command-line ``flocker-volume`` tool."""
import sys
from twisted.python.usage import Options
from twisted.python.filepath import FilePath
from twisted.internet.task import react
from twisted.internet.defer import succeed
from .service import Volume... | # Copyright Hybrid Logic Ltd. See LICENSE file for details.
"""The command-line ``flocker-volume`` tool."""
import sys
from twisted.python.usage import Options
from twisted.python.filepath import FilePath
from twisted.internet.task import react
from twisted.internet.defer import succeed
from .service import Volume... | <commit_before># Copyright Hybrid Logic Ltd. See LICENSE file for details.
"""The command-line ``flocker-volume`` tool."""
import sys
from twisted.python.usage import Options
from twisted.python.filepath import FilePath
from twisted.internet.task import react
from twisted.internet.defer import succeed
from .servic... | # Copyright Hybrid Logic Ltd. See LICENSE file for details.
"""The command-line ``flocker-volume`` tool."""
import sys
from twisted.python.usage import Options
from twisted.python.filepath import FilePath
from twisted.internet.task import react
from twisted.internet.defer import succeed
from .service import Volume... | # Copyright Hybrid Logic Ltd. See LICENSE file for details.
"""The command-line ``flocker-volume`` tool."""
import sys
from twisted.python.usage import Options
from twisted.python.filepath import FilePath
from twisted.internet.task import react
from twisted.internet.defer import succeed
from .service import Volume... | <commit_before># Copyright Hybrid Logic Ltd. See LICENSE file for details.
"""The command-line ``flocker-volume`` tool."""
import sys
from twisted.python.usage import Options
from twisted.python.filepath import FilePath
from twisted.internet.task import react
from twisted.internet.defer import succeed
from .servic... |
a2a73049c03f6144e68c4eca36bb70fdb929ac04 | grab/spider/data/shortcut.py | grab/spider/data/shortcut.py | import os
from .base import Data
from grab.tools.files import hashed_path
from .. import Task
class MongoObjectImageData(Data):
def handler(self, url, collection, obj, path_field):
path = hashed_path(url, base_dir='media/post_image')
if os.path.exists(path):
if path != getattr(obj, p... | Add MongoObjectImageData shourt to handle specific cases when you need to download image and assign its local path to some field of object stored in the mongo database | Add MongoObjectImageData shourt to handle specific cases when you need to download image and assign its local path to some field of object stored in the mongo database
| Python | mit | codevlabs/grab,pombredanne/grab-1,lorien/grab,liorvh/grab,giserh/grab,kevinlondon/grab,DDShadoww/grab,subeax/grab,giserh/grab,codevlabs/grab,shaunstanislaus/grab,pombredanne/grab-1,maurobaraldi/grab,alihalabyah/grab,raybuhr/grab,huiyi1990/grab,kevinlondon/grab,istinspring/grab,lorien/grab,alihalabyah/grab,huiyi1990/gra... | Add MongoObjectImageData shourt to handle specific cases when you need to download image and assign its local path to some field of object stored in the mongo database | import os
from .base import Data
from grab.tools.files import hashed_path
from .. import Task
class MongoObjectImageData(Data):
def handler(self, url, collection, obj, path_field):
path = hashed_path(url, base_dir='media/post_image')
if os.path.exists(path):
if path != getattr(obj, p... | <commit_before><commit_msg>Add MongoObjectImageData shourt to handle specific cases when you need to download image and assign its local path to some field of object stored in the mongo database<commit_after> | import os
from .base import Data
from grab.tools.files import hashed_path
from .. import Task
class MongoObjectImageData(Data):
def handler(self, url, collection, obj, path_field):
path = hashed_path(url, base_dir='media/post_image')
if os.path.exists(path):
if path != getattr(obj, p... | Add MongoObjectImageData shourt to handle specific cases when you need to download image and assign its local path to some field of object stored in the mongo databaseimport os
from .base import Data
from grab.tools.files import hashed_path
from .. import Task
class MongoObjectImageData(Data):
def handler(self, u... | <commit_before><commit_msg>Add MongoObjectImageData shourt to handle specific cases when you need to download image and assign its local path to some field of object stored in the mongo database<commit_after>import os
from .base import Data
from grab.tools.files import hashed_path
from .. import Task
class MongoObjec... | |
d790a9e1a83d4a7bc1555c23235c2b0a31a5b69a | functest/tests/unit/features/test_domino.py | functest/tests/unit/features/test_domino.py | #!/usr/bin/env python
# Copyright (c) 2017 Orange and others.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
# pylint: d... | Add unit tests for domino | Add unit tests for domino
Change-Id: Ie6671080a3d38a17da0ee608a362605a6d9df9db
Signed-off-by: Cédric Ollivier <[email protected]>
| Python | apache-2.0 | opnfv/functest,mywulin/functest,opnfv/functest,mywulin/functest | Add unit tests for domino
Change-Id: Ie6671080a3d38a17da0ee608a362605a6d9df9db
Signed-off-by: Cédric Ollivier <[email protected]> | #!/usr/bin/env python
# Copyright (c) 2017 Orange and others.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
# pylint: d... | <commit_before><commit_msg>Add unit tests for domino
Change-Id: Ie6671080a3d38a17da0ee608a362605a6d9df9db
Signed-off-by: Cédric Ollivier <[email protected]><commit_after> | #!/usr/bin/env python
# Copyright (c) 2017 Orange and others.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
# pylint: d... | Add unit tests for domino
Change-Id: Ie6671080a3d38a17da0ee608a362605a6d9df9db
Signed-off-by: Cédric Ollivier <[email protected]>#!/usr/bin/env python
# Copyright (c) 2017 Orange and others.
#
# All rights reserved. This program and the accompanying materials
# are made available und... | <commit_before><commit_msg>Add unit tests for domino
Change-Id: Ie6671080a3d38a17da0ee608a362605a6d9df9db
Signed-off-by: Cédric Ollivier <[email protected]><commit_after>#!/usr/bin/env python
# Copyright (c) 2017 Orange and others.
#
# All rights reserved. This program and the accomp... | |
88d936f6df9b609e7d6bdfc7d637d860b92da7a7 | scripts/export_sequences_data.py | scripts/export_sequences_data.py | import argparse
import csv
import gevent.monkey
gevent.monkey.patch_all()
from closeio_api import Client as CloseIO_API
from gevent.pool import Pool
parser = argparse.ArgumentParser(description='Download a CSV of email sequences and their subscription counts (number of active/paused/finished subscriptions)')
parser... | Add a script that exports email sequences stats | Add a script that exports email sequences stats
| Python | mit | closeio/closeio-api-scripts | Add a script that exports email sequences stats | import argparse
import csv
import gevent.monkey
gevent.monkey.patch_all()
from closeio_api import Client as CloseIO_API
from gevent.pool import Pool
parser = argparse.ArgumentParser(description='Download a CSV of email sequences and their subscription counts (number of active/paused/finished subscriptions)')
parser... | <commit_before><commit_msg>Add a script that exports email sequences stats<commit_after> | import argparse
import csv
import gevent.monkey
gevent.monkey.patch_all()
from closeio_api import Client as CloseIO_API
from gevent.pool import Pool
parser = argparse.ArgumentParser(description='Download a CSV of email sequences and their subscription counts (number of active/paused/finished subscriptions)')
parser... | Add a script that exports email sequences statsimport argparse
import csv
import gevent.monkey
gevent.monkey.patch_all()
from closeio_api import Client as CloseIO_API
from gevent.pool import Pool
parser = argparse.ArgumentParser(description='Download a CSV of email sequences and their subscription counts (number of ... | <commit_before><commit_msg>Add a script that exports email sequences stats<commit_after>import argparse
import csv
import gevent.monkey
gevent.monkey.patch_all()
from closeio_api import Client as CloseIO_API
from gevent.pool import Pool
parser = argparse.ArgumentParser(description='Download a CSV of email sequences ... | |
f68b51409b5a2f0ec3ad8720b32cdd1e9174dbd6 | scripts/linearmodel.py | scripts/linearmodel.py | import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets("data/", one_hot=True)
image_dim = 28 * 28
label_count = 10
graph = tf.Graph()
with graph.as_default():
x = tf.placeholder("float", shape=[None, image_dim])
y_ = tf.placeholder("float", shape=[None... | Add a linear sample for mnist in python. | Add a linear sample for mnist in python.
| Python | apache-2.0 | LaurentMazare/tensorflow-ocaml,hhugo/tensorflow-ocaml,LaurentMazare/tensorflow-ocaml,hhugo/tensorflow-ocaml | Add a linear sample for mnist in python. | import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets("data/", one_hot=True)
image_dim = 28 * 28
label_count = 10
graph = tf.Graph()
with graph.as_default():
x = tf.placeholder("float", shape=[None, image_dim])
y_ = tf.placeholder("float", shape=[None... | <commit_before><commit_msg>Add a linear sample for mnist in python.<commit_after> | import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets("data/", one_hot=True)
image_dim = 28 * 28
label_count = 10
graph = tf.Graph()
with graph.as_default():
x = tf.placeholder("float", shape=[None, image_dim])
y_ = tf.placeholder("float", shape=[None... | Add a linear sample for mnist in python.import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets("data/", one_hot=True)
image_dim = 28 * 28
label_count = 10
graph = tf.Graph()
with graph.as_default():
x = tf.placeholder("float", shape=[None, image_dim])
... | <commit_before><commit_msg>Add a linear sample for mnist in python.<commit_after>import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets("data/", one_hot=True)
image_dim = 28 * 28
label_count = 10
graph = tf.Graph()
with graph.as_default():
x = tf.placeho... | |
6a06cbcb6b3ee52a85dc4bb0eeb952234e05b6d5 | nototools/drop_hints.py | nototools/drop_hints.py | #!/usr/bin/python
#
# Copyright 2014 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | Add script to drop hints. | [nototools] Add script to drop hints.
| Python | apache-2.0 | dougfelt/nototools,googlei18n/nototools,pahans/nototools,dougfelt/nototools,googlefonts/nototools,googlei18n/nototools,googlefonts/nototools,anthrotype/nototools,dougfelt/nototools,pathumego/nototools,anthrotype/nototools,pahans/nototools,davelab6/nototools,namemealrady/nototools,googlei18n/nototools,pathumego/nototool... | [nototools] Add script to drop hints. | #!/usr/bin/python
#
# Copyright 2014 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | <commit_before><commit_msg>[nototools] Add script to drop hints.<commit_after> | #!/usr/bin/python
#
# Copyright 2014 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | [nototools] Add script to drop hints.#!/usr/bin/python
#
# Copyright 2014 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licens... | <commit_before><commit_msg>[nototools] Add script to drop hints.<commit_after>#!/usr/bin/python
#
# Copyright 2014 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the Licens... | |
620b7afd50e93847dc6d9fa08751fd69bec35d95 | barython/events/__init__.py | barython/events/__init__.py | #!/usr/bin/env python3
import logging
import threading
logger = logging.getLogger("barython")
class _Hook(threading.Thread):
#: list of callbacks
callbacks = None
def notify(self, *args, **kwargs):
for c in self.callbacks:
try:
threading.Thread(target=c, args=args,... | Add the abstract class _Hook | Add the abstract class _Hook
Related to #2
Should be used by the panel to handle events and spread it through the
widgets.
| Python | bsd-3-clause | Anthony25/barython | Add the abstract class _Hook
Related to #2
Should be used by the panel to handle events and spread it through the
widgets. | #!/usr/bin/env python3
import logging
import threading
logger = logging.getLogger("barython")
class _Hook(threading.Thread):
#: list of callbacks
callbacks = None
def notify(self, *args, **kwargs):
for c in self.callbacks:
try:
threading.Thread(target=c, args=args,... | <commit_before><commit_msg>Add the abstract class _Hook
Related to #2
Should be used by the panel to handle events and spread it through the
widgets.<commit_after> | #!/usr/bin/env python3
import logging
import threading
logger = logging.getLogger("barython")
class _Hook(threading.Thread):
#: list of callbacks
callbacks = None
def notify(self, *args, **kwargs):
for c in self.callbacks:
try:
threading.Thread(target=c, args=args,... | Add the abstract class _Hook
Related to #2
Should be used by the panel to handle events and spread it through the
widgets.#!/usr/bin/env python3
import logging
import threading
logger = logging.getLogger("barython")
class _Hook(threading.Thread):
#: list of callbacks
callbacks = None
def notify(self... | <commit_before><commit_msg>Add the abstract class _Hook
Related to #2
Should be used by the panel to handle events and spread it through the
widgets.<commit_after>#!/usr/bin/env python3
import logging
import threading
logger = logging.getLogger("barython")
class _Hook(threading.Thread):
#: list of callbacks
... | |
ef754c3bb0fd4d026b898fd259632d98f2688ab0 | test.py | test.py | #!/usr/bin/env python
import ystockquote as y
x = 'SYK'
a = y.get_all(x)
# 'fifty_two_week_low', 'fifty_day_moving_avg', 'price', 'price_book_ratio', 'volume', 'market_cap', 'dividend_yield', 'ebitda', 'change', 'dividend_per_share', 'stock_exchange', 'two_hundred_day_moving_avg', 'fifty_two_week_high', 'price_sales_... | Print more stock stuff in small space. | Print more stock stuff in small space.
| Python | mit | zimolzak/Raspberry-Pi-newbie,zimolzak/Raspberry-Pi-newbie,zimolzak/Raspberry-Pi-newbie,zimolzak/Raspberry-Pi-newbie,zimolzak/Raspberry-Pi-newbie | Print more stock stuff in small space. | #!/usr/bin/env python
import ystockquote as y
x = 'SYK'
a = y.get_all(x)
# 'fifty_two_week_low', 'fifty_day_moving_avg', 'price', 'price_book_ratio', 'volume', 'market_cap', 'dividend_yield', 'ebitda', 'change', 'dividend_per_share', 'stock_exchange', 'two_hundred_day_moving_avg', 'fifty_two_week_high', 'price_sales_... | <commit_before><commit_msg>Print more stock stuff in small space.<commit_after> | #!/usr/bin/env python
import ystockquote as y
x = 'SYK'
a = y.get_all(x)
# 'fifty_two_week_low', 'fifty_day_moving_avg', 'price', 'price_book_ratio', 'volume', 'market_cap', 'dividend_yield', 'ebitda', 'change', 'dividend_per_share', 'stock_exchange', 'two_hundred_day_moving_avg', 'fifty_two_week_high', 'price_sales_... | Print more stock stuff in small space.#!/usr/bin/env python
import ystockquote as y
x = 'SYK'
a = y.get_all(x)
# 'fifty_two_week_low', 'fifty_day_moving_avg', 'price', 'price_book_ratio', 'volume', 'market_cap', 'dividend_yield', 'ebitda', 'change', 'dividend_per_share', 'stock_exchange', 'two_hundred_day_moving_avg'... | <commit_before><commit_msg>Print more stock stuff in small space.<commit_after>#!/usr/bin/env python
import ystockquote as y
x = 'SYK'
a = y.get_all(x)
# 'fifty_two_week_low', 'fifty_day_moving_avg', 'price', 'price_book_ratio', 'volume', 'market_cap', 'dividend_yield', 'ebitda', 'change', 'dividend_per_share', 'stoc... | |
22c6455ce5e05e5ec532d17210ef60fed4bb6aba | tests/chainer_tests/training_tests/extensions_tests/test_print_report.py | tests/chainer_tests/training_tests/extensions_tests/test_print_report.py | import sys
import unittest
from chainer import testing
from chainer.training import extensions
class TestPrintReport(unittest.TestCase):
def test_stream_typecheck(self):
report = extensions.PrintReport(['epoch'], out=sys.stderr)
self.assertIsInstance(report, extensions.PrintReport)
with... | Test typechecking for an output stream | Test typechecking for an output stream
| Python | mit | keisuke-umezawa/chainer,hvy/chainer,okuta/chainer,rezoo/chainer,wkentaro/chainer,tkerola/chainer,keisuke-umezawa/chainer,niboshi/chainer,ktnyt/chainer,ktnyt/chainer,niboshi/chainer,jnishi/chainer,pfnet/chainer,chainer/chainer,ktnyt/chainer,hvy/chainer,okuta/chainer,keisuke-umezawa/chainer,niboshi/chainer,jnishi/chainer... | Test typechecking for an output stream | import sys
import unittest
from chainer import testing
from chainer.training import extensions
class TestPrintReport(unittest.TestCase):
def test_stream_typecheck(self):
report = extensions.PrintReport(['epoch'], out=sys.stderr)
self.assertIsInstance(report, extensions.PrintReport)
with... | <commit_before><commit_msg>Test typechecking for an output stream<commit_after> | import sys
import unittest
from chainer import testing
from chainer.training import extensions
class TestPrintReport(unittest.TestCase):
def test_stream_typecheck(self):
report = extensions.PrintReport(['epoch'], out=sys.stderr)
self.assertIsInstance(report, extensions.PrintReport)
with... | Test typechecking for an output streamimport sys
import unittest
from chainer import testing
from chainer.training import extensions
class TestPrintReport(unittest.TestCase):
def test_stream_typecheck(self):
report = extensions.PrintReport(['epoch'], out=sys.stderr)
self.assertIsInstance(report,... | <commit_before><commit_msg>Test typechecking for an output stream<commit_after>import sys
import unittest
from chainer import testing
from chainer.training import extensions
class TestPrintReport(unittest.TestCase):
def test_stream_typecheck(self):
report = extensions.PrintReport(['epoch'], out=sys.stde... | |
c4cfacfb8038b104ff91baf664ef1359a8ebb128 | games/migrations/0010_auto_20160615_0436.py | games/migrations/0010_auto_20160615_0436.py | # -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-06-15 02:36
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('games', '0009_installer_rating'),
]
operations = [
migrations.AlterField(
... | Add migration for rating choices modification | Add migration for rating choices modification
| Python | agpl-3.0 | lutris/website,Turupawn/website,Turupawn/website,lutris/website,Turupawn/website,Turupawn/website,lutris/website,lutris/website | Add migration for rating choices modification | # -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-06-15 02:36
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('games', '0009_installer_rating'),
]
operations = [
migrations.AlterField(
... | <commit_before><commit_msg>Add migration for rating choices modification<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-06-15 02:36
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('games', '0009_installer_rating'),
]
operations = [
migrations.AlterField(
... | Add migration for rating choices modification# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-06-15 02:36
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('games', '0009_installer_rating'),
]
ope... | <commit_before><commit_msg>Add migration for rating choices modification<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-06-15 02:36
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('games',... | |
7e307fb6eb8246fdec9fe9f3249f8dff9c89ccd3 | librisxl-tools/blazegraph/lddb-to-import.py | librisxl-tools/blazegraph/lddb-to-import.py | from __future__ import unicode_literals, print_function
import sys
import os
import re
CONTEXT_PATH = 'context.jsonld'
args = sys.argv[1:]
basepath = args.pop(0) if args else 'data'
chunksize = int(args.pop(0)) if args else 100 * 1000
outfile = None
def next_outfile(i):
global outfile
fpath = "{}-{}.jsonld... | Add script for turning lines of JSON-LD records into chunked datasets | Add script for turning lines of JSON-LD records into chunked datasets
This creates a bunch of "reasonably sized" JSON-LD dataset files with a
given count of named graphs.
It also fixes some things for BlazeGraph to be able to parse the data.
| Python | apache-2.0 | libris/librisxl,libris/librisxl,libris/librisxl | Add script for turning lines of JSON-LD records into chunked datasets
This creates a bunch of "reasonably sized" JSON-LD dataset files with a
given count of named graphs.
It also fixes some things for BlazeGraph to be able to parse the data. | from __future__ import unicode_literals, print_function
import sys
import os
import re
CONTEXT_PATH = 'context.jsonld'
args = sys.argv[1:]
basepath = args.pop(0) if args else 'data'
chunksize = int(args.pop(0)) if args else 100 * 1000
outfile = None
def next_outfile(i):
global outfile
fpath = "{}-{}.jsonld... | <commit_before><commit_msg>Add script for turning lines of JSON-LD records into chunked datasets
This creates a bunch of "reasonably sized" JSON-LD dataset files with a
given count of named graphs.
It also fixes some things for BlazeGraph to be able to parse the data.<commit_after> | from __future__ import unicode_literals, print_function
import sys
import os
import re
CONTEXT_PATH = 'context.jsonld'
args = sys.argv[1:]
basepath = args.pop(0) if args else 'data'
chunksize = int(args.pop(0)) if args else 100 * 1000
outfile = None
def next_outfile(i):
global outfile
fpath = "{}-{}.jsonld... | Add script for turning lines of JSON-LD records into chunked datasets
This creates a bunch of "reasonably sized" JSON-LD dataset files with a
given count of named graphs.
It also fixes some things for BlazeGraph to be able to parse the data.from __future__ import unicode_literals, print_function
import sys
import os
... | <commit_before><commit_msg>Add script for turning lines of JSON-LD records into chunked datasets
This creates a bunch of "reasonably sized" JSON-LD dataset files with a
given count of named graphs.
It also fixes some things for BlazeGraph to be able to parse the data.<commit_after>from __future__ import unicode_liter... | |
25d53a43576753f1aa0cc6fbaf05ae94dcdec564 | tmp/cacd2000_split_identities.py | tmp/cacd2000_split_identities.py | import shutil
import argparse
import os
import sys
def main(args):
src_path_exp = os.path.expanduser(args.src_path)
dst_path_exp = os.path.expanduser(args.dst_path)
if not os.path.exists(dst_path_exp):
os.makedirs(dst_path_exp)
files = os.listdir(src_path_exp)
for f in files:
file_n... | Split CACD2000 dataset into one directory per identity | Split CACD2000 dataset into one directory per identity | Python | mit | davidsandberg/facenet,wangxianliang/facenet,wangxianliang/facenet,liuzz1983/open_vision,davidsandberg/facenet | Split CACD2000 dataset into one directory per identity | import shutil
import argparse
import os
import sys
def main(args):
src_path_exp = os.path.expanduser(args.src_path)
dst_path_exp = os.path.expanduser(args.dst_path)
if not os.path.exists(dst_path_exp):
os.makedirs(dst_path_exp)
files = os.listdir(src_path_exp)
for f in files:
file_n... | <commit_before><commit_msg>Split CACD2000 dataset into one directory per identity<commit_after> | import shutil
import argparse
import os
import sys
def main(args):
src_path_exp = os.path.expanduser(args.src_path)
dst_path_exp = os.path.expanduser(args.dst_path)
if not os.path.exists(dst_path_exp):
os.makedirs(dst_path_exp)
files = os.listdir(src_path_exp)
for f in files:
file_n... | Split CACD2000 dataset into one directory per identityimport shutil
import argparse
import os
import sys
def main(args):
src_path_exp = os.path.expanduser(args.src_path)
dst_path_exp = os.path.expanduser(args.dst_path)
if not os.path.exists(dst_path_exp):
os.makedirs(dst_path_exp)
files = os.li... | <commit_before><commit_msg>Split CACD2000 dataset into one directory per identity<commit_after>import shutil
import argparse
import os
import sys
def main(args):
src_path_exp = os.path.expanduser(args.src_path)
dst_path_exp = os.path.expanduser(args.dst_path)
if not os.path.exists(dst_path_exp):
os... | |
c55d917b28c41d363e2dea8ecaf750a431f016da | migrations/versions/0364_drop_old_column.py | migrations/versions/0364_drop_old_column.py | """
Revision ID: 0364_drop_old_column
Revises: 0363_cancelled_by_api_key
Create Date: 2022-01-25 18:05:27.750234
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
revision = '0364_drop_old_column'
down_revision = '0363_cancelled_by_api_key'
def upgrade():
# move data... | Drop api_key_id column from broadcast_message table | Drop api_key_id column from broadcast_message table
This column has been superseded by a new column named
created_by_api_key_id.
Also create constraint checking that we know who created broadcast
Also move data so that constraint is met before instatiating it.
| Python | mit | alphagov/notifications-api,alphagov/notifications-api | Drop api_key_id column from broadcast_message table
This column has been superseded by a new column named
created_by_api_key_id.
Also create constraint checking that we know who created broadcast
Also move data so that constraint is met before instatiating it. | """
Revision ID: 0364_drop_old_column
Revises: 0363_cancelled_by_api_key
Create Date: 2022-01-25 18:05:27.750234
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
revision = '0364_drop_old_column'
down_revision = '0363_cancelled_by_api_key'
def upgrade():
# move data... | <commit_before><commit_msg>Drop api_key_id column from broadcast_message table
This column has been superseded by a new column named
created_by_api_key_id.
Also create constraint checking that we know who created broadcast
Also move data so that constraint is met before instatiating it.<commit_after> | """
Revision ID: 0364_drop_old_column
Revises: 0363_cancelled_by_api_key
Create Date: 2022-01-25 18:05:27.750234
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
revision = '0364_drop_old_column'
down_revision = '0363_cancelled_by_api_key'
def upgrade():
# move data... | Drop api_key_id column from broadcast_message table
This column has been superseded by a new column named
created_by_api_key_id.
Also create constraint checking that we know who created broadcast
Also move data so that constraint is met before instatiating it."""
Revision ID: 0364_drop_old_column
Revises: 0363_canc... | <commit_before><commit_msg>Drop api_key_id column from broadcast_message table
This column has been superseded by a new column named
created_by_api_key_id.
Also create constraint checking that we know who created broadcast
Also move data so that constraint is met before instatiating it.<commit_after>"""
Revision ID... | |
2b9830d89fd1c7aef5deb5bd16a7f6a26ea8e682 | data/mongorandomgraph.py | data/mongorandomgraph.py | import bson.json_util
from bson.objectid import ObjectId
import itertools
import random
import string
import sys
def emit_node(name):
oid = ObjectId()
print bson.json_util.dumps({"_id": oid,
"type": "node",
"data": {"name": name}})
return o... | Add script to generate test mongo data | Add script to generate test mongo data
| Python | apache-2.0 | XDATA-Year-3/clique,XDATA-Year-3/clique,Kitware/clique,Kitware/clique,Kitware/clique,XDATA-Year-3/clique | Add script to generate test mongo data | import bson.json_util
from bson.objectid import ObjectId
import itertools
import random
import string
import sys
def emit_node(name):
oid = ObjectId()
print bson.json_util.dumps({"_id": oid,
"type": "node",
"data": {"name": name}})
return o... | <commit_before><commit_msg>Add script to generate test mongo data<commit_after> | import bson.json_util
from bson.objectid import ObjectId
import itertools
import random
import string
import sys
def emit_node(name):
oid = ObjectId()
print bson.json_util.dumps({"_id": oid,
"type": "node",
"data": {"name": name}})
return o... | Add script to generate test mongo dataimport bson.json_util
from bson.objectid import ObjectId
import itertools
import random
import string
import sys
def emit_node(name):
oid = ObjectId()
print bson.json_util.dumps({"_id": oid,
"type": "node",
... | <commit_before><commit_msg>Add script to generate test mongo data<commit_after>import bson.json_util
from bson.objectid import ObjectId
import itertools
import random
import string
import sys
def emit_node(name):
oid = ObjectId()
print bson.json_util.dumps({"_id": oid,
"type":... | |
6dba942d41c38d301f225627aae318910d139eb0 | scripts/create_pca_component_overlay.py | scripts/create_pca_component_overlay.py | # Generate overlay corresponding to 2nd PCA component
# which serves as a proxy for senescence
import csv
from collections import defaultdict
import dtoolcore
import click
import numpy as np
def calc_pca_components(all_entries):
rgb_matrix = np.transpose(np.array(
[
map(float, [entry['R'... | Add script to create overlay on individual plots for senescence | Add script to create overlay on individual plots for senescence
| Python | mit | JIC-Image-Analysis/senescence-in-field,JIC-Image-Analysis/senescence-in-field,JIC-Image-Analysis/senescence-in-field | Add script to create overlay on individual plots for senescence | # Generate overlay corresponding to 2nd PCA component
# which serves as a proxy for senescence
import csv
from collections import defaultdict
import dtoolcore
import click
import numpy as np
def calc_pca_components(all_entries):
rgb_matrix = np.transpose(np.array(
[
map(float, [entry['R'... | <commit_before><commit_msg>Add script to create overlay on individual plots for senescence<commit_after> | # Generate overlay corresponding to 2nd PCA component
# which serves as a proxy for senescence
import csv
from collections import defaultdict
import dtoolcore
import click
import numpy as np
def calc_pca_components(all_entries):
rgb_matrix = np.transpose(np.array(
[
map(float, [entry['R'... | Add script to create overlay on individual plots for senescence# Generate overlay corresponding to 2nd PCA component
# which serves as a proxy for senescence
import csv
from collections import defaultdict
import dtoolcore
import click
import numpy as np
def calc_pca_components(all_entries):
rgb_matrix = np.... | <commit_before><commit_msg>Add script to create overlay on individual plots for senescence<commit_after># Generate overlay corresponding to 2nd PCA component
# which serves as a proxy for senescence
import csv
from collections import defaultdict
import dtoolcore
import click
import numpy as np
def calc_pca_compo... | |
4c0273b38437302526457c90a142efd465d8addd | tests/algebra/test_abstract_quantum_algebra.py | tests/algebra/test_abstract_quantum_algebra.py | from qnet import (
One, Zero, ZeroOperator, IdentityOperator, ZeroSuperOperator,
IdentitySuperOperator, ZeroKet, TrivialKet, FullSpace, TrivialSpace,
CIdentity, CircuitZero)
def test_neutral_elements():
"""test the properties of the neutral elements in the quantum algebras.
This tests the resoluti... | Test equality and hashing of neutral elements | Test equality and hashing of neutral elements
With the implementation of the scalar algebra it turns out that the way
to go is to have only the scalar Zero and One equal to 0 and 1. In every
other algebra, the neutral elements have no relation to the scalar 0 and
1, or to the neutral elements of other algebras.
Hoeve... | Python | mit | mabuchilab/QNET | Test equality and hashing of neutral elements
With the implementation of the scalar algebra it turns out that the way
to go is to have only the scalar Zero and One equal to 0 and 1. In every
other algebra, the neutral elements have no relation to the scalar 0 and
1, or to the neutral elements of other algebras.
Hoeve... | from qnet import (
One, Zero, ZeroOperator, IdentityOperator, ZeroSuperOperator,
IdentitySuperOperator, ZeroKet, TrivialKet, FullSpace, TrivialSpace,
CIdentity, CircuitZero)
def test_neutral_elements():
"""test the properties of the neutral elements in the quantum algebras.
This tests the resoluti... | <commit_before><commit_msg>Test equality and hashing of neutral elements
With the implementation of the scalar algebra it turns out that the way
to go is to have only the scalar Zero and One equal to 0 and 1. In every
other algebra, the neutral elements have no relation to the scalar 0 and
1, or to the neutral element... | from qnet import (
One, Zero, ZeroOperator, IdentityOperator, ZeroSuperOperator,
IdentitySuperOperator, ZeroKet, TrivialKet, FullSpace, TrivialSpace,
CIdentity, CircuitZero)
def test_neutral_elements():
"""test the properties of the neutral elements in the quantum algebras.
This tests the resoluti... | Test equality and hashing of neutral elements
With the implementation of the scalar algebra it turns out that the way
to go is to have only the scalar Zero and One equal to 0 and 1. In every
other algebra, the neutral elements have no relation to the scalar 0 and
1, or to the neutral elements of other algebras.
Hoeve... | <commit_before><commit_msg>Test equality and hashing of neutral elements
With the implementation of the scalar algebra it turns out that the way
to go is to have only the scalar Zero and One equal to 0 and 1. In every
other algebra, the neutral elements have no relation to the scalar 0 and
1, or to the neutral element... | |
768f98a2b873833b5029f587c869a39697e7683f | plenum/test/requests/test_send_audit_txn.py | plenum/test/requests/test_send_audit_txn.py | import json
import time
import pytest
from plenum.test.helper import sdk_get_and_check_replies
from plenum.test.pool_transactions.helper import sdk_sign_and_send_prepared_request
from plenum.common.exceptions import RequestNackedException
from plenum.common.constants import TXN_TYPE, AUDIT, CURRENT_PROTOCOL_VERSION
f... | Test for audit txn sending | Test for audit txn sending
Signed-off-by: ArtObr <[email protected]>
| Python | apache-2.0 | evernym/plenum,evernym/zeno | Test for audit txn sending
Signed-off-by: ArtObr <[email protected]> | import json
import time
import pytest
from plenum.test.helper import sdk_get_and_check_replies
from plenum.test.pool_transactions.helper import sdk_sign_and_send_prepared_request
from plenum.common.exceptions import RequestNackedException
from plenum.common.constants import TXN_TYPE, AUDIT, CURRENT_PROTOCOL_VERSION
f... | <commit_before><commit_msg>Test for audit txn sending
Signed-off-by: ArtObr <[email protected]><commit_after> | import json
import time
import pytest
from plenum.test.helper import sdk_get_and_check_replies
from plenum.test.pool_transactions.helper import sdk_sign_and_send_prepared_request
from plenum.common.exceptions import RequestNackedException
from plenum.common.constants import TXN_TYPE, AUDIT, CURRENT_PROTOCOL_VERSION
f... | Test for audit txn sending
Signed-off-by: ArtObr <[email protected]>import json
import time
import pytest
from plenum.test.helper import sdk_get_and_check_replies
from plenum.test.pool_transactions.helper import sdk_sign_and_send_prepared_request
from plenum.common.exceptions import ... | <commit_before><commit_msg>Test for audit txn sending
Signed-off-by: ArtObr <[email protected]><commit_after>import json
import time
import pytest
from plenum.test.helper import sdk_get_and_check_replies
from plenum.test.pool_transactions.helper import sdk_sign_and_send_prepared_reque... | |
3e5193f6dee511a8fd082da7e58705d4c825e079 | utilities/data_migration/sms_import/sms-recovery.py | utilities/data_migration/sms_import/sms-recovery.py | #!/usr/bin/env python
# encoding: utf-8
"""
sms-recovery.py
Created by Brian DeRenzi on 2010-04-27.
Copyright (c) 2010 __MyCompanyName__. All rights reserved.
"""
import sys
import os
import MySQLdb
from datetime import datetime, timedelta
DB_HOST = "localhost"
DB_USER = "changeme"
DB_PASSWORD = "changeme"
DB_NAME =... | Add brian's sms import scripts + test data | Add brian's sms import scripts + test data
| Python | bsd-3-clause | puttarajubr/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,puttarajubr/commcare-hq,SEL-Columbia/commcare-hq,gmimano/commcaretest,qedsoftware/commcare-hq,puttarajubr/commcare-hq,dimagi/commcare-hq,gmimano/commcaretest,qedsoftware/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,SEL-Colum... | Add brian's sms import scripts + test data | #!/usr/bin/env python
# encoding: utf-8
"""
sms-recovery.py
Created by Brian DeRenzi on 2010-04-27.
Copyright (c) 2010 __MyCompanyName__. All rights reserved.
"""
import sys
import os
import MySQLdb
from datetime import datetime, timedelta
DB_HOST = "localhost"
DB_USER = "changeme"
DB_PASSWORD = "changeme"
DB_NAME =... | <commit_before><commit_msg>Add brian's sms import scripts + test data<commit_after> | #!/usr/bin/env python
# encoding: utf-8
"""
sms-recovery.py
Created by Brian DeRenzi on 2010-04-27.
Copyright (c) 2010 __MyCompanyName__. All rights reserved.
"""
import sys
import os
import MySQLdb
from datetime import datetime, timedelta
DB_HOST = "localhost"
DB_USER = "changeme"
DB_PASSWORD = "changeme"
DB_NAME =... | Add brian's sms import scripts + test data#!/usr/bin/env python
# encoding: utf-8
"""
sms-recovery.py
Created by Brian DeRenzi on 2010-04-27.
Copyright (c) 2010 __MyCompanyName__. All rights reserved.
"""
import sys
import os
import MySQLdb
from datetime import datetime, timedelta
DB_HOST = "localhost"
DB_USER = "ch... | <commit_before><commit_msg>Add brian's sms import scripts + test data<commit_after>#!/usr/bin/env python
# encoding: utf-8
"""
sms-recovery.py
Created by Brian DeRenzi on 2010-04-27.
Copyright (c) 2010 __MyCompanyName__. All rights reserved.
"""
import sys
import os
import MySQLdb
from datetime import datetime, timed... | |
5974e5a1518e26ffd1c0d77d8ca1ba1427319567 | tests/integration/customer/test_dispatcher.py | tests/integration/customer/test_dispatcher.py | from django.test import TestCase
from django.core import mail
from oscar.core.compat import get_user_model
from oscar.apps.customer.utils import Dispatcher
from oscar.apps.customer.models import CommunicationEventType
from oscar.test.factories import create_order
User = get_user_model()
class TestDispatcher(TestCa... | from django.test import TestCase
from django.core import mail
from oscar.core.compat import get_user_model
from oscar.apps.customer.utils import Dispatcher
from oscar.apps.customer.models import CommunicationEventType
from oscar.test.factories import create_order
User = get_user_model()
class TestDispatcher(TestCa... | Use empty message instead None. | Use empty message instead None.
| Python | bsd-3-clause | solarissmoke/django-oscar,sasha0/django-oscar,sonofatailor/django-oscar,django-oscar/django-oscar,solarissmoke/django-oscar,sonofatailor/django-oscar,django-oscar/django-oscar,solarissmoke/django-oscar,okfish/django-oscar,okfish/django-oscar,sonofatailor/django-oscar,okfish/django-oscar,sasha0/django-oscar,sonofatailor... | from django.test import TestCase
from django.core import mail
from oscar.core.compat import get_user_model
from oscar.apps.customer.utils import Dispatcher
from oscar.apps.customer.models import CommunicationEventType
from oscar.test.factories import create_order
User = get_user_model()
class TestDispatcher(TestCa... | from django.test import TestCase
from django.core import mail
from oscar.core.compat import get_user_model
from oscar.apps.customer.utils import Dispatcher
from oscar.apps.customer.models import CommunicationEventType
from oscar.test.factories import create_order
User = get_user_model()
class TestDispatcher(TestCa... | <commit_before>from django.test import TestCase
from django.core import mail
from oscar.core.compat import get_user_model
from oscar.apps.customer.utils import Dispatcher
from oscar.apps.customer.models import CommunicationEventType
from oscar.test.factories import create_order
User = get_user_model()
class TestDi... | from django.test import TestCase
from django.core import mail
from oscar.core.compat import get_user_model
from oscar.apps.customer.utils import Dispatcher
from oscar.apps.customer.models import CommunicationEventType
from oscar.test.factories import create_order
User = get_user_model()
class TestDispatcher(TestCa... | from django.test import TestCase
from django.core import mail
from oscar.core.compat import get_user_model
from oscar.apps.customer.utils import Dispatcher
from oscar.apps.customer.models import CommunicationEventType
from oscar.test.factories import create_order
User = get_user_model()
class TestDispatcher(TestCa... | <commit_before>from django.test import TestCase
from django.core import mail
from oscar.core.compat import get_user_model
from oscar.apps.customer.utils import Dispatcher
from oscar.apps.customer.models import CommunicationEventType
from oscar.test.factories import create_order
User = get_user_model()
class TestDi... |
810aee1682f16f8697943baf622abead57c707eb | portal/migrations/versions/d0b40bc8d7e6_.py | portal/migrations/versions/d0b40bc8d7e6_.py | from alembic import op
import sqlalchemy as sa
"""empty message
Revision ID: d0b40bc8d7e6
Revises: 8ffec90e68a7
Create Date: 2017-09-20 05:59:45.168324
"""
# revision identifiers, used by Alembic.
revision = 'd0b40bc8d7e6'
down_revision = '8ffec90e68a7'
def upgrade():
# Work around site_persistence fragility... | Work around site_persistence fragility. Replace a couple names as delete and recreate on these fails due to FK constraints | Work around site_persistence fragility. Replace a couple names
as delete and recreate on these fails due to FK constraints
| Python | bsd-3-clause | uwcirg/true_nth_usa_portal,uwcirg/true_nth_usa_portal,uwcirg/true_nth_usa_portal,uwcirg/true_nth_usa_portal | Work around site_persistence fragility. Replace a couple names
as delete and recreate on these fails due to FK constraints | from alembic import op
import sqlalchemy as sa
"""empty message
Revision ID: d0b40bc8d7e6
Revises: 8ffec90e68a7
Create Date: 2017-09-20 05:59:45.168324
"""
# revision identifiers, used by Alembic.
revision = 'd0b40bc8d7e6'
down_revision = '8ffec90e68a7'
def upgrade():
# Work around site_persistence fragility... | <commit_before><commit_msg>Work around site_persistence fragility. Replace a couple names
as delete and recreate on these fails due to FK constraints<commit_after> | from alembic import op
import sqlalchemy as sa
"""empty message
Revision ID: d0b40bc8d7e6
Revises: 8ffec90e68a7
Create Date: 2017-09-20 05:59:45.168324
"""
# revision identifiers, used by Alembic.
revision = 'd0b40bc8d7e6'
down_revision = '8ffec90e68a7'
def upgrade():
# Work around site_persistence fragility... | Work around site_persistence fragility. Replace a couple names
as delete and recreate on these fails due to FK constraintsfrom alembic import op
import sqlalchemy as sa
"""empty message
Revision ID: d0b40bc8d7e6
Revises: 8ffec90e68a7
Create Date: 2017-09-20 05:59:45.168324
"""
# revision identifiers, used by Alem... | <commit_before><commit_msg>Work around site_persistence fragility. Replace a couple names
as delete and recreate on these fails due to FK constraints<commit_after>from alembic import op
import sqlalchemy as sa
"""empty message
Revision ID: d0b40bc8d7e6
Revises: 8ffec90e68a7
Create Date: 2017-09-20 05:59:45.168324
... | |
8c2eb34d1a1f70150b3f3e7c9bc7255e5178bda6 | accounts/migrations/0003_migrate_api_keys.py | accounts/migrations/0003_migrate_api_keys.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
def migrate_keys(apps, schema_editor):
Token = apps.get_model("authtoken", "Token")
ApiKey = apps.get_model("tastypie", "ApiKey")
for key in ApiKey.objects.all():
Token.objects.create(
use... | Write migration for API keys | Write migration for API keys
| Python | agpl-3.0 | lutris/website,Turupawn/website,lutris/website,Turupawn/website,Turupawn/website,lutris/website,Turupawn/website,lutris/website | Write migration for API keys | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
def migrate_keys(apps, schema_editor):
Token = apps.get_model("authtoken", "Token")
ApiKey = apps.get_model("tastypie", "ApiKey")
for key in ApiKey.objects.all():
Token.objects.create(
use... | <commit_before><commit_msg>Write migration for API keys<commit_after> | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
def migrate_keys(apps, schema_editor):
Token = apps.get_model("authtoken", "Token")
ApiKey = apps.get_model("tastypie", "ApiKey")
for key in ApiKey.objects.all():
Token.objects.create(
use... | Write migration for API keys# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
def migrate_keys(apps, schema_editor):
Token = apps.get_model("authtoken", "Token")
ApiKey = apps.get_model("tastypie", "ApiKey")
for key in ApiKey.objects.all():
Token.obj... | <commit_before><commit_msg>Write migration for API keys<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
def migrate_keys(apps, schema_editor):
Token = apps.get_model("authtoken", "Token")
ApiKey = apps.get_model("tastypie", "ApiKey")
for key i... | |
1e83e4a47d0f97e0f20ab64b465c23483503d598 | samples/magicbot_simple/tests/pyfrc_test.py | samples/magicbot_simple/tests/pyfrc_test.py | '''
This test module imports tests that come with pyfrc, and can be used
to test basic functionality of just about any robot.
'''
from pyfrc.tests import *
from magicbot.magicbot_tests import *
| Add tests to magicbot example | Add tests to magicbot example
| Python | bsd-3-clause | Twinters007/robotpy-wpilib-utilities,robotpy/robotpy-wpilib-utilities,robotpy/robotpy-wpilib-utilities,Twinters007/robotpy-wpilib-utilities | Add tests to magicbot example | '''
This test module imports tests that come with pyfrc, and can be used
to test basic functionality of just about any robot.
'''
from pyfrc.tests import *
from magicbot.magicbot_tests import *
| <commit_before><commit_msg>Add tests to magicbot example<commit_after> | '''
This test module imports tests that come with pyfrc, and can be used
to test basic functionality of just about any robot.
'''
from pyfrc.tests import *
from magicbot.magicbot_tests import *
| Add tests to magicbot example'''
This test module imports tests that come with pyfrc, and can be used
to test basic functionality of just about any robot.
'''
from pyfrc.tests import *
from magicbot.magicbot_tests import *
| <commit_before><commit_msg>Add tests to magicbot example<commit_after>'''
This test module imports tests that come with pyfrc, and can be used
to test basic functionality of just about any robot.
'''
from pyfrc.tests import *
from magicbot.magicbot_tests import *
| |
4460aee67c1d95fd896d131add5c99151b24573e | fileapi/tests/test_qunit.py | fileapi/tests/test_qunit.py | import os
from django.conf import settings
from django.contrib.staticfiles.testing import StaticLiveServerTestCase
from django.test.utils import override_settings
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions
from selenium.webdriv... | Add Django testcase to load QUnit test suite and assert there are no failures. | Add Django testcase to load QUnit test suite and assert there are no failures.
| Python | bsd-2-clause | mlavin/fileapi,mlavin/fileapi,mlavin/fileapi | Add Django testcase to load QUnit test suite and assert there are no failures. | import os
from django.conf import settings
from django.contrib.staticfiles.testing import StaticLiveServerTestCase
from django.test.utils import override_settings
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions
from selenium.webdriv... | <commit_before><commit_msg>Add Django testcase to load QUnit test suite and assert there are no failures.<commit_after> | import os
from django.conf import settings
from django.contrib.staticfiles.testing import StaticLiveServerTestCase
from django.test.utils import override_settings
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions
from selenium.webdriv... | Add Django testcase to load QUnit test suite and assert there are no failures.import os
from django.conf import settings
from django.contrib.staticfiles.testing import StaticLiveServerTestCase
from django.test.utils import override_settings
from selenium import webdriver
from selenium.webdriver.common.by import By
fr... | <commit_before><commit_msg>Add Django testcase to load QUnit test suite and assert there are no failures.<commit_after>import os
from django.conf import settings
from django.contrib.staticfiles.testing import StaticLiveServerTestCase
from django.test.utils import override_settings
from selenium import webdriver
from ... | |
e406c876e0668b1b2e6a0531d68249b579831d9b | apps/pyjob_check_finished_jobs.py | apps/pyjob_check_finished_jobs.py | #!/usr/bin/env python3
import os
def find_rms_dirs(dirpath):
dirs = [x for x in os.walk(dirpath)];
for i in range(len(dirs)):
if any('rms' in x for x in dirs[i][1]):
par_dir = dirs[i][0]
rms_dirs = [os.path.join(par_dir, x) for x in dirs[i][1] if 'rms' in x]
return... | Add script to check finished jobs | Add script to check finished jobs
| Python | mit | lnls-fac/job_manager | Add script to check finished jobs | #!/usr/bin/env python3
import os
def find_rms_dirs(dirpath):
dirs = [x for x in os.walk(dirpath)];
for i in range(len(dirs)):
if any('rms' in x for x in dirs[i][1]):
par_dir = dirs[i][0]
rms_dirs = [os.path.join(par_dir, x) for x in dirs[i][1] if 'rms' in x]
return... | <commit_before><commit_msg>Add script to check finished jobs<commit_after> | #!/usr/bin/env python3
import os
def find_rms_dirs(dirpath):
dirs = [x for x in os.walk(dirpath)];
for i in range(len(dirs)):
if any('rms' in x for x in dirs[i][1]):
par_dir = dirs[i][0]
rms_dirs = [os.path.join(par_dir, x) for x in dirs[i][1] if 'rms' in x]
return... | Add script to check finished jobs#!/usr/bin/env python3
import os
def find_rms_dirs(dirpath):
dirs = [x for x in os.walk(dirpath)];
for i in range(len(dirs)):
if any('rms' in x for x in dirs[i][1]):
par_dir = dirs[i][0]
rms_dirs = [os.path.join(par_dir, x) for x in dirs[i][1] ... | <commit_before><commit_msg>Add script to check finished jobs<commit_after>#!/usr/bin/env python3
import os
def find_rms_dirs(dirpath):
dirs = [x for x in os.walk(dirpath)];
for i in range(len(dirs)):
if any('rms' in x for x in dirs[i][1]):
par_dir = dirs[i][0]
rms_dirs = [os.p... | |
ff1b5a3bbfb1deb92d2b34d0951db35a48c1d630 | cifar.py | cifar.py | import cProfile
import data_loader
import data_manipulator
import data_saver
import neural_net
def main():
test_batch, train_batch = data_loader.load_data()
data_manipulator.categorize(train_batch, test_batch)
model = neural_net.get_trained_model(train_batches=train_batch,
... | Add main module for solving CIFAR-10 classification problem | Add main module for solving CIFAR-10 classification problem
| Python | mit | maciewar/AGH-Deep-Learning-CIFAR10 | Add main module for solving CIFAR-10 classification problem | import cProfile
import data_loader
import data_manipulator
import data_saver
import neural_net
def main():
test_batch, train_batch = data_loader.load_data()
data_manipulator.categorize(train_batch, test_batch)
model = neural_net.get_trained_model(train_batches=train_batch,
... | <commit_before><commit_msg>Add main module for solving CIFAR-10 classification problem<commit_after> | import cProfile
import data_loader
import data_manipulator
import data_saver
import neural_net
def main():
test_batch, train_batch = data_loader.load_data()
data_manipulator.categorize(train_batch, test_batch)
model = neural_net.get_trained_model(train_batches=train_batch,
... | Add main module for solving CIFAR-10 classification problemimport cProfile
import data_loader
import data_manipulator
import data_saver
import neural_net
def main():
test_batch, train_batch = data_loader.load_data()
data_manipulator.categorize(train_batch, test_batch)
model = neural_net.get_trained_model... | <commit_before><commit_msg>Add main module for solving CIFAR-10 classification problem<commit_after>import cProfile
import data_loader
import data_manipulator
import data_saver
import neural_net
def main():
test_batch, train_batch = data_loader.load_data()
data_manipulator.categorize(train_batch, test_batch)
... | |
2df69f87e92a9795aaf6095448e6222db485430d | automation/KMeansDataGenerator.py | automation/KMeansDataGenerator.py | import numpy as np
import sys
import random
def get_next(x):
i = 0
new_x = np.copy(x)
while new_x[i] == 1:
i = i + 1
new_x[i] = 1
for j in range(i):
new_x[j] = 0
return new_x
D = int(sys.argv[1])
K = int(sys.argv[2])
num = int(sys.argv[3])
point_file = open(sys.argv[4], "w")
center_file = open(sys.argv[5],... | Add Multi-Dimension KMeans data generator | Add Multi-Dimension KMeans data generator
| Python | apache-2.0 | mjsax/performance,dataArtisans/performance,mxm/flink-perf,project-flink/flink-perf,dataArtisans/performance,project-flink/flink-perf,mjsax/performance,mxm/flink-perf,mjsax/performance,dataArtisans/performance,mxm/flink-perf,project-flink/flink-perf | Add Multi-Dimension KMeans data generator | import numpy as np
import sys
import random
def get_next(x):
i = 0
new_x = np.copy(x)
while new_x[i] == 1:
i = i + 1
new_x[i] = 1
for j in range(i):
new_x[j] = 0
return new_x
D = int(sys.argv[1])
K = int(sys.argv[2])
num = int(sys.argv[3])
point_file = open(sys.argv[4], "w")
center_file = open(sys.argv[5],... | <commit_before><commit_msg>Add Multi-Dimension KMeans data generator<commit_after> | import numpy as np
import sys
import random
def get_next(x):
i = 0
new_x = np.copy(x)
while new_x[i] == 1:
i = i + 1
new_x[i] = 1
for j in range(i):
new_x[j] = 0
return new_x
D = int(sys.argv[1])
K = int(sys.argv[2])
num = int(sys.argv[3])
point_file = open(sys.argv[4], "w")
center_file = open(sys.argv[5],... | Add Multi-Dimension KMeans data generatorimport numpy as np
import sys
import random
def get_next(x):
i = 0
new_x = np.copy(x)
while new_x[i] == 1:
i = i + 1
new_x[i] = 1
for j in range(i):
new_x[j] = 0
return new_x
D = int(sys.argv[1])
K = int(sys.argv[2])
num = int(sys.argv[3])
point_file = open(sys.argv... | <commit_before><commit_msg>Add Multi-Dimension KMeans data generator<commit_after>import numpy as np
import sys
import random
def get_next(x):
i = 0
new_x = np.copy(x)
while new_x[i] == 1:
i = i + 1
new_x[i] = 1
for j in range(i):
new_x[j] = 0
return new_x
D = int(sys.argv[1])
K = int(sys.argv[2])
num = int... | |
85eaf8ead07e91187b1f52c86dec14395e6cd974 | tdclient/test/server_status_api_test.py | tdclient/test/server_status_api_test.py | #!/usr/bin/env python
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import with_statement
import functools
import os
from tdclient import api
from tdclient import version
def setup_function(function):
try:
del os.environ["TD_API_SERVER"]
except KeyErro... | Add test for `GET /v3/system/server_status` | Add test for `GET /v3/system/server_status`
| Python | apache-2.0 | treasure-data/td-client-python | Add test for `GET /v3/system/server_status` | #!/usr/bin/env python
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import with_statement
import functools
import os
from tdclient import api
from tdclient import version
def setup_function(function):
try:
del os.environ["TD_API_SERVER"]
except KeyErro... | <commit_before><commit_msg>Add test for `GET /v3/system/server_status`<commit_after> | #!/usr/bin/env python
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import with_statement
import functools
import os
from tdclient import api
from tdclient import version
def setup_function(function):
try:
del os.environ["TD_API_SERVER"]
except KeyErro... | Add test for `GET /v3/system/server_status`#!/usr/bin/env python
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import with_statement
import functools
import os
from tdclient import api
from tdclient import version
def setup_function(function):
try:
del os.... | <commit_before><commit_msg>Add test for `GET /v3/system/server_status`<commit_after>#!/usr/bin/env python
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import with_statement
import functools
import os
from tdclient import api
from tdclient import version
def setup_fun... | |
8fce09979271c721586ecd4de94fed3bad712ce8 | girder/utility/resource.py | girder/utility/resource.py | import cherrypy
import six
from girder.api.rest import Resource
def _walk_tree(node, path=[]):
route_map = {}
for k, v in six.iteritems(vars(node)):
if isinstance(v, Resource):
full_path = list(path)
full_path.append(k)
route_map[v] = full_path
path = [... | Add utility function to walk cherrypy tree | Add utility function to walk cherrypy tree
This function generates a map of Resource to mounted path.
| Python | apache-2.0 | Kitware/girder,jbeezley/girder,manthey/girder,data-exp-lab/girder,girder/girder,manthey/girder,Kitware/girder,Xarthisius/girder,data-exp-lab/girder,kotfic/girder,Kitware/girder,data-exp-lab/girder,kotfic/girder,data-exp-lab/girder,Xarthisius/girder,kotfic/girder,RafaelPalomar/girder,girder/girder,kotfic/girder,RafaelPa... | Add utility function to walk cherrypy tree
This function generates a map of Resource to mounted path. | import cherrypy
import six
from girder.api.rest import Resource
def _walk_tree(node, path=[]):
route_map = {}
for k, v in six.iteritems(vars(node)):
if isinstance(v, Resource):
full_path = list(path)
full_path.append(k)
route_map[v] = full_path
path = [... | <commit_before><commit_msg>Add utility function to walk cherrypy tree
This function generates a map of Resource to mounted path.<commit_after> | import cherrypy
import six
from girder.api.rest import Resource
def _walk_tree(node, path=[]):
route_map = {}
for k, v in six.iteritems(vars(node)):
if isinstance(v, Resource):
full_path = list(path)
full_path.append(k)
route_map[v] = full_path
path = [... | Add utility function to walk cherrypy tree
This function generates a map of Resource to mounted path.import cherrypy
import six
from girder.api.rest import Resource
def _walk_tree(node, path=[]):
route_map = {}
for k, v in six.iteritems(vars(node)):
if isinstance(v, Resource):
full_path ... | <commit_before><commit_msg>Add utility function to walk cherrypy tree
This function generates a map of Resource to mounted path.<commit_after>import cherrypy
import six
from girder.api.rest import Resource
def _walk_tree(node, path=[]):
route_map = {}
for k, v in six.iteritems(vars(node)):
if isinst... | |
09d559f8eaa4b65c480d48a4459c5a38c3dc7fd4 | katalogss/utils.py | katalogss/utils.py | import numpy as np
def centroid(x, flux):
mu = np.sum(x*flux)/np.sum(flux)
sd = np.sqrt(np.sum(flux * (x-mu)**2)/np.sum(flux))
return mu,sd
def approx_stokes_i(Axx,Ayy):
try: a = np.sqrt((Axx**2 + Ayy**2)/2.)
except TypeError:
a = type(Axx)()
a.header = Axx.header
... | Add module with utility functions. | Add module with utility functions.
| Python | bsd-2-clause | EoRImaging/katalogss | Add module with utility functions. | import numpy as np
def centroid(x, flux):
mu = np.sum(x*flux)/np.sum(flux)
sd = np.sqrt(np.sum(flux * (x-mu)**2)/np.sum(flux))
return mu,sd
def approx_stokes_i(Axx,Ayy):
try: a = np.sqrt((Axx**2 + Ayy**2)/2.)
except TypeError:
a = type(Axx)()
a.header = Axx.header
... | <commit_before><commit_msg>Add module with utility functions.<commit_after> | import numpy as np
def centroid(x, flux):
mu = np.sum(x*flux)/np.sum(flux)
sd = np.sqrt(np.sum(flux * (x-mu)**2)/np.sum(flux))
return mu,sd
def approx_stokes_i(Axx,Ayy):
try: a = np.sqrt((Axx**2 + Ayy**2)/2.)
except TypeError:
a = type(Axx)()
a.header = Axx.header
... | Add module with utility functions.import numpy as np
def centroid(x, flux):
mu = np.sum(x*flux)/np.sum(flux)
sd = np.sqrt(np.sum(flux * (x-mu)**2)/np.sum(flux))
return mu,sd
def approx_stokes_i(Axx,Ayy):
try: a = np.sqrt((Axx**2 + Ayy**2)/2.)
except TypeError:
a = type(Axx)()
... | <commit_before><commit_msg>Add module with utility functions.<commit_after>import numpy as np
def centroid(x, flux):
mu = np.sum(x*flux)/np.sum(flux)
sd = np.sqrt(np.sum(flux * (x-mu)**2)/np.sum(flux))
return mu,sd
def approx_stokes_i(Axx,Ayy):
try: a = np.sqrt((Axx**2 + Ayy**2)/2.)
except... | |
7c60724a93aa44e7afac3a59848f1abfa3598623 | updater.py | updater.py | import sys
import argparse
from ceterach.api import MediaWiki
from difflib import Differ
from parse_equipment import AUTOGEN_HEADER, AUTOGEN_FOOTER
parser = argparse.ArgumentParser()
parser.add_argument('infile', nargs='?', type=argparse.FileType('r'), default=sys.stdin,
help='The file to read t... | Add a script to automatically update an autogenerated table. | Add a script to automatically update an autogenerated table.
| Python | mit | rcfox/DragonsDogmaWikiParser | Add a script to automatically update an autogenerated table. | import sys
import argparse
from ceterach.api import MediaWiki
from difflib import Differ
from parse_equipment import AUTOGEN_HEADER, AUTOGEN_FOOTER
parser = argparse.ArgumentParser()
parser.add_argument('infile', nargs='?', type=argparse.FileType('r'), default=sys.stdin,
help='The file to read t... | <commit_before><commit_msg>Add a script to automatically update an autogenerated table.<commit_after> | import sys
import argparse
from ceterach.api import MediaWiki
from difflib import Differ
from parse_equipment import AUTOGEN_HEADER, AUTOGEN_FOOTER
parser = argparse.ArgumentParser()
parser.add_argument('infile', nargs='?', type=argparse.FileType('r'), default=sys.stdin,
help='The file to read t... | Add a script to automatically update an autogenerated table.import sys
import argparse
from ceterach.api import MediaWiki
from difflib import Differ
from parse_equipment import AUTOGEN_HEADER, AUTOGEN_FOOTER
parser = argparse.ArgumentParser()
parser.add_argument('infile', nargs='?', type=argparse.FileType('r'), def... | <commit_before><commit_msg>Add a script to automatically update an autogenerated table.<commit_after>import sys
import argparse
from ceterach.api import MediaWiki
from difflib import Differ
from parse_equipment import AUTOGEN_HEADER, AUTOGEN_FOOTER
parser = argparse.ArgumentParser()
parser.add_argument('infile', na... | |
d8d5ce4d1dd2228d70cc90025995a30dca7b075d | s2v3.py | s2v3.py | from s2v2 import *
def calculate_sum(data_sample):
total = 0
for row in data_sample[1:]: # slice to start at row two, but I think we should only skip row 1 if we're importing the full csv (data_from_csv), but if we use the data w/ the header (my_csv) we'll be skipping a row that we're not supposed to skip (the actu... | Define function for determining the sum of price rows | Define function for determining the sum of price rows
| Python | mit | alexmilesyounger/ds_basics | Define function for determining the sum of price rows | from s2v2 import *
def calculate_sum(data_sample):
total = 0
for row in data_sample[1:]: # slice to start at row two, but I think we should only skip row 1 if we're importing the full csv (data_from_csv), but if we use the data w/ the header (my_csv) we'll be skipping a row that we're not supposed to skip (the actu... | <commit_before><commit_msg>Define function for determining the sum of price rows<commit_after> | from s2v2 import *
def calculate_sum(data_sample):
total = 0
for row in data_sample[1:]: # slice to start at row two, but I think we should only skip row 1 if we're importing the full csv (data_from_csv), but if we use the data w/ the header (my_csv) we'll be skipping a row that we're not supposed to skip (the actu... | Define function for determining the sum of price rowsfrom s2v2 import *
def calculate_sum(data_sample):
total = 0
for row in data_sample[1:]: # slice to start at row two, but I think we should only skip row 1 if we're importing the full csv (data_from_csv), but if we use the data w/ the header (my_csv) we'll be ski... | <commit_before><commit_msg>Define function for determining the sum of price rows<commit_after>from s2v2 import *
def calculate_sum(data_sample):
total = 0
for row in data_sample[1:]: # slice to start at row two, but I think we should only skip row 1 if we're importing the full csv (data_from_csv), but if we use the... | |
1d76b22bc0090580e4ccbfb43e2f5d88d86f2bc7 | tests/app/main/test_placeholder_form.py | tests/app/main/test_placeholder_form.py | from app.main.forms import get_placeholder_form_instance
from wtforms import Label
def test_form_class_not_mutated(app_):
with app_.test_request_context(
method='POST',
data={'placeholder_value': ''}
) as req:
form1 = get_placeholder_form_instance('name', {}, optional_placeholder=Fals... | Add extra tests to make sure that the form is safe | Add extra tests to make sure that the form is safe
Previous implementations of this functionality mutated the base form
class, which broke a bunch of stuff.
I want to make sure that getting this form for one placeholder doesn’t
change other forms that have already been instantiated for other
placeholders.
Mutation i... | Python | mit | gov-cjwaszczuk/notifications-admin,alphagov/notifications-admin,gov-cjwaszczuk/notifications-admin,alphagov/notifications-admin,alphagov/notifications-admin,gov-cjwaszczuk/notifications-admin,gov-cjwaszczuk/notifications-admin,alphagov/notifications-admin | Add extra tests to make sure that the form is safe
Previous implementations of this functionality mutated the base form
class, which broke a bunch of stuff.
I want to make sure that getting this form for one placeholder doesn’t
change other forms that have already been instantiated for other
placeholders.
Mutation i... | from app.main.forms import get_placeholder_form_instance
from wtforms import Label
def test_form_class_not_mutated(app_):
with app_.test_request_context(
method='POST',
data={'placeholder_value': ''}
) as req:
form1 = get_placeholder_form_instance('name', {}, optional_placeholder=Fals... | <commit_before><commit_msg>Add extra tests to make sure that the form is safe
Previous implementations of this functionality mutated the base form
class, which broke a bunch of stuff.
I want to make sure that getting this form for one placeholder doesn’t
change other forms that have already been instantiated for othe... | from app.main.forms import get_placeholder_form_instance
from wtforms import Label
def test_form_class_not_mutated(app_):
with app_.test_request_context(
method='POST',
data={'placeholder_value': ''}
) as req:
form1 = get_placeholder_form_instance('name', {}, optional_placeholder=Fals... | Add extra tests to make sure that the form is safe
Previous implementations of this functionality mutated the base form
class, which broke a bunch of stuff.
I want to make sure that getting this form for one placeholder doesn’t
change other forms that have already been instantiated for other
placeholders.
Mutation i... | <commit_before><commit_msg>Add extra tests to make sure that the form is safe
Previous implementations of this functionality mutated the base form
class, which broke a bunch of stuff.
I want to make sure that getting this form for one placeholder doesn’t
change other forms that have already been instantiated for othe... | |
f335f0032b9eb0847de4fd1261f063012bc4d2f5 | functest/tests/unit/features/test_promise.py | functest/tests/unit/features/test_promise.py | #!/usr/bin/env python
# Copyright (c) 2017 Orange and others.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
# pylint: d... | Add unit tests for promise | Add unit tests for promise
Change-Id: I538fcedbfbef46ae36b8eff5a20acaa28a8bfb85
Signed-off-by: Cédric Ollivier <[email protected]>
| Python | apache-2.0 | mywulin/functest,opnfv/functest,mywulin/functest,opnfv/functest | Add unit tests for promise
Change-Id: I538fcedbfbef46ae36b8eff5a20acaa28a8bfb85
Signed-off-by: Cédric Ollivier <[email protected]> | #!/usr/bin/env python
# Copyright (c) 2017 Orange and others.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
# pylint: d... | <commit_before><commit_msg>Add unit tests for promise
Change-Id: I538fcedbfbef46ae36b8eff5a20acaa28a8bfb85
Signed-off-by: Cédric Ollivier <[email protected]><commit_after> | #!/usr/bin/env python
# Copyright (c) 2017 Orange and others.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
# pylint: d... | Add unit tests for promise
Change-Id: I538fcedbfbef46ae36b8eff5a20acaa28a8bfb85
Signed-off-by: Cédric Ollivier <[email protected]>#!/usr/bin/env python
# Copyright (c) 2017 Orange and others.
#
# All rights reserved. This program and the accompanying materials
# are made available un... | <commit_before><commit_msg>Add unit tests for promise
Change-Id: I538fcedbfbef46ae36b8eff5a20acaa28a8bfb85
Signed-off-by: Cédric Ollivier <[email protected]><commit_after>#!/usr/bin/env python
# Copyright (c) 2017 Orange and others.
#
# All rights reserved. This program and the accom... | |
0c20abe4420b92b25acb28e67cd344f6b45d28ef | flake8diff/vcs/hg.py | flake8diff/vcs/hg.py | from __future__ import unicode_literals, print_function
import logging
import subprocess
from ..utils import _execute
from .base import VCSBase
logger = logging.getLogger(__name__)
class HgVCS(VCSBase):
"""
Mercurial support implementation
"""
name = 'hg'
def get_vcs(self):
"""
... | Introduce HgVCS, check for extdiff extension enabled | Introduce HgVCS, check for extdiff extension enabled
| Python | mit | dealertrack/flake8-diff,miki725/flake8-diff | Introduce HgVCS, check for extdiff extension enabled | from __future__ import unicode_literals, print_function
import logging
import subprocess
from ..utils import _execute
from .base import VCSBase
logger = logging.getLogger(__name__)
class HgVCS(VCSBase):
"""
Mercurial support implementation
"""
name = 'hg'
def get_vcs(self):
"""
... | <commit_before><commit_msg>Introduce HgVCS, check for extdiff extension enabled<commit_after> | from __future__ import unicode_literals, print_function
import logging
import subprocess
from ..utils import _execute
from .base import VCSBase
logger = logging.getLogger(__name__)
class HgVCS(VCSBase):
"""
Mercurial support implementation
"""
name = 'hg'
def get_vcs(self):
"""
... | Introduce HgVCS, check for extdiff extension enabledfrom __future__ import unicode_literals, print_function
import logging
import subprocess
from ..utils import _execute
from .base import VCSBase
logger = logging.getLogger(__name__)
class HgVCS(VCSBase):
"""
Mercurial support implementation
"""
na... | <commit_before><commit_msg>Introduce HgVCS, check for extdiff extension enabled<commit_after>from __future__ import unicode_literals, print_function
import logging
import subprocess
from ..utils import _execute
from .base import VCSBase
logger = logging.getLogger(__name__)
class HgVCS(VCSBase):
"""
Mercur... | |
1b3c0e108fed7eb33edc2ee3646819e75267de69 | bot/action/standard/info/formatter/__init__.py | bot/action/standard/info/formatter/__init__.py | from typing import List
from bot.action.util.format import DateFormatter
from bot.action.util.textformat import FormattedText
from bot.api.api import Api
from bot.api.domain import ApiObject
class ApiObjectInfoFormatter:
def __init__(self, api: Api, api_object: ApiObject):
self.api = api
self.api... | Create info.formatter subpackage, and add ApiObjectInfoFormatter base class | Create info.formatter subpackage, and add ApiObjectInfoFormatter base class
| Python | agpl-3.0 | alvarogzp/telegram-bot,alvarogzp/telegram-bot | Create info.formatter subpackage, and add ApiObjectInfoFormatter base class | from typing import List
from bot.action.util.format import DateFormatter
from bot.action.util.textformat import FormattedText
from bot.api.api import Api
from bot.api.domain import ApiObject
class ApiObjectInfoFormatter:
def __init__(self, api: Api, api_object: ApiObject):
self.api = api
self.api... | <commit_before><commit_msg>Create info.formatter subpackage, and add ApiObjectInfoFormatter base class<commit_after> | from typing import List
from bot.action.util.format import DateFormatter
from bot.action.util.textformat import FormattedText
from bot.api.api import Api
from bot.api.domain import ApiObject
class ApiObjectInfoFormatter:
def __init__(self, api: Api, api_object: ApiObject):
self.api = api
self.api... | Create info.formatter subpackage, and add ApiObjectInfoFormatter base classfrom typing import List
from bot.action.util.format import DateFormatter
from bot.action.util.textformat import FormattedText
from bot.api.api import Api
from bot.api.domain import ApiObject
class ApiObjectInfoFormatter:
def __init__(self... | <commit_before><commit_msg>Create info.formatter subpackage, and add ApiObjectInfoFormatter base class<commit_after>from typing import List
from bot.action.util.format import DateFormatter
from bot.action.util.textformat import FormattedText
from bot.api.api import Api
from bot.api.domain import ApiObject
class ApiO... | |
7ff3a40d5cdc9fe8d7a960377a7d2f4ea2fb411d | Ratings-Counter.py | Ratings-Counter.py | from pyspark import SparkConf, SparkContext
import collections
conf = SparkConf().setMaster("local").setAppName("RatingsHistogram")
sc = SparkContext(conf = conf)
lines = sc.textFile("ml-100k/u.data")
ratings = lines.map(lambda x: x.split()[2])
result = ratings.countByValue()
sortedResults = collections.Or... | Add a test for running spark | Add a test for running spark
We're using data from http://grouplens.org/datasets/movielens/
For this test we're using the MovieLens 100K Dataset
| Python | mit | tonirilix/apache-spark-hands-on | Add a test for running spark
We're using data from http://grouplens.org/datasets/movielens/
For this test we're using the MovieLens 100K Dataset | from pyspark import SparkConf, SparkContext
import collections
conf = SparkConf().setMaster("local").setAppName("RatingsHistogram")
sc = SparkContext(conf = conf)
lines = sc.textFile("ml-100k/u.data")
ratings = lines.map(lambda x: x.split()[2])
result = ratings.countByValue()
sortedResults = collections.Or... | <commit_before><commit_msg>Add a test for running spark
We're using data from http://grouplens.org/datasets/movielens/
For this test we're using the MovieLens 100K Dataset<commit_after> | from pyspark import SparkConf, SparkContext
import collections
conf = SparkConf().setMaster("local").setAppName("RatingsHistogram")
sc = SparkContext(conf = conf)
lines = sc.textFile("ml-100k/u.data")
ratings = lines.map(lambda x: x.split()[2])
result = ratings.countByValue()
sortedResults = collections.Or... | Add a test for running spark
We're using data from http://grouplens.org/datasets/movielens/
For this test we're using the MovieLens 100K Datasetfrom pyspark import SparkConf, SparkContext
import collections
conf = SparkConf().setMaster("local").setAppName("RatingsHistogram")
sc = SparkContext(conf = conf)
line... | <commit_before><commit_msg>Add a test for running spark
We're using data from http://grouplens.org/datasets/movielens/
For this test we're using the MovieLens 100K Dataset<commit_after>from pyspark import SparkConf, SparkContext
import collections
conf = SparkConf().setMaster("local").setAppName("RatingsHistogram"... | |
717bafb43870b45d49bfc9d89408544feecb1a78 | hooks/update-nrpe.py | hooks/update-nrpe.py | #!/usr/bin/env python
import sys
from charmhelpers.contrib.charmsupport import nrpe
def update_nrpe_checks():
nrpe_compat = nrpe.NRPE()
# The use of port 80 assumes the 'secure' charm configuration
# value is false, which is the scenario for our deployment on
# staging and production. If testing this... | Update description of the nagios port for check_http. | Update description of the nagios port for check_http.
| Python | agpl-3.0 | juju/juju-gui-charm,juju/juju-gui-charm | Update description of the nagios port for check_http. | #!/usr/bin/env python
import sys
from charmhelpers.contrib.charmsupport import nrpe
def update_nrpe_checks():
nrpe_compat = nrpe.NRPE()
# The use of port 80 assumes the 'secure' charm configuration
# value is false, which is the scenario for our deployment on
# staging and production. If testing this... | <commit_before><commit_msg>Update description of the nagios port for check_http.<commit_after> | #!/usr/bin/env python
import sys
from charmhelpers.contrib.charmsupport import nrpe
def update_nrpe_checks():
nrpe_compat = nrpe.NRPE()
# The use of port 80 assumes the 'secure' charm configuration
# value is false, which is the scenario for our deployment on
# staging and production. If testing this... | Update description of the nagios port for check_http.#!/usr/bin/env python
import sys
from charmhelpers.contrib.charmsupport import nrpe
def update_nrpe_checks():
nrpe_compat = nrpe.NRPE()
# The use of port 80 assumes the 'secure' charm configuration
# value is false, which is the scenario for our deploy... | <commit_before><commit_msg>Update description of the nagios port for check_http.<commit_after>#!/usr/bin/env python
import sys
from charmhelpers.contrib.charmsupport import nrpe
def update_nrpe_checks():
nrpe_compat = nrpe.NRPE()
# The use of port 80 assumes the 'secure' charm configuration
# value is fa... | |
8bdd32b41b1a89aac50eb25ed5bd32c3c15b49c7 | leetcode/171-Excel-Sheet-Column-Number/ExcelSheetColNum_001.py | leetcode/171-Excel-Sheet-Column-Number/ExcelSheetColNum_001.py | class Solution(object):
def titleToNumber(self, s):
"""
:type s: str
:rtype: int
"""
res = 0
for i in range(len(s) - 1, -1, -1):
res += (ord(s[i]) - ord('A') + 1) * 26 ** (len(s) - 1 - i)
return res | Create Simplified ExcelSheetColNum for Leetcode | Create Simplified ExcelSheetColNum for Leetcode
| Python | mit | cc13ny/Allin,cc13ny/Allin,Chasego/codirit,cc13ny/Allin,cc13ny/algo,Chasego/cod,cc13ny/Allin,Chasego/codi,cc13ny/algo,Chasego/codirit,cc13ny/Allin,Chasego/codi,Chasego/codi,Chasego/codi,cc13ny/algo,Chasego/cod,Chasego/cod,cc13ny/algo,Chasego/cod,Chasego/codirit,Chasego/codi,Chasego/cod,cc13ny/algo,Chasego/codirit,Chaseg... | Create Simplified ExcelSheetColNum for Leetcode | class Solution(object):
def titleToNumber(self, s):
"""
:type s: str
:rtype: int
"""
res = 0
for i in range(len(s) - 1, -1, -1):
res += (ord(s[i]) - ord('A') + 1) * 26 ** (len(s) - 1 - i)
return res | <commit_before><commit_msg>Create Simplified ExcelSheetColNum for Leetcode<commit_after> | class Solution(object):
def titleToNumber(self, s):
"""
:type s: str
:rtype: int
"""
res = 0
for i in range(len(s) - 1, -1, -1):
res += (ord(s[i]) - ord('A') + 1) * 26 ** (len(s) - 1 - i)
return res | Create Simplified ExcelSheetColNum for Leetcodeclass Solution(object):
def titleToNumber(self, s):
"""
:type s: str
:rtype: int
"""
res = 0
for i in range(len(s) - 1, -1, -1):
res += (ord(s[i]) - ord('A') + 1) * 26 ** (len(s) - 1 - i)
retu... | <commit_before><commit_msg>Create Simplified ExcelSheetColNum for Leetcode<commit_after>class Solution(object):
def titleToNumber(self, s):
"""
:type s: str
:rtype: int
"""
res = 0
for i in range(len(s) - 1, -1, -1):
res += (ord(s[i]) - ord('A') + 1) * 26 ... | |
7b5de280562f5984b04c63432de8f28e03b57cbd | firecares/firestation/migrations/0020_update_greeley_headquarters_location.py | firecares/firestation/migrations/0020_update_greeley_headquarters_location.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib.gis.geos import Point
from django.db import models, migrations
from genericm2m.utils import monkey_patch
class Migration(migrations.Migration):
dependencies = [
('firestation', '0019_assign-station-number-2'),
('... | Move Union Colony Fire rescue authority to correct location | Move Union Colony Fire rescue authority to correct location
| Python | mit | HunterConnelly/firecares,HunterConnelly/firecares,HunterConnelly/firecares,meilinger/firecares,FireCARES/firecares,FireCARES/firecares,HunterConnelly/firecares,FireCARES/firecares,FireCARES/firecares,meilinger/firecares,meilinger/firecares,meilinger/firecares,FireCARES/firecares | Move Union Colony Fire rescue authority to correct location | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib.gis.geos import Point
from django.db import models, migrations
from genericm2m.utils import monkey_patch
class Migration(migrations.Migration):
dependencies = [
('firestation', '0019_assign-station-number-2'),
('... | <commit_before><commit_msg>Move Union Colony Fire rescue authority to correct location<commit_after> | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib.gis.geos import Point
from django.db import models, migrations
from genericm2m.utils import monkey_patch
class Migration(migrations.Migration):
dependencies = [
('firestation', '0019_assign-station-number-2'),
('... | Move Union Colony Fire rescue authority to correct location# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib.gis.geos import Point
from django.db import models, migrations
from genericm2m.utils import monkey_patch
class Migration(migrations.Migration):
dependencies = [
... | <commit_before><commit_msg>Move Union Colony Fire rescue authority to correct location<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib.gis.geos import Point
from django.db import models, migrations
from genericm2m.utils import monkey_patch
class Migration(migrations.M... | |
27b43a8e46ad7a47415942587ab23e391c72b269 | tests/functional/core/test_brocker.py | tests/functional/core/test_brocker.py | from circus.client import CircusClient
from onitu.utils import get_circusctl_endpoint
from tests.utils.testdriver import TestDriver
from tests.utils.loop import BooleanLoop
def test_abort_if_no_source(setup, launcher):
A = TestDriver('A', speed_bump=True)
B = TestDriver('B', speed_bump=True)
setup.add(... | Add some tests for the brocker | Add some tests for the brocker
| Python | mit | onitu/onitu,onitu/onitu,onitu/onitu | Add some tests for the brocker | from circus.client import CircusClient
from onitu.utils import get_circusctl_endpoint
from tests.utils.testdriver import TestDriver
from tests.utils.loop import BooleanLoop
def test_abort_if_no_source(setup, launcher):
A = TestDriver('A', speed_bump=True)
B = TestDriver('B', speed_bump=True)
setup.add(... | <commit_before><commit_msg>Add some tests for the brocker<commit_after> | from circus.client import CircusClient
from onitu.utils import get_circusctl_endpoint
from tests.utils.testdriver import TestDriver
from tests.utils.loop import BooleanLoop
def test_abort_if_no_source(setup, launcher):
A = TestDriver('A', speed_bump=True)
B = TestDriver('B', speed_bump=True)
setup.add(... | Add some tests for the brockerfrom circus.client import CircusClient
from onitu.utils import get_circusctl_endpoint
from tests.utils.testdriver import TestDriver
from tests.utils.loop import BooleanLoop
def test_abort_if_no_source(setup, launcher):
A = TestDriver('A', speed_bump=True)
B = TestDriver('B', sp... | <commit_before><commit_msg>Add some tests for the brocker<commit_after>from circus.client import CircusClient
from onitu.utils import get_circusctl_endpoint
from tests.utils.testdriver import TestDriver
from tests.utils.loop import BooleanLoop
def test_abort_if_no_source(setup, launcher):
A = TestDriver('A', sp... | |
72ea0dc2c55ac139e006eebc0fed29a20d3900ad | tests/test_django_default_settings.py | tests/test_django_default_settings.py | import unittest
from django.conf import global_settings as default
import cbs
class MySettings:
@property
def INSTALLED_APPS(self):
# Customize an empty global setting.
return list(default.INSTALLED_APPS) + ['test']
@property
def CACHES(self):
# Customize a non-empty global... | Add a test demonstrating how to use the django global settings. | Add a test demonstrating how to use the django global settings.
| Python | bsd-2-clause | funkybob/django-classy-settings | Add a test demonstrating how to use the django global settings. | import unittest
from django.conf import global_settings as default
import cbs
class MySettings:
@property
def INSTALLED_APPS(self):
# Customize an empty global setting.
return list(default.INSTALLED_APPS) + ['test']
@property
def CACHES(self):
# Customize a non-empty global... | <commit_before><commit_msg>Add a test demonstrating how to use the django global settings.<commit_after> | import unittest
from django.conf import global_settings as default
import cbs
class MySettings:
@property
def INSTALLED_APPS(self):
# Customize an empty global setting.
return list(default.INSTALLED_APPS) + ['test']
@property
def CACHES(self):
# Customize a non-empty global... | Add a test demonstrating how to use the django global settings.import unittest
from django.conf import global_settings as default
import cbs
class MySettings:
@property
def INSTALLED_APPS(self):
# Customize an empty global setting.
return list(default.INSTALLED_APPS) + ['test']
@proper... | <commit_before><commit_msg>Add a test demonstrating how to use the django global settings.<commit_after>import unittest
from django.conf import global_settings as default
import cbs
class MySettings:
@property
def INSTALLED_APPS(self):
# Customize an empty global setting.
return list(defaul... | |
a142dfd0ec94785df58d766abc97df837106a736 | tests/test_50_xarray_to_grib_regular_ll.py | tests/test_50_xarray_to_grib_regular_ll.py |
import numpy as np
import pytest
import xarray as xr
from cfgrib import xarray_store
@pytest.fixture()
def canonic_dataarray():
da = xr.DataArray(
np.arange(20.).reshape((4, 5)),
coords=[np.linspace(90., -90., 4), np.linspace(0., 360., 5, endpoint=False)],
dims=['latitude', 'longitude'],... | Add some simple tests for grib_keys auto-detection and user definition. | Add some simple tests for grib_keys auto-detection and user definition.
| Python | apache-2.0 | ecmwf/cfgrib | Add some simple tests for grib_keys auto-detection and user definition. |
import numpy as np
import pytest
import xarray as xr
from cfgrib import xarray_store
@pytest.fixture()
def canonic_dataarray():
da = xr.DataArray(
np.arange(20.).reshape((4, 5)),
coords=[np.linspace(90., -90., 4), np.linspace(0., 360., 5, endpoint=False)],
dims=['latitude', 'longitude'],... | <commit_before><commit_msg>Add some simple tests for grib_keys auto-detection and user definition.<commit_after> |
import numpy as np
import pytest
import xarray as xr
from cfgrib import xarray_store
@pytest.fixture()
def canonic_dataarray():
da = xr.DataArray(
np.arange(20.).reshape((4, 5)),
coords=[np.linspace(90., -90., 4), np.linspace(0., 360., 5, endpoint=False)],
dims=['latitude', 'longitude'],... | Add some simple tests for grib_keys auto-detection and user definition.
import numpy as np
import pytest
import xarray as xr
from cfgrib import xarray_store
@pytest.fixture()
def canonic_dataarray():
da = xr.DataArray(
np.arange(20.).reshape((4, 5)),
coords=[np.linspace(90., -90., 4), np.linspace... | <commit_before><commit_msg>Add some simple tests for grib_keys auto-detection and user definition.<commit_after>
import numpy as np
import pytest
import xarray as xr
from cfgrib import xarray_store
@pytest.fixture()
def canonic_dataarray():
da = xr.DataArray(
np.arange(20.).reshape((4, 5)),
coord... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.