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
1804d75f7037398dd0ed2ee67748f666cef84c10
utils/setBaud.py
utils/setBaud.py
#!/usr/bin/python """Looks for sensor on the bus and changes it's address to the one specified on command line""" import argparse import minimalmodbus import serial from time import sleep baudrates=[1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200] parser = argparse.ArgumentParser() parser.add_argument('baudr...
Add utility for baut setting
Add utility for baut setting
Python
apache-2.0
Miceuz/rs485-moist-sensor,Miceuz/rs485-moist-sensor
Add utility for baut setting
#!/usr/bin/python """Looks for sensor on the bus and changes it's address to the one specified on command line""" import argparse import minimalmodbus import serial from time import sleep baudrates=[1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200] parser = argparse.ArgumentParser() parser.add_argument('baudr...
<commit_before><commit_msg>Add utility for baut setting<commit_after>
#!/usr/bin/python """Looks for sensor on the bus and changes it's address to the one specified on command line""" import argparse import minimalmodbus import serial from time import sleep baudrates=[1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200] parser = argparse.ArgumentParser() parser.add_argument('baudr...
Add utility for baut setting#!/usr/bin/python """Looks for sensor on the bus and changes it's address to the one specified on command line""" import argparse import minimalmodbus import serial from time import sleep baudrates=[1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200] parser = argparse.ArgumentParser(...
<commit_before><commit_msg>Add utility for baut setting<commit_after>#!/usr/bin/python """Looks for sensor on the bus and changes it's address to the one specified on command line""" import argparse import minimalmodbus import serial from time import sleep baudrates=[1200, 2400, 4800, 9600, 19200, 38400, 57600, 11...
10a07ebf706c3a553e76a60d25d38eeb0372e257
tools/dircondenser.py
tools/dircondenser.py
#!/usr/bin/env python3 # Copyright 2018 The Meson development team # 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 app...
Add script to condense test directory names.
Add script to condense test directory names.
Python
apache-2.0
pexip/meson,becm/meson,MathieuDuponchelle/meson,QuLogic/meson,pexip/meson,becm/meson,jpakkane/meson,becm/meson,pexip/meson,MathieuDuponchelle/meson,MathieuDuponchelle/meson,QuLogic/meson,jpakkane/meson,mesonbuild/meson,MathieuDuponchelle/meson,becm/meson,thiblahute/meson,QuLogic/meson,mesonbuild/meson,mesonbuild/meson,...
Add script to condense test directory names.
#!/usr/bin/env python3 # Copyright 2018 The Meson development team # 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 app...
<commit_before><commit_msg>Add script to condense test directory names.<commit_after>
#!/usr/bin/env python3 # Copyright 2018 The Meson development team # 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 app...
Add script to condense test directory names.#!/usr/bin/env python3 # Copyright 2018 The Meson development team # 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/li...
<commit_before><commit_msg>Add script to condense test directory names.<commit_after>#!/usr/bin/env python3 # Copyright 2018 The Meson development team # 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 L...
e4869e9e348dd5a0441edc0aca7c0298c2c892a9
mopidy/backends/dummy.py
mopidy/backends/dummy.py
from __future__ import unicode_literals # Make classes previously residing here available in the old location for # backwards compatibility with extensions targeting Mopidy < 0.18. from mopidy.backend.dummy import * # noqa
Make old DummyBackend imports work
backend: Make old DummyBackend imports work
Python
apache-2.0
glogiotatidis/mopidy,vrs01/mopidy,mokieyue/mopidy,quartz55/mopidy,jmarsik/mopidy,diandiankan/mopidy,jmarsik/mopidy,dbrgn/mopidy,bencevans/mopidy,mopidy/mopidy,bencevans/mopidy,mokieyue/mopidy,tkem/mopidy,hkariti/mopidy,bencevans/mopidy,glogiotatidis/mopidy,swak/mopidy,ZenithDK/mopidy,kingosticks/mopidy,diandiankan/mopi...
backend: Make old DummyBackend imports work
from __future__ import unicode_literals # Make classes previously residing here available in the old location for # backwards compatibility with extensions targeting Mopidy < 0.18. from mopidy.backend.dummy import * # noqa
<commit_before><commit_msg>backend: Make old DummyBackend imports work<commit_after>
from __future__ import unicode_literals # Make classes previously residing here available in the old location for # backwards compatibility with extensions targeting Mopidy < 0.18. from mopidy.backend.dummy import * # noqa
backend: Make old DummyBackend imports workfrom __future__ import unicode_literals # Make classes previously residing here available in the old location for # backwards compatibility with extensions targeting Mopidy < 0.18. from mopidy.backend.dummy import * # noqa
<commit_before><commit_msg>backend: Make old DummyBackend imports work<commit_after>from __future__ import unicode_literals # Make classes previously residing here available in the old location for # backwards compatibility with extensions targeting Mopidy < 0.18. from mopidy.backend.dummy import * # noqa
e3d54a292576e33e1dcd2c5bd58f78de4e71682b
flask-index/app/main.py
flask-index/app/main.py
from flask import Flask, send_file app = Flask(__name__) @app.route("/hello") def hello(): return "Hello World from Flask (default)" @app.route("/") def main(): return send_file('./static/index.html') if __name__ == "__main__": app.run(host='0.0.0.0', debug=True, port=80)
Add default flask-index file that also sends index.html to /
Add default flask-index file that also sends index.html to /
Python
apache-2.0
tiangolo/uwsgi-nginx-flask-docker,tiangolo/uwsgi-nginx-flask-docker,tiangolo/uwsgi-nginx-flask-docker
Add default flask-index file that also sends index.html to /
from flask import Flask, send_file app = Flask(__name__) @app.route("/hello") def hello(): return "Hello World from Flask (default)" @app.route("/") def main(): return send_file('./static/index.html') if __name__ == "__main__": app.run(host='0.0.0.0', debug=True, port=80)
<commit_before><commit_msg>Add default flask-index file that also sends index.html to /<commit_after>
from flask import Flask, send_file app = Flask(__name__) @app.route("/hello") def hello(): return "Hello World from Flask (default)" @app.route("/") def main(): return send_file('./static/index.html') if __name__ == "__main__": app.run(host='0.0.0.0', debug=True, port=80)
Add default flask-index file that also sends index.html to /from flask import Flask, send_file app = Flask(__name__) @app.route("/hello") def hello(): return "Hello World from Flask (default)" @app.route("/") def main(): return send_file('./static/index.html') if __name__ == "__main__": app.run(host='0.0...
<commit_before><commit_msg>Add default flask-index file that also sends index.html to /<commit_after>from flask import Flask, send_file app = Flask(__name__) @app.route("/hello") def hello(): return "Hello World from Flask (default)" @app.route("/") def main(): return send_file('./static/index.html') if __na...
30a2e6f39cde7d8cd19af7c783e85a50593a5e05
.editorconfig*.py
.editorconfig*.py
# http://editorconfig.org root = true [*] indent_style = space indent_size = 4 trim_trailing_whitespace = true insert_final_newline = true charset = utf-8 end_of_line = lf [*.bat] indent_style = tab end_of_line = crlf [LICENSE] insert_final_newline = false [Makefile] indent_style = tab
Add .editorconfig.py to suggest indent amount, spaces over tabs, etc.
Add .editorconfig.py to suggest indent amount, spaces over tabs, etc.
Python
isc
nsh87/regressors
Add .editorconfig.py to suggest indent amount, spaces over tabs, etc.
# http://editorconfig.org root = true [*] indent_style = space indent_size = 4 trim_trailing_whitespace = true insert_final_newline = true charset = utf-8 end_of_line = lf [*.bat] indent_style = tab end_of_line = crlf [LICENSE] insert_final_newline = false [Makefile] indent_style = tab
<commit_before><commit_msg>Add .editorconfig.py to suggest indent amount, spaces over tabs, etc.<commit_after>
# http://editorconfig.org root = true [*] indent_style = space indent_size = 4 trim_trailing_whitespace = true insert_final_newline = true charset = utf-8 end_of_line = lf [*.bat] indent_style = tab end_of_line = crlf [LICENSE] insert_final_newline = false [Makefile] indent_style = tab
Add .editorconfig.py to suggest indent amount, spaces over tabs, etc.# http://editorconfig.org root = true [*] indent_style = space indent_size = 4 trim_trailing_whitespace = true insert_final_newline = true charset = utf-8 end_of_line = lf [*.bat] indent_style = tab end_of_line = crlf [LICENSE] insert_final_newlin...
<commit_before><commit_msg>Add .editorconfig.py to suggest indent amount, spaces over tabs, etc.<commit_after># http://editorconfig.org root = true [*] indent_style = space indent_size = 4 trim_trailing_whitespace = true insert_final_newline = true charset = utf-8 end_of_line = lf [*.bat] indent_style = tab end_of_l...
16bd993545a665f4fc127df3bd5a2b69349bdedd
scripts/create_user.py
scripts/create_user.py
#!/usr/bin/env python # -*- coding: utf-8 -*- #============================================================================== # Script for creating MySQL user #============================================================================== import os import sys import mysql.connector from mysql.connector import errorco...
Add script to create MySQL user.
scripts: Add script to create MySQL user.
Python
mit
alberand/tserver,alberand/tserver,alberand/tserver,alberand/tserver
scripts: Add script to create MySQL user.
#!/usr/bin/env python # -*- coding: utf-8 -*- #============================================================================== # Script for creating MySQL user #============================================================================== import os import sys import mysql.connector from mysql.connector import errorco...
<commit_before><commit_msg>scripts: Add script to create MySQL user.<commit_after>
#!/usr/bin/env python # -*- coding: utf-8 -*- #============================================================================== # Script for creating MySQL user #============================================================================== import os import sys import mysql.connector from mysql.connector import errorco...
scripts: Add script to create MySQL user.#!/usr/bin/env python # -*- coding: utf-8 -*- #============================================================================== # Script for creating MySQL user #============================================================================== import os import sys import mysql.conn...
<commit_before><commit_msg>scripts: Add script to create MySQL user.<commit_after>#!/usr/bin/env python # -*- coding: utf-8 -*- #============================================================================== # Script for creating MySQL user #=============================================================================...
eb30ba0366e7a5639faaad91972df0ee7bf0a049
webserver/processes_web_server.py
webserver/processes_web_server.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function import BaseHTTPServer import json import time import psutil HOST_NAME = '0.0.0.0' PORT_NUMBER = 8222 class ProcessListHandler(BaseHTTPServer.BaseHTTPRequestHandler): def do_GET(s): s.send_response(200) s.send_h...
Add script for listing running processes.
Add script for listing running processes.
Python
mit
grundic/teamcity-web-parameters,grundic/teamcity-web-parameters,grundic/teamcity-web-parameters
Add script for listing running processes.
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function import BaseHTTPServer import json import time import psutil HOST_NAME = '0.0.0.0' PORT_NUMBER = 8222 class ProcessListHandler(BaseHTTPServer.BaseHTTPRequestHandler): def do_GET(s): s.send_response(200) s.send_h...
<commit_before><commit_msg>Add script for listing running processes.<commit_after>
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function import BaseHTTPServer import json import time import psutil HOST_NAME = '0.0.0.0' PORT_NUMBER = 8222 class ProcessListHandler(BaseHTTPServer.BaseHTTPRequestHandler): def do_GET(s): s.send_response(200) s.send_h...
Add script for listing running processes.#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function import BaseHTTPServer import json import time import psutil HOST_NAME = '0.0.0.0' PORT_NUMBER = 8222 class ProcessListHandler(BaseHTTPServer.BaseHTTPRequestHandler): def do_GET(s): ...
<commit_before><commit_msg>Add script for listing running processes.<commit_after>#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function import BaseHTTPServer import json import time import psutil HOST_NAME = '0.0.0.0' PORT_NUMBER = 8222 class ProcessListHandler(BaseHTTPServer.BaseHTT...
164b860e4a44a22a1686cf6133fac6258fc97db6
nbgrader/tests/apps/test_nbgrader_fetch.py
nbgrader/tests/apps/test_nbgrader_fetch.py
from nbgrader.tests import run_command from nbgrader.tests.apps.base import BaseTestApp class TestNbGraderFetch(BaseTestApp): def test_help(self): """Does the help display without error?""" run_command("nbgrader fetch --help-all")
import os from nbgrader.tests import run_command from nbgrader.tests.apps.base import BaseTestApp class TestNbGraderFetch(BaseTestApp): def _fetch(self, assignment, exchange, flags="", retcode=0): run_command( 'nbgrader fetch abc101 {} ' '--TransferApp.exchange_directory={} ' ...
Add some basic tests for nbgrader fetch
Add some basic tests for nbgrader fetch
Python
bsd-3-clause
modulexcite/nbgrader,jupyter/nbgrader,MatKallada/nbgrader,alope107/nbgrader,modulexcite/nbgrader,dementrock/nbgrader,alope107/nbgrader,EdwardJKim/nbgrader,jhamrick/nbgrader,jhamrick/nbgrader,jhamrick/nbgrader,jupyter/nbgrader,EdwardJKim/nbgrader,ellisonbg/nbgrader,jupyter/nbgrader,jhamrick/nbgrader,EdwardJKim/nbgrader,...
from nbgrader.tests import run_command from nbgrader.tests.apps.base import BaseTestApp class TestNbGraderFetch(BaseTestApp): def test_help(self): """Does the help display without error?""" run_command("nbgrader fetch --help-all") Add some basic tests for nbgrader fetch
import os from nbgrader.tests import run_command from nbgrader.tests.apps.base import BaseTestApp class TestNbGraderFetch(BaseTestApp): def _fetch(self, assignment, exchange, flags="", retcode=0): run_command( 'nbgrader fetch abc101 {} ' '--TransferApp.exchange_directory={} ' ...
<commit_before>from nbgrader.tests import run_command from nbgrader.tests.apps.base import BaseTestApp class TestNbGraderFetch(BaseTestApp): def test_help(self): """Does the help display without error?""" run_command("nbgrader fetch --help-all") <commit_msg>Add some basic tests for nbgrader fetch...
import os from nbgrader.tests import run_command from nbgrader.tests.apps.base import BaseTestApp class TestNbGraderFetch(BaseTestApp): def _fetch(self, assignment, exchange, flags="", retcode=0): run_command( 'nbgrader fetch abc101 {} ' '--TransferApp.exchange_directory={} ' ...
from nbgrader.tests import run_command from nbgrader.tests.apps.base import BaseTestApp class TestNbGraderFetch(BaseTestApp): def test_help(self): """Does the help display without error?""" run_command("nbgrader fetch --help-all") Add some basic tests for nbgrader fetchimport os from nbgrader.te...
<commit_before>from nbgrader.tests import run_command from nbgrader.tests.apps.base import BaseTestApp class TestNbGraderFetch(BaseTestApp): def test_help(self): """Does the help display without error?""" run_command("nbgrader fetch --help-all") <commit_msg>Add some basic tests for nbgrader fetch...
a8d2d9a953cba50d6c2ccbd6653f44e26982dff0
river/river_plugins.py
river/river_plugins.py
#!/usr/bin/env python # -*- encoding: utf-8 -*- class Plugins: cb_new_entries = [] cb_download_complete = [] p_config = {} def __init__(self): pass def new_entries(self): pass def download_complete(self): pass def register_plugin(self, name, path, config): ...
Add prototype for plugin handler
Add prototype for plugin handler
Python
mit
ozamosi/river,ozamosi/river
Add prototype for plugin handler
#!/usr/bin/env python # -*- encoding: utf-8 -*- class Plugins: cb_new_entries = [] cb_download_complete = [] p_config = {} def __init__(self): pass def new_entries(self): pass def download_complete(self): pass def register_plugin(self, name, path, config): ...
<commit_before><commit_msg>Add prototype for plugin handler<commit_after>
#!/usr/bin/env python # -*- encoding: utf-8 -*- class Plugins: cb_new_entries = [] cb_download_complete = [] p_config = {} def __init__(self): pass def new_entries(self): pass def download_complete(self): pass def register_plugin(self, name, path, config): ...
Add prototype for plugin handler#!/usr/bin/env python # -*- encoding: utf-8 -*- class Plugins: cb_new_entries = [] cb_download_complete = [] p_config = {} def __init__(self): pass def new_entries(self): pass def download_complete(self): pass def register_plugin(...
<commit_before><commit_msg>Add prototype for plugin handler<commit_after>#!/usr/bin/env python # -*- encoding: utf-8 -*- class Plugins: cb_new_entries = [] cb_download_complete = [] p_config = {} def __init__(self): pass def new_entries(self): pass def download_complete(self...
58b69493a92ada5897300a96ef934fe593ffe926
docs/tutorial/src/python-types/tutorial001.py
docs/tutorial/src/python-types/tutorial001.py
def get_full_name(first_name, last_name): full_name = first_name.title() + " " + last_name.title() return full_name print(get_full_name("john", "doe"))
Add tutorial src for python-types
:memo: Add tutorial src for python-types
Python
mit
tiangolo/fastapi,tiangolo/fastapi,tiangolo/fastapi
:memo: Add tutorial src for python-types
def get_full_name(first_name, last_name): full_name = first_name.title() + " " + last_name.title() return full_name print(get_full_name("john", "doe"))
<commit_before><commit_msg>:memo: Add tutorial src for python-types<commit_after>
def get_full_name(first_name, last_name): full_name = first_name.title() + " " + last_name.title() return full_name print(get_full_name("john", "doe"))
:memo: Add tutorial src for python-typesdef get_full_name(first_name, last_name): full_name = first_name.title() + " " + last_name.title() return full_name print(get_full_name("john", "doe"))
<commit_before><commit_msg>:memo: Add tutorial src for python-types<commit_after>def get_full_name(first_name, last_name): full_name = first_name.title() + " " + last_name.title() return full_name print(get_full_name("john", "doe"))
e59fcfe88dfac788b6dea197d308f4f9216352f9
spotpy/unittests/test_objectivefunctions.py
spotpy/unittests/test_objectivefunctions.py
import unittest from spotpy import objectivefunctions as of import numpy as np #https://docs.python.org/3/library/unittest.html class TestObjectiveFunctions(unittest.TestCase): # How many digits to match in case of floating point answers tolerance = 10 def setUp(self): np.random.seed(42) ...
Add tests for bias and length mismatch
Add tests for bias and length mismatch
Python
mit
thouska/spotpy,bees4ever/spotpy,thouska/spotpy,bees4ever/spotpy,thouska/spotpy,bees4ever/spotpy
Add tests for bias and length mismatch
import unittest from spotpy import objectivefunctions as of import numpy as np #https://docs.python.org/3/library/unittest.html class TestObjectiveFunctions(unittest.TestCase): # How many digits to match in case of floating point answers tolerance = 10 def setUp(self): np.random.seed(42) ...
<commit_before><commit_msg>Add tests for bias and length mismatch<commit_after>
import unittest from spotpy import objectivefunctions as of import numpy as np #https://docs.python.org/3/library/unittest.html class TestObjectiveFunctions(unittest.TestCase): # How many digits to match in case of floating point answers tolerance = 10 def setUp(self): np.random.seed(42) ...
Add tests for bias and length mismatchimport unittest from spotpy import objectivefunctions as of import numpy as np #https://docs.python.org/3/library/unittest.html class TestObjectiveFunctions(unittest.TestCase): # How many digits to match in case of floating point answers tolerance = 10 def setUp(sel...
<commit_before><commit_msg>Add tests for bias and length mismatch<commit_after>import unittest from spotpy import objectivefunctions as of import numpy as np #https://docs.python.org/3/library/unittest.html class TestObjectiveFunctions(unittest.TestCase): # How many digits to match in case of floating point answ...
6b5ab66b7fb3d514c05bf3cf69023b1e119e1797
stock_picking_list/9.0.1.0.0/post-migration.py
stock_picking_list/9.0.1.0.0/post-migration.py
# -*- coding: utf-8 -*- ############################################################################## # # OpenUpgrade module for Odoo # @copyright 2015-Today: Odoo Community Association # @author: Stephane LE CORNEC # # This program is free software: you can redistribute it and/or modify # it under the ...
ADD mig scripts for picking list
ADD mig scripts for picking list
Python
agpl-3.0
ingadhoc/stock
ADD mig scripts for picking list
# -*- coding: utf-8 -*- ############################################################################## # # OpenUpgrade module for Odoo # @copyright 2015-Today: Odoo Community Association # @author: Stephane LE CORNEC # # This program is free software: you can redistribute it and/or modify # it under the ...
<commit_before><commit_msg>ADD mig scripts for picking list<commit_after>
# -*- coding: utf-8 -*- ############################################################################## # # OpenUpgrade module for Odoo # @copyright 2015-Today: Odoo Community Association # @author: Stephane LE CORNEC # # This program is free software: you can redistribute it and/or modify # it under the ...
ADD mig scripts for picking list# -*- coding: utf-8 -*- ############################################################################## # # OpenUpgrade module for Odoo # @copyright 2015-Today: Odoo Community Association # @author: Stephane LE CORNEC # # This program is free software: you can redistribute it ...
<commit_before><commit_msg>ADD mig scripts for picking list<commit_after># -*- coding: utf-8 -*- ############################################################################## # # OpenUpgrade module for Odoo # @copyright 2015-Today: Odoo Community Association # @author: Stephane LE CORNEC # # This program i...
25e6fd9b6a17def2f3a07b83ace1e65e6f1fa40d
test/functional/abc_rpc_buildavalancheproof.py
test/functional/abc_rpc_buildavalancheproof.py
#!/usr/bin/env python3 # Copyright (c) 2021 The Bitcoin developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test the buildavalancheproof RPC""" from test_framework.avatools import create_coinbase_stakes from test_framewo...
Add some test coverage for the buildavalancheproof RPC
[avalanche] Add some test coverage for the buildavalancheproof RPC Summary: The RPC is used everywhere in the tests but is not tested itself. This diff does not intend to extend the safety checks but only check for the existing errors to prevent regressions. Test Plan: ./test/functional/test_runner.py abc_rpc_build...
Python
mit
Bitcoin-ABC/bitcoin-abc,Bitcoin-ABC/bitcoin-abc,Bitcoin-ABC/bitcoin-abc,Bitcoin-ABC/bitcoin-abc,Bitcoin-ABC/bitcoin-abc,Bitcoin-ABC/bitcoin-abc,Bitcoin-ABC/bitcoin-abc,Bitcoin-ABC/bitcoin-abc,Bitcoin-ABC/bitcoin-abc,Bitcoin-ABC/bitcoin-abc,Bitcoin-ABC/bitcoin-abc,Bitcoin-ABC/bitcoin-abc,Bitcoin-ABC/bitcoin-abc
[avalanche] Add some test coverage for the buildavalancheproof RPC Summary: The RPC is used everywhere in the tests but is not tested itself. This diff does not intend to extend the safety checks but only check for the existing errors to prevent regressions. Test Plan: ./test/functional/test_runner.py abc_rpc_build...
#!/usr/bin/env python3 # Copyright (c) 2021 The Bitcoin developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test the buildavalancheproof RPC""" from test_framework.avatools import create_coinbase_stakes from test_framewo...
<commit_before><commit_msg>[avalanche] Add some test coverage for the buildavalancheproof RPC Summary: The RPC is used everywhere in the tests but is not tested itself. This diff does not intend to extend the safety checks but only check for the existing errors to prevent regressions. Test Plan: ./test/functional/t...
#!/usr/bin/env python3 # Copyright (c) 2021 The Bitcoin developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test the buildavalancheproof RPC""" from test_framework.avatools import create_coinbase_stakes from test_framewo...
[avalanche] Add some test coverage for the buildavalancheproof RPC Summary: The RPC is used everywhere in the tests but is not tested itself. This diff does not intend to extend the safety checks but only check for the existing errors to prevent regressions. Test Plan: ./test/functional/test_runner.py abc_rpc_build...
<commit_before><commit_msg>[avalanche] Add some test coverage for the buildavalancheproof RPC Summary: The RPC is used everywhere in the tests but is not tested itself. This diff does not intend to extend the safety checks but only check for the existing errors to prevent regressions. Test Plan: ./test/functional/t...
ede3742ad0dd92d28a2c072b6c700b9ebc6484b9
game/quests/__init__.py
game/quests/__init__.py
# -*- coding: utf-8 -*- """ Quests - questcache.wdb """ from .. import * class Quest(Model): def getTooltip(self): return QuestTooltip(self) class QuestTooltip(Tooltip): def tooltip(self): self.append("name", self.obj.getName(), color=YELLOW) ret = self.values self.values = [] return ret class Q...
Add the quest module and basic Quest, QuestTooltip classes
game/quests: Add the quest module and basic Quest, QuestTooltip classes
Python
cc0-1.0
jleclanche/pywow,jleclanche/pywow,jleclanche/pywow,jleclanche/pywow,jleclanche/pywow,jleclanche/pywow
game/quests: Add the quest module and basic Quest, QuestTooltip classes
# -*- coding: utf-8 -*- """ Quests - questcache.wdb """ from .. import * class Quest(Model): def getTooltip(self): return QuestTooltip(self) class QuestTooltip(Tooltip): def tooltip(self): self.append("name", self.obj.getName(), color=YELLOW) ret = self.values self.values = [] return ret class Q...
<commit_before><commit_msg>game/quests: Add the quest module and basic Quest, QuestTooltip classes<commit_after>
# -*- coding: utf-8 -*- """ Quests - questcache.wdb """ from .. import * class Quest(Model): def getTooltip(self): return QuestTooltip(self) class QuestTooltip(Tooltip): def tooltip(self): self.append("name", self.obj.getName(), color=YELLOW) ret = self.values self.values = [] return ret class Q...
game/quests: Add the quest module and basic Quest, QuestTooltip classes# -*- coding: utf-8 -*- """ Quests - questcache.wdb """ from .. import * class Quest(Model): def getTooltip(self): return QuestTooltip(self) class QuestTooltip(Tooltip): def tooltip(self): self.append("name", self.obj.getName(), color=...
<commit_before><commit_msg>game/quests: Add the quest module and basic Quest, QuestTooltip classes<commit_after># -*- coding: utf-8 -*- """ Quests - questcache.wdb """ from .. import * class Quest(Model): def getTooltip(self): return QuestTooltip(self) class QuestTooltip(Tooltip): def tooltip(self): self....
7ceadc54b271d0534229c2f2feed617e97331671
tests/test_testlevelsplit_output_task_order.py
tests/test_testlevelsplit_output_task_order.py
import shutil import subprocess import sys import tempfile import textwrap import unittest from robot.api import ExecutionResult class PabotTestlevelsplitOutputTaskOrderTest(unittest.TestCase): def setUp(self): self.tmpdir = tempfile.mkdtemp() def tearDown(self): shutil.rmtree...
Create test for testcase order in output.
Create test for testcase order in output.
Python
apache-2.0
mkorpela/pabot,mkorpela/pabot
Create test for testcase order in output.
import shutil import subprocess import sys import tempfile import textwrap import unittest from robot.api import ExecutionResult class PabotTestlevelsplitOutputTaskOrderTest(unittest.TestCase): def setUp(self): self.tmpdir = tempfile.mkdtemp() def tearDown(self): shutil.rmtree...
<commit_before><commit_msg>Create test for testcase order in output.<commit_after>
import shutil import subprocess import sys import tempfile import textwrap import unittest from robot.api import ExecutionResult class PabotTestlevelsplitOutputTaskOrderTest(unittest.TestCase): def setUp(self): self.tmpdir = tempfile.mkdtemp() def tearDown(self): shutil.rmtree...
Create test for testcase order in output.import shutil import subprocess import sys import tempfile import textwrap import unittest from robot.api import ExecutionResult class PabotTestlevelsplitOutputTaskOrderTest(unittest.TestCase): def setUp(self): self.tmpdir = tempfile.mkdtemp() d...
<commit_before><commit_msg>Create test for testcase order in output.<commit_after>import shutil import subprocess import sys import tempfile import textwrap import unittest from robot.api import ExecutionResult class PabotTestlevelsplitOutputTaskOrderTest(unittest.TestCase): def setUp(self): ...
325075d3e6cf85bf8510b6dcc5a29accad5e7bdd
tests/bin/test_anchors.py
tests/bin/test_anchors.py
import keras_retinanet.bin.train import keras_retinanet.bin.evaluate from keras_retinanet.bin.train import get_anchors_params from keras_retinanet.preprocessing.csv_generator import CSVGenerator from keras_retinanet.utils.anchors import anchors_for_shape import warnings def test_csv_generator_anchors(): anchors_d...
Add a script to test the configure of acnhors parameters
Add a script to test the configure of acnhors parameters
Python
apache-2.0
delftrobotics/keras-retinanet
Add a script to test the configure of acnhors parameters
import keras_retinanet.bin.train import keras_retinanet.bin.evaluate from keras_retinanet.bin.train import get_anchors_params from keras_retinanet.preprocessing.csv_generator import CSVGenerator from keras_retinanet.utils.anchors import anchors_for_shape import warnings def test_csv_generator_anchors(): anchors_d...
<commit_before><commit_msg>Add a script to test the configure of acnhors parameters<commit_after>
import keras_retinanet.bin.train import keras_retinanet.bin.evaluate from keras_retinanet.bin.train import get_anchors_params from keras_retinanet.preprocessing.csv_generator import CSVGenerator from keras_retinanet.utils.anchors import anchors_for_shape import warnings def test_csv_generator_anchors(): anchors_d...
Add a script to test the configure of acnhors parametersimport keras_retinanet.bin.train import keras_retinanet.bin.evaluate from keras_retinanet.bin.train import get_anchors_params from keras_retinanet.preprocessing.csv_generator import CSVGenerator from keras_retinanet.utils.anchors import anchors_for_shape import w...
<commit_before><commit_msg>Add a script to test the configure of acnhors parameters<commit_after>import keras_retinanet.bin.train import keras_retinanet.bin.evaluate from keras_retinanet.bin.train import get_anchors_params from keras_retinanet.preprocessing.csv_generator import CSVGenerator from keras_retinanet.utils.a...
73e3ce5d88adc602f340990cb99e81ab3c9b77d9
polyfit_distributions.py
polyfit_distributions.py
import numpy as np def main(): np.random.seed(0) bins = 50 X = np.random.zipf(1.2, 1000) y = np.histogram(X[X<bins], bins, normed=True)[0] fn = np.polyfit(np.arange(bins), y, 3) print(fn) np.random.seed(0) bins = 50 samples = 1000 X = [np.random.zipf(1.2, samples), np...
Build curves for a single zipfian distribution and then 3 combined
Build curves for a single zipfian distribution and then 3 combined
Python
mit
noelevans/sandpit,noelevans/sandpit,noelevans/sandpit,noelevans/sandpit,noelevans/sandpit,noelevans/sandpit
Build curves for a single zipfian distribution and then 3 combined
import numpy as np def main(): np.random.seed(0) bins = 50 X = np.random.zipf(1.2, 1000) y = np.histogram(X[X<bins], bins, normed=True)[0] fn = np.polyfit(np.arange(bins), y, 3) print(fn) np.random.seed(0) bins = 50 samples = 1000 X = [np.random.zipf(1.2, samples), np...
<commit_before><commit_msg>Build curves for a single zipfian distribution and then 3 combined<commit_after>
import numpy as np def main(): np.random.seed(0) bins = 50 X = np.random.zipf(1.2, 1000) y = np.histogram(X[X<bins], bins, normed=True)[0] fn = np.polyfit(np.arange(bins), y, 3) print(fn) np.random.seed(0) bins = 50 samples = 1000 X = [np.random.zipf(1.2, samples), np...
Build curves for a single zipfian distribution and then 3 combinedimport numpy as np def main(): np.random.seed(0) bins = 50 X = np.random.zipf(1.2, 1000) y = np.histogram(X[X<bins], bins, normed=True)[0] fn = np.polyfit(np.arange(bins), y, 3) print(fn) np.random.seed(0) bins = 50 ...
<commit_before><commit_msg>Build curves for a single zipfian distribution and then 3 combined<commit_after>import numpy as np def main(): np.random.seed(0) bins = 50 X = np.random.zipf(1.2, 1000) y = np.histogram(X[X<bins], bins, normed=True)[0] fn = np.polyfit(np.arange(bins), y, 3) print(fn)...
9fac1940891a18688afbc5383ba030599aa55ad3
candidates/management/commands/candidates_remove_last_party_from_versions.py
candidates/management/commands/candidates_remove_last_party_from_versions.py
import sys from candidates.popit import PopItApiMixin, popit_unwrap_pagination from candidates.update import fix_dates from django.core.management.base import BaseCommand from slumber.exceptions import HttpClientError class Command(PopItApiMixin, BaseCommand): def handle(self, **options): for person i...
Add a command to remove bogus 'last_party' from versions
Add a command to remove bogus 'last_party' from versions
Python
agpl-3.0
openstate/yournextrepresentative,neavouli/yournextrepresentative,neavouli/yournextrepresentative,mysociety/yournextrepresentative,DemocracyClub/yournextrepresentative,mysociety/yournextmp-popit,openstate/yournextrepresentative,datamade/yournextmp-popit,openstate/yournextrepresentative,YoQuieroSaber/yournextrepresentati...
Add a command to remove bogus 'last_party' from versions
import sys from candidates.popit import PopItApiMixin, popit_unwrap_pagination from candidates.update import fix_dates from django.core.management.base import BaseCommand from slumber.exceptions import HttpClientError class Command(PopItApiMixin, BaseCommand): def handle(self, **options): for person i...
<commit_before><commit_msg>Add a command to remove bogus 'last_party' from versions<commit_after>
import sys from candidates.popit import PopItApiMixin, popit_unwrap_pagination from candidates.update import fix_dates from django.core.management.base import BaseCommand from slumber.exceptions import HttpClientError class Command(PopItApiMixin, BaseCommand): def handle(self, **options): for person i...
Add a command to remove bogus 'last_party' from versionsimport sys from candidates.popit import PopItApiMixin, popit_unwrap_pagination from candidates.update import fix_dates from django.core.management.base import BaseCommand from slumber.exceptions import HttpClientError class Command(PopItApiMixin, BaseCommand)...
<commit_before><commit_msg>Add a command to remove bogus 'last_party' from versions<commit_after>import sys from candidates.popit import PopItApiMixin, popit_unwrap_pagination from candidates.update import fix_dates from django.core.management.base import BaseCommand from slumber.exceptions import HttpClientError ...
646a6a3acfbe2b2abd5c8360c45041676fdf7b73
display.py
display.py
# -*- coding: utf-8 -*- """This is the display module to show a chess board""" def render_ascii_board(matrix): end_line_template = ' ---------------------------------\n' intermediary_line_template = ' |-------------------------------|\n' file_template = ' a b c d e f g h\n' rank_temp...
Add code to print a chess board in ASCII format.
Add code to print a chess board in ASCII format.
Python
mit
gisraptor/fen-parser
Add code to print a chess board in ASCII format.
# -*- coding: utf-8 -*- """This is the display module to show a chess board""" def render_ascii_board(matrix): end_line_template = ' ---------------------------------\n' intermediary_line_template = ' |-------------------------------|\n' file_template = ' a b c d e f g h\n' rank_temp...
<commit_before><commit_msg>Add code to print a chess board in ASCII format.<commit_after>
# -*- coding: utf-8 -*- """This is the display module to show a chess board""" def render_ascii_board(matrix): end_line_template = ' ---------------------------------\n' intermediary_line_template = ' |-------------------------------|\n' file_template = ' a b c d e f g h\n' rank_temp...
Add code to print a chess board in ASCII format.# -*- coding: utf-8 -*- """This is the display module to show a chess board""" def render_ascii_board(matrix): end_line_template = ' ---------------------------------\n' intermediary_line_template = ' |-------------------------------|\n' file_template = ' ...
<commit_before><commit_msg>Add code to print a chess board in ASCII format.<commit_after># -*- coding: utf-8 -*- """This is the display module to show a chess board""" def render_ascii_board(matrix): end_line_template = ' ---------------------------------\n' intermediary_line_template = ' |------------------...
443ed8e2782faad53f002f74d1aaa032c70915bf
tests/test_libudev.py
tests/test_libudev.py
# -*- coding: utf-8 -*- # Copyright (C) 2011 Sebastian Wiesner <[email protected]> # This library is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by the # Free Software Foundation; either version 2.1 of the License, or (at your #...
Test for presence and signature of wrapped libudev functions
Test for presence and signature of wrapped libudev functions
Python
lgpl-2.1
deepakkapoor624/pyudev,mulkieran/pyudev,deepakkapoor624/pyudev,mulkieran/pyudev,mulkieran/pyudev,pyudev/pyudev
Test for presence and signature of wrapped libudev functions
# -*- coding: utf-8 -*- # Copyright (C) 2011 Sebastian Wiesner <[email protected]> # This library is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by the # Free Software Foundation; either version 2.1 of the License, or (at your #...
<commit_before><commit_msg>Test for presence and signature of wrapped libudev functions<commit_after>
# -*- coding: utf-8 -*- # Copyright (C) 2011 Sebastian Wiesner <[email protected]> # This library is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by the # Free Software Foundation; either version 2.1 of the License, or (at your #...
Test for presence and signature of wrapped libudev functions# -*- coding: utf-8 -*- # Copyright (C) 2011 Sebastian Wiesner <[email protected]> # This library is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by the # Free Software ...
<commit_before><commit_msg>Test for presence and signature of wrapped libudev functions<commit_after># -*- coding: utf-8 -*- # Copyright (C) 2011 Sebastian Wiesner <[email protected]> # This library is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public Lic...
f78d1b549fa4d659ade9fcf03b2d85926eabd29e
lambdaCheckDownload.py
lambdaCheckDownload.py
#!/usr/bin/python import boto3 import datetime import dateutil.relativedelta as rd from botocore.exceptions import ClientError s3 = boto3.client('s3') sns = boto3.client('sns') def keySize(key): try: response = s3.head_object(Bucket='ictrp-data', Key=key) return '{:0.1f}'.format(response['ContentL...
Add a lambda to check on previous downloads
Add a lambda to check on previous downloads
Python
mit
gertvv/ictrp-retrieval,gertvv/ictrp-retrieval
Add a lambda to check on previous downloads
#!/usr/bin/python import boto3 import datetime import dateutil.relativedelta as rd from botocore.exceptions import ClientError s3 = boto3.client('s3') sns = boto3.client('sns') def keySize(key): try: response = s3.head_object(Bucket='ictrp-data', Key=key) return '{:0.1f}'.format(response['ContentL...
<commit_before><commit_msg>Add a lambda to check on previous downloads<commit_after>
#!/usr/bin/python import boto3 import datetime import dateutil.relativedelta as rd from botocore.exceptions import ClientError s3 = boto3.client('s3') sns = boto3.client('sns') def keySize(key): try: response = s3.head_object(Bucket='ictrp-data', Key=key) return '{:0.1f}'.format(response['ContentL...
Add a lambda to check on previous downloads#!/usr/bin/python import boto3 import datetime import dateutil.relativedelta as rd from botocore.exceptions import ClientError s3 = boto3.client('s3') sns = boto3.client('sns') def keySize(key): try: response = s3.head_object(Bucket='ictrp-data', Key=key) ...
<commit_before><commit_msg>Add a lambda to check on previous downloads<commit_after>#!/usr/bin/python import boto3 import datetime import dateutil.relativedelta as rd from botocore.exceptions import ClientError s3 = boto3.client('s3') sns = boto3.client('sns') def keySize(key): try: response = s3.head_obj...
1026256a525a73a404fe195e0a103a007da9ceeb
test/unit/test_bark.py
test/unit/test_bark.py
# :coding: utf-8 # :copyright: Copyright (c) 2013 Martin Pengelly-Phillips # :license: See LICENSE.txt. import pytest import mock import bark def test_default_configure(): '''Test configure helper with no arguments.''' configurators = {'classic': mock.Mock()} with mock.patch.dict( bark.configura...
Add unit tests for configure helper.
Add unit tests for configure helper.
Python
apache-2.0
4degrees/mill,4degrees/sawmill
Add unit tests for configure helper.
# :coding: utf-8 # :copyright: Copyright (c) 2013 Martin Pengelly-Phillips # :license: See LICENSE.txt. import pytest import mock import bark def test_default_configure(): '''Test configure helper with no arguments.''' configurators = {'classic': mock.Mock()} with mock.patch.dict( bark.configura...
<commit_before><commit_msg>Add unit tests for configure helper.<commit_after>
# :coding: utf-8 # :copyright: Copyright (c) 2013 Martin Pengelly-Phillips # :license: See LICENSE.txt. import pytest import mock import bark def test_default_configure(): '''Test configure helper with no arguments.''' configurators = {'classic': mock.Mock()} with mock.patch.dict( bark.configura...
Add unit tests for configure helper.# :coding: utf-8 # :copyright: Copyright (c) 2013 Martin Pengelly-Phillips # :license: See LICENSE.txt. import pytest import mock import bark def test_default_configure(): '''Test configure helper with no arguments.''' configurators = {'classic': mock.Mock()} with moc...
<commit_before><commit_msg>Add unit tests for configure helper.<commit_after># :coding: utf-8 # :copyright: Copyright (c) 2013 Martin Pengelly-Phillips # :license: See LICENSE.txt. import pytest import mock import bark def test_default_configure(): '''Test configure helper with no arguments.''' configurator...
4ad1576aa97fc83d344c50ac4695019ce2e43f61
hordak/migrations/0010_auto_20161216_1202.py
hordak/migrations/0010_auto_20161216_1202.py
# -*- coding: utf-8 -*- # Generated by Django 1.10.4 on 2016-12-16 18:02 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('hordak', '0009_bank_accounts_are_asset_accounts'), ] operations = [ migrati...
Add missing migration for account model
Add missing migration for account model
Python
mit
adamcharnock/django-hordak,adamcharnock/django-hordak,waldocollective/django-hordak
Add missing migration for account model
# -*- coding: utf-8 -*- # Generated by Django 1.10.4 on 2016-12-16 18:02 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('hordak', '0009_bank_accounts_are_asset_accounts'), ] operations = [ migrati...
<commit_before><commit_msg>Add missing migration for account model<commit_after>
# -*- coding: utf-8 -*- # Generated by Django 1.10.4 on 2016-12-16 18:02 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('hordak', '0009_bank_accounts_are_asset_accounts'), ] operations = [ migrati...
Add missing migration for account model# -*- coding: utf-8 -*- # Generated by Django 1.10.4 on 2016-12-16 18:02 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('hordak', '0009_bank_accounts_are_asset_accounts'), ...
<commit_before><commit_msg>Add missing migration for account model<commit_after># -*- coding: utf-8 -*- # Generated by Django 1.10.4 on 2016-12-16 18:02 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('hordak', '00...
c2e861adbb0174747e5ec8a75239f015ff67c244
ideascale/migrations/0010_auto_20150513_1146.py
ideascale/migrations/0010_auto_20150513_1146.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('ideascale', '0009_auto_20150430_0006'), ] operations = [ migrations.RenameModel( old_name='TestingParameters', ...
Modify ideascale connect app data model
Modify ideascale connect app data model
Python
mit
joausaga/social-ideation,rebearteta/social-ideation,rebearteta/social-ideation,rebearteta/social-ideation,joausaga/social-ideation,rebearteta/social-ideation,joausaga/social-ideation,joausaga/social-ideation
Modify ideascale connect app data model
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('ideascale', '0009_auto_20150430_0006'), ] operations = [ migrations.RenameModel( old_name='TestingParameters', ...
<commit_before><commit_msg>Modify ideascale connect app data model<commit_after>
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('ideascale', '0009_auto_20150430_0006'), ] operations = [ migrations.RenameModel( old_name='TestingParameters', ...
Modify ideascale connect app data model# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('ideascale', '0009_auto_20150430_0006'), ] operations = [ migrations.RenameModel( ...
<commit_before><commit_msg>Modify ideascale connect app data model<commit_after># -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('ideascale', '0009_auto_20150430_0006'), ] operations...
43ed3eeacf353404acf77c106aacb143f1c2c2ea
tests/instancing_tests/NonterminalsTest.py
tests/instancing_tests/NonterminalsTest.py
#!/usr/bin/env python """ :Author Patrik Valkovic :Created 31.08.2017 11:55 :Licence GNUv3 Part of grammpy """ from unittest import TestCase, main from grammpy import * from grammpy.exceptions import TreeDeletedException class A(Nonterminal): pass class B(Nonterminal): pass class C(Nonterminal): pass class From(Rul...
Add tests of instancing nonterminals
Add tests of instancing nonterminals
Python
mit
PatrikValkovic/grammpy
Add tests of instancing nonterminals
#!/usr/bin/env python """ :Author Patrik Valkovic :Created 31.08.2017 11:55 :Licence GNUv3 Part of grammpy """ from unittest import TestCase, main from grammpy import * from grammpy.exceptions import TreeDeletedException class A(Nonterminal): pass class B(Nonterminal): pass class C(Nonterminal): pass class From(Rul...
<commit_before><commit_msg>Add tests of instancing nonterminals<commit_after>
#!/usr/bin/env python """ :Author Patrik Valkovic :Created 31.08.2017 11:55 :Licence GNUv3 Part of grammpy """ from unittest import TestCase, main from grammpy import * from grammpy.exceptions import TreeDeletedException class A(Nonterminal): pass class B(Nonterminal): pass class C(Nonterminal): pass class From(Rul...
Add tests of instancing nonterminals#!/usr/bin/env python """ :Author Patrik Valkovic :Created 31.08.2017 11:55 :Licence GNUv3 Part of grammpy """ from unittest import TestCase, main from grammpy import * from grammpy.exceptions import TreeDeletedException class A(Nonterminal): pass class B(Nonterminal): pass class...
<commit_before><commit_msg>Add tests of instancing nonterminals<commit_after>#!/usr/bin/env python """ :Author Patrik Valkovic :Created 31.08.2017 11:55 :Licence GNUv3 Part of grammpy """ from unittest import TestCase, main from grammpy import * from grammpy.exceptions import TreeDeletedException class A(Nontermina...
821fc882ec14d6af626a69d0ac70c3428d39d812
tests/integration/container_create_test.py
tests/integration/container_create_test.py
import pytest import contextlib import os import re from xd.docker.client import * from xd.docker.container import * from xd.docker.parameters import * @pytest.fixture def docker_with_busybox(docker): docker.image_pull("busybox") return docker def test_container_create_1(docker_with_busybox, stdout): w...
Add simple container_create() integration test
client: Add simple container_create() integration test Signed-off-by: Esben Haabendal <[email protected]>
Python
mit
XD-embedded/xd-docker,XD-embedded/xd-docker,esben/xd-docker,esben/xd-docker
client: Add simple container_create() integration test Signed-off-by: Esben Haabendal <[email protected]>
import pytest import contextlib import os import re from xd.docker.client import * from xd.docker.container import * from xd.docker.parameters import * @pytest.fixture def docker_with_busybox(docker): docker.image_pull("busybox") return docker def test_container_create_1(docker_with_busybox, stdout): w...
<commit_before><commit_msg>client: Add simple container_create() integration test Signed-off-by: Esben Haabendal <[email protected]><commit_after>
import pytest import contextlib import os import re from xd.docker.client import * from xd.docker.container import * from xd.docker.parameters import * @pytest.fixture def docker_with_busybox(docker): docker.image_pull("busybox") return docker def test_container_create_1(docker_with_busybox, stdout): w...
client: Add simple container_create() integration test Signed-off-by: Esben Haabendal <[email protected]>import pytest import contextlib import os import re from xd.docker.client import * from xd.docker.container import * from xd.docker.parameters import * @pytest.fixture def doc...
<commit_before><commit_msg>client: Add simple container_create() integration test Signed-off-by: Esben Haabendal <[email protected]><commit_after>import pytest import contextlib import os import re from xd.docker.client import * from xd.docker.container import * from xd.docker.para...
7dc8c40356733042c1c30ad180afb8605aab871d
scripts/submit_build.py
scripts/submit_build.py
#!/usr/bin/python """ Notifies HQ of a new CommCare version. If artifacts are present, the build is considered a J2ME build. Requires an ApiUser (corehq.apps.api.models.ApiUser) on the remote_host with username/password given """ import os import shlex import subprocess from subprocess import PIPE import sys def ...
Copy build post script from commcare-j2me
Copy build post script from commcare-j2me
Python
apache-2.0
dimagi/commcare-core,dimagi/commcare-core,dimagi/commcare,dimagi/commcare-core,dimagi/commcare,dimagi/commcare
Copy build post script from commcare-j2me
#!/usr/bin/python """ Notifies HQ of a new CommCare version. If artifacts are present, the build is considered a J2ME build. Requires an ApiUser (corehq.apps.api.models.ApiUser) on the remote_host with username/password given """ import os import shlex import subprocess from subprocess import PIPE import sys def ...
<commit_before><commit_msg>Copy build post script from commcare-j2me<commit_after>
#!/usr/bin/python """ Notifies HQ of a new CommCare version. If artifacts are present, the build is considered a J2ME build. Requires an ApiUser (corehq.apps.api.models.ApiUser) on the remote_host with username/password given """ import os import shlex import subprocess from subprocess import PIPE import sys def ...
Copy build post script from commcare-j2me#!/usr/bin/python """ Notifies HQ of a new CommCare version. If artifacts are present, the build is considered a J2ME build. Requires an ApiUser (corehq.apps.api.models.ApiUser) on the remote_host with username/password given """ import os import shlex import subprocess from...
<commit_before><commit_msg>Copy build post script from commcare-j2me<commit_after>#!/usr/bin/python """ Notifies HQ of a new CommCare version. If artifacts are present, the build is considered a J2ME build. Requires an ApiUser (corehq.apps.api.models.ApiUser) on the remote_host with username/password given """ impor...
d6f04cb1b9383122e673a4d8d314c2fdc0191608
AndroidGatewayPlugin/Testdriver/Consumer.py
AndroidGatewayPlugin/Testdriver/Consumer.py
import AndroidConnector import uuid import sys import time import datetime import AmmoMessages_pb2 from twisted.internet import reactor def onDataReceived(connector, msg): messageType = AmmoMessages_pb2._MESSAGEWRAPPER_MESSAGETYPE.values_by_number[msg.type].name print messageType, datetime.datetime.now(), if ms...
Add consumer testdriver (subscribes to a topic and prints what it gets)
Add consumer testdriver (subscribes to a topic and prints what it gets)
Python
mit
isis-ammo/ammo-gateway,isis-ammo/ammo-gateway,isis-ammo/ammo-gateway,isis-ammo/ammo-gateway,isis-ammo/ammo-gateway,isis-ammo/ammo-gateway
Add consumer testdriver (subscribes to a topic and prints what it gets)
import AndroidConnector import uuid import sys import time import datetime import AmmoMessages_pb2 from twisted.internet import reactor def onDataReceived(connector, msg): messageType = AmmoMessages_pb2._MESSAGEWRAPPER_MESSAGETYPE.values_by_number[msg.type].name print messageType, datetime.datetime.now(), if ms...
<commit_before><commit_msg>Add consumer testdriver (subscribes to a topic and prints what it gets)<commit_after>
import AndroidConnector import uuid import sys import time import datetime import AmmoMessages_pb2 from twisted.internet import reactor def onDataReceived(connector, msg): messageType = AmmoMessages_pb2._MESSAGEWRAPPER_MESSAGETYPE.values_by_number[msg.type].name print messageType, datetime.datetime.now(), if ms...
Add consumer testdriver (subscribes to a topic and prints what it gets)import AndroidConnector import uuid import sys import time import datetime import AmmoMessages_pb2 from twisted.internet import reactor def onDataReceived(connector, msg): messageType = AmmoMessages_pb2._MESSAGEWRAPPER_MESSAGETYPE.values_by_numb...
<commit_before><commit_msg>Add consumer testdriver (subscribes to a topic and prints what it gets)<commit_after>import AndroidConnector import uuid import sys import time import datetime import AmmoMessages_pb2 from twisted.internet import reactor def onDataReceived(connector, msg): messageType = AmmoMessages_pb2._...
5e60a3ffb8d008e1bc9ed0045ef2a927f8854598
tool/corpus_tools/download_pub_packages.py
tool/corpus_tools/download_pub_packages.py
# Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file # for details. All rights reserved. Use of this source code is governed by a # BSD-style license that can be found in the LICENSE file. import os import re import shutil import subprocess import requests PACKAGE_URL = re.compile(r'http://pu...
Add tool for downloading pub packages
Add tool for downloading pub packages
Python
bsd-3-clause
dart-archive/smart,dart-archive/smart,dart-archive/smart
Add tool for downloading pub packages
# Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file # for details. All rights reserved. Use of this source code is governed by a # BSD-style license that can be found in the LICENSE file. import os import re import shutil import subprocess import requests PACKAGE_URL = re.compile(r'http://pu...
<commit_before><commit_msg>Add tool for downloading pub packages<commit_after>
# Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file # for details. All rights reserved. Use of this source code is governed by a # BSD-style license that can be found in the LICENSE file. import os import re import shutil import subprocess import requests PACKAGE_URL = re.compile(r'http://pu...
Add tool for downloading pub packages# Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file # for details. All rights reserved. Use of this source code is governed by a # BSD-style license that can be found in the LICENSE file. import os import re import shutil import subprocess import requests ...
<commit_before><commit_msg>Add tool for downloading pub packages<commit_after># Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file # for details. All rights reserved. Use of this source code is governed by a # BSD-style license that can be found in the LICENSE file. import os import re import s...
bf957e66274911686631708a88b701735e036227
tests/pytests/integration/ssh/test_state.py
tests/pytests/integration/ssh/test_state.py
import pytest pytestmark = [ pytest.mark.skip_on_windows(reason="salt-ssh not available on Windows"), ] @pytest.fixture(scope="module") def state_tree(base_env_state_tree_root_dir): top_file = """ base: 'localhost': - basic '127.0.0.1': - basic """ map_file = """ {...
Verify salt-ssh can import from map files in states
Verify salt-ssh can import from map files in states
Python
apache-2.0
saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt
Verify salt-ssh can import from map files in states
import pytest pytestmark = [ pytest.mark.skip_on_windows(reason="salt-ssh not available on Windows"), ] @pytest.fixture(scope="module") def state_tree(base_env_state_tree_root_dir): top_file = """ base: 'localhost': - basic '127.0.0.1': - basic """ map_file = """ {...
<commit_before><commit_msg>Verify salt-ssh can import from map files in states<commit_after>
import pytest pytestmark = [ pytest.mark.skip_on_windows(reason="salt-ssh not available on Windows"), ] @pytest.fixture(scope="module") def state_tree(base_env_state_tree_root_dir): top_file = """ base: 'localhost': - basic '127.0.0.1': - basic """ map_file = """ {...
Verify salt-ssh can import from map files in statesimport pytest pytestmark = [ pytest.mark.skip_on_windows(reason="salt-ssh not available on Windows"), ] @pytest.fixture(scope="module") def state_tree(base_env_state_tree_root_dir): top_file = """ base: 'localhost': - basic '127.0.0.1...
<commit_before><commit_msg>Verify salt-ssh can import from map files in states<commit_after>import pytest pytestmark = [ pytest.mark.skip_on_windows(reason="salt-ssh not available on Windows"), ] @pytest.fixture(scope="module") def state_tree(base_env_state_tree_root_dir): top_file = """ base: 'loc...
559fc56211fb85badfe73090be2a8103fe46ba40
genhosts.py
genhosts.py
#!/usr/bin/env python import socket import sys import yaml from boto3.session import Session def genhosts(elbip, sysdomain, outfile=sys.stdout): SYS_PREFIXES = [ 'console', 'uaa', 'apps', 'login'] print >>outfile, "#"*16, "Generated for /etc/hosts by cfawsinit", "#"*16 pr...
Add ability to generate correct hosts file
Add ability to generate correct hosts file
Python
apache-2.0
mandarjog/cfawsinit
Add ability to generate correct hosts file
#!/usr/bin/env python import socket import sys import yaml from boto3.session import Session def genhosts(elbip, sysdomain, outfile=sys.stdout): SYS_PREFIXES = [ 'console', 'uaa', 'apps', 'login'] print >>outfile, "#"*16, "Generated for /etc/hosts by cfawsinit", "#"*16 pr...
<commit_before><commit_msg>Add ability to generate correct hosts file<commit_after>
#!/usr/bin/env python import socket import sys import yaml from boto3.session import Session def genhosts(elbip, sysdomain, outfile=sys.stdout): SYS_PREFIXES = [ 'console', 'uaa', 'apps', 'login'] print >>outfile, "#"*16, "Generated for /etc/hosts by cfawsinit", "#"*16 pr...
Add ability to generate correct hosts file#!/usr/bin/env python import socket import sys import yaml from boto3.session import Session def genhosts(elbip, sysdomain, outfile=sys.stdout): SYS_PREFIXES = [ 'console', 'uaa', 'apps', 'login'] print >>outfile, "#"*16, "Generated fo...
<commit_before><commit_msg>Add ability to generate correct hosts file<commit_after>#!/usr/bin/env python import socket import sys import yaml from boto3.session import Session def genhosts(elbip, sysdomain, outfile=sys.stdout): SYS_PREFIXES = [ 'console', 'uaa', 'apps', 'login'] ...
838f85c604c2c320051aa69838b01ca8b07c7f8b
integration_tests/directory/test_data_source.py
integration_tests/directory/test_data_source.py
from contextlib import closing from minerva.directory import DataSource from minerva.test import with_conn @with_conn() def test_create_data_source(conn): with closing(conn.cursor()) as cursor: data_source = DataSource.create( "TestSource", "short description of data source" )(cursor)...
Add basic DataSource integration test
Add basic DataSource integration test
Python
agpl-3.0
hendrikx-itc/minerva,hendrikx-itc/minerva
Add basic DataSource integration test
from contextlib import closing from minerva.directory import DataSource from minerva.test import with_conn @with_conn() def test_create_data_source(conn): with closing(conn.cursor()) as cursor: data_source = DataSource.create( "TestSource", "short description of data source" )(cursor)...
<commit_before><commit_msg>Add basic DataSource integration test<commit_after>
from contextlib import closing from minerva.directory import DataSource from minerva.test import with_conn @with_conn() def test_create_data_source(conn): with closing(conn.cursor()) as cursor: data_source = DataSource.create( "TestSource", "short description of data source" )(cursor)...
Add basic DataSource integration testfrom contextlib import closing from minerva.directory import DataSource from minerva.test import with_conn @with_conn() def test_create_data_source(conn): with closing(conn.cursor()) as cursor: data_source = DataSource.create( "TestSource", "short descript...
<commit_before><commit_msg>Add basic DataSource integration test<commit_after>from contextlib import closing from minerva.directory import DataSource from minerva.test import with_conn @with_conn() def test_create_data_source(conn): with closing(conn.cursor()) as cursor: data_source = DataSource.create( ...
3d62a8e177cbeaa9acc1ceea57a6781a8180166e
reminder/access_list.py
reminder/access_list.py
from pyramid.security import ( Allow, Everyone ) class RootFactory(object): """ Set up what permissions groups have. """ __acl__ = [ (Allow, 'users', 'view'), (Allow, 'users', 'edit'), (Allow, 'admins', 'admin') ] def __init__(self, request): pass
Access list in seperate module
Access list in seperate module
Python
mit
haydenashton/reminders,haydenashton/reminders
Access list in seperate module
from pyramid.security import ( Allow, Everyone ) class RootFactory(object): """ Set up what permissions groups have. """ __acl__ = [ (Allow, 'users', 'view'), (Allow, 'users', 'edit'), (Allow, 'admins', 'admin') ] def __init__(self, request): pass
<commit_before><commit_msg>Access list in seperate module<commit_after>
from pyramid.security import ( Allow, Everyone ) class RootFactory(object): """ Set up what permissions groups have. """ __acl__ = [ (Allow, 'users', 'view'), (Allow, 'users', 'edit'), (Allow, 'admins', 'admin') ] def __init__(self, request): pass
Access list in seperate modulefrom pyramid.security import ( Allow, Everyone ) class RootFactory(object): """ Set up what permissions groups have. """ __acl__ = [ (Allow, 'users', 'view'), (Allow, 'users', 'edit'), (Allow, 'admins', 'admin') ] def __init__(self,...
<commit_before><commit_msg>Access list in seperate module<commit_after>from pyramid.security import ( Allow, Everyone ) class RootFactory(object): """ Set up what permissions groups have. """ __acl__ = [ (Allow, 'users', 'view'), (Allow, 'users', 'edit'), (Allow, 'admins...
d6a4f3149739ef35bed57c61ebaacfabeb51e46a
etrago/cluster/analyses/objective_function.py
etrago/cluster/analyses/objective_function.py
# -*- coding: utf-8 -*- """ """ from os import path, listdir import matplotlib import pandas as pd results_dir = 'snapshot-clustering-results-k10-noDailyBounds' clustered_path = path.join('/home/simnh/pf_results', results_dir, 'daily') original_path = path.join('/home/simnh/pf_results', results_dir, 'original') netw...
Add code for objective function error
Add code for objective function error
Python
agpl-3.0
openego/eTraGo
Add code for objective function error
# -*- coding: utf-8 -*- """ """ from os import path, listdir import matplotlib import pandas as pd results_dir = 'snapshot-clustering-results-k10-noDailyBounds' clustered_path = path.join('/home/simnh/pf_results', results_dir, 'daily') original_path = path.join('/home/simnh/pf_results', results_dir, 'original') netw...
<commit_before><commit_msg>Add code for objective function error<commit_after>
# -*- coding: utf-8 -*- """ """ from os import path, listdir import matplotlib import pandas as pd results_dir = 'snapshot-clustering-results-k10-noDailyBounds' clustered_path = path.join('/home/simnh/pf_results', results_dir, 'daily') original_path = path.join('/home/simnh/pf_results', results_dir, 'original') netw...
Add code for objective function error# -*- coding: utf-8 -*- """ """ from os import path, listdir import matplotlib import pandas as pd results_dir = 'snapshot-clustering-results-k10-noDailyBounds' clustered_path = path.join('/home/simnh/pf_results', results_dir, 'daily') original_path = path.join('/home/simnh/pf_res...
<commit_before><commit_msg>Add code for objective function error<commit_after># -*- coding: utf-8 -*- """ """ from os import path, listdir import matplotlib import pandas as pd results_dir = 'snapshot-clustering-results-k10-noDailyBounds' clustered_path = path.join('/home/simnh/pf_results', results_dir, 'daily') orig...
6cd6a5dbc81548aa823fb5a8e69041c05c71914e
cabot/cabotapp/tests/test_plugin_settings.py
cabot/cabotapp/tests/test_plugin_settings.py
# -*- coding: utf-8 -*- from django.contrib.auth import get_user_model from django.contrib.auth.models import User from django.shortcuts import resolve_url from django.test import TestCase from mock import patch from cabot.cabotapp.alert import AlertPlugin from cabot.cabotapp.models import Service class PluginSetti...
Add tests for plugin settings and alert tests
Add tests for plugin settings and alert tests
Python
mit
maks-us/cabot,arachnys/cabot,arachnys/cabot,maks-us/cabot,maks-us/cabot,maks-us/cabot,arachnys/cabot,arachnys/cabot
Add tests for plugin settings and alert tests
# -*- coding: utf-8 -*- from django.contrib.auth import get_user_model from django.contrib.auth.models import User from django.shortcuts import resolve_url from django.test import TestCase from mock import patch from cabot.cabotapp.alert import AlertPlugin from cabot.cabotapp.models import Service class PluginSetti...
<commit_before><commit_msg>Add tests for plugin settings and alert tests<commit_after>
# -*- coding: utf-8 -*- from django.contrib.auth import get_user_model from django.contrib.auth.models import User from django.shortcuts import resolve_url from django.test import TestCase from mock import patch from cabot.cabotapp.alert import AlertPlugin from cabot.cabotapp.models import Service class PluginSetti...
Add tests for plugin settings and alert tests# -*- coding: utf-8 -*- from django.contrib.auth import get_user_model from django.contrib.auth.models import User from django.shortcuts import resolve_url from django.test import TestCase from mock import patch from cabot.cabotapp.alert import AlertPlugin from cabot.cabot...
<commit_before><commit_msg>Add tests for plugin settings and alert tests<commit_after># -*- coding: utf-8 -*- from django.contrib.auth import get_user_model from django.contrib.auth.models import User from django.shortcuts import resolve_url from django.test import TestCase from mock import patch from cabot.cabotapp....
235e3933d5a3c0cf4c171af8fb3950d50598c48e
pconsc/scripts/trim2jones.py
pconsc/scripts/trim2jones.py
#!/usr/bin/env python import sys, os infilef = sys.argv[1] infile = open(infilef) for l in infile: if '>' in l: continue upperseq = ''.join([c for c in l if not c.islower()]) upperseq = upperseq.replace('X', '-') sys.stdout.write(upperseq)
Add a3m to jones parser.
Add a3m to jones parser.
Python
mit
ElofssonLab/pcons-fold,MMichel/pcons-fold,ElofssonLab/pcons-fold,MMichel/pcons-fold
Add a3m to jones parser.
#!/usr/bin/env python import sys, os infilef = sys.argv[1] infile = open(infilef) for l in infile: if '>' in l: continue upperseq = ''.join([c for c in l if not c.islower()]) upperseq = upperseq.replace('X', '-') sys.stdout.write(upperseq)
<commit_before><commit_msg>Add a3m to jones parser.<commit_after>
#!/usr/bin/env python import sys, os infilef = sys.argv[1] infile = open(infilef) for l in infile: if '>' in l: continue upperseq = ''.join([c for c in l if not c.islower()]) upperseq = upperseq.replace('X', '-') sys.stdout.write(upperseq)
Add a3m to jones parser.#!/usr/bin/env python import sys, os infilef = sys.argv[1] infile = open(infilef) for l in infile: if '>' in l: continue upperseq = ''.join([c for c in l if not c.islower()]) upperseq = upperseq.replace('X', '-') sys.stdout.write(upperseq)
<commit_before><commit_msg>Add a3m to jones parser.<commit_after>#!/usr/bin/env python import sys, os infilef = sys.argv[1] infile = open(infilef) for l in infile: if '>' in l: continue upperseq = ''.join([c for c in l if not c.islower()]) upperseq = upperseq.replace('X', '-') sys.stdout.writ...
e7a88fd1f896f2bac5e6c6bf1ced57cb4ed689dc
ffdc/plugins/shell_execution.py
ffdc/plugins/shell_execution.py
import subprocess def execute_cmd(parms_string, quiet=False): r""" Run CLI standard tool or scripts. Description of variable: parms_string Command to execute from the current SHELL. quiet do not print tool error message if True """ result = subprocess.run([parms_st...
Add plugin shell execution script
Add plugin shell execution script Change-Id: Ie2444c332e54956c547e74fa71da5a9465c0f8c8 Signed-off-by: George Keishing <[email protected]>
Python
apache-2.0
openbmc/openbmc-test-automation,openbmc/openbmc-test-automation
Add plugin shell execution script Change-Id: Ie2444c332e54956c547e74fa71da5a9465c0f8c8 Signed-off-by: George Keishing <[email protected]>
import subprocess def execute_cmd(parms_string, quiet=False): r""" Run CLI standard tool or scripts. Description of variable: parms_string Command to execute from the current SHELL. quiet do not print tool error message if True """ result = subprocess.run([parms_st...
<commit_before><commit_msg>Add plugin shell execution script Change-Id: Ie2444c332e54956c547e74fa71da5a9465c0f8c8 Signed-off-by: George Keishing <[email protected]><commit_after>
import subprocess def execute_cmd(parms_string, quiet=False): r""" Run CLI standard tool or scripts. Description of variable: parms_string Command to execute from the current SHELL. quiet do not print tool error message if True """ result = subprocess.run([parms_st...
Add plugin shell execution script Change-Id: Ie2444c332e54956c547e74fa71da5a9465c0f8c8 Signed-off-by: George Keishing <[email protected]>import subprocess def execute_cmd(parms_string, quiet=False): r""" Run CLI standard tool or scripts. Description of variable: par...
<commit_before><commit_msg>Add plugin shell execution script Change-Id: Ie2444c332e54956c547e74fa71da5a9465c0f8c8 Signed-off-by: George Keishing <[email protected]><commit_after>import subprocess def execute_cmd(parms_string, quiet=False): r""" Run CLI standard tool or scrip...
408bf25432fd7c9b355bc549f18f552d89a02a43
pymc/examples/hierarchical_sqlite.py
pymc/examples/hierarchical_sqlite.py
if __name__ == '__main__': # Avoid loading during tests. import pymc as pm import pymc.examples.hierarchical as hier with hier.model: trace = pm.sample(3000, hier.step, hier.start, trace='sqlite')
Add SQLite backend example for hierarchical.py
Add SQLite backend example for hierarchical.py
Python
apache-2.0
kyleam/pymc3,tyarkoni/pymc3,evidation-health/pymc3,jameshensman/pymc3,superbobry/pymc3,LoLab-VU/pymc,CVML/pymc3,hothHowler/pymc3,wanderer2/pymc3,clk8908/pymc3,LoLab-VU/pymc,MCGallaspy/pymc3,hothHowler/pymc3,MichielCottaar/pymc3,CVML/pymc3,Anjum48/pymc3,superbobry/pymc3,Anjum48/pymc3,arunlodhi/pymc3,evidation-health/pym...
Add SQLite backend example for hierarchical.py
if __name__ == '__main__': # Avoid loading during tests. import pymc as pm import pymc.examples.hierarchical as hier with hier.model: trace = pm.sample(3000, hier.step, hier.start, trace='sqlite')
<commit_before><commit_msg>Add SQLite backend example for hierarchical.py<commit_after>
if __name__ == '__main__': # Avoid loading during tests. import pymc as pm import pymc.examples.hierarchical as hier with hier.model: trace = pm.sample(3000, hier.step, hier.start, trace='sqlite')
Add SQLite backend example for hierarchical.pyif __name__ == '__main__': # Avoid loading during tests. import pymc as pm import pymc.examples.hierarchical as hier with hier.model: trace = pm.sample(3000, hier.step, hier.start, trace='sqlite')
<commit_before><commit_msg>Add SQLite backend example for hierarchical.py<commit_after>if __name__ == '__main__': # Avoid loading during tests. import pymc as pm import pymc.examples.hierarchical as hier with hier.model: trace = pm.sample(3000, hier.step, hier.start, trace='sqlite')
8454e45f9964438bb1c3df3b398d32fe3c0f9d6c
block/migrations/0015_auto_20161024_1405.py
block/migrations/0015_auto_20161024_1405.py
# -*- coding: utf-8 -*- # Generated by Django 1.10.1 on 2016-10-24 13:05 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('block', '0014_auto_20161014_1630'), ] operations = [ migrations.AlterField(...
Make migrations for footer field type change
Make migrations for footer field type change
Python
apache-2.0
pkimber/block,pkimber/block,pkimber/block
Make migrations for footer field type change
# -*- coding: utf-8 -*- # Generated by Django 1.10.1 on 2016-10-24 13:05 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('block', '0014_auto_20161014_1630'), ] operations = [ migrations.AlterField(...
<commit_before><commit_msg>Make migrations for footer field type change<commit_after>
# -*- coding: utf-8 -*- # Generated by Django 1.10.1 on 2016-10-24 13:05 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('block', '0014_auto_20161014_1630'), ] operations = [ migrations.AlterField(...
Make migrations for footer field type change# -*- coding: utf-8 -*- # Generated by Django 1.10.1 on 2016-10-24 13:05 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('block', '0014_auto_20161014_1630'), ] o...
<commit_before><commit_msg>Make migrations for footer field type change<commit_after># -*- coding: utf-8 -*- # Generated by Django 1.10.1 on 2016-10-24 13:05 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('block',...
bb20687fb26daece194aa90f52ce87a87668d040
openkamer/management/commands/clean_dossiers.py
openkamer/management/commands/clean_dossiers.py
import logging from django.core.management.base import BaseCommand from document.models import Dossier logger = logging.getLogger(__name__) class Command(BaseCommand): def handle(self, *args, **options): dossier_ids = Dossier.get_dossier_ids() if len(dossier_ids) < 1500: logger.err...
Create command to clean non-wetsvoorstel dossiers
Create command to clean non-wetsvoorstel dossiers
Python
mit
openkamer/openkamer,openkamer/openkamer,openkamer/openkamer,openkamer/openkamer
Create command to clean non-wetsvoorstel dossiers
import logging from django.core.management.base import BaseCommand from document.models import Dossier logger = logging.getLogger(__name__) class Command(BaseCommand): def handle(self, *args, **options): dossier_ids = Dossier.get_dossier_ids() if len(dossier_ids) < 1500: logger.err...
<commit_before><commit_msg>Create command to clean non-wetsvoorstel dossiers<commit_after>
import logging from django.core.management.base import BaseCommand from document.models import Dossier logger = logging.getLogger(__name__) class Command(BaseCommand): def handle(self, *args, **options): dossier_ids = Dossier.get_dossier_ids() if len(dossier_ids) < 1500: logger.err...
Create command to clean non-wetsvoorstel dossiersimport logging from django.core.management.base import BaseCommand from document.models import Dossier logger = logging.getLogger(__name__) class Command(BaseCommand): def handle(self, *args, **options): dossier_ids = Dossier.get_dossier_ids() i...
<commit_before><commit_msg>Create command to clean non-wetsvoorstel dossiers<commit_after>import logging from django.core.management.base import BaseCommand from document.models import Dossier logger = logging.getLogger(__name__) class Command(BaseCommand): def handle(self, *args, **options): dossier_...
5673ced05395c08292df76ceebb4b4b8b876d0a9
markers/mark_error_2.py
markers/mark_error_2.py
"""Marks all fixed errors #2 on ruwiki's CheckWikipedia.""" import re import pywikibot from checkwiki import load_page_list, mark_error_done, log NUMBER = "2" REGEXP = r""" <\s*/?\s*abbr\s*/\s*>| <\s*/?\s*b\s*/\s*>| <\s*/?\s*big\s*/\s*>| <\s*/?\s*blockquote\s*/\s*>| <\s*/?\s*center\s*/\s*>| <\s...
Add marker for 2nd error
Add marker for 2nd error
Python
mit
Facenapalm/NapalmBot
Add marker for 2nd error
"""Marks all fixed errors #2 on ruwiki's CheckWikipedia.""" import re import pywikibot from checkwiki import load_page_list, mark_error_done, log NUMBER = "2" REGEXP = r""" <\s*/?\s*abbr\s*/\s*>| <\s*/?\s*b\s*/\s*>| <\s*/?\s*big\s*/\s*>| <\s*/?\s*blockquote\s*/\s*>| <\s*/?\s*center\s*/\s*>| <\s...
<commit_before><commit_msg>Add marker for 2nd error<commit_after>
"""Marks all fixed errors #2 on ruwiki's CheckWikipedia.""" import re import pywikibot from checkwiki import load_page_list, mark_error_done, log NUMBER = "2" REGEXP = r""" <\s*/?\s*abbr\s*/\s*>| <\s*/?\s*b\s*/\s*>| <\s*/?\s*big\s*/\s*>| <\s*/?\s*blockquote\s*/\s*>| <\s*/?\s*center\s*/\s*>| <\s...
Add marker for 2nd error"""Marks all fixed errors #2 on ruwiki's CheckWikipedia.""" import re import pywikibot from checkwiki import load_page_list, mark_error_done, log NUMBER = "2" REGEXP = r""" <\s*/?\s*abbr\s*/\s*>| <\s*/?\s*b\s*/\s*>| <\s*/?\s*big\s*/\s*>| <\s*/?\s*blockquote\s*/\s*>| <\s*/?\s...
<commit_before><commit_msg>Add marker for 2nd error<commit_after>"""Marks all fixed errors #2 on ruwiki's CheckWikipedia.""" import re import pywikibot from checkwiki import load_page_list, mark_error_done, log NUMBER = "2" REGEXP = r""" <\s*/?\s*abbr\s*/\s*>| <\s*/?\s*b\s*/\s*>| <\s*/?\s*big\s*/\s*>| ...
15f77deefdd76ec31dd012fe404b85378eb6d785
feature-reduction.py
feature-reduction.py
# Reduce the dimension of the feature vector. # This script works with tf-idf.csv (produced by tf-idf.py), # where each document is represented with 5 most important features. # The task of this script: # leave only the features that are mentioned at least once. # Renumber them as 1, 2, 3, 4 etc. INPUT_FILE =...
Add utility functions to parse and to compose the document
Add utility functions to parse and to compose the document
Python
mit
artem-erofeev/kaggle-lshtc,artem-erofeev/kaggle-lshtc
Add utility functions to parse and to compose the document
# Reduce the dimension of the feature vector. # This script works with tf-idf.csv (produced by tf-idf.py), # where each document is represented with 5 most important features. # The task of this script: # leave only the features that are mentioned at least once. # Renumber them as 1, 2, 3, 4 etc. INPUT_FILE =...
<commit_before><commit_msg>Add utility functions to parse and to compose the document<commit_after>
# Reduce the dimension of the feature vector. # This script works with tf-idf.csv (produced by tf-idf.py), # where each document is represented with 5 most important features. # The task of this script: # leave only the features that are mentioned at least once. # Renumber them as 1, 2, 3, 4 etc. INPUT_FILE =...
Add utility functions to parse and to compose the document# Reduce the dimension of the feature vector. # This script works with tf-idf.csv (produced by tf-idf.py), # where each document is represented with 5 most important features. # The task of this script: # leave only the features that are mentioned at least...
<commit_before><commit_msg>Add utility functions to parse and to compose the document<commit_after># Reduce the dimension of the feature vector. # This script works with tf-idf.csv (produced by tf-idf.py), # where each document is represented with 5 most important features. # The task of this script: # leave only...
3a074a43f6e979854de3e2f80dfc5dd733b7d64c
double_link_list.py
double_link_list.py
from __future__ import unicode_literals class Node(object): def __init__(self, val, prev=None, next_=None): self.val = val self.prev = prev self.next = next_ def __repr__(self): """Print representation of node.""" return "{val}".format(val=self.val) class DoubleLink...
Add first pass for double link list
Add first pass for double link list
Python
mit
jonathanstallings/data-structures,jay-tyler/data-structures
Add first pass for double link list
from __future__ import unicode_literals class Node(object): def __init__(self, val, prev=None, next_=None): self.val = val self.prev = prev self.next = next_ def __repr__(self): """Print representation of node.""" return "{val}".format(val=self.val) class DoubleLink...
<commit_before><commit_msg>Add first pass for double link list<commit_after>
from __future__ import unicode_literals class Node(object): def __init__(self, val, prev=None, next_=None): self.val = val self.prev = prev self.next = next_ def __repr__(self): """Print representation of node.""" return "{val}".format(val=self.val) class DoubleLink...
Add first pass for double link listfrom __future__ import unicode_literals class Node(object): def __init__(self, val, prev=None, next_=None): self.val = val self.prev = prev self.next = next_ def __repr__(self): """Print representation of node.""" return "{val}".form...
<commit_before><commit_msg>Add first pass for double link list<commit_after>from __future__ import unicode_literals class Node(object): def __init__(self, val, prev=None, next_=None): self.val = val self.prev = prev self.next = next_ def __repr__(self): """Print representatio...
c37ae9178f2f6616b6d03577d6e8129a5bb371fd
src/install_services.py
src/install_services.py
#!/usr/bin/env python3 import os import socket def install_pyjob_run(): print('installing pyjob_run') os.system('stop pyjob_run 2>&1 > /dev/null') os.system('cp -f ./pyjob_run.conf /etc/init/') os.system('start pyjob_run 2>&1 > /dev/null &') def install_pyjob_server(): print('installing pyjob_s...
Add python script that installs services
Add python script that installs services
Python
mit
lnls-fac/job_manager
Add python script that installs services
#!/usr/bin/env python3 import os import socket def install_pyjob_run(): print('installing pyjob_run') os.system('stop pyjob_run 2>&1 > /dev/null') os.system('cp -f ./pyjob_run.conf /etc/init/') os.system('start pyjob_run 2>&1 > /dev/null &') def install_pyjob_server(): print('installing pyjob_s...
<commit_before><commit_msg>Add python script that installs services<commit_after>
#!/usr/bin/env python3 import os import socket def install_pyjob_run(): print('installing pyjob_run') os.system('stop pyjob_run 2>&1 > /dev/null') os.system('cp -f ./pyjob_run.conf /etc/init/') os.system('start pyjob_run 2>&1 > /dev/null &') def install_pyjob_server(): print('installing pyjob_s...
Add python script that installs services#!/usr/bin/env python3 import os import socket def install_pyjob_run(): print('installing pyjob_run') os.system('stop pyjob_run 2>&1 > /dev/null') os.system('cp -f ./pyjob_run.conf /etc/init/') os.system('start pyjob_run 2>&1 > /dev/null &') def install_pyjob...
<commit_before><commit_msg>Add python script that installs services<commit_after>#!/usr/bin/env python3 import os import socket def install_pyjob_run(): print('installing pyjob_run') os.system('stop pyjob_run 2>&1 > /dev/null') os.system('cp -f ./pyjob_run.conf /etc/init/') os.system('start pyjob_run...
76f79ddf1d796306551d316d032ab4e4075e6647
localore/home/migrations/0016_homepage_site_intro.py
localore/home/migrations/0016_homepage_site_intro.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models import wagtail.wagtailcore.fields class Migration(migrations.Migration): dependencies = [ ('home', '0015_auto_20160402_1209'), ] operations = [ migrations.AddField( model...
Add missed migration for daaab63
Add missed migration for daaab63
Python
mpl-2.0
ghostwords/localore,ghostwords/localore,ghostwords/localore
Add missed migration for daaab63
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models import wagtail.wagtailcore.fields class Migration(migrations.Migration): dependencies = [ ('home', '0015_auto_20160402_1209'), ] operations = [ migrations.AddField( model...
<commit_before><commit_msg>Add missed migration for daaab63<commit_after>
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models import wagtail.wagtailcore.fields class Migration(migrations.Migration): dependencies = [ ('home', '0015_auto_20160402_1209'), ] operations = [ migrations.AddField( model...
Add missed migration for daaab63# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models import wagtail.wagtailcore.fields class Migration(migrations.Migration): dependencies = [ ('home', '0015_auto_20160402_1209'), ] operations = [ migrat...
<commit_before><commit_msg>Add missed migration for daaab63<commit_after># -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models import wagtail.wagtailcore.fields class Migration(migrations.Migration): dependencies = [ ('home', '0015_auto_20160402_1209'),...
b4cb2758b76633856e2fd701a9469447b75192fc
lowfat/migrations/0120_auto_20180206_1505.py
lowfat/migrations/0120_auto_20180206_1505.py
# -*- coding: utf-8 -*- # Generated by Django 1.11 on 2018-02-06 15:05 from __future__ import unicode_literals import datetime from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('lowfat', '0119_auto_20171214_0722'), ] operations = [ migrati...
Add migration for default year
Add migration for default year
Python
bsd-3-clause
softwaresaved/fat,softwaresaved/fat,softwaresaved/fat,softwaresaved/fat
Add migration for default year
# -*- coding: utf-8 -*- # Generated by Django 1.11 on 2018-02-06 15:05 from __future__ import unicode_literals import datetime from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('lowfat', '0119_auto_20171214_0722'), ] operations = [ migrati...
<commit_before><commit_msg>Add migration for default year<commit_after>
# -*- coding: utf-8 -*- # Generated by Django 1.11 on 2018-02-06 15:05 from __future__ import unicode_literals import datetime from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('lowfat', '0119_auto_20171214_0722'), ] operations = [ migrati...
Add migration for default year# -*- coding: utf-8 -*- # Generated by Django 1.11 on 2018-02-06 15:05 from __future__ import unicode_literals import datetime from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('lowfat', '0119_auto_20171214_0722'), ] ...
<commit_before><commit_msg>Add migration for default year<commit_after># -*- coding: utf-8 -*- # Generated by Django 1.11 on 2018-02-06 15:05 from __future__ import unicode_literals import datetime from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('lowfat'...
f5594907ed2b99c88ad0cb6bf66d1f2c46770e78
eventkit_cloud/jobs/migrations/add_permissions_to_existing_jobs.py
eventkit_cloud/jobs/migrations/add_permissions_to_existing_jobs.py
# https://docs.djangoproject.com/en/dev/howto/writing-migrations/#migrations-that-add-unique-fields from django.db import migrations from django.contrib.auth.models import Group, User from ..models import Job def add_permissions(apps, schema_editor): JobPermission = apps.get_model("core", "JobPermission") ...
Add permissions for existing jobs via migration
Add permissions for existing jobs via migration
Python
bsd-3-clause
venicegeo/eventkit-cloud,venicegeo/eventkit-cloud,venicegeo/eventkit-cloud,terranodo/eventkit-cloud,terranodo/eventkit-cloud,terranodo/eventkit-cloud,venicegeo/eventkit-cloud,venicegeo/eventkit-cloud,venicegeo/eventkit-cloud,terranodo/eventkit-cloud
Add permissions for existing jobs via migration
# https://docs.djangoproject.com/en/dev/howto/writing-migrations/#migrations-that-add-unique-fields from django.db import migrations from django.contrib.auth.models import Group, User from ..models import Job def add_permissions(apps, schema_editor): JobPermission = apps.get_model("core", "JobPermission") ...
<commit_before><commit_msg>Add permissions for existing jobs via migration<commit_after>
# https://docs.djangoproject.com/en/dev/howto/writing-migrations/#migrations-that-add-unique-fields from django.db import migrations from django.contrib.auth.models import Group, User from ..models import Job def add_permissions(apps, schema_editor): JobPermission = apps.get_model("core", "JobPermission") ...
Add permissions for existing jobs via migration# https://docs.djangoproject.com/en/dev/howto/writing-migrations/#migrations-that-add-unique-fields from django.db import migrations from django.contrib.auth.models import Group, User from ..models import Job def add_permissions(apps, schema_editor): JobPermissio...
<commit_before><commit_msg>Add permissions for existing jobs via migration<commit_after># https://docs.djangoproject.com/en/dev/howto/writing-migrations/#migrations-that-add-unique-fields from django.db import migrations from django.contrib.auth.models import Group, User from ..models import Job def add_permissio...
a27c14bb4854a8a6be78da8020b64cb60f271b0a
tests/rules_tests/FromLeftRightToRulesTest.py
tests/rules_tests/FromLeftRightToRulesTest.py
#!/usr/bin/env python """ :Author Patrik Valkovic :Created 23.06.2017 16:39 :Licence GNUv3 Part of grammpy """ from unittest import main, TestCase from grammpy import Rule class FromLeftRIghtToRulesTest(TestCase): pass if __name__ == '__main__': main()
Add file for rule's left right tests
Add file for rule's left right tests
Python
mit
PatrikValkovic/grammpy
Add file for rule's left right tests
#!/usr/bin/env python """ :Author Patrik Valkovic :Created 23.06.2017 16:39 :Licence GNUv3 Part of grammpy """ from unittest import main, TestCase from grammpy import Rule class FromLeftRIghtToRulesTest(TestCase): pass if __name__ == '__main__': main()
<commit_before><commit_msg>Add file for rule's left right tests<commit_after>
#!/usr/bin/env python """ :Author Patrik Valkovic :Created 23.06.2017 16:39 :Licence GNUv3 Part of grammpy """ from unittest import main, TestCase from grammpy import Rule class FromLeftRIghtToRulesTest(TestCase): pass if __name__ == '__main__': main()
Add file for rule's left right tests#!/usr/bin/env python """ :Author Patrik Valkovic :Created 23.06.2017 16:39 :Licence GNUv3 Part of grammpy """ from unittest import main, TestCase from grammpy import Rule class FromLeftRIghtToRulesTest(TestCase): pass if __name__ == '__main__': main()
<commit_before><commit_msg>Add file for rule's left right tests<commit_after>#!/usr/bin/env python """ :Author Patrik Valkovic :Created 23.06.2017 16:39 :Licence GNUv3 Part of grammpy """ from unittest import main, TestCase from grammpy import Rule class FromLeftRIghtToRulesTest(TestCase): pass if __name__ ==...
625d1b51bd83687eb8928647e4fc9b582d8607c3
instance/migrations/0013_auto_20150805_1309.py
instance/migrations/0013_auto_20150805_1309.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import django.core.validators class Migration(migrations.Migration): dependencies = [ ('instance', '0012_auto_20150803_0606'), ] operations = [ migrations.AlterField( mod...
Add missing migration to instance & server objects validation
Add missing migration to instance & server objects validation
Python
agpl-3.0
open-craft/opencraft,omarkhan/opencraft,omarkhan/opencraft,open-craft/opencraft,omarkhan/opencraft,open-craft/opencraft,brousch/opencraft,brousch/opencraft,open-craft/opencraft,omarkhan/opencraft,brousch/opencraft,open-craft/opencraft
Add missing migration to instance & server objects validation
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import django.core.validators class Migration(migrations.Migration): dependencies = [ ('instance', '0012_auto_20150803_0606'), ] operations = [ migrations.AlterField( mod...
<commit_before><commit_msg>Add missing migration to instance & server objects validation<commit_after>
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import django.core.validators class Migration(migrations.Migration): dependencies = [ ('instance', '0012_auto_20150803_0606'), ] operations = [ migrations.AlterField( mod...
Add missing migration to instance & server objects validation# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import django.core.validators class Migration(migrations.Migration): dependencies = [ ('instance', '0012_auto_20150803_0606'), ] ...
<commit_before><commit_msg>Add missing migration to instance & server objects validation<commit_after># -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import django.core.validators class Migration(migrations.Migration): dependencies = [ ('instance'...
c888400860baa3a26260fa81ecc8b415aeb6885d
source/excerptexport/tests/test_downloads.py
source/excerptexport/tests/test_downloads.py
import os from django.test import TestCase from django.core.urlresolvers import reverse from django.core.files import File from django.contrib.auth.models import User from excerptexport.models import OutputFile, Excerpt, ExtractionOrder from excerptexport import settings class DownloadsTestCase(TestCase): def...
Add test for file download
Add test for file download
Python
mit
geometalab/osmaxx-frontend,geometalab/osmaxx,geometalab/osmaxx-frontend,geometalab/osmaxx-frontend,geometalab/osmaxx,geometalab/osmaxx,geometalab/osmaxx-frontend,geometalab/drf-utm-zone-info,geometalab/osmaxx,geometalab/drf-utm-zone-info
Add test for file download
import os from django.test import TestCase from django.core.urlresolvers import reverse from django.core.files import File from django.contrib.auth.models import User from excerptexport.models import OutputFile, Excerpt, ExtractionOrder from excerptexport import settings class DownloadsTestCase(TestCase): def...
<commit_before><commit_msg>Add test for file download<commit_after>
import os from django.test import TestCase from django.core.urlresolvers import reverse from django.core.files import File from django.contrib.auth.models import User from excerptexport.models import OutputFile, Excerpt, ExtractionOrder from excerptexport import settings class DownloadsTestCase(TestCase): def...
Add test for file downloadimport os from django.test import TestCase from django.core.urlresolvers import reverse from django.core.files import File from django.contrib.auth.models import User from excerptexport.models import OutputFile, Excerpt, ExtractionOrder from excerptexport import settings class DownloadsT...
<commit_before><commit_msg>Add test for file download<commit_after>import os from django.test import TestCase from django.core.urlresolvers import reverse from django.core.files import File from django.contrib.auth.models import User from excerptexport.models import OutputFile, Excerpt, ExtractionOrder from excerpt...
f028e7638b02fad40561a2eca28d2bcfea34d064
numba/tests/test_fastmath.py
numba/tests/test_fastmath.py
from __future__ import print_function, absolute_import import math import numpy as np from numba import unittest_support as unittest from numba.tests.support import captured_stdout, override_config from numba import njit, vectorize, guvectorize class TestFastMath(unittest.TestCase): def test_jit(self): ...
Add test cases for fastmath flag
Add test cases for fastmath flag
Python
bsd-2-clause
cpcloud/numba,jriehl/numba,seibert/numba,stuartarchibald/numba,IntelLabs/numba,stuartarchibald/numba,numba/numba,gmarkall/numba,sklam/numba,stonebig/numba,cpcloud/numba,cpcloud/numba,sklam/numba,seibert/numba,seibert/numba,IntelLabs/numba,IntelLabs/numba,IntelLabs/numba,stonebig/numba,stuartarchibald/numba,jriehl/numba...
Add test cases for fastmath flag
from __future__ import print_function, absolute_import import math import numpy as np from numba import unittest_support as unittest from numba.tests.support import captured_stdout, override_config from numba import njit, vectorize, guvectorize class TestFastMath(unittest.TestCase): def test_jit(self): ...
<commit_before><commit_msg>Add test cases for fastmath flag<commit_after>
from __future__ import print_function, absolute_import import math import numpy as np from numba import unittest_support as unittest from numba.tests.support import captured_stdout, override_config from numba import njit, vectorize, guvectorize class TestFastMath(unittest.TestCase): def test_jit(self): ...
Add test cases for fastmath flagfrom __future__ import print_function, absolute_import import math import numpy as np from numba import unittest_support as unittest from numba.tests.support import captured_stdout, override_config from numba import njit, vectorize, guvectorize class TestFastMath(unittest.TestCase): ...
<commit_before><commit_msg>Add test cases for fastmath flag<commit_after>from __future__ import print_function, absolute_import import math import numpy as np from numba import unittest_support as unittest from numba.tests.support import captured_stdout, override_config from numba import njit, vectorize, guvectorize ...
edc482e33236ad775d6cb7c941ef02575db36f4c
factorial_variations.py
factorial_variations.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Program s několika variacemi implementace funkce faktorial. http://www.pythontutor.com/visualize.html#mode=edit """ def factorial_iter(n): if n == 0: return 1 result = 1 while n >= 1: result = result * n n = n - 1 return result def factorial_iter_opt(n)...
Create a new lesson file
Create a new lesson file
Python
mit
holkasepsem/python-lessons
Create a new lesson file
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Program s několika variacemi implementace funkce faktorial. http://www.pythontutor.com/visualize.html#mode=edit """ def factorial_iter(n): if n == 0: return 1 result = 1 while n >= 1: result = result * n n = n - 1 return result def factorial_iter_opt(n)...
<commit_before><commit_msg>Create a new lesson file<commit_after>
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Program s několika variacemi implementace funkce faktorial. http://www.pythontutor.com/visualize.html#mode=edit """ def factorial_iter(n): if n == 0: return 1 result = 1 while n >= 1: result = result * n n = n - 1 return result def factorial_iter_opt(n)...
Create a new lesson file#!/usr/bin/env python # -*- coding: utf-8 -*- """ Program s několika variacemi implementace funkce faktorial. http://www.pythontutor.com/visualize.html#mode=edit """ def factorial_iter(n): if n == 0: return 1 result = 1 while n >= 1: result = result * n n = n - 1 return result d...
<commit_before><commit_msg>Create a new lesson file<commit_after>#!/usr/bin/env python # -*- coding: utf-8 -*- """ Program s několika variacemi implementace funkce faktorial. http://www.pythontutor.com/visualize.html#mode=edit """ def factorial_iter(n): if n == 0: return 1 result = 1 while n >= 1: result = r...
e4043f88c77d5aff1962c73f126176f1328f0c27
python-files/generate-allpasses.py
python-files/generate-allpasses.py
#!/usr/bin/env python3 from itertools import product import pickle import sys import time from schedulingbazaar import (load_tles, load_gs, compute_all_passes, load_all_passes) sats = load_tles('amateur.txt') stations = load_g...
Add a utility to generate the master passes db
Add a utility to generate the master passes db Assumes that amateur.txt and groundstations.txt are in the same folder.
Python
agpl-3.0
valpo-sats/scheduling-bazaar,valpo-sats/scheduling-bazaar
Add a utility to generate the master passes db Assumes that amateur.txt and groundstations.txt are in the same folder.
#!/usr/bin/env python3 from itertools import product import pickle import sys import time from schedulingbazaar import (load_tles, load_gs, compute_all_passes, load_all_passes) sats = load_tles('amateur.txt') stations = load_g...
<commit_before><commit_msg>Add a utility to generate the master passes db Assumes that amateur.txt and groundstations.txt are in the same folder.<commit_after>
#!/usr/bin/env python3 from itertools import product import pickle import sys import time from schedulingbazaar import (load_tles, load_gs, compute_all_passes, load_all_passes) sats = load_tles('amateur.txt') stations = load_g...
Add a utility to generate the master passes db Assumes that amateur.txt and groundstations.txt are in the same folder.#!/usr/bin/env python3 from itertools import product import pickle import sys import time from schedulingbazaar import (load_tles, load_gs, ...
<commit_before><commit_msg>Add a utility to generate the master passes db Assumes that amateur.txt and groundstations.txt are in the same folder.<commit_after>#!/usr/bin/env python3 from itertools import product import pickle import sys import time from schedulingbazaar import (load_tles, ...
624f771e79d36cd013b2372feafc6d4dff37da39
edgedb/lang/common/datastructures/tests/test_all.py
edgedb/lang/common/datastructures/tests/test_all.py
## # Copyright (c) 2011 Sprymix Inc. # All rights reserved. # # See LICENSE for details. ## import pickle from semantix.utils.datastructures import Void from semantix.utils.debug import assert_raises class TestUtilsDSAll: def test_utils_ds_markers_pickle(self): assert pickle.loads(pickle.dumps(Void)) i...
Add pickle unittests for Markers
utils.datastructures.tests: Add pickle unittests for Markers
Python
apache-2.0
edgedb/edgedb,edgedb/edgedb,edgedb/edgedb
utils.datastructures.tests: Add pickle unittests for Markers
## # Copyright (c) 2011 Sprymix Inc. # All rights reserved. # # See LICENSE for details. ## import pickle from semantix.utils.datastructures import Void from semantix.utils.debug import assert_raises class TestUtilsDSAll: def test_utils_ds_markers_pickle(self): assert pickle.loads(pickle.dumps(Void)) i...
<commit_before><commit_msg>utils.datastructures.tests: Add pickle unittests for Markers<commit_after>
## # Copyright (c) 2011 Sprymix Inc. # All rights reserved. # # See LICENSE for details. ## import pickle from semantix.utils.datastructures import Void from semantix.utils.debug import assert_raises class TestUtilsDSAll: def test_utils_ds_markers_pickle(self): assert pickle.loads(pickle.dumps(Void)) i...
utils.datastructures.tests: Add pickle unittests for Markers## # Copyright (c) 2011 Sprymix Inc. # All rights reserved. # # See LICENSE for details. ## import pickle from semantix.utils.datastructures import Void from semantix.utils.debug import assert_raises class TestUtilsDSAll: def test_utils_ds_markers_pic...
<commit_before><commit_msg>utils.datastructures.tests: Add pickle unittests for Markers<commit_after>## # Copyright (c) 2011 Sprymix Inc. # All rights reserved. # # See LICENSE for details. ## import pickle from semantix.utils.datastructures import Void from semantix.utils.debug import assert_raises class TestUtil...
fa4a12125d0ce3651452dd8b7049167b3c413eda
cnxarchive/sql/migrations/20160511151028_add_update_default_modules_stateid_trigger.py
cnxarchive/sql/migrations/20160511151028_add_update_default_modules_stateid_trigger.py
# -*- coding: utf-8 -*- """Add a trigger on modules to set all new inserted books to have state "post-publication" in case there is a ruleset for collation. """ def up(cursor): cursor.execute("""\ CREATE OR REPLACE FUNCTION update_default_modules_stateid () RETURNS TRIGGER LANGUAGE PLPGSQL AS $$ BEGIN IF NEW.po...
Add migration to add sql function for updating default stateid
Add migration to add sql function for updating default stateid
Python
agpl-3.0
Connexions/cnx-archive,Connexions/cnx-archive
Add migration to add sql function for updating default stateid
# -*- coding: utf-8 -*- """Add a trigger on modules to set all new inserted books to have state "post-publication" in case there is a ruleset for collation. """ def up(cursor): cursor.execute("""\ CREATE OR REPLACE FUNCTION update_default_modules_stateid () RETURNS TRIGGER LANGUAGE PLPGSQL AS $$ BEGIN IF NEW.po...
<commit_before><commit_msg>Add migration to add sql function for updating default stateid<commit_after>
# -*- coding: utf-8 -*- """Add a trigger on modules to set all new inserted books to have state "post-publication" in case there is a ruleset for collation. """ def up(cursor): cursor.execute("""\ CREATE OR REPLACE FUNCTION update_default_modules_stateid () RETURNS TRIGGER LANGUAGE PLPGSQL AS $$ BEGIN IF NEW.po...
Add migration to add sql function for updating default stateid# -*- coding: utf-8 -*- """Add a trigger on modules to set all new inserted books to have state "post-publication" in case there is a ruleset for collation. """ def up(cursor): cursor.execute("""\ CREATE OR REPLACE FUNCTION update_default_modules_state...
<commit_before><commit_msg>Add migration to add sql function for updating default stateid<commit_after># -*- coding: utf-8 -*- """Add a trigger on modules to set all new inserted books to have state "post-publication" in case there is a ruleset for collation. """ def up(cursor): cursor.execute("""\ CREATE OR REPL...
f3187499a19b2656e44f97e274ea63c996a742a5
fpsd/test/test_utils.py
fpsd/test/test_utils.py
#!/usr/bin/env python3.5 import unittest import datetime from utils import get_lookback class LookbackTimeTest(unittest.TestCase): def test_one_week(self): self.assertEqual(get_lookback('1w'), datetime.timedelta(7)) def test_four_weeks(self): self.assertEqual(get_lookback('4w'), datetime.ti...
Add tests for new utils
Add tests for new utils
Python
agpl-3.0
freedomofpress/fingerprint-securedrop,freedomofpress/fingerprint-securedrop,freedomofpress/fingerprint-securedrop,freedomofpress/FingerprintSecureDrop,freedomofpress/FingerprintSecureDrop
Add tests for new utils
#!/usr/bin/env python3.5 import unittest import datetime from utils import get_lookback class LookbackTimeTest(unittest.TestCase): def test_one_week(self): self.assertEqual(get_lookback('1w'), datetime.timedelta(7)) def test_four_weeks(self): self.assertEqual(get_lookback('4w'), datetime.ti...
<commit_before><commit_msg>Add tests for new utils<commit_after>
#!/usr/bin/env python3.5 import unittest import datetime from utils import get_lookback class LookbackTimeTest(unittest.TestCase): def test_one_week(self): self.assertEqual(get_lookback('1w'), datetime.timedelta(7)) def test_four_weeks(self): self.assertEqual(get_lookback('4w'), datetime.ti...
Add tests for new utils#!/usr/bin/env python3.5 import unittest import datetime from utils import get_lookback class LookbackTimeTest(unittest.TestCase): def test_one_week(self): self.assertEqual(get_lookback('1w'), datetime.timedelta(7)) def test_four_weeks(self): self.assertEqual(get_look...
<commit_before><commit_msg>Add tests for new utils<commit_after>#!/usr/bin/env python3.5 import unittest import datetime from utils import get_lookback class LookbackTimeTest(unittest.TestCase): def test_one_week(self): self.assertEqual(get_lookback('1w'), datetime.timedelta(7)) def test_four_weeks...
d9fbe6bb6f2916cd29daefe476696c8279b49123
workshops/migrations/0005_auto_20150404_0953.py
workshops/migrations/0005_auto_20150404_0953.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('workshops', '0004_merge'), ] operations = [ migrations.AlterField( model_name='person', name='groups...
Add important migration to Django 1.8
Add important migration to Django 1.8 This migration makes `Person.last_login` NULL-able.
Python
mit
wking/swc-amy,wking/swc-amy,pbanaszkiewicz/amy,swcarpentry/amy,swcarpentry/amy,vahtras/amy,shapiromatron/amy,shapiromatron/amy,shapiromatron/amy,vahtras/amy,wking/swc-amy,swcarpentry/amy,wking/swc-amy,pbanaszkiewicz/amy,vahtras/amy,pbanaszkiewicz/amy
Add important migration to Django 1.8 This migration makes `Person.last_login` NULL-able.
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('workshops', '0004_merge'), ] operations = [ migrations.AlterField( model_name='person', name='groups...
<commit_before><commit_msg>Add important migration to Django 1.8 This migration makes `Person.last_login` NULL-able.<commit_after>
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('workshops', '0004_merge'), ] operations = [ migrations.AlterField( model_name='person', name='groups...
Add important migration to Django 1.8 This migration makes `Person.last_login` NULL-able.# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('workshops', '0004_merge'), ] operations = ...
<commit_before><commit_msg>Add important migration to Django 1.8 This migration makes `Person.last_login` NULL-able.<commit_after># -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('workshops'...
d0403b168b45ae9dc3bd4d22a50e01a12273b8a2
test/test_datasource.py
test/test_datasource.py
""" Test cases for the datasource classes. :author: Martin Norbury ([email protected]) """ import json from nose.tools import eq_ from mock import patch import datasource class TestDataSource(object): def __init__(self): self.source = datasource.JenkinsDataSource('buildsba:8085') @patch('datasou...
Test cases for the datasource class.
Test cases for the datasource class.
Python
mit
mnorbury/pyblink
Test cases for the datasource class.
""" Test cases for the datasource classes. :author: Martin Norbury ([email protected]) """ import json from nose.tools import eq_ from mock import patch import datasource class TestDataSource(object): def __init__(self): self.source = datasource.JenkinsDataSource('buildsba:8085') @patch('datasou...
<commit_before><commit_msg>Test cases for the datasource class.<commit_after>
""" Test cases for the datasource classes. :author: Martin Norbury ([email protected]) """ import json from nose.tools import eq_ from mock import patch import datasource class TestDataSource(object): def __init__(self): self.source = datasource.JenkinsDataSource('buildsba:8085') @patch('datasou...
Test cases for the datasource class.""" Test cases for the datasource classes. :author: Martin Norbury ([email protected]) """ import json from nose.tools import eq_ from mock import patch import datasource class TestDataSource(object): def __init__(self): self.source = datasource.JenkinsDataSource('...
<commit_before><commit_msg>Test cases for the datasource class.<commit_after>""" Test cases for the datasource classes. :author: Martin Norbury ([email protected]) """ import json from nose.tools import eq_ from mock import patch import datasource class TestDataSource(object): def __init__(self): sel...
675fbbad8917e2ce2d9395c47a42650bd0e4f697
tests/test_extensions.py
tests/test_extensions.py
"""Test suites for the extension management features.""" from __future__ import division from __future__ import absolute_import from __future__ import print_function from __future__ import unicode_literals import itertools import pytest from rpmvenv.extensions import loader def test_loader_deterministic_order(): ...
Add test to reproduce ordering issues
Add test to reproduce ordering issues This is an attempt to reproduce an issue reported related to the non-deterministic ordering of extensions.
Python
mit
kevinconway/rpmvenv
Add test to reproduce ordering issues This is an attempt to reproduce an issue reported related to the non-deterministic ordering of extensions.
"""Test suites for the extension management features.""" from __future__ import division from __future__ import absolute_import from __future__ import print_function from __future__ import unicode_literals import itertools import pytest from rpmvenv.extensions import loader def test_loader_deterministic_order(): ...
<commit_before><commit_msg>Add test to reproduce ordering issues This is an attempt to reproduce an issue reported related to the non-deterministic ordering of extensions.<commit_after>
"""Test suites for the extension management features.""" from __future__ import division from __future__ import absolute_import from __future__ import print_function from __future__ import unicode_literals import itertools import pytest from rpmvenv.extensions import loader def test_loader_deterministic_order(): ...
Add test to reproduce ordering issues This is an attempt to reproduce an issue reported related to the non-deterministic ordering of extensions."""Test suites for the extension management features.""" from __future__ import division from __future__ import absolute_import from __future__ import print_function from __f...
<commit_before><commit_msg>Add test to reproduce ordering issues This is an attempt to reproduce an issue reported related to the non-deterministic ordering of extensions.<commit_after>"""Test suites for the extension management features.""" from __future__ import division from __future__ import absolute_import from ...
9759c4605199443f2331f4d2fbbd991cc737f7af
avalanche/evaluation/metrics/forward_transfer.py
avalanche/evaluation/metrics/forward_transfer.py
################################################################################ # Copyright (c) 2021 ContinualAI. # # Copyrights licensed under the MIT License. # # See the accompanying LICENSE file for terms. ...
Set up base class for Forward Transfer metric
Set up base class for Forward Transfer metric
Python
mit
ContinualAI/avalanche,ContinualAI/avalanche
Set up base class for Forward Transfer metric
################################################################################ # Copyright (c) 2021 ContinualAI. # # Copyrights licensed under the MIT License. # # See the accompanying LICENSE file for terms. ...
<commit_before><commit_msg>Set up base class for Forward Transfer metric<commit_after>
################################################################################ # Copyright (c) 2021 ContinualAI. # # Copyrights licensed under the MIT License. # # See the accompanying LICENSE file for terms. ...
Set up base class for Forward Transfer metric################################################################################ # Copyright (c) 2021 ContinualAI. # # Copyrights licensed under the MIT License. # # See the accompanying LICENSE f...
<commit_before><commit_msg>Set up base class for Forward Transfer metric<commit_after>################################################################################ # Copyright (c) 2021 ContinualAI. # # Copyrights licensed under the MIT License. ...
e98a15c3277d86ea8b588abcfbbcaec5eea5e9b8
test/test_spacelinks.py
test/test_spacelinks.py
import pytest from tiddlywebplugins.markdown import render from tiddlyweb.model.tiddler import Tiddler environ = { 'tiddlyweb.config': { 'markdown.wiki_link_base': '', 'server_host': { 'host': 'tiddlyspace.org', 'port': '8080', 'scheme': 'http', } }...
Add the tests that drove the previous commit.
Add the tests that drove the previous commit.
Python
bsd-2-clause
tiddlyweb/tiddlywebplugins.markdown
Add the tests that drove the previous commit.
import pytest from tiddlywebplugins.markdown import render from tiddlyweb.model.tiddler import Tiddler environ = { 'tiddlyweb.config': { 'markdown.wiki_link_base': '', 'server_host': { 'host': 'tiddlyspace.org', 'port': '8080', 'scheme': 'http', } }...
<commit_before><commit_msg>Add the tests that drove the previous commit.<commit_after>
import pytest from tiddlywebplugins.markdown import render from tiddlyweb.model.tiddler import Tiddler environ = { 'tiddlyweb.config': { 'markdown.wiki_link_base': '', 'server_host': { 'host': 'tiddlyspace.org', 'port': '8080', 'scheme': 'http', } }...
Add the tests that drove the previous commit. import pytest from tiddlywebplugins.markdown import render from tiddlyweb.model.tiddler import Tiddler environ = { 'tiddlyweb.config': { 'markdown.wiki_link_base': '', 'server_host': { 'host': 'tiddlyspace.org', 'port': '8080', ...
<commit_before><commit_msg>Add the tests that drove the previous commit.<commit_after> import pytest from tiddlywebplugins.markdown import render from tiddlyweb.model.tiddler import Tiddler environ = { 'tiddlyweb.config': { 'markdown.wiki_link_base': '', 'server_host': { 'host': 'tiddl...
c808e41ac7e61fe9aabfb6b7694453bcb903fab4
py/palindromic-substrings.py
py/palindromic-substrings.py
class Solution(object): def countSubstrings(self, s): """ :type s: str :rtype: int """ P = 10 ** 9 + 7 Q = 65535 inv = lambda x: pow(x % P, P - 2, P) ls = len(s) ans = 0 Q_inv = inv(Q) for lp in xrange(1, ls + 1): l...
Add py solution for 647. Palindromic Substrings
Add py solution for 647. Palindromic Substrings 647. Palindromic Substrings: https://leetcode.com/problems/palindromic-substrings/ Approach: O(n^2) with Rolling hash: https://en.wikipedia.org/wiki/Rolling_hash It's kind of overkill though...
Python
apache-2.0
ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode
Add py solution for 647. Palindromic Substrings 647. Palindromic Substrings: https://leetcode.com/problems/palindromic-substrings/ Approach: O(n^2) with Rolling hash: https://en.wikipedia.org/wiki/Rolling_hash It's kind of overkill though...
class Solution(object): def countSubstrings(self, s): """ :type s: str :rtype: int """ P = 10 ** 9 + 7 Q = 65535 inv = lambda x: pow(x % P, P - 2, P) ls = len(s) ans = 0 Q_inv = inv(Q) for lp in xrange(1, ls + 1): l...
<commit_before><commit_msg>Add py solution for 647. Palindromic Substrings 647. Palindromic Substrings: https://leetcode.com/problems/palindromic-substrings/ Approach: O(n^2) with Rolling hash: https://en.wikipedia.org/wiki/Rolling_hash It's kind of overkill though...<commit_after>
class Solution(object): def countSubstrings(self, s): """ :type s: str :rtype: int """ P = 10 ** 9 + 7 Q = 65535 inv = lambda x: pow(x % P, P - 2, P) ls = len(s) ans = 0 Q_inv = inv(Q) for lp in xrange(1, ls + 1): l...
Add py solution for 647. Palindromic Substrings 647. Palindromic Substrings: https://leetcode.com/problems/palindromic-substrings/ Approach: O(n^2) with Rolling hash: https://en.wikipedia.org/wiki/Rolling_hash It's kind of overkill though...class Solution(object): def countSubstrings(self, s): """...
<commit_before><commit_msg>Add py solution for 647. Palindromic Substrings 647. Palindromic Substrings: https://leetcode.com/problems/palindromic-substrings/ Approach: O(n^2) with Rolling hash: https://en.wikipedia.org/wiki/Rolling_hash It's kind of overkill though...<commit_after>class Solution(object): ...
f21017d5d611b7dda9db52eb80f1a9cdb70fcac5
cms/djangoapps/contentstore/migrations/0004_remove_push_notification_configmodel_table.py
cms/djangoapps/contentstore/migrations/0004_remove_push_notification_configmodel_table.py
# -*- coding: utf-8 -*- # Generated by Django 1.11.22 on 2019-07-26 20:12 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('contentstore', '0003_remove_assets_page_flag'), ] operations = [ migrations.Remove...
Remove the configmodel for push notifications.
Remove the configmodel for push notifications. This feature was used to enable/disable push notifications using Parse.com. That service died a few years ago but this was never cleaned up. Cleaning it up as a part of DEPR-41 now that we've removed the code that references this model.
Python
agpl-3.0
eduNEXT/edunext-platform,mitocw/edx-platform,cpennington/edx-platform,angelapper/edx-platform,EDUlib/edx-platform,eduNEXT/edunext-platform,stvstnfrd/edx-platform,ESOedX/edx-platform,arbrandes/edx-platform,EDUlib/edx-platform,appsembler/edx-platform,edx-solutions/edx-platform,msegado/edx-platform,appsembler/edx-platform...
Remove the configmodel for push notifications. This feature was used to enable/disable push notifications using Parse.com. That service died a few years ago but this was never cleaned up. Cleaning it up as a part of DEPR-41 now that we've removed the code that references this model.
# -*- coding: utf-8 -*- # Generated by Django 1.11.22 on 2019-07-26 20:12 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('contentstore', '0003_remove_assets_page_flag'), ] operations = [ migrations.Remove...
<commit_before><commit_msg>Remove the configmodel for push notifications. This feature was used to enable/disable push notifications using Parse.com. That service died a few years ago but this was never cleaned up. Cleaning it up as a part of DEPR-41 now that we've removed the code that references this model.<commit...
# -*- coding: utf-8 -*- # Generated by Django 1.11.22 on 2019-07-26 20:12 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('contentstore', '0003_remove_assets_page_flag'), ] operations = [ migrations.Remove...
Remove the configmodel for push notifications. This feature was used to enable/disable push notifications using Parse.com. That service died a few years ago but this was never cleaned up. Cleaning it up as a part of DEPR-41 now that we've removed the code that references this model.# -*- coding: utf-8 -*- # Generate...
<commit_before><commit_msg>Remove the configmodel for push notifications. This feature was used to enable/disable push notifications using Parse.com. That service died a few years ago but this was never cleaned up. Cleaning it up as a part of DEPR-41 now that we've removed the code that references this model.<commit...
6b074c25fb4d0e93268f4f2bf5a1830c6df73ab8
tests/make_epoch_dow.py
tests/make_epoch_dow.py
#!/usr/bin/env python """ Program to compute the day of week for the epoch used. """ import datetime print('// Day of week calculation needs to know the starting condition') for n in range(0, 28, 4): # Limit to multiples of 4 since that limit is in the C code year = 1970 + n d = datetime.datetime(year, 1, 1...
Add Python program to calculate the day of week at start of epoch
Add Python program to calculate the day of week at start of epoch
Python
lgpl-2.1
stevemarple/RTCx,stevemarple/RTCx
Add Python program to calculate the day of week at start of epoch
#!/usr/bin/env python """ Program to compute the day of week for the epoch used. """ import datetime print('// Day of week calculation needs to know the starting condition') for n in range(0, 28, 4): # Limit to multiples of 4 since that limit is in the C code year = 1970 + n d = datetime.datetime(year, 1, 1...
<commit_before><commit_msg>Add Python program to calculate the day of week at start of epoch<commit_after>
#!/usr/bin/env python """ Program to compute the day of week for the epoch used. """ import datetime print('// Day of week calculation needs to know the starting condition') for n in range(0, 28, 4): # Limit to multiples of 4 since that limit is in the C code year = 1970 + n d = datetime.datetime(year, 1, 1...
Add Python program to calculate the day of week at start of epoch#!/usr/bin/env python """ Program to compute the day of week for the epoch used. """ import datetime print('// Day of week calculation needs to know the starting condition') for n in range(0, 28, 4): # Limit to multiples of 4 since that limit is in th...
<commit_before><commit_msg>Add Python program to calculate the day of week at start of epoch<commit_after>#!/usr/bin/env python """ Program to compute the day of week for the epoch used. """ import datetime print('// Day of week calculation needs to know the starting condition') for n in range(0, 28, 4): # Limit to...
3c31c48d6b23b639c750eb63f93a395ee8a66c92
usr/examples/test_all.py
usr/examples/test_all.py
import sensor, time # Set sensor gainceiling sensor.set_gainceiling(16) # Set sensor brightness sensor.set_brightness(-2) # Set sensor to grayscale sensor.set_pixformat(sensor.GRAYSCALE) def test_surf(sensor): clock = time.clock() for x in range(100): image = sensor.snapshot() clock.tick() ...
Add script to do combined tests
Add script to do combined tests
Python
mit
tianzhihen/openmv,SmartArduino/openmv,openmv/openmv,SmartArduino/openmv,openmv/openmv,kwagyeman/openmv,kwagyeman/openmv,iabdalkader/openmv,iabdalkader/openmv,iabdalkader/openmv,tianzhihen/openmv,SmartArduino/openmv,kwagyeman/openmv,SmartArduino/openmv,kwagyeman/openmv,openmv/openmv,tianzhihen/openmv,openmv/openmv,iabda...
Add script to do combined tests
import sensor, time # Set sensor gainceiling sensor.set_gainceiling(16) # Set sensor brightness sensor.set_brightness(-2) # Set sensor to grayscale sensor.set_pixformat(sensor.GRAYSCALE) def test_surf(sensor): clock = time.clock() for x in range(100): image = sensor.snapshot() clock.tick() ...
<commit_before><commit_msg>Add script to do combined tests<commit_after>
import sensor, time # Set sensor gainceiling sensor.set_gainceiling(16) # Set sensor brightness sensor.set_brightness(-2) # Set sensor to grayscale sensor.set_pixformat(sensor.GRAYSCALE) def test_surf(sensor): clock = time.clock() for x in range(100): image = sensor.snapshot() clock.tick() ...
Add script to do combined testsimport sensor, time # Set sensor gainceiling sensor.set_gainceiling(16) # Set sensor brightness sensor.set_brightness(-2) # Set sensor to grayscale sensor.set_pixformat(sensor.GRAYSCALE) def test_surf(sensor): clock = time.clock() for x in range(100): image = sensor.snaps...
<commit_before><commit_msg>Add script to do combined tests<commit_after>import sensor, time # Set sensor gainceiling sensor.set_gainceiling(16) # Set sensor brightness sensor.set_brightness(-2) # Set sensor to grayscale sensor.set_pixformat(sensor.GRAYSCALE) def test_surf(sensor): clock = time.clock() for x in...
e105b97e7cdbbb6b78f94c6683c82a9e9932c85c
benchexec/tools/lctd.py
benchexec/tools/lctd.py
""" BenchExec is a framework for reliable benchmarking. This file is part of BenchExec. Copyright (C) 2007-2015 Dirk Beyer 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 ...
Add wrapper script for the LCTD verification tool
Add wrapper script for the LCTD verification tool
Python
apache-2.0
ultimate-pa/benchexec,sosy-lab/benchexec,sosy-lab/benchexec,ultimate-pa/benchexec,sosy-lab/benchexec,IljaZakharov/benchexec,sosy-lab/benchexec,dbeyer/benchexec,ultimate-pa/benchexec,IljaZakharov/benchexec,dbeyer/benchexec,ultimate-pa/benchexec,martin-neuhaeusser/benchexec,martin-neuhaeusser/benchexec,sosy-lab/benchexec...
Add wrapper script for the LCTD verification tool
""" BenchExec is a framework for reliable benchmarking. This file is part of BenchExec. Copyright (C) 2007-2015 Dirk Beyer 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 ...
<commit_before><commit_msg>Add wrapper script for the LCTD verification tool<commit_after>
""" BenchExec is a framework for reliable benchmarking. This file is part of BenchExec. Copyright (C) 2007-2015 Dirk Beyer 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 ...
Add wrapper script for the LCTD verification tool""" BenchExec is a framework for reliable benchmarking. This file is part of BenchExec. Copyright (C) 2007-2015 Dirk Beyer All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the Lice...
<commit_before><commit_msg>Add wrapper script for the LCTD verification tool<commit_after>""" BenchExec is a framework for reliable benchmarking. This file is part of BenchExec. Copyright (C) 2007-2015 Dirk Beyer All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use thi...
30315a030944aae812c7a8f3729fc9c282f5014f
llsm-downscale.py
llsm-downscale.py
# IPython log file from tqdm import tqdm import numpy as np import dask.array as da import zarr import itertools from skimage.transform import downscale_local_mean lls = da.from_zarr('gokul-lls/aollsm-m4-560nm.zarr') lls3 = zarr.open( 'gokul-lls/aollsm-m4-560nm-downscale.zarr', dtype=np.float32, shape=(19...
Add IPython log for downscaling Gokul's LLS zarr dataset
Add IPython log for downscaling Gokul's LLS zarr dataset
Python
bsd-3-clause
jni/useful-histories
Add IPython log for downscaling Gokul's LLS zarr dataset
# IPython log file from tqdm import tqdm import numpy as np import dask.array as da import zarr import itertools from skimage.transform import downscale_local_mean lls = da.from_zarr('gokul-lls/aollsm-m4-560nm.zarr') lls3 = zarr.open( 'gokul-lls/aollsm-m4-560nm-downscale.zarr', dtype=np.float32, shape=(19...
<commit_before><commit_msg>Add IPython log for downscaling Gokul's LLS zarr dataset<commit_after>
# IPython log file from tqdm import tqdm import numpy as np import dask.array as da import zarr import itertools from skimage.transform import downscale_local_mean lls = da.from_zarr('gokul-lls/aollsm-m4-560nm.zarr') lls3 = zarr.open( 'gokul-lls/aollsm-m4-560nm-downscale.zarr', dtype=np.float32, shape=(19...
Add IPython log for downscaling Gokul's LLS zarr dataset# IPython log file from tqdm import tqdm import numpy as np import dask.array as da import zarr import itertools from skimage.transform import downscale_local_mean lls = da.from_zarr('gokul-lls/aollsm-m4-560nm.zarr') lls3 = zarr.open( 'gokul-lls/aollsm-m4-56...
<commit_before><commit_msg>Add IPython log for downscaling Gokul's LLS zarr dataset<commit_after># IPython log file from tqdm import tqdm import numpy as np import dask.array as da import zarr import itertools from skimage.transform import downscale_local_mean lls = da.from_zarr('gokul-lls/aollsm-m4-560nm.zarr') lls3...
d073a0f3ea6dd7be5c61ac08e4b566601ec211e6
makeRegionFile.py
makeRegionFile.py
''' A program to turn a catalog file into a ds9 region file ''' import phot_utils as pu import Sources as S def makeRegionFile(filename, outname): catalog = open(filename, "r") tmp = filter(lambda line: pu.noHead(line), catalog) sources = map(lambda line: S.SCAMSource(line), tmp) out = open(outname,...
Convert a catalog of sources to ds9 region file
Convert a catalog of sources to ds9 region file
Python
mit
SAGES-UCSC/Photometry,SAGES-UCSC/Photometry
Convert a catalog of sources to ds9 region file
''' A program to turn a catalog file into a ds9 region file ''' import phot_utils as pu import Sources as S def makeRegionFile(filename, outname): catalog = open(filename, "r") tmp = filter(lambda line: pu.noHead(line), catalog) sources = map(lambda line: S.SCAMSource(line), tmp) out = open(outname,...
<commit_before><commit_msg>Convert a catalog of sources to ds9 region file<commit_after>
''' A program to turn a catalog file into a ds9 region file ''' import phot_utils as pu import Sources as S def makeRegionFile(filename, outname): catalog = open(filename, "r") tmp = filter(lambda line: pu.noHead(line), catalog) sources = map(lambda line: S.SCAMSource(line), tmp) out = open(outname,...
Convert a catalog of sources to ds9 region file''' A program to turn a catalog file into a ds9 region file ''' import phot_utils as pu import Sources as S def makeRegionFile(filename, outname): catalog = open(filename, "r") tmp = filter(lambda line: pu.noHead(line), catalog) sources = map(lambda line: S....
<commit_before><commit_msg>Convert a catalog of sources to ds9 region file<commit_after>''' A program to turn a catalog file into a ds9 region file ''' import phot_utils as pu import Sources as S def makeRegionFile(filename, outname): catalog = open(filename, "r") tmp = filter(lambda line: pu.noHead(line), ca...
6ec0b59c3f105f13503acaab691bccf3a6bf70b1
test/runtest/testargv.py
test/runtest/testargv.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 for "runtest test/somedir" case
Add test for "runtest test/somedir" case
Python
mit
andrewyoung1991/scons,andrewyoung1991/scons,andrewyoung1991/scons,andrewyoung1991/scons,andrewyoung1991/scons,andrewyoung1991/scons,andrewyoung1991/scons,andrewyoung1991/scons,andrewyoung1991/scons
Add test for "runtest test/somedir" case
#!/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 for "runtest test/somedir" case<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 for "runtest test/somedir" case#!/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 right...
<commit_before><commit_msg>Add test for "runtest test/somedir" case<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,...
368360640aa31f93cf92290baf313ede0b212584
toon/input/keyboard2.py
toon/input/keyboard2.py
import numpy as np from toon.input.base_input import BaseInput, DummyTime class Keyboard(BaseInput): def __init__(self, clock_source=DummyTime, keys=None, multiprocess=False, nrow=10): if keys is None: raise ValueError('`keys` ...
Add windows keyboard (works, but needs rate-limiting
Add windows keyboard (works, but needs rate-limiting
Python
mit
aforren1/toon
Add windows keyboard (works, but needs rate-limiting
import numpy as np from toon.input.base_input import BaseInput, DummyTime class Keyboard(BaseInput): def __init__(self, clock_source=DummyTime, keys=None, multiprocess=False, nrow=10): if keys is None: raise ValueError('`keys` ...
<commit_before><commit_msg>Add windows keyboard (works, but needs rate-limiting<commit_after>
import numpy as np from toon.input.base_input import BaseInput, DummyTime class Keyboard(BaseInput): def __init__(self, clock_source=DummyTime, keys=None, multiprocess=False, nrow=10): if keys is None: raise ValueError('`keys` ...
Add windows keyboard (works, but needs rate-limitingimport numpy as np from toon.input.base_input import BaseInput, DummyTime class Keyboard(BaseInput): def __init__(self, clock_source=DummyTime, keys=None, multiprocess=False, nrow=10): if...
<commit_before><commit_msg>Add windows keyboard (works, but needs rate-limiting<commit_after>import numpy as np from toon.input.base_input import BaseInput, DummyTime class Keyboard(BaseInput): def __init__(self, clock_source=DummyTime, keys=None, multiprocess=Fal...
1e385a0d1ef396249ac626e242ae6c1140d8b7a0
tests/unit/test_files.py
tests/unit/test_files.py
from tests import PMGTestCase import datetime import pytz from pmg.models import db, CommitteeMeeting, Event, EventFile, File, House, Committee from tests.fixtures import dbfixture, CommitteeData, CommitteeMeetingData, EventData # TODO: might have to mock S3 class TestFiles(PMGTestCase): def setUp(self): ...
Add test for file deletion
Add test for file deletion
Python
apache-2.0
Code4SA/pmg-cms-2,Code4SA/pmg-cms-2,Code4SA/pmg-cms-2
Add test for file deletion
from tests import PMGTestCase import datetime import pytz from pmg.models import db, CommitteeMeeting, Event, EventFile, File, House, Committee from tests.fixtures import dbfixture, CommitteeData, CommitteeMeetingData, EventData # TODO: might have to mock S3 class TestFiles(PMGTestCase): def setUp(self): ...
<commit_before><commit_msg>Add test for file deletion<commit_after>
from tests import PMGTestCase import datetime import pytz from pmg.models import db, CommitteeMeeting, Event, EventFile, File, House, Committee from tests.fixtures import dbfixture, CommitteeData, CommitteeMeetingData, EventData # TODO: might have to mock S3 class TestFiles(PMGTestCase): def setUp(self): ...
Add test for file deletionfrom tests import PMGTestCase import datetime import pytz from pmg.models import db, CommitteeMeeting, Event, EventFile, File, House, Committee from tests.fixtures import dbfixture, CommitteeData, CommitteeMeetingData, EventData # TODO: might have to mock S3 class TestFiles(PMGTestCase): ...
<commit_before><commit_msg>Add test for file deletion<commit_after>from tests import PMGTestCase import datetime import pytz from pmg.models import db, CommitteeMeeting, Event, EventFile, File, House, Committee from tests.fixtures import dbfixture, CommitteeData, CommitteeMeetingData, EventData # TODO: might have to ...
e377be96d4d928c83ad91b5fad9a3c465ecf6b1b
zerver/management/commands/realm_filters.py
zerver/management/commands/realm_filters.py
from __future__ import absolute_import from optparse import make_option from django.core.management.base import BaseCommand from zerver.models import RealmFilter, all_realm_filters, Realm import sys class Command(BaseCommand): help = """Create a realm for the specified domain. Usage: python manage.py realm_filte...
Add a management command to set realm filters.
Add a management command to set realm filters. (imported from commit 6590d7eb58ea6e6afc15104dd75ad56b832858fa)
Python
apache-2.0
Jianchun1/zulip,easyfmxu/zulip,m1ssou/zulip,moria/zulip,LeeRisk/zulip,eastlhu/zulip,kou/zulip,RobotCaleb/zulip,bluesea/zulip,atomic-labs/zulip,xuanhan863/zulip,Qgap/zulip,willingc/zulip,natanovia/zulip,voidException/zulip,stamhe/zulip,blaze225/zulip,Qgap/zulip,Vallher/zulip,mohsenSy/zulip,grave-w-grave/zulip,proliming/...
Add a management command to set realm filters. (imported from commit 6590d7eb58ea6e6afc15104dd75ad56b832858fa)
from __future__ import absolute_import from optparse import make_option from django.core.management.base import BaseCommand from zerver.models import RealmFilter, all_realm_filters, Realm import sys class Command(BaseCommand): help = """Create a realm for the specified domain. Usage: python manage.py realm_filte...
<commit_before><commit_msg>Add a management command to set realm filters. (imported from commit 6590d7eb58ea6e6afc15104dd75ad56b832858fa)<commit_after>
from __future__ import absolute_import from optparse import make_option from django.core.management.base import BaseCommand from zerver.models import RealmFilter, all_realm_filters, Realm import sys class Command(BaseCommand): help = """Create a realm for the specified domain. Usage: python manage.py realm_filte...
Add a management command to set realm filters. (imported from commit 6590d7eb58ea6e6afc15104dd75ad56b832858fa)from __future__ import absolute_import from optparse import make_option from django.core.management.base import BaseCommand from zerver.models import RealmFilter, all_realm_filters, Realm import sys class Co...
<commit_before><commit_msg>Add a management command to set realm filters. (imported from commit 6590d7eb58ea6e6afc15104dd75ad56b832858fa)<commit_after>from __future__ import absolute_import from optparse import make_option from django.core.management.base import BaseCommand from zerver.models import RealmFilter, all_...
075f0342a1b03882af8e6afbe4c4debeb1c35093
graph/plot-char.py
graph/plot-char.py
from bluepy.btle import * from binascii import * import matplotlib.pyplot as plt import numpy as np DEVICE_UUID = '00:0B:57:0B:F6:F6' x = np.arange(100) y = np.ones(100) * 560 plt.ion() fig = plt.figure() ax = fig.add_subplot(111) h1, = ax.plot(x, y, 'r-') def updateLine(h1, newData): global y print newData # h1...
Add python code for graphing
Add python code for graphing
Python
apache-2.0
Miceuz/ScaleHack,Miceuz/ScaleHack
Add python code for graphing
from bluepy.btle import * from binascii import * import matplotlib.pyplot as plt import numpy as np DEVICE_UUID = '00:0B:57:0B:F6:F6' x = np.arange(100) y = np.ones(100) * 560 plt.ion() fig = plt.figure() ax = fig.add_subplot(111) h1, = ax.plot(x, y, 'r-') def updateLine(h1, newData): global y print newData # h1...
<commit_before><commit_msg>Add python code for graphing<commit_after>
from bluepy.btle import * from binascii import * import matplotlib.pyplot as plt import numpy as np DEVICE_UUID = '00:0B:57:0B:F6:F6' x = np.arange(100) y = np.ones(100) * 560 plt.ion() fig = plt.figure() ax = fig.add_subplot(111) h1, = ax.plot(x, y, 'r-') def updateLine(h1, newData): global y print newData # h1...
Add python code for graphingfrom bluepy.btle import * from binascii import * import matplotlib.pyplot as plt import numpy as np DEVICE_UUID = '00:0B:57:0B:F6:F6' x = np.arange(100) y = np.ones(100) * 560 plt.ion() fig = plt.figure() ax = fig.add_subplot(111) h1, = ax.plot(x, y, 'r-') def updateLine(h1, newData): ...
<commit_before><commit_msg>Add python code for graphing<commit_after>from bluepy.btle import * from binascii import * import matplotlib.pyplot as plt import numpy as np DEVICE_UUID = '00:0B:57:0B:F6:F6' x = np.arange(100) y = np.ones(100) * 560 plt.ion() fig = plt.figure() ax = fig.add_subplot(111) h1, = ax.plot(x,...
cfcba59e0d5cf01f731f6996b42547b7143a3fd4
beer_search_v2/signals.py
beer_search_v2/signals.py
from django.db import IntegrityError from random import sample from beer_search_v2.models import Country, Brewery, SimplifiedStyle, ProductType, Product from django.db.models.signals import pre_save, post_save from django.dispatch import receiver from django.utils.text import slugify from markdown import markdown from...
Allow for the post_save signal already knowing of the object at hand
Allow for the post_save signal already knowing of the object at hand
Python
mit
Ernir/bjorleitin,Ernir/bjorleitin,Ernir/bjorleitin,Ernir/bjorleitin
Allow for the post_save signal already knowing of the object at hand
from django.db import IntegrityError from random import sample from beer_search_v2.models import Country, Brewery, SimplifiedStyle, ProductType, Product from django.db.models.signals import pre_save, post_save from django.dispatch import receiver from django.utils.text import slugify from markdown import markdown from...
<commit_before><commit_msg>Allow for the post_save signal already knowing of the object at hand<commit_after>
from django.db import IntegrityError from random import sample from beer_search_v2.models import Country, Brewery, SimplifiedStyle, ProductType, Product from django.db.models.signals import pre_save, post_save from django.dispatch import receiver from django.utils.text import slugify from markdown import markdown from...
Allow for the post_save signal already knowing of the object at handfrom django.db import IntegrityError from random import sample from beer_search_v2.models import Country, Brewery, SimplifiedStyle, ProductType, Product from django.db.models.signals import pre_save, post_save from django.dispatch import receiver from...
<commit_before><commit_msg>Allow for the post_save signal already knowing of the object at hand<commit_after>from django.db import IntegrityError from random import sample from beer_search_v2.models import Country, Brewery, SimplifiedStyle, ProductType, Product from django.db.models.signals import pre_save, post_save ...
b855384437b3f1a392e2d3e19f91e0675bac1885
35-dumb-filters/tf-35.py
35-dumb-filters/tf-35.py
from keras.models import Sequential from keras.layers import Dense from keras.utils import plot_model import numpy as np import sys, os, string characters = string.printable char_indices = dict((c, i) for i, c in enumerate(characters)) indices_char = dict((i, c) for i, c in enumerate(characters)) INPUT_VOCAB_SIZE = l...
Add a version of this that works on single characters, and batches on the line. It's much simpler to explain.
Add a version of this that works on single characters, and batches on the line. It's much simpler to explain.
Python
mit
kranthikumar/exercises-in-programming-style,crista/exercises-in-programming-style,kranthikumar/exercises-in-programming-style,kranthikumar/exercises-in-programming-style,crista/exercises-in-programming-style,kranthikumar/exercises-in-programming-style,crista/exercises-in-programming-style,kranthikumar/exercises-in-prog...
Add a version of this that works on single characters, and batches on the line. It's much simpler to explain.
from keras.models import Sequential from keras.layers import Dense from keras.utils import plot_model import numpy as np import sys, os, string characters = string.printable char_indices = dict((c, i) for i, c in enumerate(characters)) indices_char = dict((i, c) for i, c in enumerate(characters)) INPUT_VOCAB_SIZE = l...
<commit_before><commit_msg>Add a version of this that works on single characters, and batches on the line. It's much simpler to explain.<commit_after>
from keras.models import Sequential from keras.layers import Dense from keras.utils import plot_model import numpy as np import sys, os, string characters = string.printable char_indices = dict((c, i) for i, c in enumerate(characters)) indices_char = dict((i, c) for i, c in enumerate(characters)) INPUT_VOCAB_SIZE = l...
Add a version of this that works on single characters, and batches on the line. It's much simpler to explain.from keras.models import Sequential from keras.layers import Dense from keras.utils import plot_model import numpy as np import sys, os, string characters = string.printable char_indices = dict((c, i) for i, c ...
<commit_before><commit_msg>Add a version of this that works on single characters, and batches on the line. It's much simpler to explain.<commit_after>from keras.models import Sequential from keras.layers import Dense from keras.utils import plot_model import numpy as np import sys, os, string characters = string.print...
5637909c0115db0bf6d10acecbed99ce2be5cdd2
create_vm.py
create_vm.py
import argparse import time import novaclient.v1_1.client as nvclient parser = argparse.ArgumentParser(description="Script for vm create") parser.add_argument("-openstack_user", dest='openstack_user', type=str, help="Openstack username", default='admin') parser.add_argument("-openstack_passw...
Create script for boot instance in cloud
Create script for boot instance in cloud
Python
apache-2.0
smurashov/test-infra,smurashov/test-infra
Create script for boot instance in cloud
import argparse import time import novaclient.v1_1.client as nvclient parser = argparse.ArgumentParser(description="Script for vm create") parser.add_argument("-openstack_user", dest='openstack_user', type=str, help="Openstack username", default='admin') parser.add_argument("-openstack_passw...
<commit_before><commit_msg>Create script for boot instance in cloud<commit_after>
import argparse import time import novaclient.v1_1.client as nvclient parser = argparse.ArgumentParser(description="Script for vm create") parser.add_argument("-openstack_user", dest='openstack_user', type=str, help="Openstack username", default='admin') parser.add_argument("-openstack_passw...
Create script for boot instance in cloudimport argparse import time import novaclient.v1_1.client as nvclient parser = argparse.ArgumentParser(description="Script for vm create") parser.add_argument("-openstack_user", dest='openstack_user', type=str, help="Openstack username", default='admin'...
<commit_before><commit_msg>Create script for boot instance in cloud<commit_after>import argparse import time import novaclient.v1_1.client as nvclient parser = argparse.ArgumentParser(description="Script for vm create") parser.add_argument("-openstack_user", dest='openstack_user', type=str, he...
1ad38ae2f932e7b8d4e51d2ef5f681840266d1d8
ensemble/volren/tests/test_volume_renderer.py
ensemble/volren/tests/test_volume_renderer.py
import unittest import numpy as np from traits_enaml.testing.enaml_test_assistant import EnamlTestAssistant from ensemble.volren.volume_data import VolumeData from ensemble.volren.volume_renderer import VolumeRenderer class VolumeRendererTestCase(EnamlTestAssistant, unittest.TestCase): def setUp(self): ...
Add a very basic unit test for the volume renderer widget.
Add a very basic unit test for the volume renderer widget.
Python
bsd-3-clause
dmsurti/ensemble
Add a very basic unit test for the volume renderer widget.
import unittest import numpy as np from traits_enaml.testing.enaml_test_assistant import EnamlTestAssistant from ensemble.volren.volume_data import VolumeData from ensemble.volren.volume_renderer import VolumeRenderer class VolumeRendererTestCase(EnamlTestAssistant, unittest.TestCase): def setUp(self): ...
<commit_before><commit_msg>Add a very basic unit test for the volume renderer widget.<commit_after>
import unittest import numpy as np from traits_enaml.testing.enaml_test_assistant import EnamlTestAssistant from ensemble.volren.volume_data import VolumeData from ensemble.volren.volume_renderer import VolumeRenderer class VolumeRendererTestCase(EnamlTestAssistant, unittest.TestCase): def setUp(self): ...
Add a very basic unit test for the volume renderer widget.import unittest import numpy as np from traits_enaml.testing.enaml_test_assistant import EnamlTestAssistant from ensemble.volren.volume_data import VolumeData from ensemble.volren.volume_renderer import VolumeRenderer class VolumeRendererTestCase(EnamlTestA...
<commit_before><commit_msg>Add a very basic unit test for the volume renderer widget.<commit_after>import unittest import numpy as np from traits_enaml.testing.enaml_test_assistant import EnamlTestAssistant from ensemble.volren.volume_data import VolumeData from ensemble.volren.volume_renderer import VolumeRenderer ...
6775c82c1ad9c60a034a521c8b8807ba7170d95d
games/management/commands/mame_ico_to_icon.py
games/management/commands/mame_ico_to_icon.py
"""Generate banners from ProgettoSnap marquees""" import os from PIL import Image from django.core.files.base import ContentFile from django.core.management.base import BaseCommand from django.conf import settings from common.util import crop_banner from games.models import Game if settings.DEBUG: MAME_ICO_PATH ...
Add task to create Lutris icons from MAME icons
Add task to create Lutris icons from MAME icons
Python
agpl-3.0
lutris/website,lutris/website,lutris/website,lutris/website
Add task to create Lutris icons from MAME icons
"""Generate banners from ProgettoSnap marquees""" import os from PIL import Image from django.core.files.base import ContentFile from django.core.management.base import BaseCommand from django.conf import settings from common.util import crop_banner from games.models import Game if settings.DEBUG: MAME_ICO_PATH ...
<commit_before><commit_msg>Add task to create Lutris icons from MAME icons<commit_after>
"""Generate banners from ProgettoSnap marquees""" import os from PIL import Image from django.core.files.base import ContentFile from django.core.management.base import BaseCommand from django.conf import settings from common.util import crop_banner from games.models import Game if settings.DEBUG: MAME_ICO_PATH ...
Add task to create Lutris icons from MAME icons"""Generate banners from ProgettoSnap marquees""" import os from PIL import Image from django.core.files.base import ContentFile from django.core.management.base import BaseCommand from django.conf import settings from common.util import crop_banner from games.models impo...
<commit_before><commit_msg>Add task to create Lutris icons from MAME icons<commit_after>"""Generate banners from ProgettoSnap marquees""" import os from PIL import Image from django.core.files.base import ContentFile from django.core.management.base import BaseCommand from django.conf import settings from common.util ...
bdada0e40b481f8d9c81032c8dff475817a1a55e
tests/test_authentication.py
tests/test_authentication.py
"""tests/test_authentication.py. Tests hugs built-in authentication helper methods 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 restriction, ...
Add test to define how basic authentication should wokr
Add test to define how basic authentication should wokr
Python
mit
giserh/hug,MuhammadAlkarouri/hug,timothycrosley/hug,MuhammadAlkarouri/hug,timothycrosley/hug,giserh/hug,timothycrosley/hug,MuhammadAlkarouri/hug
Add test to define how basic authentication should wokr
"""tests/test_authentication.py. Tests hugs built-in authentication helper methods 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 restriction, ...
<commit_before><commit_msg>Add test to define how basic authentication should wokr<commit_after>
"""tests/test_authentication.py. Tests hugs built-in authentication helper methods 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 restriction, ...
Add test to define how basic authentication should wokr"""tests/test_authentication.py. Tests hugs built-in authentication helper methods 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 "So...
<commit_before><commit_msg>Add test to define how basic authentication should wokr<commit_after>"""tests/test_authentication.py. Tests hugs built-in authentication helper methods Copyright (C) 2015 Timothy Edmund Crosley Permission is hereby granted, free of charge, to any person obtaining a copy of this software an...
74a413cb59eb59ce7354ca90d6b49b26960ad235
web/main/migrations/0022_post_32_upgrade.py
web/main/migrations/0022_post_32_upgrade.py
# Generated by Django 3.2.14 on 2022-07-05 17:19 import django.core.validators from django.db import migrations, models import main.models import re class Migration(migrations.Migration): dependencies = [ ('main', '0021_auto_20220527_1714'), ] operations = [ migrations.AlterField( ...
Add migrations that were pending since the 3.2 upgrade
Add migrations that were pending since the 3.2 upgrade
Python
agpl-3.0
harvard-lil/h2o,harvard-lil/h2o,harvard-lil/h2o,harvard-lil/h2o
Add migrations that were pending since the 3.2 upgrade
# Generated by Django 3.2.14 on 2022-07-05 17:19 import django.core.validators from django.db import migrations, models import main.models import re class Migration(migrations.Migration): dependencies = [ ('main', '0021_auto_20220527_1714'), ] operations = [ migrations.AlterField( ...
<commit_before><commit_msg>Add migrations that were pending since the 3.2 upgrade<commit_after>
# Generated by Django 3.2.14 on 2022-07-05 17:19 import django.core.validators from django.db import migrations, models import main.models import re class Migration(migrations.Migration): dependencies = [ ('main', '0021_auto_20220527_1714'), ] operations = [ migrations.AlterField( ...
Add migrations that were pending since the 3.2 upgrade# Generated by Django 3.2.14 on 2022-07-05 17:19 import django.core.validators from django.db import migrations, models import main.models import re class Migration(migrations.Migration): dependencies = [ ('main', '0021_auto_20220527_1714'), ] ...
<commit_before><commit_msg>Add migrations that were pending since the 3.2 upgrade<commit_after># Generated by Django 3.2.14 on 2022-07-05 17:19 import django.core.validators from django.db import migrations, models import main.models import re class Migration(migrations.Migration): dependencies = [ ('ma...
7d98b3ab9ba55478e69d27d77ff962ff7eab73c1
nbgrader/tests/test_api.py
nbgrader/tests/test_api.py
from nbgrader import api class TestApi(object): def test_create_assignment(self): a = api.Assignment(assignment_id='foo', duedate='someday') assert a.assignment_id == 'foo' assert a.duedate == 'someday' assert a._id def test_create_student(self): s = api.Student(studen...
Add some minimal api tests
Add some minimal api tests
Python
bsd-3-clause
modulexcite/nbgrader,jupyter/nbgrader,EdwardJKim/nbgrader,jupyter/nbgrader,alope107/nbgrader,MatKallada/nbgrader,MatKallada/nbgrader,jupyter/nbgrader,jhamrick/nbgrader,EdwardJKim/nbgrader,jhamrick/nbgrader,jupyter/nbgrader,jhamrick/nbgrader,ellisonbg/nbgrader,ellisonbg/nbgrader,dementrock/nbgrader,ellisonbg/nbgrader,Ed...
Add some minimal api tests
from nbgrader import api class TestApi(object): def test_create_assignment(self): a = api.Assignment(assignment_id='foo', duedate='someday') assert a.assignment_id == 'foo' assert a.duedate == 'someday' assert a._id def test_create_student(self): s = api.Student(studen...
<commit_before><commit_msg>Add some minimal api tests<commit_after>
from nbgrader import api class TestApi(object): def test_create_assignment(self): a = api.Assignment(assignment_id='foo', duedate='someday') assert a.assignment_id == 'foo' assert a.duedate == 'someday' assert a._id def test_create_student(self): s = api.Student(studen...
Add some minimal api testsfrom nbgrader import api class TestApi(object): def test_create_assignment(self): a = api.Assignment(assignment_id='foo', duedate='someday') assert a.assignment_id == 'foo' assert a.duedate == 'someday' assert a._id def test_create_student(self): ...
<commit_before><commit_msg>Add some minimal api tests<commit_after>from nbgrader import api class TestApi(object): def test_create_assignment(self): a = api.Assignment(assignment_id='foo', duedate='someday') assert a.assignment_id == 'foo' assert a.duedate == 'someday' assert a._id...
b687a3eac694a311bf4e92b9662a0f13c3506154
tests/linters/test_lint_nwod.py
tests/linters/test_lint_nwod.py
import npc import pytest import os from tests.util import fixture_dir def test_has_virtue(): char_file = fixture_dir('linter', 'nwod', 'Gotta Nada.nwod') with open(char_file, 'r') as char_file: problems = npc.linters.nwod.lint_vice_virtue(char_file.read()) assert 'Missing virtue' in problems d...
Add core nwod linting tests
Add core nwod linting tests
Python
mit
aurule/npc,aurule/npc
Add core nwod linting tests
import npc import pytest import os from tests.util import fixture_dir def test_has_virtue(): char_file = fixture_dir('linter', 'nwod', 'Gotta Nada.nwod') with open(char_file, 'r') as char_file: problems = npc.linters.nwod.lint_vice_virtue(char_file.read()) assert 'Missing virtue' in problems d...
<commit_before><commit_msg>Add core nwod linting tests<commit_after>
import npc import pytest import os from tests.util import fixture_dir def test_has_virtue(): char_file = fixture_dir('linter', 'nwod', 'Gotta Nada.nwod') with open(char_file, 'r') as char_file: problems = npc.linters.nwod.lint_vice_virtue(char_file.read()) assert 'Missing virtue' in problems d...
Add core nwod linting testsimport npc import pytest import os from tests.util import fixture_dir def test_has_virtue(): char_file = fixture_dir('linter', 'nwod', 'Gotta Nada.nwod') with open(char_file, 'r') as char_file: problems = npc.linters.nwod.lint_vice_virtue(char_file.read()) assert 'Mis...
<commit_before><commit_msg>Add core nwod linting tests<commit_after>import npc import pytest import os from tests.util import fixture_dir def test_has_virtue(): char_file = fixture_dir('linter', 'nwod', 'Gotta Nada.nwod') with open(char_file, 'r') as char_file: problems = npc.linters.nwod.lint_vice_vir...
20fecc93aca627a4aaf42c36df32d5f5a38f5b7a
tools/map_2d_dictionaries.py
tools/map_2d_dictionaries.py
import numpy as np import os import itertools import matplotlib.pyplot as plt from parameter_prediction.datasets import dictionary def grouper(iterable, n, fillvalue=None): "Collect data into fixed-length chunks or blocks" # grouper('ABCDEFG', 3, 'x') --> ABC DEF Gxx args = [iter(iterable)] * n return ...
Add script for visualizing 2d dictionaries.
Add script for visualizing 2d dictionaries. Useful for debugging.
Python
mit
mdenil/parameter_prediction,mdenil/parameter_prediction,mdenil/parameter_prediction
Add script for visualizing 2d dictionaries. Useful for debugging.
import numpy as np import os import itertools import matplotlib.pyplot as plt from parameter_prediction.datasets import dictionary def grouper(iterable, n, fillvalue=None): "Collect data into fixed-length chunks or blocks" # grouper('ABCDEFG', 3, 'x') --> ABC DEF Gxx args = [iter(iterable)] * n return ...
<commit_before><commit_msg>Add script for visualizing 2d dictionaries. Useful for debugging.<commit_after>
import numpy as np import os import itertools import matplotlib.pyplot as plt from parameter_prediction.datasets import dictionary def grouper(iterable, n, fillvalue=None): "Collect data into fixed-length chunks or blocks" # grouper('ABCDEFG', 3, 'x') --> ABC DEF Gxx args = [iter(iterable)] * n return ...
Add script for visualizing 2d dictionaries. Useful for debugging.import numpy as np import os import itertools import matplotlib.pyplot as plt from parameter_prediction.datasets import dictionary def grouper(iterable, n, fillvalue=None): "Collect data into fixed-length chunks or blocks" # grouper('ABCDEFG', 3...
<commit_before><commit_msg>Add script for visualizing 2d dictionaries. Useful for debugging.<commit_after>import numpy as np import os import itertools import matplotlib.pyplot as plt from parameter_prediction.datasets import dictionary def grouper(iterable, n, fillvalue=None): "Collect data into fixed-length chu...
2a0958455799601068db054c130fa9573e7c1e22
tensorflow/python/ops/parallel_for/__init__.py
tensorflow/python/ops/parallel_for/__init__.py
# Copyright 2018 The TensorFlow Authors. 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 applica...
# Copyright 2018 The TensorFlow Authors. 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 applica...
Remove usage of remove_undocumented from core parallel_for.
Remove usage of remove_undocumented from core parallel_for. remove_undocumented is causing issues with our pip tests. remove_undocumented is not used anywhere else in core TF code and we have a new mechanism for annotating the public TF API.
Python
apache-2.0
chemelnucfin/tensorflow,ppwwyyxx/tensorflow,annarev/tensorflow,jhseu/tensorflow,alshedivat/tensorflow,kobejean/tensorflow,Bismarrck/tensorflow,chemelnucfin/tensorflow,davidzchen/tensorflow,Intel-tensorflow/tensorflow,aselle/tensorflow,kobejean/tensorflow,Bismarrck/tensorflow,girving/tensorflow,petewarden/tensorflow,hfp...
# Copyright 2018 The TensorFlow Authors. 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 applica...
# Copyright 2018 The TensorFlow Authors. 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 applica...
<commit_before># Copyright 2018 The TensorFlow Authors. 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 requ...
# Copyright 2018 The TensorFlow Authors. 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 applica...
# Copyright 2018 The TensorFlow Authors. 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 applica...
<commit_before># Copyright 2018 The TensorFlow Authors. 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 requ...
c7f6ac0dd56b755a25c215d02a540919e1cc92a3
gmmp/management/commands/map_weights_to_codes.py
gmmp/management/commands/map_weights_to_codes.py
import csv from pprint import pprint from django.core.management.base import BaseCommand from django_countries import countries from forms.modelutils import CountryRegion class Command(BaseCommand): args = 'input_file output_file' help = 'Maps the given country names to there codes and regions.' def hand...
Add management command to import weightings
Add management command to import weightings
Python
apache-2.0
Code4SA/gmmp,Code4SA/gmmp,Code4SA/gmmp
Add management command to import weightings
import csv from pprint import pprint from django.core.management.base import BaseCommand from django_countries import countries from forms.modelutils import CountryRegion class Command(BaseCommand): args = 'input_file output_file' help = 'Maps the given country names to there codes and regions.' def hand...
<commit_before><commit_msg>Add management command to import weightings<commit_after>
import csv from pprint import pprint from django.core.management.base import BaseCommand from django_countries import countries from forms.modelutils import CountryRegion class Command(BaseCommand): args = 'input_file output_file' help = 'Maps the given country names to there codes and regions.' def hand...
Add management command to import weightingsimport csv from pprint import pprint from django.core.management.base import BaseCommand from django_countries import countries from forms.modelutils import CountryRegion class Command(BaseCommand): args = 'input_file output_file' help = 'Maps the given country name...
<commit_before><commit_msg>Add management command to import weightings<commit_after>import csv from pprint import pprint from django.core.management.base import BaseCommand from django_countries import countries from forms.modelutils import CountryRegion class Command(BaseCommand): args = 'input_file output_file...
5043d74db37e3e3f955f51782164fae45a780d9e
test/test_message.py
test/test_message.py
import quopri from daemail.message import DraftMessage TEXT = 'àéîøü' def test_quopri_text(): msg = DraftMessage() msg.addtext(TEXT) blob = msg.compile() assert isinstance(blob, bytes) assert TEXT.encode('utf-8') not in blob assert quopri.encodestring(TEXT.encode('utf-8')) in blob def test_...
Test quoted-printable is always applied to text
Test quoted-printable is always applied to text
Python
mit
jwodder/daemail
Test quoted-printable is always applied to text
import quopri from daemail.message import DraftMessage TEXT = 'àéîøü' def test_quopri_text(): msg = DraftMessage() msg.addtext(TEXT) blob = msg.compile() assert isinstance(blob, bytes) assert TEXT.encode('utf-8') not in blob assert quopri.encodestring(TEXT.encode('utf-8')) in blob def test_...
<commit_before><commit_msg>Test quoted-printable is always applied to text<commit_after>
import quopri from daemail.message import DraftMessage TEXT = 'àéîøü' def test_quopri_text(): msg = DraftMessage() msg.addtext(TEXT) blob = msg.compile() assert isinstance(blob, bytes) assert TEXT.encode('utf-8') not in blob assert quopri.encodestring(TEXT.encode('utf-8')) in blob def test_...
Test quoted-printable is always applied to textimport quopri from daemail.message import DraftMessage TEXT = 'àéîøü' def test_quopri_text(): msg = DraftMessage() msg.addtext(TEXT) blob = msg.compile() assert isinstance(blob, bytes) assert TEXT.encode('utf-8') not in blob assert quopri.encode...
<commit_before><commit_msg>Test quoted-printable is always applied to text<commit_after>import quopri from daemail.message import DraftMessage TEXT = 'àéîøü' def test_quopri_text(): msg = DraftMessage() msg.addtext(TEXT) blob = msg.compile() assert isinstance(blob, bytes) assert TEXT.encode('utf...
bf5ed92820a347fe8ecc34b8b2b204c44276a392
scooby_doo.py
scooby_doo.py
#!/usr/bin/env python3 for i in range(1,101): if i%3 == 0 and i%7==0: print("Scooby Doo") elif i%3 == 0: print("Scooby") elif i%7 == 0: print("Doo") else: print(i)
Add solution to Scooby doo problem
Add solution to Scooby doo problem
Python
mit
khusi-anu/dgplug-python
Add solution to Scooby doo problem
#!/usr/bin/env python3 for i in range(1,101): if i%3 == 0 and i%7==0: print("Scooby Doo") elif i%3 == 0: print("Scooby") elif i%7 == 0: print("Doo") else: print(i)
<commit_before><commit_msg>Add solution to Scooby doo problem<commit_after>
#!/usr/bin/env python3 for i in range(1,101): if i%3 == 0 and i%7==0: print("Scooby Doo") elif i%3 == 0: print("Scooby") elif i%7 == 0: print("Doo") else: print(i)
Add solution to Scooby doo problem#!/usr/bin/env python3 for i in range(1,101): if i%3 == 0 and i%7==0: print("Scooby Doo") elif i%3 == 0: print("Scooby") elif i%7 == 0: print("Doo") else: print(i)
<commit_before><commit_msg>Add solution to Scooby doo problem<commit_after>#!/usr/bin/env python3 for i in range(1,101): if i%3 == 0 and i%7==0: print("Scooby Doo") elif i%3 == 0: print("Scooby") elif i%7 == 0: print("Doo") else: print(i)
d176a959473f279073fc1df8ed09d71f9a2ca1b4
custom/aaa/migrations/0008_auto_20190410_1952.py
custom/aaa/migrations/0008_auto_20190410_1952.py
# -*- coding: utf-8 -*- # Generated by Django 1.11.20 on 2019-04-10 19:52 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('aaa', '0007_auto_20190319_2225'), ] operations = [ migrations.AlterField( ...
Add migration after help_text changes
Add migration after help_text changes
Python
bsd-3-clause
dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq
Add migration after help_text changes
# -*- coding: utf-8 -*- # Generated by Django 1.11.20 on 2019-04-10 19:52 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('aaa', '0007_auto_20190319_2225'), ] operations = [ migrations.AlterField( ...
<commit_before><commit_msg>Add migration after help_text changes<commit_after>
# -*- coding: utf-8 -*- # Generated by Django 1.11.20 on 2019-04-10 19:52 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('aaa', '0007_auto_20190319_2225'), ] operations = [ migrations.AlterField( ...
Add migration after help_text changes# -*- coding: utf-8 -*- # Generated by Django 1.11.20 on 2019-04-10 19:52 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('aaa', '0007_auto_20190319_2225'), ] operation...
<commit_before><commit_msg>Add migration after help_text changes<commit_after># -*- coding: utf-8 -*- # Generated by Django 1.11.20 on 2019-04-10 19:52 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('aaa', '0007_a...
84ae17aaf19330a57f96171bd6bcda94e0dbb7d0
tests/test_exception.py
tests/test_exception.py
# -*- coding: utf-8 -*- import pytest from wait_for import wait_for, TimedOutError class MyError(Exception): """A sample exception for use by the tests in this module.""" def raise_my_error(): """Raise ``MyError``.""" raise MyError() def test_handle_exception_v1(): """Don't set ``handle_exception...
Add some unit tests for exception handling
Add some unit tests for exception handling
Python
apache-2.0
RedHatQE/wait_for
Add some unit tests for exception handling
# -*- coding: utf-8 -*- import pytest from wait_for import wait_for, TimedOutError class MyError(Exception): """A sample exception for use by the tests in this module.""" def raise_my_error(): """Raise ``MyError``.""" raise MyError() def test_handle_exception_v1(): """Don't set ``handle_exception...
<commit_before><commit_msg>Add some unit tests for exception handling<commit_after>
# -*- coding: utf-8 -*- import pytest from wait_for import wait_for, TimedOutError class MyError(Exception): """A sample exception for use by the tests in this module.""" def raise_my_error(): """Raise ``MyError``.""" raise MyError() def test_handle_exception_v1(): """Don't set ``handle_exception...
Add some unit tests for exception handling# -*- coding: utf-8 -*- import pytest from wait_for import wait_for, TimedOutError class MyError(Exception): """A sample exception for use by the tests in this module.""" def raise_my_error(): """Raise ``MyError``.""" raise MyError() def test_handle_exception...
<commit_before><commit_msg>Add some unit tests for exception handling<commit_after># -*- coding: utf-8 -*- import pytest from wait_for import wait_for, TimedOutError class MyError(Exception): """A sample exception for use by the tests in this module.""" def raise_my_error(): """Raise ``MyError``.""" ra...
7664670f43ec9ea2a28df436d2e87d3259d6e519
document/management/commands/clean_submitters.py
document/management/commands/clean_submitters.py
import logging from django.core.management.base import BaseCommand from django.db import transaction from document.models import Document from document.models import Submitter logger = logging.getLogger(__name__) class Command(BaseCommand): def handle(self, *args, **options): self.do() @transacti...
Create command to remove duplicate submitters
Create command to remove duplicate submitters
Python
mit
openkamer/openkamer,openkamer/openkamer,openkamer/openkamer,openkamer/openkamer
Create command to remove duplicate submitters
import logging from django.core.management.base import BaseCommand from django.db import transaction from document.models import Document from document.models import Submitter logger = logging.getLogger(__name__) class Command(BaseCommand): def handle(self, *args, **options): self.do() @transacti...
<commit_before><commit_msg>Create command to remove duplicate submitters<commit_after>
import logging from django.core.management.base import BaseCommand from django.db import transaction from document.models import Document from document.models import Submitter logger = logging.getLogger(__name__) class Command(BaseCommand): def handle(self, *args, **options): self.do() @transacti...
Create command to remove duplicate submittersimport logging from django.core.management.base import BaseCommand from django.db import transaction from document.models import Document from document.models import Submitter logger = logging.getLogger(__name__) class Command(BaseCommand): def handle(self, *args, ...
<commit_before><commit_msg>Create command to remove duplicate submitters<commit_after>import logging from django.core.management.base import BaseCommand from django.db import transaction from document.models import Document from document.models import Submitter logger = logging.getLogger(__name__) class Command(Ba...
f2dab6c81e8d0308dede549549a1b6f3b1ab78cf
analysis/check_files.py
analysis/check_files.py
#!/usr/bin/env python # vim: set sw=2 ts=2 softtabstop=2 expandtab: import argparse import os import logging import sys import yaml try: # Try to use libyaml which is faster from yaml import CLoader as Loader, CDumper as Dumper except ImportError: # fall back on python implementation from yaml import Loader, D...
Add script to detect missing results between yaml files that we intend to compare.
Add script to detect missing results between yaml files that we intend to compare.
Python
bsd-3-clause
symbooglix/boogie-runner,symbooglix/boogie-runner
Add script to detect missing results between yaml files that we intend to compare.
#!/usr/bin/env python # vim: set sw=2 ts=2 softtabstop=2 expandtab: import argparse import os import logging import sys import yaml try: # Try to use libyaml which is faster from yaml import CLoader as Loader, CDumper as Dumper except ImportError: # fall back on python implementation from yaml import Loader, D...
<commit_before><commit_msg>Add script to detect missing results between yaml files that we intend to compare.<commit_after>
#!/usr/bin/env python # vim: set sw=2 ts=2 softtabstop=2 expandtab: import argparse import os import logging import sys import yaml try: # Try to use libyaml which is faster from yaml import CLoader as Loader, CDumper as Dumper except ImportError: # fall back on python implementation from yaml import Loader, D...
Add script to detect missing results between yaml files that we intend to compare.#!/usr/bin/env python # vim: set sw=2 ts=2 softtabstop=2 expandtab: import argparse import os import logging import sys import yaml try: # Try to use libyaml which is faster from yaml import CLoader as Loader, CDumper as Dumper excep...
<commit_before><commit_msg>Add script to detect missing results between yaml files that we intend to compare.<commit_after>#!/usr/bin/env python # vim: set sw=2 ts=2 softtabstop=2 expandtab: import argparse import os import logging import sys import yaml try: # Try to use libyaml which is faster from yaml import C...
aee5bdbb09cd12478e4cdccb3db33dc3f5ffc498
app/tests/test_utils.py
app/tests/test_utils.py
from redidropper.utils import clean_int, allowed_file #import unittest #class TestUtils(unittest.TestCase): def test_clean_int(): """ Verify common cases """ cases = [ {"x": None, "exp": None}, {"x": "", "exp": None}, {"x": " ", "exp": None}, ...
Add two tests for utils.py
Add two tests for utils.py
Python
bsd-3-clause
indera/redi-dropper-client,indera/redi-dropper-client,indera/redi-dropper-client,indera/redi-dropper-client,indera/redi-dropper-client
Add two tests for utils.py
from redidropper.utils import clean_int, allowed_file #import unittest #class TestUtils(unittest.TestCase): def test_clean_int(): """ Verify common cases """ cases = [ {"x": None, "exp": None}, {"x": "", "exp": None}, {"x": " ", "exp": None}, ...
<commit_before><commit_msg>Add two tests for utils.py<commit_after>
from redidropper.utils import clean_int, allowed_file #import unittest #class TestUtils(unittest.TestCase): def test_clean_int(): """ Verify common cases """ cases = [ {"x": None, "exp": None}, {"x": "", "exp": None}, {"x": " ", "exp": None}, ...
Add two tests for utils.pyfrom redidropper.utils import clean_int, allowed_file #import unittest #class TestUtils(unittest.TestCase): def test_clean_int(): """ Verify common cases """ cases = [ {"x": None, "exp": None}, {"x": "", "exp": None}, {"x": " ", ...
<commit_before><commit_msg>Add two tests for utils.py<commit_after>from redidropper.utils import clean_int, allowed_file #import unittest #class TestUtils(unittest.TestCase): def test_clean_int(): """ Verify common cases """ cases = [ {"x": None, "exp": None}, {"x": "", ...
9a3128c4994eb241d6a69d33606e3aeacfa6475b
learntris.py
learntris.py
#!/usr/bin/python2.7 import sys WIDTH = 10 LENGTH = 22 def main(): command_line_arguments = sys.argv print command_line_arguments[0] if len(command_line_arguments) >= 2: arguments(command_line_arguments) else: print "no arguments passed" def arguments(command_line_arguments): ...
Use command line arguments to tell it what to do
Use command line arguments to tell it what to do
Python
mit
SultansDream/testris
Use command line arguments to tell it what to do
#!/usr/bin/python2.7 import sys WIDTH = 10 LENGTH = 22 def main(): command_line_arguments = sys.argv print command_line_arguments[0] if len(command_line_arguments) >= 2: arguments(command_line_arguments) else: print "no arguments passed" def arguments(command_line_arguments): ...
<commit_before><commit_msg>Use command line arguments to tell it what to do<commit_after>
#!/usr/bin/python2.7 import sys WIDTH = 10 LENGTH = 22 def main(): command_line_arguments = sys.argv print command_line_arguments[0] if len(command_line_arguments) >= 2: arguments(command_line_arguments) else: print "no arguments passed" def arguments(command_line_arguments): ...
Use command line arguments to tell it what to do#!/usr/bin/python2.7 import sys WIDTH = 10 LENGTH = 22 def main(): command_line_arguments = sys.argv print command_line_arguments[0] if len(command_line_arguments) >= 2: arguments(command_line_arguments) else: print "no arguments pa...
<commit_before><commit_msg>Use command line arguments to tell it what to do<commit_after>#!/usr/bin/python2.7 import sys WIDTH = 10 LENGTH = 22 def main(): command_line_arguments = sys.argv print command_line_arguments[0] if len(command_line_arguments) >= 2: arguments(command_line_arguments)...
ac7cff3a1a74934cc728297bd274bf3ac3dd9a97
logfilter.py
logfilter.py
#!/usr/bin/python from paste.translogger import TransLogger def factory(config, **settings): def filter(app): config.update(settings); return TransLogger(app, setup_console_handler = True) return filter
Add this class useful for debugging, which logs requests passing through it.
Add this class useful for debugging, which logs requests passing through it.
Python
apache-2.0
NeCTAR-RC/reporting-api,NCI-Cloud/reporting-api,NeCTAR-RC/reporting-api,NCI-Cloud/reporting-api
Add this class useful for debugging, which logs requests passing through it.
#!/usr/bin/python from paste.translogger import TransLogger def factory(config, **settings): def filter(app): config.update(settings); return TransLogger(app, setup_console_handler = True) return filter
<commit_before><commit_msg>Add this class useful for debugging, which logs requests passing through it.<commit_after>
#!/usr/bin/python from paste.translogger import TransLogger def factory(config, **settings): def filter(app): config.update(settings); return TransLogger(app, setup_console_handler = True) return filter
Add this class useful for debugging, which logs requests passing through it.#!/usr/bin/python from paste.translogger import TransLogger def factory(config, **settings): def filter(app): config.update(settings); return TransLogger(app, setup_console_handler = True) return filter
<commit_before><commit_msg>Add this class useful for debugging, which logs requests passing through it.<commit_after>#!/usr/bin/python from paste.translogger import TransLogger def factory(config, **settings): def filter(app): config.update(settings); return TransLogger(app, setup_console_handler = True) return...
9db5e0d8a17f250e0d1a9acbcd070876a418c228
aleph/migrate/versions/af9b37868cf3_remove_doc_tables.py
aleph/migrate/versions/af9b37868cf3_remove_doc_tables.py
"""Remove document-related tables Revision ID: af9b37868cf3 Revises: 284a9ec16306 Create Date: 2019-06-13 17:45:43.310462 """ from alembic import op # revision identifiers, used by Alembic. revision = 'af9b37868cf3' down_revision = '284a9ec16306' def upgrade(): op.drop_index('ix_document_tag_document_id', table...
Remove document tables and audit table
Remove document tables and audit table
Python
mit
alephdata/aleph,pudo/aleph,alephdata/aleph,pudo/aleph,pudo/aleph,alephdata/aleph,alephdata/aleph,alephdata/aleph
Remove document tables and audit table
"""Remove document-related tables Revision ID: af9b37868cf3 Revises: 284a9ec16306 Create Date: 2019-06-13 17:45:43.310462 """ from alembic import op # revision identifiers, used by Alembic. revision = 'af9b37868cf3' down_revision = '284a9ec16306' def upgrade(): op.drop_index('ix_document_tag_document_id', table...
<commit_before><commit_msg>Remove document tables and audit table<commit_after>
"""Remove document-related tables Revision ID: af9b37868cf3 Revises: 284a9ec16306 Create Date: 2019-06-13 17:45:43.310462 """ from alembic import op # revision identifiers, used by Alembic. revision = 'af9b37868cf3' down_revision = '284a9ec16306' def upgrade(): op.drop_index('ix_document_tag_document_id', table...
Remove document tables and audit table"""Remove document-related tables Revision ID: af9b37868cf3 Revises: 284a9ec16306 Create Date: 2019-06-13 17:45:43.310462 """ from alembic import op # revision identifiers, used by Alembic. revision = 'af9b37868cf3' down_revision = '284a9ec16306' def upgrade(): op.drop_inde...
<commit_before><commit_msg>Remove document tables and audit table<commit_after>"""Remove document-related tables Revision ID: af9b37868cf3 Revises: 284a9ec16306 Create Date: 2019-06-13 17:45:43.310462 """ from alembic import op # revision identifiers, used by Alembic. revision = 'af9b37868cf3' down_revision = '284a9e...
ec1c315eac4570cea6be7c2c08cefcdbee35d415
bin/representation_classes.py
bin/representation_classes.py
"""representation_classes.py Compute the representation of the emergent classes in the dataset and the variance obtained for the null model. """ import csv import marble as mb # # Import data # ## List of MSA msa = {} with open('data/names/msa.csv', 'r') as source: reader = csv.reader(source, delimiter='\t') ...
Add script to compute the representation of each class in the different areal units
Add script to compute the representation of each class in the different areal units
Python
bsd-3-clause
rlouf/patterns-of-segregation
Add script to compute the representation of each class in the different areal units
"""representation_classes.py Compute the representation of the emergent classes in the dataset and the variance obtained for the null model. """ import csv import marble as mb # # Import data # ## List of MSA msa = {} with open('data/names/msa.csv', 'r') as source: reader = csv.reader(source, delimiter='\t') ...
<commit_before><commit_msg>Add script to compute the representation of each class in the different areal units<commit_after>
"""representation_classes.py Compute the representation of the emergent classes in the dataset and the variance obtained for the null model. """ import csv import marble as mb # # Import data # ## List of MSA msa = {} with open('data/names/msa.csv', 'r') as source: reader = csv.reader(source, delimiter='\t') ...
Add script to compute the representation of each class in the different areal units"""representation_classes.py Compute the representation of the emergent classes in the dataset and the variance obtained for the null model. """ import csv import marble as mb # # Import data # ## List of MSA msa = {} with open('dat...
<commit_before><commit_msg>Add script to compute the representation of each class in the different areal units<commit_after>"""representation_classes.py Compute the representation of the emergent classes in the dataset and the variance obtained for the null model. """ import csv import marble as mb # # Import data ...
01673b2e2d154abc7354881ae92162245f0ac78f
pygametemplate/image.py
pygametemplate/image.py
"""Module containing the Image class for easily adding/removing images from RAM.""" from pygametemplate import load_image class Image: def __init__(self, image_name): self.name = image_name self.image = None def load(self): """Load the image into RAM.""" self.image = load_ima...
Add implementation of pygametemplate.Image class which passes all unit tests :)
Add implementation of pygametemplate.Image class which passes all unit tests :)
Python
mit
AndyDeany/pygame-template
Add implementation of pygametemplate.Image class which passes all unit tests :)
"""Module containing the Image class for easily adding/removing images from RAM.""" from pygametemplate import load_image class Image: def __init__(self, image_name): self.name = image_name self.image = None def load(self): """Load the image into RAM.""" self.image = load_ima...
<commit_before><commit_msg>Add implementation of pygametemplate.Image class which passes all unit tests :)<commit_after>
"""Module containing the Image class for easily adding/removing images from RAM.""" from pygametemplate import load_image class Image: def __init__(self, image_name): self.name = image_name self.image = None def load(self): """Load the image into RAM.""" self.image = load_ima...
Add implementation of pygametemplate.Image class which passes all unit tests :)"""Module containing the Image class for easily adding/removing images from RAM.""" from pygametemplate import load_image class Image: def __init__(self, image_name): self.name = image_name self.image = None def l...
<commit_before><commit_msg>Add implementation of pygametemplate.Image class which passes all unit tests :)<commit_after>"""Module containing the Image class for easily adding/removing images from RAM.""" from pygametemplate import load_image class Image: def __init__(self, image_name): self.name = image_...
507565fd461fd34f27a44d179a69648b775d9e2a
euxfel_h5tools/h5index.py
euxfel_h5tools/h5index.py
import csv import h5py import sys def hdf5_datasets(grp): """Print CSV data of all datasets in an HDF5 file. path, shape, dtype """ writer = csv.writer(sys.stdout) writer.writerow(['path', 'shape', 'dtype']) def visitor(path, item): if isinstance(item, h5py.Dataset): write...
Add a utility for indexing structure of HDF5 files
Add a utility for indexing structure of HDF5 files
Python
bsd-3-clause
European-XFEL/h5tools-py
Add a utility for indexing structure of HDF5 files
import csv import h5py import sys def hdf5_datasets(grp): """Print CSV data of all datasets in an HDF5 file. path, shape, dtype """ writer = csv.writer(sys.stdout) writer.writerow(['path', 'shape', 'dtype']) def visitor(path, item): if isinstance(item, h5py.Dataset): write...
<commit_before><commit_msg>Add a utility for indexing structure of HDF5 files<commit_after>
import csv import h5py import sys def hdf5_datasets(grp): """Print CSV data of all datasets in an HDF5 file. path, shape, dtype """ writer = csv.writer(sys.stdout) writer.writerow(['path', 'shape', 'dtype']) def visitor(path, item): if isinstance(item, h5py.Dataset): write...
Add a utility for indexing structure of HDF5 filesimport csv import h5py import sys def hdf5_datasets(grp): """Print CSV data of all datasets in an HDF5 file. path, shape, dtype """ writer = csv.writer(sys.stdout) writer.writerow(['path', 'shape', 'dtype']) def visitor(path, item): if...
<commit_before><commit_msg>Add a utility for indexing structure of HDF5 files<commit_after>import csv import h5py import sys def hdf5_datasets(grp): """Print CSV data of all datasets in an HDF5 file. path, shape, dtype """ writer = csv.writer(sys.stdout) writer.writerow(['path', 'shape', 'dtype'])...
a782f9b02a9e6dd1e72076605761759c883220e0
convert_sorted_array_to_binary_search_tree.py
convert_sorted_array_to_binary_search_tree.py
# coding: utf-8 # author: Fei Gao <[email protected]> # Problem: convert sorted array to binary search tree # # Given an array where elements are sorted in ascending order, # convert it to a height balanced BST. # # Subscribe to see which companies asked this question # # Show Tags # # Tree # Depth-first Sea...
Convert Sorted Array to Binary Search Tree
Convert Sorted Array to Binary Search Tree
Python
mit
feigaochn/leetcode
Convert Sorted Array to Binary Search Tree
# coding: utf-8 # author: Fei Gao <[email protected]> # Problem: convert sorted array to binary search tree # # Given an array where elements are sorted in ascending order, # convert it to a height balanced BST. # # Subscribe to see which companies asked this question # # Show Tags # # Tree # Depth-first Sea...
<commit_before><commit_msg>Convert Sorted Array to Binary Search Tree<commit_after>
# coding: utf-8 # author: Fei Gao <[email protected]> # Problem: convert sorted array to binary search tree # # Given an array where elements are sorted in ascending order, # convert it to a height balanced BST. # # Subscribe to see which companies asked this question # # Show Tags # # Tree # Depth-first Sea...
Convert Sorted Array to Binary Search Tree# coding: utf-8 # author: Fei Gao <[email protected]> # Problem: convert sorted array to binary search tree # # Given an array where elements are sorted in ascending order, # convert it to a height balanced BST. # # Subscribe to see which companies asked this question ...
<commit_before><commit_msg>Convert Sorted Array to Binary Search Tree<commit_after># coding: utf-8 # author: Fei Gao <[email protected]> # Problem: convert sorted array to binary search tree # # Given an array where elements are sorted in ascending order, # convert it to a height balanced BST. # # Subscribe to...
cf59fde7b54a2e537adad9695f04aeed1712e02d
d1lod/tests/test_util.py
d1lod/tests/test_util.py
"""test_util.py""" from d1lod import util def test_can_match_doi_strings(): """Tests the matching algorithm which takes unstructured strings and guesses their identifier structure using string-matching. """ assert util.getIdentifierScheme("http://doi.org/10.XX") == "doi" assert util.getIdentifi...
Add basic unit test of getIdentifierScheme
Add basic unit test of getIdentifierScheme
Python
apache-2.0
ec-geolink/d1lod,ec-geolink/d1lod,ec-geolink/d1lod,ec-geolink/d1lod
Add basic unit test of getIdentifierScheme
"""test_util.py""" from d1lod import util def test_can_match_doi_strings(): """Tests the matching algorithm which takes unstructured strings and guesses their identifier structure using string-matching. """ assert util.getIdentifierScheme("http://doi.org/10.XX") == "doi" assert util.getIdentifi...
<commit_before><commit_msg>Add basic unit test of getIdentifierScheme<commit_after>
"""test_util.py""" from d1lod import util def test_can_match_doi_strings(): """Tests the matching algorithm which takes unstructured strings and guesses their identifier structure using string-matching. """ assert util.getIdentifierScheme("http://doi.org/10.XX") == "doi" assert util.getIdentifi...
Add basic unit test of getIdentifierScheme"""test_util.py""" from d1lod import util def test_can_match_doi_strings(): """Tests the matching algorithm which takes unstructured strings and guesses their identifier structure using string-matching. """ assert util.getIdentifierScheme("http://doi.org/10...
<commit_before><commit_msg>Add basic unit test of getIdentifierScheme<commit_after>"""test_util.py""" from d1lod import util def test_can_match_doi_strings(): """Tests the matching algorithm which takes unstructured strings and guesses their identifier structure using string-matching. """ assert ut...