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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
adb6ce275e1cbc2d000286e169a4a96b25b32dbb | test_doc.py | test_doc.py | #!/usr/bin/env python
import doctest
import sys
if hasattr(doctest, "testfile"):
print("=== Test file: README ===")
failure, tests = doctest.testfile('README', optionflags=doctest.ELLIPSIS)
if failure:
sys.exit(1)
print("=== Test file: test.rst ===")
failure, tests = doctest.testfile('test/... | #!/usr/bin/env python
import doctest
import sys
if hasattr(doctest, "testfile"):
total_failures, total_tests = (0, 0)
print("=== Test file: README ===")
failure, tests = doctest.testfile('README', optionflags=doctest.ELLIPSIS)
total_failures += failure
total_tests += tests
print("=== Test file... | Allow doctest runner to keep going after failures | Allow doctest runner to keep going after failures
It will still return an error code, but there is little need to halt the
running of the three different doctest modules if an early one fails,
which may in fact mask the real reason for failure in an IPy internal
method.
Signed-off-by: Dan McGee <a6e5737275ff1276377ee... | Python | bsd-3-clause | dstam/python-ipy,sigma-random/python-ipy | #!/usr/bin/env python
import doctest
import sys
if hasattr(doctest, "testfile"):
print("=== Test file: README ===")
failure, tests = doctest.testfile('README', optionflags=doctest.ELLIPSIS)
if failure:
sys.exit(1)
print("=== Test file: test.rst ===")
failure, tests = doctest.testfile('test/... | #!/usr/bin/env python
import doctest
import sys
if hasattr(doctest, "testfile"):
total_failures, total_tests = (0, 0)
print("=== Test file: README ===")
failure, tests = doctest.testfile('README', optionflags=doctest.ELLIPSIS)
total_failures += failure
total_tests += tests
print("=== Test file... | <commit_before>#!/usr/bin/env python
import doctest
import sys
if hasattr(doctest, "testfile"):
print("=== Test file: README ===")
failure, tests = doctest.testfile('README', optionflags=doctest.ELLIPSIS)
if failure:
sys.exit(1)
print("=== Test file: test.rst ===")
failure, tests = doctest.... | #!/usr/bin/env python
import doctest
import sys
if hasattr(doctest, "testfile"):
total_failures, total_tests = (0, 0)
print("=== Test file: README ===")
failure, tests = doctest.testfile('README', optionflags=doctest.ELLIPSIS)
total_failures += failure
total_tests += tests
print("=== Test file... | #!/usr/bin/env python
import doctest
import sys
if hasattr(doctest, "testfile"):
print("=== Test file: README ===")
failure, tests = doctest.testfile('README', optionflags=doctest.ELLIPSIS)
if failure:
sys.exit(1)
print("=== Test file: test.rst ===")
failure, tests = doctest.testfile('test/... | <commit_before>#!/usr/bin/env python
import doctest
import sys
if hasattr(doctest, "testfile"):
print("=== Test file: README ===")
failure, tests = doctest.testfile('README', optionflags=doctest.ELLIPSIS)
if failure:
sys.exit(1)
print("=== Test file: test.rst ===")
failure, tests = doctest.... |
4318c0275b1c90fc65aff5ce59eaf101b78fba31 | scripts/award_badge_to_user.py | scripts/award_badge_to_user.py | #!/usr/bin/env python
"""Award a badge to a user.
:Copyright: 2006-2018 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
import click
from byceps.services.user_badge import service as badge_service
from byceps.util.system import get_config_filename_from_env_or_exit
from bootstrap.validator... | Add script to award a badge to a user | Add script to award a badge to a user
| Python | bsd-3-clause | m-ober/byceps,homeworkprod/byceps,homeworkprod/byceps,homeworkprod/byceps,m-ober/byceps,m-ober/byceps | Add script to award a badge to a user | #!/usr/bin/env python
"""Award a badge to a user.
:Copyright: 2006-2018 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
import click
from byceps.services.user_badge import service as badge_service
from byceps.util.system import get_config_filename_from_env_or_exit
from bootstrap.validator... | <commit_before><commit_msg>Add script to award a badge to a user<commit_after> | #!/usr/bin/env python
"""Award a badge to a user.
:Copyright: 2006-2018 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
import click
from byceps.services.user_badge import service as badge_service
from byceps.util.system import get_config_filename_from_env_or_exit
from bootstrap.validator... | Add script to award a badge to a user#!/usr/bin/env python
"""Award a badge to a user.
:Copyright: 2006-2018 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
import click
from byceps.services.user_badge import service as badge_service
from byceps.util.system import get_config_filename_from_... | <commit_before><commit_msg>Add script to award a badge to a user<commit_after>#!/usr/bin/env python
"""Award a badge to a user.
:Copyright: 2006-2018 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
import click
from byceps.services.user_badge import service as badge_service
from byceps.uti... | |
7a98fd7f4f5a3d29aa9b8b182e19d7c8b16bcc4a | symposion/reviews/migrations/0002_migrate_messages_to_feedback.py | symposion/reviews/migrations/0002_migrate_messages_to_feedback.py | # Generated by Django 2.0.13 on 2019-05-13 22:09
from django.db import migrations
def migrate_messages_to_feedback(apps, schema_editor):
"""
Migrate symposion.reviews.models.ProposalMessage to
conf_site.reviews.models.ProposalFeedback.
"""
ProposalMessage = apps.get_model("symposion_reviews", "Pr... | Migrate old proposal messages to new feedback. | Migrate old proposal messages to new feedback.
Migrate `symposion.reviews.models.ProposalMessage` objects to
`conf_site.reviews.models.ProposalFeedback` objects.
| Python | mit | pydata/conf_site,pydata/conf_site,pydata/conf_site | Migrate old proposal messages to new feedback.
Migrate `symposion.reviews.models.ProposalMessage` objects to
`conf_site.reviews.models.ProposalFeedback` objects. | # Generated by Django 2.0.13 on 2019-05-13 22:09
from django.db import migrations
def migrate_messages_to_feedback(apps, schema_editor):
"""
Migrate symposion.reviews.models.ProposalMessage to
conf_site.reviews.models.ProposalFeedback.
"""
ProposalMessage = apps.get_model("symposion_reviews", "Pr... | <commit_before><commit_msg>Migrate old proposal messages to new feedback.
Migrate `symposion.reviews.models.ProposalMessage` objects to
`conf_site.reviews.models.ProposalFeedback` objects.<commit_after> | # Generated by Django 2.0.13 on 2019-05-13 22:09
from django.db import migrations
def migrate_messages_to_feedback(apps, schema_editor):
"""
Migrate symposion.reviews.models.ProposalMessage to
conf_site.reviews.models.ProposalFeedback.
"""
ProposalMessage = apps.get_model("symposion_reviews", "Pr... | Migrate old proposal messages to new feedback.
Migrate `symposion.reviews.models.ProposalMessage` objects to
`conf_site.reviews.models.ProposalFeedback` objects.# Generated by Django 2.0.13 on 2019-05-13 22:09
from django.db import migrations
def migrate_messages_to_feedback(apps, schema_editor):
"""
Migrat... | <commit_before><commit_msg>Migrate old proposal messages to new feedback.
Migrate `symposion.reviews.models.ProposalMessage` objects to
`conf_site.reviews.models.ProposalFeedback` objects.<commit_after># Generated by Django 2.0.13 on 2019-05-13 22:09
from django.db import migrations
def migrate_messages_to_feedback... | |
35f3aa0407b68210abe2e46648ae3a39ee21b17b | senlin/tests/tempest/api/receivers/test_receiver_show.py | senlin/tests/tempest/api/receivers/test_receiver_show.py | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | Add API test for receiver show | Add API test for receiver show
Add API test for receiver show
Change-Id: I6d01189cdba772c1c085549a4a9838d43ce39a73
| Python | apache-2.0 | openstack/senlin,openstack/senlin,stackforge/senlin,openstack/senlin,stackforge/senlin | Add API test for receiver show
Add API test for receiver show
Change-Id: I6d01189cdba772c1c085549a4a9838d43ce39a73 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | <commit_before><commit_msg>Add API test for receiver show
Add API test for receiver show
Change-Id: I6d01189cdba772c1c085549a4a9838d43ce39a73<commit_after> | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | Add API test for receiver show
Add API test for receiver show
Change-Id: I6d01189cdba772c1c085549a4a9838d43ce39a73# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.or... | <commit_before><commit_msg>Add API test for receiver show
Add API test for receiver show
Change-Id: I6d01189cdba772c1c085549a4a9838d43ce39a73<commit_after># 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... | |
7c5ec81cd0775aaa47b004d275eac6496dd53297 | __init__.py | __init__.py | import os
import sys
def get_path(version=2014):
'''Get the path to these shaders for stuffing into Maya envvars.'''
return os.path.abspath(os.path.join(
__file__,
'..',
'build',
'%s-%d' % (
'macosx' if sys.platform == 'darwin' else 'linux',
version
... | Add a hook for key_base to find this tool | Add a hook for key_base to find this tool
For the dev command, really. | Python | bsd-3-clause | westernx/ksmrshaders | Add a hook for key_base to find this tool
For the dev command, really. | import os
import sys
def get_path(version=2014):
'''Get the path to these shaders for stuffing into Maya envvars.'''
return os.path.abspath(os.path.join(
__file__,
'..',
'build',
'%s-%d' % (
'macosx' if sys.platform == 'darwin' else 'linux',
version
... | <commit_before><commit_msg>Add a hook for key_base to find this tool
For the dev command, really.<commit_after> | import os
import sys
def get_path(version=2014):
'''Get the path to these shaders for stuffing into Maya envvars.'''
return os.path.abspath(os.path.join(
__file__,
'..',
'build',
'%s-%d' % (
'macosx' if sys.platform == 'darwin' else 'linux',
version
... | Add a hook for key_base to find this tool
For the dev command, really.import os
import sys
def get_path(version=2014):
'''Get the path to these shaders for stuffing into Maya envvars.'''
return os.path.abspath(os.path.join(
__file__,
'..',
'build',
'%s-%d' % (
'ma... | <commit_before><commit_msg>Add a hook for key_base to find this tool
For the dev command, really.<commit_after>import os
import sys
def get_path(version=2014):
'''Get the path to these shaders for stuffing into Maya envvars.'''
return os.path.abspath(os.path.join(
__file__,
'..',
'bu... | |
dc7887dde6b2ca8136647051da3c8cbe8762ca65 | samples/migrations/0014_auto_20170529_0935.py | samples/migrations/0014_auto_20170529_0935.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-05-29 12:35
from __future__ import unicode_literals
from django.db import migrations
import samples.custom.models
class Migration(migrations.Migration):
dependencies = [
('samples', '0013_auto_20170526_1718'),
]
operations = [
m... | Add mitration file for changing ObservedSymptom field | :memo: Add mitration file for changing ObservedSymptom field
| Python | mit | gems-uff/labsys,gems-uff/labsys,gems-uff/labsys | :memo: Add mitration file for changing ObservedSymptom field | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-05-29 12:35
from __future__ import unicode_literals
from django.db import migrations
import samples.custom.models
class Migration(migrations.Migration):
dependencies = [
('samples', '0013_auto_20170526_1718'),
]
operations = [
m... | <commit_before><commit_msg>:memo: Add mitration file for changing ObservedSymptom field<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-05-29 12:35
from __future__ import unicode_literals
from django.db import migrations
import samples.custom.models
class Migration(migrations.Migration):
dependencies = [
('samples', '0013_auto_20170526_1718'),
]
operations = [
m... | :memo: Add mitration file for changing ObservedSymptom field# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-05-29 12:35
from __future__ import unicode_literals
from django.db import migrations
import samples.custom.models
class Migration(migrations.Migration):
dependencies = [
('samples', '00... | <commit_before><commit_msg>:memo: Add mitration file for changing ObservedSymptom field<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-05-29 12:35
from __future__ import unicode_literals
from django.db import migrations
import samples.custom.models
class Migration(migrations.Migration):
... | |
39ec6a5c1c42ababb44aa1863d5e441ec807f345 | sara_flexbe_states/src/sara_flexbe_states/Wonderland_Read_Entity_Position.py | sara_flexbe_states/src/sara_flexbe_states/Wonderland_Read_Entity_Position.py | #!/usr/bin/env python
# encoding=utf8
from flexbe_core import EventState, Logger
import json
class Wonderland_Read_Entity_Position(EventState):
'''
Read the 3D position of an entity in a json string
># json_text string command to read
#< x_pos int x position of the entity
#< y_pos int y po... | Add a state for read an entity position in Wonderland. | Add a state for read an entity position in Wonderland.
| Python | bsd-3-clause | WalkingMachine/sara_behaviors,WalkingMachine/sara_behaviors | Add a state for read an entity position in Wonderland. | #!/usr/bin/env python
# encoding=utf8
from flexbe_core import EventState, Logger
import json
class Wonderland_Read_Entity_Position(EventState):
'''
Read the 3D position of an entity in a json string
># json_text string command to read
#< x_pos int x position of the entity
#< y_pos int y po... | <commit_before><commit_msg>Add a state for read an entity position in Wonderland.<commit_after> | #!/usr/bin/env python
# encoding=utf8
from flexbe_core import EventState, Logger
import json
class Wonderland_Read_Entity_Position(EventState):
'''
Read the 3D position of an entity in a json string
># json_text string command to read
#< x_pos int x position of the entity
#< y_pos int y po... | Add a state for read an entity position in Wonderland.#!/usr/bin/env python
# encoding=utf8
from flexbe_core import EventState, Logger
import json
class Wonderland_Read_Entity_Position(EventState):
'''
Read the 3D position of an entity in a json string
># json_text string command to read
#< x_pos in... | <commit_before><commit_msg>Add a state for read an entity position in Wonderland.<commit_after>#!/usr/bin/env python
# encoding=utf8
from flexbe_core import EventState, Logger
import json
class Wonderland_Read_Entity_Position(EventState):
'''
Read the 3D position of an entity in a json string
># json_text stri... | |
32c190b4ba195c164686fdef03029edda38549eb | velocity_step_example2sv.py | velocity_step_example2sv.py | import numpy as np
import matplotlib.pyplot as plt
import rsf
model = rsf.ExternalSystem()
# Set model initial conditions
model.mu0 = 0.6 # Friction initial (at the reference velocity)
model.a = 0.005 # Empirical coefficient for the direct effect
model.k = 1e-3 # Normalized System stiffness (friction/micron)
model.v ... | Add two state variable example | Add two state variable example
| Python | mit | jrleeman/rsfmodel | Add two state variable example | import numpy as np
import matplotlib.pyplot as plt
import rsf
model = rsf.ExternalSystem()
# Set model initial conditions
model.mu0 = 0.6 # Friction initial (at the reference velocity)
model.a = 0.005 # Empirical coefficient for the direct effect
model.k = 1e-3 # Normalized System stiffness (friction/micron)
model.v ... | <commit_before><commit_msg>Add two state variable example<commit_after> | import numpy as np
import matplotlib.pyplot as plt
import rsf
model = rsf.ExternalSystem()
# Set model initial conditions
model.mu0 = 0.6 # Friction initial (at the reference velocity)
model.a = 0.005 # Empirical coefficient for the direct effect
model.k = 1e-3 # Normalized System stiffness (friction/micron)
model.v ... | Add two state variable exampleimport numpy as np
import matplotlib.pyplot as plt
import rsf
model = rsf.ExternalSystem()
# Set model initial conditions
model.mu0 = 0.6 # Friction initial (at the reference velocity)
model.a = 0.005 # Empirical coefficient for the direct effect
model.k = 1e-3 # Normalized System stiffn... | <commit_before><commit_msg>Add two state variable example<commit_after>import numpy as np
import matplotlib.pyplot as plt
import rsf
model = rsf.ExternalSystem()
# Set model initial conditions
model.mu0 = 0.6 # Friction initial (at the reference velocity)
model.a = 0.005 # Empirical coefficient for the direct effect
... | |
6acc7838e250512957392fe3577f24f97c712cd2 | tests/app/notify_client/test_status_api_client.py | tests/app/notify_client/test_status_api_client.py | from app.notify_client.status_api_client import StatusApiClient
def test_get_count_of_live_services_and_organisations(mocker):
mocker.patch('app.extensions.RedisClient.get', return_value=None)
client = StatusApiClient()
mock = mocker.patch.object(client, 'get', return_value={})
client.get_count_of_li... | Add tests for existing status api client | Add tests for existing status api client
Essentially copies the tests found in the performance_platform
api client.
| Python | mit | alphagov/notifications-admin,alphagov/notifications-admin,alphagov/notifications-admin,alphagov/notifications-admin | Add tests for existing status api client
Essentially copies the tests found in the performance_platform
api client. | from app.notify_client.status_api_client import StatusApiClient
def test_get_count_of_live_services_and_organisations(mocker):
mocker.patch('app.extensions.RedisClient.get', return_value=None)
client = StatusApiClient()
mock = mocker.patch.object(client, 'get', return_value={})
client.get_count_of_li... | <commit_before><commit_msg>Add tests for existing status api client
Essentially copies the tests found in the performance_platform
api client.<commit_after> | from app.notify_client.status_api_client import StatusApiClient
def test_get_count_of_live_services_and_organisations(mocker):
mocker.patch('app.extensions.RedisClient.get', return_value=None)
client = StatusApiClient()
mock = mocker.patch.object(client, 'get', return_value={})
client.get_count_of_li... | Add tests for existing status api client
Essentially copies the tests found in the performance_platform
api client.from app.notify_client.status_api_client import StatusApiClient
def test_get_count_of_live_services_and_organisations(mocker):
mocker.patch('app.extensions.RedisClient.get', return_value=None)
c... | <commit_before><commit_msg>Add tests for existing status api client
Essentially copies the tests found in the performance_platform
api client.<commit_after>from app.notify_client.status_api_client import StatusApiClient
def test_get_count_of_live_services_and_organisations(mocker):
mocker.patch('app.extensions.R... | |
5973e21ee459dd4f659f9a3a94be48e8a0df13bc | py/brick-wall.py | py/brick-wall.py | from collections import Counter
class Solution(object):
def leastBricks(self, wall):
"""
:type wall: List[List[int]]
:rtype: int
"""
c = Counter()
wall_width = sum(wall[0])
max_non_cut = 0
for row in wall:
subsum = 0
for n in ro... | Add py solution for 554. Brick Wall | Add py solution for 554. Brick Wall
554. Brick Wall: https://leetcode.com/problems/brick-wall/
| Python | apache-2.0 | ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode | Add py solution for 554. Brick Wall
554. Brick Wall: https://leetcode.com/problems/brick-wall/ | from collections import Counter
class Solution(object):
def leastBricks(self, wall):
"""
:type wall: List[List[int]]
:rtype: int
"""
c = Counter()
wall_width = sum(wall[0])
max_non_cut = 0
for row in wall:
subsum = 0
for n in ro... | <commit_before><commit_msg>Add py solution for 554. Brick Wall
554. Brick Wall: https://leetcode.com/problems/brick-wall/<commit_after> | from collections import Counter
class Solution(object):
def leastBricks(self, wall):
"""
:type wall: List[List[int]]
:rtype: int
"""
c = Counter()
wall_width = sum(wall[0])
max_non_cut = 0
for row in wall:
subsum = 0
for n in ro... | Add py solution for 554. Brick Wall
554. Brick Wall: https://leetcode.com/problems/brick-wall/from collections import Counter
class Solution(object):
def leastBricks(self, wall):
"""
:type wall: List[List[int]]
:rtype: int
"""
c = Counter()
wall_width = sum(wall[0])
... | <commit_before><commit_msg>Add py solution for 554. Brick Wall
554. Brick Wall: https://leetcode.com/problems/brick-wall/<commit_after>from collections import Counter
class Solution(object):
def leastBricks(self, wall):
"""
:type wall: List[List[int]]
:rtype: int
"""
c = Cou... | |
f0251c2638f1242655b514eb4d8fddf16c655ad0 | test/test_data_uri.py | test/test_data_uri.py | import os
import unittest
from node import data_uri
TEST_TXT_FILE = "data_uri_test.txt"
TEST_CONTENTS = "foo\n"
class TestDataURI(unittest.TestCase):
def setUp(self):
with open(TEST_TXT_FILE, 'w') as f:
f.write(TEST_CONTENTS)
def tearDown(self):
os.remove(TEST_TXT_FILE)
def... | Add tests for data_uri module | Add tests for data_uri module
Address reviewer comments
| Python | mit | bglassy/OpenBazaar,bankonme/OpenBazaar,bankonme/OpenBazaar,atsuyim/OpenBazaar,rllola/OpenBazaar,NolanZhao/OpenBazaar,mirrax/OpenBazaar,bglassy/OpenBazaar,matiasbastos/OpenBazaar,habibmasuro/OpenBazaar,NolanZhao/OpenBazaar,saltduck/OpenBazaar,akhavr/OpenBazaar,mirrax/OpenBazaar,matiasbastos/OpenBazaar,NolanZhao/OpenBaza... | Add tests for data_uri module
Address reviewer comments | import os
import unittest
from node import data_uri
TEST_TXT_FILE = "data_uri_test.txt"
TEST_CONTENTS = "foo\n"
class TestDataURI(unittest.TestCase):
def setUp(self):
with open(TEST_TXT_FILE, 'w') as f:
f.write(TEST_CONTENTS)
def tearDown(self):
os.remove(TEST_TXT_FILE)
def... | <commit_before><commit_msg>Add tests for data_uri module
Address reviewer comments<commit_after> | import os
import unittest
from node import data_uri
TEST_TXT_FILE = "data_uri_test.txt"
TEST_CONTENTS = "foo\n"
class TestDataURI(unittest.TestCase):
def setUp(self):
with open(TEST_TXT_FILE, 'w') as f:
f.write(TEST_CONTENTS)
def tearDown(self):
os.remove(TEST_TXT_FILE)
def... | Add tests for data_uri module
Address reviewer commentsimport os
import unittest
from node import data_uri
TEST_TXT_FILE = "data_uri_test.txt"
TEST_CONTENTS = "foo\n"
class TestDataURI(unittest.TestCase):
def setUp(self):
with open(TEST_TXT_FILE, 'w') as f:
f.write(TEST_CONTENTS)
def t... | <commit_before><commit_msg>Add tests for data_uri module
Address reviewer comments<commit_after>import os
import unittest
from node import data_uri
TEST_TXT_FILE = "data_uri_test.txt"
TEST_CONTENTS = "foo\n"
class TestDataURI(unittest.TestCase):
def setUp(self):
with open(TEST_TXT_FILE, 'w') as f:
... | |
455627ee963f1e61f1e9986fa00fa62318d8c179 | test/test_issuexxx.py | test/test_issuexxx.py | from rdflib import Graph, Namespace, URIRef, Literal
from rdflib.compare import to_isomorphic
import unittest
class TestIssueXXXX(unittest.TestCase):
def test_issuexxxx(self):
PROV = Namespace('http://www.w3.org/ns/prov#')
bob = URIRef("http://example.org/object/Bob")
value = Literal(flo... | Test serialisation of infinite values | Test serialisation of infinite values
| Python | bsd-3-clause | RDFLib/rdflib,RDFLib/rdflib,RDFLib/rdflib,RDFLib/rdflib | Test serialisation of infinite values | from rdflib import Graph, Namespace, URIRef, Literal
from rdflib.compare import to_isomorphic
import unittest
class TestIssueXXXX(unittest.TestCase):
def test_issuexxxx(self):
PROV = Namespace('http://www.w3.org/ns/prov#')
bob = URIRef("http://example.org/object/Bob")
value = Literal(flo... | <commit_before><commit_msg>Test serialisation of infinite values<commit_after> | from rdflib import Graph, Namespace, URIRef, Literal
from rdflib.compare import to_isomorphic
import unittest
class TestIssueXXXX(unittest.TestCase):
def test_issuexxxx(self):
PROV = Namespace('http://www.w3.org/ns/prov#')
bob = URIRef("http://example.org/object/Bob")
value = Literal(flo... | Test serialisation of infinite valuesfrom rdflib import Graph, Namespace, URIRef, Literal
from rdflib.compare import to_isomorphic
import unittest
class TestIssueXXXX(unittest.TestCase):
def test_issuexxxx(self):
PROV = Namespace('http://www.w3.org/ns/prov#')
bob = URIRef("http://example.org/obj... | <commit_before><commit_msg>Test serialisation of infinite values<commit_after>from rdflib import Graph, Namespace, URIRef, Literal
from rdflib.compare import to_isomorphic
import unittest
class TestIssueXXXX(unittest.TestCase):
def test_issuexxxx(self):
PROV = Namespace('http://www.w3.org/ns/prov#')
... | |
31c3aa17875bf6e3c51d0a8b47500cd4f234f002 | knights/k_tags.py | knights/k_tags.py |
import ast
from .klass import build_method
from .library import Library
register = Library()
def parse_args(bits):
'''
Parse tag bits as if they're function args
'''
code = ast.parse('x(%s)' % bits, mode='eval')
return code.body.args, code.body.keywords
@register.tag(name='block')
def block(s... | Add basic block tag implementation | Add basic block tag implementation
| Python | mit | funkybob/knights-templater,funkybob/knights-templater | Add basic block tag implementation |
import ast
from .klass import build_method
from .library import Library
register = Library()
def parse_args(bits):
'''
Parse tag bits as if they're function args
'''
code = ast.parse('x(%s)' % bits, mode='eval')
return code.body.args, code.body.keywords
@register.tag(name='block')
def block(s... | <commit_before><commit_msg>Add basic block tag implementation<commit_after> |
import ast
from .klass import build_method
from .library import Library
register = Library()
def parse_args(bits):
'''
Parse tag bits as if they're function args
'''
code = ast.parse('x(%s)' % bits, mode='eval')
return code.body.args, code.body.keywords
@register.tag(name='block')
def block(s... | Add basic block tag implementation
import ast
from .klass import build_method
from .library import Library
register = Library()
def parse_args(bits):
'''
Parse tag bits as if they're function args
'''
code = ast.parse('x(%s)' % bits, mode='eval')
return code.body.args, code.body.keywords
@regi... | <commit_before><commit_msg>Add basic block tag implementation<commit_after>
import ast
from .klass import build_method
from .library import Library
register = Library()
def parse_args(bits):
'''
Parse tag bits as if they're function args
'''
code = ast.parse('x(%s)' % bits, mode='eval')
return c... | |
1f1ffb3071f5ba3215b47745896352496df199fa | bin/cobbler/migrate_ks.py | bin/cobbler/migrate_ks.py | #!/usr/bin/python
import xmlrpclib
import logging
from compass.utils import setting_wrapper as setting
def main():
remote = xmlrpclib.Server(setting.COBBLER_INSTALLER_URL, allow_none=True)
token = remote.login(*setting.COBBLER_INSTALLER_TOKEN)
systems = remote.get_systems(token)
for system in system... | Migrate rendered kickstarts to solve cobbler single-threading issues | Migrate rendered kickstarts to solve cobbler single-threading issues
Change-Id: I431878dd1fbab44c5415739db1c6bb89788a5803
| Python | apache-2.0 | stackforge/compass-core,stackforge/compass-core,stackforge/compass-core,openstack/compass-core,baigk/compass-core,openstack/compass-core,openstack/compass-core,baigk/compass-core,stackforge/compass-core,baigk/compass-core,openstack/compass-core | Migrate rendered kickstarts to solve cobbler single-threading issues
Change-Id: I431878dd1fbab44c5415739db1c6bb89788a5803 | #!/usr/bin/python
import xmlrpclib
import logging
from compass.utils import setting_wrapper as setting
def main():
remote = xmlrpclib.Server(setting.COBBLER_INSTALLER_URL, allow_none=True)
token = remote.login(*setting.COBBLER_INSTALLER_TOKEN)
systems = remote.get_systems(token)
for system in system... | <commit_before><commit_msg>Migrate rendered kickstarts to solve cobbler single-threading issues
Change-Id: I431878dd1fbab44c5415739db1c6bb89788a5803<commit_after> | #!/usr/bin/python
import xmlrpclib
import logging
from compass.utils import setting_wrapper as setting
def main():
remote = xmlrpclib.Server(setting.COBBLER_INSTALLER_URL, allow_none=True)
token = remote.login(*setting.COBBLER_INSTALLER_TOKEN)
systems = remote.get_systems(token)
for system in system... | Migrate rendered kickstarts to solve cobbler single-threading issues
Change-Id: I431878dd1fbab44c5415739db1c6bb89788a5803#!/usr/bin/python
import xmlrpclib
import logging
from compass.utils import setting_wrapper as setting
def main():
remote = xmlrpclib.Server(setting.COBBLER_INSTALLER_URL, allow_none=True)
... | <commit_before><commit_msg>Migrate rendered kickstarts to solve cobbler single-threading issues
Change-Id: I431878dd1fbab44c5415739db1c6bb89788a5803<commit_after>#!/usr/bin/python
import xmlrpclib
import logging
from compass.utils import setting_wrapper as setting
def main():
remote = xmlrpclib.Server(setting.... | |
5d705221e6e6e1d32c90bd8a6e7ee940008d91e9 | examples/chatserver/views.py | examples/chatserver/views.py | # -*- coding: utf-8 -*-
from django.contrib.auth.models import User
from django.http import HttpResponse
from django.views.generic.base import TemplateView
from django.views.decorators.csrf import csrf_exempt
import redis
from ws4redis import settings as redis_settings
class BaseTemplateView(TemplateView):
def __... | # -*- coding: utf-8 -*-
from django.contrib.auth.models import User
from django.http import HttpResponse
from django.views.generic.base import TemplateView
from django.views.decorators.csrf import csrf_exempt
import redis
from ws4redis import settings as redis_settings
class BaseTemplateView(TemplateView):
def __... | Use META.SERVER_NAME in template view. … | Use META.SERVER_NAME in template view. …
| Python | mit | yacneyac/django-websocket-redis,0nkery/django-websocket-redis3,yacneyac/django-websocket-redis,jgroszko/django-websocket-redis,0nkery/django-websocket-redis3,jgroszko/django-websocket-redis,malefice/django-websocket-redis,Frky/django-websocket-redis,Frky/django-websocket-redis,jrief/django-websocket-redis,malefice/djan... | # -*- coding: utf-8 -*-
from django.contrib.auth.models import User
from django.http import HttpResponse
from django.views.generic.base import TemplateView
from django.views.decorators.csrf import csrf_exempt
import redis
from ws4redis import settings as redis_settings
class BaseTemplateView(TemplateView):
def __... | # -*- coding: utf-8 -*-
from django.contrib.auth.models import User
from django.http import HttpResponse
from django.views.generic.base import TemplateView
from django.views.decorators.csrf import csrf_exempt
import redis
from ws4redis import settings as redis_settings
class BaseTemplateView(TemplateView):
def __... | <commit_before># -*- coding: utf-8 -*-
from django.contrib.auth.models import User
from django.http import HttpResponse
from django.views.generic.base import TemplateView
from django.views.decorators.csrf import csrf_exempt
import redis
from ws4redis import settings as redis_settings
class BaseTemplateView(TemplateVi... | # -*- coding: utf-8 -*-
from django.contrib.auth.models import User
from django.http import HttpResponse
from django.views.generic.base import TemplateView
from django.views.decorators.csrf import csrf_exempt
import redis
from ws4redis import settings as redis_settings
class BaseTemplateView(TemplateView):
def __... | # -*- coding: utf-8 -*-
from django.contrib.auth.models import User
from django.http import HttpResponse
from django.views.generic.base import TemplateView
from django.views.decorators.csrf import csrf_exempt
import redis
from ws4redis import settings as redis_settings
class BaseTemplateView(TemplateView):
def __... | <commit_before># -*- coding: utf-8 -*-
from django.contrib.auth.models import User
from django.http import HttpResponse
from django.views.generic.base import TemplateView
from django.views.decorators.csrf import csrf_exempt
import redis
from ws4redis import settings as redis_settings
class BaseTemplateView(TemplateVi... |
09cf3f450a6a3d718cf011daf6ef4862ad0181b4 | examples/connected_region.py | examples/connected_region.py | import numpy as np
import matplotlib.pyplot as plt
import lulu.lulu_base as base
c = base.ConnectedRegion(shape=(5,5),
value=1, start_row=1,
rowptr=[0,4,6,10,14],
colptr=[2,3,4,5,0,5,0,1,2,5,0,2,3,5])
print c.todense()
dense = np.zeros((7,7,... | Add example to illustrate boundaries. | Add example to illustrate boundaries.
| Python | bsd-3-clause | stefanv/lulu | Add example to illustrate boundaries. | import numpy as np
import matplotlib.pyplot as plt
import lulu.lulu_base as base
c = base.ConnectedRegion(shape=(5,5),
value=1, start_row=1,
rowptr=[0,4,6,10,14],
colptr=[2,3,4,5,0,5,0,1,2,5,0,2,3,5])
print c.todense()
dense = np.zeros((7,7,... | <commit_before><commit_msg>Add example to illustrate boundaries.<commit_after> | import numpy as np
import matplotlib.pyplot as plt
import lulu.lulu_base as base
c = base.ConnectedRegion(shape=(5,5),
value=1, start_row=1,
rowptr=[0,4,6,10,14],
colptr=[2,3,4,5,0,5,0,1,2,5,0,2,3,5])
print c.todense()
dense = np.zeros((7,7,... | Add example to illustrate boundaries.import numpy as np
import matplotlib.pyplot as plt
import lulu.lulu_base as base
c = base.ConnectedRegion(shape=(5,5),
value=1, start_row=1,
rowptr=[0,4,6,10,14],
colptr=[2,3,4,5,0,5,0,1,2,5,0,2,3,5])
prin... | <commit_before><commit_msg>Add example to illustrate boundaries.<commit_after>import numpy as np
import matplotlib.pyplot as plt
import lulu.lulu_base as base
c = base.ConnectedRegion(shape=(5,5),
value=1, start_row=1,
rowptr=[0,4,6,10,14],
co... | |
e4b1cccddde441a4973eb3c9f741e2ce47e1d8dc | openprescribing/frontend/tests/test_geojson_serializer.py | openprescribing/frontend/tests/test_geojson_serializer.py | import json
from django.test import TestCase
from django.core.serializers import serialize
from frontend.models import PCT
from api.geojson_serializer import as_geojson_stream
class GeoJSONSerializerTest(TestCase):
fixtures = ['orgs']
def test_output_is_the_same_as_core_serializer(self):
fields = ... | Add test for GeoJSON serializer | Add test for GeoJSON serializer
| Python | mit | ebmdatalab/openprescribing,ebmdatalab/openprescribing,annapowellsmith/openpresc,ebmdatalab/openprescribing,annapowellsmith/openpresc,annapowellsmith/openpresc,annapowellsmith/openpresc,ebmdatalab/openprescribing | Add test for GeoJSON serializer | import json
from django.test import TestCase
from django.core.serializers import serialize
from frontend.models import PCT
from api.geojson_serializer import as_geojson_stream
class GeoJSONSerializerTest(TestCase):
fixtures = ['orgs']
def test_output_is_the_same_as_core_serializer(self):
fields = ... | <commit_before><commit_msg>Add test for GeoJSON serializer<commit_after> | import json
from django.test import TestCase
from django.core.serializers import serialize
from frontend.models import PCT
from api.geojson_serializer import as_geojson_stream
class GeoJSONSerializerTest(TestCase):
fixtures = ['orgs']
def test_output_is_the_same_as_core_serializer(self):
fields = ... | Add test for GeoJSON serializerimport json
from django.test import TestCase
from django.core.serializers import serialize
from frontend.models import PCT
from api.geojson_serializer import as_geojson_stream
class GeoJSONSerializerTest(TestCase):
fixtures = ['orgs']
def test_output_is_the_same_as_core_seri... | <commit_before><commit_msg>Add test for GeoJSON serializer<commit_after>import json
from django.test import TestCase
from django.core.serializers import serialize
from frontend.models import PCT
from api.geojson_serializer import as_geojson_stream
class GeoJSONSerializerTest(TestCase):
fixtures = ['orgs']
... | |
8f9ee7f7ad751a3d785e1063c7bbf52b4c8a8de2 | migrations/versions/0236_another_letter_org.py | migrations/versions/0236_another_letter_org.py | """empty message
Revision ID: 0236_another_letter_org
Revises: 0235_add_postage_to_pk
"""
# revision identifiers, used by Alembic.
revision = '0236_another_letter_org'
down_revision = '0235_add_postage_to_pk'
from alembic import op
NEW_ORGANISATIONS = [
('514', 'Brighton and Hove city council'),
]
def upgra... | Add letter org for Brighton and Hove | Add letter org for Brighton and Hove
| Python | mit | alphagov/notifications-api,alphagov/notifications-api | Add letter org for Brighton and Hove | """empty message
Revision ID: 0236_another_letter_org
Revises: 0235_add_postage_to_pk
"""
# revision identifiers, used by Alembic.
revision = '0236_another_letter_org'
down_revision = '0235_add_postage_to_pk'
from alembic import op
NEW_ORGANISATIONS = [
('514', 'Brighton and Hove city council'),
]
def upgra... | <commit_before><commit_msg>Add letter org for Brighton and Hove<commit_after> | """empty message
Revision ID: 0236_another_letter_org
Revises: 0235_add_postage_to_pk
"""
# revision identifiers, used by Alembic.
revision = '0236_another_letter_org'
down_revision = '0235_add_postage_to_pk'
from alembic import op
NEW_ORGANISATIONS = [
('514', 'Brighton and Hove city council'),
]
def upgra... | Add letter org for Brighton and Hove"""empty message
Revision ID: 0236_another_letter_org
Revises: 0235_add_postage_to_pk
"""
# revision identifiers, used by Alembic.
revision = '0236_another_letter_org'
down_revision = '0235_add_postage_to_pk'
from alembic import op
NEW_ORGANISATIONS = [
('514', 'Brighton an... | <commit_before><commit_msg>Add letter org for Brighton and Hove<commit_after>"""empty message
Revision ID: 0236_another_letter_org
Revises: 0235_add_postage_to_pk
"""
# revision identifiers, used by Alembic.
revision = '0236_another_letter_org'
down_revision = '0235_add_postage_to_pk'
from alembic import op
NEW_O... | |
449285d8136015fe8c0ecd1c756d77b21dfba6e9 | html/cli-get-html-hyperlinks.py | html/cli-get-html-hyperlinks.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import urllib2
from HTMLParser import HTMLParser
# HTML Hyperlink(s) getter
class GetHyperlinks(HTMLParser):
def __init__(self):
self.reset()
self.links = []
def handle_starttag(self, tag, attrs):
if tag == 'a':
for attr in at... | Add HTML hyperlink (<a> tag) finder/getter | Add HTML hyperlink (<a> tag) finder/getter
| Python | mit | rawswift/python-collections | Add HTML hyperlink (<a> tag) finder/getter | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import urllib2
from HTMLParser import HTMLParser
# HTML Hyperlink(s) getter
class GetHyperlinks(HTMLParser):
def __init__(self):
self.reset()
self.links = []
def handle_starttag(self, tag, attrs):
if tag == 'a':
for attr in at... | <commit_before><commit_msg>Add HTML hyperlink (<a> tag) finder/getter<commit_after> | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import urllib2
from HTMLParser import HTMLParser
# HTML Hyperlink(s) getter
class GetHyperlinks(HTMLParser):
def __init__(self):
self.reset()
self.links = []
def handle_starttag(self, tag, attrs):
if tag == 'a':
for attr in at... | Add HTML hyperlink (<a> tag) finder/getter#!/usr/bin/env python
# -*- coding: utf-8 -*-
import urllib2
from HTMLParser import HTMLParser
# HTML Hyperlink(s) getter
class GetHyperlinks(HTMLParser):
def __init__(self):
self.reset()
self.links = []
def handle_starttag(self, tag, attrs):
... | <commit_before><commit_msg>Add HTML hyperlink (<a> tag) finder/getter<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import urllib2
from HTMLParser import HTMLParser
# HTML Hyperlink(s) getter
class GetHyperlinks(HTMLParser):
def __init__(self):
self.reset()
self.links = []
def h... | |
923c463e4a8e2da3b2cbe60d7351a3036257551d | migrations/versions/65fc9ede4746_add_is_draft_status_to_queries_and_.py | migrations/versions/65fc9ede4746_add_is_draft_status_to_queries_and_.py | """Add is_draft status to queries and dashboards
Revision ID: 65fc9ede4746
Revises:
Create Date: 2016-12-07 18:08:13.395586
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
from sqlalchemy.exc import ProgrammingError
revision = '... | Add migration for the is_draft column | Add migration for the is_draft column
| Python | bsd-2-clause | stefanseifert/redash,amino-data/redash,getredash/redash,alexanderlz/redash,alexanderlz/redash,vishesh92/redash,imsally/redash,amino-data/redash,chriszs/redash,useabode/redash,44px/redash,EverlyWell/redash,imsally/redash,hudl/redash,amino-data/redash,rockwotj/redash,rockwotj/redash,M32Media/redash,hudl/redash,alexanderl... | Add migration for the is_draft column | """Add is_draft status to queries and dashboards
Revision ID: 65fc9ede4746
Revises:
Create Date: 2016-12-07 18:08:13.395586
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
from sqlalchemy.exc import ProgrammingError
revision = '... | <commit_before><commit_msg>Add migration for the is_draft column<commit_after> | """Add is_draft status to queries and dashboards
Revision ID: 65fc9ede4746
Revises:
Create Date: 2016-12-07 18:08:13.395586
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
from sqlalchemy.exc import ProgrammingError
revision = '... | Add migration for the is_draft column"""Add is_draft status to queries and dashboards
Revision ID: 65fc9ede4746
Revises:
Create Date: 2016-12-07 18:08:13.395586
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
from sqlalchemy.exc ... | <commit_before><commit_msg>Add migration for the is_draft column<commit_after>"""Add is_draft status to queries and dashboards
Revision ID: 65fc9ede4746
Revises:
Create Date: 2016-12-07 18:08:13.395586
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# revision identifie... | |
617819e7aff47f2764d13bd183080dea54f689f9 | test_equil_solver.py | test_equil_solver.py | # -*- coding: utf-8 -*-
"""
Created on Thu Nov 5 09:44:38 2015
@author: jensv
"""
import numpy as np
import numpy.testing as test
import scipy.integrate as integrate
import equil_solver as es
from scipy.interpolate import splev
from nose.tools import with_setup
test_equil = None
def setup_func():
r"""
Gene... | Add tests for equilibrium profiles. | Add tests for equilibrium profiles.
| Python | mit | jensv/fluxtubestability,jensv/fluxtubestability | Add tests for equilibrium profiles. | # -*- coding: utf-8 -*-
"""
Created on Thu Nov 5 09:44:38 2015
@author: jensv
"""
import numpy as np
import numpy.testing as test
import scipy.integrate as integrate
import equil_solver as es
from scipy.interpolate import splev
from nose.tools import with_setup
test_equil = None
def setup_func():
r"""
Gene... | <commit_before><commit_msg>Add tests for equilibrium profiles.<commit_after> | # -*- coding: utf-8 -*-
"""
Created on Thu Nov 5 09:44:38 2015
@author: jensv
"""
import numpy as np
import numpy.testing as test
import scipy.integrate as integrate
import equil_solver as es
from scipy.interpolate import splev
from nose.tools import with_setup
test_equil = None
def setup_func():
r"""
Gene... | Add tests for equilibrium profiles.# -*- coding: utf-8 -*-
"""
Created on Thu Nov 5 09:44:38 2015
@author: jensv
"""
import numpy as np
import numpy.testing as test
import scipy.integrate as integrate
import equil_solver as es
from scipy.interpolate import splev
from nose.tools import with_setup
test_equil = None
... | <commit_before><commit_msg>Add tests for equilibrium profiles.<commit_after># -*- coding: utf-8 -*-
"""
Created on Thu Nov 5 09:44:38 2015
@author: jensv
"""
import numpy as np
import numpy.testing as test
import scipy.integrate as integrate
import equil_solver as es
from scipy.interpolate import splev
from nose.too... | |
04e63aa44bb2de8f769202c02a3a23a7e9d17d74 | tests/unit/test_handlers.py | tests/unit/test_handlers.py | from pmxbot import core
def test_contains_always_match():
"""
Contains handler should always match if no rate is specified.
"""
handler = core.ContainsHandler(name='#', func=None)
assert handler.match('Tell me about #foo', channel='bar')
| Add test capturing bad implementation of contains handler. | Add test capturing bad implementation of contains handler.
| Python | mit | yougov/pmxbot,yougov/pmxbot,yougov/pmxbot | Add test capturing bad implementation of contains handler. | from pmxbot import core
def test_contains_always_match():
"""
Contains handler should always match if no rate is specified.
"""
handler = core.ContainsHandler(name='#', func=None)
assert handler.match('Tell me about #foo', channel='bar')
| <commit_before><commit_msg>Add test capturing bad implementation of contains handler.<commit_after> | from pmxbot import core
def test_contains_always_match():
"""
Contains handler should always match if no rate is specified.
"""
handler = core.ContainsHandler(name='#', func=None)
assert handler.match('Tell me about #foo', channel='bar')
| Add test capturing bad implementation of contains handler.from pmxbot import core
def test_contains_always_match():
"""
Contains handler should always match if no rate is specified.
"""
handler = core.ContainsHandler(name='#', func=None)
assert handler.match('Tell me about #foo', channel='bar')
| <commit_before><commit_msg>Add test capturing bad implementation of contains handler.<commit_after>from pmxbot import core
def test_contains_always_match():
"""
Contains handler should always match if no rate is specified.
"""
handler = core.ContainsHandler(name='#', func=None)
assert handler.match('Tell me about... | |
14d048091cfa24d0f6abd5cb61d814c4fee9e6db | hooks/post_gen_project.py | hooks/post_gen_project.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Rename the generated kv file to be compatible with the original kivy kv file
detection of `App.load_kv`.
"""
import os
package_dir = '{{cookiecutter.repo_name}}'
old_kv_file = os.path.join(package_dir, '{{cookiecutter.app_class_name}}.kv')
lower_app_class_name = '{{... | Implement a post gen python script to rename the kv file | Implement a post gen python script to rename the kv file
| Python | mit | hackebrot/cookiedozer,hackebrot/cookiedozer | Implement a post gen python script to rename the kv file | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Rename the generated kv file to be compatible with the original kivy kv file
detection of `App.load_kv`.
"""
import os
package_dir = '{{cookiecutter.repo_name}}'
old_kv_file = os.path.join(package_dir, '{{cookiecutter.app_class_name}}.kv')
lower_app_class_name = '{{... | <commit_before><commit_msg>Implement a post gen python script to rename the kv file<commit_after> | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Rename the generated kv file to be compatible with the original kivy kv file
detection of `App.load_kv`.
"""
import os
package_dir = '{{cookiecutter.repo_name}}'
old_kv_file = os.path.join(package_dir, '{{cookiecutter.app_class_name}}.kv')
lower_app_class_name = '{{... | Implement a post gen python script to rename the kv file#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Rename the generated kv file to be compatible with the original kivy kv file
detection of `App.load_kv`.
"""
import os
package_dir = '{{cookiecutter.repo_name}}'
old_kv_file = os.path.join(package_dir, '{{cookie... | <commit_before><commit_msg>Implement a post gen python script to rename the kv file<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Rename the generated kv file to be compatible with the original kivy kv file
detection of `App.load_kv`.
"""
import os
package_dir = '{{cookiecutter.repo_name}}'
old_kv_f... | |
92e840aef7ac0d9aee629db58791a43a71cd578c | myhdl/test/conversion/numeric/test_numass.py | myhdl/test/conversion/numeric/test_numass.py | from __future__ import absolute_import, print_function
from random import randrange
from myhdl import Signal, uintba, sintba, instance, delay, conversion
def NumassBench():
p = Signal(uintba(1, 8))
q = Signal(uintba(1, 40))
r = Signal(sintba(1, 9))
s = Signal(sintba(1, 41))
PBIGINT = randrange(2... | Revert "Revert "Revert "Revert "Added the number assignment test for numeric."""" | Revert "Revert "Revert "Revert "Added the number assignment test for numeric.""""
This reverts commit 91151bc6fd2c48c83656452e7c8f8f7e8b7b4218.
| Python | lgpl-2.1 | jmgc/myhdl-numeric,jmgc/myhdl-numeric,jmgc/myhdl-numeric | Revert "Revert "Revert "Revert "Added the number assignment test for numeric.""""
This reverts commit 91151bc6fd2c48c83656452e7c8f8f7e8b7b4218. | from __future__ import absolute_import, print_function
from random import randrange
from myhdl import Signal, uintba, sintba, instance, delay, conversion
def NumassBench():
p = Signal(uintba(1, 8))
q = Signal(uintba(1, 40))
r = Signal(sintba(1, 9))
s = Signal(sintba(1, 41))
PBIGINT = randrange(2... | <commit_before><commit_msg>Revert "Revert "Revert "Revert "Added the number assignment test for numeric.""""
This reverts commit 91151bc6fd2c48c83656452e7c8f8f7e8b7b4218.<commit_after> | from __future__ import absolute_import, print_function
from random import randrange
from myhdl import Signal, uintba, sintba, instance, delay, conversion
def NumassBench():
p = Signal(uintba(1, 8))
q = Signal(uintba(1, 40))
r = Signal(sintba(1, 9))
s = Signal(sintba(1, 41))
PBIGINT = randrange(2... | Revert "Revert "Revert "Revert "Added the number assignment test for numeric.""""
This reverts commit 91151bc6fd2c48c83656452e7c8f8f7e8b7b4218.from __future__ import absolute_import, print_function
from random import randrange
from myhdl import Signal, uintba, sintba, instance, delay, conversion
def NumassBench():... | <commit_before><commit_msg>Revert "Revert "Revert "Revert "Added the number assignment test for numeric.""""
This reverts commit 91151bc6fd2c48c83656452e7c8f8f7e8b7b4218.<commit_after>from __future__ import absolute_import, print_function
from random import randrange
from myhdl import Signal, uintba, sintba, instanc... | |
de760c40c8aa187131b0b3b7a9517445cb648634 | distance.py | distance.py | #Import needed libraries
import numpy as np
import cv2
cap=cv2.VideoCapture(0)
i=0
ret=True
while(i<1):
ret, frame =cap.read()
# print("Camera is still running buddy")
cv2.imwrite('test{0}.png'.format(i), frame)
i=i+1
cap.release()
cv2.destroyAllWindows()
| Add python script to take image frame from live camera feed | Add python script to take image frame from live camera feed
| Python | mit | galxy25/safeDriver | Add python script to take image frame from live camera feed | #Import needed libraries
import numpy as np
import cv2
cap=cv2.VideoCapture(0)
i=0
ret=True
while(i<1):
ret, frame =cap.read()
# print("Camera is still running buddy")
cv2.imwrite('test{0}.png'.format(i), frame)
i=i+1
cap.release()
cv2.destroyAllWindows()
| <commit_before><commit_msg>Add python script to take image frame from live camera feed<commit_after> | #Import needed libraries
import numpy as np
import cv2
cap=cv2.VideoCapture(0)
i=0
ret=True
while(i<1):
ret, frame =cap.read()
# print("Camera is still running buddy")
cv2.imwrite('test{0}.png'.format(i), frame)
i=i+1
cap.release()
cv2.destroyAllWindows()
| Add python script to take image frame from live camera feed#Import needed libraries
import numpy as np
import cv2
cap=cv2.VideoCapture(0)
i=0
ret=True
while(i<1):
ret, frame =cap.read()
# print("Camera is still running buddy")
cv2.imwrite('test{0}.png'.format(i), frame)
i=i+1
cap.release()
cv2.destroyAllWin... | <commit_before><commit_msg>Add python script to take image frame from live camera feed<commit_after>#Import needed libraries
import numpy as np
import cv2
cap=cv2.VideoCapture(0)
i=0
ret=True
while(i<1):
ret, frame =cap.read()
# print("Camera is still running buddy")
cv2.imwrite('test{0}.png'.format(i), frame)... | |
08749433dfcc8e3df19adcdfc4598f9cba43adee | ansible-tests/validations.py | ansible-tests/validations.py | #!/usr/bin/env python
import sys
import glob
def die(msg):
print msg
sys.exit(1)
def validations():
validations = glob.glob('playbooks/*.yaml')
return list(sorted(validations))
def command_list(**args):
for i, name in enumerate(validations()):
print "%d. %s" % (i + 1, name)
def comman... | Add a basic runner program | Add a basic runner program
It just lists validations right now. Ultimately it will run them and
potentially provide a HTTP API.
| Python | apache-2.0 | rthallisey/clapper,coolsvap/clapper,coolsvap/clapper,coolsvap/clapper,rthallisey/clapper | Add a basic runner program
It just lists validations right now. Ultimately it will run them and
potentially provide a HTTP API. | #!/usr/bin/env python
import sys
import glob
def die(msg):
print msg
sys.exit(1)
def validations():
validations = glob.glob('playbooks/*.yaml')
return list(sorted(validations))
def command_list(**args):
for i, name in enumerate(validations()):
print "%d. %s" % (i + 1, name)
def comman... | <commit_before><commit_msg>Add a basic runner program
It just lists validations right now. Ultimately it will run them and
potentially provide a HTTP API.<commit_after> | #!/usr/bin/env python
import sys
import glob
def die(msg):
print msg
sys.exit(1)
def validations():
validations = glob.glob('playbooks/*.yaml')
return list(sorted(validations))
def command_list(**args):
for i, name in enumerate(validations()):
print "%d. %s" % (i + 1, name)
def comman... | Add a basic runner program
It just lists validations right now. Ultimately it will run them and
potentially provide a HTTP API.#!/usr/bin/env python
import sys
import glob
def die(msg):
print msg
sys.exit(1)
def validations():
validations = glob.glob('playbooks/*.yaml')
return list(sorted(validation... | <commit_before><commit_msg>Add a basic runner program
It just lists validations right now. Ultimately it will run them and
potentially provide a HTTP API.<commit_after>#!/usr/bin/env python
import sys
import glob
def die(msg):
print msg
sys.exit(1)
def validations():
validations = glob.glob('playbooks/*... | |
d3cac0f637a8667497ff311fc94bdceb19330b77 | plugins/modules/dedicated_server_monitoring.py | plugins/modules/dedicated_server_monitoring.py | #!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible.module_utils.basic import AnsibleModule
DOCUMENTATION = '''
---
module: dedicated_server_monitoring
short_description: Enable or disable ovh monitoring on a dedicated server
description:
- Enable... | Add dedicated server monitoring modulec | INFRA-6746: Add dedicated server monitoring modulec
- Then you can add or remove OVH monitoring
| Python | mit | synthesio/infra-ovh-ansible-module | INFRA-6746: Add dedicated server monitoring modulec
- Then you can add or remove OVH monitoring | #!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible.module_utils.basic import AnsibleModule
DOCUMENTATION = '''
---
module: dedicated_server_monitoring
short_description: Enable or disable ovh monitoring on a dedicated server
description:
- Enable... | <commit_before><commit_msg>INFRA-6746: Add dedicated server monitoring modulec
- Then you can add or remove OVH monitoring<commit_after> | #!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible.module_utils.basic import AnsibleModule
DOCUMENTATION = '''
---
module: dedicated_server_monitoring
short_description: Enable or disable ovh monitoring on a dedicated server
description:
- Enable... | INFRA-6746: Add dedicated server monitoring modulec
- Then you can add or remove OVH monitoring#!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible.module_utils.basic import AnsibleModule
DOCUMENTATION = '''
---
module: dedicated_server_monitoring
sh... | <commit_before><commit_msg>INFRA-6746: Add dedicated server monitoring modulec
- Then you can add or remove OVH monitoring<commit_after>#!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible.module_utils.basic import AnsibleModule
DOCUMENTATION = '''
-... | |
9080fae1e329a541102ec31fbf7a93dab36c891b | scripts/migrate_logs_branded_preprints.py | scripts/migrate_logs_branded_preprints.py | import sys
import logging
from website.app import init_app
from website.models import NodeLog, PreprintService
from scripts import utils as script_utils
from modularodm import Q
logger = logging.getLogger(__name__)
def do_migration(records, dry=False):
count = 0
for log in records:
provider = Prepr... | Add node log migration script for branded preprints | Add node log migration script for branded preprints
| Python | apache-2.0 | baylee-d/osf.io,leb2dg/osf.io,Johnetordoff/osf.io,brianjgeiger/osf.io,chennan47/osf.io,chrisseto/osf.io,rdhyee/osf.io,caneruguz/osf.io,CenterForOpenScience/osf.io,sloria/osf.io,alexschiller/osf.io,mluo613/osf.io,caseyrollins/osf.io,binoculars/osf.io,pattisdr/osf.io,HalcyonChimera/osf.io,caseyrollins/osf.io,hmoco/osf.io... | Add node log migration script for branded preprints | import sys
import logging
from website.app import init_app
from website.models import NodeLog, PreprintService
from scripts import utils as script_utils
from modularodm import Q
logger = logging.getLogger(__name__)
def do_migration(records, dry=False):
count = 0
for log in records:
provider = Prepr... | <commit_before><commit_msg>Add node log migration script for branded preprints<commit_after> | import sys
import logging
from website.app import init_app
from website.models import NodeLog, PreprintService
from scripts import utils as script_utils
from modularodm import Q
logger = logging.getLogger(__name__)
def do_migration(records, dry=False):
count = 0
for log in records:
provider = Prepr... | Add node log migration script for branded preprintsimport sys
import logging
from website.app import init_app
from website.models import NodeLog, PreprintService
from scripts import utils as script_utils
from modularodm import Q
logger = logging.getLogger(__name__)
def do_migration(records, dry=False):
count = ... | <commit_before><commit_msg>Add node log migration script for branded preprints<commit_after>import sys
import logging
from website.app import init_app
from website.models import NodeLog, PreprintService
from scripts import utils as script_utils
from modularodm import Q
logger = logging.getLogger(__name__)
def do_mi... | |
a5efa5bd91cbbb2e963f48e4b8c2c371da02a6ec | readthedocs/core/migrations/0002_make_userprofile_user_a_onetoonefield.py | readthedocs/core/migrations/0002_make_userprofile_user_a_onetoonefield.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('core', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='use... | Add migration for UserProfile.user's change to OneToOneField | Add migration for UserProfile.user's change to OneToOneField
| Python | mit | gjtorikian/readthedocs.org,kdkeyser/readthedocs.org,titiushko/readthedocs.org,LukasBoersma/readthedocs.org,SteveViss/readthedocs.org,rtfd/readthedocs.org,techtonik/readthedocs.org,soulshake/readthedocs.org,royalwang/readthedocs.org,sunnyzwh/readthedocs.org,michaelmcandrew/readthedocs.org,wijerasa/readthedocs.org,clarkp... | Add migration for UserProfile.user's change to OneToOneField | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('core', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='use... | <commit_before><commit_msg>Add migration for UserProfile.user's change to OneToOneField<commit_after> | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('core', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='use... | Add migration for UserProfile.user's change to OneToOneField# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('core', '0001_initial'),
]
operations = ... | <commit_before><commit_msg>Add migration for UserProfile.user's change to OneToOneField<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('core', ... | |
c600509c9c5069cc27d0c63ae34dc62a80087fa1 | scripts/rosedu-chat-logs.py | scripts/rosedu-chat-logs.py | #!/usr/local/bin/python3
import requests
from datetime import datetime, timedelta
url = "http://data.softwareliber.ro/irc-logs/%23rosedu/%23rosedu.{0:02d}-{1:02d}-{2}.log"
now = datetime.now()
yesterday = now - timedelta(hours=24)
ret = []
forbidden_lines = ["has quit", "has joined", "has left"]
for dates in [yester... | Add ROSEdu chat logs script | Add ROSEdu chat logs script
| Python | mit | smathson/dotfiles | Add ROSEdu chat logs script | #!/usr/local/bin/python3
import requests
from datetime import datetime, timedelta
url = "http://data.softwareliber.ro/irc-logs/%23rosedu/%23rosedu.{0:02d}-{1:02d}-{2}.log"
now = datetime.now()
yesterday = now - timedelta(hours=24)
ret = []
forbidden_lines = ["has quit", "has joined", "has left"]
for dates in [yester... | <commit_before><commit_msg>Add ROSEdu chat logs script<commit_after> | #!/usr/local/bin/python3
import requests
from datetime import datetime, timedelta
url = "http://data.softwareliber.ro/irc-logs/%23rosedu/%23rosedu.{0:02d}-{1:02d}-{2}.log"
now = datetime.now()
yesterday = now - timedelta(hours=24)
ret = []
forbidden_lines = ["has quit", "has joined", "has left"]
for dates in [yester... | Add ROSEdu chat logs script#!/usr/local/bin/python3
import requests
from datetime import datetime, timedelta
url = "http://data.softwareliber.ro/irc-logs/%23rosedu/%23rosedu.{0:02d}-{1:02d}-{2}.log"
now = datetime.now()
yesterday = now - timedelta(hours=24)
ret = []
forbidden_lines = ["has quit", "has joined", "has ... | <commit_before><commit_msg>Add ROSEdu chat logs script<commit_after>#!/usr/local/bin/python3
import requests
from datetime import datetime, timedelta
url = "http://data.softwareliber.ro/irc-logs/%23rosedu/%23rosedu.{0:02d}-{1:02d}-{2}.log"
now = datetime.now()
yesterday = now - timedelta(hours=24)
ret = []
forbidden... | |
ff3a3cd831a70d89864d040c9cc6a71a378a5569 | setup.py | setup.py | #!/usr/bin/env python
from setuptools import setup, find_packages
from cron_sentry.version import VERSION
setup(
name='cron-sentry',
version=VERSION,
author='Yipit Coders',
author_email='coders@yipit.com',
description='Cron-Sentry is a command-line wrapper that reports unsuccessful runs to Sentry (... | #!/usr/bin/env python
from setuptools import setup, find_packages
from cron_sentry.version import VERSION
setup(
name='cron-sentry',
version=VERSION,
author='Yipit Coders',
author_email='coders@yipit.com',
description='Cron-Sentry is a command-line wrapper that reports unsuccessful runs to Sentry (... | Add missing package requirement of argparse. | Add missing package requirement of argparse.
| Python | mit | ciiol/cron-sentry,sysadmind/cron-sentry | #!/usr/bin/env python
from setuptools import setup, find_packages
from cron_sentry.version import VERSION
setup(
name='cron-sentry',
version=VERSION,
author='Yipit Coders',
author_email='coders@yipit.com',
description='Cron-Sentry is a command-line wrapper that reports unsuccessful runs to Sentry (... | #!/usr/bin/env python
from setuptools import setup, find_packages
from cron_sentry.version import VERSION
setup(
name='cron-sentry',
version=VERSION,
author='Yipit Coders',
author_email='coders@yipit.com',
description='Cron-Sentry is a command-line wrapper that reports unsuccessful runs to Sentry (... | <commit_before>#!/usr/bin/env python
from setuptools import setup, find_packages
from cron_sentry.version import VERSION
setup(
name='cron-sentry',
version=VERSION,
author='Yipit Coders',
author_email='coders@yipit.com',
description='Cron-Sentry is a command-line wrapper that reports unsuccessful r... | #!/usr/bin/env python
from setuptools import setup, find_packages
from cron_sentry.version import VERSION
setup(
name='cron-sentry',
version=VERSION,
author='Yipit Coders',
author_email='coders@yipit.com',
description='Cron-Sentry is a command-line wrapper that reports unsuccessful runs to Sentry (... | #!/usr/bin/env python
from setuptools import setup, find_packages
from cron_sentry.version import VERSION
setup(
name='cron-sentry',
version=VERSION,
author='Yipit Coders',
author_email='coders@yipit.com',
description='Cron-Sentry is a command-line wrapper that reports unsuccessful runs to Sentry (... | <commit_before>#!/usr/bin/env python
from setuptools import setup, find_packages
from cron_sentry.version import VERSION
setup(
name='cron-sentry',
version=VERSION,
author='Yipit Coders',
author_email='coders@yipit.com',
description='Cron-Sentry is a command-line wrapper that reports unsuccessful r... |
8e124cf84b400a910e8dfc0c0b2b3fda3b846bd5 | sara_flexbe_states/src/sara_flexbe_states/Wonderland_Objects_In_A_Room.py | sara_flexbe_states/src/sara_flexbe_states/Wonderland_Objects_In_A_Room.py | #!/usr/bin/env python
# encoding=utf8
from flexbe_core import EventState, Logger
import json
class Wonderland_Objects_In_A_Room(EventState):
'''
Return all objects in a room
># json_text string json to read
#> names int[] array containing all names of objects in the room
#> ids ... | Add a state listing all entities in a room | Add a state listing all entities in a room
| Python | bsd-3-clause | WalkingMachine/sara_behaviors,WalkingMachine/sara_behaviors | Add a state listing all entities in a room | #!/usr/bin/env python
# encoding=utf8
from flexbe_core import EventState, Logger
import json
class Wonderland_Objects_In_A_Room(EventState):
'''
Return all objects in a room
># json_text string json to read
#> names int[] array containing all names of objects in the room
#> ids ... | <commit_before><commit_msg>Add a state listing all entities in a room<commit_after> | #!/usr/bin/env python
# encoding=utf8
from flexbe_core import EventState, Logger
import json
class Wonderland_Objects_In_A_Room(EventState):
'''
Return all objects in a room
># json_text string json to read
#> names int[] array containing all names of objects in the room
#> ids ... | Add a state listing all entities in a room#!/usr/bin/env python
# encoding=utf8
from flexbe_core import EventState, Logger
import json
class Wonderland_Objects_In_A_Room(EventState):
'''
Return all objects in a room
># json_text string json to read
#> names int[] array containing all nam... | <commit_before><commit_msg>Add a state listing all entities in a room<commit_after>#!/usr/bin/env python
# encoding=utf8
from flexbe_core import EventState, Logger
import json
class Wonderland_Objects_In_A_Room(EventState):
'''
Return all objects in a room
># json_text string json to read
#> names ... | |
59a1d93ca6e0ff20035e2aa9c3ffc83e453f0942 | set1/challenge-2.py | set1/challenge-2.py | import base64
def fixed_xor(hex_a, hex_b):
decoded_a = base64.b16decode(hex_a, True)
decoded_b = base64.b16decode(hex_b, True)
xor_result = [chr(ord(a) ^ ord(b)) for a, b in zip(decoded_a, decoded_b)]
return base64.b16encode(''.join(xor_result))
if __name__ == '__main__':
hex_a = raw_input("hex_a... | Add solution to challenge 2. | Add solution to challenge 2.
| Python | mit | ericnorris/cryptopals-solutions | Add solution to challenge 2. | import base64
def fixed_xor(hex_a, hex_b):
decoded_a = base64.b16decode(hex_a, True)
decoded_b = base64.b16decode(hex_b, True)
xor_result = [chr(ord(a) ^ ord(b)) for a, b in zip(decoded_a, decoded_b)]
return base64.b16encode(''.join(xor_result))
if __name__ == '__main__':
hex_a = raw_input("hex_a... | <commit_before><commit_msg>Add solution to challenge 2.<commit_after> | import base64
def fixed_xor(hex_a, hex_b):
decoded_a = base64.b16decode(hex_a, True)
decoded_b = base64.b16decode(hex_b, True)
xor_result = [chr(ord(a) ^ ord(b)) for a, b in zip(decoded_a, decoded_b)]
return base64.b16encode(''.join(xor_result))
if __name__ == '__main__':
hex_a = raw_input("hex_a... | Add solution to challenge 2.import base64
def fixed_xor(hex_a, hex_b):
decoded_a = base64.b16decode(hex_a, True)
decoded_b = base64.b16decode(hex_b, True)
xor_result = [chr(ord(a) ^ ord(b)) for a, b in zip(decoded_a, decoded_b)]
return base64.b16encode(''.join(xor_result))
if __name__ == '__main__':
... | <commit_before><commit_msg>Add solution to challenge 2.<commit_after>import base64
def fixed_xor(hex_a, hex_b):
decoded_a = base64.b16decode(hex_a, True)
decoded_b = base64.b16decode(hex_b, True)
xor_result = [chr(ord(a) ^ ord(b)) for a, b in zip(decoded_a, decoded_b)]
return base64.b16encode(''.join(... | |
7f3acc09228460e4494ab7e4899edf3f131efc72 | build/android/test_runner.py | build/android/test_runner.py | #!/usr/bin/env python
# Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All c... | Add Android test runner script for WebRTC. | Add Android test runner script for WebRTC.
The Android test execution toolchain scripts in Chromium
has been causing headaches for us several times. Mostly
because they're tailored at running Chrome tests only.
Wrapping their script in our own avoids the pain of
upstreaming new test names to Chromium and rolling them... | Python | bsd-3-clause | sippet/webrtc,sippet/webrtc,sippet/webrtc,sippet/webrtc,sippet/webrtc,sippet/webrtc | Add Android test runner script for WebRTC.
The Android test execution toolchain scripts in Chromium
has been causing headaches for us several times. Mostly
because they're tailored at running Chrome tests only.
Wrapping their script in our own avoids the pain of
upstreaming new test names to Chromium and rolling them... | #!/usr/bin/env python
# Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All c... | <commit_before><commit_msg>Add Android test runner script for WebRTC.
The Android test execution toolchain scripts in Chromium
has been causing headaches for us several times. Mostly
because they're tailored at running Chrome tests only.
Wrapping their script in our own avoids the pain of
upstreaming new test names t... | #!/usr/bin/env python
# Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All c... | Add Android test runner script for WebRTC.
The Android test execution toolchain scripts in Chromium
has been causing headaches for us several times. Mostly
because they're tailored at running Chrome tests only.
Wrapping their script in our own avoids the pain of
upstreaming new test names to Chromium and rolling them... | <commit_before><commit_msg>Add Android test runner script for WebRTC.
The Android test execution toolchain scripts in Chromium
has been causing headaches for us several times. Mostly
because they're tailored at running Chrome tests only.
Wrapping their script in our own avoids the pain of
upstreaming new test names t... | |
37dee83ed478eba2079bd6eb98c39d7ba2872c7d | multigtfs/management/commands/refreshgeometries.py | multigtfs/management/commands/refreshgeometries.py | #
# Copyright 2012-2014 John Whitlock
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | Add mgmt command for refreshing cached geometries | Add mgmt command for refreshing cached geometries
| Python | apache-2.0 | tulsawebdevs/django-multi-gtfs,tulsawebdevs/django-multi-gtfs,inmagik/django-multi-gtfs,inmagik/django-multi-gtfs,inmagik/django-multi-gtfs,inmagik/django-multi-gtfs | Add mgmt command for refreshing cached geometries | #
# Copyright 2012-2014 John Whitlock
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | <commit_before><commit_msg>Add mgmt command for refreshing cached geometries<commit_after> | #
# Copyright 2012-2014 John Whitlock
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | Add mgmt command for refreshing cached geometries#
# Copyright 2012-2014 John Whitlock
#
# 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
#
# Unles... | <commit_before><commit_msg>Add mgmt command for refreshing cached geometries<commit_after>#
# Copyright 2012-2014 John Whitlock
#
# 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.... | |
252bbb9c2eb4623c46e6ad5c78ce0299c2ba433b | misc/create_test_identifier.py | misc/create_test_identifier.py | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
Creates an identifier in the same scheme as the ID minter.
Useful for creating test IDs.
ABSOLUTELY NOT FOR PRODUCTION USE.
"""
import random
import string
allowed_chars = [
char
for char in (string.ascii_lowercase + string.digits)
if char not in '0oil... | Check in my script for creating test IDs | Check in my script for creating test IDs
[skip ci]
| Python | mit | wellcometrust/platform-api,wellcometrust/platform-api,wellcometrust/platform-api,wellcometrust/platform-api | Check in my script for creating test IDs
[skip ci] | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
Creates an identifier in the same scheme as the ID minter.
Useful for creating test IDs.
ABSOLUTELY NOT FOR PRODUCTION USE.
"""
import random
import string
allowed_chars = [
char
for char in (string.ascii_lowercase + string.digits)
if char not in '0oil... | <commit_before><commit_msg>Check in my script for creating test IDs
[skip ci]<commit_after> | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
Creates an identifier in the same scheme as the ID minter.
Useful for creating test IDs.
ABSOLUTELY NOT FOR PRODUCTION USE.
"""
import random
import string
allowed_chars = [
char
for char in (string.ascii_lowercase + string.digits)
if char not in '0oil... | Check in my script for creating test IDs
[skip ci]#!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
Creates an identifier in the same scheme as the ID minter.
Useful for creating test IDs.
ABSOLUTELY NOT FOR PRODUCTION USE.
"""
import random
import string
allowed_chars = [
char
for char in (string.ascii_... | <commit_before><commit_msg>Check in my script for creating test IDs
[skip ci]<commit_after>#!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
Creates an identifier in the same scheme as the ID minter.
Useful for creating test IDs.
ABSOLUTELY NOT FOR PRODUCTION USE.
"""
import random
import string
allowed_chars = ... | |
fae3703d64c0f4975612ccc1ba7710b47dfec8b9 | tests/test_connection.py | tests/test_connection.py | from django.test import TestCase
from revproxy import connection
class TestOutput(TestCase):
def setUp(self):
self.connection = connection.HTTPConnectionPool.ConnectionCls('example.com')
def test_byte_url(self):
"""Output strings are always byte strings, even using Python 3"""
mock_... | Add tests for output as bytes and testing that the host line is second | Add tests for output as bytes and testing that the host line is second
| Python | mpl-2.0 | TracyWebTech/django-revproxy,TracyWebTech/django-revproxy | Add tests for output as bytes and testing that the host line is second | from django.test import TestCase
from revproxy import connection
class TestOutput(TestCase):
def setUp(self):
self.connection = connection.HTTPConnectionPool.ConnectionCls('example.com')
def test_byte_url(self):
"""Output strings are always byte strings, even using Python 3"""
mock_... | <commit_before><commit_msg>Add tests for output as bytes and testing that the host line is second<commit_after> | from django.test import TestCase
from revproxy import connection
class TestOutput(TestCase):
def setUp(self):
self.connection = connection.HTTPConnectionPool.ConnectionCls('example.com')
def test_byte_url(self):
"""Output strings are always byte strings, even using Python 3"""
mock_... | Add tests for output as bytes and testing that the host line is secondfrom django.test import TestCase
from revproxy import connection
class TestOutput(TestCase):
def setUp(self):
self.connection = connection.HTTPConnectionPool.ConnectionCls('example.com')
def test_byte_url(self):
"""Output... | <commit_before><commit_msg>Add tests for output as bytes and testing that the host line is second<commit_after>from django.test import TestCase
from revproxy import connection
class TestOutput(TestCase):
def setUp(self):
self.connection = connection.HTTPConnectionPool.ConnectionCls('example.com')
d... | |
1856e8102b709176e46c3751bd21234dd5d1eacc | src/nodeconductor_assembly_waldur/packages/tests/unittests/test_admin.py | src/nodeconductor_assembly_waldur/packages/tests/unittests/test_admin.py | from django.test import TestCase
from .. import factories
from ... import admin, models
class TestPackageComponentForm(TestCase):
def test_package_component_form_is_valid_when_component_price_is_0(self):
data = {
'monthly_price': '0',
'amount': '2',
'type': models.Pac... | Add unit tests for package component form | Add unit tests for package component form [WAL-450]
| Python | mit | opennode/waldur-mastermind,opennode/waldur-mastermind,opennode/nodeconductor-assembly-waldur,opennode/waldur-mastermind,opennode/waldur-mastermind,opennode/nodeconductor-assembly-waldur,opennode/nodeconductor-assembly-waldur | Add unit tests for package component form [WAL-450] | from django.test import TestCase
from .. import factories
from ... import admin, models
class TestPackageComponentForm(TestCase):
def test_package_component_form_is_valid_when_component_price_is_0(self):
data = {
'monthly_price': '0',
'amount': '2',
'type': models.Pac... | <commit_before><commit_msg>Add unit tests for package component form [WAL-450]<commit_after> | from django.test import TestCase
from .. import factories
from ... import admin, models
class TestPackageComponentForm(TestCase):
def test_package_component_form_is_valid_when_component_price_is_0(self):
data = {
'monthly_price': '0',
'amount': '2',
'type': models.Pac... | Add unit tests for package component form [WAL-450]from django.test import TestCase
from .. import factories
from ... import admin, models
class TestPackageComponentForm(TestCase):
def test_package_component_form_is_valid_when_component_price_is_0(self):
data = {
'monthly_price': '0',
... | <commit_before><commit_msg>Add unit tests for package component form [WAL-450]<commit_after>from django.test import TestCase
from .. import factories
from ... import admin, models
class TestPackageComponentForm(TestCase):
def test_package_component_form_is_valid_when_component_price_is_0(self):
data = {... | |
9f6673afa14dda9c4d32b3b30bd8e4f1a0489269 | Problem_04_palindrome/problem_4.py | Problem_04_palindrome/problem_4.py | def is_palindrome(number):
reversed_number = 0
n = number
while(n):
reversed_number = reversed_number * 10 + (n % 10)
#print("reversed_number:", reversed_number)
n //= 10
#print("n:", n)
return number == reversed_number
largest_palindrome = -1
for i in range(100, 1000):
#print("i:", i)
... | Solve problem 2 in Python | Solve problem 2 in Python
| Python | mit | sirodoht/project-euler,sirodoht/project-euler,sirodoht/project-euler | Solve problem 2 in Python | def is_palindrome(number):
reversed_number = 0
n = number
while(n):
reversed_number = reversed_number * 10 + (n % 10)
#print("reversed_number:", reversed_number)
n //= 10
#print("n:", n)
return number == reversed_number
largest_palindrome = -1
for i in range(100, 1000):
#print("i:", i)
... | <commit_before><commit_msg>Solve problem 2 in Python<commit_after> | def is_palindrome(number):
reversed_number = 0
n = number
while(n):
reversed_number = reversed_number * 10 + (n % 10)
#print("reversed_number:", reversed_number)
n //= 10
#print("n:", n)
return number == reversed_number
largest_palindrome = -1
for i in range(100, 1000):
#print("i:", i)
... | Solve problem 2 in Pythondef is_palindrome(number):
reversed_number = 0
n = number
while(n):
reversed_number = reversed_number * 10 + (n % 10)
#print("reversed_number:", reversed_number)
n //= 10
#print("n:", n)
return number == reversed_number
largest_palindrome = -1
for i in range(100, 10... | <commit_before><commit_msg>Solve problem 2 in Python<commit_after>def is_palindrome(number):
reversed_number = 0
n = number
while(n):
reversed_number = reversed_number * 10 + (n % 10)
#print("reversed_number:", reversed_number)
n //= 10
#print("n:", n)
return number == reversed_number
large... | |
703de44925dd4fe2d06aa4dcda51b56bad77af2f | test/benchmarks/startup/TestStartupDelays.py | test/benchmarks/startup/TestStartupDelays.py | """Test lldb's startup delays creating a target and setting a breakpoint."""
import os, sys
import unittest2
import lldb
import pexpect
from lldbbench import *
class StartupDelaysBench(BenchBase):
mydir = os.path.join("benchmarks", "startup")
def setUp(self):
BenchBase.setUp(self)
# Create s... | Add a benchmark for measuring start up delays of lldb, including: | Add a benchmark for measuring start up delays of lldb, including:
o create a fresh target; and
o set the first breakpoint
Example (using lldb to set a breakpoint on lldb's Driver::MainLoop function):
./dotest.py -v +b -x '-F Driver::MainLoop()' -p TestStartupDelays.py
...
1: test_startup_delay (TestStartupDelays.S... | Python | apache-2.0 | llvm-mirror/lldb,llvm-mirror/lldb,llvm-mirror/lldb,apple/swift-lldb,apple/swift-lldb,apple/swift-lldb,apple/swift-lldb,apple/swift-lldb,apple/swift-lldb,llvm-mirror/lldb,llvm-mirror/lldb | Add a benchmark for measuring start up delays of lldb, including:
o create a fresh target; and
o set the first breakpoint
Example (using lldb to set a breakpoint on lldb's Driver::MainLoop function):
./dotest.py -v +b -x '-F Driver::MainLoop()' -p TestStartupDelays.py
...
1: test_startup_delay (TestStartupDelays.S... | """Test lldb's startup delays creating a target and setting a breakpoint."""
import os, sys
import unittest2
import lldb
import pexpect
from lldbbench import *
class StartupDelaysBench(BenchBase):
mydir = os.path.join("benchmarks", "startup")
def setUp(self):
BenchBase.setUp(self)
# Create s... | <commit_before><commit_msg>Add a benchmark for measuring start up delays of lldb, including:
o create a fresh target; and
o set the first breakpoint
Example (using lldb to set a breakpoint on lldb's Driver::MainLoop function):
./dotest.py -v +b -x '-F Driver::MainLoop()' -p TestStartupDelays.py
...
1: test_startup... | """Test lldb's startup delays creating a target and setting a breakpoint."""
import os, sys
import unittest2
import lldb
import pexpect
from lldbbench import *
class StartupDelaysBench(BenchBase):
mydir = os.path.join("benchmarks", "startup")
def setUp(self):
BenchBase.setUp(self)
# Create s... | Add a benchmark for measuring start up delays of lldb, including:
o create a fresh target; and
o set the first breakpoint
Example (using lldb to set a breakpoint on lldb's Driver::MainLoop function):
./dotest.py -v +b -x '-F Driver::MainLoop()' -p TestStartupDelays.py
...
1: test_startup_delay (TestStartupDelays.S... | <commit_before><commit_msg>Add a benchmark for measuring start up delays of lldb, including:
o create a fresh target; and
o set the first breakpoint
Example (using lldb to set a breakpoint on lldb's Driver::MainLoop function):
./dotest.py -v +b -x '-F Driver::MainLoop()' -p TestStartupDelays.py
...
1: test_startup... | |
047697aa92f297c5e9c74ef0bd9eb3702b5fce13 | bioagents/dtda/generate_tas_dump.py | bioagents/dtda/generate_tas_dump.py | import os
import pickle
from collections import defaultdict
from indra.sources import tas
from indra.databases import drugbank_client
def normalize_drug(drug):
flags = score_drug(drug)
if 'long_name' in flags:
if 'DRUGBANK' in drug.db_refs:
db_name = \
drugbank_client.get_d... | Add script to reproduce custom TAS dump | Add script to reproduce custom TAS dump
| Python | bsd-2-clause | sorgerlab/bioagents,bgyori/bioagents | Add script to reproduce custom TAS dump | import os
import pickle
from collections import defaultdict
from indra.sources import tas
from indra.databases import drugbank_client
def normalize_drug(drug):
flags = score_drug(drug)
if 'long_name' in flags:
if 'DRUGBANK' in drug.db_refs:
db_name = \
drugbank_client.get_d... | <commit_before><commit_msg>Add script to reproduce custom TAS dump<commit_after> | import os
import pickle
from collections import defaultdict
from indra.sources import tas
from indra.databases import drugbank_client
def normalize_drug(drug):
flags = score_drug(drug)
if 'long_name' in flags:
if 'DRUGBANK' in drug.db_refs:
db_name = \
drugbank_client.get_d... | Add script to reproduce custom TAS dumpimport os
import pickle
from collections import defaultdict
from indra.sources import tas
from indra.databases import drugbank_client
def normalize_drug(drug):
flags = score_drug(drug)
if 'long_name' in flags:
if 'DRUGBANK' in drug.db_refs:
db_name = ... | <commit_before><commit_msg>Add script to reproduce custom TAS dump<commit_after>import os
import pickle
from collections import defaultdict
from indra.sources import tas
from indra.databases import drugbank_client
def normalize_drug(drug):
flags = score_drug(drug)
if 'long_name' in flags:
if 'DRUGBANK... | |
a9af94015d395a674a8ba542b1ba12bc74114f47 | tests/test_stack/test_queue_two_stacks.py | tests/test_stack/test_queue_two_stacks.py | import unittest
from aids.stack.queue_two_stacks import QueueUsingTwoStacks
class QueueTwoStacksTestCase(unittest.TestCase):
'''
Unit tests for the Queue data structure implemented using two stacks
'''
def setUp(self):
self.test_queue = QueueUsingTwoStacks()
def test_queue_initialization(sel... | Add unit tests for queue_two_stacks | Add unit tests for queue_two_stacks
| Python | mit | ueg1990/aids | Add unit tests for queue_two_stacks | import unittest
from aids.stack.queue_two_stacks import QueueUsingTwoStacks
class QueueTwoStacksTestCase(unittest.TestCase):
'''
Unit tests for the Queue data structure implemented using two stacks
'''
def setUp(self):
self.test_queue = QueueUsingTwoStacks()
def test_queue_initialization(sel... | <commit_before><commit_msg>Add unit tests for queue_two_stacks<commit_after> | import unittest
from aids.stack.queue_two_stacks import QueueUsingTwoStacks
class QueueTwoStacksTestCase(unittest.TestCase):
'''
Unit tests for the Queue data structure implemented using two stacks
'''
def setUp(self):
self.test_queue = QueueUsingTwoStacks()
def test_queue_initialization(sel... | Add unit tests for queue_two_stacksimport unittest
from aids.stack.queue_two_stacks import QueueUsingTwoStacks
class QueueTwoStacksTestCase(unittest.TestCase):
'''
Unit tests for the Queue data structure implemented using two stacks
'''
def setUp(self):
self.test_queue = QueueUsingTwoStacks()
... | <commit_before><commit_msg>Add unit tests for queue_two_stacks<commit_after>import unittest
from aids.stack.queue_two_stacks import QueueUsingTwoStacks
class QueueTwoStacksTestCase(unittest.TestCase):
'''
Unit tests for the Queue data structure implemented using two stacks
'''
def setUp(self):
se... | |
6ec81721055c4a236a4e6f3cd4bac3a116aea01a | tests/unit/cloud/clouds/test_qingcloud.py | tests/unit/cloud/clouds/test_qingcloud.py | import copy
from salt.cloud.clouds import qingcloud
from tests.support.mixins import LoaderModuleMockMixin
from tests.support.mock import MagicMock, patch
from tests.support.unit import TestCase
class QingCloudTestCase(TestCase, LoaderModuleMockMixin):
"""
Unit TestCase for salt.cloud.clouds.qingcloud module... | Validate qingcloud defaults to verifying SSL | Validate qingcloud defaults to verifying SSL
| Python | apache-2.0 | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | Validate qingcloud defaults to verifying SSL | import copy
from salt.cloud.clouds import qingcloud
from tests.support.mixins import LoaderModuleMockMixin
from tests.support.mock import MagicMock, patch
from tests.support.unit import TestCase
class QingCloudTestCase(TestCase, LoaderModuleMockMixin):
"""
Unit TestCase for salt.cloud.clouds.qingcloud module... | <commit_before><commit_msg>Validate qingcloud defaults to verifying SSL<commit_after> | import copy
from salt.cloud.clouds import qingcloud
from tests.support.mixins import LoaderModuleMockMixin
from tests.support.mock import MagicMock, patch
from tests.support.unit import TestCase
class QingCloudTestCase(TestCase, LoaderModuleMockMixin):
"""
Unit TestCase for salt.cloud.clouds.qingcloud module... | Validate qingcloud defaults to verifying SSLimport copy
from salt.cloud.clouds import qingcloud
from tests.support.mixins import LoaderModuleMockMixin
from tests.support.mock import MagicMock, patch
from tests.support.unit import TestCase
class QingCloudTestCase(TestCase, LoaderModuleMockMixin):
"""
Unit Tes... | <commit_before><commit_msg>Validate qingcloud defaults to verifying SSL<commit_after>import copy
from salt.cloud.clouds import qingcloud
from tests.support.mixins import LoaderModuleMockMixin
from tests.support.mock import MagicMock, patch
from tests.support.unit import TestCase
class QingCloudTestCase(TestCase, Loa... | |
da722b889a2b637bf3895f9f0c5e614deee7e45f | scripts/util/add_clifiles.py | scripts/util/add_clifiles.py | """Utility script that copies neighboring clifiles when it is discovered
that we need new ones!"""
import psycopg2
import os
import sys
import shutil
def missing_logic(fn):
"""Figure out what to do when this filename is missing"""
print("Searching for replacement for '%s'" % (fn,))
lon = float(fn[17:23])
... | Add utility for copying clifiles when new points are needed. | Add utility for copying clifiles when new points are needed. | Python | mit | akrherz/idep,akrherz/idep,akrherz/dep,akrherz/dep,akrherz/dep,akrherz/idep,akrherz/dep,akrherz/dep,akrherz/idep,akrherz/idep,akrherz/idep | Add utility for copying clifiles when new points are needed. | """Utility script that copies neighboring clifiles when it is discovered
that we need new ones!"""
import psycopg2
import os
import sys
import shutil
def missing_logic(fn):
"""Figure out what to do when this filename is missing"""
print("Searching for replacement for '%s'" % (fn,))
lon = float(fn[17:23])
... | <commit_before><commit_msg>Add utility for copying clifiles when new points are needed.<commit_after> | """Utility script that copies neighboring clifiles when it is discovered
that we need new ones!"""
import psycopg2
import os
import sys
import shutil
def missing_logic(fn):
"""Figure out what to do when this filename is missing"""
print("Searching for replacement for '%s'" % (fn,))
lon = float(fn[17:23])
... | Add utility for copying clifiles when new points are needed."""Utility script that copies neighboring clifiles when it is discovered
that we need new ones!"""
import psycopg2
import os
import sys
import shutil
def missing_logic(fn):
"""Figure out what to do when this filename is missing"""
print("Searching fo... | <commit_before><commit_msg>Add utility for copying clifiles when new points are needed.<commit_after>"""Utility script that copies neighboring clifiles when it is discovered
that we need new ones!"""
import psycopg2
import os
import sys
import shutil
def missing_logic(fn):
"""Figure out what to do when this filen... | |
1e363121f66d0ef01de6ff83b3dd9167df4d146f | tests/RemovingUnitRules/__init__.py | tests/RemovingUnitRules/__init__.py | #!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 24.08.2017 11:32
:Licence GNUv3
Part of grammpy-transforms
""" | Add directory for tests of removing unit rules | Add directory for tests of removing unit rules
| Python | mit | PatrikValkovic/grammpy | Add directory for tests of removing unit rules | #!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 24.08.2017 11:32
:Licence GNUv3
Part of grammpy-transforms
""" | <commit_before><commit_msg>Add directory for tests of removing unit rules<commit_after> | #!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 24.08.2017 11:32
:Licence GNUv3
Part of grammpy-transforms
""" | Add directory for tests of removing unit rules#!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 24.08.2017 11:32
:Licence GNUv3
Part of grammpy-transforms
""" | <commit_before><commit_msg>Add directory for tests of removing unit rules<commit_after>#!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 24.08.2017 11:32
:Licence GNUv3
Part of grammpy-transforms
""" | |
e44e50d16726b8517d497f50a276a9851be7fcf0 | tests/cmd/test_manage.py | tests/cmd/test_manage.py | # Copyright 2013: 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 b... | Add missing tests for rally/cmd/manage.py | Add missing tests for rally/cmd/manage.py
Change-Id: Id0e6659b957a346ab7d9aed4ff295e61f7eed515
| Python | apache-2.0 | cernops/rally,eonpatapon/rally,yeming233/rally,ytsarev/rally,paboldin/rally,vefimova/rally,gluke77/rally,group-policy/rally,aforalee/RRally,yeming233/rally,cernops/rally,varunarya10/rally,go-bears/rally,aplanas/rally,shdowofdeath/rally,vefimova/rally,amit0701/rally,vponomaryov/rally,openstack/rally,group-policy/rally,g... | Add missing tests for rally/cmd/manage.py
Change-Id: Id0e6659b957a346ab7d9aed4ff295e61f7eed515 | # Copyright 2013: 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 b... | <commit_before><commit_msg>Add missing tests for rally/cmd/manage.py
Change-Id: Id0e6659b957a346ab7d9aed4ff295e61f7eed515<commit_after> | # Copyright 2013: 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 b... | Add missing tests for rally/cmd/manage.py
Change-Id: Id0e6659b957a346ab7d9aed4ff295e61f7eed515# Copyright 2013: 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... | <commit_before><commit_msg>Add missing tests for rally/cmd/manage.py
Change-Id: Id0e6659b957a346ab7d9aed4ff295e61f7eed515<commit_after># Copyright 2013: 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 t... | |
95a53e362eac0b42e9f77bf9dba2b43a71b95e6d | vertex/repositories/__init__.py | vertex/repositories/__init__.py | from grapher import commons, errors
from grapher.repositories.base import EntityRepository
class CachedRepository(EntityRepository):
data = {}
def where(self, skip=0, limit=None, **query):
return []
def create(self, entities):
result = []
for entity in entities:
self... | Remove commons.request. Tests are now mocking flask_restful.request module. | Remove commons.request.
Tests are now mocking flask_restful.request module.
| Python | mit | lucasdavid/vertex | Remove commons.request.
Tests are now mocking flask_restful.request module. | from grapher import commons, errors
from grapher.repositories.base import EntityRepository
class CachedRepository(EntityRepository):
data = {}
def where(self, skip=0, limit=None, **query):
return []
def create(self, entities):
result = []
for entity in entities:
self... | <commit_before><commit_msg> Remove commons.request.
Tests are now mocking flask_restful.request module.<commit_after> | from grapher import commons, errors
from grapher.repositories.base import EntityRepository
class CachedRepository(EntityRepository):
data = {}
def where(self, skip=0, limit=None, **query):
return []
def create(self, entities):
result = []
for entity in entities:
self... | Remove commons.request.
Tests are now mocking flask_restful.request module.from grapher import commons, errors
from grapher.repositories.base import EntityRepository
class CachedRepository(EntityRepository):
data = {}
def where(self, skip=0, limit=None, **query):
return []
def create(self, ent... | <commit_before><commit_msg> Remove commons.request.
Tests are now mocking flask_restful.request module.<commit_after>from grapher import commons, errors
from grapher.repositories.base import EntityRepository
class CachedRepository(EntityRepository):
data = {}
def where(self, skip=0, limit=None, **query):
... | |
783165571d6fe5b0e655e8c2a4cf7a77e74b3ea1 | wger/manager/migrations/0007_auto_20160311_2258.py | wger/manager/migrations/0007_auto_20160311_2258.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
def convert_logs(apps, schema_editor):
'''
Adds a unit to users who have imperial units in the profile
'''
WorkoutLog = apps.get_model('manager', 'WorkoutLog')
UserProfile = apps.get_model('c... | Add data migration for settings and logs | Add data migration for settings and logs
| Python | agpl-3.0 | wger-project/wger,petervanderdoes/wger,petervanderdoes/wger,kjagoo/wger_stark,DeveloperMal/wger,DeveloperMal/wger,wger-project/wger,rolandgeider/wger,kjagoo/wger_stark,kjagoo/wger_stark,rolandgeider/wger,rolandgeider/wger,DeveloperMal/wger,DeveloperMal/wger,rolandgeider/wger,kjagoo/wger_stark,petervanderdoes/wger,wger-... | Add data migration for settings and logs | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
def convert_logs(apps, schema_editor):
'''
Adds a unit to users who have imperial units in the profile
'''
WorkoutLog = apps.get_model('manager', 'WorkoutLog')
UserProfile = apps.get_model('c... | <commit_before><commit_msg>Add data migration for settings and logs<commit_after> | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
def convert_logs(apps, schema_editor):
'''
Adds a unit to users who have imperial units in the profile
'''
WorkoutLog = apps.get_model('manager', 'WorkoutLog')
UserProfile = apps.get_model('c... | Add data migration for settings and logs# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
def convert_logs(apps, schema_editor):
'''
Adds a unit to users who have imperial units in the profile
'''
WorkoutLog = apps.get_model('manager', 'WorkoutL... | <commit_before><commit_msg>Add data migration for settings and logs<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
def convert_logs(apps, schema_editor):
'''
Adds a unit to users who have imperial units in the profile
'''
Workout... | |
206547027c6390664e498b6c5e00e48aa07a198c | libnamebench/config_test.py | libnamebench/config_test.py | #!/usr/bin/env python
# Copyright 2009 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... | Add some tests for dns config parsing | Add some tests for dns config parsing | Python | apache-2.0 | somehume/namebench | Add some tests for dns config parsing | #!/usr/bin/env python
# Copyright 2009 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... | <commit_before><commit_msg>Add some tests for dns config parsing<commit_after> | #!/usr/bin/env python
# Copyright 2009 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... | Add some tests for dns config parsing#!/usr/bin/env python
# Copyright 2009 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/lic... | <commit_before><commit_msg>Add some tests for dns config parsing<commit_after>#!/usr/bin/env python
# Copyright 2009 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the Lice... | |
a1ef84da0df661a9371df23a623daf2b51304e89 | scripts/domain/effects.py | scripts/domain/effects.py |
class Effects:
def attack(self, player, dices):
pass
def defend(self, player, dmg, dodge):
pass
def dispute(self, player, attrName):
pass
| Add first version of the Effects base class | Add first version of the Effects base class
| Python | mit | VinGarcia/jit-rpg-system | Add first version of the Effects base class |
class Effects:
def attack(self, player, dices):
pass
def defend(self, player, dmg, dodge):
pass
def dispute(self, player, attrName):
pass
| <commit_before><commit_msg>Add first version of the Effects base class<commit_after> |
class Effects:
def attack(self, player, dices):
pass
def defend(self, player, dmg, dodge):
pass
def dispute(self, player, attrName):
pass
| Add first version of the Effects base class
class Effects:
def attack(self, player, dices):
pass
def defend(self, player, dmg, dodge):
pass
def dispute(self, player, attrName):
pass
| <commit_before><commit_msg>Add first version of the Effects base class<commit_after>
class Effects:
def attack(self, player, dices):
pass
def defend(self, player, dmg, dodge):
pass
def dispute(self, player, attrName):
pass
| |
3b467abc665a1807d8a1adbba1be78d40f77b4ce | tests/unit/dataactcore/factories/job.py | tests/unit/dataactcore/factories/job.py | import factory
from factory import fuzzy
from datetime import date, datetime, timezone
from dataactcore.models import jobModels
class SubmissionFactory(factory.Factory):
class Meta:
model = jobModels.Submission
submission_id = None
datetime_utc = fuzzy.FuzzyDateTime(
datetime(2010, 1, 1... | Add factory for Submission model | Add factory for Submission model
| Python | cc0-1.0 | chambers-brian/SIG_Digital-Strategy_SI_ODP_Backend,fedspendingtransparency/data-act-broker-backend,fedspendingtransparency/data-act-broker-backend,chambers-brian/SIG_Digital-Strategy_SI_ODP_Backend | Add factory for Submission model | import factory
from factory import fuzzy
from datetime import date, datetime, timezone
from dataactcore.models import jobModels
class SubmissionFactory(factory.Factory):
class Meta:
model = jobModels.Submission
submission_id = None
datetime_utc = fuzzy.FuzzyDateTime(
datetime(2010, 1, 1... | <commit_before><commit_msg>Add factory for Submission model<commit_after> | import factory
from factory import fuzzy
from datetime import date, datetime, timezone
from dataactcore.models import jobModels
class SubmissionFactory(factory.Factory):
class Meta:
model = jobModels.Submission
submission_id = None
datetime_utc = fuzzy.FuzzyDateTime(
datetime(2010, 1, 1... | Add factory for Submission modelimport factory
from factory import fuzzy
from datetime import date, datetime, timezone
from dataactcore.models import jobModels
class SubmissionFactory(factory.Factory):
class Meta:
model = jobModels.Submission
submission_id = None
datetime_utc = fuzzy.FuzzyDateT... | <commit_before><commit_msg>Add factory for Submission model<commit_after>import factory
from factory import fuzzy
from datetime import date, datetime, timezone
from dataactcore.models import jobModels
class SubmissionFactory(factory.Factory):
class Meta:
model = jobModels.Submission
submission_id =... | |
ffb1a660401d12eccb31787becc9c7ca45edaedc | algorithms/distances/euclidean_distance.py | algorithms/distances/euclidean_distance.py | from math import sqrt
from .distance_abstract import DistanceAbstract
class EuclideanDistance(DistanceAbstract):
def measure(cls, list1, list2):
distance = 0
min_len = min(len(list1), len(list2))
for i in range(0, min_len):
distance += sqrt(abs(list1[i]**2 - list2[i]**2))
... | Add support for Euclidean distance | Add support for Euclidean distance
| Python | mit | theowni/Keyboard-Typing-User-Recognition | Add support for Euclidean distance | from math import sqrt
from .distance_abstract import DistanceAbstract
class EuclideanDistance(DistanceAbstract):
def measure(cls, list1, list2):
distance = 0
min_len = min(len(list1), len(list2))
for i in range(0, min_len):
distance += sqrt(abs(list1[i]**2 - list2[i]**2))
... | <commit_before><commit_msg>Add support for Euclidean distance<commit_after> | from math import sqrt
from .distance_abstract import DistanceAbstract
class EuclideanDistance(DistanceAbstract):
def measure(cls, list1, list2):
distance = 0
min_len = min(len(list1), len(list2))
for i in range(0, min_len):
distance += sqrt(abs(list1[i]**2 - list2[i]**2))
... | Add support for Euclidean distancefrom math import sqrt
from .distance_abstract import DistanceAbstract
class EuclideanDistance(DistanceAbstract):
def measure(cls, list1, list2):
distance = 0
min_len = min(len(list1), len(list2))
for i in range(0, min_len):
distance += sqrt(ab... | <commit_before><commit_msg>Add support for Euclidean distance<commit_after>from math import sqrt
from .distance_abstract import DistanceAbstract
class EuclideanDistance(DistanceAbstract):
def measure(cls, list1, list2):
distance = 0
min_len = min(len(list1), len(list2))
for i in range(0, ... | |
ef7406a0ba6d87311c55bd0422bb2a411a51043a | vectorExtractorWithTuples.py | vectorExtractorWithTuples.py | import string
import sklearn
import numpy as np
from titleParse import *
import os
from sklearn import svm
import re
from featureHelpers.py import *
#testStringList = getTitles("test_data" + os.sep + "merged.txt")
#testStringList = getTitles("test.txt")
"""This is a function designed to extract an attribute vector out... | Revert "Got rid of tuples" | Revert "Got rid of tuples"
This reverts commit 958ab35bcf408502f1347db5720241c489de8260.
| Python | apache-2.0 | bharadwajramachandran/TartanRoof | Revert "Got rid of tuples"
This reverts commit 958ab35bcf408502f1347db5720241c489de8260. | import string
import sklearn
import numpy as np
from titleParse import *
import os
from sklearn import svm
import re
from featureHelpers.py import *
#testStringList = getTitles("test_data" + os.sep + "merged.txt")
#testStringList = getTitles("test.txt")
"""This is a function designed to extract an attribute vector out... | <commit_before><commit_msg>Revert "Got rid of tuples"
This reverts commit 958ab35bcf408502f1347db5720241c489de8260.<commit_after> | import string
import sklearn
import numpy as np
from titleParse import *
import os
from sklearn import svm
import re
from featureHelpers.py import *
#testStringList = getTitles("test_data" + os.sep + "merged.txt")
#testStringList = getTitles("test.txt")
"""This is a function designed to extract an attribute vector out... | Revert "Got rid of tuples"
This reverts commit 958ab35bcf408502f1347db5720241c489de8260.import string
import sklearn
import numpy as np
from titleParse import *
import os
from sklearn import svm
import re
from featureHelpers.py import *
#testStringList = getTitles("test_data" + os.sep + "merged.txt")
#testStringList ... | <commit_before><commit_msg>Revert "Got rid of tuples"
This reverts commit 958ab35bcf408502f1347db5720241c489de8260.<commit_after>import string
import sklearn
import numpy as np
from titleParse import *
import os
from sklearn import svm
import re
from featureHelpers.py import *
#testStringList = getTitles("test_data" ... | |
09a2975b8940a2726620ffff95950ecdad3ca884 | pykmer/codec16.py | pykmer/codec16.py |
def encode(x):
"encode an integer using a 15-bit+continuation-bit encodeing"
r = []
while True:
r.append(x & 32767)
x >>= 15
if x == 0:
break
r = r[::-1]
n = len(r) - 1
i = 0
while i < n:
r[i] |= 32768
i += 1
return r
def encodeInto(x... | Add a 15/1 bit codec. | Add a 15/1 bit codec.
| Python | apache-2.0 | drtconway/pykmer | Add a 15/1 bit codec. |
def encode(x):
"encode an integer using a 15-bit+continuation-bit encodeing"
r = []
while True:
r.append(x & 32767)
x >>= 15
if x == 0:
break
r = r[::-1]
n = len(r) - 1
i = 0
while i < n:
r[i] |= 32768
i += 1
return r
def encodeInto(x... | <commit_before><commit_msg>Add a 15/1 bit codec.<commit_after> |
def encode(x):
"encode an integer using a 15-bit+continuation-bit encodeing"
r = []
while True:
r.append(x & 32767)
x >>= 15
if x == 0:
break
r = r[::-1]
n = len(r) - 1
i = 0
while i < n:
r[i] |= 32768
i += 1
return r
def encodeInto(x... | Add a 15/1 bit codec.
def encode(x):
"encode an integer using a 15-bit+continuation-bit encodeing"
r = []
while True:
r.append(x & 32767)
x >>= 15
if x == 0:
break
r = r[::-1]
n = len(r) - 1
i = 0
while i < n:
r[i] |= 32768
i += 1
retur... | <commit_before><commit_msg>Add a 15/1 bit codec.<commit_after>
def encode(x):
"encode an integer using a 15-bit+continuation-bit encodeing"
r = []
while True:
r.append(x & 32767)
x >>= 15
if x == 0:
break
r = r[::-1]
n = len(r) - 1
i = 0
while i < n:
... | |
a834d778e4ec72beb26ebc458bfc3975217fcf7b | scripts/mc_rtp_launch_record.py | scripts/mc_rtp_launch_record.py | #!/usr/bin/env python
# -*- mode: python; coding: utf-8 -*-
# Copyright 2021 The HERA Collaboration
# Licensed under the 2-clause BSD license.
import numpy as np
from astropy.time import Time
from pyuvdata import UVData
from hera_mc import mc
from hera_mc.rtp import RTPLaunchRecord
ap = mc.get_mc_argument_parser()
... | Add script for adding/updating RTP launch records | Add script for adding/updating RTP launch records
| Python | bsd-2-clause | HERA-Team/hera_mc,HERA-Team/hera_mc | Add script for adding/updating RTP launch records | #!/usr/bin/env python
# -*- mode: python; coding: utf-8 -*-
# Copyright 2021 The HERA Collaboration
# Licensed under the 2-clause BSD license.
import numpy as np
from astropy.time import Time
from pyuvdata import UVData
from hera_mc import mc
from hera_mc.rtp import RTPLaunchRecord
ap = mc.get_mc_argument_parser()
... | <commit_before><commit_msg>Add script for adding/updating RTP launch records<commit_after> | #!/usr/bin/env python
# -*- mode: python; coding: utf-8 -*-
# Copyright 2021 The HERA Collaboration
# Licensed under the 2-clause BSD license.
import numpy as np
from astropy.time import Time
from pyuvdata import UVData
from hera_mc import mc
from hera_mc.rtp import RTPLaunchRecord
ap = mc.get_mc_argument_parser()
... | Add script for adding/updating RTP launch records#!/usr/bin/env python
# -*- mode: python; coding: utf-8 -*-
# Copyright 2021 The HERA Collaboration
# Licensed under the 2-clause BSD license.
import numpy as np
from astropy.time import Time
from pyuvdata import UVData
from hera_mc import mc
from hera_mc.rtp import R... | <commit_before><commit_msg>Add script for adding/updating RTP launch records<commit_after>#!/usr/bin/env python
# -*- mode: python; coding: utf-8 -*-
# Copyright 2021 The HERA Collaboration
# Licensed under the 2-clause BSD license.
import numpy as np
from astropy.time import Time
from pyuvdata import UVData
from he... | |
61bcf2e6c47e0ade839d2712edc0e499d17bb552 | tests/helpers.py | tests/helpers.py | # vim: fileencoding=utf-8 et sw=4 ts=4 tw=80:
# python-quilt - A Python implementation of the quilt patch system
#
# Copyright (C) 2012 Björn Ricks <bjoern.ricks@googlemail.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as ... | Add helper module for tests | Add helper module for tests
Currently the module contains a base class for all quilt tests.
| Python | mit | vadmium/python-quilt,bjoernricks/python-quilt | Add helper module for tests
Currently the module contains a base class for all quilt tests. | # vim: fileencoding=utf-8 et sw=4 ts=4 tw=80:
# python-quilt - A Python implementation of the quilt patch system
#
# Copyright (C) 2012 Björn Ricks <bjoern.ricks@googlemail.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as ... | <commit_before><commit_msg>Add helper module for tests
Currently the module contains a base class for all quilt tests.<commit_after> | # vim: fileencoding=utf-8 et sw=4 ts=4 tw=80:
# python-quilt - A Python implementation of the quilt patch system
#
# Copyright (C) 2012 Björn Ricks <bjoern.ricks@googlemail.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as ... | Add helper module for tests
Currently the module contains a base class for all quilt tests.# vim: fileencoding=utf-8 et sw=4 ts=4 tw=80:
# python-quilt - A Python implementation of the quilt patch system
#
# Copyright (C) 2012 Björn Ricks <bjoern.ricks@googlemail.com>
#
# This library is free software; you can redis... | <commit_before><commit_msg>Add helper module for tests
Currently the module contains a base class for all quilt tests.<commit_after># vim: fileencoding=utf-8 et sw=4 ts=4 tw=80:
# python-quilt - A Python implementation of the quilt patch system
#
# Copyright (C) 2012 Björn Ricks <bjoern.ricks@googlemail.com>
#
# Thi... | |
0774aa1c1bf64c39d3f456c6e85fc85403219f7f | examples/multiple_windows.py | examples/multiple_windows.py | import webview
import threading
"""
This example demonstrates how to create and manage multiple windows
"""
def create_new_window():
# Create new window and store its uid
child_window = webview.create_window("Window #2", width=800, height=400)
# Load content into both windows
webview.load_html('<h1>M... | Add a simple multiple-window example | [All] Add a simple multiple-window example
| Python | bsd-3-clause | shivaprsdv/pywebview,r0x0r/pywebview,r0x0r/pywebview,r0x0r/pywebview,shivaprsdv/pywebview,r0x0r/pywebview,shivaprsdv/pywebview,shivaprsdv/pywebview,r0x0r/pywebview | [All] Add a simple multiple-window example | import webview
import threading
"""
This example demonstrates how to create and manage multiple windows
"""
def create_new_window():
# Create new window and store its uid
child_window = webview.create_window("Window #2", width=800, height=400)
# Load content into both windows
webview.load_html('<h1>M... | <commit_before><commit_msg>[All] Add a simple multiple-window example<commit_after> | import webview
import threading
"""
This example demonstrates how to create and manage multiple windows
"""
def create_new_window():
# Create new window and store its uid
child_window = webview.create_window("Window #2", width=800, height=400)
# Load content into both windows
webview.load_html('<h1>M... | [All] Add a simple multiple-window exampleimport webview
import threading
"""
This example demonstrates how to create and manage multiple windows
"""
def create_new_window():
# Create new window and store its uid
child_window = webview.create_window("Window #2", width=800, height=400)
# Load content into... | <commit_before><commit_msg>[All] Add a simple multiple-window example<commit_after>import webview
import threading
"""
This example demonstrates how to create and manage multiple windows
"""
def create_new_window():
# Create new window and store its uid
child_window = webview.create_window("Window #2", width=... | |
d58505e13edce70a34d4058dce4387d9ca43c911 | bench/pact-suite/uts/uts_calc.py | bench/pact-suite/uts/uts_calc.py |
# Estimate number of nodes for geometric uts with linear shape
b_0 = 4.0
gen_mx = 22
# level is from 0 onwards
def level_nodes(level):
branch_factors = [ b_0 * ( 1.0 - i / float(gen_mx)) for i in range(level + 1) ]
return reduce(lambda x, y: x*y, branch_factors)
print "b_0: %f gen_mx %d" % (b_0, gen_mx)
total ... | Add calculator for uts tree size | Add calculator for uts tree size
git-svn-id: 0c5512015aa96f7d3f5c3ad598bd98edc52008b1@12008 dc4e9af1-7f46-4ead-bba6-71afc04862de
| Python | apache-2.0 | swift-lang/swift-t,blue42u/swift-t,JohnPJenkins/swift-t,JohnPJenkins/swift-t,blue42u/swift-t,blue42u/swift-t,swift-lang/swift-t,JohnPJenkins/swift-t,swift-lang/swift-t,swift-lang/swift-t,JohnPJenkins/swift-t,JohnPJenkins/swift-t,basheersubei/swift-t,basheersubei/swift-t,basheersubei/swift-t,swift-lang/swift-t,JohnPJenk... | Add calculator for uts tree size
git-svn-id: 0c5512015aa96f7d3f5c3ad598bd98edc52008b1@12008 dc4e9af1-7f46-4ead-bba6-71afc04862de |
# Estimate number of nodes for geometric uts with linear shape
b_0 = 4.0
gen_mx = 22
# level is from 0 onwards
def level_nodes(level):
branch_factors = [ b_0 * ( 1.0 - i / float(gen_mx)) for i in range(level + 1) ]
return reduce(lambda x, y: x*y, branch_factors)
print "b_0: %f gen_mx %d" % (b_0, gen_mx)
total ... | <commit_before><commit_msg>Add calculator for uts tree size
git-svn-id: 0c5512015aa96f7d3f5c3ad598bd98edc52008b1@12008 dc4e9af1-7f46-4ead-bba6-71afc04862de<commit_after> |
# Estimate number of nodes for geometric uts with linear shape
b_0 = 4.0
gen_mx = 22
# level is from 0 onwards
def level_nodes(level):
branch_factors = [ b_0 * ( 1.0 - i / float(gen_mx)) for i in range(level + 1) ]
return reduce(lambda x, y: x*y, branch_factors)
print "b_0: %f gen_mx %d" % (b_0, gen_mx)
total ... | Add calculator for uts tree size
git-svn-id: 0c5512015aa96f7d3f5c3ad598bd98edc52008b1@12008 dc4e9af1-7f46-4ead-bba6-71afc04862de
# Estimate number of nodes for geometric uts with linear shape
b_0 = 4.0
gen_mx = 22
# level is from 0 onwards
def level_nodes(level):
branch_factors = [ b_0 * ( 1.0 - i / float(gen_mx))... | <commit_before><commit_msg>Add calculator for uts tree size
git-svn-id: 0c5512015aa96f7d3f5c3ad598bd98edc52008b1@12008 dc4e9af1-7f46-4ead-bba6-71afc04862de<commit_after>
# Estimate number of nodes for geometric uts with linear shape
b_0 = 4.0
gen_mx = 22
# level is from 0 onwards
def level_nodes(level):
branch_fac... | |
d4443b05fbd48ca89d03942ef30bed1769948366 | contrib_bots/bots/thesaurus/test_thesaurus.py | contrib_bots/bots/thesaurus/test_thesaurus.py | #!/usr/bin/env python
from __future__ import absolute_import
from __future__ import print_function
import os
import sys
our_dir = os.path.dirname(os.path.abspath(__file__))
# For dev setups, we can find the API in the repo itself.
if os.path.exists(os.path.join(our_dir, '..')):
sys.path.insert(0, '..')
from bots... | Add tests for thesaurus bot in contrib_bots. | testsuite: Add tests for thesaurus bot in contrib_bots.
Add test file 'test_thesaurus.py'.
| Python | apache-2.0 | jackrzhang/zulip,punchagan/zulip,eeshangarg/zulip,brockwhittaker/zulip,zulip/zulip,amanharitsh123/zulip,brainwane/zulip,hackerkid/zulip,mahim97/zulip,showell/zulip,amanharitsh123/zulip,timabbott/zulip,verma-varsha/zulip,shubhamdhama/zulip,vaidap/zulip,shubhamdhama/zulip,mahim97/zulip,zulip/zulip,mahim97/zulip,dhcrzf/zu... | testsuite: Add tests for thesaurus bot in contrib_bots.
Add test file 'test_thesaurus.py'. | #!/usr/bin/env python
from __future__ import absolute_import
from __future__ import print_function
import os
import sys
our_dir = os.path.dirname(os.path.abspath(__file__))
# For dev setups, we can find the API in the repo itself.
if os.path.exists(os.path.join(our_dir, '..')):
sys.path.insert(0, '..')
from bots... | <commit_before><commit_msg>testsuite: Add tests for thesaurus bot in contrib_bots.
Add test file 'test_thesaurus.py'.<commit_after> | #!/usr/bin/env python
from __future__ import absolute_import
from __future__ import print_function
import os
import sys
our_dir = os.path.dirname(os.path.abspath(__file__))
# For dev setups, we can find the API in the repo itself.
if os.path.exists(os.path.join(our_dir, '..')):
sys.path.insert(0, '..')
from bots... | testsuite: Add tests for thesaurus bot in contrib_bots.
Add test file 'test_thesaurus.py'.#!/usr/bin/env python
from __future__ import absolute_import
from __future__ import print_function
import os
import sys
our_dir = os.path.dirname(os.path.abspath(__file__))
# For dev setups, we can find the API in the repo its... | <commit_before><commit_msg>testsuite: Add tests for thesaurus bot in contrib_bots.
Add test file 'test_thesaurus.py'.<commit_after>#!/usr/bin/env python
from __future__ import absolute_import
from __future__ import print_function
import os
import sys
our_dir = os.path.dirname(os.path.abspath(__file__))
# For dev se... | |
25c215df5550e34de21bfde7416ed43286d70ef2 | core/migrations/0049_providerconfiguration.py | core/migrations/0049_providerconfiguration.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
def create_provider_configuration(apps, schema_editor):
Provider = apps.get_model("core", "Provider")
ProviderConfiguration = apps.get_model("core", "ProviderConfiguration")
providers = Provider.object... | Add 0049 - ProviderConfiguration migration+RunPython | Add 0049 - ProviderConfiguration migration+RunPython
| Python | apache-2.0 | CCI-MOC/GUI-Backend,CCI-MOC/GUI-Backend,CCI-MOC/GUI-Backend,CCI-MOC/GUI-Backend | Add 0049 - ProviderConfiguration migration+RunPython | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
def create_provider_configuration(apps, schema_editor):
Provider = apps.get_model("core", "Provider")
ProviderConfiguration = apps.get_model("core", "ProviderConfiguration")
providers = Provider.object... | <commit_before><commit_msg>Add 0049 - ProviderConfiguration migration+RunPython<commit_after> | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
def create_provider_configuration(apps, schema_editor):
Provider = apps.get_model("core", "Provider")
ProviderConfiguration = apps.get_model("core", "ProviderConfiguration")
providers = Provider.object... | Add 0049 - ProviderConfiguration migration+RunPython# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
def create_provider_configuration(apps, schema_editor):
Provider = apps.get_model("core", "Provider")
ProviderConfiguration = apps.get_model("core", "Pro... | <commit_before><commit_msg>Add 0049 - ProviderConfiguration migration+RunPython<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
def create_provider_configuration(apps, schema_editor):
Provider = apps.get_model("core", "Provider")
ProviderCo... | |
387873ef2a953f89d7b98cade3a87b1339ff9ca6 | scripts/external_test_allocation.py | scripts/external_test_allocation.py | #!/usr/bin/env python
from django import setup
setup()
from service.monitoring import get_allocation_result_for
from core.models import Identity, Instance, AtmosphereUser
from django.utils.timezone import timedelta, datetime
import pytz, sys
from dateutil.parser import parse
if len(sys.argv) < 3:
print "Invalid # ... | Add a script to call for allocation result externally | Add a script to call for allocation result externally
| Python | apache-2.0 | CCI-MOC/GUI-Backend,CCI-MOC/GUI-Backend,CCI-MOC/GUI-Backend,CCI-MOC/GUI-Backend | Add a script to call for allocation result externally | #!/usr/bin/env python
from django import setup
setup()
from service.monitoring import get_allocation_result_for
from core.models import Identity, Instance, AtmosphereUser
from django.utils.timezone import timedelta, datetime
import pytz, sys
from dateutil.parser import parse
if len(sys.argv) < 3:
print "Invalid # ... | <commit_before><commit_msg>Add a script to call for allocation result externally<commit_after> | #!/usr/bin/env python
from django import setup
setup()
from service.monitoring import get_allocation_result_for
from core.models import Identity, Instance, AtmosphereUser
from django.utils.timezone import timedelta, datetime
import pytz, sys
from dateutil.parser import parse
if len(sys.argv) < 3:
print "Invalid # ... | Add a script to call for allocation result externally#!/usr/bin/env python
from django import setup
setup()
from service.monitoring import get_allocation_result_for
from core.models import Identity, Instance, AtmosphereUser
from django.utils.timezone import timedelta, datetime
import pytz, sys
from dateutil.parser impo... | <commit_before><commit_msg>Add a script to call for allocation result externally<commit_after>#!/usr/bin/env python
from django import setup
setup()
from service.monitoring import get_allocation_result_for
from core.models import Identity, Instance, AtmosphereUser
from django.utils.timezone import timedelta, datetime
i... | |
45d7a6ed3a68793585b24474753cec2a01fc6c03 | Largest_Palindrome_Product.py | Largest_Palindrome_Product.py | # Find the largest palindrome made from the product of two n-digit numbers.
# Since the result could be very large, you should return the largest palindrome mod 1337.
# Example:
# Input: 2
# Output: 987
# Explanation: 99 x 91 = 9009, 9009 % 1337 = 987
# Note:
# The range of n is [1,8].
def largestPalindrome(n):
"... | Solve Largest Palindrome Product with brute force (Time Limit Exceeded) | Solve Largest Palindrome Product with brute force (Time Limit Exceeded)
| Python | mit | Kunal57/Python_Algorithms | Solve Largest Palindrome Product with brute force (Time Limit Exceeded) | # Find the largest palindrome made from the product of two n-digit numbers.
# Since the result could be very large, you should return the largest palindrome mod 1337.
# Example:
# Input: 2
# Output: 987
# Explanation: 99 x 91 = 9009, 9009 % 1337 = 987
# Note:
# The range of n is [1,8].
def largestPalindrome(n):
"... | <commit_before><commit_msg>Solve Largest Palindrome Product with brute force (Time Limit Exceeded)<commit_after> | # Find the largest palindrome made from the product of two n-digit numbers.
# Since the result could be very large, you should return the largest palindrome mod 1337.
# Example:
# Input: 2
# Output: 987
# Explanation: 99 x 91 = 9009, 9009 % 1337 = 987
# Note:
# The range of n is [1,8].
def largestPalindrome(n):
"... | Solve Largest Palindrome Product with brute force (Time Limit Exceeded)# Find the largest palindrome made from the product of two n-digit numbers.
# Since the result could be very large, you should return the largest palindrome mod 1337.
# Example:
# Input: 2
# Output: 987
# Explanation: 99 x 91 = 9009, 9009 % 1337 =... | <commit_before><commit_msg>Solve Largest Palindrome Product with brute force (Time Limit Exceeded)<commit_after># Find the largest palindrome made from the product of two n-digit numbers.
# Since the result could be very large, you should return the largest palindrome mod 1337.
# Example:
# Input: 2
# Output: 987
# E... | |
c5e0fe1845f2f503f59279305c3a41e1d6b70aa8 | localore/people/migrations/0010_auto_20160516_1123.py | localore/people/migrations/0010_auto_20160516_1123.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('people', '0009_auto_20160408_1535'),
]
operations = [
migrations.AlterModelOptions(
name='person',
o... | Add missed migration for 12d09f5. | Add missed migration for 12d09f5.
| Python | mpl-2.0 | ghostwords/localore,ghostwords/localore,ghostwords/localore | Add missed migration for 12d09f5. | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('people', '0009_auto_20160408_1535'),
]
operations = [
migrations.AlterModelOptions(
name='person',
o... | <commit_before><commit_msg>Add missed migration for 12d09f5.<commit_after> | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('people', '0009_auto_20160408_1535'),
]
operations = [
migrations.AlterModelOptions(
name='person',
o... | Add missed migration for 12d09f5.# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('people', '0009_auto_20160408_1535'),
]
operations = [
migrations.AlterModelOptions(
... | <commit_before><commit_msg>Add missed migration for 12d09f5.<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('people', '0009_auto_20160408_1535'),
]
operations = [
... | |
d67d5fc6de19f2a1191e7289fcf8b96116eb1cf9 | custom/icds/tests/test_views.py | custom/icds/tests/test_views.py | from __future__ import absolute_import
from django.test import TestCase
from django.test.utils import override_settings
from django.urls import reverse
class TestViews(TestCase):
@override_settings(CUSTOM_LANDING_TEMPLATE='icds/login.html')
def test_custom_login(self):
response = self.client.get(rever... | Test ICDS login doesn't 500 | Test ICDS login doesn't 500
| Python | bsd-3-clause | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | Test ICDS login doesn't 500 | from __future__ import absolute_import
from django.test import TestCase
from django.test.utils import override_settings
from django.urls import reverse
class TestViews(TestCase):
@override_settings(CUSTOM_LANDING_TEMPLATE='icds/login.html')
def test_custom_login(self):
response = self.client.get(rever... | <commit_before><commit_msg>Test ICDS login doesn't 500<commit_after> | from __future__ import absolute_import
from django.test import TestCase
from django.test.utils import override_settings
from django.urls import reverse
class TestViews(TestCase):
@override_settings(CUSTOM_LANDING_TEMPLATE='icds/login.html')
def test_custom_login(self):
response = self.client.get(rever... | Test ICDS login doesn't 500from __future__ import absolute_import
from django.test import TestCase
from django.test.utils import override_settings
from django.urls import reverse
class TestViews(TestCase):
@override_settings(CUSTOM_LANDING_TEMPLATE='icds/login.html')
def test_custom_login(self):
respo... | <commit_before><commit_msg>Test ICDS login doesn't 500<commit_after>from __future__ import absolute_import
from django.test import TestCase
from django.test.utils import override_settings
from django.urls import reverse
class TestViews(TestCase):
@override_settings(CUSTOM_LANDING_TEMPLATE='icds/login.html')
d... | |
dd2b861cb1576943bb290bede5544eaec146bdbf | som_generationkwh/migrations/0.0.1.2/pre-0001_delete_inactive_investments.py | som_generationkwh/migrations/0.0.1.2/pre-0001_delete_inactive_investments.py | # coding=utf-8
from oopgrade import oopgrade
import netsvc
def migrate(cr,v):
print "somenergia-generationkwh_0.0.1.2: Hem entrat al Migrate"
return
def up(cursor, installed_version):
logger= netsvc.Logger()
print "somenergia-generationkwh_0.0.1.2: Hem entrat al UP"
if not installed_version:
... | Add second migration, it works! | Add second migration, it works!
| Python | agpl-3.0 | Som-Energia/somenergia-generationkwh,Som-Energia/somenergia-generationkwh | Add second migration, it works! | # coding=utf-8
from oopgrade import oopgrade
import netsvc
def migrate(cr,v):
print "somenergia-generationkwh_0.0.1.2: Hem entrat al Migrate"
return
def up(cursor, installed_version):
logger= netsvc.Logger()
print "somenergia-generationkwh_0.0.1.2: Hem entrat al UP"
if not installed_version:
... | <commit_before><commit_msg>Add second migration, it works!<commit_after> | # coding=utf-8
from oopgrade import oopgrade
import netsvc
def migrate(cr,v):
print "somenergia-generationkwh_0.0.1.2: Hem entrat al Migrate"
return
def up(cursor, installed_version):
logger= netsvc.Logger()
print "somenergia-generationkwh_0.0.1.2: Hem entrat al UP"
if not installed_version:
... | Add second migration, it works!# coding=utf-8
from oopgrade import oopgrade
import netsvc
def migrate(cr,v):
print "somenergia-generationkwh_0.0.1.2: Hem entrat al Migrate"
return
def up(cursor, installed_version):
logger= netsvc.Logger()
print "somenergia-generationkwh_0.0.1.2: Hem entrat al UP"
... | <commit_before><commit_msg>Add second migration, it works!<commit_after># coding=utf-8
from oopgrade import oopgrade
import netsvc
def migrate(cr,v):
print "somenergia-generationkwh_0.0.1.2: Hem entrat al Migrate"
return
def up(cursor, installed_version):
logger= netsvc.Logger()
print "somenergia-gen... | |
d44b79541dae38b8deabaab4e7fe990ce1cbfa95 | opal/tests/test_templatetags_patient_lists.py | opal/tests/test_templatetags_patient_lists.py | """
Unittests for opal.templatetags.patient_lists
"""
from mock import MagicMock
from opal.core.test import OpalTestCase
from opal.tests.test_patient_lists import TestTabbedPatientListGroup, TaggingTestPatientList
from opal.templatetags import patient_lists
class TabbedListGroupTestCase(OpalTestCase):
def test_... | Add tests for patient lists templatetags | Add tests for patient lists templatetags
| Python | agpl-3.0 | khchine5/opal,khchine5/opal,khchine5/opal | Add tests for patient lists templatetags | """
Unittests for opal.templatetags.patient_lists
"""
from mock import MagicMock
from opal.core.test import OpalTestCase
from opal.tests.test_patient_lists import TestTabbedPatientListGroup, TaggingTestPatientList
from opal.templatetags import patient_lists
class TabbedListGroupTestCase(OpalTestCase):
def test_... | <commit_before><commit_msg>Add tests for patient lists templatetags<commit_after> | """
Unittests for opal.templatetags.patient_lists
"""
from mock import MagicMock
from opal.core.test import OpalTestCase
from opal.tests.test_patient_lists import TestTabbedPatientListGroup, TaggingTestPatientList
from opal.templatetags import patient_lists
class TabbedListGroupTestCase(OpalTestCase):
def test_... | Add tests for patient lists templatetags"""
Unittests for opal.templatetags.patient_lists
"""
from mock import MagicMock
from opal.core.test import OpalTestCase
from opal.tests.test_patient_lists import TestTabbedPatientListGroup, TaggingTestPatientList
from opal.templatetags import patient_lists
class TabbedListGro... | <commit_before><commit_msg>Add tests for patient lists templatetags<commit_after>"""
Unittests for opal.templatetags.patient_lists
"""
from mock import MagicMock
from opal.core.test import OpalTestCase
from opal.tests.test_patient_lists import TestTabbedPatientListGroup, TaggingTestPatientList
from opal.templatetags ... | |
1a50184437e73b8e14e6cd3a35ff5d5dc0e53fd5 | dna/test/test_DoublePinchHex.py | dna/test/test_DoublePinchHex.py | import components as comp
from model import DnaModel
#for plotting:
from numpy import linspace
import matplotlib.pyplot as plt
def round_down(num, divisor):
return num - (num%divisor)
def round_up(num, divisor):
return num + (num%divisor)
#actual test:
class DoublePinchHexTest(DnaModel):
def run(self):
... | Add a broken test for a Double Pinch Heat Exchanger | Add a broken test for a Double Pinch Heat Exchanger
| Python | bsd-3-clause | mwoc/pydna | Add a broken test for a Double Pinch Heat Exchanger | import components as comp
from model import DnaModel
#for plotting:
from numpy import linspace
import matplotlib.pyplot as plt
def round_down(num, divisor):
return num - (num%divisor)
def round_up(num, divisor):
return num + (num%divisor)
#actual test:
class DoublePinchHexTest(DnaModel):
def run(self):
... | <commit_before><commit_msg>Add a broken test for a Double Pinch Heat Exchanger<commit_after> | import components as comp
from model import DnaModel
#for plotting:
from numpy import linspace
import matplotlib.pyplot as plt
def round_down(num, divisor):
return num - (num%divisor)
def round_up(num, divisor):
return num + (num%divisor)
#actual test:
class DoublePinchHexTest(DnaModel):
def run(self):
... | Add a broken test for a Double Pinch Heat Exchangerimport components as comp
from model import DnaModel
#for plotting:
from numpy import linspace
import matplotlib.pyplot as plt
def round_down(num, divisor):
return num - (num%divisor)
def round_up(num, divisor):
return num + (num%divisor)
#actual test:
class... | <commit_before><commit_msg>Add a broken test for a Double Pinch Heat Exchanger<commit_after>import components as comp
from model import DnaModel
#for plotting:
from numpy import linspace
import matplotlib.pyplot as plt
def round_down(num, divisor):
return num - (num%divisor)
def round_up(num, divisor):
return... | |
fd6056cc8b226f2d89ef63cbc03b2b4966d06593 | numba/tests/test_remove_dead.py | numba/tests/test_remove_dead.py | from numba import compiler, typing
from numba.targets import cpu
from numba import types
from numba.targets.registry import cpu_target
from numba import config
from numba.annotations import type_annotations
from numba.ir_utils import copy_propagate, apply_copy_propagate, get_name_var_table, remove_dels, remove_dead
fro... | Add test for dead code removal. | Add test for dead code removal.
| Python | bsd-2-clause | stonebig/numba,stonebig/numba,sklam/numba,cpcloud/numba,jriehl/numba,IntelLabs/numba,jriehl/numba,sklam/numba,gmarkall/numba,gmarkall/numba,numba/numba,sklam/numba,IntelLabs/numba,stonebig/numba,stuartarchibald/numba,IntelLabs/numba,seibert/numba,gmarkall/numba,seibert/numba,cpcloud/numba,stuartarchibald/numba,cpcloud/... | Add test for dead code removal. | from numba import compiler, typing
from numba.targets import cpu
from numba import types
from numba.targets.registry import cpu_target
from numba import config
from numba.annotations import type_annotations
from numba.ir_utils import copy_propagate, apply_copy_propagate, get_name_var_table, remove_dels, remove_dead
fro... | <commit_before><commit_msg>Add test for dead code removal.<commit_after> | from numba import compiler, typing
from numba.targets import cpu
from numba import types
from numba.targets.registry import cpu_target
from numba import config
from numba.annotations import type_annotations
from numba.ir_utils import copy_propagate, apply_copy_propagate, get_name_var_table, remove_dels, remove_dead
fro... | Add test for dead code removal.from numba import compiler, typing
from numba.targets import cpu
from numba import types
from numba.targets.registry import cpu_target
from numba import config
from numba.annotations import type_annotations
from numba.ir_utils import copy_propagate, apply_copy_propagate, get_name_var_tabl... | <commit_before><commit_msg>Add test for dead code removal.<commit_after>from numba import compiler, typing
from numba.targets import cpu
from numba import types
from numba.targets.registry import cpu_target
from numba import config
from numba.annotations import type_annotations
from numba.ir_utils import copy_propagate... | |
31a6433ee74d8d13ba3035a41db8e925de1d2b5d | bin/2000/crosswalk_msa_tract.py | bin/2000/crosswalk_msa_tract.py | """crosswalk_msa_tract.py
Extract the crosswalk between 2000 msa and tracts.
"""
import os
import csv
#
# Import data
#
## MSA to counties crosswalk
# county_to_msa = {county: {msa: [cousub ids]}
county_to_msa = {}
with open('data/2000/crosswalks/msa_county.csv', 'r') as source:
reader = csv.reader(source, delim... | Add script to extract the crosswalk between msas and tracts | Add script to extract the crosswalk between msas and tracts
| Python | bsd-2-clause | scities/2000-us-metro-atlas | Add script to extract the crosswalk between msas and tracts | """crosswalk_msa_tract.py
Extract the crosswalk between 2000 msa and tracts.
"""
import os
import csv
#
# Import data
#
## MSA to counties crosswalk
# county_to_msa = {county: {msa: [cousub ids]}
county_to_msa = {}
with open('data/2000/crosswalks/msa_county.csv', 'r') as source:
reader = csv.reader(source, delim... | <commit_before><commit_msg>Add script to extract the crosswalk between msas and tracts<commit_after> | """crosswalk_msa_tract.py
Extract the crosswalk between 2000 msa and tracts.
"""
import os
import csv
#
# Import data
#
## MSA to counties crosswalk
# county_to_msa = {county: {msa: [cousub ids]}
county_to_msa = {}
with open('data/2000/crosswalks/msa_county.csv', 'r') as source:
reader = csv.reader(source, delim... | Add script to extract the crosswalk between msas and tracts"""crosswalk_msa_tract.py
Extract the crosswalk between 2000 msa and tracts.
"""
import os
import csv
#
# Import data
#
## MSA to counties crosswalk
# county_to_msa = {county: {msa: [cousub ids]}
county_to_msa = {}
with open('data/2000/crosswalks/msa_county.... | <commit_before><commit_msg>Add script to extract the crosswalk between msas and tracts<commit_after>"""crosswalk_msa_tract.py
Extract the crosswalk between 2000 msa and tracts.
"""
import os
import csv
#
# Import data
#
## MSA to counties crosswalk
# county_to_msa = {county: {msa: [cousub ids]}
county_to_msa = {}
wi... | |
0fbea33e99af8fbb30ba508b649ec0e898a6cc98 | examples/work_queue.py | examples/work_queue.py | import threading
import time
from walrus import Walrus
db = Walrus()
def create_consumer_group():
consumer = db.consumer_group('tasks-cg', ['tasks'])
if not db.exists('tasks'):
db.xadd('tasks', {'dummy': ''}, id=b'0-1')
consumer.create()
consumer.set_id('$')
return consumer
def ... | Add work queue example using streams. | Add work queue example using streams.
| Python | mit | coleifer/walrus | Add work queue example using streams. | import threading
import time
from walrus import Walrus
db = Walrus()
def create_consumer_group():
consumer = db.consumer_group('tasks-cg', ['tasks'])
if not db.exists('tasks'):
db.xadd('tasks', {'dummy': ''}, id=b'0-1')
consumer.create()
consumer.set_id('$')
return consumer
def ... | <commit_before><commit_msg>Add work queue example using streams.<commit_after> | import threading
import time
from walrus import Walrus
db = Walrus()
def create_consumer_group():
consumer = db.consumer_group('tasks-cg', ['tasks'])
if not db.exists('tasks'):
db.xadd('tasks', {'dummy': ''}, id=b'0-1')
consumer.create()
consumer.set_id('$')
return consumer
def ... | Add work queue example using streams.import threading
import time
from walrus import Walrus
db = Walrus()
def create_consumer_group():
consumer = db.consumer_group('tasks-cg', ['tasks'])
if not db.exists('tasks'):
db.xadd('tasks', {'dummy': ''}, id=b'0-1')
consumer.create()
consumer.... | <commit_before><commit_msg>Add work queue example using streams.<commit_after>import threading
import time
from walrus import Walrus
db = Walrus()
def create_consumer_group():
consumer = db.consumer_group('tasks-cg', ['tasks'])
if not db.exists('tasks'):
db.xadd('tasks', {'dummy': ''}, id=b'0-1')
... | |
99340e34e219101ad21acdff22665a3fdbf5a64b | gravity/migrations/0003_ispindelconfiguration_temperature_correction.py | gravity/migrations/0003_ispindelconfiguration_temperature_correction.py | # Generated by Django 3.0.11 on 2020-11-27 19:22
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('gravity', '0002_brewfather_updates'),
]
operations = [
migrations.AddField(
model_name='ispindelconfiguration',
nam... | Add migration for iSpindel temperature correction | Add migration for iSpindel temperature correction
| Python | mit | thorrak/fermentrack,thorrak/fermentrack,thorrak/fermentrack,thorrak/fermentrack,thorrak/fermentrack | Add migration for iSpindel temperature correction | # Generated by Django 3.0.11 on 2020-11-27 19:22
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('gravity', '0002_brewfather_updates'),
]
operations = [
migrations.AddField(
model_name='ispindelconfiguration',
nam... | <commit_before><commit_msg>Add migration for iSpindel temperature correction<commit_after> | # Generated by Django 3.0.11 on 2020-11-27 19:22
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('gravity', '0002_brewfather_updates'),
]
operations = [
migrations.AddField(
model_name='ispindelconfiguration',
nam... | Add migration for iSpindel temperature correction# Generated by Django 3.0.11 on 2020-11-27 19:22
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('gravity', '0002_brewfather_updates'),
]
operations = [
migrations.AddField(
mo... | <commit_before><commit_msg>Add migration for iSpindel temperature correction<commit_after># Generated by Django 3.0.11 on 2020-11-27 19:22
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('gravity', '0002_brewfather_updates'),
]
operations = [
... | |
7570120ee325e1b0595b39850dba11e4cce7629d | src/promo/__init__.py | src/promo/__init__.py | from contextlib import contextmanager
from email.mime.text import MIMEText
from email.utils import formatdate
from cfg import config, parse_end_date
import os
import re
from teammails import base_path, get_template, smtp_session
@contextmanager
def address_iterator(filename):
if not os.path.isfile(filename):
... | Add code to send promotional mails | Add code to send promotional mails
| Python | bsd-3-clause | janLo/meet-and-eat-registration-system,janLo/meet-and-eat-registration-system,eXma/meet-and-eat-registration-system,eXma/meet-and-eat-registration-system,eXma/meet-and-eat-registration-system,eXma/meet-and-eat-registration-system,janLo/meet-and-eat-registration-system,janLo/meet-and-eat-registration-system | Add code to send promotional mails | from contextlib import contextmanager
from email.mime.text import MIMEText
from email.utils import formatdate
from cfg import config, parse_end_date
import os
import re
from teammails import base_path, get_template, smtp_session
@contextmanager
def address_iterator(filename):
if not os.path.isfile(filename):
... | <commit_before><commit_msg>Add code to send promotional mails<commit_after> | from contextlib import contextmanager
from email.mime.text import MIMEText
from email.utils import formatdate
from cfg import config, parse_end_date
import os
import re
from teammails import base_path, get_template, smtp_session
@contextmanager
def address_iterator(filename):
if not os.path.isfile(filename):
... | Add code to send promotional mailsfrom contextlib import contextmanager
from email.mime.text import MIMEText
from email.utils import formatdate
from cfg import config, parse_end_date
import os
import re
from teammails import base_path, get_template, smtp_session
@contextmanager
def address_iterator(filename):
... | <commit_before><commit_msg>Add code to send promotional mails<commit_after>from contextlib import contextmanager
from email.mime.text import MIMEText
from email.utils import formatdate
from cfg import config, parse_end_date
import os
import re
from teammails import base_path, get_template, smtp_session
@contextma... | |
0b8bbb5def7d5f621b26093897b01ac9a14239bf | src/tor/x25519-gen.py | src/tor/x25519-gen.py | #!/usr/bin/env python3
import base64
try:
import nacl.public
except ImportError:
print('PyNaCl is required: "pip install pynacl" or similar')
exit(1)
def key_str(key):
# bytes to base 32
key_bytes = bytes(key)
key_b32 = base64.b32encode(key_bytes)
# strip trailing ====
assert key_b32[-... | Add script for generating x25519 keys | Add script for generating x25519 keys
| Python | unlicense | pastly/python-snippits | Add script for generating x25519 keys | #!/usr/bin/env python3
import base64
try:
import nacl.public
except ImportError:
print('PyNaCl is required: "pip install pynacl" or similar')
exit(1)
def key_str(key):
# bytes to base 32
key_bytes = bytes(key)
key_b32 = base64.b32encode(key_bytes)
# strip trailing ====
assert key_b32[-... | <commit_before><commit_msg>Add script for generating x25519 keys<commit_after> | #!/usr/bin/env python3
import base64
try:
import nacl.public
except ImportError:
print('PyNaCl is required: "pip install pynacl" or similar')
exit(1)
def key_str(key):
# bytes to base 32
key_bytes = bytes(key)
key_b32 = base64.b32encode(key_bytes)
# strip trailing ====
assert key_b32[-... | Add script for generating x25519 keys#!/usr/bin/env python3
import base64
try:
import nacl.public
except ImportError:
print('PyNaCl is required: "pip install pynacl" or similar')
exit(1)
def key_str(key):
# bytes to base 32
key_bytes = bytes(key)
key_b32 = base64.b32encode(key_bytes)
# str... | <commit_before><commit_msg>Add script for generating x25519 keys<commit_after>#!/usr/bin/env python3
import base64
try:
import nacl.public
except ImportError:
print('PyNaCl is required: "pip install pynacl" or similar')
exit(1)
def key_str(key):
# bytes to base 32
key_bytes = bytes(key)
key_b3... | |
0135a28e5e4fc1183737e3d5bade231d7330d564 | scripts/run_on_swarming_bots/reboot_bot.py | scripts/run_on_swarming_bots/reboot_bot.py | #!/usr/bin/env python
#
# Copyright 2017 Google Inc.
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Reboot a Swarming bot."""
import os
import sys
if sys.platform == 'win32':
os.system('shutdown /r /t 0')
else:
os.system('sudo reboot')
| Add Reboot script for run_on_swarming_bots | Add Reboot script for run_on_swarming_bots
Change-Id: I01c72ef2157660e5d7f3c5d47a9b30fa78054e9f
Reviewed-on: https://skia-review.googlesource.com/135381
Auto-Submit: Ben Wagner <3ef7217be91069877d94f7907ce5479000772cd3@google.com>
Commit-Queue: Kevin Lubick <7cdab2cfab351f23814786ba39716e90eed69047@google.com>
Reviewe... | Python | bsd-3-clause | google/skia-buildbot,google/skia-buildbot,google/skia-buildbot,google/skia-buildbot,google/skia-buildbot,google/skia-buildbot,google/skia-buildbot,google/skia-buildbot | Add Reboot script for run_on_swarming_bots
Change-Id: I01c72ef2157660e5d7f3c5d47a9b30fa78054e9f
Reviewed-on: https://skia-review.googlesource.com/135381
Auto-Submit: Ben Wagner <3ef7217be91069877d94f7907ce5479000772cd3@google.com>
Commit-Queue: Kevin Lubick <7cdab2cfab351f23814786ba39716e90eed69047@google.com>
Reviewe... | #!/usr/bin/env python
#
# Copyright 2017 Google Inc.
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Reboot a Swarming bot."""
import os
import sys
if sys.platform == 'win32':
os.system('shutdown /r /t 0')
else:
os.system('sudo reboot')
| <commit_before><commit_msg>Add Reboot script for run_on_swarming_bots
Change-Id: I01c72ef2157660e5d7f3c5d47a9b30fa78054e9f
Reviewed-on: https://skia-review.googlesource.com/135381
Auto-Submit: Ben Wagner <3ef7217be91069877d94f7907ce5479000772cd3@google.com>
Commit-Queue: Kevin Lubick <7cdab2cfab351f23814786ba39716e90e... | #!/usr/bin/env python
#
# Copyright 2017 Google Inc.
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Reboot a Swarming bot."""
import os
import sys
if sys.platform == 'win32':
os.system('shutdown /r /t 0')
else:
os.system('sudo reboot')
| Add Reboot script for run_on_swarming_bots
Change-Id: I01c72ef2157660e5d7f3c5d47a9b30fa78054e9f
Reviewed-on: https://skia-review.googlesource.com/135381
Auto-Submit: Ben Wagner <3ef7217be91069877d94f7907ce5479000772cd3@google.com>
Commit-Queue: Kevin Lubick <7cdab2cfab351f23814786ba39716e90eed69047@google.com>
Reviewe... | <commit_before><commit_msg>Add Reboot script for run_on_swarming_bots
Change-Id: I01c72ef2157660e5d7f3c5d47a9b30fa78054e9f
Reviewed-on: https://skia-review.googlesource.com/135381
Auto-Submit: Ben Wagner <3ef7217be91069877d94f7907ce5479000772cd3@google.com>
Commit-Queue: Kevin Lubick <7cdab2cfab351f23814786ba39716e90e... | |
372fdf61b30041862383b16d2c0ca4ed84d530e4 | troposphere/s3.py | troposphere/s3.py | # Copyright (c) 2013, Bob Van Zant <bob@veznat.com>
# All rights reserved.
#
# See LICENSE file for full license.
from . import AWSObject, AWSProperty, Tags
class WebsiteConfiguration(AWSProperty):
props = {
'IndexDocument': (basestring, False),
'ErrorDocument': (basestring, False),
}
class... | Support for creating S3 buckets. | Support for creating S3 buckets.
| Python | bsd-2-clause | samcrang/troposphere,alonsodomin/troposphere,johnctitus/troposphere,WeAreCloudar/troposphere,mhahn/troposphere,wangqiang8511/troposphere,ikben/troposphere,7digital/troposphere,LouTheBrew/troposphere,mannytoledo/troposphere,cloudtools/troposphere,DualSpark/troposphere,Yipit/troposphere,inetCatapult/troposphere,dmm92/tro... | Support for creating S3 buckets. | # Copyright (c) 2013, Bob Van Zant <bob@veznat.com>
# All rights reserved.
#
# See LICENSE file for full license.
from . import AWSObject, AWSProperty, Tags
class WebsiteConfiguration(AWSProperty):
props = {
'IndexDocument': (basestring, False),
'ErrorDocument': (basestring, False),
}
class... | <commit_before><commit_msg>Support for creating S3 buckets.<commit_after> | # Copyright (c) 2013, Bob Van Zant <bob@veznat.com>
# All rights reserved.
#
# See LICENSE file for full license.
from . import AWSObject, AWSProperty, Tags
class WebsiteConfiguration(AWSProperty):
props = {
'IndexDocument': (basestring, False),
'ErrorDocument': (basestring, False),
}
class... | Support for creating S3 buckets.# Copyright (c) 2013, Bob Van Zant <bob@veznat.com>
# All rights reserved.
#
# See LICENSE file for full license.
from . import AWSObject, AWSProperty, Tags
class WebsiteConfiguration(AWSProperty):
props = {
'IndexDocument': (basestring, False),
'ErrorDocument': (b... | <commit_before><commit_msg>Support for creating S3 buckets.<commit_after># Copyright (c) 2013, Bob Van Zant <bob@veznat.com>
# All rights reserved.
#
# See LICENSE file for full license.
from . import AWSObject, AWSProperty, Tags
class WebsiteConfiguration(AWSProperty):
props = {
'IndexDocument': (basest... | |
5b13240d65f70f6418ca92b7cff81bc290e26fef | demo/ipython_notebook_config.py | demo/ipython_notebook_config.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Configuration file for ipython-notebook.
c = get_config()
c.NotebookApp.ip = '*'
c.NotebookApp.open_browser = False
c.NotebookApp.port = 8888
# Whether to trust or not X-Scheme/X-Forwarded-Proto and X-Real-Ip/X-Forwarded-
# For headerssent by the upstream reverse proxy... | Configure the IPython notebook user settings | Configure the IPython notebook user settings
| Python | bsd-3-clause | Zsailer/docker-jupyter-teaching,odewahn/docker-demo-images,danielballan/docker-demo-images,willjharmer/docker-demo-images,tanyaschlusser/docker-demo-images,pelucid/docker-demo-images,Zsailer/docker-demo-images,rgbkrk/docker-demo-images,vanceb/docker-demo-images,parente/docker-demo-images,philipz/docker-demo-images,phil... | Configure the IPython notebook user settings | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Configuration file for ipython-notebook.
c = get_config()
c.NotebookApp.ip = '*'
c.NotebookApp.open_browser = False
c.NotebookApp.port = 8888
# Whether to trust or not X-Scheme/X-Forwarded-Proto and X-Real-Ip/X-Forwarded-
# For headerssent by the upstream reverse proxy... | <commit_before><commit_msg>Configure the IPython notebook user settings<commit_after> | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Configuration file for ipython-notebook.
c = get_config()
c.NotebookApp.ip = '*'
c.NotebookApp.open_browser = False
c.NotebookApp.port = 8888
# Whether to trust or not X-Scheme/X-Forwarded-Proto and X-Real-Ip/X-Forwarded-
# For headerssent by the upstream reverse proxy... | Configure the IPython notebook user settings#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Configuration file for ipython-notebook.
c = get_config()
c.NotebookApp.ip = '*'
c.NotebookApp.open_browser = False
c.NotebookApp.port = 8888
# Whether to trust or not X-Scheme/X-Forwarded-Proto and X-Real-Ip/X-Forwarded-
# F... | <commit_before><commit_msg>Configure the IPython notebook user settings<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Configuration file for ipython-notebook.
c = get_config()
c.NotebookApp.ip = '*'
c.NotebookApp.open_browser = False
c.NotebookApp.port = 8888
# Whether to trust or not X-Scheme/X-Forwa... | |
b29fa5c96fa5e0fdd2117164baace9ac8492867d | testmodel/webapp/selenium/test/log-in-test.py | testmodel/webapp/selenium/test/log-in-test.py | import unittest
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
class LoginTestCase(unittest.TestCase):
def setUp(self):
self.browser = webdriver.Firefox()
self.addCleanup(self.browser.quit)
self.browser.get('http://localhost:8080/intermine-demo/begin.do')
... | Test ability to log in | Test ability to log in
| Python | lgpl-2.1 | tomck/intermine,elsiklab/intermine,Arabidopsis-Information-Portal/intermine,Arabidopsis-Information-Portal/intermine,joshkh/intermine,joshkh/intermine,justincc/intermine,joshkh/intermine,elsiklab/intermine,zebrafishmine/intermine,elsiklab/intermine,kimrutherford/intermine,elsiklab/intermine,Arabidopsis-Information-Port... | Test ability to log in | import unittest
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
class LoginTestCase(unittest.TestCase):
def setUp(self):
self.browser = webdriver.Firefox()
self.addCleanup(self.browser.quit)
self.browser.get('http://localhost:8080/intermine-demo/begin.do')
... | <commit_before><commit_msg>Test ability to log in<commit_after> | import unittest
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
class LoginTestCase(unittest.TestCase):
def setUp(self):
self.browser = webdriver.Firefox()
self.addCleanup(self.browser.quit)
self.browser.get('http://localhost:8080/intermine-demo/begin.do')
... | Test ability to log inimport unittest
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
class LoginTestCase(unittest.TestCase):
def setUp(self):
self.browser = webdriver.Firefox()
self.addCleanup(self.browser.quit)
self.browser.get('http://localhost:8080/interm... | <commit_before><commit_msg>Test ability to log in<commit_after>import unittest
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
class LoginTestCase(unittest.TestCase):
def setUp(self):
self.browser = webdriver.Firefox()
self.addCleanup(self.browser.quit)
self.... | |
13f06e971967106fba98aace57b7ffa0b07201eb | comrade/functional.py | comrade/functional.py | def lazy(func):
def lazy_func(self, *args, **kwargs):
cached_attribute = '_cached_%s' % func.__name__
if not hasattr(self, cached_attribute):
setattr(self, cached_attribute, func(self, *args, **kwargs))
return getattr(self, cached_attribute)
return lazy_func
| Add a @lazy decorator for simple lazy methods. | Add a @lazy decorator for simple lazy methods.
| Python | mit | bueda/django-comrade | Add a @lazy decorator for simple lazy methods. | def lazy(func):
def lazy_func(self, *args, **kwargs):
cached_attribute = '_cached_%s' % func.__name__
if not hasattr(self, cached_attribute):
setattr(self, cached_attribute, func(self, *args, **kwargs))
return getattr(self, cached_attribute)
return lazy_func
| <commit_before><commit_msg>Add a @lazy decorator for simple lazy methods.<commit_after> | def lazy(func):
def lazy_func(self, *args, **kwargs):
cached_attribute = '_cached_%s' % func.__name__
if not hasattr(self, cached_attribute):
setattr(self, cached_attribute, func(self, *args, **kwargs))
return getattr(self, cached_attribute)
return lazy_func
| Add a @lazy decorator for simple lazy methods.def lazy(func):
def lazy_func(self, *args, **kwargs):
cached_attribute = '_cached_%s' % func.__name__
if not hasattr(self, cached_attribute):
setattr(self, cached_attribute, func(self, *args, **kwargs))
return getattr(self, cached_att... | <commit_before><commit_msg>Add a @lazy decorator for simple lazy methods.<commit_after>def lazy(func):
def lazy_func(self, *args, **kwargs):
cached_attribute = '_cached_%s' % func.__name__
if not hasattr(self, cached_attribute):
setattr(self, cached_attribute, func(self, *args, **kwargs)... | |
23a4e55ba85dde4447d7768e8e4ffd7f1efcc385 | cme/modules/laps.py | cme/modules/laps.py | from impacket.ldap import ldapasn1 as ldapasn1_impacket
class CMEModule:
'''
Module by technobro refactored by @mpgn (now compatible with LDAP protocol + filter by computer)
Initial module:
@T3KX: https://github.com/T3KX/Crackmapexec-LAPS
Credit: @n00py1
Reference: https://www.n00... | Add LAPS module thx to @T3KX | Add LAPS module thx to @T3KX
| Python | bsd-2-clause | byt3bl33d3r/CrackMapExec | Add LAPS module thx to @T3KX | from impacket.ldap import ldapasn1 as ldapasn1_impacket
class CMEModule:
'''
Module by technobro refactored by @mpgn (now compatible with LDAP protocol + filter by computer)
Initial module:
@T3KX: https://github.com/T3KX/Crackmapexec-LAPS
Credit: @n00py1
Reference: https://www.n00... | <commit_before><commit_msg>Add LAPS module thx to @T3KX<commit_after> | from impacket.ldap import ldapasn1 as ldapasn1_impacket
class CMEModule:
'''
Module by technobro refactored by @mpgn (now compatible with LDAP protocol + filter by computer)
Initial module:
@T3KX: https://github.com/T3KX/Crackmapexec-LAPS
Credit: @n00py1
Reference: https://www.n00... | Add LAPS module thx to @T3KXfrom impacket.ldap import ldapasn1 as ldapasn1_impacket
class CMEModule:
'''
Module by technobro refactored by @mpgn (now compatible with LDAP protocol + filter by computer)
Initial module:
@T3KX: https://github.com/T3KX/Crackmapexec-LAPS
Credit: @n00py1
... | <commit_before><commit_msg>Add LAPS module thx to @T3KX<commit_after>from impacket.ldap import ldapasn1 as ldapasn1_impacket
class CMEModule:
'''
Module by technobro refactored by @mpgn (now compatible with LDAP protocol + filter by computer)
Initial module:
@T3KX: https://github.com/T3KX/Crackm... | |
3e0e9702becc5c7a8455b12113eb2341c27a34bd | CDJSVis/filtering/filters/tests/test_charge.py | CDJSVis/filtering/filters/tests/test_charge.py |
"""
Unit tests for the charge filter
"""
import unittest
import numpy as np
from ....state import lattice
from .. import chargeFilter
from .. import base
################################################################################
class TestChargeFilter(unittest.TestCase):
"""
Test charge filter
... | Add a test for the charge filter. | Add a test for the charge filter. | Python | mit | chrisdjscott/Atoman,chrisdjscott/Atoman,chrisdjscott/Atoman,chrisdjscott/Atoman,chrisdjscott/Atoman | Add a test for the charge filter. |
"""
Unit tests for the charge filter
"""
import unittest
import numpy as np
from ....state import lattice
from .. import chargeFilter
from .. import base
################################################################################
class TestChargeFilter(unittest.TestCase):
"""
Test charge filter
... | <commit_before><commit_msg>Add a test for the charge filter.<commit_after> |
"""
Unit tests for the charge filter
"""
import unittest
import numpy as np
from ....state import lattice
from .. import chargeFilter
from .. import base
################################################################################
class TestChargeFilter(unittest.TestCase):
"""
Test charge filter
... | Add a test for the charge filter.
"""
Unit tests for the charge filter
"""
import unittest
import numpy as np
from ....state import lattice
from .. import chargeFilter
from .. import base
################################################################################
class TestChargeFilter(unittest.TestCase):
... | <commit_before><commit_msg>Add a test for the charge filter.<commit_after>
"""
Unit tests for the charge filter
"""
import unittest
import numpy as np
from ....state import lattice
from .. import chargeFilter
from .. import base
################################################################################
clas... | |
ded110e2357ea400a64d90822efd43213374cfd4 | fedmsg.d/logging.py | fedmsg.d/logging.py | # Setup fedmsg logging.
# See the following for constraints on this format https://bit.ly/Xn1WDn
bare_format = "[%(asctime)s][%(name)10s %(levelname)7s] %(message)s"
config = dict(
logging=dict(
version=1,
formatters=dict(
bare={
"datefmt": "%Y-%m-%d %H:%M:%S",
... | # Setup fedmsg logging.
# See the following for constraints on this format https://bit.ly/Xn1WDn
bare_format = "[%(asctime)s][%(name)10s %(levelname)7s] %(message)s"
config = dict(
logging=dict(
version=1,
formatters=dict(
bare={
"datefmt": "%Y-%m-%d %H:%M:%S",
... | Add a comma here to help out people who modify this file. | Add a comma here to help out people who modify this file.
See https://bugzilla.redhat.com/show_bug.cgi?id=1184523
| Python | lgpl-2.1 | maxamillion/fedmsg,maxamillion/fedmsg,maxamillion/fedmsg,vivekanand1101/fedmsg,cicku/fedmsg,pombredanne/fedmsg,mathstuf/fedmsg,chaiku/fedmsg,vivekanand1101/fedmsg,pombredanne/fedmsg,cicku/fedmsg,cicku/fedmsg,chaiku/fedmsg,fedora-infra/fedmsg,chaiku/fedmsg,mathstuf/fedmsg,fedora-infra/fedmsg,fedora-infra/fedmsg,vivekana... | # Setup fedmsg logging.
# See the following for constraints on this format https://bit.ly/Xn1WDn
bare_format = "[%(asctime)s][%(name)10s %(levelname)7s] %(message)s"
config = dict(
logging=dict(
version=1,
formatters=dict(
bare={
"datefmt": "%Y-%m-%d %H:%M:%S",
... | # Setup fedmsg logging.
# See the following for constraints on this format https://bit.ly/Xn1WDn
bare_format = "[%(asctime)s][%(name)10s %(levelname)7s] %(message)s"
config = dict(
logging=dict(
version=1,
formatters=dict(
bare={
"datefmt": "%Y-%m-%d %H:%M:%S",
... | <commit_before># Setup fedmsg logging.
# See the following for constraints on this format https://bit.ly/Xn1WDn
bare_format = "[%(asctime)s][%(name)10s %(levelname)7s] %(message)s"
config = dict(
logging=dict(
version=1,
formatters=dict(
bare={
"datefmt": "%Y-%m-%d %H:%M... | # Setup fedmsg logging.
# See the following for constraints on this format https://bit.ly/Xn1WDn
bare_format = "[%(asctime)s][%(name)10s %(levelname)7s] %(message)s"
config = dict(
logging=dict(
version=1,
formatters=dict(
bare={
"datefmt": "%Y-%m-%d %H:%M:%S",
... | # Setup fedmsg logging.
# See the following for constraints on this format https://bit.ly/Xn1WDn
bare_format = "[%(asctime)s][%(name)10s %(levelname)7s] %(message)s"
config = dict(
logging=dict(
version=1,
formatters=dict(
bare={
"datefmt": "%Y-%m-%d %H:%M:%S",
... | <commit_before># Setup fedmsg logging.
# See the following for constraints on this format https://bit.ly/Xn1WDn
bare_format = "[%(asctime)s][%(name)10s %(levelname)7s] %(message)s"
config = dict(
logging=dict(
version=1,
formatters=dict(
bare={
"datefmt": "%Y-%m-%d %H:%M... |
8b45094e20c69f8a5c9aa9ca74de40763d27b8f2 | test_parallel_vectorize_numpy_2.py | test_parallel_vectorize_numpy_2.py | '''
Test parallel-vectorize with numpy.fromfunc.
Uses the work load from test_parallel_vectorize.
This time we pass a function pointer.
'''
from test_parallel_vectorize import *
import numpy as np
def main():
module = Module.new(__name__)
exe = CExecutor(module)
workdef = Work_D_D()
workfunc = workd... | Add test that uses function pointer. | Add test that uses function pointer.
| Python | bsd-3-clause | llvmpy/llvmpy,llvmpy/llvmpy,llvmpy/llvmpy,llvmpy/llvmpy,llvmpy/llvmpy,llvmpy/llvmpy | Add test that uses function pointer. | '''
Test parallel-vectorize with numpy.fromfunc.
Uses the work load from test_parallel_vectorize.
This time we pass a function pointer.
'''
from test_parallel_vectorize import *
import numpy as np
def main():
module = Module.new(__name__)
exe = CExecutor(module)
workdef = Work_D_D()
workfunc = workd... | <commit_before><commit_msg>Add test that uses function pointer.<commit_after> | '''
Test parallel-vectorize with numpy.fromfunc.
Uses the work load from test_parallel_vectorize.
This time we pass a function pointer.
'''
from test_parallel_vectorize import *
import numpy as np
def main():
module = Module.new(__name__)
exe = CExecutor(module)
workdef = Work_D_D()
workfunc = workd... | Add test that uses function pointer.'''
Test parallel-vectorize with numpy.fromfunc.
Uses the work load from test_parallel_vectorize.
This time we pass a function pointer.
'''
from test_parallel_vectorize import *
import numpy as np
def main():
module = Module.new(__name__)
exe = CExecutor(module)
workd... | <commit_before><commit_msg>Add test that uses function pointer.<commit_after>'''
Test parallel-vectorize with numpy.fromfunc.
Uses the work load from test_parallel_vectorize.
This time we pass a function pointer.
'''
from test_parallel_vectorize import *
import numpy as np
def main():
module = Module.new(__name_... | |
3bc56faeb1d12082b2ceee147c37ae42bd7713ca | tests/test_serialization_format.py | tests/test_serialization_format.py | # Copyright 2019 D-Wave Systems 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 or... | Add one smoketest to str(sampleset) | Add one smoketest to str(sampleset)
| Python | apache-2.0 | oneklc/dimod,oneklc/dimod | Add one smoketest to str(sampleset) | # Copyright 2019 D-Wave Systems 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 or... | <commit_before><commit_msg>Add one smoketest to str(sampleset)<commit_after> | # Copyright 2019 D-Wave Systems 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 or... | Add one smoketest to str(sampleset)# Copyright 2019 D-Wave Systems 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
#
# U... | <commit_before><commit_msg>Add one smoketest to str(sampleset)<commit_after># Copyright 2019 D-Wave Systems 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... | |
cd1620bb1b617f8413eafcf93c3da3ac43bfa088 | db_connection_pool.py | db_connection_pool.py | class ConnectionPool():
"""
Usage:
conn_pool = nmi_mysql.ConnectionPool(config)
db = conn_pool.get_connection()
db.query('SELECT 1', [])
conn_pool.return_connection(db)
conn_pool.close()
"""
def __init__(self, conf, max_pool_size=20):
self.conf = conf
... | Add db connection pool example | Add db connection pool example | Python | mit | voidabhi/python-scripts,voidabhi/python-scripts,voidabhi/python-scripts,voidabhi/python-scripts,voidabhi/python-scripts | Add db connection pool example | class ConnectionPool():
"""
Usage:
conn_pool = nmi_mysql.ConnectionPool(config)
db = conn_pool.get_connection()
db.query('SELECT 1', [])
conn_pool.return_connection(db)
conn_pool.close()
"""
def __init__(self, conf, max_pool_size=20):
self.conf = conf
... | <commit_before><commit_msg>Add db connection pool example<commit_after> | class ConnectionPool():
"""
Usage:
conn_pool = nmi_mysql.ConnectionPool(config)
db = conn_pool.get_connection()
db.query('SELECT 1', [])
conn_pool.return_connection(db)
conn_pool.close()
"""
def __init__(self, conf, max_pool_size=20):
self.conf = conf
... | Add db connection pool exampleclass ConnectionPool():
"""
Usage:
conn_pool = nmi_mysql.ConnectionPool(config)
db = conn_pool.get_connection()
db.query('SELECT 1', [])
conn_pool.return_connection(db)
conn_pool.close()
"""
def __init__(self, conf, max_pool_size=20):... | <commit_before><commit_msg>Add db connection pool example<commit_after>class ConnectionPool():
"""
Usage:
conn_pool = nmi_mysql.ConnectionPool(config)
db = conn_pool.get_connection()
db.query('SELECT 1', [])
conn_pool.return_connection(db)
conn_pool.close()
"""
de... | |
e64df5ab8307c6f6120735816166c6ff8ffeccfc | neural_network/neural_network.py | neural_network/neural_network.py | #!/usr/bin/env python
import math
import numpy as np
def sigmoid(x):
return 1.0 / (1 + np.exp(-x))
def sigmoid_derivate(x):
return x * (1 - x)
def main():
np.random.seed(1)
# [4, 3]
features = np.array([[0, 0, 1], [0, 1, 1], [1, 0, 1], [1, 1, 1]])
# [4, 1]
labels = np.array([[0], [0], [1], [1]])
... | Implement backpropagation algorithm for neural network | Implement backpropagation algorithm for neural network
| Python | mit | tobegit3hub/ml_implementation,erwin00776/copy_ml_implements | Implement backpropagation algorithm for neural network | #!/usr/bin/env python
import math
import numpy as np
def sigmoid(x):
return 1.0 / (1 + np.exp(-x))
def sigmoid_derivate(x):
return x * (1 - x)
def main():
np.random.seed(1)
# [4, 3]
features = np.array([[0, 0, 1], [0, 1, 1], [1, 0, 1], [1, 1, 1]])
# [4, 1]
labels = np.array([[0], [0], [1], [1]])
... | <commit_before><commit_msg>Implement backpropagation algorithm for neural network<commit_after> | #!/usr/bin/env python
import math
import numpy as np
def sigmoid(x):
return 1.0 / (1 + np.exp(-x))
def sigmoid_derivate(x):
return x * (1 - x)
def main():
np.random.seed(1)
# [4, 3]
features = np.array([[0, 0, 1], [0, 1, 1], [1, 0, 1], [1, 1, 1]])
# [4, 1]
labels = np.array([[0], [0], [1], [1]])
... | Implement backpropagation algorithm for neural network#!/usr/bin/env python
import math
import numpy as np
def sigmoid(x):
return 1.0 / (1 + np.exp(-x))
def sigmoid_derivate(x):
return x * (1 - x)
def main():
np.random.seed(1)
# [4, 3]
features = np.array([[0, 0, 1], [0, 1, 1], [1, 0, 1], [1, 1, 1]])
... | <commit_before><commit_msg>Implement backpropagation algorithm for neural network<commit_after>#!/usr/bin/env python
import math
import numpy as np
def sigmoid(x):
return 1.0 / (1 + np.exp(-x))
def sigmoid_derivate(x):
return x * (1 - x)
def main():
np.random.seed(1)
# [4, 3]
features = np.array([[0, ... | |
15ec7cf519ce98ddb6dee50de2a2b3c6ace44680 | l10n_br_sale/tests/test_l10n_br_sale_product.py | l10n_br_sale/tests/test_l10n_br_sale_product.py | # @ 2019 Akretion - www.akretion.com.br -
# Magno Costa <magno.costa@akretion.com.br>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
import odoo.tests.common as common
class TestL10nBRSaleProduct(common.TransactionCase):
def setUp(self):
super(TestL10nBRSaleProduct, self).setUp()
... | Move test from l10n_br_sale_product to l10n_br_sale. | [12.0][MIG][WIP] Move test from l10n_br_sale_product to l10n_br_sale.
| Python | agpl-3.0 | OCA/l10n-brazil,OCA/l10n-brazil,OCA/l10n-brazil,akretion/l10n-brazil,akretion/l10n-brazil,akretion/l10n-brazil | [12.0][MIG][WIP] Move test from l10n_br_sale_product to l10n_br_sale. | # @ 2019 Akretion - www.akretion.com.br -
# Magno Costa <magno.costa@akretion.com.br>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
import odoo.tests.common as common
class TestL10nBRSaleProduct(common.TransactionCase):
def setUp(self):
super(TestL10nBRSaleProduct, self).setUp()
... | <commit_before><commit_msg>[12.0][MIG][WIP] Move test from l10n_br_sale_product to l10n_br_sale.<commit_after> | # @ 2019 Akretion - www.akretion.com.br -
# Magno Costa <magno.costa@akretion.com.br>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
import odoo.tests.common as common
class TestL10nBRSaleProduct(common.TransactionCase):
def setUp(self):
super(TestL10nBRSaleProduct, self).setUp()
... | [12.0][MIG][WIP] Move test from l10n_br_sale_product to l10n_br_sale.# @ 2019 Akretion - www.akretion.com.br -
# Magno Costa <magno.costa@akretion.com.br>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
import odoo.tests.common as common
class TestL10nBRSaleProduct(common.TransactionCase):
... | <commit_before><commit_msg>[12.0][MIG][WIP] Move test from l10n_br_sale_product to l10n_br_sale.<commit_after># @ 2019 Akretion - www.akretion.com.br -
# Magno Costa <magno.costa@akretion.com.br>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
import odoo.tests.common as common
class TestL10nB... | |
4000af5d4ca53683b4577d7394c923c22f79ca52 | simulate_loads.py | simulate_loads.py | import random
import itertools as it
from sklearn.externals import joblib
def simulate_loads(nfrag, ngt, q):
loads = [1] * nfrag
active = set(range(nfrag))
for k in range(1, len(loads)):
i0, i1 = random.sample(active, k=2)
active.remove(i0)
active.remove(i1)
active.add(len(l... | Add function to simulate load of CSR merge matrix | Add function to simulate load of CSR merge matrix
| Python | bsd-3-clause | jni/gala-scripts | Add function to simulate load of CSR merge matrix | import random
import itertools as it
from sklearn.externals import joblib
def simulate_loads(nfrag, ngt, q):
loads = [1] * nfrag
active = set(range(nfrag))
for k in range(1, len(loads)):
i0, i1 = random.sample(active, k=2)
active.remove(i0)
active.remove(i1)
active.add(len(l... | <commit_before><commit_msg>Add function to simulate load of CSR merge matrix<commit_after> | import random
import itertools as it
from sklearn.externals import joblib
def simulate_loads(nfrag, ngt, q):
loads = [1] * nfrag
active = set(range(nfrag))
for k in range(1, len(loads)):
i0, i1 = random.sample(active, k=2)
active.remove(i0)
active.remove(i1)
active.add(len(l... | Add function to simulate load of CSR merge matriximport random
import itertools as it
from sklearn.externals import joblib
def simulate_loads(nfrag, ngt, q):
loads = [1] * nfrag
active = set(range(nfrag))
for k in range(1, len(loads)):
i0, i1 = random.sample(active, k=2)
active.remove(i0)
... | <commit_before><commit_msg>Add function to simulate load of CSR merge matrix<commit_after>import random
import itertools as it
from sklearn.externals import joblib
def simulate_loads(nfrag, ngt, q):
loads = [1] * nfrag
active = set(range(nfrag))
for k in range(1, len(loads)):
i0, i1 = random.sample... | |
4a4cb336839d42cee872e52399e17249b948492a | rackattack/common/globallock.py | rackattack/common/globallock.py | import threading
import contextlib
import time
import traceback
import logging
_lock = threading.Lock()
@contextlib.contextmanager
def lock():
before = time.time()
with _lock:
acquired = time.time()
took = acquired - before
if took > 0.1:
logging.error(
"A... | import threading
import contextlib
import time
import traceback
import logging
_lock = threading.Lock()
def prettyStack():
return "\n".join([line.strip() for line in traceback.format_stack()])
@contextlib.contextmanager
def lock():
before = time.time()
with _lock:
acquired = time.time()
... | Print the stack info more clearly, when holding the global lock for too long | Print the stack info more clearly, when holding the global lock for too long
| Python | apache-2.0 | Stratoscale/rackattack-virtual,eliran-stratoscale/rackattack-virtual,Stratoscale/rackattack-virtual,eliran-stratoscale/rackattack-virtual | import threading
import contextlib
import time
import traceback
import logging
_lock = threading.Lock()
@contextlib.contextmanager
def lock():
before = time.time()
with _lock:
acquired = time.time()
took = acquired - before
if took > 0.1:
logging.error(
"A... | import threading
import contextlib
import time
import traceback
import logging
_lock = threading.Lock()
def prettyStack():
return "\n".join([line.strip() for line in traceback.format_stack()])
@contextlib.contextmanager
def lock():
before = time.time()
with _lock:
acquired = time.time()
... | <commit_before>import threading
import contextlib
import time
import traceback
import logging
_lock = threading.Lock()
@contextlib.contextmanager
def lock():
before = time.time()
with _lock:
acquired = time.time()
took = acquired - before
if took > 0.1:
logging.error(
... | import threading
import contextlib
import time
import traceback
import logging
_lock = threading.Lock()
def prettyStack():
return "\n".join([line.strip() for line in traceback.format_stack()])
@contextlib.contextmanager
def lock():
before = time.time()
with _lock:
acquired = time.time()
... | import threading
import contextlib
import time
import traceback
import logging
_lock = threading.Lock()
@contextlib.contextmanager
def lock():
before = time.time()
with _lock:
acquired = time.time()
took = acquired - before
if took > 0.1:
logging.error(
"A... | <commit_before>import threading
import contextlib
import time
import traceback
import logging
_lock = threading.Lock()
@contextlib.contextmanager
def lock():
before = time.time()
with _lock:
acquired = time.time()
took = acquired - before
if took > 0.1:
logging.error(
... |
217b5fd119a835ee0c3f2a359fe814727ef1c954 | misc/system_list.py | misc/system_list.py | import lxml
import json
import urllib
from lxml import etree
tmpresponce = urllib.urlopen("https://api.eveonline.com/map/Sovereignty.xml.aspx")
resString = tmpresponce.read()
#print type(resString)
parser = etree.XMLParser(remove_blank_text=True)
responce = etree.XML(resString, parser)
print "starting"
systemID... | Load the Sovereignty xml and process | Load the Sovereignty xml and process
Compose a list of SystemID to SystemName mappings
| Python | apache-2.0 | Funi1234/InternetSpaceships,Funi1234/InternetSpaceships,Funi1234/InternetSpaceships | Load the Sovereignty xml and process
Compose a list of SystemID to SystemName mappings | import lxml
import json
import urllib
from lxml import etree
tmpresponce = urllib.urlopen("https://api.eveonline.com/map/Sovereignty.xml.aspx")
resString = tmpresponce.read()
#print type(resString)
parser = etree.XMLParser(remove_blank_text=True)
responce = etree.XML(resString, parser)
print "starting"
systemID... | <commit_before><commit_msg>Load the Sovereignty xml and process
Compose a list of SystemID to SystemName mappings<commit_after> | import lxml
import json
import urllib
from lxml import etree
tmpresponce = urllib.urlopen("https://api.eveonline.com/map/Sovereignty.xml.aspx")
resString = tmpresponce.read()
#print type(resString)
parser = etree.XMLParser(remove_blank_text=True)
responce = etree.XML(resString, parser)
print "starting"
systemID... | Load the Sovereignty xml and process
Compose a list of SystemID to SystemName mappingsimport lxml
import json
import urllib
from lxml import etree
tmpresponce = urllib.urlopen("https://api.eveonline.com/map/Sovereignty.xml.aspx")
resString = tmpresponce.read()
#print type(resString)
parser = etree.XMLParser(remov... | <commit_before><commit_msg>Load the Sovereignty xml and process
Compose a list of SystemID to SystemName mappings<commit_after>import lxml
import json
import urllib
from lxml import etree
tmpresponce = urllib.urlopen("https://api.eveonline.com/map/Sovereignty.xml.aspx")
resString = tmpresponce.read()
#print type(re... | |
0493098758f1c500a76852e9b032d2c867829ba8 | src/ggrc/migrations/versions/20150326190126_16883afbc18b_update_status_column_to_draft.py | src/ggrc/migrations/versions/20150326190126_16883afbc18b_update_status_column_to_draft.py |
"""Update status column to draft
Revision ID: 16883afbc18b
Revises: 56bda17c92ee
Create Date: 2015-03-26 19:01:26.702662
"""
# revision identifiers, used by Alembic.
revision = '16883afbc18b'
down_revision = '56bda17c92ee'
from alembic import op
import sqlalchemy as sa
from sqlalchemy.sql import table, column
from... | Update object status to Draft when null, CORE-1519 | Update object status to Draft when null, CORE-1519
| Python | apache-2.0 | AleksNeStu/ggrc-core,VinnieJohns/ggrc-core,VinnieJohns/ggrc-core,josthkko/ggrc-core,NejcZupec/ggrc-core,hyperNURb/ggrc-core,kr41/ggrc-core,vladan-m/ggrc-core,josthkko/ggrc-core,uskudnik/ggrc-core,vladan-m/ggrc-core,hasanalom/ggrc-core,jmakov/ggrc-core,andrei-karalionak/ggrc-core,VinnieJohns/ggrc-core,j0gurt/ggrc-core,h... | Update object status to Draft when null, CORE-1519 |
"""Update status column to draft
Revision ID: 16883afbc18b
Revises: 56bda17c92ee
Create Date: 2015-03-26 19:01:26.702662
"""
# revision identifiers, used by Alembic.
revision = '16883afbc18b'
down_revision = '56bda17c92ee'
from alembic import op
import sqlalchemy as sa
from sqlalchemy.sql import table, column
from... | <commit_before><commit_msg>Update object status to Draft when null, CORE-1519<commit_after> |
"""Update status column to draft
Revision ID: 16883afbc18b
Revises: 56bda17c92ee
Create Date: 2015-03-26 19:01:26.702662
"""
# revision identifiers, used by Alembic.
revision = '16883afbc18b'
down_revision = '56bda17c92ee'
from alembic import op
import sqlalchemy as sa
from sqlalchemy.sql import table, column
from... | Update object status to Draft when null, CORE-1519
"""Update status column to draft
Revision ID: 16883afbc18b
Revises: 56bda17c92ee
Create Date: 2015-03-26 19:01:26.702662
"""
# revision identifiers, used by Alembic.
revision = '16883afbc18b'
down_revision = '56bda17c92ee'
from alembic import op
import sqlalchemy a... | <commit_before><commit_msg>Update object status to Draft when null, CORE-1519<commit_after>
"""Update status column to draft
Revision ID: 16883afbc18b
Revises: 56bda17c92ee
Create Date: 2015-03-26 19:01:26.702662
"""
# revision identifiers, used by Alembic.
revision = '16883afbc18b'
down_revision = '56bda17c92ee'
f... | |
a821717103f8b469b71cee4f60fce50dd792cb36 | InvenTree/stock/migrations/0071_auto_20211205_1733.py | InvenTree/stock/migrations/0071_auto_20211205_1733.py | # Generated by Django 3.2.5 on 2021-12-05 06:33
from django.db import migrations
import logging
logger = logging.getLogger('inventree')
def delete_scheduled(apps, schema_editor):
"""
Delete all stock items which are marked as 'scheduled_for_deletion'.
The issue that this field was addressing has now ... | Add a data migration which deletes any stock items which have been scheduled for deletion. | Add a data migration which deletes any stock items which have been scheduled for deletion.
Also deletes any instance of the "delete_old_stock_items" worker task
| Python | mit | SchrodingersGat/InvenTree,inventree/InvenTree,inventree/InvenTree,SchrodingersGat/InvenTree,SchrodingersGat/InvenTree,SchrodingersGat/InvenTree,inventree/InvenTree,inventree/InvenTree | Add a data migration which deletes any stock items which have been scheduled for deletion.
Also deletes any instance of the "delete_old_stock_items" worker task | # Generated by Django 3.2.5 on 2021-12-05 06:33
from django.db import migrations
import logging
logger = logging.getLogger('inventree')
def delete_scheduled(apps, schema_editor):
"""
Delete all stock items which are marked as 'scheduled_for_deletion'.
The issue that this field was addressing has now ... | <commit_before><commit_msg>Add a data migration which deletes any stock items which have been scheduled for deletion.
Also deletes any instance of the "delete_old_stock_items" worker task<commit_after> | # Generated by Django 3.2.5 on 2021-12-05 06:33
from django.db import migrations
import logging
logger = logging.getLogger('inventree')
def delete_scheduled(apps, schema_editor):
"""
Delete all stock items which are marked as 'scheduled_for_deletion'.
The issue that this field was addressing has now ... | Add a data migration which deletes any stock items which have been scheduled for deletion.
Also deletes any instance of the "delete_old_stock_items" worker task# Generated by Django 3.2.5 on 2021-12-05 06:33
from django.db import migrations
import logging
logger = logging.getLogger('inventree')
def delete_schedu... | <commit_before><commit_msg>Add a data migration which deletes any stock items which have been scheduled for deletion.
Also deletes any instance of the "delete_old_stock_items" worker task<commit_after># Generated by Django 3.2.5 on 2021-12-05 06:33
from django.db import migrations
import logging
logger = logging.g... | |
2de2a7fc80df710e308846ffde8aa4546e832394 | chrome/PRESUBMIT.py | chrome/PRESUBMIT.py | # Copyright (c) 2009 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.
"""Makes sure that the chrome/ code is cpplint clean."""
INCLUDE_CPP_FILES_ONLY = (
r'.*\.cc$', r'.*\.h$'
)
EXCLUDE = (
# Objective C confuses ever... | Call the new presubmit checks from chrome/ code, with a blacklist. | Call the new presubmit checks from chrome/ code, with a blacklist.
Review URL: http://codereview.chromium.org/400014
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@32190 0039d316-1c4b-4281-b951-d872f2087c98
| Python | bsd-3-clause | yitian134/chromium,adobe/chromium,ropik/chromium,adobe/chromium,adobe/chromium,ropik/chromium,Crystalnix/house-of-life-chromium,yitian134/chromium,yitian134/chromium,gavinp/chromium,Crystalnix/house-of-life-chromium,yitian134/chromium,Crystalnix/house-of-life-chromium,gavinp/chromium,yitian134/chromium,adobe/chromium,C... | Call the new presubmit checks from chrome/ code, with a blacklist.
Review URL: http://codereview.chromium.org/400014
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@32190 0039d316-1c4b-4281-b951-d872f2087c98 | # Copyright (c) 2009 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.
"""Makes sure that the chrome/ code is cpplint clean."""
INCLUDE_CPP_FILES_ONLY = (
r'.*\.cc$', r'.*\.h$'
)
EXCLUDE = (
# Objective C confuses ever... | <commit_before><commit_msg>Call the new presubmit checks from chrome/ code, with a blacklist.
Review URL: http://codereview.chromium.org/400014
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@32190 0039d316-1c4b-4281-b951-d872f2087c98<commit_after> | # Copyright (c) 2009 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.
"""Makes sure that the chrome/ code is cpplint clean."""
INCLUDE_CPP_FILES_ONLY = (
r'.*\.cc$', r'.*\.h$'
)
EXCLUDE = (
# Objective C confuses ever... | Call the new presubmit checks from chrome/ code, with a blacklist.
Review URL: http://codereview.chromium.org/400014
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@32190 0039d316-1c4b-4281-b951-d872f2087c98# Copyright (c) 2009 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a... | <commit_before><commit_msg>Call the new presubmit checks from chrome/ code, with a blacklist.
Review URL: http://codereview.chromium.org/400014
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@32190 0039d316-1c4b-4281-b951-d872f2087c98<commit_after># Copyright (c) 2009 The Chromium Authors. All rights reserved.
#... | |
ed6fa694ea7ce62cdbda89a60cbbaad1409c285b | misc/add_source_header.py | misc/add_source_header.py | #!/usr/bin/env python
import sys
import itertools
import os
import re
import traceback
from optparse import OptionParser
header_path = "source_header.txt"
def debug(s):
sys.stderr.write("[DEBUG] %s\n" % s)
def error(s):
sys.stderr.write("[ERROR] %s\n" % s)
def main():
parser = OptionParser()
(optio... | Add a utility script to add source header | Add a utility script to add source header
| Python | bsd-3-clause | naoyam/physis,naoyam/physis,naoyam/physis,naoyam/physis | Add a utility script to add source header | #!/usr/bin/env python
import sys
import itertools
import os
import re
import traceback
from optparse import OptionParser
header_path = "source_header.txt"
def debug(s):
sys.stderr.write("[DEBUG] %s\n" % s)
def error(s):
sys.stderr.write("[ERROR] %s\n" % s)
def main():
parser = OptionParser()
(optio... | <commit_before><commit_msg>Add a utility script to add source header<commit_after> | #!/usr/bin/env python
import sys
import itertools
import os
import re
import traceback
from optparse import OptionParser
header_path = "source_header.txt"
def debug(s):
sys.stderr.write("[DEBUG] %s\n" % s)
def error(s):
sys.stderr.write("[ERROR] %s\n" % s)
def main():
parser = OptionParser()
(optio... | Add a utility script to add source header#!/usr/bin/env python
import sys
import itertools
import os
import re
import traceback
from optparse import OptionParser
header_path = "source_header.txt"
def debug(s):
sys.stderr.write("[DEBUG] %s\n" % s)
def error(s):
sys.stderr.write("[ERROR] %s\n" % s)
def main(... | <commit_before><commit_msg>Add a utility script to add source header<commit_after>#!/usr/bin/env python
import sys
import itertools
import os
import re
import traceback
from optparse import OptionParser
header_path = "source_header.txt"
def debug(s):
sys.stderr.write("[DEBUG] %s\n" % s)
def error(s):
sys.st... | |
57e108e2b1680dc5ec26142d43e90207ec1a8a37 | app/common/falcon/error_handlers.py | app/common/falcon/error_handlers.py | from __future__ import unicode_literals, absolute_import, division
import re
import json
from uuid import uuid4
import falcon.responders
from falcon import HTTP_500, HTTP_404, HTTP_405
from app.common.errors import BaseAppError
from app.common.text_utils import to_first_lower
def _handle_app_error(ex, req, res, par... | Add handlers for internal/user errors, not found, method not allowed | Add handlers for internal/user errors, not found, method not allowed
| Python | mit | diyan/falcon_seed | Add handlers for internal/user errors, not found, method not allowed | from __future__ import unicode_literals, absolute_import, division
import re
import json
from uuid import uuid4
import falcon.responders
from falcon import HTTP_500, HTTP_404, HTTP_405
from app.common.errors import BaseAppError
from app.common.text_utils import to_first_lower
def _handle_app_error(ex, req, res, par... | <commit_before><commit_msg>Add handlers for internal/user errors, not found, method not allowed<commit_after> | from __future__ import unicode_literals, absolute_import, division
import re
import json
from uuid import uuid4
import falcon.responders
from falcon import HTTP_500, HTTP_404, HTTP_405
from app.common.errors import BaseAppError
from app.common.text_utils import to_first_lower
def _handle_app_error(ex, req, res, par... | Add handlers for internal/user errors, not found, method not allowedfrom __future__ import unicode_literals, absolute_import, division
import re
import json
from uuid import uuid4
import falcon.responders
from falcon import HTTP_500, HTTP_404, HTTP_405
from app.common.errors import BaseAppError
from app.common.text_u... | <commit_before><commit_msg>Add handlers for internal/user errors, not found, method not allowed<commit_after>from __future__ import unicode_literals, absolute_import, division
import re
import json
from uuid import uuid4
import falcon.responders
from falcon import HTTP_500, HTTP_404, HTTP_405
from app.common.errors i... | |
4718be19fd198ca0a2eaf4582dc283d52f40d42a | scripts/check-used-functions.py | scripts/check-used-functions.py | #!/usr/bin/env python
"""
Check that all the functions defined in the chemfiles-sys crate are
effectivelly used in the chemfiles binding.
"""
import os
ROOT = os.path.dirname(os.path.dirname(__file__))
def functions_list():
functions = []
with open(os.path.join(ROOT, "src", "chemfiles", "ffi.py")) as fd:
... | Add a script to check if all function are wraped to Python | Add a script to check if all function are wraped to Python
| Python | mpl-2.0 | Luthaf/Chemharp-python | Add a script to check if all function are wraped to Python | #!/usr/bin/env python
"""
Check that all the functions defined in the chemfiles-sys crate are
effectivelly used in the chemfiles binding.
"""
import os
ROOT = os.path.dirname(os.path.dirname(__file__))
def functions_list():
functions = []
with open(os.path.join(ROOT, "src", "chemfiles", "ffi.py")) as fd:
... | <commit_before><commit_msg>Add a script to check if all function are wraped to Python<commit_after> | #!/usr/bin/env python
"""
Check that all the functions defined in the chemfiles-sys crate are
effectivelly used in the chemfiles binding.
"""
import os
ROOT = os.path.dirname(os.path.dirname(__file__))
def functions_list():
functions = []
with open(os.path.join(ROOT, "src", "chemfiles", "ffi.py")) as fd:
... | Add a script to check if all function are wraped to Python#!/usr/bin/env python
"""
Check that all the functions defined in the chemfiles-sys crate are
effectivelly used in the chemfiles binding.
"""
import os
ROOT = os.path.dirname(os.path.dirname(__file__))
def functions_list():
functions = []
with open(os... | <commit_before><commit_msg>Add a script to check if all function are wraped to Python<commit_after>#!/usr/bin/env python
"""
Check that all the functions defined in the chemfiles-sys crate are
effectivelly used in the chemfiles binding.
"""
import os
ROOT = os.path.dirname(os.path.dirname(__file__))
def functions_li... | |
77e489734f0206ba454c7b855615451b7cf021e1 | djangae/blobstore_service.py | djangae/blobstore_service.py | import os
import threading
import logging
blobstore_service = None
server = None
def start_blobstore_service():
"""
When the blobstore files API was deprecated, the blobstore storage was switched
to use a POST request to the upload handler when storing files uploaded via Django.
Unfortu... | import os
import threading
import logging
blobstore_service = None
server = None
def start_blobstore_service():
"""
When the blobstore files API was deprecated, the blobstore storage was switched
to use a POST request to the upload handler when storing files uploaded via Django.
Unfortu... | Make the blobstore service wsgi handler only serve our upload handler view | Make the blobstore service wsgi handler only serve our upload handler view
| Python | bsd-3-clause | potatolondon/djangae,leekchan/djangae,armirusco/djangae,armirusco/djangae,chargrizzle/djangae,chargrizzle/djangae,asendecka/djangae,jscissr/djangae,grzes/djangae,jscissr/djangae,kirberich/djangae,trik/djangae,chargrizzle/djangae,wangjun/djangae,wangjun/djangae,asendecka/djangae,asendecka/djangae,kirberich/djangae,SiPig... | import os
import threading
import logging
blobstore_service = None
server = None
def start_blobstore_service():
"""
When the blobstore files API was deprecated, the blobstore storage was switched
to use a POST request to the upload handler when storing files uploaded via Django.
Unfortu... | import os
import threading
import logging
blobstore_service = None
server = None
def start_blobstore_service():
"""
When the blobstore files API was deprecated, the blobstore storage was switched
to use a POST request to the upload handler when storing files uploaded via Django.
Unfortu... | <commit_before>import os
import threading
import logging
blobstore_service = None
server = None
def start_blobstore_service():
"""
When the blobstore files API was deprecated, the blobstore storage was switched
to use a POST request to the upload handler when storing files uploaded via Django.
... | import os
import threading
import logging
blobstore_service = None
server = None
def start_blobstore_service():
"""
When the blobstore files API was deprecated, the blobstore storage was switched
to use a POST request to the upload handler when storing files uploaded via Django.
Unfortu... | import os
import threading
import logging
blobstore_service = None
server = None
def start_blobstore_service():
"""
When the blobstore files API was deprecated, the blobstore storage was switched
to use a POST request to the upload handler when storing files uploaded via Django.
Unfortu... | <commit_before>import os
import threading
import logging
blobstore_service = None
server = None
def start_blobstore_service():
"""
When the blobstore files API was deprecated, the blobstore storage was switched
to use a POST request to the upload handler when storing files uploaded via Django.
... |
61fe7343a7792d388edb074a0c8e4382e2d8adc1 | color_transformations_skimage.py | color_transformations_skimage.py | import numpy as np
import matplotlib.colors as mcolors
from skimage.color import rgb2lab as rgb2lab_skimage
from skimage.color import lab2rgb as lab2rgb_skimage
class RGBRangeError(Exception):
pass
def rgb2lab(rgb):
rgb = np.asarray(rgb).reshape(1, 1, 3)
lab = rgb2lab_skimage(rgb).reshape(3)
return ... | Use color transformation functions from scikit-image for now, even though it is a bit slower (there seems to be a bug somewhere in my manual implementation). | Use color transformation functions from scikit-image for now, even though it is a bit slower (there seems to be a bug somewhere in my manual implementation).
| Python | mit | maxalbert/colormap-selector | Use color transformation functions from scikit-image for now, even though it is a bit slower (there seems to be a bug somewhere in my manual implementation). | import numpy as np
import matplotlib.colors as mcolors
from skimage.color import rgb2lab as rgb2lab_skimage
from skimage.color import lab2rgb as lab2rgb_skimage
class RGBRangeError(Exception):
pass
def rgb2lab(rgb):
rgb = np.asarray(rgb).reshape(1, 1, 3)
lab = rgb2lab_skimage(rgb).reshape(3)
return ... | <commit_before><commit_msg>Use color transformation functions from scikit-image for now, even though it is a bit slower (there seems to be a bug somewhere in my manual implementation).<commit_after> | import numpy as np
import matplotlib.colors as mcolors
from skimage.color import rgb2lab as rgb2lab_skimage
from skimage.color import lab2rgb as lab2rgb_skimage
class RGBRangeError(Exception):
pass
def rgb2lab(rgb):
rgb = np.asarray(rgb).reshape(1, 1, 3)
lab = rgb2lab_skimage(rgb).reshape(3)
return ... | Use color transformation functions from scikit-image for now, even though it is a bit slower (there seems to be a bug somewhere in my manual implementation).import numpy as np
import matplotlib.colors as mcolors
from skimage.color import rgb2lab as rgb2lab_skimage
from skimage.color import lab2rgb as lab2rgb_skimage
... | <commit_before><commit_msg>Use color transformation functions from scikit-image for now, even though it is a bit slower (there seems to be a bug somewhere in my manual implementation).<commit_after>import numpy as np
import matplotlib.colors as mcolors
from skimage.color import rgb2lab as rgb2lab_skimage
from skimage.c... | |
e7b78b3de38faed02ed2168cd6b8f1cae2cbf575 | src/core/migrations/0073_auto_20220630_1608.py | src/core/migrations/0073_auto_20220630_1608.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2022-06-30 14:08
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0072_auto_20220623_1028'),
]
operations = [
migrations.AlterField(... | Add migration for new `max_length` of field `username`. | Add migration for new `max_length` of field `username`.
| Python | agpl-3.0 | BirkbeckCTP/janeway,BirkbeckCTP/janeway,BirkbeckCTP/janeway,BirkbeckCTP/janeway | Add migration for new `max_length` of field `username`. | # -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2022-06-30 14:08
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0072_auto_20220623_1028'),
]
operations = [
migrations.AlterField(... | <commit_before><commit_msg>Add migration for new `max_length` of field `username`.<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2022-06-30 14:08
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0072_auto_20220623_1028'),
]
operations = [
migrations.AlterField(... | Add migration for new `max_length` of field `username`.# -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2022-06-30 14:08
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0072_auto_20220623_1028'),
... | <commit_before><commit_msg>Add migration for new `max_length` of field `username`.<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2022-06-30 14:08
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
... | |
0ee87c220610b2e27330af7df61ae740a909405d | regparser/commands/proposal_pipeline.py | regparser/commands/proposal_pipeline.py | import click
from regparser.commands.annual_editions import annual_editions
from regparser.commands.current_version import current_version
from regparser.commands.diffs import diffs
from regparser.commands.fill_with_rules import fill_with_rules
from regparser.commands.import_notice import import_notice, parse_notice
f... | Add an analog to `pipeline` to deal with proposals | Add an analog to `pipeline` to deal with proposals
Some of the underlying commands aren't using dependencies properly, so there's
significant rebuilding every run. That said, it works!
| Python | cc0-1.0 | tadhg-ohiggins/regulations-parser,eregs/regulations-parser,eregs/regulations-parser,tadhg-ohiggins/regulations-parser | Add an analog to `pipeline` to deal with proposals
Some of the underlying commands aren't using dependencies properly, so there's
significant rebuilding every run. That said, it works! | import click
from regparser.commands.annual_editions import annual_editions
from regparser.commands.current_version import current_version
from regparser.commands.diffs import diffs
from regparser.commands.fill_with_rules import fill_with_rules
from regparser.commands.import_notice import import_notice, parse_notice
f... | <commit_before><commit_msg>Add an analog to `pipeline` to deal with proposals
Some of the underlying commands aren't using dependencies properly, so there's
significant rebuilding every run. That said, it works!<commit_after> | import click
from regparser.commands.annual_editions import annual_editions
from regparser.commands.current_version import current_version
from regparser.commands.diffs import diffs
from regparser.commands.fill_with_rules import fill_with_rules
from regparser.commands.import_notice import import_notice, parse_notice
f... | Add an analog to `pipeline` to deal with proposals
Some of the underlying commands aren't using dependencies properly, so there's
significant rebuilding every run. That said, it works!import click
from regparser.commands.annual_editions import annual_editions
from regparser.commands.current_version import current_ver... | <commit_before><commit_msg>Add an analog to `pipeline` to deal with proposals
Some of the underlying commands aren't using dependencies properly, so there's
significant rebuilding every run. That said, it works!<commit_after>import click
from regparser.commands.annual_editions import annual_editions
from regparser.co... | |
9ec49fe0d699e19d9a325b8e73bff4d7a75b8de4 | studies/migrations/0037_response_date_created.py | studies/migrations/0037_response_date_created.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-11-07 22:28
from __future__ import unicode_literals
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('studies', '0036_add_scheduled_jobs'),
]
operations = [... | Add migration to add date_created field to response. | Add migration to add date_created field to response.
| Python | apache-2.0 | CenterForOpenScience/lookit-api,CenterForOpenScience/lookit-api,CenterForOpenScience/lookit-api | Add migration to add date_created field to response. | # -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-11-07 22:28
from __future__ import unicode_literals
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('studies', '0036_add_scheduled_jobs'),
]
operations = [... | <commit_before><commit_msg>Add migration to add date_created field to response.<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-11-07 22:28
from __future__ import unicode_literals
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('studies', '0036_add_scheduled_jobs'),
]
operations = [... | Add migration to add date_created field to response.# -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-11-07 22:28
from __future__ import unicode_literals
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('studies', '... | <commit_before><commit_msg>Add migration to add date_created field to response.<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-11-07 22:28
from __future__ import unicode_literals
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.