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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
971570b4288c9ac7131a1756e17574acbe6d1b9a | python/misc/solarized-dark-high-contrast.py | python/misc/solarized-dark-high-contrast.py | #!/usr/bin/env python
import sys
if sys.version_info < (3, 4):
sys.exit('ERROR: Requires Python 3.4')
from enum import Enum
def main():
Cases = Enum('Cases', 'lower upper')
infile_case = None
if len(sys.argv) < 2:
sys.stderr.write('ERROR: Must provide a file to modify\n')
sys.ex... | Add script for converting a solarized dark file to solarized dark high contrast | Add script for converting a solarized dark file to solarized dark high contrast
| Python | mit | bmaupin/junkpile,bmaupin/junkpile,bmaupin/junkpile,bmaupin/junkpile,bmaupin/junkpile,bmaupin/junkpile,bmaupin/junkpile,bmaupin/junkpile,bmaupin/junkpile | Add script for converting a solarized dark file to solarized dark high contrast | #!/usr/bin/env python
import sys
if sys.version_info < (3, 4):
sys.exit('ERROR: Requires Python 3.4')
from enum import Enum
def main():
Cases = Enum('Cases', 'lower upper')
infile_case = None
if len(sys.argv) < 2:
sys.stderr.write('ERROR: Must provide a file to modify\n')
sys.ex... | <commit_before><commit_msg>Add script for converting a solarized dark file to solarized dark high contrast<commit_after> | #!/usr/bin/env python
import sys
if sys.version_info < (3, 4):
sys.exit('ERROR: Requires Python 3.4')
from enum import Enum
def main():
Cases = Enum('Cases', 'lower upper')
infile_case = None
if len(sys.argv) < 2:
sys.stderr.write('ERROR: Must provide a file to modify\n')
sys.ex... | Add script for converting a solarized dark file to solarized dark high contrast#!/usr/bin/env python
import sys
if sys.version_info < (3, 4):
sys.exit('ERROR: Requires Python 3.4')
from enum import Enum
def main():
Cases = Enum('Cases', 'lower upper')
infile_case = None
if len(sys.argv) < 2:
... | <commit_before><commit_msg>Add script for converting a solarized dark file to solarized dark high contrast<commit_after>#!/usr/bin/env python
import sys
if sys.version_info < (3, 4):
sys.exit('ERROR: Requires Python 3.4')
from enum import Enum
def main():
Cases = Enum('Cases', 'lower upper')
infile_case... | |
b72c421696b5714d256b7ac461833bc692ca5354 | robot/robot/src/autonomous/hot_aim_shoot.py | robot/robot/src/autonomous/hot_aim_shoot.py |
try:
import wpilib
except ImportError:
from pyfrc import wpilib
import timed_shoot
class HotShootAutonomous(timed_shoot.TimedShootAutonomous):
'''
Based on the TimedShootAutonomous mode. Modified to allow
shooting based on whether the hot goal is enabled or not.
'''
... | Add an autonomous mode to strafe and shoot. Doesn't work | Add an autonomous mode to strafe and shoot. Doesn't work
| Python | bsd-3-clause | frc1418/2014 | Add an autonomous mode to strafe and shoot. Doesn't work |
try:
import wpilib
except ImportError:
from pyfrc import wpilib
import timed_shoot
class HotShootAutonomous(timed_shoot.TimedShootAutonomous):
'''
Based on the TimedShootAutonomous mode. Modified to allow
shooting based on whether the hot goal is enabled or not.
'''
... | <commit_before><commit_msg>Add an autonomous mode to strafe and shoot. Doesn't work<commit_after> |
try:
import wpilib
except ImportError:
from pyfrc import wpilib
import timed_shoot
class HotShootAutonomous(timed_shoot.TimedShootAutonomous):
'''
Based on the TimedShootAutonomous mode. Modified to allow
shooting based on whether the hot goal is enabled or not.
'''
... | Add an autonomous mode to strafe and shoot. Doesn't work
try:
import wpilib
except ImportError:
from pyfrc import wpilib
import timed_shoot
class HotShootAutonomous(timed_shoot.TimedShootAutonomous):
'''
Based on the TimedShootAutonomous mode. Modified to allow
shooting based on... | <commit_before><commit_msg>Add an autonomous mode to strafe and shoot. Doesn't work<commit_after>
try:
import wpilib
except ImportError:
from pyfrc import wpilib
import timed_shoot
class HotShootAutonomous(timed_shoot.TimedShootAutonomous):
'''
Based on the TimedShootAutonomous mode. Mod... | |
17e2b9ecb67c8b1f3a6f71b752bc70b21584092e | tests/test_scriptserver.py | tests/test_scriptserver.py | import unittest
from mock import patch, Mock
import sys
sys.path.append(".")
from scriptserver import ZoneScriptRunner
class TestZoneScriptRunner(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.mongoengine_patch = patch('scriptserver.me')
cls.mongoengine_patch.start()
@classmeth... | Add initial tests for scriptserver. | Add initial tests for scriptserver.
Covers ZoneScriptRunner.__init__ and ZoneScriptRunner.load_scripts.
| Python | agpl-3.0 | cnelsonsic/SimpleMMO,cnelsonsic/SimpleMMO,cnelsonsic/SimpleMMO | Add initial tests for scriptserver.
Covers ZoneScriptRunner.__init__ and ZoneScriptRunner.load_scripts. | import unittest
from mock import patch, Mock
import sys
sys.path.append(".")
from scriptserver import ZoneScriptRunner
class TestZoneScriptRunner(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.mongoengine_patch = patch('scriptserver.me')
cls.mongoengine_patch.start()
@classmeth... | <commit_before><commit_msg>Add initial tests for scriptserver.
Covers ZoneScriptRunner.__init__ and ZoneScriptRunner.load_scripts.<commit_after> | import unittest
from mock import patch, Mock
import sys
sys.path.append(".")
from scriptserver import ZoneScriptRunner
class TestZoneScriptRunner(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.mongoengine_patch = patch('scriptserver.me')
cls.mongoengine_patch.start()
@classmeth... | Add initial tests for scriptserver.
Covers ZoneScriptRunner.__init__ and ZoneScriptRunner.load_scripts.import unittest
from mock import patch, Mock
import sys
sys.path.append(".")
from scriptserver import ZoneScriptRunner
class TestZoneScriptRunner(unittest.TestCase):
@classmethod
def setUpClass(cls):
... | <commit_before><commit_msg>Add initial tests for scriptserver.
Covers ZoneScriptRunner.__init__ and ZoneScriptRunner.load_scripts.<commit_after>import unittest
from mock import patch, Mock
import sys
sys.path.append(".")
from scriptserver import ZoneScriptRunner
class TestZoneScriptRunner(unittest.TestCase):
@cl... | |
b63e65b1a41f809caf1c2dcd689955df76add20f | test/test_delta.py | test/test_delta.py | import matplotlib.pyplot as plt
import numpy as np
import scattering
import scipy.constants as consts
def plot_csec(scatterer, d, var, name):
plt.plot(d / consts.centi, var,
label='%.1f cm' % (scatterer.wavelength / consts.centi))
plt.xlabel('Diameter (cm)')
plt.ylabel(name)
def plot_csecs(d, ... | Add a plot just of backscatter phase vs. diameter. | Add a plot just of backscatter phase vs. diameter.
This (mostly) reproduces a figure in Matrosov et al. 2002 in JAM.
| Python | bsd-2-clause | dopplershift/Scattering | Add a plot just of backscatter phase vs. diameter.
This (mostly) reproduces a figure in Matrosov et al. 2002 in JAM. | import matplotlib.pyplot as plt
import numpy as np
import scattering
import scipy.constants as consts
def plot_csec(scatterer, d, var, name):
plt.plot(d / consts.centi, var,
label='%.1f cm' % (scatterer.wavelength / consts.centi))
plt.xlabel('Diameter (cm)')
plt.ylabel(name)
def plot_csecs(d, ... | <commit_before><commit_msg>Add a plot just of backscatter phase vs. diameter.
This (mostly) reproduces a figure in Matrosov et al. 2002 in JAM.<commit_after> | import matplotlib.pyplot as plt
import numpy as np
import scattering
import scipy.constants as consts
def plot_csec(scatterer, d, var, name):
plt.plot(d / consts.centi, var,
label='%.1f cm' % (scatterer.wavelength / consts.centi))
plt.xlabel('Diameter (cm)')
plt.ylabel(name)
def plot_csecs(d, ... | Add a plot just of backscatter phase vs. diameter.
This (mostly) reproduces a figure in Matrosov et al. 2002 in JAM.import matplotlib.pyplot as plt
import numpy as np
import scattering
import scipy.constants as consts
def plot_csec(scatterer, d, var, name):
plt.plot(d / consts.centi, var,
label='%.1f ... | <commit_before><commit_msg>Add a plot just of backscatter phase vs. diameter.
This (mostly) reproduces a figure in Matrosov et al. 2002 in JAM.<commit_after>import matplotlib.pyplot as plt
import numpy as np
import scattering
import scipy.constants as consts
def plot_csec(scatterer, d, var, name):
plt.plot(d / co... | |
da2a4fa9e618b212ddbb2fcbc079fa37970ae596 | tfd/loggingutil.py | tfd/loggingutil.py |
'''
Utilities to assist with logging in python
'''
import logging
class ConcurrentFileHandler(logging.Handler):
"""
A handler class which writes logging records to a file. Every time it
writes a record it opens the file, writes to it, flushes the buffer, and
closes the file. Perhaps this could cre... | Add handler for concurrently logging to a file | Add handler for concurrently logging to a file
| Python | mit | todddeluca/tfd | Add handler for concurrently logging to a file |
'''
Utilities to assist with logging in python
'''
import logging
class ConcurrentFileHandler(logging.Handler):
"""
A handler class which writes logging records to a file. Every time it
writes a record it opens the file, writes to it, flushes the buffer, and
closes the file. Perhaps this could cre... | <commit_before><commit_msg>Add handler for concurrently logging to a file<commit_after> |
'''
Utilities to assist with logging in python
'''
import logging
class ConcurrentFileHandler(logging.Handler):
"""
A handler class which writes logging records to a file. Every time it
writes a record it opens the file, writes to it, flushes the buffer, and
closes the file. Perhaps this could cre... | Add handler for concurrently logging to a file
'''
Utilities to assist with logging in python
'''
import logging
class ConcurrentFileHandler(logging.Handler):
"""
A handler class which writes logging records to a file. Every time it
writes a record it opens the file, writes to it, flushes the buffer, an... | <commit_before><commit_msg>Add handler for concurrently logging to a file<commit_after>
'''
Utilities to assist with logging in python
'''
import logging
class ConcurrentFileHandler(logging.Handler):
"""
A handler class which writes logging records to a file. Every time it
writes a record it opens the f... | |
700db5c742be8a893b1c362ae0955a934b88c39b | test_journal.py | test_journal.py | # -*- coding: utf-8 -*-
from contextlib import closing
import pytest
from journal import app
from journal import connect_db
from journal import get_database_connection
from journal import init_db
TEST_DSN = 'dbname=test_learning_journal'
def clear_db():
with closing(connect_db()) as db:
db.cursor().exec... | Add test_learning_journal.py with test_app() for configuring the app for testing | Add test_learning_journal.py with test_app() for configuring the app for testing
| Python | mit | sazlin/learning_journal | Add test_learning_journal.py with test_app() for configuring the app for testing | # -*- coding: utf-8 -*-
from contextlib import closing
import pytest
from journal import app
from journal import connect_db
from journal import get_database_connection
from journal import init_db
TEST_DSN = 'dbname=test_learning_journal'
def clear_db():
with closing(connect_db()) as db:
db.cursor().exec... | <commit_before><commit_msg>Add test_learning_journal.py with test_app() for configuring the app for testing<commit_after> | # -*- coding: utf-8 -*-
from contextlib import closing
import pytest
from journal import app
from journal import connect_db
from journal import get_database_connection
from journal import init_db
TEST_DSN = 'dbname=test_learning_journal'
def clear_db():
with closing(connect_db()) as db:
db.cursor().exec... | Add test_learning_journal.py with test_app() for configuring the app for testing# -*- coding: utf-8 -*-
from contextlib import closing
import pytest
from journal import app
from journal import connect_db
from journal import get_database_connection
from journal import init_db
TEST_DSN = 'dbname=test_learning_journal'
... | <commit_before><commit_msg>Add test_learning_journal.py with test_app() for configuring the app for testing<commit_after># -*- coding: utf-8 -*-
from contextlib import closing
import pytest
from journal import app
from journal import connect_db
from journal import get_database_connection
from journal import init_db
T... | |
eb1c7d1c2bfaa063c98612d64bbe35dedf217143 | tests/test_alerter.py | tests/test_alerter.py | import unittest
import datetime
import Alerters.alerter
class TestAlerter(unittest.TestCase):
def test_groups(self):
config_options = {'groups': 'a,b,c'}
a = Alerters.alerter.Alerter(config_options)
self.assertEqual(['a', 'b', 'c'], a.groups)
def test_times_always(self):
conf... | Add initial tests for alerter class | Add initial tests for alerter class
| Python | bsd-3-clause | jamesoff/simplemonitor,jamesoff/simplemonitor,jamesoff/simplemonitor,jamesoff/simplemonitor,jamesoff/simplemonitor | Add initial tests for alerter class | import unittest
import datetime
import Alerters.alerter
class TestAlerter(unittest.TestCase):
def test_groups(self):
config_options = {'groups': 'a,b,c'}
a = Alerters.alerter.Alerter(config_options)
self.assertEqual(['a', 'b', 'c'], a.groups)
def test_times_always(self):
conf... | <commit_before><commit_msg>Add initial tests for alerter class<commit_after> | import unittest
import datetime
import Alerters.alerter
class TestAlerter(unittest.TestCase):
def test_groups(self):
config_options = {'groups': 'a,b,c'}
a = Alerters.alerter.Alerter(config_options)
self.assertEqual(['a', 'b', 'c'], a.groups)
def test_times_always(self):
conf... | Add initial tests for alerter classimport unittest
import datetime
import Alerters.alerter
class TestAlerter(unittest.TestCase):
def test_groups(self):
config_options = {'groups': 'a,b,c'}
a = Alerters.alerter.Alerter(config_options)
self.assertEqual(['a', 'b', 'c'], a.groups)
def te... | <commit_before><commit_msg>Add initial tests for alerter class<commit_after>import unittest
import datetime
import Alerters.alerter
class TestAlerter(unittest.TestCase):
def test_groups(self):
config_options = {'groups': 'a,b,c'}
a = Alerters.alerter.Alerter(config_options)
self.assertEqu... | |
33658163b909073aae074b5b2cdae40a0e5c44e8 | tests/test_asyncio.py | tests/test_asyncio.py | from trollius import test_utils
from trollius import From, Return
import trollius
import unittest
try:
import asyncio
except ImportError:
from trollius.test_utils import SkipTest
raise SkipTest('need asyncio')
# "yield from" syntax cannot be used directly, because Python 2 should be able
# to execute thi... | Add unit tests for asyncio coroutines | Add unit tests for asyncio coroutines
| Python | apache-2.0 | overcastcloud/trollius,overcastcloud/trollius,overcastcloud/trollius | Add unit tests for asyncio coroutines | from trollius import test_utils
from trollius import From, Return
import trollius
import unittest
try:
import asyncio
except ImportError:
from trollius.test_utils import SkipTest
raise SkipTest('need asyncio')
# "yield from" syntax cannot be used directly, because Python 2 should be able
# to execute thi... | <commit_before><commit_msg>Add unit tests for asyncio coroutines<commit_after> | from trollius import test_utils
from trollius import From, Return
import trollius
import unittest
try:
import asyncio
except ImportError:
from trollius.test_utils import SkipTest
raise SkipTest('need asyncio')
# "yield from" syntax cannot be used directly, because Python 2 should be able
# to execute thi... | Add unit tests for asyncio coroutinesfrom trollius import test_utils
from trollius import From, Return
import trollius
import unittest
try:
import asyncio
except ImportError:
from trollius.test_utils import SkipTest
raise SkipTest('need asyncio')
# "yield from" syntax cannot be used directly, because Pyt... | <commit_before><commit_msg>Add unit tests for asyncio coroutines<commit_after>from trollius import test_utils
from trollius import From, Return
import trollius
import unittest
try:
import asyncio
except ImportError:
from trollius.test_utils import SkipTest
raise SkipTest('need asyncio')
# "yield from" sy... | |
1ffdfc3c7ae11c583b2ea4d45b50136996bcf3e3 | tests/mocks.py | tests/mocks.py | from http.server import BaseHTTPRequestHandler, HTTPServer
import json
import socket
from threading import Thread
import requests
# https://realpython.com/blog/python/testing-third-party-apis-with-mock-servers/
class MockHTTPServerRequestHandler(BaseHTTPRequestHandler):
def do_OPTIONS(self):
# add respo... | Add mock HTTP server to respond to requests from web UI | Add mock HTTP server to respond to requests from web UI
| Python | mpl-2.0 | jmlong1027/multiscanner,jmlong1027/multiscanner,mitre/multiscanner,mitre/multiscanner,mitre/multiscanner,jmlong1027/multiscanner,MITRECND/multiscanner,MITRECND/multiscanner,jmlong1027/multiscanner | Add mock HTTP server to respond to requests from web UI | from http.server import BaseHTTPRequestHandler, HTTPServer
import json
import socket
from threading import Thread
import requests
# https://realpython.com/blog/python/testing-third-party-apis-with-mock-servers/
class MockHTTPServerRequestHandler(BaseHTTPRequestHandler):
def do_OPTIONS(self):
# add respo... | <commit_before><commit_msg>Add mock HTTP server to respond to requests from web UI<commit_after> | from http.server import BaseHTTPRequestHandler, HTTPServer
import json
import socket
from threading import Thread
import requests
# https://realpython.com/blog/python/testing-third-party-apis-with-mock-servers/
class MockHTTPServerRequestHandler(BaseHTTPRequestHandler):
def do_OPTIONS(self):
# add respo... | Add mock HTTP server to respond to requests from web UIfrom http.server import BaseHTTPRequestHandler, HTTPServer
import json
import socket
from threading import Thread
import requests
# https://realpython.com/blog/python/testing-third-party-apis-with-mock-servers/
class MockHTTPServerRequestHandler(BaseHTTPRequestH... | <commit_before><commit_msg>Add mock HTTP server to respond to requests from web UI<commit_after>from http.server import BaseHTTPRequestHandler, HTTPServer
import json
import socket
from threading import Thread
import requests
# https://realpython.com/blog/python/testing-third-party-apis-with-mock-servers/
class Mock... | |
744d7971926bf7672ce01388b8617be1ee35df0e | xunit-autolabeler-v2/ast_parser/core/test_data/parser/exclude_tags/exclude_tags_main.py | xunit-autolabeler-v2/ast_parser/core/test_data/parser/exclude_tags/exclude_tags_main.py | # Copyright 2020 Google LLC.
#
# 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, ... | Add missing test data folder | Add missing test data folder
| Python | apache-2.0 | GoogleCloudPlatform/repo-automation-playground,GoogleCloudPlatform/repo-automation-playground,GoogleCloudPlatform/repo-automation-playground,GoogleCloudPlatform/repo-automation-playground,GoogleCloudPlatform/repo-automation-playground,GoogleCloudPlatform/repo-automation-playground,GoogleCloudPlatform/repo-automation-pl... | Add missing test data folder | # Copyright 2020 Google LLC.
#
# 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, ... | <commit_before><commit_msg>Add missing test data folder<commit_after> | # Copyright 2020 Google LLC.
#
# 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, ... | Add missing test data folder# Copyright 2020 Google LLC.
#
# 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 l... | <commit_before><commit_msg>Add missing test data folder<commit_after># Copyright 2020 Google LLC.
#
# 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/LICENS... | |
24baf3e5e7a608d0b34d74be25f96f1b74b7622e | web/social/tasks.py | web/social/tasks.py | from celery.task import PeriodicTask
from datetime import timedelta
from social.utils import FeedUpdater, UpdateError
class UpdateFeedsTask(PeriodicTask):
run_every = timedelta(minutes=15)
def run(self, **kwargs):
logger = self.get_logger()
updater = FeedUpdater(logger)
print "Updatin... | Add feed update task for social app | Add feed update task for social app
| Python | agpl-3.0 | kansanmuisti/datavaalit,kansanmuisti/datavaalit | Add feed update task for social app | from celery.task import PeriodicTask
from datetime import timedelta
from social.utils import FeedUpdater, UpdateError
class UpdateFeedsTask(PeriodicTask):
run_every = timedelta(minutes=15)
def run(self, **kwargs):
logger = self.get_logger()
updater = FeedUpdater(logger)
print "Updatin... | <commit_before><commit_msg>Add feed update task for social app<commit_after> | from celery.task import PeriodicTask
from datetime import timedelta
from social.utils import FeedUpdater, UpdateError
class UpdateFeedsTask(PeriodicTask):
run_every = timedelta(minutes=15)
def run(self, **kwargs):
logger = self.get_logger()
updater = FeedUpdater(logger)
print "Updatin... | Add feed update task for social appfrom celery.task import PeriodicTask
from datetime import timedelta
from social.utils import FeedUpdater, UpdateError
class UpdateFeedsTask(PeriodicTask):
run_every = timedelta(minutes=15)
def run(self, **kwargs):
logger = self.get_logger()
updater = FeedUpd... | <commit_before><commit_msg>Add feed update task for social app<commit_after>from celery.task import PeriodicTask
from datetime import timedelta
from social.utils import FeedUpdater, UpdateError
class UpdateFeedsTask(PeriodicTask):
run_every = timedelta(minutes=15)
def run(self, **kwargs):
logger = se... | |
3fb4d7b630fb7a4b34dcc4e1b72947e61f73a80f | TestData/download_test_data.py | TestData/download_test_data.py | def set_test_db():
from sys import path
path.insert(0, "..")
from MyEdgarDb import get_list_sec_filings, get_cik_ticker_lookup_db, lookup_cik_ticker
get_list_sec_filings (7, 'test_idx.db')
get_cik_ticker_lookup_db ('test_idx.db')
def download_test_data():
import sqlite3
from datetime import... | Create script to dowload requisite test urls. | Create script to dowload requisite test urls.
| Python | agpl-3.0 | cielling/jupyternbs | Create script to dowload requisite test urls. | def set_test_db():
from sys import path
path.insert(0, "..")
from MyEdgarDb import get_list_sec_filings, get_cik_ticker_lookup_db, lookup_cik_ticker
get_list_sec_filings (7, 'test_idx.db')
get_cik_ticker_lookup_db ('test_idx.db')
def download_test_data():
import sqlite3
from datetime import... | <commit_before><commit_msg>Create script to dowload requisite test urls.<commit_after> | def set_test_db():
from sys import path
path.insert(0, "..")
from MyEdgarDb import get_list_sec_filings, get_cik_ticker_lookup_db, lookup_cik_ticker
get_list_sec_filings (7, 'test_idx.db')
get_cik_ticker_lookup_db ('test_idx.db')
def download_test_data():
import sqlite3
from datetime import... | Create script to dowload requisite test urls.def set_test_db():
from sys import path
path.insert(0, "..")
from MyEdgarDb import get_list_sec_filings, get_cik_ticker_lookup_db, lookup_cik_ticker
get_list_sec_filings (7, 'test_idx.db')
get_cik_ticker_lookup_db ('test_idx.db')
def download_test_data()... | <commit_before><commit_msg>Create script to dowload requisite test urls.<commit_after>def set_test_db():
from sys import path
path.insert(0, "..")
from MyEdgarDb import get_list_sec_filings, get_cik_ticker_lookup_db, lookup_cik_ticker
get_list_sec_filings (7, 'test_idx.db')
get_cik_ticker_lookup_db ... | |
3ebb2731d6389170e0bef0dab66dc7c4ab41152e | thread_pool_test.py | thread_pool_test.py | import thread_pool
import unittest
from six.moves import queue
class TestThreadPool(unittest.TestCase):
def _producer_thread(self, results):
for i in range(10):
results.put(i)
def _consumer_thread(self, results):
for i in range(10):
self.assertEqual(results.get(), i)
def testContextManager... | Add a unit-test for thread_pool.py. | Add a unit-test for thread_pool.py.
| Python | mit | graveljp/smugcli | Add a unit-test for thread_pool.py. | import thread_pool
import unittest
from six.moves import queue
class TestThreadPool(unittest.TestCase):
def _producer_thread(self, results):
for i in range(10):
results.put(i)
def _consumer_thread(self, results):
for i in range(10):
self.assertEqual(results.get(), i)
def testContextManager... | <commit_before><commit_msg>Add a unit-test for thread_pool.py.<commit_after> | import thread_pool
import unittest
from six.moves import queue
class TestThreadPool(unittest.TestCase):
def _producer_thread(self, results):
for i in range(10):
results.put(i)
def _consumer_thread(self, results):
for i in range(10):
self.assertEqual(results.get(), i)
def testContextManager... | Add a unit-test for thread_pool.py.import thread_pool
import unittest
from six.moves import queue
class TestThreadPool(unittest.TestCase):
def _producer_thread(self, results):
for i in range(10):
results.put(i)
def _consumer_thread(self, results):
for i in range(10):
self.assertEqual(results.... | <commit_before><commit_msg>Add a unit-test for thread_pool.py.<commit_after>import thread_pool
import unittest
from six.moves import queue
class TestThreadPool(unittest.TestCase):
def _producer_thread(self, results):
for i in range(10):
results.put(i)
def _consumer_thread(self, results):
for i in r... | |
19712e8e7b9423d4cb4bb22c37c7d8d2ea0559c5 | examples/list-usb.py | examples/list-usb.py | #!/usr/bin/env python2
#
# This file is Public Domain and provided only for documentation purposes.
#
# Run : python2 ./list-usb.py
#
# Note: This will happily run with Python3 too, I just picked a common baseline
#
import gi
gi.require_version('Ldm', '0.1')
from gi.repository import Ldm, GObject
class PretendyPlugin... | Add example to show listing of USB devices | examples: Add example to show listing of USB devices
Also we add a quick example of how to implement a custom plugin to provide
runtime plugin support for LdmManager.
Signed-off-by: Ikey Doherty <d8d992cf0016e35c2a8339d5e7d44bebd12a2d77@solus-project.com>
| Python | lgpl-2.1 | solus-project/linux-driver-management,solus-project/linux-driver-management | examples: Add example to show listing of USB devices
Also we add a quick example of how to implement a custom plugin to provide
runtime plugin support for LdmManager.
Signed-off-by: Ikey Doherty <d8d992cf0016e35c2a8339d5e7d44bebd12a2d77@solus-project.com> | #!/usr/bin/env python2
#
# This file is Public Domain and provided only for documentation purposes.
#
# Run : python2 ./list-usb.py
#
# Note: This will happily run with Python3 too, I just picked a common baseline
#
import gi
gi.require_version('Ldm', '0.1')
from gi.repository import Ldm, GObject
class PretendyPlugin... | <commit_before><commit_msg>examples: Add example to show listing of USB devices
Also we add a quick example of how to implement a custom plugin to provide
runtime plugin support for LdmManager.
Signed-off-by: Ikey Doherty <d8d992cf0016e35c2a8339d5e7d44bebd12a2d77@solus-project.com><commit_after> | #!/usr/bin/env python2
#
# This file is Public Domain and provided only for documentation purposes.
#
# Run : python2 ./list-usb.py
#
# Note: This will happily run with Python3 too, I just picked a common baseline
#
import gi
gi.require_version('Ldm', '0.1')
from gi.repository import Ldm, GObject
class PretendyPlugin... | examples: Add example to show listing of USB devices
Also we add a quick example of how to implement a custom plugin to provide
runtime plugin support for LdmManager.
Signed-off-by: Ikey Doherty <d8d992cf0016e35c2a8339d5e7d44bebd12a2d77@solus-project.com>#!/usr/bin/env python2
#
# This file is Public Domain and provi... | <commit_before><commit_msg>examples: Add example to show listing of USB devices
Also we add a quick example of how to implement a custom plugin to provide
runtime plugin support for LdmManager.
Signed-off-by: Ikey Doherty <d8d992cf0016e35c2a8339d5e7d44bebd12a2d77@solus-project.com><commit_after>#!/usr/bin/env python2... | |
b56690d046021e036b5b15c484d86c92f3519600 | scikits/learn/common/myfunctools.py | scikits/learn/common/myfunctools.py | # Last Change: Mon Aug 20 01:00 PM 2007 J
# Implement partial application (should only be used if functools is not
# available (eg python < 2.5)
class partial:
def __init__(self, fun, *args, **kwargs):
self.fun = fun
self.pending = args[:]
self.kwargs = kwargs.copy()
def __call__(self,... | Add partial evaluation tool to replace functools module for python < 2.5 | Add partial evaluation tool to replace functools module for python < 2.5
From: cdavid <cdavid@cb17146a-f446-4be1-a4f7-bd7c5bb65646>
git-svn-id: a2d1b0e147e530765aaf3e1662d4a98e2f63c719@236 22fbfee3-77ab-4535-9bad-27d1bd3bc7d8
| Python | bsd-3-clause | shikhardb/scikit-learn,ClimbsRocks/scikit-learn,bthirion/scikit-learn,samuel1208/scikit-learn,sinhrks/scikit-learn,OshynSong/scikit-learn,ky822/scikit-learn,treycausey/scikit-learn,TomDLT/scikit-learn,RomainBrault/scikit-learn,zuku1985/scikit-learn,icdishb/scikit-learn,arabenjamin/scikit-learn,sarahgrogan/scikit-learn,... | Add partial evaluation tool to replace functools module for python < 2.5
From: cdavid <cdavid@cb17146a-f446-4be1-a4f7-bd7c5bb65646>
git-svn-id: a2d1b0e147e530765aaf3e1662d4a98e2f63c719@236 22fbfee3-77ab-4535-9bad-27d1bd3bc7d8 | # Last Change: Mon Aug 20 01:00 PM 2007 J
# Implement partial application (should only be used if functools is not
# available (eg python < 2.5)
class partial:
def __init__(self, fun, *args, **kwargs):
self.fun = fun
self.pending = args[:]
self.kwargs = kwargs.copy()
def __call__(self,... | <commit_before><commit_msg>Add partial evaluation tool to replace functools module for python < 2.5
From: cdavid <cdavid@cb17146a-f446-4be1-a4f7-bd7c5bb65646>
git-svn-id: a2d1b0e147e530765aaf3e1662d4a98e2f63c719@236 22fbfee3-77ab-4535-9bad-27d1bd3bc7d8<commit_after> | # Last Change: Mon Aug 20 01:00 PM 2007 J
# Implement partial application (should only be used if functools is not
# available (eg python < 2.5)
class partial:
def __init__(self, fun, *args, **kwargs):
self.fun = fun
self.pending = args[:]
self.kwargs = kwargs.copy()
def __call__(self,... | Add partial evaluation tool to replace functools module for python < 2.5
From: cdavid <cdavid@cb17146a-f446-4be1-a4f7-bd7c5bb65646>
git-svn-id: a2d1b0e147e530765aaf3e1662d4a98e2f63c719@236 22fbfee3-77ab-4535-9bad-27d1bd3bc7d8# Last Change: Mon Aug 20 01:00 PM 2007 J
# Implement partial application (should only be use... | <commit_before><commit_msg>Add partial evaluation tool to replace functools module for python < 2.5
From: cdavid <cdavid@cb17146a-f446-4be1-a4f7-bd7c5bb65646>
git-svn-id: a2d1b0e147e530765aaf3e1662d4a98e2f63c719@236 22fbfee3-77ab-4535-9bad-27d1bd3bc7d8<commit_after># Last Change: Mon Aug 20 01:00 PM 2007 J
# Implemen... | |
51e04ff17bccb4b71b8d5db4057a782fd2f8520c | tools/touch_all_files.py | tools/touch_all_files.py | #!/usr/bin/python
"""
This script touches all files known to the database, creating a skeletal
mirror for local development.
"""
import sys, os
import store
def get_paths(cursor, prefix=None):
store.safe_execute(cursor, "SELECT python_version, name, filename FROM release_files")
for type, name, filename in c... | Add script to synthesize all uploaded files. Patch by Dan Callahan. | Add script to synthesize all uploaded files.
Patch by Dan Callahan.
| Python | bsd-3-clause | techtonik/pydotorg.pypi,techtonik/pydotorg.pypi | Add script to synthesize all uploaded files.
Patch by Dan Callahan. | #!/usr/bin/python
"""
This script touches all files known to the database, creating a skeletal
mirror for local development.
"""
import sys, os
import store
def get_paths(cursor, prefix=None):
store.safe_execute(cursor, "SELECT python_version, name, filename FROM release_files")
for type, name, filename in c... | <commit_before><commit_msg>Add script to synthesize all uploaded files.
Patch by Dan Callahan.<commit_after> | #!/usr/bin/python
"""
This script touches all files known to the database, creating a skeletal
mirror for local development.
"""
import sys, os
import store
def get_paths(cursor, prefix=None):
store.safe_execute(cursor, "SELECT python_version, name, filename FROM release_files")
for type, name, filename in c... | Add script to synthesize all uploaded files.
Patch by Dan Callahan.#!/usr/bin/python
"""
This script touches all files known to the database, creating a skeletal
mirror for local development.
"""
import sys, os
import store
def get_paths(cursor, prefix=None):
store.safe_execute(cursor, "SELECT python_version, nam... | <commit_before><commit_msg>Add script to synthesize all uploaded files.
Patch by Dan Callahan.<commit_after>#!/usr/bin/python
"""
This script touches all files known to the database, creating a skeletal
mirror for local development.
"""
import sys, os
import store
def get_paths(cursor, prefix=None):
store.safe_ex... | |
533559e20e377ce042591709e53d7dc7031d6205 | tests/test_directives.py | tests/test_directives.py | """tests/test_directives.py.
Tests to ensure that directives interact in the etimerpected mannor
Copyright (C) 2015 Timothy Edmund Crosley
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without... | """tests/test_directives.py.
Tests to ensure that directives interact in the etimerpected mannor
Copyright (C) 2015 Timothy Edmund Crosley
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without... | Add test for timer automatically inserted due to directive | Add test for timer automatically inserted due to directive
| Python | mit | giserh/hug,STANAPO/hug,MuhammadAlkarouri/hug,janusnic/hug,MuhammadAlkarouri/hug,janusnic/hug,gbn972/hug,MuhammadAlkarouri/hug,STANAPO/hug,shaunstanislaus/hug,yasoob/hug,jean/hug,philiptzou/hug,philiptzou/hug,jean/hug,shaunstanislaus/hug,origingod/hug,giserh/hug,yasoob/hug,timothycrosley/hug,alisaifee/hug,timothycrosley... | """tests/test_directives.py.
Tests to ensure that directives interact in the etimerpected mannor
Copyright (C) 2015 Timothy Edmund Crosley
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without... | """tests/test_directives.py.
Tests to ensure that directives interact in the etimerpected mannor
Copyright (C) 2015 Timothy Edmund Crosley
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without... | <commit_before>"""tests/test_directives.py.
Tests to ensure that directives interact in the etimerpected mannor
Copyright (C) 2015 Timothy Edmund Crosley
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the S... | """tests/test_directives.py.
Tests to ensure that directives interact in the etimerpected mannor
Copyright (C) 2015 Timothy Edmund Crosley
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without... | """tests/test_directives.py.
Tests to ensure that directives interact in the etimerpected mannor
Copyright (C) 2015 Timothy Edmund Crosley
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without... | <commit_before>"""tests/test_directives.py.
Tests to ensure that directives interact in the etimerpected mannor
Copyright (C) 2015 Timothy Edmund Crosley
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the S... |
a3939b572c51b7a721b758cb5b93364e4b156c13 | dev_tools/syspath.py | dev_tools/syspath.py | #!/usr/bin/env python
import sys
# path[0], is the directory containing the script that was used to invoke the Python interpreter
for s in sorted(sys.path[1:]):
print s
| Add script that dumps the python path | Add script that dumps the python path
| Python | apache-2.0 | DataONEorg/d1_python,DataONEorg/d1_python,DataONEorg/d1_python,DataONEorg/d1_python | Add script that dumps the python path | #!/usr/bin/env python
import sys
# path[0], is the directory containing the script that was used to invoke the Python interpreter
for s in sorted(sys.path[1:]):
print s
| <commit_before><commit_msg>Add script that dumps the python path<commit_after> | #!/usr/bin/env python
import sys
# path[0], is the directory containing the script that was used to invoke the Python interpreter
for s in sorted(sys.path[1:]):
print s
| Add script that dumps the python path#!/usr/bin/env python
import sys
# path[0], is the directory containing the script that was used to invoke the Python interpreter
for s in sorted(sys.path[1:]):
print s
| <commit_before><commit_msg>Add script that dumps the python path<commit_after>#!/usr/bin/env python
import sys
# path[0], is the directory containing the script that was used to invoke the Python interpreter
for s in sorted(sys.path[1:]):
print s
| |
f06a71a87daaaf0bc4b1f5701ce4c59805b70f6b | usr/bin/json_readable.py | usr/bin/json_readable.py | #!/usr/bin/env python
import json, os
for filename in os.listdir('.'):
if os.path.isfile(filename) and os.path.splitext(filename)[1].lower() == '.json':
with open(filename) as in_file:
data = json.load(in_file)
with open(filename, 'w') as out_file:
json.dump(data, out_file,... | Format all local .json files for human readability | Format all local .json files for human readability | Python | apache-2.0 | cclauss/Ten-lines-or-less | Format all local .json files for human readability | #!/usr/bin/env python
import json, os
for filename in os.listdir('.'):
if os.path.isfile(filename) and os.path.splitext(filename)[1].lower() == '.json':
with open(filename) as in_file:
data = json.load(in_file)
with open(filename, 'w') as out_file:
json.dump(data, out_file,... | <commit_before><commit_msg>Format all local .json files for human readability<commit_after> | #!/usr/bin/env python
import json, os
for filename in os.listdir('.'):
if os.path.isfile(filename) and os.path.splitext(filename)[1].lower() == '.json':
with open(filename) as in_file:
data = json.load(in_file)
with open(filename, 'w') as out_file:
json.dump(data, out_file,... | Format all local .json files for human readability#!/usr/bin/env python
import json, os
for filename in os.listdir('.'):
if os.path.isfile(filename) and os.path.splitext(filename)[1].lower() == '.json':
with open(filename) as in_file:
data = json.load(in_file)
with open(filename, 'w') ... | <commit_before><commit_msg>Format all local .json files for human readability<commit_after>#!/usr/bin/env python
import json, os
for filename in os.listdir('.'):
if os.path.isfile(filename) and os.path.splitext(filename)[1].lower() == '.json':
with open(filename) as in_file:
data = json.load(i... | |
ed4d07fb2a7fa8f1dd30a2b7982940a5fe78275b | dakota_run_driver.py | dakota_run_driver.py | #! /usr/bin/env python
# Brokers communication between Dakota and SWASH through files.
#
# Arguments:
# $1 is 'params.in' from Dakota
# $2 is 'results.out' returned to Dakota
import sys
import os
import shutil
from subprocess import call
def driver():
"""Broker communication between Dakota and SWASH through ... | Add the analysis driver for the run step of the study | Add the analysis driver for the run step of the study
| Python | mit | mdpiper/dakota-swash-parameter-study,mdpiper/dakota-swash-parameter-study | Add the analysis driver for the run step of the study | #! /usr/bin/env python
# Brokers communication between Dakota and SWASH through files.
#
# Arguments:
# $1 is 'params.in' from Dakota
# $2 is 'results.out' returned to Dakota
import sys
import os
import shutil
from subprocess import call
def driver():
"""Broker communication between Dakota and SWASH through ... | <commit_before><commit_msg>Add the analysis driver for the run step of the study<commit_after> | #! /usr/bin/env python
# Brokers communication between Dakota and SWASH through files.
#
# Arguments:
# $1 is 'params.in' from Dakota
# $2 is 'results.out' returned to Dakota
import sys
import os
import shutil
from subprocess import call
def driver():
"""Broker communication between Dakota and SWASH through ... | Add the analysis driver for the run step of the study#! /usr/bin/env python
# Brokers communication between Dakota and SWASH through files.
#
# Arguments:
# $1 is 'params.in' from Dakota
# $2 is 'results.out' returned to Dakota
import sys
import os
import shutil
from subprocess import call
def driver():
"""B... | <commit_before><commit_msg>Add the analysis driver for the run step of the study<commit_after>#! /usr/bin/env python
# Brokers communication between Dakota and SWASH through files.
#
# Arguments:
# $1 is 'params.in' from Dakota
# $2 is 'results.out' returned to Dakota
import sys
import os
import shutil
from subpro... | |
dab192db863fdd694bb0adbce10fa2dd6c05353b | jrnl/__init__.py | jrnl/__init__.py | #!/usr/bin/env python
# encoding: utf-8
"""
jrnl is a simple journal application for your command line.
"""
__title__ = 'jrnl'
__version__ = '1.0.3'
__author__ = 'Manuel Ebert'
__license__ = 'MIT License'
__copyright__ = 'Copyright 2013 Manuel Ebert'
from . import Journal
from . import jrnl
| #!/usr/bin/env python
# encoding: utf-8
"""
jrnl is a simple journal application for your command line.
"""
__title__ = 'jrnl'
__version__ = '1.0.3'
__author__ = 'Manuel Ebert'
__license__ = 'MIT License'
__copyright__ = 'Copyright 2013 Manuel Ebert'
from . import Journal
from . import jrnl
from .jrnl import cli
| Make the cli work again. | Make the cli work again.
| Python | mit | rzyns/jrnl,philipsd6/jrnl,notbalanced/jrnl,flight16/jrnl,maebert/jrnl,MSylvia/jrnl,dzeban/jrnl,nikvdp/jrnl,cloudrave/jrnl-todos,MinchinWeb/jrnl,beni55/jrnl,zdravi/jrnl,Shir0kamii/jrnl | #!/usr/bin/env python
# encoding: utf-8
"""
jrnl is a simple journal application for your command line.
"""
__title__ = 'jrnl'
__version__ = '1.0.3'
__author__ = 'Manuel Ebert'
__license__ = 'MIT License'
__copyright__ = 'Copyright 2013 Manuel Ebert'
from . import Journal
from . import jrnl
Make the cli work again. | #!/usr/bin/env python
# encoding: utf-8
"""
jrnl is a simple journal application for your command line.
"""
__title__ = 'jrnl'
__version__ = '1.0.3'
__author__ = 'Manuel Ebert'
__license__ = 'MIT License'
__copyright__ = 'Copyright 2013 Manuel Ebert'
from . import Journal
from . import jrnl
from .jrnl import cli
| <commit_before>#!/usr/bin/env python
# encoding: utf-8
"""
jrnl is a simple journal application for your command line.
"""
__title__ = 'jrnl'
__version__ = '1.0.3'
__author__ = 'Manuel Ebert'
__license__ = 'MIT License'
__copyright__ = 'Copyright 2013 Manuel Ebert'
from . import Journal
from . import jrnl
<commit_m... | #!/usr/bin/env python
# encoding: utf-8
"""
jrnl is a simple journal application for your command line.
"""
__title__ = 'jrnl'
__version__ = '1.0.3'
__author__ = 'Manuel Ebert'
__license__ = 'MIT License'
__copyright__ = 'Copyright 2013 Manuel Ebert'
from . import Journal
from . import jrnl
from .jrnl import cli
| #!/usr/bin/env python
# encoding: utf-8
"""
jrnl is a simple journal application for your command line.
"""
__title__ = 'jrnl'
__version__ = '1.0.3'
__author__ = 'Manuel Ebert'
__license__ = 'MIT License'
__copyright__ = 'Copyright 2013 Manuel Ebert'
from . import Journal
from . import jrnl
Make the cli work again.... | <commit_before>#!/usr/bin/env python
# encoding: utf-8
"""
jrnl is a simple journal application for your command line.
"""
__title__ = 'jrnl'
__version__ = '1.0.3'
__author__ = 'Manuel Ebert'
__license__ = 'MIT License'
__copyright__ = 'Copyright 2013 Manuel Ebert'
from . import Journal
from . import jrnl
<commit_m... |
8a668efbc266802a4f4e23c936d3589b230d9528 | nanpy/examples/blink_2boards.py | nanpy/examples/blink_2boards.py | #!/usr/bin/env python
# Author: Andrea Stagi <stagi.andrea@gmail.com>
# Description: keeps your led blinking on 2 boards
# Dependencies: None
from nanpy import (ArduinoApi, SerialManager)
from time import sleep
device_1 = '/dev/tty.usbmodem1411'
device_2 = '/dev/tty.usbmodem1431'
connection_1 = SerialManager(devic... | Add blink example on two different boards | Add blink example on two different boards
| Python | mit | joppi/nanpy,nanpy/nanpy | Add blink example on two different boards | #!/usr/bin/env python
# Author: Andrea Stagi <stagi.andrea@gmail.com>
# Description: keeps your led blinking on 2 boards
# Dependencies: None
from nanpy import (ArduinoApi, SerialManager)
from time import sleep
device_1 = '/dev/tty.usbmodem1411'
device_2 = '/dev/tty.usbmodem1431'
connection_1 = SerialManager(devic... | <commit_before><commit_msg>Add blink example on two different boards<commit_after> | #!/usr/bin/env python
# Author: Andrea Stagi <stagi.andrea@gmail.com>
# Description: keeps your led blinking on 2 boards
# Dependencies: None
from nanpy import (ArduinoApi, SerialManager)
from time import sleep
device_1 = '/dev/tty.usbmodem1411'
device_2 = '/dev/tty.usbmodem1431'
connection_1 = SerialManager(devic... | Add blink example on two different boards#!/usr/bin/env python
# Author: Andrea Stagi <stagi.andrea@gmail.com>
# Description: keeps your led blinking on 2 boards
# Dependencies: None
from nanpy import (ArduinoApi, SerialManager)
from time import sleep
device_1 = '/dev/tty.usbmodem1411'
device_2 = '/dev/tty.usbmodem... | <commit_before><commit_msg>Add blink example on two different boards<commit_after>#!/usr/bin/env python
# Author: Andrea Stagi <stagi.andrea@gmail.com>
# Description: keeps your led blinking on 2 boards
# Dependencies: None
from nanpy import (ArduinoApi, SerialManager)
from time import sleep
device_1 = '/dev/tty.us... | |
61a005ffbc988b6a20441841112890bb397f8ca3 | 2016_player_picks.py | 2016_player_picks.py |
stone = {"firstname": "chris", "lastname": "stone", "timestamp": "9/6/2016", "email": "stone@usisales.com",
"afc_east_1": "Patriots", "afc_east_2": "Jets", "afc_east_last": "Bills", "afc_north_1": "Steelers",
"afc_north_2": "Bengals", "afc_north_last": "Browns", "afc_south_1": "Colts", "afc_south_2"... | Create stub for 2016 NFLPool player picks | Create stub for 2016 NFLPool player picks
| Python | mit | prcutler/nflpool,prcutler/nflpool | Create stub for 2016 NFLPool player picks |
stone = {"firstname": "chris", "lastname": "stone", "timestamp": "9/6/2016", "email": "stone@usisales.com",
"afc_east_1": "Patriots", "afc_east_2": "Jets", "afc_east_last": "Bills", "afc_north_1": "Steelers",
"afc_north_2": "Bengals", "afc_north_last": "Browns", "afc_south_1": "Colts", "afc_south_2"... | <commit_before><commit_msg>Create stub for 2016 NFLPool player picks<commit_after> |
stone = {"firstname": "chris", "lastname": "stone", "timestamp": "9/6/2016", "email": "stone@usisales.com",
"afc_east_1": "Patriots", "afc_east_2": "Jets", "afc_east_last": "Bills", "afc_north_1": "Steelers",
"afc_north_2": "Bengals", "afc_north_last": "Browns", "afc_south_1": "Colts", "afc_south_2"... | Create stub for 2016 NFLPool player picks
stone = {"firstname": "chris", "lastname": "stone", "timestamp": "9/6/2016", "email": "stone@usisales.com",
"afc_east_1": "Patriots", "afc_east_2": "Jets", "afc_east_last": "Bills", "afc_north_1": "Steelers",
"afc_north_2": "Bengals", "afc_north_last": "Brown... | <commit_before><commit_msg>Create stub for 2016 NFLPool player picks<commit_after>
stone = {"firstname": "chris", "lastname": "stone", "timestamp": "9/6/2016", "email": "stone@usisales.com",
"afc_east_1": "Patriots", "afc_east_2": "Jets", "afc_east_last": "Bills", "afc_north_1": "Steelers",
"afc_nort... | |
893e4292f6b1799bf5f1888fcbad41ec8b5a5951 | examples/tic_ql_tabular_selfplay_all.py | examples/tic_ql_tabular_selfplay_all.py | '''
In this example we use Q-learning via self-play to learn
the value function of all Tic-Tac-Toe positions.
'''
from capstone.environment import Environment
from capstone.game import TicTacToe
from capstone.mdp import GameMDP
from capstone.rl import QLearningSelfPlay
from capstone.rl.tabularf import TabularF
from cap... | Use Q-learning to learn all state-action values via self-play | Use Q-learning to learn all state-action values via self-play
| Python | mit | davidrobles/mlnd-capstone-code | Use Q-learning to learn all state-action values via self-play | '''
In this example we use Q-learning via self-play to learn
the value function of all Tic-Tac-Toe positions.
'''
from capstone.environment import Environment
from capstone.game import TicTacToe
from capstone.mdp import GameMDP
from capstone.rl import QLearningSelfPlay
from capstone.rl.tabularf import TabularF
from cap... | <commit_before><commit_msg>Use Q-learning to learn all state-action values via self-play<commit_after> | '''
In this example we use Q-learning via self-play to learn
the value function of all Tic-Tac-Toe positions.
'''
from capstone.environment import Environment
from capstone.game import TicTacToe
from capstone.mdp import GameMDP
from capstone.rl import QLearningSelfPlay
from capstone.rl.tabularf import TabularF
from cap... | Use Q-learning to learn all state-action values via self-play'''
In this example we use Q-learning via self-play to learn
the value function of all Tic-Tac-Toe positions.
'''
from capstone.environment import Environment
from capstone.game import TicTacToe
from capstone.mdp import GameMDP
from capstone.rl import QLearni... | <commit_before><commit_msg>Use Q-learning to learn all state-action values via self-play<commit_after>'''
In this example we use Q-learning via self-play to learn
the value function of all Tic-Tac-Toe positions.
'''
from capstone.environment import Environment
from capstone.game import TicTacToe
from capstone.mdp impor... | |
a8419c46ceed655a276dad00a24e21f300fda543 | py/find-bottom-left-tree-value.py | py/find-bottom-left-tree-value.py | # Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution(object):
def findBottomLeftValue(self, root):
"""
:type root: TreeNode
:rtype: int
"""
q =... | Add py solution for 513. Find Bottom Left Tree Value | Add py solution for 513. Find Bottom Left Tree Value
513. Find Bottom Left Tree Value: https://leetcode.com/problems/find-bottom-left-tree-value/
| Python | apache-2.0 | ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode | Add py solution for 513. Find Bottom Left Tree Value
513. Find Bottom Left Tree Value: https://leetcode.com/problems/find-bottom-left-tree-value/ | # Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution(object):
def findBottomLeftValue(self, root):
"""
:type root: TreeNode
:rtype: int
"""
q =... | <commit_before><commit_msg>Add py solution for 513. Find Bottom Left Tree Value
513. Find Bottom Left Tree Value: https://leetcode.com/problems/find-bottom-left-tree-value/<commit_after> | # Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution(object):
def findBottomLeftValue(self, root):
"""
:type root: TreeNode
:rtype: int
"""
q =... | Add py solution for 513. Find Bottom Left Tree Value
513. Find Bottom Left Tree Value: https://leetcode.com/problems/find-bottom-left-tree-value/# Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
cla... | <commit_before><commit_msg>Add py solution for 513. Find Bottom Left Tree Value
513. Find Bottom Left Tree Value: https://leetcode.com/problems/find-bottom-left-tree-value/<commit_after># Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.lef... | |
3dcf737fa6a6467e1c96d31325e26ecf20c50320 | test/test_logger.py | test/test_logger.py | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
from __future__ import print_function
from __future__ import unicode_literals
import logbook
import pytest
from sqliteschema import (
set_logger,
set_log_level,
)
class Test_set_logger(object):
@pytest.mark.param... | Add test cases for the logger | Add test cases for the logger
| Python | mit | thombashi/sqliteschema | Add test cases for the logger | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
from __future__ import print_function
from __future__ import unicode_literals
import logbook
import pytest
from sqliteschema import (
set_logger,
set_log_level,
)
class Test_set_logger(object):
@pytest.mark.param... | <commit_before><commit_msg>Add test cases for the logger<commit_after> | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
from __future__ import print_function
from __future__ import unicode_literals
import logbook
import pytest
from sqliteschema import (
set_logger,
set_log_level,
)
class Test_set_logger(object):
@pytest.mark.param... | Add test cases for the logger# encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
from __future__ import print_function
from __future__ import unicode_literals
import logbook
import pytest
from sqliteschema import (
set_logger,
set_log_level,
)
class Test_set_logger(obj... | <commit_before><commit_msg>Add test cases for the logger<commit_after># encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
from __future__ import print_function
from __future__ import unicode_literals
import logbook
import pytest
from sqliteschema import (
set_logger,
set... | |
8b0b7c19d2e2c015fd8ba7d5408b23334ee8874f | test/Configure/VariantDir2.py | test/Configure/VariantDir2.py | #!/usr/bin/env python
#
# __COPYRIGHT__
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
... | Add test case for configure failure. | Add test case for configure failure.
TryRun fails to find the executable when VariantDir is set up from
SConscript/SConstruct.
| Python | mit | Distrotech/scons,Distrotech/scons,Distrotech/scons,Distrotech/scons,Distrotech/scons | Add test case for configure failure.
TryRun fails to find the executable when VariantDir is set up from
SConscript/SConstruct. | #!/usr/bin/env python
#
# __COPYRIGHT__
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
... | <commit_before><commit_msg>Add test case for configure failure.
TryRun fails to find the executable when VariantDir is set up from
SConscript/SConstruct.<commit_after> | #!/usr/bin/env python
#
# __COPYRIGHT__
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
... | Add test case for configure failure.
TryRun fails to find the executable when VariantDir is set up from
SConscript/SConstruct.#!/usr/bin/env python
#
# __COPYRIGHT__
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software")... | <commit_before><commit_msg>Add test case for configure failure.
TryRun fails to find the executable when VariantDir is set up from
SConscript/SConstruct.<commit_after>#!/usr/bin/env python
#
# __COPYRIGHT__
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associat... | |
1fd09e7328b1ebf41bc0790f2a96c18207b10077 | tests/test-sweep.py | tests/test-sweep.py | #!/usr/bin/env python
try:
from cStringIO import StringIO
except ImportError:
from io import StringIO
class Makefile(object):
def __init__(self):
self._fp = StringIO()
self._all = set()
self._targets = set()
def add_default(self, x):
self._all.add(x)
def build(self, ... | Add sine wave sweep test | Add sine wave sweep test
This test produces spectrograms like those available on the SRC
Comparisons web site.
http://src.infinitewave.ca/
| Python | bsd-2-clause | depp/libfresample,depp/libfresample,depp/libfresample,h6ah4i/libfresample,h6ah4i/libfresample | Add sine wave sweep test
This test produces spectrograms like those available on the SRC
Comparisons web site.
http://src.infinitewave.ca/ | #!/usr/bin/env python
try:
from cStringIO import StringIO
except ImportError:
from io import StringIO
class Makefile(object):
def __init__(self):
self._fp = StringIO()
self._all = set()
self._targets = set()
def add_default(self, x):
self._all.add(x)
def build(self, ... | <commit_before><commit_msg>Add sine wave sweep test
This test produces spectrograms like those available on the SRC
Comparisons web site.
http://src.infinitewave.ca/<commit_after> | #!/usr/bin/env python
try:
from cStringIO import StringIO
except ImportError:
from io import StringIO
class Makefile(object):
def __init__(self):
self._fp = StringIO()
self._all = set()
self._targets = set()
def add_default(self, x):
self._all.add(x)
def build(self, ... | Add sine wave sweep test
This test produces spectrograms like those available on the SRC
Comparisons web site.
http://src.infinitewave.ca/#!/usr/bin/env python
try:
from cStringIO import StringIO
except ImportError:
from io import StringIO
class Makefile(object):
def __init__(self):
self._fp = St... | <commit_before><commit_msg>Add sine wave sweep test
This test produces spectrograms like those available on the SRC
Comparisons web site.
http://src.infinitewave.ca/<commit_after>#!/usr/bin/env python
try:
from cStringIO import StringIO
except ImportError:
from io import StringIO
class Makefile(object):
... | |
1165673d784eab36edcdc4ed4caf22dbd222874a | whois-scraper.py | whois-scraper.py | from lxml import html
from PIL import Image
import requests
def enlarge_image(image_file):
image = Image.open(image_file)
enlarged_size = map(lambda x: x*2, image.size)
enlarged_image = image.resize(enlarged_size)
return enlarged_image
def extract_text(image_file):
image = enlarge_image(image_file)
# Use Tess... | Add some preliminary code and function to enlarge image | Add some preliminary code and function to enlarge image
| Python | mit | SkullTech/whois-scraper | Add some preliminary code and function to enlarge image | from lxml import html
from PIL import Image
import requests
def enlarge_image(image_file):
image = Image.open(image_file)
enlarged_size = map(lambda x: x*2, image.size)
enlarged_image = image.resize(enlarged_size)
return enlarged_image
def extract_text(image_file):
image = enlarge_image(image_file)
# Use Tess... | <commit_before><commit_msg>Add some preliminary code and function to enlarge image<commit_after> | from lxml import html
from PIL import Image
import requests
def enlarge_image(image_file):
image = Image.open(image_file)
enlarged_size = map(lambda x: x*2, image.size)
enlarged_image = image.resize(enlarged_size)
return enlarged_image
def extract_text(image_file):
image = enlarge_image(image_file)
# Use Tess... | Add some preliminary code and function to enlarge imagefrom lxml import html
from PIL import Image
import requests
def enlarge_image(image_file):
image = Image.open(image_file)
enlarged_size = map(lambda x: x*2, image.size)
enlarged_image = image.resize(enlarged_size)
return enlarged_image
def extract_text(image... | <commit_before><commit_msg>Add some preliminary code and function to enlarge image<commit_after>from lxml import html
from PIL import Image
import requests
def enlarge_image(image_file):
image = Image.open(image_file)
enlarged_size = map(lambda x: x*2, image.size)
enlarged_image = image.resize(enlarged_size)
retu... | |
1d1f9d5d8f4873d6a23c430a5629eaeddfd50d2a | subiquity/ui/views/network_default_route.py | subiquity/ui/views/network_default_route.py | # Copyright 2015 Canonical, Ltd.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distribute... | Add network set default route view | Add network set default route view
Signed-off-by: Adam Stokes <0a364f4bf549cc82d725fa7fd7ed34404be64079@ubuntu.com>
| Python | agpl-3.0 | CanonicalLtd/subiquity,CanonicalLtd/subiquity | Add network set default route view
Signed-off-by: Adam Stokes <0a364f4bf549cc82d725fa7fd7ed34404be64079@ubuntu.com> | # Copyright 2015 Canonical, Ltd.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distribute... | <commit_before><commit_msg>Add network set default route view
Signed-off-by: Adam Stokes <0a364f4bf549cc82d725fa7fd7ed34404be64079@ubuntu.com><commit_after> | # Copyright 2015 Canonical, Ltd.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distribute... | Add network set default route view
Signed-off-by: Adam Stokes <0a364f4bf549cc82d725fa7fd7ed34404be64079@ubuntu.com># Copyright 2015 Canonical, Ltd.
#
# 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 ... | <commit_before><commit_msg>Add network set default route view
Signed-off-by: Adam Stokes <0a364f4bf549cc82d725fa7fd7ed34404be64079@ubuntu.com><commit_after># Copyright 2015 Canonical, Ltd.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public Lic... | |
2c57f2143e21fa3d006d4e4e2737429fb60b4797 | tornado/setup_pg.py | tornado/setup_pg.py | from os.path import expanduser
from os import kill
import subprocess
import sys
import time
python = expanduser('~/FrameworkBenchmarks/installs/py2/bin/python')
cwd = expanduser('~/FrameworkBenchmarks/tornado')
def start(args, logfile, errfile):
subprocess.Popen(
python + " server.py --port=8080 --postg... | import os
import subprocess
import sys
import time
bin_dir = os.path.expanduser('~/FrameworkBenchmarks/installs/py2/bin')
python = os.path.expanduser(os.path.join(bin_dir, 'python'))
pip = os.path.expanduser(os.path.join(bin_dir, 'pip'))
cwd = os.path.expanduser('~/FrameworkBenchmarks/tornado')
def start(args, logf... | Call pip install before running server. | Call pip install before running server.
| Python | bsd-3-clause | knewmanTE/FrameworkBenchmarks,PermeAgility/FrameworkBenchmarks,circlespainter/FrameworkBenchmarks,raziel057/FrameworkBenchmarks,saturday06/FrameworkBenchmarks,circlespainter/FrameworkBenchmarks,sanjoydesk/FrameworkBenchmarks,ashawnbandy-te-tfb/FrameworkBenchmarks,markkolich/FrameworkBenchmarks,stefanocasazza/FrameworkB... | from os.path import expanduser
from os import kill
import subprocess
import sys
import time
python = expanduser('~/FrameworkBenchmarks/installs/py2/bin/python')
cwd = expanduser('~/FrameworkBenchmarks/tornado')
def start(args, logfile, errfile):
subprocess.Popen(
python + " server.py --port=8080 --postg... | import os
import subprocess
import sys
import time
bin_dir = os.path.expanduser('~/FrameworkBenchmarks/installs/py2/bin')
python = os.path.expanduser(os.path.join(bin_dir, 'python'))
pip = os.path.expanduser(os.path.join(bin_dir, 'pip'))
cwd = os.path.expanduser('~/FrameworkBenchmarks/tornado')
def start(args, logf... | <commit_before>from os.path import expanduser
from os import kill
import subprocess
import sys
import time
python = expanduser('~/FrameworkBenchmarks/installs/py2/bin/python')
cwd = expanduser('~/FrameworkBenchmarks/tornado')
def start(args, logfile, errfile):
subprocess.Popen(
python + " server.py --po... | import os
import subprocess
import sys
import time
bin_dir = os.path.expanduser('~/FrameworkBenchmarks/installs/py2/bin')
python = os.path.expanduser(os.path.join(bin_dir, 'python'))
pip = os.path.expanduser(os.path.join(bin_dir, 'pip'))
cwd = os.path.expanduser('~/FrameworkBenchmarks/tornado')
def start(args, logf... | from os.path import expanduser
from os import kill
import subprocess
import sys
import time
python = expanduser('~/FrameworkBenchmarks/installs/py2/bin/python')
cwd = expanduser('~/FrameworkBenchmarks/tornado')
def start(args, logfile, errfile):
subprocess.Popen(
python + " server.py --port=8080 --postg... | <commit_before>from os.path import expanduser
from os import kill
import subprocess
import sys
import time
python = expanduser('~/FrameworkBenchmarks/installs/py2/bin/python')
cwd = expanduser('~/FrameworkBenchmarks/tornado')
def start(args, logfile, errfile):
subprocess.Popen(
python + " server.py --po... |
9ec957af0c3d57dff4c05c1b7ed3e66e1c033f6b | nagios/check_idot_snowplows.py | nagios/check_idot_snowplows.py | """
Nagios check to see how much snowplow data we are currently ingesting
"""
import sys
import os
import psycopg2
POSTGIS = psycopg2.connect(database='postgis', host='iemdb', user='nobody')
pcursor = POSTGIS.cursor()
pcursor.execute("""
select count(*) from idot_snowplow_current WHERE
valid > now() - '30 minutes... | Add nagios check for idot snowplow ingest | Add nagios check for idot snowplow ingest | Python | mit | akrherz/iem,akrherz/iem,akrherz/iem,akrherz/iem,akrherz/iem | Add nagios check for idot snowplow ingest | """
Nagios check to see how much snowplow data we are currently ingesting
"""
import sys
import os
import psycopg2
POSTGIS = psycopg2.connect(database='postgis', host='iemdb', user='nobody')
pcursor = POSTGIS.cursor()
pcursor.execute("""
select count(*) from idot_snowplow_current WHERE
valid > now() - '30 minutes... | <commit_before><commit_msg>Add nagios check for idot snowplow ingest<commit_after> | """
Nagios check to see how much snowplow data we are currently ingesting
"""
import sys
import os
import psycopg2
POSTGIS = psycopg2.connect(database='postgis', host='iemdb', user='nobody')
pcursor = POSTGIS.cursor()
pcursor.execute("""
select count(*) from idot_snowplow_current WHERE
valid > now() - '30 minutes... | Add nagios check for idot snowplow ingest"""
Nagios check to see how much snowplow data we are currently ingesting
"""
import sys
import os
import psycopg2
POSTGIS = psycopg2.connect(database='postgis', host='iemdb', user='nobody')
pcursor = POSTGIS.cursor()
pcursor.execute("""
select count(*) from idot_snowplow_cu... | <commit_before><commit_msg>Add nagios check for idot snowplow ingest<commit_after>"""
Nagios check to see how much snowplow data we are currently ingesting
"""
import sys
import os
import psycopg2
POSTGIS = psycopg2.connect(database='postgis', host='iemdb', user='nobody')
pcursor = POSTGIS.cursor()
pcursor.execute("... | |
717b20e298547685ed0685bd09a4fac541034910 | example/map_flows.py | example/map_flows.py | from taskin import task
def get_servers(data):
return [
'foo.example.com',
'bar.example.com',
]
def create_something(data):
servers, name = data
for server in servers:
print('Creating: https://%s/%s' % (server, name))
def main():
flow = [
get_servers,
ta... | Add an example map flow | Add an example map flow
| Python | bsd-3-clause | ionrock/taskin | Add an example map flow | from taskin import task
def get_servers(data):
return [
'foo.example.com',
'bar.example.com',
]
def create_something(data):
servers, name = data
for server in servers:
print('Creating: https://%s/%s' % (server, name))
def main():
flow = [
get_servers,
ta... | <commit_before><commit_msg>Add an example map flow<commit_after> | from taskin import task
def get_servers(data):
return [
'foo.example.com',
'bar.example.com',
]
def create_something(data):
servers, name = data
for server in servers:
print('Creating: https://%s/%s' % (server, name))
def main():
flow = [
get_servers,
ta... | Add an example map flowfrom taskin import task
def get_servers(data):
return [
'foo.example.com',
'bar.example.com',
]
def create_something(data):
servers, name = data
for server in servers:
print('Creating: https://%s/%s' % (server, name))
def main():
flow = [
... | <commit_before><commit_msg>Add an example map flow<commit_after>from taskin import task
def get_servers(data):
return [
'foo.example.com',
'bar.example.com',
]
def create_something(data):
servers, name = data
for server in servers:
print('Creating: https://%s/%s' % (server, n... | |
61139332ce1bcfd145f16b8f3c411e178db4054c | numpy/core/tests/test_dtype.py | numpy/core/tests/test_dtype.py | import numpy as np
from numpy.testing import *
class TestBuiltin(TestCase):
def test_run(self):
"""Only test hash runs at all."""
for t in [np.int, np.float, np.complex, np.int32, np.str, np.object,
np.unicode]:
dt = np.dtype(t)
hash(dt)
class TestRecord(Tes... | Add some unit tests for the hashing protocol of dtype (fail currently). | Add some unit tests for the hashing protocol of dtype (fail currently).
git-svn-id: 77a43f9646713b91fea7788fad5dfbf67e151ece@6666 94b884b6-d6fd-0310-90d3-974f1d3f35e1
| Python | bsd-3-clause | teoliphant/numpy-refactor,efiring/numpy-work,efiring/numpy-work,Ademan/NumPy-GSoC,teoliphant/numpy-refactor,jasonmccampbell/numpy-refactor-sprint,teoliphant/numpy-refactor,jasonmccampbell/numpy-refactor-sprint,Ademan/NumPy-GSoC,teoliphant/numpy-refactor,illume/numpy3k,jasonmccampbell/numpy-refactor-sprint,chadnetzer/nu... | Add some unit tests for the hashing protocol of dtype (fail currently).
git-svn-id: 77a43f9646713b91fea7788fad5dfbf67e151ece@6666 94b884b6-d6fd-0310-90d3-974f1d3f35e1 | import numpy as np
from numpy.testing import *
class TestBuiltin(TestCase):
def test_run(self):
"""Only test hash runs at all."""
for t in [np.int, np.float, np.complex, np.int32, np.str, np.object,
np.unicode]:
dt = np.dtype(t)
hash(dt)
class TestRecord(Tes... | <commit_before><commit_msg>Add some unit tests for the hashing protocol of dtype (fail currently).
git-svn-id: 77a43f9646713b91fea7788fad5dfbf67e151ece@6666 94b884b6-d6fd-0310-90d3-974f1d3f35e1<commit_after> | import numpy as np
from numpy.testing import *
class TestBuiltin(TestCase):
def test_run(self):
"""Only test hash runs at all."""
for t in [np.int, np.float, np.complex, np.int32, np.str, np.object,
np.unicode]:
dt = np.dtype(t)
hash(dt)
class TestRecord(Tes... | Add some unit tests for the hashing protocol of dtype (fail currently).
git-svn-id: 77a43f9646713b91fea7788fad5dfbf67e151ece@6666 94b884b6-d6fd-0310-90d3-974f1d3f35e1import numpy as np
from numpy.testing import *
class TestBuiltin(TestCase):
def test_run(self):
"""Only test hash runs at all."""
fo... | <commit_before><commit_msg>Add some unit tests for the hashing protocol of dtype (fail currently).
git-svn-id: 77a43f9646713b91fea7788fad5dfbf67e151ece@6666 94b884b6-d6fd-0310-90d3-974f1d3f35e1<commit_after>import numpy as np
from numpy.testing import *
class TestBuiltin(TestCase):
def test_run(self):
"""... | |
c3e7b563c3eeb24aa269f23672b8f469470908b7 | onetime/views.py | onetime/views.py | from datetime import datetime
from django.http import HttpResponseRedirect, HttpResponseGone
from django.shortcuts import get_object_or_404
from django.contrib.auth import login
from django.conf import settings
from onetime import utils
from onetime.models import Key
def cleanup(request):
utils.cleanup()
def lo... | from datetime import datetime
from django.http import HttpResponseRedirect, HttpResponseGone
from django.shortcuts import get_object_or_404
from django.contrib.auth import login
from django.conf import settings
from onetime import utils
from onetime.models import Key
def cleanup(request):
utils.cleanup()
def lo... | Add an option to redirect user to a page if the key is already expired. | Add an option to redirect user to a page if the key is already expired.
| Python | agpl-3.0 | ISIFoundation/influenzanet-website,ISIFoundation/influenzanet-website,ISIFoundation/influenzanet-website,uploadcare/django-loginurl,ISIFoundation/influenzanet-website,vanschelven/cmsplugin-journal,ISIFoundation/influenzanet-website,ISIFoundation/influenzanet-website,fajran/django-loginurl,ISIFoundation/influenzanet-web... | from datetime import datetime
from django.http import HttpResponseRedirect, HttpResponseGone
from django.shortcuts import get_object_or_404
from django.contrib.auth import login
from django.conf import settings
from onetime import utils
from onetime.models import Key
def cleanup(request):
utils.cleanup()
def lo... | from datetime import datetime
from django.http import HttpResponseRedirect, HttpResponseGone
from django.shortcuts import get_object_or_404
from django.contrib.auth import login
from django.conf import settings
from onetime import utils
from onetime.models import Key
def cleanup(request):
utils.cleanup()
def lo... | <commit_before>from datetime import datetime
from django.http import HttpResponseRedirect, HttpResponseGone
from django.shortcuts import get_object_or_404
from django.contrib.auth import login
from django.conf import settings
from onetime import utils
from onetime.models import Key
def cleanup(request):
utils.cl... | from datetime import datetime
from django.http import HttpResponseRedirect, HttpResponseGone
from django.shortcuts import get_object_or_404
from django.contrib.auth import login
from django.conf import settings
from onetime import utils
from onetime.models import Key
def cleanup(request):
utils.cleanup()
def lo... | from datetime import datetime
from django.http import HttpResponseRedirect, HttpResponseGone
from django.shortcuts import get_object_or_404
from django.contrib.auth import login
from django.conf import settings
from onetime import utils
from onetime.models import Key
def cleanup(request):
utils.cleanup()
def lo... | <commit_before>from datetime import datetime
from django.http import HttpResponseRedirect, HttpResponseGone
from django.shortcuts import get_object_or_404
from django.contrib.auth import login
from django.conf import settings
from onetime import utils
from onetime.models import Key
def cleanup(request):
utils.cl... |
a136eeefdd6cf276a0d4815fa39453737ed04727 | py/next-greater-element-iii.py | py/next-greater-element-iii.py | class Solution(object):
def nextGreaterElement(self, n):
"""
:type n: int
:rtype: int
"""
s = str(n)
for i, n in enumerate(reversed(s[:-1]), 1):
if n < s[-i]:
x, j = min((x, k) for k, x in enumerate(s[-i:]) if x > n)
ans = s... | Add py solution for 556. Next Greater Element III | Add py solution for 556. Next Greater Element III
556. Next Greater Element III: https://leetcode.com/problems/next-greater-element-iii/
Approach:
Observe the first item remaining in each step. The value will be added
1 << step either the remaining count is odd or it's a left-to-right
step. Hence the n | ... | Python | apache-2.0 | ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode | Add py solution for 556. Next Greater Element III
556. Next Greater Element III: https://leetcode.com/problems/next-greater-element-iii/
Approach:
Observe the first item remaining in each step. The value will be added
1 << step either the remaining count is odd or it's a left-to-right
step. Hence the n | ... | class Solution(object):
def nextGreaterElement(self, n):
"""
:type n: int
:rtype: int
"""
s = str(n)
for i, n in enumerate(reversed(s[:-1]), 1):
if n < s[-i]:
x, j = min((x, k) for k, x in enumerate(s[-i:]) if x > n)
ans = s... | <commit_before><commit_msg>Add py solution for 556. Next Greater Element III
556. Next Greater Element III: https://leetcode.com/problems/next-greater-element-iii/
Approach:
Observe the first item remaining in each step. The value will be added
1 << step either the remaining count is odd or it's a left-to-rig... | class Solution(object):
def nextGreaterElement(self, n):
"""
:type n: int
:rtype: int
"""
s = str(n)
for i, n in enumerate(reversed(s[:-1]), 1):
if n < s[-i]:
x, j = min((x, k) for k, x in enumerate(s[-i:]) if x > n)
ans = s... | Add py solution for 556. Next Greater Element III
556. Next Greater Element III: https://leetcode.com/problems/next-greater-element-iii/
Approach:
Observe the first item remaining in each step. The value will be added
1 << step either the remaining count is odd or it's a left-to-right
step. Hence the n | ... | <commit_before><commit_msg>Add py solution for 556. Next Greater Element III
556. Next Greater Element III: https://leetcode.com/problems/next-greater-element-iii/
Approach:
Observe the first item remaining in each step. The value will be added
1 << step either the remaining count is odd or it's a left-to-rig... | |
32d46fe3e080b13ab9ae9dc3d868e9a724cccda9 | tools/telemetry/telemetry/core/backends/chrome/ios_browser_finder_unittest.py | tools/telemetry/telemetry/core/backends/chrome/ios_browser_finder_unittest.py | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import unittest
from telemetry.core import browser_options
from telemetry.core.backends.chrome import ios_browser_finder
from telemetry.unittest import test
... | Add unit test for IosBrowserFinder. | Add unit test for IosBrowserFinder.
This test checks if Chrome on iOS is running. It only
runs on iOS platforms.
BUG=None
Review URL: https://codereview.chromium.org/350583002
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@279143 0039d316-1c4b-4281-b951-d872f2087c98
| Python | bsd-3-clause | krieger-od/nwjs_chromium.src,Fireblend/chromium-crosswalk,ltilve/chromium,axinging/chromium-crosswalk,jaruba/chromium.src,ltilve/chromium,Fireblend/chromium-crosswalk,dednal/chromium.src,mohamed--abdel-maksoud/chromium.src,Jonekee/chromium.src,Just-D/chromium-1,Pluto-tv/chromium-crosswalk,M4sse/chromium.src,M4sse/chrom... | Add unit test for IosBrowserFinder.
This test checks if Chrome on iOS is running. It only
runs on iOS platforms.
BUG=None
Review URL: https://codereview.chromium.org/350583002
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@279143 0039d316-1c4b-4281-b951-d872f2087c98 | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import unittest
from telemetry.core import browser_options
from telemetry.core.backends.chrome import ios_browser_finder
from telemetry.unittest import test
... | <commit_before><commit_msg>Add unit test for IosBrowserFinder.
This test checks if Chrome on iOS is running. It only
runs on iOS platforms.
BUG=None
Review URL: https://codereview.chromium.org/350583002
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@279143 0039d316-1c4b-4281-b951-d872f2087c98<commit_after> | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import unittest
from telemetry.core import browser_options
from telemetry.core.backends.chrome import ios_browser_finder
from telemetry.unittest import test
... | Add unit test for IosBrowserFinder.
This test checks if Chrome on iOS is running. It only
runs on iOS platforms.
BUG=None
Review URL: https://codereview.chromium.org/350583002
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@279143 0039d316-1c4b-4281-b951-d872f2087c98# Copyright 2014 The Chromium Authors. All r... | <commit_before><commit_msg>Add unit test for IosBrowserFinder.
This test checks if Chrome on iOS is running. It only
runs on iOS platforms.
BUG=None
Review URL: https://codereview.chromium.org/350583002
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@279143 0039d316-1c4b-4281-b951-d872f2087c98<commit_after># C... | |
bc35e89d04e541f75fc12788893b21a3b876aaf9 | tail/tests/test_tail.py | tail/tests/test_tail.py | """
Tests for the tail implementation
"""
from tail import FileTail
def test_tail_from_file():
"""Tests that tail works as advertised from a file"""
from unittest.mock import mock_open, patch
# The mock_data we are using for our test
mock_data = """A
B
C
D
E
F
"""
mocked_open = mock_open(read_da... | Create test case for tail from file | Create test case for tail from file
| Python | mit | shuttle1987/tail,shuttle1987/tail | Create test case for tail from file | """
Tests for the tail implementation
"""
from tail import FileTail
def test_tail_from_file():
"""Tests that tail works as advertised from a file"""
from unittest.mock import mock_open, patch
# The mock_data we are using for our test
mock_data = """A
B
C
D
E
F
"""
mocked_open = mock_open(read_da... | <commit_before><commit_msg>Create test case for tail from file<commit_after> | """
Tests for the tail implementation
"""
from tail import FileTail
def test_tail_from_file():
"""Tests that tail works as advertised from a file"""
from unittest.mock import mock_open, patch
# The mock_data we are using for our test
mock_data = """A
B
C
D
E
F
"""
mocked_open = mock_open(read_da... | Create test case for tail from file"""
Tests for the tail implementation
"""
from tail import FileTail
def test_tail_from_file():
"""Tests that tail works as advertised from a file"""
from unittest.mock import mock_open, patch
# The mock_data we are using for our test
mock_data = """A
B
C
D
E
F
"""
... | <commit_before><commit_msg>Create test case for tail from file<commit_after>"""
Tests for the tail implementation
"""
from tail import FileTail
def test_tail_from_file():
"""Tests that tail works as advertised from a file"""
from unittest.mock import mock_open, patch
# The mock_data we are using for our... | |
d21743f2543f8d953a837d75bff0fcdb0105f4db | feincms/module/page/extensions/changedate.py | feincms/module/page/extensions/changedate.py | """
Track the modification date for pages.
"""
from datetime import datetime
from django.db import models
from django.db.models import Q
from django.utils.translation import ugettext_lazy as _
from django.conf import settings
def register(cls, admin_cls):
cls.add_to_class('creation_date', models.DateTimeField(_... | Add page extension for tracking page creation and modification dates. | Add page extension for tracking page creation and modification dates.
This can be used in conjunction with a response processor to set the "last-modified" or "etag" response headers.
| Python | bsd-3-clause | feincms/feincms,hgrimelid/feincms,pjdelport/feincms,joshuajonah/feincms,nickburlett/feincms,matthiask/django-content-editor,joshuajonah/feincms,matthiask/django-content-editor,matthiask/django-content-editor,nickburlett/feincms,michaelkuty/feincms,joshuajonah/feincms,mjl/feincms,michaelkuty/feincms,hgrimelid/feincms,jo... | Add page extension for tracking page creation and modification dates.
This can be used in conjunction with a response processor to set the "last-modified" or "etag" response headers. | """
Track the modification date for pages.
"""
from datetime import datetime
from django.db import models
from django.db.models import Q
from django.utils.translation import ugettext_lazy as _
from django.conf import settings
def register(cls, admin_cls):
cls.add_to_class('creation_date', models.DateTimeField(_... | <commit_before><commit_msg>Add page extension for tracking page creation and modification dates.
This can be used in conjunction with a response processor to set the "last-modified" or "etag" response headers.<commit_after> | """
Track the modification date for pages.
"""
from datetime import datetime
from django.db import models
from django.db.models import Q
from django.utils.translation import ugettext_lazy as _
from django.conf import settings
def register(cls, admin_cls):
cls.add_to_class('creation_date', models.DateTimeField(_... | Add page extension for tracking page creation and modification dates.
This can be used in conjunction with a response processor to set the "last-modified" or "etag" response headers."""
Track the modification date for pages.
"""
from datetime import datetime
from django.db import models
from django.db.models import ... | <commit_before><commit_msg>Add page extension for tracking page creation and modification dates.
This can be used in conjunction with a response processor to set the "last-modified" or "etag" response headers.<commit_after>"""
Track the modification date for pages.
"""
from datetime import datetime
from django.db im... | |
06e4fd4b7d4cc4c984a05887fce00f7c8bbdc174 | tests/notifiers/test_messaging.py | tests/notifiers/test_messaging.py | # Copyright 2014 Mirantis Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | Add missing tests for messaging notifer plugin | Add missing tests for messaging notifer plugin
Change-Id: I1a206fdbbb89c03b04eafe0ad850441094e363e5
| Python | apache-2.0 | stackforge/osprofiler,openstack/osprofiler,stackforge/osprofiler,openstack/osprofiler,stackforge/osprofiler,openstack/osprofiler | Add missing tests for messaging notifer plugin
Change-Id: I1a206fdbbb89c03b04eafe0ad850441094e363e5 | # Copyright 2014 Mirantis Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | <commit_before><commit_msg>Add missing tests for messaging notifer plugin
Change-Id: I1a206fdbbb89c03b04eafe0ad850441094e363e5<commit_after> | # Copyright 2014 Mirantis Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | Add missing tests for messaging notifer plugin
Change-Id: I1a206fdbbb89c03b04eafe0ad850441094e363e5# Copyright 2014 Mirantis Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a cop... | <commit_before><commit_msg>Add missing tests for messaging notifer plugin
Change-Id: I1a206fdbbb89c03b04eafe0ad850441094e363e5<commit_after># Copyright 2014 Mirantis Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance wi... | |
387b5732c0b2231580ae04bf5088ef7ce59b0d84 | normalize_dataset.py | normalize_dataset.py | """Create multilabel data set with normalized spelling.
The input consists of a directory of text files containing the dataset in
historic spelling.
The data set consists of:
<sentence id>\t<sentence>\tEmotie_Liefde (embodied emotions labels separated by
_)
<sentence id>\t<sentence>\tNone ('None' if no words were tagg... | Add script to normalize the spelling in a dataset | Add script to normalize the spelling in a dataset
Added a script that normalizes the spelling in a dataset consisting of
files containing <sentence_id> \t <sentence> \t <label(s)>
| Python | apache-2.0 | NLeSC/embodied-emotions-scripts,NLeSC/embodied-emotions-scripts | Add script to normalize the spelling in a dataset
Added a script that normalizes the spelling in a dataset consisting of
files containing <sentence_id> \t <sentence> \t <label(s)> | """Create multilabel data set with normalized spelling.
The input consists of a directory of text files containing the dataset in
historic spelling.
The data set consists of:
<sentence id>\t<sentence>\tEmotie_Liefde (embodied emotions labels separated by
_)
<sentence id>\t<sentence>\tNone ('None' if no words were tagg... | <commit_before><commit_msg>Add script to normalize the spelling in a dataset
Added a script that normalizes the spelling in a dataset consisting of
files containing <sentence_id> \t <sentence> \t <label(s)><commit_after> | """Create multilabel data set with normalized spelling.
The input consists of a directory of text files containing the dataset in
historic spelling.
The data set consists of:
<sentence id>\t<sentence>\tEmotie_Liefde (embodied emotions labels separated by
_)
<sentence id>\t<sentence>\tNone ('None' if no words were tagg... | Add script to normalize the spelling in a dataset
Added a script that normalizes the spelling in a dataset consisting of
files containing <sentence_id> \t <sentence> \t <label(s)>"""Create multilabel data set with normalized spelling.
The input consists of a directory of text files containing the dataset in
historic s... | <commit_before><commit_msg>Add script to normalize the spelling in a dataset
Added a script that normalizes the spelling in a dataset consisting of
files containing <sentence_id> \t <sentence> \t <label(s)><commit_after>"""Create multilabel data set with normalized spelling.
The input consists of a directory of text f... | |
65e689dd66124fcaa0ce8ab9f5029b727fba18e2 | src/compare_version_numbers.py | src/compare_version_numbers.py | """
Source : https://oj.leetcode.com/problems/compare-version-numbers/
Author : Changxi Wu
Date : 2015-01-23
Compare two version numbers version1 and version2.
if version1 > version2 return 1, if version1 < version2 return -1, otherwise return 0.
You may assume that the version strings are non-empty and contain on... | Add solution for compare version numbers | Add solution for compare version numbers
| Python | mit | chancyWu/leetcode | Add solution for compare version numbers | """
Source : https://oj.leetcode.com/problems/compare-version-numbers/
Author : Changxi Wu
Date : 2015-01-23
Compare two version numbers version1 and version2.
if version1 > version2 return 1, if version1 < version2 return -1, otherwise return 0.
You may assume that the version strings are non-empty and contain on... | <commit_before><commit_msg>Add solution for compare version numbers<commit_after> | """
Source : https://oj.leetcode.com/problems/compare-version-numbers/
Author : Changxi Wu
Date : 2015-01-23
Compare two version numbers version1 and version2.
if version1 > version2 return 1, if version1 < version2 return -1, otherwise return 0.
You may assume that the version strings are non-empty and contain on... | Add solution for compare version numbers"""
Source : https://oj.leetcode.com/problems/compare-version-numbers/
Author : Changxi Wu
Date : 2015-01-23
Compare two version numbers version1 and version2.
if version1 > version2 return 1, if version1 < version2 return -1, otherwise return 0.
You may assume that the vers... | <commit_before><commit_msg>Add solution for compare version numbers<commit_after>"""
Source : https://oj.leetcode.com/problems/compare-version-numbers/
Author : Changxi Wu
Date : 2015-01-23
Compare two version numbers version1 and version2.
if version1 > version2 return 1, if version1 < version2 return -1, otherwis... | |
2dd5afae12dc7d58c3349f2df2694eeb77ca0298 | examples/test_spinn_tracks4.py | examples/test_spinn_tracks4.py | import nengo
import nengo_pushbot
import numpy as np
model = nengo.Network()
with model:
input = nengo.Node(lambda t: [0.5*np.sin(t), 0.5*np.cos(t)])
a = nengo.Ensemble(nengo.LIF(100), dimensions=2)
#b = nengo.Ensemble(nengo.LIF(100), dimensions=2)
#c = nengo.Ensemble(nengo.LIF(100), dimensions=2)
... | Test driving robot via serial input | Test driving robot via serial input
| Python | mit | ctn-waterloo/nengo_pushbot,ctn-waterloo/nengo_pushbot | Test driving robot via serial input | import nengo
import nengo_pushbot
import numpy as np
model = nengo.Network()
with model:
input = nengo.Node(lambda t: [0.5*np.sin(t), 0.5*np.cos(t)])
a = nengo.Ensemble(nengo.LIF(100), dimensions=2)
#b = nengo.Ensemble(nengo.LIF(100), dimensions=2)
#c = nengo.Ensemble(nengo.LIF(100), dimensions=2)
... | <commit_before><commit_msg>Test driving robot via serial input<commit_after> | import nengo
import nengo_pushbot
import numpy as np
model = nengo.Network()
with model:
input = nengo.Node(lambda t: [0.5*np.sin(t), 0.5*np.cos(t)])
a = nengo.Ensemble(nengo.LIF(100), dimensions=2)
#b = nengo.Ensemble(nengo.LIF(100), dimensions=2)
#c = nengo.Ensemble(nengo.LIF(100), dimensions=2)
... | Test driving robot via serial inputimport nengo
import nengo_pushbot
import numpy as np
model = nengo.Network()
with model:
input = nengo.Node(lambda t: [0.5*np.sin(t), 0.5*np.cos(t)])
a = nengo.Ensemble(nengo.LIF(100), dimensions=2)
#b = nengo.Ensemble(nengo.LIF(100), dimensions=2)
#c = nengo.Ensemb... | <commit_before><commit_msg>Test driving robot via serial input<commit_after>import nengo
import nengo_pushbot
import numpy as np
model = nengo.Network()
with model:
input = nengo.Node(lambda t: [0.5*np.sin(t), 0.5*np.cos(t)])
a = nengo.Ensemble(nengo.LIF(100), dimensions=2)
#b = nengo.Ensemble(nengo.LIF(... | |
d777a19bb804ae1a4268702da00d3138b028b386 | contrib/dump_docs.py | contrib/dump_docs.py | #!/usr/bin/env python
"""
Start the process and dump the documentation to the doc dir
"""
import socket, subprocess, time,os
env = os.environ
env['L1FWD_BTS_HOST'] = '127.0.0.1'
bts_proc = subprocess.Popen(["./src/osmo-bts-sysmo/sysmobts-remote",
"-c", "./doc/examples/osmo-bts.cfg"], env = env,
stdin=None, stdo... | Add a python script to start sysmobts-remote and dump docs | contrib: Add a python script to start sysmobts-remote and dump docs
This starts sysmobts-remote and dumps the documentation about the
VTY to the doc/ directory.
$ ./contrib/dump_docs.py
this writes doc/vty_reference.xml
| Python | agpl-3.0 | osmocom/osmo-bts,telenoobie/osmo-bts,shimaore/osmo-bts,geosphere/osmo-bts,telenoobie/osmo-bts,shimaore/osmo-bts,osmocom/osmo-bts,shimaore/osmo-bts,geosphere/osmo-bts,geosphere/osmo-bts,telenoobie/osmo-bts,shimaore/osmo-bts,geosphere/osmo-bts,telenoobie/osmo-bts,osmocom/osmo-bts | contrib: Add a python script to start sysmobts-remote and dump docs
This starts sysmobts-remote and dumps the documentation about the
VTY to the doc/ directory.
$ ./contrib/dump_docs.py
this writes doc/vty_reference.xml | #!/usr/bin/env python
"""
Start the process and dump the documentation to the doc dir
"""
import socket, subprocess, time,os
env = os.environ
env['L1FWD_BTS_HOST'] = '127.0.0.1'
bts_proc = subprocess.Popen(["./src/osmo-bts-sysmo/sysmobts-remote",
"-c", "./doc/examples/osmo-bts.cfg"], env = env,
stdin=None, stdo... | <commit_before><commit_msg>contrib: Add a python script to start sysmobts-remote and dump docs
This starts sysmobts-remote and dumps the documentation about the
VTY to the doc/ directory.
$ ./contrib/dump_docs.py
this writes doc/vty_reference.xml<commit_after> | #!/usr/bin/env python
"""
Start the process and dump the documentation to the doc dir
"""
import socket, subprocess, time,os
env = os.environ
env['L1FWD_BTS_HOST'] = '127.0.0.1'
bts_proc = subprocess.Popen(["./src/osmo-bts-sysmo/sysmobts-remote",
"-c", "./doc/examples/osmo-bts.cfg"], env = env,
stdin=None, stdo... | contrib: Add a python script to start sysmobts-remote and dump docs
This starts sysmobts-remote and dumps the documentation about the
VTY to the doc/ directory.
$ ./contrib/dump_docs.py
this writes doc/vty_reference.xml#!/usr/bin/env python
"""
Start the process and dump the documentation to the doc dir
"""
import ... | <commit_before><commit_msg>contrib: Add a python script to start sysmobts-remote and dump docs
This starts sysmobts-remote and dumps the documentation about the
VTY to the doc/ directory.
$ ./contrib/dump_docs.py
this writes doc/vty_reference.xml<commit_after>#!/usr/bin/env python
"""
Start the process and dump the ... | |
89c17110f9d17e99ea7686e884cfba91b4762d57 | pybaseball/lahman.py | pybaseball/lahman.py | ################################################
# WORK IN PROGRESS: ADD LAHMAN DB TO PYBASEBALL
# TODO: Make a callable function that retrieves the Lahman db
# Considerations: users should have a way to pull just the parts they want
# within their code without having to write / save permanently. They should
# also ha... | Add starter code for Lahman db | Add starter code for Lahman db
| Python | mit | jldbc/pybaseball | Add starter code for Lahman db | ################################################
# WORK IN PROGRESS: ADD LAHMAN DB TO PYBASEBALL
# TODO: Make a callable function that retrieves the Lahman db
# Considerations: users should have a way to pull just the parts they want
# within their code without having to write / save permanently. They should
# also ha... | <commit_before><commit_msg>Add starter code for Lahman db<commit_after> | ################################################
# WORK IN PROGRESS: ADD LAHMAN DB TO PYBASEBALL
# TODO: Make a callable function that retrieves the Lahman db
# Considerations: users should have a way to pull just the parts they want
# within their code without having to write / save permanently. They should
# also ha... | Add starter code for Lahman db################################################
# WORK IN PROGRESS: ADD LAHMAN DB TO PYBASEBALL
# TODO: Make a callable function that retrieves the Lahman db
# Considerations: users should have a way to pull just the parts they want
# within their code without having to write / save perm... | <commit_before><commit_msg>Add starter code for Lahman db<commit_after>################################################
# WORK IN PROGRESS: ADD LAHMAN DB TO PYBASEBALL
# TODO: Make a callable function that retrieves the Lahman db
# Considerations: users should have a way to pull just the parts they want
# within their... | |
0e9e63a48c5f3e02fb49d0068363ac5442b39e37 | discussion/models.py | discussion/models.py | from django.contrib.auth.models import User
from django.db import models
class Discussion(models.Model):
user = models.ForeignKey(User)
name = models.CharField(max_length=255)
slug = models.SlugField()
def __unicode__(self):
return self.name
class Post(models.Model):
discussion = models... | from django.contrib.auth.models import User
from django.db import models
class Discussion(models.Model):
user = models.ForeignKey(User)
name = models.CharField(max_length=255)
slug = models.SlugField()
def __unicode__(self):
return self.name
class Post(models.Model):
discussion = models... | Add a body to posts | Add a body to posts
| Python | bsd-2-clause | incuna/django-discussion,lehins/lehins-discussion,lehins/lehins-discussion,incuna/django-discussion,lehins/lehins-discussion | from django.contrib.auth.models import User
from django.db import models
class Discussion(models.Model):
user = models.ForeignKey(User)
name = models.CharField(max_length=255)
slug = models.SlugField()
def __unicode__(self):
return self.name
class Post(models.Model):
discussion = models... | from django.contrib.auth.models import User
from django.db import models
class Discussion(models.Model):
user = models.ForeignKey(User)
name = models.CharField(max_length=255)
slug = models.SlugField()
def __unicode__(self):
return self.name
class Post(models.Model):
discussion = models... | <commit_before>from django.contrib.auth.models import User
from django.db import models
class Discussion(models.Model):
user = models.ForeignKey(User)
name = models.CharField(max_length=255)
slug = models.SlugField()
def __unicode__(self):
return self.name
class Post(models.Model):
disc... | from django.contrib.auth.models import User
from django.db import models
class Discussion(models.Model):
user = models.ForeignKey(User)
name = models.CharField(max_length=255)
slug = models.SlugField()
def __unicode__(self):
return self.name
class Post(models.Model):
discussion = models... | from django.contrib.auth.models import User
from django.db import models
class Discussion(models.Model):
user = models.ForeignKey(User)
name = models.CharField(max_length=255)
slug = models.SlugField()
def __unicode__(self):
return self.name
class Post(models.Model):
discussion = models... | <commit_before>from django.contrib.auth.models import User
from django.db import models
class Discussion(models.Model):
user = models.ForeignKey(User)
name = models.CharField(max_length=255)
slug = models.SlugField()
def __unicode__(self):
return self.name
class Post(models.Model):
disc... |
20d77f66e0287b3aab08b4cf14f23e7e5672aefd | db_setup/nflpool_picks.py | db_setup/nflpool_picks.py | import sqlite3
conn = sqlite3.connect('nflpool.sqlite')
cur = conn.cursor()
# Do some setup
cur.executescript('''
DROP TABLE IF EXISTS Player;
CREATE TABLE Picks (
firstname TEXT NOT NULL,
lastname TEXT NOT NULL,
id INTEGER NOT NULL PRIMARY KEY UNIQUE,
season TEXT NOT NULL UNIQUE,
email TE... | Create database import script for the Picks table (each NFLPool Player's picks for a given season) | Create database import script for the Picks table (each NFLPool Player's picks for a given season)
| Python | mit | prcutler/nflpool,prcutler/nflpool | Create database import script for the Picks table (each NFLPool Player's picks for a given season) | import sqlite3
conn = sqlite3.connect('nflpool.sqlite')
cur = conn.cursor()
# Do some setup
cur.executescript('''
DROP TABLE IF EXISTS Player;
CREATE TABLE Picks (
firstname TEXT NOT NULL,
lastname TEXT NOT NULL,
id INTEGER NOT NULL PRIMARY KEY UNIQUE,
season TEXT NOT NULL UNIQUE,
email TE... | <commit_before><commit_msg>Create database import script for the Picks table (each NFLPool Player's picks for a given season)<commit_after> | import sqlite3
conn = sqlite3.connect('nflpool.sqlite')
cur = conn.cursor()
# Do some setup
cur.executescript('''
DROP TABLE IF EXISTS Player;
CREATE TABLE Picks (
firstname TEXT NOT NULL,
lastname TEXT NOT NULL,
id INTEGER NOT NULL PRIMARY KEY UNIQUE,
season TEXT NOT NULL UNIQUE,
email TE... | Create database import script for the Picks table (each NFLPool Player's picks for a given season)import sqlite3
conn = sqlite3.connect('nflpool.sqlite')
cur = conn.cursor()
# Do some setup
cur.executescript('''
DROP TABLE IF EXISTS Player;
CREATE TABLE Picks (
firstname TEXT NOT NULL,
lastname TEXT NO... | <commit_before><commit_msg>Create database import script for the Picks table (each NFLPool Player's picks for a given season)<commit_after>import sqlite3
conn = sqlite3.connect('nflpool.sqlite')
cur = conn.cursor()
# Do some setup
cur.executescript('''
DROP TABLE IF EXISTS Player;
CREATE TABLE Picks (
firstname ... | |
8ad4627973db344e228a9170aef030ab58efdeb9 | src/ggrc/converters/__init__.py | src/ggrc/converters/__init__.py | # Copyright (C) 2013 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: dan@reciprocitylabs.com
# Maintained By: dan@reciprocitylabs.com
from ggrc.converters.sections import SectionsConverter
all_converters = [('sectio... | # Copyright (C) 2013 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: dan@reciprocitylabs.com
# Maintained By: dan@reciprocitylabs.com
from ggrc.converters.sections import SectionsConverter
from ggrc.models import (
... | Add column order and importable objects lists | Add column order and importable objects lists
| Python | apache-2.0 | edofic/ggrc-core,hasanalom/ggrc-core,AleksNeStu/ggrc-core,AleksNeStu/ggrc-core,plamut/ggrc-core,NejcZupec/ggrc-core,selahssea/ggrc-core,jmakov/ggrc-core,j0gurt/ggrc-core,NejcZupec/ggrc-core,NejcZupec/ggrc-core,josthkko/ggrc-core,jmakov/ggrc-core,VinnieJohns/ggrc-core,edofic/ggrc-core,selahssea/ggrc-core,hyperNURb/ggrc-... | # Copyright (C) 2013 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: dan@reciprocitylabs.com
# Maintained By: dan@reciprocitylabs.com
from ggrc.converters.sections import SectionsConverter
all_converters = [('sectio... | # Copyright (C) 2013 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: dan@reciprocitylabs.com
# Maintained By: dan@reciprocitylabs.com
from ggrc.converters.sections import SectionsConverter
from ggrc.models import (
... | <commit_before># Copyright (C) 2013 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: dan@reciprocitylabs.com
# Maintained By: dan@reciprocitylabs.com
from ggrc.converters.sections import SectionsConverter
all_convert... | # Copyright (C) 2013 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: dan@reciprocitylabs.com
# Maintained By: dan@reciprocitylabs.com
from ggrc.converters.sections import SectionsConverter
from ggrc.models import (
... | # Copyright (C) 2013 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: dan@reciprocitylabs.com
# Maintained By: dan@reciprocitylabs.com
from ggrc.converters.sections import SectionsConverter
all_converters = [('sectio... | <commit_before># Copyright (C) 2013 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: dan@reciprocitylabs.com
# Maintained By: dan@reciprocitylabs.com
from ggrc.converters.sections import SectionsConverter
all_convert... |
8141d6cafb4a1c8986ec7065f27d536d98cc9916 | Modules/Biophotonics/python/iMC/script_plot_one_spectrum.py | Modules/Biophotonics/python/iMC/script_plot_one_spectrum.py | '''
Created on Oct 12, 2015
@author: wirkert
'''
import pickle
import logging
import numpy as np
import matplotlib.pyplot as plt
import luigi
import tasks_regression as rt
from msi.plot import plot
from msi.msi import Msi
import msi.normalize as norm
import scriptpaths as sp
sp.ROOT_FOLDER = "/media/wirkert/data/D... | Add little script calculate sample spectra. | Add little script calculate sample spectra.
| Python | bsd-3-clause | RabadanLab/MITKats,MITK/MITK,MITK/MITK,RabadanLab/MITKats,MITK/MITK,MITK/MITK,fmilano/mitk,fmilano/mitk,fmilano/mitk,iwegner/MITK,RabadanLab/MITKats,iwegner/MITK,RabadanLab/MITKats,iwegner/MITK,RabadanLab/MITKats,MITK/MITK,fmilano/mitk,iwegner/MITK,fmilano/mitk,iwegner/MITK,fmilano/mitk,fmilano/mitk,RabadanLab/MITKats,... | Add little script calculate sample spectra. | '''
Created on Oct 12, 2015
@author: wirkert
'''
import pickle
import logging
import numpy as np
import matplotlib.pyplot as plt
import luigi
import tasks_regression as rt
from msi.plot import plot
from msi.msi import Msi
import msi.normalize as norm
import scriptpaths as sp
sp.ROOT_FOLDER = "/media/wirkert/data/D... | <commit_before><commit_msg>Add little script calculate sample spectra.<commit_after> | '''
Created on Oct 12, 2015
@author: wirkert
'''
import pickle
import logging
import numpy as np
import matplotlib.pyplot as plt
import luigi
import tasks_regression as rt
from msi.plot import plot
from msi.msi import Msi
import msi.normalize as norm
import scriptpaths as sp
sp.ROOT_FOLDER = "/media/wirkert/data/D... | Add little script calculate sample spectra.'''
Created on Oct 12, 2015
@author: wirkert
'''
import pickle
import logging
import numpy as np
import matplotlib.pyplot as plt
import luigi
import tasks_regression as rt
from msi.plot import plot
from msi.msi import Msi
import msi.normalize as norm
import scriptpaths as ... | <commit_before><commit_msg>Add little script calculate sample spectra.<commit_after>'''
Created on Oct 12, 2015
@author: wirkert
'''
import pickle
import logging
import numpy as np
import matplotlib.pyplot as plt
import luigi
import tasks_regression as rt
from msi.plot import plot
from msi.msi import Msi
import msi... | |
6be3e0c5264ca2750a77ac1dbd4175502e51fd3c | ceph_deploy/tests/parser/test_admin.py | ceph_deploy/tests/parser/test_admin.py | import pytest
from ceph_deploy.cli import get_parser
class TestParserAdmin(object):
def setup(self):
self.parser = get_parser()
def test_admin_help(self, capsys):
with pytest.raises(SystemExit):
self.parser.parse_args('admin --help'.split())
out, err = capsys.readouterr(... | Add argparse tests for ceph-deploy admin | [RM-11742] Add argparse tests for ceph-deploy admin
Signed-off-by: Travis Rhoden <e5e44d6dbac12e32e01c3bb8b67940d8b42e225b@redhat.com>
| Python | mit | Vicente-Cheng/ceph-deploy,ceph/ceph-deploy,codenrhoden/ceph-deploy,shenhequnying/ceph-deploy,branto1/ceph-deploy,ghxandsky/ceph-deploy,imzhulei/ceph-deploy,isyippee/ceph-deploy,trhoden/ceph-deploy,zhouyuan/ceph-deploy,Vicente-Cheng/ceph-deploy,zhouyuan/ceph-deploy,ceph/ceph-deploy,osynge/ceph-deploy,SUSE/ceph-deploy-to... | [RM-11742] Add argparse tests for ceph-deploy admin
Signed-off-by: Travis Rhoden <e5e44d6dbac12e32e01c3bb8b67940d8b42e225b@redhat.com> | import pytest
from ceph_deploy.cli import get_parser
class TestParserAdmin(object):
def setup(self):
self.parser = get_parser()
def test_admin_help(self, capsys):
with pytest.raises(SystemExit):
self.parser.parse_args('admin --help'.split())
out, err = capsys.readouterr(... | <commit_before><commit_msg>[RM-11742] Add argparse tests for ceph-deploy admin
Signed-off-by: Travis Rhoden <e5e44d6dbac12e32e01c3bb8b67940d8b42e225b@redhat.com><commit_after> | import pytest
from ceph_deploy.cli import get_parser
class TestParserAdmin(object):
def setup(self):
self.parser = get_parser()
def test_admin_help(self, capsys):
with pytest.raises(SystemExit):
self.parser.parse_args('admin --help'.split())
out, err = capsys.readouterr(... | [RM-11742] Add argparse tests for ceph-deploy admin
Signed-off-by: Travis Rhoden <e5e44d6dbac12e32e01c3bb8b67940d8b42e225b@redhat.com>import pytest
from ceph_deploy.cli import get_parser
class TestParserAdmin(object):
def setup(self):
self.parser = get_parser()
def test_admin_help(self, capsys):
... | <commit_before><commit_msg>[RM-11742] Add argparse tests for ceph-deploy admin
Signed-off-by: Travis Rhoden <e5e44d6dbac12e32e01c3bb8b67940d8b42e225b@redhat.com><commit_after>import pytest
from ceph_deploy.cli import get_parser
class TestParserAdmin(object):
def setup(self):
self.parser = get_parser()
... | |
2523d34d4f3e26a408c7ec0e43708efea77f03a9 | workflow/cndic_naver_search.py | workflow/cndic_naver_search.py | # Naver Search Workflow for Alfred 2
# Copyright (C) 2013 Jinuk Baek
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later versi... | Add to support the chinese library | Add to support the chinese library
| Python | mit | Kuniz/alfnaversearch,Kuniz/alfnaversearch | Add to support the chinese library | # Naver Search Workflow for Alfred 2
# Copyright (C) 2013 Jinuk Baek
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later versi... | <commit_before><commit_msg>Add to support the chinese library<commit_after> | # Naver Search Workflow for Alfred 2
# Copyright (C) 2013 Jinuk Baek
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later versi... | Add to support the chinese library# Naver Search Workflow for Alfred 2
# Copyright (C) 2013 Jinuk Baek
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, o... | <commit_before><commit_msg>Add to support the chinese library<commit_after># Naver Search Workflow for Alfred 2
# Copyright (C) 2013 Jinuk Baek
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundati... | |
1e7b84155623691fb9fc1cec4efa6386938f3e72 | core/migrations/0055_update_username_validators.py | core/migrations/0055_update_username_validators.py | # -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-07-22 22:03
from __future__ import unicode_literals
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0054_add_provider__cloud_config_and_timezone'),
]
... | Add missing migration (updating validators=) | Add missing migration (updating validators=)
| Python | apache-2.0 | CCI-MOC/GUI-Backend,CCI-MOC/GUI-Backend,CCI-MOC/GUI-Backend,CCI-MOC/GUI-Backend | Add missing migration (updating validators=) | # -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-07-22 22:03
from __future__ import unicode_literals
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0054_add_provider__cloud_config_and_timezone'),
]
... | <commit_before><commit_msg>Add missing migration (updating validators=)<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-07-22 22:03
from __future__ import unicode_literals
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0054_add_provider__cloud_config_and_timezone'),
]
... | Add missing migration (updating validators=)# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-07-22 22:03
from __future__ import unicode_literals
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0054_add_pr... | <commit_before><commit_msg>Add missing migration (updating validators=)<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-07-22 22:03
from __future__ import unicode_literals
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
depen... | |
48217e5317412a9b5fb8181b6915963783efeaf2 | tests/test_historical_klines.py | tests/test_historical_klines.py | #!/usr/bin/env python
# coding=utf-8
from binance.client import Client
import pytest
import requests_mock
client = Client('api_key', 'api_secret')
def test_exact_amount():
"""Test Exact amount returned"""
first_res = []
row = [1519892340000,"0.00099400","0.00099810","0.00099400","0.00099810","4806.040... | Add test for kline result of exact amount | Add test for kline result of exact amount
| Python | mit | sammchardy/python-binance | Add test for kline result of exact amount | #!/usr/bin/env python
# coding=utf-8
from binance.client import Client
import pytest
import requests_mock
client = Client('api_key', 'api_secret')
def test_exact_amount():
"""Test Exact amount returned"""
first_res = []
row = [1519892340000,"0.00099400","0.00099810","0.00099400","0.00099810","4806.040... | <commit_before><commit_msg>Add test for kline result of exact amount<commit_after> | #!/usr/bin/env python
# coding=utf-8
from binance.client import Client
import pytest
import requests_mock
client = Client('api_key', 'api_secret')
def test_exact_amount():
"""Test Exact amount returned"""
first_res = []
row = [1519892340000,"0.00099400","0.00099810","0.00099400","0.00099810","4806.040... | Add test for kline result of exact amount#!/usr/bin/env python
# coding=utf-8
from binance.client import Client
import pytest
import requests_mock
client = Client('api_key', 'api_secret')
def test_exact_amount():
"""Test Exact amount returned"""
first_res = []
row = [1519892340000,"0.00099400","0.0009... | <commit_before><commit_msg>Add test for kline result of exact amount<commit_after>#!/usr/bin/env python
# coding=utf-8
from binance.client import Client
import pytest
import requests_mock
client = Client('api_key', 'api_secret')
def test_exact_amount():
"""Test Exact amount returned"""
first_res = []
... | |
c663f6b6e31832fae682c2c527955b13682b701e | course_discovery/apps/course_metadata/migrations/0127_remove_courserun_learner_testimonials.py | course_discovery/apps/course_metadata/migrations/0127_remove_courserun_learner_testimonials.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2018-11-07 17:16
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('course_metadata', '0126_course_has_ofac_restrictions'),
]
operations = [
migration... | Remove learner_testimonials column from course_metadata course run table | Remove learner_testimonials column from course_metadata course run table
| Python | agpl-3.0 | edx/course-discovery,edx/course-discovery,edx/course-discovery,edx/course-discovery | Remove learner_testimonials column from course_metadata course run table | # -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2018-11-07 17:16
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('course_metadata', '0126_course_has_ofac_restrictions'),
]
operations = [
migration... | <commit_before><commit_msg>Remove learner_testimonials column from course_metadata course run table<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2018-11-07 17:16
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('course_metadata', '0126_course_has_ofac_restrictions'),
]
operations = [
migration... | Remove learner_testimonials column from course_metadata course run table# -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2018-11-07 17:16
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('course_metadata', '0126_cou... | <commit_before><commit_msg>Remove learner_testimonials column from course_metadata course run table<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2018-11-07 17:16
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies ... | |
b75e10f3235e9215458071279b67910627a95180 | ceam/framework/celery_tasks.py | ceam/framework/celery_tasks.py | import os
from time import time
import logging
import pandas as pd
from celery import Celery
from billiard import current_process
app = Celery()
@app.task(autoretry_for=(Exception,), max_retries=2)
def worker(draw_number, component_config, branch_config, logging_directory):
worker = current_process().index
... | Add celery based job runner | Add celery based job runner
| Python | bsd-3-clause | ihmeuw/vivarium | Add celery based job runner | import os
from time import time
import logging
import pandas as pd
from celery import Celery
from billiard import current_process
app = Celery()
@app.task(autoretry_for=(Exception,), max_retries=2)
def worker(draw_number, component_config, branch_config, logging_directory):
worker = current_process().index
... | <commit_before><commit_msg>Add celery based job runner<commit_after> | import os
from time import time
import logging
import pandas as pd
from celery import Celery
from billiard import current_process
app = Celery()
@app.task(autoretry_for=(Exception,), max_retries=2)
def worker(draw_number, component_config, branch_config, logging_directory):
worker = current_process().index
... | Add celery based job runnerimport os
from time import time
import logging
import pandas as pd
from celery import Celery
from billiard import current_process
app = Celery()
@app.task(autoretry_for=(Exception,), max_retries=2)
def worker(draw_number, component_config, branch_config, logging_directory):
worker = ... | <commit_before><commit_msg>Add celery based job runner<commit_after>import os
from time import time
import logging
import pandas as pd
from celery import Celery
from billiard import current_process
app = Celery()
@app.task(autoretry_for=(Exception,), max_retries=2)
def worker(draw_number, component_config, branch_... | |
164f43f902b89b84b4f0d474f4d3e0a18924110d | selection_test.py | selection_test.py | import quicksort.quicksort
import random_selection.random_selection
import sys
import time
from random import randint
def main(max_len, check):
for n in [2**(n+1) for n in range(max_len)]:
arr = [randint(0, 2**max_len) for n in range(n)]
median = int((len(arr)+1)/2) - 1
current_time = time.time()
result = r... | Add test of randomized select algorithm | Add test of randomized select algorithm
Similar to the sorting algorithm tests, selection_test.py checks
the runtime and correctness of the randomized selection algorithm
for exponentially increasing n.
Because it checks for correctness with quicksort, it can't test for
very large n (sorting runtime grows a lot faste... | Python | mit | timpel/stanford-algs,timpel/stanford-algs | Add test of randomized select algorithm
Similar to the sorting algorithm tests, selection_test.py checks
the runtime and correctness of the randomized selection algorithm
for exponentially increasing n.
Because it checks for correctness with quicksort, it can't test for
very large n (sorting runtime grows a lot faste... | import quicksort.quicksort
import random_selection.random_selection
import sys
import time
from random import randint
def main(max_len, check):
for n in [2**(n+1) for n in range(max_len)]:
arr = [randint(0, 2**max_len) for n in range(n)]
median = int((len(arr)+1)/2) - 1
current_time = time.time()
result = r... | <commit_before><commit_msg>Add test of randomized select algorithm
Similar to the sorting algorithm tests, selection_test.py checks
the runtime and correctness of the randomized selection algorithm
for exponentially increasing n.
Because it checks for correctness with quicksort, it can't test for
very large n (sortin... | import quicksort.quicksort
import random_selection.random_selection
import sys
import time
from random import randint
def main(max_len, check):
for n in [2**(n+1) for n in range(max_len)]:
arr = [randint(0, 2**max_len) for n in range(n)]
median = int((len(arr)+1)/2) - 1
current_time = time.time()
result = r... | Add test of randomized select algorithm
Similar to the sorting algorithm tests, selection_test.py checks
the runtime and correctness of the randomized selection algorithm
for exponentially increasing n.
Because it checks for correctness with quicksort, it can't test for
very large n (sorting runtime grows a lot faste... | <commit_before><commit_msg>Add test of randomized select algorithm
Similar to the sorting algorithm tests, selection_test.py checks
the runtime and correctness of the randomized selection algorithm
for exponentially increasing n.
Because it checks for correctness with quicksort, it can't test for
very large n (sortin... | |
82d34111295fdfa35d0e9815053498e935d415af | examples/store_datetimes.py | examples/store_datetimes.py | import h5py
import numpy as np
arr = np.array([np.datetime64('2019-09-22T17:38:30')])
with h5py.File('datetimes.h5', 'w') as f:
# Create dataset
f['data'] = arr.astype(h5py.opaque_dtype(arr.dtype))
# Read
print(f['data'][:])
| Add example script to store & read datetime | Add example script to store & read datetime
| Python | bsd-3-clause | h5py/h5py,h5py/h5py,h5py/h5py | Add example script to store & read datetime | import h5py
import numpy as np
arr = np.array([np.datetime64('2019-09-22T17:38:30')])
with h5py.File('datetimes.h5', 'w') as f:
# Create dataset
f['data'] = arr.astype(h5py.opaque_dtype(arr.dtype))
# Read
print(f['data'][:])
| <commit_before><commit_msg>Add example script to store & read datetime<commit_after> | import h5py
import numpy as np
arr = np.array([np.datetime64('2019-09-22T17:38:30')])
with h5py.File('datetimes.h5', 'w') as f:
# Create dataset
f['data'] = arr.astype(h5py.opaque_dtype(arr.dtype))
# Read
print(f['data'][:])
| Add example script to store & read datetimeimport h5py
import numpy as np
arr = np.array([np.datetime64('2019-09-22T17:38:30')])
with h5py.File('datetimes.h5', 'w') as f:
# Create dataset
f['data'] = arr.astype(h5py.opaque_dtype(arr.dtype))
# Read
print(f['data'][:])
| <commit_before><commit_msg>Add example script to store & read datetime<commit_after>import h5py
import numpy as np
arr = np.array([np.datetime64('2019-09-22T17:38:30')])
with h5py.File('datetimes.h5', 'w') as f:
# Create dataset
f['data'] = arr.astype(h5py.opaque_dtype(arr.dtype))
# Read
print(f['dat... | |
52236b1ad285683d828b248e462a7b984d31e636 | examples/world.py | examples/world.py | import ogr
import pylab
from numpy import asarray
from shapely.wkb import loads
source = ogr.Open("/var/gis/data/world/world_borders.shp")
borders = source.GetLayerByName("world_borders")
fig = pylab.figure(1, figsize=(4,2), dpi=300)
while 1:
feature = borders.GetNextFeature()
if not feature:
break
... | Add example of connecting OGR to matplotlib through shapely and numpy | Add example of connecting OGR to matplotlib through shapely and numpy
git-svn-id: 30e8e193f18ae0331cc1220771e45549f871ece9@749 b426a367-1105-0410-b9ff-cdf4ab011145
| Python | bsd-3-clause | jdmcbr/Shapely,mindw/shapely,jdmcbr/Shapely,mouadino/Shapely,abali96/Shapely,abali96/Shapely,mouadino/Shapely,mindw/shapely | Add example of connecting OGR to matplotlib through shapely and numpy
git-svn-id: 30e8e193f18ae0331cc1220771e45549f871ece9@749 b426a367-1105-0410-b9ff-cdf4ab011145 | import ogr
import pylab
from numpy import asarray
from shapely.wkb import loads
source = ogr.Open("/var/gis/data/world/world_borders.shp")
borders = source.GetLayerByName("world_borders")
fig = pylab.figure(1, figsize=(4,2), dpi=300)
while 1:
feature = borders.GetNextFeature()
if not feature:
break
... | <commit_before><commit_msg>Add example of connecting OGR to matplotlib through shapely and numpy
git-svn-id: 30e8e193f18ae0331cc1220771e45549f871ece9@749 b426a367-1105-0410-b9ff-cdf4ab011145<commit_after> | import ogr
import pylab
from numpy import asarray
from shapely.wkb import loads
source = ogr.Open("/var/gis/data/world/world_borders.shp")
borders = source.GetLayerByName("world_borders")
fig = pylab.figure(1, figsize=(4,2), dpi=300)
while 1:
feature = borders.GetNextFeature()
if not feature:
break
... | Add example of connecting OGR to matplotlib through shapely and numpy
git-svn-id: 30e8e193f18ae0331cc1220771e45549f871ece9@749 b426a367-1105-0410-b9ff-cdf4ab011145import ogr
import pylab
from numpy import asarray
from shapely.wkb import loads
source = ogr.Open("/var/gis/data/world/world_borders.shp")
borders = sourc... | <commit_before><commit_msg>Add example of connecting OGR to matplotlib through shapely and numpy
git-svn-id: 30e8e193f18ae0331cc1220771e45549f871ece9@749 b426a367-1105-0410-b9ff-cdf4ab011145<commit_after>import ogr
import pylab
from numpy import asarray
from shapely.wkb import loads
source = ogr.Open("/var/gis/data/... | |
fd33fadc260cda2bd2395f027457f990ab05480b | registration/migrations/0008_auto_20160418_2250.py | registration/migrations/0008_auto_20160418_2250.py | # -*- coding: utf-8 -*-
# Generated by Django 1.9.4 on 2016-04-18 13:50
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('registration', '0007_auto_20160416_1217'),
]
operations = [
migrations.Alter... | Add migration for Registration changed | Add migration for Registration changed
| Python | mit | pythonkr/pyconapac-2016,pythonkr/pyconapac-2016,pythonkr/pyconapac-2016 | Add migration for Registration changed | # -*- coding: utf-8 -*-
# Generated by Django 1.9.4 on 2016-04-18 13:50
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('registration', '0007_auto_20160416_1217'),
]
operations = [
migrations.Alter... | <commit_before><commit_msg>Add migration for Registration changed<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.9.4 on 2016-04-18 13:50
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('registration', '0007_auto_20160416_1217'),
]
operations = [
migrations.Alter... | Add migration for Registration changed# -*- coding: utf-8 -*-
# Generated by Django 1.9.4 on 2016-04-18 13:50
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('registration', '0007_auto_20160416_1217'),
]
o... | <commit_before><commit_msg>Add migration for Registration changed<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.9.4 on 2016-04-18 13:50
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('registration',... | |
9f6f6b727458eb331d370443074a58d1efa6d755 | kolibri/logger/migrations/0003_auto_20170531_1140.py | kolibri/logger/migrations/0003_auto_20170531_1140.py | # -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2017-05-31 18:40
from __future__ import unicode_literals
import kolibri.core.fields
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('logger', '0002_auto_20170518_1031'),
]
operations = [
mig... | Add migration for blank true. | Add migration for blank true.
| Python | mit | mrpau/kolibri,benjaoming/kolibri,indirectlylit/kolibri,benjaoming/kolibri,christianmemije/kolibri,lyw07/kolibri,benjaoming/kolibri,learningequality/kolibri,rtibbles/kolibri,indirectlylit/kolibri,indirectlylit/kolibri,jonboiser/kolibri,MingDai/kolibri,DXCanas/kolibri,rtibbles/kolibri,benjaoming/kolibri,rtibbles/kolibri,... | Add migration for blank true. | # -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2017-05-31 18:40
from __future__ import unicode_literals
import kolibri.core.fields
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('logger', '0002_auto_20170518_1031'),
]
operations = [
mig... | <commit_before><commit_msg>Add migration for blank true.<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2017-05-31 18:40
from __future__ import unicode_literals
import kolibri.core.fields
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('logger', '0002_auto_20170518_1031'),
]
operations = [
mig... | Add migration for blank true.# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2017-05-31 18:40
from __future__ import unicode_literals
import kolibri.core.fields
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('logger', '0002_auto_20170518_1031'),
]
... | <commit_before><commit_msg>Add migration for blank true.<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2017-05-31 18:40
from __future__ import unicode_literals
import kolibri.core.fields
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('logg... | |
b04e3787de29d4bee68854e15a7e783cbe3c3bd0 | pymks/tests/test_microstructure_generator.py | pymks/tests/test_microstructure_generator.py | import pytest
import numpy as np
from pymks.datasets import make_microstructure
@pytest.mark.xfail
def test_size_and_grain_size_failure():
make_microstructure(n_samples=1, size=(7, 7), grain_size=(8, 1))
@pytest.mark.xfail
def test_volume_fraction_failure():
make_microstructure(n_samples=1, volume_fraction=... | Add test for microstructure generator | Add test for microstructure generator
address #242
Add tests for microstructure generator to test new functionality. These
tests change that correct quantities of the volume fraction are
generated and that in appropriate sets of parameters fail.
| Python | mit | awhite40/pymks,davidbrough1/pymks,davidbrough1/pymks | Add test for microstructure generator
address #242
Add tests for microstructure generator to test new functionality. These
tests change that correct quantities of the volume fraction are
generated and that in appropriate sets of parameters fail. | import pytest
import numpy as np
from pymks.datasets import make_microstructure
@pytest.mark.xfail
def test_size_and_grain_size_failure():
make_microstructure(n_samples=1, size=(7, 7), grain_size=(8, 1))
@pytest.mark.xfail
def test_volume_fraction_failure():
make_microstructure(n_samples=1, volume_fraction=... | <commit_before><commit_msg>Add test for microstructure generator
address #242
Add tests for microstructure generator to test new functionality. These
tests change that correct quantities of the volume fraction are
generated and that in appropriate sets of parameters fail.<commit_after> | import pytest
import numpy as np
from pymks.datasets import make_microstructure
@pytest.mark.xfail
def test_size_and_grain_size_failure():
make_microstructure(n_samples=1, size=(7, 7), grain_size=(8, 1))
@pytest.mark.xfail
def test_volume_fraction_failure():
make_microstructure(n_samples=1, volume_fraction=... | Add test for microstructure generator
address #242
Add tests for microstructure generator to test new functionality. These
tests change that correct quantities of the volume fraction are
generated and that in appropriate sets of parameters fail.import pytest
import numpy as np
from pymks.datasets import make_microstr... | <commit_before><commit_msg>Add test for microstructure generator
address #242
Add tests for microstructure generator to test new functionality. These
tests change that correct quantities of the volume fraction are
generated and that in appropriate sets of parameters fail.<commit_after>import pytest
import numpy as np... | |
77e980157f51af421eceb7c7b7a84945d8d33a91 | scripts/caffe_to_chainermodel.py | scripts/caffe_to_chainermodel.py | #!/usr/bin/env python
from __future__ import print_function
import argparse
import os.path as osp
import caffe
import chainer.functions as F
import chainer.serializers as S
import fcn
from fcn.models import FCN8s
data_dir = fcn.get_data_dir()
caffemodel = osp.join(data_dir, 'voc-fcn8s/fcn8s-heavy-pascal.caffemodel... | Convert caffemodel of FCN8s to chainer model | Convert caffemodel of FCN8s to chainer model
| Python | mit | wkentaro/fcn | Convert caffemodel of FCN8s to chainer model | #!/usr/bin/env python
from __future__ import print_function
import argparse
import os.path as osp
import caffe
import chainer.functions as F
import chainer.serializers as S
import fcn
from fcn.models import FCN8s
data_dir = fcn.get_data_dir()
caffemodel = osp.join(data_dir, 'voc-fcn8s/fcn8s-heavy-pascal.caffemodel... | <commit_before><commit_msg>Convert caffemodel of FCN8s to chainer model<commit_after> | #!/usr/bin/env python
from __future__ import print_function
import argparse
import os.path as osp
import caffe
import chainer.functions as F
import chainer.serializers as S
import fcn
from fcn.models import FCN8s
data_dir = fcn.get_data_dir()
caffemodel = osp.join(data_dir, 'voc-fcn8s/fcn8s-heavy-pascal.caffemodel... | Convert caffemodel of FCN8s to chainer model#!/usr/bin/env python
from __future__ import print_function
import argparse
import os.path as osp
import caffe
import chainer.functions as F
import chainer.serializers as S
import fcn
from fcn.models import FCN8s
data_dir = fcn.get_data_dir()
caffemodel = osp.join(data_d... | <commit_before><commit_msg>Convert caffemodel of FCN8s to chainer model<commit_after>#!/usr/bin/env python
from __future__ import print_function
import argparse
import os.path as osp
import caffe
import chainer.functions as F
import chainer.serializers as S
import fcn
from fcn.models import FCN8s
data_dir = fcn.ge... | |
b0d699066799d0309e7af3f8892f56a6feaac778 | new_tests.py | new_tests.py | from numpy import testing
import unittest
import numpy as np
from numpy import pi
from robot_arm import RobotArm
class TestRobotArm(unittest.TestCase):
def setUp(self):
self.lengths = (3, 2, 2,)
self.destinations = (
(5, 0,),
(4, 2,),
(6, 0.5),
... | Write tests for new functionality; several destinations | Write tests for new functionality; several destinations
| Python | mit | JakobGM/robotarm-optimization | Write tests for new functionality; several destinations | from numpy import testing
import unittest
import numpy as np
from numpy import pi
from robot_arm import RobotArm
class TestRobotArm(unittest.TestCase):
def setUp(self):
self.lengths = (3, 2, 2,)
self.destinations = (
(5, 0,),
(4, 2,),
(6, 0.5),
... | <commit_before><commit_msg>Write tests for new functionality; several destinations<commit_after> | from numpy import testing
import unittest
import numpy as np
from numpy import pi
from robot_arm import RobotArm
class TestRobotArm(unittest.TestCase):
def setUp(self):
self.lengths = (3, 2, 2,)
self.destinations = (
(5, 0,),
(4, 2,),
(6, 0.5),
... | Write tests for new functionality; several destinationsfrom numpy import testing
import unittest
import numpy as np
from numpy import pi
from robot_arm import RobotArm
class TestRobotArm(unittest.TestCase):
def setUp(self):
self.lengths = (3, 2, 2,)
self.destinations = (
(5, 0,),... | <commit_before><commit_msg>Write tests for new functionality; several destinations<commit_after>from numpy import testing
import unittest
import numpy as np
from numpy import pi
from robot_arm import RobotArm
class TestRobotArm(unittest.TestCase):
def setUp(self):
self.lengths = (3, 2, 2,)
self.... | |
50f698c2fdd90bc4b3e60a583c196381fc23e099 | lltk-restful/base.py | lltk-restful/base.py | #!/usr/bin/python
# -*- coding: UTF-8 -*-
import lltk
import lltk.generic
import lltk.caching
import lltk.exceptions
from flask import Flask
from flask import jsonify, request
__author__ = 'Markus Beuckelmann'
__author_email__ = 'email@markus-beuckelmann.de'
__version__ = '0.1.0'
DEBUG = True
CACHING = True
NAME = ... | Implement a rudimentary API for LLTK | Implement a rudimentary API for LLTK
| Python | agpl-3.0 | lltk/lltk-restful | Implement a rudimentary API for LLTK | #!/usr/bin/python
# -*- coding: UTF-8 -*-
import lltk
import lltk.generic
import lltk.caching
import lltk.exceptions
from flask import Flask
from flask import jsonify, request
__author__ = 'Markus Beuckelmann'
__author_email__ = 'email@markus-beuckelmann.de'
__version__ = '0.1.0'
DEBUG = True
CACHING = True
NAME = ... | <commit_before><commit_msg>Implement a rudimentary API for LLTK<commit_after> | #!/usr/bin/python
# -*- coding: UTF-8 -*-
import lltk
import lltk.generic
import lltk.caching
import lltk.exceptions
from flask import Flask
from flask import jsonify, request
__author__ = 'Markus Beuckelmann'
__author_email__ = 'email@markus-beuckelmann.de'
__version__ = '0.1.0'
DEBUG = True
CACHING = True
NAME = ... | Implement a rudimentary API for LLTK#!/usr/bin/python
# -*- coding: UTF-8 -*-
import lltk
import lltk.generic
import lltk.caching
import lltk.exceptions
from flask import Flask
from flask import jsonify, request
__author__ = 'Markus Beuckelmann'
__author_email__ = 'email@markus-beuckelmann.de'
__version__ = '0.1.0'
... | <commit_before><commit_msg>Implement a rudimentary API for LLTK<commit_after>#!/usr/bin/python
# -*- coding: UTF-8 -*-
import lltk
import lltk.generic
import lltk.caching
import lltk.exceptions
from flask import Flask
from flask import jsonify, request
__author__ = 'Markus Beuckelmann'
__author_email__ = 'email@mark... | |
4f404a71cb7ee912bca8184fe94c97d6cfba1186 | preprocessing_tools/solid_rotation_y.py | preprocessing_tools/solid_rotation_y.py | '''
Rotates the protein by a solid angle on the plane xz
'''
import numpy
import os
from argparse import ArgumentParser
from move_prot_helper import (read_vertex, read_pqr, rotate_y,
modify_pqr)
def read_inputs():
"""
Parse command-line arguments to run move_protein.
User s... | Add script to rotate a solid angle in the xz plane | Add script to rotate a solid angle in the xz plane
| Python | bsd-3-clause | barbagroup/pygbe,barbagroup/pygbe,barbagroup/pygbe | Add script to rotate a solid angle in the xz plane | '''
Rotates the protein by a solid angle on the plane xz
'''
import numpy
import os
from argparse import ArgumentParser
from move_prot_helper import (read_vertex, read_pqr, rotate_y,
modify_pqr)
def read_inputs():
"""
Parse command-line arguments to run move_protein.
User s... | <commit_before><commit_msg>Add script to rotate a solid angle in the xz plane<commit_after> | '''
Rotates the protein by a solid angle on the plane xz
'''
import numpy
import os
from argparse import ArgumentParser
from move_prot_helper import (read_vertex, read_pqr, rotate_y,
modify_pqr)
def read_inputs():
"""
Parse command-line arguments to run move_protein.
User s... | Add script to rotate a solid angle in the xz plane'''
Rotates the protein by a solid angle on the plane xz
'''
import numpy
import os
from argparse import ArgumentParser
from move_prot_helper import (read_vertex, read_pqr, rotate_y,
modify_pqr)
def read_inputs():
"""
Parse comma... | <commit_before><commit_msg>Add script to rotate a solid angle in the xz plane<commit_after>'''
Rotates the protein by a solid angle on the plane xz
'''
import numpy
import os
from argparse import ArgumentParser
from move_prot_helper import (read_vertex, read_pqr, rotate_y,
modify_pqr)
d... | |
116babc38e2e4023eb0b45eabc02050ed433e240 | scripts/mod_info.py | scripts/mod_info.py | # mod_info.py
#
# Display information about a Protracker module.
#
# Written & released by Keir Fraser <keir.xen@gmail.com>
#
# This is free and unencumbered software released into the public domain.
# See the file COPYING for more details, or visit <http://unlicense.org>.
import struct, sys
with open(sys.argv[1],... | Include a helpful MOD analyser script | scripts: Include a helpful MOD analyser script
| Python | unlicense | keirf/Amiga-Stuff,keirf/Amiga-Stuff | scripts: Include a helpful MOD analyser script | # mod_info.py
#
# Display information about a Protracker module.
#
# Written & released by Keir Fraser <keir.xen@gmail.com>
#
# This is free and unencumbered software released into the public domain.
# See the file COPYING for more details, or visit <http://unlicense.org>.
import struct, sys
with open(sys.argv[1],... | <commit_before><commit_msg>scripts: Include a helpful MOD analyser script<commit_after> | # mod_info.py
#
# Display information about a Protracker module.
#
# Written & released by Keir Fraser <keir.xen@gmail.com>
#
# This is free and unencumbered software released into the public domain.
# See the file COPYING for more details, or visit <http://unlicense.org>.
import struct, sys
with open(sys.argv[1],... | scripts: Include a helpful MOD analyser script# mod_info.py
#
# Display information about a Protracker module.
#
# Written & released by Keir Fraser <keir.xen@gmail.com>
#
# This is free and unencumbered software released into the public domain.
# See the file COPYING for more details, or visit <http://unlicense.org... | <commit_before><commit_msg>scripts: Include a helpful MOD analyser script<commit_after># mod_info.py
#
# Display information about a Protracker module.
#
# Written & released by Keir Fraser <keir.xen@gmail.com>
#
# This is free and unencumbered software released into the public domain.
# See the file COPYING for mor... | |
07467664b699612e10b51bbeafdce79a9d1e0127 | test/test_util.py | test/test_util.py | from __future__ import unicode_literals
try:
import io
StringIO = io.StringIO
except ImportError:
import StringIO
StringIO = StringIO.StringIO
import os
import shutil
import sys
import tempfile
import unittest
import cudnnenv
class TestSafeTempDir(unittest.TestCase):
def test_safe_temp_dir(self... | Write unit test for utility functions | Write unit test for utility functions
| Python | mit | unnonouno/cudnnenv | Write unit test for utility functions | from __future__ import unicode_literals
try:
import io
StringIO = io.StringIO
except ImportError:
import StringIO
StringIO = StringIO.StringIO
import os
import shutil
import sys
import tempfile
import unittest
import cudnnenv
class TestSafeTempDir(unittest.TestCase):
def test_safe_temp_dir(self... | <commit_before><commit_msg>Write unit test for utility functions<commit_after> | from __future__ import unicode_literals
try:
import io
StringIO = io.StringIO
except ImportError:
import StringIO
StringIO = StringIO.StringIO
import os
import shutil
import sys
import tempfile
import unittest
import cudnnenv
class TestSafeTempDir(unittest.TestCase):
def test_safe_temp_dir(self... | Write unit test for utility functionsfrom __future__ import unicode_literals
try:
import io
StringIO = io.StringIO
except ImportError:
import StringIO
StringIO = StringIO.StringIO
import os
import shutil
import sys
import tempfile
import unittest
import cudnnenv
class TestSafeTempDir(unittest.TestCa... | <commit_before><commit_msg>Write unit test for utility functions<commit_after>from __future__ import unicode_literals
try:
import io
StringIO = io.StringIO
except ImportError:
import StringIO
StringIO = StringIO.StringIO
import os
import shutil
import sys
import tempfile
import unittest
import cudnnen... | |
256648ad4effd9811d7c35ed6ef45de67f108926 | tests/conftest.py | tests/conftest.py | import sys
def pytest_addoption(parser):
parser.addoption('--typing', action='store', default='typing')
def pytest_configure(config):
if config.option.typing == 'no':
sys.modules['typing'] = None
elif config.option.typing != 'typing':
sys.modules['typing'] = __import__(config.option.typi... | Add pytest option for specifying the typing module to use | Add pytest option for specifying the typing module to use
| Python | mit | bintoro/overloading.py | Add pytest option for specifying the typing module to use | import sys
def pytest_addoption(parser):
parser.addoption('--typing', action='store', default='typing')
def pytest_configure(config):
if config.option.typing == 'no':
sys.modules['typing'] = None
elif config.option.typing != 'typing':
sys.modules['typing'] = __import__(config.option.typi... | <commit_before><commit_msg>Add pytest option for specifying the typing module to use<commit_after> | import sys
def pytest_addoption(parser):
parser.addoption('--typing', action='store', default='typing')
def pytest_configure(config):
if config.option.typing == 'no':
sys.modules['typing'] = None
elif config.option.typing != 'typing':
sys.modules['typing'] = __import__(config.option.typi... | Add pytest option for specifying the typing module to useimport sys
def pytest_addoption(parser):
parser.addoption('--typing', action='store', default='typing')
def pytest_configure(config):
if config.option.typing == 'no':
sys.modules['typing'] = None
elif config.option.typing != 'typing':
... | <commit_before><commit_msg>Add pytest option for specifying the typing module to use<commit_after>import sys
def pytest_addoption(parser):
parser.addoption('--typing', action='store', default='typing')
def pytest_configure(config):
if config.option.typing == 'no':
sys.modules['typing'] = None
el... | |
1d8cbf94f127571358aee97677a09f7cea3bf3a7 | p23serialize/util.py | p23serialize/util.py | from . import str_mode
if str_mode == 'bytes':
unicode_type = unicode
else: # str_mode == 'unicode'
unicode_type = str
def recursive_unicode(obj):
if isinstance(obj, bytes):
return obj.decode('latin1')
elif isinstance(obj, list):
return [recursive_unicode(_) for _ in obj]
else:
... | Add helper functions for to/from bytes/unicode | Add helper functions for to/from bytes/unicode
| Python | mit | rh314/p23serialize | Add helper functions for to/from bytes/unicode | from . import str_mode
if str_mode == 'bytes':
unicode_type = unicode
else: # str_mode == 'unicode'
unicode_type = str
def recursive_unicode(obj):
if isinstance(obj, bytes):
return obj.decode('latin1')
elif isinstance(obj, list):
return [recursive_unicode(_) for _ in obj]
else:
... | <commit_before><commit_msg>Add helper functions for to/from bytes/unicode<commit_after> | from . import str_mode
if str_mode == 'bytes':
unicode_type = unicode
else: # str_mode == 'unicode'
unicode_type = str
def recursive_unicode(obj):
if isinstance(obj, bytes):
return obj.decode('latin1')
elif isinstance(obj, list):
return [recursive_unicode(_) for _ in obj]
else:
... | Add helper functions for to/from bytes/unicodefrom . import str_mode
if str_mode == 'bytes':
unicode_type = unicode
else: # str_mode == 'unicode'
unicode_type = str
def recursive_unicode(obj):
if isinstance(obj, bytes):
return obj.decode('latin1')
elif isinstance(obj, list):
return [r... | <commit_before><commit_msg>Add helper functions for to/from bytes/unicode<commit_after>from . import str_mode
if str_mode == 'bytes':
unicode_type = unicode
else: # str_mode == 'unicode'
unicode_type = str
def recursive_unicode(obj):
if isinstance(obj, bytes):
return obj.decode('latin1')
elif... | |
01f21a16e4bcecccf51a565b51222ab18b79adb4 | st2common/tests/unit/test_util_shell.py | st2common/tests/unit/test_util_shell.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 shell utils. | Add tests for shell utils.
| Python | apache-2.0 | tonybaloney/st2,pixelrebel/st2,Plexxi/st2,emedvedev/st2,pixelrebel/st2,grengojbo/st2,armab/st2,StackStorm/st2,StackStorm/st2,lakshmi-kannan/st2,Itxaka/st2,emedvedev/st2,punalpatel/st2,alfasin/st2,punalpatel/st2,dennybaa/st2,pinterb/st2,dennybaa/st2,StackStorm/st2,peak6/st2,armab/st2,tonybaloney/st2,Plexxi/st2,Plexxi/st... | Add tests for shell utils. | # 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 shell utils.<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 shell utils.# 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 "Lic... | <commit_before><commit_msg>Add tests for shell utils.<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 th... | |
b40512e834e88f24c20885cddb220188fce11339 | accounts/migrations/0004_auto_20150227_2347.py | accounts/migrations/0004_auto_20150227_2347.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('accounts', '0003_auto_20150227_2158'),
]
operations = [
migrations.AlterField(
model_name='userprofile',
... | Add verbose names to UserProfile fields. | Add verbose names to UserProfile fields.
| Python | bsd-3-clause | ugoertz/django-familio,ugoertz/django-familio,ugoertz/django-familio,ugoertz/django-familio | Add verbose names to UserProfile fields. | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('accounts', '0003_auto_20150227_2158'),
]
operations = [
migrations.AlterField(
model_name='userprofile',
... | <commit_before><commit_msg>Add verbose names to UserProfile fields.<commit_after> | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('accounts', '0003_auto_20150227_2158'),
]
operations = [
migrations.AlterField(
model_name='userprofile',
... | Add verbose names to UserProfile fields.# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('accounts', '0003_auto_20150227_2158'),
]
operations = [
migrations.AlterField(
... | <commit_before><commit_msg>Add verbose names to UserProfile fields.<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('accounts', '0003_auto_20150227_2158'),
]
operations... | |
008625fef55f8f58ab80b883d34ae5d40e55c721 | test_binheap.py | test_binheap.py | import pytest
from binheap import Binheap
def test_init_bh():
b = Binheap()
assert b.binlist is []
c = Binheap([1, 2])
assert c.binlist == [1, 2]
| Add initial test for binheap | Add initial test for binheap
| Python | mit | constanthatz/data-structures | Add initial test for binheap | import pytest
from binheap import Binheap
def test_init_bh():
b = Binheap()
assert b.binlist is []
c = Binheap([1, 2])
assert c.binlist == [1, 2]
| <commit_before><commit_msg>Add initial test for binheap<commit_after> | import pytest
from binheap import Binheap
def test_init_bh():
b = Binheap()
assert b.binlist is []
c = Binheap([1, 2])
assert c.binlist == [1, 2]
| Add initial test for binheapimport pytest
from binheap import Binheap
def test_init_bh():
b = Binheap()
assert b.binlist is []
c = Binheap([1, 2])
assert c.binlist == [1, 2]
| <commit_before><commit_msg>Add initial test for binheap<commit_after>import pytest
from binheap import Binheap
def test_init_bh():
b = Binheap()
assert b.binlist is []
c = Binheap([1, 2])
assert c.binlist == [1, 2]
| |
80e80bff7603e852710df6c9de613b1781877b2d | tests/python/typeinference/same_name.py | tests/python/typeinference/same_name.py | class A(object):
def method(self):
return 1
A().method() ## type int
class A(object):
def method(self):
return "test"
A().method() ## type str
| Test case for two classes with the same name in one module. | Test case for two classes with the same name in one module.
| Python | lgpl-2.1 | retoo/pystructure,retoo/pystructure,retoo/pystructure,retoo/pystructure | Test case for two classes with the same name in one module. | class A(object):
def method(self):
return 1
A().method() ## type int
class A(object):
def method(self):
return "test"
A().method() ## type str
| <commit_before><commit_msg>Test case for two classes with the same name in one module.<commit_after> | class A(object):
def method(self):
return 1
A().method() ## type int
class A(object):
def method(self):
return "test"
A().method() ## type str
| Test case for two classes with the same name in one module.class A(object):
def method(self):
return 1
A().method() ## type int
class A(object):
def method(self):
return "test"
A().method() ## type str
| <commit_before><commit_msg>Test case for two classes with the same name in one module.<commit_after>class A(object):
def method(self):
return 1
A().method() ## type int
class A(object):
def method(self):
return "test"
A().method() ## type str
| |
542bc508b587a39a6e709d469c1cb166dee9eef4 | app/grandchallenge/retina_api/renderers.py | app/grandchallenge/retina_api/renderers.py | import base64
from rest_framework import renderers
class Base64Renderer(renderers.BaseRenderer):
media_type = "image/png;base64"
format = "base64"
charset = "utf-8"
render_style = "text"
def render(self, data, media_type=None, renderer_context=None):
return base64.b64encode(data)
| Add renderer for base64 content | Add renderer for base64 content
| Python | apache-2.0 | comic/comic-django,comic/comic-django,comic/comic-django,comic/comic-django,comic/comic-django | Add renderer for base64 content | import base64
from rest_framework import renderers
class Base64Renderer(renderers.BaseRenderer):
media_type = "image/png;base64"
format = "base64"
charset = "utf-8"
render_style = "text"
def render(self, data, media_type=None, renderer_context=None):
return base64.b64encode(data)
| <commit_before><commit_msg>Add renderer for base64 content<commit_after> | import base64
from rest_framework import renderers
class Base64Renderer(renderers.BaseRenderer):
media_type = "image/png;base64"
format = "base64"
charset = "utf-8"
render_style = "text"
def render(self, data, media_type=None, renderer_context=None):
return base64.b64encode(data)
| Add renderer for base64 contentimport base64
from rest_framework import renderers
class Base64Renderer(renderers.BaseRenderer):
media_type = "image/png;base64"
format = "base64"
charset = "utf-8"
render_style = "text"
def render(self, data, media_type=None, renderer_context=None):
return... | <commit_before><commit_msg>Add renderer for base64 content<commit_after>import base64
from rest_framework import renderers
class Base64Renderer(renderers.BaseRenderer):
media_type = "image/png;base64"
format = "base64"
charset = "utf-8"
render_style = "text"
def render(self, data, media_type=Non... | |
e8832b5f126f39672cfc48159148b490c1e3c6c7 | tests/import_time.py | tests/import_time.py | import subprocess
import sys
import pytest
AVG_ITERATIONS = 15
# Maximum expected import time for rasa module when running on a Travis VM.
# Keep in mind the hardware configuration where tests are run:
# https://docs.travis-ci.com/user/reference/overview/
MAX_IMPORT_TIME_S = 0.3
def average_import_time(n, module):
... | Add test for import time. | Add test for import time.
| Python | apache-2.0 | RasaHQ/rasa_nlu,RasaHQ/rasa_nlu,RasaHQ/rasa_nlu | Add test for import time. | import subprocess
import sys
import pytest
AVG_ITERATIONS = 15
# Maximum expected import time for rasa module when running on a Travis VM.
# Keep in mind the hardware configuration where tests are run:
# https://docs.travis-ci.com/user/reference/overview/
MAX_IMPORT_TIME_S = 0.3
def average_import_time(n, module):
... | <commit_before><commit_msg>Add test for import time.<commit_after> | import subprocess
import sys
import pytest
AVG_ITERATIONS = 15
# Maximum expected import time for rasa module when running on a Travis VM.
# Keep in mind the hardware configuration where tests are run:
# https://docs.travis-ci.com/user/reference/overview/
MAX_IMPORT_TIME_S = 0.3
def average_import_time(n, module):
... | Add test for import time.import subprocess
import sys
import pytest
AVG_ITERATIONS = 15
# Maximum expected import time for rasa module when running on a Travis VM.
# Keep in mind the hardware configuration where tests are run:
# https://docs.travis-ci.com/user/reference/overview/
MAX_IMPORT_TIME_S = 0.3
def average... | <commit_before><commit_msg>Add test for import time.<commit_after>import subprocess
import sys
import pytest
AVG_ITERATIONS = 15
# Maximum expected import time for rasa module when running on a Travis VM.
# Keep in mind the hardware configuration where tests are run:
# https://docs.travis-ci.com/user/reference/overvi... | |
1a311415c007bebcb2c6f042816a86a7cc32ec36 | src/foobar/tests/test_admin.py | src/foobar/tests/test_admin.py | from django.apps import apps
from django.contrib import admin
from django.contrib.auth import get_user_model
from django.core.urlresolvers import reverse
from django.test import TestCase
class TestAdminViews(TestCase):
def setUp(self):
User = get_user_model()
self.user = User.objects.create_superu... | Test admin views in order to catch stupid errors | Test admin views in order to catch stupid errors | Python | mit | uppsaladatavetare/foobar-api,uppsaladatavetare/foobar-api,uppsaladatavetare/foobar-api | Test admin views in order to catch stupid errors | from django.apps import apps
from django.contrib import admin
from django.contrib.auth import get_user_model
from django.core.urlresolvers import reverse
from django.test import TestCase
class TestAdminViews(TestCase):
def setUp(self):
User = get_user_model()
self.user = User.objects.create_superu... | <commit_before><commit_msg>Test admin views in order to catch stupid errors<commit_after> | from django.apps import apps
from django.contrib import admin
from django.contrib.auth import get_user_model
from django.core.urlresolvers import reverse
from django.test import TestCase
class TestAdminViews(TestCase):
def setUp(self):
User = get_user_model()
self.user = User.objects.create_superu... | Test admin views in order to catch stupid errorsfrom django.apps import apps
from django.contrib import admin
from django.contrib.auth import get_user_model
from django.core.urlresolvers import reverse
from django.test import TestCase
class TestAdminViews(TestCase):
def setUp(self):
User = get_user_model(... | <commit_before><commit_msg>Test admin views in order to catch stupid errors<commit_after>from django.apps import apps
from django.contrib import admin
from django.contrib.auth import get_user_model
from django.core.urlresolvers import reverse
from django.test import TestCase
class TestAdminViews(TestCase):
def se... | |
353df423343688f206c0f3628092608d1a95f5c2 | mopidy/backends/__init__.py | mopidy/backends/__init__.py | import logging
import time
from mopidy.exceptions import MpdNotImplemented
from mopidy.models import Playlist
logger = logging.getLogger('backends.base')
class BaseBackend(object):
current_playlist = None
library = None
playback = None
stored_playlists = None
uri_handlers = []
class BasePlayback... | import logging
import time
from mopidy.exceptions import MpdNotImplemented
from mopidy.models import Playlist
logger = logging.getLogger('backends.base')
class BaseBackend(object):
current_playlist = None
library = None
playback = None
stored_playlists = None
uri_handlers = []
class BasePlayback... | Use textual defaults for status constants | Use textual defaults for status constants
| Python | apache-2.0 | SuperStarPL/mopidy,liamw9534/mopidy,glogiotatidis/mopidy,mopidy/mopidy,hkariti/mopidy,tkem/mopidy,hkariti/mopidy,jcass77/mopidy,bencevans/mopidy,pacificIT/mopidy,jodal/mopidy,jmarsik/mopidy,woutervanwijk/mopidy,kingosticks/mopidy,hkariti/mopidy,jodal/mopidy,mokieyue/mopidy,pacificIT/mopidy,mokieyue/mopidy,vrs01/mopidy,... | import logging
import time
from mopidy.exceptions import MpdNotImplemented
from mopidy.models import Playlist
logger = logging.getLogger('backends.base')
class BaseBackend(object):
current_playlist = None
library = None
playback = None
stored_playlists = None
uri_handlers = []
class BasePlayback... | import logging
import time
from mopidy.exceptions import MpdNotImplemented
from mopidy.models import Playlist
logger = logging.getLogger('backends.base')
class BaseBackend(object):
current_playlist = None
library = None
playback = None
stored_playlists = None
uri_handlers = []
class BasePlayback... | <commit_before>import logging
import time
from mopidy.exceptions import MpdNotImplemented
from mopidy.models import Playlist
logger = logging.getLogger('backends.base')
class BaseBackend(object):
current_playlist = None
library = None
playback = None
stored_playlists = None
uri_handlers = []
cla... | import logging
import time
from mopidy.exceptions import MpdNotImplemented
from mopidy.models import Playlist
logger = logging.getLogger('backends.base')
class BaseBackend(object):
current_playlist = None
library = None
playback = None
stored_playlists = None
uri_handlers = []
class BasePlayback... | import logging
import time
from mopidy.exceptions import MpdNotImplemented
from mopidy.models import Playlist
logger = logging.getLogger('backends.base')
class BaseBackend(object):
current_playlist = None
library = None
playback = None
stored_playlists = None
uri_handlers = []
class BasePlayback... | <commit_before>import logging
import time
from mopidy.exceptions import MpdNotImplemented
from mopidy.models import Playlist
logger = logging.getLogger('backends.base')
class BaseBackend(object):
current_playlist = None
library = None
playback = None
stored_playlists = None
uri_handlers = []
cla... |
112dcd24d9888c8376afa36535870eb861982d9c | create_review.py | create_review.py | import sys
import os
import subprocess
initial_layout = [
"---",
"layout: default",
"permalink: 'reviews/{}.html'",
"title: '{}'",
"---\n",
"# {}",
"---\n",
"## Idea\n\n",
"## Method\n\n",
"## Observations\n\n"
]
def main():
paper_name = sys.argv[1]
formatted_name = su... | Add script to automate review markdown file creation | Add script to automate review markdown file creation
| Python | cc0-1.0 | v1n337/research-review-notes,v1n337/research-review-notes,v1n337/research-review-notes | Add script to automate review markdown file creation | import sys
import os
import subprocess
initial_layout = [
"---",
"layout: default",
"permalink: 'reviews/{}.html'",
"title: '{}'",
"---\n",
"# {}",
"---\n",
"## Idea\n\n",
"## Method\n\n",
"## Observations\n\n"
]
def main():
paper_name = sys.argv[1]
formatted_name = su... | <commit_before><commit_msg>Add script to automate review markdown file creation<commit_after> | import sys
import os
import subprocess
initial_layout = [
"---",
"layout: default",
"permalink: 'reviews/{}.html'",
"title: '{}'",
"---\n",
"# {}",
"---\n",
"## Idea\n\n",
"## Method\n\n",
"## Observations\n\n"
]
def main():
paper_name = sys.argv[1]
formatted_name = su... | Add script to automate review markdown file creationimport sys
import os
import subprocess
initial_layout = [
"---",
"layout: default",
"permalink: 'reviews/{}.html'",
"title: '{}'",
"---\n",
"# {}",
"---\n",
"## Idea\n\n",
"## Method\n\n",
"## Observations\n\n"
]
def main():
... | <commit_before><commit_msg>Add script to automate review markdown file creation<commit_after>import sys
import os
import subprocess
initial_layout = [
"---",
"layout: default",
"permalink: 'reviews/{}.html'",
"title: '{}'",
"---\n",
"# {}",
"---\n",
"## Idea\n\n",
"## Method\n\n",
... | |
7594e2b4405be3fb8b5b07fc9b5fd79ecc5a5aec | py/maximum-binary-tree.py | py/maximum-binary-tree.py | # Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution(object):
def constructMaximumBinaryTree(self, nums, start=None, end=None):
"""
:type nums: List[int]
:rtyp... | Add py solution for 654. Maximum Binary Tree | Add py solution for 654. Maximum Binary Tree
654. Maximum Binary Tree: https://leetcode.com/problems/maximum-binary-tree/
Approach 1:
1. Modify the method to accept (nums, start, end), and the method
will return the subtree of nums[start:end]
2. Find the maximum and split the array into left, right pa... | Python | apache-2.0 | ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode | Add py solution for 654. Maximum Binary Tree
654. Maximum Binary Tree: https://leetcode.com/problems/maximum-binary-tree/
Approach 1:
1. Modify the method to accept (nums, start, end), and the method
will return the subtree of nums[start:end]
2. Find the maximum and split the array into left, right pa... | # Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution(object):
def constructMaximumBinaryTree(self, nums, start=None, end=None):
"""
:type nums: List[int]
:rtyp... | <commit_before><commit_msg>Add py solution for 654. Maximum Binary Tree
654. Maximum Binary Tree: https://leetcode.com/problems/maximum-binary-tree/
Approach 1:
1. Modify the method to accept (nums, start, end), and the method
will return the subtree of nums[start:end]
2. Find the maximum and split th... | # Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution(object):
def constructMaximumBinaryTree(self, nums, start=None, end=None):
"""
:type nums: List[int]
:rtyp... | Add py solution for 654. Maximum Binary Tree
654. Maximum Binary Tree: https://leetcode.com/problems/maximum-binary-tree/
Approach 1:
1. Modify the method to accept (nums, start, end), and the method
will return the subtree of nums[start:end]
2. Find the maximum and split the array into left, right pa... | <commit_before><commit_msg>Add py solution for 654. Maximum Binary Tree
654. Maximum Binary Tree: https://leetcode.com/problems/maximum-binary-tree/
Approach 1:
1. Modify the method to accept (nums, start, end), and the method
will return the subtree of nums[start:end]
2. Find the maximum and split th... | |
01acf59474ac2ccd5612bba9b7fa925ebec1e5c5 | py/valid-palindrome-ii.py | py/valid-palindrome-ii.py | class Solution(object):
def validPalindromeIdx(self, s, i, j, todelete):
while i < j:
if s[i] == s[j]:
i += 1
j -= 1
else:
return bool(todelete) and (self.validPalindromeIdx(s, i + 1, j, todelete - 1) or self.validPalindromeIdx(s, i, j ... | Add py solution for 680. Valid Palindrome II | Add py solution for 680. Valid Palindrome II
680. Valid Palindrome II: https://leetcode.com/problems/valid-palindrome-ii/
| Python | apache-2.0 | ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode | Add py solution for 680. Valid Palindrome II
680. Valid Palindrome II: https://leetcode.com/problems/valid-palindrome-ii/ | class Solution(object):
def validPalindromeIdx(self, s, i, j, todelete):
while i < j:
if s[i] == s[j]:
i += 1
j -= 1
else:
return bool(todelete) and (self.validPalindromeIdx(s, i + 1, j, todelete - 1) or self.validPalindromeIdx(s, i, j ... | <commit_before><commit_msg>Add py solution for 680. Valid Palindrome II
680. Valid Palindrome II: https://leetcode.com/problems/valid-palindrome-ii/<commit_after> | class Solution(object):
def validPalindromeIdx(self, s, i, j, todelete):
while i < j:
if s[i] == s[j]:
i += 1
j -= 1
else:
return bool(todelete) and (self.validPalindromeIdx(s, i + 1, j, todelete - 1) or self.validPalindromeIdx(s, i, j ... | Add py solution for 680. Valid Palindrome II
680. Valid Palindrome II: https://leetcode.com/problems/valid-palindrome-ii/class Solution(object):
def validPalindromeIdx(self, s, i, j, todelete):
while i < j:
if s[i] == s[j]:
i += 1
j -= 1
else:
... | <commit_before><commit_msg>Add py solution for 680. Valid Palindrome II
680. Valid Palindrome II: https://leetcode.com/problems/valid-palindrome-ii/<commit_after>class Solution(object):
def validPalindromeIdx(self, s, i, j, todelete):
while i < j:
if s[i] == s[j]:
i += 1
... | |
01d848f77690bfafff1fdc28efb09b6c0e9e11bc | AutoUpdateProxy.py | AutoUpdateProxy.py | import json
import time
import traceback
import requests
from lxml import etree
def updateProxy():
with open('F:\liuming\Shadowsocks\gui-config.json', encoding='utf-8', mode='r') as file:
proxyInfo = json.load(file)
while 1:
requestHeaders = {
'Accept-Encoding': 'gzip, deflate, sd... | Add an utility getting the free proxy from the certain site. | Add an utility getting the free proxy from the certain site.
| Python | mit | i2it/XYWYCrawler | Add an utility getting the free proxy from the certain site. | import json
import time
import traceback
import requests
from lxml import etree
def updateProxy():
with open('F:\liuming\Shadowsocks\gui-config.json', encoding='utf-8', mode='r') as file:
proxyInfo = json.load(file)
while 1:
requestHeaders = {
'Accept-Encoding': 'gzip, deflate, sd... | <commit_before><commit_msg>Add an utility getting the free proxy from the certain site.<commit_after> | import json
import time
import traceback
import requests
from lxml import etree
def updateProxy():
with open('F:\liuming\Shadowsocks\gui-config.json', encoding='utf-8', mode='r') as file:
proxyInfo = json.load(file)
while 1:
requestHeaders = {
'Accept-Encoding': 'gzip, deflate, sd... | Add an utility getting the free proxy from the certain site.import json
import time
import traceback
import requests
from lxml import etree
def updateProxy():
with open('F:\liuming\Shadowsocks\gui-config.json', encoding='utf-8', mode='r') as file:
proxyInfo = json.load(file)
while 1:
requestH... | <commit_before><commit_msg>Add an utility getting the free proxy from the certain site.<commit_after>import json
import time
import traceback
import requests
from lxml import etree
def updateProxy():
with open('F:\liuming\Shadowsocks\gui-config.json', encoding='utf-8', mode='r') as file:
proxyInfo = json... | |
27f0b6481675fcc07ec2ce09acbd2bd1ac8cf197 | testing/test_main.py | testing/test_main.py | import os.path
mainfile = os.path.join(
os.path.dirname(__file__), "..", "setuptools_scm", "__main__.py")
with open(mainfile) as f:
code = compile(f.read(), "__main__.py", 'exec')
exec(code)
| Test 'python -m setuptools_scm' invocation (__main__.py). | Test 'python -m setuptools_scm' invocation (__main__.py).
| Python | mit | esben/setuptools_scm,pypa/setuptools_scm,RonnyPfannschmidt/setuptools_scm,pypa/setuptools_scm,RonnyPfannschmidt/setuptools_scm | Test 'python -m setuptools_scm' invocation (__main__.py). | import os.path
mainfile = os.path.join(
os.path.dirname(__file__), "..", "setuptools_scm", "__main__.py")
with open(mainfile) as f:
code = compile(f.read(), "__main__.py", 'exec')
exec(code)
| <commit_before><commit_msg>Test 'python -m setuptools_scm' invocation (__main__.py).<commit_after> | import os.path
mainfile = os.path.join(
os.path.dirname(__file__), "..", "setuptools_scm", "__main__.py")
with open(mainfile) as f:
code = compile(f.read(), "__main__.py", 'exec')
exec(code)
| Test 'python -m setuptools_scm' invocation (__main__.py).import os.path
mainfile = os.path.join(
os.path.dirname(__file__), "..", "setuptools_scm", "__main__.py")
with open(mainfile) as f:
code = compile(f.read(), "__main__.py", 'exec')
exec(code)
| <commit_before><commit_msg>Test 'python -m setuptools_scm' invocation (__main__.py).<commit_after>import os.path
mainfile = os.path.join(
os.path.dirname(__file__), "..", "setuptools_scm", "__main__.py")
with open(mainfile) as f:
code = compile(f.read(), "__main__.py", 'exec')
exec(code)
| |
2f3b3a34cfed77fea3c48ec17b8c2e40603bbcc0 | app/src/visualizer.py | app/src/visualizer.py | '''
Created on Sep 6, 2017
@author: Hossein
This file handles all the visualizations. It assumes that the status are ready and it
contains the function to generate the jpg's
'''
import os
from utils import get_visual_data_path
import numpy as np
import matplotlib.pyplot as plt
from turtledemo.__main__ import font... | Add a library for data visualization and add a dummy function | Add a library for data visualization and add a dummy function
| Python | apache-2.0 | TeMedy/DaViL,TeMedy/DaViL | Add a library for data visualization and add a dummy function | '''
Created on Sep 6, 2017
@author: Hossein
This file handles all the visualizations. It assumes that the status are ready and it
contains the function to generate the jpg's
'''
import os
from utils import get_visual_data_path
import numpy as np
import matplotlib.pyplot as plt
from turtledemo.__main__ import font... | <commit_before><commit_msg>Add a library for data visualization and add a dummy function<commit_after> | '''
Created on Sep 6, 2017
@author: Hossein
This file handles all the visualizations. It assumes that the status are ready and it
contains the function to generate the jpg's
'''
import os
from utils import get_visual_data_path
import numpy as np
import matplotlib.pyplot as plt
from turtledemo.__main__ import font... | Add a library for data visualization and add a dummy function'''
Created on Sep 6, 2017
@author: Hossein
This file handles all the visualizations. It assumes that the status are ready and it
contains the function to generate the jpg's
'''
import os
from utils import get_visual_data_path
import numpy as np
import ... | <commit_before><commit_msg>Add a library for data visualization and add a dummy function<commit_after>'''
Created on Sep 6, 2017
@author: Hossein
This file handles all the visualizations. It assumes that the status are ready and it
contains the function to generate the jpg's
'''
import os
from utils import get_vi... | |
f57ac6c3c7935d44956fac1295e417e34039c703 | bin/historical/migrations/move_trips_places_sections_stops_to_analysis_timeseries_db.py | bin/historical/migrations/move_trips_places_sections_stops_to_analysis_timeseries_db.py | import logging
import arrow
import emission.core.get_database as edb
import emission.core.wrapper.entry as ecwe
def convert_wrapper_to_entry(key, wrapper):
logging.debug("found user_id in wrapper %s" % wrapper["user_id"])
wrapper_entry = ecwe.Entry.create_entry(wrapper["user_id"], key, wrapper)
wrapper_en... | Add a new script to move existing entries to their correct location | Add a new script to move existing entries to their correct location
Now that we have moved it out of the usercache into its own class
| Python | bsd-3-clause | e-mission/e-mission-server,shankari/e-mission-server,sunil07t/e-mission-server,sunil07t/e-mission-server,yw374cornell/e-mission-server,e-mission/e-mission-server,yw374cornell/e-mission-server,shankari/e-mission-server,sunil07t/e-mission-server,shankari/e-mission-server,e-mission/e-mission-server,yw374cornell/e-mission-... | Add a new script to move existing entries to their correct location
Now that we have moved it out of the usercache into its own class | import logging
import arrow
import emission.core.get_database as edb
import emission.core.wrapper.entry as ecwe
def convert_wrapper_to_entry(key, wrapper):
logging.debug("found user_id in wrapper %s" % wrapper["user_id"])
wrapper_entry = ecwe.Entry.create_entry(wrapper["user_id"], key, wrapper)
wrapper_en... | <commit_before><commit_msg>Add a new script to move existing entries to their correct location
Now that we have moved it out of the usercache into its own class<commit_after> | import logging
import arrow
import emission.core.get_database as edb
import emission.core.wrapper.entry as ecwe
def convert_wrapper_to_entry(key, wrapper):
logging.debug("found user_id in wrapper %s" % wrapper["user_id"])
wrapper_entry = ecwe.Entry.create_entry(wrapper["user_id"], key, wrapper)
wrapper_en... | Add a new script to move existing entries to their correct location
Now that we have moved it out of the usercache into its own classimport logging
import arrow
import emission.core.get_database as edb
import emission.core.wrapper.entry as ecwe
def convert_wrapper_to_entry(key, wrapper):
logging.debug("found use... | <commit_before><commit_msg>Add a new script to move existing entries to their correct location
Now that we have moved it out of the usercache into its own class<commit_after>import logging
import arrow
import emission.core.get_database as edb
import emission.core.wrapper.entry as ecwe
def convert_wrapper_to_entry(ke... | |
5159dcdbdb1b73a57a550b239b9a92ae7a98e73f | bindings/python/tests/runner.py | bindings/python/tests/runner.py | import summer
import unittest
class TestDataTypes (unittest.TestCase):
def testitem(self):
i = summer.ItemData ()
i['title'] = 'hello world'
self.assertEqual (i['title'], 'hello world') #first
# Make sure strings aren't freed
self.assertEqual (i['title'], 'hello world') #sec... | Add test case for last commit (should probably be squashed) | python-bindings: Add test case for last commit (should probably be squashed)
| Python | lgpl-2.1 | ozamosi/summer,ozamosi/summer,ozamosi/summer,ozamosi/summer | python-bindings: Add test case for last commit (should probably be squashed) | import summer
import unittest
class TestDataTypes (unittest.TestCase):
def testitem(self):
i = summer.ItemData ()
i['title'] = 'hello world'
self.assertEqual (i['title'], 'hello world') #first
# Make sure strings aren't freed
self.assertEqual (i['title'], 'hello world') #sec... | <commit_before><commit_msg>python-bindings: Add test case for last commit (should probably be squashed)<commit_after> | import summer
import unittest
class TestDataTypes (unittest.TestCase):
def testitem(self):
i = summer.ItemData ()
i['title'] = 'hello world'
self.assertEqual (i['title'], 'hello world') #first
# Make sure strings aren't freed
self.assertEqual (i['title'], 'hello world') #sec... | python-bindings: Add test case for last commit (should probably be squashed)import summer
import unittest
class TestDataTypes (unittest.TestCase):
def testitem(self):
i = summer.ItemData ()
i['title'] = 'hello world'
self.assertEqual (i['title'], 'hello world') #first
# Make sure st... | <commit_before><commit_msg>python-bindings: Add test case for last commit (should probably be squashed)<commit_after>import summer
import unittest
class TestDataTypes (unittest.TestCase):
def testitem(self):
i = summer.ItemData ()
i['title'] = 'hello world'
self.assertEqual (i['title'], 'he... | |
665e0ef301ca91eaa715c236e1db7e5566959b57 | impschedules/usermanagement.py | impschedules/usermanagement.py | from flask import Flask, render_template, flash, request, Markup, session, redirect, url_for, escape, Response, current_app, send_file
from werkzeug.security import generate_password_hash, check_password_hash
from functools import wraps
def login_required(fn):
@wraps(fn)
def decorated_function(*args, **kwargs)... | Move user management to a new file | Move user management to a new file
| Python | agpl-3.0 | pwyf/IATI-Implementation-Schedules,pwyf/IATI-Implementation-Schedules,pwyf/IATI-Implementation-Schedules,pwyf/IATI-Implementation-Schedules | Move user management to a new file | from flask import Flask, render_template, flash, request, Markup, session, redirect, url_for, escape, Response, current_app, send_file
from werkzeug.security import generate_password_hash, check_password_hash
from functools import wraps
def login_required(fn):
@wraps(fn)
def decorated_function(*args, **kwargs)... | <commit_before><commit_msg>Move user management to a new file<commit_after> | from flask import Flask, render_template, flash, request, Markup, session, redirect, url_for, escape, Response, current_app, send_file
from werkzeug.security import generate_password_hash, check_password_hash
from functools import wraps
def login_required(fn):
@wraps(fn)
def decorated_function(*args, **kwargs)... | Move user management to a new filefrom flask import Flask, render_template, flash, request, Markup, session, redirect, url_for, escape, Response, current_app, send_file
from werkzeug.security import generate_password_hash, check_password_hash
from functools import wraps
def login_required(fn):
@wraps(fn)
def d... | <commit_before><commit_msg>Move user management to a new file<commit_after>from flask import Flask, render_template, flash, request, Markup, session, redirect, url_for, escape, Response, current_app, send_file
from werkzeug.security import generate_password_hash, check_password_hash
from functools import wraps
def log... | |
a7aa9301daeff4c93bd907f51114af68b36669df | redd/tests/test_api_data.py | redd/tests/test_api_data.py | #!/usr/bin/env python
from django.conf import settings
from django.test import TestCase
from django.test.client import Client
from django.utils import simplejson as json
from redd.models import Dataset
from redd.tests import utils
class TestAPIData(TestCase):
def setUp(self):
settings.CELERY_ALWAYS_EAGER... | Add test_get for api data (and missing file). | Add test_get for api data (and missing file).
| Python | mit | ibrahimcesar/panda,PalmBeachPost/panda,datadesk/panda,datadesk/panda,newsapps/panda,datadesk/panda,PalmBeachPost/panda,PalmBeachPost/panda,pandaproject/panda,ibrahimcesar/panda,NUKnightLab/panda,pandaproject/panda,pandaproject/panda,newsapps/panda,NUKnightLab/panda,ibrahimcesar/panda,newsapps/panda,NUKnightLab/panda,da... | Add test_get for api data (and missing file). | #!/usr/bin/env python
from django.conf import settings
from django.test import TestCase
from django.test.client import Client
from django.utils import simplejson as json
from redd.models import Dataset
from redd.tests import utils
class TestAPIData(TestCase):
def setUp(self):
settings.CELERY_ALWAYS_EAGER... | <commit_before><commit_msg>Add test_get for api data (and missing file).<commit_after> | #!/usr/bin/env python
from django.conf import settings
from django.test import TestCase
from django.test.client import Client
from django.utils import simplejson as json
from redd.models import Dataset
from redd.tests import utils
class TestAPIData(TestCase):
def setUp(self):
settings.CELERY_ALWAYS_EAGER... | Add test_get for api data (and missing file).#!/usr/bin/env python
from django.conf import settings
from django.test import TestCase
from django.test.client import Client
from django.utils import simplejson as json
from redd.models import Dataset
from redd.tests import utils
class TestAPIData(TestCase):
def setU... | <commit_before><commit_msg>Add test_get for api data (and missing file).<commit_after>#!/usr/bin/env python
from django.conf import settings
from django.test import TestCase
from django.test.client import Client
from django.utils import simplejson as json
from redd.models import Dataset
from redd.tests import utils
... | |
9eab96f40634c81ed53d54d2c9df126a445dfd56 | registry/spec_tools/util.py | registry/spec_tools/util.py | """Utility functions not closely tied to other spec_tools types."""
# Copyright (c) 2018-2019 Collabora, Ltd.
# Copyright (c) 2013-2019 The Khronos Group Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of... | Add new local dependency of scripts. | Add new local dependency of scripts.
| Python | apache-2.0 | KhronosGroup/Vulkan-Headers,KhronosGroup/Vulkan-Headers,KhronosGroup/Vulkan-Headers | Add new local dependency of scripts. | """Utility functions not closely tied to other spec_tools types."""
# Copyright (c) 2018-2019 Collabora, Ltd.
# Copyright (c) 2013-2019 The Khronos Group Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of... | <commit_before><commit_msg>Add new local dependency of scripts.<commit_after> | """Utility functions not closely tied to other spec_tools types."""
# Copyright (c) 2018-2019 Collabora, Ltd.
# Copyright (c) 2013-2019 The Khronos Group Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of... | Add new local dependency of scripts."""Utility functions not closely tied to other spec_tools types."""
# Copyright (c) 2018-2019 Collabora, Ltd.
# Copyright (c) 2013-2019 The Khronos Group Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the... | <commit_before><commit_msg>Add new local dependency of scripts.<commit_after>"""Utility functions not closely tied to other spec_tools types."""
# Copyright (c) 2018-2019 Collabora, Ltd.
# Copyright (c) 2013-2019 The Khronos Group Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not us... | |
1d7165dc88be1aea9a233c8e794ee66b99f1c70e | tools/rsyslog-cdn.py | tools/rsyslog-cdn.py | #!/usr/bin/python -u
import sys
import redis
import csv
import posixpath
import datetime
import logging
import logging.handlers
from email.utils import parsedate
PRECISIONS = [
("hour", "%y-%m-%d-%H", datetime.timedelta(days=2)),
("daily", "%y-%m-%d", datetime.timedelta(days=32)),
]
logger = logging.getLog... | Add a script to parse incoming CDN log entries | Add a script to parse incoming CDN log entries
| Python | bsd-3-clause | pydotorg/pypi,pydotorg/pypi,pydotorg/pypi,pydotorg/pypi | Add a script to parse incoming CDN log entries | #!/usr/bin/python -u
import sys
import redis
import csv
import posixpath
import datetime
import logging
import logging.handlers
from email.utils import parsedate
PRECISIONS = [
("hour", "%y-%m-%d-%H", datetime.timedelta(days=2)),
("daily", "%y-%m-%d", datetime.timedelta(days=32)),
]
logger = logging.getLog... | <commit_before><commit_msg>Add a script to parse incoming CDN log entries<commit_after> | #!/usr/bin/python -u
import sys
import redis
import csv
import posixpath
import datetime
import logging
import logging.handlers
from email.utils import parsedate
PRECISIONS = [
("hour", "%y-%m-%d-%H", datetime.timedelta(days=2)),
("daily", "%y-%m-%d", datetime.timedelta(days=32)),
]
logger = logging.getLog... | Add a script to parse incoming CDN log entries#!/usr/bin/python -u
import sys
import redis
import csv
import posixpath
import datetime
import logging
import logging.handlers
from email.utils import parsedate
PRECISIONS = [
("hour", "%y-%m-%d-%H", datetime.timedelta(days=2)),
("daily", "%y-%m-%d", datetime.ti... | <commit_before><commit_msg>Add a script to parse incoming CDN log entries<commit_after>#!/usr/bin/python -u
import sys
import redis
import csv
import posixpath
import datetime
import logging
import logging.handlers
from email.utils import parsedate
PRECISIONS = [
("hour", "%y-%m-%d-%H", datetime.timedelta(days=2... | |
2d3d63adac30db637cedd0280679db1100c39525 | tests/pool_connection_tests.py | tests/pool_connection_tests.py | """
Tests for Connection class in the pool module
"""
import mock
try:
import unittest2 as unittest
except ImportError:
import unittest
import weakref
from queries import pool
class ConnectionTests(unittest.TestCase):
def setUp(self):
self.handle = mock.Mock()
self.handle.close = mock.M... | Move pool.Connection tests into own file | Move pool.Connection tests into own file
| Python | bsd-3-clause | gmr/queries,gmr/queries | Move pool.Connection tests into own file | """
Tests for Connection class in the pool module
"""
import mock
try:
import unittest2 as unittest
except ImportError:
import unittest
import weakref
from queries import pool
class ConnectionTests(unittest.TestCase):
def setUp(self):
self.handle = mock.Mock()
self.handle.close = mock.M... | <commit_before><commit_msg>Move pool.Connection tests into own file<commit_after> | """
Tests for Connection class in the pool module
"""
import mock
try:
import unittest2 as unittest
except ImportError:
import unittest
import weakref
from queries import pool
class ConnectionTests(unittest.TestCase):
def setUp(self):
self.handle = mock.Mock()
self.handle.close = mock.M... | Move pool.Connection tests into own file"""
Tests for Connection class in the pool module
"""
import mock
try:
import unittest2 as unittest
except ImportError:
import unittest
import weakref
from queries import pool
class ConnectionTests(unittest.TestCase):
def setUp(self):
self.handle = mock.M... | <commit_before><commit_msg>Move pool.Connection tests into own file<commit_after>"""
Tests for Connection class in the pool module
"""
import mock
try:
import unittest2 as unittest
except ImportError:
import unittest
import weakref
from queries import pool
class ConnectionTests(unittest.TestCase):
def ... | |
67cc1656a7d075c1136c6e18b63167792b8747c3 | assignment2/my_client.py | assignment2/my_client.py | import argparse
import ReplicatorClient
PORT = 3000
def main():
parser = argparse.ArgumentParser()
parser.add_argument("host", help="the ip of the host")
args = parser.parse_args()
print("Client is connecting to Server at {}:{}...".format(args.host, PORT))
client = ReplicatorClient(host=args.host,... | Add external client for pushing values | Add external client for pushing values
| Python | mit | rimpybharot/CMPE273 | Add external client for pushing values | import argparse
import ReplicatorClient
PORT = 3000
def main():
parser = argparse.ArgumentParser()
parser.add_argument("host", help="the ip of the host")
args = parser.parse_args()
print("Client is connecting to Server at {}:{}...".format(args.host, PORT))
client = ReplicatorClient(host=args.host,... | <commit_before><commit_msg>Add external client for pushing values<commit_after> | import argparse
import ReplicatorClient
PORT = 3000
def main():
parser = argparse.ArgumentParser()
parser.add_argument("host", help="the ip of the host")
args = parser.parse_args()
print("Client is connecting to Server at {}:{}...".format(args.host, PORT))
client = ReplicatorClient(host=args.host,... | Add external client for pushing valuesimport argparse
import ReplicatorClient
PORT = 3000
def main():
parser = argparse.ArgumentParser()
parser.add_argument("host", help="the ip of the host")
args = parser.parse_args()
print("Client is connecting to Server at {}:{}...".format(args.host, PORT))
cli... | <commit_before><commit_msg>Add external client for pushing values<commit_after>import argparse
import ReplicatorClient
PORT = 3000
def main():
parser = argparse.ArgumentParser()
parser.add_argument("host", help="the ip of the host")
args = parser.parse_args()
print("Client is connecting to Server at {... | |
09099ab106ae4c0695502e3632e4ac1c2f459566 | apps/teams/bulk_actions.py | apps/teams/bulk_actions.py | from django.contrib.contenttypes.models import ContentType
from subtitles.models import SubtitleLanguage
from teams.signals import api_subtitles_approved
from utils.csv_parser import UnicodeReader
from videos.tasks import video_changed_tasks
def complete_approve_tasks(tasks):
lang_ct = ContentType.objects.get_for_... | from django.contrib.contenttypes.models import ContentType
from subtitles.models import SubtitleLanguage
from subtitles.signals import subtitles_published
from teams.signals import api_subtitles_approved
from utils.csv_parser import UnicodeReader
from videos.tasks import video_changed_tasks
def complete_approve_tasks(... | Send subtitles_published signal for bulk approvals | Send subtitles_published signal for bulk approvals
This fixes pculture/amara-enterprise#608
| Python | agpl-3.0 | pculture/unisubs,pculture/unisubs,wevoice/wesub,pculture/unisubs,wevoice/wesub,wevoice/wesub,pculture/unisubs,wevoice/wesub | from django.contrib.contenttypes.models import ContentType
from subtitles.models import SubtitleLanguage
from teams.signals import api_subtitles_approved
from utils.csv_parser import UnicodeReader
from videos.tasks import video_changed_tasks
def complete_approve_tasks(tasks):
lang_ct = ContentType.objects.get_for_... | from django.contrib.contenttypes.models import ContentType
from subtitles.models import SubtitleLanguage
from subtitles.signals import subtitles_published
from teams.signals import api_subtitles_approved
from utils.csv_parser import UnicodeReader
from videos.tasks import video_changed_tasks
def complete_approve_tasks(... | <commit_before>from django.contrib.contenttypes.models import ContentType
from subtitles.models import SubtitleLanguage
from teams.signals import api_subtitles_approved
from utils.csv_parser import UnicodeReader
from videos.tasks import video_changed_tasks
def complete_approve_tasks(tasks):
lang_ct = ContentType.o... | from django.contrib.contenttypes.models import ContentType
from subtitles.models import SubtitleLanguage
from subtitles.signals import subtitles_published
from teams.signals import api_subtitles_approved
from utils.csv_parser import UnicodeReader
from videos.tasks import video_changed_tasks
def complete_approve_tasks(... | from django.contrib.contenttypes.models import ContentType
from subtitles.models import SubtitleLanguage
from teams.signals import api_subtitles_approved
from utils.csv_parser import UnicodeReader
from videos.tasks import video_changed_tasks
def complete_approve_tasks(tasks):
lang_ct = ContentType.objects.get_for_... | <commit_before>from django.contrib.contenttypes.models import ContentType
from subtitles.models import SubtitleLanguage
from teams.signals import api_subtitles_approved
from utils.csv_parser import UnicodeReader
from videos.tasks import video_changed_tasks
def complete_approve_tasks(tasks):
lang_ct = ContentType.o... |
dc038e9b0da446e4d8b3f3e5964d6d6b4ec82d8e | snowrunner/transfer_save.py | snowrunner/transfer_save.py | """Automate Snowrunner save file renaming described in https://steamcommunity.com/sharedfiles/filedetails/?id=2530914231"""
import argparse
import csv
import os
import shutil
def load_csv(csv_path):
save_dict = {}
with open(csv_path) as csvfile:
csv_reader = csv.reader(csvfile, delimiter=",", quotechar... | Add automated Snowrunner save file renaming | Add automated Snowrunner save file renaming
| Python | mit | esabouraud/scripts,esabouraud/scripts | Add automated Snowrunner save file renaming | """Automate Snowrunner save file renaming described in https://steamcommunity.com/sharedfiles/filedetails/?id=2530914231"""
import argparse
import csv
import os
import shutil
def load_csv(csv_path):
save_dict = {}
with open(csv_path) as csvfile:
csv_reader = csv.reader(csvfile, delimiter=",", quotechar... | <commit_before><commit_msg>Add automated Snowrunner save file renaming<commit_after> | """Automate Snowrunner save file renaming described in https://steamcommunity.com/sharedfiles/filedetails/?id=2530914231"""
import argparse
import csv
import os
import shutil
def load_csv(csv_path):
save_dict = {}
with open(csv_path) as csvfile:
csv_reader = csv.reader(csvfile, delimiter=",", quotechar... | Add automated Snowrunner save file renaming"""Automate Snowrunner save file renaming described in https://steamcommunity.com/sharedfiles/filedetails/?id=2530914231"""
import argparse
import csv
import os
import shutil
def load_csv(csv_path):
save_dict = {}
with open(csv_path) as csvfile:
csv_reader = c... | <commit_before><commit_msg>Add automated Snowrunner save file renaming<commit_after>"""Automate Snowrunner save file renaming described in https://steamcommunity.com/sharedfiles/filedetails/?id=2530914231"""
import argparse
import csv
import os
import shutil
def load_csv(csv_path):
save_dict = {}
with open(csv... | |
3468794db82e020bc40c54a9399269169fbb37a8 | CodeFights/concatenateArrays.py | CodeFights/concatenateArrays.py | #!/usr/local/bin/python
# Code Fights Concatenate Arrays Problem
def concatenateArrays(a, b):
return a + b
def main():
tests = [
[[2, 2, 1], [10, 11], [2, 2, 1, 10, 11]],
[[1, 2], [3, 1, 2], [1, 2, 3, 1, 2]],
[[1], [], [1]],
[
[2, 10, 3, 9, 5, 11, 11],
... | Solve Code Fights concatenate arrays problem | Solve Code Fights concatenate arrays problem
| Python | mit | HKuz/Test_Code | Solve Code Fights concatenate arrays problem | #!/usr/local/bin/python
# Code Fights Concatenate Arrays Problem
def concatenateArrays(a, b):
return a + b
def main():
tests = [
[[2, 2, 1], [10, 11], [2, 2, 1, 10, 11]],
[[1, 2], [3, 1, 2], [1, 2, 3, 1, 2]],
[[1], [], [1]],
[
[2, 10, 3, 9, 5, 11, 11],
... | <commit_before><commit_msg>Solve Code Fights concatenate arrays problem<commit_after> | #!/usr/local/bin/python
# Code Fights Concatenate Arrays Problem
def concatenateArrays(a, b):
return a + b
def main():
tests = [
[[2, 2, 1], [10, 11], [2, 2, 1, 10, 11]],
[[1, 2], [3, 1, 2], [1, 2, 3, 1, 2]],
[[1], [], [1]],
[
[2, 10, 3, 9, 5, 11, 11],
... | Solve Code Fights concatenate arrays problem#!/usr/local/bin/python
# Code Fights Concatenate Arrays Problem
def concatenateArrays(a, b):
return a + b
def main():
tests = [
[[2, 2, 1], [10, 11], [2, 2, 1, 10, 11]],
[[1, 2], [3, 1, 2], [1, 2, 3, 1, 2]],
[[1], [], [1]],
[
... | <commit_before><commit_msg>Solve Code Fights concatenate arrays problem<commit_after>#!/usr/local/bin/python
# Code Fights Concatenate Arrays Problem
def concatenateArrays(a, b):
return a + b
def main():
tests = [
[[2, 2, 1], [10, 11], [2, 2, 1, 10, 11]],
[[1, 2], [3, 1, 2], [1, 2, 3, 1, 2]]... | |
9116776bd62e6b7ae7a018fa2c2c0b3964c3fa7d | py/maximum-binary-tree.py | py/maximum-binary-tree.py | # Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution(object):
def findMax(self, start, end):
bit_length = (end - start).bit_length() - 1
d = 1 << bit_length
re... | Add py solution for 654. Maximum Binary Tree | Add py solution for 654. Maximum Binary Tree
654. Maximum Binary Tree: https://leetcode.com/problems/maximum-binary-tree/
| Python | apache-2.0 | ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode | Add py solution for 654. Maximum Binary Tree
654. Maximum Binary Tree: https://leetcode.com/problems/maximum-binary-tree/ | # Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution(object):
def findMax(self, start, end):
bit_length = (end - start).bit_length() - 1
d = 1 << bit_length
re... | <commit_before><commit_msg>Add py solution for 654. Maximum Binary Tree
654. Maximum Binary Tree: https://leetcode.com/problems/maximum-binary-tree/<commit_after> | # Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution(object):
def findMax(self, start, end):
bit_length = (end - start).bit_length() - 1
d = 1 << bit_length
re... | Add py solution for 654. Maximum Binary Tree
654. Maximum Binary Tree: https://leetcode.com/problems/maximum-binary-tree/# Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution(object):
... | <commit_before><commit_msg>Add py solution for 654. Maximum Binary Tree
654. Maximum Binary Tree: https://leetcode.com/problems/maximum-binary-tree/<commit_after># Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.... | |
e9c851ac5a328ed43c61df29b9a3b6129e08c7c5 | pylua/tests/test_while.py | pylua/tests/test_while.py | from .helpers import codetest
class TestWhile(object):
"""
tests for the lua if then else and various comparisons
"""
def test_simple_while(self):
ret = codetest("""
x = 0
while x < 10 do
x = x + 1
end
return ... | Implement simple for loop and SUBVN | Implement simple for loop and SUBVN
| Python | bsd-3-clause | fhahn/luna,fhahn/luna | Implement simple for loop and SUBVN | from .helpers import codetest
class TestWhile(object):
"""
tests for the lua if then else and various comparisons
"""
def test_simple_while(self):
ret = codetest("""
x = 0
while x < 10 do
x = x + 1
end
return ... | <commit_before><commit_msg>Implement simple for loop and SUBVN<commit_after> | from .helpers import codetest
class TestWhile(object):
"""
tests for the lua if then else and various comparisons
"""
def test_simple_while(self):
ret = codetest("""
x = 0
while x < 10 do
x = x + 1
end
return ... | Implement simple for loop and SUBVNfrom .helpers import codetest
class TestWhile(object):
"""
tests for the lua if then else and various comparisons
"""
def test_simple_while(self):
ret = codetest("""
x = 0
while x < 10 do
x = x + 1
... | <commit_before><commit_msg>Implement simple for loop and SUBVN<commit_after>from .helpers import codetest
class TestWhile(object):
"""
tests for the lua if then else and various comparisons
"""
def test_simple_while(self):
ret = codetest("""
x = 0
while x < 10 ... | |
f659f773b7713fab2bb02a4a26eefc9e002145ca | 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 zlib
assert(zlib.decompress(zlib.compress(b'IT WORKS IT WORKS IT WORKS')) == b'IT WORKS IT WORKS IT WORKS')
| 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... | Add "lzma" to "python-imports" test | Add "lzma" to "python-imports" test
| Python | apache-2.0 | chorrell/official-images,docker-flink/official-images,docker-library/official-images,nodejs-docker-bot/official-images,jperrin/official-images,docker-library/official-images,chorrell/official-images,pesho/docker-official-images,benbc/docker-official-images,mattrobenolt/official-images,docker-flink/official-images,31z4/... | 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 zlib
assert(zlib.decompress(zlib.compress(b'IT WORKS IT WORKS IT WORKS')) == b'IT WORKS IT WORKS IT WORKS')
Add "lzma" to "python-imports" test | 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 zlib
assert(zlib.decompress(zlib.compress(b'IT WORKS IT WORKS IT WORKS')) == b'IT WORKS IT WORKS IT WORKS')
<commit_msg>Add "lzma" to "python-imports" tes... | 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 readline
import bz2
assert(bz2.decompress(bz2.compress(b'IT WORKS IT WORKS IT WORKS')) == b'IT WORKS IT WORKS IT WORKS')
import zlib
assert(zlib.decompress(zlib.compress(b'IT WORKS IT WORKS IT WORKS')) == b'IT WORKS IT WORKS IT WORKS')
Add "lzma" to "python-imports" testimport curses
import readl... | <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 zlib
assert(zlib.decompress(zlib.compress(b'IT WORKS IT WORKS IT WORKS')) == b'IT WORKS IT WORKS IT WORKS')
<commit_msg>Add "lzma" to "python-imports" tes... |
4308a409ea970a59be5965cce2617c7cecf8b5b6 | src/player.py | src/player.py | # card-fight-thingy - Simplistic battle card game... thingy
#
# The MIT License (MIT)
#
# Copyright (c) 2015 The Underscores
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restrict... | Add beginnings of Player class implementation | Add beginnings of Player class implementation
| Python | mit | TheUnderscores/card-fight-thingy | Add beginnings of Player class implementation | # card-fight-thingy - Simplistic battle card game... thingy
#
# The MIT License (MIT)
#
# Copyright (c) 2015 The Underscores
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restrict... | <commit_before><commit_msg>Add beginnings of Player class implementation<commit_after> | # card-fight-thingy - Simplistic battle card game... thingy
#
# The MIT License (MIT)
#
# Copyright (c) 2015 The Underscores
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restrict... | Add beginnings of Player class implementation# card-fight-thingy - Simplistic battle card game... thingy
#
# The MIT License (MIT)
#
# Copyright (c) 2015 The Underscores
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"... | <commit_before><commit_msg>Add beginnings of Player class implementation<commit_after># card-fight-thingy - Simplistic battle card game... thingy
#
# The MIT License (MIT)
#
# Copyright (c) 2015 The Underscores
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and assoc... | |
5ed3bc5627b8dc3643f6a4d0d6ee782b701bdfd1 | InterleavePdf.py | InterleavePdf.py | import PyPDF2
from formlayout import fedit
paths = [('Input', ''), ('Output', '')]
pathsRead = fedit(paths,
title="Interleave pdf",
comment="Enter the full path to the source pdf and a path to output the result."
)
# Full path to files should be specified eg C:\U... | Add source file to repository. | Add source file to repository.
| Python | mit | sproberts92/interleave-pdf | Add source file to repository. | import PyPDF2
from formlayout import fedit
paths = [('Input', ''), ('Output', '')]
pathsRead = fedit(paths,
title="Interleave pdf",
comment="Enter the full path to the source pdf and a path to output the result."
)
# Full path to files should be specified eg C:\U... | <commit_before><commit_msg>Add source file to repository.<commit_after> | import PyPDF2
from formlayout import fedit
paths = [('Input', ''), ('Output', '')]
pathsRead = fedit(paths,
title="Interleave pdf",
comment="Enter the full path to the source pdf and a path to output the result."
)
# Full path to files should be specified eg C:\U... | Add source file to repository.import PyPDF2
from formlayout import fedit
paths = [('Input', ''), ('Output', '')]
pathsRead = fedit(paths,
title="Interleave pdf",
comment="Enter the full path to the source pdf and a path to output the result."
)
# Full path to fil... | <commit_before><commit_msg>Add source file to repository.<commit_after>import PyPDF2
from formlayout import fedit
paths = [('Input', ''), ('Output', '')]
pathsRead = fedit(paths,
title="Interleave pdf",
comment="Enter the full path to the source pdf and a path to output the result... | |
b373bfeaaf9017b9c16b21adb495155e0345a05a | tests/testrepos/FoodRelations/combineCooccurrences.py | tests/testrepos/FoodRelations/combineCooccurrences.py | import argparse
import os
import codecs
from collections import Counter
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Merges cooccurrences files down to a single file')
parser.add_argument('--inDir',type=str,required=True,help='Directory containing cooccurrence files. Expected to be tab-de... | Add combine cooccurrence script for Food project | Add combine cooccurrence script for Food project
| Python | mit | jakelever/pubrunner,jakelever/pubrunner | Add combine cooccurrence script for Food project | import argparse
import os
import codecs
from collections import Counter
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Merges cooccurrences files down to a single file')
parser.add_argument('--inDir',type=str,required=True,help='Directory containing cooccurrence files. Expected to be tab-de... | <commit_before><commit_msg>Add combine cooccurrence script for Food project<commit_after> | import argparse
import os
import codecs
from collections import Counter
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Merges cooccurrences files down to a single file')
parser.add_argument('--inDir',type=str,required=True,help='Directory containing cooccurrence files. Expected to be tab-de... | Add combine cooccurrence script for Food projectimport argparse
import os
import codecs
from collections import Counter
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Merges cooccurrences files down to a single file')
parser.add_argument('--inDir',type=str,required=True,help='Directory cont... | <commit_before><commit_msg>Add combine cooccurrence script for Food project<commit_after>import argparse
import os
import codecs
from collections import Counter
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Merges cooccurrences files down to a single file')
parser.add_argument('--inDir',ty... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.