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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
80c749e8b8395f20305c04c480fbf39400f1b5a4 | features/tests/test_index.py | features/tests/test_index.py | from django.test import TestCase
class TestIndex(TestCase):
"""Verify the index page is served properly"""
def test_root(self):
# Fetch page from '/'
reponse = self.client.get('/')
# Should respond OK
self.assertEqual(reponse.status_code, 200)
# Should be rendered from ... | Add failing test for index route | Add failing test for index route
Currently the index route gloms every other route.
| Python | mit | wkevina/feature-requests-app,wkevina/feature-requests-app,wkevina/feature-requests-app | Add failing test for index route
Currently the index route gloms every other route. | from django.test import TestCase
class TestIndex(TestCase):
"""Verify the index page is served properly"""
def test_root(self):
# Fetch page from '/'
reponse = self.client.get('/')
# Should respond OK
self.assertEqual(reponse.status_code, 200)
# Should be rendered from ... | <commit_before><commit_msg>Add failing test for index route
Currently the index route gloms every other route.<commit_after> | from django.test import TestCase
class TestIndex(TestCase):
"""Verify the index page is served properly"""
def test_root(self):
# Fetch page from '/'
reponse = self.client.get('/')
# Should respond OK
self.assertEqual(reponse.status_code, 200)
# Should be rendered from ... | Add failing test for index route
Currently the index route gloms every other route.from django.test import TestCase
class TestIndex(TestCase):
"""Verify the index page is served properly"""
def test_root(self):
# Fetch page from '/'
reponse = self.client.get('/')
# Should respond OK
... | <commit_before><commit_msg>Add failing test for index route
Currently the index route gloms every other route.<commit_after>from django.test import TestCase
class TestIndex(TestCase):
"""Verify the index page is served properly"""
def test_root(self):
# Fetch page from '/'
reponse = self.clie... | |
3f7b54496826f496863de545a601c23c2c06427a | shipyard2/shipyard2/rules/javascripts.py | shipyard2/shipyard2/rules/javascripts.py | """Helpers for writing rules for first-party JavaScript packages."""
__all__ = [
'define_package',
'find_package',
]
import dataclasses
import logging
import foreman
from g1 import scripts
from g1.bases.assertions import ASSERT
from shipyard2 import rules
LOG = logging.getLogger(__name__)
@dataclasses.d... | Add first-party JavaScript build rule library | Add first-party JavaScript build rule library
| Python | mit | clchiou/garage,clchiou/garage,clchiou/garage,clchiou/garage | Add first-party JavaScript build rule library | """Helpers for writing rules for first-party JavaScript packages."""
__all__ = [
'define_package',
'find_package',
]
import dataclasses
import logging
import foreman
from g1 import scripts
from g1.bases.assertions import ASSERT
from shipyard2 import rules
LOG = logging.getLogger(__name__)
@dataclasses.d... | <commit_before><commit_msg>Add first-party JavaScript build rule library<commit_after> | """Helpers for writing rules for first-party JavaScript packages."""
__all__ = [
'define_package',
'find_package',
]
import dataclasses
import logging
import foreman
from g1 import scripts
from g1.bases.assertions import ASSERT
from shipyard2 import rules
LOG = logging.getLogger(__name__)
@dataclasses.d... | Add first-party JavaScript build rule library"""Helpers for writing rules for first-party JavaScript packages."""
__all__ = [
'define_package',
'find_package',
]
import dataclasses
import logging
import foreman
from g1 import scripts
from g1.bases.assertions import ASSERT
from shipyard2 import rules
LOG =... | <commit_before><commit_msg>Add first-party JavaScript build rule library<commit_after>"""Helpers for writing rules for first-party JavaScript packages."""
__all__ = [
'define_package',
'find_package',
]
import dataclasses
import logging
import foreman
from g1 import scripts
from g1.bases.assertions import A... | |
6a74915c3f197ef197a34514c7ff313ac0a68d2f | corehq/apps/fixtures/migrations/0002_rm_blobdb_domain_fixtures.py | corehq/apps/fixtures/migrations/0002_rm_blobdb_domain_fixtures.py | # -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-09-08 10:23
from __future__ import unicode_literals
from django.db import migrations
from corehq.blobs import get_blob_db
from corehq.sql_db.operations import HqRunPython
FIXTURE_BUCKET = 'domain-fixtures'
def rm_blobdb_domain_fixtures(apps, schema_edito... | Add migration to delete existing cache values | Add migration to delete existing cache values | Python | bsd-3-clause | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | Add migration to delete existing cache values | # -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-09-08 10:23
from __future__ import unicode_literals
from django.db import migrations
from corehq.blobs import get_blob_db
from corehq.sql_db.operations import HqRunPython
FIXTURE_BUCKET = 'domain-fixtures'
def rm_blobdb_domain_fixtures(apps, schema_edito... | <commit_before><commit_msg>Add migration to delete existing cache values<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-09-08 10:23
from __future__ import unicode_literals
from django.db import migrations
from corehq.blobs import get_blob_db
from corehq.sql_db.operations import HqRunPython
FIXTURE_BUCKET = 'domain-fixtures'
def rm_blobdb_domain_fixtures(apps, schema_edito... | Add migration to delete existing cache values# -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-09-08 10:23
from __future__ import unicode_literals
from django.db import migrations
from corehq.blobs import get_blob_db
from corehq.sql_db.operations import HqRunPython
FIXTURE_BUCKET = 'domain-fixtures'
def... | <commit_before><commit_msg>Add migration to delete existing cache values<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-09-08 10:23
from __future__ import unicode_literals
from django.db import migrations
from corehq.blobs import get_blob_db
from corehq.sql_db.operations import HqRunPython
... | |
e184b806c6170aad2bdee87c051ea6400e1d954e | tests/parser_test.py | tests/parser_test.py | import unittest
from clippings.parser import Document
class DocumentTest(unittest.TestCase):
def test_create_document(self):
title = 'Haunted'
authors = ['Chuck Palahniuk']
document = Document(title, authors)
self.assertEqual(title, document.title)
self.assertEqual(autho... | Add unit tests for the Document class | Add unit tests for the Document class
| Python | mit | samueldg/clippings | Add unit tests for the Document class | import unittest
from clippings.parser import Document
class DocumentTest(unittest.TestCase):
def test_create_document(self):
title = 'Haunted'
authors = ['Chuck Palahniuk']
document = Document(title, authors)
self.assertEqual(title, document.title)
self.assertEqual(autho... | <commit_before><commit_msg>Add unit tests for the Document class<commit_after> | import unittest
from clippings.parser import Document
class DocumentTest(unittest.TestCase):
def test_create_document(self):
title = 'Haunted'
authors = ['Chuck Palahniuk']
document = Document(title, authors)
self.assertEqual(title, document.title)
self.assertEqual(autho... | Add unit tests for the Document classimport unittest
from clippings.parser import Document
class DocumentTest(unittest.TestCase):
def test_create_document(self):
title = 'Haunted'
authors = ['Chuck Palahniuk']
document = Document(title, authors)
self.assertEqual(title, document.... | <commit_before><commit_msg>Add unit tests for the Document class<commit_after>import unittest
from clippings.parser import Document
class DocumentTest(unittest.TestCase):
def test_create_document(self):
title = 'Haunted'
authors = ['Chuck Palahniuk']
document = Document(title, authors)
... | |
e9cfb095ac4261c8bf959d1c9b904256c267178f | openfisca_web_api/tests/test_variables.py | openfisca_web_api/tests/test_variables.py | # -*- coding: utf-8 -*-
import json
from nose.tools import assert_equal, assert_greater, assert_in, assert_is_instance
from webob import Request
from . import common
def setup_module(module):
common.get_or_load_app()
def test_basic_call():
req = Request.blank('/api/1/variables', method = 'GET')
res ... | Add basic unit test about /variables endpoint | Add basic unit test about /variables endpoint
| Python | agpl-3.0 | openfisca/openfisca-web-api,openfisca/openfisca-web-api | Add basic unit test about /variables endpoint | # -*- coding: utf-8 -*-
import json
from nose.tools import assert_equal, assert_greater, assert_in, assert_is_instance
from webob import Request
from . import common
def setup_module(module):
common.get_or_load_app()
def test_basic_call():
req = Request.blank('/api/1/variables', method = 'GET')
res ... | <commit_before><commit_msg>Add basic unit test about /variables endpoint<commit_after> | # -*- coding: utf-8 -*-
import json
from nose.tools import assert_equal, assert_greater, assert_in, assert_is_instance
from webob import Request
from . import common
def setup_module(module):
common.get_or_load_app()
def test_basic_call():
req = Request.blank('/api/1/variables', method = 'GET')
res ... | Add basic unit test about /variables endpoint# -*- coding: utf-8 -*-
import json
from nose.tools import assert_equal, assert_greater, assert_in, assert_is_instance
from webob import Request
from . import common
def setup_module(module):
common.get_or_load_app()
def test_basic_call():
req = Request.blank... | <commit_before><commit_msg>Add basic unit test about /variables endpoint<commit_after># -*- coding: utf-8 -*-
import json
from nose.tools import assert_equal, assert_greater, assert_in, assert_is_instance
from webob import Request
from . import common
def setup_module(module):
common.get_or_load_app()
def t... | |
404c9b70cf9b6c27e0fb16be1556d01b5077a4f4 | tests/test_regressions.py | tests/test_regressions.py | """
"""
import time
import logging
import unittest
from flask import Flask
import mock
from flask.ext.limiter.extension import C, Limiter
class RegressionTests(unittest.TestCase):
def build_app(self, config={}, **limiter_args):
app = Flask(__name__)
for k,v in config.items():
app.c... | Add test cases for 500 error with slow responses | Add test cases for 500 error with slow responses
when using redis as the rate limit storage and the response
is slower than the rate limit window, 500 errors occur as the
key is not available post request for constructing the rate limit
headers.
| Python | mit | alisaifee/flask-limiter,joshfriend/flask-limiter,alisaifee/limits,alisaifee/limits,joshfriend/flask-limiter,alisaifee/flask-limiter | Add test cases for 500 error with slow responses
when using redis as the rate limit storage and the response
is slower than the rate limit window, 500 errors occur as the
key is not available post request for constructing the rate limit
headers. | """
"""
import time
import logging
import unittest
from flask import Flask
import mock
from flask.ext.limiter.extension import C, Limiter
class RegressionTests(unittest.TestCase):
def build_app(self, config={}, **limiter_args):
app = Flask(__name__)
for k,v in config.items():
app.c... | <commit_before><commit_msg>Add test cases for 500 error with slow responses
when using redis as the rate limit storage and the response
is slower than the rate limit window, 500 errors occur as the
key is not available post request for constructing the rate limit
headers.<commit_after> | """
"""
import time
import logging
import unittest
from flask import Flask
import mock
from flask.ext.limiter.extension import C, Limiter
class RegressionTests(unittest.TestCase):
def build_app(self, config={}, **limiter_args):
app = Flask(__name__)
for k,v in config.items():
app.c... | Add test cases for 500 error with slow responses
when using redis as the rate limit storage and the response
is slower than the rate limit window, 500 errors occur as the
key is not available post request for constructing the rate limit
headers."""
"""
import time
import logging
import unittest
from flask import Fla... | <commit_before><commit_msg>Add test cases for 500 error with slow responses
when using redis as the rate limit storage and the response
is slower than the rate limit window, 500 errors occur as the
key is not available post request for constructing the rate limit
headers.<commit_after>"""
"""
import time
import loggi... | |
27f187d3cc5725b6ed912e15ecafb38a44cc4992 | tests/unit/utils/test_win_service.py | tests/unit/utils/test_win_service.py | # Import Python Libs
import os
# Import Salt Libs
import salt.utils.platform
# Import Salt Testing Libs
from tests.support.mock import patch, MagicMock
from tests.support.unit import TestCase, skipIf
try:
import salt.utils.win_service as win_service
from salt.exceptions import CommandExecutionError
except Ex... | Add unit tests for new service util | Add unit tests for new service util
| Python | apache-2.0 | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | Add unit tests for new service util | # Import Python Libs
import os
# Import Salt Libs
import salt.utils.platform
# Import Salt Testing Libs
from tests.support.mock import patch, MagicMock
from tests.support.unit import TestCase, skipIf
try:
import salt.utils.win_service as win_service
from salt.exceptions import CommandExecutionError
except Ex... | <commit_before><commit_msg>Add unit tests for new service util<commit_after> | # Import Python Libs
import os
# Import Salt Libs
import salt.utils.platform
# Import Salt Testing Libs
from tests.support.mock import patch, MagicMock
from tests.support.unit import TestCase, skipIf
try:
import salt.utils.win_service as win_service
from salt.exceptions import CommandExecutionError
except Ex... | Add unit tests for new service util# Import Python Libs
import os
# Import Salt Libs
import salt.utils.platform
# Import Salt Testing Libs
from tests.support.mock import patch, MagicMock
from tests.support.unit import TestCase, skipIf
try:
import salt.utils.win_service as win_service
from salt.exceptions imp... | <commit_before><commit_msg>Add unit tests for new service util<commit_after># Import Python Libs
import os
# Import Salt Libs
import salt.utils.platform
# Import Salt Testing Libs
from tests.support.mock import patch, MagicMock
from tests.support.unit import TestCase, skipIf
try:
import salt.utils.win_service as... | |
71bbd57214cd8be6ac8583884eb1fc2e5b270eb8 | ideascube/conf/idb_fra_emmaus.py | ideascube/conf/idb_fra_emmaus.py | # -*- coding: utf-8 -*-
"""Ideaxbox for Emmaus, France"""
from .idb import * # noqa
from django.utils.translation import ugettext_lazy as _
IDEASCUBE_NAME = u"Emmaus"
IDEASCUBE_PLACE_NAME = _("city")
COUNTRIES_FIRST = ['FR']
TIME_ZONE = None
LANGUAGE_CODE = 'fr'
LOAN_DURATION = 14
MONITORING_ENTRY_EXPORT_FIELDS = ['s... | Add conf file for Emmaus Ideasbox in France | Add conf file for Emmaus Ideasbox in France
| Python | agpl-3.0 | ideascube/ideascube,ideascube/ideascube,ideascube/ideascube,ideascube/ideascube | Add conf file for Emmaus Ideasbox in France | # -*- coding: utf-8 -*-
"""Ideaxbox for Emmaus, France"""
from .idb import * # noqa
from django.utils.translation import ugettext_lazy as _
IDEASCUBE_NAME = u"Emmaus"
IDEASCUBE_PLACE_NAME = _("city")
COUNTRIES_FIRST = ['FR']
TIME_ZONE = None
LANGUAGE_CODE = 'fr'
LOAN_DURATION = 14
MONITORING_ENTRY_EXPORT_FIELDS = ['s... | <commit_before><commit_msg>Add conf file for Emmaus Ideasbox in France<commit_after> | # -*- coding: utf-8 -*-
"""Ideaxbox for Emmaus, France"""
from .idb import * # noqa
from django.utils.translation import ugettext_lazy as _
IDEASCUBE_NAME = u"Emmaus"
IDEASCUBE_PLACE_NAME = _("city")
COUNTRIES_FIRST = ['FR']
TIME_ZONE = None
LANGUAGE_CODE = 'fr'
LOAN_DURATION = 14
MONITORING_ENTRY_EXPORT_FIELDS = ['s... | Add conf file for Emmaus Ideasbox in France# -*- coding: utf-8 -*-
"""Ideaxbox for Emmaus, France"""
from .idb import * # noqa
from django.utils.translation import ugettext_lazy as _
IDEASCUBE_NAME = u"Emmaus"
IDEASCUBE_PLACE_NAME = _("city")
COUNTRIES_FIRST = ['FR']
TIME_ZONE = None
LANGUAGE_CODE = 'fr'
LOAN_DURATIO... | <commit_before><commit_msg>Add conf file for Emmaus Ideasbox in France<commit_after># -*- coding: utf-8 -*-
"""Ideaxbox for Emmaus, France"""
from .idb import * # noqa
from django.utils.translation import ugettext_lazy as _
IDEASCUBE_NAME = u"Emmaus"
IDEASCUBE_PLACE_NAME = _("city")
COUNTRIES_FIRST = ['FR']
TIME_ZONE... | |
f3eb1c8efbcd3695dba0037faa4f90328625f547 | permcomb.py | permcomb.py | #!/usr/bin/python
import itertools
import sys
def combination(elements,items):
for combination in itertools.product(xrange(elements), repeat=items):
print ''.join(map(str, combination))
if len(sys.argv) == 3:
allSet = int(sys.argv[1])
setItems = int(sys.argv[2])
if allSet >= setItems:
... | Add script for creating numeric passwordlists using permutation & combination. | Add script for creating numeric passwordlists using permutation & combination.
| Python | cc0-1.0 | JohnTroony/Scriptology,JohnTroony/Scriptology,JohnTroony/Scriptology,JohnTroony/Scriptology,JohnTroony/Scriptology,JohnTroony/Scriptology | Add script for creating numeric passwordlists using permutation & combination. | #!/usr/bin/python
import itertools
import sys
def combination(elements,items):
for combination in itertools.product(xrange(elements), repeat=items):
print ''.join(map(str, combination))
if len(sys.argv) == 3:
allSet = int(sys.argv[1])
setItems = int(sys.argv[2])
if allSet >= setItems:
... | <commit_before><commit_msg>Add script for creating numeric passwordlists using permutation & combination.<commit_after> | #!/usr/bin/python
import itertools
import sys
def combination(elements,items):
for combination in itertools.product(xrange(elements), repeat=items):
print ''.join(map(str, combination))
if len(sys.argv) == 3:
allSet = int(sys.argv[1])
setItems = int(sys.argv[2])
if allSet >= setItems:
... | Add script for creating numeric passwordlists using permutation & combination.#!/usr/bin/python
import itertools
import sys
def combination(elements,items):
for combination in itertools.product(xrange(elements), repeat=items):
print ''.join(map(str, combination))
if len(sys.argv) == 3:
allSet = in... | <commit_before><commit_msg>Add script for creating numeric passwordlists using permutation & combination.<commit_after>#!/usr/bin/python
import itertools
import sys
def combination(elements,items):
for combination in itertools.product(xrange(elements), repeat=items):
print ''.join(map(str, combination))
... | |
b01076381ebc91f20c527f1632c7b3f2aa82d39a | perftest.py | perftest.py | """
Simple peformance tests.
"""
import sys
import time
import couchdb
def main():
print 'sys.version : %r' % (sys.version,)
print 'sys.platform : %r' % (sys.platform,)
tests = [create_doc, create_bulk_docs]
if len(sys.argv) > 1:
tests = [test for test in tests if test.__name__ in sys.argv... | Add a very simple performance testing tool. | Add a very simple performance testing tool. | Python | bsd-3-clause | ajmirsky/couchdb-python | Add a very simple performance testing tool. | """
Simple peformance tests.
"""
import sys
import time
import couchdb
def main():
print 'sys.version : %r' % (sys.version,)
print 'sys.platform : %r' % (sys.platform,)
tests = [create_doc, create_bulk_docs]
if len(sys.argv) > 1:
tests = [test for test in tests if test.__name__ in sys.argv... | <commit_before><commit_msg>Add a very simple performance testing tool.<commit_after> | """
Simple peformance tests.
"""
import sys
import time
import couchdb
def main():
print 'sys.version : %r' % (sys.version,)
print 'sys.platform : %r' % (sys.platform,)
tests = [create_doc, create_bulk_docs]
if len(sys.argv) > 1:
tests = [test for test in tests if test.__name__ in sys.argv... | Add a very simple performance testing tool."""
Simple peformance tests.
"""
import sys
import time
import couchdb
def main():
print 'sys.version : %r' % (sys.version,)
print 'sys.platform : %r' % (sys.platform,)
tests = [create_doc, create_bulk_docs]
if len(sys.argv) > 1:
tests = [test for... | <commit_before><commit_msg>Add a very simple performance testing tool.<commit_after>"""
Simple peformance tests.
"""
import sys
import time
import couchdb
def main():
print 'sys.version : %r' % (sys.version,)
print 'sys.platform : %r' % (sys.platform,)
tests = [create_doc, create_bulk_docs]
if len... | |
fbf91352da4cf16be8462f57c71aa9f86f21746f | amaranth/data_analysis/class_balance.py | amaranth/data_analysis/class_balance.py | # Lint as: python3
"""This script checks the balance of classes in the FDC dataset.
Classes are split based on LOW_CALORIE_THRESHOLD and
HIGH_CALORIE_THRESHOLD in the amaranth module.
"""
import os
import pandas as pd
import amaranth
from amaranth.ml import lib
FDC_DATA_DIR = '../../data/fdc/'
def main():
# Rea... | Add class balance checking code | Add class balance checking code
| Python | apache-2.0 | googleinterns/amaranth,googleinterns/amaranth | Add class balance checking code | # Lint as: python3
"""This script checks the balance of classes in the FDC dataset.
Classes are split based on LOW_CALORIE_THRESHOLD and
HIGH_CALORIE_THRESHOLD in the amaranth module.
"""
import os
import pandas as pd
import amaranth
from amaranth.ml import lib
FDC_DATA_DIR = '../../data/fdc/'
def main():
# Rea... | <commit_before><commit_msg>Add class balance checking code<commit_after> | # Lint as: python3
"""This script checks the balance of classes in the FDC dataset.
Classes are split based on LOW_CALORIE_THRESHOLD and
HIGH_CALORIE_THRESHOLD in the amaranth module.
"""
import os
import pandas as pd
import amaranth
from amaranth.ml import lib
FDC_DATA_DIR = '../../data/fdc/'
def main():
# Rea... | Add class balance checking code# Lint as: python3
"""This script checks the balance of classes in the FDC dataset.
Classes are split based on LOW_CALORIE_THRESHOLD and
HIGH_CALORIE_THRESHOLD in the amaranth module.
"""
import os
import pandas as pd
import amaranth
from amaranth.ml import lib
FDC_DATA_DIR = '../../d... | <commit_before><commit_msg>Add class balance checking code<commit_after># Lint as: python3
"""This script checks the balance of classes in the FDC dataset.
Classes are split based on LOW_CALORIE_THRESHOLD and
HIGH_CALORIE_THRESHOLD in the amaranth module.
"""
import os
import pandas as pd
import amaranth
from amaran... | |
93b2d93098c395d866f18e51b6ac42a9ba81a9b5 | exp/modelselect/RealDataSVMExp.py | exp/modelselect/RealDataSVMExp.py | """
Observe if C varies when we use more examples
"""
import logging
import numpy
import sys
import multiprocessing
from apgl.util.PathDefaults import PathDefaults
from apgl.predictors.AbstractPredictor import computeTestError
from exp.modelselect.ModelSelectUtils import ModelSelectUtils
from apgl.util.Sampling... | Test if C changes with more examples. | Test if C changes with more examples. | Python | bsd-3-clause | charanpald/APGL | Test if C changes with more examples. | """
Observe if C varies when we use more examples
"""
import logging
import numpy
import sys
import multiprocessing
from apgl.util.PathDefaults import PathDefaults
from apgl.predictors.AbstractPredictor import computeTestError
from exp.modelselect.ModelSelectUtils import ModelSelectUtils
from apgl.util.Sampling... | <commit_before><commit_msg>Test if C changes with more examples. <commit_after> | """
Observe if C varies when we use more examples
"""
import logging
import numpy
import sys
import multiprocessing
from apgl.util.PathDefaults import PathDefaults
from apgl.predictors.AbstractPredictor import computeTestError
from exp.modelselect.ModelSelectUtils import ModelSelectUtils
from apgl.util.Sampling... | Test if C changes with more examples. """
Observe if C varies when we use more examples
"""
import logging
import numpy
import sys
import multiprocessing
from apgl.util.PathDefaults import PathDefaults
from apgl.predictors.AbstractPredictor import computeTestError
from exp.modelselect.ModelSelectUtils import Mod... | <commit_before><commit_msg>Test if C changes with more examples. <commit_after>"""
Observe if C varies when we use more examples
"""
import logging
import numpy
import sys
import multiprocessing
from apgl.util.PathDefaults import PathDefaults
from apgl.predictors.AbstractPredictor import computeTestError
from ex... | |
7997d02e52172b8ad0e96a845f953f90a6e739b7 | scripts/examples/02-Board-Control/vsync_gpio_output.py | scripts/examples/02-Board-Control/vsync_gpio_output.py | # VSYNC GPIO output example.
#
# This example shows how to toggle the IR LED pin on VSYNC interrupt.
import sensor, image, time
from pyb import Pin
sensor.reset() # Reset and initialize the sensor.
sensor.set_pixformat(sensor.RGB565) # Set pixel format to RGB565 (or GRAYSCALE)
sensor.set_framesiz... | Add VSYNC GPIO output example. | Add VSYNC GPIO output example.
| Python | mit | iabdalkader/openmv,kwagyeman/openmv,openmv/openmv,kwagyeman/openmv,kwagyeman/openmv,iabdalkader/openmv,openmv/openmv,openmv/openmv,iabdalkader/openmv,kwagyeman/openmv,openmv/openmv,iabdalkader/openmv | Add VSYNC GPIO output example. | # VSYNC GPIO output example.
#
# This example shows how to toggle the IR LED pin on VSYNC interrupt.
import sensor, image, time
from pyb import Pin
sensor.reset() # Reset and initialize the sensor.
sensor.set_pixformat(sensor.RGB565) # Set pixel format to RGB565 (or GRAYSCALE)
sensor.set_framesiz... | <commit_before><commit_msg>Add VSYNC GPIO output example.<commit_after> | # VSYNC GPIO output example.
#
# This example shows how to toggle the IR LED pin on VSYNC interrupt.
import sensor, image, time
from pyb import Pin
sensor.reset() # Reset and initialize the sensor.
sensor.set_pixformat(sensor.RGB565) # Set pixel format to RGB565 (or GRAYSCALE)
sensor.set_framesiz... | Add VSYNC GPIO output example.# VSYNC GPIO output example.
#
# This example shows how to toggle the IR LED pin on VSYNC interrupt.
import sensor, image, time
from pyb import Pin
sensor.reset() # Reset and initialize the sensor.
sensor.set_pixformat(sensor.RGB565) # Set pixel format to RGB565 (or ... | <commit_before><commit_msg>Add VSYNC GPIO output example.<commit_after># VSYNC GPIO output example.
#
# This example shows how to toggle the IR LED pin on VSYNC interrupt.
import sensor, image, time
from pyb import Pin
sensor.reset() # Reset and initialize the sensor.
sensor.set_pixformat(sensor.... | |
2585b44484b175bb116c228496069cc4269440c0 | hoomd/md/test-py/test_angle_cosinesq.py | hoomd/md/test-py/test_angle_cosinesq.py | # -*- coding: iso-8859-1 -*-
# Maintainer: joaander
from hoomd import *
from hoomd import md
context.initialize()
import unittest
import os
import numpy
# tests md.angle.cosinesq
class angle_cosinesq_tests (unittest.TestCase):
def setUp(self):
print
snap = data.make_snapshot(N=40,
... | Add python tests for cosine squared angles | Add python tests for cosine squared angles
| Python | bsd-3-clause | joaander/hoomd-blue,joaander/hoomd-blue,joaander/hoomd-blue,joaander/hoomd-blue,joaander/hoomd-blue,joaander/hoomd-blue | Add python tests for cosine squared angles | # -*- coding: iso-8859-1 -*-
# Maintainer: joaander
from hoomd import *
from hoomd import md
context.initialize()
import unittest
import os
import numpy
# tests md.angle.cosinesq
class angle_cosinesq_tests (unittest.TestCase):
def setUp(self):
print
snap = data.make_snapshot(N=40,
... | <commit_before><commit_msg>Add python tests for cosine squared angles<commit_after> | # -*- coding: iso-8859-1 -*-
# Maintainer: joaander
from hoomd import *
from hoomd import md
context.initialize()
import unittest
import os
import numpy
# tests md.angle.cosinesq
class angle_cosinesq_tests (unittest.TestCase):
def setUp(self):
print
snap = data.make_snapshot(N=40,
... | Add python tests for cosine squared angles# -*- coding: iso-8859-1 -*-
# Maintainer: joaander
from hoomd import *
from hoomd import md
context.initialize()
import unittest
import os
import numpy
# tests md.angle.cosinesq
class angle_cosinesq_tests (unittest.TestCase):
def setUp(self):
print
snap =... | <commit_before><commit_msg>Add python tests for cosine squared angles<commit_after># -*- coding: iso-8859-1 -*-
# Maintainer: joaander
from hoomd import *
from hoomd import md
context.initialize()
import unittest
import os
import numpy
# tests md.angle.cosinesq
class angle_cosinesq_tests (unittest.TestCase):
def ... | |
d168256dd4b75375770b3391f716ceaba2cf722e | cpsScrap.py | cpsScrap.py | #user/local/bin/python
#uses python3
import urllib.request
from bs4 import BeautifulSoup
url = "http://www.bls.gov/cps/cpsaat01.htm" #access the search term through website
page = urllib.request.urlopen(url).read()
soup = BeautifulSoup(page)
tables = soup.findAll('table') #find all tables
#print(tables)
mainTable = so... | Add scrapper of Bureau of Labor Statistis Employment status | Add scrapper of Bureau of Labor Statistis Employment status
| Python | mit | lexieheinle/python-productivity | Add scrapper of Bureau of Labor Statistis Employment status | #user/local/bin/python
#uses python3
import urllib.request
from bs4 import BeautifulSoup
url = "http://www.bls.gov/cps/cpsaat01.htm" #access the search term through website
page = urllib.request.urlopen(url).read()
soup = BeautifulSoup(page)
tables = soup.findAll('table') #find all tables
#print(tables)
mainTable = so... | <commit_before><commit_msg>Add scrapper of Bureau of Labor Statistis Employment status<commit_after> | #user/local/bin/python
#uses python3
import urllib.request
from bs4 import BeautifulSoup
url = "http://www.bls.gov/cps/cpsaat01.htm" #access the search term through website
page = urllib.request.urlopen(url).read()
soup = BeautifulSoup(page)
tables = soup.findAll('table') #find all tables
#print(tables)
mainTable = so... | Add scrapper of Bureau of Labor Statistis Employment status#user/local/bin/python
#uses python3
import urllib.request
from bs4 import BeautifulSoup
url = "http://www.bls.gov/cps/cpsaat01.htm" #access the search term through website
page = urllib.request.urlopen(url).read()
soup = BeautifulSoup(page)
tables = soup.find... | <commit_before><commit_msg>Add scrapper of Bureau of Labor Statistis Employment status<commit_after>#user/local/bin/python
#uses python3
import urllib.request
from bs4 import BeautifulSoup
url = "http://www.bls.gov/cps/cpsaat01.htm" #access the search term through website
page = urllib.request.urlopen(url).read()
soup... | |
39de01462baf3db60c5a0f5d8a3b529f798730ab | pygraphc/bin/Check.py | pygraphc/bin/Check.py | import csv
from os import listdir
from pygraphc.evaluation.ExternalEvaluation import ExternalEvaluation
# read result and ground truth
result_dir = '/home/hudan/Git/pygraphc/result/improved_majorclust/Kippo/per_day/'
groundtruth_dir = '/home/hudan/Git/labeled-authlog/dataset/Kippo/attack/'
result_files = listdir(resul... | Add script to check the performance | Add script to check the performance
| Python | mit | studiawan/pygraphc | Add script to check the performance | import csv
from os import listdir
from pygraphc.evaluation.ExternalEvaluation import ExternalEvaluation
# read result and ground truth
result_dir = '/home/hudan/Git/pygraphc/result/improved_majorclust/Kippo/per_day/'
groundtruth_dir = '/home/hudan/Git/labeled-authlog/dataset/Kippo/attack/'
result_files = listdir(resul... | <commit_before><commit_msg>Add script to check the performance<commit_after> | import csv
from os import listdir
from pygraphc.evaluation.ExternalEvaluation import ExternalEvaluation
# read result and ground truth
result_dir = '/home/hudan/Git/pygraphc/result/improved_majorclust/Kippo/per_day/'
groundtruth_dir = '/home/hudan/Git/labeled-authlog/dataset/Kippo/attack/'
result_files = listdir(resul... | Add script to check the performanceimport csv
from os import listdir
from pygraphc.evaluation.ExternalEvaluation import ExternalEvaluation
# read result and ground truth
result_dir = '/home/hudan/Git/pygraphc/result/improved_majorclust/Kippo/per_day/'
groundtruth_dir = '/home/hudan/Git/labeled-authlog/dataset/Kippo/at... | <commit_before><commit_msg>Add script to check the performance<commit_after>import csv
from os import listdir
from pygraphc.evaluation.ExternalEvaluation import ExternalEvaluation
# read result and ground truth
result_dir = '/home/hudan/Git/pygraphc/result/improved_majorclust/Kippo/per_day/'
groundtruth_dir = '/home/h... | |
8da927a0a196301ce5fb2ef2224e556b4d414729 | problem1.py | problem1.py | from collections import Counter
if __name__ == '__main__':
with open('data/rosalind_dna.txt', mode='r') as f:
sequence = f.read()
counts = Counter(sequence)
print '%d %d %d %d' % (counts['A'], counts['C'], counts['G'], counts['T'])
| Add solution for counting DNA nucleotides | Add solution for counting DNA nucleotides
| Python | mit | MichaelAquilina/rosalind-solutions | Add solution for counting DNA nucleotides | from collections import Counter
if __name__ == '__main__':
with open('data/rosalind_dna.txt', mode='r') as f:
sequence = f.read()
counts = Counter(sequence)
print '%d %d %d %d' % (counts['A'], counts['C'], counts['G'], counts['T'])
| <commit_before><commit_msg>Add solution for counting DNA nucleotides<commit_after> | from collections import Counter
if __name__ == '__main__':
with open('data/rosalind_dna.txt', mode='r') as f:
sequence = f.read()
counts = Counter(sequence)
print '%d %d %d %d' % (counts['A'], counts['C'], counts['G'], counts['T'])
| Add solution for counting DNA nucleotidesfrom collections import Counter
if __name__ == '__main__':
with open('data/rosalind_dna.txt', mode='r') as f:
sequence = f.read()
counts = Counter(sequence)
print '%d %d %d %d' % (counts['A'], counts['C'], counts['G'], counts['T'])
| <commit_before><commit_msg>Add solution for counting DNA nucleotides<commit_after>from collections import Counter
if __name__ == '__main__':
with open('data/rosalind_dna.txt', mode='r') as f:
sequence = f.read()
counts = Counter(sequence)
print '%d %d %d %d' % (counts['A'], counts['C'], counts['... | |
5178b104993401f47b1c4d8e3c796bef379e389e | letsmeet/communities/migrations/0011_auto_20160318_2240.py | letsmeet/communities/migrations/0011_auto_20160318_2240.py | # -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2016-03-18 21:40
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('communities', '0010_auto_20160108_1618'),
]
operations = [
migrations.AlterModelManager... | Add migration for `communities` app. | Add migration for `communities` app.
It was created independently of changes to `events` app; probably because of some old code changes in `communities` app.
| Python | mit | letsmeet-click/letsmeet.click,letsmeet-click/letsmeet.click,letsmeet-click/letsmeet.click,letsmeet-click/letsmeet.click | Add migration for `communities` app.
It was created independently of changes to `events` app; probably because of some old code changes in `communities` app. | # -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2016-03-18 21:40
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('communities', '0010_auto_20160108_1618'),
]
operations = [
migrations.AlterModelManager... | <commit_before><commit_msg>Add migration for `communities` app.
It was created independently of changes to `events` app; probably because of some old code changes in `communities` app.<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2016-03-18 21:40
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('communities', '0010_auto_20160108_1618'),
]
operations = [
migrations.AlterModelManager... | Add migration for `communities` app.
It was created independently of changes to `events` app; probably because of some old code changes in `communities` app.# -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2016-03-18 21:40
from __future__ import unicode_literals
from django.db import migrations
class Migration(... | <commit_before><commit_msg>Add migration for `communities` app.
It was created independently of changes to `events` app; probably because of some old code changes in `communities` app.<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2016-03-18 21:40
from __future__ import unicode_literals
from djang... | |
eee85e5157d69cee515c01fa0f638b064de74a6e | script/graph-reports-by-transport-mode.py | script/graph-reports-by-transport-mode.py | #!/usr/bin/python
# A script to draw graphs showing the number of reports by transport
# type each month. This script expects to find a file called
# 'problems.csv' in the current directory which should be generated
# by:
# DIR=`pwd` rake data:create_problem_spreadsheet
import csv
import datetime
from collecti... | Add a script to graph problem reports over time by transport mode | Add a script to graph problem reports over time by transport mode
| Python | agpl-3.0 | mysociety/fixmytransport,mysociety/fixmytransport,mysociety/fixmytransport,mysociety/fixmytransport,mysociety/fixmytransport,mysociety/fixmytransport | Add a script to graph problem reports over time by transport mode | #!/usr/bin/python
# A script to draw graphs showing the number of reports by transport
# type each month. This script expects to find a file called
# 'problems.csv' in the current directory which should be generated
# by:
# DIR=`pwd` rake data:create_problem_spreadsheet
import csv
import datetime
from collecti... | <commit_before><commit_msg>Add a script to graph problem reports over time by transport mode<commit_after> | #!/usr/bin/python
# A script to draw graphs showing the number of reports by transport
# type each month. This script expects to find a file called
# 'problems.csv' in the current directory which should be generated
# by:
# DIR=`pwd` rake data:create_problem_spreadsheet
import csv
import datetime
from collecti... | Add a script to graph problem reports over time by transport mode#!/usr/bin/python
# A script to draw graphs showing the number of reports by transport
# type each month. This script expects to find a file called
# 'problems.csv' in the current directory which should be generated
# by:
# DIR=`pwd` rake data:cre... | <commit_before><commit_msg>Add a script to graph problem reports over time by transport mode<commit_after>#!/usr/bin/python
# A script to draw graphs showing the number of reports by transport
# type each month. This script expects to find a file called
# 'problems.csv' in the current directory which should be genera... | |
b75de39ae75b3780988673ffbab869dec20c1521 | serverconfig/toolkit_uwsgi_star_shadow.py | serverconfig/toolkit_uwsgi_star_shadow.py | # mysite_uwsgi.ini file
# http://uwsgi-docs.readthedocs.io/en/latest/tutorials/Django_and_nginx.html
[uwsgi]
# Django-related settings
# the base directory (full path)
chdir = /home/users/starandshadow/star_site
# Django's wsgi file
module = wsgi
# the virtualenv (full path)
home = /home... | Add uwsgi conf file for star and shadow | Add uwsgi conf file for star and shadow
| Python | agpl-3.0 | BenMotz/cubetoolkit,BenMotz/cubetoolkit,BenMotz/cubetoolkit,BenMotz/cubetoolkit | Add uwsgi conf file for star and shadow | # mysite_uwsgi.ini file
# http://uwsgi-docs.readthedocs.io/en/latest/tutorials/Django_and_nginx.html
[uwsgi]
# Django-related settings
# the base directory (full path)
chdir = /home/users/starandshadow/star_site
# Django's wsgi file
module = wsgi
# the virtualenv (full path)
home = /home... | <commit_before><commit_msg>Add uwsgi conf file for star and shadow<commit_after> | # mysite_uwsgi.ini file
# http://uwsgi-docs.readthedocs.io/en/latest/tutorials/Django_and_nginx.html
[uwsgi]
# Django-related settings
# the base directory (full path)
chdir = /home/users/starandshadow/star_site
# Django's wsgi file
module = wsgi
# the virtualenv (full path)
home = /home... | Add uwsgi conf file for star and shadow# mysite_uwsgi.ini file
# http://uwsgi-docs.readthedocs.io/en/latest/tutorials/Django_and_nginx.html
[uwsgi]
# Django-related settings
# the base directory (full path)
chdir = /home/users/starandshadow/star_site
# Django's wsgi file
module = wsgi
# the virtual... | <commit_before><commit_msg>Add uwsgi conf file for star and shadow<commit_after># mysite_uwsgi.ini file
# http://uwsgi-docs.readthedocs.io/en/latest/tutorials/Django_and_nginx.html
[uwsgi]
# Django-related settings
# the base directory (full path)
chdir = /home/users/starandshadow/star_site
# Django's wsgi ... | |
4bfc3f650bd5560f2e2e469252ea1166496a4b6b | example1.py | example1.py | from __future__ import print_function
from datacube.api.model import DatasetType, Satellite, Ls57Arg25Bands, Fc25Bands, Pq25Bands
from datacube.api.query import list_tiles_as_list
from datacube.api.utils import get_dataset_metadata
from datacube.api.utils import get_dataset_data
from geotiff_to_netcdf import BandAsDim... | Add dodgy NetCDF creation example | Add dodgy NetCDF creation example
| Python | bsd-3-clause | omad/datacube-experiments | Add dodgy NetCDF creation example | from __future__ import print_function
from datacube.api.model import DatasetType, Satellite, Ls57Arg25Bands, Fc25Bands, Pq25Bands
from datacube.api.query import list_tiles_as_list
from datacube.api.utils import get_dataset_metadata
from datacube.api.utils import get_dataset_data
from geotiff_to_netcdf import BandAsDim... | <commit_before><commit_msg>Add dodgy NetCDF creation example<commit_after> | from __future__ import print_function
from datacube.api.model import DatasetType, Satellite, Ls57Arg25Bands, Fc25Bands, Pq25Bands
from datacube.api.query import list_tiles_as_list
from datacube.api.utils import get_dataset_metadata
from datacube.api.utils import get_dataset_data
from geotiff_to_netcdf import BandAsDim... | Add dodgy NetCDF creation examplefrom __future__ import print_function
from datacube.api.model import DatasetType, Satellite, Ls57Arg25Bands, Fc25Bands, Pq25Bands
from datacube.api.query import list_tiles_as_list
from datacube.api.utils import get_dataset_metadata
from datacube.api.utils import get_dataset_data
from g... | <commit_before><commit_msg>Add dodgy NetCDF creation example<commit_after>from __future__ import print_function
from datacube.api.model import DatasetType, Satellite, Ls57Arg25Bands, Fc25Bands, Pq25Bands
from datacube.api.query import list_tiles_as_list
from datacube.api.utils import get_dataset_metadata
from datacube.... | |
bbf28b1c7fa3fb9f9074b9d4879c30e810ab3f31 | ktbs_bench/utils/bench_manager.py | ktbs_bench/utils/bench_manager.py | from contextlib import contextmanager
from ktbs_bench.utils.decorators import bench as util_bench
class BenchManager:
def __init__(self):
self._contexts = []
self._bench_funcs = []
def bench(self, func):
"""Prepare a function to be benched and add it to the list to be run later."""
... | Add premise of Bench Manager | Add premise of Bench Manager
| Python | mit | ktbs/ktbs-bench,ktbs/ktbs-bench | Add premise of Bench Manager | from contextlib import contextmanager
from ktbs_bench.utils.decorators import bench as util_bench
class BenchManager:
def __init__(self):
self._contexts = []
self._bench_funcs = []
def bench(self, func):
"""Prepare a function to be benched and add it to the list to be run later."""
... | <commit_before><commit_msg>Add premise of Bench Manager<commit_after> | from contextlib import contextmanager
from ktbs_bench.utils.decorators import bench as util_bench
class BenchManager:
def __init__(self):
self._contexts = []
self._bench_funcs = []
def bench(self, func):
"""Prepare a function to be benched and add it to the list to be run later."""
... | Add premise of Bench Managerfrom contextlib import contextmanager
from ktbs_bench.utils.decorators import bench as util_bench
class BenchManager:
def __init__(self):
self._contexts = []
self._bench_funcs = []
def bench(self, func):
"""Prepare a function to be benched and add it to th... | <commit_before><commit_msg>Add premise of Bench Manager<commit_after>from contextlib import contextmanager
from ktbs_bench.utils.decorators import bench as util_bench
class BenchManager:
def __init__(self):
self._contexts = []
self._bench_funcs = []
def bench(self, func):
"""Prepare ... | |
cbb182ff0e999954c7a5c8fd19097a441762666b | salt/sdb/etcd_db.py | salt/sdb/etcd_db.py | # -*- coding: utf-8 -*-
'''
etcd Database Module
:maintainer: SaltStack
:maturity: New
:depends: python-etcd
:platform: all
This module allows access to the etcd database using an ``sdb://`` URI. This
package is located at ``https://pypi.python.org/pypi/python-etcd``.
Like all sdb modules, the etc... | Add sdb driver for etcd | Add sdb driver for etcd
| Python | apache-2.0 | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | Add sdb driver for etcd | # -*- coding: utf-8 -*-
'''
etcd Database Module
:maintainer: SaltStack
:maturity: New
:depends: python-etcd
:platform: all
This module allows access to the etcd database using an ``sdb://`` URI. This
package is located at ``https://pypi.python.org/pypi/python-etcd``.
Like all sdb modules, the etc... | <commit_before><commit_msg>Add sdb driver for etcd<commit_after> | # -*- coding: utf-8 -*-
'''
etcd Database Module
:maintainer: SaltStack
:maturity: New
:depends: python-etcd
:platform: all
This module allows access to the etcd database using an ``sdb://`` URI. This
package is located at ``https://pypi.python.org/pypi/python-etcd``.
Like all sdb modules, the etc... | Add sdb driver for etcd# -*- coding: utf-8 -*-
'''
etcd Database Module
:maintainer: SaltStack
:maturity: New
:depends: python-etcd
:platform: all
This module allows access to the etcd database using an ``sdb://`` URI. This
package is located at ``https://pypi.python.org/pypi/python-etcd``.
Like a... | <commit_before><commit_msg>Add sdb driver for etcd<commit_after># -*- coding: utf-8 -*-
'''
etcd Database Module
:maintainer: SaltStack
:maturity: New
:depends: python-etcd
:platform: all
This module allows access to the etcd database using an ``sdb://`` URI. This
package is located at ``https://py... | |
916c453d2ba939fb7eb15f4d87557c37bfc57a21 | tests/components/test_shell_command.py | tests/components/test_shell_command.py | """
tests.test_shell_command
~~~~~~~~~~~~~~~~~~~~~~~~
Tests demo component.
"""
import os
import tempfile
import unittest
from homeassistant import core
from homeassistant.components import shell_command
class TestShellCommand(unittest.TestCase):
""" Test the demo module. """
def setUp(self): # pylint: di... | Add test for shell command | Add test for shell command
| Python | mit | Julian/home-assistant,ct-23/home-assistant,mezz64/home-assistant,pottzer/home-assistant,joopert/home-assistant,FreekingDean/home-assistant,eagleamon/home-assistant,betrisey/home-assistant,eagleamon/home-assistant,open-homeautomation/home-assistant,aequitas/home-assistant,open-homeautomation/home-assistant,bdfoster/blum... | Add test for shell command | """
tests.test_shell_command
~~~~~~~~~~~~~~~~~~~~~~~~
Tests demo component.
"""
import os
import tempfile
import unittest
from homeassistant import core
from homeassistant.components import shell_command
class TestShellCommand(unittest.TestCase):
""" Test the demo module. """
def setUp(self): # pylint: di... | <commit_before><commit_msg>Add test for shell command<commit_after> | """
tests.test_shell_command
~~~~~~~~~~~~~~~~~~~~~~~~
Tests demo component.
"""
import os
import tempfile
import unittest
from homeassistant import core
from homeassistant.components import shell_command
class TestShellCommand(unittest.TestCase):
""" Test the demo module. """
def setUp(self): # pylint: di... | Add test for shell command"""
tests.test_shell_command
~~~~~~~~~~~~~~~~~~~~~~~~
Tests demo component.
"""
import os
import tempfile
import unittest
from homeassistant import core
from homeassistant.components import shell_command
class TestShellCommand(unittest.TestCase):
""" Test the demo module. """
def ... | <commit_before><commit_msg>Add test for shell command<commit_after>"""
tests.test_shell_command
~~~~~~~~~~~~~~~~~~~~~~~~
Tests demo component.
"""
import os
import tempfile
import unittest
from homeassistant import core
from homeassistant.components import shell_command
class TestShellCommand(unittest.TestCase):
... | |
029de4a3a10f31b2d300e100db7767722698f00a | tests/core/parse/test_parse_literal.py | tests/core/parse/test_parse_literal.py | import unittest
from mygrations.core.parse.rule_literal import rule_literal
class test_parse_regexp( unittest.TestCase ):
def get_rule( self, name, literal ):
return rule_literal( False, { 'name': name, 'value': literal }, {} )
def test_name_not_required( self ):
rule = self.get_rule( '', ... | Test for newly refactored literal rule | Test for newly refactored literal rule
| Python | mit | cmancone/mygrations,cmancone/mygrations | Test for newly refactored literal rule | import unittest
from mygrations.core.parse.rule_literal import rule_literal
class test_parse_regexp( unittest.TestCase ):
def get_rule( self, name, literal ):
return rule_literal( False, { 'name': name, 'value': literal }, {} )
def test_name_not_required( self ):
rule = self.get_rule( '', ... | <commit_before><commit_msg>Test for newly refactored literal rule<commit_after> | import unittest
from mygrations.core.parse.rule_literal import rule_literal
class test_parse_regexp( unittest.TestCase ):
def get_rule( self, name, literal ):
return rule_literal( False, { 'name': name, 'value': literal }, {} )
def test_name_not_required( self ):
rule = self.get_rule( '', ... | Test for newly refactored literal ruleimport unittest
from mygrations.core.parse.rule_literal import rule_literal
class test_parse_regexp( unittest.TestCase ):
def get_rule( self, name, literal ):
return rule_literal( False, { 'name': name, 'value': literal }, {} )
def test_name_not_required( self ... | <commit_before><commit_msg>Test for newly refactored literal rule<commit_after>import unittest
from mygrations.core.parse.rule_literal import rule_literal
class test_parse_regexp( unittest.TestCase ):
def get_rule( self, name, literal ):
return rule_literal( False, { 'name': name, 'value': literal }, {}... | |
a72516f4faae6993d55b7a542ef9b686c6e659fb | bot/action/core/command/no_command.py | bot/action/core/command/no_command.py | from bot.action.core.action import IntermediateAction
from bot.action.core.command import CommandAction
class NoCommandAction(IntermediateAction):
def process(self, event):
for entity in self.get_entities(event):
if self.is_valid_command(entity):
break
else:
... | Add NoCommandAction to only continue execution when a non-command text event is received | Add NoCommandAction to only continue execution when a non-command text event is received
| Python | agpl-3.0 | alvarogzp/telegram-bot,alvarogzp/telegram-bot | Add NoCommandAction to only continue execution when a non-command text event is received | from bot.action.core.action import IntermediateAction
from bot.action.core.command import CommandAction
class NoCommandAction(IntermediateAction):
def process(self, event):
for entity in self.get_entities(event):
if self.is_valid_command(entity):
break
else:
... | <commit_before><commit_msg>Add NoCommandAction to only continue execution when a non-command text event is received<commit_after> | from bot.action.core.action import IntermediateAction
from bot.action.core.command import CommandAction
class NoCommandAction(IntermediateAction):
def process(self, event):
for entity in self.get_entities(event):
if self.is_valid_command(entity):
break
else:
... | Add NoCommandAction to only continue execution when a non-command text event is receivedfrom bot.action.core.action import IntermediateAction
from bot.action.core.command import CommandAction
class NoCommandAction(IntermediateAction):
def process(self, event):
for entity in self.get_entities(event):
... | <commit_before><commit_msg>Add NoCommandAction to only continue execution when a non-command text event is received<commit_after>from bot.action.core.action import IntermediateAction
from bot.action.core.command import CommandAction
class NoCommandAction(IntermediateAction):
def process(self, event):
for ... | |
e41ce4338334794466ba6918fc3b8a1f118d6b41 | py/testdir_multi_jvm/test_gbm_prostate.py | py/testdir_multi_jvm/test_gbm_prostate.py | import sys
sys.path.insert(1, '../../h2o-py/src/main/py')
from h2o import H2OConnection
from h2o import H2OFrame
from h2o import H2OGBM
from tabulate import tabulate
######################################################
# Parse command-line args.
#
# usage: python test_name.py --usecloud ipaddr:port
#
ip_port = sy... | Add first example test of using h2o python API to gradle build regression suite. | Add first example test of using h2o python API to gradle build regression suite.
| Python | apache-2.0 | mrgloom/h2o-3,brightchen/h2o-3,kyoren/https-github.com-h2oai-h2o-3,nilbody/h2o-3,madmax983/h2o-3,jangorecki/h2o-3,pchmieli/h2o-3,kyoren/https-github.com-h2oai-h2o-3,madmax983/h2o-3,YzPaul3/h2o-3,ChristosChristofidis/h2o-3,brightchen/h2o-3,jangorecki/h2o-3,michalkurka/h2o-3,printedheart/h2o-3,h2oai/h2o-3,PawarPawan/h2o-... | Add first example test of using h2o python API to gradle build regression suite. | import sys
sys.path.insert(1, '../../h2o-py/src/main/py')
from h2o import H2OConnection
from h2o import H2OFrame
from h2o import H2OGBM
from tabulate import tabulate
######################################################
# Parse command-line args.
#
# usage: python test_name.py --usecloud ipaddr:port
#
ip_port = sy... | <commit_before><commit_msg>Add first example test of using h2o python API to gradle build regression suite.<commit_after> | import sys
sys.path.insert(1, '../../h2o-py/src/main/py')
from h2o import H2OConnection
from h2o import H2OFrame
from h2o import H2OGBM
from tabulate import tabulate
######################################################
# Parse command-line args.
#
# usage: python test_name.py --usecloud ipaddr:port
#
ip_port = sy... | Add first example test of using h2o python API to gradle build regression suite.import sys
sys.path.insert(1, '../../h2o-py/src/main/py')
from h2o import H2OConnection
from h2o import H2OFrame
from h2o import H2OGBM
from tabulate import tabulate
######################################################
# Parse command-l... | <commit_before><commit_msg>Add first example test of using h2o python API to gradle build regression suite.<commit_after>import sys
sys.path.insert(1, '../../h2o-py/src/main/py')
from h2o import H2OConnection
from h2o import H2OFrame
from h2o import H2OGBM
from tabulate import tabulate
###############################... | |
c27685da10c85cb9876b4c73012da3ebff1915dc | codingame/easy/horse-racing_duals.py | codingame/easy/horse-racing_duals.py | N = int(raw_input())
lst = []
# Read the list
for i in xrange(N):
lst.append(int(raw_input()))
# Sort the list, ascending order
a = sorted(lst)
# Find the min difference
print min(y-x for x,y in zip(a, a[1:])) | Add exercise horse racing duals | Add exercise horse racing duals
| Python | mit | AntoineAugusti/katas,AntoineAugusti/katas,AntoineAugusti/katas | Add exercise horse racing duals | N = int(raw_input())
lst = []
# Read the list
for i in xrange(N):
lst.append(int(raw_input()))
# Sort the list, ascending order
a = sorted(lst)
# Find the min difference
print min(y-x for x,y in zip(a, a[1:])) | <commit_before><commit_msg>Add exercise horse racing duals<commit_after> | N = int(raw_input())
lst = []
# Read the list
for i in xrange(N):
lst.append(int(raw_input()))
# Sort the list, ascending order
a = sorted(lst)
# Find the min difference
print min(y-x for x,y in zip(a, a[1:])) | Add exercise horse racing dualsN = int(raw_input())
lst = []
# Read the list
for i in xrange(N):
lst.append(int(raw_input()))
# Sort the list, ascending order
a = sorted(lst)
# Find the min difference
print min(y-x for x,y in zip(a, a[1:])) | <commit_before><commit_msg>Add exercise horse racing duals<commit_after>N = int(raw_input())
lst = []
# Read the list
for i in xrange(N):
lst.append(int(raw_input()))
# Sort the list, ascending order
a = sorted(lst)
# Find the min difference
print min(y-x for x,y in zip(a, a[1:])) | |
717f3c5d4babe9feeb4e0d82fb2ea839d735c4b4 | test/backend/test_database/test_common.py | test/backend/test_database/test_common.py | import mock
from linkr import db
import database.common
from test.backend.test_case import LinkrTestCase
class TestCommon(LinkrTestCase):
def test_create_tables(self):
with mock.patch.object(db, 'create_all') as mock_create:
database.common.create_tables()
self.assertTrue(mock_cre... | Test database.common for full coverage of database | Test database.common for full coverage of database
| Python | mit | LINKIWI/linkr,LINKIWI/linkr,LINKIWI/linkr | Test database.common for full coverage of database | import mock
from linkr import db
import database.common
from test.backend.test_case import LinkrTestCase
class TestCommon(LinkrTestCase):
def test_create_tables(self):
with mock.patch.object(db, 'create_all') as mock_create:
database.common.create_tables()
self.assertTrue(mock_cre... | <commit_before><commit_msg>Test database.common for full coverage of database<commit_after> | import mock
from linkr import db
import database.common
from test.backend.test_case import LinkrTestCase
class TestCommon(LinkrTestCase):
def test_create_tables(self):
with mock.patch.object(db, 'create_all') as mock_create:
database.common.create_tables()
self.assertTrue(mock_cre... | Test database.common for full coverage of databaseimport mock
from linkr import db
import database.common
from test.backend.test_case import LinkrTestCase
class TestCommon(LinkrTestCase):
def test_create_tables(self):
with mock.patch.object(db, 'create_all') as mock_create:
database.common.cre... | <commit_before><commit_msg>Test database.common for full coverage of database<commit_after>import mock
from linkr import db
import database.common
from test.backend.test_case import LinkrTestCase
class TestCommon(LinkrTestCase):
def test_create_tables(self):
with mock.patch.object(db, 'create_all') as moc... | |
4316122225d2e523ff310f65479ea676e0aa02e3 | load_data_sets.py | load_data_sets.py | import os
import numpy as np
import sgf_wrapper
def load_sgf_positions(*dataset_names):
for dataset in dataset_names:
dataset_dir = os.path.join(os.getcwd(), 'data', dataset)
dataset_files = [os.path.join(dataset_dir, name) for name in os.listdir(dataset_dir)]
all_datafiles = filter(os.pat... | Add methods for loading data sets | Add methods for loading data sets
| Python | apache-2.0 | brilee/MuGo | Add methods for loading data sets | import os
import numpy as np
import sgf_wrapper
def load_sgf_positions(*dataset_names):
for dataset in dataset_names:
dataset_dir = os.path.join(os.getcwd(), 'data', dataset)
dataset_files = [os.path.join(dataset_dir, name) for name in os.listdir(dataset_dir)]
all_datafiles = filter(os.pat... | <commit_before><commit_msg>Add methods for loading data sets<commit_after> | import os
import numpy as np
import sgf_wrapper
def load_sgf_positions(*dataset_names):
for dataset in dataset_names:
dataset_dir = os.path.join(os.getcwd(), 'data', dataset)
dataset_files = [os.path.join(dataset_dir, name) for name in os.listdir(dataset_dir)]
all_datafiles = filter(os.pat... | Add methods for loading data setsimport os
import numpy as np
import sgf_wrapper
def load_sgf_positions(*dataset_names):
for dataset in dataset_names:
dataset_dir = os.path.join(os.getcwd(), 'data', dataset)
dataset_files = [os.path.join(dataset_dir, name) for name in os.listdir(dataset_dir)]
... | <commit_before><commit_msg>Add methods for loading data sets<commit_after>import os
import numpy as np
import sgf_wrapper
def load_sgf_positions(*dataset_names):
for dataset in dataset_names:
dataset_dir = os.path.join(os.getcwd(), 'data', dataset)
dataset_files = [os.path.join(dataset_dir, name) ... | |
612fb44b33c4f52488f3565c009188d61a8343c2 | python/autojoin_on_invite.py | python/autojoin_on_invite.py | __module_name__ = "autojoin on invite"
__module_version__ = "1.0"
import hexchat
def join(word, word_eol, userdata):
hexchat.command('join ' + word[0])
hexchat.hook_print('Invited', join)
| Add an auto join script | Add an auto join script
| Python | apache-2.0 | arai-wa/hexchat-addons | Add an auto join script | __module_name__ = "autojoin on invite"
__module_version__ = "1.0"
import hexchat
def join(word, word_eol, userdata):
hexchat.command('join ' + word[0])
hexchat.hook_print('Invited', join)
| <commit_before><commit_msg>Add an auto join script<commit_after> | __module_name__ = "autojoin on invite"
__module_version__ = "1.0"
import hexchat
def join(word, word_eol, userdata):
hexchat.command('join ' + word[0])
hexchat.hook_print('Invited', join)
| Add an auto join script__module_name__ = "autojoin on invite"
__module_version__ = "1.0"
import hexchat
def join(word, word_eol, userdata):
hexchat.command('join ' + word[0])
hexchat.hook_print('Invited', join)
| <commit_before><commit_msg>Add an auto join script<commit_after>__module_name__ = "autojoin on invite"
__module_version__ = "1.0"
import hexchat
def join(word, word_eol, userdata):
hexchat.command('join ' + word[0])
hexchat.hook_print('Invited', join)
| |
3fd3b376b1334dba0ffea3641dcbb32d788f4083 | scripts/fix_templated_orphans.py | scripts/fix_templated_orphans.py | # -*- coding: utf-8 -*-
"""Find orphaned templated nodes without parents, then attempt to identify and
restore their parent nodes. Due to a bug in templating that has since been
fixed, several templated nodes were not attached to the `nodes` lists of their
parents.
"""
import logging
from modularodm import Q
from ... | Add migration script to fix templated orphans. | Add migration script to fix templated orphans.
Restore parents to orphaned nodes created during templating.
See scripts/fix_templated_orphans.py for details.
| Python | apache-2.0 | amyshi188/osf.io,fabianvf/osf.io,mluke93/osf.io,GaryKriebel/osf.io,KAsante95/osf.io,ckc6cz/osf.io,revanthkolli/osf.io,cslzchen/osf.io,Nesiehr/osf.io,zkraime/osf.io,reinaH/osf.io,mluke93/osf.io,haoyuchen1992/osf.io,ckc6cz/osf.io,asanfilippo7/osf.io,laurenrevere/osf.io,zkraime/osf.io,aaxelb/osf.io,emetsger/osf.io,Ghalko/... | Add migration script to fix templated orphans.
Restore parents to orphaned nodes created during templating.
See scripts/fix_templated_orphans.py for details. | # -*- coding: utf-8 -*-
"""Find orphaned templated nodes without parents, then attempt to identify and
restore their parent nodes. Due to a bug in templating that has since been
fixed, several templated nodes were not attached to the `nodes` lists of their
parents.
"""
import logging
from modularodm import Q
from ... | <commit_before><commit_msg>Add migration script to fix templated orphans.
Restore parents to orphaned nodes created during templating.
See scripts/fix_templated_orphans.py for details.<commit_after> | # -*- coding: utf-8 -*-
"""Find orphaned templated nodes without parents, then attempt to identify and
restore their parent nodes. Due to a bug in templating that has since been
fixed, several templated nodes were not attached to the `nodes` lists of their
parents.
"""
import logging
from modularodm import Q
from ... | Add migration script to fix templated orphans.
Restore parents to orphaned nodes created during templating.
See scripts/fix_templated_orphans.py for details.# -*- coding: utf-8 -*-
"""Find orphaned templated nodes without parents, then attempt to identify and
restore their parent nodes. Due to a bug in templating tha... | <commit_before><commit_msg>Add migration script to fix templated orphans.
Restore parents to orphaned nodes created during templating.
See scripts/fix_templated_orphans.py for details.<commit_after># -*- coding: utf-8 -*-
"""Find orphaned templated nodes without parents, then attempt to identify and
restore their par... | |
df17f792faab74955f5e9573bf7dd9812b489bd3 | hybridization_solver.py | hybridization_solver.py | from __future__ import absolute_import, print_function, division
from firedrake import *
qflag = False
degree = 1
mesh = UnitSquareMesh(8, 8, quadrilateral=qflag)
n = FacetNormal(mesh)
if qflag:
RT = FiniteElement("RTCF", quadrilateral, degree)
DG = FiniteElement("DQ", quadrilateral, degree - 1)
Te = Fi... | Add a hybridization example using Slate manually | Add a hybridization example using Slate manually
| Python | mit | thomasgibson/firedrake-hybridization | Add a hybridization example using Slate manually | from __future__ import absolute_import, print_function, division
from firedrake import *
qflag = False
degree = 1
mesh = UnitSquareMesh(8, 8, quadrilateral=qflag)
n = FacetNormal(mesh)
if qflag:
RT = FiniteElement("RTCF", quadrilateral, degree)
DG = FiniteElement("DQ", quadrilateral, degree - 1)
Te = Fi... | <commit_before><commit_msg>Add a hybridization example using Slate manually<commit_after> | from __future__ import absolute_import, print_function, division
from firedrake import *
qflag = False
degree = 1
mesh = UnitSquareMesh(8, 8, quadrilateral=qflag)
n = FacetNormal(mesh)
if qflag:
RT = FiniteElement("RTCF", quadrilateral, degree)
DG = FiniteElement("DQ", quadrilateral, degree - 1)
Te = Fi... | Add a hybridization example using Slate manuallyfrom __future__ import absolute_import, print_function, division
from firedrake import *
qflag = False
degree = 1
mesh = UnitSquareMesh(8, 8, quadrilateral=qflag)
n = FacetNormal(mesh)
if qflag:
RT = FiniteElement("RTCF", quadrilateral, degree)
DG = FiniteElem... | <commit_before><commit_msg>Add a hybridization example using Slate manually<commit_after>from __future__ import absolute_import, print_function, division
from firedrake import *
qflag = False
degree = 1
mesh = UnitSquareMesh(8, 8, quadrilateral=qflag)
n = FacetNormal(mesh)
if qflag:
RT = FiniteElement("RTCF", q... | |
8a844b78c5ded93ce7a75585a6ad2b86d8b4cb13 | pida_type_decoder.py | pida_type_decoder.py | from pida_types import IDA_TYPES
from pida_tlocal_type import IdaTLocalType
def decode_step(ida_type):
# TODO :
pass
def decode_hybrid_type(ida_type):
value = {'idt': None, 'value': None}
rbyte = ord(ida_type[0])
if not (ida_type[1] == '#' and rbyte in [4, 5]):
value = {'idt': IDA_TYPES[... | Add recognize decoding typedef or local type | Add recognize decoding typedef or local type
| Python | mit | goodwinxp/ATFGenerator,goodwinxp/ATFGenerator,goodwinxp/ATFGenerator | Add recognize decoding typedef or local type | from pida_types import IDA_TYPES
from pida_tlocal_type import IdaTLocalType
def decode_step(ida_type):
# TODO :
pass
def decode_hybrid_type(ida_type):
value = {'idt': None, 'value': None}
rbyte = ord(ida_type[0])
if not (ida_type[1] == '#' and rbyte in [4, 5]):
value = {'idt': IDA_TYPES[... | <commit_before><commit_msg>Add recognize decoding typedef or local type<commit_after> | from pida_types import IDA_TYPES
from pida_tlocal_type import IdaTLocalType
def decode_step(ida_type):
# TODO :
pass
def decode_hybrid_type(ida_type):
value = {'idt': None, 'value': None}
rbyte = ord(ida_type[0])
if not (ida_type[1] == '#' and rbyte in [4, 5]):
value = {'idt': IDA_TYPES[... | Add recognize decoding typedef or local typefrom pida_types import IDA_TYPES
from pida_tlocal_type import IdaTLocalType
def decode_step(ida_type):
# TODO :
pass
def decode_hybrid_type(ida_type):
value = {'idt': None, 'value': None}
rbyte = ord(ida_type[0])
if not (ida_type[1] == '#' and rbyte in... | <commit_before><commit_msg>Add recognize decoding typedef or local type<commit_after>from pida_types import IDA_TYPES
from pida_tlocal_type import IdaTLocalType
def decode_step(ida_type):
# TODO :
pass
def decode_hybrid_type(ida_type):
value = {'idt': None, 'value': None}
rbyte = ord(ida_type[0])
... | |
0ad8d8665f064542346c3788cecaffdcb68f168a | plasmapy/utils/tests/test_exceptions.py | plasmapy/utils/tests/test_exceptions.py | import pytest
import warnings
from .. import (PlasmaPyError,
PhysicsError,
RelativityError,
AtomicError)
from .. import (PlasmaPyWarning,
PhysicsWarning,
RelativityWarning,
AtomicWarning)
plasmapy_exceptions = [
Plas... | Create tests for custom exceptions and warnings | Create tests for custom exceptions and warnings
| Python | bsd-3-clause | StanczakDominik/PlasmaPy | Create tests for custom exceptions and warnings | import pytest
import warnings
from .. import (PlasmaPyError,
PhysicsError,
RelativityError,
AtomicError)
from .. import (PlasmaPyWarning,
PhysicsWarning,
RelativityWarning,
AtomicWarning)
plasmapy_exceptions = [
Plas... | <commit_before><commit_msg>Create tests for custom exceptions and warnings<commit_after> | import pytest
import warnings
from .. import (PlasmaPyError,
PhysicsError,
RelativityError,
AtomicError)
from .. import (PlasmaPyWarning,
PhysicsWarning,
RelativityWarning,
AtomicWarning)
plasmapy_exceptions = [
Plas... | Create tests for custom exceptions and warningsimport pytest
import warnings
from .. import (PlasmaPyError,
PhysicsError,
RelativityError,
AtomicError)
from .. import (PlasmaPyWarning,
PhysicsWarning,
RelativityWarning,
At... | <commit_before><commit_msg>Create tests for custom exceptions and warnings<commit_after>import pytest
import warnings
from .. import (PlasmaPyError,
PhysicsError,
RelativityError,
AtomicError)
from .. import (PlasmaPyWarning,
PhysicsWarning,
... | |
6cd12f2aaa6170daef88a913ee78b725b6450d61 | proselint/checks/garner/not_guilty.py | proselint/checks/garner/not_guilty.py | # -*- coding: utf-8 -*-
"""Not guilty beyond a reasonable doubt.
---
layout: post
source: Garner's Modern American Usage
source_url: http://bit.ly/1T4alrY
title: Not guilty beyond a reasonable doubt.
date: 2016-03-09 15:50:31
categories: writing
---
This phrasing is ambiguous. The standard by which... | Add check for 'not guilty beyond a reasonable doubt' | Add check for 'not guilty beyond a reasonable doubt'
Closes issue #242
| Python | bsd-3-clause | amperser/proselint,amperser/proselint,amperser/proselint,amperser/proselint,amperser/proselint | Add check for 'not guilty beyond a reasonable doubt'
Closes issue #242 | # -*- coding: utf-8 -*-
"""Not guilty beyond a reasonable doubt.
---
layout: post
source: Garner's Modern American Usage
source_url: http://bit.ly/1T4alrY
title: Not guilty beyond a reasonable doubt.
date: 2016-03-09 15:50:31
categories: writing
---
This phrasing is ambiguous. The standard by which... | <commit_before><commit_msg>Add check for 'not guilty beyond a reasonable doubt'
Closes issue #242<commit_after> | # -*- coding: utf-8 -*-
"""Not guilty beyond a reasonable doubt.
---
layout: post
source: Garner's Modern American Usage
source_url: http://bit.ly/1T4alrY
title: Not guilty beyond a reasonable doubt.
date: 2016-03-09 15:50:31
categories: writing
---
This phrasing is ambiguous. The standard by which... | Add check for 'not guilty beyond a reasonable doubt'
Closes issue #242# -*- coding: utf-8 -*-
"""Not guilty beyond a reasonable doubt.
---
layout: post
source: Garner's Modern American Usage
source_url: http://bit.ly/1T4alrY
title: Not guilty beyond a reasonable doubt.
date: 2016-03-09 15:50:31
cat... | <commit_before><commit_msg>Add check for 'not guilty beyond a reasonable doubt'
Closes issue #242<commit_after># -*- coding: utf-8 -*-
"""Not guilty beyond a reasonable doubt.
---
layout: post
source: Garner's Modern American Usage
source_url: http://bit.ly/1T4alrY
title: Not guilty beyond a reasonable d... | |
2c9760da48caaf9656c8b1e3f81e70671b7e7c5e | postgres/audit/migrations/0003_auditlog_app_session.py | postgres/audit/migrations/0003_auditlog_app_session.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('audit', '0002_auditlog'),
]
operations = [
migrations.AddField(
model_name='auditlog',
name='app_ses... | Add missing migration for audit app. | Add missing migration for audit app.
| Python | bsd-3-clause | wlanslovenija/django-postgres | Add missing migration for audit app. | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('audit', '0002_auditlog'),
]
operations = [
migrations.AddField(
model_name='auditlog',
name='app_ses... | <commit_before><commit_msg>Add missing migration for audit app.<commit_after> | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('audit', '0002_auditlog'),
]
operations = [
migrations.AddField(
model_name='auditlog',
name='app_ses... | Add missing migration for audit app.# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('audit', '0002_auditlog'),
]
operations = [
migrations.AddField(
model_name='... | <commit_before><commit_msg>Add missing migration for audit app.<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('audit', '0002_auditlog'),
]
operations = [
migr... | |
a466a89cd18252c6d90fd3b590148ca3268ff637 | karabo_data/tests/test_lpd_geometry.py | karabo_data/tests/test_lpd_geometry.py | from matplotlib.figure import Figure
import numpy as np
from karabo_data.geometry2 import LPD_1MGeometry
def test_inspect():
geom = LPD_1MGeometry.from_quad_positions([
(11.4, 299),
(-11.5, 8),
(254.5, -16),
(278.5, 275)
])
# Smoketest
fig = geom.inspect()
assert is... | Add a couple of simple tests for LPD geometry | Add a couple of simple tests for LPD geometry
| Python | bsd-3-clause | European-XFEL/h5tools-py | Add a couple of simple tests for LPD geometry | from matplotlib.figure import Figure
import numpy as np
from karabo_data.geometry2 import LPD_1MGeometry
def test_inspect():
geom = LPD_1MGeometry.from_quad_positions([
(11.4, 299),
(-11.5, 8),
(254.5, -16),
(278.5, 275)
])
# Smoketest
fig = geom.inspect()
assert is... | <commit_before><commit_msg>Add a couple of simple tests for LPD geometry<commit_after> | from matplotlib.figure import Figure
import numpy as np
from karabo_data.geometry2 import LPD_1MGeometry
def test_inspect():
geom = LPD_1MGeometry.from_quad_positions([
(11.4, 299),
(-11.5, 8),
(254.5, -16),
(278.5, 275)
])
# Smoketest
fig = geom.inspect()
assert is... | Add a couple of simple tests for LPD geometryfrom matplotlib.figure import Figure
import numpy as np
from karabo_data.geometry2 import LPD_1MGeometry
def test_inspect():
geom = LPD_1MGeometry.from_quad_positions([
(11.4, 299),
(-11.5, 8),
(254.5, -16),
(278.5, 275)
])
# Smo... | <commit_before><commit_msg>Add a couple of simple tests for LPD geometry<commit_after>from matplotlib.figure import Figure
import numpy as np
from karabo_data.geometry2 import LPD_1MGeometry
def test_inspect():
geom = LPD_1MGeometry.from_quad_positions([
(11.4, 299),
(-11.5, 8),
(254.5, -1... | |
80f35ad0d3a6a1f04eb0339bb1088ebe6eb27af5 | mongomock/results.py | mongomock/results.py | try:
from pymongo.results import InsertOneResult
from pymongo.results import InsertManyResult
from pymongo.results import UpdateResult
from pymongo.results import DeleteResult
except ImportError:
class _WriteResult(object):
def __init__(self, acknowledged=True):
self.__acknowled... | Add result classes for update/insert/delete ops | Add result classes for update/insert/delete ops
| Python | bsd-3-clause | vmalloc/mongomock,marcinbarczynski/mongomock,mdomke/mongomock,drorasaf/mongomock,magaman384/mongomock,StarfishStorage/mongomock,julianhille/mongomock | Add result classes for update/insert/delete ops | try:
from pymongo.results import InsertOneResult
from pymongo.results import InsertManyResult
from pymongo.results import UpdateResult
from pymongo.results import DeleteResult
except ImportError:
class _WriteResult(object):
def __init__(self, acknowledged=True):
self.__acknowled... | <commit_before><commit_msg>Add result classes for update/insert/delete ops<commit_after> | try:
from pymongo.results import InsertOneResult
from pymongo.results import InsertManyResult
from pymongo.results import UpdateResult
from pymongo.results import DeleteResult
except ImportError:
class _WriteResult(object):
def __init__(self, acknowledged=True):
self.__acknowled... | Add result classes for update/insert/delete opstry:
from pymongo.results import InsertOneResult
from pymongo.results import InsertManyResult
from pymongo.results import UpdateResult
from pymongo.results import DeleteResult
except ImportError:
class _WriteResult(object):
def __init__(self, a... | <commit_before><commit_msg>Add result classes for update/insert/delete ops<commit_after>try:
from pymongo.results import InsertOneResult
from pymongo.results import InsertManyResult
from pymongo.results import UpdateResult
from pymongo.results import DeleteResult
except ImportError:
class _WriteResu... | |
9d44e4eb4c8d2c2f10152894f7c53d9feaae528c | api_bouncer/middlewares/ip_restriction.py | api_bouncer/middlewares/ip_restriction.py | import ipaddress
from django.http import JsonResponse
from ..models import Plugin
def get_client_ip(request):
x_forwarded_for = request.META.get('HTTP_X_FORWARDED_FOR')
if x_forwarded_for:
ip = x_forwarded_for.split(',')[0]
else:
ip = request.META.get('REMOTE_ADDR')
return ip
class... | Add ip-restriction plugin to declare ip whitelists/blacklists and restrict api access | Add ip-restriction plugin to declare ip whitelists/blacklists
and restrict api access
| Python | apache-2.0 | menecio/django-api-bouncer | Add ip-restriction plugin to declare ip whitelists/blacklists
and restrict api access | import ipaddress
from django.http import JsonResponse
from ..models import Plugin
def get_client_ip(request):
x_forwarded_for = request.META.get('HTTP_X_FORWARDED_FOR')
if x_forwarded_for:
ip = x_forwarded_for.split(',')[0]
else:
ip = request.META.get('REMOTE_ADDR')
return ip
class... | <commit_before><commit_msg>Add ip-restriction plugin to declare ip whitelists/blacklists
and restrict api access<commit_after> | import ipaddress
from django.http import JsonResponse
from ..models import Plugin
def get_client_ip(request):
x_forwarded_for = request.META.get('HTTP_X_FORWARDED_FOR')
if x_forwarded_for:
ip = x_forwarded_for.split(',')[0]
else:
ip = request.META.get('REMOTE_ADDR')
return ip
class... | Add ip-restriction plugin to declare ip whitelists/blacklists
and restrict api accessimport ipaddress
from django.http import JsonResponse
from ..models import Plugin
def get_client_ip(request):
x_forwarded_for = request.META.get('HTTP_X_FORWARDED_FOR')
if x_forwarded_for:
ip = x_forwarded_for.split... | <commit_before><commit_msg>Add ip-restriction plugin to declare ip whitelists/blacklists
and restrict api access<commit_after>import ipaddress
from django.http import JsonResponse
from ..models import Plugin
def get_client_ip(request):
x_forwarded_for = request.META.get('HTTP_X_FORWARDED_FOR')
if x_forwarde... | |
94d8adf9d48c6118a3467947ad8b1ae0b6dd3d63 | blog/migrations/0006_auto_20160513_1634.py | blog/migrations/0006_auto_20160513_1634.py | # -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2016-05-13 13:34
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('blog', '0005_auto_20160422_1256'),
]
operations = [
migrations.AddField(
... | Fix - add missed migrations | Fix - add missed migrations
| Python | mit | fidals/refarm-site,fidals/refarm-site,fidals/refarm-site | Fix - add missed migrations | # -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2016-05-13 13:34
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('blog', '0005_auto_20160422_1256'),
]
operations = [
migrations.AddField(
... | <commit_before><commit_msg>Fix - add missed migrations<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2016-05-13 13:34
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('blog', '0005_auto_20160422_1256'),
]
operations = [
migrations.AddField(
... | Fix - add missed migrations# -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2016-05-13 13:34
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('blog', '0005_auto_20160422_1256'),
]
operations = [
... | <commit_before><commit_msg>Fix - add missed migrations<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2016-05-13 13:34
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('blog', '0005_auto_2016042... | |
4681ee081f5600cebf7540862efc60dbf1d190d7 | test_app.py | test_app.py | import unittest
from unittest import TestCase
from user import User
from bucketlist import BucketList
from flask import url_for
from app import app
class BucketListTest(TestCase):
def setUp(self):
# creates a test client
self.client = app.test_client()
self.client.testing = True
... | Rename test module and add test for login page content | Rename test module and add test for login page content
| Python | mit | mkiterian/bucket-list-app,mkiterian/bucket-list-app,mkiterian/bucket-list-app | Rename test module and add test for login page content | import unittest
from unittest import TestCase
from user import User
from bucketlist import BucketList
from flask import url_for
from app import app
class BucketListTest(TestCase):
def setUp(self):
# creates a test client
self.client = app.test_client()
self.client.testing = True
... | <commit_before><commit_msg>Rename test module and add test for login page content<commit_after> | import unittest
from unittest import TestCase
from user import User
from bucketlist import BucketList
from flask import url_for
from app import app
class BucketListTest(TestCase):
def setUp(self):
# creates a test client
self.client = app.test_client()
self.client.testing = True
... | Rename test module and add test for login page contentimport unittest
from unittest import TestCase
from user import User
from bucketlist import BucketList
from flask import url_for
from app import app
class BucketListTest(TestCase):
def setUp(self):
# creates a test client
self.client = app.test... | <commit_before><commit_msg>Rename test module and add test for login page content<commit_after>import unittest
from unittest import TestCase
from user import User
from bucketlist import BucketList
from flask import url_for
from app import app
class BucketListTest(TestCase):
def setUp(self):
# creates a t... | |
f6c64846fc066403d39d7cb60ce0bcc455aff2d5 | src/server/convert.py | src/server/convert.py | # midi-beeper-orchestra - program to create an orchestra from PC speakers
# Copyright (C) 2015 The Underscores
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the Lice... | Add conversions for MIDI to hertz and hertz to MIDI | Add conversions for MIDI to hertz and hertz to MIDI
| Python | agpl-3.0 | TheUnderscores/midi-beeper-orchestra | Add conversions for MIDI to hertz and hertz to MIDI | # midi-beeper-orchestra - program to create an orchestra from PC speakers
# Copyright (C) 2015 The Underscores
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the Lice... | <commit_before><commit_msg>Add conversions for MIDI to hertz and hertz to MIDI<commit_after> | # midi-beeper-orchestra - program to create an orchestra from PC speakers
# Copyright (C) 2015 The Underscores
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the Lice... | Add conversions for MIDI to hertz and hertz to MIDI# midi-beeper-orchestra - program to create an orchestra from PC speakers
# Copyright (C) 2015 The Underscores
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Fre... | <commit_before><commit_msg>Add conversions for MIDI to hertz and hertz to MIDI<commit_after># midi-beeper-orchestra - program to create an orchestra from PC speakers
# Copyright (C) 2015 The Underscores
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General... | |
17cc4de3c0d6b7e3c843085a1f7f6694930a7e84 | geometry/graham_scan/python/graham_scan.py | geometry/graham_scan/python/graham_scan.py | #!/usr/bin/env python
import Tkinter as tk
from random import random
def make_a_right_turn(a, b, c):
"""Going from a to b to c involves a right turn?"""
u = (c[0] - b[0], c[1] - b[1])
v = (a[0] - b[0], a[1] - b[1])
cross_product = u[0] * v[1] - u[1] * v[0]
return cross_product < 0
def graham_s... | Add Graham's Scan in Python | Add Graham's Scan in Python
| Python | cc0-1.0 | Deepak345/al-go-rithms,manikTharaka/al-go-rithms,Cnidarias/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,manikTharaka/al-go-rithms,Deepak345/al-go-rithms,ZoranPandovski/al-go-rithms,Cnidarias/al-go-rithms,ZoranPandovski/al-go-rithms,manikTharaka/al-go-rithms,ZoranPandovski/al-go-rithms,Deepak345/... | Add Graham's Scan in Python | #!/usr/bin/env python
import Tkinter as tk
from random import random
def make_a_right_turn(a, b, c):
"""Going from a to b to c involves a right turn?"""
u = (c[0] - b[0], c[1] - b[1])
v = (a[0] - b[0], a[1] - b[1])
cross_product = u[0] * v[1] - u[1] * v[0]
return cross_product < 0
def graham_s... | <commit_before><commit_msg>Add Graham's Scan in Python<commit_after> | #!/usr/bin/env python
import Tkinter as tk
from random import random
def make_a_right_turn(a, b, c):
"""Going from a to b to c involves a right turn?"""
u = (c[0] - b[0], c[1] - b[1])
v = (a[0] - b[0], a[1] - b[1])
cross_product = u[0] * v[1] - u[1] * v[0]
return cross_product < 0
def graham_s... | Add Graham's Scan in Python#!/usr/bin/env python
import Tkinter as tk
from random import random
def make_a_right_turn(a, b, c):
"""Going from a to b to c involves a right turn?"""
u = (c[0] - b[0], c[1] - b[1])
v = (a[0] - b[0], a[1] - b[1])
cross_product = u[0] * v[1] - u[1] * v[0]
return cros... | <commit_before><commit_msg>Add Graham's Scan in Python<commit_after>#!/usr/bin/env python
import Tkinter as tk
from random import random
def make_a_right_turn(a, b, c):
"""Going from a to b to c involves a right turn?"""
u = (c[0] - b[0], c[1] - b[1])
v = (a[0] - b[0], a[1] - b[1])
cross_product = u... | |
1d311f7e53ac1081d801e902d8cb1d9a0ad8d1ec | tests/compiler/test_loop_compilation.py | tests/compiler/test_loop_compilation.py | from tests.compiler import compile_local, LST_ID, IMPLICIT_ITERATOR_ID, IMPLICIT_ITERATION_ID
from thinglang.compiler.opcodes import OpcodePushLocal, OpcodeCallInternal, OpcodePopLocal, OpcodeJumpConditional, \
OpcodeJump
from thinglang.foundation.definitions import INTERNAL_TYPE_ORDERING
from thinglang.lexer.value... | Add test for iteration loop bytecode generation | Add test for iteration loop bytecode generation
| Python | mit | ytanay/thinglang,ytanay/thinglang,ytanay/thinglang,ytanay/thinglang | Add test for iteration loop bytecode generation | from tests.compiler import compile_local, LST_ID, IMPLICIT_ITERATOR_ID, IMPLICIT_ITERATION_ID
from thinglang.compiler.opcodes import OpcodePushLocal, OpcodeCallInternal, OpcodePopLocal, OpcodeJumpConditional, \
OpcodeJump
from thinglang.foundation.definitions import INTERNAL_TYPE_ORDERING
from thinglang.lexer.value... | <commit_before><commit_msg>Add test for iteration loop bytecode generation<commit_after> | from tests.compiler import compile_local, LST_ID, IMPLICIT_ITERATOR_ID, IMPLICIT_ITERATION_ID
from thinglang.compiler.opcodes import OpcodePushLocal, OpcodeCallInternal, OpcodePopLocal, OpcodeJumpConditional, \
OpcodeJump
from thinglang.foundation.definitions import INTERNAL_TYPE_ORDERING
from thinglang.lexer.value... | Add test for iteration loop bytecode generationfrom tests.compiler import compile_local, LST_ID, IMPLICIT_ITERATOR_ID, IMPLICIT_ITERATION_ID
from thinglang.compiler.opcodes import OpcodePushLocal, OpcodeCallInternal, OpcodePopLocal, OpcodeJumpConditional, \
OpcodeJump
from thinglang.foundation.definitions import IN... | <commit_before><commit_msg>Add test for iteration loop bytecode generation<commit_after>from tests.compiler import compile_local, LST_ID, IMPLICIT_ITERATOR_ID, IMPLICIT_ITERATION_ID
from thinglang.compiler.opcodes import OpcodePushLocal, OpcodeCallInternal, OpcodePopLocal, OpcodeJumpConditional, \
OpcodeJump
from t... | |
7c609188df1ef457440543beb9dc4dbf286abd87 | test/test_cache_source.py | test/test_cache_source.py | import pytest
import large_image
from large_image.cache_util import cachesClear
from .datastore import datastore
@pytest.mark.singular
def testCacheSourceStyle():
cachesClear()
imagePath = datastore.fetch('sample_image.ptif')
ts1 = large_image.open(imagePath)
ts2 = large_image.open(imagePath, style=... | Add some source cache tests. | Add some source cache tests.
| Python | apache-2.0 | girder/large_image,girder/large_image,girder/large_image | Add some source cache tests. | import pytest
import large_image
from large_image.cache_util import cachesClear
from .datastore import datastore
@pytest.mark.singular
def testCacheSourceStyle():
cachesClear()
imagePath = datastore.fetch('sample_image.ptif')
ts1 = large_image.open(imagePath)
ts2 = large_image.open(imagePath, style=... | <commit_before><commit_msg>Add some source cache tests.<commit_after> | import pytest
import large_image
from large_image.cache_util import cachesClear
from .datastore import datastore
@pytest.mark.singular
def testCacheSourceStyle():
cachesClear()
imagePath = datastore.fetch('sample_image.ptif')
ts1 = large_image.open(imagePath)
ts2 = large_image.open(imagePath, style=... | Add some source cache tests.import pytest
import large_image
from large_image.cache_util import cachesClear
from .datastore import datastore
@pytest.mark.singular
def testCacheSourceStyle():
cachesClear()
imagePath = datastore.fetch('sample_image.ptif')
ts1 = large_image.open(imagePath)
ts2 = large_... | <commit_before><commit_msg>Add some source cache tests.<commit_after>import pytest
import large_image
from large_image.cache_util import cachesClear
from .datastore import datastore
@pytest.mark.singular
def testCacheSourceStyle():
cachesClear()
imagePath = datastore.fetch('sample_image.ptif')
ts1 = lar... | |
5d58788f75a7334def3dc5a2471c9e0ed2893589 | test/item_in_init_test.py | test/item_in_init_test.py | # Copyright (c) 2012 Lars Hupfeldt Nielsen, Hupfeldt IT
# All rights reserved. This work is under a BSD license, see LICENSE.TXT.
from multiconf import mc_config, ConfigItem
from multiconf.envs import EnvFactory
ef = EnvFactory()
prod = ef.Env('prod')
def test_item_in_init_goes_to_parent():
parent = [None]
... | Test ConfigItem created in __init__ goes to parent | Test ConfigItem created in __init__ goes to parent
| Python | bsd-3-clause | lhupfeldt/multiconf | Test ConfigItem created in __init__ goes to parent | # Copyright (c) 2012 Lars Hupfeldt Nielsen, Hupfeldt IT
# All rights reserved. This work is under a BSD license, see LICENSE.TXT.
from multiconf import mc_config, ConfigItem
from multiconf.envs import EnvFactory
ef = EnvFactory()
prod = ef.Env('prod')
def test_item_in_init_goes_to_parent():
parent = [None]
... | <commit_before><commit_msg>Test ConfigItem created in __init__ goes to parent<commit_after> | # Copyright (c) 2012 Lars Hupfeldt Nielsen, Hupfeldt IT
# All rights reserved. This work is under a BSD license, see LICENSE.TXT.
from multiconf import mc_config, ConfigItem
from multiconf.envs import EnvFactory
ef = EnvFactory()
prod = ef.Env('prod')
def test_item_in_init_goes_to_parent():
parent = [None]
... | Test ConfigItem created in __init__ goes to parent# Copyright (c) 2012 Lars Hupfeldt Nielsen, Hupfeldt IT
# All rights reserved. This work is under a BSD license, see LICENSE.TXT.
from multiconf import mc_config, ConfigItem
from multiconf.envs import EnvFactory
ef = EnvFactory()
prod = ef.Env('prod')
def test_item_... | <commit_before><commit_msg>Test ConfigItem created in __init__ goes to parent<commit_after># Copyright (c) 2012 Lars Hupfeldt Nielsen, Hupfeldt IT
# All rights reserved. This work is under a BSD license, see LICENSE.TXT.
from multiconf import mc_config, ConfigItem
from multiconf.envs import EnvFactory
ef = EnvFactory... | |
8618c68046487d475c077cb30070c9080cc4fbc7 | tests/test_WOA_from_nc.py | tests/test_WOA_from_nc.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
"""
from datetime import datetime
from WOA.woa import WOA
def test_import():
# A shortcut
from WOA import WOA
db = WOA()
def test_available_vars():
db = WOA()
for v in ['TEMP', 'PSAL']:
assert v in db.keys()
def test_get_pr... | Test prototype for WOA from a netCDF file. | Test prototype for WOA from a netCDF file.
| Python | bsd-3-clause | castelao/oceansdb,castelao/pyWOA | Test prototype for WOA from a netCDF file. | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
"""
from datetime import datetime
from WOA.woa import WOA
def test_import():
# A shortcut
from WOA import WOA
db = WOA()
def test_available_vars():
db = WOA()
for v in ['TEMP', 'PSAL']:
assert v in db.keys()
def test_get_pr... | <commit_before><commit_msg>Test prototype for WOA from a netCDF file.<commit_after> | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
"""
from datetime import datetime
from WOA.woa import WOA
def test_import():
# A shortcut
from WOA import WOA
db = WOA()
def test_available_vars():
db = WOA()
for v in ['TEMP', 'PSAL']:
assert v in db.keys()
def test_get_pr... | Test prototype for WOA from a netCDF file.#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
"""
from datetime import datetime
from WOA.woa import WOA
def test_import():
# A shortcut
from WOA import WOA
db = WOA()
def test_available_vars():
db = WOA()
for v in ['TEMP', 'PSAL']:
ass... | <commit_before><commit_msg>Test prototype for WOA from a netCDF file.<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
"""
from datetime import datetime
from WOA.woa import WOA
def test_import():
# A shortcut
from WOA import WOA
db = WOA()
def test_available_vars():
db = WOA()
... | |
7593923070766f53a35d3c404523199f68accd3e | tests/test_user_config.py | tests/test_user_config.py | # -*- coding: utf-8 -*-
def test_config(testdir):
"""Make sure that pytest accepts the `cookies` fixture."""
# create a temporary pytest test module
testdir.makepyfile("""
import json
def test_user_dir(tmpdir_factory, _config_file):
basetemp = tmpdir_factory.getbasetemp()
... | Implement tests for a new _config_file fixture | Implement tests for a new _config_file fixture
| Python | mit | hackebrot/pytest-cookies | Implement tests for a new _config_file fixture | # -*- coding: utf-8 -*-
def test_config(testdir):
"""Make sure that pytest accepts the `cookies` fixture."""
# create a temporary pytest test module
testdir.makepyfile("""
import json
def test_user_dir(tmpdir_factory, _config_file):
basetemp = tmpdir_factory.getbasetemp()
... | <commit_before><commit_msg>Implement tests for a new _config_file fixture<commit_after> | # -*- coding: utf-8 -*-
def test_config(testdir):
"""Make sure that pytest accepts the `cookies` fixture."""
# create a temporary pytest test module
testdir.makepyfile("""
import json
def test_user_dir(tmpdir_factory, _config_file):
basetemp = tmpdir_factory.getbasetemp()
... | Implement tests for a new _config_file fixture# -*- coding: utf-8 -*-
def test_config(testdir):
"""Make sure that pytest accepts the `cookies` fixture."""
# create a temporary pytest test module
testdir.makepyfile("""
import json
def test_user_dir(tmpdir_factory, _config_file):
... | <commit_before><commit_msg>Implement tests for a new _config_file fixture<commit_after># -*- coding: utf-8 -*-
def test_config(testdir):
"""Make sure that pytest accepts the `cookies` fixture."""
# create a temporary pytest test module
testdir.makepyfile("""
import json
def test_user_di... | |
4973cf7fda38168c8189d77ced2ee2a2c89cadfa | py/can-place-flowers.py | py/can-place-flowers.py | from itertools import groupby
class Solution(object):
def canPlaceFlowers(self, flowerbed, n):
"""
:type flowerbed: List[int]
:type n: int
:rtype: bool
"""
prev = None
l = len(flowerbed)
for i, f in enumerate(flowerbed):
if f == 0:
... | Add py solution for 605. Can Place Flowers | Add py solution for 605. Can Place Flowers
605. Can Place Flowers: https://leetcode.com/problems/can-place-flowers/
| Python | apache-2.0 | ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode | Add py solution for 605. Can Place Flowers
605. Can Place Flowers: https://leetcode.com/problems/can-place-flowers/ | from itertools import groupby
class Solution(object):
def canPlaceFlowers(self, flowerbed, n):
"""
:type flowerbed: List[int]
:type n: int
:rtype: bool
"""
prev = None
l = len(flowerbed)
for i, f in enumerate(flowerbed):
if f == 0:
... | <commit_before><commit_msg>Add py solution for 605. Can Place Flowers
605. Can Place Flowers: https://leetcode.com/problems/can-place-flowers/<commit_after> | from itertools import groupby
class Solution(object):
def canPlaceFlowers(self, flowerbed, n):
"""
:type flowerbed: List[int]
:type n: int
:rtype: bool
"""
prev = None
l = len(flowerbed)
for i, f in enumerate(flowerbed):
if f == 0:
... | Add py solution for 605. Can Place Flowers
605. Can Place Flowers: https://leetcode.com/problems/can-place-flowers/from itertools import groupby
class Solution(object):
def canPlaceFlowers(self, flowerbed, n):
"""
:type flowerbed: List[int]
:type n: int
:rtype: bool
"""
... | <commit_before><commit_msg>Add py solution for 605. Can Place Flowers
605. Can Place Flowers: https://leetcode.com/problems/can-place-flowers/<commit_after>from itertools import groupby
class Solution(object):
def canPlaceFlowers(self, flowerbed, n):
"""
:type flowerbed: List[int]
:type n: ... | |
5dc2ad1bf129ba2b4f77602678f8e62d26d132a9 | utils/add_sample_feeds.py | utils/add_sample_feeds.py | from smoke_signal import app, init_db
from smoke_signal.database.helpers import add_feed
from utils.generate_feed import SampleFeed
from os import walk
feeds_dir = app.root_path + "/test_resources/feeds/"
app.config['DATABASE_PATH'] = 'sqlite:///smoke_signal/test_resources/posts.db'
def create_sample_feed_files(nu... | Add new utility script to add sample feeds as files | Add new utility script to add sample feeds as files
| Python | mit | flacerdk/smoke-signal,flacerdk/smoke-signal,flacerdk/smoke-signal | Add new utility script to add sample feeds as files | from smoke_signal import app, init_db
from smoke_signal.database.helpers import add_feed
from utils.generate_feed import SampleFeed
from os import walk
feeds_dir = app.root_path + "/test_resources/feeds/"
app.config['DATABASE_PATH'] = 'sqlite:///smoke_signal/test_resources/posts.db'
def create_sample_feed_files(nu... | <commit_before><commit_msg>Add new utility script to add sample feeds as files<commit_after> | from smoke_signal import app, init_db
from smoke_signal.database.helpers import add_feed
from utils.generate_feed import SampleFeed
from os import walk
feeds_dir = app.root_path + "/test_resources/feeds/"
app.config['DATABASE_PATH'] = 'sqlite:///smoke_signal/test_resources/posts.db'
def create_sample_feed_files(nu... | Add new utility script to add sample feeds as filesfrom smoke_signal import app, init_db
from smoke_signal.database.helpers import add_feed
from utils.generate_feed import SampleFeed
from os import walk
feeds_dir = app.root_path + "/test_resources/feeds/"
app.config['DATABASE_PATH'] = 'sqlite:///smoke_signal/test_re... | <commit_before><commit_msg>Add new utility script to add sample feeds as files<commit_after>from smoke_signal import app, init_db
from smoke_signal.database.helpers import add_feed
from utils.generate_feed import SampleFeed
from os import walk
feeds_dir = app.root_path + "/test_resources/feeds/"
app.config['DATABASE... | |
399568bbb0c88b2aa3919ac3552483a9dd8f01ab | python/examples/instruction-iterator.py | python/examples/instruction-iterator.py | #!/usr/bin/env python
import sys
try:
import binaryninja
except ImportError:
sys.path.append("/Applications/Binary Ninja.app/Contents/Resources/python/")
import binaryninja
import time
if sys.platform.lower().startswith("linux"):
bintype="ELF"
elif sys.platform.lower() == "darwin":
bintype="Mach-O"
else... | Add an example that uses the interators | Add an example that uses the interators
| Python | mit | Vector35/binaryninja-api,Vector35/binaryninja-api,joshwatson/binaryninja-api,Vector35/binaryninja-api,Vector35/binaryninja-api,joshwatson/binaryninja-api,joshwatson/binaryninja-api,joshwatson/binaryninja-api,Vector35/binaryninja-api,joshwatson/binaryninja-api,Vector35/binaryninja-api,Vector35/binaryninja-api | Add an example that uses the interators | #!/usr/bin/env python
import sys
try:
import binaryninja
except ImportError:
sys.path.append("/Applications/Binary Ninja.app/Contents/Resources/python/")
import binaryninja
import time
if sys.platform.lower().startswith("linux"):
bintype="ELF"
elif sys.platform.lower() == "darwin":
bintype="Mach-O"
else... | <commit_before><commit_msg>Add an example that uses the interators<commit_after> | #!/usr/bin/env python
import sys
try:
import binaryninja
except ImportError:
sys.path.append("/Applications/Binary Ninja.app/Contents/Resources/python/")
import binaryninja
import time
if sys.platform.lower().startswith("linux"):
bintype="ELF"
elif sys.platform.lower() == "darwin":
bintype="Mach-O"
else... | Add an example that uses the interators#!/usr/bin/env python
import sys
try:
import binaryninja
except ImportError:
sys.path.append("/Applications/Binary Ninja.app/Contents/Resources/python/")
import binaryninja
import time
if sys.platform.lower().startswith("linux"):
bintype="ELF"
elif sys.platform.lowe... | <commit_before><commit_msg>Add an example that uses the interators<commit_after>#!/usr/bin/env python
import sys
try:
import binaryninja
except ImportError:
sys.path.append("/Applications/Binary Ninja.app/Contents/Resources/python/")
import binaryninja
import time
if sys.platform.lower().startswith("linux... | |
214c81265db7dc23a805717126fad6f97d391fe8 | scripts/markers/mark_error_105.py | scripts/markers/mark_error_105.py | """Marks all fixed errors #105 on ruwiki's CheckWikipedia."""
import re
import pywikibot
from checkwiki import load_page_list, mark_error_done, log
NUMBER = "105"
def main():
"""Main script function."""
site = pywikibot.Site()
for pagename in load_page_list(NUMBER):
page = pywikibot.Page(site, pag... | Add marker for 105 error | Add marker for 105 error
| Python | mit | Facenapalm/NapalmBot | Add marker for 105 error | """Marks all fixed errors #105 on ruwiki's CheckWikipedia."""
import re
import pywikibot
from checkwiki import load_page_list, mark_error_done, log
NUMBER = "105"
def main():
"""Main script function."""
site = pywikibot.Site()
for pagename in load_page_list(NUMBER):
page = pywikibot.Page(site, pag... | <commit_before><commit_msg>Add marker for 105 error<commit_after> | """Marks all fixed errors #105 on ruwiki's CheckWikipedia."""
import re
import pywikibot
from checkwiki import load_page_list, mark_error_done, log
NUMBER = "105"
def main():
"""Main script function."""
site = pywikibot.Site()
for pagename in load_page_list(NUMBER):
page = pywikibot.Page(site, pag... | Add marker for 105 error"""Marks all fixed errors #105 on ruwiki's CheckWikipedia."""
import re
import pywikibot
from checkwiki import load_page_list, mark_error_done, log
NUMBER = "105"
def main():
"""Main script function."""
site = pywikibot.Site()
for pagename in load_page_list(NUMBER):
page = ... | <commit_before><commit_msg>Add marker for 105 error<commit_after>"""Marks all fixed errors #105 on ruwiki's CheckWikipedia."""
import re
import pywikibot
from checkwiki import load_page_list, mark_error_done, log
NUMBER = "105"
def main():
"""Main script function."""
site = pywikibot.Site()
for pagename i... | |
54c5f4f476cebec063652f5e4c6acd30bf2dee2e | nova/tests/unit/cmd/test_cmd_db_blocks.py | nova/tests/unit/cmd/test_cmd_db_blocks.py | # Copyright 2016 Red Hat
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, soft... | Add test for nova-compute and nova-network main database blocks | Add test for nova-compute and nova-network main database blocks
We block the database objects when conductor is not local for compute
and network, but we don't test this code anywhere because it's in the
main() function of the actual executable.
Fix that.
Change-Id: I5b9343d30e6b4aedb05f0731ba9bdca51d408ba9
| Python | apache-2.0 | klmitch/nova,gooddata/openstack-nova,hanlind/nova,mahak/nova,Juniper/nova,phenoxim/nova,vmturbo/nova,phenoxim/nova,mahak/nova,vmturbo/nova,rajalokan/nova,rajalokan/nova,openstack/nova,mikalstill/nova,gooddata/openstack-nova,mikalstill/nova,alaski/nova,sebrandon1/nova,sebrandon1/nova,openstack/nova,alaski/nova,mahak/nov... | Add test for nova-compute and nova-network main database blocks
We block the database objects when conductor is not local for compute
and network, but we don't test this code anywhere because it's in the
main() function of the actual executable.
Fix that.
Change-Id: I5b9343d30e6b4aedb05f0731ba9bdca51d408ba9 | # Copyright 2016 Red Hat
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, soft... | <commit_before><commit_msg>Add test for nova-compute and nova-network main database blocks
We block the database objects when conductor is not local for compute
and network, but we don't test this code anywhere because it's in the
main() function of the actual executable.
Fix that.
Change-Id: I5b9343d30e6b4aedb05f07... | # Copyright 2016 Red Hat
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, soft... | Add test for nova-compute and nova-network main database blocks
We block the database objects when conductor is not local for compute
and network, but we don't test this code anywhere because it's in the
main() function of the actual executable.
Fix that.
Change-Id: I5b9343d30e6b4aedb05f0731ba9bdca51d408ba9# Copyrig... | <commit_before><commit_msg>Add test for nova-compute and nova-network main database blocks
We block the database objects when conductor is not local for compute
and network, but we don't test this code anywhere because it's in the
main() function of the actual executable.
Fix that.
Change-Id: I5b9343d30e6b4aedb05f07... | |
86c13905a616fe74ea1264b3e462ada3ca7b4e04 | tests/test_clickthrough.py | tests/test_clickthrough.py | import openliveq as olq
import os
class TestClickthrough(object):
def test_load(self):
filepath = os.path.join(os.path.dirname(__file__),
"fixtures", "sample_clickthrough.tsv")
cs = []
with open(filepath) as f:
for line in f:
c = olq.Clickthrough.rea... | Add a test for clickthrough | Add a test for clickthrough
| Python | mit | mpkato/openliveq | Add a test for clickthrough | import openliveq as olq
import os
class TestClickthrough(object):
def test_load(self):
filepath = os.path.join(os.path.dirname(__file__),
"fixtures", "sample_clickthrough.tsv")
cs = []
with open(filepath) as f:
for line in f:
c = olq.Clickthrough.rea... | <commit_before><commit_msg>Add a test for clickthrough<commit_after> | import openliveq as olq
import os
class TestClickthrough(object):
def test_load(self):
filepath = os.path.join(os.path.dirname(__file__),
"fixtures", "sample_clickthrough.tsv")
cs = []
with open(filepath) as f:
for line in f:
c = olq.Clickthrough.rea... | Add a test for clickthroughimport openliveq as olq
import os
class TestClickthrough(object):
def test_load(self):
filepath = os.path.join(os.path.dirname(__file__),
"fixtures", "sample_clickthrough.tsv")
cs = []
with open(filepath) as f:
for line in f:
... | <commit_before><commit_msg>Add a test for clickthrough<commit_after>import openliveq as olq
import os
class TestClickthrough(object):
def test_load(self):
filepath = os.path.join(os.path.dirname(__file__),
"fixtures", "sample_clickthrough.tsv")
cs = []
with open(filepath) as f:... | |
8c4e58fac4d1d020ac2da38441067959100690a5 | yunity/tests/integration/test_python.py | yunity/tests/integration/test_python.py | from importlib import import_module, reload
from os.path import join as join_path, dirname
from os import walk
from sys import modules
from yunity.utils.tests.abc import BaseTestCase
import yunity
def _path_to_module(path, root_module_path, pysuffix='.py'):
path = path[len(dirname(root_module_path)) + 1:-len(pys... | Add expectation that all Python code is correct | Add expectation that all Python code is correct
| Python | agpl-3.0 | yunity/yunity-core,yunity/foodsaving-backend,yunity/foodsaving-backend,yunity/foodsaving-backend,yunity/yunity-core | Add expectation that all Python code is correct | from importlib import import_module, reload
from os.path import join as join_path, dirname
from os import walk
from sys import modules
from yunity.utils.tests.abc import BaseTestCase
import yunity
def _path_to_module(path, root_module_path, pysuffix='.py'):
path = path[len(dirname(root_module_path)) + 1:-len(pys... | <commit_before><commit_msg>Add expectation that all Python code is correct<commit_after> | from importlib import import_module, reload
from os.path import join as join_path, dirname
from os import walk
from sys import modules
from yunity.utils.tests.abc import BaseTestCase
import yunity
def _path_to_module(path, root_module_path, pysuffix='.py'):
path = path[len(dirname(root_module_path)) + 1:-len(pys... | Add expectation that all Python code is correctfrom importlib import import_module, reload
from os.path import join as join_path, dirname
from os import walk
from sys import modules
from yunity.utils.tests.abc import BaseTestCase
import yunity
def _path_to_module(path, root_module_path, pysuffix='.py'):
path = p... | <commit_before><commit_msg>Add expectation that all Python code is correct<commit_after>from importlib import import_module, reload
from os.path import join as join_path, dirname
from os import walk
from sys import modules
from yunity.utils.tests.abc import BaseTestCase
import yunity
def _path_to_module(path, root_m... | |
87fdc8ab59baa989d57c482085d67fb139573313 | test/test_get_name.py | test/test_get_name.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015-2015: Alignak team, see AUTHORS.txt file for contributors
#
# This file is part of Alignak.
#
# Alignak is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free So... | Test - Trigger AttributeError with an get_name call in daemonlinks | Enh: Test - Trigger AttributeError with an get_name call in daemonlinks
| Python | agpl-3.0 | titilambert/alignak,Alignak-monitoring/alignak,gst/alignak,titilambert/alignak,Alignak-monitoring/alignak,gst/alignak,gst/alignak,titilambert/alignak,titilambert/alignak,gst/alignak | Enh: Test - Trigger AttributeError with an get_name call in daemonlinks | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015-2015: Alignak team, see AUTHORS.txt file for contributors
#
# This file is part of Alignak.
#
# Alignak is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free So... | <commit_before><commit_msg>Enh: Test - Trigger AttributeError with an get_name call in daemonlinks<commit_after> | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015-2015: Alignak team, see AUTHORS.txt file for contributors
#
# This file is part of Alignak.
#
# Alignak is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free So... | Enh: Test - Trigger AttributeError with an get_name call in daemonlinks#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015-2015: Alignak team, see AUTHORS.txt file for contributors
#
# This file is part of Alignak.
#
# Alignak is free software: you can redistribute it and/or modify
# it under the terms... | <commit_before><commit_msg>Enh: Test - Trigger AttributeError with an get_name call in daemonlinks<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015-2015: Alignak team, see AUTHORS.txt file for contributors
#
# This file is part of Alignak.
#
# Alignak is free software: you can redistrib... | |
d0f92caf504e78a3fd7257ac9fab1fbd9c039212 | distarray/tests/test_testing.py | distarray/tests/test_testing.py | # encoding: utf-8
# ---------------------------------------------------------------------------
# Copyright (C) 2008-2014, IPython Development Team and Enthought, Inc.
# Distributed under the terms of the BSD License. See COPYING.rst.
# ---------------------------------------------------------------------------
imp... | Add simple tests for DAP validator wrappers. | Add simple tests for DAP validator wrappers.
Incidentally, add the test file `distarray/tests/test_testing.py`. | Python | bsd-3-clause | enthought/distarray,RaoUmer/distarray,enthought/distarray,RaoUmer/distarray | Add simple tests for DAP validator wrappers.
Incidentally, add the test file `distarray/tests/test_testing.py`. | # encoding: utf-8
# ---------------------------------------------------------------------------
# Copyright (C) 2008-2014, IPython Development Team and Enthought, Inc.
# Distributed under the terms of the BSD License. See COPYING.rst.
# ---------------------------------------------------------------------------
imp... | <commit_before><commit_msg>Add simple tests for DAP validator wrappers.
Incidentally, add the test file `distarray/tests/test_testing.py`.<commit_after> | # encoding: utf-8
# ---------------------------------------------------------------------------
# Copyright (C) 2008-2014, IPython Development Team and Enthought, Inc.
# Distributed under the terms of the BSD License. See COPYING.rst.
# ---------------------------------------------------------------------------
imp... | Add simple tests for DAP validator wrappers.
Incidentally, add the test file `distarray/tests/test_testing.py`.# encoding: utf-8
# ---------------------------------------------------------------------------
# Copyright (C) 2008-2014, IPython Development Team and Enthought, Inc.
# Distributed under the terms of the B... | <commit_before><commit_msg>Add simple tests for DAP validator wrappers.
Incidentally, add the test file `distarray/tests/test_testing.py`.<commit_after># encoding: utf-8
# ---------------------------------------------------------------------------
# Copyright (C) 2008-2014, IPython Development Team and Enthought, Inc... | |
6dfa189bdab536ecfa2c14e4893017363923ee6a | bayes.py | bayes.py | import numpy as np
import cv2
# pos and neg are positive and negative instances
# each is a list of files of nparray dumps,
# nparray of BoW histograms; shape = (n, 101)
# of the class to be trained for
def build_trained_classifier(pos_files, neg_files):
total = len(pos_files) + len(neg_files)
samples = np.emp... | Implement Naive Bayes Classifier builder method | Implement Naive Bayes Classifier builder method
| Python | mit | ah450/ObjectRecognizer | Implement Naive Bayes Classifier builder method | import numpy as np
import cv2
# pos and neg are positive and negative instances
# each is a list of files of nparray dumps,
# nparray of BoW histograms; shape = (n, 101)
# of the class to be trained for
def build_trained_classifier(pos_files, neg_files):
total = len(pos_files) + len(neg_files)
samples = np.emp... | <commit_before><commit_msg>Implement Naive Bayes Classifier builder method<commit_after> | import numpy as np
import cv2
# pos and neg are positive and negative instances
# each is a list of files of nparray dumps,
# nparray of BoW histograms; shape = (n, 101)
# of the class to be trained for
def build_trained_classifier(pos_files, neg_files):
total = len(pos_files) + len(neg_files)
samples = np.emp... | Implement Naive Bayes Classifier builder methodimport numpy as np
import cv2
# pos and neg are positive and negative instances
# each is a list of files of nparray dumps,
# nparray of BoW histograms; shape = (n, 101)
# of the class to be trained for
def build_trained_classifier(pos_files, neg_files):
total = len(p... | <commit_before><commit_msg>Implement Naive Bayes Classifier builder method<commit_after>import numpy as np
import cv2
# pos and neg are positive and negative instances
# each is a list of files of nparray dumps,
# nparray of BoW histograms; shape = (n, 101)
# of the class to be trained for
def build_trained_classifier... | |
71b6246dda3e4812490a5c2936eac44e063806c0 | tests/test_sonify.py | tests/test_sonify.py | """ Unit tests for sonification methods """
import mir_eval
import numpy as np
def test_clicks():
# Test output length for a variety of parameter settings
for times in [np.array([1.]), np.arange(10)*1.]:
for fs in [8000, 44100]:
click_signal = mir_eval.sonify.clicks(times, fs)
... | Add tests for sonify submodule | Add tests for sonify submodule
| Python | mit | faroit/mir_eval,faroit/mir_eval,bmcfee/mir_eval,craffel/mir_eval,bmcfee/mir_eval,rabitt/mir_eval,craffel/mir_eval,rabitt/mir_eval | Add tests for sonify submodule | """ Unit tests for sonification methods """
import mir_eval
import numpy as np
def test_clicks():
# Test output length for a variety of parameter settings
for times in [np.array([1.]), np.arange(10)*1.]:
for fs in [8000, 44100]:
click_signal = mir_eval.sonify.clicks(times, fs)
... | <commit_before><commit_msg>Add tests for sonify submodule<commit_after> | """ Unit tests for sonification methods """
import mir_eval
import numpy as np
def test_clicks():
# Test output length for a variety of parameter settings
for times in [np.array([1.]), np.arange(10)*1.]:
for fs in [8000, 44100]:
click_signal = mir_eval.sonify.clicks(times, fs)
... | Add tests for sonify submodule""" Unit tests for sonification methods """
import mir_eval
import numpy as np
def test_clicks():
# Test output length for a variety of parameter settings
for times in [np.array([1.]), np.arange(10)*1.]:
for fs in [8000, 44100]:
click_signal = mir_eval.sonify... | <commit_before><commit_msg>Add tests for sonify submodule<commit_after>""" Unit tests for sonification methods """
import mir_eval
import numpy as np
def test_clicks():
# Test output length for a variety of parameter settings
for times in [np.array([1.]), np.arange(10)*1.]:
for fs in [8000, 44100]:
... | |
f46361d1009665e87543b56d69212b04b9b14993 | VehicleDetectionTracking/histo_colors.py | VehicleDetectionTracking/histo_colors.py | # Code given by Udacity, complete by Andres Guijarro
# Purpose: Define a function to compute color histogram features
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
image = mpimg.imread('cutout1.jpg')
# Define a function to compute color histogram features
def color_hist(img, n... | Add scripts which Define a function to compute color histogram features | feat: Add scripts which Define a function to compute color histogram features
| Python | mit | aguijarro/SelfDrivingCar | feat: Add scripts which Define a function to compute color histogram features | # Code given by Udacity, complete by Andres Guijarro
# Purpose: Define a function to compute color histogram features
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
image = mpimg.imread('cutout1.jpg')
# Define a function to compute color histogram features
def color_hist(img, n... | <commit_before><commit_msg>feat: Add scripts which Define a function to compute color histogram features<commit_after> | # Code given by Udacity, complete by Andres Guijarro
# Purpose: Define a function to compute color histogram features
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
image = mpimg.imread('cutout1.jpg')
# Define a function to compute color histogram features
def color_hist(img, n... | feat: Add scripts which Define a function to compute color histogram features# Code given by Udacity, complete by Andres Guijarro
# Purpose: Define a function to compute color histogram features
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
image = mpimg.imread('cutout1.jpg')
# ... | <commit_before><commit_msg>feat: Add scripts which Define a function to compute color histogram features<commit_after># Code given by Udacity, complete by Andres Guijarro
# Purpose: Define a function to compute color histogram features
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.image as mpimg... | |
a2e18f9b10e5e6bbcad6c13cdc5c76047d319fc2 | python/tests/test_pv_composite_wavelet.py | python/tests/test_pv_composite_wavelet.py | # -----------------------------------------------------------------------------
# User configuration
# -----------------------------------------------------------------------------
outputDir = '/Users/seb/Desktop/float-image/'
# -----------------------------------------------------------------------------
from paravie... | Add fake limited composite example | Add fake limited composite example
| Python | bsd-3-clause | Kitware/tonic-data-generator,Kitware/tonic-data-generator | Add fake limited composite example | # -----------------------------------------------------------------------------
# User configuration
# -----------------------------------------------------------------------------
outputDir = '/Users/seb/Desktop/float-image/'
# -----------------------------------------------------------------------------
from paravie... | <commit_before><commit_msg>Add fake limited composite example<commit_after> | # -----------------------------------------------------------------------------
# User configuration
# -----------------------------------------------------------------------------
outputDir = '/Users/seb/Desktop/float-image/'
# -----------------------------------------------------------------------------
from paravie... | Add fake limited composite example# -----------------------------------------------------------------------------
# User configuration
# -----------------------------------------------------------------------------
outputDir = '/Users/seb/Desktop/float-image/'
# ---------------------------------------------------------... | <commit_before><commit_msg>Add fake limited composite example<commit_after># -----------------------------------------------------------------------------
# User configuration
# -----------------------------------------------------------------------------
outputDir = '/Users/seb/Desktop/float-image/'
# ----------------... | |
6a2bd578cc22231bce66a4d110b4ff1536743097 | dataactcore/migrations/versions/7597deb348fb_fabs_created_at_and_fpds_updated_at_.py | dataactcore/migrations/versions/7597deb348fb_fabs_created_at_and_fpds_updated_at_.py | """FABS created_at and FPDS updated_at indexes
Revision ID: 7597deb348fb
Revises: b168f0cdc5a8
Create Date: 2018-02-06 16:08:20.985202
"""
# revision identifiers, used by Alembic.
revision = '7597deb348fb'
down_revision = 'b168f0cdc5a8'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy... | Add index to the `created_at` column in `published_award_financial_assistance` and the `updated_at` column in `detached_award_procurement` | Add index to the `created_at` column in `published_award_financial_assistance` and the `updated_at` column in `detached_award_procurement`
| Python | cc0-1.0 | fedspendingtransparency/data-act-broker-backend,fedspendingtransparency/data-act-broker-backend | Add index to the `created_at` column in `published_award_financial_assistance` and the `updated_at` column in `detached_award_procurement` | """FABS created_at and FPDS updated_at indexes
Revision ID: 7597deb348fb
Revises: b168f0cdc5a8
Create Date: 2018-02-06 16:08:20.985202
"""
# revision identifiers, used by Alembic.
revision = '7597deb348fb'
down_revision = 'b168f0cdc5a8'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy... | <commit_before><commit_msg>Add index to the `created_at` column in `published_award_financial_assistance` and the `updated_at` column in `detached_award_procurement`<commit_after> | """FABS created_at and FPDS updated_at indexes
Revision ID: 7597deb348fb
Revises: b168f0cdc5a8
Create Date: 2018-02-06 16:08:20.985202
"""
# revision identifiers, used by Alembic.
revision = '7597deb348fb'
down_revision = 'b168f0cdc5a8'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy... | Add index to the `created_at` column in `published_award_financial_assistance` and the `updated_at` column in `detached_award_procurement`"""FABS created_at and FPDS updated_at indexes
Revision ID: 7597deb348fb
Revises: b168f0cdc5a8
Create Date: 2018-02-06 16:08:20.985202
"""
# revision identifiers, used by Alembic.... | <commit_before><commit_msg>Add index to the `created_at` column in `published_award_financial_assistance` and the `updated_at` column in `detached_award_procurement`<commit_after>"""FABS created_at and FPDS updated_at indexes
Revision ID: 7597deb348fb
Revises: b168f0cdc5a8
Create Date: 2018-02-06 16:08:20.985202
"""
... | |
29d0797540461f8c021ecad6e5d1e724dcc3e378 | tardis/tests/tests_slow/runner.py | tardis/tests/tests_slow/runner.py | import time
import subprocess
if __name__ == "__main__":
while True:
subprocess.call([
"python", "setup.py", "test", "--test-path=tardis/tests/test_util.py",
])
time.sleep(20)
| Make a simple infinite while loop to run tests. | Make a simple infinite while loop to run tests.
| Python | bsd-3-clause | orbitfold/tardis,kaushik94/tardis,kaushik94/tardis,orbitfold/tardis,orbitfold/tardis,orbitfold/tardis,kaushik94/tardis,kaushik94/tardis | Make a simple infinite while loop to run tests. | import time
import subprocess
if __name__ == "__main__":
while True:
subprocess.call([
"python", "setup.py", "test", "--test-path=tardis/tests/test_util.py",
])
time.sleep(20)
| <commit_before><commit_msg>Make a simple infinite while loop to run tests.<commit_after> | import time
import subprocess
if __name__ == "__main__":
while True:
subprocess.call([
"python", "setup.py", "test", "--test-path=tardis/tests/test_util.py",
])
time.sleep(20)
| Make a simple infinite while loop to run tests.import time
import subprocess
if __name__ == "__main__":
while True:
subprocess.call([
"python", "setup.py", "test", "--test-path=tardis/tests/test_util.py",
])
time.sleep(20)
| <commit_before><commit_msg>Make a simple infinite while loop to run tests.<commit_after>import time
import subprocess
if __name__ == "__main__":
while True:
subprocess.call([
"python", "setup.py", "test", "--test-path=tardis/tests/test_util.py",
])
time.sleep(20)
| |
9013f072a8b82ab65ad2c599fe331f7835ebee47 | {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_urls.py | {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/tests/test_urls.py | from django.core.urlresolvers import reverse, resolve
from test_plus.test import TestCase
class TestUserURLs(TestCase):
"""Test URL patterns for users app."""
def setUp(self):
self.user = self.make_user()
def test_list_reverse(self):
"""users:list should reverse to /users/."""
s... | Test users app URL patterns | Test users app URL patterns
For the sake of completeness, and since regular expressions can be error-prone. | Python | bsd-3-clause | hackebrot/cookiecutter-django,topwebmaster/cookiecutter-django,trungdong/cookiecutter-django,thisjustin/cookiecutter-django,luzfcb/cookiecutter-django,webyneter/cookiecutter-django,aleprovencio/cookiecutter-django,hackebrot/cookiecutter-django,hairychris/cookiecutter-django,gappsexperts/cookiecutter-django,asyncee/cook... | Test users app URL patterns
For the sake of completeness, and since regular expressions can be error-prone. | from django.core.urlresolvers import reverse, resolve
from test_plus.test import TestCase
class TestUserURLs(TestCase):
"""Test URL patterns for users app."""
def setUp(self):
self.user = self.make_user()
def test_list_reverse(self):
"""users:list should reverse to /users/."""
s... | <commit_before><commit_msg>Test users app URL patterns
For the sake of completeness, and since regular expressions can be error-prone.<commit_after> | from django.core.urlresolvers import reverse, resolve
from test_plus.test import TestCase
class TestUserURLs(TestCase):
"""Test URL patterns for users app."""
def setUp(self):
self.user = self.make_user()
def test_list_reverse(self):
"""users:list should reverse to /users/."""
s... | Test users app URL patterns
For the sake of completeness, and since regular expressions can be error-prone.from django.core.urlresolvers import reverse, resolve
from test_plus.test import TestCase
class TestUserURLs(TestCase):
"""Test URL patterns for users app."""
def setUp(self):
self.user = self... | <commit_before><commit_msg>Test users app URL patterns
For the sake of completeness, and since regular expressions can be error-prone.<commit_after>from django.core.urlresolvers import reverse, resolve
from test_plus.test import TestCase
class TestUserURLs(TestCase):
"""Test URL patterns for users app."""
... | |
e7685951e1d271b07df0e4a0681a2404806f4028 | InvenTree/stock/test_api.py | InvenTree/stock/test_api.py | from rest_framework.test import APITestCase
from rest_framework import status
from django.urls import reverse
from django.contrib.auth import get_user_model
from .models import StockLocation, StockItem
class StockLocationTest(APITestCase):
"""
Series of API tests for the StockLocation API
"""
list_u... | Add (simple) test cases for Stock API | Add (simple) test cases for Stock API
- Still a lot of work to do here
| Python | mit | SchrodingersGat/InvenTree,SchrodingersGat/InvenTree,SchrodingersGat/InvenTree,inventree/InvenTree,SchrodingersGat/InvenTree,inventree/InvenTree,inventree/InvenTree,inventree/InvenTree | Add (simple) test cases for Stock API
- Still a lot of work to do here | from rest_framework.test import APITestCase
from rest_framework import status
from django.urls import reverse
from django.contrib.auth import get_user_model
from .models import StockLocation, StockItem
class StockLocationTest(APITestCase):
"""
Series of API tests for the StockLocation API
"""
list_u... | <commit_before><commit_msg>Add (simple) test cases for Stock API
- Still a lot of work to do here<commit_after> | from rest_framework.test import APITestCase
from rest_framework import status
from django.urls import reverse
from django.contrib.auth import get_user_model
from .models import StockLocation, StockItem
class StockLocationTest(APITestCase):
"""
Series of API tests for the StockLocation API
"""
list_u... | Add (simple) test cases for Stock API
- Still a lot of work to do herefrom rest_framework.test import APITestCase
from rest_framework import status
from django.urls import reverse
from django.contrib.auth import get_user_model
from .models import StockLocation, StockItem
class StockLocationTest(APITestCase):
""... | <commit_before><commit_msg>Add (simple) test cases for Stock API
- Still a lot of work to do here<commit_after>from rest_framework.test import APITestCase
from rest_framework import status
from django.urls import reverse
from django.contrib.auth import get_user_model
from .models import StockLocation, StockItem
cla... | |
5c142d7e7a311013dd940a6d6900b5d9984dc0fe | python/dynamic_image_meme.py | python/dynamic_image_meme.py | import requests
import json
# Dynamically create a 300x300 PNG image with a yellow background and draw some text on the center of it later.
# Refer to https://pixlab.io/#/cmd?id=newimage && https://pixlab.io/#/cmd?id=drawtext for additional information.
req = requests.get('https://api.pixlab.io/newimage',params={
'k... | Create dynamic image & draw some text on it | Create dynamic image & draw some text on it | Python | bsd-2-clause | symisc/pixlab,symisc/pixlab,symisc/pixlab | Create dynamic image & draw some text on it | import requests
import json
# Dynamically create a 300x300 PNG image with a yellow background and draw some text on the center of it later.
# Refer to https://pixlab.io/#/cmd?id=newimage && https://pixlab.io/#/cmd?id=drawtext for additional information.
req = requests.get('https://api.pixlab.io/newimage',params={
'k... | <commit_before><commit_msg>Create dynamic image & draw some text on it<commit_after> | import requests
import json
# Dynamically create a 300x300 PNG image with a yellow background and draw some text on the center of it later.
# Refer to https://pixlab.io/#/cmd?id=newimage && https://pixlab.io/#/cmd?id=drawtext for additional information.
req = requests.get('https://api.pixlab.io/newimage',params={
'k... | Create dynamic image & draw some text on itimport requests
import json
# Dynamically create a 300x300 PNG image with a yellow background and draw some text on the center of it later.
# Refer to https://pixlab.io/#/cmd?id=newimage && https://pixlab.io/#/cmd?id=drawtext for additional information.
req = requests.get('h... | <commit_before><commit_msg>Create dynamic image & draw some text on it<commit_after>import requests
import json
# Dynamically create a 300x300 PNG image with a yellow background and draw some text on the center of it later.
# Refer to https://pixlab.io/#/cmd?id=newimage && https://pixlab.io/#/cmd?id=drawtext for addit... | |
88877163201ce32d28633b833e1ec17cd3429650 | python/misc/clean-sms-mms.py | python/misc/clean-sms-mms.py | #!/usr/bin/env python3
''' Deletes old messages from a backup file created by Titanium Backup Pro
'''
import datetime
import lxml.etree
import shutil
import sys
MAXIMUM_MESSAGE_AGE_IN_DAYS = 365
if len(sys.argv) < 2:
sys.exit('USAGE: %s /path/to/com.keramidas.virtual.XML_MESSAGES-XXXXXXXX-XXXXXX.xml' % (sys.arg... | Add script for cleaning up old SMS/MMS text messages | Add script for cleaning up old SMS/MMS text messages
| Python | mit | bmaupin/junkpile,bmaupin/junkpile,bmaupin/junkpile,bmaupin/junkpile,bmaupin/junkpile,bmaupin/junkpile,bmaupin/junkpile,bmaupin/junkpile,bmaupin/junkpile | Add script for cleaning up old SMS/MMS text messages | #!/usr/bin/env python3
''' Deletes old messages from a backup file created by Titanium Backup Pro
'''
import datetime
import lxml.etree
import shutil
import sys
MAXIMUM_MESSAGE_AGE_IN_DAYS = 365
if len(sys.argv) < 2:
sys.exit('USAGE: %s /path/to/com.keramidas.virtual.XML_MESSAGES-XXXXXXXX-XXXXXX.xml' % (sys.arg... | <commit_before><commit_msg>Add script for cleaning up old SMS/MMS text messages<commit_after> | #!/usr/bin/env python3
''' Deletes old messages from a backup file created by Titanium Backup Pro
'''
import datetime
import lxml.etree
import shutil
import sys
MAXIMUM_MESSAGE_AGE_IN_DAYS = 365
if len(sys.argv) < 2:
sys.exit('USAGE: %s /path/to/com.keramidas.virtual.XML_MESSAGES-XXXXXXXX-XXXXXX.xml' % (sys.arg... | Add script for cleaning up old SMS/MMS text messages#!/usr/bin/env python3
''' Deletes old messages from a backup file created by Titanium Backup Pro
'''
import datetime
import lxml.etree
import shutil
import sys
MAXIMUM_MESSAGE_AGE_IN_DAYS = 365
if len(sys.argv) < 2:
sys.exit('USAGE: %s /path/to/com.keramidas.... | <commit_before><commit_msg>Add script for cleaning up old SMS/MMS text messages<commit_after>#!/usr/bin/env python3
''' Deletes old messages from a backup file created by Titanium Backup Pro
'''
import datetime
import lxml.etree
import shutil
import sys
MAXIMUM_MESSAGE_AGE_IN_DAYS = 365
if len(sys.argv) < 2:
sy... | |
ba907a0c12c5bf90fa796d36fe18218df12281ae | printers.py | printers.py | import gdb
import re
class ShortVectorPrinter:
def __init__(self, val):
self.val = val
def to_string(self):
size = int(self.val['_size'])
N = int(self.val.type.template_argument(1))
cap = N if size <= N else int(self.val['_capacity'])
return 'MArray::short_vector<%d> o... | Add GDB pretty-printer for short_vector<T,N> | Add GDB pretty-printer for short_vector<T,N>
| Python | bsd-3-clause | devinamatthews/marray,devinamatthews/marray,devinamatthews/marray | Add GDB pretty-printer for short_vector<T,N> | import gdb
import re
class ShortVectorPrinter:
def __init__(self, val):
self.val = val
def to_string(self):
size = int(self.val['_size'])
N = int(self.val.type.template_argument(1))
cap = N if size <= N else int(self.val['_capacity'])
return 'MArray::short_vector<%d> o... | <commit_before><commit_msg>Add GDB pretty-printer for short_vector<T,N><commit_after> | import gdb
import re
class ShortVectorPrinter:
def __init__(self, val):
self.val = val
def to_string(self):
size = int(self.val['_size'])
N = int(self.val.type.template_argument(1))
cap = N if size <= N else int(self.val['_capacity'])
return 'MArray::short_vector<%d> o... | Add GDB pretty-printer for short_vector<T,N>import gdb
import re
class ShortVectorPrinter:
def __init__(self, val):
self.val = val
def to_string(self):
size = int(self.val['_size'])
N = int(self.val.type.template_argument(1))
cap = N if size <= N else int(self.val['_capacity']... | <commit_before><commit_msg>Add GDB pretty-printer for short_vector<T,N><commit_after>import gdb
import re
class ShortVectorPrinter:
def __init__(self, val):
self.val = val
def to_string(self):
size = int(self.val['_size'])
N = int(self.val.type.template_argument(1))
cap = N if... | |
ca30516df8037cfb0745f84481f7ada936447a8a | vkfeed/pages/main.py | vkfeed/pages/main.py | # -*- coding: utf-8 -*-
'''Generates the main page.'''
import re
from google.appengine.ext import webapp
import vkfeed.util
class MainPage(webapp.RequestHandler):
'''Generates the main page.'''
def get(self):
'''Processes a GET request.'''
self.response.out.write(vkfeed.util.render_temp... | # -*- coding: utf-8 -*-
'''Generates the main page.'''
import re
from google.appengine.ext import webapp
import vkfeed.util
class MainPage(webapp.RequestHandler):
'''Generates the main page.'''
def get(self):
'''Processes a GET request.'''
self.response.out.write(vkfeed.util.render_temp... | Support of old profile names | Support of old profile names
| Python | bsd-2-clause | zhenkyn/vkfeedd,zhenkyn/vkfeedd,tol1k/vkfeed,kostkost/vkfeed,ALERTua/vkfeed,flyer2001/vkrss,KonishchevDmitry/vkfeed,antonsotin/vkfeedtrue,Densvin/RSSVK,ALERTua/vkfeed,Evorvian/vkfeed,KonishchevDmitry/vkfeed,flyer2001/vkrss,greengeez/vkfeed,schelkovo/rss,greengeez/vkfeed,lokineverdie/parservkrss1488,lokineverdie/parserv... | # -*- coding: utf-8 -*-
'''Generates the main page.'''
import re
from google.appengine.ext import webapp
import vkfeed.util
class MainPage(webapp.RequestHandler):
'''Generates the main page.'''
def get(self):
'''Processes a GET request.'''
self.response.out.write(vkfeed.util.render_temp... | # -*- coding: utf-8 -*-
'''Generates the main page.'''
import re
from google.appengine.ext import webapp
import vkfeed.util
class MainPage(webapp.RequestHandler):
'''Generates the main page.'''
def get(self):
'''Processes a GET request.'''
self.response.out.write(vkfeed.util.render_temp... | <commit_before># -*- coding: utf-8 -*-
'''Generates the main page.'''
import re
from google.appengine.ext import webapp
import vkfeed.util
class MainPage(webapp.RequestHandler):
'''Generates the main page.'''
def get(self):
'''Processes a GET request.'''
self.response.out.write(vkfeed.u... | # -*- coding: utf-8 -*-
'''Generates the main page.'''
import re
from google.appengine.ext import webapp
import vkfeed.util
class MainPage(webapp.RequestHandler):
'''Generates the main page.'''
def get(self):
'''Processes a GET request.'''
self.response.out.write(vkfeed.util.render_temp... | # -*- coding: utf-8 -*-
'''Generates the main page.'''
import re
from google.appengine.ext import webapp
import vkfeed.util
class MainPage(webapp.RequestHandler):
'''Generates the main page.'''
def get(self):
'''Processes a GET request.'''
self.response.out.write(vkfeed.util.render_temp... | <commit_before># -*- coding: utf-8 -*-
'''Generates the main page.'''
import re
from google.appengine.ext import webapp
import vkfeed.util
class MainPage(webapp.RequestHandler):
'''Generates the main page.'''
def get(self):
'''Processes a GET request.'''
self.response.out.write(vkfeed.u... |
6080a7475daef38037b8e8462a7a734380179e3f | scripts/ensure_click_help.py | scripts/ensure_click_help.py | import ast
import argparse
import sys
def stringify_name(name: ast.AST):
if isinstance(name, ast.Attribute):
return f"{stringify_name(name.value)}.{stringify_name(name.attr)}"
if isinstance(name, ast.Name):
return name.id
if isinstance(name, str):
return name
raise NotImplement... | Add script to find out click annotations missing help text | Add script to find out click annotations missing help text
| Python | mit | valohai/valohai-cli | Add script to find out click annotations missing help text | import ast
import argparse
import sys
def stringify_name(name: ast.AST):
if isinstance(name, ast.Attribute):
return f"{stringify_name(name.value)}.{stringify_name(name.attr)}"
if isinstance(name, ast.Name):
return name.id
if isinstance(name, str):
return name
raise NotImplement... | <commit_before><commit_msg>Add script to find out click annotations missing help text<commit_after> | import ast
import argparse
import sys
def stringify_name(name: ast.AST):
if isinstance(name, ast.Attribute):
return f"{stringify_name(name.value)}.{stringify_name(name.attr)}"
if isinstance(name, ast.Name):
return name.id
if isinstance(name, str):
return name
raise NotImplement... | Add script to find out click annotations missing help textimport ast
import argparse
import sys
def stringify_name(name: ast.AST):
if isinstance(name, ast.Attribute):
return f"{stringify_name(name.value)}.{stringify_name(name.attr)}"
if isinstance(name, ast.Name):
return name.id
if isinsta... | <commit_before><commit_msg>Add script to find out click annotations missing help text<commit_after>import ast
import argparse
import sys
def stringify_name(name: ast.AST):
if isinstance(name, ast.Attribute):
return f"{stringify_name(name.value)}.{stringify_name(name.attr)}"
if isinstance(name, ast.Nam... | |
a142472b86044395e428abea2fa5ff28b892d1fb | attr_utils.py | attr_utils.py | def _set_attr( obj, attr_name, value_to_set ):
setattr( obj, attr_name, value_to_set )
return getattr( obj, attr_name )
def _memoize_attr( obj, attr_name, value_to_set ):
return getattr( obj, attr_name, _set_attr( obj, attr_name, value_to_set ) )
| Create attr-utils module; create attribute memoization helper | Create attr-utils module; create attribute memoization helper
| Python | mit | fire-uta/iiix-data-parser | Create attr-utils module; create attribute memoization helper | def _set_attr( obj, attr_name, value_to_set ):
setattr( obj, attr_name, value_to_set )
return getattr( obj, attr_name )
def _memoize_attr( obj, attr_name, value_to_set ):
return getattr( obj, attr_name, _set_attr( obj, attr_name, value_to_set ) )
| <commit_before><commit_msg>Create attr-utils module; create attribute memoization helper<commit_after> | def _set_attr( obj, attr_name, value_to_set ):
setattr( obj, attr_name, value_to_set )
return getattr( obj, attr_name )
def _memoize_attr( obj, attr_name, value_to_set ):
return getattr( obj, attr_name, _set_attr( obj, attr_name, value_to_set ) )
| Create attr-utils module; create attribute memoization helperdef _set_attr( obj, attr_name, value_to_set ):
setattr( obj, attr_name, value_to_set )
return getattr( obj, attr_name )
def _memoize_attr( obj, attr_name, value_to_set ):
return getattr( obj, attr_name, _set_attr( obj, attr_name, value_to_set ) )
| <commit_before><commit_msg>Create attr-utils module; create attribute memoization helper<commit_after>def _set_attr( obj, attr_name, value_to_set ):
setattr( obj, attr_name, value_to_set )
return getattr( obj, attr_name )
def _memoize_attr( obj, attr_name, value_to_set ):
return getattr( obj, attr_name, _set_att... | |
72ffe438270fb54a1ce163faff6d2083079c77e2 | anydo/lib/tests/test_utils.py | anydo/lib/tests/test_utils.py | # -*- coding: utf-8 -*-
import unittest
import re
import sys
import os.path
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
from anydo.lib import utils
class UtilsTests(unittest.TestCase):
def setUp(self):
self.pattern = re.compile('(^([\w-]+)==$)', flags=re.U)
def test_create_uuid(sel... | Add unit test of utils module. | Add unit test of utils module.
Signed-off-by: Kouhei Maeda <c9f1823971fa1a4c79cdb50b3311094021cee31e@palmtb.net>
| Python | mit | gvkalra/python-anydo,gvkalra/python-anydo | Add unit test of utils module.
Signed-off-by: Kouhei Maeda <c9f1823971fa1a4c79cdb50b3311094021cee31e@palmtb.net> | # -*- coding: utf-8 -*-
import unittest
import re
import sys
import os.path
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
from anydo.lib import utils
class UtilsTests(unittest.TestCase):
def setUp(self):
self.pattern = re.compile('(^([\w-]+)==$)', flags=re.U)
def test_create_uuid(sel... | <commit_before><commit_msg>Add unit test of utils module.
Signed-off-by: Kouhei Maeda <c9f1823971fa1a4c79cdb50b3311094021cee31e@palmtb.net><commit_after> | # -*- coding: utf-8 -*-
import unittest
import re
import sys
import os.path
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
from anydo.lib import utils
class UtilsTests(unittest.TestCase):
def setUp(self):
self.pattern = re.compile('(^([\w-]+)==$)', flags=re.U)
def test_create_uuid(sel... | Add unit test of utils module.
Signed-off-by: Kouhei Maeda <c9f1823971fa1a4c79cdb50b3311094021cee31e@palmtb.net># -*- coding: utf-8 -*-
import unittest
import re
import sys
import os.path
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
from anydo.lib import utils
class UtilsTests(unittest.TestCase):
... | <commit_before><commit_msg>Add unit test of utils module.
Signed-off-by: Kouhei Maeda <c9f1823971fa1a4c79cdb50b3311094021cee31e@palmtb.net><commit_after># -*- coding: utf-8 -*-
import unittest
import re
import sys
import os.path
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
from anydo.lib import utils... | |
36a2f0de9f525ea030e4cc805b8ccc7eb29c8098 | src/vimapt/library/vimapt/Dependency.py | src/vimapt/library/vimapt/Dependency.py | import networkx as nx
class Dependency(object):
def __init__(self, package_name):
self.package_name = package_name
self.dependency_graph = nx.DiGraph()
self.dependency_graph.add_node(self.package_name)
self.top_node_name = self.package_name
def parse(self, dependency_specific... | Add dependency function (not finished yet) | Add dependency function (not finished yet)
| Python | mit | howl-anderson/vimapt,howl-anderson/vimapt | Add dependency function (not finished yet) | import networkx as nx
class Dependency(object):
def __init__(self, package_name):
self.package_name = package_name
self.dependency_graph = nx.DiGraph()
self.dependency_graph.add_node(self.package_name)
self.top_node_name = self.package_name
def parse(self, dependency_specific... | <commit_before><commit_msg>Add dependency function (not finished yet)<commit_after> | import networkx as nx
class Dependency(object):
def __init__(self, package_name):
self.package_name = package_name
self.dependency_graph = nx.DiGraph()
self.dependency_graph.add_node(self.package_name)
self.top_node_name = self.package_name
def parse(self, dependency_specific... | Add dependency function (not finished yet)import networkx as nx
class Dependency(object):
def __init__(self, package_name):
self.package_name = package_name
self.dependency_graph = nx.DiGraph()
self.dependency_graph.add_node(self.package_name)
self.top_node_name = self.package_nam... | <commit_before><commit_msg>Add dependency function (not finished yet)<commit_after>import networkx as nx
class Dependency(object):
def __init__(self, package_name):
self.package_name = package_name
self.dependency_graph = nx.DiGraph()
self.dependency_graph.add_node(self.package_name)
... | |
0a0a9addea16d5adf4d9edb3d56e1d890b6214e5 | st2common/tests/unit/test_db_fields.py | st2common/tests/unit/test_db_fields.py | # Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use th... | Add tests for new complext date time field. | Add tests for new complext date time field.
| Python | apache-2.0 | nzlosh/st2,punalpatel/st2,pixelrebel/st2,dennybaa/st2,StackStorm/st2,lakshmi-kannan/st2,nzlosh/st2,jtopjian/st2,peak6/st2,pinterb/st2,Plexxi/st2,tonybaloney/st2,jtopjian/st2,grengojbo/st2,emedvedev/st2,dennybaa/st2,armab/st2,StackStorm/st2,dennybaa/st2,tonybaloney/st2,jtopjian/st2,tonybaloney/st2,armab/st2,pixelrebel/s... | Add tests for new complext date time field. | # Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use th... | <commit_before><commit_msg>Add tests for new complext date time field.<commit_after> | # Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use th... | Add tests for new complext date time field.# Licensed to the StackStorm, Inc ('StackStorm') 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, Versio... | <commit_before><commit_msg>Add tests for new complext date time field.<commit_after># Licensed to the StackStorm, Inc ('StackStorm') 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 fil... | |
1b6966cf0e90da0ac060a43349bbe4ce0f5fc365 | src/whitelist/whitelist_form.py | src/whitelist/whitelist_form.py | from django.forms import ModelForm
from whitelist.models import Player
class WhitelistForm(ModelForm):
""" Automatically generate a form based on the Player model
"""
class Meta:
model = Player
fields = ('ign', 'email')
| Create a model-based form for whitelist requests | Create a model-based form for whitelist requests
| Python | mit | Jonpro03/Minecrunch_Web,Jonpro03/Minecrunch_Web,Jonpro03/Minecrunch_Web | Create a model-based form for whitelist requests | from django.forms import ModelForm
from whitelist.models import Player
class WhitelistForm(ModelForm):
""" Automatically generate a form based on the Player model
"""
class Meta:
model = Player
fields = ('ign', 'email')
| <commit_before><commit_msg>Create a model-based form for whitelist requests<commit_after> | from django.forms import ModelForm
from whitelist.models import Player
class WhitelistForm(ModelForm):
""" Automatically generate a form based on the Player model
"""
class Meta:
model = Player
fields = ('ign', 'email')
| Create a model-based form for whitelist requestsfrom django.forms import ModelForm
from whitelist.models import Player
class WhitelistForm(ModelForm):
""" Automatically generate a form based on the Player model
"""
class Meta:
model = Player
fields = ('ign', 'email')
| <commit_before><commit_msg>Create a model-based form for whitelist requests<commit_after>from django.forms import ModelForm
from whitelist.models import Player
class WhitelistForm(ModelForm):
""" Automatically generate a form based on the Player model
"""
class Meta:
model = Player
fields ... | |
e78e93d5f2a3c35e92b03ba85f0cdad9a5f893d2 | affiliate-builder/upload_bdists.py | affiliate-builder/upload_bdists.py | from __future__ import (division, print_function, absolute_import,
unicode_literals)
import os
import glob
from conda import config
#from conda_build.metadata import MetaData
from binstar_client.inspect_package.conda import inspect_conda_package
from obvci.conda_tools.build import upload
fro... | Add script for uploading bdists | Add script for uploading bdists
| Python | bsd-3-clause | bmorris3/conda-builder-affiliated,Cadair/conda-builder-affiliated,astropy/conda-build-tools,astropy/conda-builder-affiliated,cdeil/conda-builder-affiliated,astropy/conda-build-tools,cdeil/conda-builder-affiliated,kbarbary/conda-builder-affiliated,mwcraig/conda-builder-affiliated,astropy/conda-builder-affiliated,kbarbar... | Add script for uploading bdists | from __future__ import (division, print_function, absolute_import,
unicode_literals)
import os
import glob
from conda import config
#from conda_build.metadata import MetaData
from binstar_client.inspect_package.conda import inspect_conda_package
from obvci.conda_tools.build import upload
fro... | <commit_before><commit_msg>Add script for uploading bdists<commit_after> | from __future__ import (division, print_function, absolute_import,
unicode_literals)
import os
import glob
from conda import config
#from conda_build.metadata import MetaData
from binstar_client.inspect_package.conda import inspect_conda_package
from obvci.conda_tools.build import upload
fro... | Add script for uploading bdistsfrom __future__ import (division, print_function, absolute_import,
unicode_literals)
import os
import glob
from conda import config
#from conda_build.metadata import MetaData
from binstar_client.inspect_package.conda import inspect_conda_package
from obvci.cond... | <commit_before><commit_msg>Add script for uploading bdists<commit_after>from __future__ import (division, print_function, absolute_import,
unicode_literals)
import os
import glob
from conda import config
#from conda_build.metadata import MetaData
from binstar_client.inspect_package.conda impo... | |
504e2321a001144d5466cb492c77f01e045c89d5 | test/tests/python-imports/container.py | test/tests/python-imports/container.py | import curses
import readline
import bz2
assert(bz2.decompress(bz2.compress(b'IT WORKS IT WORKS IT WORKS')) == b'IT WORKS IT WORKS IT WORKS')
import platform
if platform.python_implementation() != 'PyPy' and platform.python_version_tuple()[0] != '2':
# PyPy and Python 2 don't support lzma
import lzma
asse... | import curses
import dbm
import readline
import bz2
assert(bz2.decompress(bz2.compress(b'IT WORKS IT WORKS IT WORKS')) == b'IT WORKS IT WORKS IT WORKS')
import platform
if platform.python_implementation() != 'PyPy' and platform.python_version_tuple()[0] != '2':
# PyPy and Python 2 don't support lzma
import lz... | Add "dbm" to "python-imports" test | Add "dbm" to "python-imports" test
| Python | apache-2.0 | emilevauge/official-images,chorrell/official-images,docker-solr/official-images,davidl-zend/official-images,jperrin/official-images,docker-solr/official-images,davidl-zend/official-images,31z4/official-images,nodejs-docker-bot/official-images,emilevauge/official-images,davidl-zend/official-images,chorrell/official-imag... | import curses
import readline
import bz2
assert(bz2.decompress(bz2.compress(b'IT WORKS IT WORKS IT WORKS')) == b'IT WORKS IT WORKS IT WORKS')
import platform
if platform.python_implementation() != 'PyPy' and platform.python_version_tuple()[0] != '2':
# PyPy and Python 2 don't support lzma
import lzma
asse... | import curses
import dbm
import readline
import bz2
assert(bz2.decompress(bz2.compress(b'IT WORKS IT WORKS IT WORKS')) == b'IT WORKS IT WORKS IT WORKS')
import platform
if platform.python_implementation() != 'PyPy' and platform.python_version_tuple()[0] != '2':
# PyPy and Python 2 don't support lzma
import lz... | <commit_before>import curses
import readline
import bz2
assert(bz2.decompress(bz2.compress(b'IT WORKS IT WORKS IT WORKS')) == b'IT WORKS IT WORKS IT WORKS')
import platform
if platform.python_implementation() != 'PyPy' and platform.python_version_tuple()[0] != '2':
# PyPy and Python 2 don't support lzma
impor... | import curses
import dbm
import readline
import bz2
assert(bz2.decompress(bz2.compress(b'IT WORKS IT WORKS IT WORKS')) == b'IT WORKS IT WORKS IT WORKS')
import platform
if platform.python_implementation() != 'PyPy' and platform.python_version_tuple()[0] != '2':
# PyPy and Python 2 don't support lzma
import lz... | import curses
import readline
import bz2
assert(bz2.decompress(bz2.compress(b'IT WORKS IT WORKS IT WORKS')) == b'IT WORKS IT WORKS IT WORKS')
import platform
if platform.python_implementation() != 'PyPy' and platform.python_version_tuple()[0] != '2':
# PyPy and Python 2 don't support lzma
import lzma
asse... | <commit_before>import curses
import readline
import bz2
assert(bz2.decompress(bz2.compress(b'IT WORKS IT WORKS IT WORKS')) == b'IT WORKS IT WORKS IT WORKS')
import platform
if platform.python_implementation() != 'PyPy' and platform.python_version_tuple()[0] != '2':
# PyPy and Python 2 don't support lzma
impor... |
df10bd85bcf94aba9661e397960a1cd3b4dd090d | POST_TEST.py | POST_TEST.py | from posts.nc import *
import posts.iso
output('POST_TEST.txt')
program_begin(123, 'Test program')
absolute()
metric()
set_plane(0)
feedrate(420)
rapid(100,120)
rapid(z=50)
feed(z=0)
rapid(z=50)
rapid_home()
program_end()
| Test for ISO NC creator | Test for ISO NC creator | Python | bsd-3-clause | danheeks/heekscnc,danheeks/heekscnc,danheeks/heekscnc,danheeks/heekscnc | Test for ISO NC creator | from posts.nc import *
import posts.iso
output('POST_TEST.txt')
program_begin(123, 'Test program')
absolute()
metric()
set_plane(0)
feedrate(420)
rapid(100,120)
rapid(z=50)
feed(z=0)
rapid(z=50)
rapid_home()
program_end()
| <commit_before><commit_msg>Test for ISO NC creator<commit_after> | from posts.nc import *
import posts.iso
output('POST_TEST.txt')
program_begin(123, 'Test program')
absolute()
metric()
set_plane(0)
feedrate(420)
rapid(100,120)
rapid(z=50)
feed(z=0)
rapid(z=50)
rapid_home()
program_end()
| Test for ISO NC creatorfrom posts.nc import *
import posts.iso
output('POST_TEST.txt')
program_begin(123, 'Test program')
absolute()
metric()
set_plane(0)
feedrate(420)
rapid(100,120)
rapid(z=50)
feed(z=0)
rapid(z=50)
rapid_home()
program_end()
| <commit_before><commit_msg>Test for ISO NC creator<commit_after>from posts.nc import *
import posts.iso
output('POST_TEST.txt')
program_begin(123, 'Test program')
absolute()
metric()
set_plane(0)
feedrate(420)
rapid(100,120)
rapid(z=50)
feed(z=0)
rapid(z=50)
rapid_home()
program_end()
| |
48984b9ab60c14c5d47ee329ef906d47b35b8ade | biothings/tests/test_query.py | biothings/tests/test_query.py | '''
Biothings Query Component Common Tests
'''
import os
from nose.core import main
from biothings.tests import BiothingsTestCase
class QueryTests(BiothingsTestCase):
''' Test against server specified in environment variable BT_HOST
and BT_API or MyGene.info production server V3 by def... | Add common tests for query endpoint | Add common tests for query endpoint
| Python | apache-2.0 | biothings/biothings.api,biothings/biothings.api | Add common tests for query endpoint | '''
Biothings Query Component Common Tests
'''
import os
from nose.core import main
from biothings.tests import BiothingsTestCase
class QueryTests(BiothingsTestCase):
''' Test against server specified in environment variable BT_HOST
and BT_API or MyGene.info production server V3 by def... | <commit_before><commit_msg>Add common tests for query endpoint<commit_after> | '''
Biothings Query Component Common Tests
'''
import os
from nose.core import main
from biothings.tests import BiothingsTestCase
class QueryTests(BiothingsTestCase):
''' Test against server specified in environment variable BT_HOST
and BT_API or MyGene.info production server V3 by def... | Add common tests for query endpoint'''
Biothings Query Component Common Tests
'''
import os
from nose.core import main
from biothings.tests import BiothingsTestCase
class QueryTests(BiothingsTestCase):
''' Test against server specified in environment variable BT_HOST
and BT_API or MyGe... | <commit_before><commit_msg>Add common tests for query endpoint<commit_after>'''
Biothings Query Component Common Tests
'''
import os
from nose.core import main
from biothings.tests import BiothingsTestCase
class QueryTests(BiothingsTestCase):
''' Test against server specified in environment var... | |
638e2d7a33f522007d80d39e0a8e5bface654286 | test/test_scripts/test_utils.py | test/test_scripts/test_utils.py | from scripts.init import utils
import unittest
class TestUtils(unittest.TestCase):
@classmethod
def setUpClass(self):
pass
def test_get_parameter(self):
api = utils.get_parameter('api')
url = utils.get_parameter('api', 'url')
# Assert parameters are not empty
self... | Add unit tests for utility methods. | Add unit tests for utility methods.
| Python | apache-2.0 | alexisrolland/data-quality,alexisrolland/data-quality,alexisrolland/data-quality,alexisrolland/data-quality | Add unit tests for utility methods. | from scripts.init import utils
import unittest
class TestUtils(unittest.TestCase):
@classmethod
def setUpClass(self):
pass
def test_get_parameter(self):
api = utils.get_parameter('api')
url = utils.get_parameter('api', 'url')
# Assert parameters are not empty
self... | <commit_before><commit_msg>Add unit tests for utility methods.<commit_after> | from scripts.init import utils
import unittest
class TestUtils(unittest.TestCase):
@classmethod
def setUpClass(self):
pass
def test_get_parameter(self):
api = utils.get_parameter('api')
url = utils.get_parameter('api', 'url')
# Assert parameters are not empty
self... | Add unit tests for utility methods.from scripts.init import utils
import unittest
class TestUtils(unittest.TestCase):
@classmethod
def setUpClass(self):
pass
def test_get_parameter(self):
api = utils.get_parameter('api')
url = utils.get_parameter('api', 'url')
# Assert pa... | <commit_before><commit_msg>Add unit tests for utility methods.<commit_after>from scripts.init import utils
import unittest
class TestUtils(unittest.TestCase):
@classmethod
def setUpClass(self):
pass
def test_get_parameter(self):
api = utils.get_parameter('api')
url = utils.get_par... | |
5bab29cbdb1d5db9949a9379656cf1a925fcf20a | tests/Settings/TestSettingFunction.py | tests/Settings/TestSettingFunction.py | # Copyright (c) 2016 Ultimaker B.V.
# Uranium is released under the terms of the AGPLv3 or higher.
import pytest
import UM.Settings.SettingFunction
## Individual test cases for the good setting functions.
#
# Each test will be executed with each of these functions. These functions are
# all good and should work... | Add test suite for SettingFunction | Add test suite for SettingFunction
It currently tests only the initialisation.
Contributes to issue CURA-1278.
| Python | agpl-3.0 | onitake/Uranium,onitake/Uranium | Add test suite for SettingFunction
It currently tests only the initialisation.
Contributes to issue CURA-1278. | # Copyright (c) 2016 Ultimaker B.V.
# Uranium is released under the terms of the AGPLv3 or higher.
import pytest
import UM.Settings.SettingFunction
## Individual test cases for the good setting functions.
#
# Each test will be executed with each of these functions. These functions are
# all good and should work... | <commit_before><commit_msg>Add test suite for SettingFunction
It currently tests only the initialisation.
Contributes to issue CURA-1278.<commit_after> | # Copyright (c) 2016 Ultimaker B.V.
# Uranium is released under the terms of the AGPLv3 or higher.
import pytest
import UM.Settings.SettingFunction
## Individual test cases for the good setting functions.
#
# Each test will be executed with each of these functions. These functions are
# all good and should work... | Add test suite for SettingFunction
It currently tests only the initialisation.
Contributes to issue CURA-1278.# Copyright (c) 2016 Ultimaker B.V.
# Uranium is released under the terms of the AGPLv3 or higher.
import pytest
import UM.Settings.SettingFunction
## Individual test cases for the good setting functions.... | <commit_before><commit_msg>Add test suite for SettingFunction
It currently tests only the initialisation.
Contributes to issue CURA-1278.<commit_after># Copyright (c) 2016 Ultimaker B.V.
# Uranium is released under the terms of the AGPLv3 or higher.
import pytest
import UM.Settings.SettingFunction
## Individual t... | |
5e13e3bc045d496232e5ced6b7dc314f14183257 | doc/examples/viennagrid_wrapper/io_stats.py | doc/examples/viennagrid_wrapper/io_stats.py | #!/usr/bin/env python
#
# This example shows is like the readers and writers example ('io.py'),
# but this one also calculates some statistics on the elapsed time, the
# number of vertices an cells read, etc.
from __future__ import print_function
# In this example, we will set up a domain of triangles in the cartesi... | Create a copy of the Netgen reader example and add some statistics calculation. | Create a copy of the Netgen reader example and add some statistics calculation.
These additions calculate the elapsed time (the time that the reader has taken in order to read the mesh file), the number of vertices in the domain and the number of cells in the segmentation (if applicable).
| Python | mit | jonancm/viennagrid-python,jonancm/viennagrid-python,jonancm/viennagrid-python | Create a copy of the Netgen reader example and add some statistics calculation.
These additions calculate the elapsed time (the time that the reader has taken in order to read the mesh file), the number of vertices in the domain and the number of cells in the segmentation (if applicable). | #!/usr/bin/env python
#
# This example shows is like the readers and writers example ('io.py'),
# but this one also calculates some statistics on the elapsed time, the
# number of vertices an cells read, etc.
from __future__ import print_function
# In this example, we will set up a domain of triangles in the cartesi... | <commit_before><commit_msg>Create a copy of the Netgen reader example and add some statistics calculation.
These additions calculate the elapsed time (the time that the reader has taken in order to read the mesh file), the number of vertices in the domain and the number of cells in the segmentation (if applicable).<co... | #!/usr/bin/env python
#
# This example shows is like the readers and writers example ('io.py'),
# but this one also calculates some statistics on the elapsed time, the
# number of vertices an cells read, etc.
from __future__ import print_function
# In this example, we will set up a domain of triangles in the cartesi... | Create a copy of the Netgen reader example and add some statistics calculation.
These additions calculate the elapsed time (the time that the reader has taken in order to read the mesh file), the number of vertices in the domain and the number of cells in the segmentation (if applicable).#!/usr/bin/env python
#
# Thi... | <commit_before><commit_msg>Create a copy of the Netgen reader example and add some statistics calculation.
These additions calculate the elapsed time (the time that the reader has taken in order to read the mesh file), the number of vertices in the domain and the number of cells in the segmentation (if applicable).<co... | |
e1bef44be34efd637bc2acdaf71f01b5d77deaec | edisgo/flex_opt/storage_integration.py | edisgo/flex_opt/storage_integration.py | from edisgo.grid.components import Storage, Line
from edisgo.grid.tools import select_cable
import logging
def integrate_storage(network, position, operation):
"""
Integrate storage units in the grid and specify its operational mode
Parameters
----------
network: :class:`~.grid.network.Network`
... | Add demo case storage integration | Add demo case storage integration
| Python | agpl-3.0 | openego/eDisGo,openego/eDisGo | Add demo case storage integration | from edisgo.grid.components import Storage, Line
from edisgo.grid.tools import select_cable
import logging
def integrate_storage(network, position, operation):
"""
Integrate storage units in the grid and specify its operational mode
Parameters
----------
network: :class:`~.grid.network.Network`
... | <commit_before><commit_msg>Add demo case storage integration<commit_after> | from edisgo.grid.components import Storage, Line
from edisgo.grid.tools import select_cable
import logging
def integrate_storage(network, position, operation):
"""
Integrate storage units in the grid and specify its operational mode
Parameters
----------
network: :class:`~.grid.network.Network`
... | Add demo case storage integrationfrom edisgo.grid.components import Storage, Line
from edisgo.grid.tools import select_cable
import logging
def integrate_storage(network, position, operation):
"""
Integrate storage units in the grid and specify its operational mode
Parameters
----------
network: ... | <commit_before><commit_msg>Add demo case storage integration<commit_after>from edisgo.grid.components import Storage, Line
from edisgo.grid.tools import select_cable
import logging
def integrate_storage(network, position, operation):
"""
Integrate storage units in the grid and specify its operational mode
... | |
ff9cbbac188f78ed33cb2f650a32777713911384 | examples/python/monochrome_pipeline.py | examples/python/monochrome_pipeline.py | import gst
import gobject
import os
VIDEODEVICE = "/dev/video1"
WIDTH = 1280
HEIGHT = 960
FRAMERATE = "15/1"
try:
import psutil
except ImportError:
psutil = None
def show_resources_cb (*args):
process = psutil.Process(os.getpid())
if getattr(process, "memory_info"):
print ("Resource usage: %d... | Add small demo for a monochrome GST pipeline | Add small demo for a monochrome GST pipeline
| Python | apache-2.0 | TheImagingSource/tiscamera,TheImagingSource/tiscamera,TheImagingSource/tiscamera,TheImagingSource/tiscamera | Add small demo for a monochrome GST pipeline | import gst
import gobject
import os
VIDEODEVICE = "/dev/video1"
WIDTH = 1280
HEIGHT = 960
FRAMERATE = "15/1"
try:
import psutil
except ImportError:
psutil = None
def show_resources_cb (*args):
process = psutil.Process(os.getpid())
if getattr(process, "memory_info"):
print ("Resource usage: %d... | <commit_before><commit_msg>Add small demo for a monochrome GST pipeline<commit_after> | import gst
import gobject
import os
VIDEODEVICE = "/dev/video1"
WIDTH = 1280
HEIGHT = 960
FRAMERATE = "15/1"
try:
import psutil
except ImportError:
psutil = None
def show_resources_cb (*args):
process = psutil.Process(os.getpid())
if getattr(process, "memory_info"):
print ("Resource usage: %d... | Add small demo for a monochrome GST pipelineimport gst
import gobject
import os
VIDEODEVICE = "/dev/video1"
WIDTH = 1280
HEIGHT = 960
FRAMERATE = "15/1"
try:
import psutil
except ImportError:
psutil = None
def show_resources_cb (*args):
process = psutil.Process(os.getpid())
if getattr(process, "memor... | <commit_before><commit_msg>Add small demo for a monochrome GST pipeline<commit_after>import gst
import gobject
import os
VIDEODEVICE = "/dev/video1"
WIDTH = 1280
HEIGHT = 960
FRAMERATE = "15/1"
try:
import psutil
except ImportError:
psutil = None
def show_resources_cb (*args):
process = psutil.Process(os... | |
08a6dddb866ec53ff45a302d7c163d041bbefe71 | protoplot-test/test_options_resolving.py | protoplot-test/test_options_resolving.py | import unittest
from protoplot.engine.item import Item
from protoplot.engine.item_container import ItemContainer
class Series(Item):
pass
Series.options.register("color", True)
Series.options.register("lineWidth", False)
Series.options.register("lineStyle", False)
class TestOptionsResolving(unittest.TestCase):... | Add stub unit test for options resolving | Add stub unit test for options resolving
| Python | agpl-3.0 | deffi/protoplot | Add stub unit test for options resolving | import unittest
from protoplot.engine.item import Item
from protoplot.engine.item_container import ItemContainer
class Series(Item):
pass
Series.options.register("color", True)
Series.options.register("lineWidth", False)
Series.options.register("lineStyle", False)
class TestOptionsResolving(unittest.TestCase):... | <commit_before><commit_msg>Add stub unit test for options resolving<commit_after> | import unittest
from protoplot.engine.item import Item
from protoplot.engine.item_container import ItemContainer
class Series(Item):
pass
Series.options.register("color", True)
Series.options.register("lineWidth", False)
Series.options.register("lineStyle", False)
class TestOptionsResolving(unittest.TestCase):... | Add stub unit test for options resolvingimport unittest
from protoplot.engine.item import Item
from protoplot.engine.item_container import ItemContainer
class Series(Item):
pass
Series.options.register("color", True)
Series.options.register("lineWidth", False)
Series.options.register("lineStyle", False)
class ... | <commit_before><commit_msg>Add stub unit test for options resolving<commit_after>import unittest
from protoplot.engine.item import Item
from protoplot.engine.item_container import ItemContainer
class Series(Item):
pass
Series.options.register("color", True)
Series.options.register("lineWidth", False)
Series.opt... | |
585c9b6f1c8bf186fee34303ba29b7b511c1ba7e | mzalendo/core/management/commands/core_match_places_to_mapit_areas_2013.py | mzalendo/core/management/commands/core_match_places_to_mapit_areas_2013.py | import sys
from optparse import make_option
from pprint import pprint
from django.core.management.base import NoArgsCommand
from django.template.defaultfilters import slugify
from django.conf import settings
# from helpers import geocode
from core import models
from mapit import models as mapit_models
class Command... | Add a script to add mapit area IDs to new Place objects for 2013 | Add a script to add mapit area IDs to new Place objects for 2013
This is variant of the existing core_match_places_to_mapit_areas
command by Edmund von der Burg, but which is also aware of
ParliamentarySesssions and has some extra debugging output.
| Python | agpl-3.0 | geoffkilpin/pombola,patricmutwiri/pombola,hzj123/56th,hzj123/56th,hzj123/56th,ken-muturi/pombola,ken-muturi/pombola,patricmutwiri/pombola,geoffkilpin/pombola,patricmutwiri/pombola,hzj123/56th,mysociety/pombola,hzj123/56th,ken-muturi/pombola,geoffkilpin/pombola,patricmutwiri/pombola,ken-muturi/pombola,patricmutwiri/pomb... | Add a script to add mapit area IDs to new Place objects for 2013
This is variant of the existing core_match_places_to_mapit_areas
command by Edmund von der Burg, but which is also aware of
ParliamentarySesssions and has some extra debugging output. | import sys
from optparse import make_option
from pprint import pprint
from django.core.management.base import NoArgsCommand
from django.template.defaultfilters import slugify
from django.conf import settings
# from helpers import geocode
from core import models
from mapit import models as mapit_models
class Command... | <commit_before><commit_msg>Add a script to add mapit area IDs to new Place objects for 2013
This is variant of the existing core_match_places_to_mapit_areas
command by Edmund von der Burg, but which is also aware of
ParliamentarySesssions and has some extra debugging output.<commit_after> | import sys
from optparse import make_option
from pprint import pprint
from django.core.management.base import NoArgsCommand
from django.template.defaultfilters import slugify
from django.conf import settings
# from helpers import geocode
from core import models
from mapit import models as mapit_models
class Command... | Add a script to add mapit area IDs to new Place objects for 2013
This is variant of the existing core_match_places_to_mapit_areas
command by Edmund von der Burg, but which is also aware of
ParliamentarySesssions and has some extra debugging output.import sys
from optparse import make_option
from pprint import pprint
... | <commit_before><commit_msg>Add a script to add mapit area IDs to new Place objects for 2013
This is variant of the existing core_match_places_to_mapit_areas
command by Edmund von der Burg, but which is also aware of
ParliamentarySesssions and has some extra debugging output.<commit_after>import sys
from optparse impo... | |
5fba93a26b6f09c20391ec18b281def2bd851650 | tests/basics/for3.py | tests/basics/for3.py | # test assigning to iterator within the loop
for i in range(2):
print(i)
i = 2
# test assigning to range parameter within the loop
# (since we optimise for loops, this needs checking, currently it fails)
#n = 2
#for i in range(n):
# print(i)
# n = 0
| Add test for semantics of for-loop that optimisation can break. | tests: Add test for semantics of for-loop that optimisation can break.
| Python | mit | SungEun-Steve-Kim/test-mp,Vogtinator/micropython,turbinenreiter/micropython,HenrikSolver/micropython,drrk/micropython,alex-march/micropython,pozetroninc/micropython,blmorris/micropython,dmazzella/micropython,kerneltask/micropython,Timmenem/micropython,adamkh/micropython,adamkh/micropython,heisewangluo/micropython,infin... | tests: Add test for semantics of for-loop that optimisation can break. | # test assigning to iterator within the loop
for i in range(2):
print(i)
i = 2
# test assigning to range parameter within the loop
# (since we optimise for loops, this needs checking, currently it fails)
#n = 2
#for i in range(n):
# print(i)
# n = 0
| <commit_before><commit_msg>tests: Add test for semantics of for-loop that optimisation can break.<commit_after> | # test assigning to iterator within the loop
for i in range(2):
print(i)
i = 2
# test assigning to range parameter within the loop
# (since we optimise for loops, this needs checking, currently it fails)
#n = 2
#for i in range(n):
# print(i)
# n = 0
| tests: Add test for semantics of for-loop that optimisation can break.# test assigning to iterator within the loop
for i in range(2):
print(i)
i = 2
# test assigning to range parameter within the loop
# (since we optimise for loops, this needs checking, currently it fails)
#n = 2
#for i in range(n):
# print... | <commit_before><commit_msg>tests: Add test for semantics of for-loop that optimisation can break.<commit_after># test assigning to iterator within the loop
for i in range(2):
print(i)
i = 2
# test assigning to range parameter within the loop
# (since we optimise for loops, this needs checking, currently it fai... | |
08a3317d577e0ee5dfa07f8a81b7a4a018297b4a | dstar-lite/scripts/python_pipe.py | dstar-lite/scripts/python_pipe.py |
import csv
import numpy as np
import scipy.io as sio
def process_gridworld_data(input, imsize):
# run training from input matlab data file, and save test data prediction in output file
# load data from Matlab file, including
# im_data: flattened images
# state_data: concatenated one-hot vectors for each stat... | Create a script to parse .mat and write .csv file | Create a script to parse .mat and write .csv file
| Python | mit | ToniRV/Learning-to-navigate-without-a-map,ToniRV/Learning-to-navigate-without-a-map | Create a script to parse .mat and write .csv file |
import csv
import numpy as np
import scipy.io as sio
def process_gridworld_data(input, imsize):
# run training from input matlab data file, and save test data prediction in output file
# load data from Matlab file, including
# im_data: flattened images
# state_data: concatenated one-hot vectors for each stat... | <commit_before><commit_msg>Create a script to parse .mat and write .csv file<commit_after> |
import csv
import numpy as np
import scipy.io as sio
def process_gridworld_data(input, imsize):
# run training from input matlab data file, and save test data prediction in output file
# load data from Matlab file, including
# im_data: flattened images
# state_data: concatenated one-hot vectors for each stat... | Create a script to parse .mat and write .csv file
import csv
import numpy as np
import scipy.io as sio
def process_gridworld_data(input, imsize):
# run training from input matlab data file, and save test data prediction in output file
# load data from Matlab file, including
# im_data: flattened images
# state... | <commit_before><commit_msg>Create a script to parse .mat and write .csv file<commit_after>
import csv
import numpy as np
import scipy.io as sio
def process_gridworld_data(input, imsize):
# run training from input matlab data file, and save test data prediction in output file
# load data from Matlab file, includin... | |
83e036f3d89c4b3956bde006085becb496a1fb6e | dbscan/test.py | dbscan/test.py | '''
Generate dummy data, and compare output from scikit-learn's DBSCAN.
Example code based on:
http://scikit-learn.org/stable/auto_examples/cluster/plot_dbscan.html#sphx-glr-auto-examples-cluster-plot-dbscan-py
Run with pytest, e.g.:
py.test test.py
'''
import os
import shutil
import subprocess
from sklearn.... | Add python / sklearn comparison script | [dbscan] Add python / sklearn comparison script
| Python | mit | jlas/ml.q | [dbscan] Add python / sklearn comparison script | '''
Generate dummy data, and compare output from scikit-learn's DBSCAN.
Example code based on:
http://scikit-learn.org/stable/auto_examples/cluster/plot_dbscan.html#sphx-glr-auto-examples-cluster-plot-dbscan-py
Run with pytest, e.g.:
py.test test.py
'''
import os
import shutil
import subprocess
from sklearn.... | <commit_before><commit_msg>[dbscan] Add python / sklearn comparison script<commit_after> | '''
Generate dummy data, and compare output from scikit-learn's DBSCAN.
Example code based on:
http://scikit-learn.org/stable/auto_examples/cluster/plot_dbscan.html#sphx-glr-auto-examples-cluster-plot-dbscan-py
Run with pytest, e.g.:
py.test test.py
'''
import os
import shutil
import subprocess
from sklearn.... | [dbscan] Add python / sklearn comparison script'''
Generate dummy data, and compare output from scikit-learn's DBSCAN.
Example code based on:
http://scikit-learn.org/stable/auto_examples/cluster/plot_dbscan.html#sphx-glr-auto-examples-cluster-plot-dbscan-py
Run with pytest, e.g.:
py.test test.py
'''
import os... | <commit_before><commit_msg>[dbscan] Add python / sklearn comparison script<commit_after>'''
Generate dummy data, and compare output from scikit-learn's DBSCAN.
Example code based on:
http://scikit-learn.org/stable/auto_examples/cluster/plot_dbscan.html#sphx-glr-auto-examples-cluster-plot-dbscan-py
Run with pytest, ... | |
fe6d4383a942eb85e3062f35f5b6d073d92b1cc2 | tests/test_pgtune.py | tests/test_pgtune.py | # coding: utf-8
"""
Test suite for PgTune.
"""
from unittest.mock import MagicMock, patch
import pytest
import smdba.postgresqlgate
class TestPgTune:
"""
Test PgTune class.
"""
def test_estimate(self):
"""
Test estimation.
:return:
"""
popen = MagicMock()
... | Add unit test for tuning estimations | Add unit test for tuning estimations
| Python | mit | SUSE/smdba,SUSE/smdba | Add unit test for tuning estimations | # coding: utf-8
"""
Test suite for PgTune.
"""
from unittest.mock import MagicMock, patch
import pytest
import smdba.postgresqlgate
class TestPgTune:
"""
Test PgTune class.
"""
def test_estimate(self):
"""
Test estimation.
:return:
"""
popen = MagicMock()
... | <commit_before><commit_msg>Add unit test for tuning estimations<commit_after> | # coding: utf-8
"""
Test suite for PgTune.
"""
from unittest.mock import MagicMock, patch
import pytest
import smdba.postgresqlgate
class TestPgTune:
"""
Test PgTune class.
"""
def test_estimate(self):
"""
Test estimation.
:return:
"""
popen = MagicMock()
... | Add unit test for tuning estimations# coding: utf-8
"""
Test suite for PgTune.
"""
from unittest.mock import MagicMock, patch
import pytest
import smdba.postgresqlgate
class TestPgTune:
"""
Test PgTune class.
"""
def test_estimate(self):
"""
Test estimation.
:return:
... | <commit_before><commit_msg>Add unit test for tuning estimations<commit_after># coding: utf-8
"""
Test suite for PgTune.
"""
from unittest.mock import MagicMock, patch
import pytest
import smdba.postgresqlgate
class TestPgTune:
"""
Test PgTune class.
"""
def test_estimate(self):
"""
T... | |
ed985791d20199af9cb34e445d0a96dc11e9129b | climlab/tests/test_rrtm.py | climlab/tests/test_rrtm.py | from __future__ import division
import numpy as np
import climlab
import pytest
from climlab.radiation import RRTMG, RRTMG_LW, RRTMG_SW, CAM3Radiation_LW
def test_rrtm_creation():
# initial state (temperatures)
state = climlab.column_state(num_lev=num_lev, num_lat=1, water_depth=5.)
# Create a RRTM radiat... | Add some basic tests for RRTM scheme. | Add some basic tests for RRTM scheme.
| Python | mit | brian-rose/climlab,cjcardinale/climlab,brian-rose/climlab,cjcardinale/climlab,cjcardinale/climlab | Add some basic tests for RRTM scheme. | from __future__ import division
import numpy as np
import climlab
import pytest
from climlab.radiation import RRTMG, RRTMG_LW, RRTMG_SW, CAM3Radiation_LW
def test_rrtm_creation():
# initial state (temperatures)
state = climlab.column_state(num_lev=num_lev, num_lat=1, water_depth=5.)
# Create a RRTM radiat... | <commit_before><commit_msg>Add some basic tests for RRTM scheme.<commit_after> | from __future__ import division
import numpy as np
import climlab
import pytest
from climlab.radiation import RRTMG, RRTMG_LW, RRTMG_SW, CAM3Radiation_LW
def test_rrtm_creation():
# initial state (temperatures)
state = climlab.column_state(num_lev=num_lev, num_lat=1, water_depth=5.)
# Create a RRTM radiat... | Add some basic tests for RRTM scheme.from __future__ import division
import numpy as np
import climlab
import pytest
from climlab.radiation import RRTMG, RRTMG_LW, RRTMG_SW, CAM3Radiation_LW
def test_rrtm_creation():
# initial state (temperatures)
state = climlab.column_state(num_lev=num_lev, num_lat=1, water_... | <commit_before><commit_msg>Add some basic tests for RRTM scheme.<commit_after>from __future__ import division
import numpy as np
import climlab
import pytest
from climlab.radiation import RRTMG, RRTMG_LW, RRTMG_SW, CAM3Radiation_LW
def test_rrtm_creation():
# initial state (temperatures)
state = climlab.column... | |
a84d8005193328b63eaf98f0852dc72c3e58aed9 | twitter_feed.py | twitter_feed.py | # authenticates with twitter, searches for microsoft, evaluates overall
# sentiment for microsoft
import numpy as np
import twitter
from textblob import TextBlob
f = open('me.auth')
keys = f.readlines()
# Read in keys
keys = [x.strip('\n') for x in keys]
# Connect
api = twitter.Api(consumer_key = keys[0],
... | Add example script for evaluating setiment | Add example script for evaluating setiment
| Python | mit | dankolbman/MarketCents | Add example script for evaluating setiment | # authenticates with twitter, searches for microsoft, evaluates overall
# sentiment for microsoft
import numpy as np
import twitter
from textblob import TextBlob
f = open('me.auth')
keys = f.readlines()
# Read in keys
keys = [x.strip('\n') for x in keys]
# Connect
api = twitter.Api(consumer_key = keys[0],
... | <commit_before><commit_msg>Add example script for evaluating setiment<commit_after> | # authenticates with twitter, searches for microsoft, evaluates overall
# sentiment for microsoft
import numpy as np
import twitter
from textblob import TextBlob
f = open('me.auth')
keys = f.readlines()
# Read in keys
keys = [x.strip('\n') for x in keys]
# Connect
api = twitter.Api(consumer_key = keys[0],
... | Add example script for evaluating setiment# authenticates with twitter, searches for microsoft, evaluates overall
# sentiment for microsoft
import numpy as np
import twitter
from textblob import TextBlob
f = open('me.auth')
keys = f.readlines()
# Read in keys
keys = [x.strip('\n') for x in keys]
# Connect
api = twi... | <commit_before><commit_msg>Add example script for evaluating setiment<commit_after># authenticates with twitter, searches for microsoft, evaluates overall
# sentiment for microsoft
import numpy as np
import twitter
from textblob import TextBlob
f = open('me.auth')
keys = f.readlines()
# Read in keys
keys = [x.strip(... | |
0d7b9e23889b2908e874bda58a119af6b763f04e | test_add_group.py | test_add_group.py | # -*- coding: utf-8 -*-
from selenium.webdriver.firefox.webdriver import WebDriver
from selenium.webdriver.common.action_chains import ActionChains
import time, unittest
def is_alert_present(wd):
try:
wd.switch_to_alert().text
return True
except:
return False
class test_add_group(unitt... | Test Case for adding groups | Test Case for adding groups
| Python | apache-2.0 | labizon/Python_training | Test Case for adding groups | # -*- coding: utf-8 -*-
from selenium.webdriver.firefox.webdriver import WebDriver
from selenium.webdriver.common.action_chains import ActionChains
import time, unittest
def is_alert_present(wd):
try:
wd.switch_to_alert().text
return True
except:
return False
class test_add_group(unitt... | <commit_before><commit_msg>Test Case for adding groups<commit_after> | # -*- coding: utf-8 -*-
from selenium.webdriver.firefox.webdriver import WebDriver
from selenium.webdriver.common.action_chains import ActionChains
import time, unittest
def is_alert_present(wd):
try:
wd.switch_to_alert().text
return True
except:
return False
class test_add_group(unitt... | Test Case for adding groups# -*- coding: utf-8 -*-
from selenium.webdriver.firefox.webdriver import WebDriver
from selenium.webdriver.common.action_chains import ActionChains
import time, unittest
def is_alert_present(wd):
try:
wd.switch_to_alert().text
return True
except:
return False
... | <commit_before><commit_msg>Test Case for adding groups<commit_after># -*- coding: utf-8 -*-
from selenium.webdriver.firefox.webdriver import WebDriver
from selenium.webdriver.common.action_chains import ActionChains
import time, unittest
def is_alert_present(wd):
try:
wd.switch_to_alert().text
retu... | |
469c2932575daaf42d8cec5578c087f4e5c340af | helusers/jwt.py | helusers/jwt.py | from django.utils.translation import ugettext as _
from django.contrib.auth import get_user_model
from rest_framework_jwt.authentication import JSONWebTokenAuthentication
from rest_framework import exceptions
import random
User = get_user_model()
class JWTAuthentication(JSONWebTokenAuthentication):
def populate... | Add Django REST Framework authentication helpers for JWT | Add Django REST Framework authentication helpers for JWT
| Python | bsd-2-clause | City-of-Helsinki/django-helusers,City-of-Helsinki/django-helusers | Add Django REST Framework authentication helpers for JWT | from django.utils.translation import ugettext as _
from django.contrib.auth import get_user_model
from rest_framework_jwt.authentication import JSONWebTokenAuthentication
from rest_framework import exceptions
import random
User = get_user_model()
class JWTAuthentication(JSONWebTokenAuthentication):
def populate... | <commit_before><commit_msg>Add Django REST Framework authentication helpers for JWT<commit_after> | from django.utils.translation import ugettext as _
from django.contrib.auth import get_user_model
from rest_framework_jwt.authentication import JSONWebTokenAuthentication
from rest_framework import exceptions
import random
User = get_user_model()
class JWTAuthentication(JSONWebTokenAuthentication):
def populate... | Add Django REST Framework authentication helpers for JWTfrom django.utils.translation import ugettext as _
from django.contrib.auth import get_user_model
from rest_framework_jwt.authentication import JSONWebTokenAuthentication
from rest_framework import exceptions
import random
User = get_user_model()
class JWTAuthe... | <commit_before><commit_msg>Add Django REST Framework authentication helpers for JWT<commit_after>from django.utils.translation import ugettext as _
from django.contrib.auth import get_user_model
from rest_framework_jwt.authentication import JSONWebTokenAuthentication
from rest_framework import exceptions
import random
... | |
5c3eaede26381babac281dfa0d9bec3ebe911ba8 | util/compile.py | util/compile.py | #!/usr/bin/env python
import sys, os, subprocess
sys.argv.pop(0)
languages = sys.argv
languages.sort()
js_path = os.path.dirname(__file__) + '/../js/'
js_files_to_include = [js_path + 'rainbow.js']
included_languages = []
for language in languages:
path = js_path + 'language/' + language + '.js'
if not os.p... | Add tool for building custom packages | Add tool for building custom packages
| Python | apache-2.0 | HotelsDotCom/rainbow,linuxl0ver/rainbow,linuxl0ver/rainbow,metasyn/rainbow,ccampbell/rainbow,HotelsDotCom/rainbow,cybrox/rainbow,jeremykenedy/rainbow,cybrox/rainbow,segmentio/rainbow,jeremykenedy/rainbow,ptigas/rainbow,greyhwndz/rainbow,linuxl0ver/rainbow,jeremykenedy/rainbow,javipepe/rainbow,greyhwndz/rainbow,metasyn/... | Add tool for building custom packages | #!/usr/bin/env python
import sys, os, subprocess
sys.argv.pop(0)
languages = sys.argv
languages.sort()
js_path = os.path.dirname(__file__) + '/../js/'
js_files_to_include = [js_path + 'rainbow.js']
included_languages = []
for language in languages:
path = js_path + 'language/' + language + '.js'
if not os.p... | <commit_before><commit_msg>Add tool for building custom packages<commit_after> | #!/usr/bin/env python
import sys, os, subprocess
sys.argv.pop(0)
languages = sys.argv
languages.sort()
js_path = os.path.dirname(__file__) + '/../js/'
js_files_to_include = [js_path + 'rainbow.js']
included_languages = []
for language in languages:
path = js_path + 'language/' + language + '.js'
if not os.p... | Add tool for building custom packages#!/usr/bin/env python
import sys, os, subprocess
sys.argv.pop(0)
languages = sys.argv
languages.sort()
js_path = os.path.dirname(__file__) + '/../js/'
js_files_to_include = [js_path + 'rainbow.js']
included_languages = []
for language in languages:
path = js_path + 'language... | <commit_before><commit_msg>Add tool for building custom packages<commit_after>#!/usr/bin/env python
import sys, os, subprocess
sys.argv.pop(0)
languages = sys.argv
languages.sort()
js_path = os.path.dirname(__file__) + '/../js/'
js_files_to_include = [js_path + 'rainbow.js']
included_languages = []
for language in ... | |
f35d5251500268235598e4dbd2ddf91c994e1632 | ixxy_admin_utils/custom_widgets.py | ixxy_admin_utils/custom_widgets.py | from dal_select2_tagging.widgets import TaggingSelect2
from django import VERSION
from tagging.utils import parse_tag_input
class IxxyTaggingSelect2(TaggingSelect2):
# TaggingSelect2 doesn't handle spaces as delimeters in tags
# Django-tagging has a function we can use that just works
def render_options... | Fix for django-tagging and automcomplete | Fix for django-tagging and automcomplete
| Python | mit | DjangoAdminHackers/ixxy-admin-utils,DjangoAdminHackers/ixxy-admin-utils | Fix for django-tagging and automcomplete | from dal_select2_tagging.widgets import TaggingSelect2
from django import VERSION
from tagging.utils import parse_tag_input
class IxxyTaggingSelect2(TaggingSelect2):
# TaggingSelect2 doesn't handle spaces as delimeters in tags
# Django-tagging has a function we can use that just works
def render_options... | <commit_before><commit_msg>Fix for django-tagging and automcomplete<commit_after> | from dal_select2_tagging.widgets import TaggingSelect2
from django import VERSION
from tagging.utils import parse_tag_input
class IxxyTaggingSelect2(TaggingSelect2):
# TaggingSelect2 doesn't handle spaces as delimeters in tags
# Django-tagging has a function we can use that just works
def render_options... | Fix for django-tagging and automcompletefrom dal_select2_tagging.widgets import TaggingSelect2
from django import VERSION
from tagging.utils import parse_tag_input
class IxxyTaggingSelect2(TaggingSelect2):
# TaggingSelect2 doesn't handle spaces as delimeters in tags
# Django-tagging has a function we can use... | <commit_before><commit_msg>Fix for django-tagging and automcomplete<commit_after>from dal_select2_tagging.widgets import TaggingSelect2
from django import VERSION
from tagging.utils import parse_tag_input
class IxxyTaggingSelect2(TaggingSelect2):
# TaggingSelect2 doesn't handle spaces as delimeters in tags
#... | |
47ae456b3a4252d7c838219e3ebd15e049316891 | profile_collection/startup/25-shutter.py | profile_collection/startup/25-shutter.py | from __future__ import print_function
import epics
import logging
from ophyd.controls import EpicsSignal
from ophyd.controls.signal import SignalGroup
class Shutter(SignalGroup):
def __init__(self, open=None, open_status=None,
close=None, close_status=None):
super(Shutter, self).__init__(... | Add three shutters and open/close functions | Add three shutters and open/close functions
| Python | bsd-2-clause | NSLS-II-CHX/ipython_ophyd,NSLS-II-CHX/ipython_ophyd | Add three shutters and open/close functions | from __future__ import print_function
import epics
import logging
from ophyd.controls import EpicsSignal
from ophyd.controls.signal import SignalGroup
class Shutter(SignalGroup):
def __init__(self, open=None, open_status=None,
close=None, close_status=None):
super(Shutter, self).__init__(... | <commit_before><commit_msg>Add three shutters and open/close functions<commit_after> | from __future__ import print_function
import epics
import logging
from ophyd.controls import EpicsSignal
from ophyd.controls.signal import SignalGroup
class Shutter(SignalGroup):
def __init__(self, open=None, open_status=None,
close=None, close_status=None):
super(Shutter, self).__init__(... | Add three shutters and open/close functionsfrom __future__ import print_function
import epics
import logging
from ophyd.controls import EpicsSignal
from ophyd.controls.signal import SignalGroup
class Shutter(SignalGroup):
def __init__(self, open=None, open_status=None,
close=None, close_status=N... | <commit_before><commit_msg>Add three shutters and open/close functions<commit_after>from __future__ import print_function
import epics
import logging
from ophyd.controls import EpicsSignal
from ophyd.controls.signal import SignalGroup
class Shutter(SignalGroup):
def __init__(self, open=None, open_status=None,
... | |
1d021cd7b52ecc4d9684dc607a1ff9f0b8181b37 | read_receiver.py | read_receiver.py | #! /usr/bin/env python
import numpy
from matplotlib import pyplot as plt
import matplotlib.colors as colors
import os
import sys
import seaborn
def ParseVariableBinaryHeader(header):
header_detect = '#'
header = header.strip("\n").split()
assert(header[0] == header_detect)
name = header[1]
dt... | Add python script to read receiver file | Add python script to read receiver file
| Python | apache-2.0 | RaphaelPoncet/2016-macs2-projet-hpc | Add python script to read receiver file | #! /usr/bin/env python
import numpy
from matplotlib import pyplot as plt
import matplotlib.colors as colors
import os
import sys
import seaborn
def ParseVariableBinaryHeader(header):
header_detect = '#'
header = header.strip("\n").split()
assert(header[0] == header_detect)
name = header[1]
dt... | <commit_before><commit_msg>Add python script to read receiver file<commit_after> | #! /usr/bin/env python
import numpy
from matplotlib import pyplot as plt
import matplotlib.colors as colors
import os
import sys
import seaborn
def ParseVariableBinaryHeader(header):
header_detect = '#'
header = header.strip("\n").split()
assert(header[0] == header_detect)
name = header[1]
dt... | Add python script to read receiver file#! /usr/bin/env python
import numpy
from matplotlib import pyplot as plt
import matplotlib.colors as colors
import os
import sys
import seaborn
def ParseVariableBinaryHeader(header):
header_detect = '#'
header = header.strip("\n").split()
assert(header[0] == head... | <commit_before><commit_msg>Add python script to read receiver file<commit_after>#! /usr/bin/env python
import numpy
from matplotlib import pyplot as plt
import matplotlib.colors as colors
import os
import sys
import seaborn
def ParseVariableBinaryHeader(header):
header_detect = '#'
header = header.strip("\... | |
2dc8ae91713fdd73ac1e835dcb191714c2e93593 | tests/test_runner.py | tests/test_runner.py | from twisted.trial import unittest
from ooni.inputunit import InputUnit
from ooni.nettest import NetTestCase
from ooni.reporter import OReporter
from ooni.runner import loadTestsAndOptions, runTestCasesWithInputUnit
class DummyTestCase(NetTestCase):
def test_a(self):
self.report['bar'] = 'bar'
def ... | Add unittests for some methods of runner | Add unittests for some methods of runner
| Python | bsd-2-clause | lordappsec/ooni-probe,juga0/ooni-probe,lordappsec/ooni-probe,Karthikeyan-kkk/ooni-probe,juga0/ooni-probe,0xPoly/ooni-probe,lordappsec/ooni-probe,kdmurray91/ooni-probe,juga0/ooni-probe,0xPoly/ooni-probe,kdmurray91/ooni-probe,lordappsec/ooni-probe,juga0/ooni-probe,Karthikeyan-kkk/ooni-probe,0xPoly/ooni-probe,Karthikeyan-... | Add unittests for some methods of runner | from twisted.trial import unittest
from ooni.inputunit import InputUnit
from ooni.nettest import NetTestCase
from ooni.reporter import OReporter
from ooni.runner import loadTestsAndOptions, runTestCasesWithInputUnit
class DummyTestCase(NetTestCase):
def test_a(self):
self.report['bar'] = 'bar'
def ... | <commit_before><commit_msg>Add unittests for some methods of runner<commit_after> | from twisted.trial import unittest
from ooni.inputunit import InputUnit
from ooni.nettest import NetTestCase
from ooni.reporter import OReporter
from ooni.runner import loadTestsAndOptions, runTestCasesWithInputUnit
class DummyTestCase(NetTestCase):
def test_a(self):
self.report['bar'] = 'bar'
def ... | Add unittests for some methods of runnerfrom twisted.trial import unittest
from ooni.inputunit import InputUnit
from ooni.nettest import NetTestCase
from ooni.reporter import OReporter
from ooni.runner import loadTestsAndOptions, runTestCasesWithInputUnit
class DummyTestCase(NetTestCase):
def test_a(self):
... | <commit_before><commit_msg>Add unittests for some methods of runner<commit_after>from twisted.trial import unittest
from ooni.inputunit import InputUnit
from ooni.nettest import NetTestCase
from ooni.reporter import OReporter
from ooni.runner import loadTestsAndOptions, runTestCasesWithInputUnit
class DummyTestCas... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.