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
2fbeeed52251c7b005e826122d731bfa25d1e41a
tweets/migrations/0001_initial.py
tweets/migrations/0001_initial.py
# -*- coding: utf-8 -*- # Generated by Django 1.10.6 on 2017-03-11 15:02 from __future__ import unicode_literals from django.db import migrations, models import django.utils.timezone import model_utils.fields class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ ...
Add initial migration for tweets app
Add initial migration for tweets app
Python
mit
gwhigs/tweeter,gwhigs/tweeter,gwhigs/tweeter,gwhigs/tweeter
Add initial migration for tweets app
# -*- coding: utf-8 -*- # Generated by Django 1.10.6 on 2017-03-11 15:02 from __future__ import unicode_literals from django.db import migrations, models import django.utils.timezone import model_utils.fields class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ ...
<commit_before><commit_msg>Add initial migration for tweets app<commit_after>
# -*- coding: utf-8 -*- # Generated by Django 1.10.6 on 2017-03-11 15:02 from __future__ import unicode_literals from django.db import migrations, models import django.utils.timezone import model_utils.fields class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ ...
Add initial migration for tweets app# -*- coding: utf-8 -*- # Generated by Django 1.10.6 on 2017-03-11 15:02 from __future__ import unicode_literals from django.db import migrations, models import django.utils.timezone import model_utils.fields class Migration(migrations.Migration): initial = True dependen...
<commit_before><commit_msg>Add initial migration for tweets app<commit_after># -*- coding: utf-8 -*- # Generated by Django 1.10.6 on 2017-03-11 15:02 from __future__ import unicode_literals from django.db import migrations, models import django.utils.timezone import model_utils.fields class Migration(migrations.Migr...
8c317b34f4897f497c9f31255c706ec886b6cf23
bluebottle/payouts/migrations/0020_auto_20190123_1731.py
bluebottle/payouts/migrations/0020_auto_20190123_1731.py
# -*- coding: utf-8 -*- # Generated by Django 1.10.8 on 2019-01-23 16:31 from __future__ import unicode_literals from django.db import migrations def set_stripe_document_default(apps, schema_editor): StripePayoutAccount = apps.get_model('payouts', 'StripePayoutAccount') StripePayoutAccount.objects.update(doc...
Set Stripe document type to 'passort' for old projects.
Set Stripe document type to 'passort' for old projects.
Python
bsd-3-clause
onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle
Set Stripe document type to 'passort' for old projects.
# -*- coding: utf-8 -*- # Generated by Django 1.10.8 on 2019-01-23 16:31 from __future__ import unicode_literals from django.db import migrations def set_stripe_document_default(apps, schema_editor): StripePayoutAccount = apps.get_model('payouts', 'StripePayoutAccount') StripePayoutAccount.objects.update(doc...
<commit_before><commit_msg>Set Stripe document type to 'passort' for old projects.<commit_after>
# -*- coding: utf-8 -*- # Generated by Django 1.10.8 on 2019-01-23 16:31 from __future__ import unicode_literals from django.db import migrations def set_stripe_document_default(apps, schema_editor): StripePayoutAccount = apps.get_model('payouts', 'StripePayoutAccount') StripePayoutAccount.objects.update(doc...
Set Stripe document type to 'passort' for old projects.# -*- coding: utf-8 -*- # Generated by Django 1.10.8 on 2019-01-23 16:31 from __future__ import unicode_literals from django.db import migrations def set_stripe_document_default(apps, schema_editor): StripePayoutAccount = apps.get_model('payouts', 'StripePay...
<commit_before><commit_msg>Set Stripe document type to 'passort' for old projects.<commit_after># -*- coding: utf-8 -*- # Generated by Django 1.10.8 on 2019-01-23 16:31 from __future__ import unicode_literals from django.db import migrations def set_stripe_document_default(apps, schema_editor): StripePayoutAccou...
048fd80ee74e5ef4544e1a6bbd6639ae27f4d144
src/pybel/io/tsv/converters.py
src/pybel/io/tsv/converters.py
# -*- coding: utf-8 -*- """Warnings for old TSV conversion module.""" import warnings from ..triples.converters import _safe_label __all__ = [ '_safe_label', ] warnings.warn( '''Use pybel.io.triples module instead. Changes in PyBEL v0.15.0: - pybel.io.tsv.converters._safe_label renamed to pybel.io.tripl...
Add additional backwards-compatibility for pybel.io.tsv/pybel.io.triples
Add additional backwards-compatibility for pybel.io.tsv/pybel.io.triples
Python
mit
pybel/pybel,pybel/pybel,pybel/pybel
Add additional backwards-compatibility for pybel.io.tsv/pybel.io.triples
# -*- coding: utf-8 -*- """Warnings for old TSV conversion module.""" import warnings from ..triples.converters import _safe_label __all__ = [ '_safe_label', ] warnings.warn( '''Use pybel.io.triples module instead. Changes in PyBEL v0.15.0: - pybel.io.tsv.converters._safe_label renamed to pybel.io.tripl...
<commit_before><commit_msg>Add additional backwards-compatibility for pybel.io.tsv/pybel.io.triples<commit_after>
# -*- coding: utf-8 -*- """Warnings for old TSV conversion module.""" import warnings from ..triples.converters import _safe_label __all__ = [ '_safe_label', ] warnings.warn( '''Use pybel.io.triples module instead. Changes in PyBEL v0.15.0: - pybel.io.tsv.converters._safe_label renamed to pybel.io.tripl...
Add additional backwards-compatibility for pybel.io.tsv/pybel.io.triples# -*- coding: utf-8 -*- """Warnings for old TSV conversion module.""" import warnings from ..triples.converters import _safe_label __all__ = [ '_safe_label', ] warnings.warn( '''Use pybel.io.triples module instead. Changes in PyBEL v0....
<commit_before><commit_msg>Add additional backwards-compatibility for pybel.io.tsv/pybel.io.triples<commit_after># -*- coding: utf-8 -*- """Warnings for old TSV conversion module.""" import warnings from ..triples.converters import _safe_label __all__ = [ '_safe_label', ] warnings.warn( '''Use pybel.io.tri...
aec424ec4b9d5ff482d7afe705cecbd463b4ddcd
convnets.py
convnets.py
import numpy as np import tensorflow as tf import matplotlib.pyplot as plt from sklearn.datasets import load_sample_image from sklearn.datasets import load_sample_images # Utility functions def plot_image(image): plt.imshow(image, cmap="gray", interpolation="nearest") plt.axis("off") def plot_color_image(image...
Add code for simple convnet
Add code for simple convnet Basic code to run a very very simple convnet
Python
mit
KT12/hands_on_machine_learning
Add code for simple convnet Basic code to run a very very simple convnet
import numpy as np import tensorflow as tf import matplotlib.pyplot as plt from sklearn.datasets import load_sample_image from sklearn.datasets import load_sample_images # Utility functions def plot_image(image): plt.imshow(image, cmap="gray", interpolation="nearest") plt.axis("off") def plot_color_image(image...
<commit_before><commit_msg>Add code for simple convnet Basic code to run a very very simple convnet<commit_after>
import numpy as np import tensorflow as tf import matplotlib.pyplot as plt from sklearn.datasets import load_sample_image from sklearn.datasets import load_sample_images # Utility functions def plot_image(image): plt.imshow(image, cmap="gray", interpolation="nearest") plt.axis("off") def plot_color_image(image...
Add code for simple convnet Basic code to run a very very simple convnetimport numpy as np import tensorflow as tf import matplotlib.pyplot as plt from sklearn.datasets import load_sample_image from sklearn.datasets import load_sample_images # Utility functions def plot_image(image): plt.imshow(image, cmap="gray",...
<commit_before><commit_msg>Add code for simple convnet Basic code to run a very very simple convnet<commit_after>import numpy as np import tensorflow as tf import matplotlib.pyplot as plt from sklearn.datasets import load_sample_image from sklearn.datasets import load_sample_images # Utility functions def plot_image(i...
8c55949339b2292f226bcbe1ea0b06a209fe85af
Cython/Compiler/Tests/TestTypes.py
Cython/Compiler/Tests/TestTypes.py
from __future__ import absolute_import import unittest import Cython.Compiler.PyrexTypes as PT class TestMethodDispatcherTransform(unittest.TestCase): def test_widest_numeric_type(self): def assert_widest(type1, type2, widest): self.assertEqual(widest, PT.widest_numeric_type(type1, type2)) ...
Add some basic tests for PyrexTypes.widest_numeric_type().
Add some basic tests for PyrexTypes.widest_numeric_type().
Python
apache-2.0
scoder/cython,scoder/cython,scoder/cython,cython/cython,cython/cython,da-woods/cython,da-woods/cython,da-woods/cython,da-woods/cython,cython/cython,cython/cython,scoder/cython
Add some basic tests for PyrexTypes.widest_numeric_type().
from __future__ import absolute_import import unittest import Cython.Compiler.PyrexTypes as PT class TestMethodDispatcherTransform(unittest.TestCase): def test_widest_numeric_type(self): def assert_widest(type1, type2, widest): self.assertEqual(widest, PT.widest_numeric_type(type1, type2)) ...
<commit_before><commit_msg>Add some basic tests for PyrexTypes.widest_numeric_type().<commit_after>
from __future__ import absolute_import import unittest import Cython.Compiler.PyrexTypes as PT class TestMethodDispatcherTransform(unittest.TestCase): def test_widest_numeric_type(self): def assert_widest(type1, type2, widest): self.assertEqual(widest, PT.widest_numeric_type(type1, type2)) ...
Add some basic tests for PyrexTypes.widest_numeric_type().from __future__ import absolute_import import unittest import Cython.Compiler.PyrexTypes as PT class TestMethodDispatcherTransform(unittest.TestCase): def test_widest_numeric_type(self): def assert_widest(type1, type2, widest): self....
<commit_before><commit_msg>Add some basic tests for PyrexTypes.widest_numeric_type().<commit_after>from __future__ import absolute_import import unittest import Cython.Compiler.PyrexTypes as PT class TestMethodDispatcherTransform(unittest.TestCase): def test_widest_numeric_type(self): def assert_widest...
c5e57f0f428369706d94a6bf67fa1eeb597bc857
tests/test_daemon.py
tests/test_daemon.py
import inotify import pytest import os from botbot import daemon def test_func(): pass def get_dbpath(): return os.path.join('.', 'test.db') def test_daemon_constructor(tmpdir): daemon.get_dbpath = get_dbpath prev = tmpdir.chdir() d = daemon.DaemonizedChecker('.') assert d prev.chdir(...
Add tests for the daemon mode
Add tests for the daemon mode
Python
mit
jackstanek/BotBot,jackstanek/BotBot
Add tests for the daemon mode
import inotify import pytest import os from botbot import daemon def test_func(): pass def get_dbpath(): return os.path.join('.', 'test.db') def test_daemon_constructor(tmpdir): daemon.get_dbpath = get_dbpath prev = tmpdir.chdir() d = daemon.DaemonizedChecker('.') assert d prev.chdir(...
<commit_before><commit_msg>Add tests for the daemon mode<commit_after>
import inotify import pytest import os from botbot import daemon def test_func(): pass def get_dbpath(): return os.path.join('.', 'test.db') def test_daemon_constructor(tmpdir): daemon.get_dbpath = get_dbpath prev = tmpdir.chdir() d = daemon.DaemonizedChecker('.') assert d prev.chdir(...
Add tests for the daemon modeimport inotify import pytest import os from botbot import daemon def test_func(): pass def get_dbpath(): return os.path.join('.', 'test.db') def test_daemon_constructor(tmpdir): daemon.get_dbpath = get_dbpath prev = tmpdir.chdir() d = daemon.DaemonizedChecker('.')...
<commit_before><commit_msg>Add tests for the daemon mode<commit_after>import inotify import pytest import os from botbot import daemon def test_func(): pass def get_dbpath(): return os.path.join('.', 'test.db') def test_daemon_constructor(tmpdir): daemon.get_dbpath = get_dbpath prev = tmpdir.chdi...
c6e5ea3727be92e2478df748acb29d1fc5bc3b76
tests/test_routes.py
tests/test_routes.py
from unittest import TestCase from kobin.routes import Router class RouterTest(TestCase): def setUp(self): self.router = Router() def test_add_func_when_input_static(self): def target_func(): pass self.router.add('/user/', 'GET', target_func) actual = self.router.static ...
Add Test of static routing
Add Test of static routing
Python
mit
c-bata/kobin,kobinpy/kobin,kobinpy/kobin,c-bata/kobin
Add Test of static routing
from unittest import TestCase from kobin.routes import Router class RouterTest(TestCase): def setUp(self): self.router = Router() def test_add_func_when_input_static(self): def target_func(): pass self.router.add('/user/', 'GET', target_func) actual = self.router.static ...
<commit_before><commit_msg>Add Test of static routing<commit_after>
from unittest import TestCase from kobin.routes import Router class RouterTest(TestCase): def setUp(self): self.router = Router() def test_add_func_when_input_static(self): def target_func(): pass self.router.add('/user/', 'GET', target_func) actual = self.router.static ...
Add Test of static routingfrom unittest import TestCase from kobin.routes import Router class RouterTest(TestCase): def setUp(self): self.router = Router() def test_add_func_when_input_static(self): def target_func(): pass self.router.add('/user/', 'GET', target_func) actual ...
<commit_before><commit_msg>Add Test of static routing<commit_after>from unittest import TestCase from kobin.routes import Router class RouterTest(TestCase): def setUp(self): self.router = Router() def test_add_func_when_input_static(self): def target_func(): pass self.router.add('/use...
ff3c664896a95b119f9b5b6d46adb0f36461f218
ecpy/utils/flags.py
ecpy/utils/flags.py
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright 2015 by Ecpy Authors, see AUTHORS for more details. # # Distributed under the terms of the BSD license. # # The full license is in the file LICENCE, distributed with this software. # ---------------------...
Add a thread safe convenient bit flag class.
Add a thread safe convenient bit flag class.
Python
bsd-3-clause
Ecpy/ecpy,Ecpy/ecpy
Add a thread safe convenient bit flag class.
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright 2015 by Ecpy Authors, see AUTHORS for more details. # # Distributed under the terms of the BSD license. # # The full license is in the file LICENCE, distributed with this software. # ---------------------...
<commit_before><commit_msg>Add a thread safe convenient bit flag class.<commit_after>
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright 2015 by Ecpy Authors, see AUTHORS for more details. # # Distributed under the terms of the BSD license. # # The full license is in the file LICENCE, distributed with this software. # ---------------------...
Add a thread safe convenient bit flag class.# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright 2015 by Ecpy Authors, see AUTHORS for more details. # # Distributed under the terms of the BSD license. # # The full license is in the file LICENCE, distributed...
<commit_before><commit_msg>Add a thread safe convenient bit flag class.<commit_after># -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright 2015 by Ecpy Authors, see AUTHORS for more details. # # Distributed under the terms of the BSD license. # # The full li...
dbb7a0ff25bcf491dfc05676dd578db5f2769fef
tests/test_rq/test_bcolz_stock.py
tests/test_rq/test_bcolz_stock.py
import bcolz import numpy as np def field_type(c_dtyep, field, dt_orig): try: return c_dtyep[field][0] except KeyError: return dt_orig float64 = np.dtype('float64') cdtype = { 'open': (float64, 1 / 10000.0, 4), 'close': (float64, 1 / 10000.0, 4), 'high': (float64, 1 / 10000.0, 4...
Add example for bcolz stock data
Add example for bcolz stock data
Python
apache-2.0
fs714/ialgotest,fs714/ialgotest
Add example for bcolz stock data
import bcolz import numpy as np def field_type(c_dtyep, field, dt_orig): try: return c_dtyep[field][0] except KeyError: return dt_orig float64 = np.dtype('float64') cdtype = { 'open': (float64, 1 / 10000.0, 4), 'close': (float64, 1 / 10000.0, 4), 'high': (float64, 1 / 10000.0, 4...
<commit_before><commit_msg>Add example for bcolz stock data<commit_after>
import bcolz import numpy as np def field_type(c_dtyep, field, dt_orig): try: return c_dtyep[field][0] except KeyError: return dt_orig float64 = np.dtype('float64') cdtype = { 'open': (float64, 1 / 10000.0, 4), 'close': (float64, 1 / 10000.0, 4), 'high': (float64, 1 / 10000.0, 4...
Add example for bcolz stock dataimport bcolz import numpy as np def field_type(c_dtyep, field, dt_orig): try: return c_dtyep[field][0] except KeyError: return dt_orig float64 = np.dtype('float64') cdtype = { 'open': (float64, 1 / 10000.0, 4), 'close': (float64, 1 / 10000.0, 4), ...
<commit_before><commit_msg>Add example for bcolz stock data<commit_after>import bcolz import numpy as np def field_type(c_dtyep, field, dt_orig): try: return c_dtyep[field][0] except KeyError: return dt_orig float64 = np.dtype('float64') cdtype = { 'open': (float64, 1 / 10000.0, 4), ...
4a3ce97a93e8b43082c4ae243ac8127c92890b28
tools/diagnose-me.py
tools/diagnose-me.py
#!/usr/bin/python # Copyright (c) 2012 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. """Diagnose some common system configuration problems on Linux, and suggest fixes.""" import subprocess import sys all_checks = [] d...
Check in a script to diagnose common system configuration problems.
Check in a script to diagnose common system configuration problems. Review URL: https://chromiumcodereview.appspot.com/9309011 git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@120430 0039d316-1c4b-4281-b951-d872f2087c98
Python
bsd-3-clause
rogerwang/chromium,mohamed--abdel-maksoud/chromium.src,ltilve/chromium,Chilledheart/chromium,chuan9/chromium-crosswalk,nacl-webkit/chrome_deps,axinging/chromium-crosswalk,Pluto-tv/chromium-crosswalk,hujiajie/pa-chromium,littlstar/chromium.src,hgl888/chromium-crosswalk-efl,hgl888/chromium-crosswalk,markYoungH/chromium.s...
Check in a script to diagnose common system configuration problems. Review URL: https://chromiumcodereview.appspot.com/9309011 git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@120430 0039d316-1c4b-4281-b951-d872f2087c98
#!/usr/bin/python # Copyright (c) 2012 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. """Diagnose some common system configuration problems on Linux, and suggest fixes.""" import subprocess import sys all_checks = [] d...
<commit_before><commit_msg>Check in a script to diagnose common system configuration problems. Review URL: https://chromiumcodereview.appspot.com/9309011 git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@120430 0039d316-1c4b-4281-b951-d872f2087c98<commit_after>
#!/usr/bin/python # Copyright (c) 2012 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. """Diagnose some common system configuration problems on Linux, and suggest fixes.""" import subprocess import sys all_checks = [] d...
Check in a script to diagnose common system configuration problems. Review URL: https://chromiumcodereview.appspot.com/9309011 git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@120430 0039d316-1c4b-4281-b951-d872f2087c98#!/usr/bin/python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this...
<commit_before><commit_msg>Check in a script to diagnose common system configuration problems. Review URL: https://chromiumcodereview.appspot.com/9309011 git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@120430 0039d316-1c4b-4281-b951-d872f2087c98<commit_after>#!/usr/bin/python # Copyright (c) 2012 The Chromium Au...
b573047502d6ceb0241257fa26e17ad572639c93
tests/utils/test_string_helper.py
tests/utils/test_string_helper.py
from unittest.case import TestCase from zsl.utils.string_helper import camelcase_to_underscore, underscore_to_camelcase class InflectionTestCase(TestCase): def testCamelCaseToUnderscore(self): self.assertEquals( "camel_case_to_underscore", camelcase_to_underscore("camelCaseToUnder...
Add tests of the improved camelcase/underscore conversion
Add tests of the improved camelcase/underscore conversion
Python
mit
AtteqCom/zsl,AtteqCom/zsl
Add tests of the improved camelcase/underscore conversion
from unittest.case import TestCase from zsl.utils.string_helper import camelcase_to_underscore, underscore_to_camelcase class InflectionTestCase(TestCase): def testCamelCaseToUnderscore(self): self.assertEquals( "camel_case_to_underscore", camelcase_to_underscore("camelCaseToUnder...
<commit_before><commit_msg>Add tests of the improved camelcase/underscore conversion<commit_after>
from unittest.case import TestCase from zsl.utils.string_helper import camelcase_to_underscore, underscore_to_camelcase class InflectionTestCase(TestCase): def testCamelCaseToUnderscore(self): self.assertEquals( "camel_case_to_underscore", camelcase_to_underscore("camelCaseToUnder...
Add tests of the improved camelcase/underscore conversionfrom unittest.case import TestCase from zsl.utils.string_helper import camelcase_to_underscore, underscore_to_camelcase class InflectionTestCase(TestCase): def testCamelCaseToUnderscore(self): self.assertEquals( "camel_case_to_underscor...
<commit_before><commit_msg>Add tests of the improved camelcase/underscore conversion<commit_after>from unittest.case import TestCase from zsl.utils.string_helper import camelcase_to_underscore, underscore_to_camelcase class InflectionTestCase(TestCase): def testCamelCaseToUnderscore(self): self.assertEqu...
211d15149ad4e05c2b1159939805246998a2e3d4
app/send_ping.py
app/send_ping.py
from discovery import Endpoint, PingNode, PingServer my_endpoint = EndPoint(u'192.168.1.192', 30303, 30303) their_endpoint = EndPoint(u'127.0.0.1', 30303, 30303) server = PingServer(my_endpoint) listen_thread = server.udp_listen() listen_thread.start() server.ping(their_endpoint)
Add script to run app
Add script to run app
Python
bsd-3-clause
tomarak/basic-eth,tomarak/basic-eth
Add script to run app
from discovery import Endpoint, PingNode, PingServer my_endpoint = EndPoint(u'192.168.1.192', 30303, 30303) their_endpoint = EndPoint(u'127.0.0.1', 30303, 30303) server = PingServer(my_endpoint) listen_thread = server.udp_listen() listen_thread.start() server.ping(their_endpoint)
<commit_before><commit_msg>Add script to run app<commit_after>
from discovery import Endpoint, PingNode, PingServer my_endpoint = EndPoint(u'192.168.1.192', 30303, 30303) their_endpoint = EndPoint(u'127.0.0.1', 30303, 30303) server = PingServer(my_endpoint) listen_thread = server.udp_listen() listen_thread.start() server.ping(their_endpoint)
Add script to run appfrom discovery import Endpoint, PingNode, PingServer my_endpoint = EndPoint(u'192.168.1.192', 30303, 30303) their_endpoint = EndPoint(u'127.0.0.1', 30303, 30303) server = PingServer(my_endpoint) listen_thread = server.udp_listen() listen_thread.start() server.ping(their_endpoint)
<commit_before><commit_msg>Add script to run app<commit_after>from discovery import Endpoint, PingNode, PingServer my_endpoint = EndPoint(u'192.168.1.192', 30303, 30303) their_endpoint = EndPoint(u'127.0.0.1', 30303, 30303) server = PingServer(my_endpoint) listen_thread = server.udp_listen() listen_thread.start() s...
8b9857958a4dc9286ac0e2e52f4e81909ea29728
scripts/cluster_build.py
scripts/cluster_build.py
#!/usr/bin/python from cluster_config import ClusterConfig from cluster_run import ClusterRun class ClusterBuild: def __init__(self, config): self.config = config def cd_to_code(self): return "cd " + self.config.code_dir + "; " def cd_to_build(self): return "cd build/cmake; " ...
Add script to handle build tasks across all nodes. Right now running it on its own just cleans out any existing data and runs the entire build process (which takes a *long* time!). Needs to be upgraded to have a nice command line interface.
Add script to handle build tasks across all nodes. Right now running it on its own just cleans out any existing data and runs the entire build process (which takes a *long* time!). Needs to be upgraded to have a nice command line interface.
Python
bsd-3-clause
sirikata/sirikata,sirikata/sirikata,sirikata/sirikata,sirikata/sirikata,sirikata/sirikata,sirikata/sirikata,sirikata/sirikata,sirikata/sirikata
Add script to handle build tasks across all nodes. Right now running it on its own just cleans out any existing data and runs the entire build process (which takes a *long* time!). Needs to be upgraded to have a nice command line interface.
#!/usr/bin/python from cluster_config import ClusterConfig from cluster_run import ClusterRun class ClusterBuild: def __init__(self, config): self.config = config def cd_to_code(self): return "cd " + self.config.code_dir + "; " def cd_to_build(self): return "cd build/cmake; " ...
<commit_before><commit_msg>Add script to handle build tasks across all nodes. Right now running it on its own just cleans out any existing data and runs the entire build process (which takes a *long* time!). Needs to be upgraded to have a nice command line interface.<commit_after>
#!/usr/bin/python from cluster_config import ClusterConfig from cluster_run import ClusterRun class ClusterBuild: def __init__(self, config): self.config = config def cd_to_code(self): return "cd " + self.config.code_dir + "; " def cd_to_build(self): return "cd build/cmake; " ...
Add script to handle build tasks across all nodes. Right now running it on its own just cleans out any existing data and runs the entire build process (which takes a *long* time!). Needs to be upgraded to have a nice command line interface.#!/usr/bin/python from cluster_config import ClusterConfig from cluster_run i...
<commit_before><commit_msg>Add script to handle build tasks across all nodes. Right now running it on its own just cleans out any existing data and runs the entire build process (which takes a *long* time!). Needs to be upgraded to have a nice command line interface.<commit_after>#!/usr/bin/python from cluster_confi...
9232cafe92c794c3cbfa2445a790d7e66b258691
scripts/analytics/file_sizes.py
scripts/analytics/file_sizes.py
# -*- coding: utf-8 -*- """ Summarize distribution of file sizes in OSF git repos. """ from __future__ import division import os import numpy as np import tabulate from website import settings def walk_collect(path, func): sizes = [] for root, dirs, files in os.walk(path): try: dirs.r...
Add script to summarize file size distribution.
Add script to summarize file size distribution. See example at https://github.com/CenterForOpenScience/openscienceframework.org/issues/871
Python
apache-2.0
pattisdr/osf.io,monikagrabowska/osf.io,petermalcolm/osf.io,zkraime/osf.io,KAsante95/osf.io,emetsger/osf.io,pattisdr/osf.io,doublebits/osf.io,baylee-d/osf.io,KAsante95/osf.io,TomHeatwole/osf.io,abought/osf.io,Johnetordoff/osf.io,GageGaskins/osf.io,hmoco/osf.io,felliott/osf.io,cldershem/osf.io,saradbowman/osf.io,jnayak1/...
Add script to summarize file size distribution. See example at https://github.com/CenterForOpenScience/openscienceframework.org/issues/871
# -*- coding: utf-8 -*- """ Summarize distribution of file sizes in OSF git repos. """ from __future__ import division import os import numpy as np import tabulate from website import settings def walk_collect(path, func): sizes = [] for root, dirs, files in os.walk(path): try: dirs.r...
<commit_before><commit_msg>Add script to summarize file size distribution. See example at https://github.com/CenterForOpenScience/openscienceframework.org/issues/871<commit_after>
# -*- coding: utf-8 -*- """ Summarize distribution of file sizes in OSF git repos. """ from __future__ import division import os import numpy as np import tabulate from website import settings def walk_collect(path, func): sizes = [] for root, dirs, files in os.walk(path): try: dirs.r...
Add script to summarize file size distribution. See example at https://github.com/CenterForOpenScience/openscienceframework.org/issues/871# -*- coding: utf-8 -*- """ Summarize distribution of file sizes in OSF git repos. """ from __future__ import division import os import numpy as np import tabulate from website...
<commit_before><commit_msg>Add script to summarize file size distribution. See example at https://github.com/CenterForOpenScience/openscienceframework.org/issues/871<commit_after># -*- coding: utf-8 -*- """ Summarize distribution of file sizes in OSF git repos. """ from __future__ import division import os import ...
43b3d92b3f2cd810a46a59b5769248280b6c63a9
main.py
main.py
import os from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice def get_MainActivity(package_name): return package_name + 'MainActivity' def install_package(package_path, device): if device.installPackage(package_path): return True else: return False def install_packages(device,...
Install packages on android device
Install packages on android device
Python
mit
jonmetz/AndroFuzz
Install packages on android device
import os from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice def get_MainActivity(package_name): return package_name + 'MainActivity' def install_package(package_path, device): if device.installPackage(package_path): return True else: return False def install_packages(device,...
<commit_before><commit_msg>Install packages on android device<commit_after>
import os from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice def get_MainActivity(package_name): return package_name + 'MainActivity' def install_package(package_path, device): if device.installPackage(package_path): return True else: return False def install_packages(device,...
Install packages on android deviceimport os from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice def get_MainActivity(package_name): return package_name + 'MainActivity' def install_package(package_path, device): if device.installPackage(package_path): return True else: return F...
<commit_before><commit_msg>Install packages on android device<commit_after>import os from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice def get_MainActivity(package_name): return package_name + 'MainActivity' def install_package(package_path, device): if device.installPackage(package_path): ...
16b3dc1f8c762a751e1476d679391f3bbc82cd5d
python-prefix.py
python-prefix.py
#!/usr/bin/env python import sys import os.path import site def main(): '''\ Check if the given prefix is included in sys.path for the given python version; if not find an alternate valid prefix. Print the result to standard out. ''' if len(sys.argv) != 3: msg = 'usage: %s <prefix> <p...
#!/usr/bin/env python import sys import os.path import site def main(): '''\ Check if the given prefix is included in sys.path for the given python version; if not find an alternate valid prefix. Print the result to standard out. ''' if len(sys.argv) != 3: msg = 'usage: %s <prefix> <p...
Fix typo in previous commit.
Fix typo in previous commit.
Python
bsd-2-clause
marek-sezemsky/coreemu,tectronics/coreemu,marek-sezemsky/coreemu,guidotack/coreemu,guidotack/coreemu,tectronics/coreemu,tectronics/coreemu,gregtampa/coreemu,guidotack/coreemu,gregtampa/coreemu,marek-sezemsky/coreemu,gregtampa/coreemu
#!/usr/bin/env python import sys import os.path import site def main(): '''\ Check if the given prefix is included in sys.path for the given python version; if not find an alternate valid prefix. Print the result to standard out. ''' if len(sys.argv) != 3: msg = 'usage: %s <prefix> <p...
#!/usr/bin/env python import sys import os.path import site def main(): '''\ Check if the given prefix is included in sys.path for the given python version; if not find an alternate valid prefix. Print the result to standard out. ''' if len(sys.argv) != 3: msg = 'usage: %s <prefix> <p...
<commit_before>#!/usr/bin/env python import sys import os.path import site def main(): '''\ Check if the given prefix is included in sys.path for the given python version; if not find an alternate valid prefix. Print the result to standard out. ''' if len(sys.argv) != 3: msg = 'usage:...
#!/usr/bin/env python import sys import os.path import site def main(): '''\ Check if the given prefix is included in sys.path for the given python version; if not find an alternate valid prefix. Print the result to standard out. ''' if len(sys.argv) != 3: msg = 'usage: %s <prefix> <p...
#!/usr/bin/env python import sys import os.path import site def main(): '''\ Check if the given prefix is included in sys.path for the given python version; if not find an alternate valid prefix. Print the result to standard out. ''' if len(sys.argv) != 3: msg = 'usage: %s <prefix> <p...
<commit_before>#!/usr/bin/env python import sys import os.path import site def main(): '''\ Check if the given prefix is included in sys.path for the given python version; if not find an alternate valid prefix. Print the result to standard out. ''' if len(sys.argv) != 3: msg = 'usage:...
844c6f18d06dcb397db76436e5f4b8ddcb1beddc
py/path-with-maximum-gold.py
py/path-with-maximum-gold.py
class Solution(object): def getMaximumGold(self, grid): """ :type grid: List[List[int]] :rtype: int """ self.grid = grid self.rows = len(grid) if self.rows: self.cols = len(grid[0]) ans = 0 for x in range(self.rows): fo...
Add py solution for 1219. Path with Maximum Gold
Add py solution for 1219. Path with Maximum Gold 1219. Path with Maximum Gold: https://leetcode.com/problems/path-with-maximum-gold/
Python
apache-2.0
ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode
Add py solution for 1219. Path with Maximum Gold 1219. Path with Maximum Gold: https://leetcode.com/problems/path-with-maximum-gold/
class Solution(object): def getMaximumGold(self, grid): """ :type grid: List[List[int]] :rtype: int """ self.grid = grid self.rows = len(grid) if self.rows: self.cols = len(grid[0]) ans = 0 for x in range(self.rows): fo...
<commit_before><commit_msg>Add py solution for 1219. Path with Maximum Gold 1219. Path with Maximum Gold: https://leetcode.com/problems/path-with-maximum-gold/<commit_after>
class Solution(object): def getMaximumGold(self, grid): """ :type grid: List[List[int]] :rtype: int """ self.grid = grid self.rows = len(grid) if self.rows: self.cols = len(grid[0]) ans = 0 for x in range(self.rows): fo...
Add py solution for 1219. Path with Maximum Gold 1219. Path with Maximum Gold: https://leetcode.com/problems/path-with-maximum-gold/class Solution(object): def getMaximumGold(self, grid): """ :type grid: List[List[int]] :rtype: int """ self.grid = grid self.rows = le...
<commit_before><commit_msg>Add py solution for 1219. Path with Maximum Gold 1219. Path with Maximum Gold: https://leetcode.com/problems/path-with-maximum-gold/<commit_after>class Solution(object): def getMaximumGold(self, grid): """ :type grid: List[List[int]] :rtype: int """ ...
d552028fcdbe1bd3b27efb7676980abe597ed40e
py/readImagesSamplesSplit.py
py/readImagesSamplesSplit.py
from __future__ import print_function import numpy as np from six.moves import cPickle as pickle import argparse import os parser = argparse.ArgumentParser() parser.add_argument('--pickle', help='Pickle file, check the script readImages to generate this file.', required=True) args = parser.parse_args() pickle_file =...
Add script to split the data in the pickle files.
ENH: Add script to split the data in the pickle files.
Python
apache-2.0
juanprietob/ExtractMSLesion,juanprietob/ExtractMSLesion,juanprietob/ExtractMSLesion,juanprietob/ExtractMSLesion,juanprietob/ExtractMSLesion
ENH: Add script to split the data in the pickle files.
from __future__ import print_function import numpy as np from six.moves import cPickle as pickle import argparse import os parser = argparse.ArgumentParser() parser.add_argument('--pickle', help='Pickle file, check the script readImages to generate this file.', required=True) args = parser.parse_args() pickle_file =...
<commit_before><commit_msg>ENH: Add script to split the data in the pickle files.<commit_after>
from __future__ import print_function import numpy as np from six.moves import cPickle as pickle import argparse import os parser = argparse.ArgumentParser() parser.add_argument('--pickle', help='Pickle file, check the script readImages to generate this file.', required=True) args = parser.parse_args() pickle_file =...
ENH: Add script to split the data in the pickle files.from __future__ import print_function import numpy as np from six.moves import cPickle as pickle import argparse import os parser = argparse.ArgumentParser() parser.add_argument('--pickle', help='Pickle file, check the script readImages to generate this file.', req...
<commit_before><commit_msg>ENH: Add script to split the data in the pickle files.<commit_after>from __future__ import print_function import numpy as np from six.moves import cPickle as pickle import argparse import os parser = argparse.ArgumentParser() parser.add_argument('--pickle', help='Pickle file, check the scrip...
d5f382aad9a378d58ff2afd9812a5ec7815f8d8a
tests/test_resources_remote.py
tests/test_resources_remote.py
#!/usr/bin/python3 import os import sys import unittest from unittest.mock import patch, sentinel LIB_PATH = os.path.dirname(os.path.realpath(__file__)) + '/../' CONFIG_PATH = os.path.join(LIB_PATH, 'grafcli.example.conf') sys.path.append(LIB_PATH) from grafcli.config import load_config load_config(CONFIG_PATH) fro...
Add remote resources tests stub.
Add remote resources tests stub.
Python
mit
m110/grafcli,m110/grafcli
Add remote resources tests stub.
#!/usr/bin/python3 import os import sys import unittest from unittest.mock import patch, sentinel LIB_PATH = os.path.dirname(os.path.realpath(__file__)) + '/../' CONFIG_PATH = os.path.join(LIB_PATH, 'grafcli.example.conf') sys.path.append(LIB_PATH) from grafcli.config import load_config load_config(CONFIG_PATH) fro...
<commit_before><commit_msg>Add remote resources tests stub.<commit_after>
#!/usr/bin/python3 import os import sys import unittest from unittest.mock import patch, sentinel LIB_PATH = os.path.dirname(os.path.realpath(__file__)) + '/../' CONFIG_PATH = os.path.join(LIB_PATH, 'grafcli.example.conf') sys.path.append(LIB_PATH) from grafcli.config import load_config load_config(CONFIG_PATH) fro...
Add remote resources tests stub.#!/usr/bin/python3 import os import sys import unittest from unittest.mock import patch, sentinel LIB_PATH = os.path.dirname(os.path.realpath(__file__)) + '/../' CONFIG_PATH = os.path.join(LIB_PATH, 'grafcli.example.conf') sys.path.append(LIB_PATH) from grafcli.config import load_conf...
<commit_before><commit_msg>Add remote resources tests stub.<commit_after>#!/usr/bin/python3 import os import sys import unittest from unittest.mock import patch, sentinel LIB_PATH = os.path.dirname(os.path.realpath(__file__)) + '/../' CONFIG_PATH = os.path.join(LIB_PATH, 'grafcli.example.conf') sys.path.append(LIB_PA...
1f425fdfcb58641025e1a41a2c2c4cbd41eb97b5
interesting/mock.py
interesting/mock.py
class Mock(object): class _MockQuery(object): '''Access Mock internals''' def __init__(self, mock): self._mock = mock @property def attributes(self): return set(self._mock._attrs.keys()) @property def calls(self): return tuple(se...
Add custom Mock class implementation.
Add custom Mock class implementation.
Python
mit
pepincho/Python-Course-FMI
Add custom Mock class implementation.
class Mock(object): class _MockQuery(object): '''Access Mock internals''' def __init__(self, mock): self._mock = mock @property def attributes(self): return set(self._mock._attrs.keys()) @property def calls(self): return tuple(se...
<commit_before><commit_msg>Add custom Mock class implementation.<commit_after>
class Mock(object): class _MockQuery(object): '''Access Mock internals''' def __init__(self, mock): self._mock = mock @property def attributes(self): return set(self._mock._attrs.keys()) @property def calls(self): return tuple(se...
Add custom Mock class implementation.class Mock(object): class _MockQuery(object): '''Access Mock internals''' def __init__(self, mock): self._mock = mock @property def attributes(self): return set(self._mock._attrs.keys()) @property def cal...
<commit_before><commit_msg>Add custom Mock class implementation.<commit_after>class Mock(object): class _MockQuery(object): '''Access Mock internals''' def __init__(self, mock): self._mock = mock @property def attributes(self): return set(self._mock._attrs.k...
56947f660581805e701b31834b6b07975e245b1d
samples/discover_one_node.py
samples/discover_one_node.py
from __future__ import print_function import re import requests from orionsdk import SwisClient def main(): npm_server = 'localhost' username = 'admin' password = '' target_node_ip = '1.2.3.4' snmpv3_credential_id = 3 orion_engine_id = 1 swis = SwisClient(npm_server, username, password) ...
Add sample for running discovery of one SNMPv3 node
Add sample for running discovery of one SNMPv3 node
Python
apache-2.0
solarwinds/orionsdk-python
Add sample for running discovery of one SNMPv3 node
from __future__ import print_function import re import requests from orionsdk import SwisClient def main(): npm_server = 'localhost' username = 'admin' password = '' target_node_ip = '1.2.3.4' snmpv3_credential_id = 3 orion_engine_id = 1 swis = SwisClient(npm_server, username, password) ...
<commit_before><commit_msg>Add sample for running discovery of one SNMPv3 node<commit_after>
from __future__ import print_function import re import requests from orionsdk import SwisClient def main(): npm_server = 'localhost' username = 'admin' password = '' target_node_ip = '1.2.3.4' snmpv3_credential_id = 3 orion_engine_id = 1 swis = SwisClient(npm_server, username, password) ...
Add sample for running discovery of one SNMPv3 nodefrom __future__ import print_function import re import requests from orionsdk import SwisClient def main(): npm_server = 'localhost' username = 'admin' password = '' target_node_ip = '1.2.3.4' snmpv3_credential_id = 3 orion_engine_id = 1 s...
<commit_before><commit_msg>Add sample for running discovery of one SNMPv3 node<commit_after>from __future__ import print_function import re import requests from orionsdk import SwisClient def main(): npm_server = 'localhost' username = 'admin' password = '' target_node_ip = '1.2.3.4' snmpv3_credent...
f13bc3017552c3d19d9b642c9f61b3f7262256a1
tests/cogs/test_admin.py
tests/cogs/test_admin.py
from __future__ import annotations from typing import TYPE_CHECKING import pytest import pytest_mock from erasmus.cogs.admin import Admin from erasmus.erasmus import Erasmus from erasmus.types import Refreshable if TYPE_CHECKING: from unittest.mock import Mock class TestAdmin: @pytest.fixture def mock...
Add initial tests for admin cog
Add initial tests for admin cog
Python
bsd-3-clause
bryanforbes/Erasmus
Add initial tests for admin cog
from __future__ import annotations from typing import TYPE_CHECKING import pytest import pytest_mock from erasmus.cogs.admin import Admin from erasmus.erasmus import Erasmus from erasmus.types import Refreshable if TYPE_CHECKING: from unittest.mock import Mock class TestAdmin: @pytest.fixture def mock...
<commit_before><commit_msg>Add initial tests for admin cog<commit_after>
from __future__ import annotations from typing import TYPE_CHECKING import pytest import pytest_mock from erasmus.cogs.admin import Admin from erasmus.erasmus import Erasmus from erasmus.types import Refreshable if TYPE_CHECKING: from unittest.mock import Mock class TestAdmin: @pytest.fixture def mock...
Add initial tests for admin cogfrom __future__ import annotations from typing import TYPE_CHECKING import pytest import pytest_mock from erasmus.cogs.admin import Admin from erasmus.erasmus import Erasmus from erasmus.types import Refreshable if TYPE_CHECKING: from unittest.mock import Mock class TestAdmin: ...
<commit_before><commit_msg>Add initial tests for admin cog<commit_after>from __future__ import annotations from typing import TYPE_CHECKING import pytest import pytest_mock from erasmus.cogs.admin import Admin from erasmus.erasmus import Erasmus from erasmus.types import Refreshable if TYPE_CHECKING: from unitt...
dfc22bc3b67bd6164d8eb2c2e51638a7f0fca5a9
parsing/tracking_logs/generate_course_tracking_logs.py
parsing/tracking_logs/generate_course_tracking_logs.py
''' This module will extract tracking logs for a given course and date range between when course enrollment start and when the course ended. For each log, the parent_data and meta_data from the course_structure collection will be appended to the log based on the event key in the log ''' import pymongo import sys ...
Add script to generate course specific tracking logs
Add script to generate course specific tracking logs
Python
mit
andyzsf/edx_data_research,McGillX/edx_data_research,McGillX/edx_data_research,McGillX/edx_data_research,andyzsf/edx_data_research
Add script to generate course specific tracking logs
''' This module will extract tracking logs for a given course and date range between when course enrollment start and when the course ended. For each log, the parent_data and meta_data from the course_structure collection will be appended to the log based on the event key in the log ''' import pymongo import sys ...
<commit_before><commit_msg>Add script to generate course specific tracking logs<commit_after>
''' This module will extract tracking logs for a given course and date range between when course enrollment start and when the course ended. For each log, the parent_data and meta_data from the course_structure collection will be appended to the log based on the event key in the log ''' import pymongo import sys ...
Add script to generate course specific tracking logs''' This module will extract tracking logs for a given course and date range between when course enrollment start and when the course ended. For each log, the parent_data and meta_data from the course_structure collection will be appended to the log based on the eve...
<commit_before><commit_msg>Add script to generate course specific tracking logs<commit_after>''' This module will extract tracking logs for a given course and date range between when course enrollment start and when the course ended. For each log, the parent_data and meta_data from the course_structure collection will...
6989972846e67e5f3fa92a5ed4f49526ea46e2e4
convergence_tests/3D_helmholtz_extr.py
convergence_tests/3D_helmholtz_extr.py
from __future__ import absolute_import, division from firedrake import * def run_hybrid_extr_helmholtz(degree, res, quads): nx = 2 ** res ny = 2 ** res nz = 2 ** (res - 1) h = 0.2 / nz base = UnitSquareMesh(nx, ny, quadrilateral=quads) mesh = ExtrudedMesh(base, layers=nz, layer_height=h) ...
Add working 3D extruded Helmholtz demo
Add working 3D extruded Helmholtz demo
Python
mit
thomasgibson/firedrake-hybridization
Add working 3D extruded Helmholtz demo
from __future__ import absolute_import, division from firedrake import * def run_hybrid_extr_helmholtz(degree, res, quads): nx = 2 ** res ny = 2 ** res nz = 2 ** (res - 1) h = 0.2 / nz base = UnitSquareMesh(nx, ny, quadrilateral=quads) mesh = ExtrudedMesh(base, layers=nz, layer_height=h) ...
<commit_before><commit_msg>Add working 3D extruded Helmholtz demo<commit_after>
from __future__ import absolute_import, division from firedrake import * def run_hybrid_extr_helmholtz(degree, res, quads): nx = 2 ** res ny = 2 ** res nz = 2 ** (res - 1) h = 0.2 / nz base = UnitSquareMesh(nx, ny, quadrilateral=quads) mesh = ExtrudedMesh(base, layers=nz, layer_height=h) ...
Add working 3D extruded Helmholtz demofrom __future__ import absolute_import, division from firedrake import * def run_hybrid_extr_helmholtz(degree, res, quads): nx = 2 ** res ny = 2 ** res nz = 2 ** (res - 1) h = 0.2 / nz base = UnitSquareMesh(nx, ny, quadrilateral=quads) mesh = ExtrudedMesh...
<commit_before><commit_msg>Add working 3D extruded Helmholtz demo<commit_after>from __future__ import absolute_import, division from firedrake import * def run_hybrid_extr_helmholtz(degree, res, quads): nx = 2 ** res ny = 2 ** res nz = 2 ** (res - 1) h = 0.2 / nz base = UnitSquareMesh(nx, ny, qua...
d87b22ee69d47d0edf33be36a217ed5d5a6a599b
flocker/__init__.py
flocker/__init__.py
# Copyright Hybrid Logic Ltd. See LICENSE file for details. # -*- test-case-name: flocker.test -*- """ Flocker is a hypervisor that provides ZFS-based replication and fail-over functionality to a Linux-based user-space operating system. """ from ._version import get_versions __version__ = get_versions()['version'] d...
# Copyright Hybrid Logic Ltd. See LICENSE file for details. """ Flocker is a hypervisor that provides ZFS-based replication and fail-over functionality to a Linux-based user-space operating system. """ from ._version import get_versions __version__ = get_versions()['version'] del get_versions
Remove reference to old tests.
Remove reference to old tests.
Python
apache-2.0
hackday-profilers/flocker,jml/flocker,wallnerryan/flocker-profiles,LaynePeng/flocker,runcom/flocker,mbrukman/flocker,beni55/flocker,adamtheturtle/flocker,w4ngyi/flocker,LaynePeng/flocker,achanda/flocker,mbrukman/flocker,achanda/flocker,moypray/flocker,lukemarsden/flocker,achanda/flocker,1d4Nf6/flocker,jml/flocker,lukem...
# Copyright Hybrid Logic Ltd. See LICENSE file for details. # -*- test-case-name: flocker.test -*- """ Flocker is a hypervisor that provides ZFS-based replication and fail-over functionality to a Linux-based user-space operating system. """ from ._version import get_versions __version__ = get_versions()['version'] d...
# Copyright Hybrid Logic Ltd. See LICENSE file for details. """ Flocker is a hypervisor that provides ZFS-based replication and fail-over functionality to a Linux-based user-space operating system. """ from ._version import get_versions __version__ = get_versions()['version'] del get_versions
<commit_before># Copyright Hybrid Logic Ltd. See LICENSE file for details. # -*- test-case-name: flocker.test -*- """ Flocker is a hypervisor that provides ZFS-based replication and fail-over functionality to a Linux-based user-space operating system. """ from ._version import get_versions __version__ = get_versions...
# Copyright Hybrid Logic Ltd. See LICENSE file for details. """ Flocker is a hypervisor that provides ZFS-based replication and fail-over functionality to a Linux-based user-space operating system. """ from ._version import get_versions __version__ = get_versions()['version'] del get_versions
# Copyright Hybrid Logic Ltd. See LICENSE file for details. # -*- test-case-name: flocker.test -*- """ Flocker is a hypervisor that provides ZFS-based replication and fail-over functionality to a Linux-based user-space operating system. """ from ._version import get_versions __version__ = get_versions()['version'] d...
<commit_before># Copyright Hybrid Logic Ltd. See LICENSE file for details. # -*- test-case-name: flocker.test -*- """ Flocker is a hypervisor that provides ZFS-based replication and fail-over functionality to a Linux-based user-space operating system. """ from ._version import get_versions __version__ = get_versions...
c7f1cbf41ef174555386fbf3b4200285bdee19b6
numba/tests/test_unsigned_arith.py
numba/tests/test_unsigned_arith.py
import numpy as np import unittest from numba import void, uint32, int32, jit, uint64, int64, typeof, bool_ @jit(void(uint32[:], uint32, uint32)) def prng(X, A, C): for i in range(X.shape[0]): for j in range(100): v = (A * X[i] + C) X[i] = v @jit(uint32()) def unsigned_literal(): ...
Add tests for unsigned arithmetic
Add tests for unsigned arithmetic
Python
bsd-2-clause
pombredanne/numba,stonebig/numba,gmarkall/numba,GaZ3ll3/numba,IntelLabs/numba,pitrou/numba,numba/numba,gdementen/numba,gdementen/numba,IntelLabs/numba,GaZ3ll3/numba,stuartarchibald/numba,pitrou/numba,IntelLabs/numba,pombredanne/numba,sklam/numba,cpcloud/numba,pombredanne/numba,stuartarchibald/numba,shiquanwang/numba,Ga...
Add tests for unsigned arithmetic
import numpy as np import unittest from numba import void, uint32, int32, jit, uint64, int64, typeof, bool_ @jit(void(uint32[:], uint32, uint32)) def prng(X, A, C): for i in range(X.shape[0]): for j in range(100): v = (A * X[i] + C) X[i] = v @jit(uint32()) def unsigned_literal(): ...
<commit_before><commit_msg>Add tests for unsigned arithmetic<commit_after>
import numpy as np import unittest from numba import void, uint32, int32, jit, uint64, int64, typeof, bool_ @jit(void(uint32[:], uint32, uint32)) def prng(X, A, C): for i in range(X.shape[0]): for j in range(100): v = (A * X[i] + C) X[i] = v @jit(uint32()) def unsigned_literal(): ...
Add tests for unsigned arithmeticimport numpy as np import unittest from numba import void, uint32, int32, jit, uint64, int64, typeof, bool_ @jit(void(uint32[:], uint32, uint32)) def prng(X, A, C): for i in range(X.shape[0]): for j in range(100): v = (A * X[i] + C) X[i] = v @jit(u...
<commit_before><commit_msg>Add tests for unsigned arithmetic<commit_after>import numpy as np import unittest from numba import void, uint32, int32, jit, uint64, int64, typeof, bool_ @jit(void(uint32[:], uint32, uint32)) def prng(X, A, C): for i in range(X.shape[0]): for j in range(100): v = (A...
c90b44a4bf974f6c3c8726960f84517c2ab1c363
modules/api_base.py
modules/api_base.py
#! /usr/bin/env python2.7 import requests class API(object): # This class should be inherited by more unique API specific classes # See kraken.py for an example def __init__(self, base_url, default_headers): self.base_url = base_url self.headers = default_headers # Define all HTTP ve...
Add simple json api wrapper
Add simple json api wrapper
Python
mit
BatedUrGonnaDie/salty_bot
Add simple json api wrapper
#! /usr/bin/env python2.7 import requests class API(object): # This class should be inherited by more unique API specific classes # See kraken.py for an example def __init__(self, base_url, default_headers): self.base_url = base_url self.headers = default_headers # Define all HTTP ve...
<commit_before><commit_msg>Add simple json api wrapper<commit_after>
#! /usr/bin/env python2.7 import requests class API(object): # This class should be inherited by more unique API specific classes # See kraken.py for an example def __init__(self, base_url, default_headers): self.base_url = base_url self.headers = default_headers # Define all HTTP ve...
Add simple json api wrapper#! /usr/bin/env python2.7 import requests class API(object): # This class should be inherited by more unique API specific classes # See kraken.py for an example def __init__(self, base_url, default_headers): self.base_url = base_url self.headers = default_header...
<commit_before><commit_msg>Add simple json api wrapper<commit_after>#! /usr/bin/env python2.7 import requests class API(object): # This class should be inherited by more unique API specific classes # See kraken.py for an example def __init__(self, base_url, default_headers): self.base_url = base_...
2d4da5b24f8a01b7e3a09ecb9f8f55d695d01a5e
apns/tests/test_utils.py
apns/tests/test_utils.py
from datetime import datetime from twisted.trial.unittest import TestCase from apns.utils import datetime_to_timestamp class DatetimeToTimestampTestCase(TestCase): def test_datetime(self): now = datetime.now() timestamp = datetime_to_timestamp(now) self.assertEqual(datetime.fromtimest...
Add tests to utils module
Add tests to utils module
Python
mit
operasoftware/twisted-apns,operasoftware/twisted-apns
Add tests to utils module
from datetime import datetime from twisted.trial.unittest import TestCase from apns.utils import datetime_to_timestamp class DatetimeToTimestampTestCase(TestCase): def test_datetime(self): now = datetime.now() timestamp = datetime_to_timestamp(now) self.assertEqual(datetime.fromtimest...
<commit_before><commit_msg>Add tests to utils module<commit_after>
from datetime import datetime from twisted.trial.unittest import TestCase from apns.utils import datetime_to_timestamp class DatetimeToTimestampTestCase(TestCase): def test_datetime(self): now = datetime.now() timestamp = datetime_to_timestamp(now) self.assertEqual(datetime.fromtimest...
Add tests to utils modulefrom datetime import datetime from twisted.trial.unittest import TestCase from apns.utils import datetime_to_timestamp class DatetimeToTimestampTestCase(TestCase): def test_datetime(self): now = datetime.now() timestamp = datetime_to_timestamp(now) self.assert...
<commit_before><commit_msg>Add tests to utils module<commit_after>from datetime import datetime from twisted.trial.unittest import TestCase from apns.utils import datetime_to_timestamp class DatetimeToTimestampTestCase(TestCase): def test_datetime(self): now = datetime.now() timestamp = dateti...
fd85f2ef68e91aea6acde2d665950ec105e1d015
bluesky/tests/test_progress_bar.py
bluesky/tests/test_progress_bar.py
from bluesky.utils import ProgressBar, ProgressBarManager from bluesky.plans import mv from bluesky import RunEngine from bluesky.examples import NullStatus, SimpleStatus, Mover from collections import OrderedDict import time def test_status_without_watch(): st = NullStatus() ProgressBar([st]) def test_stat...
Add test to cover ProgressBar and ProgressBarManager.
TST: Add test to cover ProgressBar and ProgressBarManager.
Python
bsd-3-clause
ericdill/bluesky,ericdill/bluesky
TST: Add test to cover ProgressBar and ProgressBarManager.
from bluesky.utils import ProgressBar, ProgressBarManager from bluesky.plans import mv from bluesky import RunEngine from bluesky.examples import NullStatus, SimpleStatus, Mover from collections import OrderedDict import time def test_status_without_watch(): st = NullStatus() ProgressBar([st]) def test_stat...
<commit_before><commit_msg>TST: Add test to cover ProgressBar and ProgressBarManager.<commit_after>
from bluesky.utils import ProgressBar, ProgressBarManager from bluesky.plans import mv from bluesky import RunEngine from bluesky.examples import NullStatus, SimpleStatus, Mover from collections import OrderedDict import time def test_status_without_watch(): st = NullStatus() ProgressBar([st]) def test_stat...
TST: Add test to cover ProgressBar and ProgressBarManager.from bluesky.utils import ProgressBar, ProgressBarManager from bluesky.plans import mv from bluesky import RunEngine from bluesky.examples import NullStatus, SimpleStatus, Mover from collections import OrderedDict import time def test_status_without_watch(): ...
<commit_before><commit_msg>TST: Add test to cover ProgressBar and ProgressBarManager.<commit_after>from bluesky.utils import ProgressBar, ProgressBarManager from bluesky.plans import mv from bluesky import RunEngine from bluesky.examples import NullStatus, SimpleStatus, Mover from collections import OrderedDict import ...
516f4ff71a062247bb026bf43257362c7386e403
test.py
test.py
# test for logic import sys, operator, random Base1 = sys.argv[1] Base2 = sys.argv[2] Base3 = sys.argv[3] Base4 = sys.argv[4] Base5 = sys.argv[5] Base6 = sys.argv[6] Level = 10 #relation = {1: Base1, 2: Base2, 3: Base3, 4: Base4, 5: Base5, 6: Base6} relation = [(1, int(Base1)), (2, int(Base2)), (3, int(Base3)), (4...
Test script for logic added
Test script for logic added
Python
apache-2.0
Phixia/WildEncounter
Test script for logic added
# test for logic import sys, operator, random Base1 = sys.argv[1] Base2 = sys.argv[2] Base3 = sys.argv[3] Base4 = sys.argv[4] Base5 = sys.argv[5] Base6 = sys.argv[6] Level = 10 #relation = {1: Base1, 2: Base2, 3: Base3, 4: Base4, 5: Base5, 6: Base6} relation = [(1, int(Base1)), (2, int(Base2)), (3, int(Base3)), (4...
<commit_before><commit_msg>Test script for logic added<commit_after>
# test for logic import sys, operator, random Base1 = sys.argv[1] Base2 = sys.argv[2] Base3 = sys.argv[3] Base4 = sys.argv[4] Base5 = sys.argv[5] Base6 = sys.argv[6] Level = 10 #relation = {1: Base1, 2: Base2, 3: Base3, 4: Base4, 5: Base5, 6: Base6} relation = [(1, int(Base1)), (2, int(Base2)), (3, int(Base3)), (4...
Test script for logic added# test for logic import sys, operator, random Base1 = sys.argv[1] Base2 = sys.argv[2] Base3 = sys.argv[3] Base4 = sys.argv[4] Base5 = sys.argv[5] Base6 = sys.argv[6] Level = 10 #relation = {1: Base1, 2: Base2, 3: Base3, 4: Base4, 5: Base5, 6: Base6} relation = [(1, int(Base1)), (2, int(B...
<commit_before><commit_msg>Test script for logic added<commit_after># test for logic import sys, operator, random Base1 = sys.argv[1] Base2 = sys.argv[2] Base3 = sys.argv[3] Base4 = sys.argv[4] Base5 = sys.argv[5] Base6 = sys.argv[6] Level = 10 #relation = {1: Base1, 2: Base2, 3: Base3, 4: Base4, 5: Base5, 6: Base6...
eb44db8a4dbe3e6c261497e249d984059b1e32fe
infinity.py
infinity.py
try: from functools import total_ordering except ImportError: # Use Python 2.6 port from total_ordering import total_ordering @total_ordering class Infinity(object): """ An object that is greater than any other object (except itself). Inspired by https://pypi.python.org/pypi/Extremes Exa...
Add first draft for Infinity class
Add first draft for Infinity class
Python
bsd-3-clause
kvesteri/infinity
Add first draft for Infinity class
try: from functools import total_ordering except ImportError: # Use Python 2.6 port from total_ordering import total_ordering @total_ordering class Infinity(object): """ An object that is greater than any other object (except itself). Inspired by https://pypi.python.org/pypi/Extremes Exa...
<commit_before><commit_msg>Add first draft for Infinity class<commit_after>
try: from functools import total_ordering except ImportError: # Use Python 2.6 port from total_ordering import total_ordering @total_ordering class Infinity(object): """ An object that is greater than any other object (except itself). Inspired by https://pypi.python.org/pypi/Extremes Exa...
Add first draft for Infinity classtry: from functools import total_ordering except ImportError: # Use Python 2.6 port from total_ordering import total_ordering @total_ordering class Infinity(object): """ An object that is greater than any other object (except itself). Inspired by https://pypi...
<commit_before><commit_msg>Add first draft for Infinity class<commit_after>try: from functools import total_ordering except ImportError: # Use Python 2.6 port from total_ordering import total_ordering @total_ordering class Infinity(object): """ An object that is greater than any other object (exce...
20c3a662e276767e3ed36acc15e7f450737d5e80
ircutils.py
ircutils.py
""" Collection of helper functions """ def privmsg(to, msg): return 'PRIVMSG %s :%s' % (to, msg) def join(channel): return 'JOIN %s' % channel def leave(channel, reason=''): return 'PART %s :%s' % (channel, reason) def quit(reason=''): return 'QUIT :%s' % reason def topic(channel, topic=''): if...
Add some IRC helper functions
Add some IRC helper functions
Python
mit
aalien/mib
Add some IRC helper functions
""" Collection of helper functions """ def privmsg(to, msg): return 'PRIVMSG %s :%s' % (to, msg) def join(channel): return 'JOIN %s' % channel def leave(channel, reason=''): return 'PART %s :%s' % (channel, reason) def quit(reason=''): return 'QUIT :%s' % reason def topic(channel, topic=''): if...
<commit_before><commit_msg>Add some IRC helper functions<commit_after>
""" Collection of helper functions """ def privmsg(to, msg): return 'PRIVMSG %s :%s' % (to, msg) def join(channel): return 'JOIN %s' % channel def leave(channel, reason=''): return 'PART %s :%s' % (channel, reason) def quit(reason=''): return 'QUIT :%s' % reason def topic(channel, topic=''): if...
Add some IRC helper functions""" Collection of helper functions """ def privmsg(to, msg): return 'PRIVMSG %s :%s' % (to, msg) def join(channel): return 'JOIN %s' % channel def leave(channel, reason=''): return 'PART %s :%s' % (channel, reason) def quit(reason=''): return 'QUIT :%s' % reason def top...
<commit_before><commit_msg>Add some IRC helper functions<commit_after>""" Collection of helper functions """ def privmsg(to, msg): return 'PRIVMSG %s :%s' % (to, msg) def join(channel): return 'JOIN %s' % channel def leave(channel, reason=''): return 'PART %s :%s' % (channel, reason) def quit(reason='')...
c4e74be4b508c226b907b27b4a00b197289680e0
django/applications/catmaid/control/ajax_templates.py
django/applications/catmaid/control/ajax_templates.py
from django.template.loader_tags import BlockNode, ExtendsNode from django.template import loader, Context, RequestContext, TextNode # Most parts of this code has been taken from this Django snippet: # http://djangosnippets.org/snippets/942/ def get_template(template): if isinstance(template, (tuple, list)): ...
Add helper methods to render template blocks independently
Add helper methods to render template blocks independently
Python
agpl-3.0
htem/CATMAID,fzadow/CATMAID,fzadow/CATMAID,htem/CATMAID,htem/CATMAID,htem/CATMAID,fzadow/CATMAID,fzadow/CATMAID
Add helper methods to render template blocks independently
from django.template.loader_tags import BlockNode, ExtendsNode from django.template import loader, Context, RequestContext, TextNode # Most parts of this code has been taken from this Django snippet: # http://djangosnippets.org/snippets/942/ def get_template(template): if isinstance(template, (tuple, list)): ...
<commit_before><commit_msg>Add helper methods to render template blocks independently<commit_after>
from django.template.loader_tags import BlockNode, ExtendsNode from django.template import loader, Context, RequestContext, TextNode # Most parts of this code has been taken from this Django snippet: # http://djangosnippets.org/snippets/942/ def get_template(template): if isinstance(template, (tuple, list)): ...
Add helper methods to render template blocks independentlyfrom django.template.loader_tags import BlockNode, ExtendsNode from django.template import loader, Context, RequestContext, TextNode # Most parts of this code has been taken from this Django snippet: # http://djangosnippets.org/snippets/942/ def get_template(t...
<commit_before><commit_msg>Add helper methods to render template blocks independently<commit_after>from django.template.loader_tags import BlockNode, ExtendsNode from django.template import loader, Context, RequestContext, TextNode # Most parts of this code has been taken from this Django snippet: # http://djangosnipp...
0fc5bc7d4582fc2af65e4c87e1962eeb702b051e
indra/sources/eidos/scala_utils.py
indra/sources/eidos/scala_utils.py
from jnius import autoclass def get_python_list(scala_list): """Return list from elements of scala.collection.immutable.List""" python_list = [] for i in range(scala_list.length()): python_list.append(scala_list.apply(i)) return python_list def get_python_dict(scala_map): """Return a dict...
Add some Scala/Python conversion utilities
Add some Scala/Python conversion utilities
Python
bsd-2-clause
johnbachman/indra,bgyori/indra,sorgerlab/belpy,johnbachman/belpy,johnbachman/belpy,sorgerlab/belpy,sorgerlab/belpy,pvtodorov/indra,pvtodorov/indra,johnbachman/indra,bgyori/indra,sorgerlab/indra,bgyori/indra,pvtodorov/indra,sorgerlab/indra,johnbachman/indra,sorgerlab/indra,johnbachman/belpy,pvtodorov/indra
Add some Scala/Python conversion utilities
from jnius import autoclass def get_python_list(scala_list): """Return list from elements of scala.collection.immutable.List""" python_list = [] for i in range(scala_list.length()): python_list.append(scala_list.apply(i)) return python_list def get_python_dict(scala_map): """Return a dict...
<commit_before><commit_msg>Add some Scala/Python conversion utilities<commit_after>
from jnius import autoclass def get_python_list(scala_list): """Return list from elements of scala.collection.immutable.List""" python_list = [] for i in range(scala_list.length()): python_list.append(scala_list.apply(i)) return python_list def get_python_dict(scala_map): """Return a dict...
Add some Scala/Python conversion utilitiesfrom jnius import autoclass def get_python_list(scala_list): """Return list from elements of scala.collection.immutable.List""" python_list = [] for i in range(scala_list.length()): python_list.append(scala_list.apply(i)) return python_list def get_py...
<commit_before><commit_msg>Add some Scala/Python conversion utilities<commit_after>from jnius import autoclass def get_python_list(scala_list): """Return list from elements of scala.collection.immutable.List""" python_list = [] for i in range(scala_list.length()): python_list.append(scala_list.appl...
39beb7b196d67dd1b8e6c3d450e48f7cea409f22
system-tests/test_efu.py
system-tests/test_efu.py
import sys from os import path sys.path.append(path.join(path.dirname(path.dirname(path.abspath(__file__))), "utils", "efushell")) from verifymetrics import verify_metrics def test_efu_received_all_sent_udp_packets(docker_compose): for name, op, value, retval in verify_metrics("localhost", "8889", "efu.mbcaen.rec...
Add first simple system test, checks received num of packets
Add first simple system test, checks received num of packets
Python
bsd-2-clause
ess-dmsc/event-formation-unit,ess-dmsc/event-formation-unit,ess-dmsc/event-formation-unit,ess-dmsc/event-formation-unit
Add first simple system test, checks received num of packets
import sys from os import path sys.path.append(path.join(path.dirname(path.dirname(path.abspath(__file__))), "utils", "efushell")) from verifymetrics import verify_metrics def test_efu_received_all_sent_udp_packets(docker_compose): for name, op, value, retval in verify_metrics("localhost", "8889", "efu.mbcaen.rec...
<commit_before><commit_msg>Add first simple system test, checks received num of packets<commit_after>
import sys from os import path sys.path.append(path.join(path.dirname(path.dirname(path.abspath(__file__))), "utils", "efushell")) from verifymetrics import verify_metrics def test_efu_received_all_sent_udp_packets(docker_compose): for name, op, value, retval in verify_metrics("localhost", "8889", "efu.mbcaen.rec...
Add first simple system test, checks received num of packetsimport sys from os import path sys.path.append(path.join(path.dirname(path.dirname(path.abspath(__file__))), "utils", "efushell")) from verifymetrics import verify_metrics def test_efu_received_all_sent_udp_packets(docker_compose): for name, op, value, r...
<commit_before><commit_msg>Add first simple system test, checks received num of packets<commit_after>import sys from os import path sys.path.append(path.join(path.dirname(path.dirname(path.abspath(__file__))), "utils", "efushell")) from verifymetrics import verify_metrics def test_efu_received_all_sent_udp_packets(do...
85688be0cc1dc7a760783f1bed5c54b5e5e7a44f
tests/redirect_bot_tests.py
tests/redirect_bot_tests.py
# -*- coding: utf-8 -*- """Tests for the redirect.py script.""" # # (C) Pywikibot team, 2017 # # Distributed under the terms of the MIT license. # from __future__ import absolute_import, unicode_literals __version__ = '$Id$' try: from unittest.mock import Mock, patch except ImportError: from mock import Mock,...
Add a few tests for RedirectRobot.get_sd_template
Add a few tests for RedirectRobot.get_sd_template Change-Id: I79c8ef9129adc4bb623179429495c5bac0ecff78
Python
mit
hasteur/g13bot_tools_new,hasteur/g13bot_tools_new,npdoty/pywikibot,happy5214/pywikibot-core,wikimedia/pywikibot-core,jayvdb/pywikibot-core,PersianWikipedia/pywikibot-core,magul/pywikibot-core,wikimedia/pywikibot-core,jayvdb/pywikibot-core,happy5214/pywikibot-core,magul/pywikibot-core,Darkdadaah/pywikibot-core,npdoty/py...
Add a few tests for RedirectRobot.get_sd_template Change-Id: I79c8ef9129adc4bb623179429495c5bac0ecff78
# -*- coding: utf-8 -*- """Tests for the redirect.py script.""" # # (C) Pywikibot team, 2017 # # Distributed under the terms of the MIT license. # from __future__ import absolute_import, unicode_literals __version__ = '$Id$' try: from unittest.mock import Mock, patch except ImportError: from mock import Mock,...
<commit_before><commit_msg>Add a few tests for RedirectRobot.get_sd_template Change-Id: I79c8ef9129adc4bb623179429495c5bac0ecff78<commit_after>
# -*- coding: utf-8 -*- """Tests for the redirect.py script.""" # # (C) Pywikibot team, 2017 # # Distributed under the terms of the MIT license. # from __future__ import absolute_import, unicode_literals __version__ = '$Id$' try: from unittest.mock import Mock, patch except ImportError: from mock import Mock,...
Add a few tests for RedirectRobot.get_sd_template Change-Id: I79c8ef9129adc4bb623179429495c5bac0ecff78# -*- coding: utf-8 -*- """Tests for the redirect.py script.""" # # (C) Pywikibot team, 2017 # # Distributed under the terms of the MIT license. # from __future__ import absolute_import, unicode_literals __version__ ...
<commit_before><commit_msg>Add a few tests for RedirectRobot.get_sd_template Change-Id: I79c8ef9129adc4bb623179429495c5bac0ecff78<commit_after># -*- coding: utf-8 -*- """Tests for the redirect.py script.""" # # (C) Pywikibot team, 2017 # # Distributed under the terms of the MIT license. # from __future__ import absolu...
8354df962c9a38270531a76385ea2ecef11e0836
examples/reset_return_delay_time.py
examples/reset_return_delay_time.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # PyAX-12 # The MIT License # # Copyright (c) 2010,2015,2017 Jeremie DECOCK (http://www.jdhp.org) # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Sof...
Add a script to reset the return delay time.
Add a script to reset the return delay time.
Python
mit
jeremiedecock/pyax12,jeremiedecock/pyax12
Add a script to reset the return delay time.
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # PyAX-12 # The MIT License # # Copyright (c) 2010,2015,2017 Jeremie DECOCK (http://www.jdhp.org) # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Sof...
<commit_before><commit_msg>Add a script to reset the return delay time.<commit_after>
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # PyAX-12 # The MIT License # # Copyright (c) 2010,2015,2017 Jeremie DECOCK (http://www.jdhp.org) # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Sof...
Add a script to reset the return delay time.#!/usr/bin/env python3 # -*- coding: utf-8 -*- # PyAX-12 # The MIT License # # Copyright (c) 2010,2015,2017 Jeremie DECOCK (http://www.jdhp.org) # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation ...
<commit_before><commit_msg>Add a script to reset the return delay time.<commit_after>#!/usr/bin/env python3 # -*- coding: utf-8 -*- # PyAX-12 # The MIT License # # Copyright (c) 2010,2015,2017 Jeremie DECOCK (http://www.jdhp.org) # # Permission is hereby granted, free of charge, to any person obtaining a copy # of th...
2dced181595cabbe9c19a544ab7cb705a3c89ad5
osc_demo.py
osc_demo.py
import s3g import serial import time import optparse import OSC import threading """ Control an s3g device (Makerbot, etc) using osc! Requires these modules: * pySerial: http://pypi.python.org/pypi/pyserial * pyOSC: https://trac.v2.nl/wiki/pyOSC """ parser = optparse.OptionParser() parser.add_option("-s", "--serialp...
Add Open Sound Controller (OSC) example
Add Open Sound Controller (OSC) example
Python
agpl-3.0
makerbot/s3g,makerbot/s3g,makerbot/s3g,Jnesselr/s3g,makerbot/s3g,Jnesselr/s3g
Add Open Sound Controller (OSC) example
import s3g import serial import time import optparse import OSC import threading """ Control an s3g device (Makerbot, etc) using osc! Requires these modules: * pySerial: http://pypi.python.org/pypi/pyserial * pyOSC: https://trac.v2.nl/wiki/pyOSC """ parser = optparse.OptionParser() parser.add_option("-s", "--serialp...
<commit_before><commit_msg>Add Open Sound Controller (OSC) example<commit_after>
import s3g import serial import time import optparse import OSC import threading """ Control an s3g device (Makerbot, etc) using osc! Requires these modules: * pySerial: http://pypi.python.org/pypi/pyserial * pyOSC: https://trac.v2.nl/wiki/pyOSC """ parser = optparse.OptionParser() parser.add_option("-s", "--serialp...
Add Open Sound Controller (OSC) exampleimport s3g import serial import time import optparse import OSC import threading """ Control an s3g device (Makerbot, etc) using osc! Requires these modules: * pySerial: http://pypi.python.org/pypi/pyserial * pyOSC: https://trac.v2.nl/wiki/pyOSC """ parser = optparse.OptionPars...
<commit_before><commit_msg>Add Open Sound Controller (OSC) example<commit_after>import s3g import serial import time import optparse import OSC import threading """ Control an s3g device (Makerbot, etc) using osc! Requires these modules: * pySerial: http://pypi.python.org/pypi/pyserial * pyOSC: https://trac.v2.nl/wik...
e05854a61052b4d34657db912f93eea007f2dda9
read_symbols_rel.py
read_symbols_rel.py
import struct import datetime import argparse import sys record_length = 128 def dump_content(filename): try: fp = open(filename, 'rb') except OSError as e: print("[ERROR] '%s' raised when tried to read the file '%s'" % (e.strerror, filename)) sys.exit(1) magic = fp.read(4...
Add a script to dump the .sel files
Add a script to dump the .sel files
Python
mit
FX31337/FX-BT-Scripts,FX31337/FX-BT-Scripts,EA31337/FX-BT-Scripts,EA31337/FX-BT-Scripts,EA31337/FX-BT-Scripts,FX31337/FX-BT-Scripts
Add a script to dump the .sel files
import struct import datetime import argparse import sys record_length = 128 def dump_content(filename): try: fp = open(filename, 'rb') except OSError as e: print("[ERROR] '%s' raised when tried to read the file '%s'" % (e.strerror, filename)) sys.exit(1) magic = fp.read(4...
<commit_before><commit_msg>Add a script to dump the .sel files<commit_after>
import struct import datetime import argparse import sys record_length = 128 def dump_content(filename): try: fp = open(filename, 'rb') except OSError as e: print("[ERROR] '%s' raised when tried to read the file '%s'" % (e.strerror, filename)) sys.exit(1) magic = fp.read(4...
Add a script to dump the .sel filesimport struct import datetime import argparse import sys record_length = 128 def dump_content(filename): try: fp = open(filename, 'rb') except OSError as e: print("[ERROR] '%s' raised when tried to read the file '%s'" % (e.strerror, filename)) ...
<commit_before><commit_msg>Add a script to dump the .sel files<commit_after>import struct import datetime import argparse import sys record_length = 128 def dump_content(filename): try: fp = open(filename, 'rb') except OSError as e: print("[ERROR] '%s' raised when tried to read the file '%...
cb4d916a23792f92f0929693d58350e7b045fb3d
plugins/coinflip.py
plugins/coinflip.py
import random from plugin import CommandPlugin, PluginException class CoinFlip(CommandPlugin): """ Flip a coin """ max_coin_flips = 1000000 def __init__(self): CommandPlugin.__init__(self) self.triggers = ['coin', 'coinflip'] self.short_help = 'Flip a coin' self.he...
Add CoinFlip plugin for some coin flipping fun
Add CoinFlip plugin for some coin flipping fun
Python
mit
Brottweiler/nimbus,itsmartin/nimbus,Plastix/nimbus,bcbwilla/nimbus
Add CoinFlip plugin for some coin flipping fun
import random from plugin import CommandPlugin, PluginException class CoinFlip(CommandPlugin): """ Flip a coin """ max_coin_flips = 1000000 def __init__(self): CommandPlugin.__init__(self) self.triggers = ['coin', 'coinflip'] self.short_help = 'Flip a coin' self.he...
<commit_before><commit_msg>Add CoinFlip plugin for some coin flipping fun<commit_after>
import random from plugin import CommandPlugin, PluginException class CoinFlip(CommandPlugin): """ Flip a coin """ max_coin_flips = 1000000 def __init__(self): CommandPlugin.__init__(self) self.triggers = ['coin', 'coinflip'] self.short_help = 'Flip a coin' self.he...
Add CoinFlip plugin for some coin flipping funimport random from plugin import CommandPlugin, PluginException class CoinFlip(CommandPlugin): """ Flip a coin """ max_coin_flips = 1000000 def __init__(self): CommandPlugin.__init__(self) self.triggers = ['coin', 'coinflip'] s...
<commit_before><commit_msg>Add CoinFlip plugin for some coin flipping fun<commit_after>import random from plugin import CommandPlugin, PluginException class CoinFlip(CommandPlugin): """ Flip a coin """ max_coin_flips = 1000000 def __init__(self): CommandPlugin.__init__(self) self....
bebdeaf75891ef83a801e243b8bd57f5aa770a3f
parameter_prediction/datasets/timit.py
parameter_prediction/datasets/timit.py
import numpy as np import os from pylearn2.datasets import dense_design_matrix from pylearn2.utils import string_utils class TIMIT(dense_design_matrix.DenseDesignMatrix): def __init__(self, which_set, preprocessor=None): """ which_set can be train, test, valid or test_valid. """ if...
Add TIMIT dataset class for pylearn2.
Add TIMIT dataset class for pylearn2.
Python
mit
mdenil/parameter_prediction,mdenil/parameter_prediction,mdenil/parameter_prediction
Add TIMIT dataset class for pylearn2.
import numpy as np import os from pylearn2.datasets import dense_design_matrix from pylearn2.utils import string_utils class TIMIT(dense_design_matrix.DenseDesignMatrix): def __init__(self, which_set, preprocessor=None): """ which_set can be train, test, valid or test_valid. """ if...
<commit_before><commit_msg>Add TIMIT dataset class for pylearn2.<commit_after>
import numpy as np import os from pylearn2.datasets import dense_design_matrix from pylearn2.utils import string_utils class TIMIT(dense_design_matrix.DenseDesignMatrix): def __init__(self, which_set, preprocessor=None): """ which_set can be train, test, valid or test_valid. """ if...
Add TIMIT dataset class for pylearn2.import numpy as np import os from pylearn2.datasets import dense_design_matrix from pylearn2.utils import string_utils class TIMIT(dense_design_matrix.DenseDesignMatrix): def __init__(self, which_set, preprocessor=None): """ which_set can be train, test, valid o...
<commit_before><commit_msg>Add TIMIT dataset class for pylearn2.<commit_after>import numpy as np import os from pylearn2.datasets import dense_design_matrix from pylearn2.utils import string_utils class TIMIT(dense_design_matrix.DenseDesignMatrix): def __init__(self, which_set, preprocessor=None): """ ...
df431d81d6524dc414061a4c39152378fb622eb5
setup.py
setup.py
# -*- coding: utf-8 -*- from setuptools import setup, find_packages setup(name='pymorph', version='0.88', description='Image Morphology Toolbox', author='Luís Pedro Coelho', author_email='lpc@mcu.edu', url='http://luispedro.org/pymorph/', packages=find_packages(), )
Make this into a python package
Make this into a python package git-svn-id: d22b6ed1b13e3e3451c5d6fab7d0adc235b2f27e@51 5128b7d6-d249-4073-bd28-aebf1259cb0a
Python
bsd-3-clause
luispedro/pymorph
Make this into a python package git-svn-id: d22b6ed1b13e3e3451c5d6fab7d0adc235b2f27e@51 5128b7d6-d249-4073-bd28-aebf1259cb0a
# -*- coding: utf-8 -*- from setuptools import setup, find_packages setup(name='pymorph', version='0.88', description='Image Morphology Toolbox', author='Luís Pedro Coelho', author_email='lpc@mcu.edu', url='http://luispedro.org/pymorph/', packages=find_packages(), )
<commit_before><commit_msg>Make this into a python package git-svn-id: d22b6ed1b13e3e3451c5d6fab7d0adc235b2f27e@51 5128b7d6-d249-4073-bd28-aebf1259cb0a<commit_after>
# -*- coding: utf-8 -*- from setuptools import setup, find_packages setup(name='pymorph', version='0.88', description='Image Morphology Toolbox', author='Luís Pedro Coelho', author_email='lpc@mcu.edu', url='http://luispedro.org/pymorph/', packages=find_packages(), )
Make this into a python package git-svn-id: d22b6ed1b13e3e3451c5d6fab7d0adc235b2f27e@51 5128b7d6-d249-4073-bd28-aebf1259cb0a# -*- coding: utf-8 -*- from setuptools import setup, find_packages setup(name='pymorph', version='0.88', description='Image Morphology Toolbox', author='Luís Pedro Coelho', ...
<commit_before><commit_msg>Make this into a python package git-svn-id: d22b6ed1b13e3e3451c5d6fab7d0adc235b2f27e@51 5128b7d6-d249-4073-bd28-aebf1259cb0a<commit_after># -*- coding: utf-8 -*- from setuptools import setup, find_packages setup(name='pymorph', version='0.88', description='Image Morphology Toolb...
7d6fa5dda38dbac5c1b694f8b0d72901087be6f4
candidates/election_specific.py
candidates/election_specific.py
from django.conf import settings # This is actually taken from Pombola's country-specific code package # in pombola/country/__init__.py. You should add to this list anything # country-specific you want to be available through an import from # candidates.election_specific imports_and_defaults = [] # Note that one cou...
Add a module for election-specific functions
Add a module for election-specific functions This gives us an extra mechanism for customizing behaviour for different elections.
Python
agpl-3.0
datamade/yournextmp-popit,openstate/yournextrepresentative,openstate/yournextrepresentative,mysociety/yournextrepresentative,neavouli/yournextrepresentative,neavouli/yournextrepresentative,mysociety/yournextmp-popit,datamade/yournextmp-popit,mysociety/yournextrepresentative,openstate/yournextrepresentative,YoQuieroSabe...
Add a module for election-specific functions This gives us an extra mechanism for customizing behaviour for different elections.
from django.conf import settings # This is actually taken from Pombola's country-specific code package # in pombola/country/__init__.py. You should add to this list anything # country-specific you want to be available through an import from # candidates.election_specific imports_and_defaults = [] # Note that one cou...
<commit_before><commit_msg>Add a module for election-specific functions This gives us an extra mechanism for customizing behaviour for different elections.<commit_after>
from django.conf import settings # This is actually taken from Pombola's country-specific code package # in pombola/country/__init__.py. You should add to this list anything # country-specific you want to be available through an import from # candidates.election_specific imports_and_defaults = [] # Note that one cou...
Add a module for election-specific functions This gives us an extra mechanism for customizing behaviour for different elections.from django.conf import settings # This is actually taken from Pombola's country-specific code package # in pombola/country/__init__.py. You should add to this list anything # country-specif...
<commit_before><commit_msg>Add a module for election-specific functions This gives us an extra mechanism for customizing behaviour for different elections.<commit_after>from django.conf import settings # This is actually taken from Pombola's country-specific code package # in pombola/country/__init__.py. You should a...
370cc8fb0b22c122e17ef23cd5c71c4531352609
migrations/versions/62d4d27afcf_.py
migrations/versions/62d4d27afcf_.py
"""empty message Revision ID: 62d4d27afcf Revises: 453729c2bc21 Create Date: 2014-11-03 14:52:53.884479 """ # revision identifiers, used by Alembic. revision = '62d4d27afcf' down_revision = '453729c2bc21' from alembic import op import sqlalchemy as sa def upgrade(): ### commands auto generated by Alembic - pl...
Add migration to add selected_texts_json column.
Add migration to add selected_texts_json column.
Python
bsd-3-clause
dlarochelle/extractor_train,dlarochelle/extractor_train,dlarochelle/extractor_train
Add migration to add selected_texts_json column.
"""empty message Revision ID: 62d4d27afcf Revises: 453729c2bc21 Create Date: 2014-11-03 14:52:53.884479 """ # revision identifiers, used by Alembic. revision = '62d4d27afcf' down_revision = '453729c2bc21' from alembic import op import sqlalchemy as sa def upgrade(): ### commands auto generated by Alembic - pl...
<commit_before><commit_msg>Add migration to add selected_texts_json column.<commit_after>
"""empty message Revision ID: 62d4d27afcf Revises: 453729c2bc21 Create Date: 2014-11-03 14:52:53.884479 """ # revision identifiers, used by Alembic. revision = '62d4d27afcf' down_revision = '453729c2bc21' from alembic import op import sqlalchemy as sa def upgrade(): ### commands auto generated by Alembic - pl...
Add migration to add selected_texts_json column."""empty message Revision ID: 62d4d27afcf Revises: 453729c2bc21 Create Date: 2014-11-03 14:52:53.884479 """ # revision identifiers, used by Alembic. revision = '62d4d27afcf' down_revision = '453729c2bc21' from alembic import op import sqlalchemy as sa def upgrade():...
<commit_before><commit_msg>Add migration to add selected_texts_json column.<commit_after>"""empty message Revision ID: 62d4d27afcf Revises: 453729c2bc21 Create Date: 2014-11-03 14:52:53.884479 """ # revision identifiers, used by Alembic. revision = '62d4d27afcf' down_revision = '453729c2bc21' from alembic import op...
da97cd5378e849de9c0bfc959186db5564e04cfa
osbrain/tests/test_agentaddress.py
osbrain/tests/test_agentaddress.py
import pytest import zmq from osbrain.core import AgentAddressKind from osbrain.core import AgentAddressRole def twin_list(elements): result = elements[:] result[1::2] = elements[::2] result[::2] = elements[1::2] return result def test_kind(): """ This test aims to cover basic AgentAddressK...
Add tests for AgentAddressRole and AgentAddressKind classes
Add tests for AgentAddressRole and AgentAddressKind classes
Python
apache-2.0
opensistemas-hub/osbrain
Add tests for AgentAddressRole and AgentAddressKind classes
import pytest import zmq from osbrain.core import AgentAddressKind from osbrain.core import AgentAddressRole def twin_list(elements): result = elements[:] result[1::2] = elements[::2] result[::2] = elements[1::2] return result def test_kind(): """ This test aims to cover basic AgentAddressK...
<commit_before><commit_msg>Add tests for AgentAddressRole and AgentAddressKind classes<commit_after>
import pytest import zmq from osbrain.core import AgentAddressKind from osbrain.core import AgentAddressRole def twin_list(elements): result = elements[:] result[1::2] = elements[::2] result[::2] = elements[1::2] return result def test_kind(): """ This test aims to cover basic AgentAddressK...
Add tests for AgentAddressRole and AgentAddressKind classesimport pytest import zmq from osbrain.core import AgentAddressKind from osbrain.core import AgentAddressRole def twin_list(elements): result = elements[:] result[1::2] = elements[::2] result[::2] = elements[1::2] return result def test_kind...
<commit_before><commit_msg>Add tests for AgentAddressRole and AgentAddressKind classes<commit_after>import pytest import zmq from osbrain.core import AgentAddressKind from osbrain.core import AgentAddressRole def twin_list(elements): result = elements[:] result[1::2] = elements[::2] result[::2] = element...
7d9b6a55ddcccc2449831f081247d697773a9aa6
common/djangoapps/student/management/commands/transfer_students.py
common/djangoapps/student/management/commands/transfer_students.py
from optparse import make_option from django.core.management.base import BaseCommand from django.contrib.auth.models import User from student.models import CourseEnrollment from shoppingcart.models import CertificateItem class Command(BaseCommand): help = """ This command takes two course ids as input and tra...
Add a command to transfer students from one course to another.
Add a command to transfer students from one course to another. Move only active students and also update cert item for verified students.
Python
agpl-3.0
peterm-itr/edx-platform,SravanthiSinha/edx-platform,Edraak/edx-platform,eestay/edx-platform,LICEF/edx-platform,ahmedaljazzar/edx-platform,TeachAtTUM/edx-platform,cselis86/edx-platform,openfun/edx-platform,bitifirefly/edx-platform,dsajkl/reqiop,jazztpt/edx-platform,ak2703/edx-platform,kursitet/edx-platform,motion2015/ed...
Add a command to transfer students from one course to another. Move only active students and also update cert item for verified students.
from optparse import make_option from django.core.management.base import BaseCommand from django.contrib.auth.models import User from student.models import CourseEnrollment from shoppingcart.models import CertificateItem class Command(BaseCommand): help = """ This command takes two course ids as input and tra...
<commit_before><commit_msg>Add a command to transfer students from one course to another. Move only active students and also update cert item for verified students.<commit_after>
from optparse import make_option from django.core.management.base import BaseCommand from django.contrib.auth.models import User from student.models import CourseEnrollment from shoppingcart.models import CertificateItem class Command(BaseCommand): help = """ This command takes two course ids as input and tra...
Add a command to transfer students from one course to another. Move only active students and also update cert item for verified students.from optparse import make_option from django.core.management.base import BaseCommand from django.contrib.auth.models import User from student.models import CourseEnrollment from shop...
<commit_before><commit_msg>Add a command to transfer students from one course to another. Move only active students and also update cert item for verified students.<commit_after>from optparse import make_option from django.core.management.base import BaseCommand from django.contrib.auth.models import User from student...
ccdcb20abc5f0f33ab60d4fa976a8b4bd856bb0e
datascripts/get_PHX_city.py
datascripts/get_PHX_city.py
import json import pymysql def GetReviewsByID(business_id): conn = pymysql.Connect(host='localhost', user='root', passwd='',charset='utf8', db='yelpdb') cursor = conn.cursor() cursor.execute( "SELECT stars, date FROM review WHERE business_id = %s", business_id ) conn.commit() result = cursor.fet...
Add script to get all Phoenix City data
Add script to get all Phoenix City data
Python
mit
zhewang/restauranthunter,zhewang/restauranthunter,zhewang/restauranthunter
Add script to get all Phoenix City data
import json import pymysql def GetReviewsByID(business_id): conn = pymysql.Connect(host='localhost', user='root', passwd='',charset='utf8', db='yelpdb') cursor = conn.cursor() cursor.execute( "SELECT stars, date FROM review WHERE business_id = %s", business_id ) conn.commit() result = cursor.fet...
<commit_before><commit_msg>Add script to get all Phoenix City data<commit_after>
import json import pymysql def GetReviewsByID(business_id): conn = pymysql.Connect(host='localhost', user='root', passwd='',charset='utf8', db='yelpdb') cursor = conn.cursor() cursor.execute( "SELECT stars, date FROM review WHERE business_id = %s", business_id ) conn.commit() result = cursor.fet...
Add script to get all Phoenix City dataimport json import pymysql def GetReviewsByID(business_id): conn = pymysql.Connect(host='localhost', user='root', passwd='',charset='utf8', db='yelpdb') cursor = conn.cursor() cursor.execute( "SELECT stars, date FROM review WHERE business_id = %s", business_id ) ...
<commit_before><commit_msg>Add script to get all Phoenix City data<commit_after>import json import pymysql def GetReviewsByID(business_id): conn = pymysql.Connect(host='localhost', user='root', passwd='',charset='utf8', db='yelpdb') cursor = conn.cursor() cursor.execute( "SELECT stars, date FROM review W...
110ce926fa0e460640f3e674623475144f847dbe
forge.py
forge.py
# Generate known SiRF binary data for testing purposes import sys, struct, math def nul(n): return chr(0) * n def frame(mid, body): payload = chr(mid) + body n = len(payload) assert(n < (1 << 11)) xsum = sum(ord(b) for b in payload) & 0xFFFF header = '\xA0\xA2' + chr(n >> 8) + chr(n & 0xFF) ...
Add script to generate SiRF data for testing
Add script to generate SiRF data for testing
Python
apache-2.0
tryan/sirf,tryan/sirf
Add script to generate SiRF data for testing
# Generate known SiRF binary data for testing purposes import sys, struct, math def nul(n): return chr(0) * n def frame(mid, body): payload = chr(mid) + body n = len(payload) assert(n < (1 << 11)) xsum = sum(ord(b) for b in payload) & 0xFFFF header = '\xA0\xA2' + chr(n >> 8) + chr(n & 0xFF) ...
<commit_before><commit_msg>Add script to generate SiRF data for testing<commit_after>
# Generate known SiRF binary data for testing purposes import sys, struct, math def nul(n): return chr(0) * n def frame(mid, body): payload = chr(mid) + body n = len(payload) assert(n < (1 << 11)) xsum = sum(ord(b) for b in payload) & 0xFFFF header = '\xA0\xA2' + chr(n >> 8) + chr(n & 0xFF) ...
Add script to generate SiRF data for testing# Generate known SiRF binary data for testing purposes import sys, struct, math def nul(n): return chr(0) * n def frame(mid, body): payload = chr(mid) + body n = len(payload) assert(n < (1 << 11)) xsum = sum(ord(b) for b in payload) & 0xFFFF header = '...
<commit_before><commit_msg>Add script to generate SiRF data for testing<commit_after># Generate known SiRF binary data for testing purposes import sys, struct, math def nul(n): return chr(0) * n def frame(mid, body): payload = chr(mid) + body n = len(payload) assert(n < (1 << 11)) xsum = sum(ord(b) ...
df5ba98be707df7c3ec48fae986cf702b9d5a66e
bayespy/inference/vmp/nodes/tests/test_gaussian.py
bayespy/inference/vmp/nodes/tests/test_gaussian.py
###################################################################### # Copyright (C) 2013 Jaakko Luttinen # # This file is licensed under Version 3.0 of the GNU General Public # License. See LICENSE for a text of the license. ###################################################################### ####################...
Add a simple test for Gaussian arrays node (GaussianArrayARD).
TST: Add a simple test for Gaussian arrays node (GaussianArrayARD).
Python
mit
bayespy/bayespy,fivejjs/bayespy,jluttine/bayespy,SalemAmeen/bayespy
TST: Add a simple test for Gaussian arrays node (GaussianArrayARD).
###################################################################### # Copyright (C) 2013 Jaakko Luttinen # # This file is licensed under Version 3.0 of the GNU General Public # License. See LICENSE for a text of the license. ###################################################################### ####################...
<commit_before><commit_msg>TST: Add a simple test for Gaussian arrays node (GaussianArrayARD).<commit_after>
###################################################################### # Copyright (C) 2013 Jaakko Luttinen # # This file is licensed under Version 3.0 of the GNU General Public # License. See LICENSE for a text of the license. ###################################################################### ####################...
TST: Add a simple test for Gaussian arrays node (GaussianArrayARD).###################################################################### # Copyright (C) 2013 Jaakko Luttinen # # This file is licensed under Version 3.0 of the GNU General Public # License. See LICENSE for a text of the license. #########################...
<commit_before><commit_msg>TST: Add a simple test for Gaussian arrays node (GaussianArrayARD).<commit_after>###################################################################### # Copyright (C) 2013 Jaakko Luttinen # # This file is licensed under Version 3.0 of the GNU General Public # License. See LICENSE for a text ...
23a70b0c91aa0438027efb1907cd56eae008c0f6
comics/comics/kalscartoon.py
comics/comics/kalscartoon.py
from dateutil.parser import parse from comics.aggregator.crawler import CrawlerBase, CrawlerResult from comics.meta.base import MetaBase class Meta(MetaBase): name = "KAL's Cartoon" language = 'en' url = 'http://www.economist.com' start_date = '2006-01-05' rights = 'Kevin Kallaugher' class Crawle...
Add crawler for KAL's cartoon
Add crawler for KAL's cartoon
Python
agpl-3.0
jodal/comics,datagutten/comics,jodal/comics,datagutten/comics,jodal/comics,datagutten/comics,klette/comics,klette/comics,datagutten/comics,jodal/comics,klette/comics
Add crawler for KAL's cartoon
from dateutil.parser import parse from comics.aggregator.crawler import CrawlerBase, CrawlerResult from comics.meta.base import MetaBase class Meta(MetaBase): name = "KAL's Cartoon" language = 'en' url = 'http://www.economist.com' start_date = '2006-01-05' rights = 'Kevin Kallaugher' class Crawle...
<commit_before><commit_msg>Add crawler for KAL's cartoon<commit_after>
from dateutil.parser import parse from comics.aggregator.crawler import CrawlerBase, CrawlerResult from comics.meta.base import MetaBase class Meta(MetaBase): name = "KAL's Cartoon" language = 'en' url = 'http://www.economist.com' start_date = '2006-01-05' rights = 'Kevin Kallaugher' class Crawle...
Add crawler for KAL's cartoonfrom dateutil.parser import parse from comics.aggregator.crawler import CrawlerBase, CrawlerResult from comics.meta.base import MetaBase class Meta(MetaBase): name = "KAL's Cartoon" language = 'en' url = 'http://www.economist.com' start_date = '2006-01-05' rights = 'Ke...
<commit_before><commit_msg>Add crawler for KAL's cartoon<commit_after>from dateutil.parser import parse from comics.aggregator.crawler import CrawlerBase, CrawlerResult from comics.meta.base import MetaBase class Meta(MetaBase): name = "KAL's Cartoon" language = 'en' url = 'http://www.economist.com' s...
6679bc398dc65b161895a1d1c5556eca38c398ba
mozillians/users/migrations/0040_auto_20180920_0954.py
mozillians/users/migrations/0040_auto_20180920_0954.py
# -*- coding: utf-8 -*- # Generated by Django 1.11.15 on 2018-09-20 16:54 from __future__ import unicode_literals from django.db import migrations def set_primary_auth0_user_id(apps, schema_editor): IdpProfile = apps.get_model('users', 'IdpProfile') for idp in IdpProfile.objects.all(): if idp.primar...
Migrate Auth0 data from Idp to UserProfiles.
Migrate Auth0 data from Idp to UserProfiles.
Python
bsd-3-clause
mozilla/mozillians,akatsoulas/mozillians,mozilla/mozillians,mozilla/mozillians,mozilla/mozillians,akatsoulas/mozillians,akatsoulas/mozillians,akatsoulas/mozillians
Migrate Auth0 data from Idp to UserProfiles.
# -*- coding: utf-8 -*- # Generated by Django 1.11.15 on 2018-09-20 16:54 from __future__ import unicode_literals from django.db import migrations def set_primary_auth0_user_id(apps, schema_editor): IdpProfile = apps.get_model('users', 'IdpProfile') for idp in IdpProfile.objects.all(): if idp.primar...
<commit_before><commit_msg>Migrate Auth0 data from Idp to UserProfiles.<commit_after>
# -*- coding: utf-8 -*- # Generated by Django 1.11.15 on 2018-09-20 16:54 from __future__ import unicode_literals from django.db import migrations def set_primary_auth0_user_id(apps, schema_editor): IdpProfile = apps.get_model('users', 'IdpProfile') for idp in IdpProfile.objects.all(): if idp.primar...
Migrate Auth0 data from Idp to UserProfiles.# -*- coding: utf-8 -*- # Generated by Django 1.11.15 on 2018-09-20 16:54 from __future__ import unicode_literals from django.db import migrations def set_primary_auth0_user_id(apps, schema_editor): IdpProfile = apps.get_model('users', 'IdpProfile') for idp in Idp...
<commit_before><commit_msg>Migrate Auth0 data from Idp to UserProfiles.<commit_after># -*- coding: utf-8 -*- # Generated by Django 1.11.15 on 2018-09-20 16:54 from __future__ import unicode_literals from django.db import migrations def set_primary_auth0_user_id(apps, schema_editor): IdpProfile = apps.get_model('...
fd8dcaa25fe2f9a14bfe64851554903cfb6976e1
pdc/apps/release/migrations/0007_add_release_variant_type_module.py
pdc/apps/release/migrations/0007_add_release_variant_type_module.py
# -*- coding: utf-8 -*- # # Copyright (c) 2016 Red Hat # Licensed under The MIT License (MIT) # http://opensource.org/licenses/MIT # from __future__ import unicode_literals from django.db import models, migrations def create_variant_type_module(apps, schema_editor): VariantType = apps.get_model('release', 'Varia...
Add release variant type 'module'
Add release variant type 'module' Signed-off-by: Nils Philippsen <ad3fa8d847df2b57853a376ad688e4be8041ecd4@redhat.com>
Python
mit
release-engineering/product-definition-center,product-definition-center/product-definition-center,product-definition-center/product-definition-center,product-definition-center/product-definition-center,product-definition-center/product-definition-center,release-engineering/product-definition-center,release-engineering/...
Add release variant type 'module' Signed-off-by: Nils Philippsen <ad3fa8d847df2b57853a376ad688e4be8041ecd4@redhat.com>
# -*- coding: utf-8 -*- # # Copyright (c) 2016 Red Hat # Licensed under The MIT License (MIT) # http://opensource.org/licenses/MIT # from __future__ import unicode_literals from django.db import models, migrations def create_variant_type_module(apps, schema_editor): VariantType = apps.get_model('release', 'Varia...
<commit_before><commit_msg>Add release variant type 'module' Signed-off-by: Nils Philippsen <ad3fa8d847df2b57853a376ad688e4be8041ecd4@redhat.com><commit_after>
# -*- coding: utf-8 -*- # # Copyright (c) 2016 Red Hat # Licensed under The MIT License (MIT) # http://opensource.org/licenses/MIT # from __future__ import unicode_literals from django.db import models, migrations def create_variant_type_module(apps, schema_editor): VariantType = apps.get_model('release', 'Varia...
Add release variant type 'module' Signed-off-by: Nils Philippsen <ad3fa8d847df2b57853a376ad688e4be8041ecd4@redhat.com># -*- coding: utf-8 -*- # # Copyright (c) 2016 Red Hat # Licensed under The MIT License (MIT) # http://opensource.org/licenses/MIT # from __future__ import unicode_literals from django.db import model...
<commit_before><commit_msg>Add release variant type 'module' Signed-off-by: Nils Philippsen <ad3fa8d847df2b57853a376ad688e4be8041ecd4@redhat.com><commit_after># -*- coding: utf-8 -*- # # Copyright (c) 2016 Red Hat # Licensed under The MIT License (MIT) # http://opensource.org/licenses/MIT # from __future__ import unic...
7229e8fa6bea9cf748d1e171d50aeaab69919922
misc/decode-mirax.py
misc/decode-mirax.py
#!/usr/bin/python import struct, sys f = open(sys.argv[1]) HEADER_OFFSET = 37 f.seek(HEADER_OFFSET) try: while True: n = struct.unpack("<i", f.read(4))[0] possible_lineno = (n - HEADER_OFFSET) / 4.0 if possible_lineno < 0 or int(possible_lineno) != possible_lineno: print "%1...
Add a little script to help figure out MIRAX
Add a little script to help figure out MIRAX
Python
lgpl-2.1
openslide/openslide,openslide/openslide,openslide/openslide,openslide/openslide
Add a little script to help figure out MIRAX
#!/usr/bin/python import struct, sys f = open(sys.argv[1]) HEADER_OFFSET = 37 f.seek(HEADER_OFFSET) try: while True: n = struct.unpack("<i", f.read(4))[0] possible_lineno = (n - HEADER_OFFSET) / 4.0 if possible_lineno < 0 or int(possible_lineno) != possible_lineno: print "%1...
<commit_before><commit_msg>Add a little script to help figure out MIRAX<commit_after>
#!/usr/bin/python import struct, sys f = open(sys.argv[1]) HEADER_OFFSET = 37 f.seek(HEADER_OFFSET) try: while True: n = struct.unpack("<i", f.read(4))[0] possible_lineno = (n - HEADER_OFFSET) / 4.0 if possible_lineno < 0 or int(possible_lineno) != possible_lineno: print "%1...
Add a little script to help figure out MIRAX#!/usr/bin/python import struct, sys f = open(sys.argv[1]) HEADER_OFFSET = 37 f.seek(HEADER_OFFSET) try: while True: n = struct.unpack("<i", f.read(4))[0] possible_lineno = (n - HEADER_OFFSET) / 4.0 if possible_lineno < 0 or int(possible_linen...
<commit_before><commit_msg>Add a little script to help figure out MIRAX<commit_after>#!/usr/bin/python import struct, sys f = open(sys.argv[1]) HEADER_OFFSET = 37 f.seek(HEADER_OFFSET) try: while True: n = struct.unpack("<i", f.read(4))[0] possible_lineno = (n - HEADER_OFFSET) / 4.0 if ...
96280e7c1d6b8f705d6dfbc1fac3d379acbd0b04
utils.py
utils.py
import numpy as np def overwrite_labels(y): classes = np.unique(y) y[y==classes[0]] = -1 y[y==classes[1]] = 1 return y
Add utility functions for tests
Add utility functions for tests
Python
mit
IshitaTakeshi/SCW
Add utility functions for tests
import numpy as np def overwrite_labels(y): classes = np.unique(y) y[y==classes[0]] = -1 y[y==classes[1]] = 1 return y
<commit_before><commit_msg>Add utility functions for tests<commit_after>
import numpy as np def overwrite_labels(y): classes = np.unique(y) y[y==classes[0]] = -1 y[y==classes[1]] = 1 return y
Add utility functions for testsimport numpy as np def overwrite_labels(y): classes = np.unique(y) y[y==classes[0]] = -1 y[y==classes[1]] = 1 return y
<commit_before><commit_msg>Add utility functions for tests<commit_after>import numpy as np def overwrite_labels(y): classes = np.unique(y) y[y==classes[0]] = -1 y[y==classes[1]] = 1 return y
8ddca17d5b0e4b8b683b596af2f99938d0977401
demo_tests.py
demo_tests.py
# This is an example unit test suite for creating an AI from game import GameRunner, Board, Player from demo import BattleshipsAI from unittest import TestCase class TestPlayer(Player): """ Mock Player which records ships placed and shots taken """ def __init__(self): super(TestPlayer, self).__init__()...
Add very simple demo unit tests
Add very simple demo unit tests
Python
mit
southampton-code-dojo/battleships,southampton-code-dojo/battleships,southampton-code-dojo/battleships,southampton-code-dojo/battleships
Add very simple demo unit tests
# This is an example unit test suite for creating an AI from game import GameRunner, Board, Player from demo import BattleshipsAI from unittest import TestCase class TestPlayer(Player): """ Mock Player which records ships placed and shots taken """ def __init__(self): super(TestPlayer, self).__init__()...
<commit_before><commit_msg>Add very simple demo unit tests<commit_after>
# This is an example unit test suite for creating an AI from game import GameRunner, Board, Player from demo import BattleshipsAI from unittest import TestCase class TestPlayer(Player): """ Mock Player which records ships placed and shots taken """ def __init__(self): super(TestPlayer, self).__init__()...
Add very simple demo unit tests# This is an example unit test suite for creating an AI from game import GameRunner, Board, Player from demo import BattleshipsAI from unittest import TestCase class TestPlayer(Player): """ Mock Player which records ships placed and shots taken """ def __init__(self): sup...
<commit_before><commit_msg>Add very simple demo unit tests<commit_after># This is an example unit test suite for creating an AI from game import GameRunner, Board, Player from demo import BattleshipsAI from unittest import TestCase class TestPlayer(Player): """ Mock Player which records ships placed and shots take...
df494797db7b4c9d62a7ef64fea74c7a231f35bd
func_utils.py
func_utils.py
''' Function helper functions. by Craig Buchek These took a lot of trial and error to get right, but seem to be working well now. I read through a lot of various other attempts to implement these (separately). I don't claim to understand Python decorators well - just well enough to get these to work like I wanted. ''...
Add @memoized_property and @memoized_class_property decorators.
Add @memoized_property and @memoized_class_property decorators.
Python
mit
booch/python-utils
Add @memoized_property and @memoized_class_property decorators.
''' Function helper functions. by Craig Buchek These took a lot of trial and error to get right, but seem to be working well now. I read through a lot of various other attempts to implement these (separately). I don't claim to understand Python decorators well - just well enough to get these to work like I wanted. ''...
<commit_before><commit_msg>Add @memoized_property and @memoized_class_property decorators.<commit_after>
''' Function helper functions. by Craig Buchek These took a lot of trial and error to get right, but seem to be working well now. I read through a lot of various other attempts to implement these (separately). I don't claim to understand Python decorators well - just well enough to get these to work like I wanted. ''...
Add @memoized_property and @memoized_class_property decorators.''' Function helper functions. by Craig Buchek These took a lot of trial and error to get right, but seem to be working well now. I read through a lot of various other attempts to implement these (separately). I don't claim to understand Python decorators...
<commit_before><commit_msg>Add @memoized_property and @memoized_class_property decorators.<commit_after>''' Function helper functions. by Craig Buchek These took a lot of trial and error to get right, but seem to be working well now. I read through a lot of various other attempts to implement these (separately). I do...
3c9b592b8b41302953c13bc0ef46b979a751fafb
test/Incremental/gen-output-file-map.py
test/Incremental/gen-output-file-map.py
#!/usr/bin/env python from __future__ import print_function import argparse import json import os import sys def fatal(msg): print(msg, file=sys.stderr) sys.exit(1) def find_swift_files(path): for parent, dirs, files in os.walk(path, topdown=True): for filename in files: if not fil...
Add a utility for generating simple output file maps
[Incremental] Add a utility for generating simple output file maps
Python
apache-2.0
atrick/swift,glessard/swift,tkremenek/swift,parkera/swift,stephentyrone/swift,JGiola/swift,atrick/swift,roambotics/swift,glessard/swift,jckarter/swift,apple/swift,hooman/swift,aschwaighofer/swift,harlanhaskins/swift,allevato/swift,harlanhaskins/swift,jmgc/swift,jckarter/swift,harlanhaskins/swift,airspeedswift/swift,nat...
[Incremental] Add a utility for generating simple output file maps
#!/usr/bin/env python from __future__ import print_function import argparse import json import os import sys def fatal(msg): print(msg, file=sys.stderr) sys.exit(1) def find_swift_files(path): for parent, dirs, files in os.walk(path, topdown=True): for filename in files: if not fil...
<commit_before><commit_msg>[Incremental] Add a utility for generating simple output file maps<commit_after>
#!/usr/bin/env python from __future__ import print_function import argparse import json import os import sys def fatal(msg): print(msg, file=sys.stderr) sys.exit(1) def find_swift_files(path): for parent, dirs, files in os.walk(path, topdown=True): for filename in files: if not fil...
[Incremental] Add a utility for generating simple output file maps#!/usr/bin/env python from __future__ import print_function import argparse import json import os import sys def fatal(msg): print(msg, file=sys.stderr) sys.exit(1) def find_swift_files(path): for parent, dirs, files in os.walk(path, to...
<commit_before><commit_msg>[Incremental] Add a utility for generating simple output file maps<commit_after>#!/usr/bin/env python from __future__ import print_function import argparse import json import os import sys def fatal(msg): print(msg, file=sys.stderr) sys.exit(1) def find_swift_files(path): fo...
34d64cc5eaf5db73791d8b21d58c58bc8c1f3fff
greenfan/management/commands/wait-for-non-build-nodes.py
greenfan/management/commands/wait-for-non-build-nodes.py
# # Copyright 2012 Cisco Systems, Inc. # # Author: Soren Hansen <sorhanse@cisco.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/LICENSE...
Add script to wait for puppet run to finish on non-build-nodes
Add script to wait for puppet run to finish on non-build-nodes
Python
apache-2.0
sorenh/python-django-greenfan,sorenh/python-django-greenfan
Add script to wait for puppet run to finish on non-build-nodes
# # Copyright 2012 Cisco Systems, Inc. # # Author: Soren Hansen <sorhanse@cisco.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/LICENSE...
<commit_before><commit_msg>Add script to wait for puppet run to finish on non-build-nodes<commit_after>
# # Copyright 2012 Cisco Systems, Inc. # # Author: Soren Hansen <sorhanse@cisco.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/LICENSE...
Add script to wait for puppet run to finish on non-build-nodes# # Copyright 2012 Cisco Systems, Inc. # # Author: Soren Hansen <sorhanse@cisco.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 t...
<commit_before><commit_msg>Add script to wait for puppet run to finish on non-build-nodes<commit_after># # Copyright 2012 Cisco Systems, Inc. # # Author: Soren Hansen <sorhanse@cisco.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with th...
aaa9f661554121ec545763664d09431f3ae529b1
benchexec/tools/btor2c.py
benchexec/tools/btor2c.py
# This file is part of BenchExec, a framework for reliable benchmarking: # https://github.com/sosy-lab/benchexec # # SPDX-FileCopyrightText: 2007-2020 Dirk Beyer <https://www.sosy-lab.org> # # SPDX-License-Identifier: Apache-2.0 import logging import benchexec.tools.template class Tool(benchexec.tools.template.Base...
Add a tool-info module for BTOR2C
Add a tool-info module for BTOR2C - BTOR2C is a converter from BTOR2 models to C programs
Python
apache-2.0
ultimate-pa/benchexec,ultimate-pa/benchexec,sosy-lab/benchexec,ultimate-pa/benchexec,sosy-lab/benchexec,sosy-lab/benchexec,sosy-lab/benchexec,sosy-lab/benchexec,ultimate-pa/benchexec,sosy-lab/benchexec,ultimate-pa/benchexec,ultimate-pa/benchexec
Add a tool-info module for BTOR2C - BTOR2C is a converter from BTOR2 models to C programs
# This file is part of BenchExec, a framework for reliable benchmarking: # https://github.com/sosy-lab/benchexec # # SPDX-FileCopyrightText: 2007-2020 Dirk Beyer <https://www.sosy-lab.org> # # SPDX-License-Identifier: Apache-2.0 import logging import benchexec.tools.template class Tool(benchexec.tools.template.Base...
<commit_before><commit_msg>Add a tool-info module for BTOR2C - BTOR2C is a converter from BTOR2 models to C programs<commit_after>
# This file is part of BenchExec, a framework for reliable benchmarking: # https://github.com/sosy-lab/benchexec # # SPDX-FileCopyrightText: 2007-2020 Dirk Beyer <https://www.sosy-lab.org> # # SPDX-License-Identifier: Apache-2.0 import logging import benchexec.tools.template class Tool(benchexec.tools.template.Base...
Add a tool-info module for BTOR2C - BTOR2C is a converter from BTOR2 models to C programs# This file is part of BenchExec, a framework for reliable benchmarking: # https://github.com/sosy-lab/benchexec # # SPDX-FileCopyrightText: 2007-2020 Dirk Beyer <https://www.sosy-lab.org> # # SPDX-License-Identifier: Apache-2.0 ...
<commit_before><commit_msg>Add a tool-info module for BTOR2C - BTOR2C is a converter from BTOR2 models to C programs<commit_after># This file is part of BenchExec, a framework for reliable benchmarking: # https://github.com/sosy-lab/benchexec # # SPDX-FileCopyrightText: 2007-2020 Dirk Beyer <https://www.sosy-lab.org> ...
89278de3f74bbb18d62b90b909d26bd7ef7c156c
src/python/utils.py
src/python/utils.py
def quiet_logs(sc): logger = sc._jvm.org.apache.log4j logger.LogManager.getLogger("org").setLevel(logger.Level.ERROR) logger.LogManager.getLogger("akka").setLevel(logger.Level.ERROR)
Move quiet_logs to separate module
Move quiet_logs to separate module
Python
apache-2.0
project-asap/telecom-analytics,project-asap/telecom-analytics
Move quiet_logs to separate module
def quiet_logs(sc): logger = sc._jvm.org.apache.log4j logger.LogManager.getLogger("org").setLevel(logger.Level.ERROR) logger.LogManager.getLogger("akka").setLevel(logger.Level.ERROR)
<commit_before><commit_msg>Move quiet_logs to separate module<commit_after>
def quiet_logs(sc): logger = sc._jvm.org.apache.log4j logger.LogManager.getLogger("org").setLevel(logger.Level.ERROR) logger.LogManager.getLogger("akka").setLevel(logger.Level.ERROR)
Move quiet_logs to separate moduledef quiet_logs(sc): logger = sc._jvm.org.apache.log4j logger.LogManager.getLogger("org").setLevel(logger.Level.ERROR) logger.LogManager.getLogger("akka").setLevel(logger.Level.ERROR)
<commit_before><commit_msg>Move quiet_logs to separate module<commit_after>def quiet_logs(sc): logger = sc._jvm.org.apache.log4j logger.LogManager.getLogger("org").setLevel(logger.Level.ERROR) logger.LogManager.getLogger("akka").setLevel(logger.Level.ERROR)
b819d08c5df0063e691f7b675937ef2d9d7d23bc
examples/python/download_packages_with_fastestmirror.py
examples/python/download_packages_with_fastestmirror.py
#!/usr/bin/env python """ librepo - download packages """ import os import os.path import time import librepo CACHE = "fastestmirror.cache" LIBREPOPKG = "librepo-1.2.1-2.fc20.x86_64.rpm" LAMEPKG = "lame-3.99.5-2.fc19.x86_64.rpm" if __name__ == "__main__": # Setup logging def debug_function(msg, _): ...
Add usage example of LRO_FASTESTMIRRORCACHE
example: Add usage example of LRO_FASTESTMIRRORCACHE
Python
lgpl-2.1
Tojaj/librepo,rpm-software-management/librepo,bgamari/librepo,rholy/librepo,cgwalters/librepo,Conan-Kudo/librepo,cgwalters/librepo,rpm-software-management/librepo,Conan-Kudo/librepo,bgamari/librepo,cgwalters/librepo,rholy/librepo,Conan-Kudo/librepo,rholy/librepo,bgamari/librepo,Tojaj/librepo,rholy/librepo,Tojaj/librepo...
example: Add usage example of LRO_FASTESTMIRRORCACHE
#!/usr/bin/env python """ librepo - download packages """ import os import os.path import time import librepo CACHE = "fastestmirror.cache" LIBREPOPKG = "librepo-1.2.1-2.fc20.x86_64.rpm" LAMEPKG = "lame-3.99.5-2.fc19.x86_64.rpm" if __name__ == "__main__": # Setup logging def debug_function(msg, _): ...
<commit_before><commit_msg>example: Add usage example of LRO_FASTESTMIRRORCACHE<commit_after>
#!/usr/bin/env python """ librepo - download packages """ import os import os.path import time import librepo CACHE = "fastestmirror.cache" LIBREPOPKG = "librepo-1.2.1-2.fc20.x86_64.rpm" LAMEPKG = "lame-3.99.5-2.fc19.x86_64.rpm" if __name__ == "__main__": # Setup logging def debug_function(msg, _): ...
example: Add usage example of LRO_FASTESTMIRRORCACHE#!/usr/bin/env python """ librepo - download packages """ import os import os.path import time import librepo CACHE = "fastestmirror.cache" LIBREPOPKG = "librepo-1.2.1-2.fc20.x86_64.rpm" LAMEPKG = "lame-3.99.5-2.fc19.x86_64.rpm" if __name__ == "__main__": # ...
<commit_before><commit_msg>example: Add usage example of LRO_FASTESTMIRRORCACHE<commit_after>#!/usr/bin/env python """ librepo - download packages """ import os import os.path import time import librepo CACHE = "fastestmirror.cache" LIBREPOPKG = "librepo-1.2.1-2.fc20.x86_64.rpm" LAMEPKG = "lame-3.99.5-2.fc19.x86_64...
b757a22bd16ff94c20eb5831acdfd74824fd8a0a
nb_classifier.py
nb_classifier.py
from feature_format import featureFormat, targetFeatureSplit import pickle from sklearn.naive_bayes import GaussianNB # loading the enron data dictionary with open("final_project_dataset.pkl", "r") as data_file: data_dict = pickle.load(data_file) # removing 'TOTAL' outlier del data_dict['TOTAL'] # selecting only...
Create first pass Gaussian Naive Bayes Classifer
feat: Create first pass Gaussian Naive Bayes Classifer
Python
mit
rjegankumar/enron_email_fraud_identification
feat: Create first pass Gaussian Naive Bayes Classifer
from feature_format import featureFormat, targetFeatureSplit import pickle from sklearn.naive_bayes import GaussianNB # loading the enron data dictionary with open("final_project_dataset.pkl", "r") as data_file: data_dict = pickle.load(data_file) # removing 'TOTAL' outlier del data_dict['TOTAL'] # selecting only...
<commit_before><commit_msg>feat: Create first pass Gaussian Naive Bayes Classifer<commit_after>
from feature_format import featureFormat, targetFeatureSplit import pickle from sklearn.naive_bayes import GaussianNB # loading the enron data dictionary with open("final_project_dataset.pkl", "r") as data_file: data_dict = pickle.load(data_file) # removing 'TOTAL' outlier del data_dict['TOTAL'] # selecting only...
feat: Create first pass Gaussian Naive Bayes Classiferfrom feature_format import featureFormat, targetFeatureSplit import pickle from sklearn.naive_bayes import GaussianNB # loading the enron data dictionary with open("final_project_dataset.pkl", "r") as data_file: data_dict = pickle.load(data_file) # removing 'T...
<commit_before><commit_msg>feat: Create first pass Gaussian Naive Bayes Classifer<commit_after>from feature_format import featureFormat, targetFeatureSplit import pickle from sklearn.naive_bayes import GaussianNB # loading the enron data dictionary with open("final_project_dataset.pkl", "r") as data_file: data_dic...
3a5975852a1b751c018e56bd3f2edadb48bbbcbd
scripts/migrate_piwik_base_nodes.py
scripts/migrate_piwik_base_nodes.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """Update Piwik for nodes that were forked, registered or templated prior to October 2014. """ import datetime import logging import sys import time from modularodm import Q from framework.analytics.piwik import _update_node_object from scripts import utils as scripts_ut...
Add migration for nodes which may have previous shared a piwik_site_id
Add migration for nodes which may have previous shared a piwik_site_id
Python
apache-2.0
leb2dg/osf.io,leb2dg/osf.io,fabianvf/osf.io,MerlinZhang/osf.io,reinaH/osf.io,arpitar/osf.io,himanshuo/osf.io,CenterForOpenScience/osf.io,hmoco/osf.io,cslzchen/osf.io,DanielSBrown/osf.io,Nesiehr/osf.io,kch8qx/osf.io,cosenal/osf.io,Nesiehr/osf.io,reinaH/osf.io,monikagrabowska/osf.io,jmcarp/osf.io,caneruguz/osf.io,Halcyon...
Add migration for nodes which may have previous shared a piwik_site_id
#!/usr/bin/env python # -*- coding: utf-8 -*- """Update Piwik for nodes that were forked, registered or templated prior to October 2014. """ import datetime import logging import sys import time from modularodm import Q from framework.analytics.piwik import _update_node_object from scripts import utils as scripts_ut...
<commit_before><commit_msg>Add migration for nodes which may have previous shared a piwik_site_id<commit_after>
#!/usr/bin/env python # -*- coding: utf-8 -*- """Update Piwik for nodes that were forked, registered or templated prior to October 2014. """ import datetime import logging import sys import time from modularodm import Q from framework.analytics.piwik import _update_node_object from scripts import utils as scripts_ut...
Add migration for nodes which may have previous shared a piwik_site_id#!/usr/bin/env python # -*- coding: utf-8 -*- """Update Piwik for nodes that were forked, registered or templated prior to October 2014. """ import datetime import logging import sys import time from modularodm import Q from framework.analytics.pi...
<commit_before><commit_msg>Add migration for nodes which may have previous shared a piwik_site_id<commit_after>#!/usr/bin/env python # -*- coding: utf-8 -*- """Update Piwik for nodes that were forked, registered or templated prior to October 2014. """ import datetime import logging import sys import time from modular...
2fe04ba1d96b25f26a2651fe74a6271fe5991bb2
migrations/versions/cf62ec87d973_agency_description_to_agency_request_.py
migrations/versions/cf62ec87d973_agency_description_to_agency_request_.py
"""agency_description to agency_request_summary Revision ID: cf62ec87d973 Revises: 971f341c0204 Create Date: 2017-05-31 16:29:17.341283 """ # revision identifiers, used by Alembic. revision = 'cf62ec87d973' down_revision = '971f341c0204' from alembic import op import sqlalchemy as sa from sqlalchemy.dialects import...
Add Database Migration for Column Rename
Add Database Migration for Column Rename Migrate the column `requests.agency_description` to `requests.agency_request_summary` and `requests.agency_description_release_date` to `requests.agency_request_summary_release_date` Signed-off-by: Joel Castillo <877468732c93e7fff2a7305e99430be238218100@records.nyc.gov>
Python
apache-2.0
CityOfNewYork/NYCOpenRecords,CityOfNewYork/NYCOpenRecords,CityOfNewYork/NYCOpenRecords,CityOfNewYork/NYCOpenRecords,CityOfNewYork/NYCOpenRecords
Add Database Migration for Column Rename Migrate the column `requests.agency_description` to `requests.agency_request_summary` and `requests.agency_description_release_date` to `requests.agency_request_summary_release_date` Signed-off-by: Joel Castillo <877468732c93e7fff2a7305e99430be238218100@records.nyc.gov>
"""agency_description to agency_request_summary Revision ID: cf62ec87d973 Revises: 971f341c0204 Create Date: 2017-05-31 16:29:17.341283 """ # revision identifiers, used by Alembic. revision = 'cf62ec87d973' down_revision = '971f341c0204' from alembic import op import sqlalchemy as sa from sqlalchemy.dialects import...
<commit_before><commit_msg>Add Database Migration for Column Rename Migrate the column `requests.agency_description` to `requests.agency_request_summary` and `requests.agency_description_release_date` to `requests.agency_request_summary_release_date` Signed-off-by: Joel Castillo <877468732c93e7fff2a7305e99430be238218...
"""agency_description to agency_request_summary Revision ID: cf62ec87d973 Revises: 971f341c0204 Create Date: 2017-05-31 16:29:17.341283 """ # revision identifiers, used by Alembic. revision = 'cf62ec87d973' down_revision = '971f341c0204' from alembic import op import sqlalchemy as sa from sqlalchemy.dialects import...
Add Database Migration for Column Rename Migrate the column `requests.agency_description` to `requests.agency_request_summary` and `requests.agency_description_release_date` to `requests.agency_request_summary_release_date` Signed-off-by: Joel Castillo <877468732c93e7fff2a7305e99430be238218100@records.nyc.gov>"""agen...
<commit_before><commit_msg>Add Database Migration for Column Rename Migrate the column `requests.agency_description` to `requests.agency_request_summary` and `requests.agency_description_release_date` to `requests.agency_request_summary_release_date` Signed-off-by: Joel Castillo <877468732c93e7fff2a7305e99430be238218...
ffd2ec7f5fa7a3e422b6da7514c4596d5c3fab3c
echoclt.py
echoclt.py
#!/usr/bin/env python3.3 """Example echo client.""" # Stdlib imports. import logging import socket import sys import time # Local imports. import scheduling import sockets def echoclient(host, port): """COROUTINE""" testdata = b'hi hi hi ha ha ha\n' trans = yield from sockets.create_transport(host, port...
Add a simple echo client. (Though it has problems.)
Add a simple echo client. (Though it has problems.)
Python
apache-2.0
gsb-eng/asyncio,leetreveil/tulip,jashandeep-sohi/asyncio,Martiusweb/asyncio,leetreveil/tulip,jashandeep-sohi/asyncio,manipopopo/asyncio,Martiusweb/asyncio,leetreveil/tulip,vxgmichel/asyncio,gvanrossum/asyncio,overcastcloud/trollius,ajdavis/asyncio,gvanrossum/asyncio,haypo/trollius,jashandeep-sohi/asyncio,manipopopo/asy...
Add a simple echo client. (Though it has problems.)
#!/usr/bin/env python3.3 """Example echo client.""" # Stdlib imports. import logging import socket import sys import time # Local imports. import scheduling import sockets def echoclient(host, port): """COROUTINE""" testdata = b'hi hi hi ha ha ha\n' trans = yield from sockets.create_transport(host, port...
<commit_before><commit_msg>Add a simple echo client. (Though it has problems.)<commit_after>
#!/usr/bin/env python3.3 """Example echo client.""" # Stdlib imports. import logging import socket import sys import time # Local imports. import scheduling import sockets def echoclient(host, port): """COROUTINE""" testdata = b'hi hi hi ha ha ha\n' trans = yield from sockets.create_transport(host, port...
Add a simple echo client. (Though it has problems.)#!/usr/bin/env python3.3 """Example echo client.""" # Stdlib imports. import logging import socket import sys import time # Local imports. import scheduling import sockets def echoclient(host, port): """COROUTINE""" testdata = b'hi hi hi ha ha ha\n' tra...
<commit_before><commit_msg>Add a simple echo client. (Though it has problems.)<commit_after>#!/usr/bin/env python3.3 """Example echo client.""" # Stdlib imports. import logging import socket import sys import time # Local imports. import scheduling import sockets def echoclient(host, port): """COROUTINE""" ...
649cc8dd7cce1728db54b35bfd9cf23cbfb268e9
seq2seq/decoders/rnn_decoder.py
seq2seq/decoders/rnn_decoder.py
# Copyright 2017 Google 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 writing,...
Rename base decoder to RNN decoder
Rename base decoder to RNN decoder
Python
apache-2.0
liyi193328/seq2seq,kontact-chan/seq2seq,liyi193328/seq2seq,liyi193328/seq2seq,kontact-chan/seq2seq,google/seq2seq,chunfengh/seq2seq,shashankrajput/seq2seq,google/seq2seq,google/seq2seq,shashankrajput/seq2seq,chunfengh/seq2seq,kontact-chan/seq2seq,google/seq2seq,shashankrajput/seq2seq,chunfengh/seq2seq,liyi193328/seq2se...
Rename base decoder to RNN decoder
# Copyright 2017 Google 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 writing,...
<commit_before><commit_msg>Rename base decoder to RNN decoder<commit_after>
# Copyright 2017 Google 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 writing,...
Rename base decoder to RNN decoder# Copyright 2017 Google 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 appli...
<commit_before><commit_msg>Rename base decoder to RNN decoder<commit_after># Copyright 2017 Google 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...
3896cd4e3ea0aee0025dafef13d2f29fe168cf10
students/psbriant/final_project/test_clean_data.py
students/psbriant/final_project/test_clean_data.py
""" Name: Paul Briant Date: 12/11/16 Class: Introduction to Python Assignment: Final Project Description: Tests for Final Project """ import clean_data as cd import pandas def get_data(): """ Retrieve data from csv file to test. """ data = pandas.read_csv("data/Residential_Water_Usage_Zip_Code_on_To...
""" Name: Paul Briant Date: 12/11/16 Class: Introduction to Python Assignment: Final Project Description: Tests for Final Project """ import clean_data as cd import matplotlib.pyplot as plt import pandas import pytest def get_data(): """ Retrieve data from csv file to test. """ data = pandas.read_cs...
Create test for plot_zipcode to compare generated graphs.
Create test for plot_zipcode to compare generated graphs.
Python
unlicense
UWPCE-PythonCert/IntroPython2016,weidnem/IntroPython2016,UWPCE-PythonCert/IntroPython2016,weidnem/IntroPython2016,UWPCE-PythonCert/IntroPython2016,weidnem/IntroPython2016
""" Name: Paul Briant Date: 12/11/16 Class: Introduction to Python Assignment: Final Project Description: Tests for Final Project """ import clean_data as cd import pandas def get_data(): """ Retrieve data from csv file to test. """ data = pandas.read_csv("data/Residential_Water_Usage_Zip_Code_on_To...
""" Name: Paul Briant Date: 12/11/16 Class: Introduction to Python Assignment: Final Project Description: Tests for Final Project """ import clean_data as cd import matplotlib.pyplot as plt import pandas import pytest def get_data(): """ Retrieve data from csv file to test. """ data = pandas.read_cs...
<commit_before>""" Name: Paul Briant Date: 12/11/16 Class: Introduction to Python Assignment: Final Project Description: Tests for Final Project """ import clean_data as cd import pandas def get_data(): """ Retrieve data from csv file to test. """ data = pandas.read_csv("data/Residential_Water_Usage...
""" Name: Paul Briant Date: 12/11/16 Class: Introduction to Python Assignment: Final Project Description: Tests for Final Project """ import clean_data as cd import matplotlib.pyplot as plt import pandas import pytest def get_data(): """ Retrieve data from csv file to test. """ data = pandas.read_cs...
""" Name: Paul Briant Date: 12/11/16 Class: Introduction to Python Assignment: Final Project Description: Tests for Final Project """ import clean_data as cd import pandas def get_data(): """ Retrieve data from csv file to test. """ data = pandas.read_csv("data/Residential_Water_Usage_Zip_Code_on_To...
<commit_before>""" Name: Paul Briant Date: 12/11/16 Class: Introduction to Python Assignment: Final Project Description: Tests for Final Project """ import clean_data as cd import pandas def get_data(): """ Retrieve data from csv file to test. """ data = pandas.read_csv("data/Residential_Water_Usage...
3ebb14dfe971c135153a58edea76901a18ff6ca0
captura/test_views.py
captura/test_views.py
from django.core.urlresolvers import reverse from django.contrib.staticfiles.testing import StaticLiveServerTestCase from splinter import Browser from django.contrib.auth.models import User from perfiles_usuario.utils import CAPTURISTA_GROUP from django.contrib.auth.models import Group from estudios_socioeconomicos.mod...
Create test to dashboard capturista
Create test to dashboard capturista
Python
mit
erikiado/jp2_online,erikiado/jp2_online,erikiado/jp2_online
Create test to dashboard capturista
from django.core.urlresolvers import reverse from django.contrib.staticfiles.testing import StaticLiveServerTestCase from splinter import Browser from django.contrib.auth.models import User from perfiles_usuario.utils import CAPTURISTA_GROUP from django.contrib.auth.models import Group from estudios_socioeconomicos.mod...
<commit_before><commit_msg>Create test to dashboard capturista<commit_after>
from django.core.urlresolvers import reverse from django.contrib.staticfiles.testing import StaticLiveServerTestCase from splinter import Browser from django.contrib.auth.models import User from perfiles_usuario.utils import CAPTURISTA_GROUP from django.contrib.auth.models import Group from estudios_socioeconomicos.mod...
Create test to dashboard capturistafrom django.core.urlresolvers import reverse from django.contrib.staticfiles.testing import StaticLiveServerTestCase from splinter import Browser from django.contrib.auth.models import User from perfiles_usuario.utils import CAPTURISTA_GROUP from django.contrib.auth.models import Grou...
<commit_before><commit_msg>Create test to dashboard capturista<commit_after>from django.core.urlresolvers import reverse from django.contrib.staticfiles.testing import StaticLiveServerTestCase from splinter import Browser from django.contrib.auth.models import User from perfiles_usuario.utils import CAPTURISTA_GROUP fr...
6764ae005630053da3b02659448cbde05c682ab9
tests/checker_tests.py
tests/checker_tests.py
from checkinchecker.checker import filter_matches from unittest import TestCase class CheckerTests(TestCase): def test_match_filter_visulite(self): possibilities = [ {"id": 0, "tags": {"name": "Taste of India"}}, {"id": 0, "tags": {"name": "Staunton"}}, {"id": 1, "tags":...
Add tests for the matcher
Add tests for the matcher
Python
mit
osmlab/checkin-checker,osmlab/checkin-checker
Add tests for the matcher
from checkinchecker.checker import filter_matches from unittest import TestCase class CheckerTests(TestCase): def test_match_filter_visulite(self): possibilities = [ {"id": 0, "tags": {"name": "Taste of India"}}, {"id": 0, "tags": {"name": "Staunton"}}, {"id": 1, "tags":...
<commit_before><commit_msg>Add tests for the matcher<commit_after>
from checkinchecker.checker import filter_matches from unittest import TestCase class CheckerTests(TestCase): def test_match_filter_visulite(self): possibilities = [ {"id": 0, "tags": {"name": "Taste of India"}}, {"id": 0, "tags": {"name": "Staunton"}}, {"id": 1, "tags":...
Add tests for the matcherfrom checkinchecker.checker import filter_matches from unittest import TestCase class CheckerTests(TestCase): def test_match_filter_visulite(self): possibilities = [ {"id": 0, "tags": {"name": "Taste of India"}}, {"id": 0, "tags": {"name": "Staunton"}}, ...
<commit_before><commit_msg>Add tests for the matcher<commit_after>from checkinchecker.checker import filter_matches from unittest import TestCase class CheckerTests(TestCase): def test_match_filter_visulite(self): possibilities = [ {"id": 0, "tags": {"name": "Taste of India"}}, {"id...
907d96948c80a2bc5396eb73e679b6cd30a0d895
testing/test_directory_deletion.py
testing/test_directory_deletion.py
import sys import os sys.path.insert(0, os.path.realpath('.')) import pytest import string import random import create_movie as c @pytest.fixture def tmp_dirname(): return ''.join(random.choice( string.ascii_uppercase + string.ascii_lowercase) for _ in range(10)) @pytest.fixture def dir_path(tm...
Add tests for temporary directory and ensure_dir
Add tests for temporary directory and ensure_dir
Python
mit
NGTS/frame-movies,NGTS/frame-movies
Add tests for temporary directory and ensure_dir
import sys import os sys.path.insert(0, os.path.realpath('.')) import pytest import string import random import create_movie as c @pytest.fixture def tmp_dirname(): return ''.join(random.choice( string.ascii_uppercase + string.ascii_lowercase) for _ in range(10)) @pytest.fixture def dir_path(tm...
<commit_before><commit_msg>Add tests for temporary directory and ensure_dir<commit_after>
import sys import os sys.path.insert(0, os.path.realpath('.')) import pytest import string import random import create_movie as c @pytest.fixture def tmp_dirname(): return ''.join(random.choice( string.ascii_uppercase + string.ascii_lowercase) for _ in range(10)) @pytest.fixture def dir_path(tm...
Add tests for temporary directory and ensure_dirimport sys import os sys.path.insert(0, os.path.realpath('.')) import pytest import string import random import create_movie as c @pytest.fixture def tmp_dirname(): return ''.join(random.choice( string.ascii_uppercase + string.ascii_lowercase) for _...
<commit_before><commit_msg>Add tests for temporary directory and ensure_dir<commit_after>import sys import os sys.path.insert(0, os.path.realpath('.')) import pytest import string import random import create_movie as c @pytest.fixture def tmp_dirname(): return ''.join(random.choice( string.ascii_uppercas...
798f660859fd802bcac54b5dba3fe77cc053baf9
website/utils/forms.py
website/utils/forms.py
from django.forms import models from django.forms.fields import ChoiceField class AdvancedModelChoiceIterator(models.ModelChoiceIterator): def choice(self, obj): return ( self.field.prepare_value(obj), self.field.label_from_instance(obj), obj ) class AdvancedM...
Add ModelChoiceField util to use actual objects
Add ModelChoiceField util to use actual objects
Python
agpl-3.0
Dekker1/moore,UTNkar/moore,UTNkar/moore,UTNkar/moore,Dekker1/moore,Dekker1/moore,UTNkar/moore,Dekker1/moore
Add ModelChoiceField util to use actual objects
from django.forms import models from django.forms.fields import ChoiceField class AdvancedModelChoiceIterator(models.ModelChoiceIterator): def choice(self, obj): return ( self.field.prepare_value(obj), self.field.label_from_instance(obj), obj ) class AdvancedM...
<commit_before><commit_msg>Add ModelChoiceField util to use actual objects<commit_after>
from django.forms import models from django.forms.fields import ChoiceField class AdvancedModelChoiceIterator(models.ModelChoiceIterator): def choice(self, obj): return ( self.field.prepare_value(obj), self.field.label_from_instance(obj), obj ) class AdvancedM...
Add ModelChoiceField util to use actual objectsfrom django.forms import models from django.forms.fields import ChoiceField class AdvancedModelChoiceIterator(models.ModelChoiceIterator): def choice(self, obj): return ( self.field.prepare_value(obj), self.field.label_from_instance(ob...
<commit_before><commit_msg>Add ModelChoiceField util to use actual objects<commit_after>from django.forms import models from django.forms.fields import ChoiceField class AdvancedModelChoiceIterator(models.ModelChoiceIterator): def choice(self, obj): return ( self.field.prepare_value(obj), ...
0ba0a96aaa05f0b71d4f7028145211308d886e2a
setup.py
setup.py
#!/usr/bin/env python from setuptools import setup, find_packages import simiki entry_points = { "console_scripts": [ "simiki = simiki.cli:main", ] } requires = open("requirements.txt").readlines() setup( name = "simiki", version = simiki.__version__, url = "https://github.com/tankywoo/...
#!/usr/bin/env python from __future__ import with_statement from setuptools import setup, find_packages import simiki entry_points = { "console_scripts": [ "simiki = simiki.cli:main", ] } with open("requirements.txt") as f: requires = f.readlines() setup( name = "simiki", version = simik...
Use with statement to ensure the file is closed by Python
Use with statement to ensure the file is closed by Python
Python
mit
zhaochunqi/simiki,9p0le/simiki,tankywoo/simiki,zhaochunqi/simiki,tankywoo/simiki,9p0le/simiki,9p0le/simiki,zhaochunqi/simiki,tankywoo/simiki
#!/usr/bin/env python from setuptools import setup, find_packages import simiki entry_points = { "console_scripts": [ "simiki = simiki.cli:main", ] } requires = open("requirements.txt").readlines() setup( name = "simiki", version = simiki.__version__, url = "https://github.com/tankywoo/...
#!/usr/bin/env python from __future__ import with_statement from setuptools import setup, find_packages import simiki entry_points = { "console_scripts": [ "simiki = simiki.cli:main", ] } with open("requirements.txt") as f: requires = f.readlines() setup( name = "simiki", version = simik...
<commit_before>#!/usr/bin/env python from setuptools import setup, find_packages import simiki entry_points = { "console_scripts": [ "simiki = simiki.cli:main", ] } requires = open("requirements.txt").readlines() setup( name = "simiki", version = simiki.__version__, url = "https://githu...
#!/usr/bin/env python from __future__ import with_statement from setuptools import setup, find_packages import simiki entry_points = { "console_scripts": [ "simiki = simiki.cli:main", ] } with open("requirements.txt") as f: requires = f.readlines() setup( name = "simiki", version = simik...
#!/usr/bin/env python from setuptools import setup, find_packages import simiki entry_points = { "console_scripts": [ "simiki = simiki.cli:main", ] } requires = open("requirements.txt").readlines() setup( name = "simiki", version = simiki.__version__, url = "https://github.com/tankywoo/...
<commit_before>#!/usr/bin/env python from setuptools import setup, find_packages import simiki entry_points = { "console_scripts": [ "simiki = simiki.cli:main", ] } requires = open("requirements.txt").readlines() setup( name = "simiki", version = simiki.__version__, url = "https://githu...
9ae72acc792fe4c1c246256c8da8070969cc246f
tests/test_types.py
tests/test_types.py
"""tests/test_types.py. Tests the type validators included with hug Copyright (C) 2015 Timothy Edmund Crosley Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including witho...
Add tests for all hug types
Add tests for all hug types
Python
mit
philiptzou/hug,janusnic/hug,yasoob/hug,yasoob/hug,giserh/hug,MuhammadAlkarouri/hug,timothycrosley/hug,shaunstanislaus/hug,STANAPO/hug,gbn972/hug,shaunstanislaus/hug,timothycrosley/hug,origingod/hug,alisaifee/hug,STANAPO/hug,philiptzou/hug,origingod/hug,janusnic/hug,jean/hug,gbn972/hug,timothycrosley/hug,giserh/hug,jean...
Add tests for all hug types
"""tests/test_types.py. Tests the type validators included with hug Copyright (C) 2015 Timothy Edmund Crosley Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including witho...
<commit_before><commit_msg>Add tests for all hug types<commit_after>
"""tests/test_types.py. Tests the type validators included with hug Copyright (C) 2015 Timothy Edmund Crosley Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including witho...
Add tests for all hug types"""tests/test_types.py. Tests the type validators included with hug Copyright (C) 2015 Timothy Edmund Crosley Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without r...
<commit_before><commit_msg>Add tests for all hug types<commit_after>"""tests/test_types.py. Tests the type validators included with hug Copyright (C) 2015 Timothy Edmund Crosley Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Soft...
dfdfe3d713fa55825f3ec4b3a9f19b923963e558
py/beautiful-arrangement.py
py/beautiful-arrangement.py
class Solution(object): def countArrangement(self, N): """ :type N: int :rtype: int """ table = dict() def dfs(cur, s): fs = frozenset(s) if (cur, fs) not in table: if not s: table[cur, fs] = 1 ...
Add py solution for 526. Beautiful Arrangement
Add py solution for 526. Beautiful Arrangement 526. Beautiful Arrangement: https://leetcode.com/problems/beautiful-arrangement/
Python
apache-2.0
ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode
Add py solution for 526. Beautiful Arrangement 526. Beautiful Arrangement: https://leetcode.com/problems/beautiful-arrangement/
class Solution(object): def countArrangement(self, N): """ :type N: int :rtype: int """ table = dict() def dfs(cur, s): fs = frozenset(s) if (cur, fs) not in table: if not s: table[cur, fs] = 1 ...
<commit_before><commit_msg>Add py solution for 526. Beautiful Arrangement 526. Beautiful Arrangement: https://leetcode.com/problems/beautiful-arrangement/<commit_after>
class Solution(object): def countArrangement(self, N): """ :type N: int :rtype: int """ table = dict() def dfs(cur, s): fs = frozenset(s) if (cur, fs) not in table: if not s: table[cur, fs] = 1 ...
Add py solution for 526. Beautiful Arrangement 526. Beautiful Arrangement: https://leetcode.com/problems/beautiful-arrangement/class Solution(object): def countArrangement(self, N): """ :type N: int :rtype: int """ table = dict() def dfs(cur, s): fs = fro...
<commit_before><commit_msg>Add py solution for 526. Beautiful Arrangement 526. Beautiful Arrangement: https://leetcode.com/problems/beautiful-arrangement/<commit_after>class Solution(object): def countArrangement(self, N): """ :type N: int :rtype: int """ table = dict() ...
a7a290d7230715eb58c29f12ad54477da5fe2209
chapter03/secondsAndHours.py
chapter03/secondsAndHours.py
#!/usr/bin/env python # -*- coding: utf-8 -*- def toSeconds(h, m, s): return h * 3600 + m * 60 + s def toHoursMinutesAndSeconds(s): hours = s / 3600 minutes = s % 3600 / 60 seconds = s % 3600 % 60 return (hours, minutes, seconds) print "10h 30m and 50s are {0} seconds".format(toSeconds(10, 30, 50)) print t...
Add seconds and hours exercise
Add seconds and hours exercise
Python
apache-2.0
MindCookin/python-exercises
Add seconds and hours exercise
#!/usr/bin/env python # -*- coding: utf-8 -*- def toSeconds(h, m, s): return h * 3600 + m * 60 + s def toHoursMinutesAndSeconds(s): hours = s / 3600 minutes = s % 3600 / 60 seconds = s % 3600 % 60 return (hours, minutes, seconds) print "10h 30m and 50s are {0} seconds".format(toSeconds(10, 30, 50)) print t...
<commit_before><commit_msg>Add seconds and hours exercise<commit_after>
#!/usr/bin/env python # -*- coding: utf-8 -*- def toSeconds(h, m, s): return h * 3600 + m * 60 + s def toHoursMinutesAndSeconds(s): hours = s / 3600 minutes = s % 3600 / 60 seconds = s % 3600 % 60 return (hours, minutes, seconds) print "10h 30m and 50s are {0} seconds".format(toSeconds(10, 30, 50)) print t...
Add seconds and hours exercise#!/usr/bin/env python # -*- coding: utf-8 -*- def toSeconds(h, m, s): return h * 3600 + m * 60 + s def toHoursMinutesAndSeconds(s): hours = s / 3600 minutes = s % 3600 / 60 seconds = s % 3600 % 60 return (hours, minutes, seconds) print "10h 30m and 50s are {0} seconds".format(...
<commit_before><commit_msg>Add seconds and hours exercise<commit_after>#!/usr/bin/env python # -*- coding: utf-8 -*- def toSeconds(h, m, s): return h * 3600 + m * 60 + s def toHoursMinutesAndSeconds(s): hours = s / 3600 minutes = s % 3600 / 60 seconds = s % 3600 % 60 return (hours, minutes, seconds) print ...
299f6f669afb1cac23090caa7df1b8c2501b84fa
test/test_loader.py
test/test_loader.py
import dirq import mock import os import shutil import tempfile import unittest import apel.db.loader schema = {"body": "string", "signer": "string", "empaid": "string?", "error": "string?"} class LoaderTest(unittest.TestCase): def setUp(self): self.queue_path = tempfile.mkdtemp() mo...
Add basic test for load_all_msgs
Add basic test for load_all_msgs
Python
apache-2.0
stfc/apel,apel/apel,tofu-rocketry/apel,stfc/apel,tofu-rocketry/apel,apel/apel
Add basic test for load_all_msgs
import dirq import mock import os import shutil import tempfile import unittest import apel.db.loader schema = {"body": "string", "signer": "string", "empaid": "string?", "error": "string?"} class LoaderTest(unittest.TestCase): def setUp(self): self.queue_path = tempfile.mkdtemp() mo...
<commit_before><commit_msg>Add basic test for load_all_msgs<commit_after>
import dirq import mock import os import shutil import tempfile import unittest import apel.db.loader schema = {"body": "string", "signer": "string", "empaid": "string?", "error": "string?"} class LoaderTest(unittest.TestCase): def setUp(self): self.queue_path = tempfile.mkdtemp() mo...
Add basic test for load_all_msgsimport dirq import mock import os import shutil import tempfile import unittest import apel.db.loader schema = {"body": "string", "signer": "string", "empaid": "string?", "error": "string?"} class LoaderTest(unittest.TestCase): def setUp(self): self.queue_path...
<commit_before><commit_msg>Add basic test for load_all_msgs<commit_after>import dirq import mock import os import shutil import tempfile import unittest import apel.db.loader schema = {"body": "string", "signer": "string", "empaid": "string?", "error": "string?"} class LoaderTest(unittest.TestCase): ...
05a1eaeabec009874fdf05b598bcde2a4aaabc4f
testbed_image_migrate.py
testbed_image_migrate.py
#!/usr/bin/env python3 """A scrip for migrating Testbed images from database to external storage.""" import argparse from pathlib import Path import psycopg2 def read_images(cursor): """Returns the ID, recorded datetime and image content of all Testbed images.""" cursor.execute('SELECT id, recorded, testbe...
Add Testbed image migration script
Add Testbed image migration script
Python
mit
terop/env-logger,terop/env-logger,terop/env-logger,terop/env-logger,terop/env-logger,terop/env-logger,terop/env-logger
Add Testbed image migration script
#!/usr/bin/env python3 """A scrip for migrating Testbed images from database to external storage.""" import argparse from pathlib import Path import psycopg2 def read_images(cursor): """Returns the ID, recorded datetime and image content of all Testbed images.""" cursor.execute('SELECT id, recorded, testbe...
<commit_before><commit_msg>Add Testbed image migration script<commit_after>
#!/usr/bin/env python3 """A scrip for migrating Testbed images from database to external storage.""" import argparse from pathlib import Path import psycopg2 def read_images(cursor): """Returns the ID, recorded datetime and image content of all Testbed images.""" cursor.execute('SELECT id, recorded, testbe...
Add Testbed image migration script#!/usr/bin/env python3 """A scrip for migrating Testbed images from database to external storage.""" import argparse from pathlib import Path import psycopg2 def read_images(cursor): """Returns the ID, recorded datetime and image content of all Testbed images.""" cursor.ex...
<commit_before><commit_msg>Add Testbed image migration script<commit_after>#!/usr/bin/env python3 """A scrip for migrating Testbed images from database to external storage.""" import argparse from pathlib import Path import psycopg2 def read_images(cursor): """Returns the ID, recorded datetime and image conten...
c74e5bc942ae2486199070ec213fa6d692a2a605
docs/source/examples/test_modify_array_argument_reals.py
docs/source/examples/test_modify_array_argument_reals.py
#!/usr/bin/env python import numpy as np from pych.extern import Chapel @Chapel() def printArray(arr=np.ndarray): """ arr += 1; writeln(arr); """ return None if __name__ == "__main__": arr = np.array([1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0]) print arr printArray(arr); p...
#!/usr/bin/env python import numpy as np from pych.extern import Chapel @Chapel() def printArray(arr=np.ndarray): """ arr += 1; writeln(arr); """ return None if __name__ == "__main__": arr = np.array([1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0]) print arr printArray(arr); p...
Fix trivial unit test error that started when numpy version changed
Fix trivial unit test error that started when numpy version changed The version of numpy brought in by pip changed, which changed some test outputs in meaningless ways (ie, spaces), and those meaningless changes broke a unit test with assertEquals( "string literal", test(something) ) This change fixes the unit te...
Python
apache-2.0
russel/pychapel,russel/pychapel,chapel-lang/pychapel,chapel-lang/pychapel,russel/pychapel,chapel-lang/pychapel
#!/usr/bin/env python import numpy as np from pych.extern import Chapel @Chapel() def printArray(arr=np.ndarray): """ arr += 1; writeln(arr); """ return None if __name__ == "__main__": arr = np.array([1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0]) print arr printArray(arr); p...
#!/usr/bin/env python import numpy as np from pych.extern import Chapel @Chapel() def printArray(arr=np.ndarray): """ arr += 1; writeln(arr); """ return None if __name__ == "__main__": arr = np.array([1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0]) print arr printArray(arr); p...
<commit_before>#!/usr/bin/env python import numpy as np from pych.extern import Chapel @Chapel() def printArray(arr=np.ndarray): """ arr += 1; writeln(arr); """ return None if __name__ == "__main__": arr = np.array([1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0]) print arr printAr...
#!/usr/bin/env python import numpy as np from pych.extern import Chapel @Chapel() def printArray(arr=np.ndarray): """ arr += 1; writeln(arr); """ return None if __name__ == "__main__": arr = np.array([1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0]) print arr printArray(arr); p...
#!/usr/bin/env python import numpy as np from pych.extern import Chapel @Chapel() def printArray(arr=np.ndarray): """ arr += 1; writeln(arr); """ return None if __name__ == "__main__": arr = np.array([1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0]) print arr printArray(arr); p...
<commit_before>#!/usr/bin/env python import numpy as np from pych.extern import Chapel @Chapel() def printArray(arr=np.ndarray): """ arr += 1; writeln(arr); """ return None if __name__ == "__main__": arr = np.array([1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0]) print arr printAr...
6ed487c8356a48f728b0ae66ac7bed4c74499c6f
ereuse_devicehub/scripts/updates/fix_add_migrate_from.py
ereuse_devicehub/scripts/updates/fix_add_migrate_from.py
from datetime import datetime from bson import ObjectId from flask import current_app from pydash import filter_ from pydash import map_ from ereuse_devicehub.resources.device.component.settings import Component from ereuse_devicehub.resources.device.domain import DeviceDomain from ereuse_devicehub.resources.event.de...
Add a fix FixAddMigrateFrom to solve a specific Migrate Problem
Add a fix FixAddMigrateFrom to solve a specific Migrate Problem
Python
agpl-3.0
eReuse/DeviceHub,eReuse/DeviceHub
Add a fix FixAddMigrateFrom to solve a specific Migrate Problem
from datetime import datetime from bson import ObjectId from flask import current_app from pydash import filter_ from pydash import map_ from ereuse_devicehub.resources.device.component.settings import Component from ereuse_devicehub.resources.device.domain import DeviceDomain from ereuse_devicehub.resources.event.de...
<commit_before><commit_msg>Add a fix FixAddMigrateFrom to solve a specific Migrate Problem<commit_after>
from datetime import datetime from bson import ObjectId from flask import current_app from pydash import filter_ from pydash import map_ from ereuse_devicehub.resources.device.component.settings import Component from ereuse_devicehub.resources.device.domain import DeviceDomain from ereuse_devicehub.resources.event.de...
Add a fix FixAddMigrateFrom to solve a specific Migrate Problemfrom datetime import datetime from bson import ObjectId from flask import current_app from pydash import filter_ from pydash import map_ from ereuse_devicehub.resources.device.component.settings import Component from ereuse_devicehub.resources.device.doma...
<commit_before><commit_msg>Add a fix FixAddMigrateFrom to solve a specific Migrate Problem<commit_after>from datetime import datetime from bson import ObjectId from flask import current_app from pydash import filter_ from pydash import map_ from ereuse_devicehub.resources.device.component.settings import Component fr...
07243c98efa12beb03387adead84e1b9297de2ac
evesrp/migrate/versions/337978f8c75_restrict_request_base_payout_to_be_0.py
evesrp/migrate/versions/337978f8c75_restrict_request_base_payout_to_be_0.py
"""Restrict request.base_payout to be >= 0 Revision ID: 337978f8c75 Revises: c1fc69b629 Create Date: 2014-06-18 14:04:52.963890 """ # revision identifiers, used by Alembic. revision = '337978f8c75' down_revision = 'c1fc69b629' from alembic import op import sqlalchemy as sa from sqlalchemy.sql import update, select,...
Add migration script for enforcing a minimum base_payout of 0
Add migration script for enforcing a minimum base_payout of 0 Should've been committed with c817d4df
Python
bsd-2-clause
eskwire/evesrp,paxswill/evesrp,paxswill/evesrp,eskwire/evesrp,eskwire/evesrp,eskwire/evesrp,paxswill/evesrp
Add migration script for enforcing a minimum base_payout of 0 Should've been committed with c817d4df
"""Restrict request.base_payout to be >= 0 Revision ID: 337978f8c75 Revises: c1fc69b629 Create Date: 2014-06-18 14:04:52.963890 """ # revision identifiers, used by Alembic. revision = '337978f8c75' down_revision = 'c1fc69b629' from alembic import op import sqlalchemy as sa from sqlalchemy.sql import update, select,...
<commit_before><commit_msg>Add migration script for enforcing a minimum base_payout of 0 Should've been committed with c817d4df<commit_after>
"""Restrict request.base_payout to be >= 0 Revision ID: 337978f8c75 Revises: c1fc69b629 Create Date: 2014-06-18 14:04:52.963890 """ # revision identifiers, used by Alembic. revision = '337978f8c75' down_revision = 'c1fc69b629' from alembic import op import sqlalchemy as sa from sqlalchemy.sql import update, select,...
Add migration script for enforcing a minimum base_payout of 0 Should've been committed with c817d4df"""Restrict request.base_payout to be >= 0 Revision ID: 337978f8c75 Revises: c1fc69b629 Create Date: 2014-06-18 14:04:52.963890 """ # revision identifiers, used by Alembic. revision = '337978f8c75' down_revision = 'c...
<commit_before><commit_msg>Add migration script for enforcing a minimum base_payout of 0 Should've been committed with c817d4df<commit_after>"""Restrict request.base_payout to be >= 0 Revision ID: 337978f8c75 Revises: c1fc69b629 Create Date: 2014-06-18 14:04:52.963890 """ # revision identifiers, used by Alembic. re...
c339cf70342df088b920eb42aca4e3094fd96938
test/test_action.py
test/test_action.py
#!/usr/bin/env python2.6 # # This file is used to test reading and processing of config files # import os #It's ugly I know.... from shinken_test import * from shinken.action import Action class TestConfig(ShinkenTest): #setUp is in shinken_test #Change ME :) def test_action(self): a = Acti...
Add a test for actions.
Add a test for actions.
Python
agpl-3.0
staute/shinken_package,xorpaul/shinken,kaji-project/shinken,h4wkmoon/shinken,baloo/shinken,lets-software/shinken,KerkhoffTechnologies/shinken,peeyush-tm/shinken,tal-nino/shinken,naparuba/shinken,staute/shinken_deb,savoirfairelinux/shinken,baloo/shinken,dfranco/shinken,ddurieux/alignak,kaji-project/shinken,h4wkmoon/shin...
Add a test for actions.
#!/usr/bin/env python2.6 # # This file is used to test reading and processing of config files # import os #It's ugly I know.... from shinken_test import * from shinken.action import Action class TestConfig(ShinkenTest): #setUp is in shinken_test #Change ME :) def test_action(self): a = Acti...
<commit_before><commit_msg>Add a test for actions.<commit_after>
#!/usr/bin/env python2.6 # # This file is used to test reading and processing of config files # import os #It's ugly I know.... from shinken_test import * from shinken.action import Action class TestConfig(ShinkenTest): #setUp is in shinken_test #Change ME :) def test_action(self): a = Acti...
Add a test for actions.#!/usr/bin/env python2.6 # # This file is used to test reading and processing of config files # import os #It's ugly I know.... from shinken_test import * from shinken.action import Action class TestConfig(ShinkenTest): #setUp is in shinken_test #Change ME :) def test_action(...
<commit_before><commit_msg>Add a test for actions.<commit_after>#!/usr/bin/env python2.6 # # This file is used to test reading and processing of config files # import os #It's ugly I know.... from shinken_test import * from shinken.action import Action class TestConfig(ShinkenTest): #setUp is in shinken_test ...
fe40ce2d041f04507c2a6a2e60ec3e7cb83ebca5
test/test_inject.py
test/test_inject.py
import sys import unittest from io import StringIO from unittest.mock import patch try: from unittest.mock import MagicMock, mock_open except ImportError: from mock import MagicMock, mock_open from sleuth.inject import _Break, _Call, _Inject, _Log, _Print class TestInjectionActions(unittest.TestCase): d...
Add tests for print injection.
Add tests for print injection.
Python
mit
emrob/sleuth
Add tests for print injection.
import sys import unittest from io import StringIO from unittest.mock import patch try: from unittest.mock import MagicMock, mock_open except ImportError: from mock import MagicMock, mock_open from sleuth.inject import _Break, _Call, _Inject, _Log, _Print class TestInjectionActions(unittest.TestCase): d...
<commit_before><commit_msg>Add tests for print injection.<commit_after>
import sys import unittest from io import StringIO from unittest.mock import patch try: from unittest.mock import MagicMock, mock_open except ImportError: from mock import MagicMock, mock_open from sleuth.inject import _Break, _Call, _Inject, _Log, _Print class TestInjectionActions(unittest.TestCase): d...
Add tests for print injection.import sys import unittest from io import StringIO from unittest.mock import patch try: from unittest.mock import MagicMock, mock_open except ImportError: from mock import MagicMock, mock_open from sleuth.inject import _Break, _Call, _Inject, _Log, _Print class TestInjectionAct...
<commit_before><commit_msg>Add tests for print injection.<commit_after>import sys import unittest from io import StringIO from unittest.mock import patch try: from unittest.mock import MagicMock, mock_open except ImportError: from mock import MagicMock, mock_open from sleuth.inject import _Break, _Call, _Inje...
a3043b147b2281867ad55a4816fafc40bcf329fd
pyheufybot/utils/webutils.py
pyheufybot/utils/webutils.py
import time from urllib import urlencode from urllib2 import build_opener, Request, urlopen, URLError from urlparse import urlparse class URLResponse(object): def __init__(self, body, domain): self.body = body self.domain = domain def fetchURL(url, extraHeaders=None): headers = [( "User-agent"...
Add utilities for working with URLs
Add utilities for working with URLs
Python
mit
Heufneutje/PyHeufyBot,Heufneutje/PyHeufyBot
Add utilities for working with URLs
import time from urllib import urlencode from urllib2 import build_opener, Request, urlopen, URLError from urlparse import urlparse class URLResponse(object): def __init__(self, body, domain): self.body = body self.domain = domain def fetchURL(url, extraHeaders=None): headers = [( "User-agent"...
<commit_before><commit_msg>Add utilities for working with URLs<commit_after>
import time from urllib import urlencode from urllib2 import build_opener, Request, urlopen, URLError from urlparse import urlparse class URLResponse(object): def __init__(self, body, domain): self.body = body self.domain = domain def fetchURL(url, extraHeaders=None): headers = [( "User-agent"...
Add utilities for working with URLsimport time from urllib import urlencode from urllib2 import build_opener, Request, urlopen, URLError from urlparse import urlparse class URLResponse(object): def __init__(self, body, domain): self.body = body self.domain = domain def fetchURL(url, extraHeaders=N...
<commit_before><commit_msg>Add utilities for working with URLs<commit_after>import time from urllib import urlencode from urllib2 import build_opener, Request, urlopen, URLError from urlparse import urlparse class URLResponse(object): def __init__(self, body, domain): self.body = body self.domain =...
7583dfe2d6fcc45003950c4c5af28b6eb407cc40
django/website/contacts/migrations/0004_auto_20160421_1645.py
django/website/contacts/migrations/0004_auto_20160421_1645.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models def add_user_profiles(apps, schema_editor): User = apps.get_model('contacts', 'User') UserPreferences = apps.get_model('contacts', 'UserPreferences') for user in User.objects.all(): UserPrefe...
Add migration to create user profiles
Add migration to create user profiles
Python
agpl-3.0
aptivate/alfie,aptivate/kashana,aptivate/alfie,daniell/kashana,daniell/kashana,daniell/kashana,aptivate/kashana,daniell/kashana,aptivate/alfie,aptivate/kashana,aptivate/alfie,aptivate/kashana
Add migration to create user profiles
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models def add_user_profiles(apps, schema_editor): User = apps.get_model('contacts', 'User') UserPreferences = apps.get_model('contacts', 'UserPreferences') for user in User.objects.all(): UserPrefe...
<commit_before><commit_msg>Add migration to create user profiles<commit_after>
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models def add_user_profiles(apps, schema_editor): User = apps.get_model('contacts', 'User') UserPreferences = apps.get_model('contacts', 'UserPreferences') for user in User.objects.all(): UserPrefe...
Add migration to create user profiles# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models def add_user_profiles(apps, schema_editor): User = apps.get_model('contacts', 'User') UserPreferences = apps.get_model('contacts', 'UserPreferences') for user in ...
<commit_before><commit_msg>Add migration to create user profiles<commit_after># -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models def add_user_profiles(apps, schema_editor): User = apps.get_model('contacts', 'User') UserPreferences = apps.get_model('contac...
863678a76664879971d50d41d52fba5c35f67913
RemoveDirectories.py
RemoveDirectories.py
# -*- coding:utf-8 -*- """ 這個程式能夠刪除所有在同目錄下的指定資料夾名稱(含子資料夾) """ import os import shutil FOLDER_NAME = 'PaxHeaders.20420' def convert_all_files(path): for dirPath, dirNames, fileNames in os.walk(path): for dirName in dirNames: if dirName == FOLDER_NAME: shutil.rmtree(os.path.join...
Copy from my project remove-all-sub-directory-with-specific-name.
Copy from my project remove-all-sub-directory-with-specific-name.
Python
mit
YiFanChen99/file-walker-for-windows
Copy from my project remove-all-sub-directory-with-specific-name.
# -*- coding:utf-8 -*- """ 這個程式能夠刪除所有在同目錄下的指定資料夾名稱(含子資料夾) """ import os import shutil FOLDER_NAME = 'PaxHeaders.20420' def convert_all_files(path): for dirPath, dirNames, fileNames in os.walk(path): for dirName in dirNames: if dirName == FOLDER_NAME: shutil.rmtree(os.path.join...
<commit_before><commit_msg>Copy from my project remove-all-sub-directory-with-specific-name.<commit_after>
# -*- coding:utf-8 -*- """ 這個程式能夠刪除所有在同目錄下的指定資料夾名稱(含子資料夾) """ import os import shutil FOLDER_NAME = 'PaxHeaders.20420' def convert_all_files(path): for dirPath, dirNames, fileNames in os.walk(path): for dirName in dirNames: if dirName == FOLDER_NAME: shutil.rmtree(os.path.join...
Copy from my project remove-all-sub-directory-with-specific-name.# -*- coding:utf-8 -*- """ 這個程式能夠刪除所有在同目錄下的指定資料夾名稱(含子資料夾) """ import os import shutil FOLDER_NAME = 'PaxHeaders.20420' def convert_all_files(path): for dirPath, dirNames, fileNames in os.walk(path): for dirName in dirNames: if d...
<commit_before><commit_msg>Copy from my project remove-all-sub-directory-with-specific-name.<commit_after># -*- coding:utf-8 -*- """ 這個程式能夠刪除所有在同目錄下的指定資料夾名稱(含子資料夾) """ import os import shutil FOLDER_NAME = 'PaxHeaders.20420' def convert_all_files(path): for dirPath, dirNames, fileNames in os.walk(path): ...
b906d75b5cf010173de4c4f0e68daa2c581b17ad
gitcommititerator.py
gitcommititerator.py
import subprocess class GitCommitIterator(object): """A class for iterating Git commits up their ancestry chain.""" previous = None current = None def __init__(self, start): if not rev_is_valid(start): raise Exception('No commit exists with ID %s' % start) self.current = s...
Add a GitCommitIterator thing for walking the ancestry chain.
Add a GitCommitIterator thing for walking the ancestry chain.
Python
mit
mikeconley/rb-repo
Add a GitCommitIterator thing for walking the ancestry chain.
import subprocess class GitCommitIterator(object): """A class for iterating Git commits up their ancestry chain.""" previous = None current = None def __init__(self, start): if not rev_is_valid(start): raise Exception('No commit exists with ID %s' % start) self.current = s...
<commit_before><commit_msg>Add a GitCommitIterator thing for walking the ancestry chain.<commit_after>
import subprocess class GitCommitIterator(object): """A class for iterating Git commits up their ancestry chain.""" previous = None current = None def __init__(self, start): if not rev_is_valid(start): raise Exception('No commit exists with ID %s' % start) self.current = s...
Add a GitCommitIterator thing for walking the ancestry chain.import subprocess class GitCommitIterator(object): """A class for iterating Git commits up their ancestry chain.""" previous = None current = None def __init__(self, start): if not rev_is_valid(start): raise Exception('N...
<commit_before><commit_msg>Add a GitCommitIterator thing for walking the ancestry chain.<commit_after>import subprocess class GitCommitIterator(object): """A class for iterating Git commits up their ancestry chain.""" previous = None current = None def __init__(self, start): if not rev_is_val...
f053735150ea7930eb5da42ac4a04e3505177e08
test_queue.py
test_queue.py
from queue import QueueItem from queue import Queue import pytest def test_enqueue(): queue = Queue() queue.enqueue("Bacon") assert queue.size() == 1 def test_enqueue_multi(): queue = Queue() queue.enqueue("Bacon") queue.enqueue("Steak") queue.enqueue("Beer") assert queue.size() == 3...
Add test structure and tests for enqueue method
Add test structure and tests for enqueue method
Python
mit
jwarren116/data-structures
Add test structure and tests for enqueue method
from queue import QueueItem from queue import Queue import pytest def test_enqueue(): queue = Queue() queue.enqueue("Bacon") assert queue.size() == 1 def test_enqueue_multi(): queue = Queue() queue.enqueue("Bacon") queue.enqueue("Steak") queue.enqueue("Beer") assert queue.size() == 3...
<commit_before><commit_msg>Add test structure and tests for enqueue method<commit_after>
from queue import QueueItem from queue import Queue import pytest def test_enqueue(): queue = Queue() queue.enqueue("Bacon") assert queue.size() == 1 def test_enqueue_multi(): queue = Queue() queue.enqueue("Bacon") queue.enqueue("Steak") queue.enqueue("Beer") assert queue.size() == 3...
Add test structure and tests for enqueue methodfrom queue import QueueItem from queue import Queue import pytest def test_enqueue(): queue = Queue() queue.enqueue("Bacon") assert queue.size() == 1 def test_enqueue_multi(): queue = Queue() queue.enqueue("Bacon") queue.enqueue("Steak") que...
<commit_before><commit_msg>Add test structure and tests for enqueue method<commit_after>from queue import QueueItem from queue import Queue import pytest def test_enqueue(): queue = Queue() queue.enqueue("Bacon") assert queue.size() == 1 def test_enqueue_multi(): queue = Queue() queue.enqueue("B...
e4ebbbb010f43612da13691b003f392f56b88fec
bitbots_body_behaviour/scripts/cheering_behaviour.py
bitbots_body_behaviour/scripts/cheering_behaviour.py
#!/usr/bin/env python3 import actionlib import rospy from humanoid_league_msgs.msg import PlayAnimationGoal, PlayAnimationAction, GameState class CheeringBehaviour: def __init__(self): rospy.init_node('cheering_behvaiour') self.opponent_goals = 0 self.animation_running = False ro...
Add simple behaviour to cheer when the opponent scores a goal
Add simple behaviour to cheer when the opponent scores a goal
Python
bsd-3-clause
bit-bots/bitbots_behaviour
Add simple behaviour to cheer when the opponent scores a goal
#!/usr/bin/env python3 import actionlib import rospy from humanoid_league_msgs.msg import PlayAnimationGoal, PlayAnimationAction, GameState class CheeringBehaviour: def __init__(self): rospy.init_node('cheering_behvaiour') self.opponent_goals = 0 self.animation_running = False ro...
<commit_before><commit_msg>Add simple behaviour to cheer when the opponent scores a goal<commit_after>
#!/usr/bin/env python3 import actionlib import rospy from humanoid_league_msgs.msg import PlayAnimationGoal, PlayAnimationAction, GameState class CheeringBehaviour: def __init__(self): rospy.init_node('cheering_behvaiour') self.opponent_goals = 0 self.animation_running = False ro...
Add simple behaviour to cheer when the opponent scores a goal#!/usr/bin/env python3 import actionlib import rospy from humanoid_league_msgs.msg import PlayAnimationGoal, PlayAnimationAction, GameState class CheeringBehaviour: def __init__(self): rospy.init_node('cheering_behvaiour') self.opponent...
<commit_before><commit_msg>Add simple behaviour to cheer when the opponent scores a goal<commit_after>#!/usr/bin/env python3 import actionlib import rospy from humanoid_league_msgs.msg import PlayAnimationGoal, PlayAnimationAction, GameState class CheeringBehaviour: def __init__(self): rospy.init_node('ch...
ee0b57b0c254546ed123a824b907ee0ef734f3b1
aphla_location.py
aphla_location.py
# Load the machine import pkg_resources pkg_resources.require('aphla') import aphla as ap # Import caget and caput from cothread.catools import caget, caput # Load the machine ap.machines.load('SRI21') print ap.__file__
Print the location of the APHLA library
Print the location of the APHLA library
Python
apache-2.0
razvanvasile/Work-Mini-Projects,razvanvasile/Work-Mini-Projects,razvanvasile/Work-Mini-Projects
Print the location of the APHLA library
# Load the machine import pkg_resources pkg_resources.require('aphla') import aphla as ap # Import caget and caput from cothread.catools import caget, caput # Load the machine ap.machines.load('SRI21') print ap.__file__
<commit_before><commit_msg>Print the location of the APHLA library<commit_after>
# Load the machine import pkg_resources pkg_resources.require('aphla') import aphla as ap # Import caget and caput from cothread.catools import caget, caput # Load the machine ap.machines.load('SRI21') print ap.__file__
Print the location of the APHLA library# Load the machine import pkg_resources pkg_resources.require('aphla') import aphla as ap # Import caget and caput from cothread.catools import caget, caput # Load the machine ap.machines.load('SRI21') print ap.__file__
<commit_before><commit_msg>Print the location of the APHLA library<commit_after># Load the machine import pkg_resources pkg_resources.require('aphla') import aphla as ap # Import caget and caput from cothread.catools import caget, caput # Load the machine ap.machines.load('SRI21') print ap.__file__
b30d2d222397122659104ef0c1f8e8a2810caa05
examples/filter_ensemble_average.py
examples/filter_ensemble_average.py
import numpy as np import matplotlib.pyplot as plt import atomic from ensemble_average import time_dependent_power if __name__ == '__main__': times = np.logspace(-7, 0, 50) temperature = np.logspace(0, 3, 50) density = 1e19 from atomic.pec import TransitionPool ad = atomic.element('argon') t...
Add example: filtered ensemble average.
Add example: filtered ensemble average.
Python
mit
ezekial4/atomic_neu,ezekial4/atomic_neu
Add example: filtered ensemble average.
import numpy as np import matplotlib.pyplot as plt import atomic from ensemble_average import time_dependent_power if __name__ == '__main__': times = np.logspace(-7, 0, 50) temperature = np.logspace(0, 3, 50) density = 1e19 from atomic.pec import TransitionPool ad = atomic.element('argon') t...
<commit_before><commit_msg>Add example: filtered ensemble average.<commit_after>
import numpy as np import matplotlib.pyplot as plt import atomic from ensemble_average import time_dependent_power if __name__ == '__main__': times = np.logspace(-7, 0, 50) temperature = np.logspace(0, 3, 50) density = 1e19 from atomic.pec import TransitionPool ad = atomic.element('argon') t...
Add example: filtered ensemble average.import numpy as np import matplotlib.pyplot as plt import atomic from ensemble_average import time_dependent_power if __name__ == '__main__': times = np.logspace(-7, 0, 50) temperature = np.logspace(0, 3, 50) density = 1e19 from atomic.pec import TransitionPool...
<commit_before><commit_msg>Add example: filtered ensemble average.<commit_after>import numpy as np import matplotlib.pyplot as plt import atomic from ensemble_average import time_dependent_power if __name__ == '__main__': times = np.logspace(-7, 0, 50) temperature = np.logspace(0, 3, 50) density = 1e19 ...
ba84856e3d318825865abecb76aa77290d107589
numba/tests/test_gdb_dwarf.py
numba/tests/test_gdb_dwarf.py
"""Tests for gdb interacting with the DWARF numba generates""" from numba.tests.support import TestCase, linux_only from numba.tests.gdb_support import needs_gdb, skip_unless_pexpect @linux_only @needs_gdb @skip_unless_pexpect class TestGDBDwarf(TestCase): # This runs the tests in numba.tests.gdb, each submodule ...
Add test driver for gdb
Add test driver for gdb
Python
bsd-2-clause
numba/numba,seibert/numba,IntelLabs/numba,seibert/numba,IntelLabs/numba,cpcloud/numba,numba/numba,numba/numba,cpcloud/numba,IntelLabs/numba,cpcloud/numba,cpcloud/numba,numba/numba,IntelLabs/numba,IntelLabs/numba,cpcloud/numba,numba/numba,seibert/numba,seibert/numba,seibert/numba
Add test driver for gdb
"""Tests for gdb interacting with the DWARF numba generates""" from numba.tests.support import TestCase, linux_only from numba.tests.gdb_support import needs_gdb, skip_unless_pexpect @linux_only @needs_gdb @skip_unless_pexpect class TestGDBDwarf(TestCase): # This runs the tests in numba.tests.gdb, each submodule ...
<commit_before><commit_msg>Add test driver for gdb<commit_after>
"""Tests for gdb interacting with the DWARF numba generates""" from numba.tests.support import TestCase, linux_only from numba.tests.gdb_support import needs_gdb, skip_unless_pexpect @linux_only @needs_gdb @skip_unless_pexpect class TestGDBDwarf(TestCase): # This runs the tests in numba.tests.gdb, each submodule ...
Add test driver for gdb"""Tests for gdb interacting with the DWARF numba generates""" from numba.tests.support import TestCase, linux_only from numba.tests.gdb_support import needs_gdb, skip_unless_pexpect @linux_only @needs_gdb @skip_unless_pexpect class TestGDBDwarf(TestCase): # This runs the tests in numba.tes...
<commit_before><commit_msg>Add test driver for gdb<commit_after>"""Tests for gdb interacting with the DWARF numba generates""" from numba.tests.support import TestCase, linux_only from numba.tests.gdb_support import needs_gdb, skip_unless_pexpect @linux_only @needs_gdb @skip_unless_pexpect class TestGDBDwarf(TestCase...
11bbff0c22be7489d28e561952ab7206288fc39e
TwoSum.py
TwoSum.py
# _*_ coding:utf-8 _*_ """ Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would have exactly one solution, and you may not use the same element twice. Example: Given nums = [2, 7, 11, 15], target = 9, Because nums[0] + nums[1]...
Add two number sum solution
Add two number sum solution
Python
mit
cometdlut/leetcode_cometdlut
Add two number sum solution
# _*_ coding:utf-8 _*_ """ Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would have exactly one solution, and you may not use the same element twice. Example: Given nums = [2, 7, 11, 15], target = 9, Because nums[0] + nums[1]...
<commit_before><commit_msg>Add two number sum solution<commit_after>
# _*_ coding:utf-8 _*_ """ Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would have exactly one solution, and you may not use the same element twice. Example: Given nums = [2, 7, 11, 15], target = 9, Because nums[0] + nums[1]...
Add two number sum solution# _*_ coding:utf-8 _*_ """ Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would have exactly one solution, and you may not use the same element twice. Example: Given nums = [2, 7, 11, 15], target = 9,...
<commit_before><commit_msg>Add two number sum solution<commit_after># _*_ coding:utf-8 _*_ """ Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would have exactly one solution, and you may not use the same element twice. Example:...
be5a91d72812c794775e52854af34c7a0bdd51da
i8c/tests/test_reserved_provider.py
i8c/tests/test_reserved_provider.py
from i8c.tests import TestCase from i8c.exceptions import NameAnnotatorError SOURCE = """\ define %s::test_reserved_provider returns ptr extern ptr __some_symbol """ class TestReservedProvider(TestCase): """Check that reserved provider names are rejected.""" def test_reserved_provider(self): """C...
Check reserved provider names are rejected
Check reserved provider names are rejected
Python
lgpl-2.1
gbenson/i8c
Check reserved provider names are rejected
from i8c.tests import TestCase from i8c.exceptions import NameAnnotatorError SOURCE = """\ define %s::test_reserved_provider returns ptr extern ptr __some_symbol """ class TestReservedProvider(TestCase): """Check that reserved provider names are rejected.""" def test_reserved_provider(self): """C...
<commit_before><commit_msg>Check reserved provider names are rejected<commit_after>
from i8c.tests import TestCase from i8c.exceptions import NameAnnotatorError SOURCE = """\ define %s::test_reserved_provider returns ptr extern ptr __some_symbol """ class TestReservedProvider(TestCase): """Check that reserved provider names are rejected.""" def test_reserved_provider(self): """C...
Check reserved provider names are rejectedfrom i8c.tests import TestCase from i8c.exceptions import NameAnnotatorError SOURCE = """\ define %s::test_reserved_provider returns ptr extern ptr __some_symbol """ class TestReservedProvider(TestCase): """Check that reserved provider names are rejected.""" def ...
<commit_before><commit_msg>Check reserved provider names are rejected<commit_after>from i8c.tests import TestCase from i8c.exceptions import NameAnnotatorError SOURCE = """\ define %s::test_reserved_provider returns ptr extern ptr __some_symbol """ class TestReservedProvider(TestCase): """Check that reserved ...
29d086bc9d31da9c702d9bc27e1ed821d45367ef
tests/test_parsing.py
tests/test_parsing.py
from __future__ import print_function from nose2.tools import such from mkerefuse.refuse import RefusePickup def setup_parser(html_path): """ Reads test HTML & instantiates a new `RefusePickup` :param html_path: Path to HTML file with a test response :type html_path: str :return: RefusePickup in...
Add Test: on garbage day, known recycle
Add Test: on garbage day, known recycle
Python
unlicense
tomislacker/python-mke-trash-pickup,tomislacker/python-mke-trash-pickup
Add Test: on garbage day, known recycle
from __future__ import print_function from nose2.tools import such from mkerefuse.refuse import RefusePickup def setup_parser(html_path): """ Reads test HTML & instantiates a new `RefusePickup` :param html_path: Path to HTML file with a test response :type html_path: str :return: RefusePickup in...
<commit_before><commit_msg>Add Test: on garbage day, known recycle<commit_after>
from __future__ import print_function from nose2.tools import such from mkerefuse.refuse import RefusePickup def setup_parser(html_path): """ Reads test HTML & instantiates a new `RefusePickup` :param html_path: Path to HTML file with a test response :type html_path: str :return: RefusePickup in...
Add Test: on garbage day, known recyclefrom __future__ import print_function from nose2.tools import such from mkerefuse.refuse import RefusePickup def setup_parser(html_path): """ Reads test HTML & instantiates a new `RefusePickup` :param html_path: Path to HTML file with a test response :type html...
<commit_before><commit_msg>Add Test: on garbage day, known recycle<commit_after>from __future__ import print_function from nose2.tools import such from mkerefuse.refuse import RefusePickup def setup_parser(html_path): """ Reads test HTML & instantiates a new `RefusePickup` :param html_path: Path to HTML...
1abeec5c22f22065e377a1567d3677e56fbc1b2c
tests/version_test.py
tests/version_test.py
import collections import numbers import os from sqlalchemy import __version__ from sqlalchemy_imageattach.version import VERSION, VERSION_INFO def test_version_info(): assert isinstance(VERSION_INFO, collections.Sequence) assert len(VERSION_INFO) == 3 assert isinstance(VERSION_INFO[0], numbers.Integral)...
import collections import numbers import os from sqlalchemy import __version__ from sqlalchemy_imageattach.version import VERSION, VERSION_INFO def test_version_info(): assert isinstance(VERSION_INFO, collections.Sequence) assert len(VERSION_INFO) == 3 assert isinstance(VERSION_INFO[0], numbers.Integral)...
Support any later versions of SQLAlchemy
Support any later versions of SQLAlchemy
Python
mit
youknowone/sqlalchemy-imageattach,dahlia/sqlalchemy-imageattach
import collections import numbers import os from sqlalchemy import __version__ from sqlalchemy_imageattach.version import VERSION, VERSION_INFO def test_version_info(): assert isinstance(VERSION_INFO, collections.Sequence) assert len(VERSION_INFO) == 3 assert isinstance(VERSION_INFO[0], numbers.Integral)...
import collections import numbers import os from sqlalchemy import __version__ from sqlalchemy_imageattach.version import VERSION, VERSION_INFO def test_version_info(): assert isinstance(VERSION_INFO, collections.Sequence) assert len(VERSION_INFO) == 3 assert isinstance(VERSION_INFO[0], numbers.Integral)...
<commit_before>import collections import numbers import os from sqlalchemy import __version__ from sqlalchemy_imageattach.version import VERSION, VERSION_INFO def test_version_info(): assert isinstance(VERSION_INFO, collections.Sequence) assert len(VERSION_INFO) == 3 assert isinstance(VERSION_INFO[0], nu...
import collections import numbers import os from sqlalchemy import __version__ from sqlalchemy_imageattach.version import VERSION, VERSION_INFO def test_version_info(): assert isinstance(VERSION_INFO, collections.Sequence) assert len(VERSION_INFO) == 3 assert isinstance(VERSION_INFO[0], numbers.Integral)...
import collections import numbers import os from sqlalchemy import __version__ from sqlalchemy_imageattach.version import VERSION, VERSION_INFO def test_version_info(): assert isinstance(VERSION_INFO, collections.Sequence) assert len(VERSION_INFO) == 3 assert isinstance(VERSION_INFO[0], numbers.Integral)...
<commit_before>import collections import numbers import os from sqlalchemy import __version__ from sqlalchemy_imageattach.version import VERSION, VERSION_INFO def test_version_info(): assert isinstance(VERSION_INFO, collections.Sequence) assert len(VERSION_INFO) == 3 assert isinstance(VERSION_INFO[0], nu...
118edbb78d2d56ccc41cb3c65346d4f3d59f5647
py/insert-delete-getrandom-o1.py
py/insert-delete-getrandom-o1.py
class RandomizedSet(object): def __init__(self): """ Initialize your data structure here. """ self.pos = dict() self.lst = [] def insert(self, val): """ Inserts a value to the set. Returns true if the set did not already contain the specified element. ...
Add py solution for 380. Insert Delete GetRandom O(1)
Add py solution for 380. Insert Delete GetRandom O(1) 380. Insert Delete GetRandom O(1): https://leetcode.com/problems/insert-delete-getrandom-o1/
Python
apache-2.0
ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode
Add py solution for 380. Insert Delete GetRandom O(1) 380. Insert Delete GetRandom O(1): https://leetcode.com/problems/insert-delete-getrandom-o1/
class RandomizedSet(object): def __init__(self): """ Initialize your data structure here. """ self.pos = dict() self.lst = [] def insert(self, val): """ Inserts a value to the set. Returns true if the set did not already contain the specified element. ...
<commit_before><commit_msg>Add py solution for 380. Insert Delete GetRandom O(1) 380. Insert Delete GetRandom O(1): https://leetcode.com/problems/insert-delete-getrandom-o1/<commit_after>
class RandomizedSet(object): def __init__(self): """ Initialize your data structure here. """ self.pos = dict() self.lst = [] def insert(self, val): """ Inserts a value to the set. Returns true if the set did not already contain the specified element. ...
Add py solution for 380. Insert Delete GetRandom O(1) 380. Insert Delete GetRandom O(1): https://leetcode.com/problems/insert-delete-getrandom-o1/class RandomizedSet(object): def __init__(self): """ Initialize your data structure here. """ self.pos = dict() self.lst = [] ...
<commit_before><commit_msg>Add py solution for 380. Insert Delete GetRandom O(1) 380. Insert Delete GetRandom O(1): https://leetcode.com/problems/insert-delete-getrandom-o1/<commit_after>class RandomizedSet(object): def __init__(self): """ Initialize your data structure here. """ s...
7e40ef982aa7a75cde4171d14a95def80f99eb35
py/maximum-average-subarray-i.py
py/maximum-average-subarray-i.py
class Solution(object): def findMaxAverage(self, nums, k): """ :type nums: List[int] :type k: int :rtype: float """ s = sum(nums[:k]) m = s for i in xrange(k, len(nums)): s += nums[i] - nums[i - k] m = max(m, s) return f...
Add py solution for 643. Maximum Average Subarray I
Add py solution for 643. Maximum Average Subarray I 643. Maximum Average Subarray I: https://leetcode.com/problems/maximum-average-subarray-i/
Python
apache-2.0
ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode
Add py solution for 643. Maximum Average Subarray I 643. Maximum Average Subarray I: https://leetcode.com/problems/maximum-average-subarray-i/
class Solution(object): def findMaxAverage(self, nums, k): """ :type nums: List[int] :type k: int :rtype: float """ s = sum(nums[:k]) m = s for i in xrange(k, len(nums)): s += nums[i] - nums[i - k] m = max(m, s) return f...
<commit_before><commit_msg>Add py solution for 643. Maximum Average Subarray I 643. Maximum Average Subarray I: https://leetcode.com/problems/maximum-average-subarray-i/<commit_after>
class Solution(object): def findMaxAverage(self, nums, k): """ :type nums: List[int] :type k: int :rtype: float """ s = sum(nums[:k]) m = s for i in xrange(k, len(nums)): s += nums[i] - nums[i - k] m = max(m, s) return f...
Add py solution for 643. Maximum Average Subarray I 643. Maximum Average Subarray I: https://leetcode.com/problems/maximum-average-subarray-i/class Solution(object): def findMaxAverage(self, nums, k): """ :type nums: List[int] :type k: int :rtype: float """ s = sum(n...
<commit_before><commit_msg>Add py solution for 643. Maximum Average Subarray I 643. Maximum Average Subarray I: https://leetcode.com/problems/maximum-average-subarray-i/<commit_after>class Solution(object): def findMaxAverage(self, nums, k): """ :type nums: List[int] :type k: int :r...
b97f97710a63c1d0c501c14e49dd0e26d8fb92d5
rabbitmq-connector.py
rabbitmq-connector.py
import asyncio import aioamqp @asyncio.coroutine def callback(channel, body, envelope, properties): print(body) @asyncio.coroutine def connect(): try: transport, protocol = yield from aioamqp.connect() channel = yield from protocol.channel() except aioamqp.AmqpClosedConnection: pri...
Add basic python script for recieving mnemosyne AMQP messages
Add basic python script for recieving mnemosyne AMQP messages
Python
agpl-3.0
jgraichen/mnemosyne,jgraichen/mnemosyne,jgraichen/mnemosyne
Add basic python script for recieving mnemosyne AMQP messages
import asyncio import aioamqp @asyncio.coroutine def callback(channel, body, envelope, properties): print(body) @asyncio.coroutine def connect(): try: transport, protocol = yield from aioamqp.connect() channel = yield from protocol.channel() except aioamqp.AmqpClosedConnection: pri...
<commit_before><commit_msg>Add basic python script for recieving mnemosyne AMQP messages<commit_after>
import asyncio import aioamqp @asyncio.coroutine def callback(channel, body, envelope, properties): print(body) @asyncio.coroutine def connect(): try: transport, protocol = yield from aioamqp.connect() channel = yield from protocol.channel() except aioamqp.AmqpClosedConnection: pri...
Add basic python script for recieving mnemosyne AMQP messagesimport asyncio import aioamqp @asyncio.coroutine def callback(channel, body, envelope, properties): print(body) @asyncio.coroutine def connect(): try: transport, protocol = yield from aioamqp.connect() channel = yield from protocol.c...
<commit_before><commit_msg>Add basic python script for recieving mnemosyne AMQP messages<commit_after>import asyncio import aioamqp @asyncio.coroutine def callback(channel, body, envelope, properties): print(body) @asyncio.coroutine def connect(): try: transport, protocol = yield from aioamqp.connect(...
720f537591fe4b79873fef904f504c401d244790
tests/test_ctests.py
tests/test_ctests.py
import os """Simple nosetest compatible test wrapper that runs the plain-C tests found in brushlib.""" # TODO: get more fine grained test setup # * Make the C test lib be able to report the registered testcases # * Make the C test lib be able to run a single specified test # * Use this to generate and execute one te...
Add a nose compatible wrapper
brushlib/tests: Add a nose compatible wrapper Allows to use the "nosetests" test runner to discover and run the brushlib C tests.
Python
isc
achadwick/libmypaint,b3sigma/libmypaint,achadwick/libmypaint,achadwick/libmypaint,b3sigma/libmypaint,achadwick/libmypaint,b3sigma/libmypaint
brushlib/tests: Add a nose compatible wrapper Allows to use the "nosetests" test runner to discover and run the brushlib C tests.
import os """Simple nosetest compatible test wrapper that runs the plain-C tests found in brushlib.""" # TODO: get more fine grained test setup # * Make the C test lib be able to report the registered testcases # * Make the C test lib be able to run a single specified test # * Use this to generate and execute one te...
<commit_before><commit_msg>brushlib/tests: Add a nose compatible wrapper Allows to use the "nosetests" test runner to discover and run the brushlib C tests.<commit_after>
import os """Simple nosetest compatible test wrapper that runs the plain-C tests found in brushlib.""" # TODO: get more fine grained test setup # * Make the C test lib be able to report the registered testcases # * Make the C test lib be able to run a single specified test # * Use this to generate and execute one te...
brushlib/tests: Add a nose compatible wrapper Allows to use the "nosetests" test runner to discover and run the brushlib C tests. import os """Simple nosetest compatible test wrapper that runs the plain-C tests found in brushlib.""" # TODO: get more fine grained test setup # * Make the C test lib be able to report t...
<commit_before><commit_msg>brushlib/tests: Add a nose compatible wrapper Allows to use the "nosetests" test runner to discover and run the brushlib C tests.<commit_after> import os """Simple nosetest compatible test wrapper that runs the plain-C tests found in brushlib.""" # TODO: get more fine grained test setup # ...
0d6c31fc6095d40b580568faf8aa787575a55183
newswall/providers/fb_graph_feed.py
newswall/providers/fb_graph_feed.py
""" Facebook Graph Feed API Provider ================================ This provider needs `offline_access` permission. See here how to get an access token with all permissions: http://liquid9.tv/blog/2011/may/12/obtaining-permanent-facebook-oauth-access-token/ Required configuration keys:: { "provider": "ne...
Add a simple provider for wall posts via the Facebook Graph API
Add a simple provider for wall posts via the Facebook Graph API
Python
bsd-3-clause
matthiask/django-newswall,michaelkuty/django-newswall,michaelkuty/django-newswall,HerraLampila/django-newswall,registerguard/django-newswall,registerguard/django-newswall,matthiask/django-newswall,HerraLampila/django-newswall
Add a simple provider for wall posts via the Facebook Graph API
""" Facebook Graph Feed API Provider ================================ This provider needs `offline_access` permission. See here how to get an access token with all permissions: http://liquid9.tv/blog/2011/may/12/obtaining-permanent-facebook-oauth-access-token/ Required configuration keys:: { "provider": "ne...
<commit_before><commit_msg>Add a simple provider for wall posts via the Facebook Graph API<commit_after>
""" Facebook Graph Feed API Provider ================================ This provider needs `offline_access` permission. See here how to get an access token with all permissions: http://liquid9.tv/blog/2011/may/12/obtaining-permanent-facebook-oauth-access-token/ Required configuration keys:: { "provider": "ne...
Add a simple provider for wall posts via the Facebook Graph API""" Facebook Graph Feed API Provider ================================ This provider needs `offline_access` permission. See here how to get an access token with all permissions: http://liquid9.tv/blog/2011/may/12/obtaining-permanent-facebook-oauth-access-t...
<commit_before><commit_msg>Add a simple provider for wall posts via the Facebook Graph API<commit_after>""" Facebook Graph Feed API Provider ================================ This provider needs `offline_access` permission. See here how to get an access token with all permissions: http://liquid9.tv/blog/2011/may/12/ob...