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
4a83a84f5358482fab7d1b7b7e259aed2b958e5d
maas/client/viscera/tests/test_sshkeys.py
maas/client/viscera/tests/test_sshkeys.py
"""Test for `maas.client.viscera.sshkeys`.""" from maas.client.viscera import Origin from .. import sshkeys from ...testing import TestCase from ..testing import bind def make_origin(): return bind(sshkeys.SSHKeys, sshkeys.SSHKey) class TestSSHKeys(TestCase): def test__sshkeys_read(self): """ SSHK...
Add tests for ssh keys (first draft)
Add tests for ssh keys (first draft)
Python
agpl-3.0
alburnum/alburnum-maas-client,blakerouse/python-libmaas
Add tests for ssh keys (first draft)
"""Test for `maas.client.viscera.sshkeys`.""" from maas.client.viscera import Origin from .. import sshkeys from ...testing import TestCase from ..testing import bind def make_origin(): return bind(sshkeys.SSHKeys, sshkeys.SSHKey) class TestSSHKeys(TestCase): def test__sshkeys_read(self): """ SSHK...
<commit_before><commit_msg>Add tests for ssh keys (first draft)<commit_after>
"""Test for `maas.client.viscera.sshkeys`.""" from maas.client.viscera import Origin from .. import sshkeys from ...testing import TestCase from ..testing import bind def make_origin(): return bind(sshkeys.SSHKeys, sshkeys.SSHKey) class TestSSHKeys(TestCase): def test__sshkeys_read(self): """ SSHK...
Add tests for ssh keys (first draft)"""Test for `maas.client.viscera.sshkeys`.""" from maas.client.viscera import Origin from .. import sshkeys from ...testing import TestCase from ..testing import bind def make_origin(): return bind(sshkeys.SSHKeys, sshkeys.SSHKey) class TestSSHKeys(TestCase): def test__...
<commit_before><commit_msg>Add tests for ssh keys (first draft)<commit_after>"""Test for `maas.client.viscera.sshkeys`.""" from maas.client.viscera import Origin from .. import sshkeys from ...testing import TestCase from ..testing import bind def make_origin(): return bind(sshkeys.SSHKeys, sshkeys.SSHKey) cla...
a5bf6c1a329f5d1a85222f9abf6635b07722a8b1
tests/grammar_creation_test/__init__.py
tests/grammar_creation_test/__init__.py
#!/usr/bin/env python """ :Author Patrik Valkovic :Created 23.06.2017 16:39 :Licence GNUv3 Part of grammpy """
Add directory for grammar creation tests
Add directory for grammar creation tests
Python
mit
PatrikValkovic/grammpy
Add directory for grammar creation tests
#!/usr/bin/env python """ :Author Patrik Valkovic :Created 23.06.2017 16:39 :Licence GNUv3 Part of grammpy """
<commit_before><commit_msg>Add directory for grammar creation tests<commit_after>
#!/usr/bin/env python """ :Author Patrik Valkovic :Created 23.06.2017 16:39 :Licence GNUv3 Part of grammpy """
Add directory for grammar creation tests#!/usr/bin/env python """ :Author Patrik Valkovic :Created 23.06.2017 16:39 :Licence GNUv3 Part of grammpy """
<commit_before><commit_msg>Add directory for grammar creation tests<commit_after>#!/usr/bin/env python """ :Author Patrik Valkovic :Created 23.06.2017 16:39 :Licence GNUv3 Part of grammpy """
79245b929d7084e262d0e1d19db1a368d51ca2fc
datasets/management/commands/clear_computing_keys.py
datasets/management/commands/clear_computing_keys.py
from django.core.management.base import BaseCommand from utils.redis_store import store class Command(BaseCommand): help = 'Remove all computing keys stored in Redis Store. Use it as python manage.py clear_store' def add_arguments(self, parser): pass def handle(self, *args, **options): c...
Add managment command clear redis computing keys
Add managment command clear redis computing keys
Python
agpl-3.0
MTG/freesound-datasets,MTG/freesound-datasets,MTG/freesound-datasets,MTG/freesound-datasets
Add managment command clear redis computing keys
from django.core.management.base import BaseCommand from utils.redis_store import store class Command(BaseCommand): help = 'Remove all computing keys stored in Redis Store. Use it as python manage.py clear_store' def add_arguments(self, parser): pass def handle(self, *args, **options): c...
<commit_before><commit_msg>Add managment command clear redis computing keys<commit_after>
from django.core.management.base import BaseCommand from utils.redis_store import store class Command(BaseCommand): help = 'Remove all computing keys stored in Redis Store. Use it as python manage.py clear_store' def add_arguments(self, parser): pass def handle(self, *args, **options): c...
Add managment command clear redis computing keysfrom django.core.management.base import BaseCommand from utils.redis_store import store class Command(BaseCommand): help = 'Remove all computing keys stored in Redis Store. Use it as python manage.py clear_store' def add_arguments(self, parser): pass ...
<commit_before><commit_msg>Add managment command clear redis computing keys<commit_after>from django.core.management.base import BaseCommand from utils.redis_store import store class Command(BaseCommand): help = 'Remove all computing keys stored in Redis Store. Use it as python manage.py clear_store' def add...
3f2492d522134efd630c3388f4531efd7274dec5
examples/test_request_sb_fixture.py
examples/test_request_sb_fixture.py
def test_request_sb_fixture(request): sb = request.getfixturevalue('sb') sb.open("https://seleniumbase.io/demo_page") sb.assert_text("SeleniumBase", "#myForm h2") sb.assert_element("input#myTextInput") sb.type("#myTextarea", "This is me") sb.click("#myButton") sb.tearDown()
Add an example that pulls in the sb fixture during a test
Add an example that pulls in the sb fixture during a test
Python
mit
seleniumbase/SeleniumBase,mdmintz/SeleniumBase,mdmintz/SeleniumBase,seleniumbase/SeleniumBase,mdmintz/SeleniumBase,seleniumbase/SeleniumBase,seleniumbase/SeleniumBase,mdmintz/SeleniumBase
Add an example that pulls in the sb fixture during a test
def test_request_sb_fixture(request): sb = request.getfixturevalue('sb') sb.open("https://seleniumbase.io/demo_page") sb.assert_text("SeleniumBase", "#myForm h2") sb.assert_element("input#myTextInput") sb.type("#myTextarea", "This is me") sb.click("#myButton") sb.tearDown()
<commit_before><commit_msg>Add an example that pulls in the sb fixture during a test<commit_after>
def test_request_sb_fixture(request): sb = request.getfixturevalue('sb') sb.open("https://seleniumbase.io/demo_page") sb.assert_text("SeleniumBase", "#myForm h2") sb.assert_element("input#myTextInput") sb.type("#myTextarea", "This is me") sb.click("#myButton") sb.tearDown()
Add an example that pulls in the sb fixture during a testdef test_request_sb_fixture(request): sb = request.getfixturevalue('sb') sb.open("https://seleniumbase.io/demo_page") sb.assert_text("SeleniumBase", "#myForm h2") sb.assert_element("input#myTextInput") sb.type("#myTextarea", "This is me")...
<commit_before><commit_msg>Add an example that pulls in the sb fixture during a test<commit_after>def test_request_sb_fixture(request): sb = request.getfixturevalue('sb') sb.open("https://seleniumbase.io/demo_page") sb.assert_text("SeleniumBase", "#myForm h2") sb.assert_element("input#myTextInput") ...
89d7e956e5194a1533c25b609928c77707f78785
tests/test_importable.py
tests/test_importable.py
"""Basic set of tests to ensure entire code base is importable""" import pytest def test_importable(): """Simple smoketest to ensure all isort modules are importable""" import isort import isort._future import isort._future._dataclasses import isort._version import isort.api import isort.c...
Add basic import smoke test
Add basic import smoke test
Python
mit
PyCQA/isort,PyCQA/isort
Add basic import smoke test
"""Basic set of tests to ensure entire code base is importable""" import pytest def test_importable(): """Simple smoketest to ensure all isort modules are importable""" import isort import isort._future import isort._future._dataclasses import isort._version import isort.api import isort.c...
<commit_before><commit_msg>Add basic import smoke test<commit_after>
"""Basic set of tests to ensure entire code base is importable""" import pytest def test_importable(): """Simple smoketest to ensure all isort modules are importable""" import isort import isort._future import isort._future._dataclasses import isort._version import isort.api import isort.c...
Add basic import smoke test"""Basic set of tests to ensure entire code base is importable""" import pytest def test_importable(): """Simple smoketest to ensure all isort modules are importable""" import isort import isort._future import isort._future._dataclasses import isort._version import i...
<commit_before><commit_msg>Add basic import smoke test<commit_after>"""Basic set of tests to ensure entire code base is importable""" import pytest def test_importable(): """Simple smoketest to ensure all isort modules are importable""" import isort import isort._future import isort._future._dataclass...
7c12c6c8f0be5c611c5463277a574489a4b9a338
migrations/versions/0325_int_letter_rates_fix.py
migrations/versions/0325_int_letter_rates_fix.py
""" Revision ID: 0325_int_letter_rates_fix Revises: 0324_int_letter_rates Create Date: 2020-07-15 10:09:17.218183 """ from datetime import datetime from alembic import op from sqlalchemy.sql import text revision = '0325_int_letter_rates_fix' down_revision = '0324_int_letter_rates' old_start_date = datetime(2020, ...
Fix international letter rate start dates
Fix international letter rate start dates These were not taking timezones into account before.
Python
mit
alphagov/notifications-api,alphagov/notifications-api
Fix international letter rate start dates These were not taking timezones into account before.
""" Revision ID: 0325_int_letter_rates_fix Revises: 0324_int_letter_rates Create Date: 2020-07-15 10:09:17.218183 """ from datetime import datetime from alembic import op from sqlalchemy.sql import text revision = '0325_int_letter_rates_fix' down_revision = '0324_int_letter_rates' old_start_date = datetime(2020, ...
<commit_before><commit_msg>Fix international letter rate start dates These were not taking timezones into account before.<commit_after>
""" Revision ID: 0325_int_letter_rates_fix Revises: 0324_int_letter_rates Create Date: 2020-07-15 10:09:17.218183 """ from datetime import datetime from alembic import op from sqlalchemy.sql import text revision = '0325_int_letter_rates_fix' down_revision = '0324_int_letter_rates' old_start_date = datetime(2020, ...
Fix international letter rate start dates These were not taking timezones into account before.""" Revision ID: 0325_int_letter_rates_fix Revises: 0324_int_letter_rates Create Date: 2020-07-15 10:09:17.218183 """ from datetime import datetime from alembic import op from sqlalchemy.sql import text revision = '0325_i...
<commit_before><commit_msg>Fix international letter rate start dates These were not taking timezones into account before.<commit_after>""" Revision ID: 0325_int_letter_rates_fix Revises: 0324_int_letter_rates Create Date: 2020-07-15 10:09:17.218183 """ from datetime import datetime from alembic import op from sqlal...
2f32dad550d8268b1325747dc1705fa0cc293996
usr/examples/19-Low-Power/sensor_sleep.py
usr/examples/19-Low-Power/sensor_sleep.py
# Sensor Sleep Mode Example. # This example demonstrates the sensor sleep mode. The sleep mode saves around # 40mA when enabled and it's automatically cleared when calling sensor reset(). import sensor, image, time sensor.reset() # Reset and initialize the sensor. sensor.set_pixformat(sensor.RGB5...
Add sensor sleep mode example.
Add sensor sleep mode example.
Python
mit
kwagyeman/openmv,kwagyeman/openmv,openmv/openmv,openmv/openmv,iabdalkader/openmv,iabdalkader/openmv,kwagyeman/openmv,iabdalkader/openmv,openmv/openmv,iabdalkader/openmv,openmv/openmv,kwagyeman/openmv
Add sensor sleep mode example.
# Sensor Sleep Mode Example. # This example demonstrates the sensor sleep mode. The sleep mode saves around # 40mA when enabled and it's automatically cleared when calling sensor reset(). import sensor, image, time sensor.reset() # Reset and initialize the sensor. sensor.set_pixformat(sensor.RGB5...
<commit_before><commit_msg>Add sensor sleep mode example.<commit_after>
# Sensor Sleep Mode Example. # This example demonstrates the sensor sleep mode. The sleep mode saves around # 40mA when enabled and it's automatically cleared when calling sensor reset(). import sensor, image, time sensor.reset() # Reset and initialize the sensor. sensor.set_pixformat(sensor.RGB5...
Add sensor sleep mode example.# Sensor Sleep Mode Example. # This example demonstrates the sensor sleep mode. The sleep mode saves around # 40mA when enabled and it's automatically cleared when calling sensor reset(). import sensor, image, time sensor.reset() # Reset and initialize the sensor. se...
<commit_before><commit_msg>Add sensor sleep mode example.<commit_after># Sensor Sleep Mode Example. # This example demonstrates the sensor sleep mode. The sleep mode saves around # 40mA when enabled and it's automatically cleared when calling sensor reset(). import sensor, image, time sensor.reset() ...
3e82ad485bda3f767e2ab099c5be16ab72e48d14
adaptive/csv_to_npz.py
adaptive/csv_to_npz.py
import os import sys import json import numpy as np if __name__ == '__main__': if len(sys.argv) == 2: input_files = [] while True: try: line = raw_input() input_files.append(line) except EOFError: break else: input...
Add program to convert csv training data to npz training data.
Add program to convert csv training data to npz training data.
Python
apache-2.0
session-id/poker-predictor
Add program to convert csv training data to npz training data.
import os import sys import json import numpy as np if __name__ == '__main__': if len(sys.argv) == 2: input_files = [] while True: try: line = raw_input() input_files.append(line) except EOFError: break else: input...
<commit_before><commit_msg>Add program to convert csv training data to npz training data.<commit_after>
import os import sys import json import numpy as np if __name__ == '__main__': if len(sys.argv) == 2: input_files = [] while True: try: line = raw_input() input_files.append(line) except EOFError: break else: input...
Add program to convert csv training data to npz training data.import os import sys import json import numpy as np if __name__ == '__main__': if len(sys.argv) == 2: input_files = [] while True: try: line = raw_input() input_files.append(line) ...
<commit_before><commit_msg>Add program to convert csv training data to npz training data.<commit_after>import os import sys import json import numpy as np if __name__ == '__main__': if len(sys.argv) == 2: input_files = [] while True: try: line = raw_input() ...
c670a4f175f39018960fc2d96a226e15ad7a6edd
tests/basic_wick_test.py
tests/basic_wick_test.py
"""Test basic Wick expansion of terms. The tests in the module is attempted to test the core Wick facility on terms, without parallelization by Spark. """ from sympy import symbols, IndexedBase from drudge import Range, Vec, CR, AN, FERMI, FockDrudge from drudge.term import sum_term from drudge.wick import wick_expa...
Add test for basic Wick expansion facility
Add test for basic Wick expansion facility The test in this module works on the terms directly without Spark parallelization. It is intended for the ease of debugging.
Python
mit
tschijnmo/drudge,tschijnmo/drudge,tschijnmo/drudge
Add test for basic Wick expansion facility The test in this module works on the terms directly without Spark parallelization. It is intended for the ease of debugging.
"""Test basic Wick expansion of terms. The tests in the module is attempted to test the core Wick facility on terms, without parallelization by Spark. """ from sympy import symbols, IndexedBase from drudge import Range, Vec, CR, AN, FERMI, FockDrudge from drudge.term import sum_term from drudge.wick import wick_expa...
<commit_before><commit_msg>Add test for basic Wick expansion facility The test in this module works on the terms directly without Spark parallelization. It is intended for the ease of debugging.<commit_after>
"""Test basic Wick expansion of terms. The tests in the module is attempted to test the core Wick facility on terms, without parallelization by Spark. """ from sympy import symbols, IndexedBase from drudge import Range, Vec, CR, AN, FERMI, FockDrudge from drudge.term import sum_term from drudge.wick import wick_expa...
Add test for basic Wick expansion facility The test in this module works on the terms directly without Spark parallelization. It is intended for the ease of debugging."""Test basic Wick expansion of terms. The tests in the module is attempted to test the core Wick facility on terms, without parallelization by Spark....
<commit_before><commit_msg>Add test for basic Wick expansion facility The test in this module works on the terms directly without Spark parallelization. It is intended for the ease of debugging.<commit_after>"""Test basic Wick expansion of terms. The tests in the module is attempted to test the core Wick facility on...
29f8afd5456ffb9c30ee2ddf1567e03ec4e1efed
tests/test_fastpbkdf2.py
tests/test_fastpbkdf2.py
import pytest from fastpbkdf2 import pbkdf2_hmac def test_unsupported_algorithm(): with pytest.raises(ValueError): pbkdf2_hmac("foo", b"password", b"salt", 1)
Add test for unsupported algorithms.
Add test for unsupported algorithms.
Python
apache-2.0
Ayrx/python-fastpbkdf2,Ayrx/python-fastpbkdf2
Add test for unsupported algorithms.
import pytest from fastpbkdf2 import pbkdf2_hmac def test_unsupported_algorithm(): with pytest.raises(ValueError): pbkdf2_hmac("foo", b"password", b"salt", 1)
<commit_before><commit_msg>Add test for unsupported algorithms.<commit_after>
import pytest from fastpbkdf2 import pbkdf2_hmac def test_unsupported_algorithm(): with pytest.raises(ValueError): pbkdf2_hmac("foo", b"password", b"salt", 1)
Add test for unsupported algorithms.import pytest from fastpbkdf2 import pbkdf2_hmac def test_unsupported_algorithm(): with pytest.raises(ValueError): pbkdf2_hmac("foo", b"password", b"salt", 1)
<commit_before><commit_msg>Add test for unsupported algorithms.<commit_after>import pytest from fastpbkdf2 import pbkdf2_hmac def test_unsupported_algorithm(): with pytest.raises(ValueError): pbkdf2_hmac("foo", b"password", b"salt", 1)
466f98425741ec2630af2d5a00f79256c627c608
tests/test_pkg_source.py
tests/test_pkg_source.py
import pytest from flexmock import flexmock import sys import os import shutil import sclbuilder.utils from sclbuilder.pkg_source_plugins.dnf import DnfArchive tests_dir = os.path.split(os.path.abspath(__file__))[0] class TestPkgSource(object): @pytest.mark.parametrize(('input_path', 'expected'), [ ...
Add concept of pkg_source tests
Add concept of pkg_source tests
Python
mit
mcyprian/sclbuilder
Add concept of pkg_source tests
import pytest from flexmock import flexmock import sys import os import shutil import sclbuilder.utils from sclbuilder.pkg_source_plugins.dnf import DnfArchive tests_dir = os.path.split(os.path.abspath(__file__))[0] class TestPkgSource(object): @pytest.mark.parametrize(('input_path', 'expected'), [ ...
<commit_before><commit_msg>Add concept of pkg_source tests<commit_after>
import pytest from flexmock import flexmock import sys import os import shutil import sclbuilder.utils from sclbuilder.pkg_source_plugins.dnf import DnfArchive tests_dir = os.path.split(os.path.abspath(__file__))[0] class TestPkgSource(object): @pytest.mark.parametrize(('input_path', 'expected'), [ ...
Add concept of pkg_source testsimport pytest from flexmock import flexmock import sys import os import shutil import sclbuilder.utils from sclbuilder.pkg_source_plugins.dnf import DnfArchive tests_dir = os.path.split(os.path.abspath(__file__))[0] class TestPkgSource(object): @pytest.mark.parametrize(('inpu...
<commit_before><commit_msg>Add concept of pkg_source tests<commit_after>import pytest from flexmock import flexmock import sys import os import shutil import sclbuilder.utils from sclbuilder.pkg_source_plugins.dnf import DnfArchive tests_dir = os.path.split(os.path.abspath(__file__))[0] class TestPkgSource(object):...
6122dd94ca881454319937884ced2efd7b0a6859
scripts/quantize.py
scripts/quantize.py
#!/usr/bin/env python import Image import argparse import os import sys def main(): parser = argparse.ArgumentParser( description='Converts input image to use only given number of colors.') parser.add_argument('-c', '--colors', metavar='COLORS', type=int, default=256, help='Number of colors to use in ...
Add tool to reduce number of colors in an image.
Add tool to reduce number of colors in an image.
Python
artistic-2.0
cahirwpz/demoscene,cahirwpz/demoscene,cahirwpz/demoscene,cahirwpz/demoscene
Add tool to reduce number of colors in an image.
#!/usr/bin/env python import Image import argparse import os import sys def main(): parser = argparse.ArgumentParser( description='Converts input image to use only given number of colors.') parser.add_argument('-c', '--colors', metavar='COLORS', type=int, default=256, help='Number of colors to use in ...
<commit_before><commit_msg>Add tool to reduce number of colors in an image.<commit_after>
#!/usr/bin/env python import Image import argparse import os import sys def main(): parser = argparse.ArgumentParser( description='Converts input image to use only given number of colors.') parser.add_argument('-c', '--colors', metavar='COLORS', type=int, default=256, help='Number of colors to use in ...
Add tool to reduce number of colors in an image.#!/usr/bin/env python import Image import argparse import os import sys def main(): parser = argparse.ArgumentParser( description='Converts input image to use only given number of colors.') parser.add_argument('-c', '--colors', metavar='COLORS', type=int, ...
<commit_before><commit_msg>Add tool to reduce number of colors in an image.<commit_after>#!/usr/bin/env python import Image import argparse import os import sys def main(): parser = argparse.ArgumentParser( description='Converts input image to use only given number of colors.') parser.add_argument('-c', '--...
b56b7ed23ce60a352f163d21fedff63fe2a1c44a
scheduler/scheduled_external_program.py
scheduler/scheduled_external_program.py
import luigi from luigi.contrib.external_program import ExternalProgramTask, ExternalProgramRunError from subprocess import Popen, PIPE, check_call import os import datetime import logging logger = logging.getLogger('luigi-interface') class Scheduler(object): @classmethod def fromblurb(cls, blurb): fo...
Implement a scheduled version of Luigi's external program module
Implement a scheduled version of Luigi's external program module
Python
unlicense
ppavlidis/rnaseq-pipeline,ppavlidis/rnaseq-pipeline,ppavlidis/rnaseq-pipeline
Implement a scheduled version of Luigi's external program module
import luigi from luigi.contrib.external_program import ExternalProgramTask, ExternalProgramRunError from subprocess import Popen, PIPE, check_call import os import datetime import logging logger = logging.getLogger('luigi-interface') class Scheduler(object): @classmethod def fromblurb(cls, blurb): fo...
<commit_before><commit_msg>Implement a scheduled version of Luigi's external program module<commit_after>
import luigi from luigi.contrib.external_program import ExternalProgramTask, ExternalProgramRunError from subprocess import Popen, PIPE, check_call import os import datetime import logging logger = logging.getLogger('luigi-interface') class Scheduler(object): @classmethod def fromblurb(cls, blurb): fo...
Implement a scheduled version of Luigi's external program moduleimport luigi from luigi.contrib.external_program import ExternalProgramTask, ExternalProgramRunError from subprocess import Popen, PIPE, check_call import os import datetime import logging logger = logging.getLogger('luigi-interface') class Scheduler(obj...
<commit_before><commit_msg>Implement a scheduled version of Luigi's external program module<commit_after>import luigi from luigi.contrib.external_program import ExternalProgramTask, ExternalProgramRunError from subprocess import Popen, PIPE, check_call import os import datetime import logging logger = logging.getLogge...
085c5a28c94ba45680848886e9a77b99639bd930
NEO_flyby.py
NEO_flyby.py
import time import datetime import requests import json def get_NEO_flyby(): neo_data = [] unix = time.time() datestamp = datetime.datetime.fromtimestamp(unix).strftime("%Y-%b-%d") json_data_url = requests.get("https://ssd-api.jpl.nasa.gov/cad.api?body=Earth&dist-max=20LD") json_data = json.lo...
Update 0.1.0 - Get neo flyby data - Check for valid entrys for today
Update 0.1.0 - Get neo flyby data - Check for valid entrys for today
Python
mit
FXelix/space_facts_bot
Update 0.1.0 - Get neo flyby data - Check for valid entrys for today
import time import datetime import requests import json def get_NEO_flyby(): neo_data = [] unix = time.time() datestamp = datetime.datetime.fromtimestamp(unix).strftime("%Y-%b-%d") json_data_url = requests.get("https://ssd-api.jpl.nasa.gov/cad.api?body=Earth&dist-max=20LD") json_data = json.lo...
<commit_before><commit_msg>Update 0.1.0 - Get neo flyby data - Check for valid entrys for today<commit_after>
import time import datetime import requests import json def get_NEO_flyby(): neo_data = [] unix = time.time() datestamp = datetime.datetime.fromtimestamp(unix).strftime("%Y-%b-%d") json_data_url = requests.get("https://ssd-api.jpl.nasa.gov/cad.api?body=Earth&dist-max=20LD") json_data = json.lo...
Update 0.1.0 - Get neo flyby data - Check for valid entrys for today import time import datetime import requests import json def get_NEO_flyby(): neo_data = [] unix = time.time() datestamp = datetime.datetime.fromtimestamp(unix).strftime("%Y-%b-%d") json_data_url = requests.get("https://ssd-api.jpl...
<commit_before><commit_msg>Update 0.1.0 - Get neo flyby data - Check for valid entrys for today<commit_after> import time import datetime import requests import json def get_NEO_flyby(): neo_data = [] unix = time.time() datestamp = datetime.datetime.fromtimestamp(unix).strftime("%Y-%b-%d") json_dat...
ce8c81cdf4d9a4d7f6704a80f8218ecfdf9a03fe
OIPA/iati_synchroniser/migrations/0024_datasetfailedpickup.py
OIPA/iati_synchroniser/migrations/0024_datasetfailedpickup.py
# Generated by Django 2.0.13 on 2021-01-22 10:56 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('iati_synchroniser', '0023_auto_20210110_0059'), ] operations = [ migrations.CreateModel( name=...
Add migration for latest version
Add migration for latest version
Python
agpl-3.0
openaid-IATI/OIPA,openaid-IATI/OIPA,zimmerman-zimmerman/OIPA,zimmerman-zimmerman/OIPA,zimmerman-zimmerman/OIPA,openaid-IATI/OIPA,openaid-IATI/OIPA,zimmerman-zimmerman/OIPA,zimmerman-zimmerman/OIPA,openaid-IATI/OIPA
Add migration for latest version
# Generated by Django 2.0.13 on 2021-01-22 10:56 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('iati_synchroniser', '0023_auto_20210110_0059'), ] operations = [ migrations.CreateModel( name=...
<commit_before><commit_msg>Add migration for latest version<commit_after>
# Generated by Django 2.0.13 on 2021-01-22 10:56 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('iati_synchroniser', '0023_auto_20210110_0059'), ] operations = [ migrations.CreateModel( name=...
Add migration for latest version# Generated by Django 2.0.13 on 2021-01-22 10:56 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('iati_synchroniser', '0023_auto_20210110_0059'), ] operations = [ migration...
<commit_before><commit_msg>Add migration for latest version<commit_after># Generated by Django 2.0.13 on 2021-01-22 10:56 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('iati_synchroniser', '0023_auto_20210110_0059'), ...
3c2ee5a5b884edcd8dd270ac78efe60b1d453daa
profile_collection/acceptance_tests/06-scan-slits.py
profile_collection/acceptance_tests/06-scan-slits.py
from bluesky.plans import relative_inner_product_scan from bluesky.callbacks import LiveTable assert slt_mb2.connected RE(relative_inner_product_scan([em], 5, slt_mb2.o, 0, 1, slt_mb2.i, 0, 1), LiveTable([slt_mb2.o, slt_mb2.i, em]))
Add scan slits test with inner_product_scan.
Add scan slits test with inner_product_scan.
Python
bsd-2-clause
NSLS-II-XPD/ipython_ophyd,NSLS-II-XPD/ipython_ophyd
Add scan slits test with inner_product_scan.
from bluesky.plans import relative_inner_product_scan from bluesky.callbacks import LiveTable assert slt_mb2.connected RE(relative_inner_product_scan([em], 5, slt_mb2.o, 0, 1, slt_mb2.i, 0, 1), LiveTable([slt_mb2.o, slt_mb2.i, em]))
<commit_before><commit_msg>Add scan slits test with inner_product_scan.<commit_after>
from bluesky.plans import relative_inner_product_scan from bluesky.callbacks import LiveTable assert slt_mb2.connected RE(relative_inner_product_scan([em], 5, slt_mb2.o, 0, 1, slt_mb2.i, 0, 1), LiveTable([slt_mb2.o, slt_mb2.i, em]))
Add scan slits test with inner_product_scan.from bluesky.plans import relative_inner_product_scan from bluesky.callbacks import LiveTable assert slt_mb2.connected RE(relative_inner_product_scan([em], 5, slt_mb2.o, 0, 1, slt_mb2.i, 0, 1), LiveTable([slt_mb2.o, slt_mb2.i, em]))
<commit_before><commit_msg>Add scan slits test with inner_product_scan.<commit_after>from bluesky.plans import relative_inner_product_scan from bluesky.callbacks import LiveTable assert slt_mb2.connected RE(relative_inner_product_scan([em], 5, slt_mb2.o, 0, 1, slt_mb2.i, 0, 1), LiveTable([slt_mb2.o, slt_mb2.i, em]...
5ecbb43f1b6b7110b7d312b1dcbdd7a2baff629d
src/collectors/consul/ConsulCollector.py
src/collectors/consul/ConsulCollector.py
import diamond.collector class ConsulCollector(diamond.collector.Collector): def get_default_config_help(self): return super(ConsulCollector, self).get_default_config_help() def get_default_config(self): """ Returns the default collector settings """ config = super(Co...
Add an empty Consul collector
Add an empty Consul collector
Python
mit
Netuitive/netuitive-diamond,Netuitive/netuitive-diamond,Netuitive/netuitive-diamond,Netuitive/netuitive-diamond
Add an empty Consul collector
import diamond.collector class ConsulCollector(diamond.collector.Collector): def get_default_config_help(self): return super(ConsulCollector, self).get_default_config_help() def get_default_config(self): """ Returns the default collector settings """ config = super(Co...
<commit_before><commit_msg>Add an empty Consul collector<commit_after>
import diamond.collector class ConsulCollector(diamond.collector.Collector): def get_default_config_help(self): return super(ConsulCollector, self).get_default_config_help() def get_default_config(self): """ Returns the default collector settings """ config = super(Co...
Add an empty Consul collectorimport diamond.collector class ConsulCollector(diamond.collector.Collector): def get_default_config_help(self): return super(ConsulCollector, self).get_default_config_help() def get_default_config(self): """ Returns the default collector settings ...
<commit_before><commit_msg>Add an empty Consul collector<commit_after>import diamond.collector class ConsulCollector(diamond.collector.Collector): def get_default_config_help(self): return super(ConsulCollector, self).get_default_config_help() def get_default_config(self): """ Return...
6c804529f1c7f6a724b757c380e58ef493e787ea
CodeFights/createArray.py
CodeFights/createArray.py
#!/usr/local/bin/python # Code Fights Create Array Problem def createArray(size): return [1] * size def main(): tests = [ [4, [1, 1, 1, 1]], [2, [1, 1]], [1, [1]], [5, [1, 1, 1, 1, 1]] ] for t in tests: res = createArray(t[0]) ans = t[1] if an...
Solve Code Fights create array problem
Solve Code Fights create array problem
Python
mit
HKuz/Test_Code
Solve Code Fights create array problem
#!/usr/local/bin/python # Code Fights Create Array Problem def createArray(size): return [1] * size def main(): tests = [ [4, [1, 1, 1, 1]], [2, [1, 1]], [1, [1]], [5, [1, 1, 1, 1, 1]] ] for t in tests: res = createArray(t[0]) ans = t[1] if an...
<commit_before><commit_msg>Solve Code Fights create array problem<commit_after>
#!/usr/local/bin/python # Code Fights Create Array Problem def createArray(size): return [1] * size def main(): tests = [ [4, [1, 1, 1, 1]], [2, [1, 1]], [1, [1]], [5, [1, 1, 1, 1, 1]] ] for t in tests: res = createArray(t[0]) ans = t[1] if an...
Solve Code Fights create array problem#!/usr/local/bin/python # Code Fights Create Array Problem def createArray(size): return [1] * size def main(): tests = [ [4, [1, 1, 1, 1]], [2, [1, 1]], [1, [1]], [5, [1, 1, 1, 1, 1]] ] for t in tests: res = createArray(...
<commit_before><commit_msg>Solve Code Fights create array problem<commit_after>#!/usr/local/bin/python # Code Fights Create Array Problem def createArray(size): return [1] * size def main(): tests = [ [4, [1, 1, 1, 1]], [2, [1, 1]], [1, [1]], [5, [1, 1, 1, 1, 1]] ] f...
72806f06d08ceeae2c26198afdccf39832fb1c43
ms/storage/generaluuid.py
ms/storage/generaluuid.py
""" Copyright 2015 The Trustees of Princeton University 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 applicab...
Store namespaced UUIDs, i.e., to prevent replay attacks on JSON RPC calls.
Store namespaced UUIDs, i.e., to prevent replay attacks on JSON RPC calls.
Python
apache-2.0
iychoi/syndicate,iychoi/syndicate,jcnelson/syndicate,jcnelson/syndicate,iychoi/syndicate,iychoi/syndicate,jcnelson/syndicate,iychoi/syndicate,jcnelson/syndicate,iychoi/syndicate,iychoi/syndicate,jcnelson/syndicate,jcnelson/syndicate,jcnelson/syndicate,iychoi/syndicate,jcnelson/syndicate
Store namespaced UUIDs, i.e., to prevent replay attacks on JSON RPC calls.
""" Copyright 2015 The Trustees of Princeton University 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 applicab...
<commit_before><commit_msg>Store namespaced UUIDs, i.e., to prevent replay attacks on JSON RPC calls.<commit_after>
""" Copyright 2015 The Trustees of Princeton University 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 applicab...
Store namespaced UUIDs, i.e., to prevent replay attacks on JSON RPC calls.""" Copyright 2015 The Trustees of Princeton University 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 ...
<commit_before><commit_msg>Store namespaced UUIDs, i.e., to prevent replay attacks on JSON RPC calls.<commit_after>""" Copyright 2015 The Trustees of Princeton University Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may...
ebd72b546500a9556e1df99768aa200cf8860628
happy_plant.py
happy_plant.py
from microbit import * import math KNOWN_RES = 1181 V_IN = 3 R_BAD = 900 R_OK = 700 BAD = ( (9, 9, 0, 9, 9), (0, 9, 0, 9, 0), (0, 0, 0, 0, 0), (0, 9, 9, 9, 0), (9, 0, 0, 0, 9), ) OK = ( (0, 9, 0, 9, 0), (0, 9, 0, 9, 0), (0, 0, 0, 0, 0), (9, 9, 9, 9, 9), (0, 0, 0, 0, 0), ) GO...
Add plant happiness detector (moisture meter)
Add plant happiness detector (moisture meter) Essentially an Ohm-meter with feelings.
Python
apache-2.0
Geekfish/microbit-week
Add plant happiness detector (moisture meter) Essentially an Ohm-meter with feelings.
from microbit import * import math KNOWN_RES = 1181 V_IN = 3 R_BAD = 900 R_OK = 700 BAD = ( (9, 9, 0, 9, 9), (0, 9, 0, 9, 0), (0, 0, 0, 0, 0), (0, 9, 9, 9, 0), (9, 0, 0, 0, 9), ) OK = ( (0, 9, 0, 9, 0), (0, 9, 0, 9, 0), (0, 0, 0, 0, 0), (9, 9, 9, 9, 9), (0, 0, 0, 0, 0), ) GO...
<commit_before><commit_msg>Add plant happiness detector (moisture meter) Essentially an Ohm-meter with feelings.<commit_after>
from microbit import * import math KNOWN_RES = 1181 V_IN = 3 R_BAD = 900 R_OK = 700 BAD = ( (9, 9, 0, 9, 9), (0, 9, 0, 9, 0), (0, 0, 0, 0, 0), (0, 9, 9, 9, 0), (9, 0, 0, 0, 9), ) OK = ( (0, 9, 0, 9, 0), (0, 9, 0, 9, 0), (0, 0, 0, 0, 0), (9, 9, 9, 9, 9), (0, 0, 0, 0, 0), ) GO...
Add plant happiness detector (moisture meter) Essentially an Ohm-meter with feelings.from microbit import * import math KNOWN_RES = 1181 V_IN = 3 R_BAD = 900 R_OK = 700 BAD = ( (9, 9, 0, 9, 9), (0, 9, 0, 9, 0), (0, 0, 0, 0, 0), (0, 9, 9, 9, 0), (9, 0, 0, 0, 9), ) OK = ( (0, 9, 0, 9, 0), ...
<commit_before><commit_msg>Add plant happiness detector (moisture meter) Essentially an Ohm-meter with feelings.<commit_after>from microbit import * import math KNOWN_RES = 1181 V_IN = 3 R_BAD = 900 R_OK = 700 BAD = ( (9, 9, 0, 9, 9), (0, 9, 0, 9, 0), (0, 0, 0, 0, 0), (0, 9, 9, 9, 0), (9, 0, 0, ...
f25f9bd3d33e04d7bcb6b8f4f655e18214bd95ad
src/armet/tests/test_response.py
src/armet/tests/test_response.py
# -*- coding: utf-8 -*- from hashlib import md5 from armet.utils import test class ResponseTestCase(test.TestCase): def setUp(self): super(ResponseTestCase, self).setUp() self.endpoint = '/' def test_content_md5(self): # Check some random endpoint endpoint = '{}choice/1'.form...
Test case for Content-MD5 response.
Test case for Content-MD5 response.
Python
mit
armet/python-armet
Test case for Content-MD5 response.
# -*- coding: utf-8 -*- from hashlib import md5 from armet.utils import test class ResponseTestCase(test.TestCase): def setUp(self): super(ResponseTestCase, self).setUp() self.endpoint = '/' def test_content_md5(self): # Check some random endpoint endpoint = '{}choice/1'.form...
<commit_before><commit_msg>Test case for Content-MD5 response.<commit_after>
# -*- coding: utf-8 -*- from hashlib import md5 from armet.utils import test class ResponseTestCase(test.TestCase): def setUp(self): super(ResponseTestCase, self).setUp() self.endpoint = '/' def test_content_md5(self): # Check some random endpoint endpoint = '{}choice/1'.form...
Test case for Content-MD5 response.# -*- coding: utf-8 -*- from hashlib import md5 from armet.utils import test class ResponseTestCase(test.TestCase): def setUp(self): super(ResponseTestCase, self).setUp() self.endpoint = '/' def test_content_md5(self): # Check some random endpoint ...
<commit_before><commit_msg>Test case for Content-MD5 response.<commit_after># -*- coding: utf-8 -*- from hashlib import md5 from armet.utils import test class ResponseTestCase(test.TestCase): def setUp(self): super(ResponseTestCase, self).setUp() self.endpoint = '/' def test_content_md5(self...
8c5736cfb09250537d6f6a48f9f73e878444d5b0
promgen/management/commands/queuecheck.py
promgen/management/commands/queuecheck.py
import logging import platform from celery import group from django.conf import settings from django.core.management.base import BaseCommand from promgen.celery import debug_task logger = logging.getLogger(__name__) class Command(BaseCommand): def add_arguments(self, parser): parser.add_argument('--tim...
Check to see if the queues are blocked
Check to see if the queues are blocked
Python
mit
kfdm/promgen,kfdm/promgen,kfdm/promgen,kfdm/promgen
Check to see if the queues are blocked
import logging import platform from celery import group from django.conf import settings from django.core.management.base import BaseCommand from promgen.celery import debug_task logger = logging.getLogger(__name__) class Command(BaseCommand): def add_arguments(self, parser): parser.add_argument('--tim...
<commit_before><commit_msg>Check to see if the queues are blocked<commit_after>
import logging import platform from celery import group from django.conf import settings from django.core.management.base import BaseCommand from promgen.celery import debug_task logger = logging.getLogger(__name__) class Command(BaseCommand): def add_arguments(self, parser): parser.add_argument('--tim...
Check to see if the queues are blockedimport logging import platform from celery import group from django.conf import settings from django.core.management.base import BaseCommand from promgen.celery import debug_task logger = logging.getLogger(__name__) class Command(BaseCommand): def add_arguments(self, parse...
<commit_before><commit_msg>Check to see if the queues are blocked<commit_after>import logging import platform from celery import group from django.conf import settings from django.core.management.base import BaseCommand from promgen.celery import debug_task logger = logging.getLogger(__name__) class Command(BaseCo...
e0baa78241b73f977757823527394551d2e2059c
findatapy/util/swimpool.py
findatapy/util/swimpool.py
class SwimPool(object): def create_pool(self, thread_technique, thread_no): if thread_technique is "thread": from multiprocessing.dummy import Pool elif thread_technique is "multiprocessor": # most of the time is spend waiting for Bloomberg to return, so can use threads rath...
Add SwimPool wrapper for thread/multiprocessor
Add SwimPool wrapper for thread/multiprocessor
Python
apache-2.0
cuemacro/findatapy
Add SwimPool wrapper for thread/multiprocessor
class SwimPool(object): def create_pool(self, thread_technique, thread_no): if thread_technique is "thread": from multiprocessing.dummy import Pool elif thread_technique is "multiprocessor": # most of the time is spend waiting for Bloomberg to return, so can use threads rath...
<commit_before><commit_msg>Add SwimPool wrapper for thread/multiprocessor<commit_after>
class SwimPool(object): def create_pool(self, thread_technique, thread_no): if thread_technique is "thread": from multiprocessing.dummy import Pool elif thread_technique is "multiprocessor": # most of the time is spend waiting for Bloomberg to return, so can use threads rath...
Add SwimPool wrapper for thread/multiprocessorclass SwimPool(object): def create_pool(self, thread_technique, thread_no): if thread_technique is "thread": from multiprocessing.dummy import Pool elif thread_technique is "multiprocessor": # most of the time is spend waiting fo...
<commit_before><commit_msg>Add SwimPool wrapper for thread/multiprocessor<commit_after>class SwimPool(object): def create_pool(self, thread_technique, thread_no): if thread_technique is "thread": from multiprocessing.dummy import Pool elif thread_technique is "multiprocessor": ...
0866a865c48cc22219fe4c025d8e01f059c1eb2e
pyplotter.py
pyplotter.py
import argparse import serial try: import readline # noqa except ImportError: pass parser = argparse.ArgumentParser( description='CNC Import tool for Makeblock XY Plotter') parser.add_argument('device', help="Serial device to connect") parser.add_argument('-f', '--file', help="File to ...
Add script to import CNC files to plotter
Add script to import CNC files to plotter
Python
apache-2.0
mkoderer/pyplotter
Add script to import CNC files to plotter
import argparse import serial try: import readline # noqa except ImportError: pass parser = argparse.ArgumentParser( description='CNC Import tool for Makeblock XY Plotter') parser.add_argument('device', help="Serial device to connect") parser.add_argument('-f', '--file', help="File to ...
<commit_before><commit_msg>Add script to import CNC files to plotter<commit_after>
import argparse import serial try: import readline # noqa except ImportError: pass parser = argparse.ArgumentParser( description='CNC Import tool for Makeblock XY Plotter') parser.add_argument('device', help="Serial device to connect") parser.add_argument('-f', '--file', help="File to ...
Add script to import CNC files to plotterimport argparse import serial try: import readline # noqa except ImportError: pass parser = argparse.ArgumentParser( description='CNC Import tool for Makeblock XY Plotter') parser.add_argument('device', help="Serial device to connect") parser.add_argument('-f', '--...
<commit_before><commit_msg>Add script to import CNC files to plotter<commit_after>import argparse import serial try: import readline # noqa except ImportError: pass parser = argparse.ArgumentParser( description='CNC Import tool for Makeblock XY Plotter') parser.add_argument('device', help="Serial device t...
1404c37e1c593971c0a7e3020af12a762ff5ccc9
embed_all.py
embed_all.py
#!/usr/bin/env python3 import argparse from importlib import import_module from os.path import splitext, join as pjoin import cv2 import numpy as np import h5py import lib from lib.models import add_defaults if __name__ == '__main__': parser = argparse.ArgumentParser(description='Embed many images.') parser...
Add script to embed all images.
Add script to embed all images.
Python
mit
VisualComputingInstitute/towards-reid-tracking
Add script to embed all images.
#!/usr/bin/env python3 import argparse from importlib import import_module from os.path import splitext, join as pjoin import cv2 import numpy as np import h5py import lib from lib.models import add_defaults if __name__ == '__main__': parser = argparse.ArgumentParser(description='Embed many images.') parser...
<commit_before><commit_msg>Add script to embed all images.<commit_after>
#!/usr/bin/env python3 import argparse from importlib import import_module from os.path import splitext, join as pjoin import cv2 import numpy as np import h5py import lib from lib.models import add_defaults if __name__ == '__main__': parser = argparse.ArgumentParser(description='Embed many images.') parser...
Add script to embed all images.#!/usr/bin/env python3 import argparse from importlib import import_module from os.path import splitext, join as pjoin import cv2 import numpy as np import h5py import lib from lib.models import add_defaults if __name__ == '__main__': parser = argparse.ArgumentParser(description='...
<commit_before><commit_msg>Add script to embed all images.<commit_after>#!/usr/bin/env python3 import argparse from importlib import import_module from os.path import splitext, join as pjoin import cv2 import numpy as np import h5py import lib from lib.models import add_defaults if __name__ == '__main__': parse...
7e25b5f85fa854df7265d0c73338556f2fd9dce1
src/scripts/detect_encoding.py
src/scripts/detect_encoding.py
import sys import os from chardet.universaldetector import UniversalDetector def report_encoding(path): file = open(path) detector = UniversalDetector() for line in file.readlines(): detector.feed(line) if detector.done: break detector.close() file.close() print detector.result...
Add script to detect file encoding
Add script to detect file encoding
Python
mit
PinPinIre/Final-Year-Project,PinPinIre/Final-Year-Project,PinPinIre/Final-Year-Project
Add script to detect file encoding
import sys import os from chardet.universaldetector import UniversalDetector def report_encoding(path): file = open(path) detector = UniversalDetector() for line in file.readlines(): detector.feed(line) if detector.done: break detector.close() file.close() print detector.result...
<commit_before><commit_msg>Add script to detect file encoding<commit_after>
import sys import os from chardet.universaldetector import UniversalDetector def report_encoding(path): file = open(path) detector = UniversalDetector() for line in file.readlines(): detector.feed(line) if detector.done: break detector.close() file.close() print detector.result...
Add script to detect file encodingimport sys import os from chardet.universaldetector import UniversalDetector def report_encoding(path): file = open(path) detector = UniversalDetector() for line in file.readlines(): detector.feed(line) if detector.done: break detector.close() file...
<commit_before><commit_msg>Add script to detect file encoding<commit_after>import sys import os from chardet.universaldetector import UniversalDetector def report_encoding(path): file = open(path) detector = UniversalDetector() for line in file.readlines(): detector.feed(line) if detector....
b0d22b76bdb4f695a3d1c3e8306523df1c538b67
test/units/TestModules.py
test/units/TestModules.py
# -*- coding: utf-8 -*- import os import ast import unittest from ansible import utils class TestModules(unittest.TestCase): def list_all_modules(self): paths = utils.plugins.module_finder._get_paths() paths = [x for x in paths if os.path.isdir(x)] module_list = [] for path in pa...
Add an ast.parse unit test for modules to simulate ansible-doc
Add an ast.parse unit test for modules to simulate ansible-doc
Python
mit
thaim/ansible,thaim/ansible
Add an ast.parse unit test for modules to simulate ansible-doc
# -*- coding: utf-8 -*- import os import ast import unittest from ansible import utils class TestModules(unittest.TestCase): def list_all_modules(self): paths = utils.plugins.module_finder._get_paths() paths = [x for x in paths if os.path.isdir(x)] module_list = [] for path in pa...
<commit_before><commit_msg>Add an ast.parse unit test for modules to simulate ansible-doc<commit_after>
# -*- coding: utf-8 -*- import os import ast import unittest from ansible import utils class TestModules(unittest.TestCase): def list_all_modules(self): paths = utils.plugins.module_finder._get_paths() paths = [x for x in paths if os.path.isdir(x)] module_list = [] for path in pa...
Add an ast.parse unit test for modules to simulate ansible-doc# -*- coding: utf-8 -*- import os import ast import unittest from ansible import utils class TestModules(unittest.TestCase): def list_all_modules(self): paths = utils.plugins.module_finder._get_paths() paths = [x for x in paths if os....
<commit_before><commit_msg>Add an ast.parse unit test for modules to simulate ansible-doc<commit_after># -*- coding: utf-8 -*- import os import ast import unittest from ansible import utils class TestModules(unittest.TestCase): def list_all_modules(self): paths = utils.plugins.module_finder._get_paths()...
6ee465629a6a531ab29a664d3142a9005bdbb5cc
malaria24/ona/migrations/0025_smsevent.py
malaria24/ona/migrations/0025_smsevent.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('ona', '0024_inboundsms'), ] operations = [ migrations.CreateModel( name='SMSEvent', fields=[ ...
Add migration for sms event model
Add migration for sms event model
Python
bsd-2-clause
praekelt/malaria24-django,praekelt/malaria24-django,praekelt/malaria24-django,praekelt/malaria24-django
Add migration for sms event model
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('ona', '0024_inboundsms'), ] operations = [ migrations.CreateModel( name='SMSEvent', fields=[ ...
<commit_before><commit_msg>Add migration for sms event model<commit_after>
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('ona', '0024_inboundsms'), ] operations = [ migrations.CreateModel( name='SMSEvent', fields=[ ...
Add migration for sms event model# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('ona', '0024_inboundsms'), ] operations = [ migrations.CreateModel( name='SMSEve...
<commit_before><commit_msg>Add migration for sms event model<commit_after># -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('ona', '0024_inboundsms'), ] operations = [ migrati...
bcb3b6879b70160598b98e87f0cf0b1b6aa8e1f1
scripts/dump_timestamp.py
scripts/dump_timestamp.py
#!/usr/bin/env python from pexif import JpegFile import sys usage = """Usage: dump_timestamp.py filename.jpg""" if len(sys.argv) != 2: print >> sys.stderr, usage sys.exit(1) try: ef = JpegFile.fromFile(sys.argv[1]) primary = ef.get_exif().get_primary() print "Primary DateTime :", primar...
Add example of extracting various date/times.
Add example of extracting various date/times.
Python
mit
ebrelsford/pexif,untereiner/pexif,bennoleslie/pexif
Add example of extracting various date/times.
#!/usr/bin/env python from pexif import JpegFile import sys usage = """Usage: dump_timestamp.py filename.jpg""" if len(sys.argv) != 2: print >> sys.stderr, usage sys.exit(1) try: ef = JpegFile.fromFile(sys.argv[1]) primary = ef.get_exif().get_primary() print "Primary DateTime :", primar...
<commit_before><commit_msg>Add example of extracting various date/times.<commit_after>
#!/usr/bin/env python from pexif import JpegFile import sys usage = """Usage: dump_timestamp.py filename.jpg""" if len(sys.argv) != 2: print >> sys.stderr, usage sys.exit(1) try: ef = JpegFile.fromFile(sys.argv[1]) primary = ef.get_exif().get_primary() print "Primary DateTime :", primar...
Add example of extracting various date/times.#!/usr/bin/env python from pexif import JpegFile import sys usage = """Usage: dump_timestamp.py filename.jpg""" if len(sys.argv) != 2: print >> sys.stderr, usage sys.exit(1) try: ef = JpegFile.fromFile(sys.argv[1]) primary = ef.get_exif().get_primary() ...
<commit_before><commit_msg>Add example of extracting various date/times.<commit_after>#!/usr/bin/env python from pexif import JpegFile import sys usage = """Usage: dump_timestamp.py filename.jpg""" if len(sys.argv) != 2: print >> sys.stderr, usage sys.exit(1) try: ef = JpegFile.fromFile(sys.argv[1]) ...
b0261ec4757167cb3d5bf8ab3ded0273eb9477de
txircd/modules/umode_s.py
txircd/modules/umode_s.py
from txircd.modbase import Mode class ServerNoticeMode(Mode): pass class Spawner(object): def __init__(self, ircd): self.ircd = ircd def spawn(self): return { "modes": { "uns": ServerNoticeMode() } } def cleanup(self): self.ircd.removeMode("uns")
Implement usermode +s (currently doesn't do anything)
Implement usermode +s (currently doesn't do anything)
Python
bsd-3-clause
ElementalAlchemist/txircd,DesertBus/txircd,Heufneutje/txircd
Implement usermode +s (currently doesn't do anything)
from txircd.modbase import Mode class ServerNoticeMode(Mode): pass class Spawner(object): def __init__(self, ircd): self.ircd = ircd def spawn(self): return { "modes": { "uns": ServerNoticeMode() } } def cleanup(self): self.ircd.removeMode("uns")
<commit_before><commit_msg>Implement usermode +s (currently doesn't do anything)<commit_after>
from txircd.modbase import Mode class ServerNoticeMode(Mode): pass class Spawner(object): def __init__(self, ircd): self.ircd = ircd def spawn(self): return { "modes": { "uns": ServerNoticeMode() } } def cleanup(self): self.ircd.removeMode("uns")
Implement usermode +s (currently doesn't do anything)from txircd.modbase import Mode class ServerNoticeMode(Mode): pass class Spawner(object): def __init__(self, ircd): self.ircd = ircd def spawn(self): return { "modes": { "uns": ServerNoticeMode() } } def cleanup(self): self.ircd.removeMode...
<commit_before><commit_msg>Implement usermode +s (currently doesn't do anything)<commit_after>from txircd.modbase import Mode class ServerNoticeMode(Mode): pass class Spawner(object): def __init__(self, ircd): self.ircd = ircd def spawn(self): return { "modes": { "uns": ServerNoticeMode() } } ...
12c53bc50612dac2fc95503c1319ea1944ce3dfd
tests/datastructs/test_datastructs_dict.py
tests/datastructs/test_datastructs_dict.py
import pytest from cafeteria.datastructs.dict import MergingDict, DeepMergingDict @pytest.fixture def simple_dict(): return {"dict": {"one": 1, "nested": {"a": "a"}}, "list": [1]} @pytest.fixture def simple_dict_update(): return {"dict": {"two": 2, "nested": {"b": "b"}}, "list": [2, 3]} class TestMerging...
Add simple test cases for merging dict
Add simple test cases for merging dict
Python
apache-2.0
abn/python-cafe
Add simple test cases for merging dict
import pytest from cafeteria.datastructs.dict import MergingDict, DeepMergingDict @pytest.fixture def simple_dict(): return {"dict": {"one": 1, "nested": {"a": "a"}}, "list": [1]} @pytest.fixture def simple_dict_update(): return {"dict": {"two": 2, "nested": {"b": "b"}}, "list": [2, 3]} class TestMerging...
<commit_before><commit_msg>Add simple test cases for merging dict<commit_after>
import pytest from cafeteria.datastructs.dict import MergingDict, DeepMergingDict @pytest.fixture def simple_dict(): return {"dict": {"one": 1, "nested": {"a": "a"}}, "list": [1]} @pytest.fixture def simple_dict_update(): return {"dict": {"two": 2, "nested": {"b": "b"}}, "list": [2, 3]} class TestMerging...
Add simple test cases for merging dictimport pytest from cafeteria.datastructs.dict import MergingDict, DeepMergingDict @pytest.fixture def simple_dict(): return {"dict": {"one": 1, "nested": {"a": "a"}}, "list": [1]} @pytest.fixture def simple_dict_update(): return {"dict": {"two": 2, "nested": {"b": "b"}...
<commit_before><commit_msg>Add simple test cases for merging dict<commit_after>import pytest from cafeteria.datastructs.dict import MergingDict, DeepMergingDict @pytest.fixture def simple_dict(): return {"dict": {"one": 1, "nested": {"a": "a"}}, "list": [1]} @pytest.fixture def simple_dict_update(): return...
d61cfafedd098d1fa06fb662406ef98663b0eba9
txircd/modules/cmode_s.py
txircd/modules/cmode_s.py
from txircd.modbase import Mode class SecretMode(Mode): def listOutput(self, command, data): if command != "LIST": return data cdata = data["cdata"] if "s" in cdata["modes"] and cdata["name"] not in data["user"].channels: data["cdata"] = {} # other +s stuff is hiding in other modules. class Spawner(obje...
Implement channel mode +s (or what's left of it)
Implement channel mode +s (or what's left of it)
Python
bsd-3-clause
Heufneutje/txircd,ElementalAlchemist/txircd,DesertBus/txircd
Implement channel mode +s (or what's left of it)
from txircd.modbase import Mode class SecretMode(Mode): def listOutput(self, command, data): if command != "LIST": return data cdata = data["cdata"] if "s" in cdata["modes"] and cdata["name"] not in data["user"].channels: data["cdata"] = {} # other +s stuff is hiding in other modules. class Spawner(obje...
<commit_before><commit_msg>Implement channel mode +s (or what's left of it)<commit_after>
from txircd.modbase import Mode class SecretMode(Mode): def listOutput(self, command, data): if command != "LIST": return data cdata = data["cdata"] if "s" in cdata["modes"] and cdata["name"] not in data["user"].channels: data["cdata"] = {} # other +s stuff is hiding in other modules. class Spawner(obje...
Implement channel mode +s (or what's left of it)from txircd.modbase import Mode class SecretMode(Mode): def listOutput(self, command, data): if command != "LIST": return data cdata = data["cdata"] if "s" in cdata["modes"] and cdata["name"] not in data["user"].channels: data["cdata"] = {} # other +s stuff...
<commit_before><commit_msg>Implement channel mode +s (or what's left of it)<commit_after>from txircd.modbase import Mode class SecretMode(Mode): def listOutput(self, command, data): if command != "LIST": return data cdata = data["cdata"] if "s" in cdata["modes"] and cdata["name"] not in data["user"].channels...
d41b7a57e6c6f562b5b750a26e46a4b6407c0384
examples/save_users_following_into_file.py
examples/save_users_following_into_file.py
""" instabot example Workflow: Save users' following into a file. """ import argparse import os import sys from tqdm import tqdm sys.path.append(os.path.join(sys.path[0], '../')) from instabot import Bot parser = argparse.ArgumentParser(add_help=False) parser.add_argument('-u', type=str, help="us...
Save users' following into file
Save users' following into file
Python
apache-2.0
ohld/instabot,instagrambot/instabot,instagrambot/instabot
Save users' following into file
""" instabot example Workflow: Save users' following into a file. """ import argparse import os import sys from tqdm import tqdm sys.path.append(os.path.join(sys.path[0], '../')) from instabot import Bot parser = argparse.ArgumentParser(add_help=False) parser.add_argument('-u', type=str, help="us...
<commit_before><commit_msg>Save users' following into file<commit_after>
""" instabot example Workflow: Save users' following into a file. """ import argparse import os import sys from tqdm import tqdm sys.path.append(os.path.join(sys.path[0], '../')) from instabot import Bot parser = argparse.ArgumentParser(add_help=False) parser.add_argument('-u', type=str, help="us...
Save users' following into file""" instabot example Workflow: Save users' following into a file. """ import argparse import os import sys from tqdm import tqdm sys.path.append(os.path.join(sys.path[0], '../')) from instabot import Bot parser = argparse.ArgumentParser(add_help=False) parser.add_ar...
<commit_before><commit_msg>Save users' following into file<commit_after>""" instabot example Workflow: Save users' following into a file. """ import argparse import os import sys from tqdm import tqdm sys.path.append(os.path.join(sys.path[0], '../')) from instabot import Bot parser = argparse.Arg...
d35737fb7a758de8fb45e45323aeda1a6b9e7c4a
bearstorage.py
bearstorage.py
import socket from geoip import geolite2 class BearStorage(): def __init__(self, ip, rawrequest, timestamp, parsed_request, isDetected): self.ip = ip # String self.rawrequest = rawrequest # String self.timestamp = timestamp # Datetime self.path = parsed_request.path # String ...
Add class for sending data from client to server
Add class for sending data from client to server
Python
mit
Zloool/manyfaced-honeypot
Add class for sending data from client to server
import socket from geoip import geolite2 class BearStorage(): def __init__(self, ip, rawrequest, timestamp, parsed_request, isDetected): self.ip = ip # String self.rawrequest = rawrequest # String self.timestamp = timestamp # Datetime self.path = parsed_request.path # String ...
<commit_before><commit_msg>Add class for sending data from client to server<commit_after>
import socket from geoip import geolite2 class BearStorage(): def __init__(self, ip, rawrequest, timestamp, parsed_request, isDetected): self.ip = ip # String self.rawrequest = rawrequest # String self.timestamp = timestamp # Datetime self.path = parsed_request.path # String ...
Add class for sending data from client to serverimport socket from geoip import geolite2 class BearStorage(): def __init__(self, ip, rawrequest, timestamp, parsed_request, isDetected): self.ip = ip # String self.rawrequest = rawrequest # String self.timestamp = timestamp # Datetime ...
<commit_before><commit_msg>Add class for sending data from client to server<commit_after>import socket from geoip import geolite2 class BearStorage(): def __init__(self, ip, rawrequest, timestamp, parsed_request, isDetected): self.ip = ip # String self.rawrequest = rawrequest # String se...
867c53c6457a24bc89f87cf2362d02d8542cf66e
books/views.py
books/views.py
from django.shortcuts import render from django.views.generic import TemplateView from rest_framework import viewsets, filters from books.models import Book, Category, SubCategory from books.serializers import BookSerializer, CategorySerializer, SubCategorySerializer class HomeTemplateView(TemplateView, ): templat...
from django.shortcuts import render from django.views.generic import TemplateView from rest_framework import viewsets, filters from books.models import Book, Category, SubCategory from books.serializers import BookSerializer, CategorySerializer, SubCategorySerializer class HomeTemplateView(TemplateView, ): templat...
Add category id filtering to subcategories
Add category id filtering to subcategories
Python
unlicense
spapas/react-tutorial,tbeg/react-tutorial,d0ntg0m0ng/react-tutorial-1,d0ntg0m0ng/react-tutorial-1,tbeg/react-tutorial,spapas/react-tutorial,d0ntg0m0ng/react-tutorial-1,spapas/react-tutorial,tbeg/react-tutorial,spapas/react-tutorial
from django.shortcuts import render from django.views.generic import TemplateView from rest_framework import viewsets, filters from books.models import Book, Category, SubCategory from books.serializers import BookSerializer, CategorySerializer, SubCategorySerializer class HomeTemplateView(TemplateView, ): templat...
from django.shortcuts import render from django.views.generic import TemplateView from rest_framework import viewsets, filters from books.models import Book, Category, SubCategory from books.serializers import BookSerializer, CategorySerializer, SubCategorySerializer class HomeTemplateView(TemplateView, ): templat...
<commit_before>from django.shortcuts import render from django.views.generic import TemplateView from rest_framework import viewsets, filters from books.models import Book, Category, SubCategory from books.serializers import BookSerializer, CategorySerializer, SubCategorySerializer class HomeTemplateView(TemplateView,...
from django.shortcuts import render from django.views.generic import TemplateView from rest_framework import viewsets, filters from books.models import Book, Category, SubCategory from books.serializers import BookSerializer, CategorySerializer, SubCategorySerializer class HomeTemplateView(TemplateView, ): templat...
from django.shortcuts import render from django.views.generic import TemplateView from rest_framework import viewsets, filters from books.models import Book, Category, SubCategory from books.serializers import BookSerializer, CategorySerializer, SubCategorySerializer class HomeTemplateView(TemplateView, ): templat...
<commit_before>from django.shortcuts import render from django.views.generic import TemplateView from rest_framework import viewsets, filters from books.models import Book, Category, SubCategory from books.serializers import BookSerializer, CategorySerializer, SubCategorySerializer class HomeTemplateView(TemplateView,...
ed0ecfdcc614ee29d5aab8565b761b38193e01ae
test/pymadtest/test_interface.py
test/pymadtest/test_interface.py
# tested classes from cern.pymad.abc.interface import Interface # test utilities import unittest from inspect import getdoc from abc import abstractmethod # class AbstractBase(Interface): @abstractmethod def foo(self): """ Dummy documentation for AbstractBase.foo """ pass ...
Add test for Interface base class
Add test for Interface base class
Python
apache-2.0
pymad/jpymad,pymad/cpymad,pymad/jpymad,pymad/cpymad,pymad/jpymad
Add test for Interface base class
# tested classes from cern.pymad.abc.interface import Interface # test utilities import unittest from inspect import getdoc from abc import abstractmethod # class AbstractBase(Interface): @abstractmethod def foo(self): """ Dummy documentation for AbstractBase.foo """ pass ...
<commit_before><commit_msg>Add test for Interface base class<commit_after>
# tested classes from cern.pymad.abc.interface import Interface # test utilities import unittest from inspect import getdoc from abc import abstractmethod # class AbstractBase(Interface): @abstractmethod def foo(self): """ Dummy documentation for AbstractBase.foo """ pass ...
Add test for Interface base class # tested classes from cern.pymad.abc.interface import Interface # test utilities import unittest from inspect import getdoc from abc import abstractmethod # class AbstractBase(Interface): @abstractmethod def foo(self): """ Dummy documentation for AbstractBase....
<commit_before><commit_msg>Add test for Interface base class<commit_after> # tested classes from cern.pymad.abc.interface import Interface # test utilities import unittest from inspect import getdoc from abc import abstractmethod # class AbstractBase(Interface): @abstractmethod def foo(self): """ ...
19df6de71721db1a4d7b43e360731704ba462d9d
tests/services/user/test_find_user.py
tests/services/user/test_find_user.py
""" :Copyright: 2006-2020 Jochen Kupperschmidt :License: Modified BSD, see LICENSE for details. """ import pytest from byceps.services.user import service as user_service from tests.conftest import database_recreated from tests.helpers import create_user @pytest.fixture(scope='module') def app(party_app, db): ...
Test finding user by email address, screen name
Test finding user by email address, screen name
Python
bsd-3-clause
homeworkprod/byceps,homeworkprod/byceps,homeworkprod/byceps
Test finding user by email address, screen name
""" :Copyright: 2006-2020 Jochen Kupperschmidt :License: Modified BSD, see LICENSE for details. """ import pytest from byceps.services.user import service as user_service from tests.conftest import database_recreated from tests.helpers import create_user @pytest.fixture(scope='module') def app(party_app, db): ...
<commit_before><commit_msg>Test finding user by email address, screen name<commit_after>
""" :Copyright: 2006-2020 Jochen Kupperschmidt :License: Modified BSD, see LICENSE for details. """ import pytest from byceps.services.user import service as user_service from tests.conftest import database_recreated from tests.helpers import create_user @pytest.fixture(scope='module') def app(party_app, db): ...
Test finding user by email address, screen name""" :Copyright: 2006-2020 Jochen Kupperschmidt :License: Modified BSD, see LICENSE for details. """ import pytest from byceps.services.user import service as user_service from tests.conftest import database_recreated from tests.helpers import create_user @pytest.fixtu...
<commit_before><commit_msg>Test finding user by email address, screen name<commit_after>""" :Copyright: 2006-2020 Jochen Kupperschmidt :License: Modified BSD, see LICENSE for details. """ import pytest from byceps.services.user import service as user_service from tests.conftest import database_recreated from tests.h...
8858d1183f1c62449c77528e9dbbe3e4d2031f92
tests/unit/modules/virtualenv_test.py
tests/unit/modules/virtualenv_test.py
# -*- coding: utf-8 -*- ''' tests.unit.modules.virtualenv_test ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :codeauthor: :email:`Pedro Algarvio ([email protected])` :copyright: © 2013 by the SaltStack Team, see AUTHORS for more details. :license: Apache 2.0, see LICENSE for more details. ''' import sys # I...
Add test case which tests for proper deprecated output based on virtualenv version.
Add test case which tests for proper deprecated output based on virtualenv version.
Python
apache-2.0
saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt
Add test case which tests for proper deprecated output based on virtualenv version.
# -*- coding: utf-8 -*- ''' tests.unit.modules.virtualenv_test ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :codeauthor: :email:`Pedro Algarvio ([email protected])` :copyright: © 2013 by the SaltStack Team, see AUTHORS for more details. :license: Apache 2.0, see LICENSE for more details. ''' import sys # I...
<commit_before><commit_msg>Add test case which tests for proper deprecated output based on virtualenv version.<commit_after>
# -*- coding: utf-8 -*- ''' tests.unit.modules.virtualenv_test ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :codeauthor: :email:`Pedro Algarvio ([email protected])` :copyright: © 2013 by the SaltStack Team, see AUTHORS for more details. :license: Apache 2.0, see LICENSE for more details. ''' import sys # I...
Add test case which tests for proper deprecated output based on virtualenv version.# -*- coding: utf-8 -*- ''' tests.unit.modules.virtualenv_test ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :codeauthor: :email:`Pedro Algarvio ([email protected])` :copyright: © 2013 by the SaltStack Team, see AUTHORS for more de...
<commit_before><commit_msg>Add test case which tests for proper deprecated output based on virtualenv version.<commit_after># -*- coding: utf-8 -*- ''' tests.unit.modules.virtualenv_test ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :codeauthor: :email:`Pedro Algarvio ([email protected])` :copyright: © 2013 by th...
7b9f255799252f56c149583b41535b7a85b326e6
tests/test_vector2_dot.py
tests/test_vector2_dot.py
from ppb_vector import Vector2 from math import isclose, sqrt import pytest # type: ignore from hypothesis import assume, given, note from utils import floats, vectors @given(x=vectors(), y=vectors()) def test_dot_commutes(x: Vector2, y: Vector2): assert x * y == y * x MAGNITUDE=1e10 @given(x=vectors(max_magn...
Add initial tests for dot product
Add initial tests for dot product Closes #9
Python
artistic-2.0
ppb/ppb-vector,ppb/ppb-vector
Add initial tests for dot product Closes #9
from ppb_vector import Vector2 from math import isclose, sqrt import pytest # type: ignore from hypothesis import assume, given, note from utils import floats, vectors @given(x=vectors(), y=vectors()) def test_dot_commutes(x: Vector2, y: Vector2): assert x * y == y * x MAGNITUDE=1e10 @given(x=vectors(max_magn...
<commit_before><commit_msg>Add initial tests for dot product Closes #9<commit_after>
from ppb_vector import Vector2 from math import isclose, sqrt import pytest # type: ignore from hypothesis import assume, given, note from utils import floats, vectors @given(x=vectors(), y=vectors()) def test_dot_commutes(x: Vector2, y: Vector2): assert x * y == y * x MAGNITUDE=1e10 @given(x=vectors(max_magn...
Add initial tests for dot product Closes #9from ppb_vector import Vector2 from math import isclose, sqrt import pytest # type: ignore from hypothesis import assume, given, note from utils import floats, vectors @given(x=vectors(), y=vectors()) def test_dot_commutes(x: Vector2, y: Vector2): assert x * y == y * ...
<commit_before><commit_msg>Add initial tests for dot product Closes #9<commit_after>from ppb_vector import Vector2 from math import isclose, sqrt import pytest # type: ignore from hypothesis import assume, given, note from utils import floats, vectors @given(x=vectors(), y=vectors()) def test_dot_commutes(x: Vecto...
44cbc513a60c248fcaa45505935cbac1cff231c7
CodeFights/chessKnight.py
CodeFights/chessKnight.py
#!/usr/local/bin/python # Code Fights Chess Knight Problem def chessKnight(cell): # Check it's a valid cell import re match = re.search(r'^([a-h])([1-8])$', cell, re.I) if not bool(match): # Invalid cell return 0 file, rank = match.group(1).lower(), int(match.group(2)) moves = ...
Solve Code Fights chess knight problem
Solve Code Fights chess knight problem
Python
mit
HKuz/Test_Code
Solve Code Fights chess knight problem
#!/usr/local/bin/python # Code Fights Chess Knight Problem def chessKnight(cell): # Check it's a valid cell import re match = re.search(r'^([a-h])([1-8])$', cell, re.I) if not bool(match): # Invalid cell return 0 file, rank = match.group(1).lower(), int(match.group(2)) moves = ...
<commit_before><commit_msg>Solve Code Fights chess knight problem<commit_after>
#!/usr/local/bin/python # Code Fights Chess Knight Problem def chessKnight(cell): # Check it's a valid cell import re match = re.search(r'^([a-h])([1-8])$', cell, re.I) if not bool(match): # Invalid cell return 0 file, rank = match.group(1).lower(), int(match.group(2)) moves = ...
Solve Code Fights chess knight problem#!/usr/local/bin/python # Code Fights Chess Knight Problem def chessKnight(cell): # Check it's a valid cell import re match = re.search(r'^([a-h])([1-8])$', cell, re.I) if not bool(match): # Invalid cell return 0 file, rank = match.group(1).low...
<commit_before><commit_msg>Solve Code Fights chess knight problem<commit_after>#!/usr/local/bin/python # Code Fights Chess Knight Problem def chessKnight(cell): # Check it's a valid cell import re match = re.search(r'^([a-h])([1-8])$', cell, re.I) if not bool(match): # Invalid cell ret...
7877ced4a52968c59f698ab0bcb0ff1b350e6045
ObjectTracking/test/displayIPVideoStream.py
ObjectTracking/test/displayIPVideoStream.py
#!/usr/bin/python # coding=utf-8 # vlc -vvv "/media/bat/DATA/videos/PERSEPOLIS.avi" --sout '#transcode{vcodec=mjpg,vb=2500,width=640,height=480,acodec=none}:standard{access=http,mux=mpjpeg,dst=localhost:8080/videofeed}' from SimpleCV import JpegStreamCamera, Display, Image cam = JpegStreamCamera('http://192.168.1.3:80...
Add a basic test to display Video stream with simplecv
Add a basic test to display Video stream with simplecv
Python
mit
baptistelabat/robokite,baptistelabat/robokite,baptistelabat/robokite,baptistelabat/robokite,baptistelabat/robokite,baptistelabat/robokite,baptistelabat/robokite,baptistelabat/robokite
Add a basic test to display Video stream with simplecv
#!/usr/bin/python # coding=utf-8 # vlc -vvv "/media/bat/DATA/videos/PERSEPOLIS.avi" --sout '#transcode{vcodec=mjpg,vb=2500,width=640,height=480,acodec=none}:standard{access=http,mux=mpjpeg,dst=localhost:8080/videofeed}' from SimpleCV import JpegStreamCamera, Display, Image cam = JpegStreamCamera('http://192.168.1.3:80...
<commit_before><commit_msg>Add a basic test to display Video stream with simplecv<commit_after>
#!/usr/bin/python # coding=utf-8 # vlc -vvv "/media/bat/DATA/videos/PERSEPOLIS.avi" --sout '#transcode{vcodec=mjpg,vb=2500,width=640,height=480,acodec=none}:standard{access=http,mux=mpjpeg,dst=localhost:8080/videofeed}' from SimpleCV import JpegStreamCamera, Display, Image cam = JpegStreamCamera('http://192.168.1.3:80...
Add a basic test to display Video stream with simplecv#!/usr/bin/python # coding=utf-8 # vlc -vvv "/media/bat/DATA/videos/PERSEPOLIS.avi" --sout '#transcode{vcodec=mjpg,vb=2500,width=640,height=480,acodec=none}:standard{access=http,mux=mpjpeg,dst=localhost:8080/videofeed}' from SimpleCV import JpegStreamCamera, Displa...
<commit_before><commit_msg>Add a basic test to display Video stream with simplecv<commit_after>#!/usr/bin/python # coding=utf-8 # vlc -vvv "/media/bat/DATA/videos/PERSEPOLIS.avi" --sout '#transcode{vcodec=mjpg,vb=2500,width=640,height=480,acodec=none}:standard{access=http,mux=mpjpeg,dst=localhost:8080/videofeed}' from...
55a505c411d350127807148b888f814abe610691
Cura/Scene/BoxRenderer.py
Cura/Scene/BoxRenderer.py
from Cura.Math.AxisAlignedBox import AxisAlignedBox from Cura.Math.Vector import Vector from Cura.Scene.ToolHandle import ToolHandle class BoxRenderer(ToolHandle): def __init__(self, box, parent = None): super().__init__(parent) md = self.getMeshData() rtf = box.rightTopFront lbb ...
Add a SceneNode subclass that can render a bounding box
Add a SceneNode subclass that can render a bounding box
Python
agpl-3.0
onitake/Uranium,onitake/Uranium
Add a SceneNode subclass that can render a bounding box
from Cura.Math.AxisAlignedBox import AxisAlignedBox from Cura.Math.Vector import Vector from Cura.Scene.ToolHandle import ToolHandle class BoxRenderer(ToolHandle): def __init__(self, box, parent = None): super().__init__(parent) md = self.getMeshData() rtf = box.rightTopFront lbb ...
<commit_before><commit_msg>Add a SceneNode subclass that can render a bounding box<commit_after>
from Cura.Math.AxisAlignedBox import AxisAlignedBox from Cura.Math.Vector import Vector from Cura.Scene.ToolHandle import ToolHandle class BoxRenderer(ToolHandle): def __init__(self, box, parent = None): super().__init__(parent) md = self.getMeshData() rtf = box.rightTopFront lbb ...
Add a SceneNode subclass that can render a bounding boxfrom Cura.Math.AxisAlignedBox import AxisAlignedBox from Cura.Math.Vector import Vector from Cura.Scene.ToolHandle import ToolHandle class BoxRenderer(ToolHandle): def __init__(self, box, parent = None): super().__init__(parent) md = self.getM...
<commit_before><commit_msg>Add a SceneNode subclass that can render a bounding box<commit_after>from Cura.Math.AxisAlignedBox import AxisAlignedBox from Cura.Math.Vector import Vector from Cura.Scene.ToolHandle import ToolHandle class BoxRenderer(ToolHandle): def __init__(self, box, parent = None): super()...
358dc90f2e1925f186d216eeac83d28d5852b099
testing/text_feed_script.py
testing/text_feed_script.py
import sys # file location should be in the first arg filename = sys.argv[1] f = open(filename, "r") lines = f.readlines() f.close lastline = lines.pop() # remove last line # reopen the file in write mode f = open(filename, "w") for line in lines: f.write(line) f.close() print lastline.rstrip()
Add text feed testing script, for when we don't want to be talking to test the rest of the project
Add text feed testing script, for when we don't want to be talking to test the rest of the project
Python
mit
Nespa32/sm_project,Nespa32/sm_project,Nespa32/sm_project,Nespa32/sm_project,Nespa32/sm_project
Add text feed testing script, for when we don't want to be talking to test the rest of the project
import sys # file location should be in the first arg filename = sys.argv[1] f = open(filename, "r") lines = f.readlines() f.close lastline = lines.pop() # remove last line # reopen the file in write mode f = open(filename, "w") for line in lines: f.write(line) f.close() print lastline.rstrip()
<commit_before><commit_msg>Add text feed testing script, for when we don't want to be talking to test the rest of the project<commit_after>
import sys # file location should be in the first arg filename = sys.argv[1] f = open(filename, "r") lines = f.readlines() f.close lastline = lines.pop() # remove last line # reopen the file in write mode f = open(filename, "w") for line in lines: f.write(line) f.close() print lastline.rstrip()
Add text feed testing script, for when we don't want to be talking to test the rest of the project import sys # file location should be in the first arg filename = sys.argv[1] f = open(filename, "r") lines = f.readlines() f.close lastline = lines.pop() # remove last line # reopen the file in write mode f = open(fil...
<commit_before><commit_msg>Add text feed testing script, for when we don't want to be talking to test the rest of the project<commit_after> import sys # file location should be in the first arg filename = sys.argv[1] f = open(filename, "r") lines = f.readlines() f.close lastline = lines.pop() # remove last line # r...
2305380ba28805cd42eb63db35440f77ededd1a2
test/streamparse/cli/test_run.py
test/streamparse/cli/test_run.py
from __future__ import absolute_import, unicode_literals import argparse import unittest from nose.tools import ok_ try: from unittest.mock import patch except ImportError: from mock import patch from streamparse.cli.run import main, subparser_hook class RunTestCase(unittest.TestCase): def test_subparser_ho...
Add simple tests for sparse run
Add simple tests for sparse run
Python
apache-2.0
Parsely/streamparse,codywilbourn/streamparse,codywilbourn/streamparse,Parsely/streamparse
Add simple tests for sparse run
from __future__ import absolute_import, unicode_literals import argparse import unittest from nose.tools import ok_ try: from unittest.mock import patch except ImportError: from mock import patch from streamparse.cli.run import main, subparser_hook class RunTestCase(unittest.TestCase): def test_subparser_ho...
<commit_before><commit_msg>Add simple tests for sparse run<commit_after>
from __future__ import absolute_import, unicode_literals import argparse import unittest from nose.tools import ok_ try: from unittest.mock import patch except ImportError: from mock import patch from streamparse.cli.run import main, subparser_hook class RunTestCase(unittest.TestCase): def test_subparser_ho...
Add simple tests for sparse runfrom __future__ import absolute_import, unicode_literals import argparse import unittest from nose.tools import ok_ try: from unittest.mock import patch except ImportError: from mock import patch from streamparse.cli.run import main, subparser_hook class RunTestCase(unittest.TestCa...
<commit_before><commit_msg>Add simple tests for sparse run<commit_after>from __future__ import absolute_import, unicode_literals import argparse import unittest from nose.tools import ok_ try: from unittest.mock import patch except ImportError: from mock import patch from streamparse.cli.run import main, subparser...
9f5de36cbb9cff0f8bb258de3ca5b9c2a27e72a8
bioagents/qca/lispify_helper.py
bioagents/qca/lispify_helper.py
__author__ = 'aarongary' class Lispify(): def __init__(self, obj): if(obj is None): raise ValueError("Please provide an object") self.obj = obj def to_lisp(self): if type(self.obj) is unicode: return self.lispify(str(self.obj)) else: return ...
Add Lispify class to project
Add Lispify class to project
Python
bsd-2-clause
bgyori/bioagents,sorgerlab/bioagents
Add Lispify class to project
__author__ = 'aarongary' class Lispify(): def __init__(self, obj): if(obj is None): raise ValueError("Please provide an object") self.obj = obj def to_lisp(self): if type(self.obj) is unicode: return self.lispify(str(self.obj)) else: return ...
<commit_before><commit_msg>Add Lispify class to project<commit_after>
__author__ = 'aarongary' class Lispify(): def __init__(self, obj): if(obj is None): raise ValueError("Please provide an object") self.obj = obj def to_lisp(self): if type(self.obj) is unicode: return self.lispify(str(self.obj)) else: return ...
Add Lispify class to project__author__ = 'aarongary' class Lispify(): def __init__(self, obj): if(obj is None): raise ValueError("Please provide an object") self.obj = obj def to_lisp(self): if type(self.obj) is unicode: return self.lispify(str(self.obj)) ...
<commit_before><commit_msg>Add Lispify class to project<commit_after>__author__ = 'aarongary' class Lispify(): def __init__(self, obj): if(obj is None): raise ValueError("Please provide an object") self.obj = obj def to_lisp(self): if type(self.obj) is unicode: ...
cef8e7a6e044405bc4b18b56351b20e1b27e17fe
glaciercmd/command_get_job_info_for_vault.py
glaciercmd/command_get_job_info_for_vault.py
import boto from boto.glacier.exceptions import UnexpectedHTTPResponseError class CommandGetJobInfoForVault(object): def execute(self, args, config): glacier_connection = boto.connect_glacier(aws_access_key_id=config.get('configuration', 'aws_key'), aws_secret_access_key=config.get('configuration', 'aws_secret...
Add command to get job info
Add command to get job info
Python
mit
carsonmcdonald/glacier-cmd
Add command to get job info
import boto from boto.glacier.exceptions import UnexpectedHTTPResponseError class CommandGetJobInfoForVault(object): def execute(self, args, config): glacier_connection = boto.connect_glacier(aws_access_key_id=config.get('configuration', 'aws_key'), aws_secret_access_key=config.get('configuration', 'aws_secret...
<commit_before><commit_msg>Add command to get job info<commit_after>
import boto from boto.glacier.exceptions import UnexpectedHTTPResponseError class CommandGetJobInfoForVault(object): def execute(self, args, config): glacier_connection = boto.connect_glacier(aws_access_key_id=config.get('configuration', 'aws_key'), aws_secret_access_key=config.get('configuration', 'aws_secret...
Add command to get job infoimport boto from boto.glacier.exceptions import UnexpectedHTTPResponseError class CommandGetJobInfoForVault(object): def execute(self, args, config): glacier_connection = boto.connect_glacier(aws_access_key_id=config.get('configuration', 'aws_key'), aws_secret_access_key=config.get('...
<commit_before><commit_msg>Add command to get job info<commit_after>import boto from boto.glacier.exceptions import UnexpectedHTTPResponseError class CommandGetJobInfoForVault(object): def execute(self, args, config): glacier_connection = boto.connect_glacier(aws_access_key_id=config.get('configuration', 'aws_...
49868b7bac42ea49e37a20bf49c5d6131ef12a84
kufpybio/uniprotrestapi.py
kufpybio/uniprotrestapi.py
# http://www.uniprot.org/faq/28 """This serves just the download of files. Parsing can be done using Biopython: from Bio import SeqIO uniprot_entry = SeqIO.read(open("uniprot_files/A8Z556.xml"), "uniprot-xml") """ import os import urllib.request from restapi import RESTAPI class UniprotRESTAPI(RESTAPI): def...
Add REST API for Uniprot
Add REST API for Uniprot
Python
isc
konrad/kufpybio
Add REST API for Uniprot
# http://www.uniprot.org/faq/28 """This serves just the download of files. Parsing can be done using Biopython: from Bio import SeqIO uniprot_entry = SeqIO.read(open("uniprot_files/A8Z556.xml"), "uniprot-xml") """ import os import urllib.request from restapi import RESTAPI class UniprotRESTAPI(RESTAPI): def...
<commit_before><commit_msg>Add REST API for Uniprot<commit_after>
# http://www.uniprot.org/faq/28 """This serves just the download of files. Parsing can be done using Biopython: from Bio import SeqIO uniprot_entry = SeqIO.read(open("uniprot_files/A8Z556.xml"), "uniprot-xml") """ import os import urllib.request from restapi import RESTAPI class UniprotRESTAPI(RESTAPI): def...
Add REST API for Uniprot# http://www.uniprot.org/faq/28 """This serves just the download of files. Parsing can be done using Biopython: from Bio import SeqIO uniprot_entry = SeqIO.read(open("uniprot_files/A8Z556.xml"), "uniprot-xml") """ import os import urllib.request from restapi import RESTAPI class UniprotRE...
<commit_before><commit_msg>Add REST API for Uniprot<commit_after># http://www.uniprot.org/faq/28 """This serves just the download of files. Parsing can be done using Biopython: from Bio import SeqIO uniprot_entry = SeqIO.read(open("uniprot_files/A8Z556.xml"), "uniprot-xml") """ import os import urllib.request fro...
95846633b9206b62bee01e34f65e5c9b64bcf375
hw/ip/alert_handler/doc/reg_alert_handler.py
hw/ip/alert_handler/doc/reg_alert_handler.py
#!/usr/bin/env python3 # Copyright lowRISC contributors. # Licensed under the Apache License, Version 2.0, see LICENSE for details. # SPDX-License-Identifier: Apache-2.0 r"""Convert mako template to hjson register description """ import argparse import sys from io import StringIO from mako.template import Template d...
Add generator script for alert handler
[alert_handler] Add generator script for alert handler
Python
apache-2.0
lowRISC/opentitan,lowRISC/opentitan,lowRISC/opentitan,lowRISC/opentitan,lowRISC/opentitan,lowRISC/opentitan
[alert_handler] Add generator script for alert handler
#!/usr/bin/env python3 # Copyright lowRISC contributors. # Licensed under the Apache License, Version 2.0, see LICENSE for details. # SPDX-License-Identifier: Apache-2.0 r"""Convert mako template to hjson register description """ import argparse import sys from io import StringIO from mako.template import Template d...
<commit_before><commit_msg>[alert_handler] Add generator script for alert handler<commit_after>
#!/usr/bin/env python3 # Copyright lowRISC contributors. # Licensed under the Apache License, Version 2.0, see LICENSE for details. # SPDX-License-Identifier: Apache-2.0 r"""Convert mako template to hjson register description """ import argparse import sys from io import StringIO from mako.template import Template d...
[alert_handler] Add generator script for alert handler#!/usr/bin/env python3 # Copyright lowRISC contributors. # Licensed under the Apache License, Version 2.0, see LICENSE for details. # SPDX-License-Identifier: Apache-2.0 r"""Convert mako template to hjson register description """ import argparse import sys from io i...
<commit_before><commit_msg>[alert_handler] Add generator script for alert handler<commit_after>#!/usr/bin/env python3 # Copyright lowRISC contributors. # Licensed under the Apache License, Version 2.0, see LICENSE for details. # SPDX-License-Identifier: Apache-2.0 r"""Convert mako template to hjson register description...
b2cb6cd8461cfb9ec748754d7d314acc12221769
workshops/test/test_lookups.py
workshops/test/test_lookups.py
from django.core.urlresolvers import reverse from .base import TestBase class TestLookups(TestBase): """Test suite for django-selectable lookups.""" def test_login_regression(self): """Make sure lookups are login-protected""" url_name = 'selectable-lookup' rv = self.client.get(revers...
Add regression test for login-required lookups
Add regression test for login-required lookups New test makes sure that we never accidentally disable @login_required on our lookups.
Python
mit
wking/swc-amy,wking/swc-amy,wking/swc-amy,vahtras/amy,shapiromatron/amy,pbanaszkiewicz/amy,wking/swc-amy,vahtras/amy,shapiromatron/amy,vahtras/amy,swcarpentry/amy,swcarpentry/amy,swcarpentry/amy,pbanaszkiewicz/amy,pbanaszkiewicz/amy,shapiromatron/amy
Add regression test for login-required lookups New test makes sure that we never accidentally disable @login_required on our lookups.
from django.core.urlresolvers import reverse from .base import TestBase class TestLookups(TestBase): """Test suite for django-selectable lookups.""" def test_login_regression(self): """Make sure lookups are login-protected""" url_name = 'selectable-lookup' rv = self.client.get(revers...
<commit_before><commit_msg>Add regression test for login-required lookups New test makes sure that we never accidentally disable @login_required on our lookups.<commit_after>
from django.core.urlresolvers import reverse from .base import TestBase class TestLookups(TestBase): """Test suite for django-selectable lookups.""" def test_login_regression(self): """Make sure lookups are login-protected""" url_name = 'selectable-lookup' rv = self.client.get(revers...
Add regression test for login-required lookups New test makes sure that we never accidentally disable @login_required on our lookups.from django.core.urlresolvers import reverse from .base import TestBase class TestLookups(TestBase): """Test suite for django-selectable lookups.""" def test_login_regression...
<commit_before><commit_msg>Add regression test for login-required lookups New test makes sure that we never accidentally disable @login_required on our lookups.<commit_after>from django.core.urlresolvers import reverse from .base import TestBase class TestLookups(TestBase): """Test suite for django-selectable l...
798d0e1cbb0b64452f8a9eaa46c7202ffb299193
cybox/test/objects/file_test.py
cybox/test/objects/file_test.py
import unittest from cybox.objects.file_object import File from cybox.test import round_trip from cybox.test.objects import ObjectTestCase class TestFile(unittest.TestCase, ObjectTestCase): object_type = "FileObjectType" klass = File def test_filepath_is_none(self): # This would throw an except...
Add a test related to creating File objects
Add a test related to creating File objects This tests a bug which was present as of 7666b90ed657fa550283bfceefb938f27f7372b5 but was fixed in 0ba7cdb9bac25bac864d87b52da1ccb6b1e94d9e.
Python
bsd-3-clause
CybOXProject/python-cybox
Add a test related to creating File objects This tests a bug which was present as of 7666b90ed657fa550283bfceefb938f27f7372b5 but was fixed in 0ba7cdb9bac25bac864d87b52da1ccb6b1e94d9e.
import unittest from cybox.objects.file_object import File from cybox.test import round_trip from cybox.test.objects import ObjectTestCase class TestFile(unittest.TestCase, ObjectTestCase): object_type = "FileObjectType" klass = File def test_filepath_is_none(self): # This would throw an except...
<commit_before><commit_msg>Add a test related to creating File objects This tests a bug which was present as of 7666b90ed657fa550283bfceefb938f27f7372b5 but was fixed in 0ba7cdb9bac25bac864d87b52da1ccb6b1e94d9e.<commit_after>
import unittest from cybox.objects.file_object import File from cybox.test import round_trip from cybox.test.objects import ObjectTestCase class TestFile(unittest.TestCase, ObjectTestCase): object_type = "FileObjectType" klass = File def test_filepath_is_none(self): # This would throw an except...
Add a test related to creating File objects This tests a bug which was present as of 7666b90ed657fa550283bfceefb938f27f7372b5 but was fixed in 0ba7cdb9bac25bac864d87b52da1ccb6b1e94d9e.import unittest from cybox.objects.file_object import File from cybox.test import round_trip from cybox.test.objects import ObjectTest...
<commit_before><commit_msg>Add a test related to creating File objects This tests a bug which was present as of 7666b90ed657fa550283bfceefb938f27f7372b5 but was fixed in 0ba7cdb9bac25bac864d87b52da1ccb6b1e94d9e.<commit_after>import unittest from cybox.objects.file_object import File from cybox.test import round_trip ...
4a2d92c3c34ce442ba8dde00fe89e7f7ad125e05
Modules/Biophotonics/python/iMC/msi/test/test_tiffwriter.py
Modules/Biophotonics/python/iMC/msi/test/test_tiffwriter.py
import unittest import os from msi.io.tiffwriter import TiffWriter from msi.io.tiffreader import TiffReader from msi.test import helpers class TestTiffWriter(unittest.TestCase): def setUp(self): # setup file and the path where it shall be written to self.msi = helpers.getFakeMsi() self....
Add a test for the new tiff writer.
Add a test for the new tiff writer.
Python
bsd-3-clause
RabadanLab/MITKats,RabadanLab/MITKats,fmilano/mitk,iwegner/MITK,iwegner/MITK,RabadanLab/MITKats,fmilano/mitk,MITK/MITK,iwegner/MITK,MITK/MITK,iwegner/MITK,fmilano/mitk,MITK/MITK,fmilano/mitk,fmilano/mitk,MITK/MITK,RabadanLab/MITKats,MITK/MITK,fmilano/mitk,RabadanLab/MITKats,iwegner/MITK,MITK/MITK,iwegner/MITK,fmilano/m...
Add a test for the new tiff writer.
import unittest import os from msi.io.tiffwriter import TiffWriter from msi.io.tiffreader import TiffReader from msi.test import helpers class TestTiffWriter(unittest.TestCase): def setUp(self): # setup file and the path where it shall be written to self.msi = helpers.getFakeMsi() self....
<commit_before><commit_msg>Add a test for the new tiff writer.<commit_after>
import unittest import os from msi.io.tiffwriter import TiffWriter from msi.io.tiffreader import TiffReader from msi.test import helpers class TestTiffWriter(unittest.TestCase): def setUp(self): # setup file and the path where it shall be written to self.msi = helpers.getFakeMsi() self....
Add a test for the new tiff writer. import unittest import os from msi.io.tiffwriter import TiffWriter from msi.io.tiffreader import TiffReader from msi.test import helpers class TestTiffWriter(unittest.TestCase): def setUp(self): # setup file and the path where it shall be written to self.msi =...
<commit_before><commit_msg>Add a test for the new tiff writer.<commit_after> import unittest import os from msi.io.tiffwriter import TiffWriter from msi.io.tiffreader import TiffReader from msi.test import helpers class TestTiffWriter(unittest.TestCase): def setUp(self): # setup file and the path where ...
18c66e780bf8ae6ba4a9f5aa13720a1370c8d7a3
plugins/Tools/SelectionTool/SelectionPass.py
plugins/Tools/SelectionTool/SelectionPass.py
# Copyright (c) 2015 Ultimaker B.V. # Cura is released under the terms of the AGPLv3 or higher. from UM.Resources import Resources from UM.Application import Application from UM.Scene.Iterator.DepthFirstIterator import DepthFirstIterator from UM.View.RenderPass import RenderPass from UM.View.GL.OpenGL import OpenGL ...
Add basic selection render pass for rendering the selection image
Add basic selection render pass for rendering the selection image
Python
agpl-3.0
onitake/Uranium,onitake/Uranium
Add basic selection render pass for rendering the selection image
# Copyright (c) 2015 Ultimaker B.V. # Cura is released under the terms of the AGPLv3 or higher. from UM.Resources import Resources from UM.Application import Application from UM.Scene.Iterator.DepthFirstIterator import DepthFirstIterator from UM.View.RenderPass import RenderPass from UM.View.GL.OpenGL import OpenGL ...
<commit_before><commit_msg>Add basic selection render pass for rendering the selection image<commit_after>
# Copyright (c) 2015 Ultimaker B.V. # Cura is released under the terms of the AGPLv3 or higher. from UM.Resources import Resources from UM.Application import Application from UM.Scene.Iterator.DepthFirstIterator import DepthFirstIterator from UM.View.RenderPass import RenderPass from UM.View.GL.OpenGL import OpenGL ...
Add basic selection render pass for rendering the selection image# Copyright (c) 2015 Ultimaker B.V. # Cura is released under the terms of the AGPLv3 or higher. from UM.Resources import Resources from UM.Application import Application from UM.Scene.Iterator.DepthFirstIterator import DepthFirstIterator from UM.View.R...
<commit_before><commit_msg>Add basic selection render pass for rendering the selection image<commit_after># Copyright (c) 2015 Ultimaker B.V. # Cura is released under the terms of the AGPLv3 or higher. from UM.Resources import Resources from UM.Application import Application from UM.Scene.Iterator.DepthFirstIterator ...
5cfbf23ff88a2d028fdd852adc735263c060f4eb
inet/inet.py
inet/inet.py
# -*- coding: utf-8 -*- import csv import os from collections import namedtuple class Inet(): """Inet class""" def __init__(self, data_file=None): # Naive check for file type based on extension # First check filepath is passed as a parameter if data_file is not None: # The...
Add read data file functionality to Inet class init
Add read data file functionality to Inet class init
Python
mit
nestauk/inet
Add read data file functionality to Inet class init
# -*- coding: utf-8 -*- import csv import os from collections import namedtuple class Inet(): """Inet class""" def __init__(self, data_file=None): # Naive check for file type based on extension # First check filepath is passed as a parameter if data_file is not None: # The...
<commit_before><commit_msg>Add read data file functionality to Inet class init<commit_after>
# -*- coding: utf-8 -*- import csv import os from collections import namedtuple class Inet(): """Inet class""" def __init__(self, data_file=None): # Naive check for file type based on extension # First check filepath is passed as a parameter if data_file is not None: # The...
Add read data file functionality to Inet class init# -*- coding: utf-8 -*- import csv import os from collections import namedtuple class Inet(): """Inet class""" def __init__(self, data_file=None): # Naive check for file type based on extension # First check filepath is passed as a parameter ...
<commit_before><commit_msg>Add read data file functionality to Inet class init<commit_after># -*- coding: utf-8 -*- import csv import os from collections import namedtuple class Inet(): """Inet class""" def __init__(self, data_file=None): # Naive check for file type based on extension # First...
1a1d390ce80ffe3fea7e1e132090f38072f38117
performance-test.py
performance-test.py
#!/usr/bin/env python import time import logging from ina219 import INA219 SHUNT_OHMS = 0.1 MAX_EXPECTED_AMPS = 0.2 READS = 100 ina = INA219(SHUNT_OHMS, MAX_EXPECTED_AMPS, log_level=logging.INFO) def init(): ina.configure(ina.RANGE_16V, ina.GAIN_AUTO) def read(): for x in range(0, READS): v = ina...
Add performance test python file
Add performance test python file
Python
mit
chrisb2/pi_ina219
Add performance test python file
#!/usr/bin/env python import time import logging from ina219 import INA219 SHUNT_OHMS = 0.1 MAX_EXPECTED_AMPS = 0.2 READS = 100 ina = INA219(SHUNT_OHMS, MAX_EXPECTED_AMPS, log_level=logging.INFO) def init(): ina.configure(ina.RANGE_16V, ina.GAIN_AUTO) def read(): for x in range(0, READS): v = ina...
<commit_before><commit_msg>Add performance test python file<commit_after>
#!/usr/bin/env python import time import logging from ina219 import INA219 SHUNT_OHMS = 0.1 MAX_EXPECTED_AMPS = 0.2 READS = 100 ina = INA219(SHUNT_OHMS, MAX_EXPECTED_AMPS, log_level=logging.INFO) def init(): ina.configure(ina.RANGE_16V, ina.GAIN_AUTO) def read(): for x in range(0, READS): v = ina...
Add performance test python file#!/usr/bin/env python import time import logging from ina219 import INA219 SHUNT_OHMS = 0.1 MAX_EXPECTED_AMPS = 0.2 READS = 100 ina = INA219(SHUNT_OHMS, MAX_EXPECTED_AMPS, log_level=logging.INFO) def init(): ina.configure(ina.RANGE_16V, ina.GAIN_AUTO) def read(): for x in ...
<commit_before><commit_msg>Add performance test python file<commit_after>#!/usr/bin/env python import time import logging from ina219 import INA219 SHUNT_OHMS = 0.1 MAX_EXPECTED_AMPS = 0.2 READS = 100 ina = INA219(SHUNT_OHMS, MAX_EXPECTED_AMPS, log_level=logging.INFO) def init(): ina.configure(ina.RANGE_16V, ...
f408346e69f643e603f279c2581fad8c99962b11
service_registry_cli/commands/configuration/remove.py
service_registry_cli/commands/configuration/remove.py
# Copyright 2012 Rackspace # # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the...
Add a command for removing a configuration value.
Add a command for removing a configuration value.
Python
apache-2.0
racker/python-service-registry-cli,racker/python-service-registry-cli
Add a command for removing a configuration value.
# Copyright 2012 Rackspace # # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the...
<commit_before><commit_msg>Add a command for removing a configuration value.<commit_after>
# Copyright 2012 Rackspace # # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the...
Add a command for removing a configuration value.# Copyright 2012 Rackspace # # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to...
<commit_before><commit_msg>Add a command for removing a configuration value.<commit_after># Copyright 2012 Rackspace # # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright o...
929849f09b62a06d8124d0f9f90d866911700718
sandcats/trivial_tests.py
sandcats/trivial_tests.py
import requests def register_asheesh(): return requests.post( 'http://localhost:3000/register', {'rawHostname': 'asheesh', 'email': '[email protected]', 'pubkey': open('snakeoil-sample-certs/ssl-cert-snakeoil.pubkey').read()}, )
Add trivial semi-manual test suite
Add trivial semi-manual test suite
Python
apache-2.0
sandstorm-io/sandcats,sandstorm-io/sandcats,sandstorm-io/sandcats,sandstorm-io/sandcats
Add trivial semi-manual test suite
import requests def register_asheesh(): return requests.post( 'http://localhost:3000/register', {'rawHostname': 'asheesh', 'email': '[email protected]', 'pubkey': open('snakeoil-sample-certs/ssl-cert-snakeoil.pubkey').read()}, )
<commit_before><commit_msg>Add trivial semi-manual test suite<commit_after>
import requests def register_asheesh(): return requests.post( 'http://localhost:3000/register', {'rawHostname': 'asheesh', 'email': '[email protected]', 'pubkey': open('snakeoil-sample-certs/ssl-cert-snakeoil.pubkey').read()}, )
Add trivial semi-manual test suiteimport requests def register_asheesh(): return requests.post( 'http://localhost:3000/register', {'rawHostname': 'asheesh', 'email': '[email protected]', 'pubkey': open('snakeoil-sample-certs/ssl-cert-snakeoil.pubkey').read()}, )
<commit_before><commit_msg>Add trivial semi-manual test suite<commit_after>import requests def register_asheesh(): return requests.post( 'http://localhost:3000/register', {'rawHostname': 'asheesh', 'email': '[email protected]', 'pubkey': open('snakeoil-sample-certs/ssl-cert-snak...
d67e7a17097ed08069a1e21fc09e0863c8bd56a8
analysis/multinomial_nb.py
analysis/multinomial_nb.py
# import dataset import json INPUT_FILE = './analysis/input/dev_posts.json' tweets = [] with open(INPUT_FILE, 'r') as f: for line in f: t = json.loads(line) tweets.append(t['body']) print('Total number of tweets: {}'.format(len(tweets))) # import results import numpy as np TARGET_FILE = './anal...
Add baseline naive bayes test
Add baseline naive bayes test
Python
apache-2.0
chuajiesheng/twitter-sentiment-analysis
Add baseline naive bayes test
# import dataset import json INPUT_FILE = './analysis/input/dev_posts.json' tweets = [] with open(INPUT_FILE, 'r') as f: for line in f: t = json.loads(line) tweets.append(t['body']) print('Total number of tweets: {}'.format(len(tweets))) # import results import numpy as np TARGET_FILE = './anal...
<commit_before><commit_msg>Add baseline naive bayes test<commit_after>
# import dataset import json INPUT_FILE = './analysis/input/dev_posts.json' tweets = [] with open(INPUT_FILE, 'r') as f: for line in f: t = json.loads(line) tweets.append(t['body']) print('Total number of tweets: {}'.format(len(tweets))) # import results import numpy as np TARGET_FILE = './anal...
Add baseline naive bayes test# import dataset import json INPUT_FILE = './analysis/input/dev_posts.json' tweets = [] with open(INPUT_FILE, 'r') as f: for line in f: t = json.loads(line) tweets.append(t['body']) print('Total number of tweets: {}'.format(len(tweets))) # import results import nump...
<commit_before><commit_msg>Add baseline naive bayes test<commit_after># import dataset import json INPUT_FILE = './analysis/input/dev_posts.json' tweets = [] with open(INPUT_FILE, 'r') as f: for line in f: t = json.loads(line) tweets.append(t['body']) print('Total number of tweets: {}'.format(len...
94e7c97b8fc22599ea92c5301bfeabf714de1635
github3/search/code.py
github3/search/code.py
from github3.models import GitHubCore from github3.repos import Repository class CodeSearchResult(GitHubCore): def __init__(self, data, session=None): super(CodeSearchResult, self).__init__(data, session) self._api = data.get('url') #: Filename the match occurs in self.name = data....
Add a class to encapsulate these results
Add a class to encapsulate these results
Python
bsd-3-clause
christophelec/github3.py,degustaf/github3.py,itsmemattchung/github3.py,agamdua/github3.py,h4ck3rm1k3/github3.py,jim-minter/github3.py,krxsky/github3.py,ueg1990/github3.py,sigmavirus24/github3.py,wbrefvem/github3.py,icio/github3.py,balloob/github3.py
Add a class to encapsulate these results
from github3.models import GitHubCore from github3.repos import Repository class CodeSearchResult(GitHubCore): def __init__(self, data, session=None): super(CodeSearchResult, self).__init__(data, session) self._api = data.get('url') #: Filename the match occurs in self.name = data....
<commit_before><commit_msg>Add a class to encapsulate these results<commit_after>
from github3.models import GitHubCore from github3.repos import Repository class CodeSearchResult(GitHubCore): def __init__(self, data, session=None): super(CodeSearchResult, self).__init__(data, session) self._api = data.get('url') #: Filename the match occurs in self.name = data....
Add a class to encapsulate these resultsfrom github3.models import GitHubCore from github3.repos import Repository class CodeSearchResult(GitHubCore): def __init__(self, data, session=None): super(CodeSearchResult, self).__init__(data, session) self._api = data.get('url') #: Filename the m...
<commit_before><commit_msg>Add a class to encapsulate these results<commit_after>from github3.models import GitHubCore from github3.repos import Repository class CodeSearchResult(GitHubCore): def __init__(self, data, session=None): super(CodeSearchResult, self).__init__(data, session) self._api = ...
05471b5d1b5328af337877433327fd90987a7492
http_date.py
http_date.py
#!/usr/bin/env python3 import re months = 'Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec'.split() http_month_pattern = '(%s)' % '|'.join(months) http_time_pattern = '\d\d:\d\d:\d\d' http_date_pattern = re.compile(r'''^ \S+ ( ,\s (?P<day1>\d+) ( \s (?P<month1>{0}) \s (?P<y...
Add some python code to parse a HTTP-date
Add some python code to parse a HTTP-date
Python
mit
DarkStarSword/junk,DarkStarSword/junk,DarkStarSword/junk,DarkStarSword/junk,DarkStarSword/junk
Add some python code to parse a HTTP-date
#!/usr/bin/env python3 import re months = 'Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec'.split() http_month_pattern = '(%s)' % '|'.join(months) http_time_pattern = '\d\d:\d\d:\d\d' http_date_pattern = re.compile(r'''^ \S+ ( ,\s (?P<day1>\d+) ( \s (?P<month1>{0}) \s (?P<y...
<commit_before><commit_msg>Add some python code to parse a HTTP-date<commit_after>
#!/usr/bin/env python3 import re months = 'Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec'.split() http_month_pattern = '(%s)' % '|'.join(months) http_time_pattern = '\d\d:\d\d:\d\d' http_date_pattern = re.compile(r'''^ \S+ ( ,\s (?P<day1>\d+) ( \s (?P<month1>{0}) \s (?P<y...
Add some python code to parse a HTTP-date#!/usr/bin/env python3 import re months = 'Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec'.split() http_month_pattern = '(%s)' % '|'.join(months) http_time_pattern = '\d\d:\d\d:\d\d' http_date_pattern = re.compile(r'''^ \S+ ( ,\s (?P<day1>\d+) ...
<commit_before><commit_msg>Add some python code to parse a HTTP-date<commit_after>#!/usr/bin/env python3 import re months = 'Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec'.split() http_month_pattern = '(%s)' % '|'.join(months) http_time_pattern = '\d\d:\d\d:\d\d' http_date_pattern = re.compile(r'''^ \S+ ( ...
b9220e5942c09b657afe748aee67d6342c6f1ac1
tests/test_polymorphic.py
tests/test_polymorphic.py
""" Tests of polymorphic behaviours """ import odin from odin.resources import create_resource_from_dict class AbstractResource(odin.Resource): class Meta: abstract = True namespace = "au.com.example.abstracts" type_field = "type" class ResourceA(AbstractResource): class Meta: ...
Add tests for polymorphic types
Add tests for polymorphic types
Python
bsd-3-clause
python-odin/odin
Add tests for polymorphic types
""" Tests of polymorphic behaviours """ import odin from odin.resources import create_resource_from_dict class AbstractResource(odin.Resource): class Meta: abstract = True namespace = "au.com.example.abstracts" type_field = "type" class ResourceA(AbstractResource): class Meta: ...
<commit_before><commit_msg>Add tests for polymorphic types<commit_after>
""" Tests of polymorphic behaviours """ import odin from odin.resources import create_resource_from_dict class AbstractResource(odin.Resource): class Meta: abstract = True namespace = "au.com.example.abstracts" type_field = "type" class ResourceA(AbstractResource): class Meta: ...
Add tests for polymorphic types""" Tests of polymorphic behaviours """ import odin from odin.resources import create_resource_from_dict class AbstractResource(odin.Resource): class Meta: abstract = True namespace = "au.com.example.abstracts" type_field = "type" class ResourceA(AbstractRe...
<commit_before><commit_msg>Add tests for polymorphic types<commit_after>""" Tests of polymorphic behaviours """ import odin from odin.resources import create_resource_from_dict class AbstractResource(odin.Resource): class Meta: abstract = True namespace = "au.com.example.abstracts" type_fi...
d9296356f9616a7712774e2349d6392f30e352cd
indico/MaKaC/plugins/EPayment/options.py
indico/MaKaC/plugins/EPayment/options.py
# -*- coding: utf-8 -*- ## ## ## This file is part of CDS Indico. ## Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 CERN. ## ## CDS Indico is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 o...
Add option file for EPayment administrator
[IMP] Add option file for EPayment administrator
Python
mit
mic4ael/indico,indico/indico,OmeGak/indico,ThiefMaster/indico,pferreir/indico,mvidalgarcia/indico,pferreir/indico,DirkHoffmann/indico,ThiefMaster/indico,OmeGak/indico,ThiefMaster/indico,DirkHoffmann/indico,indico/indico,DirkHoffmann/indico,indico/indico,OmeGak/indico,mic4ael/indico,mvidalgarcia/indico,mvidalgarcia/indi...
[IMP] Add option file for EPayment administrator
# -*- coding: utf-8 -*- ## ## ## This file is part of CDS Indico. ## Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 CERN. ## ## CDS Indico is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 o...
<commit_before><commit_msg>[IMP] Add option file for EPayment administrator<commit_after>
# -*- coding: utf-8 -*- ## ## ## This file is part of CDS Indico. ## Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 CERN. ## ## CDS Indico is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 o...
[IMP] Add option file for EPayment administrator# -*- coding: utf-8 -*- ## ## ## This file is part of CDS Indico. ## Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 CERN. ## ## CDS Indico is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by ...
<commit_before><commit_msg>[IMP] Add option file for EPayment administrator<commit_after># -*- coding: utf-8 -*- ## ## ## This file is part of CDS Indico. ## Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 CERN. ## ## CDS Indico is free software; you can redistribute it and/or ## modify it under the terms of the GNU G...
a38f46566b18803d0b5ab0d75a267ee9ac3ceea3
doc/examples/viennagrid_wrapper/io.py
doc/examples/viennagrid_wrapper/io.py
#!/usr/bin/env python # # This example shows how to read and write mesh files using the low-level ViennaGrid # wrapper for Python (viennagrid.wrapper). from __future__ import print_function # In this example, we will set up a domain of triangles in the cartesian 3D # space from the contents of a Netgen mesh file. # ...
Write an example of the use of the Netgen reader.
Write an example of the use of the Netgen reader.
Python
mit
jonancm/viennagrid-python,jonancm/viennagrid-python,jonancm/viennagrid-python
Write an example of the use of the Netgen reader.
#!/usr/bin/env python # # This example shows how to read and write mesh files using the low-level ViennaGrid # wrapper for Python (viennagrid.wrapper). from __future__ import print_function # In this example, we will set up a domain of triangles in the cartesian 3D # space from the contents of a Netgen mesh file. # ...
<commit_before><commit_msg>Write an example of the use of the Netgen reader.<commit_after>
#!/usr/bin/env python # # This example shows how to read and write mesh files using the low-level ViennaGrid # wrapper for Python (viennagrid.wrapper). from __future__ import print_function # In this example, we will set up a domain of triangles in the cartesian 3D # space from the contents of a Netgen mesh file. # ...
Write an example of the use of the Netgen reader.#!/usr/bin/env python # # This example shows how to read and write mesh files using the low-level ViennaGrid # wrapper for Python (viennagrid.wrapper). from __future__ import print_function # In this example, we will set up a domain of triangles in the cartesian 3D # ...
<commit_before><commit_msg>Write an example of the use of the Netgen reader.<commit_after>#!/usr/bin/env python # # This example shows how to read and write mesh files using the low-level ViennaGrid # wrapper for Python (viennagrid.wrapper). from __future__ import print_function # In this example, we will set up a d...
57bee62b1bd6c42469f420e036937ea3c9ca56b7
wikilink/db/connection.py
wikilink/db/connection.py
from sqlalchemy import create_engine from sqlalchemy_utils import functions from sqlalchemy.orm import sessionmaker class Connection: def __init__(self, db, name, password, ip, port): if db == "postgresql": connection = "postgresql+psycopg2://" + name + ":" + password + "@" + ip + ":" + port elif db == "mys...
Change class name to Connection
Change class name to Connection Signed-off-by: Tran Ly Vu <[email protected]>
Python
apache-2.0
tranlyvu/find-link,tranlyvu/findLink
Change class name to Connection Signed-off-by: Tran Ly Vu <[email protected]>
from sqlalchemy import create_engine from sqlalchemy_utils import functions from sqlalchemy.orm import sessionmaker class Connection: def __init__(self, db, name, password, ip, port): if db == "postgresql": connection = "postgresql+psycopg2://" + name + ":" + password + "@" + ip + ":" + port elif db == "mys...
<commit_before><commit_msg>Change class name to Connection Signed-off-by: Tran Ly Vu <[email protected]><commit_after>
from sqlalchemy import create_engine from sqlalchemy_utils import functions from sqlalchemy.orm import sessionmaker class Connection: def __init__(self, db, name, password, ip, port): if db == "postgresql": connection = "postgresql+psycopg2://" + name + ":" + password + "@" + ip + ":" + port elif db == "mys...
Change class name to Connection Signed-off-by: Tran Ly Vu <[email protected]>from sqlalchemy import create_engine from sqlalchemy_utils import functions from sqlalchemy.orm import sessionmaker class Connection: def __init__(self, db, name, password, ip, port): if db == "postgresql"...
<commit_before><commit_msg>Change class name to Connection Signed-off-by: Tran Ly Vu <[email protected]><commit_after>from sqlalchemy import create_engine from sqlalchemy_utils import functions from sqlalchemy.orm import sessionmaker class Connection: def __init__(self, db, name, pas...
ec99e4fea77074bfe525bb2aeecbe66be231cc7d
integration-tests/multiple_clients_test.py
integration-tests/multiple_clients_test.py
#!/usr/bin/env python2.7 from __future__ import absolute_import, division, unicode_literals import json import requests import websocket test_url ='http://localhost:3000/so/cool?auth=mS7karSP9QbD2FFdgBk2QmuTna7fJyp7ll0Vg8gnffIBHKILSrusMslucBzMhwO' def validate_data(connections, expected_result): for connection i...
Add a multiple client integration test
Add a multiple client integration test It appears to have found an issue right away: Clients are not disconnected even if the process spawning them has exited.
Python
bsd-3-clause
channable/icepeak,channable/icepeak,channable/icepeak
Add a multiple client integration test It appears to have found an issue right away: Clients are not disconnected even if the process spawning them has exited.
#!/usr/bin/env python2.7 from __future__ import absolute_import, division, unicode_literals import json import requests import websocket test_url ='http://localhost:3000/so/cool?auth=mS7karSP9QbD2FFdgBk2QmuTna7fJyp7ll0Vg8gnffIBHKILSrusMslucBzMhwO' def validate_data(connections, expected_result): for connection i...
<commit_before><commit_msg>Add a multiple client integration test It appears to have found an issue right away: Clients are not disconnected even if the process spawning them has exited.<commit_after>
#!/usr/bin/env python2.7 from __future__ import absolute_import, division, unicode_literals import json import requests import websocket test_url ='http://localhost:3000/so/cool?auth=mS7karSP9QbD2FFdgBk2QmuTna7fJyp7ll0Vg8gnffIBHKILSrusMslucBzMhwO' def validate_data(connections, expected_result): for connection i...
Add a multiple client integration test It appears to have found an issue right away: Clients are not disconnected even if the process spawning them has exited.#!/usr/bin/env python2.7 from __future__ import absolute_import, division, unicode_literals import json import requests import websocket test_url ='http://loc...
<commit_before><commit_msg>Add a multiple client integration test It appears to have found an issue right away: Clients are not disconnected even if the process spawning them has exited.<commit_after>#!/usr/bin/env python2.7 from __future__ import absolute_import, division, unicode_literals import json import request...
c6c92b1d073151d0c7173d9718e79465c3ce5803
midterm/problem4.py
midterm/problem4.py
# Problem 4 # 10.0 points possible (graded) # Implement a function called closest_power that meets the specifications below. # For example, # closest_power(3,12) returns 2 # closest_power(4,12) returns 2 # closest_power(4,1) returns 0 def closest_power(base, num): ''' base: base of the exponential, integer > 1 ...
Implement a function called closest_power
Implement a function called closest_power
Python
mit
Kunal57/MIT_6.00.1x
Implement a function called closest_power
# Problem 4 # 10.0 points possible (graded) # Implement a function called closest_power that meets the specifications below. # For example, # closest_power(3,12) returns 2 # closest_power(4,12) returns 2 # closest_power(4,1) returns 0 def closest_power(base, num): ''' base: base of the exponential, integer > 1 ...
<commit_before><commit_msg>Implement a function called closest_power<commit_after>
# Problem 4 # 10.0 points possible (graded) # Implement a function called closest_power that meets the specifications below. # For example, # closest_power(3,12) returns 2 # closest_power(4,12) returns 2 # closest_power(4,1) returns 0 def closest_power(base, num): ''' base: base of the exponential, integer > 1 ...
Implement a function called closest_power# Problem 4 # 10.0 points possible (graded) # Implement a function called closest_power that meets the specifications below. # For example, # closest_power(3,12) returns 2 # closest_power(4,12) returns 2 # closest_power(4,1) returns 0 def closest_power(base, num): ''' bas...
<commit_before><commit_msg>Implement a function called closest_power<commit_after># Problem 4 # 10.0 points possible (graded) # Implement a function called closest_power that meets the specifications below. # For example, # closest_power(3,12) returns 2 # closest_power(4,12) returns 2 # closest_power(4,1) returns 0 ...
840c34f9428cc4b7db6dbc610a72e3ed5957e04c
neutron_vpnaas/cmd/eventlet/vyatta_agent.py
neutron_vpnaas/cmd/eventlet/vyatta_agent.py
# Copyright 2015 Brocade Communications System, 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 # #...
Introduce Vyatta VPN agent cmd in monkey patched eventlet module
Introduce Vyatta VPN agent cmd in monkey patched eventlet module Commit [1] introduced an entry for reference vpn agent in cmd/eventlet module so that they get monkey patched in an uniform way. This commit introduces the same for vyatta vpn agent. [1] I2d7081dbd4cb532332e3b66667bb8c71aa5a6658 Change-Id: Icc3c8f040bd...
Python
apache-2.0
openstack/neutron-vpnaas,openstack/neutron-vpnaas
Introduce Vyatta VPN agent cmd in monkey patched eventlet module Commit [1] introduced an entry for reference vpn agent in cmd/eventlet module so that they get monkey patched in an uniform way. This commit introduces the same for vyatta vpn agent. [1] I2d7081dbd4cb532332e3b66667bb8c71aa5a6658 Change-Id: Icc3c8f040bd...
# Copyright 2015 Brocade Communications System, 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 # #...
<commit_before><commit_msg>Introduce Vyatta VPN agent cmd in monkey patched eventlet module Commit [1] introduced an entry for reference vpn agent in cmd/eventlet module so that they get monkey patched in an uniform way. This commit introduces the same for vyatta vpn agent. [1] I2d7081dbd4cb532332e3b66667bb8c71aa5a66...
# Copyright 2015 Brocade Communications System, 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 # #...
Introduce Vyatta VPN agent cmd in monkey patched eventlet module Commit [1] introduced an entry for reference vpn agent in cmd/eventlet module so that they get monkey patched in an uniform way. This commit introduces the same for vyatta vpn agent. [1] I2d7081dbd4cb532332e3b66667bb8c71aa5a6658 Change-Id: Icc3c8f040bd...
<commit_before><commit_msg>Introduce Vyatta VPN agent cmd in monkey patched eventlet module Commit [1] introduced an entry for reference vpn agent in cmd/eventlet module so that they get monkey patched in an uniform way. This commit introduces the same for vyatta vpn agent. [1] I2d7081dbd4cb532332e3b66667bb8c71aa5a66...
208dcdf09afc0d625439f6c20b5272a06b86c87f
lms/djangoapps/edraak_certificates/tests/test_webview_changes.py
lms/djangoapps/edraak_certificates/tests/test_webview_changes.py
"""Tests for changes on certificates by Edraak""" from django.test.utils import override_settings from lms.djangoapps.certificates.api import get_certificate_url from lms.djangoapps.certificates.models import CertificateTemplate from lms.djangoapps.certificates.tests.test_webview_views import CommonCertificatesTestC...
Add Tests for Changes of Certificate
Add Tests for Changes of Certificate
Python
agpl-3.0
Edraak/edraak-platform,Edraak/edraak-platform,Edraak/edraak-platform,Edraak/edraak-platform
Add Tests for Changes of Certificate
"""Tests for changes on certificates by Edraak""" from django.test.utils import override_settings from lms.djangoapps.certificates.api import get_certificate_url from lms.djangoapps.certificates.models import CertificateTemplate from lms.djangoapps.certificates.tests.test_webview_views import CommonCertificatesTestC...
<commit_before><commit_msg>Add Tests for Changes of Certificate<commit_after>
"""Tests for changes on certificates by Edraak""" from django.test.utils import override_settings from lms.djangoapps.certificates.api import get_certificate_url from lms.djangoapps.certificates.models import CertificateTemplate from lms.djangoapps.certificates.tests.test_webview_views import CommonCertificatesTestC...
Add Tests for Changes of Certificate"""Tests for changes on certificates by Edraak""" from django.test.utils import override_settings from lms.djangoapps.certificates.api import get_certificate_url from lms.djangoapps.certificates.models import CertificateTemplate from lms.djangoapps.certificates.tests.test_webview_...
<commit_before><commit_msg>Add Tests for Changes of Certificate<commit_after>"""Tests for changes on certificates by Edraak""" from django.test.utils import override_settings from lms.djangoapps.certificates.api import get_certificate_url from lms.djangoapps.certificates.models import CertificateTemplate from lms.dj...
0a70e5cd789131ae67a4cdbd25ea0fc1b140bfe2
tests/general_test.py
tests/general_test.py
from tests.integration import _IntegrationTest from bioagents import Bioagent, BioagentException from kqml import KQMLList, KQMLPerformative class TestErrorHandling(_IntegrationTest): reason = 'Found it!' def __init__(self, *args): class FindMe(BioagentException): pass class Test...
Add test for exception handling problem.
Add test for exception handling problem.
Python
bsd-2-clause
bgyori/bioagents,sorgerlab/bioagents
Add test for exception handling problem.
from tests.integration import _IntegrationTest from bioagents import Bioagent, BioagentException from kqml import KQMLList, KQMLPerformative class TestErrorHandling(_IntegrationTest): reason = 'Found it!' def __init__(self, *args): class FindMe(BioagentException): pass class Test...
<commit_before><commit_msg>Add test for exception handling problem.<commit_after>
from tests.integration import _IntegrationTest from bioagents import Bioagent, BioagentException from kqml import KQMLList, KQMLPerformative class TestErrorHandling(_IntegrationTest): reason = 'Found it!' def __init__(self, *args): class FindMe(BioagentException): pass class Test...
Add test for exception handling problem.from tests.integration import _IntegrationTest from bioagents import Bioagent, BioagentException from kqml import KQMLList, KQMLPerformative class TestErrorHandling(_IntegrationTest): reason = 'Found it!' def __init__(self, *args): class FindMe(BioagentExceptio...
<commit_before><commit_msg>Add test for exception handling problem.<commit_after>from tests.integration import _IntegrationTest from bioagents import Bioagent, BioagentException from kqml import KQMLList, KQMLPerformative class TestErrorHandling(_IntegrationTest): reason = 'Found it!' def __init__(self, *arg...
007c2be42ae5a5cb16b04a7f0fa0dffdb0649068
CodeFights/arrayPacking.py
CodeFights/arrayPacking.py
#!/usr/local/bin/python # Code Fights Are Equally Strong Problem def arrayPacking(): pass def main(): tests = [ [], [] ] for t in tests: res = arrayPacking(t[0]) if t[1] == res: print("PASSED: arrayPacking({}) returned {}" .format(t[0], ...
Add file for Code Fights array packing problem
Add file for Code Fights array packing problem
Python
mit
HKuz/Test_Code
Add file for Code Fights array packing problem
#!/usr/local/bin/python # Code Fights Are Equally Strong Problem def arrayPacking(): pass def main(): tests = [ [], [] ] for t in tests: res = arrayPacking(t[0]) if t[1] == res: print("PASSED: arrayPacking({}) returned {}" .format(t[0], ...
<commit_before><commit_msg>Add file for Code Fights array packing problem<commit_after>
#!/usr/local/bin/python # Code Fights Are Equally Strong Problem def arrayPacking(): pass def main(): tests = [ [], [] ] for t in tests: res = arrayPacking(t[0]) if t[1] == res: print("PASSED: arrayPacking({}) returned {}" .format(t[0], ...
Add file for Code Fights array packing problem#!/usr/local/bin/python # Code Fights Are Equally Strong Problem def arrayPacking(): pass def main(): tests = [ [], [] ] for t in tests: res = arrayPacking(t[0]) if t[1] == res: print("PASSED: arrayPacking({})...
<commit_before><commit_msg>Add file for Code Fights array packing problem<commit_after>#!/usr/local/bin/python # Code Fights Are Equally Strong Problem def arrayPacking(): pass def main(): tests = [ [], [] ] for t in tests: res = arrayPacking(t[0]) if t[1] == res: ...
b9dcf30e199b19d5115f4ea7602ef10a8bfa966c
asyncio_irc/tests/test_filters.py
asyncio_irc/tests/test_filters.py
from unittest import mock, TestCase from .. import filters from ..message import ReceivedMessage class TestCommandBlacklist(TestCase): def setUp(self): self.connection = object() self.handler = mock.Mock() def test_correct(self): message = ReceivedMessage(b'COMMAND\r\n') wrap...
Test the new filtering decorators
Test the new filtering decorators
Python
bsd-2-clause
meshy/framewirc
Test the new filtering decorators
from unittest import mock, TestCase from .. import filters from ..message import ReceivedMessage class TestCommandBlacklist(TestCase): def setUp(self): self.connection = object() self.handler = mock.Mock() def test_correct(self): message = ReceivedMessage(b'COMMAND\r\n') wrap...
<commit_before><commit_msg>Test the new filtering decorators<commit_after>
from unittest import mock, TestCase from .. import filters from ..message import ReceivedMessage class TestCommandBlacklist(TestCase): def setUp(self): self.connection = object() self.handler = mock.Mock() def test_correct(self): message = ReceivedMessage(b'COMMAND\r\n') wrap...
Test the new filtering decoratorsfrom unittest import mock, TestCase from .. import filters from ..message import ReceivedMessage class TestCommandBlacklist(TestCase): def setUp(self): self.connection = object() self.handler = mock.Mock() def test_correct(self): message = ReceivedMes...
<commit_before><commit_msg>Test the new filtering decorators<commit_after>from unittest import mock, TestCase from .. import filters from ..message import ReceivedMessage class TestCommandBlacklist(TestCase): def setUp(self): self.connection = object() self.handler = mock.Mock() def test_cor...
f29dd515a853a18d5680e4f6e1fa9608c8c26076
research_pyutils/tests/tests_auxiliary.py
research_pyutils/tests/tests_auxiliary.py
import numpy as np def test_array_reshape_to_dims(): from research_pyutils import array_reshape_to_dims a = np.array([[1, 2], [3, 4], [5, 6], [7, 8]]) sh = a.shape tot = sh[0] * sh[1] # # test 1 for a conversion, vectorize. b = array_reshape_to_dims(a, k=1) assert b.shape[0] == tot ass...
Add the tests for auxiliary.py modules.
Add the tests for auxiliary.py modules.
Python
apache-2.0
grigorisg9gr/pyutils,grigorisg9gr/pyutils
Add the tests for auxiliary.py modules.
import numpy as np def test_array_reshape_to_dims(): from research_pyutils import array_reshape_to_dims a = np.array([[1, 2], [3, 4], [5, 6], [7, 8]]) sh = a.shape tot = sh[0] * sh[1] # # test 1 for a conversion, vectorize. b = array_reshape_to_dims(a, k=1) assert b.shape[0] == tot ass...
<commit_before><commit_msg>Add the tests for auxiliary.py modules.<commit_after>
import numpy as np def test_array_reshape_to_dims(): from research_pyutils import array_reshape_to_dims a = np.array([[1, 2], [3, 4], [5, 6], [7, 8]]) sh = a.shape tot = sh[0] * sh[1] # # test 1 for a conversion, vectorize. b = array_reshape_to_dims(a, k=1) assert b.shape[0] == tot ass...
Add the tests for auxiliary.py modules.import numpy as np def test_array_reshape_to_dims(): from research_pyutils import array_reshape_to_dims a = np.array([[1, 2], [3, 4], [5, 6], [7, 8]]) sh = a.shape tot = sh[0] * sh[1] # # test 1 for a conversion, vectorize. b = array_reshape_to_dims(a, k=...
<commit_before><commit_msg>Add the tests for auxiliary.py modules.<commit_after>import numpy as np def test_array_reshape_to_dims(): from research_pyutils import array_reshape_to_dims a = np.array([[1, 2], [3, 4], [5, 6], [7, 8]]) sh = a.shape tot = sh[0] * sh[1] # # test 1 for a conversion, vecto...
d454b9aead39db2c6836d6d0e0565decd92e85b7
bin/debug/load_timeline_for_day_and_user.py
bin/debug/load_timeline_for_day_and_user.py
import json import bson.json_util as bju import emission.core.get_database as edb import sys if __name__ == '__main__': if len(sys.argv) != 2: print "Usage: %s <filename>" % (sys.argv[0]) fn = sys.argv[1] print "Loading file " + fn entries = json.load(open(fn), object_hook = bju.object_hook) ...
Load the timeseries data for a particular day/user combination
Load the timeseries data for a particular day/user combination So that we can perform analysis on it
Python
bsd-3-clause
sunil07t/e-mission-server,sunil07t/e-mission-server,e-mission/e-mission-server,yw374cornell/e-mission-server,shankari/e-mission-server,yw374cornell/e-mission-server,joshzarrabi/e-mission-server,shankari/e-mission-server,e-mission/e-mission-server,sunil07t/e-mission-server,shankari/e-mission-server,sunil07t/e-mission-se...
Load the timeseries data for a particular day/user combination So that we can perform analysis on it
import json import bson.json_util as bju import emission.core.get_database as edb import sys if __name__ == '__main__': if len(sys.argv) != 2: print "Usage: %s <filename>" % (sys.argv[0]) fn = sys.argv[1] print "Loading file " + fn entries = json.load(open(fn), object_hook = bju.object_hook) ...
<commit_before><commit_msg>Load the timeseries data for a particular day/user combination So that we can perform analysis on it<commit_after>
import json import bson.json_util as bju import emission.core.get_database as edb import sys if __name__ == '__main__': if len(sys.argv) != 2: print "Usage: %s <filename>" % (sys.argv[0]) fn = sys.argv[1] print "Loading file " + fn entries = json.load(open(fn), object_hook = bju.object_hook) ...
Load the timeseries data for a particular day/user combination So that we can perform analysis on itimport json import bson.json_util as bju import emission.core.get_database as edb import sys if __name__ == '__main__': if len(sys.argv) != 2: print "Usage: %s <filename>" % (sys.argv[0]) fn = sys.argv...
<commit_before><commit_msg>Load the timeseries data for a particular day/user combination So that we can perform analysis on it<commit_after>import json import bson.json_util as bju import emission.core.get_database as edb import sys if __name__ == '__main__': if len(sys.argv) != 2: print "Usage: %s <file...
cdf107ddeb9ca4f11ca5e5af59e196e752e79841
amzn.py
amzn.py
avsRequestHeader = { "messageHeader": { "deviceContext": [ { "name": "playbackState", "namespace": "AudioPlayer", "payload": { "streamId": "", "offsetInMilliseconds": "0", ...
Put AVS Request Header into separate module
Put AVS Request Header into separate module Signed-off-by: Mike Erdahl <[email protected]>
Python
mit
merdahl/AlexaBeagleBone2
Put AVS Request Header into separate module Signed-off-by: Mike Erdahl <[email protected]>
avsRequestHeader = { "messageHeader": { "deviceContext": [ { "name": "playbackState", "namespace": "AudioPlayer", "payload": { "streamId": "", "offsetInMilliseconds": "0", ...
<commit_before><commit_msg>Put AVS Request Header into separate module Signed-off-by: Mike Erdahl <[email protected]><commit_after>
avsRequestHeader = { "messageHeader": { "deviceContext": [ { "name": "playbackState", "namespace": "AudioPlayer", "payload": { "streamId": "", "offsetInMilliseconds": "0", ...
Put AVS Request Header into separate module Signed-off-by: Mike Erdahl <[email protected]>avsRequestHeader = { "messageHeader": { "deviceContext": [ { "name": "playbackState", "namespace": "AudioPlayer", ...
<commit_before><commit_msg>Put AVS Request Header into separate module Signed-off-by: Mike Erdahl <[email protected]><commit_after>avsRequestHeader = { "messageHeader": { "deviceContext": [ { "name": "playbackState", ...
72b0502e3d1c9b2e95b43a2d5c182544a5acdbd3
kala.py
kala.py
#!/usr/bin/python import json import bottle from bottle_mongo import MongoPlugin app = bottle.Bottle() app.config.load_config('settings.ini') bottle.install(MongoPlugin( uri=app.config['mongodb.uri'], db=app.config['mongodb.db'], json_mongo=True)) def _get_json(name): result = bottle.request.que...
#!/usr/bin/python import json import bottle from bottle_mongo import MongoPlugin app = bottle.Bottle() app.config.load_config('settings.ini') app.install(MongoPlugin( uri=app.config['mongodb.uri'], db=app.config['mongodb.db'], json_mongo=True)) def _get_json(name): result = bottle.request.query....
Install the plugin to the app.
Bugfix: Install the plugin to the app.
Python
mit
cloudbuy/kala,damoxc/kala,cheng93/kala
#!/usr/bin/python import json import bottle from bottle_mongo import MongoPlugin app = bottle.Bottle() app.config.load_config('settings.ini') bottle.install(MongoPlugin( uri=app.config['mongodb.uri'], db=app.config['mongodb.db'], json_mongo=True)) def _get_json(name): result = bottle.request.que...
#!/usr/bin/python import json import bottle from bottle_mongo import MongoPlugin app = bottle.Bottle() app.config.load_config('settings.ini') app.install(MongoPlugin( uri=app.config['mongodb.uri'], db=app.config['mongodb.db'], json_mongo=True)) def _get_json(name): result = bottle.request.query....
<commit_before>#!/usr/bin/python import json import bottle from bottle_mongo import MongoPlugin app = bottle.Bottle() app.config.load_config('settings.ini') bottle.install(MongoPlugin( uri=app.config['mongodb.uri'], db=app.config['mongodb.db'], json_mongo=True)) def _get_json(name): result = bot...
#!/usr/bin/python import json import bottle from bottle_mongo import MongoPlugin app = bottle.Bottle() app.config.load_config('settings.ini') app.install(MongoPlugin( uri=app.config['mongodb.uri'], db=app.config['mongodb.db'], json_mongo=True)) def _get_json(name): result = bottle.request.query....
#!/usr/bin/python import json import bottle from bottle_mongo import MongoPlugin app = bottle.Bottle() app.config.load_config('settings.ini') bottle.install(MongoPlugin( uri=app.config['mongodb.uri'], db=app.config['mongodb.db'], json_mongo=True)) def _get_json(name): result = bottle.request.que...
<commit_before>#!/usr/bin/python import json import bottle from bottle_mongo import MongoPlugin app = bottle.Bottle() app.config.load_config('settings.ini') bottle.install(MongoPlugin( uri=app.config['mongodb.uri'], db=app.config['mongodb.db'], json_mongo=True)) def _get_json(name): result = bot...
822bc71bc8153db2b403bcaadb65755e7563ddb2
src/mmw/apps/modeling/migrations/0020_old_scenarios.py
src/mmw/apps/modeling/migrations/0020_old_scenarios.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations def clear_old_scenario_results(apps, schema_editor): Scenario = apps.get_model('modeling', 'Scenario') old_scenarios = Scenario.objects.filter( project__model_package='tr-55' ).filter(...
Clear outdated cached results in old scenarios
Clear outdated cached results in old scenarios Their values will be reclalculated and cached in the new format by the front-end whenever they are loaded next.
Python
apache-2.0
kdeloach/model-my-watershed,kdeloach/model-my-watershed,WikiWatershed/model-my-watershed,kdeloach/model-my-watershed,WikiWatershed/model-my-watershed,kdeloach/model-my-watershed,WikiWatershed/model-my-watershed,WikiWatershed/model-my-watershed,kdeloach/model-my-watershed,WikiWatershed/model-my-watershed
Clear outdated cached results in old scenarios Their values will be reclalculated and cached in the new format by the front-end whenever they are loaded next.
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations def clear_old_scenario_results(apps, schema_editor): Scenario = apps.get_model('modeling', 'Scenario') old_scenarios = Scenario.objects.filter( project__model_package='tr-55' ).filter(...
<commit_before><commit_msg>Clear outdated cached results in old scenarios Their values will be reclalculated and cached in the new format by the front-end whenever they are loaded next.<commit_after>
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations def clear_old_scenario_results(apps, schema_editor): Scenario = apps.get_model('modeling', 'Scenario') old_scenarios = Scenario.objects.filter( project__model_package='tr-55' ).filter(...
Clear outdated cached results in old scenarios Their values will be reclalculated and cached in the new format by the front-end whenever they are loaded next.# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations def clear_old_scenario_results(apps, schema_editor): ...
<commit_before><commit_msg>Clear outdated cached results in old scenarios Their values will be reclalculated and cached in the new format by the front-end whenever they are loaded next.<commit_after># -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations def clear_ol...
629459d8b8780e4ecca3104034cdeccdd7cccfb3
src/olympia/yara/migrations/0003_auto_20191010_1446.py
src/olympia/yara/migrations/0003_auto_20191010_1446.py
from django.db import migrations from django.db.models import Case, Value, When def backfill_has_matches(apps, schema_editor): YaraResult = apps.get_model('yara', 'YaraResult') YaraResult.objects.filter(has_matches=None).update( has_matches=Case( When(matches='[]', then=Value(False)), ...
Add data migration to backfill YaraResult.has_matches
Add data migration to backfill YaraResult.has_matches
Python
bsd-3-clause
bqbn/addons-server,mozilla/addons-server,psiinon/addons-server,mozilla/addons-server,wagnerand/addons-server,mozilla/olympia,mozilla/olympia,psiinon/addons-server,wagnerand/addons-server,psiinon/addons-server,bqbn/addons-server,diox/olympia,mozilla/olympia,bqbn/addons-server,mozilla/addons-server,eviljeff/olympia,evilj...
Add data migration to backfill YaraResult.has_matches
from django.db import migrations from django.db.models import Case, Value, When def backfill_has_matches(apps, schema_editor): YaraResult = apps.get_model('yara', 'YaraResult') YaraResult.objects.filter(has_matches=None).update( has_matches=Case( When(matches='[]', then=Value(False)), ...
<commit_before><commit_msg>Add data migration to backfill YaraResult.has_matches<commit_after>
from django.db import migrations from django.db.models import Case, Value, When def backfill_has_matches(apps, schema_editor): YaraResult = apps.get_model('yara', 'YaraResult') YaraResult.objects.filter(has_matches=None).update( has_matches=Case( When(matches='[]', then=Value(False)), ...
Add data migration to backfill YaraResult.has_matchesfrom django.db import migrations from django.db.models import Case, Value, When def backfill_has_matches(apps, schema_editor): YaraResult = apps.get_model('yara', 'YaraResult') YaraResult.objects.filter(has_matches=None).update( has_matches=Case( ...
<commit_before><commit_msg>Add data migration to backfill YaraResult.has_matches<commit_after>from django.db import migrations from django.db.models import Case, Value, When def backfill_has_matches(apps, schema_editor): YaraResult = apps.get_model('yara', 'YaraResult') YaraResult.objects.filter(has_matches=N...
92dda83e9fe2c33639867c35a97c2b536e53278c
prep.py
prep.py
from os import listdir from os.path import join def file_paths(data_path): return [join(data_path, name) for name in listdir(data_path)] def training_data(data_path): paths = file_paths(data_path) raw_text = [ open(path, 'r').read() for path in paths] dataX = [] dataY = [] for text in raw_text: data ...
Read data and split inputs and outputs
Read data and split inputs and outputs
Python
mit
vdragan1993/python-coder
Read data and split inputs and outputs
from os import listdir from os.path import join def file_paths(data_path): return [join(data_path, name) for name in listdir(data_path)] def training_data(data_path): paths = file_paths(data_path) raw_text = [ open(path, 'r').read() for path in paths] dataX = [] dataY = [] for text in raw_text: data ...
<commit_before><commit_msg>Read data and split inputs and outputs<commit_after>
from os import listdir from os.path import join def file_paths(data_path): return [join(data_path, name) for name in listdir(data_path)] def training_data(data_path): paths = file_paths(data_path) raw_text = [ open(path, 'r').read() for path in paths] dataX = [] dataY = [] for text in raw_text: data ...
Read data and split inputs and outputsfrom os import listdir from os.path import join def file_paths(data_path): return [join(data_path, name) for name in listdir(data_path)] def training_data(data_path): paths = file_paths(data_path) raw_text = [ open(path, 'r').read() for path in paths] dataX = [] dataY ...
<commit_before><commit_msg>Read data and split inputs and outputs<commit_after>from os import listdir from os.path import join def file_paths(data_path): return [join(data_path, name) for name in listdir(data_path)] def training_data(data_path): paths = file_paths(data_path) raw_text = [ open(path, 'r').read() ...
597000dac85ef0760e04f3c6d885bde531fa86a2
Lib/test/crashers/decref_before_assignment.py
Lib/test/crashers/decref_before_assignment.py
""" General example for an attack against code like this: Py_DECREF(obj->attr); obj->attr = ...; here in Module/_json.c:scanner_init(). Explanation: if the first Py_DECREF() calls either a __del__ or a weakref callback, it will run while the 'obj' appears to have in 'obj->attr' still the old reference to the obj...
Add a crasher for the documented issue of calling "Py_DECREF(self->xxx)";
Add a crasher for the documented issue of calling "Py_DECREF(self->xxx)";
Python
mit
sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator
Add a crasher for the documented issue of calling "Py_DECREF(self->xxx)";
""" General example for an attack against code like this: Py_DECREF(obj->attr); obj->attr = ...; here in Module/_json.c:scanner_init(). Explanation: if the first Py_DECREF() calls either a __del__ or a weakref callback, it will run while the 'obj' appears to have in 'obj->attr' still the old reference to the obj...
<commit_before><commit_msg>Add a crasher for the documented issue of calling "Py_DECREF(self->xxx)";<commit_after>
""" General example for an attack against code like this: Py_DECREF(obj->attr); obj->attr = ...; here in Module/_json.c:scanner_init(). Explanation: if the first Py_DECREF() calls either a __del__ or a weakref callback, it will run while the 'obj' appears to have in 'obj->attr' still the old reference to the obj...
Add a crasher for the documented issue of calling "Py_DECREF(self->xxx)";""" General example for an attack against code like this: Py_DECREF(obj->attr); obj->attr = ...; here in Module/_json.c:scanner_init(). Explanation: if the first Py_DECREF() calls either a __del__ or a weakref callback, it will run while th...
<commit_before><commit_msg>Add a crasher for the documented issue of calling "Py_DECREF(self->xxx)";<commit_after>""" General example for an attack against code like this: Py_DECREF(obj->attr); obj->attr = ...; here in Module/_json.c:scanner_init(). Explanation: if the first Py_DECREF() calls either a __del__ or...
aaa546cf6a0ba15a0d1b4a8d7ad5b3c8d349f9b8
tidy.py
tidy.py
#!/usr/bin/env python ''' Script for reflowing C code. This script is intended to be run on arbitrarily messy - but valid - C code, which it then attempts to reformat into something more readable. Usage is pretty straightforward. Note that you will need a recent version of Clang to avoid common bugs in its AST printi...
Add a tool for cleaning up the messy C output by the pruner.
Add a tool for cleaning up the messy C output by the pruner.
Python
bsd-2-clause
seL4/pruner
Add a tool for cleaning up the messy C output by the pruner.
#!/usr/bin/env python ''' Script for reflowing C code. This script is intended to be run on arbitrarily messy - but valid - C code, which it then attempts to reformat into something more readable. Usage is pretty straightforward. Note that you will need a recent version of Clang to avoid common bugs in its AST printi...
<commit_before><commit_msg>Add a tool for cleaning up the messy C output by the pruner.<commit_after>
#!/usr/bin/env python ''' Script for reflowing C code. This script is intended to be run on arbitrarily messy - but valid - C code, which it then attempts to reformat into something more readable. Usage is pretty straightforward. Note that you will need a recent version of Clang to avoid common bugs in its AST printi...
Add a tool for cleaning up the messy C output by the pruner.#!/usr/bin/env python ''' Script for reflowing C code. This script is intended to be run on arbitrarily messy - but valid - C code, which it then attempts to reformat into something more readable. Usage is pretty straightforward. Note that you will need a re...
<commit_before><commit_msg>Add a tool for cleaning up the messy C output by the pruner.<commit_after>#!/usr/bin/env python ''' Script for reflowing C code. This script is intended to be run on arbitrarily messy - but valid - C code, which it then attempts to reformat into something more readable. Usage is pretty stra...
15a4b183c8c48d1960a23d8efa09eee42f882c14
tools/skp/page_sets/skia_micrographygirlsvg_desktop.py
tools/skp/page_sets/skia_micrographygirlsvg_desktop.py
# Copyright 2020 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. # pylint: disable=W0401,W0614 from telemetry import story from telemetry.page import page as page_module from telemetry.page import shared_page_state clas...
Add digital micrography svg to the RecreateSKPs bot
Add digital micrography svg to the RecreateSKPs bot Bug: skia:10752 Change-Id: I15d6bb189d44eddbd8bbe2133a2bd705f5313a75 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/319028 Reviewed-by: Chris Dalton <[email protected]> Commit-Queue: Ravi Mistry <9fa2e7438b8cb730f96b74865...
Python
bsd-3-clause
aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,google/skia,google/skia,aosp-mirror/platform_external_skia,google/skia,aosp-mirror/platform_external_skia,google/skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_extern...
Add digital micrography svg to the RecreateSKPs bot Bug: skia:10752 Change-Id: I15d6bb189d44eddbd8bbe2133a2bd705f5313a75 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/319028 Reviewed-by: Chris Dalton <[email protected]> Commit-Queue: Ravi Mistry <9fa2e7438b8cb730f96b74865...
# Copyright 2020 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. # pylint: disable=W0401,W0614 from telemetry import story from telemetry.page import page as page_module from telemetry.page import shared_page_state clas...
<commit_before><commit_msg>Add digital micrography svg to the RecreateSKPs bot Bug: skia:10752 Change-Id: I15d6bb189d44eddbd8bbe2133a2bd705f5313a75 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/319028 Reviewed-by: Chris Dalton <[email protected]> Commit-Queue: Ravi Mistry...
# Copyright 2020 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. # pylint: disable=W0401,W0614 from telemetry import story from telemetry.page import page as page_module from telemetry.page import shared_page_state clas...
Add digital micrography svg to the RecreateSKPs bot Bug: skia:10752 Change-Id: I15d6bb189d44eddbd8bbe2133a2bd705f5313a75 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/319028 Reviewed-by: Chris Dalton <[email protected]> Commit-Queue: Ravi Mistry <9fa2e7438b8cb730f96b74865...
<commit_before><commit_msg>Add digital micrography svg to the RecreateSKPs bot Bug: skia:10752 Change-Id: I15d6bb189d44eddbd8bbe2133a2bd705f5313a75 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/319028 Reviewed-by: Chris Dalton <[email protected]> Commit-Queue: Ravi Mistry...
330c4d257f987b72e23592308d0af6567e2f0064
snippets/keras/mnist_cross_validation.py
snippets/keras/mnist_cross_validation.py
import numpy as np np.random.seed(1337) # for reproducibility from keras.datasets import mnist from keras.models import Sequential from keras.layers.core import Dense, Dropout, Activation from keras.optimizers import RMSprop from keras.utils import np_utils import pandas as pd from sklearn.model_selection import Stra...
Add a working example of StratifiedKFold cross-validation on MNIST with Keras.
Add a working example of StratifiedKFold cross-validation on MNIST with Keras. Compute the mean/std of the loss and accuracy metrics over the folds.
Python
mit
bzamecnik/ml,bzamecnik/ml,bzamecnik/ml,bzamecnik/ml-playground,bzamecnik/ml-playground
Add a working example of StratifiedKFold cross-validation on MNIST with Keras. Compute the mean/std of the loss and accuracy metrics over the folds.
import numpy as np np.random.seed(1337) # for reproducibility from keras.datasets import mnist from keras.models import Sequential from keras.layers.core import Dense, Dropout, Activation from keras.optimizers import RMSprop from keras.utils import np_utils import pandas as pd from sklearn.model_selection import Stra...
<commit_before><commit_msg>Add a working example of StratifiedKFold cross-validation on MNIST with Keras. Compute the mean/std of the loss and accuracy metrics over the folds.<commit_after>
import numpy as np np.random.seed(1337) # for reproducibility from keras.datasets import mnist from keras.models import Sequential from keras.layers.core import Dense, Dropout, Activation from keras.optimizers import RMSprop from keras.utils import np_utils import pandas as pd from sklearn.model_selection import Stra...
Add a working example of StratifiedKFold cross-validation on MNIST with Keras. Compute the mean/std of the loss and accuracy metrics over the folds.import numpy as np np.random.seed(1337) # for reproducibility from keras.datasets import mnist from keras.models import Sequential from keras.layers.core import Dense, D...
<commit_before><commit_msg>Add a working example of StratifiedKFold cross-validation on MNIST with Keras. Compute the mean/std of the loss and accuracy metrics over the folds.<commit_after>import numpy as np np.random.seed(1337) # for reproducibility from keras.datasets import mnist from keras.models import Sequenti...
2ed4205e88f322e52fe2ade40f053c28f8a076a3
csunplugged/tests/utils/test_str_to_bool.py
csunplugged/tests/utils/test_str_to_bool.py
"""Test class for str_to_bool module.""" from django.test import SimpleTestCase from utils.str_to_bool import str_to_bool class StrToBoolTest(SimpleTestCase): """Test class for str_to_bool module.""" def test_true(self): self.assertTrue(str_to_bool("True")) def test_false(self): self.as...
Add tests for str_to_bool module.
Add tests for str_to_bool module.
Python
mit
uccser/cs-unplugged,uccser/cs-unplugged,uccser/cs-unplugged,uccser/cs-unplugged
Add tests for str_to_bool module.
"""Test class for str_to_bool module.""" from django.test import SimpleTestCase from utils.str_to_bool import str_to_bool class StrToBoolTest(SimpleTestCase): """Test class for str_to_bool module.""" def test_true(self): self.assertTrue(str_to_bool("True")) def test_false(self): self.as...
<commit_before><commit_msg>Add tests for str_to_bool module.<commit_after>
"""Test class for str_to_bool module.""" from django.test import SimpleTestCase from utils.str_to_bool import str_to_bool class StrToBoolTest(SimpleTestCase): """Test class for str_to_bool module.""" def test_true(self): self.assertTrue(str_to_bool("True")) def test_false(self): self.as...
Add tests for str_to_bool module."""Test class for str_to_bool module.""" from django.test import SimpleTestCase from utils.str_to_bool import str_to_bool class StrToBoolTest(SimpleTestCase): """Test class for str_to_bool module.""" def test_true(self): self.assertTrue(str_to_bool("True")) def ...
<commit_before><commit_msg>Add tests for str_to_bool module.<commit_after>"""Test class for str_to_bool module.""" from django.test import SimpleTestCase from utils.str_to_bool import str_to_bool class StrToBoolTest(SimpleTestCase): """Test class for str_to_bool module.""" def test_true(self): self....
9cb4cabe997590977b9002f731aa07734130d2d6
scikits/learn/glm/benchmarks/lars.py
scikits/learn/glm/benchmarks/lars.py
""" Benchmark for the LARS algorithm. Work in progress """ from datetime import datetime import numpy as np from scikits.learn import glm n, m = 100, 50000 X = np.random.randn(n, m) y = np.random.randn(n) print "Computing regularization path using the LARS ..." start = datetime.now() alphas, active, path = glm.lar...
""" Benchmark for the LARS algorithm. Work in progress """ from datetime import datetime import numpy as np from scikits.learn import glm n, m = 100, 50000 X = np.random.randn(n, m) y = np.random.randn(n) if __name__ == '__main__': print "Computing regularization path using the LARS ..." start = datetime.n...
Make sure computations do not get executed at import time, so that the tests still run.
BUG: Make sure computations do not get executed at import time, so that the tests still run.
Python
bsd-3-clause
hrjn/scikit-learn,arahuja/scikit-learn,hrjn/scikit-learn,glouppe/scikit-learn,betatim/scikit-learn,Titan-C/scikit-learn,rajat1994/scikit-learn,xavierwu/scikit-learn,amueller/scikit-learn,lucidfrontier45/scikit-learn,PrashntS/scikit-learn,raghavrv/scikit-learn,kylerbrown/scikit-learn,jzt5132/scikit-learn,ndingwall/sciki...
""" Benchmark for the LARS algorithm. Work in progress """ from datetime import datetime import numpy as np from scikits.learn import glm n, m = 100, 50000 X = np.random.randn(n, m) y = np.random.randn(n) print "Computing regularization path using the LARS ..." start = datetime.now() alphas, active, path = glm.lar...
""" Benchmark for the LARS algorithm. Work in progress """ from datetime import datetime import numpy as np from scikits.learn import glm n, m = 100, 50000 X = np.random.randn(n, m) y = np.random.randn(n) if __name__ == '__main__': print "Computing regularization path using the LARS ..." start = datetime.n...
<commit_before>""" Benchmark for the LARS algorithm. Work in progress """ from datetime import datetime import numpy as np from scikits.learn import glm n, m = 100, 50000 X = np.random.randn(n, m) y = np.random.randn(n) print "Computing regularization path using the LARS ..." start = datetime.now() alphas, active,...
""" Benchmark for the LARS algorithm. Work in progress """ from datetime import datetime import numpy as np from scikits.learn import glm n, m = 100, 50000 X = np.random.randn(n, m) y = np.random.randn(n) if __name__ == '__main__': print "Computing regularization path using the LARS ..." start = datetime.n...
""" Benchmark for the LARS algorithm. Work in progress """ from datetime import datetime import numpy as np from scikits.learn import glm n, m = 100, 50000 X = np.random.randn(n, m) y = np.random.randn(n) print "Computing regularization path using the LARS ..." start = datetime.now() alphas, active, path = glm.lar...
<commit_before>""" Benchmark for the LARS algorithm. Work in progress """ from datetime import datetime import numpy as np from scikits.learn import glm n, m = 100, 50000 X = np.random.randn(n, m) y = np.random.randn(n) print "Computing regularization path using the LARS ..." start = datetime.now() alphas, active,...
e6e42d9bd99dca0b539131fdc27788803f06ee8f
is/clean_pron_dict_csv.py
is/clean_pron_dict_csv.py
#! /usr/bin/python2 # -*- coding: utf-8 -*- # # Copyright 2015 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-...
Add tool for tidying the Icelandic pron_dict CSV file.
Add tool for tidying the Icelandic pron_dict CSV file.
Python
apache-2.0
google/language-resources,google/language-resources,googlei18n/language-resources,google/language-resources,googlei18n/language-resources,googlei18n/language-resources,google/language-resources,google/language-resources,googlei18n/language-resources,googlei18n/language-resources,googlei18n/language-resources,google/lan...
Add tool for tidying the Icelandic pron_dict CSV file.
#! /usr/bin/python2 # -*- coding: utf-8 -*- # # Copyright 2015 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-...
<commit_before><commit_msg>Add tool for tidying the Icelandic pron_dict CSV file.<commit_after>
#! /usr/bin/python2 # -*- coding: utf-8 -*- # # Copyright 2015 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-...
Add tool for tidying the Icelandic pron_dict CSV file.#! /usr/bin/python2 # -*- coding: utf-8 -*- # # Copyright 2015 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...
<commit_before><commit_msg>Add tool for tidying the Icelandic pron_dict CSV file.<commit_after>#! /usr/bin/python2 # -*- coding: utf-8 -*- # # Copyright 2015 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 Lic...
d956cfb04a1ae3c84460cec224dd4f5aba4012e1
lintcode/Medium/104_Merge_k_Sorted_Lists.py
lintcode/Medium/104_Merge_k_Sorted_Lists.py
""" Definition of ListNode class ListNode(object): def __init__(self, val, next=None): self.val = val self.next = next """ class Solution: """ @param lists: a list of ListNode @return: The head of one sorted list. """ def mergeKLists(self, lists): # write your code here ...
Add solution to lintcode question 104
Add solution to lintcode question 104
Python
mit
Rhadow/leetcode,Rhadow/leetcode,Rhadow/leetcode,Rhadow/leetcode
Add solution to lintcode question 104
""" Definition of ListNode class ListNode(object): def __init__(self, val, next=None): self.val = val self.next = next """ class Solution: """ @param lists: a list of ListNode @return: The head of one sorted list. """ def mergeKLists(self, lists): # write your code here ...
<commit_before><commit_msg>Add solution to lintcode question 104<commit_after>
""" Definition of ListNode class ListNode(object): def __init__(self, val, next=None): self.val = val self.next = next """ class Solution: """ @param lists: a list of ListNode @return: The head of one sorted list. """ def mergeKLists(self, lists): # write your code here ...
Add solution to lintcode question 104""" Definition of ListNode class ListNode(object): def __init__(self, val, next=None): self.val = val self.next = next """ class Solution: """ @param lists: a list of ListNode @return: The head of one sorted list. """ def mergeKLists(self, li...
<commit_before><commit_msg>Add solution to lintcode question 104<commit_after>""" Definition of ListNode class ListNode(object): def __init__(self, val, next=None): self.val = val self.next = next """ class Solution: """ @param lists: a list of ListNode @return: The head of one sorted l...
e04213330dda10ab1ec114e158ad854bdedd7058
Doc/tools/cvsinfo.py
Doc/tools/cvsinfo.py
"""Utility class and function to get information about the CVS repository based on checked-out files. """ import os def get_repository_list(paths): d = {} for name in paths: if os.path.isfile(name): dir = os.path.dirname(name) else: dir = name rootfile = os.pat...
Support module to help work with checked-out CVS trees.
Support module to help work with checked-out CVS trees.
Python
mit
sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator
Support module to help work with checked-out CVS trees.
"""Utility class and function to get information about the CVS repository based on checked-out files. """ import os def get_repository_list(paths): d = {} for name in paths: if os.path.isfile(name): dir = os.path.dirname(name) else: dir = name rootfile = os.pat...
<commit_before><commit_msg>Support module to help work with checked-out CVS trees.<commit_after>
"""Utility class and function to get information about the CVS repository based on checked-out files. """ import os def get_repository_list(paths): d = {} for name in paths: if os.path.isfile(name): dir = os.path.dirname(name) else: dir = name rootfile = os.pat...
Support module to help work with checked-out CVS trees."""Utility class and function to get information about the CVS repository based on checked-out files. """ import os def get_repository_list(paths): d = {} for name in paths: if os.path.isfile(name): dir = os.path.dirname(name) ...
<commit_before><commit_msg>Support module to help work with checked-out CVS trees.<commit_after>"""Utility class and function to get information about the CVS repository based on checked-out files. """ import os def get_repository_list(paths): d = {} for name in paths: if os.path.isfile(name): ...
6bc10fd6d00593c3ad192a4bf528e9e01dd605c3
exa/relational/__init__.py
exa/relational/__init__.py
# -*- coding: utf-8 -*- # Copyright (c) 2015-2016, Exa Analytics Development Team # Distributed under the terms of the Apache License 2.0 """ Relational #################### This (sub)package is provides the content management framework for container objects and a collection of static data for reference and unit...
# -*- coding: utf-8 -*- # Copyright (c) 2015-2016, Exa Analytics Development Team # Distributed under the terms of the Apache License 2.0 """ Relational #################### This (sub)package is provides the content management framework for container objects and a collection of static data for reference and unit...
Comment out relational for now; working on workflows, parallelism first
Comment out relational for now; working on workflows, parallelism first
Python
apache-2.0
alexvmarch/exa,alexvmarch/exa,exa-analytics/exa,avmarchenko/exa,alexvmarch/exa,tjduigna/exa,exa-analytics/exa
# -*- coding: utf-8 -*- # Copyright (c) 2015-2016, Exa Analytics Development Team # Distributed under the terms of the Apache License 2.0 """ Relational #################### This (sub)package is provides the content management framework for container objects and a collection of static data for reference and unit...
# -*- coding: utf-8 -*- # Copyright (c) 2015-2016, Exa Analytics Development Team # Distributed under the terms of the Apache License 2.0 """ Relational #################### This (sub)package is provides the content management framework for container objects and a collection of static data for reference and unit...
<commit_before># -*- coding: utf-8 -*- # Copyright (c) 2015-2016, Exa Analytics Development Team # Distributed under the terms of the Apache License 2.0 """ Relational #################### This (sub)package is provides the content management framework for container objects and a collection of static data for ref...
# -*- coding: utf-8 -*- # Copyright (c) 2015-2016, Exa Analytics Development Team # Distributed under the terms of the Apache License 2.0 """ Relational #################### This (sub)package is provides the content management framework for container objects and a collection of static data for reference and unit...
# -*- coding: utf-8 -*- # Copyright (c) 2015-2016, Exa Analytics Development Team # Distributed under the terms of the Apache License 2.0 """ Relational #################### This (sub)package is provides the content management framework for container objects and a collection of static data for reference and unit...
<commit_before># -*- coding: utf-8 -*- # Copyright (c) 2015-2016, Exa Analytics Development Team # Distributed under the terms of the Apache License 2.0 """ Relational #################### This (sub)package is provides the content management framework for container objects and a collection of static data for ref...
d43b5aee3d172adf0fc59517e458ee92775b3917
h2o-py/tests/testdir_algos/deepwater/pyunit_demo_deepwater.py
h2o-py/tests/testdir_algos/deepwater/pyunit_demo_deepwater.py
from __future__ import print_function from builtins import range import sys, os sys.path.insert(1, os.path.join("..","..","..")) import h2o from tests import pyunit_utils import h2o, tests from h2o.estimators.deepwater import H2ODeepWaterEstimator def deepwater_demo(): # Training data train_data = h2o.import_file...
Add pyunit for deepwater example (huge FC network).
Add pyunit for deepwater example (huge FC network).
Python
apache-2.0
jangorecki/h2o-3,mathemage/h2o-3,jangorecki/h2o-3,h2oai/h2o-dev,jangorecki/h2o-3,michalkurka/h2o-3,spennihana/h2o-3,h2oai/h2o-3,michalkurka/h2o-3,h2oai/h2o-dev,spennihana/h2o-3,h2oai/h2o-dev,jangorecki/h2o-3,mathemage/h2o-3,mathemage/h2o-3,h2oai/h2o-3,michalkurka/h2o-3,h2oai/h2o-dev,spennihana/h2o-3,michalkurka/h2o-3,s...
Add pyunit for deepwater example (huge FC network).
from __future__ import print_function from builtins import range import sys, os sys.path.insert(1, os.path.join("..","..","..")) import h2o from tests import pyunit_utils import h2o, tests from h2o.estimators.deepwater import H2ODeepWaterEstimator def deepwater_demo(): # Training data train_data = h2o.import_file...
<commit_before><commit_msg>Add pyunit for deepwater example (huge FC network).<commit_after>
from __future__ import print_function from builtins import range import sys, os sys.path.insert(1, os.path.join("..","..","..")) import h2o from tests import pyunit_utils import h2o, tests from h2o.estimators.deepwater import H2ODeepWaterEstimator def deepwater_demo(): # Training data train_data = h2o.import_file...
Add pyunit for deepwater example (huge FC network).from __future__ import print_function from builtins import range import sys, os sys.path.insert(1, os.path.join("..","..","..")) import h2o from tests import pyunit_utils import h2o, tests from h2o.estimators.deepwater import H2ODeepWaterEstimator def deepwater_demo(...
<commit_before><commit_msg>Add pyunit for deepwater example (huge FC network).<commit_after>from __future__ import print_function from builtins import range import sys, os sys.path.insert(1, os.path.join("..","..","..")) import h2o from tests import pyunit_utils import h2o, tests from h2o.estimators.deepwater import H2...
92556eade9572bcba06c04d9f4d9ec54d173505c
sprint_dates.py
sprint_dates.py
#!/usr/bin/env python # encoding: utf-8 """ sprint_dates.py Created by Rod Docking on 2017-06-13. Copyright (c) 2017 Canada's Michael Smith Genome Sciences Centre. All rights reserved. """ import argparse from dateutil.parser import parse from dateutil.relativedelta import relativedelta, FR def _parse_args(): p...
Add script for generating sprint dates
Add script for generating sprint dates
Python
mit
rdocking/bits_and_bobs
Add script for generating sprint dates
#!/usr/bin/env python # encoding: utf-8 """ sprint_dates.py Created by Rod Docking on 2017-06-13. Copyright (c) 2017 Canada's Michael Smith Genome Sciences Centre. All rights reserved. """ import argparse from dateutil.parser import parse from dateutil.relativedelta import relativedelta, FR def _parse_args(): p...
<commit_before><commit_msg>Add script for generating sprint dates<commit_after>
#!/usr/bin/env python # encoding: utf-8 """ sprint_dates.py Created by Rod Docking on 2017-06-13. Copyright (c) 2017 Canada's Michael Smith Genome Sciences Centre. All rights reserved. """ import argparse from dateutil.parser import parse from dateutil.relativedelta import relativedelta, FR def _parse_args(): p...
Add script for generating sprint dates#!/usr/bin/env python # encoding: utf-8 """ sprint_dates.py Created by Rod Docking on 2017-06-13. Copyright (c) 2017 Canada's Michael Smith Genome Sciences Centre. All rights reserved. """ import argparse from dateutil.parser import parse from dateutil.relativedelta import relati...
<commit_before><commit_msg>Add script for generating sprint dates<commit_after>#!/usr/bin/env python # encoding: utf-8 """ sprint_dates.py Created by Rod Docking on 2017-06-13. Copyright (c) 2017 Canada's Michael Smith Genome Sciences Centre. All rights reserved. """ import argparse from dateutil.parser import parse ...
7784e15410e9b3aa0b39d8732fc05aa9cc0d2acf
pyramid_authsanity/tests/test_util.py
pyramid_authsanity/tests/test_util.py
from pyramid_authsanity.util import add_vary_callback class TestAddVaryCallback(object): def _makeOne(self, *varies): return add_vary_callback(varies) def test_add_single_vary(self): cb = self._makeOne('cookie') response = DummyResponse() cb(None, response) assert len(...
Add tests to excercise the vary callback utility
Add tests to excercise the vary callback utility
Python
isc
usingnamespace/pyramid_authsanity
Add tests to excercise the vary callback utility
from pyramid_authsanity.util import add_vary_callback class TestAddVaryCallback(object): def _makeOne(self, *varies): return add_vary_callback(varies) def test_add_single_vary(self): cb = self._makeOne('cookie') response = DummyResponse() cb(None, response) assert len(...
<commit_before><commit_msg>Add tests to excercise the vary callback utility<commit_after>
from pyramid_authsanity.util import add_vary_callback class TestAddVaryCallback(object): def _makeOne(self, *varies): return add_vary_callback(varies) def test_add_single_vary(self): cb = self._makeOne('cookie') response = DummyResponse() cb(None, response) assert len(...
Add tests to excercise the vary callback utilityfrom pyramid_authsanity.util import add_vary_callback class TestAddVaryCallback(object): def _makeOne(self, *varies): return add_vary_callback(varies) def test_add_single_vary(self): cb = self._makeOne('cookie') response = DummyResponse()...
<commit_before><commit_msg>Add tests to excercise the vary callback utility<commit_after>from pyramid_authsanity.util import add_vary_callback class TestAddVaryCallback(object): def _makeOne(self, *varies): return add_vary_callback(varies) def test_add_single_vary(self): cb = self._makeOne('co...
689fc658234346f1e44cb4c59c0a1143bf722e6d
scripts/fcn_forward.py
scripts/fcn_forward.py
#!/usr/bin/env python import os.path as osp from chainer import cuda import chainer.serializers as S from chainer import Variable import matplotlib.pyplot as plt import numpy as np from scipy.misc import imread from skimage.color import label2rgb import fcn from fcn.models import FCN8s def main(): data_dir = f...
Add forward function of FCN8s
Add forward function of FCN8s
Python
mit
wkentaro/fcn
Add forward function of FCN8s
#!/usr/bin/env python import os.path as osp from chainer import cuda import chainer.serializers as S from chainer import Variable import matplotlib.pyplot as plt import numpy as np from scipy.misc import imread from skimage.color import label2rgb import fcn from fcn.models import FCN8s def main(): data_dir = f...
<commit_before><commit_msg>Add forward function of FCN8s<commit_after>
#!/usr/bin/env python import os.path as osp from chainer import cuda import chainer.serializers as S from chainer import Variable import matplotlib.pyplot as plt import numpy as np from scipy.misc import imread from skimage.color import label2rgb import fcn from fcn.models import FCN8s def main(): data_dir = f...
Add forward function of FCN8s#!/usr/bin/env python import os.path as osp from chainer import cuda import chainer.serializers as S from chainer import Variable import matplotlib.pyplot as plt import numpy as np from scipy.misc import imread from skimage.color import label2rgb import fcn from fcn.models import FCN8s ...
<commit_before><commit_msg>Add forward function of FCN8s<commit_after>#!/usr/bin/env python import os.path as osp from chainer import cuda import chainer.serializers as S from chainer import Variable import matplotlib.pyplot as plt import numpy as np from scipy.misc import imread from skimage.color import label2rgb ...
49d1d8ce0221af7f9732b09370cd0c0ec85b7191
indra/sources/process_mentions.py
indra/sources/process_mentions.py
import json from indra.statements import Activation, Agent def process_mentions(fname): with open(fname, 'r') as fh: jd = json.load(fh) mentions = jd['mentions'] events = [m for m in mentions if m['type'] == 'EventMention'] events = [e for e in events if len(e['arguments']) == 2] event...
Add initial mention processing code
Add initial mention processing code
Python
bsd-2-clause
sorgerlab/indra,pvtodorov/indra,johnbachman/belpy,sorgerlab/indra,bgyori/indra,sorgerlab/belpy,johnbachman/indra,pvtodorov/indra,bgyori/indra,bgyori/indra,johnbachman/indra,pvtodorov/indra,pvtodorov/indra,johnbachman/belpy,sorgerlab/indra,sorgerlab/belpy,sorgerlab/belpy,johnbachman/belpy,johnbachman/indra
Add initial mention processing code
import json from indra.statements import Activation, Agent def process_mentions(fname): with open(fname, 'r') as fh: jd = json.load(fh) mentions = jd['mentions'] events = [m for m in mentions if m['type'] == 'EventMention'] events = [e for e in events if len(e['arguments']) == 2] event...
<commit_before><commit_msg>Add initial mention processing code<commit_after>
import json from indra.statements import Activation, Agent def process_mentions(fname): with open(fname, 'r') as fh: jd = json.load(fh) mentions = jd['mentions'] events = [m for m in mentions if m['type'] == 'EventMention'] events = [e for e in events if len(e['arguments']) == 2] event...
Add initial mention processing codeimport json from indra.statements import Activation, Agent def process_mentions(fname): with open(fname, 'r') as fh: jd = json.load(fh) mentions = jd['mentions'] events = [m for m in mentions if m['type'] == 'EventMention'] events = [e for e in events if ...
<commit_before><commit_msg>Add initial mention processing code<commit_after>import json from indra.statements import Activation, Agent def process_mentions(fname): with open(fname, 'r') as fh: jd = json.load(fh) mentions = jd['mentions'] events = [m for m in mentions if m['type'] == 'EventMent...
534bfdd64d6e25f02897f15846c54d7e435b2406
jenkinsapi/utils/krb_requester.py
jenkinsapi/utils/krb_requester.py
from jenkinsapi.utils.requester import Requester from requests_kerberos import HTTPKerberosAuth, OPTIONAL class KrbRequester(Requester): """ A class which carries out HTTP requests with Kerberos/GSSAPI authentication. """ def __init__(self, ssl_verify=None, baseurl=None, mutual_auth=OPTIONAL): ...
Add kerberos authentication requester using requests_kerberos
Add kerberos authentication requester using requests_kerberos
Python
mit
jduan/jenkinsapi,zaro0508/jenkinsapi,imsardine/jenkinsapi,domenkozar/jenkinsapi,mistermocha/jenkinsapi,imsardine/jenkinsapi,jduan/jenkinsapi,domenkozar/jenkinsapi,salimfadhley/jenkinsapi,JohnLZeller/jenkinsapi,JohnLZeller/jenkinsapi,salimfadhley/jenkinsapi,imsardine/jenkinsapi,zaro0508/jenkinsapi,mistermocha/jenkinsapi...
Add kerberos authentication requester using requests_kerberos
from jenkinsapi.utils.requester import Requester from requests_kerberos import HTTPKerberosAuth, OPTIONAL class KrbRequester(Requester): """ A class which carries out HTTP requests with Kerberos/GSSAPI authentication. """ def __init__(self, ssl_verify=None, baseurl=None, mutual_auth=OPTIONAL): ...
<commit_before><commit_msg>Add kerberos authentication requester using requests_kerberos<commit_after>
from jenkinsapi.utils.requester import Requester from requests_kerberos import HTTPKerberosAuth, OPTIONAL class KrbRequester(Requester): """ A class which carries out HTTP requests with Kerberos/GSSAPI authentication. """ def __init__(self, ssl_verify=None, baseurl=None, mutual_auth=OPTIONAL): ...
Add kerberos authentication requester using requests_kerberosfrom jenkinsapi.utils.requester import Requester from requests_kerberos import HTTPKerberosAuth, OPTIONAL class KrbRequester(Requester): """ A class which carries out HTTP requests with Kerberos/GSSAPI authentication. """ def __init__(self...
<commit_before><commit_msg>Add kerberos authentication requester using requests_kerberos<commit_after>from jenkinsapi.utils.requester import Requester from requests_kerberos import HTTPKerberosAuth, OPTIONAL class KrbRequester(Requester): """ A class which carries out HTTP requests with Kerberos/GSSAPI authe...
7fa4f8d6fcef81ec91b6cdff70880ad053c887bc
scripts/newActivity.py
scripts/newActivity.py
#!/usr/bin/env python from datetime import datetime from pymongo import MongoClient import re from subprocess import call import sys # minutes window = 30 if len(sys.argv) != 2: print 'Usage: %s <logfile>' % sys.argv[0] sys.exit(1) now = datetime.now() logformat = re.compile('(\d{4}-\d\d-\d\d \d\d:\d\d:\d\...
Add in script to track new account activity
Add in script to track new account activity
Python
agpl-3.0
precog/platform,precog/platform,precog/platform,precog/platform
Add in script to track new account activity
#!/usr/bin/env python from datetime import datetime from pymongo import MongoClient import re from subprocess import call import sys # minutes window = 30 if len(sys.argv) != 2: print 'Usage: %s <logfile>' % sys.argv[0] sys.exit(1) now = datetime.now() logformat = re.compile('(\d{4}-\d\d-\d\d \d\d:\d\d:\d\...
<commit_before><commit_msg>Add in script to track new account activity<commit_after>
#!/usr/bin/env python from datetime import datetime from pymongo import MongoClient import re from subprocess import call import sys # minutes window = 30 if len(sys.argv) != 2: print 'Usage: %s <logfile>' % sys.argv[0] sys.exit(1) now = datetime.now() logformat = re.compile('(\d{4}-\d\d-\d\d \d\d:\d\d:\d\...
Add in script to track new account activity#!/usr/bin/env python from datetime import datetime from pymongo import MongoClient import re from subprocess import call import sys # minutes window = 30 if len(sys.argv) != 2: print 'Usage: %s <logfile>' % sys.argv[0] sys.exit(1) now = datetime.now() logformat =...
<commit_before><commit_msg>Add in script to track new account activity<commit_after>#!/usr/bin/env python from datetime import datetime from pymongo import MongoClient import re from subprocess import call import sys # minutes window = 30 if len(sys.argv) != 2: print 'Usage: %s <logfile>' % sys.argv[0] sys.e...
26a9d49622e54fa20d9875ca1329ca304496030f
molly/favourites/utils.py
molly/favourites/utils.py
""" Utilities to help handling favourites """ from django.http import Http404 from django.core.urlresolvers import resolve def get_favourites(request): """ Returns a list of favourites, the list is tuples of (title, URL) """ fs = [] for url in (request.session['favourites'] if 'favourites' i...
Add utility functions to get a list of favourites
Add utility functions to get a list of favourites
Python
apache-2.0
mollyproject/mollyproject,mollyproject/mollyproject,mollyproject/mollyproject
Add utility functions to get a list of favourites
""" Utilities to help handling favourites """ from django.http import Http404 from django.core.urlresolvers import resolve def get_favourites(request): """ Returns a list of favourites, the list is tuples of (title, URL) """ fs = [] for url in (request.session['favourites'] if 'favourites' i...
<commit_before><commit_msg>Add utility functions to get a list of favourites<commit_after>
""" Utilities to help handling favourites """ from django.http import Http404 from django.core.urlresolvers import resolve def get_favourites(request): """ Returns a list of favourites, the list is tuples of (title, URL) """ fs = [] for url in (request.session['favourites'] if 'favourites' i...
Add utility functions to get a list of favourites""" Utilities to help handling favourites """ from django.http import Http404 from django.core.urlresolvers import resolve def get_favourites(request): """ Returns a list of favourites, the list is tuples of (title, URL) """ fs = [] for url in...
<commit_before><commit_msg>Add utility functions to get a list of favourites<commit_after>""" Utilities to help handling favourites """ from django.http import Http404 from django.core.urlresolvers import resolve def get_favourites(request): """ Returns a list of favourites, the list is tuples of (title, URL...
b9485e5510c92d88451c272c327d4077cde39d96
src/test_numbers.py
src/test_numbers.py
from nose.tools import assert_equal, assert_almost_equal, assert_true, \ assert_false, assert_raises, assert_is_instance from subprocess import call from ksatools import loadfile, calcmedian, calccumsum import numpy as np from numpy import array def test_01(): data = loadfile("../test/test01.21") cn, c...
Add skeleton for statistics-sanity check tests
Add skeleton for statistics-sanity check tests
Python
bsd-2-clause
wltrimbl/kmerspectrumanalyzer,MG-RAST/kmerspectrumanalyzer,MG-RAST/kmerspectrumanalyzer,wltrimbl/kmerspectrumanalyzer,wltrimbl/kmerspectrumanalyzer,MG-RAST/kmerspectrumanalyzer
Add skeleton for statistics-sanity check tests
from nose.tools import assert_equal, assert_almost_equal, assert_true, \ assert_false, assert_raises, assert_is_instance from subprocess import call from ksatools import loadfile, calcmedian, calccumsum import numpy as np from numpy import array def test_01(): data = loadfile("../test/test01.21") cn, c...
<commit_before><commit_msg>Add skeleton for statistics-sanity check tests<commit_after>
from nose.tools import assert_equal, assert_almost_equal, assert_true, \ assert_false, assert_raises, assert_is_instance from subprocess import call from ksatools import loadfile, calcmedian, calccumsum import numpy as np from numpy import array def test_01(): data = loadfile("../test/test01.21") cn, c...
Add skeleton for statistics-sanity check tests from nose.tools import assert_equal, assert_almost_equal, assert_true, \ assert_false, assert_raises, assert_is_instance from subprocess import call from ksatools import loadfile, calcmedian, calccumsum import numpy as np from numpy import array def test_01(): ...
<commit_before><commit_msg>Add skeleton for statistics-sanity check tests<commit_after> from nose.tools import assert_equal, assert_almost_equal, assert_true, \ assert_false, assert_raises, assert_is_instance from subprocess import call from ksatools import loadfile, calcmedian, calccumsum import numpy as np fro...
3a09a2ed29c05eaa66a010405f9e609951bf5238
submodules-to-glockfile.py
submodules-to-glockfile.py
#!/usr/bin/python import re import subprocess def main(): source = open(".gitmodules").read() paths = re.findall(r"path = (.*)", source) for path in paths: print "{repo} {sha}".format( repo = path[7:], sha = path_sha1(path) ) def path_sha1(path): cmd = "cd {} ...
Add a script that prints submodules info in Glockfile compatible format
Add a script that prints submodules info in Glockfile compatible format
Python
mit
localhots/satan,localhots/satan,localhots/satan,localhots/satan
Add a script that prints submodules info in Glockfile compatible format
#!/usr/bin/python import re import subprocess def main(): source = open(".gitmodules").read() paths = re.findall(r"path = (.*)", source) for path in paths: print "{repo} {sha}".format( repo = path[7:], sha = path_sha1(path) ) def path_sha1(path): cmd = "cd {} ...
<commit_before><commit_msg>Add a script that prints submodules info in Glockfile compatible format<commit_after>
#!/usr/bin/python import re import subprocess def main(): source = open(".gitmodules").read() paths = re.findall(r"path = (.*)", source) for path in paths: print "{repo} {sha}".format( repo = path[7:], sha = path_sha1(path) ) def path_sha1(path): cmd = "cd {} ...
Add a script that prints submodules info in Glockfile compatible format#!/usr/bin/python import re import subprocess def main(): source = open(".gitmodules").read() paths = re.findall(r"path = (.*)", source) for path in paths: print "{repo} {sha}".format( repo = path[7:], ...
<commit_before><commit_msg>Add a script that prints submodules info in Glockfile compatible format<commit_after>#!/usr/bin/python import re import subprocess def main(): source = open(".gitmodules").read() paths = re.findall(r"path = (.*)", source) for path in paths: print "{repo} {sha}".format( ...
3b30c40dfeccae5fb22a69369a2b09b8f3a5e9cd
iterative_binary_search.py
iterative_binary_search.py
def iterative_binary_search(array, item): low = 0 high = len(array) - 1 while(low<=high): mid = (low+high)//2 if (item == array[mid]): return mid elif item < array[mid]: high = mid - 1 elif item > array[mid]: low = mid + 1 return -...
Add iterative binary search algorithm implementation
Add iterative binary search algorithm implementation
Python
mit
arafat-al-mahmud/algorithms-python
Add iterative binary search algorithm implementation
def iterative_binary_search(array, item): low = 0 high = len(array) - 1 while(low<=high): mid = (low+high)//2 if (item == array[mid]): return mid elif item < array[mid]: high = mid - 1 elif item > array[mid]: low = mid + 1 return -...
<commit_before><commit_msg>Add iterative binary search algorithm implementation<commit_after>
def iterative_binary_search(array, item): low = 0 high = len(array) - 1 while(low<=high): mid = (low+high)//2 if (item == array[mid]): return mid elif item < array[mid]: high = mid - 1 elif item > array[mid]: low = mid + 1 return -...
Add iterative binary search algorithm implementationdef iterative_binary_search(array, item): low = 0 high = len(array) - 1 while(low<=high): mid = (low+high)//2 if (item == array[mid]): return mid elif item < array[mid]: high = mid - 1 elif item >...
<commit_before><commit_msg>Add iterative binary search algorithm implementation<commit_after>def iterative_binary_search(array, item): low = 0 high = len(array) - 1 while(low<=high): mid = (low+high)//2 if (item == array[mid]): return mid elif item < array[mid]: ...
628f41751f247b7bc7e4a6422d33355bd8913bca
resolwe_bio/migrations/0013_star_index.py
resolwe_bio/migrations/0013_star_index.py
from django.db import migrations from resolwe.flow.migration_ops import ResolweProcessChangeType class Migration(migrations.Migration): """ Change the ``alignment-star-index`` process type. """ dependencies = [ ('resolwe_bio', '0012_full_text_search'), ] operations = [ Resol...
Migrate STAR index process type
Migrate STAR index process type
Python
apache-2.0
genialis/resolwe-bio,genialis/resolwe-bio,genialis/resolwe-bio,genialis/resolwe-bio
Migrate STAR index process type
from django.db import migrations from resolwe.flow.migration_ops import ResolweProcessChangeType class Migration(migrations.Migration): """ Change the ``alignment-star-index`` process type. """ dependencies = [ ('resolwe_bio', '0012_full_text_search'), ] operations = [ Resol...
<commit_before><commit_msg>Migrate STAR index process type<commit_after>
from django.db import migrations from resolwe.flow.migration_ops import ResolweProcessChangeType class Migration(migrations.Migration): """ Change the ``alignment-star-index`` process type. """ dependencies = [ ('resolwe_bio', '0012_full_text_search'), ] operations = [ Resol...
Migrate STAR index process typefrom django.db import migrations from resolwe.flow.migration_ops import ResolweProcessChangeType class Migration(migrations.Migration): """ Change the ``alignment-star-index`` process type. """ dependencies = [ ('resolwe_bio', '0012_full_text_search'), ] ...
<commit_before><commit_msg>Migrate STAR index process type<commit_after>from django.db import migrations from resolwe.flow.migration_ops import ResolweProcessChangeType class Migration(migrations.Migration): """ Change the ``alignment-star-index`` process type. """ dependencies = [ ('resolwe...
0f77b509a561a90a898ce2668a02a39c6dd10486
app/tests/cases_tests/test_permissions.py
app/tests/cases_tests/test_permissions.py
import pytest from django.conf import settings from django.contrib.auth.models import AnonymousUser, Group from grandchallenge.cases.permissions import ImagePermission from tests.factories import UserFactory, ImageFactory class Request: """ Mock request class containing only user """ def __init__(self, user...
Add tests for permission class
Add tests for permission class
Python
apache-2.0
comic/comic-django,comic/comic-django,comic/comic-django,comic/comic-django,comic/comic-django
Add tests for permission class
import pytest from django.conf import settings from django.contrib.auth.models import AnonymousUser, Group from grandchallenge.cases.permissions import ImagePermission from tests.factories import UserFactory, ImageFactory class Request: """ Mock request class containing only user """ def __init__(self, user...
<commit_before><commit_msg>Add tests for permission class<commit_after>
import pytest from django.conf import settings from django.contrib.auth.models import AnonymousUser, Group from grandchallenge.cases.permissions import ImagePermission from tests.factories import UserFactory, ImageFactory class Request: """ Mock request class containing only user """ def __init__(self, user...
Add tests for permission classimport pytest from django.conf import settings from django.contrib.auth.models import AnonymousUser, Group from grandchallenge.cases.permissions import ImagePermission from tests.factories import UserFactory, ImageFactory class Request: """ Mock request class containing only user ""...
<commit_before><commit_msg>Add tests for permission class<commit_after>import pytest from django.conf import settings from django.contrib.auth.models import AnonymousUser, Group from grandchallenge.cases.permissions import ImagePermission from tests.factories import UserFactory, ImageFactory class Request: """ M...