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
51a7d69b6c8cd1cceaccbb0288e1d9e222619b61
tests/test_controllers/test_hellocontroller.py
tests/test_controllers/test_hellocontroller.py
import unittest import sys import os sys.path.append(os.path.join(os.path.dirname(__file__), "..", "..")) from pkg_resources import require require("mock") from mock import Mock from malcolm.controllers.hellocontroller import HelloController class TestHelloController(unittest.TestCase): def test_init(self): ...
Add unit test for HelloController
Add unit test for HelloController
Python
apache-2.0
dls-controls/pymalcolm,dls-controls/pymalcolm,dls-controls/pymalcolm
Add unit test for HelloController
import unittest import sys import os sys.path.append(os.path.join(os.path.dirname(__file__), "..", "..")) from pkg_resources import require require("mock") from mock import Mock from malcolm.controllers.hellocontroller import HelloController class TestHelloController(unittest.TestCase): def test_init(self): ...
<commit_before><commit_msg>Add unit test for HelloController<commit_after>
import unittest import sys import os sys.path.append(os.path.join(os.path.dirname(__file__), "..", "..")) from pkg_resources import require require("mock") from mock import Mock from malcolm.controllers.hellocontroller import HelloController class TestHelloController(unittest.TestCase): def test_init(self): ...
Add unit test for HelloControllerimport unittest import sys import os sys.path.append(os.path.join(os.path.dirname(__file__), "..", "..")) from pkg_resources import require require("mock") from mock import Mock from malcolm.controllers.hellocontroller import HelloController class TestHelloController(unittest.TestCa...
<commit_before><commit_msg>Add unit test for HelloController<commit_after>import unittest import sys import os sys.path.append(os.path.join(os.path.dirname(__file__), "..", "..")) from pkg_resources import require require("mock") from mock import Mock from malcolm.controllers.hellocontroller import HelloController ...
f1b09372f3a4286925ba5892c3f5fded399932bb
generate-data-using-jmeter/05-fabric-create-salesman-order/fabfile.py
generate-data-using-jmeter/05-fabric-create-salesman-order/fabfile.py
from datetime import datetime, timedelta from fabric.api import local, task, lcd import random @task def create_salesman_order(): """ Create Sales Order GT # 1. date between START and END. # 2. work from Monday to Saturday. # 3. create number_order_on_day. # 4. time between 08:00 and 17:00. ...
Add generate data using jmeter: add fabric script.
Add generate data using jmeter: add fabric script.
Python
mit
tranhuucuong91/test-tools
Add generate data using jmeter: add fabric script.
from datetime import datetime, timedelta from fabric.api import local, task, lcd import random @task def create_salesman_order(): """ Create Sales Order GT # 1. date between START and END. # 2. work from Monday to Saturday. # 3. create number_order_on_day. # 4. time between 08:00 and 17:00. ...
<commit_before><commit_msg>Add generate data using jmeter: add fabric script.<commit_after>
from datetime import datetime, timedelta from fabric.api import local, task, lcd import random @task def create_salesman_order(): """ Create Sales Order GT # 1. date between START and END. # 2. work from Monday to Saturday. # 3. create number_order_on_day. # 4. time between 08:00 and 17:00. ...
Add generate data using jmeter: add fabric script.from datetime import datetime, timedelta from fabric.api import local, task, lcd import random @task def create_salesman_order(): """ Create Sales Order GT # 1. date between START and END. # 2. work from Monday to Saturday. # 3. create number_order_...
<commit_before><commit_msg>Add generate data using jmeter: add fabric script.<commit_after>from datetime import datetime, timedelta from fabric.api import local, task, lcd import random @task def create_salesman_order(): """ Create Sales Order GT # 1. date between START and END. # 2. work from Monday t...
29bd89c6ca182afa8b5f163ddf1bd985bec4ed3f
release-scripts/update-canonical-urls.py
release-scripts/update-canonical-urls.py
#!/usr/bin/env python import os import re VERSION_MASK = "__version__" def split_version(f): m = re.match("(master|v[0-9]+\\.[0-9]+)/", f) if m: return m.group(1), f[:m.start(1)] + VERSION_MASK + f[m.end(1):-3] return None, f[:-3] def version_later_than(v1, v2): # Basic implementation for ...
Automate calculation of canonical URLs
Automate calculation of canonical URLs
Python
apache-2.0
bcreane/calico,bcreane/calico,bcreane/calico,bcreane/calico,bcreane/calico,bcreane/calico
Automate calculation of canonical URLs
#!/usr/bin/env python import os import re VERSION_MASK = "__version__" def split_version(f): m = re.match("(master|v[0-9]+\\.[0-9]+)/", f) if m: return m.group(1), f[:m.start(1)] + VERSION_MASK + f[m.end(1):-3] return None, f[:-3] def version_later_than(v1, v2): # Basic implementation for ...
<commit_before><commit_msg>Automate calculation of canonical URLs<commit_after>
#!/usr/bin/env python import os import re VERSION_MASK = "__version__" def split_version(f): m = re.match("(master|v[0-9]+\\.[0-9]+)/", f) if m: return m.group(1), f[:m.start(1)] + VERSION_MASK + f[m.end(1):-3] return None, f[:-3] def version_later_than(v1, v2): # Basic implementation for ...
Automate calculation of canonical URLs#!/usr/bin/env python import os import re VERSION_MASK = "__version__" def split_version(f): m = re.match("(master|v[0-9]+\\.[0-9]+)/", f) if m: return m.group(1), f[:m.start(1)] + VERSION_MASK + f[m.end(1):-3] return None, f[:-3] def version_later_than(v1...
<commit_before><commit_msg>Automate calculation of canonical URLs<commit_after>#!/usr/bin/env python import os import re VERSION_MASK = "__version__" def split_version(f): m = re.match("(master|v[0-9]+\\.[0-9]+)/", f) if m: return m.group(1), f[:m.start(1)] + VERSION_MASK + f[m.end(1):-3] return...
62fa48e28ab46c4b48e9fcd3cc909b80f83c1fb6
examples/Numbers/numbers.py
examples/Numbers/numbers.py
from bessie import BaseClient, Endpoint class NumbersApi(BaseClient): endpoints = [ Endpoint('GET', 'random', None), Endpoint('GET', '<n>/trivia', None), Endpoint('GET', '<n>/date', None), Endpoint('GET', '<n1>/<n2>/date') ] base_url='http://numbersapi.com' if __name__ == '__main__': api = NumbersApi()...
Add very basic NumbersApi example
Add very basic NumbersApi example
Python
mit
andymitchhank/bessie
Add very basic NumbersApi example
from bessie import BaseClient, Endpoint class NumbersApi(BaseClient): endpoints = [ Endpoint('GET', 'random', None), Endpoint('GET', '<n>/trivia', None), Endpoint('GET', '<n>/date', None), Endpoint('GET', '<n1>/<n2>/date') ] base_url='http://numbersapi.com' if __name__ == '__main__': api = NumbersApi()...
<commit_before><commit_msg>Add very basic NumbersApi example<commit_after>
from bessie import BaseClient, Endpoint class NumbersApi(BaseClient): endpoints = [ Endpoint('GET', 'random', None), Endpoint('GET', '<n>/trivia', None), Endpoint('GET', '<n>/date', None), Endpoint('GET', '<n1>/<n2>/date') ] base_url='http://numbersapi.com' if __name__ == '__main__': api = NumbersApi()...
Add very basic NumbersApi examplefrom bessie import BaseClient, Endpoint class NumbersApi(BaseClient): endpoints = [ Endpoint('GET', 'random', None), Endpoint('GET', '<n>/trivia', None), Endpoint('GET', '<n>/date', None), Endpoint('GET', '<n1>/<n2>/date') ] base_url='http://numbersapi.com' if __name__ =...
<commit_before><commit_msg>Add very basic NumbersApi example<commit_after>from bessie import BaseClient, Endpoint class NumbersApi(BaseClient): endpoints = [ Endpoint('GET', 'random', None), Endpoint('GET', '<n>/trivia', None), Endpoint('GET', '<n>/date', None), Endpoint('GET', '<n1>/<n2>/date') ] base_ur...
eaed3dff1e478ee0ba9e1564ab22fc9ec059f166
skimage/transform/tests/test_pyramids.py
skimage/transform/tests/test_pyramids.py
from numpy.testing import assert_array_equal, run_module_suite from skimage import data from skimage.transform import (pyramid_reduce, pyramid_expand, build_gaussian_pyramid, build_laplacian_pyramid) image = data.lena() def test_pyramid_reduce(): rows, cols, dim = image.shape ...
Add tests for pyramid functions
Add tests for pyramid functions
Python
bsd-3-clause
michaelpacer/scikit-image,almarklein/scikit-image,bennlich/scikit-image,paalge/scikit-image,emon10005/scikit-image,youprofit/scikit-image,GaZ3ll3/scikit-image,SamHames/scikit-image,warmspringwinds/scikit-image,bsipocz/scikit-image,pratapvardhan/scikit-image,SamHames/scikit-image,rjeli/scikit-image,vighneshbirodkar/scik...
Add tests for pyramid functions
from numpy.testing import assert_array_equal, run_module_suite from skimage import data from skimage.transform import (pyramid_reduce, pyramid_expand, build_gaussian_pyramid, build_laplacian_pyramid) image = data.lena() def test_pyramid_reduce(): rows, cols, dim = image.shape ...
<commit_before><commit_msg>Add tests for pyramid functions<commit_after>
from numpy.testing import assert_array_equal, run_module_suite from skimage import data from skimage.transform import (pyramid_reduce, pyramid_expand, build_gaussian_pyramid, build_laplacian_pyramid) image = data.lena() def test_pyramid_reduce(): rows, cols, dim = image.shape ...
Add tests for pyramid functionsfrom numpy.testing import assert_array_equal, run_module_suite from skimage import data from skimage.transform import (pyramid_reduce, pyramid_expand, build_gaussian_pyramid, build_laplacian_pyramid) image = data.lena() def test_pyramid_reduce(): row...
<commit_before><commit_msg>Add tests for pyramid functions<commit_after>from numpy.testing import assert_array_equal, run_module_suite from skimage import data from skimage.transform import (pyramid_reduce, pyramid_expand, build_gaussian_pyramid, build_laplacian_pyramid) image = data.le...
5fcf221ab22e182b009bb95156e9789219bf50f4
ideascube/conf/kb_usa_wmapache.py
ideascube/conf/kb_usa_wmapache.py
# -*- coding: utf-8 -*- """KoomBook conf""" from .kb import * # noqa LANGUAGE_CODE = 'en' IDEASCUBE_NAME = 'WHITE MOUNTAIN APACHE' HOME_CARDS = STAFF_HOME_CARDS + [ { 'id': 'blog', }, { 'id': 'mediacenter', }, { 'id': 'gutenberg', }, { 'id': 'wiktionary', ...
Add conf file for KoomBook USA Apache
Add conf file for KoomBook USA Apache
Python
agpl-3.0
ideascube/ideascube,ideascube/ideascube,ideascube/ideascube,ideascube/ideascube
Add conf file for KoomBook USA Apache
# -*- coding: utf-8 -*- """KoomBook conf""" from .kb import * # noqa LANGUAGE_CODE = 'en' IDEASCUBE_NAME = 'WHITE MOUNTAIN APACHE' HOME_CARDS = STAFF_HOME_CARDS + [ { 'id': 'blog', }, { 'id': 'mediacenter', }, { 'id': 'gutenberg', }, { 'id': 'wiktionary', ...
<commit_before><commit_msg>Add conf file for KoomBook USA Apache<commit_after>
# -*- coding: utf-8 -*- """KoomBook conf""" from .kb import * # noqa LANGUAGE_CODE = 'en' IDEASCUBE_NAME = 'WHITE MOUNTAIN APACHE' HOME_CARDS = STAFF_HOME_CARDS + [ { 'id': 'blog', }, { 'id': 'mediacenter', }, { 'id': 'gutenberg', }, { 'id': 'wiktionary', ...
Add conf file for KoomBook USA Apache# -*- coding: utf-8 -*- """KoomBook conf""" from .kb import * # noqa LANGUAGE_CODE = 'en' IDEASCUBE_NAME = 'WHITE MOUNTAIN APACHE' HOME_CARDS = STAFF_HOME_CARDS + [ { 'id': 'blog', }, { 'id': 'mediacenter', }, { 'id': 'gutenberg', },...
<commit_before><commit_msg>Add conf file for KoomBook USA Apache<commit_after># -*- coding: utf-8 -*- """KoomBook conf""" from .kb import * # noqa LANGUAGE_CODE = 'en' IDEASCUBE_NAME = 'WHITE MOUNTAIN APACHE' HOME_CARDS = STAFF_HOME_CARDS + [ { 'id': 'blog', }, { 'id': 'mediacenter', }...
d3d45373acb04e4a6128874437092aabd55ceac9
scripts/emerge/automate_rfmake.py
scripts/emerge/automate_rfmake.py
""" Copyright [2009-2017] EMBL-European Bioinformatics Institute Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or a...
Add a script for running rfmake on emerge data
Add a script for running rfmake on emerge data
Python
apache-2.0
Rfam/rfam-production,Rfam/rfam-production,Rfam/rfam-production
Add a script for running rfmake on emerge data
""" Copyright [2009-2017] EMBL-European Bioinformatics Institute Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or a...
<commit_before><commit_msg>Add a script for running rfmake on emerge data<commit_after>
""" Copyright [2009-2017] EMBL-European Bioinformatics Institute Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or a...
Add a script for running rfmake on emerge data""" Copyright [2009-2017] EMBL-European Bioinformatics Institute 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/LICE...
<commit_before><commit_msg>Add a script for running rfmake on emerge data<commit_after>""" Copyright [2009-2017] EMBL-European Bioinformatics Institute 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...
462e4ca5c6d15e50c781d5c29a478df276543440
scripts/verify-locale-keys-usage.py
scripts/verify-locale-keys-usage.py
import json import os ROOT_PATH = os.path.dirname(os.path.dirname(__file__)) DEFAULT_LOCALE_PATH = os.path.join(ROOT_PATH, "app/locales/taiga/locale-en.json") def keywords(key, value): if key is not None and not isinstance(value, dict): return [".".join(key)] if key is not None and isinstance(value,...
Add verify locale keys usage script
Add verify locale keys usage script
Python
agpl-3.0
taigaio/taiga-front,taigaio/taiga-front,taigaio/taiga-front
Add verify locale keys usage script
import json import os ROOT_PATH = os.path.dirname(os.path.dirname(__file__)) DEFAULT_LOCALE_PATH = os.path.join(ROOT_PATH, "app/locales/taiga/locale-en.json") def keywords(key, value): if key is not None and not isinstance(value, dict): return [".".join(key)] if key is not None and isinstance(value,...
<commit_before><commit_msg>Add verify locale keys usage script<commit_after>
import json import os ROOT_PATH = os.path.dirname(os.path.dirname(__file__)) DEFAULT_LOCALE_PATH = os.path.join(ROOT_PATH, "app/locales/taiga/locale-en.json") def keywords(key, value): if key is not None and not isinstance(value, dict): return [".".join(key)] if key is not None and isinstance(value,...
Add verify locale keys usage scriptimport json import os ROOT_PATH = os.path.dirname(os.path.dirname(__file__)) DEFAULT_LOCALE_PATH = os.path.join(ROOT_PATH, "app/locales/taiga/locale-en.json") def keywords(key, value): if key is not None and not isinstance(value, dict): return [".".join(key)] if ke...
<commit_before><commit_msg>Add verify locale keys usage script<commit_after>import json import os ROOT_PATH = os.path.dirname(os.path.dirname(__file__)) DEFAULT_LOCALE_PATH = os.path.join(ROOT_PATH, "app/locales/taiga/locale-en.json") def keywords(key, value): if key is not None and not isinstance(value, dict): ...
557350d511b04f85f46b0693fa5769ebd3468793
tests/test_js_bootstrapped.py
tests/test_js_bootstrapped.py
from validator.errorbundler import ErrorBundle from validator.testcases import scripting scripting.traverser.DEBUG = True def _test(script): err = ErrorBundle() err.save_resource("em:bootstrap", "true") scripting.test_js_file(err, "foo", script) return err def test_bootstrapped(): "Performs a t...
Add tests for (and fix a minor bug in) the last two commits.
Add tests for (and fix a minor bug in) the last two commits.
Python
bsd-3-clause
eviljeff/app-validator,eviljeff/app-validator,diox/amo-validator,muffinresearch/amo-validator,eviljeff/app-validator,kmaglione/amo-validator,kumar303/amo-validator,mstriemer/amo-validator,muffinresearch/amo-validator,mozilla/app-validator,eviljeff/app-validator,diox/amo-validator,stasm/app-validator,mattbasta/perfalato...
Add tests for (and fix a minor bug in) the last two commits.
from validator.errorbundler import ErrorBundle from validator.testcases import scripting scripting.traverser.DEBUG = True def _test(script): err = ErrorBundle() err.save_resource("em:bootstrap", "true") scripting.test_js_file(err, "foo", script) return err def test_bootstrapped(): "Performs a t...
<commit_before><commit_msg>Add tests for (and fix a minor bug in) the last two commits.<commit_after>
from validator.errorbundler import ErrorBundle from validator.testcases import scripting scripting.traverser.DEBUG = True def _test(script): err = ErrorBundle() err.save_resource("em:bootstrap", "true") scripting.test_js_file(err, "foo", script) return err def test_bootstrapped(): "Performs a t...
Add tests for (and fix a minor bug in) the last two commits.from validator.errorbundler import ErrorBundle from validator.testcases import scripting scripting.traverser.DEBUG = True def _test(script): err = ErrorBundle() err.save_resource("em:bootstrap", "true") scripting.test_js_file(err, "foo", script) ...
<commit_before><commit_msg>Add tests for (and fix a minor bug in) the last two commits.<commit_after>from validator.errorbundler import ErrorBundle from validator.testcases import scripting scripting.traverser.DEBUG = True def _test(script): err = ErrorBundle() err.save_resource("em:bootstrap", "true") sc...
dcdf0247ff1612ef257a5ab49fe54c7f56c19ea3
tests/data_checks/test_gold_standards.py
tests/data_checks/test_gold_standards.py
# ------------------------------------------------ # built-ins import unittest # local from utils.base import TestPostgapBase # ------------------------------------------------ # TODO: Expected (target, disease) pairs from experts EXPECTED_ASSOCIATIONS = [ ('ENSG00001', 'EFO_00001'), ('ENSG00002', 'EFO_00001'...
Add placeholder for gold standard
Add placeholder for gold standard
Python
apache-2.0
Ensembl/cttv024,Ensembl/cttv024
Add placeholder for gold standard
# ------------------------------------------------ # built-ins import unittest # local from utils.base import TestPostgapBase # ------------------------------------------------ # TODO: Expected (target, disease) pairs from experts EXPECTED_ASSOCIATIONS = [ ('ENSG00001', 'EFO_00001'), ('ENSG00002', 'EFO_00001'...
<commit_before><commit_msg>Add placeholder for gold standard<commit_after>
# ------------------------------------------------ # built-ins import unittest # local from utils.base import TestPostgapBase # ------------------------------------------------ # TODO: Expected (target, disease) pairs from experts EXPECTED_ASSOCIATIONS = [ ('ENSG00001', 'EFO_00001'), ('ENSG00002', 'EFO_00001'...
Add placeholder for gold standard# ------------------------------------------------ # built-ins import unittest # local from utils.base import TestPostgapBase # ------------------------------------------------ # TODO: Expected (target, disease) pairs from experts EXPECTED_ASSOCIATIONS = [ ('ENSG00001', 'EFO_00001...
<commit_before><commit_msg>Add placeholder for gold standard<commit_after># ------------------------------------------------ # built-ins import unittest # local from utils.base import TestPostgapBase # ------------------------------------------------ # TODO: Expected (target, disease) pairs from experts EXPECTED_ASSO...
31da92f943c8db6b81c41bbca49f461250b9ae83
tests/server/blueprints/phenotypes/test_server_phenotypes.py
tests/server/blueprints/phenotypes/test_server_phenotypes.py
# -*- coding: utf-8 -*- from flask import url_for def test_phenotypes(app, institute_obj): # GIVEN an initialized app # GIVEN a valid user and institute with app.test_client() as client: # GIVEN that the user could be logged in resp = client.get(url_for('auto_login')) assert resp.s...
Add test for phenotypes page.
Add test for phenotypes page.
Python
bsd-3-clause
Clinical-Genomics/scout,Clinical-Genomics/scout,Clinical-Genomics/scout
Add test for phenotypes page.
# -*- coding: utf-8 -*- from flask import url_for def test_phenotypes(app, institute_obj): # GIVEN an initialized app # GIVEN a valid user and institute with app.test_client() as client: # GIVEN that the user could be logged in resp = client.get(url_for('auto_login')) assert resp.s...
<commit_before><commit_msg>Add test for phenotypes page.<commit_after>
# -*- coding: utf-8 -*- from flask import url_for def test_phenotypes(app, institute_obj): # GIVEN an initialized app # GIVEN a valid user and institute with app.test_client() as client: # GIVEN that the user could be logged in resp = client.get(url_for('auto_login')) assert resp.s...
Add test for phenotypes page.# -*- coding: utf-8 -*- from flask import url_for def test_phenotypes(app, institute_obj): # GIVEN an initialized app # GIVEN a valid user and institute with app.test_client() as client: # GIVEN that the user could be logged in resp = client.get(url_for('auto_l...
<commit_before><commit_msg>Add test for phenotypes page.<commit_after># -*- coding: utf-8 -*- from flask import url_for def test_phenotypes(app, institute_obj): # GIVEN an initialized app # GIVEN a valid user and institute with app.test_client() as client: # GIVEN that the user could be logged in ...
90c3f568b1179e4c5da9f8349f909d25e5221f10
tests/integration/modules/test_win_ip.py
tests/integration/modules/test_win_ip.py
# -*- coding: utf-8 -*- # Import Python libs from __future__ import absolute_import import re # Import Salt Testing libs from tests.support.case import ModuleCase from tests.support.unit import skipIf # Import Salt libs import salt.utils @skipIf(not salt.utils.is_windows(), 'windows test only') class WinIPTest(Mod...
Add windows ip module integration tests
Add windows ip module integration tests
Python
apache-2.0
saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt
Add windows ip module integration tests
# -*- coding: utf-8 -*- # Import Python libs from __future__ import absolute_import import re # Import Salt Testing libs from tests.support.case import ModuleCase from tests.support.unit import skipIf # Import Salt libs import salt.utils @skipIf(not salt.utils.is_windows(), 'windows test only') class WinIPTest(Mod...
<commit_before><commit_msg>Add windows ip module integration tests<commit_after>
# -*- coding: utf-8 -*- # Import Python libs from __future__ import absolute_import import re # Import Salt Testing libs from tests.support.case import ModuleCase from tests.support.unit import skipIf # Import Salt libs import salt.utils @skipIf(not salt.utils.is_windows(), 'windows test only') class WinIPTest(Mod...
Add windows ip module integration tests# -*- coding: utf-8 -*- # Import Python libs from __future__ import absolute_import import re # Import Salt Testing libs from tests.support.case import ModuleCase from tests.support.unit import skipIf # Import Salt libs import salt.utils @skipIf(not salt.utils.is_windows(), '...
<commit_before><commit_msg>Add windows ip module integration tests<commit_after># -*- coding: utf-8 -*- # Import Python libs from __future__ import absolute_import import re # Import Salt Testing libs from tests.support.case import ModuleCase from tests.support.unit import skipIf # Import Salt libs import salt.utils...
faa4f2f26b051dc9946d9ee1d3ca209aebdd8880
p3/templatetags/accepted_talks.py
p3/templatetags/accepted_talks.py
from __future__ import unicode_literals from django import template from conference import models from ..utils import profile_url, talk_title register = template.Library() # These must match the talk .type or .admin_type TYPE_NAMES = ( ('k', 'Keynotes', ''), ('t', 'Talks', ''), ('r', 'Training sessions'...
Add basic accepted talks template tag
Add basic accepted talks template tag
Python
bsd-2-clause
artcz/epcon,EuroPython/epcon,artcz/epcon,EuroPython/epcon,malemburg/epcon,artcz/epcon,matrixise/epcon,EuroPython/epcon,malemburg/epcon,matrixise/epcon,malemburg/epcon,artcz/epcon,malemburg/epcon,artcz/epcon,matrixise/epcon,EuroPython/epcon,matrixise/epcon,matrixise/epcon,artcz/epcon,matrixise/epcon,malemburg/epcon,male...
Add basic accepted talks template tag
from __future__ import unicode_literals from django import template from conference import models from ..utils import profile_url, talk_title register = template.Library() # These must match the talk .type or .admin_type TYPE_NAMES = ( ('k', 'Keynotes', ''), ('t', 'Talks', ''), ('r', 'Training sessions'...
<commit_before><commit_msg>Add basic accepted talks template tag<commit_after>
from __future__ import unicode_literals from django import template from conference import models from ..utils import profile_url, talk_title register = template.Library() # These must match the talk .type or .admin_type TYPE_NAMES = ( ('k', 'Keynotes', ''), ('t', 'Talks', ''), ('r', 'Training sessions'...
Add basic accepted talks template tagfrom __future__ import unicode_literals from django import template from conference import models from ..utils import profile_url, talk_title register = template.Library() # These must match the talk .type or .admin_type TYPE_NAMES = ( ('k', 'Keynotes', ''), ('t', 'Talks...
<commit_before><commit_msg>Add basic accepted talks template tag<commit_after>from __future__ import unicode_literals from django import template from conference import models from ..utils import profile_url, talk_title register = template.Library() # These must match the talk .type or .admin_type TYPE_NAMES = ( ...
1740e3550ecd73c296a5adf90383ebb7c6c1fcf2
katagawa/engine/__init__.py
katagawa/engine/__init__.py
""" Katagawa engines are the actual SQL connections behind the scenes. They actually emit the raw SQL to the database server, and return the results produced. """ import importlib import dsnparse import logging from katagawa.engine.base import BaseEngine BASE_PATH = "katagawa.engine.backends" logger = logging.getL...
Add a `create_engine` function which creates an engine from a DSN.
Add a `create_engine` function which creates an engine from a DSN.
Python
mit
SunDwarf/asyncqlio
Add a `create_engine` function which creates an engine from a DSN.
""" Katagawa engines are the actual SQL connections behind the scenes. They actually emit the raw SQL to the database server, and return the results produced. """ import importlib import dsnparse import logging from katagawa.engine.base import BaseEngine BASE_PATH = "katagawa.engine.backends" logger = logging.getL...
<commit_before><commit_msg>Add a `create_engine` function which creates an engine from a DSN.<commit_after>
""" Katagawa engines are the actual SQL connections behind the scenes. They actually emit the raw SQL to the database server, and return the results produced. """ import importlib import dsnparse import logging from katagawa.engine.base import BaseEngine BASE_PATH = "katagawa.engine.backends" logger = logging.getL...
Add a `create_engine` function which creates an engine from a DSN.""" Katagawa engines are the actual SQL connections behind the scenes. They actually emit the raw SQL to the database server, and return the results produced. """ import importlib import dsnparse import logging from katagawa.engine.base import BaseEng...
<commit_before><commit_msg>Add a `create_engine` function which creates an engine from a DSN.<commit_after>""" Katagawa engines are the actual SQL connections behind the scenes. They actually emit the raw SQL to the database server, and return the results produced. """ import importlib import dsnparse import logging ...
3ea5e8956987b2c7ff0830186ca601118693f3d1
benchmarks/legendre1_sage.py
benchmarks/legendre1_sage.py
print "import..." from timeit import default_timer as clock from sage.all import var, Integer print " done." def fact(n): if n in [0, 1]: return 1 else: return n*fact(n-1) def diff(e, x, n): for i in range(n): e = e.diff(x) return e def legendre(n, x): e = Integer(1)/(I...
Add the Legendre benchmark in Sage
Add the Legendre benchmark in Sage
Python
mit
symengine/symengine.py,symengine/symengine.py,bjodah/symengine.py,symengine/symengine.py,bjodah/symengine.py,bjodah/symengine.py
Add the Legendre benchmark in Sage
print "import..." from timeit import default_timer as clock from sage.all import var, Integer print " done." def fact(n): if n in [0, 1]: return 1 else: return n*fact(n-1) def diff(e, x, n): for i in range(n): e = e.diff(x) return e def legendre(n, x): e = Integer(1)/(I...
<commit_before><commit_msg>Add the Legendre benchmark in Sage<commit_after>
print "import..." from timeit import default_timer as clock from sage.all import var, Integer print " done." def fact(n): if n in [0, 1]: return 1 else: return n*fact(n-1) def diff(e, x, n): for i in range(n): e = e.diff(x) return e def legendre(n, x): e = Integer(1)/(I...
Add the Legendre benchmark in Sageprint "import..." from timeit import default_timer as clock from sage.all import var, Integer print " done." def fact(n): if n in [0, 1]: return 1 else: return n*fact(n-1) def diff(e, x, n): for i in range(n): e = e.diff(x) return e def leg...
<commit_before><commit_msg>Add the Legendre benchmark in Sage<commit_after>print "import..." from timeit import default_timer as clock from sage.all import var, Integer print " done." def fact(n): if n in [0, 1]: return 1 else: return n*fact(n-1) def diff(e, x, n): for i in range(n): ...
e28ebe8bf2209d624e4b9470a4f86dcffcc5be56
src/80_Remove_Duplicates_from_Sorted_Array_II.py
src/80_Remove_Duplicates_from_Sorted_Array_II.py
class Solution(object): def removeDuplicates(self, nums): """ :type nums: List[int] :rtype: int """ k = 2 if len(nums) == 0: return 0 m = 1 count = 1 for i in range(1, len(nums)): if nums[i] == nums[i - 1]: ...
Remove Duplicates from Sorted Array II
完成了第80题: Remove Duplicates from Sorted Array II
Python
mit
ChuanleiGuo/AlgorithmsPlayground,ChuanleiGuo/AlgorithmsPlayground,ChuanleiGuo/AlgorithmsPlayground,ChuanleiGuo/AlgorithmsPlayground
完成了第80题: Remove Duplicates from Sorted Array II
class Solution(object): def removeDuplicates(self, nums): """ :type nums: List[int] :rtype: int """ k = 2 if len(nums) == 0: return 0 m = 1 count = 1 for i in range(1, len(nums)): if nums[i] == nums[i - 1]: ...
<commit_before><commit_msg>完成了第80题: Remove Duplicates from Sorted Array II<commit_after>
class Solution(object): def removeDuplicates(self, nums): """ :type nums: List[int] :rtype: int """ k = 2 if len(nums) == 0: return 0 m = 1 count = 1 for i in range(1, len(nums)): if nums[i] == nums[i - 1]: ...
完成了第80题: Remove Duplicates from Sorted Array IIclass Solution(object): def removeDuplicates(self, nums): """ :type nums: List[int] :rtype: int """ k = 2 if len(nums) == 0: return 0 m = 1 count = 1 for i in range(1, len(nums)): ...
<commit_before><commit_msg>完成了第80题: Remove Duplicates from Sorted Array II<commit_after>class Solution(object): def removeDuplicates(self, nums): """ :type nums: List[int] :rtype: int """ k = 2 if len(nums) == 0: return 0 m = 1 count = 1 ...
2b793812b0e237e90048c33439ac940466ad068a
mapping/make_num_from_fq.py
mapping/make_num_from_fq.py
import gzip from sys import argv if __name__ == "__main__": fastq = gzip.open(argv[1], 'rt') base, _ = argv[1].rsplit('.remap', 1) num = gzip.open(base+'.to.remap.num.gz', 'wt') line = next(fastq) last = '' while line: curr, counts = line.strip().rsplit(':', 1) if curr != last: ...
Add script to make the .num.txt.gz file from the fastq
Add script to make the .num.txt.gz file from the fastq
Python
apache-2.0
TheFraserLab/Hornet
Add script to make the .num.txt.gz file from the fastq
import gzip from sys import argv if __name__ == "__main__": fastq = gzip.open(argv[1], 'rt') base, _ = argv[1].rsplit('.remap', 1) num = gzip.open(base+'.to.remap.num.gz', 'wt') line = next(fastq) last = '' while line: curr, counts = line.strip().rsplit(':', 1) if curr != last: ...
<commit_before><commit_msg>Add script to make the .num.txt.gz file from the fastq<commit_after>
import gzip from sys import argv if __name__ == "__main__": fastq = gzip.open(argv[1], 'rt') base, _ = argv[1].rsplit('.remap', 1) num = gzip.open(base+'.to.remap.num.gz', 'wt') line = next(fastq) last = '' while line: curr, counts = line.strip().rsplit(':', 1) if curr != last: ...
Add script to make the .num.txt.gz file from the fastqimport gzip from sys import argv if __name__ == "__main__": fastq = gzip.open(argv[1], 'rt') base, _ = argv[1].rsplit('.remap', 1) num = gzip.open(base+'.to.remap.num.gz', 'wt') line = next(fastq) last = '' while line: curr, counts =...
<commit_before><commit_msg>Add script to make the .num.txt.gz file from the fastq<commit_after>import gzip from sys import argv if __name__ == "__main__": fastq = gzip.open(argv[1], 'rt') base, _ = argv[1].rsplit('.remap', 1) num = gzip.open(base+'.to.remap.num.gz', 'wt') line = next(fastq) last = ...
a3d5736fdd8ae747bb7c375ddf1e7934f2227d25
go/tests/test_urls.py
go/tests/test_urls.py
from django.core.urlresolvers import reverse from go.base.tests.helpers import GoDjangoTestCase, DjangoVumiApiHelper class TestLoginAs(GoDjangoTestCase): def setUp(self): self.vumi_helper = self.add_helper(DjangoVumiApiHelper()) self.superuser_helper = self.vumi_helper.make_django_user( ...
Add tests for login-as URLs.
Add tests for login-as URLs.
Python
bsd-3-clause
praekelt/vumi-go,praekelt/vumi-go,praekelt/vumi-go,praekelt/vumi-go
Add tests for login-as URLs.
from django.core.urlresolvers import reverse from go.base.tests.helpers import GoDjangoTestCase, DjangoVumiApiHelper class TestLoginAs(GoDjangoTestCase): def setUp(self): self.vumi_helper = self.add_helper(DjangoVumiApiHelper()) self.superuser_helper = self.vumi_helper.make_django_user( ...
<commit_before><commit_msg>Add tests for login-as URLs.<commit_after>
from django.core.urlresolvers import reverse from go.base.tests.helpers import GoDjangoTestCase, DjangoVumiApiHelper class TestLoginAs(GoDjangoTestCase): def setUp(self): self.vumi_helper = self.add_helper(DjangoVumiApiHelper()) self.superuser_helper = self.vumi_helper.make_django_user( ...
Add tests for login-as URLs.from django.core.urlresolvers import reverse from go.base.tests.helpers import GoDjangoTestCase, DjangoVumiApiHelper class TestLoginAs(GoDjangoTestCase): def setUp(self): self.vumi_helper = self.add_helper(DjangoVumiApiHelper()) self.superuser_helper = self.vumi_helpe...
<commit_before><commit_msg>Add tests for login-as URLs.<commit_after>from django.core.urlresolvers import reverse from go.base.tests.helpers import GoDjangoTestCase, DjangoVumiApiHelper class TestLoginAs(GoDjangoTestCase): def setUp(self): self.vumi_helper = self.add_helper(DjangoVumiApiHelper()) ...
aab3ddec9fc0c88bf6fb96e1efd762a277cb48ad
ideascube/conf/kb_eth_kytabu.py
ideascube/conf/kb_eth_kytabu.py
# -*- coding: utf-8 -*- """KoomBook conf""" from .kb import * # noqa LANGUAGE_CODE = 'fr' IDEASCUBE_NAME = 'KYTABU' HOME_CARDS = STAFF_HOME_CARDS + [ { 'id': 'blog', }, { 'id': 'mediacenter', }, { 'id': 'gutenberg', }, { 'id': 'khanacademy', }, ]
Add conf file for KoomBook Kytabu
Add conf file for KoomBook Kytabu
Python
agpl-3.0
ideascube/ideascube,ideascube/ideascube,ideascube/ideascube,ideascube/ideascube
Add conf file for KoomBook Kytabu
# -*- coding: utf-8 -*- """KoomBook conf""" from .kb import * # noqa LANGUAGE_CODE = 'fr' IDEASCUBE_NAME = 'KYTABU' HOME_CARDS = STAFF_HOME_CARDS + [ { 'id': 'blog', }, { 'id': 'mediacenter', }, { 'id': 'gutenberg', }, { 'id': 'khanacademy', }, ]
<commit_before><commit_msg>Add conf file for KoomBook Kytabu<commit_after>
# -*- coding: utf-8 -*- """KoomBook conf""" from .kb import * # noqa LANGUAGE_CODE = 'fr' IDEASCUBE_NAME = 'KYTABU' HOME_CARDS = STAFF_HOME_CARDS + [ { 'id': 'blog', }, { 'id': 'mediacenter', }, { 'id': 'gutenberg', }, { 'id': 'khanacademy', }, ]
Add conf file for KoomBook Kytabu# -*- coding: utf-8 -*- """KoomBook conf""" from .kb import * # noqa LANGUAGE_CODE = 'fr' IDEASCUBE_NAME = 'KYTABU' HOME_CARDS = STAFF_HOME_CARDS + [ { 'id': 'blog', }, { 'id': 'mediacenter', }, { 'id': 'gutenberg', }, { 'id'...
<commit_before><commit_msg>Add conf file for KoomBook Kytabu<commit_after># -*- coding: utf-8 -*- """KoomBook conf""" from .kb import * # noqa LANGUAGE_CODE = 'fr' IDEASCUBE_NAME = 'KYTABU' HOME_CARDS = STAFF_HOME_CARDS + [ { 'id': 'blog', }, { 'id': 'mediacenter', }, { 'id...
677f721e38dcbefaf9378eba6e54a5f4b63c1a3f
migrations/versions/febbe2d7e47b_use_largebinary_for_fernet_key_columns.py
migrations/versions/febbe2d7e47b_use_largebinary_for_fernet_key_columns.py
"""Use LargeBinary for fernet key columns. Revision ID: febbe2d7e47b Revises: 8c431c5e70a8 Create Date: 2022-03-19 11:40:07.203662 """ import sqlalchemy as sa from alembic import op # revision identifiers, used by Alembic. revision = "febbe2d7e47b" down_revision = "8c431c5e70a8" def upgrade(): with op.batch_al...
Create migration febbe2d7e47b for fernet columns
Create migration febbe2d7e47b for fernet columns Updates fastly_encrypted_api_key and aws_encrypted_secret_key to use LargeBinary types for their columns.
Python
mit
lsst-sqre/ltd-keeper,lsst-sqre/ltd-keeper
Create migration febbe2d7e47b for fernet columns Updates fastly_encrypted_api_key and aws_encrypted_secret_key to use LargeBinary types for their columns.
"""Use LargeBinary for fernet key columns. Revision ID: febbe2d7e47b Revises: 8c431c5e70a8 Create Date: 2022-03-19 11:40:07.203662 """ import sqlalchemy as sa from alembic import op # revision identifiers, used by Alembic. revision = "febbe2d7e47b" down_revision = "8c431c5e70a8" def upgrade(): with op.batch_al...
<commit_before><commit_msg>Create migration febbe2d7e47b for fernet columns Updates fastly_encrypted_api_key and aws_encrypted_secret_key to use LargeBinary types for their columns.<commit_after>
"""Use LargeBinary for fernet key columns. Revision ID: febbe2d7e47b Revises: 8c431c5e70a8 Create Date: 2022-03-19 11:40:07.203662 """ import sqlalchemy as sa from alembic import op # revision identifiers, used by Alembic. revision = "febbe2d7e47b" down_revision = "8c431c5e70a8" def upgrade(): with op.batch_al...
Create migration febbe2d7e47b for fernet columns Updates fastly_encrypted_api_key and aws_encrypted_secret_key to use LargeBinary types for their columns."""Use LargeBinary for fernet key columns. Revision ID: febbe2d7e47b Revises: 8c431c5e70a8 Create Date: 2022-03-19 11:40:07.203662 """ import sqlalchemy as sa from...
<commit_before><commit_msg>Create migration febbe2d7e47b for fernet columns Updates fastly_encrypted_api_key and aws_encrypted_secret_key to use LargeBinary types for their columns.<commit_after>"""Use LargeBinary for fernet key columns. Revision ID: febbe2d7e47b Revises: 8c431c5e70a8 Create Date: 2022-03-19 11:40:07...
46c140bd441904f9cbfa655382223363c6e6e2fc
server/tests/test_views.py
server/tests/test_views.py
from django.contrib.auth.models import User as AuthUser from django.core.urlresolvers import resolve from django.http import HttpRequest from django.template.loader import render_to_string from django.test import TestCase from django.utils.html import escape from server.models import Player, Song, Request class SongR...
Add first test for views
Add first test for views
Python
bsd-3-clause
raspberrywhite/raspberrywhite,raspberrywhite/raspberrywhite,raspberrywhite/raspberrywhite,raspberrywhite/raspberrywhite
Add first test for views
from django.contrib.auth.models import User as AuthUser from django.core.urlresolvers import resolve from django.http import HttpRequest from django.template.loader import render_to_string from django.test import TestCase from django.utils.html import escape from server.models import Player, Song, Request class SongR...
<commit_before><commit_msg>Add first test for views<commit_after>
from django.contrib.auth.models import User as AuthUser from django.core.urlresolvers import resolve from django.http import HttpRequest from django.template.loader import render_to_string from django.test import TestCase from django.utils.html import escape from server.models import Player, Song, Request class SongR...
Add first test for viewsfrom django.contrib.auth.models import User as AuthUser from django.core.urlresolvers import resolve from django.http import HttpRequest from django.template.loader import render_to_string from django.test import TestCase from django.utils.html import escape from server.models import Player, So...
<commit_before><commit_msg>Add first test for views<commit_after>from django.contrib.auth.models import User as AuthUser from django.core.urlresolvers import resolve from django.http import HttpRequest from django.template.loader import render_to_string from django.test import TestCase from django.utils.html import esc...
e30333f6c7d4dfc14934fea6d379ba0ae035ce0f
numba/cuda/tests/cudadrv/test_ir_patch.py
numba/cuda/tests/cudadrv/test_ir_patch.py
from __future__ import print_function, absolute_import, division from numba.cuda.testing import unittest from numba.cuda.testing import skip_on_cudasim from numba.cuda.cudadrv.nvvm import llvm39_to_34_ir @skip_on_cudasim('Linking unsupported in the simulator') class TestIRPatch(unittest.TestCase): def test_load_...
Add tests for ir downgrade patch
Add tests for ir downgrade patch
Python
bsd-2-clause
jriehl/numba,sklam/numba,cpcloud/numba,IntelLabs/numba,jriehl/numba,stuartarchibald/numba,cpcloud/numba,jriehl/numba,numba/numba,stonebig/numba,stuartarchibald/numba,stonebig/numba,sklam/numba,IntelLabs/numba,gmarkall/numba,numba/numba,cpcloud/numba,seibert/numba,seibert/numba,sklam/numba,gmarkall/numba,numba/numba,skl...
Add tests for ir downgrade patch
from __future__ import print_function, absolute_import, division from numba.cuda.testing import unittest from numba.cuda.testing import skip_on_cudasim from numba.cuda.cudadrv.nvvm import llvm39_to_34_ir @skip_on_cudasim('Linking unsupported in the simulator') class TestIRPatch(unittest.TestCase): def test_load_...
<commit_before><commit_msg>Add tests for ir downgrade patch<commit_after>
from __future__ import print_function, absolute_import, division from numba.cuda.testing import unittest from numba.cuda.testing import skip_on_cudasim from numba.cuda.cudadrv.nvvm import llvm39_to_34_ir @skip_on_cudasim('Linking unsupported in the simulator') class TestIRPatch(unittest.TestCase): def test_load_...
Add tests for ir downgrade patchfrom __future__ import print_function, absolute_import, division from numba.cuda.testing import unittest from numba.cuda.testing import skip_on_cudasim from numba.cuda.cudadrv.nvvm import llvm39_to_34_ir @skip_on_cudasim('Linking unsupported in the simulator') class TestIRPatch(unitte...
<commit_before><commit_msg>Add tests for ir downgrade patch<commit_after>from __future__ import print_function, absolute_import, division from numba.cuda.testing import unittest from numba.cuda.testing import skip_on_cudasim from numba.cuda.cudadrv.nvvm import llvm39_to_34_ir @skip_on_cudasim('Linking unsupported in...
02740a850817d2d3294965e97333218b5f44f532
setup.py
setup.py
# -*- coding: utf-8 -*- import os from setuptools import setup def read(fname): try: return open(os.path.join(os.path.dirname(__file__), fname)).read() except: return '' setup( name='todoist-python', version='0.2.15', packages=['todoist', 'todoist.managers'], author='Doist Team...
# -*- coding: utf-8 -*- import os from setuptools import setup def read(fname): try: return open(os.path.join(os.path.dirname(__file__), fname)).read() except: return '' setup( name='todoist-python', version='0.2.16', packages=['todoist', 'todoist.managers'], author='Doist Team...
Update the PyPI version to 0.2.16.
Update the PyPI version to 0.2.16.
Python
mit
electronick1/todoist-python,Doist/todoist-python
# -*- coding: utf-8 -*- import os from setuptools import setup def read(fname): try: return open(os.path.join(os.path.dirname(__file__), fname)).read() except: return '' setup( name='todoist-python', version='0.2.15', packages=['todoist', 'todoist.managers'], author='Doist Team...
# -*- coding: utf-8 -*- import os from setuptools import setup def read(fname): try: return open(os.path.join(os.path.dirname(__file__), fname)).read() except: return '' setup( name='todoist-python', version='0.2.16', packages=['todoist', 'todoist.managers'], author='Doist Team...
<commit_before># -*- coding: utf-8 -*- import os from setuptools import setup def read(fname): try: return open(os.path.join(os.path.dirname(__file__), fname)).read() except: return '' setup( name='todoist-python', version='0.2.15', packages=['todoist', 'todoist.managers'], aut...
# -*- coding: utf-8 -*- import os from setuptools import setup def read(fname): try: return open(os.path.join(os.path.dirname(__file__), fname)).read() except: return '' setup( name='todoist-python', version='0.2.16', packages=['todoist', 'todoist.managers'], author='Doist Team...
# -*- coding: utf-8 -*- import os from setuptools import setup def read(fname): try: return open(os.path.join(os.path.dirname(__file__), fname)).read() except: return '' setup( name='todoist-python', version='0.2.15', packages=['todoist', 'todoist.managers'], author='Doist Team...
<commit_before># -*- coding: utf-8 -*- import os from setuptools import setup def read(fname): try: return open(os.path.join(os.path.dirname(__file__), fname)).read() except: return '' setup( name='todoist-python', version='0.2.15', packages=['todoist', 'todoist.managers'], aut...
145cf9e539d44b3996a4ab916edb7873fa5090f0
other/wrapping-cpp/swig/c++/test_mylib.py
other/wrapping-cpp/swig/c++/test_mylib.py
import os import pytest @pytest.fixture def setup(request): def teardown(): print("Running make clean") os.system('make clean') print("Completed finaliser") request.addfinalizer(teardown) os.system('make clean') os.system('make all') def test_squared(setup): import mylib ...
import os import pytest # Need to call Makefile in directory where this test file is def call_make(target): # where is this file this_file = os.path.realpath(__file__) this_dir = os.path.split(this_file)[0] cd_command = "cd {}".format(this_dir) make_command = "make {}".format(target) command =...
Allow file to be called from other directories
Allow file to be called from other directories
Python
bsd-2-clause
fangohr/oommf-python,ryanpepper/oommf-python,ryanpepper/oommf-python,ryanpepper/oommf-python,fangohr/oommf-python,fangohr/oommf-python,ryanpepper/oommf-python
import os import pytest @pytest.fixture def setup(request): def teardown(): print("Running make clean") os.system('make clean') print("Completed finaliser") request.addfinalizer(teardown) os.system('make clean') os.system('make all') def test_squared(setup): import mylib ...
import os import pytest # Need to call Makefile in directory where this test file is def call_make(target): # where is this file this_file = os.path.realpath(__file__) this_dir = os.path.split(this_file)[0] cd_command = "cd {}".format(this_dir) make_command = "make {}".format(target) command =...
<commit_before>import os import pytest @pytest.fixture def setup(request): def teardown(): print("Running make clean") os.system('make clean') print("Completed finaliser") request.addfinalizer(teardown) os.system('make clean') os.system('make all') def test_squared(setup): ...
import os import pytest # Need to call Makefile in directory where this test file is def call_make(target): # where is this file this_file = os.path.realpath(__file__) this_dir = os.path.split(this_file)[0] cd_command = "cd {}".format(this_dir) make_command = "make {}".format(target) command =...
import os import pytest @pytest.fixture def setup(request): def teardown(): print("Running make clean") os.system('make clean') print("Completed finaliser") request.addfinalizer(teardown) os.system('make clean') os.system('make all') def test_squared(setup): import mylib ...
<commit_before>import os import pytest @pytest.fixture def setup(request): def teardown(): print("Running make clean") os.system('make clean') print("Completed finaliser") request.addfinalizer(teardown) os.system('make clean') os.system('make all') def test_squared(setup): ...
4325c2fc8308f604eef379551524a2d8f8bfc8bb
corehq/apps/sms/management/commands/find_commconnect_enabled_projects.py
corehq/apps/sms/management/commands/find_commconnect_enabled_projects.py
from django.core.management.base import BaseCommand from corehq.apps.domain.models import Domain class Command(BaseCommand): args = "" help = "" def handle(self, *args, **options): for domain in Domain.get_all(): if domain.commconnect_enabled: print "%s has commconnect_...
Add management command for finding commconnect enabled projects
Add management command for finding commconnect enabled projects
Python
bsd-3-clause
puttarajubr/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,puttarajubr/commcare-hq,dimagi/commcare-hq,puttarajubr/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,puttarajubr/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq
Add management command for finding commconnect enabled projects
from django.core.management.base import BaseCommand from corehq.apps.domain.models import Domain class Command(BaseCommand): args = "" help = "" def handle(self, *args, **options): for domain in Domain.get_all(): if domain.commconnect_enabled: print "%s has commconnect_...
<commit_before><commit_msg>Add management command for finding commconnect enabled projects<commit_after>
from django.core.management.base import BaseCommand from corehq.apps.domain.models import Domain class Command(BaseCommand): args = "" help = "" def handle(self, *args, **options): for domain in Domain.get_all(): if domain.commconnect_enabled: print "%s has commconnect_...
Add management command for finding commconnect enabled projectsfrom django.core.management.base import BaseCommand from corehq.apps.domain.models import Domain class Command(BaseCommand): args = "" help = "" def handle(self, *args, **options): for domain in Domain.get_all(): if domain....
<commit_before><commit_msg>Add management command for finding commconnect enabled projects<commit_after>from django.core.management.base import BaseCommand from corehq.apps.domain.models import Domain class Command(BaseCommand): args = "" help = "" def handle(self, *args, **options): for domain in...
ada5c5039d9a516fa9e6bc7741fbbbcd7f35d30f
migrations/0003_auto_20190327_1951.py
migrations/0003_auto_20190327_1951.py
# -*- coding: utf-8 -*- # Generated by Django 1.11.20 on 2019-03-27 19:51 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('announcements', '0002_auto_20141004_1330'), ] operations = [ migrations.Al...
Update migrations for Django 1.11 and Python 3
Update migrations for Django 1.11 and Python 3
Python
mit
mback2k/django-app-announcements
Update migrations for Django 1.11 and Python 3
# -*- coding: utf-8 -*- # Generated by Django 1.11.20 on 2019-03-27 19:51 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('announcements', '0002_auto_20141004_1330'), ] operations = [ migrations.Al...
<commit_before><commit_msg>Update migrations for Django 1.11 and Python 3<commit_after>
# -*- coding: utf-8 -*- # Generated by Django 1.11.20 on 2019-03-27 19:51 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('announcements', '0002_auto_20141004_1330'), ] operations = [ migrations.Al...
Update migrations for Django 1.11 and Python 3# -*- coding: utf-8 -*- # Generated by Django 1.11.20 on 2019-03-27 19:51 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('announcements', '0002_auto_20141004_1330'), ...
<commit_before><commit_msg>Update migrations for Django 1.11 and Python 3<commit_after># -*- coding: utf-8 -*- # Generated by Django 1.11.20 on 2019-03-27 19:51 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('anno...
2d58336d0605b313a90f2d1c3c13e0c33f4c592c
scripts/cache/warn_cache.py
scripts/cache/warn_cache.py
# Need something to cache the warnings GIS files, since they are so # huge. import os FINAL = "/mesonet/share/pickup/wwa/" for year in range(1986,2010): cmd = "wget -q -O %s/%s_all.zip http://localhost/cgi-bin/request/gis/watchwarn.py?year1=%s&month1=1&day1=1&hour1=0&minute1=0&year2=%s&month2=1&day2=1&hour2=0&min...
Add cache script for the warnings
Add cache script for the warnings
Python
mit
akrherz/iem,akrherz/iem,akrherz/iem,akrherz/iem,akrherz/iem
Add cache script for the warnings
# Need something to cache the warnings GIS files, since they are so # huge. import os FINAL = "/mesonet/share/pickup/wwa/" for year in range(1986,2010): cmd = "wget -q -O %s/%s_all.zip http://localhost/cgi-bin/request/gis/watchwarn.py?year1=%s&month1=1&day1=1&hour1=0&minute1=0&year2=%s&month2=1&day2=1&hour2=0&min...
<commit_before><commit_msg>Add cache script for the warnings<commit_after>
# Need something to cache the warnings GIS files, since they are so # huge. import os FINAL = "/mesonet/share/pickup/wwa/" for year in range(1986,2010): cmd = "wget -q -O %s/%s_all.zip http://localhost/cgi-bin/request/gis/watchwarn.py?year1=%s&month1=1&day1=1&hour1=0&minute1=0&year2=%s&month2=1&day2=1&hour2=0&min...
Add cache script for the warnings# Need something to cache the warnings GIS files, since they are so # huge. import os FINAL = "/mesonet/share/pickup/wwa/" for year in range(1986,2010): cmd = "wget -q -O %s/%s_all.zip http://localhost/cgi-bin/request/gis/watchwarn.py?year1=%s&month1=1&day1=1&hour1=0&minute1=0&yea...
<commit_before><commit_msg>Add cache script for the warnings<commit_after># Need something to cache the warnings GIS files, since they are so # huge. import os FINAL = "/mesonet/share/pickup/wwa/" for year in range(1986,2010): cmd = "wget -q -O %s/%s_all.zip http://localhost/cgi-bin/request/gis/watchwarn.py?year1...
068a273d859a082c153acee4192a34df0b1ce4ea
scripts/update-readme-with-pack-list.py
scripts/update-readme-with-pack-list.py
#!/usr/bin/env python """ Script which updates README.md with a list of all the available packs. """ import os import copy import argparse import yaml CURRENT_DIR = os.path.dirname(os.path.abspath(__file__)) PACKS_DIR = os.path.join(CURRENT_DIR, '../packs') README_PATH = os.path.join(CURRENT_DIR, '../README.md') B...
Add script for upating readme with auto-generated pack list.
Add script for upating readme with auto-generated pack list.
Python
apache-2.0
pidah/st2contrib,tonybaloney/st2contrib,lmEshoo/st2contrib,pearsontechnology/st2contrib,meirwah/st2contrib,jtopjian/st2contrib,lmEshoo/st2contrib,pearsontechnology/st2contrib,Aamir-raza-1/st2contrib,jtopjian/st2contrib,pearsontechnology/st2contrib,armab/st2contrib,digideskio/st2contrib,pinterb/st2contrib,tonybaloney/st...
Add script for upating readme with auto-generated pack list.
#!/usr/bin/env python """ Script which updates README.md with a list of all the available packs. """ import os import copy import argparse import yaml CURRENT_DIR = os.path.dirname(os.path.abspath(__file__)) PACKS_DIR = os.path.join(CURRENT_DIR, '../packs') README_PATH = os.path.join(CURRENT_DIR, '../README.md') B...
<commit_before><commit_msg>Add script for upating readme with auto-generated pack list.<commit_after>
#!/usr/bin/env python """ Script which updates README.md with a list of all the available packs. """ import os import copy import argparse import yaml CURRENT_DIR = os.path.dirname(os.path.abspath(__file__)) PACKS_DIR = os.path.join(CURRENT_DIR, '../packs') README_PATH = os.path.join(CURRENT_DIR, '../README.md') B...
Add script for upating readme with auto-generated pack list.#!/usr/bin/env python """ Script which updates README.md with a list of all the available packs. """ import os import copy import argparse import yaml CURRENT_DIR = os.path.dirname(os.path.abspath(__file__)) PACKS_DIR = os.path.join(CURRENT_DIR, '../packs'...
<commit_before><commit_msg>Add script for upating readme with auto-generated pack list.<commit_after>#!/usr/bin/env python """ Script which updates README.md with a list of all the available packs. """ import os import copy import argparse import yaml CURRENT_DIR = os.path.dirname(os.path.abspath(__file__)) PACKS_D...
b84b04178d1ad16ae8c515c002427244183de0ca
photutils/detection/base.py
photutils/detection/base.py
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This module implements the base classes for detecting stars in an astronomical image. Each star-finding class should define a method called ``find_stars`` that finds stars in an image. """ import abc __all__ = ['StarFinderBase'] class StarFinderBas...
Put StarFinderBase is separate module
Put StarFinderBase is separate module
Python
bsd-3-clause
larrybradley/photutils,astropy/photutils
Put StarFinderBase is separate module
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This module implements the base classes for detecting stars in an astronomical image. Each star-finding class should define a method called ``find_stars`` that finds stars in an image. """ import abc __all__ = ['StarFinderBase'] class StarFinderBas...
<commit_before><commit_msg>Put StarFinderBase is separate module<commit_after>
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This module implements the base classes for detecting stars in an astronomical image. Each star-finding class should define a method called ``find_stars`` that finds stars in an image. """ import abc __all__ = ['StarFinderBase'] class StarFinderBas...
Put StarFinderBase is separate module# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This module implements the base classes for detecting stars in an astronomical image. Each star-finding class should define a method called ``find_stars`` that finds stars in an image. """ import abc __all__ = ['S...
<commit_before><commit_msg>Put StarFinderBase is separate module<commit_after># Licensed under a 3-clause BSD style license - see LICENSE.rst """ This module implements the base classes for detecting stars in an astronomical image. Each star-finding class should define a method called ``find_stars`` that finds stars in...
6500a93f4b13f6c51be88288542aabdc0dea954a
table_loader.py
table_loader.py
import csv def load_table(filepath, headers=False): ''' Return a dict representing a roll table loaded from filepath. Loads a roll table from the CSV file at filepath into a dict whose keys are tuples specifying the range of rolls (min, max) associated with the event specified in that key...
Add function to load CSV roll tables into dicts
Add function to load CSV roll tables into dicts Specify the format for roll table CSV files. Dashes are used to specify ranges for consistency with tables printed in the core rulebooks. Headers are optional simply to give flexibility. Range tuples are used in the dict even for single roll entries in order to make the...
Python
mit
whonut/Random-Table-Roller,whonut/Random-Table-Roller,whonut/Random-Table-Roller
Add function to load CSV roll tables into dicts Specify the format for roll table CSV files. Dashes are used to specify ranges for consistency with tables printed in the core rulebooks. Headers are optional simply to give flexibility. Range tuples are used in the dict even for single roll entries in order to make the...
import csv def load_table(filepath, headers=False): ''' Return a dict representing a roll table loaded from filepath. Loads a roll table from the CSV file at filepath into a dict whose keys are tuples specifying the range of rolls (min, max) associated with the event specified in that key...
<commit_before><commit_msg>Add function to load CSV roll tables into dicts Specify the format for roll table CSV files. Dashes are used to specify ranges for consistency with tables printed in the core rulebooks. Headers are optional simply to give flexibility. Range tuples are used in the dict even for single roll e...
import csv def load_table(filepath, headers=False): ''' Return a dict representing a roll table loaded from filepath. Loads a roll table from the CSV file at filepath into a dict whose keys are tuples specifying the range of rolls (min, max) associated with the event specified in that key...
Add function to load CSV roll tables into dicts Specify the format for roll table CSV files. Dashes are used to specify ranges for consistency with tables printed in the core rulebooks. Headers are optional simply to give flexibility. Range tuples are used in the dict even for single roll entries in order to make the...
<commit_before><commit_msg>Add function to load CSV roll tables into dicts Specify the format for roll table CSV files. Dashes are used to specify ranges for consistency with tables printed in the core rulebooks. Headers are optional simply to give flexibility. Range tuples are used in the dict even for single roll e...
ecce72199a8c9f0f333715419d572444d5b9fc90
shade/tests/functional/test_devstack.py
shade/tests/functional/test_devstack.py
# Copyright (c) 2016 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
Add test to trap for missing services
Add test to trap for missing services Recently when there was an issue with the magnum devstack plugin causing the shade gate to not have swift, we didn't notice except through the ansible tests. That's because we have a bunch of has_service checks in the tests themselves to deal with different configs. Unfortunately,...
Python
apache-2.0
openstack/python-openstacksdk,dtroyer/python-openstacksdk,openstack/python-openstacksdk,dtroyer/python-openstacksdk,stackforge/python-openstacksdk,stackforge/python-openstacksdk,openstack-infra/shade,openstack-infra/shade
Add test to trap for missing services Recently when there was an issue with the magnum devstack plugin causing the shade gate to not have swift, we didn't notice except through the ansible tests. That's because we have a bunch of has_service checks in the tests themselves to deal with different configs. Unfortunately,...
# Copyright (c) 2016 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
<commit_before><commit_msg>Add test to trap for missing services Recently when there was an issue with the magnum devstack plugin causing the shade gate to not have swift, we didn't notice except through the ansible tests. That's because we have a bunch of has_service checks in the tests themselves to deal with differ...
# Copyright (c) 2016 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
Add test to trap for missing services Recently when there was an issue with the magnum devstack plugin causing the shade gate to not have swift, we didn't notice except through the ansible tests. That's because we have a bunch of has_service checks in the tests themselves to deal with different configs. Unfortunately,...
<commit_before><commit_msg>Add test to trap for missing services Recently when there was an issue with the magnum devstack plugin causing the shade gate to not have swift, we didn't notice except through the ansible tests. That's because we have a bunch of has_service checks in the tests themselves to deal with differ...
f109f24e8f10d1fd3f8940c0eb54b157aa9ed909
content/test/gpu/gpu_tests/pixel_expectations.py
content/test/gpu/gpu_tests/pixel_expectations.py
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from gpu_test_expectations import GpuTestExpectations # See the GpuTestExpectations class for documentation. class PixelExpectations(GpuTestExpectations): ...
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from gpu_test_expectations import GpuTestExpectations # See the GpuTestExpectations class for documentation. class PixelExpectations(GpuTestExpectations): ...
Mark pixel tests as failing on all platform
Mark pixel tests as failing on all platform BUG=511580 R=kbr@chromium.org Review URL: https://codereview.chromium.org/1245243003 Cr-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03eb8f276f7@{#340191}
Python
bsd-3-clause
Just-D/chromium-1,Chilledheart/chromium,axinging/chromium-crosswalk,Just-D/chromium-1,axinging/chromium-crosswalk,Pluto-tv/chromium-crosswalk,axinging/chromium-crosswalk,Just-D/chromium-1,Pluto-tv/chromium-crosswalk,Chilledheart/chromium,Pluto-tv/chromium-crosswalk,Just-D/chromium-1,Chilledheart/chromium,Pluto-tv/chrom...
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from gpu_test_expectations import GpuTestExpectations # See the GpuTestExpectations class for documentation. class PixelExpectations(GpuTestExpectations): ...
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from gpu_test_expectations import GpuTestExpectations # See the GpuTestExpectations class for documentation. class PixelExpectations(GpuTestExpectations): ...
<commit_before># Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from gpu_test_expectations import GpuTestExpectations # See the GpuTestExpectations class for documentation. class PixelExpectations(GpuTest...
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from gpu_test_expectations import GpuTestExpectations # See the GpuTestExpectations class for documentation. class PixelExpectations(GpuTestExpectations): ...
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from gpu_test_expectations import GpuTestExpectations # See the GpuTestExpectations class for documentation. class PixelExpectations(GpuTestExpectations): ...
<commit_before># Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from gpu_test_expectations import GpuTestExpectations # See the GpuTestExpectations class for documentation. class PixelExpectations(GpuTest...
2fe3b8040730e769ce4814b5e7be35ff0293d8a8
corehq/messaging/scheduling/tests/test_content.py
corehq/messaging/scheduling/tests/test_content.py
from corehq.apps.users.models import CommCareUser from corehq.messaging.scheduling.models import CustomContent from corehq.messaging.scheduling.scheduling_partitioned.models import ( AlertScheduleInstance, TimedScheduleInstance, CaseAlertScheduleInstance, CaseTimedScheduleInstance, ) from django.test im...
Add generic test for custom content resolution
Add generic test for custom content resolution
Python
bsd-3-clause
dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq
Add generic test for custom content resolution
from corehq.apps.users.models import CommCareUser from corehq.messaging.scheduling.models import CustomContent from corehq.messaging.scheduling.scheduling_partitioned.models import ( AlertScheduleInstance, TimedScheduleInstance, CaseAlertScheduleInstance, CaseTimedScheduleInstance, ) from django.test im...
<commit_before><commit_msg>Add generic test for custom content resolution<commit_after>
from corehq.apps.users.models import CommCareUser from corehq.messaging.scheduling.models import CustomContent from corehq.messaging.scheduling.scheduling_partitioned.models import ( AlertScheduleInstance, TimedScheduleInstance, CaseAlertScheduleInstance, CaseTimedScheduleInstance, ) from django.test im...
Add generic test for custom content resolutionfrom corehq.apps.users.models import CommCareUser from corehq.messaging.scheduling.models import CustomContent from corehq.messaging.scheduling.scheduling_partitioned.models import ( AlertScheduleInstance, TimedScheduleInstance, CaseAlertScheduleInstance, Ca...
<commit_before><commit_msg>Add generic test for custom content resolution<commit_after>from corehq.apps.users.models import CommCareUser from corehq.messaging.scheduling.models import CustomContent from corehq.messaging.scheduling.scheduling_partitioned.models import ( AlertScheduleInstance, TimedScheduleInstan...
4d82d539b25a1a7f3e5e5b5c5bfa25a171757fdc
code/python/knub/thesis/word2vec_gaussian_lda_preprocessing.py
code/python/knub/thesis/word2vec_gaussian_lda_preprocessing.py
import argparse import logging import os from gensim.models import Word2Vec logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO) if __name__ == "__main__": parser = argparse.ArgumentParser("Prepare model for Gaussian LDA") parser.add_argument("--topic_model", type=str) ...
Add Gaussian LDA preparation script.
Add Gaussian LDA preparation script.
Python
apache-2.0
knub/master-thesis,knub/master-thesis,knub/master-thesis,knub/master-thesis
Add Gaussian LDA preparation script.
import argparse import logging import os from gensim.models import Word2Vec logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO) if __name__ == "__main__": parser = argparse.ArgumentParser("Prepare model for Gaussian LDA") parser.add_argument("--topic_model", type=str) ...
<commit_before><commit_msg>Add Gaussian LDA preparation script.<commit_after>
import argparse import logging import os from gensim.models import Word2Vec logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO) if __name__ == "__main__": parser = argparse.ArgumentParser("Prepare model for Gaussian LDA") parser.add_argument("--topic_model", type=str) ...
Add Gaussian LDA preparation script.import argparse import logging import os from gensim.models import Word2Vec logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO) if __name__ == "__main__": parser = argparse.ArgumentParser("Prepare model for Gaussian LDA") parser.add_...
<commit_before><commit_msg>Add Gaussian LDA preparation script.<commit_after>import argparse import logging import os from gensim.models import Word2Vec logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO) if __name__ == "__main__": parser = argparse.ArgumentParser("Prepare...
2f976fda50e0946486383b61a996a36b0f3ff9ae
django/setup.py
django/setup.py
import subprocess import sys import setup_util import os from os.path import expanduser home = expanduser("~") def start(args): setup_util.replace_text("django/hello/hello/settings.py", "HOST': '.*'", "HOST': '" + args.database_host + "'") setup_util.replace_text("django/hello/hello/settings.py", "\/home\/ubuntu"...
import subprocess import sys import setup_util import os from os.path import expanduser home = expanduser("~") def start(args): setup_util.replace_text("django/hello/hello/settings.py", "HOST': '.*'", "HOST': '" + args.database_host + "'") setup_util.replace_text("django/hello/hello/settings.py", "\/home\/ubuntu"...
Use more gunicorn threads when pooling database connector isn't available.
Use more gunicorn threads when pooling database connector isn't available. When using postgres with meinheld, the best you can do so far (as far as I know) is up the number of threads.
Python
bsd-3-clause
raziel057/FrameworkBenchmarks,zhuochenKIDD/FrameworkBenchmarks,circlespainter/FrameworkBenchmarks,RockinRoel/FrameworkBenchmarks,denkab/FrameworkBenchmarks,doom369/FrameworkBenchmarks,stefanocasazza/FrameworkBenchmarks,greenlaw110/FrameworkBenchmarks,Rayne/FrameworkBenchmarks,donovanmuller/FrameworkBenchmarks,sgml/Fram...
import subprocess import sys import setup_util import os from os.path import expanduser home = expanduser("~") def start(args): setup_util.replace_text("django/hello/hello/settings.py", "HOST': '.*'", "HOST': '" + args.database_host + "'") setup_util.replace_text("django/hello/hello/settings.py", "\/home\/ubuntu"...
import subprocess import sys import setup_util import os from os.path import expanduser home = expanduser("~") def start(args): setup_util.replace_text("django/hello/hello/settings.py", "HOST': '.*'", "HOST': '" + args.database_host + "'") setup_util.replace_text("django/hello/hello/settings.py", "\/home\/ubuntu"...
<commit_before>import subprocess import sys import setup_util import os from os.path import expanduser home = expanduser("~") def start(args): setup_util.replace_text("django/hello/hello/settings.py", "HOST': '.*'", "HOST': '" + args.database_host + "'") setup_util.replace_text("django/hello/hello/settings.py", "...
import subprocess import sys import setup_util import os from os.path import expanduser home = expanduser("~") def start(args): setup_util.replace_text("django/hello/hello/settings.py", "HOST': '.*'", "HOST': '" + args.database_host + "'") setup_util.replace_text("django/hello/hello/settings.py", "\/home\/ubuntu"...
import subprocess import sys import setup_util import os from os.path import expanduser home = expanduser("~") def start(args): setup_util.replace_text("django/hello/hello/settings.py", "HOST': '.*'", "HOST': '" + args.database_host + "'") setup_util.replace_text("django/hello/hello/settings.py", "\/home\/ubuntu"...
<commit_before>import subprocess import sys import setup_util import os from os.path import expanduser home = expanduser("~") def start(args): setup_util.replace_text("django/hello/hello/settings.py", "HOST': '.*'", "HOST': '" + args.database_host + "'") setup_util.replace_text("django/hello/hello/settings.py", "...
77b248c18bf1edfe6d36fb8c1ca2fc96258dacb2
tests/test_oauth2/test_refresh.py
tests/test_oauth2/test_refresh.py
# coding: utf-8 from .base import TestCase from .base import create_server, sqlalchemy_provider, cache_provider from .base import db, Client, User, Token class TestDefaultProvider(TestCase): def create_server(self): create_server(self.app) def prepare_data(self): self.create_server() ...
Add test for refresh token
Add test for refresh token
Python
bsd-3-clause
stianpr/flask-oauthlib,stianpr/flask-oauthlib,CoreyHyllested/flask-oauthlib,cogniteev/flask-oauthlib,lepture/flask-oauthlib,landler/flask-oauthlib,tonyseek/flask-oauthlib,landler/flask-oauthlib,brightforme/flask-oauthlib,cogniteev/flask-oauthlib,PyBossa/flask-oauthlib,Ryan-K/flask-oauthlib,icook/flask-oauthlib,lepture/...
Add test for refresh token
# coding: utf-8 from .base import TestCase from .base import create_server, sqlalchemy_provider, cache_provider from .base import db, Client, User, Token class TestDefaultProvider(TestCase): def create_server(self): create_server(self.app) def prepare_data(self): self.create_server() ...
<commit_before><commit_msg>Add test for refresh token<commit_after>
# coding: utf-8 from .base import TestCase from .base import create_server, sqlalchemy_provider, cache_provider from .base import db, Client, User, Token class TestDefaultProvider(TestCase): def create_server(self): create_server(self.app) def prepare_data(self): self.create_server() ...
Add test for refresh token# coding: utf-8 from .base import TestCase from .base import create_server, sqlalchemy_provider, cache_provider from .base import db, Client, User, Token class TestDefaultProvider(TestCase): def create_server(self): create_server(self.app) def prepare_data(self): se...
<commit_before><commit_msg>Add test for refresh token<commit_after># coding: utf-8 from .base import TestCase from .base import create_server, sqlalchemy_provider, cache_provider from .base import db, Client, User, Token class TestDefaultProvider(TestCase): def create_server(self): create_server(self.app...
0a0a34bc1e6e09b85a3e1739679a7b76dc2672c4
examples/chart_maker/my_chart.py
examples/chart_maker/my_chart.py
from seleniumbase import BaseCase class MyChartMakerClass(BaseCase): def test_chart_maker(self): self.create_pie_chart(title="Automated Tests") self.add_data_point("Passed", 7, color="#95d96f") self.add_data_point("Untested", 2, color="#eaeaea") self.add_data_point("Failed", 1, co...
Add an example of SeleniumBase Chart Maker
Add an example of SeleniumBase Chart Maker
Python
mit
mdmintz/SeleniumBase,mdmintz/SeleniumBase,seleniumbase/SeleniumBase,seleniumbase/SeleniumBase,seleniumbase/SeleniumBase,mdmintz/SeleniumBase,mdmintz/SeleniumBase,seleniumbase/SeleniumBase
Add an example of SeleniumBase Chart Maker
from seleniumbase import BaseCase class MyChartMakerClass(BaseCase): def test_chart_maker(self): self.create_pie_chart(title="Automated Tests") self.add_data_point("Passed", 7, color="#95d96f") self.add_data_point("Untested", 2, color="#eaeaea") self.add_data_point("Failed", 1, co...
<commit_before><commit_msg>Add an example of SeleniumBase Chart Maker<commit_after>
from seleniumbase import BaseCase class MyChartMakerClass(BaseCase): def test_chart_maker(self): self.create_pie_chart(title="Automated Tests") self.add_data_point("Passed", 7, color="#95d96f") self.add_data_point("Untested", 2, color="#eaeaea") self.add_data_point("Failed", 1, co...
Add an example of SeleniumBase Chart Makerfrom seleniumbase import BaseCase class MyChartMakerClass(BaseCase): def test_chart_maker(self): self.create_pie_chart(title="Automated Tests") self.add_data_point("Passed", 7, color="#95d96f") self.add_data_point("Untested", 2, color="#eaeaea") ...
<commit_before><commit_msg>Add an example of SeleniumBase Chart Maker<commit_after>from seleniumbase import BaseCase class MyChartMakerClass(BaseCase): def test_chart_maker(self): self.create_pie_chart(title="Automated Tests") self.add_data_point("Passed", 7, color="#95d96f") self.add_dat...
3b1e38785505e4f472e7cb0bce487b7d31efbf1d
cyhdfs3/tests/test_file.py
cyhdfs3/tests/test_file.py
import inspect import posixpath from utils import * def test_block_locations(hdfs): testname = inspect.stack()[0][3] fname = posixpath.join(TEST_DIR, testname) data = b'a' * 2 * 2 ** 20 data += b'b' * 2 * 2 ** 19 with hdfs.open(fname, 'w', block_size=1 * 2 ** 20) as f: f.write(data) ...
Add tests for file blocks and file info
Add tests for file blocks and file info
Python
apache-2.0
danielfrg/cyhdfs3,danielfrg/libhdfs3.py,danielfrg/libhdfs3.py,danielfrg/cyhdfs3
Add tests for file blocks and file info
import inspect import posixpath from utils import * def test_block_locations(hdfs): testname = inspect.stack()[0][3] fname = posixpath.join(TEST_DIR, testname) data = b'a' * 2 * 2 ** 20 data += b'b' * 2 * 2 ** 19 with hdfs.open(fname, 'w', block_size=1 * 2 ** 20) as f: f.write(data) ...
<commit_before><commit_msg>Add tests for file blocks and file info<commit_after>
import inspect import posixpath from utils import * def test_block_locations(hdfs): testname = inspect.stack()[0][3] fname = posixpath.join(TEST_DIR, testname) data = b'a' * 2 * 2 ** 20 data += b'b' * 2 * 2 ** 19 with hdfs.open(fname, 'w', block_size=1 * 2 ** 20) as f: f.write(data) ...
Add tests for file blocks and file infoimport inspect import posixpath from utils import * def test_block_locations(hdfs): testname = inspect.stack()[0][3] fname = posixpath.join(TEST_DIR, testname) data = b'a' * 2 * 2 ** 20 data += b'b' * 2 * 2 ** 19 with hdfs.open(fname, 'w', block_size=1 * 2 ...
<commit_before><commit_msg>Add tests for file blocks and file info<commit_after>import inspect import posixpath from utils import * def test_block_locations(hdfs): testname = inspect.stack()[0][3] fname = posixpath.join(TEST_DIR, testname) data = b'a' * 2 * 2 ** 20 data += b'b' * 2 * 2 ** 19 wit...
b948968dc616b671b2b426ead5768e60e86a38c1
cumulusci/tasks/metadata/modify.py
cumulusci/tasks/metadata/modify.py
import glob import os import lxml.etree as ET from xml.sax.saxutils import escape from cumulusci.core.tasks import BaseTask class RemoveElementsXPath(BaseTask): task_options = { 'elements': { 'description': 'A list of dictionaries containing path and xpath keys. The path key is a file path that...
Add new task class RemoveElementsXPath for removing XML elements using XPath selectors
Add new task class RemoveElementsXPath for removing XML elements using XPath selectors
Python
bsd-3-clause
e02d96ec16/CumulusCI,e02d96ec16/CumulusCI,SalesforceFoundation/CumulusCI,SalesforceFoundation/CumulusCI
Add new task class RemoveElementsXPath for removing XML elements using XPath selectors
import glob import os import lxml.etree as ET from xml.sax.saxutils import escape from cumulusci.core.tasks import BaseTask class RemoveElementsXPath(BaseTask): task_options = { 'elements': { 'description': 'A list of dictionaries containing path and xpath keys. The path key is a file path that...
<commit_before><commit_msg>Add new task class RemoveElementsXPath for removing XML elements using XPath selectors<commit_after>
import glob import os import lxml.etree as ET from xml.sax.saxutils import escape from cumulusci.core.tasks import BaseTask class RemoveElementsXPath(BaseTask): task_options = { 'elements': { 'description': 'A list of dictionaries containing path and xpath keys. The path key is a file path that...
Add new task class RemoveElementsXPath for removing XML elements using XPath selectorsimport glob import os import lxml.etree as ET from xml.sax.saxutils import escape from cumulusci.core.tasks import BaseTask class RemoveElementsXPath(BaseTask): task_options = { 'elements': { 'description': 'A...
<commit_before><commit_msg>Add new task class RemoveElementsXPath for removing XML elements using XPath selectors<commit_after>import glob import os import lxml.etree as ET from xml.sax.saxutils import escape from cumulusci.core.tasks import BaseTask class RemoveElementsXPath(BaseTask): task_options = { 'e...
a336c6d939cc9b18780d8671af41b8128701db40
src/adhocracy_core/adhocracy_core/scripts/test_import_local_roles.py
src/adhocracy_core/adhocracy_core/scripts/test_import_local_roles.py
from pyramid import testing from tempfile import mkstemp import os import json class TestImportLocalRoles: # pragma: no cover def test_import_local_roles(self, registry): from adhocracy_core.scripts.import_local_roles import _import_local_roles (self._tempfd, filename) = mkstemp() with ...
Add unit test for import_local_roles script
Add unit test for import_local_roles script
Python
agpl-3.0
liqd/adhocracy3.mercator,xs2maverick/adhocracy3.mercator,fhartwig/adhocracy3.mercator,liqd/adhocracy3.mercator,liqd/adhocracy3.mercator,fhartwig/adhocracy3.mercator,liqd/adhocracy3.mercator,liqd/adhocracy3.mercator,fhartwig/adhocracy3.mercator,liqd/adhocracy3.mercator,xs2maverick/adhocracy3.mercator,fhartwig/adhocracy3...
Add unit test for import_local_roles script
from pyramid import testing from tempfile import mkstemp import os import json class TestImportLocalRoles: # pragma: no cover def test_import_local_roles(self, registry): from adhocracy_core.scripts.import_local_roles import _import_local_roles (self._tempfd, filename) = mkstemp() with ...
<commit_before><commit_msg>Add unit test for import_local_roles script<commit_after>
from pyramid import testing from tempfile import mkstemp import os import json class TestImportLocalRoles: # pragma: no cover def test_import_local_roles(self, registry): from adhocracy_core.scripts.import_local_roles import _import_local_roles (self._tempfd, filename) = mkstemp() with ...
Add unit test for import_local_roles scriptfrom pyramid import testing from tempfile import mkstemp import os import json class TestImportLocalRoles: # pragma: no cover def test_import_local_roles(self, registry): from adhocracy_core.scripts.import_local_roles import _import_local_roles (self._...
<commit_before><commit_msg>Add unit test for import_local_roles script<commit_after>from pyramid import testing from tempfile import mkstemp import os import json class TestImportLocalRoles: # pragma: no cover def test_import_local_roles(self, registry): from adhocracy_core.scripts.import_local_roles im...
34927e575294ecadebca62a9d8decda550fd1001
alembic/versions/8888a0f4c1ef_add_code_of_conduct_and_data_policy_.py
alembic/versions/8888a0f4c1ef_add_code_of_conduct_and_data_policy_.py
"""Add Code of Conduct and Data Policy agreement columns Revision ID: 8888a0f4c1ef Revises: fa869546b8ca Create Date: 2019-09-01 01:17:02.604266 """ # revision identifiers, used by Alembic. revision = '8888a0f4c1ef' down_revision = 'fa869546b8ca' branch_labels = None depends_on = None from alembic import op import...
Include the database migration this time
Include the database migration this time
Python
agpl-3.0
magfest/ubersystem,magfest/ubersystem,magfest/ubersystem,magfest/ubersystem
Include the database migration this time
"""Add Code of Conduct and Data Policy agreement columns Revision ID: 8888a0f4c1ef Revises: fa869546b8ca Create Date: 2019-09-01 01:17:02.604266 """ # revision identifiers, used by Alembic. revision = '8888a0f4c1ef' down_revision = 'fa869546b8ca' branch_labels = None depends_on = None from alembic import op import...
<commit_before><commit_msg>Include the database migration this time<commit_after>
"""Add Code of Conduct and Data Policy agreement columns Revision ID: 8888a0f4c1ef Revises: fa869546b8ca Create Date: 2019-09-01 01:17:02.604266 """ # revision identifiers, used by Alembic. revision = '8888a0f4c1ef' down_revision = 'fa869546b8ca' branch_labels = None depends_on = None from alembic import op import...
Include the database migration this time"""Add Code of Conduct and Data Policy agreement columns Revision ID: 8888a0f4c1ef Revises: fa869546b8ca Create Date: 2019-09-01 01:17:02.604266 """ # revision identifiers, used by Alembic. revision = '8888a0f4c1ef' down_revision = 'fa869546b8ca' branch_labels = None depends_...
<commit_before><commit_msg>Include the database migration this time<commit_after>"""Add Code of Conduct and Data Policy agreement columns Revision ID: 8888a0f4c1ef Revises: fa869546b8ca Create Date: 2019-09-01 01:17:02.604266 """ # revision identifiers, used by Alembic. revision = '8888a0f4c1ef' down_revision = 'fa...
6863a9526af42f2c7615abe22f3a6eb40b759da2
sorting/quick_sort.py
sorting/quick_sort.py
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Quick Sort. It is an application of divide and conquer strategy. Best, Average: O(nlogn), Worst: O(n^2). ''' def partion(array, left, right, pivot, order): p = left pv = array[pivot] array[right], array[pivot] = array[pivot], array[right] if order...
Implement the quick sort algorithm.
Implement the quick sort algorithm.
Python
mit
weichen2046/algorithm-study,weichen2046/algorithm-study
Implement the quick sort algorithm.
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Quick Sort. It is an application of divide and conquer strategy. Best, Average: O(nlogn), Worst: O(n^2). ''' def partion(array, left, right, pivot, order): p = left pv = array[pivot] array[right], array[pivot] = array[pivot], array[right] if order...
<commit_before><commit_msg>Implement the quick sort algorithm.<commit_after>
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Quick Sort. It is an application of divide and conquer strategy. Best, Average: O(nlogn), Worst: O(n^2). ''' def partion(array, left, right, pivot, order): p = left pv = array[pivot] array[right], array[pivot] = array[pivot], array[right] if order...
Implement the quick sort algorithm.#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Quick Sort. It is an application of divide and conquer strategy. Best, Average: O(nlogn), Worst: O(n^2). ''' def partion(array, left, right, pivot, order): p = left pv = array[pivot] array[right], array[pivot] = array...
<commit_before><commit_msg>Implement the quick sort algorithm.<commit_after>#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Quick Sort. It is an application of divide and conquer strategy. Best, Average: O(nlogn), Worst: O(n^2). ''' def partion(array, left, right, pivot, order): p = left pv = array[pivot...
72b944740a474b3f476ed36fd5940cdac2895754
src/VipFormat/emitAllXml.py
src/VipFormat/emitAllXml.py
import precinct import electoralDistrict def emitProlog(): print '<?xml version="1.0"?>' print '<VipObject xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" schemaVersion="5.0" xsi:noNamespaceSchemaLocation="http://votinginfoproject.github.com/vip-specification/vip_spec.xsd">' def emitEpilog(): prin...
Add wrapper code to emit all of the XML things
Add wrapper code to emit all of the XML things
Python
apache-2.0
mapmydemocracy/civichackathon,mapmydemocracy/civichackathon
Add wrapper code to emit all of the XML things
import precinct import electoralDistrict def emitProlog(): print '<?xml version="1.0"?>' print '<VipObject xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" schemaVersion="5.0" xsi:noNamespaceSchemaLocation="http://votinginfoproject.github.com/vip-specification/vip_spec.xsd">' def emitEpilog(): prin...
<commit_before><commit_msg>Add wrapper code to emit all of the XML things<commit_after>
import precinct import electoralDistrict def emitProlog(): print '<?xml version="1.0"?>' print '<VipObject xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" schemaVersion="5.0" xsi:noNamespaceSchemaLocation="http://votinginfoproject.github.com/vip-specification/vip_spec.xsd">' def emitEpilog(): prin...
Add wrapper code to emit all of the XML things import precinct import electoralDistrict def emitProlog(): print '<?xml version="1.0"?>' print '<VipObject xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" schemaVersion="5.0" xsi:noNamespaceSchemaLocation="http://votinginfoproject.github.com/vip-specificati...
<commit_before><commit_msg>Add wrapper code to emit all of the XML things<commit_after> import precinct import electoralDistrict def emitProlog(): print '<?xml version="1.0"?>' print '<VipObject xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" schemaVersion="5.0" xsi:noNamespaceSchemaLocation="http://vot...
229e5136b56ffa6488abd81647d5811a5371ce8a
src/citation_vs_blocking.py
src/citation_vs_blocking.py
#!/bin/env python # -*- coding: utf-8 -*- """ Created on Sun Jan 24 14:56:23 2016 @author: Xilin Sun <s.sn.giraffe AT gmail.com> Get the number of prior art citations for each Motorola patent; Get the number of blocking actions for each Motorola patent; Find the relationship between these numbers; """
Add a script to find the relationship between numbers of prior art citations and numbers of blocking actions, and types of blocking actions
Add a script to find the relationship between numbers of prior art citations and numbers of blocking actions, and types of blocking actions
Python
bsd-2-clause
PatentBlocker/Motorola_Patent_Citations,PatentBlocker/Motorola_Patent_Citations
Add a script to find the relationship between numbers of prior art citations and numbers of blocking actions, and types of blocking actions
#!/bin/env python # -*- coding: utf-8 -*- """ Created on Sun Jan 24 14:56:23 2016 @author: Xilin Sun <s.sn.giraffe AT gmail.com> Get the number of prior art citations for each Motorola patent; Get the number of blocking actions for each Motorola patent; Find the relationship between these numbers; """
<commit_before><commit_msg>Add a script to find the relationship between numbers of prior art citations and numbers of blocking actions, and types of blocking actions<commit_after>
#!/bin/env python # -*- coding: utf-8 -*- """ Created on Sun Jan 24 14:56:23 2016 @author: Xilin Sun <s.sn.giraffe AT gmail.com> Get the number of prior art citations for each Motorola patent; Get the number of blocking actions for each Motorola patent; Find the relationship between these numbers; """
Add a script to find the relationship between numbers of prior art citations and numbers of blocking actions, and types of blocking actions#!/bin/env python # -*- coding: utf-8 -*- """ Created on Sun Jan 24 14:56:23 2016 @author: Xilin Sun <s.sn.giraffe AT gmail.com> Get the number of prior art citations for each Mot...
<commit_before><commit_msg>Add a script to find the relationship between numbers of prior art citations and numbers of blocking actions, and types of blocking actions<commit_after>#!/bin/env python # -*- coding: utf-8 -*- """ Created on Sun Jan 24 14:56:23 2016 @author: Xilin Sun <s.sn.giraffe AT gmail.com> Get the n...
83f0aeb4c8bdea3da65c50b9545bacb9c1aec74b
models/secure_pass.py
models/secure_pass.py
from hashlib import sha512 # crypto-secure hashing algorithm from pbkdf2 import PBKDF2 # key-stretching algorithm from os import urandom # crypto-secure random number gen ITERATIONS = 5000 SALT_LEN = 32 KEY_LEN = 64 class Password: def __init__(self, password): self.salt = urandom(SALT_LEN) # 256-bit salt...
Add file to securely hash passwords
Add file to securely hash passwords
Python
mit
davenportw15/SnailMail,davenportw15/SnailMail,davenportw15/SnailMail
Add file to securely hash passwords
from hashlib import sha512 # crypto-secure hashing algorithm from pbkdf2 import PBKDF2 # key-stretching algorithm from os import urandom # crypto-secure random number gen ITERATIONS = 5000 SALT_LEN = 32 KEY_LEN = 64 class Password: def __init__(self, password): self.salt = urandom(SALT_LEN) # 256-bit salt...
<commit_before><commit_msg>Add file to securely hash passwords<commit_after>
from hashlib import sha512 # crypto-secure hashing algorithm from pbkdf2 import PBKDF2 # key-stretching algorithm from os import urandom # crypto-secure random number gen ITERATIONS = 5000 SALT_LEN = 32 KEY_LEN = 64 class Password: def __init__(self, password): self.salt = urandom(SALT_LEN) # 256-bit salt...
Add file to securely hash passwords from hashlib import sha512 # crypto-secure hashing algorithm from pbkdf2 import PBKDF2 # key-stretching algorithm from os import urandom # crypto-secure random number gen ITERATIONS = 5000 SALT_LEN = 32 KEY_LEN = 64 class Password: def __init__(self, password): self.salt...
<commit_before><commit_msg>Add file to securely hash passwords<commit_after> from hashlib import sha512 # crypto-secure hashing algorithm from pbkdf2 import PBKDF2 # key-stretching algorithm from os import urandom # crypto-secure random number gen ITERATIONS = 5000 SALT_LEN = 32 KEY_LEN = 64 class Password: def __...
f614502f0a67b754f5757935ffb0d86920998dcb
glamkit_collections/contrib/work_creator/migrations/0012_auto_20170502_2209.py
glamkit_collections/contrib/work_creator/migrations/0012_auto_20170502_2209.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('gk_collections_work_creator', '0011_role_title_plural'), ] operations = [ migrations.AlterModelOptions( name='cr...
Add DB migration for more explicit ordering of work & creator models
Add DB migration for more explicit ordering of work & creator models
Python
mit
ic-labs/glamkit-collections,ic-labs/django-icekit,ic-labs/django-icekit,ic-labs/django-icekit,ic-labs/glamkit-collections,ic-labs/django-icekit
Add DB migration for more explicit ordering of work & creator models
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('gk_collections_work_creator', '0011_role_title_plural'), ] operations = [ migrations.AlterModelOptions( name='cr...
<commit_before><commit_msg>Add DB migration for more explicit ordering of work & creator models<commit_after>
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('gk_collections_work_creator', '0011_role_title_plural'), ] operations = [ migrations.AlterModelOptions( name='cr...
Add DB migration for more explicit ordering of work & creator models# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('gk_collections_work_creator', '0011_role_title_plural'), ] opera...
<commit_before><commit_msg>Add DB migration for more explicit ordering of work & creator models<commit_after># -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('gk_collections_work_creator', '0...
554f3437e06c3bd295a38b3b87c93bf6c0af6f52
test/jpypetest/test_hash.py
test/jpypetest/test_hash.py
# ***************************************************************************** # Copyright 2019 Karl Einar Nelson # # 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...
Test for problems in hash.
Test for problems in hash.
Python
apache-2.0
originell/jpype,originell/jpype,originell/jpype,originell/jpype,originell/jpype
Test for problems in hash.
# ***************************************************************************** # Copyright 2019 Karl Einar Nelson # # 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...
<commit_before><commit_msg>Test for problems in hash.<commit_after>
# ***************************************************************************** # Copyright 2019 Karl Einar Nelson # # 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...
Test for problems in hash.# ***************************************************************************** # Copyright 2019 Karl Einar Nelson # # 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 Licen...
<commit_before><commit_msg>Test for problems in hash.<commit_after># ***************************************************************************** # Copyright 2019 Karl Einar Nelson # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the Licens...
667ad3e48fb1107b34bff54231bf653b621b01cb
common/migrations/0002_auto_20150717_2202.py
common/migrations/0002_auto_20150717_2202.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('common', '0001_initial'), ] operations = [ migrations.AlterField( model_name='news', name='content_m...
Add a migration for common
Add a migration for common
Python
agpl-3.0
Turupawn/website,lutris/website,Turupawn/website,Turupawn/website,lutris/website,lutris/website,Turupawn/website,lutris/website
Add a migration for common
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('common', '0001_initial'), ] operations = [ migrations.AlterField( model_name='news', name='content_m...
<commit_before><commit_msg>Add a migration for common<commit_after>
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('common', '0001_initial'), ] operations = [ migrations.AlterField( model_name='news', name='content_m...
Add a migration for common# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('common', '0001_initial'), ] operations = [ migrations.AlterField( model_name='news', ...
<commit_before><commit_msg>Add a migration for common<commit_after># -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('common', '0001_initial'), ] operations = [ migrations.Alt...
a854abd2d9580e1c31e659cb4d0bd182f96c5b81
CodeFights/bishopAndPawn.py
CodeFights/bishopAndPawn.py
#!/usr/local/bin/python # Code Fights Bishop and Pawn Problem def bishopAndPawn(bishop, pawn): epsilon = 0.001 dist = ((ord(bishop[0]) - ord(pawn[0]))**2 + (int(bishop[1]) - int(pawn[1]))**2)**(0.5) dist = dist / (2**0.5) # distance is a multiple of sqrt(2) return (round(dist) - dist < ep...
Solve Code Fights bishop and pawn problem
Solve Code Fights bishop and pawn problem
Python
mit
HKuz/Test_Code
Solve Code Fights bishop and pawn problem
#!/usr/local/bin/python # Code Fights Bishop and Pawn Problem def bishopAndPawn(bishop, pawn): epsilon = 0.001 dist = ((ord(bishop[0]) - ord(pawn[0]))**2 + (int(bishop[1]) - int(pawn[1]))**2)**(0.5) dist = dist / (2**0.5) # distance is a multiple of sqrt(2) return (round(dist) - dist < ep...
<commit_before><commit_msg>Solve Code Fights bishop and pawn problem<commit_after>
#!/usr/local/bin/python # Code Fights Bishop and Pawn Problem def bishopAndPawn(bishop, pawn): epsilon = 0.001 dist = ((ord(bishop[0]) - ord(pawn[0]))**2 + (int(bishop[1]) - int(pawn[1]))**2)**(0.5) dist = dist / (2**0.5) # distance is a multiple of sqrt(2) return (round(dist) - dist < ep...
Solve Code Fights bishop and pawn problem#!/usr/local/bin/python # Code Fights Bishop and Pawn Problem def bishopAndPawn(bishop, pawn): epsilon = 0.001 dist = ((ord(bishop[0]) - ord(pawn[0]))**2 + (int(bishop[1]) - int(pawn[1]))**2)**(0.5) dist = dist / (2**0.5) # distance is a multiple of sq...
<commit_before><commit_msg>Solve Code Fights bishop and pawn problem<commit_after>#!/usr/local/bin/python # Code Fights Bishop and Pawn Problem def bishopAndPawn(bishop, pawn): epsilon = 0.001 dist = ((ord(bishop[0]) - ord(pawn[0]))**2 + (int(bishop[1]) - int(pawn[1]))**2)**(0.5) dist = dist /...
314de418ff9e920238c5dcb274a6b009fab728d0
icp.py
icp.py
# -*- coding: utf-8 -*- """ Created on Mon Dec 25 18:07:42 2017 @author: vostok """ import numpy as np def icp_metric(image_stars, catalog_stars, vectors=False): closest_distances = np.empty_like(image_stars['X']) closest_indices = np.empty_like(image_stars['X']) catalog_X, catalog_Y = catalog_stars...
Add function for ICP metrics (and plotting)
Add function for ICP metrics (and plotting)
Python
mit
lkangas/python-tycho2
Add function for ICP metrics (and plotting)
# -*- coding: utf-8 -*- """ Created on Mon Dec 25 18:07:42 2017 @author: vostok """ import numpy as np def icp_metric(image_stars, catalog_stars, vectors=False): closest_distances = np.empty_like(image_stars['X']) closest_indices = np.empty_like(image_stars['X']) catalog_X, catalog_Y = catalog_stars...
<commit_before><commit_msg>Add function for ICP metrics (and plotting)<commit_after>
# -*- coding: utf-8 -*- """ Created on Mon Dec 25 18:07:42 2017 @author: vostok """ import numpy as np def icp_metric(image_stars, catalog_stars, vectors=False): closest_distances = np.empty_like(image_stars['X']) closest_indices = np.empty_like(image_stars['X']) catalog_X, catalog_Y = catalog_stars...
Add function for ICP metrics (and plotting)# -*- coding: utf-8 -*- """ Created on Mon Dec 25 18:07:42 2017 @author: vostok """ import numpy as np def icp_metric(image_stars, catalog_stars, vectors=False): closest_distances = np.empty_like(image_stars['X']) closest_indices = np.empty_like(image_stars['X']) ...
<commit_before><commit_msg>Add function for ICP metrics (and plotting)<commit_after># -*- coding: utf-8 -*- """ Created on Mon Dec 25 18:07:42 2017 @author: vostok """ import numpy as np def icp_metric(image_stars, catalog_stars, vectors=False): closest_distances = np.empty_like(image_stars['X']) closest_ind...
36c0ff5f5139b5c0277f23d535aa28d597c991a5
depot/tests/test_rentals.py
depot/tests/test_rentals.py
from django.contrib.auth.models import User from depot.models import Depot, Organization from rental.models import Rental from verleihtool.test import ClientTestCase from datetime import datetime class RentalsTestCase(ClientTestCase): def create_rental(self, depot, firstname, lastname, state): return Ren...
Test for the rentals list
Test for the rentals list
Python
agpl-3.0
verleihtool/verleihtool,verleihtool/verleihtool,verleihtool/verleihtool,verleihtool/verleihtool
Test for the rentals list
from django.contrib.auth.models import User from depot.models import Depot, Organization from rental.models import Rental from verleihtool.test import ClientTestCase from datetime import datetime class RentalsTestCase(ClientTestCase): def create_rental(self, depot, firstname, lastname, state): return Ren...
<commit_before><commit_msg>Test for the rentals list<commit_after>
from django.contrib.auth.models import User from depot.models import Depot, Organization from rental.models import Rental from verleihtool.test import ClientTestCase from datetime import datetime class RentalsTestCase(ClientTestCase): def create_rental(self, depot, firstname, lastname, state): return Ren...
Test for the rentals listfrom django.contrib.auth.models import User from depot.models import Depot, Organization from rental.models import Rental from verleihtool.test import ClientTestCase from datetime import datetime class RentalsTestCase(ClientTestCase): def create_rental(self, depot, firstname, lastname, s...
<commit_before><commit_msg>Test for the rentals list<commit_after>from django.contrib.auth.models import User from depot.models import Depot, Organization from rental.models import Rental from verleihtool.test import ClientTestCase from datetime import datetime class RentalsTestCase(ClientTestCase): def create_r...
9a4cd54a254089e2ffdffc97b40791bb96041660
zilencer/management/commands/add_remote_server.py
zilencer/management/commands/add_remote_server.py
from argparse import ArgumentParser from typing import Any from zerver.lib.management import ZulipBaseCommand from zilencer.models import RemoteZulipServer class Command(ZulipBaseCommand): help = """Add a remote Zulip server for push notifications.""" def add_arguments(self, parser: ArgumentParser) -> None: ...
Add a simple management command to create a RemoteZulipServer.
zilencer: Add a simple management command to create a RemoteZulipServer. This saves us from having to go into a `manage.py shell` to do this, and adds a bit more structure like the usage message.
Python
apache-2.0
rishig/zulip,showell/zulip,zulip/zulip,synicalsyntax/zulip,dhcrzf/zulip,rishig/zulip,zulip/zulip,shubhamdhama/zulip,shubhamdhama/zulip,hackerkid/zulip,dhcrzf/zulip,punchagan/zulip,synicalsyntax/zulip,timabbott/zulip,rishig/zulip,kou/zulip,tommyip/zulip,andersk/zulip,timabbott/zulip,rht/zulip,timabbott/zulip,brainwane/z...
zilencer: Add a simple management command to create a RemoteZulipServer. This saves us from having to go into a `manage.py shell` to do this, and adds a bit more structure like the usage message.
from argparse import ArgumentParser from typing import Any from zerver.lib.management import ZulipBaseCommand from zilencer.models import RemoteZulipServer class Command(ZulipBaseCommand): help = """Add a remote Zulip server for push notifications.""" def add_arguments(self, parser: ArgumentParser) -> None: ...
<commit_before><commit_msg>zilencer: Add a simple management command to create a RemoteZulipServer. This saves us from having to go into a `manage.py shell` to do this, and adds a bit more structure like the usage message.<commit_after>
from argparse import ArgumentParser from typing import Any from zerver.lib.management import ZulipBaseCommand from zilencer.models import RemoteZulipServer class Command(ZulipBaseCommand): help = """Add a remote Zulip server for push notifications.""" def add_arguments(self, parser: ArgumentParser) -> None: ...
zilencer: Add a simple management command to create a RemoteZulipServer. This saves us from having to go into a `manage.py shell` to do this, and adds a bit more structure like the usage message.from argparse import ArgumentParser from typing import Any from zerver.lib.management import ZulipBaseCommand from zilencer...
<commit_before><commit_msg>zilencer: Add a simple management command to create a RemoteZulipServer. This saves us from having to go into a `manage.py shell` to do this, and adds a bit more structure like the usage message.<commit_after>from argparse import ArgumentParser from typing import Any from zerver.lib.managem...
d85ac47afeda6753157b77d1ffd7d27f122d42d7
tests/api/conftest.py
tests/api/conftest.py
from unittest import mock import pytest import fmn.api.main from fmn.api.auth import get_identity @pytest.fixture def api_identity(fasjson_user_data): class TestIdentity: name = fasjson_user_data["username"] def get_test_identity(): return TestIdentity with mock.patch.dict(fmn.api.main...
Add test fixture mocking an API identity
Add test fixture mocking an API identity Related: #606 Signed-off-by: Nils Philippsen <ad3fa8d847df2b57853a376ad688e4be8041ecd4@redhat.com>
Python
lgpl-2.1
fedora-infra/fmn,fedora-infra/fmn,fedora-infra/fmn,fedora-infra/fmn,fedora-infra/fmn
Add test fixture mocking an API identity Related: #606 Signed-off-by: Nils Philippsen <ad3fa8d847df2b57853a376ad688e4be8041ecd4@redhat.com>
from unittest import mock import pytest import fmn.api.main from fmn.api.auth import get_identity @pytest.fixture def api_identity(fasjson_user_data): class TestIdentity: name = fasjson_user_data["username"] def get_test_identity(): return TestIdentity with mock.patch.dict(fmn.api.main...
<commit_before><commit_msg>Add test fixture mocking an API identity Related: #606 Signed-off-by: Nils Philippsen <ad3fa8d847df2b57853a376ad688e4be8041ecd4@redhat.com><commit_after>
from unittest import mock import pytest import fmn.api.main from fmn.api.auth import get_identity @pytest.fixture def api_identity(fasjson_user_data): class TestIdentity: name = fasjson_user_data["username"] def get_test_identity(): return TestIdentity with mock.patch.dict(fmn.api.main...
Add test fixture mocking an API identity Related: #606 Signed-off-by: Nils Philippsen <ad3fa8d847df2b57853a376ad688e4be8041ecd4@redhat.com>from unittest import mock import pytest import fmn.api.main from fmn.api.auth import get_identity @pytest.fixture def api_identity(fasjson_user_data): class TestIdentity: ...
<commit_before><commit_msg>Add test fixture mocking an API identity Related: #606 Signed-off-by: Nils Philippsen <ad3fa8d847df2b57853a376ad688e4be8041ecd4@redhat.com><commit_after>from unittest import mock import pytest import fmn.api.main from fmn.api.auth import get_identity @pytest.fixture def api_identity(fas...
2a5ca3c708582b213950d7134a2e29333b8dfd11
tests/test_backend_tools.py
tests/test_backend_tools.py
import unittest from pymanopt.tools import flatten_arguments class TestArgumentFlattening(unittest.TestCase): def _test_flatten_arguments( self, arguments, correctly_flattened_arguments): flattened_arguments = flatten_arguments(arguments) self.assertEqual(flattened_arguments, correctl...
Add test stub module for backend tools
Add test stub module for backend tools Signed-off-by: Niklas Koep <342d5290239d9c5264c8f98185afedb99596601a@gmail.com>
Python
bsd-3-clause
nkoep/pymanopt,pymanopt/pymanopt,pymanopt/pymanopt,nkoep/pymanopt,nkoep/pymanopt
Add test stub module for backend tools Signed-off-by: Niklas Koep <342d5290239d9c5264c8f98185afedb99596601a@gmail.com>
import unittest from pymanopt.tools import flatten_arguments class TestArgumentFlattening(unittest.TestCase): def _test_flatten_arguments( self, arguments, correctly_flattened_arguments): flattened_arguments = flatten_arguments(arguments) self.assertEqual(flattened_arguments, correctl...
<commit_before><commit_msg>Add test stub module for backend tools Signed-off-by: Niklas Koep <342d5290239d9c5264c8f98185afedb99596601a@gmail.com><commit_after>
import unittest from pymanopt.tools import flatten_arguments class TestArgumentFlattening(unittest.TestCase): def _test_flatten_arguments( self, arguments, correctly_flattened_arguments): flattened_arguments = flatten_arguments(arguments) self.assertEqual(flattened_arguments, correctl...
Add test stub module for backend tools Signed-off-by: Niklas Koep <342d5290239d9c5264c8f98185afedb99596601a@gmail.com>import unittest from pymanopt.tools import flatten_arguments class TestArgumentFlattening(unittest.TestCase): def _test_flatten_arguments( self, arguments, correctly_flattened_argume...
<commit_before><commit_msg>Add test stub module for backend tools Signed-off-by: Niklas Koep <342d5290239d9c5264c8f98185afedb99596601a@gmail.com><commit_after>import unittest from pymanopt.tools import flatten_arguments class TestArgumentFlattening(unittest.TestCase): def _test_flatten_arguments( se...
2e5cc8f3a8ccfc6299e98d1b46ed46b093e261a5
tests/unit/test_handlers.py
tests/unit/test_handlers.py
from pmxbot import core def test_contains_always_match(): """ Contains handler should always match if no rate is specified. """ handler = core.ContainsHandler(name='#', func=None) assert handler.match('Tell me about #foo', channel='bar')
Add test capturing bad implementation of contains handler.
Add test capturing bad implementation of contains handler.
Python
bsd-3-clause
jamwt/diesel-pmxbot,jamwt/diesel-pmxbot
Add test capturing bad implementation of contains handler.
from pmxbot import core def test_contains_always_match(): """ Contains handler should always match if no rate is specified. """ handler = core.ContainsHandler(name='#', func=None) assert handler.match('Tell me about #foo', channel='bar')
<commit_before><commit_msg>Add test capturing bad implementation of contains handler.<commit_after>
from pmxbot import core def test_contains_always_match(): """ Contains handler should always match if no rate is specified. """ handler = core.ContainsHandler(name='#', func=None) assert handler.match('Tell me about #foo', channel='bar')
Add test capturing bad implementation of contains handler.from pmxbot import core def test_contains_always_match(): """ Contains handler should always match if no rate is specified. """ handler = core.ContainsHandler(name='#', func=None) assert handler.match('Tell me about #foo', channel='bar')
<commit_before><commit_msg>Add test capturing bad implementation of contains handler.<commit_after>from pmxbot import core def test_contains_always_match(): """ Contains handler should always match if no rate is specified. """ handler = core.ContainsHandler(name='#', func=None) assert handler.match('Tell me about...
e60397f163607fb606c3c7e872da5e9d0e37781c
ynr/apps/ynr_refactoring/migrations/0003_move_person_identifiers.py
ynr/apps/ynr_refactoring/migrations/0003_move_person_identifiers.py
# -*- coding: utf-8 -*- # Generated by Django 1.11.18 on 2019-01-19 18:25 from __future__ import unicode_literals from django.db import migrations def move_person_identifiers(apps, schema_editor): ContentType = apps.get_model("contenttypes", "ContentType") PersonIdentifier = apps.get_model("people", "PersonI...
Move TheyWorkForYou IDs to PersonIdentifiers
Move TheyWorkForYou IDs to PersonIdentifiers
Python
agpl-3.0
DemocracyClub/yournextrepresentative,DemocracyClub/yournextrepresentative,DemocracyClub/yournextrepresentative
Move TheyWorkForYou IDs to PersonIdentifiers
# -*- coding: utf-8 -*- # Generated by Django 1.11.18 on 2019-01-19 18:25 from __future__ import unicode_literals from django.db import migrations def move_person_identifiers(apps, schema_editor): ContentType = apps.get_model("contenttypes", "ContentType") PersonIdentifier = apps.get_model("people", "PersonI...
<commit_before><commit_msg>Move TheyWorkForYou IDs to PersonIdentifiers<commit_after>
# -*- coding: utf-8 -*- # Generated by Django 1.11.18 on 2019-01-19 18:25 from __future__ import unicode_literals from django.db import migrations def move_person_identifiers(apps, schema_editor): ContentType = apps.get_model("contenttypes", "ContentType") PersonIdentifier = apps.get_model("people", "PersonI...
Move TheyWorkForYou IDs to PersonIdentifiers# -*- coding: utf-8 -*- # Generated by Django 1.11.18 on 2019-01-19 18:25 from __future__ import unicode_literals from django.db import migrations def move_person_identifiers(apps, schema_editor): ContentType = apps.get_model("contenttypes", "ContentType") PersonId...
<commit_before><commit_msg>Move TheyWorkForYou IDs to PersonIdentifiers<commit_after># -*- coding: utf-8 -*- # Generated by Django 1.11.18 on 2019-01-19 18:25 from __future__ import unicode_literals from django.db import migrations def move_person_identifiers(apps, schema_editor): ContentType = apps.get_model("c...
abfb39c841293d719809d595af6aa7e9d6a12e87
py/add-strings.py
py/add-strings.py
class Solution(object): def addStrings(self, num1, num2): """ :type num1: str :type num2: str :rtype: str """ l1, l2 = len(num1), len(num2) if l1 > l2: l1, l2 = l2, l1 num1, num2 = num2, num1 carry = 0 out = [] ...
Add py solution for 415. Add Strings
Add py solution for 415. Add Strings 415. Add Strings: https://leetcode.com/problems/add-strings/
Python
apache-2.0
ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode
Add py solution for 415. Add Strings 415. Add Strings: https://leetcode.com/problems/add-strings/
class Solution(object): def addStrings(self, num1, num2): """ :type num1: str :type num2: str :rtype: str """ l1, l2 = len(num1), len(num2) if l1 > l2: l1, l2 = l2, l1 num1, num2 = num2, num1 carry = 0 out = [] ...
<commit_before><commit_msg>Add py solution for 415. Add Strings 415. Add Strings: https://leetcode.com/problems/add-strings/<commit_after>
class Solution(object): def addStrings(self, num1, num2): """ :type num1: str :type num2: str :rtype: str """ l1, l2 = len(num1), len(num2) if l1 > l2: l1, l2 = l2, l1 num1, num2 = num2, num1 carry = 0 out = [] ...
Add py solution for 415. Add Strings 415. Add Strings: https://leetcode.com/problems/add-strings/class Solution(object): def addStrings(self, num1, num2): """ :type num1: str :type num2: str :rtype: str """ l1, l2 = len(num1), len(num2) if l1 > l2: ...
<commit_before><commit_msg>Add py solution for 415. Add Strings 415. Add Strings: https://leetcode.com/problems/add-strings/<commit_after>class Solution(object): def addStrings(self, num1, num2): """ :type num1: str :type num2: str :rtype: str """ l1, l2 = len(num1),...
11c060ea43082dfaad503b2af9149e69878ca4e6
zinnia_ckeditor/__init__.py
zinnia_ckeditor/__init__.py
"""CKEditor for Django-blog-zinnia""" __version__ = '1.0' __license__ = 'BSD License' __author__ = 'Fantomas42' __email__ = 'fantomas42@gmail.com' __url__ = 'https://github.com/django-blog-zinnia/zinnia-wysiwyg-ckeditor'
Create the package with metadatas
Create the package with metadatas
Python
bsd-3-clause
django-blog-zinnia/zinnia-wysiwyg-ckeditor
Create the package with metadatas
"""CKEditor for Django-blog-zinnia""" __version__ = '1.0' __license__ = 'BSD License' __author__ = 'Fantomas42' __email__ = 'fantomas42@gmail.com' __url__ = 'https://github.com/django-blog-zinnia/zinnia-wysiwyg-ckeditor'
<commit_before><commit_msg>Create the package with metadatas<commit_after>
"""CKEditor for Django-blog-zinnia""" __version__ = '1.0' __license__ = 'BSD License' __author__ = 'Fantomas42' __email__ = 'fantomas42@gmail.com' __url__ = 'https://github.com/django-blog-zinnia/zinnia-wysiwyg-ckeditor'
Create the package with metadatas"""CKEditor for Django-blog-zinnia""" __version__ = '1.0' __license__ = 'BSD License' __author__ = 'Fantomas42' __email__ = 'fantomas42@gmail.com' __url__ = 'https://github.com/django-blog-zinnia/zinnia-wysiwyg-ckeditor'
<commit_before><commit_msg>Create the package with metadatas<commit_after>"""CKEditor for Django-blog-zinnia""" __version__ = '1.0' __license__ = 'BSD License' __author__ = 'Fantomas42' __email__ = 'fantomas42@gmail.com' __url__ = 'https://github.com/django-blog-zinnia/zinnia-wysiwyg-ckeditor'
41625db23c40c0d1b9479321693bbca6b56fbd25
foliant/swagger2markdown.py
foliant/swagger2markdown.py
"""Swagger to Markdown converter.""" import shlex, subprocess def convert(swagger_location, output_file, template_file): """Convert Swagger JSON file to Markdown.""" if template_file: command = "swagger2markdown -i %s -o %s -t %s" % ( swagger_location, output_file, ...
Add Swagger to Markdown converter.
Add Swagger to Markdown converter.
Python
mit
foliant-docs/foliant
Add Swagger to Markdown converter.
"""Swagger to Markdown converter.""" import shlex, subprocess def convert(swagger_location, output_file, template_file): """Convert Swagger JSON file to Markdown.""" if template_file: command = "swagger2markdown -i %s -o %s -t %s" % ( swagger_location, output_file, ...
<commit_before><commit_msg>Add Swagger to Markdown converter.<commit_after>
"""Swagger to Markdown converter.""" import shlex, subprocess def convert(swagger_location, output_file, template_file): """Convert Swagger JSON file to Markdown.""" if template_file: command = "swagger2markdown -i %s -o %s -t %s" % ( swagger_location, output_file, ...
Add Swagger to Markdown converter."""Swagger to Markdown converter.""" import shlex, subprocess def convert(swagger_location, output_file, template_file): """Convert Swagger JSON file to Markdown.""" if template_file: command = "swagger2markdown -i %s -o %s -t %s" % ( swagger_location, ...
<commit_before><commit_msg>Add Swagger to Markdown converter.<commit_after>"""Swagger to Markdown converter.""" import shlex, subprocess def convert(swagger_location, output_file, template_file): """Convert Swagger JSON file to Markdown.""" if template_file: command = "swagger2markdown -i %s -o %s -t...
463360261d573f3f3ca934264bd27a072b96d3e6
src/mmw/apps/core/decorators.py
src/mmw/apps/core/decorators.py
# -*- coding: utf-8 -*- from __future__ import print_function from __future__ import unicode_literals import sys import rollbar from django.utils.timezone import now from apps.core.models import RequestLog def log_request(view): """ Log the request and its response as a RequestLog model """ def de...
Create log_request decorator to log API requests
Create log_request decorator to log API requests * Creates a new decorator to save info about API requets (user, path, etc) * Heavily inspired by https://github.com/aschn/drf-tracking/blob/master/rest_framework_tracking/mixins.py
Python
apache-2.0
WikiWatershed/model-my-watershed,WikiWatershed/model-my-watershed,WikiWatershed/model-my-watershed,WikiWatershed/model-my-watershed,WikiWatershed/model-my-watershed
Create log_request decorator to log API requests * Creates a new decorator to save info about API requets (user, path, etc) * Heavily inspired by https://github.com/aschn/drf-tracking/blob/master/rest_framework_tracking/mixins.py
# -*- coding: utf-8 -*- from __future__ import print_function from __future__ import unicode_literals import sys import rollbar from django.utils.timezone import now from apps.core.models import RequestLog def log_request(view): """ Log the request and its response as a RequestLog model """ def de...
<commit_before><commit_msg>Create log_request decorator to log API requests * Creates a new decorator to save info about API requets (user, path, etc) * Heavily inspired by https://github.com/aschn/drf-tracking/blob/master/rest_framework_tracking/mixins.py<commit_after>
# -*- coding: utf-8 -*- from __future__ import print_function from __future__ import unicode_literals import sys import rollbar from django.utils.timezone import now from apps.core.models import RequestLog def log_request(view): """ Log the request and its response as a RequestLog model """ def de...
Create log_request decorator to log API requests * Creates a new decorator to save info about API requets (user, path, etc) * Heavily inspired by https://github.com/aschn/drf-tracking/blob/master/rest_framework_tracking/mixins.py# -*- coding: utf-8 -*- from __future__ import print_function from __future__ import unic...
<commit_before><commit_msg>Create log_request decorator to log API requests * Creates a new decorator to save info about API requets (user, path, etc) * Heavily inspired by https://github.com/aschn/drf-tracking/blob/master/rest_framework_tracking/mixins.py<commit_after># -*- coding: utf-8 -*- from __future__ import p...
4e3c76fa2c2af7b19bcac72c25044b9534198e18
appModules/potplayermini.py
appModules/potplayermini.py
# -*- coding: utf-8 -*- # appModule for Daum potplayer (automatic reading subtitle and play information) # This file part of Daum potplayer AppModule # Copyright <2016> aheu <advck1123 at GMail Dot com>, license details <license.txt> from potplayer import AppModule
Add pot player mini support
Add pot player mini support
Python
mit
dnz3d4c/potplayerNVDAAddon
Add pot player mini support
# -*- coding: utf-8 -*- # appModule for Daum potplayer (automatic reading subtitle and play information) # This file part of Daum potplayer AppModule # Copyright <2016> aheu <advck1123 at GMail Dot com>, license details <license.txt> from potplayer import AppModule
<commit_before><commit_msg>Add pot player mini support<commit_after>
# -*- coding: utf-8 -*- # appModule for Daum potplayer (automatic reading subtitle and play information) # This file part of Daum potplayer AppModule # Copyright <2016> aheu <advck1123 at GMail Dot com>, license details <license.txt> from potplayer import AppModule
Add pot player mini support# -*- coding: utf-8 -*- # appModule for Daum potplayer (automatic reading subtitle and play information) # This file part of Daum potplayer AppModule # Copyright <2016> aheu <advck1123 at GMail Dot com>, license details <license.txt> from potplayer import AppModule
<commit_before><commit_msg>Add pot player mini support<commit_after># -*- coding: utf-8 -*- # appModule for Daum potplayer (automatic reading subtitle and play information) # This file part of Daum potplayer AppModule # Copyright <2016> aheu <advck1123 at GMail Dot com>, license details <license.txt> from potplayer im...
839716bb2ea94d8c8a3f6cf44ceecf0afcfd6c55
migrations/versions/2213b8196921_.py
migrations/versions/2213b8196921_.py
"""Use native JSON for entry.content on postgres Revision ID: 2213b8196921 Revises: 2b7f5e38dd73 Create Date: 2013-12-15 13:48:25.988000 """ # revision identifiers, used by Alembic. revision = '2213b8196921' down_revision = '2b7f5e38dd73' from marvin.types import JSONType from alembic import op import sqlalchemy a...
Add migration for entry.content -> JSON
Add migration for entry.content -> JSON
Python
mit
streamr/marvin,streamr/marvin,streamr/marvin
Add migration for entry.content -> JSON
"""Use native JSON for entry.content on postgres Revision ID: 2213b8196921 Revises: 2b7f5e38dd73 Create Date: 2013-12-15 13:48:25.988000 """ # revision identifiers, used by Alembic. revision = '2213b8196921' down_revision = '2b7f5e38dd73' from marvin.types import JSONType from alembic import op import sqlalchemy a...
<commit_before><commit_msg>Add migration for entry.content -> JSON<commit_after>
"""Use native JSON for entry.content on postgres Revision ID: 2213b8196921 Revises: 2b7f5e38dd73 Create Date: 2013-12-15 13:48:25.988000 """ # revision identifiers, used by Alembic. revision = '2213b8196921' down_revision = '2b7f5e38dd73' from marvin.types import JSONType from alembic import op import sqlalchemy a...
Add migration for entry.content -> JSON"""Use native JSON for entry.content on postgres Revision ID: 2213b8196921 Revises: 2b7f5e38dd73 Create Date: 2013-12-15 13:48:25.988000 """ # revision identifiers, used by Alembic. revision = '2213b8196921' down_revision = '2b7f5e38dd73' from marvin.types import JSONType fro...
<commit_before><commit_msg>Add migration for entry.content -> JSON<commit_after>"""Use native JSON for entry.content on postgres Revision ID: 2213b8196921 Revises: 2b7f5e38dd73 Create Date: 2013-12-15 13:48:25.988000 """ # revision identifiers, used by Alembic. revision = '2213b8196921' down_revision = '2b7f5e38dd73...
52d8a8f7e616523360528367b6354ebca6c44f8e
migrations/versions/2c240cb3edd1_.py
migrations/versions/2c240cb3edd1_.py
"""Add movie metadata (imdb rating, number of votes, metascore) and relevancy Revision ID: 2c240cb3edd1 Revises: 588336e02ca Create Date: 2014-02-09 13:46:18.630000 """ # revision identifiers, used by Alembic. revision = '2c240cb3edd1' down_revision = '588336e02ca' from alembic import op import sqlalchemy as sa d...
Add migrations for movie ranking metadata
Add migrations for movie ranking metadata
Python
mit
streamr/marvin,streamr/marvin,streamr/marvin
Add migrations for movie ranking metadata
"""Add movie metadata (imdb rating, number of votes, metascore) and relevancy Revision ID: 2c240cb3edd1 Revises: 588336e02ca Create Date: 2014-02-09 13:46:18.630000 """ # revision identifiers, used by Alembic. revision = '2c240cb3edd1' down_revision = '588336e02ca' from alembic import op import sqlalchemy as sa d...
<commit_before><commit_msg>Add migrations for movie ranking metadata<commit_after>
"""Add movie metadata (imdb rating, number of votes, metascore) and relevancy Revision ID: 2c240cb3edd1 Revises: 588336e02ca Create Date: 2014-02-09 13:46:18.630000 """ # revision identifiers, used by Alembic. revision = '2c240cb3edd1' down_revision = '588336e02ca' from alembic import op import sqlalchemy as sa d...
Add migrations for movie ranking metadata"""Add movie metadata (imdb rating, number of votes, metascore) and relevancy Revision ID: 2c240cb3edd1 Revises: 588336e02ca Create Date: 2014-02-09 13:46:18.630000 """ # revision identifiers, used by Alembic. revision = '2c240cb3edd1' down_revision = '588336e02ca' from alem...
<commit_before><commit_msg>Add migrations for movie ranking metadata<commit_after>"""Add movie metadata (imdb rating, number of votes, metascore) and relevancy Revision ID: 2c240cb3edd1 Revises: 588336e02ca Create Date: 2014-02-09 13:46:18.630000 """ # revision identifiers, used by Alembic. revision = '2c240cb3edd1'...
e5c57e7e0110fb35707ef4900f289698fb778dfd
tests/unit/test_settings.py
tests/unit/test_settings.py
""" Tests application settings are connected to Django settings and have sensible default values. """ import importlib from django.test import TestCase, override_settings from drf_signed_auth import settings class SettingsTest(TestCase): def setUp(self): self.sut = settings self.addCleanup(lambda...
Add tests for settings & defaults
Add tests for settings & defaults
Python
bsd-2-clause
marcgibbons/drf_signed_auth,marcgibbons/drf_signed_auth,marcgibbons/drf_signed_auth
Add tests for settings & defaults
""" Tests application settings are connected to Django settings and have sensible default values. """ import importlib from django.test import TestCase, override_settings from drf_signed_auth import settings class SettingsTest(TestCase): def setUp(self): self.sut = settings self.addCleanup(lambda...
<commit_before><commit_msg>Add tests for settings & defaults<commit_after>
""" Tests application settings are connected to Django settings and have sensible default values. """ import importlib from django.test import TestCase, override_settings from drf_signed_auth import settings class SettingsTest(TestCase): def setUp(self): self.sut = settings self.addCleanup(lambda...
Add tests for settings & defaults""" Tests application settings are connected to Django settings and have sensible default values. """ import importlib from django.test import TestCase, override_settings from drf_signed_auth import settings class SettingsTest(TestCase): def setUp(self): self.sut = settin...
<commit_before><commit_msg>Add tests for settings & defaults<commit_after>""" Tests application settings are connected to Django settings and have sensible default values. """ import importlib from django.test import TestCase, override_settings from drf_signed_auth import settings class SettingsTest(TestCase): d...
7e56bb9c4ac96e46bb786277414724de742af8f0
photutils/utils/tests/test_misc.py
photutils/utils/tests/test_misc.py
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Tests for the _misc module. """ import pytest from .._misc import _get_meta @pytest.mark.parametrize('utc', (False, True)) def test_get_meta(utc): meta = _get_meta(utc) keys = ('date', 'version') for key in keys: assert key in m...
Add unit tests for utils._misc
Add unit tests for utils._misc
Python
bsd-3-clause
astropy/photutils,larrybradley/photutils
Add unit tests for utils._misc
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Tests for the _misc module. """ import pytest from .._misc import _get_meta @pytest.mark.parametrize('utc', (False, True)) def test_get_meta(utc): meta = _get_meta(utc) keys = ('date', 'version') for key in keys: assert key in m...
<commit_before><commit_msg>Add unit tests for utils._misc<commit_after>
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Tests for the _misc module. """ import pytest from .._misc import _get_meta @pytest.mark.parametrize('utc', (False, True)) def test_get_meta(utc): meta = _get_meta(utc) keys = ('date', 'version') for key in keys: assert key in m...
Add unit tests for utils._misc# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Tests for the _misc module. """ import pytest from .._misc import _get_meta @pytest.mark.parametrize('utc', (False, True)) def test_get_meta(utc): meta = _get_meta(utc) keys = ('date', 'version') for key in...
<commit_before><commit_msg>Add unit tests for utils._misc<commit_after># Licensed under a 3-clause BSD style license - see LICENSE.rst """ Tests for the _misc module. """ import pytest from .._misc import _get_meta @pytest.mark.parametrize('utc', (False, True)) def test_get_meta(utc): meta = _get_meta(utc) ...
a9116a9c47602f24c9e4fa6ca30b99507ae29703
dumpws.py
dumpws.py
#!/usr/bin/env python3 import websockets import asyncio import time # import logging # logger = logging.getLogger('websockets') # logger.setLevel(logging.DEBUG) # logger.addHandler(logging.StreamHandler()) VARS = ["v.atmosphericDensity", "v.dynamicPressure", "v.altitude", "v.heightFromTerrain", "v.terrainHeigh...
Add a python websocket dumper
Add a python websocket dumper
Python
mit
ndevenish/KerbalHUD,ndevenish/KerbalHUD
Add a python websocket dumper
#!/usr/bin/env python3 import websockets import asyncio import time # import logging # logger = logging.getLogger('websockets') # logger.setLevel(logging.DEBUG) # logger.addHandler(logging.StreamHandler()) VARS = ["v.atmosphericDensity", "v.dynamicPressure", "v.altitude", "v.heightFromTerrain", "v.terrainHeigh...
<commit_before><commit_msg>Add a python websocket dumper<commit_after>
#!/usr/bin/env python3 import websockets import asyncio import time # import logging # logger = logging.getLogger('websockets') # logger.setLevel(logging.DEBUG) # logger.addHandler(logging.StreamHandler()) VARS = ["v.atmosphericDensity", "v.dynamicPressure", "v.altitude", "v.heightFromTerrain", "v.terrainHeigh...
Add a python websocket dumper#!/usr/bin/env python3 import websockets import asyncio import time # import logging # logger = logging.getLogger('websockets') # logger.setLevel(logging.DEBUG) # logger.addHandler(logging.StreamHandler()) VARS = ["v.atmosphericDensity", "v.dynamicPressure", "v.altitude", "v.height...
<commit_before><commit_msg>Add a python websocket dumper<commit_after>#!/usr/bin/env python3 import websockets import asyncio import time # import logging # logger = logging.getLogger('websockets') # logger.setLevel(logging.DEBUG) # logger.addHandler(logging.StreamHandler()) VARS = ["v.atmosphericDensity", "v.dynami...
0107cdcfdef6d8562c71b576c39ed52fc7afcedf
migrations/versions/0219_default_email_branding.py
migrations/versions/0219_default_email_branding.py
""" Revision ID: 0219_default_email_branding Revises: 0218_another_letter_org Create Date: 2018-08-24 13:36:49.346156 """ from alembic import op from app.models import BRANDING_ORG revision = '0219_default_email_branding' down_revision = '0218_another_letter_org' def upgrade(): op.execute(""" update ...
Set branding_type to org if it’s none
Set branding_type to org if it’s none Same as a0deef06e23e4c81e55d83afb63d4bbab1bdaaa5 but with `is null` not `= null` 🤦🏻‍
Python
mit
alphagov/notifications-api,alphagov/notifications-api
Set branding_type to org if it’s none Same as a0deef06e23e4c81e55d83afb63d4bbab1bdaaa5 but with `is null` not `= null` 🤦🏻‍
""" Revision ID: 0219_default_email_branding Revises: 0218_another_letter_org Create Date: 2018-08-24 13:36:49.346156 """ from alembic import op from app.models import BRANDING_ORG revision = '0219_default_email_branding' down_revision = '0218_another_letter_org' def upgrade(): op.execute(""" update ...
<commit_before><commit_msg>Set branding_type to org if it’s none Same as a0deef06e23e4c81e55d83afb63d4bbab1bdaaa5 but with `is null` not `= null` 🤦🏻‍<commit_after>
""" Revision ID: 0219_default_email_branding Revises: 0218_another_letter_org Create Date: 2018-08-24 13:36:49.346156 """ from alembic import op from app.models import BRANDING_ORG revision = '0219_default_email_branding' down_revision = '0218_another_letter_org' def upgrade(): op.execute(""" update ...
Set branding_type to org if it’s none Same as a0deef06e23e4c81e55d83afb63d4bbab1bdaaa5 but with `is null` not `= null` 🤦🏻‍""" Revision ID: 0219_default_email_branding Revises: 0218_another_letter_org Create Date: 2018-08-24 13:36:49.346156 """ from alembic import op from app.models import BRANDING_ORG revision = ...
<commit_before><commit_msg>Set branding_type to org if it’s none Same as a0deef06e23e4c81e55d83afb63d4bbab1bdaaa5 but with `is null` not `= null` 🤦🏻‍<commit_after>""" Revision ID: 0219_default_email_branding Revises: 0218_another_letter_org Create Date: 2018-08-24 13:36:49.346156 """ from alembic import op from ap...
d064a1e86e2de66593ec2bf665ccd015ed87e6d2
disk_usage.py
disk_usage.py
#!/usr/bin/env python """ Return disk usage statistics about the given path as a (total, used, free) namedtuple. Values are expressed in bytes. """ # Author: Giampaolo Rodola' <g.rodola [AT] gmail [DOT] com> # License: MIT import os import collections _ntuple_diskusage = collections.namedtuple('usage', 'total used ...
Add module to retrieve disk space
Add module to retrieve disk space
Python
mit
borevitzlab/Gigavision,borevitzlab/Gigavision,borevitzlab/Gigavision,borevitzlab/Gigvaision-ControlSoftware,borevitzlab/Gigvaision-ControlSoftware
Add module to retrieve disk space
#!/usr/bin/env python """ Return disk usage statistics about the given path as a (total, used, free) namedtuple. Values are expressed in bytes. """ # Author: Giampaolo Rodola' <g.rodola [AT] gmail [DOT] com> # License: MIT import os import collections _ntuple_diskusage = collections.namedtuple('usage', 'total used ...
<commit_before><commit_msg>Add module to retrieve disk space<commit_after>
#!/usr/bin/env python """ Return disk usage statistics about the given path as a (total, used, free) namedtuple. Values are expressed in bytes. """ # Author: Giampaolo Rodola' <g.rodola [AT] gmail [DOT] com> # License: MIT import os import collections _ntuple_diskusage = collections.namedtuple('usage', 'total used ...
Add module to retrieve disk space#!/usr/bin/env python """ Return disk usage statistics about the given path as a (total, used, free) namedtuple. Values are expressed in bytes. """ # Author: Giampaolo Rodola' <g.rodola [AT] gmail [DOT] com> # License: MIT import os import collections _ntuple_diskusage = collections...
<commit_before><commit_msg>Add module to retrieve disk space<commit_after>#!/usr/bin/env python """ Return disk usage statistics about the given path as a (total, used, free) namedtuple. Values are expressed in bytes. """ # Author: Giampaolo Rodola' <g.rodola [AT] gmail [DOT] com> # License: MIT import os import col...
b996e0f7ddc622afbbd06d1640f7804f0a97745c
.github/release_log.py
.github/release_log.py
#!/usr/bin/env python3 import argparse import json import requests import re BASE_URL = 'https://api.github.com/repos/magicstack/uvloop/compare' def main(): parser = argparse.ArgumentParser( description='Generate release log.') parser.add_argument('--to', dest='to_hash', default='master', type=str...
Add a script to generate release log
Add a script to generate release log
Python
apache-2.0
1st1/uvloop,MagicStack/uvloop,MagicStack/uvloop
Add a script to generate release log
#!/usr/bin/env python3 import argparse import json import requests import re BASE_URL = 'https://api.github.com/repos/magicstack/uvloop/compare' def main(): parser = argparse.ArgumentParser( description='Generate release log.') parser.add_argument('--to', dest='to_hash', default='master', type=str...
<commit_before><commit_msg>Add a script to generate release log<commit_after>
#!/usr/bin/env python3 import argparse import json import requests import re BASE_URL = 'https://api.github.com/repos/magicstack/uvloop/compare' def main(): parser = argparse.ArgumentParser( description='Generate release log.') parser.add_argument('--to', dest='to_hash', default='master', type=str...
Add a script to generate release log#!/usr/bin/env python3 import argparse import json import requests import re BASE_URL = 'https://api.github.com/repos/magicstack/uvloop/compare' def main(): parser = argparse.ArgumentParser( description='Generate release log.') parser.add_argument('--to', dest='...
<commit_before><commit_msg>Add a script to generate release log<commit_after>#!/usr/bin/env python3 import argparse import json import requests import re BASE_URL = 'https://api.github.com/repos/magicstack/uvloop/compare' def main(): parser = argparse.ArgumentParser( description='Generate release log....
916d4e2860e231be0b2f602212931c32dcf72743
migrations/versions/0287_drop_branding_domains.py
migrations/versions/0287_drop_branding_domains.py
""" Revision ID: 0287_drop_branding_domains Revises: 0286_add_unique_email_name Create Date: 2019-04-05 16:25:11.535816 """ from alembic import op import sqlalchemy as sa from sqlalchemy.dialects import postgresql revision = '0287_drop_branding_domains' down_revision = '0286_add_unique_email_name' def upgrade(): ...
Remove domain columns from branding table
Remove domain columns from branding table This relationship is via the `Organisation` now; we don’t use this column to fudge a relationship based on the user’s email address and the matching something in these columns.
Python
mit
alphagov/notifications-api,alphagov/notifications-api
Remove domain columns from branding table This relationship is via the `Organisation` now; we don’t use this column to fudge a relationship based on the user’s email address and the matching something in these columns.
""" Revision ID: 0287_drop_branding_domains Revises: 0286_add_unique_email_name Create Date: 2019-04-05 16:25:11.535816 """ from alembic import op import sqlalchemy as sa from sqlalchemy.dialects import postgresql revision = '0287_drop_branding_domains' down_revision = '0286_add_unique_email_name' def upgrade(): ...
<commit_before><commit_msg>Remove domain columns from branding table This relationship is via the `Organisation` now; we don’t use this column to fudge a relationship based on the user’s email address and the matching something in these columns.<commit_after>
""" Revision ID: 0287_drop_branding_domains Revises: 0286_add_unique_email_name Create Date: 2019-04-05 16:25:11.535816 """ from alembic import op import sqlalchemy as sa from sqlalchemy.dialects import postgresql revision = '0287_drop_branding_domains' down_revision = '0286_add_unique_email_name' def upgrade(): ...
Remove domain columns from branding table This relationship is via the `Organisation` now; we don’t use this column to fudge a relationship based on the user’s email address and the matching something in these columns.""" Revision ID: 0287_drop_branding_domains Revises: 0286_add_unique_email_name Create Date: 2019-04...
<commit_before><commit_msg>Remove domain columns from branding table This relationship is via the `Organisation` now; we don’t use this column to fudge a relationship based on the user’s email address and the matching something in these columns.<commit_after>""" Revision ID: 0287_drop_branding_domains Revises: 0286_a...
fd5824e4e4600b0a3bd58386edfc1029418bd813
auth0/v2/test/authentication/test_users.py
auth0/v2/test/authentication/test_users.py
import unittest import mock from ...authentication.users import Users class TestUsers(unittest.TestCase): @mock.patch('auth0.v2.authentication.users.Users.get') def test_userinfo(self, mock_get): u = Users('my.domain.com') u.userinfo(access_token='atk') mock_get.assert_called_with(...
Add test cases for Users
Add test cases for Users
Python
mit
auth0/auth0-python,auth0/auth0-python
Add test cases for Users
import unittest import mock from ...authentication.users import Users class TestUsers(unittest.TestCase): @mock.patch('auth0.v2.authentication.users.Users.get') def test_userinfo(self, mock_get): u = Users('my.domain.com') u.userinfo(access_token='atk') mock_get.assert_called_with(...
<commit_before><commit_msg>Add test cases for Users<commit_after>
import unittest import mock from ...authentication.users import Users class TestUsers(unittest.TestCase): @mock.patch('auth0.v2.authentication.users.Users.get') def test_userinfo(self, mock_get): u = Users('my.domain.com') u.userinfo(access_token='atk') mock_get.assert_called_with(...
Add test cases for Usersimport unittest import mock from ...authentication.users import Users class TestUsers(unittest.TestCase): @mock.patch('auth0.v2.authentication.users.Users.get') def test_userinfo(self, mock_get): u = Users('my.domain.com') u.userinfo(access_token='atk') mock...
<commit_before><commit_msg>Add test cases for Users<commit_after>import unittest import mock from ...authentication.users import Users class TestUsers(unittest.TestCase): @mock.patch('auth0.v2.authentication.users.Users.get') def test_userinfo(self, mock_get): u = Users('my.domain.com') u.u...
1358eb62cd54d921da0c76dba8536067ff51a31e
server/patch_hosts.py
server/patch_hosts.py
#!/usr/bin/env python import argparse from qlmdm import set_gpg, patch_hosts set_gpg('server') def parse_args(): parser = argparse.ArgumentParser(description='Queue a patch for one or ' 'more hosts') parser.add_argument('--host', action='append', help='Host(s) on which...
Add script for sending arbitrary patch files to clients
Add script for sending arbitrary patch files to clients
Python
apache-2.0
quantopian/PenguinDome,quantopian/PenguinDome
Add script for sending arbitrary patch files to clients
#!/usr/bin/env python import argparse from qlmdm import set_gpg, patch_hosts set_gpg('server') def parse_args(): parser = argparse.ArgumentParser(description='Queue a patch for one or ' 'more hosts') parser.add_argument('--host', action='append', help='Host(s) on which...
<commit_before><commit_msg>Add script for sending arbitrary patch files to clients<commit_after>
#!/usr/bin/env python import argparse from qlmdm import set_gpg, patch_hosts set_gpg('server') def parse_args(): parser = argparse.ArgumentParser(description='Queue a patch for one or ' 'more hosts') parser.add_argument('--host', action='append', help='Host(s) on which...
Add script for sending arbitrary patch files to clients#!/usr/bin/env python import argparse from qlmdm import set_gpg, patch_hosts set_gpg('server') def parse_args(): parser = argparse.ArgumentParser(description='Queue a patch for one or ' 'more hosts') parser.add_arg...
<commit_before><commit_msg>Add script for sending arbitrary patch files to clients<commit_after>#!/usr/bin/env python import argparse from qlmdm import set_gpg, patch_hosts set_gpg('server') def parse_args(): parser = argparse.ArgumentParser(description='Queue a patch for one or ' ...
5b0cbbd19aef3a28dcee8b7143c1c0644da9c3ff
find_bytes.py
find_bytes.py
shellcode = "\x31\xdb\xf7\xe3\x53\x43\x53\x6a\x02\x89\xe1\xb0\x66\xcd\x80\x93\x59\xb0\x3f\xcd\x80\x49\x79\xf9\x68\x8f\xf8\x02\x4f\x68\x02\x00\x11\x5c\x89\xe1\xb0\x66\x50\x51\x53\xb3\x03\x89\xe1\xcd\x80\x52\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\x52\x53\x89\xe1\xb0\x0b\xcd\x80" shellcode = shellcode.encode("hex...
Add a script for finding bytes
Add a script for finding bytes
Python
mit
jakkdu/idapythons
Add a script for finding bytes
shellcode = "\x31\xdb\xf7\xe3\x53\x43\x53\x6a\x02\x89\xe1\xb0\x66\xcd\x80\x93\x59\xb0\x3f\xcd\x80\x49\x79\xf9\x68\x8f\xf8\x02\x4f\x68\x02\x00\x11\x5c\x89\xe1\xb0\x66\x50\x51\x53\xb3\x03\x89\xe1\xcd\x80\x52\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\x52\x53\x89\xe1\xb0\x0b\xcd\x80" shellcode = shellcode.encode("hex...
<commit_before><commit_msg>Add a script for finding bytes<commit_after>
shellcode = "\x31\xdb\xf7\xe3\x53\x43\x53\x6a\x02\x89\xe1\xb0\x66\xcd\x80\x93\x59\xb0\x3f\xcd\x80\x49\x79\xf9\x68\x8f\xf8\x02\x4f\x68\x02\x00\x11\x5c\x89\xe1\xb0\x66\x50\x51\x53\xb3\x03\x89\xe1\xcd\x80\x52\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\x52\x53\x89\xe1\xb0\x0b\xcd\x80" shellcode = shellcode.encode("hex...
Add a script for finding bytesshellcode = "\x31\xdb\xf7\xe3\x53\x43\x53\x6a\x02\x89\xe1\xb0\x66\xcd\x80\x93\x59\xb0\x3f\xcd\x80\x49\x79\xf9\x68\x8f\xf8\x02\x4f\x68\x02\x00\x11\x5c\x89\xe1\xb0\x66\x50\x51\x53\xb3\x03\x89\xe1\xcd\x80\x52\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\x52\x53\x89\xe1\xb0\x0b\xcd\x80" she...
<commit_before><commit_msg>Add a script for finding bytes<commit_after>shellcode = "\x31\xdb\xf7\xe3\x53\x43\x53\x6a\x02\x89\xe1\xb0\x66\xcd\x80\x93\x59\xb0\x3f\xcd\x80\x49\x79\xf9\x68\x8f\xf8\x02\x4f\x68\x02\x00\x11\x5c\x89\xe1\xb0\x66\x50\x51\x53\xb3\x03\x89\xe1\xcd\x80\x52\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89...
17c42034137ca01557163f9d5386450303b872d7
scripts/tests/test_populate_new_and_noteworthy.py
scripts/tests/test_populate_new_and_noteworthy.py
import datetime from nose.tools import * # noqa from tests.base import OsfTestCase from tests.factories import ProjectFactory from scripts.populate_new_and_noteworthy_projects import main class TestPopulateNewAndNoteworthy(OsfTestCase): def setUp(self): super(TestPopulateNewAndNoteworthy, self).setUp(...
Add file for testing script that populates new and noteworthy nodes. Tests still need to be written.
Add file for testing script that populates new and noteworthy nodes. Tests still need to be written.
Python
apache-2.0
caseyrollins/osf.io,TomBaxter/osf.io,TomHeatwole/osf.io,SSJohns/osf.io,Nesiehr/osf.io,crcresearch/osf.io,emetsger/osf.io,crcresearch/osf.io,chennan47/osf.io,caneruguz/osf.io,emetsger/osf.io,leb2dg/osf.io,asanfilippo7/osf.io,TomHeatwole/osf.io,mluo613/osf.io,cwisecarver/osf.io,zamattiac/osf.io,amyshi188/osf.io,DanielSBr...
Add file for testing script that populates new and noteworthy nodes. Tests still need to be written.
import datetime from nose.tools import * # noqa from tests.base import OsfTestCase from tests.factories import ProjectFactory from scripts.populate_new_and_noteworthy_projects import main class TestPopulateNewAndNoteworthy(OsfTestCase): def setUp(self): super(TestPopulateNewAndNoteworthy, self).setUp(...
<commit_before><commit_msg>Add file for testing script that populates new and noteworthy nodes. Tests still need to be written.<commit_after>
import datetime from nose.tools import * # noqa from tests.base import OsfTestCase from tests.factories import ProjectFactory from scripts.populate_new_and_noteworthy_projects import main class TestPopulateNewAndNoteworthy(OsfTestCase): def setUp(self): super(TestPopulateNewAndNoteworthy, self).setUp(...
Add file for testing script that populates new and noteworthy nodes. Tests still need to be written.import datetime from nose.tools import * # noqa from tests.base import OsfTestCase from tests.factories import ProjectFactory from scripts.populate_new_and_noteworthy_projects import main class TestPopulateNewAndNo...
<commit_before><commit_msg>Add file for testing script that populates new and noteworthy nodes. Tests still need to be written.<commit_after>import datetime from nose.tools import * # noqa from tests.base import OsfTestCase from tests.factories import ProjectFactory from scripts.populate_new_and_noteworthy_projects...
09fe0bfb275ded53b2569ce1160a931238fd7116
Python/CompareFreeBSDDocs.py
Python/CompareFreeBSDDocs.py
# -*- Coding: utf-8 -*- # # Copyright (C) 2014 Loic BLOT <http://www.unix-experience.fr> # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # ...
Create a basic script to compare FreeBSD docs
Create a basic script to compare FreeBSD docs needs more and more code :)
Python
bsd-2-clause
nerzhul/MiscScripts,nerzhul/MiscScripts
Create a basic script to compare FreeBSD docs needs more and more code :)
# -*- Coding: utf-8 -*- # # Copyright (C) 2014 Loic BLOT <http://www.unix-experience.fr> # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # ...
<commit_before><commit_msg>Create a basic script to compare FreeBSD docs needs more and more code :)<commit_after>
# -*- Coding: utf-8 -*- # # Copyright (C) 2014 Loic BLOT <http://www.unix-experience.fr> # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # ...
Create a basic script to compare FreeBSD docs needs more and more code :)# -*- Coding: utf-8 -*- # # Copyright (C) 2014 Loic BLOT <http://www.unix-experience.fr> # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # ...
<commit_before><commit_msg>Create a basic script to compare FreeBSD docs needs more and more code :)<commit_after># -*- Coding: utf-8 -*- # # Copyright (C) 2014 Loic BLOT <http://www.unix-experience.fr> # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided tha...
f80bf4cf1723db814e62753ee4bd5a7c302e09ee
src/project/lda_corpus.py
src/project/lda_corpus.py
import sys import logging from os.path import isdir, isfile from gensim import models from corpus import Corpus logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO) class LDACorpus(Corpus): def __init__(self, dict_loc, vec_loc, no_topics=100, update=1, chunksize=10000, pass...
Add basic framework for LDA
Add basic framework for LDA
Python
mit
PinPinIre/Final-Year-Project,PinPinIre/Final-Year-Project,PinPinIre/Final-Year-Project
Add basic framework for LDA
import sys import logging from os.path import isdir, isfile from gensim import models from corpus import Corpus logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO) class LDACorpus(Corpus): def __init__(self, dict_loc, vec_loc, no_topics=100, update=1, chunksize=10000, pass...
<commit_before><commit_msg>Add basic framework for LDA<commit_after>
import sys import logging from os.path import isdir, isfile from gensim import models from corpus import Corpus logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO) class LDACorpus(Corpus): def __init__(self, dict_loc, vec_loc, no_topics=100, update=1, chunksize=10000, pass...
Add basic framework for LDAimport sys import logging from os.path import isdir, isfile from gensim import models from corpus import Corpus logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO) class LDACorpus(Corpus): def __init__(self, dict_loc, vec_loc, no_topics=100, upda...
<commit_before><commit_msg>Add basic framework for LDA<commit_after>import sys import logging from os.path import isdir, isfile from gensim import models from corpus import Corpus logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO) class LDACorpus(Corpus): def __init__(sel...
1984fbe9a59eb5de3c8e9af477ac277a978cf21d
evaluation/packages/displacementKernels.py
evaluation/packages/displacementKernels.py
"""@package DisplacementKernels This module defines an interface to read and use InputGen projects See C++ InputGen project for more details on Projects """ from decimal import Decimal class DisplacementKernel(object): """Python representation of the C++ class AbstractDisplacementKernel """ def __init__(...
Define kernel classes and a factory to generate them from xml
Define kernel classes and a factory to generate them from xml
Python
apache-2.0
amonszpart/globOpt,NUAAXXY/globOpt,NUAAXXY/globOpt,amonszpart/globOpt,NUAAXXY/globOpt,amonszpart/globOpt,amonszpart/globOpt,NUAAXXY/globOpt,amonszpart/globOpt,NUAAXXY/globOpt,amonszpart/globOpt,NUAAXXY/globOpt
Define kernel classes and a factory to generate them from xml
"""@package DisplacementKernels This module defines an interface to read and use InputGen projects See C++ InputGen project for more details on Projects """ from decimal import Decimal class DisplacementKernel(object): """Python representation of the C++ class AbstractDisplacementKernel """ def __init__(...
<commit_before><commit_msg>Define kernel classes and a factory to generate them from xml<commit_after>
"""@package DisplacementKernels This module defines an interface to read and use InputGen projects See C++ InputGen project for more details on Projects """ from decimal import Decimal class DisplacementKernel(object): """Python representation of the C++ class AbstractDisplacementKernel """ def __init__(...
Define kernel classes and a factory to generate them from xml"""@package DisplacementKernels This module defines an interface to read and use InputGen projects See C++ InputGen project for more details on Projects """ from decimal import Decimal class DisplacementKernel(object): """Python representation of the C...
<commit_before><commit_msg>Define kernel classes and a factory to generate them from xml<commit_after>"""@package DisplacementKernels This module defines an interface to read and use InputGen projects See C++ InputGen project for more details on Projects """ from decimal import Decimal class DisplacementKernel(objec...
f71251f5f5b25da9e76dcb93a5b0ffbda3efa0c6
src/lib/constants/element/page_header/lhn_menu/create_new_program.py
src/lib/constants/element/page_header/lhn_menu/create_new_program.py
SELECTOR_TITLE = '[data-test-id="new_program_field_title_a63ed79d"]' SELECTOR_DESCRIPTION = '[data-test-id="new_program_field_description_77c4a06d"] ' \ 'iframe.wysihtml5-sandbox' SELECTOR_NOTES = '[data-test-id="new_program_field_notes_75b8bc05"] ' \ 'iframe.wysihtml5-sandbox' S...
Add selectors for elements in new program page
Add selectors for elements in new program page
Python
apache-2.0
andrei-karalionak/ggrc-core,edofic/ggrc-core,selahssea/ggrc-core,jmakov/ggrc-core,jmakov/ggrc-core,j0gurt/ggrc-core,prasannav7/ggrc-core,NejcZupec/ggrc-core,j0gurt/ggrc-core,edofic/ggrc-core,NejcZupec/ggrc-core,andrei-karalionak/ggrc-core,VinnieJohns/ggrc-core,kr41/ggrc-core,plamut/ggrc-core,plamut/ggrc-core,edofic/ggr...
Add selectors for elements in new program page
SELECTOR_TITLE = '[data-test-id="new_program_field_title_a63ed79d"]' SELECTOR_DESCRIPTION = '[data-test-id="new_program_field_description_77c4a06d"] ' \ 'iframe.wysihtml5-sandbox' SELECTOR_NOTES = '[data-test-id="new_program_field_notes_75b8bc05"] ' \ 'iframe.wysihtml5-sandbox' S...
<commit_before><commit_msg>Add selectors for elements in new program page<commit_after>
SELECTOR_TITLE = '[data-test-id="new_program_field_title_a63ed79d"]' SELECTOR_DESCRIPTION = '[data-test-id="new_program_field_description_77c4a06d"] ' \ 'iframe.wysihtml5-sandbox' SELECTOR_NOTES = '[data-test-id="new_program_field_notes_75b8bc05"] ' \ 'iframe.wysihtml5-sandbox' S...
Add selectors for elements in new program pageSELECTOR_TITLE = '[data-test-id="new_program_field_title_a63ed79d"]' SELECTOR_DESCRIPTION = '[data-test-id="new_program_field_description_77c4a06d"] ' \ 'iframe.wysihtml5-sandbox' SELECTOR_NOTES = '[data-test-id="new_program_field_notes_75b8bc05"] ' \...
<commit_before><commit_msg>Add selectors for elements in new program page<commit_after>SELECTOR_TITLE = '[data-test-id="new_program_field_title_a63ed79d"]' SELECTOR_DESCRIPTION = '[data-test-id="new_program_field_description_77c4a06d"] ' \ 'iframe.wysihtml5-sandbox' SELECTOR_NOTES = '[data-test-i...
faa68400ef3e3001bd87e4e9d0189b78908c3e9f
myselenium.py
myselenium.py
# -*- coding:utf-8 -*- from selenium import webdriver import requests import sqlite3 browser = webdriver.Firefox() browser.get('http://www.mouser.cn') html_source = browser.page_source print html_source coon = sqlite3.connect('/root/.mozilla/firefox/gmfs2ivm.default/cookies.sqlite') cursor = coon.cursor() cursor.exe...
Use selenium to open url and then extract local cookies into requests.get
Use selenium to open url and then extract local cookies into requests.get
Python
apache-2.0
huangchuchuan/Spider
Use selenium to open url and then extract local cookies into requests.get
# -*- coding:utf-8 -*- from selenium import webdriver import requests import sqlite3 browser = webdriver.Firefox() browser.get('http://www.mouser.cn') html_source = browser.page_source print html_source coon = sqlite3.connect('/root/.mozilla/firefox/gmfs2ivm.default/cookies.sqlite') cursor = coon.cursor() cursor.exe...
<commit_before><commit_msg>Use selenium to open url and then extract local cookies into requests.get<commit_after>
# -*- coding:utf-8 -*- from selenium import webdriver import requests import sqlite3 browser = webdriver.Firefox() browser.get('http://www.mouser.cn') html_source = browser.page_source print html_source coon = sqlite3.connect('/root/.mozilla/firefox/gmfs2ivm.default/cookies.sqlite') cursor = coon.cursor() cursor.exe...
Use selenium to open url and then extract local cookies into requests.get# -*- coding:utf-8 -*- from selenium import webdriver import requests import sqlite3 browser = webdriver.Firefox() browser.get('http://www.mouser.cn') html_source = browser.page_source print html_source coon = sqlite3.connect('/root/.mozilla/fi...
<commit_before><commit_msg>Use selenium to open url and then extract local cookies into requests.get<commit_after># -*- coding:utf-8 -*- from selenium import webdriver import requests import sqlite3 browser = webdriver.Firefox() browser.get('http://www.mouser.cn') html_source = browser.page_source print html_source ...
86e6577fc9737b76b287c676fa7b7ceb64c25838
karabo_data/tests/test_agipd_geometry.py
karabo_data/tests/test_agipd_geometry.py
import numpy as np from karabo_data.geometry2 import AGIPD_1MGeometry def test_snap_assemble_data(): geom = AGIPD_1MGeometry.from_quad_positions(quad_pos=[ (-525, 625), (-550, -10), (520, -160), (542.5, 475), ]) snap_geom = geom.snap() stacked_data = np.zeros((16, 512,...
Add rough test for AGIPD geometry
Add rough test for AGIPD geometry
Python
bsd-3-clause
European-XFEL/h5tools-py
Add rough test for AGIPD geometry
import numpy as np from karabo_data.geometry2 import AGIPD_1MGeometry def test_snap_assemble_data(): geom = AGIPD_1MGeometry.from_quad_positions(quad_pos=[ (-525, 625), (-550, -10), (520, -160), (542.5, 475), ]) snap_geom = geom.snap() stacked_data = np.zeros((16, 512,...
<commit_before><commit_msg>Add rough test for AGIPD geometry<commit_after>
import numpy as np from karabo_data.geometry2 import AGIPD_1MGeometry def test_snap_assemble_data(): geom = AGIPD_1MGeometry.from_quad_positions(quad_pos=[ (-525, 625), (-550, -10), (520, -160), (542.5, 475), ]) snap_geom = geom.snap() stacked_data = np.zeros((16, 512,...
Add rough test for AGIPD geometryimport numpy as np from karabo_data.geometry2 import AGIPD_1MGeometry def test_snap_assemble_data(): geom = AGIPD_1MGeometry.from_quad_positions(quad_pos=[ (-525, 625), (-550, -10), (520, -160), (542.5, 475), ]) snap_geom = geom.snap() ...
<commit_before><commit_msg>Add rough test for AGIPD geometry<commit_after>import numpy as np from karabo_data.geometry2 import AGIPD_1MGeometry def test_snap_assemble_data(): geom = AGIPD_1MGeometry.from_quad_positions(quad_pos=[ (-525, 625), (-550, -10), (520, -160), (542.5, 475),...
306b18870044798aa4256bba8cd213a6ef2b9365
myflaskapp/migrations/versions/042f45c107c4_create_items_table.py
myflaskapp/migrations/versions/042f45c107c4_create_items_table.py
"""Create items table Revision ID: 042f45c107c4 Revises: 8b1cf2bfda5e Create Date: 2017-04-24 02:31:00.545797 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '042f45c107c4' down_revision = '8b1cf2bfda5e' branch_labels = None depends_on = None def upgrade(): ...
Create Items table db migration
Create Items table db migration
Python
mit
terryjbates/test-driven-development-with-python,terryjbates/test-driven-development-with-python,terryjbates/test-driven-development-with-python,terryjbates/test-driven-development-with-python,terryjbates/test-driven-development-with-python
Create Items table db migration
"""Create items table Revision ID: 042f45c107c4 Revises: 8b1cf2bfda5e Create Date: 2017-04-24 02:31:00.545797 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '042f45c107c4' down_revision = '8b1cf2bfda5e' branch_labels = None depends_on = None def upgrade(): ...
<commit_before><commit_msg>Create Items table db migration<commit_after>
"""Create items table Revision ID: 042f45c107c4 Revises: 8b1cf2bfda5e Create Date: 2017-04-24 02:31:00.545797 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '042f45c107c4' down_revision = '8b1cf2bfda5e' branch_labels = None depends_on = None def upgrade(): ...
Create Items table db migration"""Create items table Revision ID: 042f45c107c4 Revises: 8b1cf2bfda5e Create Date: 2017-04-24 02:31:00.545797 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '042f45c107c4' down_revision = '8b1cf2bfda5e' branch_labels = None depen...
<commit_before><commit_msg>Create Items table db migration<commit_after>"""Create items table Revision ID: 042f45c107c4 Revises: 8b1cf2bfda5e Create Date: 2017-04-24 02:31:00.545797 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '042f45c107c4' down_revision = ...
bbb448e6909fd975ba4f1a19d40febad4464df8c
tests/test_file_handle.py
tests/test_file_handle.py
"""Check that given file handles are not closed.""" import unittest from os.path import join, dirname from msoffcrypto import OfficeFile #: directory with input DATA_DIR = join(dirname(__file__), 'inputs') class FileHandleTest(unittest.TestCase): """See module doc.""" def test_file_handle_open(self): ...
Create unittest to avoid repeating excessive closing
Create unittest to avoid repeating excessive closing "Thou shalst not close file handles that SHE, your caller, has given you!" Ensure we comply with this dogma.
Python
mit
nolze/ms-offcrypto-tool,nolze/msoffcrypto-tool,nolze/msoffcrypto-tool,nolze/ms-offcrypto-tool
Create unittest to avoid repeating excessive closing "Thou shalst not close file handles that SHE, your caller, has given you!" Ensure we comply with this dogma.
"""Check that given file handles are not closed.""" import unittest from os.path import join, dirname from msoffcrypto import OfficeFile #: directory with input DATA_DIR = join(dirname(__file__), 'inputs') class FileHandleTest(unittest.TestCase): """See module doc.""" def test_file_handle_open(self): ...
<commit_before><commit_msg>Create unittest to avoid repeating excessive closing "Thou shalst not close file handles that SHE, your caller, has given you!" Ensure we comply with this dogma.<commit_after>
"""Check that given file handles are not closed.""" import unittest from os.path import join, dirname from msoffcrypto import OfficeFile #: directory with input DATA_DIR = join(dirname(__file__), 'inputs') class FileHandleTest(unittest.TestCase): """See module doc.""" def test_file_handle_open(self): ...
Create unittest to avoid repeating excessive closing "Thou shalst not close file handles that SHE, your caller, has given you!" Ensure we comply with this dogma."""Check that given file handles are not closed.""" import unittest from os.path import join, dirname from msoffcrypto import OfficeFile #: directory wi...
<commit_before><commit_msg>Create unittest to avoid repeating excessive closing "Thou shalst not close file handles that SHE, your caller, has given you!" Ensure we comply with this dogma.<commit_after>"""Check that given file handles are not closed.""" import unittest from os.path import join, dirname from msoffc...
21b8788e2df4fa143dcb7594510c3bff60367224
designate/storage/impl_sqlalchemy/migrate_repo/versions/018_add_back_unique_name_deleted_sqlite.py
designate/storage/impl_sqlalchemy/migrate_repo/versions/018_add_back_unique_name_deleted_sqlite.py
# Copyright 2013 Hewlett-Packard Development Company, L.P. # # Author: Patrick Galbraith <patg@hp.com> # # 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/...
Replace missing indexes for SQLite
Replace missing indexes for SQLite Migration 018 to replace missing indexes on domains and servers Bug #1200027 Change-Id: I2240af58c7730d019916924f8f314134899c7cf6
Python
apache-2.0
ionrock/designate,grahamhayes/designate,openstack/designate,richm/designate,kiall/designate-py3,ramsateesh/designate,tonyli71/designate,cneill/designate,kiall/designate-py3,grahamhayes/designate,ramsateesh/designate,tonyli71/designate,muraliselva10/designate,kiall/designate-py3,kiall/designate-py3,muraliselva10/designa...
Replace missing indexes for SQLite Migration 018 to replace missing indexes on domains and servers Bug #1200027 Change-Id: I2240af58c7730d019916924f8f314134899c7cf6
# Copyright 2013 Hewlett-Packard Development Company, L.P. # # Author: Patrick Galbraith <patg@hp.com> # # 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/...
<commit_before><commit_msg>Replace missing indexes for SQLite Migration 018 to replace missing indexes on domains and servers Bug #1200027 Change-Id: I2240af58c7730d019916924f8f314134899c7cf6<commit_after>
# Copyright 2013 Hewlett-Packard Development Company, L.P. # # Author: Patrick Galbraith <patg@hp.com> # # 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/...
Replace missing indexes for SQLite Migration 018 to replace missing indexes on domains and servers Bug #1200027 Change-Id: I2240af58c7730d019916924f8f314134899c7cf6# Copyright 2013 Hewlett-Packard Development Company, L.P. # # Author: Patrick Galbraith <patg@hp.com> # # Licensed under the Apache License, Version 2.0...
<commit_before><commit_msg>Replace missing indexes for SQLite Migration 018 to replace missing indexes on domains and servers Bug #1200027 Change-Id: I2240af58c7730d019916924f8f314134899c7cf6<commit_after># Copyright 2013 Hewlett-Packard Development Company, L.P. # # Author: Patrick Galbraith <patg@hp.com> # # Licen...
93bb70c34f7c6eb4a72f8a6f53982a4228fe710f
update.py
update.py
#! /usr/bin/python import os, subprocess os.chdir(os.path.dirname(os.path.abspath(__file__))) subprocess.call([ 'python', os.path.join('..', 'venus', 'planet.py'), 'planet.ini' ])
Add a script for cron
Add a script for cron
Python
mit
kzys/planet-tempura
Add a script for cron
#! /usr/bin/python import os, subprocess os.chdir(os.path.dirname(os.path.abspath(__file__))) subprocess.call([ 'python', os.path.join('..', 'venus', 'planet.py'), 'planet.ini' ])
<commit_before><commit_msg>Add a script for cron<commit_after>
#! /usr/bin/python import os, subprocess os.chdir(os.path.dirname(os.path.abspath(__file__))) subprocess.call([ 'python', os.path.join('..', 'venus', 'planet.py'), 'planet.ini' ])
Add a script for cron#! /usr/bin/python import os, subprocess os.chdir(os.path.dirname(os.path.abspath(__file__))) subprocess.call([ 'python', os.path.join('..', 'venus', 'planet.py'), 'planet.ini' ])
<commit_before><commit_msg>Add a script for cron<commit_after>#! /usr/bin/python import os, subprocess os.chdir(os.path.dirname(os.path.abspath(__file__))) subprocess.call([ 'python', os.path.join('..', 'venus', 'planet.py'), 'planet.ini' ])
1bb0855bc70598bafb341b48c93e5e26ec8b5818
xc7/fasm2bels/tests/test_verilog_modeling.py
xc7/fasm2bels/tests/test_verilog_modeling.py
import unittest from fasm2bels.verilog_modeling import Wire, Constant, Bus, NoConnect class TestVerilogModeling(unittest.TestCase): def test_connections(self): self.assertEqual("a", Wire("a").to_string()) self.assertEqual("1'b0", Constant(0).to_string()) self.assertEqual("1'b1", Constant(1...
Add test for new connection modelling objects.
Add test for new connection modelling objects. Signed-off-by: Keith Rothman <1bc19627a439baf17510dc2d0b2d250c96d445a5@users.noreply.github.com>
Python
isc
SymbiFlow/symbiflow-xc-fasm2bels
Add test for new connection modelling objects. Signed-off-by: Keith Rothman <1bc19627a439baf17510dc2d0b2d250c96d445a5@users.noreply.github.com>
import unittest from fasm2bels.verilog_modeling import Wire, Constant, Bus, NoConnect class TestVerilogModeling(unittest.TestCase): def test_connections(self): self.assertEqual("a", Wire("a").to_string()) self.assertEqual("1'b0", Constant(0).to_string()) self.assertEqual("1'b1", Constant(1...
<commit_before><commit_msg>Add test for new connection modelling objects. Signed-off-by: Keith Rothman <1bc19627a439baf17510dc2d0b2d250c96d445a5@users.noreply.github.com><commit_after>
import unittest from fasm2bels.verilog_modeling import Wire, Constant, Bus, NoConnect class TestVerilogModeling(unittest.TestCase): def test_connections(self): self.assertEqual("a", Wire("a").to_string()) self.assertEqual("1'b0", Constant(0).to_string()) self.assertEqual("1'b1", Constant(1...
Add test for new connection modelling objects. Signed-off-by: Keith Rothman <1bc19627a439baf17510dc2d0b2d250c96d445a5@users.noreply.github.com>import unittest from fasm2bels.verilog_modeling import Wire, Constant, Bus, NoConnect class TestVerilogModeling(unittest.TestCase): def test_connections(self): se...
<commit_before><commit_msg>Add test for new connection modelling objects. Signed-off-by: Keith Rothman <1bc19627a439baf17510dc2d0b2d250c96d445a5@users.noreply.github.com><commit_after>import unittest from fasm2bels.verilog_modeling import Wire, Constant, Bus, NoConnect class TestVerilogModeling(unittest.TestCase): ...
42a1aaba8daa253b99f444a512f8231db47dfbb2
helpers.py
helpers.py
import array import numpy as np def load_glove_vectors(filename, vocab=None): """ Load glove vectors from a .txt file. Optionally limit the vocabulary to save memory. `vocab` should be a set. """ dct = {} vectors = array.array('d') current_idx = 0 with open(filename, "r", encoding="utf...
import array import numpy as np import pandas as pd def load_glove_vectors(filename, vocab=None): """ Load glove vectors from a .txt file. Optionally limit the vocabulary to save memory. `vocab` should be a set. """ dct = {} vectors = array.array('d') current_idx = 0 with open(filename...
Add dataset conversion helper function
Add dataset conversion helper function
Python
mit
AotY/chatbot-retrieval,LepiorzDaniel/test2
import array import numpy as np def load_glove_vectors(filename, vocab=None): """ Load glove vectors from a .txt file. Optionally limit the vocabulary to save memory. `vocab` should be a set. """ dct = {} vectors = array.array('d') current_idx = 0 with open(filename, "r", encoding="utf...
import array import numpy as np import pandas as pd def load_glove_vectors(filename, vocab=None): """ Load glove vectors from a .txt file. Optionally limit the vocabulary to save memory. `vocab` should be a set. """ dct = {} vectors = array.array('d') current_idx = 0 with open(filename...
<commit_before>import array import numpy as np def load_glove_vectors(filename, vocab=None): """ Load glove vectors from a .txt file. Optionally limit the vocabulary to save memory. `vocab` should be a set. """ dct = {} vectors = array.array('d') current_idx = 0 with open(filename, "r"...
import array import numpy as np import pandas as pd def load_glove_vectors(filename, vocab=None): """ Load glove vectors from a .txt file. Optionally limit the vocabulary to save memory. `vocab` should be a set. """ dct = {} vectors = array.array('d') current_idx = 0 with open(filename...
import array import numpy as np def load_glove_vectors(filename, vocab=None): """ Load glove vectors from a .txt file. Optionally limit the vocabulary to save memory. `vocab` should be a set. """ dct = {} vectors = array.array('d') current_idx = 0 with open(filename, "r", encoding="utf...
<commit_before>import array import numpy as np def load_glove_vectors(filename, vocab=None): """ Load glove vectors from a .txt file. Optionally limit the vocabulary to save memory. `vocab` should be a set. """ dct = {} vectors = array.array('d') current_idx = 0 with open(filename, "r"...
4b9798b028afbfcfc4ae7417f1adc488a9567977
benchmarks/expand2b_sympy.py
benchmarks/expand2b_sympy.py
from timeit import default_timer as clock from sympy import ring, ZZ R, x, y, z, w = ring("x y z w", ZZ) e = (x+y+z+w)**15 t1 = clock() f = e*(e+w) t2 = clock() #print f print "Total time:", t2-t1, "s" print "number of terms:", len(f)
Add SymPy benchmark for the expand2b problem
Add SymPy benchmark for the expand2b problem
Python
mit
bjodah/symengine.py,bjodah/symengine.py,symengine/symengine.py,bjodah/symengine.py,symengine/symengine.py,symengine/symengine.py
Add SymPy benchmark for the expand2b problem
from timeit import default_timer as clock from sympy import ring, ZZ R, x, y, z, w = ring("x y z w", ZZ) e = (x+y+z+w)**15 t1 = clock() f = e*(e+w) t2 = clock() #print f print "Total time:", t2-t1, "s" print "number of terms:", len(f)
<commit_before><commit_msg>Add SymPy benchmark for the expand2b problem<commit_after>
from timeit import default_timer as clock from sympy import ring, ZZ R, x, y, z, w = ring("x y z w", ZZ) e = (x+y+z+w)**15 t1 = clock() f = e*(e+w) t2 = clock() #print f print "Total time:", t2-t1, "s" print "number of terms:", len(f)
Add SymPy benchmark for the expand2b problemfrom timeit import default_timer as clock from sympy import ring, ZZ R, x, y, z, w = ring("x y z w", ZZ) e = (x+y+z+w)**15 t1 = clock() f = e*(e+w) t2 = clock() #print f print "Total time:", t2-t1, "s" print "number of terms:", len(f)
<commit_before><commit_msg>Add SymPy benchmark for the expand2b problem<commit_after>from timeit import default_timer as clock from sympy import ring, ZZ R, x, y, z, w = ring("x y z w", ZZ) e = (x+y+z+w)**15 t1 = clock() f = e*(e+w) t2 = clock() #print f print "Total time:", t2-t1, "s" print "number of terms:", len(f)
e4e345e348093639a488855058b1b5ebe44e3507
lintcode/Hard/180_Binary_Representation.py
lintcode/Hard/180_Binary_Representation.py
class Solution: #@param n: Given a decimal number that is passed in as a string #@return: A string def binaryRepresentation(self, n): # write you code here int_part = int(float(n)) dec_part = float('0' + n[n.find('.'):]) if n.find('.') != -1 else 0 dec_str = '' valid ...
Add solution to lintcode question 180
Add solution to lintcode question 180
Python
mit
Rhadow/leetcode,Rhadow/leetcode,Rhadow/leetcode,Rhadow/leetcode
Add solution to lintcode question 180
class Solution: #@param n: Given a decimal number that is passed in as a string #@return: A string def binaryRepresentation(self, n): # write you code here int_part = int(float(n)) dec_part = float('0' + n[n.find('.'):]) if n.find('.') != -1 else 0 dec_str = '' valid ...
<commit_before><commit_msg>Add solution to lintcode question 180<commit_after>
class Solution: #@param n: Given a decimal number that is passed in as a string #@return: A string def binaryRepresentation(self, n): # write you code here int_part = int(float(n)) dec_part = float('0' + n[n.find('.'):]) if n.find('.') != -1 else 0 dec_str = '' valid ...
Add solution to lintcode question 180class Solution: #@param n: Given a decimal number that is passed in as a string #@return: A string def binaryRepresentation(self, n): # write you code here int_part = int(float(n)) dec_part = float('0' + n[n.find('.'):]) if n.find('.') != -1 else ...
<commit_before><commit_msg>Add solution to lintcode question 180<commit_after>class Solution: #@param n: Given a decimal number that is passed in as a string #@return: A string def binaryRepresentation(self, n): # write you code here int_part = int(float(n)) dec_part = float('0' + n[...
a006c5f13e25d36f72e0878b4245e0edb126da68
ckanext/requestdata/controllers/search.py
ckanext/requestdata/controllers/search.py
try: # CKAN 2.7 and later from ckan.common import config except ImportError: # CKAN 2.6 and earlier from pylons import config is_hdx = config.get('hdx_portal') if is_hdx: from ckanext.hdx_search.controllers.search_controller import HDXSearchController as PackageController else: from ckan.contr...
try: # CKAN 2.7 and later from ckan.common import config except ImportError: # CKAN 2.6 and earlier from pylons import config from paste.deploy.converters import asbool is_hdx = asbool(config.get('hdx_portal', False)) if is_hdx: from ckanext.hdx_search.controllers.search_controller\ impor...
Convert hdx_portal to a boolean value
Convert hdx_portal to a boolean value
Python
agpl-3.0
ViderumGlobal/ckanext-requestdata,ViderumGlobal/ckanext-requestdata,ViderumGlobal/ckanext-requestdata,ViderumGlobal/ckanext-requestdata
try: # CKAN 2.7 and later from ckan.common import config except ImportError: # CKAN 2.6 and earlier from pylons import config is_hdx = config.get('hdx_portal') if is_hdx: from ckanext.hdx_search.controllers.search_controller import HDXSearchController as PackageController else: from ckan.contr...
try: # CKAN 2.7 and later from ckan.common import config except ImportError: # CKAN 2.6 and earlier from pylons import config from paste.deploy.converters import asbool is_hdx = asbool(config.get('hdx_portal', False)) if is_hdx: from ckanext.hdx_search.controllers.search_controller\ impor...
<commit_before>try: # CKAN 2.7 and later from ckan.common import config except ImportError: # CKAN 2.6 and earlier from pylons import config is_hdx = config.get('hdx_portal') if is_hdx: from ckanext.hdx_search.controllers.search_controller import HDXSearchController as PackageController else: ...
try: # CKAN 2.7 and later from ckan.common import config except ImportError: # CKAN 2.6 and earlier from pylons import config from paste.deploy.converters import asbool is_hdx = asbool(config.get('hdx_portal', False)) if is_hdx: from ckanext.hdx_search.controllers.search_controller\ impor...
try: # CKAN 2.7 and later from ckan.common import config except ImportError: # CKAN 2.6 and earlier from pylons import config is_hdx = config.get('hdx_portal') if is_hdx: from ckanext.hdx_search.controllers.search_controller import HDXSearchController as PackageController else: from ckan.contr...
<commit_before>try: # CKAN 2.7 and later from ckan.common import config except ImportError: # CKAN 2.6 and earlier from pylons import config is_hdx = config.get('hdx_portal') if is_hdx: from ckanext.hdx_search.controllers.search_controller import HDXSearchController as PackageController else: ...
1d9e9e3f6b5796db7f72f108e3a19327f0313cd9
tead/event.py
tead/event.py
import queue class Event: def __init__(self, eventType='', userParam=dict()): self.type = eventType self.userParam = userParam class EventSystem: def __init__(self): self._eventQueue = queue.Queue() self._eventHandlers = dict() def regist...
Implement first prototype of EventSystem
Implement first prototype of EventSystem
Python
mit
JeFaProductions/TextAdventure2
Implement first prototype of EventSystem
import queue class Event: def __init__(self, eventType='', userParam=dict()): self.type = eventType self.userParam = userParam class EventSystem: def __init__(self): self._eventQueue = queue.Queue() self._eventHandlers = dict() def regist...
<commit_before><commit_msg>Implement first prototype of EventSystem<commit_after>
import queue class Event: def __init__(self, eventType='', userParam=dict()): self.type = eventType self.userParam = userParam class EventSystem: def __init__(self): self._eventQueue = queue.Queue() self._eventHandlers = dict() def regist...
Implement first prototype of EventSystemimport queue class Event: def __init__(self, eventType='', userParam=dict()): self.type = eventType self.userParam = userParam class EventSystem: def __init__(self): self._eventQueue = queue.Queue() self._eventH...
<commit_before><commit_msg>Implement first prototype of EventSystem<commit_after>import queue class Event: def __init__(self, eventType='', userParam=dict()): self.type = eventType self.userParam = userParam class EventSystem: def __init__(self): self._eventQ...
429a2fa0d24c4c56506d584b42a977b13874b9ec
test/test_live.py
test/test_live.py
# from unittest import TestCase # from elasticsearch import Elasticsearch # from query import Match, Range # # # def get_docs(ret): # return ret['hits']['hits'] # # # class TestLive(TestCase): # es = None # # @staticmethod # def query(query): # return TestLive.es.search('test_index', 'test_doc',...
Add test with live database, disabled by default such that all test complete when using master
Add test with live database, disabled by default such that all test complete when using master
Python
mit
pietermarsman/elastic-queries
Add test with live database, disabled by default such that all test complete when using master
# from unittest import TestCase # from elasticsearch import Elasticsearch # from query import Match, Range # # # def get_docs(ret): # return ret['hits']['hits'] # # # class TestLive(TestCase): # es = None # # @staticmethod # def query(query): # return TestLive.es.search('test_index', 'test_doc',...
<commit_before><commit_msg>Add test with live database, disabled by default such that all test complete when using master<commit_after>
# from unittest import TestCase # from elasticsearch import Elasticsearch # from query import Match, Range # # # def get_docs(ret): # return ret['hits']['hits'] # # # class TestLive(TestCase): # es = None # # @staticmethod # def query(query): # return TestLive.es.search('test_index', 'test_doc',...
Add test with live database, disabled by default such that all test complete when using master# from unittest import TestCase # from elasticsearch import Elasticsearch # from query import Match, Range # # # def get_docs(ret): # return ret['hits']['hits'] # # # class TestLive(TestCase): # es = None # # @stat...
<commit_before><commit_msg>Add test with live database, disabled by default such that all test complete when using master<commit_after># from unittest import TestCase # from elasticsearch import Elasticsearch # from query import Match, Range # # # def get_docs(ret): # return ret['hits']['hits'] # # # class TestLive...
54942867218662dc1856faf6fda989ccadfda08d
test/test_otps.py
test/test_otps.py
from stompy.model.otps import read_otps import six six.moves.reload_module(read_otps) modfile="data/DATA/Model_OR1km" def test_read_otps(): times=np.arange( np.datetime64('2010-01-01 00:00'), np.datetime64('2010-01-10 00:00'), np.timedelta64(15,'m') ) pred_h,pred_u,...
Add basic test for OTPS code
Add basic test for OTPS code
Python
mit
rustychris/stompy,rustychris/stompy
Add basic test for OTPS code
from stompy.model.otps import read_otps import six six.moves.reload_module(read_otps) modfile="data/DATA/Model_OR1km" def test_read_otps(): times=np.arange( np.datetime64('2010-01-01 00:00'), np.datetime64('2010-01-10 00:00'), np.timedelta64(15,'m') ) pred_h,pred_u,...
<commit_before><commit_msg>Add basic test for OTPS code<commit_after>
from stompy.model.otps import read_otps import six six.moves.reload_module(read_otps) modfile="data/DATA/Model_OR1km" def test_read_otps(): times=np.arange( np.datetime64('2010-01-01 00:00'), np.datetime64('2010-01-10 00:00'), np.timedelta64(15,'m') ) pred_h,pred_u,...
Add basic test for OTPS codefrom stompy.model.otps import read_otps import six six.moves.reload_module(read_otps) modfile="data/DATA/Model_OR1km" def test_read_otps(): times=np.arange( np.datetime64('2010-01-01 00:00'), np.datetime64('2010-01-10 00:00'), np.timedelta64(1...
<commit_before><commit_msg>Add basic test for OTPS code<commit_after>from stompy.model.otps import read_otps import six six.moves.reload_module(read_otps) modfile="data/DATA/Model_OR1km" def test_read_otps(): times=np.arange( np.datetime64('2010-01-01 00:00'), np.datetime64('2010-01-10 00:00...
04337a036429e98edab7c2e5f17086a3ccfe263b
jsonsempai.py
jsonsempai.py
import sys class SempaiLoader(object): def __init__(self, *args): print args def find_module(self, fullname, path=None): print 'finding', fullname, path if fullname == 'simple': return self return None sys.path_hooks.append(SempaiLoader) sys.path.insert(0, 'simple'...
Add very simple module finder
Add very simple module finder
Python
mit
kragniz/json-sempai
Add very simple module finder
import sys class SempaiLoader(object): def __init__(self, *args): print args def find_module(self, fullname, path=None): print 'finding', fullname, path if fullname == 'simple': return self return None sys.path_hooks.append(SempaiLoader) sys.path.insert(0, 'simple'...
<commit_before><commit_msg>Add very simple module finder<commit_after>
import sys class SempaiLoader(object): def __init__(self, *args): print args def find_module(self, fullname, path=None): print 'finding', fullname, path if fullname == 'simple': return self return None sys.path_hooks.append(SempaiLoader) sys.path.insert(0, 'simple'...
Add very simple module finderimport sys class SempaiLoader(object): def __init__(self, *args): print args def find_module(self, fullname, path=None): print 'finding', fullname, path if fullname == 'simple': return self return None sys.path_hooks.append(SempaiLoader...
<commit_before><commit_msg>Add very simple module finder<commit_after>import sys class SempaiLoader(object): def __init__(self, *args): print args def find_module(self, fullname, path=None): print 'finding', fullname, path if fullname == 'simple': return self return...
fe7be655c261af07477fdf49959eff9609832127
tests/test_cli.py
tests/test_cli.py
from valohai_cli.cli import PluginCLI def test_command_enumeration(): cli = PluginCLI() assert 'init' in cli.list_commands(None) assert cli.get_command(None, 'init')
Add test for root CLI
Add test for root CLI
Python
mit
valohai/valohai-cli
Add test for root CLI
from valohai_cli.cli import PluginCLI def test_command_enumeration(): cli = PluginCLI() assert 'init' in cli.list_commands(None) assert cli.get_command(None, 'init')
<commit_before><commit_msg>Add test for root CLI<commit_after>
from valohai_cli.cli import PluginCLI def test_command_enumeration(): cli = PluginCLI() assert 'init' in cli.list_commands(None) assert cli.get_command(None, 'init')
Add test for root CLIfrom valohai_cli.cli import PluginCLI def test_command_enumeration(): cli = PluginCLI() assert 'init' in cli.list_commands(None) assert cli.get_command(None, 'init')
<commit_before><commit_msg>Add test for root CLI<commit_after>from valohai_cli.cli import PluginCLI def test_command_enumeration(): cli = PluginCLI() assert 'init' in cli.list_commands(None) assert cli.get_command(None, 'init')
3b34008cbf659c34059ce783470edb69001d3584
problem145.py
problem145.py
#!/usr/bin/env python """ A solution for problem 145 from Project Euler. https://projecteuler.net/problem=145 Some positive integers n have the property that the sum [ n + reverse(n) ] consists entirely of odd (decimal) digits. For instance, 36 + 63 = 99 and 409 + 904 = 1313. We will call such numbers...
Add a brute force solution.
Add a brute force solution. It works on the small 1000 number test case but fails horribly on the 10 ** 9 case. Still worth saving before moving on.
Python
mit
smillet15/project-euler
Add a brute force solution. It works on the small 1000 number test case but fails horribly on the 10 ** 9 case. Still worth saving before moving on.
#!/usr/bin/env python """ A solution for problem 145 from Project Euler. https://projecteuler.net/problem=145 Some positive integers n have the property that the sum [ n + reverse(n) ] consists entirely of odd (decimal) digits. For instance, 36 + 63 = 99 and 409 + 904 = 1313. We will call such numbers...
<commit_before><commit_msg>Add a brute force solution. It works on the small 1000 number test case but fails horribly on the 10 ** 9 case. Still worth saving before moving on.<commit_after>
#!/usr/bin/env python """ A solution for problem 145 from Project Euler. https://projecteuler.net/problem=145 Some positive integers n have the property that the sum [ n + reverse(n) ] consists entirely of odd (decimal) digits. For instance, 36 + 63 = 99 and 409 + 904 = 1313. We will call such numbers...
Add a brute force solution. It works on the small 1000 number test case but fails horribly on the 10 ** 9 case. Still worth saving before moving on.#!/usr/bin/env python """ A solution for problem 145 from Project Euler. https://projecteuler.net/problem=145 Some positive integers n have the property that...
<commit_before><commit_msg>Add a brute force solution. It works on the small 1000 number test case but fails horribly on the 10 ** 9 case. Still worth saving before moving on.<commit_after>#!/usr/bin/env python """ A solution for problem 145 from Project Euler. https://projecteuler.net/problem=145 Some p...
986888c882273a2f69c367641eaea84dd3a1791f
test/command_line/test_symmetry.py
test/command_line/test_symmetry.py
from __future__ import absolute_import, division, print_function import os import pytest import procrunner def test_symmetry(dials_regression, run_in_tmpdir): """Simple test to check that dials.symmetry completes""" result = procrunner.run_process([ 'dials.symmetry', os.path.join(dials_regression, "xia2...
Add command-line test for dials.symmetry
Add command-line test for dials.symmetry
Python
bsd-3-clause
dials/dials,dials/dials,dials/dials,dials/dials,dials/dials
Add command-line test for dials.symmetry
from __future__ import absolute_import, division, print_function import os import pytest import procrunner def test_symmetry(dials_regression, run_in_tmpdir): """Simple test to check that dials.symmetry completes""" result = procrunner.run_process([ 'dials.symmetry', os.path.join(dials_regression, "xia2...
<commit_before><commit_msg>Add command-line test for dials.symmetry<commit_after>
from __future__ import absolute_import, division, print_function import os import pytest import procrunner def test_symmetry(dials_regression, run_in_tmpdir): """Simple test to check that dials.symmetry completes""" result = procrunner.run_process([ 'dials.symmetry', os.path.join(dials_regression, "xia2...
Add command-line test for dials.symmetryfrom __future__ import absolute_import, division, print_function import os import pytest import procrunner def test_symmetry(dials_regression, run_in_tmpdir): """Simple test to check that dials.symmetry completes""" result = procrunner.run_process([ 'dials.symmetry', ...
<commit_before><commit_msg>Add command-line test for dials.symmetry<commit_after>from __future__ import absolute_import, division, print_function import os import pytest import procrunner def test_symmetry(dials_regression, run_in_tmpdir): """Simple test to check that dials.symmetry completes""" result = procru...
ac531c43efdba1645585d88ee87eaf313c07748b
archive/archive_api/src/progress_manager.py
archive/archive_api/src/progress_manager.py
# -*- encoding: utf-8 import requests class ProgressError(Exception): """Raised if we get an unexpected response from the progress service.""" pass class ProgressManager: """ Handles requests to/from the progress service. """ def __init__(self, endpoint, sess=None): self.endpoint = ...
Add an initial ProgressManager implementation
Add an initial ProgressManager implementation
Python
mit
wellcometrust/platform-api,wellcometrust/platform-api,wellcometrust/platform-api,wellcometrust/platform-api
Add an initial ProgressManager implementation
# -*- encoding: utf-8 import requests class ProgressError(Exception): """Raised if we get an unexpected response from the progress service.""" pass class ProgressManager: """ Handles requests to/from the progress service. """ def __init__(self, endpoint, sess=None): self.endpoint = ...
<commit_before><commit_msg>Add an initial ProgressManager implementation<commit_after>
# -*- encoding: utf-8 import requests class ProgressError(Exception): """Raised if we get an unexpected response from the progress service.""" pass class ProgressManager: """ Handles requests to/from the progress service. """ def __init__(self, endpoint, sess=None): self.endpoint = ...
Add an initial ProgressManager implementation# -*- encoding: utf-8 import requests class ProgressError(Exception): """Raised if we get an unexpected response from the progress service.""" pass class ProgressManager: """ Handles requests to/from the progress service. """ def __init__(self, e...
<commit_before><commit_msg>Add an initial ProgressManager implementation<commit_after># -*- encoding: utf-8 import requests class ProgressError(Exception): """Raised if we get an unexpected response from the progress service.""" pass class ProgressManager: """ Handles requests to/from the progress ...
fad6285f79a8681994c25261941be49d7e43617c
etk/extractors/language_identification_extractor.py
etk/extractors/language_identification_extractor.py
from typing import List from etk.extraction import Extraction from etk.extractor import Extractor, InputType class LangaugeIdentificationExtractor(Extractor): """ Identify the language used in text, returning the identifier language using ISO 639-1 codes Uses two libraries: - https://github.com/david...
Define API for language identification extractor.
Define API for language identification extractor.
Python
mit
usc-isi-i2/etk,usc-isi-i2/etk,usc-isi-i2/etk
Define API for language identification extractor.
from typing import List from etk.extraction import Extraction from etk.extractor import Extractor, InputType class LangaugeIdentificationExtractor(Extractor): """ Identify the language used in text, returning the identifier language using ISO 639-1 codes Uses two libraries: - https://github.com/david...
<commit_before><commit_msg>Define API for language identification extractor.<commit_after>
from typing import List from etk.extraction import Extraction from etk.extractor import Extractor, InputType class LangaugeIdentificationExtractor(Extractor): """ Identify the language used in text, returning the identifier language using ISO 639-1 codes Uses two libraries: - https://github.com/david...
Define API for language identification extractor.from typing import List from etk.extraction import Extraction from etk.extractor import Extractor, InputType class LangaugeIdentificationExtractor(Extractor): """ Identify the language used in text, returning the identifier language using ISO 639-1 codes U...
<commit_before><commit_msg>Define API for language identification extractor.<commit_after>from typing import List from etk.extraction import Extraction from etk.extractor import Extractor, InputType class LangaugeIdentificationExtractor(Extractor): """ Identify the language used in text, returning the identif...
cd5a846e82ec023a1d69ff832924493e8dfc3068
tests/api_tests/base/test_utils.py
tests/api_tests/base/test_utils.py
from nose.tools import * # noqa from api.base import utils as api_utils from tests.base import ApiTestCase class DummyAttrAttr(object): def __init__(self, key): self.key = key class DummyAttr(object): def __init__(self, key): self.key = key self.attr_attr = DummyAttrAttr(key.uppe...
Add unit tests for deep_get and soft_get api utils
Add unit tests for deep_get and soft_get api utils
Python
apache-2.0
mluo613/osf.io,kwierman/osf.io,leb2dg/osf.io,samchrisinger/osf.io,Nesiehr/osf.io,Nesiehr/osf.io,rdhyee/osf.io,laurenrevere/osf.io,kch8qx/osf.io,zamattiac/osf.io,hmoco/osf.io,asanfilippo7/osf.io,zachjanicki/osf.io,hmoco/osf.io,brandonPurvis/osf.io,leb2dg/osf.io,GageGaskins/osf.io,kch8qx/osf.io,abought/osf.io,pattisdr/os...
Add unit tests for deep_get and soft_get api utils
from nose.tools import * # noqa from api.base import utils as api_utils from tests.base import ApiTestCase class DummyAttrAttr(object): def __init__(self, key): self.key = key class DummyAttr(object): def __init__(self, key): self.key = key self.attr_attr = DummyAttrAttr(key.uppe...
<commit_before><commit_msg>Add unit tests for deep_get and soft_get api utils<commit_after>
from nose.tools import * # noqa from api.base import utils as api_utils from tests.base import ApiTestCase class DummyAttrAttr(object): def __init__(self, key): self.key = key class DummyAttr(object): def __init__(self, key): self.key = key self.attr_attr = DummyAttrAttr(key.uppe...
Add unit tests for deep_get and soft_get api utilsfrom nose.tools import * # noqa from api.base import utils as api_utils from tests.base import ApiTestCase class DummyAttrAttr(object): def __init__(self, key): self.key = key class DummyAttr(object): def __init__(self, key): self.key = k...
<commit_before><commit_msg>Add unit tests for deep_get and soft_get api utils<commit_after>from nose.tools import * # noqa from api.base import utils as api_utils from tests.base import ApiTestCase class DummyAttrAttr(object): def __init__(self, key): self.key = key class DummyAttr(object): def ...
c0bae380d83283541860bbd709425e653678a3cf
txircd/modules/ircv3/servertime.py
txircd/modules/ircv3/servertime.py
from twisted.plugin import IPlugin from txircd.module_interface import IModuleData, ModuleData from zope.interface import implements class ServerTime(ModuleData): implements(IPlugin, IModuleData) name = "ServerTime" def actions(self): return [ ("capabilitylist", 1, self.addCapability) ] def load(self): i...
Implement server-time; this just enables server-time to be used by other modules
Implement server-time; this just enables server-time to be used by other modules
Python
bsd-3-clause
ElementalAlchemist/txircd,Heufneutje/txircd
Implement server-time; this just enables server-time to be used by other modules
from twisted.plugin import IPlugin from txircd.module_interface import IModuleData, ModuleData from zope.interface import implements class ServerTime(ModuleData): implements(IPlugin, IModuleData) name = "ServerTime" def actions(self): return [ ("capabilitylist", 1, self.addCapability) ] def load(self): i...
<commit_before><commit_msg>Implement server-time; this just enables server-time to be used by other modules<commit_after>
from twisted.plugin import IPlugin from txircd.module_interface import IModuleData, ModuleData from zope.interface import implements class ServerTime(ModuleData): implements(IPlugin, IModuleData) name = "ServerTime" def actions(self): return [ ("capabilitylist", 1, self.addCapability) ] def load(self): i...
Implement server-time; this just enables server-time to be used by other modulesfrom twisted.plugin import IPlugin from txircd.module_interface import IModuleData, ModuleData from zope.interface import implements class ServerTime(ModuleData): implements(IPlugin, IModuleData) name = "ServerTime" def actions(self...
<commit_before><commit_msg>Implement server-time; this just enables server-time to be used by other modules<commit_after>from twisted.plugin import IPlugin from txircd.module_interface import IModuleData, ModuleData from zope.interface import implements class ServerTime(ModuleData): implements(IPlugin, IModuleData) ...