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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
41beca23fff6eab718550d0ce8d22769653c3109 | sauce_test/test_suite.py | sauce_test/test_suite.py | # This contain a list of individual test and will be run from Jenkins.
import unittest
import access_dvn
# This is a list of testFileName.testClass
def suite():
return unittest.TestSuite((\
unittest.makeSuite(access_dvn.AccessDVN),
))
if __name__ == "__main__":
result = unittest.TextTestRunne... | # This contain a list of individual test and will be run from Jenkins.
import unittest
import access_dvn
import test_dataverse
import test_dataset
# This is a list of testFileName.testClass
def suite():
return unittest.TestSuite((\
unittest.makeSuite(access_dvn.AccessDVN),
unittest.makeSuite(test_... | Update test suite to include dataverse and dataset tests. | Update test suite to include dataverse and dataset tests. | Python | apache-2.0 | ekoi/DANS-DVN-4.6.1,ekoi/DANS-DVN-4.6.1,quarian/dataverse,leeper/dataverse-1,leeper/dataverse-1,bmckinney/dataverse-canonical,bmckinney/dataverse-canonical,JayanthyChengan/dataverse,quarian/dataverse,quarian/dataverse,leeper/dataverse-1,leeper/dataverse-1,JayanthyChengan/dataverse,JayanthyChengan/dataverse,quarian/data... | # This contain a list of individual test and will be run from Jenkins.
import unittest
import access_dvn
# This is a list of testFileName.testClass
def suite():
return unittest.TestSuite((\
unittest.makeSuite(access_dvn.AccessDVN),
))
if __name__ == "__main__":
result = unittest.TextTestRunne... | # This contain a list of individual test and will be run from Jenkins.
import unittest
import access_dvn
import test_dataverse
import test_dataset
# This is a list of testFileName.testClass
def suite():
return unittest.TestSuite((\
unittest.makeSuite(access_dvn.AccessDVN),
unittest.makeSuite(test_... | <commit_before># This contain a list of individual test and will be run from Jenkins.
import unittest
import access_dvn
# This is a list of testFileName.testClass
def suite():
return unittest.TestSuite((\
unittest.makeSuite(access_dvn.AccessDVN),
))
if __name__ == "__main__":
result = unittes... | # This contain a list of individual test and will be run from Jenkins.
import unittest
import access_dvn
import test_dataverse
import test_dataset
# This is a list of testFileName.testClass
def suite():
return unittest.TestSuite((\
unittest.makeSuite(access_dvn.AccessDVN),
unittest.makeSuite(test_... | # This contain a list of individual test and will be run from Jenkins.
import unittest
import access_dvn
# This is a list of testFileName.testClass
def suite():
return unittest.TestSuite((\
unittest.makeSuite(access_dvn.AccessDVN),
))
if __name__ == "__main__":
result = unittest.TextTestRunne... | <commit_before># This contain a list of individual test and will be run from Jenkins.
import unittest
import access_dvn
# This is a list of testFileName.testClass
def suite():
return unittest.TestSuite((\
unittest.makeSuite(access_dvn.AccessDVN),
))
if __name__ == "__main__":
result = unittes... |
a13f23b5f1b11b40db3325c46add3508f43cf649 | python/qilinguist/test/test_qilinguist_list.py | python/qilinguist/test/test_qilinguist_list.py | ## Copyright (c) 2012-2015 Aldebaran Robotics. All rights reserved.
## Use of this source code is governed by a BSD-style license that can be
## found in the COPYING file.
from qibuild.test.conftest import TestBuildWorkTree
def test_simple(qilinguist_action, record_messages):
build_worktree = TestBuildWorkTree()
... | Add a test for `qilinguist list` | Add a test for `qilinguist list`
Change-Id: Ia2b2e937732e80a231df9ca57a9d9f39d337da1f
Reviewed-on: http://gerrit.aldebaran.lan/62796
Tested-by: gerrit
Reviewed-by: vbarbaresi <[email protected]>
| Python | bsd-3-clause | aldebaran/qibuild,aldebaran/qibuild,aldebaran/qibuild,aldebaran/qibuild | Add a test for `qilinguist list`
Change-Id: Ia2b2e937732e80a231df9ca57a9d9f39d337da1f
Reviewed-on: http://gerrit.aldebaran.lan/62796
Tested-by: gerrit
Reviewed-by: vbarbaresi <[email protected]> | ## Copyright (c) 2012-2015 Aldebaran Robotics. All rights reserved.
## Use of this source code is governed by a BSD-style license that can be
## found in the COPYING file.
from qibuild.test.conftest import TestBuildWorkTree
def test_simple(qilinguist_action, record_messages):
build_worktree = TestBuildWorkTree()
... | <commit_before><commit_msg>Add a test for `qilinguist list`
Change-Id: Ia2b2e937732e80a231df9ca57a9d9f39d337da1f
Reviewed-on: http://gerrit.aldebaran.lan/62796
Tested-by: gerrit
Reviewed-by: vbarbaresi <[email protected]><commit_after> | ## Copyright (c) 2012-2015 Aldebaran Robotics. All rights reserved.
## Use of this source code is governed by a BSD-style license that can be
## found in the COPYING file.
from qibuild.test.conftest import TestBuildWorkTree
def test_simple(qilinguist_action, record_messages):
build_worktree = TestBuildWorkTree()
... | Add a test for `qilinguist list`
Change-Id: Ia2b2e937732e80a231df9ca57a9d9f39d337da1f
Reviewed-on: http://gerrit.aldebaran.lan/62796
Tested-by: gerrit
Reviewed-by: vbarbaresi <[email protected]>## Copyright (c) 2012-2015 Aldebaran Robotics. All rights reserved.
## Use of t... | <commit_before><commit_msg>Add a test for `qilinguist list`
Change-Id: Ia2b2e937732e80a231df9ca57a9d9f39d337da1f
Reviewed-on: http://gerrit.aldebaran.lan/62796
Tested-by: gerrit
Reviewed-by: vbarbaresi <[email protected]><commit_after>## Copyright (c) 2012-2015 Aldebaran R... | |
f3e0664c4b062587badaa86ddfc9e75711ecf631 | coding-practice/Trie/count_using_wildcards.py | coding-practice/Trie/count_using_wildcards.py | class Trie:
def __init__(self):
self.root = {}
self.end = '*'
def insert(self, word):
cur = self.root
for c in word:
if c in cur:
cur = cur[c]
else:
cur[c] = {}
cur = cur[c]
cur[self.end] = True
... | Use Trie to find no of words matching pattern | Use Trie to find no of words matching pattern
| Python | mit | sayak1711/coding_solutions,sayak1711/coding_solutions,sayak1711/coding_solutions,sayak1711/coding_solutions | Use Trie to find no of words matching pattern | class Trie:
def __init__(self):
self.root = {}
self.end = '*'
def insert(self, word):
cur = self.root
for c in word:
if c in cur:
cur = cur[c]
else:
cur[c] = {}
cur = cur[c]
cur[self.end] = True
... | <commit_before><commit_msg>Use Trie to find no of words matching pattern<commit_after> | class Trie:
def __init__(self):
self.root = {}
self.end = '*'
def insert(self, word):
cur = self.root
for c in word:
if c in cur:
cur = cur[c]
else:
cur[c] = {}
cur = cur[c]
cur[self.end] = True
... | Use Trie to find no of words matching patternclass Trie:
def __init__(self):
self.root = {}
self.end = '*'
def insert(self, word):
cur = self.root
for c in word:
if c in cur:
cur = cur[c]
else:
cur[c] = {}
... | <commit_before><commit_msg>Use Trie to find no of words matching pattern<commit_after>class Trie:
def __init__(self):
self.root = {}
self.end = '*'
def insert(self, word):
cur = self.root
for c in word:
if c in cur:
cur = cur[c]
else:
... | |
e66c6289a7986048329e86162fa59441df7b9a0a | studies/migrations/0003_auto_20170615_1404.py | studies/migrations/0003_auto_20170615_1404.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.1 on 2017-06-15 14:04
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('studies', '0002_auto_20170607_1800'),
]
operations = [
migrations.RenameFie... | Add migration for changes to study model. | Add migration for changes to study model.
| Python | apache-2.0 | CenterForOpenScience/lookit-api,CenterForOpenScience/lookit-api,CenterForOpenScience/lookit-api,pattisdr/lookit-api,pattisdr/lookit-api,pattisdr/lookit-api | Add migration for changes to study model. | # -*- coding: utf-8 -*-
# Generated by Django 1.11.1 on 2017-06-15 14:04
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('studies', '0002_auto_20170607_1800'),
]
operations = [
migrations.RenameFie... | <commit_before><commit_msg>Add migration for changes to study model.<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.11.1 on 2017-06-15 14:04
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('studies', '0002_auto_20170607_1800'),
]
operations = [
migrations.RenameFie... | Add migration for changes to study model.# -*- coding: utf-8 -*-
# Generated by Django 1.11.1 on 2017-06-15 14:04
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('studies', '0002_auto_20170607_1800'),
]
op... | <commit_before><commit_msg>Add migration for changes to study model.<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.11.1 on 2017-06-15 14:04
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('studies', ... | |
ef72df34a42eb32409a4928346382f6b5e670000 | core/migrations/0007_pin_private.py | core/migrations/0007_pin_private.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.26 on 2020-02-11 05:32
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0006_remove_pin_origin'),
]
operations = [
migrations.AddField(
... | Add migrations for private property of pin | Feature: Add migrations for private property of pin
| Python | bsd-2-clause | lapo-luchini/pinry,lapo-luchini/pinry,pinry/pinry,pinry/pinry,pinry/pinry,lapo-luchini/pinry,pinry/pinry,lapo-luchini/pinry | Feature: Add migrations for private property of pin | # -*- coding: utf-8 -*-
# Generated by Django 1.11.26 on 2020-02-11 05:32
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0006_remove_pin_origin'),
]
operations = [
migrations.AddField(
... | <commit_before><commit_msg>Feature: Add migrations for private property of pin<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.11.26 on 2020-02-11 05:32
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0006_remove_pin_origin'),
]
operations = [
migrations.AddField(
... | Feature: Add migrations for private property of pin# -*- coding: utf-8 -*-
# Generated by Django 1.11.26 on 2020-02-11 05:32
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0006_remove_pin_origin'),
]
... | <commit_before><commit_msg>Feature: Add migrations for private property of pin<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.11.26 on 2020-02-11 05:32
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
(... | |
48dbaf596ee8af826d7e9dec96fee0c626005281 | examples/web_cookies.py | examples/web_cookies.py | #!/usr/bin/env python3
"""Example for aiohttp.web basic server with cookies.
"""
import asyncio
from aiohttp import web
tmpl = '''\
<html>
<body>
<a href="/login">Login</a><br/>
<a href="/logout">Logout</a><br/>
{}
</body>
</html>'''
@asyncio.coroutine
def root(request):
resp = ... | Add example for server-side cookies | Add example for server-side cookies
| Python | apache-2.0 | z2v/aiohttp,avanov/aiohttp,singulared/aiohttp,alunduil/aiohttp,danielnelson/aiohttp,hellysmile/aiohttp,pfreixes/aiohttp,pathcl/aiohttp,morgan-del/aiohttp,alexsdutton/aiohttp,decentfox/aiohttp,panda73111/aiohttp,alex-eri/aiohttp-1,AraHaanOrg/aiohttp,elastic-coders/aiohttp,pfreixes/aiohttp,elastic-coders/aiohttp,mind1mas... | Add example for server-side cookies | #!/usr/bin/env python3
"""Example for aiohttp.web basic server with cookies.
"""
import asyncio
from aiohttp import web
tmpl = '''\
<html>
<body>
<a href="/login">Login</a><br/>
<a href="/logout">Logout</a><br/>
{}
</body>
</html>'''
@asyncio.coroutine
def root(request):
resp = ... | <commit_before><commit_msg>Add example for server-side cookies<commit_after> | #!/usr/bin/env python3
"""Example for aiohttp.web basic server with cookies.
"""
import asyncio
from aiohttp import web
tmpl = '''\
<html>
<body>
<a href="/login">Login</a><br/>
<a href="/logout">Logout</a><br/>
{}
</body>
</html>'''
@asyncio.coroutine
def root(request):
resp = ... | Add example for server-side cookies#!/usr/bin/env python3
"""Example for aiohttp.web basic server with cookies.
"""
import asyncio
from aiohttp import web
tmpl = '''\
<html>
<body>
<a href="/login">Login</a><br/>
<a href="/logout">Logout</a><br/>
{}
</body>
</html>'''
@asyncio.corou... | <commit_before><commit_msg>Add example for server-side cookies<commit_after>#!/usr/bin/env python3
"""Example for aiohttp.web basic server with cookies.
"""
import asyncio
from aiohttp import web
tmpl = '''\
<html>
<body>
<a href="/login">Login</a><br/>
<a href="/logout">Logout</a><br/>
{... | |
dca99dab5e09e6767708e92f9bf92e54a9aa9ed4 | hecuba_py/tests/storage_api_tests.py | hecuba_py/tests/storage_api_tests.py | import unittest
from storage.api import getByID
from hecuba.hdict import StorageDict
class ApiTestSDict(StorageDict):
'''
@TypeSpec <<key:int>, value:double>
'''
class StorageApi_Tests(unittest.TestCase):
def setUp(self):
pass
def class_type_test(self):
base_dict = ApiTestSDict(... | Test build remotely SDict wrong class | Test build remotely SDict wrong class
| Python | apache-2.0 | bsc-dd/hecuba,bsc-dd/hecuba,bsc-dd/hecuba,bsc-dd/hecuba | Test build remotely SDict wrong class | import unittest
from storage.api import getByID
from hecuba.hdict import StorageDict
class ApiTestSDict(StorageDict):
'''
@TypeSpec <<key:int>, value:double>
'''
class StorageApi_Tests(unittest.TestCase):
def setUp(self):
pass
def class_type_test(self):
base_dict = ApiTestSDict(... | <commit_before><commit_msg>Test build remotely SDict wrong class<commit_after> | import unittest
from storage.api import getByID
from hecuba.hdict import StorageDict
class ApiTestSDict(StorageDict):
'''
@TypeSpec <<key:int>, value:double>
'''
class StorageApi_Tests(unittest.TestCase):
def setUp(self):
pass
def class_type_test(self):
base_dict = ApiTestSDict(... | Test build remotely SDict wrong classimport unittest
from storage.api import getByID
from hecuba.hdict import StorageDict
class ApiTestSDict(StorageDict):
'''
@TypeSpec <<key:int>, value:double>
'''
class StorageApi_Tests(unittest.TestCase):
def setUp(self):
pass
def class_type_test(sel... | <commit_before><commit_msg>Test build remotely SDict wrong class<commit_after>import unittest
from storage.api import getByID
from hecuba.hdict import StorageDict
class ApiTestSDict(StorageDict):
'''
@TypeSpec <<key:int>, value:double>
'''
class StorageApi_Tests(unittest.TestCase):
def setUp(self):
... | |
b28d544167dcee75ff7476ae3d43d51191aca717 | reservation_gap.py | reservation_gap.py | from collections import Counter
from boto.ec2 import connect_to_region
REGION = 'us-east-1'
COUNTER_KEY_FMT = '{availability_zone},{instance_type}'
ec2 = connect_to_region(REGION)
running_instance_counter = Counter()
current_reservations_counter = Counter()
def get_instances(ec2):
reservations = ec2.get_all_... | Add script to find gaps between on-demand instances and reservations. | Add script to find gaps between on-demand instances and reservations.
| Python | mit | kjoconnor/aws | Add script to find gaps between on-demand instances and reservations. | from collections import Counter
from boto.ec2 import connect_to_region
REGION = 'us-east-1'
COUNTER_KEY_FMT = '{availability_zone},{instance_type}'
ec2 = connect_to_region(REGION)
running_instance_counter = Counter()
current_reservations_counter = Counter()
def get_instances(ec2):
reservations = ec2.get_all_... | <commit_before><commit_msg>Add script to find gaps between on-demand instances and reservations.<commit_after> | from collections import Counter
from boto.ec2 import connect_to_region
REGION = 'us-east-1'
COUNTER_KEY_FMT = '{availability_zone},{instance_type}'
ec2 = connect_to_region(REGION)
running_instance_counter = Counter()
current_reservations_counter = Counter()
def get_instances(ec2):
reservations = ec2.get_all_... | Add script to find gaps between on-demand instances and reservations.from collections import Counter
from boto.ec2 import connect_to_region
REGION = 'us-east-1'
COUNTER_KEY_FMT = '{availability_zone},{instance_type}'
ec2 = connect_to_region(REGION)
running_instance_counter = Counter()
current_reservations_counter ... | <commit_before><commit_msg>Add script to find gaps between on-demand instances and reservations.<commit_after>from collections import Counter
from boto.ec2 import connect_to_region
REGION = 'us-east-1'
COUNTER_KEY_FMT = '{availability_zone},{instance_type}'
ec2 = connect_to_region(REGION)
running_instance_counter ... | |
22e4430a55c17a5b2f77c90f8862530a3ae7f0d6 | accounts/migrations/0005_auto_20170621_1843.py | accounts/migrations/0005_auto_20170621_1843.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.1 on 2017-06-21 18:43
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('accounts', '0004_auto_20170607_1800'),
]
operations = [
migrations.AlterFie... | Add migration for verbose name. | Add migration for verbose name.
| Python | apache-2.0 | pattisdr/lookit-api,CenterForOpenScience/lookit-api,CenterForOpenScience/lookit-api,CenterForOpenScience/lookit-api,pattisdr/lookit-api,pattisdr/lookit-api | Add migration for verbose name. | # -*- coding: utf-8 -*-
# Generated by Django 1.11.1 on 2017-06-21 18:43
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('accounts', '0004_auto_20170607_1800'),
]
operations = [
migrations.AlterFie... | <commit_before><commit_msg>Add migration for verbose name.<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.11.1 on 2017-06-21 18:43
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('accounts', '0004_auto_20170607_1800'),
]
operations = [
migrations.AlterFie... | Add migration for verbose name.# -*- coding: utf-8 -*-
# Generated by Django 1.11.1 on 2017-06-21 18:43
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('accounts', '0004_auto_20170607_1800'),
]
operations ... | <commit_before><commit_msg>Add migration for verbose name.<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.11.1 on 2017-06-21 18:43
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('accounts', '0004_aut... | |
5e229787c013cc66fe202964ffb733a2d8f5aa6a | webauthn2/scripts/globus_test_client.py | webauthn2/scripts/globus_test_client.py | from globus_sdk import ConfidentialAppAuthClient
import json
import sys
import pprint
CLIENT_CRED_FILE='/home/secrets/oauth2/client_secret_globus.json'
if __name__ == '__main__':
if len(sys.argv) != 2:
print("Usage: {me} access_token".format(me=sys.argv[0]))
sys.exit(1)
token = sys.argv[1]
... | Add utility to examine depedent tokens retrieved from Globus. | Add utility to examine depedent tokens retrieved from Globus.
| Python | apache-2.0 | informatics-isi-edu/webauthn,informatics-isi-edu/webauthn,informatics-isi-edu/webauthn | Add utility to examine depedent tokens retrieved from Globus. | from globus_sdk import ConfidentialAppAuthClient
import json
import sys
import pprint
CLIENT_CRED_FILE='/home/secrets/oauth2/client_secret_globus.json'
if __name__ == '__main__':
if len(sys.argv) != 2:
print("Usage: {me} access_token".format(me=sys.argv[0]))
sys.exit(1)
token = sys.argv[1]
... | <commit_before><commit_msg>Add utility to examine depedent tokens retrieved from Globus.<commit_after> | from globus_sdk import ConfidentialAppAuthClient
import json
import sys
import pprint
CLIENT_CRED_FILE='/home/secrets/oauth2/client_secret_globus.json'
if __name__ == '__main__':
if len(sys.argv) != 2:
print("Usage: {me} access_token".format(me=sys.argv[0]))
sys.exit(1)
token = sys.argv[1]
... | Add utility to examine depedent tokens retrieved from Globus.from globus_sdk import ConfidentialAppAuthClient
import json
import sys
import pprint
CLIENT_CRED_FILE='/home/secrets/oauth2/client_secret_globus.json'
if __name__ == '__main__':
if len(sys.argv) != 2:
print("Usage: {me} access_token".format(me=... | <commit_before><commit_msg>Add utility to examine depedent tokens retrieved from Globus.<commit_after>from globus_sdk import ConfidentialAppAuthClient
import json
import sys
import pprint
CLIENT_CRED_FILE='/home/secrets/oauth2/client_secret_globus.json'
if __name__ == '__main__':
if len(sys.argv) != 2:
pr... | |
6364ce646e06d1168b8b96f27c8a7df2e2f0f23b | neutron/pecan_wsgi/hooks/translation.py | neutron/pecan_wsgi/hooks/translation.py | # Copyright (c) 2015 Mirantis, 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 applicabl... | # Copyright (c) 2015 Mirantis, 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 applicabl... | Fix the bug of "Spelling error of a word" | Fix the bug of "Spelling error of a word"
The word "occured" should be spelled as "occurred".
So it is changed.
Change-Id: Ice5212dc8565edb0c5b5c55f979b27440eeeb9aa
Closes-Bug: #1505043
| Python | apache-2.0 | chitr/neutron,asgard-lab/neutron,eayunstack/neutron,noironetworks/neutron,chitr/neutron,mahak/neutron,yanheven/neutron,openstack/neutron,cloudbase/neutron,sebrandon1/neutron,bigswitch/neutron,bigswitch/neutron,huntxu/neutron,MaximNevrov/neutron,asgard-lab/neutron,dims/neutron,wolverineav/neutron,wolverineav/neutron,mah... | # Copyright (c) 2015 Mirantis, 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 applicabl... | # Copyright (c) 2015 Mirantis, 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 applicabl... | <commit_before># Copyright (c) 2015 Mirantis, 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 requir... | # Copyright (c) 2015 Mirantis, 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 applicabl... | # Copyright (c) 2015 Mirantis, 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 applicabl... | <commit_before># Copyright (c) 2015 Mirantis, 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 requir... |
01b84f1b2a73ba31d6304baa0e08415657c72dca | website/tests/models/test_cancer.py | website/tests/models/test_cancer.py | from database import db
from model_testing import ModelTest
from models import Cancer
from sqlalchemy.exc import IntegrityError
import pytest
class CancerTest(ModelTest):
def test_init(self):
cancer = Cancer(name='Bladder Urothelial Carcinoma', code='BLCA')
assert cancer.name == 'Bladder Uroth... | Add tests for cancer model init | Add tests for cancer model init
| Python | lgpl-2.1 | reimandlab/Visualisation-Framework-for-Genome-Mutations,reimandlab/Visualistion-Framework-for-Genome-Mutations,reimandlab/ActiveDriverDB,reimandlab/ActiveDriverDB,reimandlab/Visualistion-Framework-for-Genome-Mutations,reimandlab/Visualisation-Framework-for-Genome-Mutations,reimandlab/Visualisation-Framework-for-Genome-... | Add tests for cancer model init | from database import db
from model_testing import ModelTest
from models import Cancer
from sqlalchemy.exc import IntegrityError
import pytest
class CancerTest(ModelTest):
def test_init(self):
cancer = Cancer(name='Bladder Urothelial Carcinoma', code='BLCA')
assert cancer.name == 'Bladder Uroth... | <commit_before><commit_msg>Add tests for cancer model init<commit_after> | from database import db
from model_testing import ModelTest
from models import Cancer
from sqlalchemy.exc import IntegrityError
import pytest
class CancerTest(ModelTest):
def test_init(self):
cancer = Cancer(name='Bladder Urothelial Carcinoma', code='BLCA')
assert cancer.name == 'Bladder Uroth... | Add tests for cancer model initfrom database import db
from model_testing import ModelTest
from models import Cancer
from sqlalchemy.exc import IntegrityError
import pytest
class CancerTest(ModelTest):
def test_init(self):
cancer = Cancer(name='Bladder Urothelial Carcinoma', code='BLCA')
asser... | <commit_before><commit_msg>Add tests for cancer model init<commit_after>from database import db
from model_testing import ModelTest
from models import Cancer
from sqlalchemy.exc import IntegrityError
import pytest
class CancerTest(ModelTest):
def test_init(self):
cancer = Cancer(name='Bladder Urothelial... | |
c625c9d8918eab3e86ac14abd674b6232c2fa8e9 | django/sierra/base/migrations/0002_auto_20170602_1115.py | django/sierra/base/migrations/0002_auto_20170602_1115.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from utils.load_data import load_data
class Migration(migrations.Migration):
dependencies = [
('base', '0001_squashed_0009_auto_20170602_1057'),
]
operations = [
migrations.RunPython... | Add data migrations for base app | Add data migrations for base app
| Python | bsd-3-clause | unt-libraries/catalog-api,unt-libraries/catalog-api,unt-libraries/catalog-api,unt-libraries/catalog-api | Add data migrations for base app | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from utils.load_data import load_data
class Migration(migrations.Migration):
dependencies = [
('base', '0001_squashed_0009_auto_20170602_1057'),
]
operations = [
migrations.RunPython... | <commit_before><commit_msg>Add data migrations for base app<commit_after> | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from utils.load_data import load_data
class Migration(migrations.Migration):
dependencies = [
('base', '0001_squashed_0009_auto_20170602_1057'),
]
operations = [
migrations.RunPython... | Add data migrations for base app# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from utils.load_data import load_data
class Migration(migrations.Migration):
dependencies = [
('base', '0001_squashed_0009_auto_20170602_1057'),
]
operations ... | <commit_before><commit_msg>Add data migrations for base app<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from utils.load_data import load_data
class Migration(migrations.Migration):
dependencies = [
('base', '0001_squashed_0009_aut... | |
25417369765087482f0d02b06913b3cffe9f43ad | tests/unit/test_secret.py | tests/unit/test_secret.py | # Import libnacl libs
import libnacl.secret
# Import python libs
import unittest
class TestSecret(unittest.TestCase):
'''
'''
def test_secret(self):
msg = 'But then of course African swallows are not migratory.'
box = libnacl.secret.SecretBox()
ctxt = box.encrypt(msg)
self.a... | Add high level secret tests | Add high level secret tests
| Python | apache-2.0 | johnttan/libnacl,cachedout/libnacl,mindw/libnacl,saltstack/libnacl,coinkite/libnacl,RaetProtocol/libnacl | Add high level secret tests | # Import libnacl libs
import libnacl.secret
# Import python libs
import unittest
class TestSecret(unittest.TestCase):
'''
'''
def test_secret(self):
msg = 'But then of course African swallows are not migratory.'
box = libnacl.secret.SecretBox()
ctxt = box.encrypt(msg)
self.a... | <commit_before><commit_msg>Add high level secret tests<commit_after> | # Import libnacl libs
import libnacl.secret
# Import python libs
import unittest
class TestSecret(unittest.TestCase):
'''
'''
def test_secret(self):
msg = 'But then of course African swallows are not migratory.'
box = libnacl.secret.SecretBox()
ctxt = box.encrypt(msg)
self.a... | Add high level secret tests# Import libnacl libs
import libnacl.secret
# Import python libs
import unittest
class TestSecret(unittest.TestCase):
'''
'''
def test_secret(self):
msg = 'But then of course African swallows are not migratory.'
box = libnacl.secret.SecretBox()
ctxt = box.... | <commit_before><commit_msg>Add high level secret tests<commit_after># Import libnacl libs
import libnacl.secret
# Import python libs
import unittest
class TestSecret(unittest.TestCase):
'''
'''
def test_secret(self):
msg = 'But then of course African swallows are not migratory.'
box = libna... | |
57a58893a2ba94b174b06e7f5f63478dff1e879e | providers/popularity/netflix.py | providers/popularity/netflix.py | from providers.popularity.provider import PopularityProvider
from utils.torrent_util import remove_bad_torrent_matches, torrent_to_movie
IDENTIFIER = "netflix"
class Provider(PopularityProvider):
def get_popular(self):
country = "se"
url = f"https://www.finder.com/{country}/netflix-movies"
... | Add provider for (Swedish) Netflix. | Add provider for (Swedish) Netflix.
Change "country" inside the provider for the movies available in a different country.
| Python | mit | EmilStenstrom/nephele | Add provider for (Swedish) Netflix.
Change "country" inside the provider for the movies available in a different country. | from providers.popularity.provider import PopularityProvider
from utils.torrent_util import remove_bad_torrent_matches, torrent_to_movie
IDENTIFIER = "netflix"
class Provider(PopularityProvider):
def get_popular(self):
country = "se"
url = f"https://www.finder.com/{country}/netflix-movies"
... | <commit_before><commit_msg>Add provider for (Swedish) Netflix.
Change "country" inside the provider for the movies available in a different country.<commit_after> | from providers.popularity.provider import PopularityProvider
from utils.torrent_util import remove_bad_torrent_matches, torrent_to_movie
IDENTIFIER = "netflix"
class Provider(PopularityProvider):
def get_popular(self):
country = "se"
url = f"https://www.finder.com/{country}/netflix-movies"
... | Add provider for (Swedish) Netflix.
Change "country" inside the provider for the movies available in a different country.from providers.popularity.provider import PopularityProvider
from utils.torrent_util import remove_bad_torrent_matches, torrent_to_movie
IDENTIFIER = "netflix"
class Provider(PopularityProvider):
... | <commit_before><commit_msg>Add provider for (Swedish) Netflix.
Change "country" inside the provider for the movies available in a different country.<commit_after>from providers.popularity.provider import PopularityProvider
from utils.torrent_util import remove_bad_torrent_matches, torrent_to_movie
IDENTIFIER = "netfl... | |
96526df63b2d45f08c7f007b45ee793e3ccc97a3 | array/rotate-image.py | array/rotate-image.py | # You are given an n x n 2D matrix that represents an image. Rotate the image by 90 degrees clockwise
# solve with O(1) additional memory
def rotate_image(a):
n = len(a)
if a is None or n < 1:
return a
else:
for i in range(n/2):
for j in range(n-i-1):
temp = a[i][j]
a[i][j] = a[n-1-j][i]
a[n-1-j... | Write rotate 90 degrees nxn 2d matrix algorithm: currently debugging | Write rotate 90 degrees nxn 2d matrix algorithm: currently debugging
| Python | mit | derekmpham/interview-prep,derekmpham/interview-prep | Write rotate 90 degrees nxn 2d matrix algorithm: currently debugging | # You are given an n x n 2D matrix that represents an image. Rotate the image by 90 degrees clockwise
# solve with O(1) additional memory
def rotate_image(a):
n = len(a)
if a is None or n < 1:
return a
else:
for i in range(n/2):
for j in range(n-i-1):
temp = a[i][j]
a[i][j] = a[n-1-j][i]
a[n-1-j... | <commit_before><commit_msg>Write rotate 90 degrees nxn 2d matrix algorithm: currently debugging<commit_after> | # You are given an n x n 2D matrix that represents an image. Rotate the image by 90 degrees clockwise
# solve with O(1) additional memory
def rotate_image(a):
n = len(a)
if a is None or n < 1:
return a
else:
for i in range(n/2):
for j in range(n-i-1):
temp = a[i][j]
a[i][j] = a[n-1-j][i]
a[n-1-j... | Write rotate 90 degrees nxn 2d matrix algorithm: currently debugging# You are given an n x n 2D matrix that represents an image. Rotate the image by 90 degrees clockwise
# solve with O(1) additional memory
def rotate_image(a):
n = len(a)
if a is None or n < 1:
return a
else:
for i in range(n/2):
for j in ra... | <commit_before><commit_msg>Write rotate 90 degrees nxn 2d matrix algorithm: currently debugging<commit_after># You are given an n x n 2D matrix that represents an image. Rotate the image by 90 degrees clockwise
# solve with O(1) additional memory
def rotate_image(a):
n = len(a)
if a is None or n < 1:
return a
el... | |
6e1f1d900d77f1352eb941f7ac569a0c681c8dc1 | loop_write.py | loop_write.py | #! /usr/bin/env python
# -*- coding:utf-8 -*-
import random
import time
from automaton_client import AutomatonClient
SERVER_HOST = "localhost"
SERVER_PORT = 1502
SLEEP_INTERVAL = 5
# sets on only 6 randomly chosen panels
def random6():
regs_values = [0] * 23
indices = []
while len(indices) < 6:
... | Add new script to loop on randomly writing registers | Add new script to loop on randomly writing registers
| Python | mit | vandaele/light-automation,vandaele/light-automation | Add new script to loop on randomly writing registers | #! /usr/bin/env python
# -*- coding:utf-8 -*-
import random
import time
from automaton_client import AutomatonClient
SERVER_HOST = "localhost"
SERVER_PORT = 1502
SLEEP_INTERVAL = 5
# sets on only 6 randomly chosen panels
def random6():
regs_values = [0] * 23
indices = []
while len(indices) < 6:
... | <commit_before><commit_msg>Add new script to loop on randomly writing registers<commit_after> | #! /usr/bin/env python
# -*- coding:utf-8 -*-
import random
import time
from automaton_client import AutomatonClient
SERVER_HOST = "localhost"
SERVER_PORT = 1502
SLEEP_INTERVAL = 5
# sets on only 6 randomly chosen panels
def random6():
regs_values = [0] * 23
indices = []
while len(indices) < 6:
... | Add new script to loop on randomly writing registers#! /usr/bin/env python
# -*- coding:utf-8 -*-
import random
import time
from automaton_client import AutomatonClient
SERVER_HOST = "localhost"
SERVER_PORT = 1502
SLEEP_INTERVAL = 5
# sets on only 6 randomly chosen panels
def random6():
regs_values = [0] * 23
... | <commit_before><commit_msg>Add new script to loop on randomly writing registers<commit_after>#! /usr/bin/env python
# -*- coding:utf-8 -*-
import random
import time
from automaton_client import AutomatonClient
SERVER_HOST = "localhost"
SERVER_PORT = 1502
SLEEP_INTERVAL = 5
# sets on only 6 randomly chosen panels
de... | |
a3b72336c5f04dfdc91b4d296adf669c9e3bf355 | txircd/modules/umode_s.py | txircd/modules/umode_s.py | from txircd.modbase import Mode
class ServerNoticeMode(Mode):
pass
class Spawner(object):
def __init__(self, ircd):
self.ircd = ircd
def spawn(self):
return {
"modes": {
"uns": ServerNoticeMode()
}
}
def cleanup(self):
self.ircd.removeMode("uns") | Implement usermode +s (currently doesn't do anything) | Implement usermode +s (currently doesn't do anything)
| Python | bsd-3-clause | ElementalAlchemist/txircd,Heufneutje/txircd,DesertBus/txircd | Implement usermode +s (currently doesn't do anything) | from txircd.modbase import Mode
class ServerNoticeMode(Mode):
pass
class Spawner(object):
def __init__(self, ircd):
self.ircd = ircd
def spawn(self):
return {
"modes": {
"uns": ServerNoticeMode()
}
}
def cleanup(self):
self.ircd.removeMode("uns") | <commit_before><commit_msg>Implement usermode +s (currently doesn't do anything)<commit_after> | from txircd.modbase import Mode
class ServerNoticeMode(Mode):
pass
class Spawner(object):
def __init__(self, ircd):
self.ircd = ircd
def spawn(self):
return {
"modes": {
"uns": ServerNoticeMode()
}
}
def cleanup(self):
self.ircd.removeMode("uns") | Implement usermode +s (currently doesn't do anything)from txircd.modbase import Mode
class ServerNoticeMode(Mode):
pass
class Spawner(object):
def __init__(self, ircd):
self.ircd = ircd
def spawn(self):
return {
"modes": {
"uns": ServerNoticeMode()
}
}
def cleanup(self):
self.ircd.removeMode... | <commit_before><commit_msg>Implement usermode +s (currently doesn't do anything)<commit_after>from txircd.modbase import Mode
class ServerNoticeMode(Mode):
pass
class Spawner(object):
def __init__(self, ircd):
self.ircd = ircd
def spawn(self):
return {
"modes": {
"uns": ServerNoticeMode()
}
}
... | |
af9ec9b12f5111cf6b2352ca9efc147c86093024 | Problems/compressString.py | Problems/compressString.py | #!/Applications/anaconda/envs/Python3/bin
def main():
# Test suite
tests = [None, '', 'AABBCC', 'AAABCCDDDD']
results = [None, '', 'AABBCC', 'A3BCCD4']
for i in range(len(tests)):
temp_result = compress_string(tests[i])
if temp_result == results[i]:
print('PASS: {} return... | Add string compression problem and tests. | Add string compression problem and tests.
| Python | mit | HKuz/Test_Code | Add string compression problem and tests. | #!/Applications/anaconda/envs/Python3/bin
def main():
# Test suite
tests = [None, '', 'AABBCC', 'AAABCCDDDD']
results = [None, '', 'AABBCC', 'A3BCCD4']
for i in range(len(tests)):
temp_result = compress_string(tests[i])
if temp_result == results[i]:
print('PASS: {} return... | <commit_before><commit_msg>Add string compression problem and tests.<commit_after> | #!/Applications/anaconda/envs/Python3/bin
def main():
# Test suite
tests = [None, '', 'AABBCC', 'AAABCCDDDD']
results = [None, '', 'AABBCC', 'A3BCCD4']
for i in range(len(tests)):
temp_result = compress_string(tests[i])
if temp_result == results[i]:
print('PASS: {} return... | Add string compression problem and tests.#!/Applications/anaconda/envs/Python3/bin
def main():
# Test suite
tests = [None, '', 'AABBCC', 'AAABCCDDDD']
results = [None, '', 'AABBCC', 'A3BCCD4']
for i in range(len(tests)):
temp_result = compress_string(tests[i])
if temp_result == resul... | <commit_before><commit_msg>Add string compression problem and tests.<commit_after>#!/Applications/anaconda/envs/Python3/bin
def main():
# Test suite
tests = [None, '', 'AABBCC', 'AAABCCDDDD']
results = [None, '', 'AABBCC', 'A3BCCD4']
for i in range(len(tests)):
temp_result = compress_string(t... | |
3061099d72364eb6d6aa36613b2a425fc3f99915 | furl/__init__.py | furl/__init__.py | #
# furl - URL manipulation made simple.
#
# Arthur Grunseid
# grunseid.com
# [email protected]
#
# License: Build Amazing Things (Unlicense)
__title__ = 'furl'
__version__ = '0.3.9'
__license__ = 'Unlicense'
__author__ = 'Arthur Grunseid'
__contact__ = '[email protected]'
__url__ = 'https://github.com/gruns/furl'
... | #
# furl - URL manipulation made simple.
#
# Arthur Grunseid
# grunseid.com
# [email protected]
#
# License: Build Amazing Things (Unlicense)
__title__ = 'furl'
__version__ = '0.3.91'
__license__ = 'Unlicense'
__author__ = 'Arthur Grunseid'
__contact__ = '[email protected]'
__url__ = 'https://github.com/gruns/furl'
... | Increment version to v0.3.91 for PyPi. | Increment version to v0.3.91 for PyPi.
| Python | unlicense | Gerhut/furl,lastfm/furl,penyatree/furl,guiquanz/furl | #
# furl - URL manipulation made simple.
#
# Arthur Grunseid
# grunseid.com
# [email protected]
#
# License: Build Amazing Things (Unlicense)
__title__ = 'furl'
__version__ = '0.3.9'
__license__ = 'Unlicense'
__author__ = 'Arthur Grunseid'
__contact__ = '[email protected]'
__url__ = 'https://github.com/gruns/furl'
... | #
# furl - URL manipulation made simple.
#
# Arthur Grunseid
# grunseid.com
# [email protected]
#
# License: Build Amazing Things (Unlicense)
__title__ = 'furl'
__version__ = '0.3.91'
__license__ = 'Unlicense'
__author__ = 'Arthur Grunseid'
__contact__ = '[email protected]'
__url__ = 'https://github.com/gruns/furl'
... | <commit_before>#
# furl - URL manipulation made simple.
#
# Arthur Grunseid
# grunseid.com
# [email protected]
#
# License: Build Amazing Things (Unlicense)
__title__ = 'furl'
__version__ = '0.3.9'
__license__ = 'Unlicense'
__author__ = 'Arthur Grunseid'
__contact__ = '[email protected]'
__url__ = 'https://github.co... | #
# furl - URL manipulation made simple.
#
# Arthur Grunseid
# grunseid.com
# [email protected]
#
# License: Build Amazing Things (Unlicense)
__title__ = 'furl'
__version__ = '0.3.91'
__license__ = 'Unlicense'
__author__ = 'Arthur Grunseid'
__contact__ = '[email protected]'
__url__ = 'https://github.com/gruns/furl'
... | #
# furl - URL manipulation made simple.
#
# Arthur Grunseid
# grunseid.com
# [email protected]
#
# License: Build Amazing Things (Unlicense)
__title__ = 'furl'
__version__ = '0.3.9'
__license__ = 'Unlicense'
__author__ = 'Arthur Grunseid'
__contact__ = '[email protected]'
__url__ = 'https://github.com/gruns/furl'
... | <commit_before>#
# furl - URL manipulation made simple.
#
# Arthur Grunseid
# grunseid.com
# [email protected]
#
# License: Build Amazing Things (Unlicense)
__title__ = 'furl'
__version__ = '0.3.9'
__license__ = 'Unlicense'
__author__ = 'Arthur Grunseid'
__contact__ = '[email protected]'
__url__ = 'https://github.co... |
55eb1c81f02a715adfe70c188985924fbeb340fd | demos/_videos_index_duration.py | demos/_videos_index_duration.py | import sys
from Ziggeo import Ziggeo
if(len(sys.argv) < 3):
print ("Error\n")
print ("Usage: $>python _videos_index_duration.py YOUR_API_TOKEN YOUR_PRIVATE_KEY\n")
sys.exit()
api_token = sys.argv[1]
private_key = sys.argv[2]
total_duration = 0.0
count_duration = 0.0
ziggeo = Ziggeo(api_token, private_key)
def ind... | Add script to get average duration based on video list data | Add script to get average duration based on video list data
| Python | apache-2.0 | Ziggeo/ZiggeoPythonSdk,Ziggeo/ZiggeoPythonSdk | Add script to get average duration based on video list data | import sys
from Ziggeo import Ziggeo
if(len(sys.argv) < 3):
print ("Error\n")
print ("Usage: $>python _videos_index_duration.py YOUR_API_TOKEN YOUR_PRIVATE_KEY\n")
sys.exit()
api_token = sys.argv[1]
private_key = sys.argv[2]
total_duration = 0.0
count_duration = 0.0
ziggeo = Ziggeo(api_token, private_key)
def ind... | <commit_before><commit_msg>Add script to get average duration based on video list data<commit_after> | import sys
from Ziggeo import Ziggeo
if(len(sys.argv) < 3):
print ("Error\n")
print ("Usage: $>python _videos_index_duration.py YOUR_API_TOKEN YOUR_PRIVATE_KEY\n")
sys.exit()
api_token = sys.argv[1]
private_key = sys.argv[2]
total_duration = 0.0
count_duration = 0.0
ziggeo = Ziggeo(api_token, private_key)
def ind... | Add script to get average duration based on video list dataimport sys
from Ziggeo import Ziggeo
if(len(sys.argv) < 3):
print ("Error\n")
print ("Usage: $>python _videos_index_duration.py YOUR_API_TOKEN YOUR_PRIVATE_KEY\n")
sys.exit()
api_token = sys.argv[1]
private_key = sys.argv[2]
total_duration = 0.0
count_dur... | <commit_before><commit_msg>Add script to get average duration based on video list data<commit_after>import sys
from Ziggeo import Ziggeo
if(len(sys.argv) < 3):
print ("Error\n")
print ("Usage: $>python _videos_index_duration.py YOUR_API_TOKEN YOUR_PRIVATE_KEY\n")
sys.exit()
api_token = sys.argv[1]
private_key = s... | |
3154ef23b48a42e274417a28953c55b98ac3fec3 | filters/png2jpg.py | filters/png2jpg.py | """
Change image extensions from .png to .jpg
EXAMPLE:
>>>> echo An  | pandoc -F png2jpg.py
"""
import panflute as pf
def action(elem, doc):
if isinstance(elem, pf.Image):
elem.url = elem.url.replace('.png', '.j... | Convert .png endings to .jpg | Convert .png endings to .jpg
| Python | bsd-3-clause | sergiocorreia/panflute-filters | Convert .png endings to .jpg | """
Change image extensions from .png to .jpg
EXAMPLE:
>>>> echo An  | pandoc -F png2jpg.py
"""
import panflute as pf
def action(elem, doc):
if isinstance(elem, pf.Image):
elem.url = elem.url.replace('.png', '.j... | <commit_before><commit_msg>Convert .png endings to .jpg<commit_after> | """
Change image extensions from .png to .jpg
EXAMPLE:
>>>> echo An  | pandoc -F png2jpg.py
"""
import panflute as pf
def action(elem, doc):
if isinstance(elem, pf.Image):
elem.url = elem.url.replace('.png', '.j... | Convert .png endings to .jpg"""
Change image extensions from .png to .jpg
EXAMPLE:
>>>> echo An  | pandoc -F png2jpg.py
"""
import panflute as pf
def action(elem, doc):
if isinstance(elem, pf.Image):
elem.url = ... | <commit_before><commit_msg>Convert .png endings to .jpg<commit_after>"""
Change image extensions from .png to .jpg
EXAMPLE:
>>>> echo An  | pandoc -F png2jpg.py
"""
import panflute as pf
def action(elem, doc):
if isinst... | |
59f9e977ee343082b9ad3e815c662d1425549e83 | tests/test_binned_likelihood.py | tests/test_binned_likelihood.py | # from blueice.test_helpers import *
# from blueice.likelihood import BinnedLogLikelihood
#
# from scipy import stats
#
#
# def test_single_bin():
# conf = test_conf()
# conf['sources'][0]['events_per_day'] = 1
# conf['analysis_space'] = [['x', [-10, 10]]]
#
# lf = BinnedLogLikelihood(conf)
# lf.add... | Add new tests (don't yet work) | Add new tests (don't yet work) | Python | bsd-3-clause | JelleAalbers/blueice | Add new tests (don't yet work) | # from blueice.test_helpers import *
# from blueice.likelihood import BinnedLogLikelihood
#
# from scipy import stats
#
#
# def test_single_bin():
# conf = test_conf()
# conf['sources'][0]['events_per_day'] = 1
# conf['analysis_space'] = [['x', [-10, 10]]]
#
# lf = BinnedLogLikelihood(conf)
# lf.add... | <commit_before><commit_msg>Add new tests (don't yet work)<commit_after> | # from blueice.test_helpers import *
# from blueice.likelihood import BinnedLogLikelihood
#
# from scipy import stats
#
#
# def test_single_bin():
# conf = test_conf()
# conf['sources'][0]['events_per_day'] = 1
# conf['analysis_space'] = [['x', [-10, 10]]]
#
# lf = BinnedLogLikelihood(conf)
# lf.add... | Add new tests (don't yet work)# from blueice.test_helpers import *
# from blueice.likelihood import BinnedLogLikelihood
#
# from scipy import stats
#
#
# def test_single_bin():
# conf = test_conf()
# conf['sources'][0]['events_per_day'] = 1
# conf['analysis_space'] = [['x', [-10, 10]]]
#
# lf = BinnedLo... | <commit_before><commit_msg>Add new tests (don't yet work)<commit_after># from blueice.test_helpers import *
# from blueice.likelihood import BinnedLogLikelihood
#
# from scipy import stats
#
#
# def test_single_bin():
# conf = test_conf()
# conf['sources'][0]['events_per_day'] = 1
# conf['analysis_space'] =... | |
7df6010f1dd4cfa00b48f2fe646d3bb0bd02f8ec | tests/fd_remote.py | tests/fd_remote.py | from __future__ import absolute_import
from filedes.test.base import BaseFDTestCase
from filedes.subprocess import Popen
from filedes import get_open_fds, FD
from subprocess import PIPE, STDOUT
import unittest2
import filedes
import socket
import tempfile
class RemoteFDTests(BaseFDTestCase):
def testPipe(self):
... | Add unittest to verify remote stat on misc fd types | Add unittest to verify remote stat on misc fd types
Fixes #8
| Python | isc | fmoo/python-filedes,fmoo/python-filedes | Add unittest to verify remote stat on misc fd types
Fixes #8 | from __future__ import absolute_import
from filedes.test.base import BaseFDTestCase
from filedes.subprocess import Popen
from filedes import get_open_fds, FD
from subprocess import PIPE, STDOUT
import unittest2
import filedes
import socket
import tempfile
class RemoteFDTests(BaseFDTestCase):
def testPipe(self):
... | <commit_before><commit_msg>Add unittest to verify remote stat on misc fd types
Fixes #8<commit_after> | from __future__ import absolute_import
from filedes.test.base import BaseFDTestCase
from filedes.subprocess import Popen
from filedes import get_open_fds, FD
from subprocess import PIPE, STDOUT
import unittest2
import filedes
import socket
import tempfile
class RemoteFDTests(BaseFDTestCase):
def testPipe(self):
... | Add unittest to verify remote stat on misc fd types
Fixes #8from __future__ import absolute_import
from filedes.test.base import BaseFDTestCase
from filedes.subprocess import Popen
from filedes import get_open_fds, FD
from subprocess import PIPE, STDOUT
import unittest2
import filedes
import socket
import tempfile
... | <commit_before><commit_msg>Add unittest to verify remote stat on misc fd types
Fixes #8<commit_after>from __future__ import absolute_import
from filedes.test.base import BaseFDTestCase
from filedes.subprocess import Popen
from filedes import get_open_fds, FD
from subprocess import PIPE, STDOUT
import unittest2
import... | |
c2506fdc71f1dcff2e3455c668e78ad6b7d5d94b | scripts/fenix/fenix_download.py | scripts/fenix/fenix_download.py | # python fenix_download login_file <url> -e <file_extension> (DEFAULT = pdf) -d <download_directory>
#
#
from fenix import Fenix
import argparse
if __name__ == '__main__':
# TODO: argparse
parser = argparse.ArgumentParser(description='Download files from Fenix Edu pages')
parser.add_argument('login', type... | Add inital structure for fenix downloader | Add inital structure for fenix downloader
| Python | mit | iluxonchik/python-general-repo | Add inital structure for fenix downloader | # python fenix_download login_file <url> -e <file_extension> (DEFAULT = pdf) -d <download_directory>
#
#
from fenix import Fenix
import argparse
if __name__ == '__main__':
# TODO: argparse
parser = argparse.ArgumentParser(description='Download files from Fenix Edu pages')
parser.add_argument('login', type... | <commit_before><commit_msg>Add inital structure for fenix downloader<commit_after> | # python fenix_download login_file <url> -e <file_extension> (DEFAULT = pdf) -d <download_directory>
#
#
from fenix import Fenix
import argparse
if __name__ == '__main__':
# TODO: argparse
parser = argparse.ArgumentParser(description='Download files from Fenix Edu pages')
parser.add_argument('login', type... | Add inital structure for fenix downloader# python fenix_download login_file <url> -e <file_extension> (DEFAULT = pdf) -d <download_directory>
#
#
from fenix import Fenix
import argparse
if __name__ == '__main__':
# TODO: argparse
parser = argparse.ArgumentParser(description='Download files from Fenix Edu page... | <commit_before><commit_msg>Add inital structure for fenix downloader<commit_after># python fenix_download login_file <url> -e <file_extension> (DEFAULT = pdf) -d <download_directory>
#
#
from fenix import Fenix
import argparse
if __name__ == '__main__':
# TODO: argparse
parser = argparse.ArgumentParser(descri... | |
a5f0544bf0ce88ecfca515f0db344fffb90c8d8e | altair/vegalite/v2/examples/percentage_of_total.py | altair/vegalite/v2/examples/percentage_of_total.py | """
Calculating Percentage of Total
-------------------------------
This chart demonstrates how to use a window transform to display data values
as a percentage of total values.
"""
import altair as alt
import pandas as pd
activities = pd.DataFrame({'Activity': ['Sleeping', 'Eating', 'TV', 'Work', 'Exercise'],
... | Add simple window transform example | Add simple window transform example
| Python | bsd-3-clause | altair-viz/altair,ellisonbg/altair,jakevdp/altair | Add simple window transform example | """
Calculating Percentage of Total
-------------------------------
This chart demonstrates how to use a window transform to display data values
as a percentage of total values.
"""
import altair as alt
import pandas as pd
activities = pd.DataFrame({'Activity': ['Sleeping', 'Eating', 'TV', 'Work', 'Exercise'],
... | <commit_before><commit_msg>Add simple window transform example<commit_after> | """
Calculating Percentage of Total
-------------------------------
This chart demonstrates how to use a window transform to display data values
as a percentage of total values.
"""
import altair as alt
import pandas as pd
activities = pd.DataFrame({'Activity': ['Sleeping', 'Eating', 'TV', 'Work', 'Exercise'],
... | Add simple window transform example"""
Calculating Percentage of Total
-------------------------------
This chart demonstrates how to use a window transform to display data values
as a percentage of total values.
"""
import altair as alt
import pandas as pd
activities = pd.DataFrame({'Activity': ['Sleeping', 'Eating'... | <commit_before><commit_msg>Add simple window transform example<commit_after>"""
Calculating Percentage of Total
-------------------------------
This chart demonstrates how to use a window transform to display data values
as a percentage of total values.
"""
import altair as alt
import pandas as pd
activities = pd.Dat... | |
9f27cf9f0669f98694e7751eb9d22064d24bdb3f | services/tests/test_indexing.py | services/tests/test_indexing.py | from django.test import TestCase
from services.tests.factories import ServiceFactory
from services.models import Service
from services.search_indexes import ServiceIndex
class IndexingTest(TestCase):
def setUp(self):
self.service_ar = ServiceFactory(
name_ar='Arabic', name_en='', name_fr='',... | Add testcase for search indexing of Service | Add testcase for search indexing of Service
| Python | bsd-3-clause | theirc/ServiceInfo,theirc/ServiceInfo,theirc/ServiceInfo,theirc/ServiceInfo | Add testcase for search indexing of Service | from django.test import TestCase
from services.tests.factories import ServiceFactory
from services.models import Service
from services.search_indexes import ServiceIndex
class IndexingTest(TestCase):
def setUp(self):
self.service_ar = ServiceFactory(
name_ar='Arabic', name_en='', name_fr='',... | <commit_before><commit_msg>Add testcase for search indexing of Service<commit_after> | from django.test import TestCase
from services.tests.factories import ServiceFactory
from services.models import Service
from services.search_indexes import ServiceIndex
class IndexingTest(TestCase):
def setUp(self):
self.service_ar = ServiceFactory(
name_ar='Arabic', name_en='', name_fr='',... | Add testcase for search indexing of Servicefrom django.test import TestCase
from services.tests.factories import ServiceFactory
from services.models import Service
from services.search_indexes import ServiceIndex
class IndexingTest(TestCase):
def setUp(self):
self.service_ar = ServiceFactory(
... | <commit_before><commit_msg>Add testcase for search indexing of Service<commit_after>from django.test import TestCase
from services.tests.factories import ServiceFactory
from services.models import Service
from services.search_indexes import ServiceIndex
class IndexingTest(TestCase):
def setUp(self):
sel... | |
729cdbfc9013bbc34bb44cc10f0f8443d604f1be | time_series_rnn.py | time_series_rnn.py | # Predict time series
import tensorflow as tf
import numpy as np
# Create time series
t_min, t_max = 0, 30
resolution = 0.1
def time_series(t):
return t * np.sin(t) / 3 + 2 * np.sin(t * 5)
def next_batch(batch_size, n_steps):
t0 = np.random.rand(batch_size, 1) * (t_max - t_min - n_steps * resolution)
Ts... | Add code for RNN time series analysis | Add code for RNN time series analysis
Uses OutputProjectionWrapper
| Python | mit | KT12/hands_on_machine_learning | Add code for RNN time series analysis
Uses OutputProjectionWrapper | # Predict time series
import tensorflow as tf
import numpy as np
# Create time series
t_min, t_max = 0, 30
resolution = 0.1
def time_series(t):
return t * np.sin(t) / 3 + 2 * np.sin(t * 5)
def next_batch(batch_size, n_steps):
t0 = np.random.rand(batch_size, 1) * (t_max - t_min - n_steps * resolution)
Ts... | <commit_before><commit_msg>Add code for RNN time series analysis
Uses OutputProjectionWrapper<commit_after> | # Predict time series
import tensorflow as tf
import numpy as np
# Create time series
t_min, t_max = 0, 30
resolution = 0.1
def time_series(t):
return t * np.sin(t) / 3 + 2 * np.sin(t * 5)
def next_batch(batch_size, n_steps):
t0 = np.random.rand(batch_size, 1) * (t_max - t_min - n_steps * resolution)
Ts... | Add code for RNN time series analysis
Uses OutputProjectionWrapper# Predict time series
import tensorflow as tf
import numpy as np
# Create time series
t_min, t_max = 0, 30
resolution = 0.1
def time_series(t):
return t * np.sin(t) / 3 + 2 * np.sin(t * 5)
def next_batch(batch_size, n_steps):
t0 = np.random.... | <commit_before><commit_msg>Add code for RNN time series analysis
Uses OutputProjectionWrapper<commit_after># Predict time series
import tensorflow as tf
import numpy as np
# Create time series
t_min, t_max = 0, 30
resolution = 0.1
def time_series(t):
return t * np.sin(t) / 3 + 2 * np.sin(t * 5)
def next_batch(... | |
1ec1bede9f5451aeef09d250ad4542bfb0cedb3d | tests/pytests/functional/modules/test_user.py | tests/pytests/functional/modules/test_user.py | import pathlib
import pytest
from saltfactories.utils import random_string
pytestmark = [
pytest.mark.skip_if_not_root,
pytest.mark.destructive_test,
pytest.mark.windows_whitelisted,
]
@pytest.fixture(scope="module")
def user(modules):
return modules.user
@pytest.fixture
def username(user):
_u... | Add functional tests for the salt user module | Add functional tests for the salt user module
| Python | apache-2.0 | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | Add functional tests for the salt user module | import pathlib
import pytest
from saltfactories.utils import random_string
pytestmark = [
pytest.mark.skip_if_not_root,
pytest.mark.destructive_test,
pytest.mark.windows_whitelisted,
]
@pytest.fixture(scope="module")
def user(modules):
return modules.user
@pytest.fixture
def username(user):
_u... | <commit_before><commit_msg>Add functional tests for the salt user module<commit_after> | import pathlib
import pytest
from saltfactories.utils import random_string
pytestmark = [
pytest.mark.skip_if_not_root,
pytest.mark.destructive_test,
pytest.mark.windows_whitelisted,
]
@pytest.fixture(scope="module")
def user(modules):
return modules.user
@pytest.fixture
def username(user):
_u... | Add functional tests for the salt user moduleimport pathlib
import pytest
from saltfactories.utils import random_string
pytestmark = [
pytest.mark.skip_if_not_root,
pytest.mark.destructive_test,
pytest.mark.windows_whitelisted,
]
@pytest.fixture(scope="module")
def user(modules):
return modules.user... | <commit_before><commit_msg>Add functional tests for the salt user module<commit_after>import pathlib
import pytest
from saltfactories.utils import random_string
pytestmark = [
pytest.mark.skip_if_not_root,
pytest.mark.destructive_test,
pytest.mark.windows_whitelisted,
]
@pytest.fixture(scope="module")
d... | |
a2ab40bd7da2131ff6b9d502cc3dde1f6a8531e6 | src/legacy_data_export.py | src/legacy_data_export.py | import json
import sys
import database as db
from database.model import Team
from geotools import simple_distance
from geotools.routing import MapPoint
from webapp.cfg.config import DB_CONNECTION
if len(sys.argv) == 2:
MAX_TEAMS = sys.argv[1]
else:
MAX_TEAMS = 9
print "init db..."
db.init_session(connection_... | Build a legacy distance export | Build a legacy distance export
| Python | bsd-3-clause | janLo/meet-and-eat-registration-system,eXma/meet-and-eat-registration-system,janLo/meet-and-eat-registration-system,eXma/meet-and-eat-registration-system,janLo/meet-and-eat-registration-system,eXma/meet-and-eat-registration-system,janLo/meet-and-eat-registration-system,eXma/meet-and-eat-registration-system | Build a legacy distance export | import json
import sys
import database as db
from database.model import Team
from geotools import simple_distance
from geotools.routing import MapPoint
from webapp.cfg.config import DB_CONNECTION
if len(sys.argv) == 2:
MAX_TEAMS = sys.argv[1]
else:
MAX_TEAMS = 9
print "init db..."
db.init_session(connection_... | <commit_before><commit_msg>Build a legacy distance export<commit_after> | import json
import sys
import database as db
from database.model import Team
from geotools import simple_distance
from geotools.routing import MapPoint
from webapp.cfg.config import DB_CONNECTION
if len(sys.argv) == 2:
MAX_TEAMS = sys.argv[1]
else:
MAX_TEAMS = 9
print "init db..."
db.init_session(connection_... | Build a legacy distance exportimport json
import sys
import database as db
from database.model import Team
from geotools import simple_distance
from geotools.routing import MapPoint
from webapp.cfg.config import DB_CONNECTION
if len(sys.argv) == 2:
MAX_TEAMS = sys.argv[1]
else:
MAX_TEAMS = 9
print "init db..... | <commit_before><commit_msg>Build a legacy distance export<commit_after>import json
import sys
import database as db
from database.model import Team
from geotools import simple_distance
from geotools.routing import MapPoint
from webapp.cfg.config import DB_CONNECTION
if len(sys.argv) == 2:
MAX_TEAMS = sys.argv[1]
... | |
43b4d63f8587bcc7078635a099f1acf48264303c | spacy/tests/serialize/test_serialize_tagger.py | spacy/tests/serialize/test_serialize_tagger.py | # coding: utf-8
from __future__ import unicode_literals
from ..util import make_tempdir
from ...pipeline import NeuralTagger as Tagger
import pytest
@pytest.fixture
def taggers(en_vocab):
tagger1 = Tagger(en_vocab, True)
tagger2 = Tagger(en_vocab, True)
tagger1.model = tagger1.Model(None, None)
tagg... | Add serialization tests for tagger | Add serialization tests for tagger
| Python | mit | honnibal/spaCy,recognai/spaCy,spacy-io/spaCy,spacy-io/spaCy,aikramer2/spaCy,aikramer2/spaCy,explosion/spaCy,recognai/spaCy,honnibal/spaCy,honnibal/spaCy,recognai/spaCy,recognai/spaCy,aikramer2/spaCy,spacy-io/spaCy,spacy-io/spaCy,spacy-io/spaCy,explosion/spaCy,recognai/spaCy,explosion/spaCy,aikramer2/spaCy,explosion/spa... | Add serialization tests for tagger | # coding: utf-8
from __future__ import unicode_literals
from ..util import make_tempdir
from ...pipeline import NeuralTagger as Tagger
import pytest
@pytest.fixture
def taggers(en_vocab):
tagger1 = Tagger(en_vocab, True)
tagger2 = Tagger(en_vocab, True)
tagger1.model = tagger1.Model(None, None)
tagg... | <commit_before><commit_msg>Add serialization tests for tagger<commit_after> | # coding: utf-8
from __future__ import unicode_literals
from ..util import make_tempdir
from ...pipeline import NeuralTagger as Tagger
import pytest
@pytest.fixture
def taggers(en_vocab):
tagger1 = Tagger(en_vocab, True)
tagger2 = Tagger(en_vocab, True)
tagger1.model = tagger1.Model(None, None)
tagg... | Add serialization tests for tagger# coding: utf-8
from __future__ import unicode_literals
from ..util import make_tempdir
from ...pipeline import NeuralTagger as Tagger
import pytest
@pytest.fixture
def taggers(en_vocab):
tagger1 = Tagger(en_vocab, True)
tagger2 = Tagger(en_vocab, True)
tagger1.model = ... | <commit_before><commit_msg>Add serialization tests for tagger<commit_after># coding: utf-8
from __future__ import unicode_literals
from ..util import make_tempdir
from ...pipeline import NeuralTagger as Tagger
import pytest
@pytest.fixture
def taggers(en_vocab):
tagger1 = Tagger(en_vocab, True)
tagger2 = Ta... | |
81728590b09270e4e32af61cdb5855bb814f683c | test/unit/sorting/test_quick_sort.py | test/unit/sorting/test_quick_sort.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import unittest
from helper.read_data_file import read_int_array
from sorting.quick_sort import sort
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
class InsertionSortTester(unittest.TestCase):
# Test sort in default order, i.e., in ascending ord... | Add unit test for quick sort implementation. | Add unit test for quick sort implementation.
| Python | mit | weichen2046/algorithm-study,weichen2046/algorithm-study | Add unit test for quick sort implementation. | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import unittest
from helper.read_data_file import read_int_array
from sorting.quick_sort import sort
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
class InsertionSortTester(unittest.TestCase):
# Test sort in default order, i.e., in ascending ord... | <commit_before><commit_msg>Add unit test for quick sort implementation.<commit_after> | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import unittest
from helper.read_data_file import read_int_array
from sorting.quick_sort import sort
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
class InsertionSortTester(unittest.TestCase):
# Test sort in default order, i.e., in ascending ord... | Add unit test for quick sort implementation.#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import unittest
from helper.read_data_file import read_int_array
from sorting.quick_sort import sort
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
class InsertionSortTester(unittest.TestCase):
# Test s... | <commit_before><commit_msg>Add unit test for quick sort implementation.<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import unittest
from helper.read_data_file import read_int_array
from sorting.quick_sort import sort
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
class InsertionSor... | |
5995fb29869e828ae7dd6bcca9eb30bfe00a959d | __init__.py | __init__.py | bl_info = {
"name": "Booltron",
"author": "Mikhail Rachinskiy (jewelcourses.com)",
"version": (2000,),
"blender": (2,7,4),
"location": "3D View → Tool Shelf",
"description": "Booltron—super add-on for super fast booleans.",
"wiki_url": "https://github.com/mrachinskiy/blender-addon-booltron",
"tracker_url": "htt... | bl_info = {
"name": "Booltron",
"author": "Mikhail Rachinskiy (jewelcourses.com)",
"version": (2000,),
"blender": (2,74,0),
"location": "3D View → Tool Shelf",
"description": "Booltron—super add-on for super fast booleans.",
"wiki_url": "https://github.com/mrachinskiy/blender-addon-booltron",
"tracker_url": "ht... | Fix for Blender version check | Fix for Blender version check
| Python | mit | mrachinskiy/blender-addon-booltron | bl_info = {
"name": "Booltron",
"author": "Mikhail Rachinskiy (jewelcourses.com)",
"version": (2000,),
"blender": (2,7,4),
"location": "3D View → Tool Shelf",
"description": "Booltron—super add-on for super fast booleans.",
"wiki_url": "https://github.com/mrachinskiy/blender-addon-booltron",
"tracker_url": "htt... | bl_info = {
"name": "Booltron",
"author": "Mikhail Rachinskiy (jewelcourses.com)",
"version": (2000,),
"blender": (2,74,0),
"location": "3D View → Tool Shelf",
"description": "Booltron—super add-on for super fast booleans.",
"wiki_url": "https://github.com/mrachinskiy/blender-addon-booltron",
"tracker_url": "ht... | <commit_before>bl_info = {
"name": "Booltron",
"author": "Mikhail Rachinskiy (jewelcourses.com)",
"version": (2000,),
"blender": (2,7,4),
"location": "3D View → Tool Shelf",
"description": "Booltron—super add-on for super fast booleans.",
"wiki_url": "https://github.com/mrachinskiy/blender-addon-booltron",
"tra... | bl_info = {
"name": "Booltron",
"author": "Mikhail Rachinskiy (jewelcourses.com)",
"version": (2000,),
"blender": (2,74,0),
"location": "3D View → Tool Shelf",
"description": "Booltron—super add-on for super fast booleans.",
"wiki_url": "https://github.com/mrachinskiy/blender-addon-booltron",
"tracker_url": "ht... | bl_info = {
"name": "Booltron",
"author": "Mikhail Rachinskiy (jewelcourses.com)",
"version": (2000,),
"blender": (2,7,4),
"location": "3D View → Tool Shelf",
"description": "Booltron—super add-on for super fast booleans.",
"wiki_url": "https://github.com/mrachinskiy/blender-addon-booltron",
"tracker_url": "htt... | <commit_before>bl_info = {
"name": "Booltron",
"author": "Mikhail Rachinskiy (jewelcourses.com)",
"version": (2000,),
"blender": (2,7,4),
"location": "3D View → Tool Shelf",
"description": "Booltron—super add-on for super fast booleans.",
"wiki_url": "https://github.com/mrachinskiy/blender-addon-booltron",
"tra... |
560228cbc2e95fd24f994e0a78465a031f6e0eef | crmapp/contacts/forms.py | crmapp/contacts/forms.py | from django import forms
from .models import Contact
class ContactForm(forms.ModelForm):
class Meta:
model = Contact
fields = ('first_name', 'last_name',
'role', 'phone', 'email', 'account',
)
widgets = {
'first_name': forms.TextInput(
... | Create the Contacts App - Part II > New Contact - Create Form | Create the Contacts App - Part II > New Contact - Create Form
| Python | mit | deenaariff/Django,tabdon/crmeasyapp,tabdon/crmeasyapp | Create the Contacts App - Part II > New Contact - Create Form | from django import forms
from .models import Contact
class ContactForm(forms.ModelForm):
class Meta:
model = Contact
fields = ('first_name', 'last_name',
'role', 'phone', 'email', 'account',
)
widgets = {
'first_name': forms.TextInput(
... | <commit_before><commit_msg>Create the Contacts App - Part II > New Contact - Create Form<commit_after> | from django import forms
from .models import Contact
class ContactForm(forms.ModelForm):
class Meta:
model = Contact
fields = ('first_name', 'last_name',
'role', 'phone', 'email', 'account',
)
widgets = {
'first_name': forms.TextInput(
... | Create the Contacts App - Part II > New Contact - Create Formfrom django import forms
from .models import Contact
class ContactForm(forms.ModelForm):
class Meta:
model = Contact
fields = ('first_name', 'last_name',
'role', 'phone', 'email', 'account',
)
widgets =... | <commit_before><commit_msg>Create the Contacts App - Part II > New Contact - Create Form<commit_after>from django import forms
from .models import Contact
class ContactForm(forms.ModelForm):
class Meta:
model = Contact
fields = ('first_name', 'last_name',
'role', 'phone', 'email... | |
b273248f1c33abfe355657e8b0e4e85492efb10d | designate/tests/test_api/test_v1/test_limits.py | designate/tests/test_api/test_v1/test_limits.py | # coding=utf-8
# Copyright 2012 Managed I.T.
#
# Author: Kiall Mac Innes <[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... | Add tests for limits api in V1 api | Add tests for limits api in V1 api
Change-Id: Id05520acf5e3a62647915829d72ca7afd3916337
| Python | apache-2.0 | cneill/designate-testing,muraliselva10/designate,ionrock/designate,grahamhayes/designate,ramsateesh/designate,tonyli71/designate,cneill/designate-testing,grahamhayes/designate,tonyli71/designate,ramsateesh/designate,openstack/designate,grahamhayes/designate,muraliselva10/designate,cneill/designate-testing,ionrock/desig... | Add tests for limits api in V1 api
Change-Id: Id05520acf5e3a62647915829d72ca7afd3916337 | # coding=utf-8
# Copyright 2012 Managed I.T.
#
# Author: Kiall Mac Innes <[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... | <commit_before><commit_msg>Add tests for limits api in V1 api
Change-Id: Id05520acf5e3a62647915829d72ca7afd3916337<commit_after> | # coding=utf-8
# Copyright 2012 Managed I.T.
#
# Author: Kiall Mac Innes <[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... | Add tests for limits api in V1 api
Change-Id: Id05520acf5e3a62647915829d72ca7afd3916337# coding=utf-8
# Copyright 2012 Managed I.T.
#
# Author: Kiall Mac Innes <[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... | <commit_before><commit_msg>Add tests for limits api in V1 api
Change-Id: Id05520acf5e3a62647915829d72ca7afd3916337<commit_after># coding=utf-8
# Copyright 2012 Managed I.T.
#
# Author: Kiall Mac Innes <[email protected]>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file e... | |
52b62e2bfd5bef7ad1047259d0516539c20a2442 | scifight_proj/management/commands/changepassword_quiet.py | scifight_proj/management/commands/changepassword_quiet.py | from django.contrib.auth import get_user_model
from django.core.management.base import BaseCommand, CommandError
from django.db import DEFAULT_DB_ALIAS
class Command(BaseCommand):
help = "Quietly change a user's password for django.contrib.auth."
requires_system_checks = False
def add_arguments(self, pa... | Add 'manage.py' command for unattended password setup | Add 'manage.py' command for unattended password setup
Unfortunately, there is no standard way to non-interactively create
superuser account, neither in Django, nor in django-extensions. All the
following commands require manual pasword-typing:
- createsuperuser
- changepassword
- passwd
- set_fake_passwords (work... | Python | agpl-3.0 | turboj55/scifight,turboj55/scifight,scifight/scifight,scifight/scifight,turboj55/scifight,scifight/scifight | Add 'manage.py' command for unattended password setup
Unfortunately, there is no standard way to non-interactively create
superuser account, neither in Django, nor in django-extensions. All the
following commands require manual pasword-typing:
- createsuperuser
- changepassword
- passwd
- set_fake_passwords (work... | from django.contrib.auth import get_user_model
from django.core.management.base import BaseCommand, CommandError
from django.db import DEFAULT_DB_ALIAS
class Command(BaseCommand):
help = "Quietly change a user's password for django.contrib.auth."
requires_system_checks = False
def add_arguments(self, pa... | <commit_before><commit_msg>Add 'manage.py' command for unattended password setup
Unfortunately, there is no standard way to non-interactively create
superuser account, neither in Django, nor in django-extensions. All the
following commands require manual pasword-typing:
- createsuperuser
- changepassword
- passwd
... | from django.contrib.auth import get_user_model
from django.core.management.base import BaseCommand, CommandError
from django.db import DEFAULT_DB_ALIAS
class Command(BaseCommand):
help = "Quietly change a user's password for django.contrib.auth."
requires_system_checks = False
def add_arguments(self, pa... | Add 'manage.py' command for unattended password setup
Unfortunately, there is no standard way to non-interactively create
superuser account, neither in Django, nor in django-extensions. All the
following commands require manual pasword-typing:
- createsuperuser
- changepassword
- passwd
- set_fake_passwords (work... | <commit_before><commit_msg>Add 'manage.py' command for unattended password setup
Unfortunately, there is no standard way to non-interactively create
superuser account, neither in Django, nor in django-extensions. All the
following commands require manual pasword-typing:
- createsuperuser
- changepassword
- passwd
... | |
7f4d21ad84dc12165ea65abd1606d4aa3689e3cb | headers/cpp/nonvirtual_dtors.py | headers/cpp/nonvirtual_dtors.py | #!/usr/bin/env python
#
# Copyright 2008 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | Add script to find destructors which are not virtual, but should be | Add script to find destructors which are not virtual, but should be
git-svn-id: b0ea89ea3bf41df64b6a046736e217d0ae4a0fba@66 806ff5bb-693f-0410-b502-81bc3482ff28
| Python | apache-2.0 | myint/cppclean,myint/cppclean,myint/cppclean,myint/cppclean | Add script to find destructors which are not virtual, but should be
git-svn-id: b0ea89ea3bf41df64b6a046736e217d0ae4a0fba@66 806ff5bb-693f-0410-b502-81bc3482ff28 | #!/usr/bin/env python
#
# Copyright 2008 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | <commit_before><commit_msg>Add script to find destructors which are not virtual, but should be
git-svn-id: b0ea89ea3bf41df64b6a046736e217d0ae4a0fba@66 806ff5bb-693f-0410-b502-81bc3482ff28<commit_after> | #!/usr/bin/env python
#
# Copyright 2008 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | Add script to find destructors which are not virtual, but should be
git-svn-id: b0ea89ea3bf41df64b6a046736e217d0ae4a0fba@66 806ff5bb-693f-0410-b502-81bc3482ff28#!/usr/bin/env python
#
# Copyright 2008 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in ... | <commit_before><commit_msg>Add script to find destructors which are not virtual, but should be
git-svn-id: b0ea89ea3bf41df64b6a046736e217d0ae4a0fba@66 806ff5bb-693f-0410-b502-81bc3482ff28<commit_after>#!/usr/bin/env python
#
# Copyright 2008 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"... | |
50886a39d3cda7b487ed3862626d565c80737add | calaccess_processed/migrations/0011_auto_20171023_1620.py | calaccess_processed/migrations/0011_auto_20171023_1620.py | # -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-10-23 16:20
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('calaccess_processed', '0010_auto_20171013_1838'),
]
operations = [
migrations.Alter... | Add migrations for verbose name changes | Add migrations for verbose name changes
| Python | mit | california-civic-data-coalition/django-calaccess-processed-data,california-civic-data-coalition/django-calaccess-processed-data | Add migrations for verbose name changes | # -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-10-23 16:20
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('calaccess_processed', '0010_auto_20171013_1838'),
]
operations = [
migrations.Alter... | <commit_before><commit_msg>Add migrations for verbose name changes<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-10-23 16:20
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('calaccess_processed', '0010_auto_20171013_1838'),
]
operations = [
migrations.Alter... | Add migrations for verbose name changes# -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-10-23 16:20
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('calaccess_processed', '0010_auto_20171013_1838'),
]
... | <commit_before><commit_msg>Add migrations for verbose name changes<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-10-23 16:20
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('calaccess_processed'... | |
d388709d1c7d52cf1f2552bcfdbfd6b83b578675 | tools/perf/benchmarks/robohornet_pro.py | tools/perf/benchmarks/robohornet_pro.py | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Runs Microsoft's RoboHornet Pro benchmark."""
import os
from telemetry import test
from telemetry.core import util
from telemetry.page import page_m... | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Runs Microsoft's RoboHornet Pro benchmark."""
import os
from telemetry import test
from telemetry.core import util
from telemetry.page import page_m... | Raise robohornetpro timeout. Is it timing out on cros. | [Telemetry] Raise robohornetpro timeout. Is it timing out on cros.
BUG=266129
Review URL: https://chromiumcodereview.appspot.com/21297004
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@214925 0039d316-1c4b-4281-b951-d872f2087c98
| Python | bsd-3-clause | ChromiumWebApps/chromium,ChromiumWebApps/chromium,anirudhSK/chromium,dushu1203/chromium.src,crosswalk-project/chromium-crosswalk-efl,Jonekee/chromium.src,ondra-novak/chromium.src,dednal/chromium.src,markYoungH/chromium.src,ondra-novak/chromium.src,crosswalk-project/chromium-crosswalk-efl,dednal/chromium.src,bright-spar... | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Runs Microsoft's RoboHornet Pro benchmark."""
import os
from telemetry import test
from telemetry.core import util
from telemetry.page import page_m... | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Runs Microsoft's RoboHornet Pro benchmark."""
import os
from telemetry import test
from telemetry.core import util
from telemetry.page import page_m... | <commit_before># Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Runs Microsoft's RoboHornet Pro benchmark."""
import os
from telemetry import test
from telemetry.core import util
from telemetry.pag... | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Runs Microsoft's RoboHornet Pro benchmark."""
import os
from telemetry import test
from telemetry.core import util
from telemetry.page import page_m... | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Runs Microsoft's RoboHornet Pro benchmark."""
import os
from telemetry import test
from telemetry.core import util
from telemetry.page import page_m... | <commit_before># Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Runs Microsoft's RoboHornet Pro benchmark."""
import os
from telemetry import test
from telemetry.core import util
from telemetry.pag... |
5c1fad9e6a75ee43d3a3b7bce6c9249cf601b4b9 | tendrl/commons/objects/cluster_tendrl_context/__init__.py | tendrl/commons/objects/cluster_tendrl_context/__init__.py | import json
import logging
import os
import socket
import uuid
from tendrl.commons.etcdobj import EtcdObj
from tendrl.commons.utils import cmd_utils
from tendrl.commons import objects
LOG = logging.getLogger(__name__)
class ClusterTendrlContext(objects.BaseObject):
def __init__(
self,
integra... | import json
import logging
import os
import socket
import uuid
from tendrl.commons.etcdobj import EtcdObj
from tendrl.commons.utils import cmd_utils
from tendrl.commons import objects
LOG = logging.getLogger(__name__)
class ClusterTendrlContext(objects.BaseObject):
def __init__(
self,
integra... | Write cluster_tendrl_context to proper location | Write cluster_tendrl_context to proper location
Currently it is written to clusters/<node-id>/TendrlContext
This is fixed in this PR
tendrl-bug-id: Tendrl/commons#302
Signed-off-by: nnDarshan <[email protected]>
| Python | lgpl-2.1 | r0h4n/commons,Tendrl/commons,rishubhjain/commons | import json
import logging
import os
import socket
import uuid
from tendrl.commons.etcdobj import EtcdObj
from tendrl.commons.utils import cmd_utils
from tendrl.commons import objects
LOG = logging.getLogger(__name__)
class ClusterTendrlContext(objects.BaseObject):
def __init__(
self,
integra... | import json
import logging
import os
import socket
import uuid
from tendrl.commons.etcdobj import EtcdObj
from tendrl.commons.utils import cmd_utils
from tendrl.commons import objects
LOG = logging.getLogger(__name__)
class ClusterTendrlContext(objects.BaseObject):
def __init__(
self,
integra... | <commit_before>import json
import logging
import os
import socket
import uuid
from tendrl.commons.etcdobj import EtcdObj
from tendrl.commons.utils import cmd_utils
from tendrl.commons import objects
LOG = logging.getLogger(__name__)
class ClusterTendrlContext(objects.BaseObject):
def __init__(
self,
... | import json
import logging
import os
import socket
import uuid
from tendrl.commons.etcdobj import EtcdObj
from tendrl.commons.utils import cmd_utils
from tendrl.commons import objects
LOG = logging.getLogger(__name__)
class ClusterTendrlContext(objects.BaseObject):
def __init__(
self,
integra... | import json
import logging
import os
import socket
import uuid
from tendrl.commons.etcdobj import EtcdObj
from tendrl.commons.utils import cmd_utils
from tendrl.commons import objects
LOG = logging.getLogger(__name__)
class ClusterTendrlContext(objects.BaseObject):
def __init__(
self,
integra... | <commit_before>import json
import logging
import os
import socket
import uuid
from tendrl.commons.etcdobj import EtcdObj
from tendrl.commons.utils import cmd_utils
from tendrl.commons import objects
LOG = logging.getLogger(__name__)
class ClusterTendrlContext(objects.BaseObject):
def __init__(
self,
... |
9a3695316f469bb70161d50665697ab248b0d7f1 | vistrails/tests/resources/console_mode_test.py | vistrails/tests/resources/console_mode_test.py | ############################################################################
##
## Copyright (C) 2006-2007 University of Utah. All rights reserved.
##
## This file is part of VisTrails.
##
## This file may be used under the terms of the GNU General Public
## License version 2.0 as published by the Free Software Foundat... | Package for console_mode test suite. | Package for console_mode test suite.
| Python | bsd-3-clause | Nikea/VisTrails,Nikea/VisTrails,minesense/VisTrails,VisTrails/VisTrails,minesense/VisTrails,hjanime/VisTrails,minesense/VisTrails,Nikea/VisTrails,celiafish/VisTrails,VisTrails/VisTrails,celiafish/VisTrails,hjanime/VisTrails,hjanime/VisTrails,minesense/VisTrails,celiafish/VisTrails,hjanime/VisTrails,VisTrails/VisTrails,... | Package for console_mode test suite. | ############################################################################
##
## Copyright (C) 2006-2007 University of Utah. All rights reserved.
##
## This file is part of VisTrails.
##
## This file may be used under the terms of the GNU General Public
## License version 2.0 as published by the Free Software Foundat... | <commit_before><commit_msg>Package for console_mode test suite.<commit_after> | ############################################################################
##
## Copyright (C) 2006-2007 University of Utah. All rights reserved.
##
## This file is part of VisTrails.
##
## This file may be used under the terms of the GNU General Public
## License version 2.0 as published by the Free Software Foundat... | Package for console_mode test suite.############################################################################
##
## Copyright (C) 2006-2007 University of Utah. All rights reserved.
##
## This file is part of VisTrails.
##
## This file may be used under the terms of the GNU General Public
## License version 2.0 as pu... | <commit_before><commit_msg>Package for console_mode test suite.<commit_after>############################################################################
##
## Copyright (C) 2006-2007 University of Utah. All rights reserved.
##
## This file is part of VisTrails.
##
## This file may be used under the terms of the GNU Ge... | |
8efab0283613dd09b09b1771fe35732c9cbc5cea | common/config.py | common/config.py | import imp
module = imp.new_module('config')
module.__file__ = 'config.py'
config = {}
config_file = open(module.__file__)
exec(compile(config_file.read(), 'config.py', 'exec'), module.__dict__)
for key in dir(module):
if key.isupper():
config[key] = getattr(module, key)
| Add missing file for last commit | Add missing file for last commit
| Python | isc | tobbez/lys-reader | Add missing file for last commit | import imp
module = imp.new_module('config')
module.__file__ = 'config.py'
config = {}
config_file = open(module.__file__)
exec(compile(config_file.read(), 'config.py', 'exec'), module.__dict__)
for key in dir(module):
if key.isupper():
config[key] = getattr(module, key)
| <commit_before><commit_msg>Add missing file for last commit<commit_after> | import imp
module = imp.new_module('config')
module.__file__ = 'config.py'
config = {}
config_file = open(module.__file__)
exec(compile(config_file.read(), 'config.py', 'exec'), module.__dict__)
for key in dir(module):
if key.isupper():
config[key] = getattr(module, key)
| Add missing file for last commitimport imp
module = imp.new_module('config')
module.__file__ = 'config.py'
config = {}
config_file = open(module.__file__)
exec(compile(config_file.read(), 'config.py', 'exec'), module.__dict__)
for key in dir(module):
if key.isupper():
config[key] = getattr(module, key)
| <commit_before><commit_msg>Add missing file for last commit<commit_after>import imp
module = imp.new_module('config')
module.__file__ = 'config.py'
config = {}
config_file = open(module.__file__)
exec(compile(config_file.read(), 'config.py', 'exec'), module.__dict__)
for key in dir(module):
if key.isupper():
... | |
ab9fed3a9a9152ed266d40eab2f16b12c77349fd | tests/test_vcs_bazaar.py | tests/test_vcs_bazaar.py | from tests.test_pip import pyversion
from pip.vcs.bazaar import Bazaar
if pyversion >= '3':
VERBOSE_FALSE = False
else:
VERBOSE_FALSE = 0
def test_bazaar_simple_urls():
"""
Test bzr url support.
SSH and launchpad have special handling.
"""
http_bzr_repo = Bazaar(url='bzr+http://bzr.mypro... | Add unit tests for bazaar URL handling | Add unit tests for bazaar URL handling
Tested on 2.4.4, 2.7.1 and 3.2
nosetests tests.test_vcs_bazaar passes in each, full setup.py test gives:
2.4:
----------------------------------------------------------------------
Ran 107 tests in 167.345s
OK
2.7 fails 1 on Test freezing a mercurial clone
Script result: py... | Python | mit | pypa/pip,willingc/pip,jythontools/pip,blarghmatey/pip,patricklaw/pip,domenkozar/pip,rouge8/pip,squidsoup/pip,zorosteven/pip,benesch/pip,pjdelport/pip,zvezdan/pip,dstufft/pip,supriyantomaftuh/pip,sbidoul/pip,caosmo/pip,natefoo/pip,h4ck3rm1k3/pip,techtonik/pip,minrk/pip,jasonkying/pip,sigmavirus24/pip,RonnyPfannschmidt/p... | Add unit tests for bazaar URL handling
Tested on 2.4.4, 2.7.1 and 3.2
nosetests tests.test_vcs_bazaar passes in each, full setup.py test gives:
2.4:
----------------------------------------------------------------------
Ran 107 tests in 167.345s
OK
2.7 fails 1 on Test freezing a mercurial clone
Script result: py... | from tests.test_pip import pyversion
from pip.vcs.bazaar import Bazaar
if pyversion >= '3':
VERBOSE_FALSE = False
else:
VERBOSE_FALSE = 0
def test_bazaar_simple_urls():
"""
Test bzr url support.
SSH and launchpad have special handling.
"""
http_bzr_repo = Bazaar(url='bzr+http://bzr.mypro... | <commit_before><commit_msg>Add unit tests for bazaar URL handling
Tested on 2.4.4, 2.7.1 and 3.2
nosetests tests.test_vcs_bazaar passes in each, full setup.py test gives:
2.4:
----------------------------------------------------------------------
Ran 107 tests in 167.345s
OK
2.7 fails 1 on Test freezing a mercuri... | from tests.test_pip import pyversion
from pip.vcs.bazaar import Bazaar
if pyversion >= '3':
VERBOSE_FALSE = False
else:
VERBOSE_FALSE = 0
def test_bazaar_simple_urls():
"""
Test bzr url support.
SSH and launchpad have special handling.
"""
http_bzr_repo = Bazaar(url='bzr+http://bzr.mypro... | Add unit tests for bazaar URL handling
Tested on 2.4.4, 2.7.1 and 3.2
nosetests tests.test_vcs_bazaar passes in each, full setup.py test gives:
2.4:
----------------------------------------------------------------------
Ran 107 tests in 167.345s
OK
2.7 fails 1 on Test freezing a mercurial clone
Script result: py... | <commit_before><commit_msg>Add unit tests for bazaar URL handling
Tested on 2.4.4, 2.7.1 and 3.2
nosetests tests.test_vcs_bazaar passes in each, full setup.py test gives:
2.4:
----------------------------------------------------------------------
Ran 107 tests in 167.345s
OK
2.7 fails 1 on Test freezing a mercuri... | |
a1a552857498206b6684681eb457978dd5adf710 | nap/rest/mapper.py | nap/rest/mapper.py | '''
Mixins for using Mappers with Publisher
'''
from django.core.exceptions import ValidationError
from nap import http
from nap.utils import flatten_errors
class MapperListMixin(object):
def list_get_default(self, request, action, object_id):
'''
Replace the default list handler with one that r... | Add Publisher mixins for using Mappers | Add Publisher mixins for using Mappers
| Python | bsd-3-clause | limbera/django-nap,MarkusH/django-nap | Add Publisher mixins for using Mappers | '''
Mixins for using Mappers with Publisher
'''
from django.core.exceptions import ValidationError
from nap import http
from nap.utils import flatten_errors
class MapperListMixin(object):
def list_get_default(self, request, action, object_id):
'''
Replace the default list handler with one that r... | <commit_before><commit_msg>Add Publisher mixins for using Mappers<commit_after> | '''
Mixins for using Mappers with Publisher
'''
from django.core.exceptions import ValidationError
from nap import http
from nap.utils import flatten_errors
class MapperListMixin(object):
def list_get_default(self, request, action, object_id):
'''
Replace the default list handler with one that r... | Add Publisher mixins for using Mappers'''
Mixins for using Mappers with Publisher
'''
from django.core.exceptions import ValidationError
from nap import http
from nap.utils import flatten_errors
class MapperListMixin(object):
def list_get_default(self, request, action, object_id):
'''
Replace th... | <commit_before><commit_msg>Add Publisher mixins for using Mappers<commit_after>'''
Mixins for using Mappers with Publisher
'''
from django.core.exceptions import ValidationError
from nap import http
from nap.utils import flatten_errors
class MapperListMixin(object):
def list_get_default(self, request, action, o... | |
ff50744e2dd1f04959e4f7f63ff3a08d21ef9839 | pint-numpy-type.py | pint-numpy-type.py | # A variable imbued with pint unit mutates its state when touched by Numpy.
# Source https://github.com/hgrecco/pint/blob/master/pint/quantity.py#L1165-L1167
# Since https://github.com/hgrecco/pint/commit/53d5fca35948a5bb80cb900e8e692e8206b1512a
import pint # 0.7.2
import numpy as np # 1.11.1
units = pint.UnitRegist... | Add pint numpy type snippet | Add pint numpy type snippet
| Python | mit | cmey/surprising-snippets,cmey/surprising-snippets | Add pint numpy type snippet | # A variable imbued with pint unit mutates its state when touched by Numpy.
# Source https://github.com/hgrecco/pint/blob/master/pint/quantity.py#L1165-L1167
# Since https://github.com/hgrecco/pint/commit/53d5fca35948a5bb80cb900e8e692e8206b1512a
import pint # 0.7.2
import numpy as np # 1.11.1
units = pint.UnitRegist... | <commit_before><commit_msg>Add pint numpy type snippet<commit_after> | # A variable imbued with pint unit mutates its state when touched by Numpy.
# Source https://github.com/hgrecco/pint/blob/master/pint/quantity.py#L1165-L1167
# Since https://github.com/hgrecco/pint/commit/53d5fca35948a5bb80cb900e8e692e8206b1512a
import pint # 0.7.2
import numpy as np # 1.11.1
units = pint.UnitRegist... | Add pint numpy type snippet# A variable imbued with pint unit mutates its state when touched by Numpy.
# Source https://github.com/hgrecco/pint/blob/master/pint/quantity.py#L1165-L1167
# Since https://github.com/hgrecco/pint/commit/53d5fca35948a5bb80cb900e8e692e8206b1512a
import pint # 0.7.2
import numpy as np # 1.11... | <commit_before><commit_msg>Add pint numpy type snippet<commit_after># A variable imbued with pint unit mutates its state when touched by Numpy.
# Source https://github.com/hgrecco/pint/blob/master/pint/quantity.py#L1165-L1167
# Since https://github.com/hgrecco/pint/commit/53d5fca35948a5bb80cb900e8e692e8206b1512a
import... | |
bf8c008742dd921865f18f10b1c925c485406343 | django_lightweight_queue/management/commands/queue_configuration.py | django_lightweight_queue/management/commands/queue_configuration.py | from django.core.management.base import NoArgsCommand
from ... import app_settings
class Command(NoArgsCommand):
def handle_noargs(self, **options):
print "django-lightweight-queue"
print "========================"
print
print "{0:<15} {1:>5}".format("Queue name", "Concurrency")
... | Add a quick way to show the current queue configuration. | Add a quick way to show the current queue configuration.
Signed-off-by: Chris Lamb <[email protected]>
| Python | bsd-3-clause | prophile/django-lightweight-queue,prophile/django-lightweight-queue,thread/django-lightweight-queue,lamby/django-lightweight-queue,thread/django-lightweight-queue | Add a quick way to show the current queue configuration.
Signed-off-by: Chris Lamb <[email protected]> | from django.core.management.base import NoArgsCommand
from ... import app_settings
class Command(NoArgsCommand):
def handle_noargs(self, **options):
print "django-lightweight-queue"
print "========================"
print
print "{0:<15} {1:>5}".format("Queue name", "Concurrency")
... | <commit_before><commit_msg>Add a quick way to show the current queue configuration.
Signed-off-by: Chris Lamb <[email protected]><commit_after> | from django.core.management.base import NoArgsCommand
from ... import app_settings
class Command(NoArgsCommand):
def handle_noargs(self, **options):
print "django-lightweight-queue"
print "========================"
print
print "{0:<15} {1:>5}".format("Queue name", "Concurrency")
... | Add a quick way to show the current queue configuration.
Signed-off-by: Chris Lamb <[email protected]>from django.core.management.base import NoArgsCommand
from ... import app_settings
class Command(NoArgsCommand):
def handle_noargs(self, **options):
print "django-lightw... | <commit_before><commit_msg>Add a quick way to show the current queue configuration.
Signed-off-by: Chris Lamb <[email protected]><commit_after>from django.core.management.base import NoArgsCommand
from ... import app_settings
class Command(NoArgsCommand):
def handle_noargs(self,... | |
f54f1cea9a839e97b27103638530fb030ca81a6a | app/utils/scripts/update-defconfig.py | app/utils/scripts/update-defconfig.py | #!/usr/bin/python
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope t... | Add utility script to convert/update builds. | Add utility script to convert/update builds.
* Moving to mass-rename everything into build, the script is
used to convert defconfig_id fields into build_id.
* Add "kernel" type to build documents.
| Python | lgpl-2.1 | kernelci/kernelci-backend,kernelci/kernelci-backend | Add utility script to convert/update builds.
* Moving to mass-rename everything into build, the script is
used to convert defconfig_id fields into build_id.
* Add "kernel" type to build documents. | #!/usr/bin/python
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope t... | <commit_before><commit_msg>Add utility script to convert/update builds.
* Moving to mass-rename everything into build, the script is
used to convert defconfig_id fields into build_id.
* Add "kernel" type to build documents.<commit_after> | #!/usr/bin/python
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope t... | Add utility script to convert/update builds.
* Moving to mass-rename everything into build, the script is
used to convert defconfig_id fields into build_id.
* Add "kernel" type to build documents.#!/usr/bin/python
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... | <commit_before><commit_msg>Add utility script to convert/update builds.
* Moving to mass-rename everything into build, the script is
used to convert defconfig_id fields into build_id.
* Add "kernel" type to build documents.<commit_after>#!/usr/bin/python
#
# This program is free software: you can redistribute ... | |
6708fd75eb7272701e8e333e4940e47d5b6a05af | plugin_tests/web_client_test.py | plugin_tests/web_client_test.py | from tests import web_client_test
setUpModule = web_client_test.setUpModule
tearDownModule = web_client_test.tearDownModule
class WebClientTestCase(web_client_test.WebClientTestCase):
def setUp(self):
super(WebClientTestCase, self).setUp()
self.model('user').createUser(
login='mine... | Add a custom client side test runner | Add a custom client side test runner
| Python | apache-2.0 | Kitware/minerva,Kitware/minerva,Kitware/minerva | Add a custom client side test runner | from tests import web_client_test
setUpModule = web_client_test.setUpModule
tearDownModule = web_client_test.tearDownModule
class WebClientTestCase(web_client_test.WebClientTestCase):
def setUp(self):
super(WebClientTestCase, self).setUp()
self.model('user').createUser(
login='mine... | <commit_before><commit_msg>Add a custom client side test runner<commit_after> | from tests import web_client_test
setUpModule = web_client_test.setUpModule
tearDownModule = web_client_test.tearDownModule
class WebClientTestCase(web_client_test.WebClientTestCase):
def setUp(self):
super(WebClientTestCase, self).setUp()
self.model('user').createUser(
login='mine... | Add a custom client side test runnerfrom tests import web_client_test
setUpModule = web_client_test.setUpModule
tearDownModule = web_client_test.tearDownModule
class WebClientTestCase(web_client_test.WebClientTestCase):
def setUp(self):
super(WebClientTestCase, self).setUp()
self.model('user')... | <commit_before><commit_msg>Add a custom client side test runner<commit_after>from tests import web_client_test
setUpModule = web_client_test.setUpModule
tearDownModule = web_client_test.tearDownModule
class WebClientTestCase(web_client_test.WebClientTestCase):
def setUp(self):
super(WebClientTestCase, ... | |
e77957398f78f905c6b8ac881b621c67c1352d0a | py/target-sum.py | py/target-sum.py | from collections import Counter
class Solution(object):
def findTargetSumWays(self, nums, S):
"""
:type nums: List[int]
:type S: int
:rtype: int
"""
c = Counter()
c[0] = 1
for n in nums:
nc = Counter()
for k, v in c.iteritems():... | Add py solution for 494. Target Sum | Add py solution for 494. Target Sum
494. Target Sum: https://leetcode.com/problems/target-sum/
| Python | apache-2.0 | ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode | Add py solution for 494. Target Sum
494. Target Sum: https://leetcode.com/problems/target-sum/ | from collections import Counter
class Solution(object):
def findTargetSumWays(self, nums, S):
"""
:type nums: List[int]
:type S: int
:rtype: int
"""
c = Counter()
c[0] = 1
for n in nums:
nc = Counter()
for k, v in c.iteritems():... | <commit_before><commit_msg>Add py solution for 494. Target Sum
494. Target Sum: https://leetcode.com/problems/target-sum/<commit_after> | from collections import Counter
class Solution(object):
def findTargetSumWays(self, nums, S):
"""
:type nums: List[int]
:type S: int
:rtype: int
"""
c = Counter()
c[0] = 1
for n in nums:
nc = Counter()
for k, v in c.iteritems():... | Add py solution for 494. Target Sum
494. Target Sum: https://leetcode.com/problems/target-sum/from collections import Counter
class Solution(object):
def findTargetSumWays(self, nums, S):
"""
:type nums: List[int]
:type S: int
:rtype: int
"""
c = Counter()
c[... | <commit_before><commit_msg>Add py solution for 494. Target Sum
494. Target Sum: https://leetcode.com/problems/target-sum/<commit_after>from collections import Counter
class Solution(object):
def findTargetSumWays(self, nums, S):
"""
:type nums: List[int]
:type S: int
:rtype: int
... | |
cbf29ea21179dcf3cf9c5f0a7eacd664f025f5db | tools/scripts/remove_package.py | tools/scripts/remove_package.py | import fnmatch
import os
import re
re_reference = re.compile(r'\<Reference Include=\"([\w\.]+)\,.*?\<\/Reference\>', re.DOTALL | re.MULTILINE)
def process_csproj(file, delete_package):
proj = open(file).read()
def repl(mo):
if mo.group(1) == delete_package:
return ""
else:
... | Add small utility for removing package references | Add small utility for removing package references
| Python | mit | SaladLab/Akka.Interfaced,SaladbowlCreative/Akka.Interfaced,SaladbowlCreative/Akka.Interfaced,SaladLab/Akka.Interfaced | Add small utility for removing package references | import fnmatch
import os
import re
re_reference = re.compile(r'\<Reference Include=\"([\w\.]+)\,.*?\<\/Reference\>', re.DOTALL | re.MULTILINE)
def process_csproj(file, delete_package):
proj = open(file).read()
def repl(mo):
if mo.group(1) == delete_package:
return ""
else:
... | <commit_before><commit_msg>Add small utility for removing package references<commit_after> | import fnmatch
import os
import re
re_reference = re.compile(r'\<Reference Include=\"([\w\.]+)\,.*?\<\/Reference\>', re.DOTALL | re.MULTILINE)
def process_csproj(file, delete_package):
proj = open(file).read()
def repl(mo):
if mo.group(1) == delete_package:
return ""
else:
... | Add small utility for removing package referencesimport fnmatch
import os
import re
re_reference = re.compile(r'\<Reference Include=\"([\w\.]+)\,.*?\<\/Reference\>', re.DOTALL | re.MULTILINE)
def process_csproj(file, delete_package):
proj = open(file).read()
def repl(mo):
if mo.group(1) == delete_pack... | <commit_before><commit_msg>Add small utility for removing package references<commit_after>import fnmatch
import os
import re
re_reference = re.compile(r'\<Reference Include=\"([\w\.]+)\,.*?\<\/Reference\>', re.DOTALL | re.MULTILINE)
def process_csproj(file, delete_package):
proj = open(file).read()
def repl(m... | |
f7fd11d657f10b2cb29000a29fcf839da6dea921 | test/python/topology/test2_submission_params.py | test/python/topology/test2_submission_params.py | # coding=utf-8
# Licensed Materials - Property of IBM
# Copyright IBM Corp. 2016
from __future__ import print_function
import unittest
import sys
import itertools
from enum import IntEnum
import datetime
import decimal
import test_vers
from streamsx.topology.schema import StreamSchema
from streamsx.topology.topology ... | Add initial Python submission parameter test | Add initial Python submission parameter test
| Python | apache-2.0 | ddebrunner/streamsx.topology,ddebrunner/streamsx.topology,IBMStreams/streamsx.topology,ddebrunner/streamsx.topology,IBMStreams/streamsx.topology,ddebrunner/streamsx.topology,IBMStreams/streamsx.topology,ddebrunner/streamsx.topology,ddebrunner/streamsx.topology,ddebrunner/streamsx.topology,IBMStreams/streamsx.topology,I... | Add initial Python submission parameter test | # coding=utf-8
# Licensed Materials - Property of IBM
# Copyright IBM Corp. 2016
from __future__ import print_function
import unittest
import sys
import itertools
from enum import IntEnum
import datetime
import decimal
import test_vers
from streamsx.topology.schema import StreamSchema
from streamsx.topology.topology ... | <commit_before><commit_msg>Add initial Python submission parameter test<commit_after> | # coding=utf-8
# Licensed Materials - Property of IBM
# Copyright IBM Corp. 2016
from __future__ import print_function
import unittest
import sys
import itertools
from enum import IntEnum
import datetime
import decimal
import test_vers
from streamsx.topology.schema import StreamSchema
from streamsx.topology.topology ... | Add initial Python submission parameter test# coding=utf-8
# Licensed Materials - Property of IBM
# Copyright IBM Corp. 2016
from __future__ import print_function
import unittest
import sys
import itertools
from enum import IntEnum
import datetime
import decimal
import test_vers
from streamsx.topology.schema import S... | <commit_before><commit_msg>Add initial Python submission parameter test<commit_after># coding=utf-8
# Licensed Materials - Property of IBM
# Copyright IBM Corp. 2016
from __future__ import print_function
import unittest
import sys
import itertools
from enum import IntEnum
import datetime
import decimal
import test_ver... | |
0fa5e9944d573d053633b1ea81497bc20598abee | CodeFights/longestWord.py | CodeFights/longestWord.py | #!/usr/local/bin/python
# Code Fights Longest Word Problem
import re
def longestWord(text):
m = re.findall(r'\b[a-z]+?\b', text, flags=re.I)
return max(m, key=len)
def main():
tests = [
["Ready, steady, go!", "steady"],
["Ready[[[, steady, go!", "steady"],
["ABCd", "ABCd"]
]... | Solve Code Fights longest word problem | Solve Code Fights longest word problem
| Python | mit | HKuz/Test_Code | Solve Code Fights longest word problem | #!/usr/local/bin/python
# Code Fights Longest Word Problem
import re
def longestWord(text):
m = re.findall(r'\b[a-z]+?\b', text, flags=re.I)
return max(m, key=len)
def main():
tests = [
["Ready, steady, go!", "steady"],
["Ready[[[, steady, go!", "steady"],
["ABCd", "ABCd"]
]... | <commit_before><commit_msg>Solve Code Fights longest word problem<commit_after> | #!/usr/local/bin/python
# Code Fights Longest Word Problem
import re
def longestWord(text):
m = re.findall(r'\b[a-z]+?\b', text, flags=re.I)
return max(m, key=len)
def main():
tests = [
["Ready, steady, go!", "steady"],
["Ready[[[, steady, go!", "steady"],
["ABCd", "ABCd"]
]... | Solve Code Fights longest word problem#!/usr/local/bin/python
# Code Fights Longest Word Problem
import re
def longestWord(text):
m = re.findall(r'\b[a-z]+?\b', text, flags=re.I)
return max(m, key=len)
def main():
tests = [
["Ready, steady, go!", "steady"],
["Ready[[[, steady, go!", "st... | <commit_before><commit_msg>Solve Code Fights longest word problem<commit_after>#!/usr/local/bin/python
# Code Fights Longest Word Problem
import re
def longestWord(text):
m = re.findall(r'\b[a-z]+?\b', text, flags=re.I)
return max(m, key=len)
def main():
tests = [
["Ready, steady, go!", "steady... | |
31b46f0ab99b945a97e3dd08d7e8d6a9a63ad75a | array/922.py | array/922.py | class Solution:
def sortArrayByParityII(self, A):
"""
:type A: List[int]
:rtype: List[int]
"""
if not A:
return A
size = len(A)
even = 0
odd = 1
while even < size - 1 and odd < size:
while even < size -... | Sort Array By Parity II | Sort Array By Parity II
| Python | apache-2.0 | MingfeiPan/leetcode,MingfeiPan/leetcode,MingfeiPan/leetcode,MingfeiPan/leetcode,MingfeiPan/leetcode | Sort Array By Parity II | class Solution:
def sortArrayByParityII(self, A):
"""
:type A: List[int]
:rtype: List[int]
"""
if not A:
return A
size = len(A)
even = 0
odd = 1
while even < size - 1 and odd < size:
while even < size -... | <commit_before><commit_msg>Sort Array By Parity II<commit_after> | class Solution:
def sortArrayByParityII(self, A):
"""
:type A: List[int]
:rtype: List[int]
"""
if not A:
return A
size = len(A)
even = 0
odd = 1
while even < size - 1 and odd < size:
while even < size -... | Sort Array By Parity IIclass Solution:
def sortArrayByParityII(self, A):
"""
:type A: List[int]
:rtype: List[int]
"""
if not A:
return A
size = len(A)
even = 0
odd = 1
while even < size - 1 and odd < size:
... | <commit_before><commit_msg>Sort Array By Parity II<commit_after>class Solution:
def sortArrayByParityII(self, A):
"""
:type A: List[int]
:rtype: List[int]
"""
if not A:
return A
size = len(A)
even = 0
odd = 1
while... | |
eade3fa4f4d53574f359b9006b4d36b1bf428d49 | tests/pluginregistry.py | tests/pluginregistry.py | #!/usr/bin/env python2
import Cura.PluginRegistry
p = Cura.PluginRegistry.PluginRegistry()
p.addPluginLocation("plugins")
p._populateMetaData()
#p.loadPlugin("ExamplePlugin")
print(p.getMetaData("ExamplePlugin"))
| Add a tiny test application for testing the plugin registry | Add a tiny test application for testing the plugin registry
| Python | agpl-3.0 | onitake/Uranium,onitake/Uranium | Add a tiny test application for testing the plugin registry | #!/usr/bin/env python2
import Cura.PluginRegistry
p = Cura.PluginRegistry.PluginRegistry()
p.addPluginLocation("plugins")
p._populateMetaData()
#p.loadPlugin("ExamplePlugin")
print(p.getMetaData("ExamplePlugin"))
| <commit_before><commit_msg>Add a tiny test application for testing the plugin registry<commit_after> | #!/usr/bin/env python2
import Cura.PluginRegistry
p = Cura.PluginRegistry.PluginRegistry()
p.addPluginLocation("plugins")
p._populateMetaData()
#p.loadPlugin("ExamplePlugin")
print(p.getMetaData("ExamplePlugin"))
| Add a tiny test application for testing the plugin registry#!/usr/bin/env python2
import Cura.PluginRegistry
p = Cura.PluginRegistry.PluginRegistry()
p.addPluginLocation("plugins")
p._populateMetaData()
#p.loadPlugin("ExamplePlugin")
print(p.getMetaData("ExamplePlugin"))
| <commit_before><commit_msg>Add a tiny test application for testing the plugin registry<commit_after>#!/usr/bin/env python2
import Cura.PluginRegistry
p = Cura.PluginRegistry.PluginRegistry()
p.addPluginLocation("plugins")
p._populateMetaData()
#p.loadPlugin("ExamplePlugin")
print(p.getMetaData("ExamplePlugin"))
| |
c6fbba9da9d1cf2a5a0007a56d192e267d19fcff | flexget/utils/database.py | flexget/utils/database.py | from flexget.manager import Session
def with_session(func):
""""Creates a session if one was not passed via keyword argument to the function"""
def wrapper(*args, **kwargs):
passed_session = kwargs.get('session')
if not passed_session:
session = Session(autoflush=True)
... | from flexget.manager import Session
def with_session(func):
""""Creates a session if one was not passed via keyword argument to the function"""
def wrapper(*args, **kwargs):
if not kwargs.get('session'):
kwargs['session'] = Session(autoflush=True)
try:
... | Fix with_session decorator for python 2.5 | Fix with_session decorator for python 2.5
git-svn-id: ad91b9aa7ba7638d69f912c9f5d012e3326e9f74@1957 3942dd89-8c5d-46d7-aeed-044bccf3e60c
| Python | mit | vfrc2/Flexget,tobinjt/Flexget,Pretagonist/Flexget,oxc/Flexget,Danfocus/Flexget,jacobmetrick/Flexget,Flexget/Flexget,spencerjanssen/Flexget,ianstalk/Flexget,xfouloux/Flexget,malkavi/Flexget,asm0dey/Flexget,v17al/Flexget,camon/Flexget,ZefQ/Flexget,cvium/Flexget,jacobmetrick/Flexget,crawln45/Flexget,camon/Flexget,OmgOhnoe... | from flexget.manager import Session
def with_session(func):
""""Creates a session if one was not passed via keyword argument to the function"""
def wrapper(*args, **kwargs):
passed_session = kwargs.get('session')
if not passed_session:
session = Session(autoflush=True)
... | from flexget.manager import Session
def with_session(func):
""""Creates a session if one was not passed via keyword argument to the function"""
def wrapper(*args, **kwargs):
if not kwargs.get('session'):
kwargs['session'] = Session(autoflush=True)
try:
... | <commit_before>from flexget.manager import Session
def with_session(func):
""""Creates a session if one was not passed via keyword argument to the function"""
def wrapper(*args, **kwargs):
passed_session = kwargs.get('session')
if not passed_session:
session = Session(aut... | from flexget.manager import Session
def with_session(func):
""""Creates a session if one was not passed via keyword argument to the function"""
def wrapper(*args, **kwargs):
if not kwargs.get('session'):
kwargs['session'] = Session(autoflush=True)
try:
... | from flexget.manager import Session
def with_session(func):
""""Creates a session if one was not passed via keyword argument to the function"""
def wrapper(*args, **kwargs):
passed_session = kwargs.get('session')
if not passed_session:
session = Session(autoflush=True)
... | <commit_before>from flexget.manager import Session
def with_session(func):
""""Creates a session if one was not passed via keyword argument to the function"""
def wrapper(*args, **kwargs):
passed_session = kwargs.get('session')
if not passed_session:
session = Session(aut... |
544857a7a3cdb40fd793fed8e33694d551cc695f | pomodoro_calculator/main.py | pomodoro_calculator/main.py | """Calculate the number of Pomodori available within a time period.
Usage:
get-pomodori [--from=<time>] [--break=<minutes>] [--long-break=<minutes>] <end-time>
get-pomodori (-h | --help | --version)
Options:
--version show program's version number and exit.
-h, --help show t... | Add initial version of the commandline tool | Add initial version of the commandline tool
| Python | mit | Matt-Deacalion/Pomodoro-Calculator | Add initial version of the commandline tool | """Calculate the number of Pomodori available within a time period.
Usage:
get-pomodori [--from=<time>] [--break=<minutes>] [--long-break=<minutes>] <end-time>
get-pomodori (-h | --help | --version)
Options:
--version show program's version number and exit.
-h, --help show t... | <commit_before><commit_msg>Add initial version of the commandline tool<commit_after> | """Calculate the number of Pomodori available within a time period.
Usage:
get-pomodori [--from=<time>] [--break=<minutes>] [--long-break=<minutes>] <end-time>
get-pomodori (-h | --help | --version)
Options:
--version show program's version number and exit.
-h, --help show t... | Add initial version of the commandline tool"""Calculate the number of Pomodori available within a time period.
Usage:
get-pomodori [--from=<time>] [--break=<minutes>] [--long-break=<minutes>] <end-time>
get-pomodori (-h | --help | --version)
Options:
--version show program's version number and... | <commit_before><commit_msg>Add initial version of the commandline tool<commit_after>"""Calculate the number of Pomodori available within a time period.
Usage:
get-pomodori [--from=<time>] [--break=<minutes>] [--long-break=<minutes>] <end-time>
get-pomodori (-h | --help | --version)
Options:
--version ... | |
08573c7c6eb20c7cf168d38a6566757b08fed6d9 | python/opencv/opencv_2/videos/capture_video_from_camera.py | python/opencv/opencv_2/videos/capture_video_from_camera.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2015 Jérémie DECOCK (http://www.jdhp.org)
"""
OpenCV - Read image: read an image given in arguments
Required: opencv library (Debian: aptitude install python-opencv)
See: https://opencv-python-tutroals.readthedocs.org/en/latest/py_tutorials/py_gui/py_vid... | Add a snippet (Python OpenCV). | Add a snippet (Python OpenCV).
| Python | mit | jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets | Add a snippet (Python OpenCV). | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2015 Jérémie DECOCK (http://www.jdhp.org)
"""
OpenCV - Read image: read an image given in arguments
Required: opencv library (Debian: aptitude install python-opencv)
See: https://opencv-python-tutroals.readthedocs.org/en/latest/py_tutorials/py_gui/py_vid... | <commit_before><commit_msg>Add a snippet (Python OpenCV).<commit_after> | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2015 Jérémie DECOCK (http://www.jdhp.org)
"""
OpenCV - Read image: read an image given in arguments
Required: opencv library (Debian: aptitude install python-opencv)
See: https://opencv-python-tutroals.readthedocs.org/en/latest/py_tutorials/py_gui/py_vid... | Add a snippet (Python OpenCV).#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2015 Jérémie DECOCK (http://www.jdhp.org)
"""
OpenCV - Read image: read an image given in arguments
Required: opencv library (Debian: aptitude install python-opencv)
See: https://opencv-python-tutroals.readthedocs.org/en/lat... | <commit_before><commit_msg>Add a snippet (Python OpenCV).<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2015 Jérémie DECOCK (http://www.jdhp.org)
"""
OpenCV - Read image: read an image given in arguments
Required: opencv library (Debian: aptitude install python-opencv)
See: https://open... | |
e0d631b4aab431c31689ccd7aa6ac92d95e32e80 | tests/test_frontend.py | tests/test_frontend.py | import os
from tvrenamr.cli import helpers
from .base import BaseTest
class TestFrontEnd(BaseTest):
def setup(self):
super(TestFrontEnd, self).setup()
self.config = helpers.get_config()
def test_passing_current_dir_makes_file_list_a_list(self):
assert isinstance(helpers.build_file_l... | import collections
import os
import sys
from tvrenamr.cli import helpers
from .utils import random_files
def test_passing_current_dir_makes_file_list_a_list(files):
file_list = helpers.build_file_list([files])
assert isinstance(file_list, collections.Iterable)
PY3 = sys.version_info[0] == 3
string... | Move to function only tests & fix test for generator based build_file_list | Move to function only tests & fix test for generator based build_file_list
build_file_list is a generator now so we need to make sure it returns an
iterable but not a string.
| Python | mit | wintersandroid/tvrenamr,ghickman/tvrenamr | import os
from tvrenamr.cli import helpers
from .base import BaseTest
class TestFrontEnd(BaseTest):
def setup(self):
super(TestFrontEnd, self).setup()
self.config = helpers.get_config()
def test_passing_current_dir_makes_file_list_a_list(self):
assert isinstance(helpers.build_file_l... | import collections
import os
import sys
from tvrenamr.cli import helpers
from .utils import random_files
def test_passing_current_dir_makes_file_list_a_list(files):
file_list = helpers.build_file_list([files])
assert isinstance(file_list, collections.Iterable)
PY3 = sys.version_info[0] == 3
string... | <commit_before>import os
from tvrenamr.cli import helpers
from .base import BaseTest
class TestFrontEnd(BaseTest):
def setup(self):
super(TestFrontEnd, self).setup()
self.config = helpers.get_config()
def test_passing_current_dir_makes_file_list_a_list(self):
assert isinstance(helpe... | import collections
import os
import sys
from tvrenamr.cli import helpers
from .utils import random_files
def test_passing_current_dir_makes_file_list_a_list(files):
file_list = helpers.build_file_list([files])
assert isinstance(file_list, collections.Iterable)
PY3 = sys.version_info[0] == 3
string... | import os
from tvrenamr.cli import helpers
from .base import BaseTest
class TestFrontEnd(BaseTest):
def setup(self):
super(TestFrontEnd, self).setup()
self.config = helpers.get_config()
def test_passing_current_dir_makes_file_list_a_list(self):
assert isinstance(helpers.build_file_l... | <commit_before>import os
from tvrenamr.cli import helpers
from .base import BaseTest
class TestFrontEnd(BaseTest):
def setup(self):
super(TestFrontEnd, self).setup()
self.config = helpers.get_config()
def test_passing_current_dir_makes_file_list_a_list(self):
assert isinstance(helpe... |
d47d7931f5531c4fe28598d15c305592e446af2b | tests/test_settings.py | tests/test_settings.py |
def test_settings_group(plex):
assert plex.settings.group('general')
def test_settings_get(plex):
# This is the value since it we havnt set any friendlyname
# plex just default to computer name but it NOT in the settings.
assert plex.settings.get('FriendlyName').value == ''
def test_settings_get(pl... | Add some test for settings. TODO fix save. | Add some test for settings. TODO fix save.
| Python | bsd-3-clause | pkkid/python-plexapi,mjs7231/python-plexapi | Add some test for settings. TODO fix save. |
def test_settings_group(plex):
assert plex.settings.group('general')
def test_settings_get(plex):
# This is the value since it we havnt set any friendlyname
# plex just default to computer name but it NOT in the settings.
assert plex.settings.get('FriendlyName').value == ''
def test_settings_get(pl... | <commit_before><commit_msg>Add some test for settings. TODO fix save.<commit_after> |
def test_settings_group(plex):
assert plex.settings.group('general')
def test_settings_get(plex):
# This is the value since it we havnt set any friendlyname
# plex just default to computer name but it NOT in the settings.
assert plex.settings.get('FriendlyName').value == ''
def test_settings_get(pl... | Add some test for settings. TODO fix save.
def test_settings_group(plex):
assert plex.settings.group('general')
def test_settings_get(plex):
# This is the value since it we havnt set any friendlyname
# plex just default to computer name but it NOT in the settings.
assert plex.settings.get('FriendlyNam... | <commit_before><commit_msg>Add some test for settings. TODO fix save.<commit_after>
def test_settings_group(plex):
assert plex.settings.group('general')
def test_settings_get(plex):
# This is the value since it we havnt set any friendlyname
# plex just default to computer name but it NOT in the settings.
... | |
0db38995d9cb7733d5dcc7bd88234c4a356fc9fb | util/merge_coop_nwsli.py | util/merge_coop_nwsli.py | # Need to check the log files for shef parser and create new sites
# within database based on what we find
import re, iemdb, os
MESOSITE = iemdb.connect('mesosite', bypass=False)
# Load up our database
sites = {}
for line in open('coop_nwsli.txt'):
tokens = line.split("|")
if len(tokens) < 9:
contin... | Add tool for adding COOP IDs | Add tool for adding COOP IDs
| Python | mit | akrherz/pyWWA,akrherz/pyWWA | Add tool for adding COOP IDs | # Need to check the log files for shef parser and create new sites
# within database based on what we find
import re, iemdb, os
MESOSITE = iemdb.connect('mesosite', bypass=False)
# Load up our database
sites = {}
for line in open('coop_nwsli.txt'):
tokens = line.split("|")
if len(tokens) < 9:
contin... | <commit_before><commit_msg>Add tool for adding COOP IDs<commit_after> | # Need to check the log files for shef parser and create new sites
# within database based on what we find
import re, iemdb, os
MESOSITE = iemdb.connect('mesosite', bypass=False)
# Load up our database
sites = {}
for line in open('coop_nwsli.txt'):
tokens = line.split("|")
if len(tokens) < 9:
contin... | Add tool for adding COOP IDs# Need to check the log files for shef parser and create new sites
# within database based on what we find
import re, iemdb, os
MESOSITE = iemdb.connect('mesosite', bypass=False)
# Load up our database
sites = {}
for line in open('coop_nwsli.txt'):
tokens = line.split("|")
if len... | <commit_before><commit_msg>Add tool for adding COOP IDs<commit_after># Need to check the log files for shef parser and create new sites
# within database based on what we find
import re, iemdb, os
MESOSITE = iemdb.connect('mesosite', bypass=False)
# Load up our database
sites = {}
for line in open('coop_nwsli.txt')... | |
fd9547f088b2ed15c289235c329be04590689855 | host-test/stateless-test.py | host-test/stateless-test.py | import json
import subprocess
import struct
import sys
import unittest
import uuid
exe = None
# The protocol datagram is described here:
# https://developer.chrome.com/extensions/nativeMessaging#native-messaging-host-protocol
#
# The protocol itself is described here:
# https://github.com/open-eid/chrome-token-signin... | Add foundation for native component testing | Add foundation for native component testing
| Python | lgpl-2.1 | metsma/chrome-token-signing,cristiano-andrade/chrome-token-signing,fabiorusso/chrome-token-signing,open-eid/chrome-token-signing,open-eid/chrome-token-signing,fabiorusso/chrome-token-signing,open-eid/chrome-token-signing,open-eid/chrome-token-signing,metsma/chrome-token-signing,fabiorusso/chrome-token-signing,metsma/ch... | Add foundation for native component testing | import json
import subprocess
import struct
import sys
import unittest
import uuid
exe = None
# The protocol datagram is described here:
# https://developer.chrome.com/extensions/nativeMessaging#native-messaging-host-protocol
#
# The protocol itself is described here:
# https://github.com/open-eid/chrome-token-signin... | <commit_before><commit_msg>Add foundation for native component testing<commit_after> | import json
import subprocess
import struct
import sys
import unittest
import uuid
exe = None
# The protocol datagram is described here:
# https://developer.chrome.com/extensions/nativeMessaging#native-messaging-host-protocol
#
# The protocol itself is described here:
# https://github.com/open-eid/chrome-token-signin... | Add foundation for native component testingimport json
import subprocess
import struct
import sys
import unittest
import uuid
exe = None
# The protocol datagram is described here:
# https://developer.chrome.com/extensions/nativeMessaging#native-messaging-host-protocol
#
# The protocol itself is described here:
# http... | <commit_before><commit_msg>Add foundation for native component testing<commit_after>import json
import subprocess
import struct
import sys
import unittest
import uuid
exe = None
# The protocol datagram is described here:
# https://developer.chrome.com/extensions/nativeMessaging#native-messaging-host-protocol
#
# The ... | |
333ae389c14593421d01bd0c8f6904d1688dfa7e | ixxy_admin_utils/dashboard_modules.py | ixxy_admin_utils/dashboard_modules.py | from admin_tools.dashboard.modules import LinkList
from django.core.urlresolvers import reverse
from linkcheck.views import get_status_message
class PermCheckingLinkList(LinkList):
def __init__(self, title=None, **kwargs):
self.required_perms = kwargs.pop('required_perms', [])
super(PermCheckingL... | Add our custom dashboard modules | Add our custom dashboard modules
| Python | mit | DjangoAdminHackers/ixxy-admin-utils,DjangoAdminHackers/ixxy-admin-utils | Add our custom dashboard modules | from admin_tools.dashboard.modules import LinkList
from django.core.urlresolvers import reverse
from linkcheck.views import get_status_message
class PermCheckingLinkList(LinkList):
def __init__(self, title=None, **kwargs):
self.required_perms = kwargs.pop('required_perms', [])
super(PermCheckingL... | <commit_before><commit_msg>Add our custom dashboard modules<commit_after> | from admin_tools.dashboard.modules import LinkList
from django.core.urlresolvers import reverse
from linkcheck.views import get_status_message
class PermCheckingLinkList(LinkList):
def __init__(self, title=None, **kwargs):
self.required_perms = kwargs.pop('required_perms', [])
super(PermCheckingL... | Add our custom dashboard modulesfrom admin_tools.dashboard.modules import LinkList
from django.core.urlresolvers import reverse
from linkcheck.views import get_status_message
class PermCheckingLinkList(LinkList):
def __init__(self, title=None, **kwargs):
self.required_perms = kwargs.pop('required_perms',... | <commit_before><commit_msg>Add our custom dashboard modules<commit_after>from admin_tools.dashboard.modules import LinkList
from django.core.urlresolvers import reverse
from linkcheck.views import get_status_message
class PermCheckingLinkList(LinkList):
def __init__(self, title=None, **kwargs):
self.requ... | |
62ec4eca706bbb521d02ec597c0c18a949b37e52 | sysctl/tests/test_sysctl_setvalue.py | sysctl/tests/test_sysctl_setvalue.py | import os
import sysctl
from sysctl.tests import SysctlTestBase
class TestSysctlANum(SysctlTestBase):
def test_sysctl_setvalue(self):
dummy = sysctl.filter('kern.dummy')[0]
try:
self.command("/sbin/sysctl kern.dummy=0")
except:
if os.getuid() == 0:
... | Add test to set a sysctl value | Add test to set a sysctl value
| Python | bsd-2-clause | williambr/py-sysctl,williambr/py-sysctl | Add test to set a sysctl value | import os
import sysctl
from sysctl.tests import SysctlTestBase
class TestSysctlANum(SysctlTestBase):
def test_sysctl_setvalue(self):
dummy = sysctl.filter('kern.dummy')[0]
try:
self.command("/sbin/sysctl kern.dummy=0")
except:
if os.getuid() == 0:
... | <commit_before><commit_msg>Add test to set a sysctl value<commit_after> | import os
import sysctl
from sysctl.tests import SysctlTestBase
class TestSysctlANum(SysctlTestBase):
def test_sysctl_setvalue(self):
dummy = sysctl.filter('kern.dummy')[0]
try:
self.command("/sbin/sysctl kern.dummy=0")
except:
if os.getuid() == 0:
... | Add test to set a sysctl valueimport os
import sysctl
from sysctl.tests import SysctlTestBase
class TestSysctlANum(SysctlTestBase):
def test_sysctl_setvalue(self):
dummy = sysctl.filter('kern.dummy')[0]
try:
self.command("/sbin/sysctl kern.dummy=0")
except:
if os.g... | <commit_before><commit_msg>Add test to set a sysctl value<commit_after>import os
import sysctl
from sysctl.tests import SysctlTestBase
class TestSysctlANum(SysctlTestBase):
def test_sysctl_setvalue(self):
dummy = sysctl.filter('kern.dummy')[0]
try:
self.command("/sbin/sysctl kern.dumm... | |
490d5110b46afe5210bf2da4489854561e1bb259 | bsd2/vagrant-ansible/provisioning/getrstudio.py | bsd2/vagrant-ansible/provisioning/getrstudio.py | #!/usr/bin/python
#
# RStudio does not provide a "-latest" download link so we deduce it from
# their S3 bucket listing and save the download to /tmp/rstudio-latest.deb.
#
# Test this script by running:
# wget -O /tmp/somefile.xml http://download1.rstudio.org
# python thisscript.py /tmp/somefile.xml
import sys
import ... | Add a utility to retrieve the latest version of RStudio. | Add a utility to retrieve the latest version of RStudio.
| Python | apache-2.0 | dlab-berkeley/collaboratool-archive,dlab-berkeley/collaboratool-archive,dlab-berkeley/collaboratool-archive,dlab-berkeley/collaboratool-archive,dlab-berkeley/collaboratool-archive | Add a utility to retrieve the latest version of RStudio. | #!/usr/bin/python
#
# RStudio does not provide a "-latest" download link so we deduce it from
# their S3 bucket listing and save the download to /tmp/rstudio-latest.deb.
#
# Test this script by running:
# wget -O /tmp/somefile.xml http://download1.rstudio.org
# python thisscript.py /tmp/somefile.xml
import sys
import ... | <commit_before><commit_msg>Add a utility to retrieve the latest version of RStudio.<commit_after> | #!/usr/bin/python
#
# RStudio does not provide a "-latest" download link so we deduce it from
# their S3 bucket listing and save the download to /tmp/rstudio-latest.deb.
#
# Test this script by running:
# wget -O /tmp/somefile.xml http://download1.rstudio.org
# python thisscript.py /tmp/somefile.xml
import sys
import ... | Add a utility to retrieve the latest version of RStudio.#!/usr/bin/python
#
# RStudio does not provide a "-latest" download link so we deduce it from
# their S3 bucket listing and save the download to /tmp/rstudio-latest.deb.
#
# Test this script by running:
# wget -O /tmp/somefile.xml http://download1.rstudio.org
# py... | <commit_before><commit_msg>Add a utility to retrieve the latest version of RStudio.<commit_after>#!/usr/bin/python
#
# RStudio does not provide a "-latest" download link so we deduce it from
# their S3 bucket listing and save the download to /tmp/rstudio-latest.deb.
#
# Test this script by running:
# wget -O /tmp/somef... | |
30e33acc50725ea5f8bb4a094e60dbeadaa6d1f8 | CodeFights/cyclicName.py | CodeFights/cyclicName.py | #!/usr/local/bin/python
# Code Fights Cyclic Name Problem
from itertools import cycle
def cyclicName(name, n):
gen = cycle(name)
res = [next(gen) for _ in range(n)]
return ''.join(res)
def main():
tests = [
["nicecoder", 15, "nicecoderniceco"],
["codefights", 50, "codefightscodefigh... | Solve Code Fights cyclic name problem | Solve Code Fights cyclic name problem
| Python | mit | HKuz/Test_Code | Solve Code Fights cyclic name problem | #!/usr/local/bin/python
# Code Fights Cyclic Name Problem
from itertools import cycle
def cyclicName(name, n):
gen = cycle(name)
res = [next(gen) for _ in range(n)]
return ''.join(res)
def main():
tests = [
["nicecoder", 15, "nicecoderniceco"],
["codefights", 50, "codefightscodefigh... | <commit_before><commit_msg>Solve Code Fights cyclic name problem<commit_after> | #!/usr/local/bin/python
# Code Fights Cyclic Name Problem
from itertools import cycle
def cyclicName(name, n):
gen = cycle(name)
res = [next(gen) for _ in range(n)]
return ''.join(res)
def main():
tests = [
["nicecoder", 15, "nicecoderniceco"],
["codefights", 50, "codefightscodefigh... | Solve Code Fights cyclic name problem#!/usr/local/bin/python
# Code Fights Cyclic Name Problem
from itertools import cycle
def cyclicName(name, n):
gen = cycle(name)
res = [next(gen) for _ in range(n)]
return ''.join(res)
def main():
tests = [
["nicecoder", 15, "nicecoderniceco"],
[... | <commit_before><commit_msg>Solve Code Fights cyclic name problem<commit_after>#!/usr/local/bin/python
# Code Fights Cyclic Name Problem
from itertools import cycle
def cyclicName(name, n):
gen = cycle(name)
res = [next(gen) for _ in range(n)]
return ''.join(res)
def main():
tests = [
["nice... | |
92c8b146783c807b143a60419efd88f2da11d065 | gaphor/C4Model/tests/test_propertypages.py | gaphor/C4Model/tests/test_propertypages.py | from gaphor import C4Model
from gaphor.C4Model.propertypages import DescriptionPropertyPage, TechnologyPropertyPage
from gaphor.diagram.tests.fixtures import find
def test_description_property_page(element_factory):
subject = element_factory.create(C4Model.c4model.C4Container)
property_page = DescriptionPrope... | Add tests for C4 model property pages | Add tests for C4 model property pages
| Python | lgpl-2.1 | amolenaar/gaphor,amolenaar/gaphor | Add tests for C4 model property pages | from gaphor import C4Model
from gaphor.C4Model.propertypages import DescriptionPropertyPage, TechnologyPropertyPage
from gaphor.diagram.tests.fixtures import find
def test_description_property_page(element_factory):
subject = element_factory.create(C4Model.c4model.C4Container)
property_page = DescriptionPrope... | <commit_before><commit_msg>Add tests for C4 model property pages<commit_after> | from gaphor import C4Model
from gaphor.C4Model.propertypages import DescriptionPropertyPage, TechnologyPropertyPage
from gaphor.diagram.tests.fixtures import find
def test_description_property_page(element_factory):
subject = element_factory.create(C4Model.c4model.C4Container)
property_page = DescriptionPrope... | Add tests for C4 model property pagesfrom gaphor import C4Model
from gaphor.C4Model.propertypages import DescriptionPropertyPage, TechnologyPropertyPage
from gaphor.diagram.tests.fixtures import find
def test_description_property_page(element_factory):
subject = element_factory.create(C4Model.c4model.C4Container)... | <commit_before><commit_msg>Add tests for C4 model property pages<commit_after>from gaphor import C4Model
from gaphor.C4Model.propertypages import DescriptionPropertyPage, TechnologyPropertyPage
from gaphor.diagram.tests.fixtures import find
def test_description_property_page(element_factory):
subject = element_fa... | |
1c4429759a3e89ed952b1a025b1470a9e187537f | tests/test_spatial_reference.py | tests/test_spatial_reference.py | # -*- coding: utf-8 -*-
import rasterio
import pytest
from math import pi
from numpy import array
from numpy.testing import assert_array_almost_equal
from gdal2mbtiles.constants import EPSG_WEB_MERCATOR
from gdal2mbtiles.gdal import SpatialReference
# SEMI_MAJOR is a constant referring to the WGS84 Semi Major Ax... | Add test for the EPSG-3857 spatial reference. | Add test for the EPSG-3857 spatial reference.
| Python | apache-2.0 | ecometrica/gdal2mbtiles | Add test for the EPSG-3857 spatial reference. | # -*- coding: utf-8 -*-
import rasterio
import pytest
from math import pi
from numpy import array
from numpy.testing import assert_array_almost_equal
from gdal2mbtiles.constants import EPSG_WEB_MERCATOR
from gdal2mbtiles.gdal import SpatialReference
# SEMI_MAJOR is a constant referring to the WGS84 Semi Major Ax... | <commit_before><commit_msg>Add test for the EPSG-3857 spatial reference.<commit_after> | # -*- coding: utf-8 -*-
import rasterio
import pytest
from math import pi
from numpy import array
from numpy.testing import assert_array_almost_equal
from gdal2mbtiles.constants import EPSG_WEB_MERCATOR
from gdal2mbtiles.gdal import SpatialReference
# SEMI_MAJOR is a constant referring to the WGS84 Semi Major Ax... | Add test for the EPSG-3857 spatial reference.# -*- coding: utf-8 -*-
import rasterio
import pytest
from math import pi
from numpy import array
from numpy.testing import assert_array_almost_equal
from gdal2mbtiles.constants import EPSG_WEB_MERCATOR
from gdal2mbtiles.gdal import SpatialReference
# SEMI_MAJOR is a ... | <commit_before><commit_msg>Add test for the EPSG-3857 spatial reference.<commit_after># -*- coding: utf-8 -*-
import rasterio
import pytest
from math import pi
from numpy import array
from numpy.testing import assert_array_almost_equal
from gdal2mbtiles.constants import EPSG_WEB_MERCATOR
from gdal2mbtiles.gdal imp... | |
0d92340f2b1cab932f14e376dc776a7c11e3e42f | tests/batch_fetch/test_generic_relationship.py | tests/batch_fetch/test_generic_relationship.py | from __future__ import unicode_literals
import sqlalchemy as sa
from tests import TestCase
from sqlalchemy_utils import batch_fetch, generic_relationship
class TestBatchFetchGenericRelationship(TestCase):
def create_models(self):
class Building(self.Base):
__tablename__ = 'building'
... | Add tests for generic relationship batch fetching | Add tests for generic relationship batch fetching
| Python | bsd-3-clause | konstantinoskostis/sqlalchemy-utils,tonyseek/sqlalchemy-utils,joshfriend/sqlalchemy-utils,cheungpat/sqlalchemy-utils,tonyseek/sqlalchemy-utils,joshfriend/sqlalchemy-utils,spoqa/sqlalchemy-utils,rmoorman/sqlalchemy-utils,marrybird/sqlalchemy-utils,JackWink/sqlalchemy-utils | Add tests for generic relationship batch fetching | from __future__ import unicode_literals
import sqlalchemy as sa
from tests import TestCase
from sqlalchemy_utils import batch_fetch, generic_relationship
class TestBatchFetchGenericRelationship(TestCase):
def create_models(self):
class Building(self.Base):
__tablename__ = 'building'
... | <commit_before><commit_msg>Add tests for generic relationship batch fetching<commit_after> | from __future__ import unicode_literals
import sqlalchemy as sa
from tests import TestCase
from sqlalchemy_utils import batch_fetch, generic_relationship
class TestBatchFetchGenericRelationship(TestCase):
def create_models(self):
class Building(self.Base):
__tablename__ = 'building'
... | Add tests for generic relationship batch fetchingfrom __future__ import unicode_literals
import sqlalchemy as sa
from tests import TestCase
from sqlalchemy_utils import batch_fetch, generic_relationship
class TestBatchFetchGenericRelationship(TestCase):
def create_models(self):
class Building(self.Base):
... | <commit_before><commit_msg>Add tests for generic relationship batch fetching<commit_after>from __future__ import unicode_literals
import sqlalchemy as sa
from tests import TestCase
from sqlalchemy_utils import batch_fetch, generic_relationship
class TestBatchFetchGenericRelationship(TestCase):
def create_models(s... | |
fb3766204cbb25ccf8ee73ab4f480ba34251542c | nagios/check_hads_ingest.py | nagios/check_hads_ingest.py | """
Check how much HADSA data we have
"""
import os
import sys
import stat
import iemdb
HADS = iemdb.connect('iem', bypass=True)
hcursor = HADS.cursor()
def check():
hcursor.execute("""SELECT count(*) from current_shef
WHERE valid > now() - '1 hour'::interval""")
row = hcursor.fetchone()
return row[... | Add check on HADS ingest | Add check on HADS ingest | Python | mit | akrherz/iem,akrherz/iem,akrherz/iem,akrherz/iem,akrherz/iem | Add check on HADS ingest | """
Check how much HADSA data we have
"""
import os
import sys
import stat
import iemdb
HADS = iemdb.connect('iem', bypass=True)
hcursor = HADS.cursor()
def check():
hcursor.execute("""SELECT count(*) from current_shef
WHERE valid > now() - '1 hour'::interval""")
row = hcursor.fetchone()
return row[... | <commit_before><commit_msg>Add check on HADS ingest<commit_after> | """
Check how much HADSA data we have
"""
import os
import sys
import stat
import iemdb
HADS = iemdb.connect('iem', bypass=True)
hcursor = HADS.cursor()
def check():
hcursor.execute("""SELECT count(*) from current_shef
WHERE valid > now() - '1 hour'::interval""")
row = hcursor.fetchone()
return row[... | Add check on HADS ingest"""
Check how much HADSA data we have
"""
import os
import sys
import stat
import iemdb
HADS = iemdb.connect('iem', bypass=True)
hcursor = HADS.cursor()
def check():
hcursor.execute("""SELECT count(*) from current_shef
WHERE valid > now() - '1 hour'::interval""")
row = hcursor.fet... | <commit_before><commit_msg>Add check on HADS ingest<commit_after>"""
Check how much HADSA data we have
"""
import os
import sys
import stat
import iemdb
HADS = iemdb.connect('iem', bypass=True)
hcursor = HADS.cursor()
def check():
hcursor.execute("""SELECT count(*) from current_shef
WHERE valid > now() - '1 ... | |
a7529057f590f8b5185a77b3ff62889b1357a0e7 | data/word_embeddings/create_graph_from_corpus.py | data/word_embeddings/create_graph_from_corpus.py | from __future__ import print_function
import sys
from random import shuffle
DISTANCE = 10
with open(sys.argv[1], 'r') as corpus:
text = corpus.read()
text = text[:1000000]
words_list = list(set(text.split()))
word_to_id = {}
# Write word id mappings
for index, word in enumerate(list(set(word... | Add w2v create graph from corpus | Add w2v create graph from corpus
| Python | apache-2.0 | agnusmaximus/cyclades,agnusmaximus/cyclades,agnusmaximus/cyclades,agnusmaximus/cyclades | Add w2v create graph from corpus | from __future__ import print_function
import sys
from random import shuffle
DISTANCE = 10
with open(sys.argv[1], 'r') as corpus:
text = corpus.read()
text = text[:1000000]
words_list = list(set(text.split()))
word_to_id = {}
# Write word id mappings
for index, word in enumerate(list(set(word... | <commit_before><commit_msg>Add w2v create graph from corpus<commit_after> | from __future__ import print_function
import sys
from random import shuffle
DISTANCE = 10
with open(sys.argv[1], 'r') as corpus:
text = corpus.read()
text = text[:1000000]
words_list = list(set(text.split()))
word_to_id = {}
# Write word id mappings
for index, word in enumerate(list(set(word... | Add w2v create graph from corpusfrom __future__ import print_function
import sys
from random import shuffle
DISTANCE = 10
with open(sys.argv[1], 'r') as corpus:
text = corpus.read()
text = text[:1000000]
words_list = list(set(text.split()))
word_to_id = {}
# Write word id mappings
for index,... | <commit_before><commit_msg>Add w2v create graph from corpus<commit_after>from __future__ import print_function
import sys
from random import shuffle
DISTANCE = 10
with open(sys.argv[1], 'r') as corpus:
text = corpus.read()
text = text[:1000000]
words_list = list(set(text.split()))
word_to_id = {}
... | |
bcb73da9d30d6737fdbdb4ba2378a612851ec9b9 | lc0336_palindrome_pairs.py | lc0336_palindrome_pairs.py | """336. Palindrome Pairs
Hard
URL: https://leetcode.com/problems/palindrome-pairs/
Given a list of unique words, find all pairs of distinct indices (i, j) in the given
list, so that the concatenation of the two words, i.e. words[i] + words[j] is a
palindrome.
Example 1:
Input: ["abcd","dcba","lls","s","sssll"]
Outpu... | Complete word idx dict + prefix/suffix pal sol | Complete word idx dict + prefix/suffix pal sol
| Python | bsd-2-clause | bowen0701/algorithms_data_structures | Complete word idx dict + prefix/suffix pal sol | """336. Palindrome Pairs
Hard
URL: https://leetcode.com/problems/palindrome-pairs/
Given a list of unique words, find all pairs of distinct indices (i, j) in the given
list, so that the concatenation of the two words, i.e. words[i] + words[j] is a
palindrome.
Example 1:
Input: ["abcd","dcba","lls","s","sssll"]
Outpu... | <commit_before><commit_msg>Complete word idx dict + prefix/suffix pal sol<commit_after> | """336. Palindrome Pairs
Hard
URL: https://leetcode.com/problems/palindrome-pairs/
Given a list of unique words, find all pairs of distinct indices (i, j) in the given
list, so that the concatenation of the two words, i.e. words[i] + words[j] is a
palindrome.
Example 1:
Input: ["abcd","dcba","lls","s","sssll"]
Outpu... | Complete word idx dict + prefix/suffix pal sol"""336. Palindrome Pairs
Hard
URL: https://leetcode.com/problems/palindrome-pairs/
Given a list of unique words, find all pairs of distinct indices (i, j) in the given
list, so that the concatenation of the two words, i.e. words[i] + words[j] is a
palindrome.
Example 1:
... | <commit_before><commit_msg>Complete word idx dict + prefix/suffix pal sol<commit_after>"""336. Palindrome Pairs
Hard
URL: https://leetcode.com/problems/palindrome-pairs/
Given a list of unique words, find all pairs of distinct indices (i, j) in the given
list, so that the concatenation of the two words, i.e. words[i]... | |
74dab4e4e7c87e247659bff6cfd4e333b7cd71f7 | chapter03/triangleArea.py | chapter03/triangleArea.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import math
print 'Insert one points, separated with commas: '
xy = input('Insert first point: ')
x2y2 = input('Insert second point: ')
def substractVectors(a, b):
return (a[0] - b[0], a[1] - b[1])
def normalize(x, y):
return math.sqrt(x**2 + y**2)
print normalize(... | Add normalize and Vector substraction functions | Add normalize and Vector substraction functions
| Python | apache-2.0 | MindCookin/python-exercises | Add normalize and Vector substraction functions | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import math
print 'Insert one points, separated with commas: '
xy = input('Insert first point: ')
x2y2 = input('Insert second point: ')
def substractVectors(a, b):
return (a[0] - b[0], a[1] - b[1])
def normalize(x, y):
return math.sqrt(x**2 + y**2)
print normalize(... | <commit_before><commit_msg>Add normalize and Vector substraction functions<commit_after> | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import math
print 'Insert one points, separated with commas: '
xy = input('Insert first point: ')
x2y2 = input('Insert second point: ')
def substractVectors(a, b):
return (a[0] - b[0], a[1] - b[1])
def normalize(x, y):
return math.sqrt(x**2 + y**2)
print normalize(... | Add normalize and Vector substraction functions#!/usr/bin/env python
# -*- coding: utf-8 -*-
import math
print 'Insert one points, separated with commas: '
xy = input('Insert first point: ')
x2y2 = input('Insert second point: ')
def substractVectors(a, b):
return (a[0] - b[0], a[1] - b[1])
def normalize(x, y):
... | <commit_before><commit_msg>Add normalize and Vector substraction functions<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import math
print 'Insert one points, separated with commas: '
xy = input('Insert first point: ')
x2y2 = input('Insert second point: ')
def substractVectors(a, b):
return (a[0] - b[... | |
e21d3a1da1d20a341ae165c0fa3605248744ce7e | altair/examples/cumulative_count_chart.py | altair/examples/cumulative_count_chart.py | """
Cumulative Count Chart
----------------------
This example shows an area chart with cumulative count.
Adapted from https://vega.github.io/vega-lite/examples/area_cumulative_freq.html
"""
# category: area charts
import altair as alt
from vega_datasets import data
source = data.movies.url
alt.Chart(source).transf... | Add example - Cumulative count | Add example - Cumulative count
| Python | bsd-3-clause | altair-viz/altair,jakevdp/altair | Add example - Cumulative count | """
Cumulative Count Chart
----------------------
This example shows an area chart with cumulative count.
Adapted from https://vega.github.io/vega-lite/examples/area_cumulative_freq.html
"""
# category: area charts
import altair as alt
from vega_datasets import data
source = data.movies.url
alt.Chart(source).transf... | <commit_before><commit_msg>Add example - Cumulative count<commit_after> | """
Cumulative Count Chart
----------------------
This example shows an area chart with cumulative count.
Adapted from https://vega.github.io/vega-lite/examples/area_cumulative_freq.html
"""
# category: area charts
import altair as alt
from vega_datasets import data
source = data.movies.url
alt.Chart(source).transf... | Add example - Cumulative count"""
Cumulative Count Chart
----------------------
This example shows an area chart with cumulative count.
Adapted from https://vega.github.io/vega-lite/examples/area_cumulative_freq.html
"""
# category: area charts
import altair as alt
from vega_datasets import data
source = data.movies... | <commit_before><commit_msg>Add example - Cumulative count<commit_after>"""
Cumulative Count Chart
----------------------
This example shows an area chart with cumulative count.
Adapted from https://vega.github.io/vega-lite/examples/area_cumulative_freq.html
"""
# category: area charts
import altair as alt
from vega_d... | |
1a1a8c00e3dc4101be78a69b3bae7d27fbb51b39 | ghpythonremote/examples/CPython_to_GH_manual.py | ghpythonremote/examples/CPython_to_GH_manual.py | import rpyc
c = rpyc.utils.factory.connect(
"localhost",
18871,
service=rpyc.core.service.ClassicService,
config={"sync_request_timeout": None},
ipv6=False,
keepalive=True,
)
rghcomp = c.root.get_component
rgh = c
Rhino = rgh.modules.Rhino
rs = rgh.modules.rhinoscriptsyntax
readopt = Rhino.Fi... | Add a debugging file connecting Python to GH | Add a debugging file connecting Python to GH
| Python | mit | pilcru/ghpythonremote,Digital-Structures/ghpythonremote | Add a debugging file connecting Python to GH | import rpyc
c = rpyc.utils.factory.connect(
"localhost",
18871,
service=rpyc.core.service.ClassicService,
config={"sync_request_timeout": None},
ipv6=False,
keepalive=True,
)
rghcomp = c.root.get_component
rgh = c
Rhino = rgh.modules.Rhino
rs = rgh.modules.rhinoscriptsyntax
readopt = Rhino.Fi... | <commit_before><commit_msg>Add a debugging file connecting Python to GH<commit_after> | import rpyc
c = rpyc.utils.factory.connect(
"localhost",
18871,
service=rpyc.core.service.ClassicService,
config={"sync_request_timeout": None},
ipv6=False,
keepalive=True,
)
rghcomp = c.root.get_component
rgh = c
Rhino = rgh.modules.Rhino
rs = rgh.modules.rhinoscriptsyntax
readopt = Rhino.Fi... | Add a debugging file connecting Python to GHimport rpyc
c = rpyc.utils.factory.connect(
"localhost",
18871,
service=rpyc.core.service.ClassicService,
config={"sync_request_timeout": None},
ipv6=False,
keepalive=True,
)
rghcomp = c.root.get_component
rgh = c
Rhino = rgh.modules.Rhino
rs = rgh.m... | <commit_before><commit_msg>Add a debugging file connecting Python to GH<commit_after>import rpyc
c = rpyc.utils.factory.connect(
"localhost",
18871,
service=rpyc.core.service.ClassicService,
config={"sync_request_timeout": None},
ipv6=False,
keepalive=True,
)
rghcomp = c.root.get_component
rgh... | |
d9db8056450528f10b9bfaa9f6226486108ac37d | creation/lib/cgWConsts.py | creation/lib/cgWConsts.py | ####################################
#
# Keep all the constants used to
# create glidein entries in this
# module
#
# Author: Igor Sfiligoi
#
####################################
import time
start_time_tuple=time.localtime()
TIMESTR=(string.printable[start_time_tuple[0]-2000]+ #year, will work until ~2060
st... | Put constants into a dedicated module | Put constants into a dedicated module
| Python | bsd-3-clause | bbockelm/glideinWMS,holzman/glideinwms-old,holzman/glideinwms-old,bbockelm/glideinWMS,bbockelm/glideinWMS,bbockelm/glideinWMS,holzman/glideinwms-old | Put constants into a dedicated module | ####################################
#
# Keep all the constants used to
# create glidein entries in this
# module
#
# Author: Igor Sfiligoi
#
####################################
import time
start_time_tuple=time.localtime()
TIMESTR=(string.printable[start_time_tuple[0]-2000]+ #year, will work until ~2060
st... | <commit_before><commit_msg>Put constants into a dedicated module<commit_after> | ####################################
#
# Keep all the constants used to
# create glidein entries in this
# module
#
# Author: Igor Sfiligoi
#
####################################
import time
start_time_tuple=time.localtime()
TIMESTR=(string.printable[start_time_tuple[0]-2000]+ #year, will work until ~2060
st... | Put constants into a dedicated module####################################
#
# Keep all the constants used to
# create glidein entries in this
# module
#
# Author: Igor Sfiligoi
#
####################################
import time
start_time_tuple=time.localtime()
TIMESTR=(string.printable[start_time_tuple[0]-2000]+ #ye... | <commit_before><commit_msg>Put constants into a dedicated module<commit_after>####################################
#
# Keep all the constants used to
# create glidein entries in this
# module
#
# Author: Igor Sfiligoi
#
####################################
import time
start_time_tuple=time.localtime()
TIMESTR=(string... | |
3756fa9cef258e91ebd8d344f6773cfc2ac537dd | benchmarks/bench_misc.py | benchmarks/bench_misc.py | """
Miscellaneous benchmarks.
"""
import subprocess
import sys
import time
from numba import jit
class InitializationTime:
# Measure wall clock time, not CPU time of calling process
timer = time.time
number = 1
repeat = 10
def time_new_process_import_numba(self):
subprocess.check_call([... | Add a benchmark of import time | Add a benchmark of import time
| Python | bsd-2-clause | numba/numba-benchmark,gmarkall/numba-benchmark | Add a benchmark of import time | """
Miscellaneous benchmarks.
"""
import subprocess
import sys
import time
from numba import jit
class InitializationTime:
# Measure wall clock time, not CPU time of calling process
timer = time.time
number = 1
repeat = 10
def time_new_process_import_numba(self):
subprocess.check_call([... | <commit_before><commit_msg>Add a benchmark of import time<commit_after> | """
Miscellaneous benchmarks.
"""
import subprocess
import sys
import time
from numba import jit
class InitializationTime:
# Measure wall clock time, not CPU time of calling process
timer = time.time
number = 1
repeat = 10
def time_new_process_import_numba(self):
subprocess.check_call([... | Add a benchmark of import time"""
Miscellaneous benchmarks.
"""
import subprocess
import sys
import time
from numba import jit
class InitializationTime:
# Measure wall clock time, not CPU time of calling process
timer = time.time
number = 1
repeat = 10
def time_new_process_import_numba(self):
... | <commit_before><commit_msg>Add a benchmark of import time<commit_after>"""
Miscellaneous benchmarks.
"""
import subprocess
import sys
import time
from numba import jit
class InitializationTime:
# Measure wall clock time, not CPU time of calling process
timer = time.time
number = 1
repeat = 10
d... | |
39039b8a6584984d6778b271a4b9c8a181198cd3 | corehq/apps/hqcase/tests/test_bulk.py | corehq/apps/hqcase/tests/test_bulk.py | import uuid
from unittest import mock
from django.test import TestCase
from casexml.apps.case.mock import CaseBlock
from corehq.apps.hqcase.bulk import CaseBulkDB
from corehq.form_processor.interfaces.dbaccessors import CaseAccessors
from corehq.form_processor.models import XFormInstance
from corehq.form_processor.t... | Add basic test for CaseBulkDB | Add basic test for CaseBulkDB
| Python | bsd-3-clause | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | Add basic test for CaseBulkDB | import uuid
from unittest import mock
from django.test import TestCase
from casexml.apps.case.mock import CaseBlock
from corehq.apps.hqcase.bulk import CaseBulkDB
from corehq.form_processor.interfaces.dbaccessors import CaseAccessors
from corehq.form_processor.models import XFormInstance
from corehq.form_processor.t... | <commit_before><commit_msg>Add basic test for CaseBulkDB<commit_after> | import uuid
from unittest import mock
from django.test import TestCase
from casexml.apps.case.mock import CaseBlock
from corehq.apps.hqcase.bulk import CaseBulkDB
from corehq.form_processor.interfaces.dbaccessors import CaseAccessors
from corehq.form_processor.models import XFormInstance
from corehq.form_processor.t... | Add basic test for CaseBulkDBimport uuid
from unittest import mock
from django.test import TestCase
from casexml.apps.case.mock import CaseBlock
from corehq.apps.hqcase.bulk import CaseBulkDB
from corehq.form_processor.interfaces.dbaccessors import CaseAccessors
from corehq.form_processor.models import XFormInstance... | <commit_before><commit_msg>Add basic test for CaseBulkDB<commit_after>import uuid
from unittest import mock
from django.test import TestCase
from casexml.apps.case.mock import CaseBlock
from corehq.apps.hqcase.bulk import CaseBulkDB
from corehq.form_processor.interfaces.dbaccessors import CaseAccessors
from corehq.f... | |
e3845e03ea1f3dd393cd077f7c2b3d2ce31b86a9 | mysite/scripts/remove_numbers_from_locations.py | mysite/scripts/remove_numbers_from_locations.py | import re
import mysite
Person = mysite.profile.models.Person
people_with_weird_locations = Person.objects.filter(location_display_name__regex=', [0-9][0-9],')
for p in people_with_weird_locations:
location_pieces = re.split(r', \d\d', p.location_display_name)
unweirded_location = "".join(location_pieces)
... | Add script to remove unnecessary numbers from people's locations. | Add script to remove unnecessary numbers from people's locations.
| Python | agpl-3.0 | SnappleCap/oh-mainline,ehashman/oh-mainline,mzdaniel/oh-mainline,jledbetter/openhatch,sudheesh001/oh-mainline,openhatch/oh-mainline,jledbetter/openhatch,SnappleCap/oh-mainline,openhatch/oh-mainline,ehashman/oh-mainline,waseem18/oh-mainline,vipul-sharma20/oh-mainline,jledbetter/openhatch,ojengwa/oh-mainline,waseem18/oh-... | Add script to remove unnecessary numbers from people's locations. | import re
import mysite
Person = mysite.profile.models.Person
people_with_weird_locations = Person.objects.filter(location_display_name__regex=', [0-9][0-9],')
for p in people_with_weird_locations:
location_pieces = re.split(r', \d\d', p.location_display_name)
unweirded_location = "".join(location_pieces)
... | <commit_before><commit_msg>Add script to remove unnecessary numbers from people's locations.<commit_after> | import re
import mysite
Person = mysite.profile.models.Person
people_with_weird_locations = Person.objects.filter(location_display_name__regex=', [0-9][0-9],')
for p in people_with_weird_locations:
location_pieces = re.split(r', \d\d', p.location_display_name)
unweirded_location = "".join(location_pieces)
... | Add script to remove unnecessary numbers from people's locations.import re
import mysite
Person = mysite.profile.models.Person
people_with_weird_locations = Person.objects.filter(location_display_name__regex=', [0-9][0-9],')
for p in people_with_weird_locations:
location_pieces = re.split(r', \d\d', p.location_di... | <commit_before><commit_msg>Add script to remove unnecessary numbers from people's locations.<commit_after>import re
import mysite
Person = mysite.profile.models.Person
people_with_weird_locations = Person.objects.filter(location_display_name__regex=', [0-9][0-9],')
for p in people_with_weird_locations:
location_p... | |
642b777f5eabc02abd54208e3895c0b1898401db | edit-cosine-cluster.py | edit-cosine-cluster.py | #!/usr/bin/env python2.7
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "... | Convert csv to json for clusters | Convert csv to json for clusters
Convert csv to json for cluster-d3.html(or dynamic-cluster.html) | Python | apache-2.0 | YongchaoShang/tika-img-similarity,chrismattmann/tika-similarity,harsham05/tika-similarity,chrismattmann/tika-similarity,chrismattmann/tika-img-similarity,YongchaoShang/tika-img-similarity,harsham05/tika-similarity,chrismattmann/tika-img-similarity | Convert csv to json for clusters
Convert csv to json for cluster-d3.html(or dynamic-cluster.html) | #!/usr/bin/env python2.7
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "... | <commit_before><commit_msg>Convert csv to json for clusters
Convert csv to json for cluster-d3.html(or dynamic-cluster.html)<commit_after> | #!/usr/bin/env python2.7
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "... | Convert csv to json for clusters
Convert csv to json for cluster-d3.html(or dynamic-cluster.html)#!/usr/bin/env python2.7
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyr... | <commit_before><commit_msg>Convert csv to json for clusters
Convert csv to json for cluster-d3.html(or dynamic-cluster.html)<commit_after>#!/usr/bin/env python2.7
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work f... | |
6fb6829c6ac0f755b468393042f538c5073c76ff | tools/rename_by_timestamp/rename_by_timestamp.py | tools/rename_by_timestamp/rename_by_timestamp.py | import os, os.path
import shutil
from datetime import datetime
import sys
def do_folder(src_folder):
assert os.path.isdir(src_folder)
dst_folder = os.path.join(src_folder, 'timestamp_prefixed')
print 'Input dir: %s'%src_folder
print 'Output dir: %s'%dst_folder
if not os.path.exists(dst_folder):
... | Add script to create copies of PNG files w/ filenames prefixed with their creation time (Windows only) | Add script to create copies of PNG files w/ filenames prefixed with their creation time (Windows only)
| Python | mit | joymachinegames/joymachine-public,joymachinegames/joymachine-public,joymachinegames/joymachine-public,joymachinegames/joymachine-public,joymachinegames/joymachine-public,joymachinegames/joymachine-public | Add script to create copies of PNG files w/ filenames prefixed with their creation time (Windows only) | import os, os.path
import shutil
from datetime import datetime
import sys
def do_folder(src_folder):
assert os.path.isdir(src_folder)
dst_folder = os.path.join(src_folder, 'timestamp_prefixed')
print 'Input dir: %s'%src_folder
print 'Output dir: %s'%dst_folder
if not os.path.exists(dst_folder):
... | <commit_before><commit_msg>Add script to create copies of PNG files w/ filenames prefixed with their creation time (Windows only)<commit_after> | import os, os.path
import shutil
from datetime import datetime
import sys
def do_folder(src_folder):
assert os.path.isdir(src_folder)
dst_folder = os.path.join(src_folder, 'timestamp_prefixed')
print 'Input dir: %s'%src_folder
print 'Output dir: %s'%dst_folder
if not os.path.exists(dst_folder):
... | Add script to create copies of PNG files w/ filenames prefixed with their creation time (Windows only)import os, os.path
import shutil
from datetime import datetime
import sys
def do_folder(src_folder):
assert os.path.isdir(src_folder)
dst_folder = os.path.join(src_folder, 'timestamp_prefixed')
print 'Inpu... | <commit_before><commit_msg>Add script to create copies of PNG files w/ filenames prefixed with their creation time (Windows only)<commit_after>import os, os.path
import shutil
from datetime import datetime
import sys
def do_folder(src_folder):
assert os.path.isdir(src_folder)
dst_folder = os.path.join(src_fold... | |
1b971b32d57df48919e0c45372237d858996e3d9 | tests/test_gmeu/test_a_C.py | tests/test_gmeu/test_a_C.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Test GMEU entry 'a', part C.
This entry is about pronunciation of the word 'a' and is unlikely to be
relevant to usage in written language.
"""
| Add test for GMEU entry "a", part C | Add test for GMEU entry "a", part C
| Python | bsd-3-clause | amperser/proselint,amperser/proselint,amperser/proselint,amperser/proselint,amperser/proselint | Add test for GMEU entry "a", part C | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Test GMEU entry 'a', part C.
This entry is about pronunciation of the word 'a' and is unlikely to be
relevant to usage in written language.
"""
| <commit_before><commit_msg>Add test for GMEU entry "a", part C<commit_after> | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Test GMEU entry 'a', part C.
This entry is about pronunciation of the word 'a' and is unlikely to be
relevant to usage in written language.
"""
| Add test for GMEU entry "a", part C#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Test GMEU entry 'a', part C.
This entry is about pronunciation of the word 'a' and is unlikely to be
relevant to usage in written language.
"""
| <commit_before><commit_msg>Add test for GMEU entry "a", part C<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Test GMEU entry 'a', part C.
This entry is about pronunciation of the word 'a' and is unlikely to be
relevant to usage in written language.
"""
| |
cea54800ae2ac13b830984aa368125faf02ba429 | examples/cli_object.py | examples/cli_object.py | import hug
@hug.cli_object(name='git', version='1.0.0')
class GIT(object):
"""An example of command like calls via an Object"""
@hug.cli_object()
def push(self, branch='master'):
return 'Pushing {}'.format(branch)
@hug.cli_object()
def pull(self, branch='master'):
return 'Pulling... | Add example for CLI object | Add example for CLI object
| Python | mit | MuhammadAlkarouri/hug,timothycrosley/hug,MuhammadAlkarouri/hug,timothycrosley/hug,MuhammadAlkarouri/hug,timothycrosley/hug | Add example for CLI object | import hug
@hug.cli_object(name='git', version='1.0.0')
class GIT(object):
"""An example of command like calls via an Object"""
@hug.cli_object()
def push(self, branch='master'):
return 'Pushing {}'.format(branch)
@hug.cli_object()
def pull(self, branch='master'):
return 'Pulling... | <commit_before><commit_msg>Add example for CLI object<commit_after> | import hug
@hug.cli_object(name='git', version='1.0.0')
class GIT(object):
"""An example of command like calls via an Object"""
@hug.cli_object()
def push(self, branch='master'):
return 'Pushing {}'.format(branch)
@hug.cli_object()
def pull(self, branch='master'):
return 'Pulling... | Add example for CLI objectimport hug
@hug.cli_object(name='git', version='1.0.0')
class GIT(object):
"""An example of command like calls via an Object"""
@hug.cli_object()
def push(self, branch='master'):
return 'Pushing {}'.format(branch)
@hug.cli_object()
def pull(self, branch='master'... | <commit_before><commit_msg>Add example for CLI object<commit_after>import hug
@hug.cli_object(name='git', version='1.0.0')
class GIT(object):
"""An example of command like calls via an Object"""
@hug.cli_object()
def push(self, branch='master'):
return 'Pushing {}'.format(branch)
@hug.cli_ob... | |
fd48746e8d1d2d94a7453a4a976ffbf362711f63 | tools/setbyte.py | tools/setbyte.py | #!/usr/bin/env python3
import sys
import ast
try:
file_name, location, new_byte = sys.argv[1:]
except:
print("Usage: ./{} file location newbyte".format(sys.argv[0]))
sys.exit(1)
addr = int(ast.literal_eval(location))
byte = int(ast.literal_eval(new_byte))
assert 0 <= addr
assert 0 <= byte < 2**8
with op... | Add new tool to set bytes in file | Add new tool to set bytes in file
| Python | mit | Dentosal/rust_os,Dentosal/rust_os,Dentosal/rust_os | Add new tool to set bytes in file | #!/usr/bin/env python3
import sys
import ast
try:
file_name, location, new_byte = sys.argv[1:]
except:
print("Usage: ./{} file location newbyte".format(sys.argv[0]))
sys.exit(1)
addr = int(ast.literal_eval(location))
byte = int(ast.literal_eval(new_byte))
assert 0 <= addr
assert 0 <= byte < 2**8
with op... | <commit_before><commit_msg>Add new tool to set bytes in file<commit_after> | #!/usr/bin/env python3
import sys
import ast
try:
file_name, location, new_byte = sys.argv[1:]
except:
print("Usage: ./{} file location newbyte".format(sys.argv[0]))
sys.exit(1)
addr = int(ast.literal_eval(location))
byte = int(ast.literal_eval(new_byte))
assert 0 <= addr
assert 0 <= byte < 2**8
with op... | Add new tool to set bytes in file#!/usr/bin/env python3
import sys
import ast
try:
file_name, location, new_byte = sys.argv[1:]
except:
print("Usage: ./{} file location newbyte".format(sys.argv[0]))
sys.exit(1)
addr = int(ast.literal_eval(location))
byte = int(ast.literal_eval(new_byte))
assert 0 <= addr... | <commit_before><commit_msg>Add new tool to set bytes in file<commit_after>#!/usr/bin/env python3
import sys
import ast
try:
file_name, location, new_byte = sys.argv[1:]
except:
print("Usage: ./{} file location newbyte".format(sys.argv[0]))
sys.exit(1)
addr = int(ast.literal_eval(location))
byte = int(ast.... | |
47c4043dfecd95686b1520c93717fa4c512c4e74 | tlsenum/hello_constructs.py | tlsenum/hello_constructs.py | from construct import Array, Bytes, Struct, UBInt16, UBInt32, UBInt8
ProtocolVersion = Struct(
"version",
UBInt8("major"),
UBInt8("minor")
)
Random = Struct(
"random",
UBInt32("gmt_unix_time"),
Bytes("random_bytes", 28)
)
SessionID = Struct(
"session_id",
UBInt8("length"),
Bytes(... | Add tentative construct format for ClientHello messages. | Add tentative construct format for ClientHello messages.
| Python | mit | Ayrx/tlsenum,Ayrx/tlsenum | Add tentative construct format for ClientHello messages. | from construct import Array, Bytes, Struct, UBInt16, UBInt32, UBInt8
ProtocolVersion = Struct(
"version",
UBInt8("major"),
UBInt8("minor")
)
Random = Struct(
"random",
UBInt32("gmt_unix_time"),
Bytes("random_bytes", 28)
)
SessionID = Struct(
"session_id",
UBInt8("length"),
Bytes(... | <commit_before><commit_msg>Add tentative construct format for ClientHello messages.<commit_after> | from construct import Array, Bytes, Struct, UBInt16, UBInt32, UBInt8
ProtocolVersion = Struct(
"version",
UBInt8("major"),
UBInt8("minor")
)
Random = Struct(
"random",
UBInt32("gmt_unix_time"),
Bytes("random_bytes", 28)
)
SessionID = Struct(
"session_id",
UBInt8("length"),
Bytes(... | Add tentative construct format for ClientHello messages.from construct import Array, Bytes, Struct, UBInt16, UBInt32, UBInt8
ProtocolVersion = Struct(
"version",
UBInt8("major"),
UBInt8("minor")
)
Random = Struct(
"random",
UBInt32("gmt_unix_time"),
Bytes("random_bytes", 28)
)
SessionID = St... | <commit_before><commit_msg>Add tentative construct format for ClientHello messages.<commit_after>from construct import Array, Bytes, Struct, UBInt16, UBInt32, UBInt8
ProtocolVersion = Struct(
"version",
UBInt8("major"),
UBInt8("minor")
)
Random = Struct(
"random",
UBInt32("gmt_unix_time"),
By... | |
5a12137c3e766451d83e6598ba93d16e0a8cbde8 | tests/basics/subclass-native3.py | tests/basics/subclass-native3.py | class MyExc(Exception):
pass
e = MyExc(100, "Some error")
print(e)
# TODO: Prints native base class name
#print(repr(e))
print(e.args)
| Add test for accessing attribute of inherited native type. | tests: Add test for accessing attribute of inherited native type.
| Python | mit | noahchense/micropython,matthewelse/micropython,micropython/micropython-esp32,Vogtinator/micropython,danicampora/micropython,adafruit/micropython,warner83/micropython,emfcamp/micropython,MrSurly/micropython-esp32,noahwilliamsson/micropython,mpalomer/micropython,kostyll/micropython,EcmaXp/micropython,drrk/micropython,MrS... | tests: Add test for accessing attribute of inherited native type. | class MyExc(Exception):
pass
e = MyExc(100, "Some error")
print(e)
# TODO: Prints native base class name
#print(repr(e))
print(e.args)
| <commit_before><commit_msg>tests: Add test for accessing attribute of inherited native type.<commit_after> | class MyExc(Exception):
pass
e = MyExc(100, "Some error")
print(e)
# TODO: Prints native base class name
#print(repr(e))
print(e.args)
| tests: Add test for accessing attribute of inherited native type.class MyExc(Exception):
pass
e = MyExc(100, "Some error")
print(e)
# TODO: Prints native base class name
#print(repr(e))
print(e.args)
| <commit_before><commit_msg>tests: Add test for accessing attribute of inherited native type.<commit_after>class MyExc(Exception):
pass
e = MyExc(100, "Some error")
print(e)
# TODO: Prints native base class name
#print(repr(e))
print(e.args)
| |
c963310123765baddf638c8d08b8fdb2f73b6ba6 | tests/basics/subclass-native4.py | tests/basics/subclass-native4.py | # Test calling non-special method inherited from native type
class mylist(list):
pass
l = mylist([1, 2, 3])
print(l)
l.append(10)
print(l)
| Add test for calling inherited native method on subclass. | tests: Add test for calling inherited native method on subclass.
| Python | mit | drrk/micropython,ryannathans/micropython,MrSurly/micropython-esp32,warner83/micropython,redbear/micropython,noahchense/micropython,AriZuu/micropython,martinribelotta/micropython,toolmacher/micropython,martinribelotta/micropython,jlillest/micropython,oopy/micropython,feilongfl/micropython,mhoffma/micropython,vitiral/mic... | tests: Add test for calling inherited native method on subclass. | # Test calling non-special method inherited from native type
class mylist(list):
pass
l = mylist([1, 2, 3])
print(l)
l.append(10)
print(l)
| <commit_before><commit_msg>tests: Add test for calling inherited native method on subclass.<commit_after> | # Test calling non-special method inherited from native type
class mylist(list):
pass
l = mylist([1, 2, 3])
print(l)
l.append(10)
print(l)
| tests: Add test for calling inherited native method on subclass.# Test calling non-special method inherited from native type
class mylist(list):
pass
l = mylist([1, 2, 3])
print(l)
l.append(10)
print(l)
| <commit_before><commit_msg>tests: Add test for calling inherited native method on subclass.<commit_after># Test calling non-special method inherited from native type
class mylist(list):
pass
l = mylist([1, 2, 3])
print(l)
l.append(10)
print(l)
| |
15a655e490b0f0d035edd4f772f126146959e531 | examples/plot_dom_hits.py | examples/plot_dom_hits.py | """
==================
DOM hits.
==================
This example shows how to create DOM hits statistics to estimate track
distances.
"""
from collections import defaultdict, Counter
import km3pipe as kp
import pandas as pd
import matplotlib.pyplot as plt
from matplotlib.colors import LogNorm
from km3modules impor... | Add example to show how to create dom hit statistics | Add example to show how to create dom hit statistics
| Python | mit | tamasgal/km3pipe,tamasgal/km3pipe | Add example to show how to create dom hit statistics | """
==================
DOM hits.
==================
This example shows how to create DOM hits statistics to estimate track
distances.
"""
from collections import defaultdict, Counter
import km3pipe as kp
import pandas as pd
import matplotlib.pyplot as plt
from matplotlib.colors import LogNorm
from km3modules impor... | <commit_before><commit_msg>Add example to show how to create dom hit statistics<commit_after> | """
==================
DOM hits.
==================
This example shows how to create DOM hits statistics to estimate track
distances.
"""
from collections import defaultdict, Counter
import km3pipe as kp
import pandas as pd
import matplotlib.pyplot as plt
from matplotlib.colors import LogNorm
from km3modules impor... | Add example to show how to create dom hit statistics"""
==================
DOM hits.
==================
This example shows how to create DOM hits statistics to estimate track
distances.
"""
from collections import defaultdict, Counter
import km3pipe as kp
import pandas as pd
import matplotlib.pyplot as plt
from mat... | <commit_before><commit_msg>Add example to show how to create dom hit statistics<commit_after>"""
==================
DOM hits.
==================
This example shows how to create DOM hits statistics to estimate track
distances.
"""
from collections import defaultdict, Counter
import km3pipe as kp
import pandas as pd
... | |
b3cbf179371c289121126d0cb66d9873d740f202 | utils/helpers.py | utils/helpers.py | from django.http import HttpResponseNotAllowed
def post_only(func):
def decorated(request, *args, **kwargs):
if request.method != 'POST':
return HttpResponseNotAllowed(['GET'])
return func(request, *args, **kwargs)
return decorated
def get_only(func):
def decorated(request, *ar... | Add post_only and get_only decorators | Add post_only and get_only decorators
| Python | apache-2.0 | Nikola-K/django_reddit,Nikola-K/django_reddit,Nikola-K/django_reddit | Add post_only and get_only decorators | from django.http import HttpResponseNotAllowed
def post_only(func):
def decorated(request, *args, **kwargs):
if request.method != 'POST':
return HttpResponseNotAllowed(['GET'])
return func(request, *args, **kwargs)
return decorated
def get_only(func):
def decorated(request, *ar... | <commit_before><commit_msg>Add post_only and get_only decorators<commit_after> | from django.http import HttpResponseNotAllowed
def post_only(func):
def decorated(request, *args, **kwargs):
if request.method != 'POST':
return HttpResponseNotAllowed(['GET'])
return func(request, *args, **kwargs)
return decorated
def get_only(func):
def decorated(request, *ar... | Add post_only and get_only decoratorsfrom django.http import HttpResponseNotAllowed
def post_only(func):
def decorated(request, *args, **kwargs):
if request.method != 'POST':
return HttpResponseNotAllowed(['GET'])
return func(request, *args, **kwargs)
return decorated
def get_only(... | <commit_before><commit_msg>Add post_only and get_only decorators<commit_after>from django.http import HttpResponseNotAllowed
def post_only(func):
def decorated(request, *args, **kwargs):
if request.method != 'POST':
return HttpResponseNotAllowed(['GET'])
return func(request, *args, **kw... | |
c5723be490b5baf953de71a6af778fe5663c70ed | scripts/slave/recipe_modules/raw_io/test_api.py | scripts/slave/recipe_modules/raw_io/test_api.py | from slave import recipe_test_api
class RawIOTestApi(recipe_test_api.RecipeTestApi): # pragma: no cover
@recipe_test_api.placeholder_step_data
@staticmethod
def output(data, retcode=None):
return data, retcode
| Add the API available inside GenTests method for the raw_io module. | Add the API available inside GenTests method for the raw_io module.
This CL makes the raw_io module ready to have its output mocked
in GenTests.
[email protected]
Review URL: https://codereview.chromium.org/160143003
git-svn-id: 239fca9b83025a0b6f823aeeca02ba5be3d9fd76@250773 0039d316-1c4b-4281-b951-d872f2087c9... | Python | bsd-3-clause | eunchong/build,eunchong/build,eunchong/build,eunchong/build | Add the API available inside GenTests method for the raw_io module.
This CL makes the raw_io module ready to have its output mocked
in GenTests.
[email protected]
Review URL: https://codereview.chromium.org/160143003
git-svn-id: 239fca9b83025a0b6f823aeeca02ba5be3d9fd76@250773 0039d316-1c4b-4281-b951-d872f2087c9... | from slave import recipe_test_api
class RawIOTestApi(recipe_test_api.RecipeTestApi): # pragma: no cover
@recipe_test_api.placeholder_step_data
@staticmethod
def output(data, retcode=None):
return data, retcode
| <commit_before><commit_msg>Add the API available inside GenTests method for the raw_io module.
This CL makes the raw_io module ready to have its output mocked
in GenTests.
[email protected]
Review URL: https://codereview.chromium.org/160143003
git-svn-id: 239fca9b83025a0b6f823aeeca02ba5be3d9fd76@250773 0039d316... | from slave import recipe_test_api
class RawIOTestApi(recipe_test_api.RecipeTestApi): # pragma: no cover
@recipe_test_api.placeholder_step_data
@staticmethod
def output(data, retcode=None):
return data, retcode
| Add the API available inside GenTests method for the raw_io module.
This CL makes the raw_io module ready to have its output mocked
in GenTests.
[email protected]
Review URL: https://codereview.chromium.org/160143003
git-svn-id: 239fca9b83025a0b6f823aeeca02ba5be3d9fd76@250773 0039d316-1c4b-4281-b951-d872f2087c9... | <commit_before><commit_msg>Add the API available inside GenTests method for the raw_io module.
This CL makes the raw_io module ready to have its output mocked
in GenTests.
[email protected]
Review URL: https://codereview.chromium.org/160143003
git-svn-id: 239fca9b83025a0b6f823aeeca02ba5be3d9fd76@250773 0039d316... | |
f93a801a7951f2ee1a59b536608e13928aa60102 | yithlibraryserver/scripts/tests/test_createdb.py | yithlibraryserver/scripts/tests/test_createdb.py | # Yith Library Server is a password storage server.
# Copyright (C) 2015 Lorenzo Gil Sanchez <[email protected]>
#
# This file is part of Yith Library Server.
#
# Yith Library Server is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as publ... | Add simple test for the createdb script | Add simple test for the createdb script
| Python | agpl-3.0 | lorenzogil/yith-library-server,lorenzogil/yith-library-server,lorenzogil/yith-library-server | Add simple test for the createdb script | # Yith Library Server is a password storage server.
# Copyright (C) 2015 Lorenzo Gil Sanchez <[email protected]>
#
# This file is part of Yith Library Server.
#
# Yith Library Server is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as publ... | <commit_before><commit_msg>Add simple test for the createdb script<commit_after> | # Yith Library Server is a password storage server.
# Copyright (C) 2015 Lorenzo Gil Sanchez <[email protected]>
#
# This file is part of Yith Library Server.
#
# Yith Library Server is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as publ... | Add simple test for the createdb script# Yith Library Server is a password storage server.
# Copyright (C) 2015 Lorenzo Gil Sanchez <[email protected]>
#
# This file is part of Yith Library Server.
#
# Yith Library Server is free software: you can redistribute it and/or modify
# it under the terms of the GN... | <commit_before><commit_msg>Add simple test for the createdb script<commit_after># Yith Library Server is a password storage server.
# Copyright (C) 2015 Lorenzo Gil Sanchez <[email protected]>
#
# This file is part of Yith Library Server.
#
# Yith Library Server is free software: you can redistribute it and... | |
836f23046a25edbdeafcbe487fa9f918a9bae5cb | Sketches/JT/Jam/application/trunk/setup_py2exe.py | Sketches/JT/Jam/application/trunk/setup_py2exe.py | #!/usr/bin/env python
#
# (C) 2008 British Broadcasting Corporation and Kamaelia Contributors(1)
# All Rights Reserved.
#
# You may only modify and redistribute this under the terms of any of the
# following licenses(2): Mozilla Public License, V1.1, GNU General
# Public License, V2.0, GNU Lesser General Pub... | Add py2exe setup file for creating windows executables | Add py2exe setup file for creating windows executables
| Python | apache-2.0 | sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia | Add py2exe setup file for creating windows executables | #!/usr/bin/env python
#
# (C) 2008 British Broadcasting Corporation and Kamaelia Contributors(1)
# All Rights Reserved.
#
# You may only modify and redistribute this under the terms of any of the
# following licenses(2): Mozilla Public License, V1.1, GNU General
# Public License, V2.0, GNU Lesser General Pub... | <commit_before><commit_msg>Add py2exe setup file for creating windows executables<commit_after> | #!/usr/bin/env python
#
# (C) 2008 British Broadcasting Corporation and Kamaelia Contributors(1)
# All Rights Reserved.
#
# You may only modify and redistribute this under the terms of any of the
# following licenses(2): Mozilla Public License, V1.1, GNU General
# Public License, V2.0, GNU Lesser General Pub... | Add py2exe setup file for creating windows executables#!/usr/bin/env python
#
# (C) 2008 British Broadcasting Corporation and Kamaelia Contributors(1)
# All Rights Reserved.
#
# You may only modify and redistribute this under the terms of any of the
# following licenses(2): Mozilla Public License, V1.1, GNU G... | <commit_before><commit_msg>Add py2exe setup file for creating windows executables<commit_after>#!/usr/bin/env python
#
# (C) 2008 British Broadcasting Corporation and Kamaelia Contributors(1)
# All Rights Reserved.
#
# You may only modify and redistribute this under the terms of any of the
# following license... | |
fecbaf30cadcf02b44f920116edea3c5de94ba4e | crackingcointsolutions/chapter4/exercisethree.py | crackingcointsolutions/chapter4/exercisethree.py | '''
Created on 30 Aug 2017
@author: igoroya
'''
import collections
from chapter4 import utils
def make_lists(root_node):
stack = collections.deque()
node_i = 1
lists = []
node = root_node
stack.append(node)
while len(stack) > 0:
node = stack.pop()
add_list(lists, node_i, nod... | Add solution for exercise 4.3 | Add solution for exercise 4.3 | Python | mit | igoroya/igor-oya-solutions-cracking-coding-interview | Add solution for exercise 4.3 | '''
Created on 30 Aug 2017
@author: igoroya
'''
import collections
from chapter4 import utils
def make_lists(root_node):
stack = collections.deque()
node_i = 1
lists = []
node = root_node
stack.append(node)
while len(stack) > 0:
node = stack.pop()
add_list(lists, node_i, nod... | <commit_before><commit_msg>Add solution for exercise 4.3<commit_after> | '''
Created on 30 Aug 2017
@author: igoroya
'''
import collections
from chapter4 import utils
def make_lists(root_node):
stack = collections.deque()
node_i = 1
lists = []
node = root_node
stack.append(node)
while len(stack) > 0:
node = stack.pop()
add_list(lists, node_i, nod... | Add solution for exercise 4.3'''
Created on 30 Aug 2017
@author: igoroya
'''
import collections
from chapter4 import utils
def make_lists(root_node):
stack = collections.deque()
node_i = 1
lists = []
node = root_node
stack.append(node)
while len(stack) > 0:
node = stack.pop()
... | <commit_before><commit_msg>Add solution for exercise 4.3<commit_after>'''
Created on 30 Aug 2017
@author: igoroya
'''
import collections
from chapter4 import utils
def make_lists(root_node):
stack = collections.deque()
node_i = 1
lists = []
node = root_node
stack.append(node)
while len(stac... | |
fad392fd67aa858f92659ab94ca1c190898d4951 | add_csp_header.py | add_csp_header.py | # Burp extension to add CSP headers to responses
__author__ = 'jay.kelath'
# setup Imports
from burp import IBurpExtender
from burp import IHttpListener
from burp import IHttpRequestResponse
from burp import IResponseInfo
# Class BurpExtender (Required) contaning all functions used to interact with Burp Suite API
cla... | Add a header to burp response | Add a header to burp response | Python | mit | kelath/Burp-Extensions | Add a header to burp response | # Burp extension to add CSP headers to responses
__author__ = 'jay.kelath'
# setup Imports
from burp import IBurpExtender
from burp import IHttpListener
from burp import IHttpRequestResponse
from burp import IResponseInfo
# Class BurpExtender (Required) contaning all functions used to interact with Burp Suite API
cla... | <commit_before><commit_msg>Add a header to burp response<commit_after> | # Burp extension to add CSP headers to responses
__author__ = 'jay.kelath'
# setup Imports
from burp import IBurpExtender
from burp import IHttpListener
from burp import IHttpRequestResponse
from burp import IResponseInfo
# Class BurpExtender (Required) contaning all functions used to interact with Burp Suite API
cla... | Add a header to burp response# Burp extension to add CSP headers to responses
__author__ = 'jay.kelath'
# setup Imports
from burp import IBurpExtender
from burp import IHttpListener
from burp import IHttpRequestResponse
from burp import IResponseInfo
# Class BurpExtender (Required) contaning all functions used to int... | <commit_before><commit_msg>Add a header to burp response<commit_after># Burp extension to add CSP headers to responses
__author__ = 'jay.kelath'
# setup Imports
from burp import IBurpExtender
from burp import IHttpListener
from burp import IHttpRequestResponse
from burp import IResponseInfo
# Class BurpExtender (Requ... | |
e142d7ec83d9b5896a741a84ff5148f300254d89 | test/util/test_cubic_interpolation.py | test/util/test_cubic_interpolation.py | import torch
from gpytorch.utils.interpolation import Interpolation
from gpytorch import utils
def test_interpolation():
x = torch.linspace(0.01, 1, 100)
grid = torch.linspace(-0.05, 1.05, 50)
J, C = Interpolation().interpolate(grid, x)
W = utils.index_coef_to_sparse(J, C, len(grid))
test_func_gri... | Add basic unit test for cubic interpolation | Add basic unit test for cubic interpolation
| Python | mit | jrg365/gpytorch,jrg365/gpytorch,jrg365/gpytorch | Add basic unit test for cubic interpolation | import torch
from gpytorch.utils.interpolation import Interpolation
from gpytorch import utils
def test_interpolation():
x = torch.linspace(0.01, 1, 100)
grid = torch.linspace(-0.05, 1.05, 50)
J, C = Interpolation().interpolate(grid, x)
W = utils.index_coef_to_sparse(J, C, len(grid))
test_func_gri... | <commit_before><commit_msg>Add basic unit test for cubic interpolation<commit_after> | import torch
from gpytorch.utils.interpolation import Interpolation
from gpytorch import utils
def test_interpolation():
x = torch.linspace(0.01, 1, 100)
grid = torch.linspace(-0.05, 1.05, 50)
J, C = Interpolation().interpolate(grid, x)
W = utils.index_coef_to_sparse(J, C, len(grid))
test_func_gri... | Add basic unit test for cubic interpolationimport torch
from gpytorch.utils.interpolation import Interpolation
from gpytorch import utils
def test_interpolation():
x = torch.linspace(0.01, 1, 100)
grid = torch.linspace(-0.05, 1.05, 50)
J, C = Interpolation().interpolate(grid, x)
W = utils.index_coef_t... | <commit_before><commit_msg>Add basic unit test for cubic interpolation<commit_after>import torch
from gpytorch.utils.interpolation import Interpolation
from gpytorch import utils
def test_interpolation():
x = torch.linspace(0.01, 1, 100)
grid = torch.linspace(-0.05, 1.05, 50)
J, C = Interpolation().interp... | |
014096616d8263ea96b5b8a2b7926b498f02b425 | setupdefaults.py | setupdefaults.py | #! /usr/bin/python
# Encoding: utf-8
import json
import os
import re
import subprocess
import sys
class TypeMapping:
def __init__(self, py_types, type_string, value_transformer):
self.py_types = py_types
self.type_string = type_string
self.value_transformer = value_transformer
def map_type(value):
# Unsuppor... | Add script for writing defaults from a directory of patch dictionaries. | Add script for writing defaults from a directory of patch dictionaries.
| Python | mit | douglashill/OS-X-setup,douglashill/OS-X-setup | Add script for writing defaults from a directory of patch dictionaries. | #! /usr/bin/python
# Encoding: utf-8
import json
import os
import re
import subprocess
import sys
class TypeMapping:
def __init__(self, py_types, type_string, value_transformer):
self.py_types = py_types
self.type_string = type_string
self.value_transformer = value_transformer
def map_type(value):
# Unsuppor... | <commit_before><commit_msg>Add script for writing defaults from a directory of patch dictionaries.<commit_after> | #! /usr/bin/python
# Encoding: utf-8
import json
import os
import re
import subprocess
import sys
class TypeMapping:
def __init__(self, py_types, type_string, value_transformer):
self.py_types = py_types
self.type_string = type_string
self.value_transformer = value_transformer
def map_type(value):
# Unsuppor... | Add script for writing defaults from a directory of patch dictionaries.#! /usr/bin/python
# Encoding: utf-8
import json
import os
import re
import subprocess
import sys
class TypeMapping:
def __init__(self, py_types, type_string, value_transformer):
self.py_types = py_types
self.type_string = type_string
self.... | <commit_before><commit_msg>Add script for writing defaults from a directory of patch dictionaries.<commit_after>#! /usr/bin/python
# Encoding: utf-8
import json
import os
import re
import subprocess
import sys
class TypeMapping:
def __init__(self, py_types, type_string, value_transformer):
self.py_types = py_types... | |
99ee6ecfa4bafbfd66a3cb2c2315a8daeeff3023 | Lib/extractor/formats/ufo.py | Lib/extractor/formats/ufo.py | import os
from robofab.ufoLib import UFOReader
# ----------------
# Public Functions
# ----------------
def isUFO(pathOrFile):
if not isinstance(pathOrFile, basestring):
return False
if os.path.splitext(pathOrFile)[-1].lower() != ".ufo":
return False
if not os.path.isdir(pathOrFile):
... | Add support for extracting a UFO from a UFO. It sounds silly, but it is useful. | Add support for extracting a UFO from a UFO. It sounds silly, but it is useful.
| Python | mit | typesupply/extractor,typemytype/extractor,anthrotype/extractor | Add support for extracting a UFO from a UFO. It sounds silly, but it is useful. | import os
from robofab.ufoLib import UFOReader
# ----------------
# Public Functions
# ----------------
def isUFO(pathOrFile):
if not isinstance(pathOrFile, basestring):
return False
if os.path.splitext(pathOrFile)[-1].lower() != ".ufo":
return False
if not os.path.isdir(pathOrFile):
... | <commit_before><commit_msg>Add support for extracting a UFO from a UFO. It sounds silly, but it is useful.<commit_after> | import os
from robofab.ufoLib import UFOReader
# ----------------
# Public Functions
# ----------------
def isUFO(pathOrFile):
if not isinstance(pathOrFile, basestring):
return False
if os.path.splitext(pathOrFile)[-1].lower() != ".ufo":
return False
if not os.path.isdir(pathOrFile):
... | Add support for extracting a UFO from a UFO. It sounds silly, but it is useful.import os
from robofab.ufoLib import UFOReader
# ----------------
# Public Functions
# ----------------
def isUFO(pathOrFile):
if not isinstance(pathOrFile, basestring):
return False
if os.path.splitext(pathOrFile)[-1].lowe... | <commit_before><commit_msg>Add support for extracting a UFO from a UFO. It sounds silly, but it is useful.<commit_after>import os
from robofab.ufoLib import UFOReader
# ----------------
# Public Functions
# ----------------
def isUFO(pathOrFile):
if not isinstance(pathOrFile, basestring):
return False
... | |
5a6759b131e4a61f9e7e4aaebb190a7e04b28b00 | create-colormaps.py | create-colormaps.py | """
Export colormaps from Python / matplotlib to JavaScript.
"""
# -----------------------------------------------------------------------------
# IMPORTS
# -----------------------------------------------------------------------------
import json
from matplotlib.colors import Colormap
import matplotlib.cm as cm
imp... | Update script to export colormaps | Update script to export colormaps
| Python | mit | derherrg/js-colormaps,derherrg/js-colormaps | Update script to export colormaps | """
Export colormaps from Python / matplotlib to JavaScript.
"""
# -----------------------------------------------------------------------------
# IMPORTS
# -----------------------------------------------------------------------------
import json
from matplotlib.colors import Colormap
import matplotlib.cm as cm
imp... | <commit_before><commit_msg>Update script to export colormaps<commit_after> | """
Export colormaps from Python / matplotlib to JavaScript.
"""
# -----------------------------------------------------------------------------
# IMPORTS
# -----------------------------------------------------------------------------
import json
from matplotlib.colors import Colormap
import matplotlib.cm as cm
imp... | Update script to export colormaps"""
Export colormaps from Python / matplotlib to JavaScript.
"""
# -----------------------------------------------------------------------------
# IMPORTS
# -----------------------------------------------------------------------------
import json
from matplotlib.colors import Colorma... | <commit_before><commit_msg>Update script to export colormaps<commit_after>"""
Export colormaps from Python / matplotlib to JavaScript.
"""
# -----------------------------------------------------------------------------
# IMPORTS
# -----------------------------------------------------------------------------
import js... | |
974651717968885fd766f17ce942e77a15011253 | go/apps/dialogue/tests/test_dialogue_api.py | go/apps/dialogue/tests/test_dialogue_api.py | """Tests for go.apps.dialogue.dialogue_api."""
from twisted.internet.defer import inlineCallbacks
from twisted.trial.unittest import TestCase
from go.apps.dialogue.dialogue_api import DialogueActionDispatcher
from go.vumitools.api import VumiApi
from go.vumitools.tests.utils import GoAppWorkerTestMixin
class Dialog... | Add tests for get_poll and save_poll. | Add tests for get_poll and save_poll.
| Python | bsd-3-clause | praekelt/vumi-go,praekelt/vumi-go,praekelt/vumi-go,praekelt/vumi-go | Add tests for get_poll and save_poll. | """Tests for go.apps.dialogue.dialogue_api."""
from twisted.internet.defer import inlineCallbacks
from twisted.trial.unittest import TestCase
from go.apps.dialogue.dialogue_api import DialogueActionDispatcher
from go.vumitools.api import VumiApi
from go.vumitools.tests.utils import GoAppWorkerTestMixin
class Dialog... | <commit_before><commit_msg>Add tests for get_poll and save_poll.<commit_after> | """Tests for go.apps.dialogue.dialogue_api."""
from twisted.internet.defer import inlineCallbacks
from twisted.trial.unittest import TestCase
from go.apps.dialogue.dialogue_api import DialogueActionDispatcher
from go.vumitools.api import VumiApi
from go.vumitools.tests.utils import GoAppWorkerTestMixin
class Dialog... | Add tests for get_poll and save_poll."""Tests for go.apps.dialogue.dialogue_api."""
from twisted.internet.defer import inlineCallbacks
from twisted.trial.unittest import TestCase
from go.apps.dialogue.dialogue_api import DialogueActionDispatcher
from go.vumitools.api import VumiApi
from go.vumitools.tests.utils impor... | <commit_before><commit_msg>Add tests for get_poll and save_poll.<commit_after>"""Tests for go.apps.dialogue.dialogue_api."""
from twisted.internet.defer import inlineCallbacks
from twisted.trial.unittest import TestCase
from go.apps.dialogue.dialogue_api import DialogueActionDispatcher
from go.vumitools.api import Vu... | |
e274c17ac8bc61d5e96fcab579b8ad07c3a48403 | queueing/resources.py | queueing/resources.py | """
queueing.resources
==================
Utilities and resources for queueing.
:author: Michael Browning
:copyright: (c) 2013 by Michael Browning.
:license: BSD, see LICENSE for more details.
"""
import threading
class StoppableThread(threading.Thread):
"""A thread that exposes a stop ... | Allow stopping of all queueing threads and respond to keyboard interrupt in main | Allow stopping of all queueing threads and respond to keyboard interrupt in main
| Python | bsd-3-clause | mrbrowning/queueing | Allow stopping of all queueing threads and respond to keyboard interrupt in main | """
queueing.resources
==================
Utilities and resources for queueing.
:author: Michael Browning
:copyright: (c) 2013 by Michael Browning.
:license: BSD, see LICENSE for more details.
"""
import threading
class StoppableThread(threading.Thread):
"""A thread that exposes a stop ... | <commit_before><commit_msg>Allow stopping of all queueing threads and respond to keyboard interrupt in main<commit_after> | """
queueing.resources
==================
Utilities and resources for queueing.
:author: Michael Browning
:copyright: (c) 2013 by Michael Browning.
:license: BSD, see LICENSE for more details.
"""
import threading
class StoppableThread(threading.Thread):
"""A thread that exposes a stop ... | Allow stopping of all queueing threads and respond to keyboard interrupt in main"""
queueing.resources
==================
Utilities and resources for queueing.
:author: Michael Browning
:copyright: (c) 2013 by Michael Browning.
:license: BSD, see LICENSE for more details.
"""
import threading... | <commit_before><commit_msg>Allow stopping of all queueing threads and respond to keyboard interrupt in main<commit_after>"""
queueing.resources
==================
Utilities and resources for queueing.
:author: Michael Browning
:copyright: (c) 2013 by Michael Browning.
:license: BSD, see LICENS... | |
475a573731de50695a12b8376d6f01ab155f5893 | api/sonetworks/migrations/0029_post_published.py | api/sonetworks/migrations/0029_post_published.py | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-05-10 23:46
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('sonetworks', '0028_auto_20170509_0231'),
]
operations = [
migrations.AddFie... | UPDATE Post model, published boolea field added | UPDATE Post model, published boolea field added
| Python | mit | semitki/semitki,semitki/semitki,semitki/semitki,semitki/semitki | UPDATE Post model, published boolea field added | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-05-10 23:46
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('sonetworks', '0028_auto_20170509_0231'),
]
operations = [
migrations.AddFie... | <commit_before><commit_msg>UPDATE Post model, published boolea field added<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-05-10 23:46
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('sonetworks', '0028_auto_20170509_0231'),
]
operations = [
migrations.AddFie... | UPDATE Post model, published boolea field added# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-05-10 23:46
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('sonetworks', '0028_auto_20170509_0231'),
... | <commit_before><commit_msg>UPDATE Post model, published boolea field added<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-05-10 23:46
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('sone... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.