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
479f04ae23227ebb8a3a298d875b73cb1b6de3b6
ceph_deploy/tests/parser/test_rgw.py
ceph_deploy/tests/parser/test_rgw.py
import pytest from ceph_deploy.cli import get_parser class TestParserRGW(object): def setup(self): self.parser = get_parser() def test_rgw_help(self, capsys): with pytest.raises(SystemExit): self.parser.parse_args('rgw --help'.split()) out, err = capsys.readouterr() ...
Add argparse tests for rgw module
[RM-11742] Add argparse tests for rgw module Signed-off-by: Travis Rhoden <[email protected]>
Python
mit
branto1/ceph-deploy,Vicente-Cheng/ceph-deploy,shenhequnying/ceph-deploy,imzhulei/ceph-deploy,Vicente-Cheng/ceph-deploy,trhoden/ceph-deploy,SUSE/ceph-deploy-to-be-deleted,ceph/ceph-deploy,SUSE/ceph-deploy,zhouyuan/ceph-deploy,imzhulei/ceph-deploy,osynge/ceph-deploy,isyippee/ceph-deploy,ghxandsky/ceph-deploy,shenhequnyin...
[RM-11742] Add argparse tests for rgw module Signed-off-by: Travis Rhoden <[email protected]>
import pytest from ceph_deploy.cli import get_parser class TestParserRGW(object): def setup(self): self.parser = get_parser() def test_rgw_help(self, capsys): with pytest.raises(SystemExit): self.parser.parse_args('rgw --help'.split()) out, err = capsys.readouterr() ...
<commit_before><commit_msg>[RM-11742] Add argparse tests for rgw module Signed-off-by: Travis Rhoden <[email protected]><commit_after>
import pytest from ceph_deploy.cli import get_parser class TestParserRGW(object): def setup(self): self.parser = get_parser() def test_rgw_help(self, capsys): with pytest.raises(SystemExit): self.parser.parse_args('rgw --help'.split()) out, err = capsys.readouterr() ...
[RM-11742] Add argparse tests for rgw module Signed-off-by: Travis Rhoden <[email protected]>import pytest from ceph_deploy.cli import get_parser class TestParserRGW(object): def setup(self): self.parser = get_parser() def test_rgw_help(self, capsys): with...
<commit_before><commit_msg>[RM-11742] Add argparse tests for rgw module Signed-off-by: Travis Rhoden <[email protected]><commit_after>import pytest from ceph_deploy.cli import get_parser class TestParserRGW(object): def setup(self): self.parser = get_parser() def ...
56ab983036bcb5c78eee91483c1e610da69216d1
kubernetes/client/apis/__init__.py
kubernetes/client/apis/__init__.py
from __future__ import absolute_import import warnings # flake8: noqa # alias kubernetes.client.api package and print deprecation warning from kubernetes.client.api import * warnings.filterwarnings('default', module='kubernetes.client.apis') warnings.warn( "The package kubernetes.client.apis is renamed and depre...
Add kubernetes.client.apis as an alias to kubernetes.client.api
Add kubernetes.client.apis as an alias to kubernetes.client.api Reference: https://github.com/kubernetes-client/python/issues/974 Signed-off-by: Nabarun Pal <[email protected]>
Python
apache-2.0
kubernetes-client/python,kubernetes-client/python
Add kubernetes.client.apis as an alias to kubernetes.client.api Reference: https://github.com/kubernetes-client/python/issues/974 Signed-off-by: Nabarun Pal <[email protected]>
from __future__ import absolute_import import warnings # flake8: noqa # alias kubernetes.client.api package and print deprecation warning from kubernetes.client.api import * warnings.filterwarnings('default', module='kubernetes.client.apis') warnings.warn( "The package kubernetes.client.apis is renamed and depre...
<commit_before><commit_msg>Add kubernetes.client.apis as an alias to kubernetes.client.api Reference: https://github.com/kubernetes-client/python/issues/974 Signed-off-by: Nabarun Pal <[email protected]><commit_after>
from __future__ import absolute_import import warnings # flake8: noqa # alias kubernetes.client.api package and print deprecation warning from kubernetes.client.api import * warnings.filterwarnings('default', module='kubernetes.client.apis') warnings.warn( "The package kubernetes.client.apis is renamed and depre...
Add kubernetes.client.apis as an alias to kubernetes.client.api Reference: https://github.com/kubernetes-client/python/issues/974 Signed-off-by: Nabarun Pal <[email protected]>from __future__ import absolute_import import warnings # flake8: noqa # alias kubernetes.client.api package...
<commit_before><commit_msg>Add kubernetes.client.apis as an alias to kubernetes.client.api Reference: https://github.com/kubernetes-client/python/issues/974 Signed-off-by: Nabarun Pal <[email protected]><commit_after>from __future__ import absolute_import import warnings # flake8: no...
ad2b0447afbee92684ab0b4f14dc0d45a28f3ba2
tests/foomodulegen-auto.py
tests/foomodulegen-auto.py
#! /usr/bin/env python import sys import re import pybindgen from pybindgen.typehandlers import base as typehandlers from pybindgen import (ReturnValue, Parameter, Module, Function, FileCodeSink) from pybindgen import (CppMethod, CppConstructor, CppClass, Enum) from pybindgen.gccxmlparser import ModuleParser from pyb...
#! /usr/bin/env python import sys import re import pybindgen from pybindgen.typehandlers import base as typehandlers from pybindgen import (ReturnValue, Parameter, Module, Function, FileCodeSink) from pybindgen import (CppMethod, CppConstructor, CppClass, Enum) from pybindgen.gccxmlparser import ModuleParser from pyb...
Add a debug switch (-d) to enable debugger
Add a debug switch (-d) to enable debugger
Python
lgpl-2.1
cawka/pybindgen,caramucho/pybindgen,caramucho/pybindgen,cawka/pybindgen,cawka/pybindgen,caramucho/pybindgen,cawka/pybindgen,caramucho/pybindgen
#! /usr/bin/env python import sys import re import pybindgen from pybindgen.typehandlers import base as typehandlers from pybindgen import (ReturnValue, Parameter, Module, Function, FileCodeSink) from pybindgen import (CppMethod, CppConstructor, CppClass, Enum) from pybindgen.gccxmlparser import ModuleParser from pyb...
#! /usr/bin/env python import sys import re import pybindgen from pybindgen.typehandlers import base as typehandlers from pybindgen import (ReturnValue, Parameter, Module, Function, FileCodeSink) from pybindgen import (CppMethod, CppConstructor, CppClass, Enum) from pybindgen.gccxmlparser import ModuleParser from pyb...
<commit_before>#! /usr/bin/env python import sys import re import pybindgen from pybindgen.typehandlers import base as typehandlers from pybindgen import (ReturnValue, Parameter, Module, Function, FileCodeSink) from pybindgen import (CppMethod, CppConstructor, CppClass, Enum) from pybindgen.gccxmlparser import Module...
#! /usr/bin/env python import sys import re import pybindgen from pybindgen.typehandlers import base as typehandlers from pybindgen import (ReturnValue, Parameter, Module, Function, FileCodeSink) from pybindgen import (CppMethod, CppConstructor, CppClass, Enum) from pybindgen.gccxmlparser import ModuleParser from pyb...
#! /usr/bin/env python import sys import re import pybindgen from pybindgen.typehandlers import base as typehandlers from pybindgen import (ReturnValue, Parameter, Module, Function, FileCodeSink) from pybindgen import (CppMethod, CppConstructor, CppClass, Enum) from pybindgen.gccxmlparser import ModuleParser from pyb...
<commit_before>#! /usr/bin/env python import sys import re import pybindgen from pybindgen.typehandlers import base as typehandlers from pybindgen import (ReturnValue, Parameter, Module, Function, FileCodeSink) from pybindgen import (CppMethod, CppConstructor, CppClass, Enum) from pybindgen.gccxmlparser import Module...
cec400d28be8a3868f3a52fb5cbd27d63b31bbea
tests/test_nowallet.py
tests/test_nowallet.py
import pytest import nowallet.nowallet as nowallet @pytest.fixture def dummy_connection(event_loop): server, port = 'hsmithsxurybd7uh.onion', 53011 return nowallet.Connection(event_loop, server, port) @pytest.fixture def dummy_wallet(event_loop, dummy_connection): salt = "CORRECT HORSE" password = "BA...
Add initial fixtures for testing nowallet.py.
Add initial fixtures for testing nowallet.py.
Python
mit
metamarcdw/nowallet
Add initial fixtures for testing nowallet.py.
import pytest import nowallet.nowallet as nowallet @pytest.fixture def dummy_connection(event_loop): server, port = 'hsmithsxurybd7uh.onion', 53011 return nowallet.Connection(event_loop, server, port) @pytest.fixture def dummy_wallet(event_loop, dummy_connection): salt = "CORRECT HORSE" password = "BA...
<commit_before><commit_msg>Add initial fixtures for testing nowallet.py.<commit_after>
import pytest import nowallet.nowallet as nowallet @pytest.fixture def dummy_connection(event_loop): server, port = 'hsmithsxurybd7uh.onion', 53011 return nowallet.Connection(event_loop, server, port) @pytest.fixture def dummy_wallet(event_loop, dummy_connection): salt = "CORRECT HORSE" password = "BA...
Add initial fixtures for testing nowallet.py.import pytest import nowallet.nowallet as nowallet @pytest.fixture def dummy_connection(event_loop): server, port = 'hsmithsxurybd7uh.onion', 53011 return nowallet.Connection(event_loop, server, port) @pytest.fixture def dummy_wallet(event_loop, dummy_connection): ...
<commit_before><commit_msg>Add initial fixtures for testing nowallet.py.<commit_after>import pytest import nowallet.nowallet as nowallet @pytest.fixture def dummy_connection(event_loop): server, port = 'hsmithsxurybd7uh.onion', 53011 return nowallet.Connection(event_loop, server, port) @pytest.fixture def dum...
8008a05fe59503d99a2141f14fcbb89f0d80322c
tests/test_selected.py
tests/test_selected.py
from tests.base import IntegrationTest from time import sleep class TestAnnotateAction(IntegrationTest): viminput = """ * [ ] test task 1 #{uuid} * [ ] test task 2 #{uuid} """ tasks = [ dict(description="test task 1"), dict(description="test task 2"), ] def execute(sel...
Add tests for TaskWikiAnnotation command
test: Add tests for TaskWikiAnnotation command
Python
mit
phha/taskwiki,Spirotot/taskwiki
test: Add tests for TaskWikiAnnotation command
from tests.base import IntegrationTest from time import sleep class TestAnnotateAction(IntegrationTest): viminput = """ * [ ] test task 1 #{uuid} * [ ] test task 2 #{uuid} """ tasks = [ dict(description="test task 1"), dict(description="test task 2"), ] def execute(sel...
<commit_before><commit_msg>test: Add tests for TaskWikiAnnotation command<commit_after>
from tests.base import IntegrationTest from time import sleep class TestAnnotateAction(IntegrationTest): viminput = """ * [ ] test task 1 #{uuid} * [ ] test task 2 #{uuid} """ tasks = [ dict(description="test task 1"), dict(description="test task 2"), ] def execute(sel...
test: Add tests for TaskWikiAnnotation commandfrom tests.base import IntegrationTest from time import sleep class TestAnnotateAction(IntegrationTest): viminput = """ * [ ] test task 1 #{uuid} * [ ] test task 2 #{uuid} """ tasks = [ dict(description="test task 1"), dict(descript...
<commit_before><commit_msg>test: Add tests for TaskWikiAnnotation command<commit_after>from tests.base import IntegrationTest from time import sleep class TestAnnotateAction(IntegrationTest): viminput = """ * [ ] test task 1 #{uuid} * [ ] test task 2 #{uuid} """ tasks = [ dict(descript...
5b18671bfe64ab6a6f29465a40ffcdb372633ea6
data/migrations/update-wof-l10n.py
data/migrations/update-wof-l10n.py
# This expects a local checkout of whos on first data. It will fetch # the data from the on disk location for all existing neighbourhoods # in the database, and generate updates for all neighbourhoods that # have other local names. from tilequeue.wof import make_wof_filesystem_neighbourhood_fetcher from tilequeue.wof ...
Add migration for wof l10n names
Add migration for wof l10n names
Python
mit
mapzen/vector-datasource,mapzen/vector-datasource,mapzen/vector-datasource
Add migration for wof l10n names
# This expects a local checkout of whos on first data. It will fetch # the data from the on disk location for all existing neighbourhoods # in the database, and generate updates for all neighbourhoods that # have other local names. from tilequeue.wof import make_wof_filesystem_neighbourhood_fetcher from tilequeue.wof ...
<commit_before><commit_msg>Add migration for wof l10n names<commit_after>
# This expects a local checkout of whos on first data. It will fetch # the data from the on disk location for all existing neighbourhoods # in the database, and generate updates for all neighbourhoods that # have other local names. from tilequeue.wof import make_wof_filesystem_neighbourhood_fetcher from tilequeue.wof ...
Add migration for wof l10n names# This expects a local checkout of whos on first data. It will fetch # the data from the on disk location for all existing neighbourhoods # in the database, and generate updates for all neighbourhoods that # have other local names. from tilequeue.wof import make_wof_filesystem_neighbour...
<commit_before><commit_msg>Add migration for wof l10n names<commit_after># This expects a local checkout of whos on first data. It will fetch # the data from the on disk location for all existing neighbourhoods # in the database, and generate updates for all neighbourhoods that # have other local names. from tilequeue...
f2afa4c6666b1dc5105bd575d2e93ff691fe1f4c
compare_patches.py
compare_patches.py
import re import sys def ParsePatch(filename): lines = [line.rstrip('\n') for line in open(filename, 'r')] def MatchChar(char): def M(line): if line.startswith(char): return line[1:] return None return M def Matches(i, func): got = [] while i < len(lines): m = func(l...
Add initial version of tool to compare two patches
Add initial version of tool to compare two patches This doesn't track the filenames that patch hunks apply to yet. It also ignores patch hunks' contexts.
Python
bsd-3-clause
mseaborn/compare-patches
Add initial version of tool to compare two patches This doesn't track the filenames that patch hunks apply to yet. It also ignores patch hunks' contexts.
import re import sys def ParsePatch(filename): lines = [line.rstrip('\n') for line in open(filename, 'r')] def MatchChar(char): def M(line): if line.startswith(char): return line[1:] return None return M def Matches(i, func): got = [] while i < len(lines): m = func(l...
<commit_before><commit_msg>Add initial version of tool to compare two patches This doesn't track the filenames that patch hunks apply to yet. It also ignores patch hunks' contexts.<commit_after>
import re import sys def ParsePatch(filename): lines = [line.rstrip('\n') for line in open(filename, 'r')] def MatchChar(char): def M(line): if line.startswith(char): return line[1:] return None return M def Matches(i, func): got = [] while i < len(lines): m = func(l...
Add initial version of tool to compare two patches This doesn't track the filenames that patch hunks apply to yet. It also ignores patch hunks' contexts. import re import sys def ParsePatch(filename): lines = [line.rstrip('\n') for line in open(filename, 'r')] def MatchChar(char): def M(line): if lin...
<commit_before><commit_msg>Add initial version of tool to compare two patches This doesn't track the filenames that patch hunks apply to yet. It also ignores patch hunks' contexts.<commit_after> import re import sys def ParsePatch(filename): lines = [line.rstrip('\n') for line in open(filename, 'r')] def Match...
353a4c4758339b559fcfe70c5fdc7659f9f13560
examples/find-duplicated-contacts.py
examples/find-duplicated-contacts.py
#! /usr/bin/env python # -*- coding: utf-8 -*- """ Find components defining more than one contact with the same role. In older versions of PDC, it was possible to have multiple contacts with the same role. When limits for cardinality of this relationship were introduced, we need to find all components that would not ...
Add example script to find components with duplicate contacts
Add example script to find components with duplicate contacts While this script is not terribly useful for day-to-day life, it can serve as an example on how to use the client. JIRA: PDC-1105
Python
mit
xychu/product-definition-center,product-definition-center/product-definition-center,product-definition-center/product-definition-center,lao605/product-definition-center,lao605/product-definition-center,lao605/product-definition-center,xychu/product-definition-center,xychu/product-definition-center,tzhaoredhat/automatio...
Add example script to find components with duplicate contacts While this script is not terribly useful for day-to-day life, it can serve as an example on how to use the client. JIRA: PDC-1105
#! /usr/bin/env python # -*- coding: utf-8 -*- """ Find components defining more than one contact with the same role. In older versions of PDC, it was possible to have multiple contacts with the same role. When limits for cardinality of this relationship were introduced, we need to find all components that would not ...
<commit_before><commit_msg>Add example script to find components with duplicate contacts While this script is not terribly useful for day-to-day life, it can serve as an example on how to use the client. JIRA: PDC-1105<commit_after>
#! /usr/bin/env python # -*- coding: utf-8 -*- """ Find components defining more than one contact with the same role. In older versions of PDC, it was possible to have multiple contacts with the same role. When limits for cardinality of this relationship were introduced, we need to find all components that would not ...
Add example script to find components with duplicate contacts While this script is not terribly useful for day-to-day life, it can serve as an example on how to use the client. JIRA: PDC-1105#! /usr/bin/env python # -*- coding: utf-8 -*- """ Find components defining more than one contact with the same role. In olde...
<commit_before><commit_msg>Add example script to find components with duplicate contacts While this script is not terribly useful for day-to-day life, it can serve as an example on how to use the client. JIRA: PDC-1105<commit_after>#! /usr/bin/env python # -*- coding: utf-8 -*- """ Find components defining more than...
60e879d37f691132c23efb12f9709223f69354f5
examples/ideal-helices/test_cases.py
examples/ideal-helices/test_cases.py
#!/usr/bin/env ccp4-python ''' Created on 29 Dec 2015 @author: jmht ''' import cPickle import os import sys AMPLE_DIR = os.sep.join(os.path.abspath(os.path.dirname(__file__)).split(os.sep)[ :-2 ]) sys.path.append(os.path.join(AMPLE_DIR,'python')) import test_funcs test_dict = {} ###################################...
Test case for ideal helices
Test case for ideal helices
Python
bsd-3-clause
linucks/ample,rigdenlab/ample,rigdenlab/ample,linucks/ample
Test case for ideal helices
#!/usr/bin/env ccp4-python ''' Created on 29 Dec 2015 @author: jmht ''' import cPickle import os import sys AMPLE_DIR = os.sep.join(os.path.abspath(os.path.dirname(__file__)).split(os.sep)[ :-2 ]) sys.path.append(os.path.join(AMPLE_DIR,'python')) import test_funcs test_dict = {} ###################################...
<commit_before><commit_msg>Test case for ideal helices<commit_after>
#!/usr/bin/env ccp4-python ''' Created on 29 Dec 2015 @author: jmht ''' import cPickle import os import sys AMPLE_DIR = os.sep.join(os.path.abspath(os.path.dirname(__file__)).split(os.sep)[ :-2 ]) sys.path.append(os.path.join(AMPLE_DIR,'python')) import test_funcs test_dict = {} ###################################...
Test case for ideal helices#!/usr/bin/env ccp4-python ''' Created on 29 Dec 2015 @author: jmht ''' import cPickle import os import sys AMPLE_DIR = os.sep.join(os.path.abspath(os.path.dirname(__file__)).split(os.sep)[ :-2 ]) sys.path.append(os.path.join(AMPLE_DIR,'python')) import test_funcs test_dict = {} ########...
<commit_before><commit_msg>Test case for ideal helices<commit_after>#!/usr/bin/env ccp4-python ''' Created on 29 Dec 2015 @author: jmht ''' import cPickle import os import sys AMPLE_DIR = os.sep.join(os.path.abspath(os.path.dirname(__file__)).split(os.sep)[ :-2 ]) sys.path.append(os.path.join(AMPLE_DIR,'python')) im...
9342e0f699c97f94274d30040b178484bbafff94
mpld3/test_plots/test_date_ticks.py
mpld3/test_plots/test_date_ticks.py
"""Plot to test custom date axis tick locations and labels""" from datetime import datetime import matplotlib.pyplot as plt import mpld3 def create_plot(): times = [datetime(2013, 12, i) for i in range(1,9)] ticks = [times[2],times[3],times[-2]] labels = [t.strftime("%Y-%m-%d") for t in ticks] plt.plo...
Add test plot for custom date ticks
Add test plot for custom date ticks
Python
bsd-3-clause
jakevdp/mpld3,aflaxman/mpld3,jakevdp/mpld3,etgalloway/mpld3,e-koch/mpld3,kdheepak89/mpld3,etgalloway/mpld3,aflaxman/mpld3,e-koch/mpld3,kdheepak89/mpld3,mpld3/mpld3,mpld3/mpld3
Add test plot for custom date ticks
"""Plot to test custom date axis tick locations and labels""" from datetime import datetime import matplotlib.pyplot as plt import mpld3 def create_plot(): times = [datetime(2013, 12, i) for i in range(1,9)] ticks = [times[2],times[3],times[-2]] labels = [t.strftime("%Y-%m-%d") for t in ticks] plt.plo...
<commit_before><commit_msg>Add test plot for custom date ticks<commit_after>
"""Plot to test custom date axis tick locations and labels""" from datetime import datetime import matplotlib.pyplot as plt import mpld3 def create_plot(): times = [datetime(2013, 12, i) for i in range(1,9)] ticks = [times[2],times[3],times[-2]] labels = [t.strftime("%Y-%m-%d") for t in ticks] plt.plo...
Add test plot for custom date ticks"""Plot to test custom date axis tick locations and labels""" from datetime import datetime import matplotlib.pyplot as plt import mpld3 def create_plot(): times = [datetime(2013, 12, i) for i in range(1,9)] ticks = [times[2],times[3],times[-2]] labels = [t.strftime("%Y-%...
<commit_before><commit_msg>Add test plot for custom date ticks<commit_after>"""Plot to test custom date axis tick locations and labels""" from datetime import datetime import matplotlib.pyplot as plt import mpld3 def create_plot(): times = [datetime(2013, 12, i) for i in range(1,9)] ticks = [times[2],times[3],...
845cc0cb8acc28d328a89af77cddb59af666f2d0
examples/plot_implied_timescales.py
examples/plot_implied_timescales.py
""" Implied Timescales Plot =============== """ from msmbuilder.example_datasets import FsPeptide from msmbuilder.featurizer import DihedralFeaturizer from msmbuilder.decomposition import tICA from msmbuilder.cluster import MiniBatchKMeans from msmbuilder.msm import MarkovStateModel import numpy as np import msmexplo...
Add example of Implied Timescales Plot
Add example of Implied Timescales Plot
Python
mit
msmexplorer/msmexplorer,msmexplorer/msmexplorer
Add example of Implied Timescales Plot
""" Implied Timescales Plot =============== """ from msmbuilder.example_datasets import FsPeptide from msmbuilder.featurizer import DihedralFeaturizer from msmbuilder.decomposition import tICA from msmbuilder.cluster import MiniBatchKMeans from msmbuilder.msm import MarkovStateModel import numpy as np import msmexplo...
<commit_before><commit_msg>Add example of Implied Timescales Plot<commit_after>
""" Implied Timescales Plot =============== """ from msmbuilder.example_datasets import FsPeptide from msmbuilder.featurizer import DihedralFeaturizer from msmbuilder.decomposition import tICA from msmbuilder.cluster import MiniBatchKMeans from msmbuilder.msm import MarkovStateModel import numpy as np import msmexplo...
Add example of Implied Timescales Plot""" Implied Timescales Plot =============== """ from msmbuilder.example_datasets import FsPeptide from msmbuilder.featurizer import DihedralFeaturizer from msmbuilder.decomposition import tICA from msmbuilder.cluster import MiniBatchKMeans from msmbuilder.msm import MarkovStateMode...
<commit_before><commit_msg>Add example of Implied Timescales Plot<commit_after>""" Implied Timescales Plot =============== """ from msmbuilder.example_datasets import FsPeptide from msmbuilder.featurizer import DihedralFeaturizer from msmbuilder.decomposition import tICA from msmbuilder.cluster import MiniBatchKMeans f...
79a1f426e22f3c213bbb081f4ca23ccf1a6f61d7
openedx/core/djangoapps/content/block_structure/migrations/0005_trim_leading_slashes_in_data_path.py
openedx/core/djangoapps/content/block_structure/migrations/0005_trim_leading_slashes_in_data_path.py
""" Data migration to convert absolute paths in block_structure.data to be relative. This has only been tested with MySQL, though it should also work for Postgres as well. This is necessary to manually correct absolute paths in the "data" field of the block_structure table. For S3 storage, having a path that starts wi...
Convert block_structure.data to relative paths (TNL-8335)
fix: Convert block_structure.data to relative paths (TNL-8335) In order to upgrade to Django > 2.2.20, we can't continue to use absolute paths in the block_structure's data FileField. This used to work for S3, but it will not work going forward due to a security fix in Django 2.2.21. This data migration will remove t...
Python
agpl-3.0
eduNEXT/edunext-platform,eduNEXT/edunext-platform,eduNEXT/edunext-platform,eduNEXT/edunext-platform
fix: Convert block_structure.data to relative paths (TNL-8335) In order to upgrade to Django > 2.2.20, we can't continue to use absolute paths in the block_structure's data FileField. This used to work for S3, but it will not work going forward due to a security fix in Django 2.2.21. This data migration will remove t...
""" Data migration to convert absolute paths in block_structure.data to be relative. This has only been tested with MySQL, though it should also work for Postgres as well. This is necessary to manually correct absolute paths in the "data" field of the block_structure table. For S3 storage, having a path that starts wi...
<commit_before><commit_msg>fix: Convert block_structure.data to relative paths (TNL-8335) In order to upgrade to Django > 2.2.20, we can't continue to use absolute paths in the block_structure's data FileField. This used to work for S3, but it will not work going forward due to a security fix in Django 2.2.21. This d...
""" Data migration to convert absolute paths in block_structure.data to be relative. This has only been tested with MySQL, though it should also work for Postgres as well. This is necessary to manually correct absolute paths in the "data" field of the block_structure table. For S3 storage, having a path that starts wi...
fix: Convert block_structure.data to relative paths (TNL-8335) In order to upgrade to Django > 2.2.20, we can't continue to use absolute paths in the block_structure's data FileField. This used to work for S3, but it will not work going forward due to a security fix in Django 2.2.21. This data migration will remove t...
<commit_before><commit_msg>fix: Convert block_structure.data to relative paths (TNL-8335) In order to upgrade to Django > 2.2.20, we can't continue to use absolute paths in the block_structure's data FileField. This used to work for S3, but it will not work going forward due to a security fix in Django 2.2.21. This d...
079b9f0856e7574c3df10ad5e847b5812f6a2ca8
filter-dictionary/exclude-words.py
filter-dictionary/exclude-words.py
#!/usr/bin/env python3 # # Reads a dictionary and a file that contains a list of words that should be # removed. Then prints the dictionary with those words excluded. import argparse import sys import codecs from pronunciationdictionary import PronunciationDictionary from filetypes import TextFileType, BinaryFileType ...
Remove listed files from a pronunciation dictionary.
Remove listed files from a pronunciation dictionary.
Python
apache-2.0
senarvi/senarvi-speech
Remove listed files from a pronunciation dictionary.
#!/usr/bin/env python3 # # Reads a dictionary and a file that contains a list of words that should be # removed. Then prints the dictionary with those words excluded. import argparse import sys import codecs from pronunciationdictionary import PronunciationDictionary from filetypes import TextFileType, BinaryFileType ...
<commit_before><commit_msg>Remove listed files from a pronunciation dictionary.<commit_after>
#!/usr/bin/env python3 # # Reads a dictionary and a file that contains a list of words that should be # removed. Then prints the dictionary with those words excluded. import argparse import sys import codecs from pronunciationdictionary import PronunciationDictionary from filetypes import TextFileType, BinaryFileType ...
Remove listed files from a pronunciation dictionary.#!/usr/bin/env python3 # # Reads a dictionary and a file that contains a list of words that should be # removed. Then prints the dictionary with those words excluded. import argparse import sys import codecs from pronunciationdictionary import PronunciationDictionary...
<commit_before><commit_msg>Remove listed files from a pronunciation dictionary.<commit_after>#!/usr/bin/env python3 # # Reads a dictionary and a file that contains a list of words that should be # removed. Then prints the dictionary with those words excluded. import argparse import sys import codecs from pronunciation...
197e6d0270803b8f32ae934def4cade29afab997
metpy/plots/tests/test_wx_symbols.py
metpy/plots/tests/test_wx_symbols.py
# Copyright (c) 2008-2015 MetPy Developers. # Distributed under the terms of the BSD 3-Clause License. # SPDX-License-Identifier: BSD-3-Clause from metpy.plots.wx_symbols import current_weather def test_mapper(): 'Test for symbol mapping functionality' assert current_weather(0) == '' assert current_weathe...
Add tests for weather symbol mapping.
Add tests for weather symbol mapping.
Python
bsd-3-clause
Unidata/MetPy,jrleeman/MetPy,ahill818/MetPy,ahaberlie/MetPy,jrleeman/MetPy,ahaberlie/MetPy,dopplershift/MetPy,Unidata/MetPy,ShawnMurd/MetPy,dopplershift/MetPy,deeplycloudy/MetPy
Add tests for weather symbol mapping.
# Copyright (c) 2008-2015 MetPy Developers. # Distributed under the terms of the BSD 3-Clause License. # SPDX-License-Identifier: BSD-3-Clause from metpy.plots.wx_symbols import current_weather def test_mapper(): 'Test for symbol mapping functionality' assert current_weather(0) == '' assert current_weathe...
<commit_before><commit_msg>Add tests for weather symbol mapping.<commit_after>
# Copyright (c) 2008-2015 MetPy Developers. # Distributed under the terms of the BSD 3-Clause License. # SPDX-License-Identifier: BSD-3-Clause from metpy.plots.wx_symbols import current_weather def test_mapper(): 'Test for symbol mapping functionality' assert current_weather(0) == '' assert current_weathe...
Add tests for weather symbol mapping.# Copyright (c) 2008-2015 MetPy Developers. # Distributed under the terms of the BSD 3-Clause License. # SPDX-License-Identifier: BSD-3-Clause from metpy.plots.wx_symbols import current_weather def test_mapper(): 'Test for symbol mapping functionality' assert current_weath...
<commit_before><commit_msg>Add tests for weather symbol mapping.<commit_after># Copyright (c) 2008-2015 MetPy Developers. # Distributed under the terms of the BSD 3-Clause License. # SPDX-License-Identifier: BSD-3-Clause from metpy.plots.wx_symbols import current_weather def test_mapper(): 'Test for symbol mappin...
0e8a1ce04d230d04cb36098fe53ccd5c239bbd54
mnist/tensorflow/fgsm_adversarial.py
mnist/tensorflow/fgsm_adversarial.py
from tensorflow.examples.tutorials.mnist import input_data import tensorflow as tf import argparse import matplotlib.pyplot as pyplot import random from feedforward_ann import neural_network, SAVE_PATH def fgsm(x, y_true, y_hat, epsilon=0.075): loss = tf.nn.softmax_cross_entropy_with_logits( labels=y_...
Add simple FGSM adversarial example crafting
Add simple FGSM adversarial example crafting
Python
apache-2.0
BrandonLMorris/ml-examples
Add simple FGSM adversarial example crafting
from tensorflow.examples.tutorials.mnist import input_data import tensorflow as tf import argparse import matplotlib.pyplot as pyplot import random from feedforward_ann import neural_network, SAVE_PATH def fgsm(x, y_true, y_hat, epsilon=0.075): loss = tf.nn.softmax_cross_entropy_with_logits( labels=y_...
<commit_before><commit_msg>Add simple FGSM adversarial example crafting<commit_after>
from tensorflow.examples.tutorials.mnist import input_data import tensorflow as tf import argparse import matplotlib.pyplot as pyplot import random from feedforward_ann import neural_network, SAVE_PATH def fgsm(x, y_true, y_hat, epsilon=0.075): loss = tf.nn.softmax_cross_entropy_with_logits( labels=y_...
Add simple FGSM adversarial example craftingfrom tensorflow.examples.tutorials.mnist import input_data import tensorflow as tf import argparse import matplotlib.pyplot as pyplot import random from feedforward_ann import neural_network, SAVE_PATH def fgsm(x, y_true, y_hat, epsilon=0.075): loss = tf.nn.softmax_cros...
<commit_before><commit_msg>Add simple FGSM adversarial example crafting<commit_after>from tensorflow.examples.tutorials.mnist import input_data import tensorflow as tf import argparse import matplotlib.pyplot as pyplot import random from feedforward_ann import neural_network, SAVE_PATH def fgsm(x, y_true, y_hat, epsi...
d812af8535605ff963c3d3e3be1528dc615d5987
tests/test_async.py
tests/test_async.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2011-2012 Antoine Bertin <[email protected]> # # This file is part of subliminal. # # subliminal is free software; you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by # the Free Software Foundatio...
Add a unittest for async
Add a unittest for async
Python
mit
t4lwh/subliminal,hpsbranco/subliminal,neo1691/subliminal,goll/subliminal,Diaoul/subliminal,juanmhidalgo/subliminal,SickRage/subliminal,Elettronik/subliminal,nvbn/subliminal,pums974/subliminal,oxan/subliminal,fernandog/subliminal,bogdal/subliminal,ofir123/subliminal,kbkailashbagaria/subliminal,ravselj/subliminal,ratoaq2...
Add a unittest for async
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2011-2012 Antoine Bertin <[email protected]> # # This file is part of subliminal. # # subliminal is free software; you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by # the Free Software Foundatio...
<commit_before><commit_msg>Add a unittest for async<commit_after>
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2011-2012 Antoine Bertin <[email protected]> # # This file is part of subliminal. # # subliminal is free software; you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by # the Free Software Foundatio...
Add a unittest for async#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2011-2012 Antoine Bertin <[email protected]> # # This file is part of subliminal. # # subliminal is free software; you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by # the...
<commit_before><commit_msg>Add a unittest for async<commit_after>#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2011-2012 Antoine Bertin <[email protected]> # # This file is part of subliminal. # # subliminal is free software; you can redistribute it and/or modify it under # the terms of the GNU Lesser Gen...
03188fe77f895b918dbbf3903a5eea8eb5256cd0
evaluation/packages/primitive.py
evaluation/packages/primitive.py
"""@package Primitive This module is the Python counterpart of the C++ LinePrimitive and and PlanePrimitive classes See C++ GlobOpt project for more details on Primitives """ import numpy as np class Primitive(object): def __init__(self, uid, did, pos=np.zeros(...
Add new Primitive class + loading function to load Primitive arrays from file
Add new Primitive class + loading function to load Primitive arrays from file
Python
apache-2.0
amonszpart/globOpt,amonszpart/globOpt,amonszpart/globOpt,NUAAXXY/globOpt,amonszpart/globOpt,NUAAXXY/globOpt,amonszpart/globOpt,amonszpart/globOpt,NUAAXXY/globOpt,NUAAXXY/globOpt,NUAAXXY/globOpt,NUAAXXY/globOpt
Add new Primitive class + loading function to load Primitive arrays from file
"""@package Primitive This module is the Python counterpart of the C++ LinePrimitive and and PlanePrimitive classes See C++ GlobOpt project for more details on Primitives """ import numpy as np class Primitive(object): def __init__(self, uid, did, pos=np.zeros(...
<commit_before><commit_msg>Add new Primitive class + loading function to load Primitive arrays from file<commit_after>
"""@package Primitive This module is the Python counterpart of the C++ LinePrimitive and and PlanePrimitive classes See C++ GlobOpt project for more details on Primitives """ import numpy as np class Primitive(object): def __init__(self, uid, did, pos=np.zeros(...
Add new Primitive class + loading function to load Primitive arrays from file"""@package Primitive This module is the Python counterpart of the C++ LinePrimitive and and PlanePrimitive classes See C++ GlobOpt project for more details on Primitives """ import numpy as np class Primitive(object): def __init__(self...
<commit_before><commit_msg>Add new Primitive class + loading function to load Primitive arrays from file<commit_after>"""@package Primitive This module is the Python counterpart of the C++ LinePrimitive and and PlanePrimitive classes See C++ GlobOpt project for more details on Primitives """ import numpy as np class ...
139db56d67ff7f0e1761c303e0074d713f25d646
gpi/Poisson_GPI.py
gpi/Poisson_GPI.py
# Author: Ashley Anderson III <[email protected]> # Date: 2015-10-10 19:37 # Copyright (C) 2015 Dignity Health from __future__ import absolute_import, division, print_function, unicode_literals import os # gpi, future import gpi from bart.gpi.borg import IFilePath, OFilePath, Command # bart import bart base_path ...
Add Poission node - generates Poisson-disc sampling pattern
Add Poission node - generates Poisson-disc sampling pattern
Python
bsd-3-clause
nckz/bart,nckz/bart,nckz/bart,nckz/bart,nckz/bart
Add Poission node - generates Poisson-disc sampling pattern
# Author: Ashley Anderson III <[email protected]> # Date: 2015-10-10 19:37 # Copyright (C) 2015 Dignity Health from __future__ import absolute_import, division, print_function, unicode_literals import os # gpi, future import gpi from bart.gpi.borg import IFilePath, OFilePath, Command # bart import bart base_path ...
<commit_before><commit_msg>Add Poission node - generates Poisson-disc sampling pattern<commit_after>
# Author: Ashley Anderson III <[email protected]> # Date: 2015-10-10 19:37 # Copyright (C) 2015 Dignity Health from __future__ import absolute_import, division, print_function, unicode_literals import os # gpi, future import gpi from bart.gpi.borg import IFilePath, OFilePath, Command # bart import bart base_path ...
Add Poission node - generates Poisson-disc sampling pattern# Author: Ashley Anderson III <[email protected]> # Date: 2015-10-10 19:37 # Copyright (C) 2015 Dignity Health from __future__ import absolute_import, division, print_function, unicode_literals import os # gpi, future import gpi from bart.gpi.borg import I...
<commit_before><commit_msg>Add Poission node - generates Poisson-disc sampling pattern<commit_after># Author: Ashley Anderson III <[email protected]> # Date: 2015-10-10 19:37 # Copyright (C) 2015 Dignity Health from __future__ import absolute_import, division, print_function, unicode_literals import os # gpi, futu...
393309ed43fbf852a698fe7dcd763d282a761590
src/pluggy/_result.py
src/pluggy/_result.py
""" Hook wrapper "result" utilities. """ import sys import warnings _py3 = sys.version_info > (3, 0) if not _py3: exec( """ def _reraise(cls, val, tb): raise cls, val, tb """ ) def _raise_wrapfail(wrap_controller, msg): co = wrap_controller.gi_code raise RuntimeError( "wrap_cont...
Move wrapper "result" types into new module
Move wrapper "result" types into new module
Python
mit
RonnyPfannschmidt/pluggy,RonnyPfannschmidt/pluggy,hpk42/pluggy,pytest-dev/pluggy,pytest-dev/pluggy
Move wrapper "result" types into new module
""" Hook wrapper "result" utilities. """ import sys import warnings _py3 = sys.version_info > (3, 0) if not _py3: exec( """ def _reraise(cls, val, tb): raise cls, val, tb """ ) def _raise_wrapfail(wrap_controller, msg): co = wrap_controller.gi_code raise RuntimeError( "wrap_cont...
<commit_before><commit_msg>Move wrapper "result" types into new module<commit_after>
""" Hook wrapper "result" utilities. """ import sys import warnings _py3 = sys.version_info > (3, 0) if not _py3: exec( """ def _reraise(cls, val, tb): raise cls, val, tb """ ) def _raise_wrapfail(wrap_controller, msg): co = wrap_controller.gi_code raise RuntimeError( "wrap_cont...
Move wrapper "result" types into new module""" Hook wrapper "result" utilities. """ import sys import warnings _py3 = sys.version_info > (3, 0) if not _py3: exec( """ def _reraise(cls, val, tb): raise cls, val, tb """ ) def _raise_wrapfail(wrap_controller, msg): co = wrap_controller.gi_code...
<commit_before><commit_msg>Move wrapper "result" types into new module<commit_after>""" Hook wrapper "result" utilities. """ import sys import warnings _py3 = sys.version_info > (3, 0) if not _py3: exec( """ def _reraise(cls, val, tb): raise cls, val, tb """ ) def _raise_wrapfail(wrap_controlle...
50e588ff368ce3ccd269f432ee543bd022a4ab22
polyaxon/auditor/events/superuser.py
polyaxon/auditor/events/superuser.py
import auditor from libs.event_manager import event_types from libs.event_manager.event import Event class SuperUserRoleGrantedEvent(Event): type = event_types.SUPERUSER_ROLE_GRANTED class SuperUserRoleRevokedEvent(Event): type = event_types.SUPERUSER_ROLE_REVOKED auditor.register(SuperUserRoleGrantedEven...
Add auditor super user's events
Add auditor super user's events
Python
apache-2.0
polyaxon/polyaxon,polyaxon/polyaxon,polyaxon/polyaxon
Add auditor super user's events
import auditor from libs.event_manager import event_types from libs.event_manager.event import Event class SuperUserRoleGrantedEvent(Event): type = event_types.SUPERUSER_ROLE_GRANTED class SuperUserRoleRevokedEvent(Event): type = event_types.SUPERUSER_ROLE_REVOKED auditor.register(SuperUserRoleGrantedEven...
<commit_before><commit_msg>Add auditor super user's events<commit_after>
import auditor from libs.event_manager import event_types from libs.event_manager.event import Event class SuperUserRoleGrantedEvent(Event): type = event_types.SUPERUSER_ROLE_GRANTED class SuperUserRoleRevokedEvent(Event): type = event_types.SUPERUSER_ROLE_REVOKED auditor.register(SuperUserRoleGrantedEven...
Add auditor super user's eventsimport auditor from libs.event_manager import event_types from libs.event_manager.event import Event class SuperUserRoleGrantedEvent(Event): type = event_types.SUPERUSER_ROLE_GRANTED class SuperUserRoleRevokedEvent(Event): type = event_types.SUPERUSER_ROLE_REVOKED auditor.re...
<commit_before><commit_msg>Add auditor super user's events<commit_after>import auditor from libs.event_manager import event_types from libs.event_manager.event import Event class SuperUserRoleGrantedEvent(Event): type = event_types.SUPERUSER_ROLE_GRANTED class SuperUserRoleRevokedEvent(Event): type = event_...
1d7660282be42d96d912855eeb3bd4dfe830f224
bitvault/test/scripts/client_usage.py
bitvault/test/scripts/client_usage.py
import time import bitvault current_milli_time = lambda: int(round(time.time())) email = '{0}@bitvault.io'.format(current_milli_time()) password = u'incredibly_secure' ## API discovery # # The BitVault server provides a JSON description of its API that allows # the client to generate all necessary resource classes ...
Add high-level client usage script
Add high-level client usage script
Python
mit
GemHQ/round-py
Add high-level client usage script
import time import bitvault current_milli_time = lambda: int(round(time.time())) email = '{0}@bitvault.io'.format(current_milli_time()) password = u'incredibly_secure' ## API discovery # # The BitVault server provides a JSON description of its API that allows # the client to generate all necessary resource classes ...
<commit_before><commit_msg>Add high-level client usage script<commit_after>
import time import bitvault current_milli_time = lambda: int(round(time.time())) email = '{0}@bitvault.io'.format(current_milli_time()) password = u'incredibly_secure' ## API discovery # # The BitVault server provides a JSON description of its API that allows # the client to generate all necessary resource classes ...
Add high-level client usage scriptimport time import bitvault current_milli_time = lambda: int(round(time.time())) email = '{0}@bitvault.io'.format(current_milli_time()) password = u'incredibly_secure' ## API discovery # # The BitVault server provides a JSON description of its API that allows # the client to genera...
<commit_before><commit_msg>Add high-level client usage script<commit_after>import time import bitvault current_milli_time = lambda: int(round(time.time())) email = '{0}@bitvault.io'.format(current_milli_time()) password = u'incredibly_secure' ## API discovery # # The BitVault server provides a JSON description of i...
bda490f0e27b49d54ca7fa71e8725dcdf9da0861
registration/tests/test_provision.py
registration/tests/test_provision.py
# -*- coding: utf-8 -*- # # OpenCraft -- tools to aid developing and hosting free software projects # Copyright (C) 2015 OpenCraft <[email protected]> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Soft...
Add unit test for beta test instance provisioning.
Add unit test for beta test instance provisioning.
Python
agpl-3.0
open-craft/opencraft,open-craft/opencraft,open-craft/opencraft,open-craft/opencraft,open-craft/opencraft
Add unit test for beta test instance provisioning.
# -*- coding: utf-8 -*- # # OpenCraft -- tools to aid developing and hosting free software projects # Copyright (C) 2015 OpenCraft <[email protected]> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Soft...
<commit_before><commit_msg>Add unit test for beta test instance provisioning.<commit_after>
# -*- coding: utf-8 -*- # # OpenCraft -- tools to aid developing and hosting free software projects # Copyright (C) 2015 OpenCraft <[email protected]> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Soft...
Add unit test for beta test instance provisioning.# -*- coding: utf-8 -*- # # OpenCraft -- tools to aid developing and hosting free software projects # Copyright (C) 2015 OpenCraft <[email protected]> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero Gene...
<commit_before><commit_msg>Add unit test for beta test instance provisioning.<commit_after># -*- coding: utf-8 -*- # # OpenCraft -- tools to aid developing and hosting free software projects # Copyright (C) 2015 OpenCraft <[email protected]> # # This program is free software: you can redistribute it and/or modify # ...
dc09ffa8abd791af99dfc28bced6aa33c46308f8
Python_Data/smpl3.py
Python_Data/smpl3.py
from random import randint as rndInt def main(): l = list([rndInt(1,100) for x in range(rndInt(5,900))]) # min_1(l) # min_2(l) # Simple O(n²) def min_1(list): minOut = list[0] for i in list: minLoc = i for j in list: if j < minLoc: minLoc = j if ...
Add very simple algorithm for teaching purposes about the big O notation
Add very simple algorithm for teaching purposes about the big O notation
Python
unlicense
robotenique/RandomAccessMemory,robotenique/RandomAccessMemory,robotenique/RandomAccessMemory
Add very simple algorithm for teaching purposes about the big O notation
from random import randint as rndInt def main(): l = list([rndInt(1,100) for x in range(rndInt(5,900))]) # min_1(l) # min_2(l) # Simple O(n²) def min_1(list): minOut = list[0] for i in list: minLoc = i for j in list: if j < minLoc: minLoc = j if ...
<commit_before><commit_msg>Add very simple algorithm for teaching purposes about the big O notation<commit_after>
from random import randint as rndInt def main(): l = list([rndInt(1,100) for x in range(rndInt(5,900))]) # min_1(l) # min_2(l) # Simple O(n²) def min_1(list): minOut = list[0] for i in list: minLoc = i for j in list: if j < minLoc: minLoc = j if ...
Add very simple algorithm for teaching purposes about the big O notationfrom random import randint as rndInt def main(): l = list([rndInt(1,100) for x in range(rndInt(5,900))]) # min_1(l) # min_2(l) # Simple O(n²) def min_1(list): minOut = list[0] for i in list: minLoc = i for j in...
<commit_before><commit_msg>Add very simple algorithm for teaching purposes about the big O notation<commit_after>from random import randint as rndInt def main(): l = list([rndInt(1,100) for x in range(rndInt(5,900))]) # min_1(l) # min_2(l) # Simple O(n²) def min_1(list): minOut = list[0] for i in ...
6c7d6881751784e30324795394abfb8fc3eb75a8
demo/amqp_clock.py
demo/amqp_clock.py
#!/usr/bin/env python """ AMQP Clock Fires off simple messages at one-minute intervals to a topic exchange named 'clock', with the topic of the message being the local time as 'year.month.date.dow.hour.minute', for example: '2007.11.26.1.12.33', where the dow (day of week) is 0 for Sunday, 1 for Monday, and so on (sim...
Add another demo program, one that spits out messages at regular intervals.
Add another demo program, one that spits out messages at regular intervals.
Python
lgpl-2.1
kmonsoor/py-amqplib,ebin123456/py-amqplib,jaknight/py-amqplib,barryp/py-amqplib
Add another demo program, one that spits out messages at regular intervals.
#!/usr/bin/env python """ AMQP Clock Fires off simple messages at one-minute intervals to a topic exchange named 'clock', with the topic of the message being the local time as 'year.month.date.dow.hour.minute', for example: '2007.11.26.1.12.33', where the dow (day of week) is 0 for Sunday, 1 for Monday, and so on (sim...
<commit_before><commit_msg>Add another demo program, one that spits out messages at regular intervals.<commit_after>
#!/usr/bin/env python """ AMQP Clock Fires off simple messages at one-minute intervals to a topic exchange named 'clock', with the topic of the message being the local time as 'year.month.date.dow.hour.minute', for example: '2007.11.26.1.12.33', where the dow (day of week) is 0 for Sunday, 1 for Monday, and so on (sim...
Add another demo program, one that spits out messages at regular intervals.#!/usr/bin/env python """ AMQP Clock Fires off simple messages at one-minute intervals to a topic exchange named 'clock', with the topic of the message being the local time as 'year.month.date.dow.hour.minute', for example: '2007.11.26.1.12.33'...
<commit_before><commit_msg>Add another demo program, one that spits out messages at regular intervals.<commit_after>#!/usr/bin/env python """ AMQP Clock Fires off simple messages at one-minute intervals to a topic exchange named 'clock', with the topic of the message being the local time as 'year.month.date.dow.hour.m...
4f4636a04b01ee0ebe45c55c98328540be13e990
napper_memaslap.py
napper_memaslap.py
import sys, socket, time, logging import shlex, subprocess from kazoo.client import KazooClient from kazoo.exceptions import NodeExistsError def zkConnect(conn_str): zk = KazooClient(hosts=conn_str) zk.start() return zk def zkCreateJobDir(zk, job_name): zk.ensure_path("/napper/memaslap/%s" % (job_name)) def ...
Add wrapper for memaslap load tester.
Add wrapper for memaslap load tester.
Python
mit
ms705/napper
Add wrapper for memaslap load tester.
import sys, socket, time, logging import shlex, subprocess from kazoo.client import KazooClient from kazoo.exceptions import NodeExistsError def zkConnect(conn_str): zk = KazooClient(hosts=conn_str) zk.start() return zk def zkCreateJobDir(zk, job_name): zk.ensure_path("/napper/memaslap/%s" % (job_name)) def ...
<commit_before><commit_msg>Add wrapper for memaslap load tester.<commit_after>
import sys, socket, time, logging import shlex, subprocess from kazoo.client import KazooClient from kazoo.exceptions import NodeExistsError def zkConnect(conn_str): zk = KazooClient(hosts=conn_str) zk.start() return zk def zkCreateJobDir(zk, job_name): zk.ensure_path("/napper/memaslap/%s" % (job_name)) def ...
Add wrapper for memaslap load tester.import sys, socket, time, logging import shlex, subprocess from kazoo.client import KazooClient from kazoo.exceptions import NodeExistsError def zkConnect(conn_str): zk = KazooClient(hosts=conn_str) zk.start() return zk def zkCreateJobDir(zk, job_name): zk.ensure_path("/na...
<commit_before><commit_msg>Add wrapper for memaslap load tester.<commit_after>import sys, socket, time, logging import shlex, subprocess from kazoo.client import KazooClient from kazoo.exceptions import NodeExistsError def zkConnect(conn_str): zk = KazooClient(hosts=conn_str) zk.start() return zk def zkCreateJo...
9c307606152fc28a7d017c39d8621433e6485034
scripts/contrib/inject_s2s_config.py
scripts/contrib/inject_s2s_config.py
#!/usr/bin/env python from __future__ import print_function import sys import argparse import numpy as np import json import yaml DESC = "Adds special node including s2s options to Nematus model.npz file." S2S_SPECIAL_NODE = "special:model.yml" def main(): args = parse_args() print("Loading config {}".fo...
Add script injecting s2s options to nematus .npz models
Add script injecting s2s options to nematus .npz models
Python
mit
marian-nmt/marian-train,emjotde/amunmt,emjotde/amunmt,marian-nmt/marian-train,emjotde/amunn,emjotde/amunmt,amunmt/marian,emjotde/amunmt,emjotde/amunn,marian-nmt/marian-train,marian-nmt/marian-train,emjotde/amunn,amunmt/marian,emjotde/amunn,amunmt/marian,marian-nmt/marian-train,emjotde/Marian,emjotde/Marian
Add script injecting s2s options to nematus .npz models
#!/usr/bin/env python from __future__ import print_function import sys import argparse import numpy as np import json import yaml DESC = "Adds special node including s2s options to Nematus model.npz file." S2S_SPECIAL_NODE = "special:model.yml" def main(): args = parse_args() print("Loading config {}".fo...
<commit_before><commit_msg>Add script injecting s2s options to nematus .npz models<commit_after>
#!/usr/bin/env python from __future__ import print_function import sys import argparse import numpy as np import json import yaml DESC = "Adds special node including s2s options to Nematus model.npz file." S2S_SPECIAL_NODE = "special:model.yml" def main(): args = parse_args() print("Loading config {}".fo...
Add script injecting s2s options to nematus .npz models#!/usr/bin/env python from __future__ import print_function import sys import argparse import numpy as np import json import yaml DESC = "Adds special node including s2s options to Nematus model.npz file." S2S_SPECIAL_NODE = "special:model.yml" def main(): ...
<commit_before><commit_msg>Add script injecting s2s options to nematus .npz models<commit_after>#!/usr/bin/env python from __future__ import print_function import sys import argparse import numpy as np import json import yaml DESC = "Adds special node including s2s options to Nematus model.npz file." S2S_SPECIAL_NO...
9ed64ddd0f5ca8ec035b53b0a699ec721e6206d9
screen_manager_test.py
screen_manager_test.py
from kivy.app import App from kivy.lang import Builder from kivy.uix.floatlayout import FloatLayout # Example from http://robertour.com/category/kivy/page/2/ Builder.load_string(""" #:import FadeTransition kivy.uix.screenmanager.FadeTransition <Phone>: AnchorLayout: anchor_x: 'right' anchor_y: ...
Add test-app which uses screen-manager
Add test-app which uses screen-manager
Python
apache-2.0
ThomasHangstoerfer/pyHomeCtrl
Add test-app which uses screen-manager
from kivy.app import App from kivy.lang import Builder from kivy.uix.floatlayout import FloatLayout # Example from http://robertour.com/category/kivy/page/2/ Builder.load_string(""" #:import FadeTransition kivy.uix.screenmanager.FadeTransition <Phone>: AnchorLayout: anchor_x: 'right' anchor_y: ...
<commit_before><commit_msg>Add test-app which uses screen-manager<commit_after>
from kivy.app import App from kivy.lang import Builder from kivy.uix.floatlayout import FloatLayout # Example from http://robertour.com/category/kivy/page/2/ Builder.load_string(""" #:import FadeTransition kivy.uix.screenmanager.FadeTransition <Phone>: AnchorLayout: anchor_x: 'right' anchor_y: ...
Add test-app which uses screen-manager from kivy.app import App from kivy.lang import Builder from kivy.uix.floatlayout import FloatLayout # Example from http://robertour.com/category/kivy/page/2/ Builder.load_string(""" #:import FadeTransition kivy.uix.screenmanager.FadeTransition <Phone>: AnchorLayout: ...
<commit_before><commit_msg>Add test-app which uses screen-manager<commit_after> from kivy.app import App from kivy.lang import Builder from kivy.uix.floatlayout import FloatLayout # Example from http://robertour.com/category/kivy/page/2/ Builder.load_string(""" #:import FadeTransition kivy.uix.screenmanager.FadeTran...
f928624343e04d1010bb7429a47a8f13032a9fea
cli.py
cli.py
#!/bin/python import argparse def parse_args(): parser = argparse.ArgumentParser() group_actions = parser.add_mutually_exclusive_group() group_actions.add_argument( "-r", "--remove", help="removes a note", action="store_true") group_actions.add_argument( "-m", "--modify", help="modif...
Add argument parser to takenote
Add argument parser to takenote
Python
mit
nocternology/takenote
Add argument parser to takenote
#!/bin/python import argparse def parse_args(): parser = argparse.ArgumentParser() group_actions = parser.add_mutually_exclusive_group() group_actions.add_argument( "-r", "--remove", help="removes a note", action="store_true") group_actions.add_argument( "-m", "--modify", help="modif...
<commit_before><commit_msg>Add argument parser to takenote<commit_after>
#!/bin/python import argparse def parse_args(): parser = argparse.ArgumentParser() group_actions = parser.add_mutually_exclusive_group() group_actions.add_argument( "-r", "--remove", help="removes a note", action="store_true") group_actions.add_argument( "-m", "--modify", help="modif...
Add argument parser to takenote#!/bin/python import argparse def parse_args(): parser = argparse.ArgumentParser() group_actions = parser.add_mutually_exclusive_group() group_actions.add_argument( "-r", "--remove", help="removes a note", action="store_true") group_actions.add_argument( ...
<commit_before><commit_msg>Add argument parser to takenote<commit_after>#!/bin/python import argparse def parse_args(): parser = argparse.ArgumentParser() group_actions = parser.add_mutually_exclusive_group() group_actions.add_argument( "-r", "--remove", help="removes a note", action="store_true...
181e8e9375c13e8759539bb84171fce015fff66e
tools/text2stercus.py
tools/text2stercus.py
#!/usr/bin/env python import argparse def parse(text): stercus = '' for char in text: stercus += str(ord(char)) + ' . ' return stercus def main(): parser = argparse.ArgumentParser() parser.add_argument('text') args = parser.parse_args() print parse(args.text) if __name__ == '__ma...
Add convenience tool for converting string to stercus.
Add convenience tool for converting string to stercus.
Python
mit
adamheins/stercus
Add convenience tool for converting string to stercus.
#!/usr/bin/env python import argparse def parse(text): stercus = '' for char in text: stercus += str(ord(char)) + ' . ' return stercus def main(): parser = argparse.ArgumentParser() parser.add_argument('text') args = parser.parse_args() print parse(args.text) if __name__ == '__ma...
<commit_before><commit_msg>Add convenience tool for converting string to stercus.<commit_after>
#!/usr/bin/env python import argparse def parse(text): stercus = '' for char in text: stercus += str(ord(char)) + ' . ' return stercus def main(): parser = argparse.ArgumentParser() parser.add_argument('text') args = parser.parse_args() print parse(args.text) if __name__ == '__ma...
Add convenience tool for converting string to stercus.#!/usr/bin/env python import argparse def parse(text): stercus = '' for char in text: stercus += str(ord(char)) + ' . ' return stercus def main(): parser = argparse.ArgumentParser() parser.add_argument('text') args = parser.parse_a...
<commit_before><commit_msg>Add convenience tool for converting string to stercus.<commit_after>#!/usr/bin/env python import argparse def parse(text): stercus = '' for char in text: stercus += str(ord(char)) + ' . ' return stercus def main(): parser = argparse.ArgumentParser() parser.add_a...
4e876b59745a67cf1fbcbaacf1ca1675c3e1946a
onetime/models.py
onetime/models.py
from django.db import models from django.contrib.auth.models import User class Key(models.Model): user = models.ForeignKey(User) key = models.CharField(max_length=40) created = models.DateTimeField(auto_now_add=True) usage_left = models.IntegerField(null=True, default=1) expires = models.DateTimeFi...
from datetime import datetime from django.db import models from django.contrib.auth.models import User class Key(models.Model): user = models.ForeignKey(User) key = models.CharField(max_length=40) created = models.DateTimeField(auto_now_add=True) usage_left = models.IntegerField(null=True, default=1) ...
Add validation and usage logics into the model
Add validation and usage logics into the model
Python
agpl-3.0
ISIFoundation/influenzanet-website,ISIFoundation/influenzanet-website,ISIFoundation/influenzanet-website,uploadcare/django-loginurl,ISIFoundation/influenzanet-website,ISIFoundation/influenzanet-website,fajran/django-loginurl,vanschelven/cmsplugin-journal,ISIFoundation/influenzanet-website,ISIFoundation/influenzanet-web...
from django.db import models from django.contrib.auth.models import User class Key(models.Model): user = models.ForeignKey(User) key = models.CharField(max_length=40) created = models.DateTimeField(auto_now_add=True) usage_left = models.IntegerField(null=True, default=1) expires = models.DateTimeFi...
from datetime import datetime from django.db import models from django.contrib.auth.models import User class Key(models.Model): user = models.ForeignKey(User) key = models.CharField(max_length=40) created = models.DateTimeField(auto_now_add=True) usage_left = models.IntegerField(null=True, default=1) ...
<commit_before>from django.db import models from django.contrib.auth.models import User class Key(models.Model): user = models.ForeignKey(User) key = models.CharField(max_length=40) created = models.DateTimeField(auto_now_add=True) usage_left = models.IntegerField(null=True, default=1) expires = mo...
from datetime import datetime from django.db import models from django.contrib.auth.models import User class Key(models.Model): user = models.ForeignKey(User) key = models.CharField(max_length=40) created = models.DateTimeField(auto_now_add=True) usage_left = models.IntegerField(null=True, default=1) ...
from django.db import models from django.contrib.auth.models import User class Key(models.Model): user = models.ForeignKey(User) key = models.CharField(max_length=40) created = models.DateTimeField(auto_now_add=True) usage_left = models.IntegerField(null=True, default=1) expires = models.DateTimeFi...
<commit_before>from django.db import models from django.contrib.auth.models import User class Key(models.Model): user = models.ForeignKey(User) key = models.CharField(max_length=40) created = models.DateTimeField(auto_now_add=True) usage_left = models.IntegerField(null=True, default=1) expires = mo...
5c2c1deacaa4a237e20d30ca4040a537a6381b9b
person/migrations/0009_auto_20200501_1504.py
person/migrations/0009_auto_20200501_1504.py
# Generated by Django 2.2.12 on 2020-05-01 13:04 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('person', '0008_person_datetime_updated'), ] operations = [ migrations.AlterField( model_name='person', name='forena...
Add migration for updated person fields
Add migration for updated person fields
Python
mit
openkamer/openkamer,openkamer/openkamer,openkamer/openkamer,openkamer/openkamer
Add migration for updated person fields
# Generated by Django 2.2.12 on 2020-05-01 13:04 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('person', '0008_person_datetime_updated'), ] operations = [ migrations.AlterField( model_name='person', name='forena...
<commit_before><commit_msg>Add migration for updated person fields<commit_after>
# Generated by Django 2.2.12 on 2020-05-01 13:04 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('person', '0008_person_datetime_updated'), ] operations = [ migrations.AlterField( model_name='person', name='forena...
Add migration for updated person fields# Generated by Django 2.2.12 on 2020-05-01 13:04 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('person', '0008_person_datetime_updated'), ] operations = [ migrations.AlterField( model_...
<commit_before><commit_msg>Add migration for updated person fields<commit_after># Generated by Django 2.2.12 on 2020-05-01 13:04 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('person', '0008_person_datetime_updated'), ] operations = [ ...
82a377e3d531543d4640bd595745e91b7f8f5c3f
sparqllib/querycomponent/tests/test_group.py
sparqllib/querycomponent/tests/test_group.py
import unittest import sparqllib from rdflib import BNode, Literal class TestGroup(unittest.TestCase): def setUp(self): self.group = sparqllib.querycomponent.Group() def test_add(self): self.assertEqual(self.group.components, []) triple = (BNode("subject"), BNode("relation"), Literal(...
Add tests for Group query component
Add tests for Group query component
Python
mit
ALSchwalm/sparqllib
Add tests for Group query component
import unittest import sparqllib from rdflib import BNode, Literal class TestGroup(unittest.TestCase): def setUp(self): self.group = sparqllib.querycomponent.Group() def test_add(self): self.assertEqual(self.group.components, []) triple = (BNode("subject"), BNode("relation"), Literal(...
<commit_before><commit_msg>Add tests for Group query component<commit_after>
import unittest import sparqllib from rdflib import BNode, Literal class TestGroup(unittest.TestCase): def setUp(self): self.group = sparqllib.querycomponent.Group() def test_add(self): self.assertEqual(self.group.components, []) triple = (BNode("subject"), BNode("relation"), Literal(...
Add tests for Group query component import unittest import sparqllib from rdflib import BNode, Literal class TestGroup(unittest.TestCase): def setUp(self): self.group = sparqllib.querycomponent.Group() def test_add(self): self.assertEqual(self.group.components, []) triple = (BNode("sub...
<commit_before><commit_msg>Add tests for Group query component<commit_after> import unittest import sparqllib from rdflib import BNode, Literal class TestGroup(unittest.TestCase): def setUp(self): self.group = sparqllib.querycomponent.Group() def test_add(self): self.assertEqual(self.group.com...
f28e380b504596aa41245cb10eebebceae67d831
bin/brut-net.py
bin/brut-net.py
#!/usr/bin/env python3 """Converti un salaire brut annuel en un salaire net mensuel.""" import optparse def main(): p = optparse.OptionParser(description=__doc__) options, arguments = p.parse_args() annuel_brut = int(arguments[0]) mensuel_net = (annuel_brut - (annuel_brut * 23 / 100)) / 12 print(...
Add new program to convert gross to net salary
Add new program to convert gross to net salary
Python
mit
mlcdf/dotfiles,mlcdf/dotfiles,mlcdf/dotfiles
Add new program to convert gross to net salary
#!/usr/bin/env python3 """Converti un salaire brut annuel en un salaire net mensuel.""" import optparse def main(): p = optparse.OptionParser(description=__doc__) options, arguments = p.parse_args() annuel_brut = int(arguments[0]) mensuel_net = (annuel_brut - (annuel_brut * 23 / 100)) / 12 print(...
<commit_before><commit_msg>Add new program to convert gross to net salary<commit_after>
#!/usr/bin/env python3 """Converti un salaire brut annuel en un salaire net mensuel.""" import optparse def main(): p = optparse.OptionParser(description=__doc__) options, arguments = p.parse_args() annuel_brut = int(arguments[0]) mensuel_net = (annuel_brut - (annuel_brut * 23 / 100)) / 12 print(...
Add new program to convert gross to net salary#!/usr/bin/env python3 """Converti un salaire brut annuel en un salaire net mensuel.""" import optparse def main(): p = optparse.OptionParser(description=__doc__) options, arguments = p.parse_args() annuel_brut = int(arguments[0]) mensuel_net = (annuel_br...
<commit_before><commit_msg>Add new program to convert gross to net salary<commit_after>#!/usr/bin/env python3 """Converti un salaire brut annuel en un salaire net mensuel.""" import optparse def main(): p = optparse.OptionParser(description=__doc__) options, arguments = p.parse_args() annuel_brut = int(a...
ccdb1b2f87c700e283b2ca51aa94408027561b0d
api.py
api.py
import json from django.conf.urls import url from django.db.models import ObjectDoesNotExist from django.http import Http404, HttpResponse from django.utils.decorators import classonlymethod from django.views import generic from django.views.decorators.csrf import csrf_exempt class Resource(generic.View): """ ...
Add a really simple resource as beginning of a custom API implementation
Add a really simple resource as beginning of a custom API implementation
Python
bsd-3-clause
matthiask/towel,matthiask/towel,matthiask/towel,matthiask/towel
Add a really simple resource as beginning of a custom API implementation
import json from django.conf.urls import url from django.db.models import ObjectDoesNotExist from django.http import Http404, HttpResponse from django.utils.decorators import classonlymethod from django.views import generic from django.views.decorators.csrf import csrf_exempt class Resource(generic.View): """ ...
<commit_before><commit_msg>Add a really simple resource as beginning of a custom API implementation<commit_after>
import json from django.conf.urls import url from django.db.models import ObjectDoesNotExist from django.http import Http404, HttpResponse from django.utils.decorators import classonlymethod from django.views import generic from django.views.decorators.csrf import csrf_exempt class Resource(generic.View): """ ...
Add a really simple resource as beginning of a custom API implementationimport json from django.conf.urls import url from django.db.models import ObjectDoesNotExist from django.http import Http404, HttpResponse from django.utils.decorators import classonlymethod from django.views import generic from django.views.decor...
<commit_before><commit_msg>Add a really simple resource as beginning of a custom API implementation<commit_after>import json from django.conf.urls import url from django.db.models import ObjectDoesNotExist from django.http import Http404, HttpResponse from django.utils.decorators import classonlymethod from django.vie...
8461b21cf4b538f2ec46a9a9b6674eff9072e84d
cli.py
cli.py
#!/usr/bin/env python import sys from pprint import pprint from argparse import ArgumentParser from minecraft_query import MinecraftQuery def main(): parser = ArgumentParser(description="Query status of Minecraft multiplayer server", epilog="Exit status: 0 if the server can be reached...
Add friendly and scriptable CLI
Add friendly and scriptable CLI
Python
apache-2.0
CloudBotIRC/mcstatus,Trax-/mcstatus
Add friendly and scriptable CLI
#!/usr/bin/env python import sys from pprint import pprint from argparse import ArgumentParser from minecraft_query import MinecraftQuery def main(): parser = ArgumentParser(description="Query status of Minecraft multiplayer server", epilog="Exit status: 0 if the server can be reached...
<commit_before><commit_msg>Add friendly and scriptable CLI<commit_after>
#!/usr/bin/env python import sys from pprint import pprint from argparse import ArgumentParser from minecraft_query import MinecraftQuery def main(): parser = ArgumentParser(description="Query status of Minecraft multiplayer server", epilog="Exit status: 0 if the server can be reached...
Add friendly and scriptable CLI#!/usr/bin/env python import sys from pprint import pprint from argparse import ArgumentParser from minecraft_query import MinecraftQuery def main(): parser = ArgumentParser(description="Query status of Minecraft multiplayer server", epilog="Exit status:...
<commit_before><commit_msg>Add friendly and scriptable CLI<commit_after>#!/usr/bin/env python import sys from pprint import pprint from argparse import ArgumentParser from minecraft_query import MinecraftQuery def main(): parser = ArgumentParser(description="Query status of Minecraft multiplayer server", ...
cd2f9ec0c8ffbdfda4620b9edf57ab839b286ddf
bluebottle/funding_stripe/migrations/0004_auto_20200318_1504.py
bluebottle/funding_stripe/migrations/0004_auto_20200318_1504.py
# -*- coding: utf-8 -*- # Generated by Django 1.11.15 on 2020-03-18 14:04 from __future__ import unicode_literals from django.db import migrations from bluebottle.funding_stripe.models import get_specs def set_eventually_due(apps, schema_editor): Account = apps.get_model('funding_stripe', 'StripePayoutAccount') ...
Add eventually_due fields in migration
Add eventually_due fields in migration
Python
bsd-3-clause
onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle
Add eventually_due fields in migration
# -*- coding: utf-8 -*- # Generated by Django 1.11.15 on 2020-03-18 14:04 from __future__ import unicode_literals from django.db import migrations from bluebottle.funding_stripe.models import get_specs def set_eventually_due(apps, schema_editor): Account = apps.get_model('funding_stripe', 'StripePayoutAccount') ...
<commit_before><commit_msg>Add eventually_due fields in migration<commit_after>
# -*- coding: utf-8 -*- # Generated by Django 1.11.15 on 2020-03-18 14:04 from __future__ import unicode_literals from django.db import migrations from bluebottle.funding_stripe.models import get_specs def set_eventually_due(apps, schema_editor): Account = apps.get_model('funding_stripe', 'StripePayoutAccount') ...
Add eventually_due fields in migration# -*- coding: utf-8 -*- # Generated by Django 1.11.15 on 2020-03-18 14:04 from __future__ import unicode_literals from django.db import migrations from bluebottle.funding_stripe.models import get_specs def set_eventually_due(apps, schema_editor): Account = apps.get_model('fu...
<commit_before><commit_msg>Add eventually_due fields in migration<commit_after># -*- coding: utf-8 -*- # Generated by Django 1.11.15 on 2020-03-18 14:04 from __future__ import unicode_literals from django.db import migrations from bluebottle.funding_stripe.models import get_specs def set_eventually_due(apps, schema_...
46883c5c0de8cf00e75654ae2e577ddc404c8b27
api/bots/giphy/test_giphy.py
api/bots/giphy/test_giphy.py
#!/usr/bin/env python from __future__ import absolute_import from __future__ import print_function import os import sys import json our_dir = os.path.dirname(os.path.abspath(__file__)) sys.path.insert(0, os.path.normpath(os.path.join(our_dir))) # For dev setups, we can find the API in the repo itself. if os.path.exi...
Add test file for 'giphy' bot.
bots: Add test file for 'giphy' bot. This bot replies with different gif for the same query that is provided. Mocked a definite response from requests.get function.
Python
apache-2.0
hackerkid/zulip,jackrzhang/zulip,eeshangarg/zulip,brainwane/zulip,vaidap/zulip,timabbott/zulip,vabs22/zulip,shubhamdhama/zulip,mahim97/zulip,eeshangarg/zulip,brockwhittaker/zulip,vaidap/zulip,showell/zulip,rht/zulip,eeshangarg/zulip,brainwane/zulip,rht/zulip,showell/zulip,dhcrzf/zulip,rishig/zulip,verma-varsha/zulip,sh...
bots: Add test file for 'giphy' bot. This bot replies with different gif for the same query that is provided. Mocked a definite response from requests.get function.
#!/usr/bin/env python from __future__ import absolute_import from __future__ import print_function import os import sys import json our_dir = os.path.dirname(os.path.abspath(__file__)) sys.path.insert(0, os.path.normpath(os.path.join(our_dir))) # For dev setups, we can find the API in the repo itself. if os.path.exi...
<commit_before><commit_msg>bots: Add test file for 'giphy' bot. This bot replies with different gif for the same query that is provided. Mocked a definite response from requests.get function.<commit_after>
#!/usr/bin/env python from __future__ import absolute_import from __future__ import print_function import os import sys import json our_dir = os.path.dirname(os.path.abspath(__file__)) sys.path.insert(0, os.path.normpath(os.path.join(our_dir))) # For dev setups, we can find the API in the repo itself. if os.path.exi...
bots: Add test file for 'giphy' bot. This bot replies with different gif for the same query that is provided. Mocked a definite response from requests.get function.#!/usr/bin/env python from __future__ import absolute_import from __future__ import print_function import os import sys import json our_dir = os.path.di...
<commit_before><commit_msg>bots: Add test file for 'giphy' bot. This bot replies with different gif for the same query that is provided. Mocked a definite response from requests.get function.<commit_after>#!/usr/bin/env python from __future__ import absolute_import from __future__ import print_function import os imp...
7ac056c7db746f397c58cfa6ba4924830bf8b624
aplpy/tests/test_wcs_util.py
aplpy/tests/test_wcs_util.py
import os import numpy as np from astropy.io import fits from astropy.tests.helper import pytest from ..wcs_util import WCS, celestial_pixel_scale, non_celestial_pixel_scales from .helpers import generate_wcs HEADER_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'data') HEADER_2D = fits.Header.fromt...
Add regression tests for pixel scale
Add regression tests for pixel scale
Python
mit
allisony/aplpy,mwcraig/aplpy
Add regression tests for pixel scale
import os import numpy as np from astropy.io import fits from astropy.tests.helper import pytest from ..wcs_util import WCS, celestial_pixel_scale, non_celestial_pixel_scales from .helpers import generate_wcs HEADER_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'data') HEADER_2D = fits.Header.fromt...
<commit_before><commit_msg>Add regression tests for pixel scale<commit_after>
import os import numpy as np from astropy.io import fits from astropy.tests.helper import pytest from ..wcs_util import WCS, celestial_pixel_scale, non_celestial_pixel_scales from .helpers import generate_wcs HEADER_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'data') HEADER_2D = fits.Header.fromt...
Add regression tests for pixel scaleimport os import numpy as np from astropy.io import fits from astropy.tests.helper import pytest from ..wcs_util import WCS, celestial_pixel_scale, non_celestial_pixel_scales from .helpers import generate_wcs HEADER_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), '...
<commit_before><commit_msg>Add regression tests for pixel scale<commit_after>import os import numpy as np from astropy.io import fits from astropy.tests.helper import pytest from ..wcs_util import WCS, celestial_pixel_scale, non_celestial_pixel_scales from .helpers import generate_wcs HEADER_DIR = os.path.join(os.p...
7a3c95e5e2db3555664c0e9737032768df4940b2
phantomas/test/test_format_args.py
phantomas/test/test_format_args.py
""" Set of unit tests for helper functions """ import unittest from phantomas import Phantomas class FormatArgsTestClass(unittest.TestCase): def test_format_args(self): self.assertEqual(Phantomas.format_args(dict()), []) self.assertEqual(Phantomas.format_args(dict(foo="bar")), ['--foo=bar']) ...
Add unit tests for Phantomas.format_args
Add unit tests for Phantomas.format_args
Python
bsd-3-clause
macbre/phantomas-python,macbre/phantomas-python
Add unit tests for Phantomas.format_args
""" Set of unit tests for helper functions """ import unittest from phantomas import Phantomas class FormatArgsTestClass(unittest.TestCase): def test_format_args(self): self.assertEqual(Phantomas.format_args(dict()), []) self.assertEqual(Phantomas.format_args(dict(foo="bar")), ['--foo=bar']) ...
<commit_before><commit_msg>Add unit tests for Phantomas.format_args<commit_after>
""" Set of unit tests for helper functions """ import unittest from phantomas import Phantomas class FormatArgsTestClass(unittest.TestCase): def test_format_args(self): self.assertEqual(Phantomas.format_args(dict()), []) self.assertEqual(Phantomas.format_args(dict(foo="bar")), ['--foo=bar']) ...
Add unit tests for Phantomas.format_args""" Set of unit tests for helper functions """ import unittest from phantomas import Phantomas class FormatArgsTestClass(unittest.TestCase): def test_format_args(self): self.assertEqual(Phantomas.format_args(dict()), []) self.assertEqual(Phantomas.format_ar...
<commit_before><commit_msg>Add unit tests for Phantomas.format_args<commit_after>""" Set of unit tests for helper functions """ import unittest from phantomas import Phantomas class FormatArgsTestClass(unittest.TestCase): def test_format_args(self): self.assertEqual(Phantomas.format_args(dict()), []) ...
f7aa9e986abd9fb55cb72ac4661f319a867e059d
scripts/ms_jsfs.py
scripts/ms_jsfs.py
#!/usr/bin/env python """ Convert the output of ms to an N-dimensional frequency spectrum. """ import sys import dadi if __name__ == '__main__': average = ('-av' in sys.argv) input = sys.stdin output = sys.stdout sfs,header = dadi.Spectrum.from_ms_file(input, average, mask_corners=True, ...
Rename so we can import it and thus get useful epydoc documentation.
Rename so we can import it and thus get useful epydoc documentation. git-svn-id: 4c7b13231a96299fde701bb5dec4bd2aaf383fc6@132 979d6bd5-6d4d-0410-bece-f567c23bd345
Python
bsd-3-clause
beni55/dadi,cheese1213/dadi,paulirish/dadi,yangjl/dadi,ChenHsiang/dadi,cheese1213/dadi,RyanGutenkunst/dadi,paulirish/dadi,niuhuifei/dadi,beni55/dadi,ChenHsiang/dadi,yangjl/dadi,niuhuifei/dadi,RyanGutenkunst/dadi
Rename so we can import it and thus get useful epydoc documentation. git-svn-id: 4c7b13231a96299fde701bb5dec4bd2aaf383fc6@132 979d6bd5-6d4d-0410-bece-f567c23bd345
#!/usr/bin/env python """ Convert the output of ms to an N-dimensional frequency spectrum. """ import sys import dadi if __name__ == '__main__': average = ('-av' in sys.argv) input = sys.stdin output = sys.stdout sfs,header = dadi.Spectrum.from_ms_file(input, average, mask_corners=True, ...
<commit_before><commit_msg>Rename so we can import it and thus get useful epydoc documentation. git-svn-id: 4c7b13231a96299fde701bb5dec4bd2aaf383fc6@132 979d6bd5-6d4d-0410-bece-f567c23bd345<commit_after>
#!/usr/bin/env python """ Convert the output of ms to an N-dimensional frequency spectrum. """ import sys import dadi if __name__ == '__main__': average = ('-av' in sys.argv) input = sys.stdin output = sys.stdout sfs,header = dadi.Spectrum.from_ms_file(input, average, mask_corners=True, ...
Rename so we can import it and thus get useful epydoc documentation. git-svn-id: 4c7b13231a96299fde701bb5dec4bd2aaf383fc6@132 979d6bd5-6d4d-0410-bece-f567c23bd345#!/usr/bin/env python """ Convert the output of ms to an N-dimensional frequency spectrum. """ import sys import dadi if __name__ == '__main__': aver...
<commit_before><commit_msg>Rename so we can import it and thus get useful epydoc documentation. git-svn-id: 4c7b13231a96299fde701bb5dec4bd2aaf383fc6@132 979d6bd5-6d4d-0410-bece-f567c23bd345<commit_after>#!/usr/bin/env python """ Convert the output of ms to an N-dimensional frequency spectrum. """ import sys import ...
ae07dc1cd72caf7aa04b76ef4c9377b26eec1730
telemetry/catapult_base/__init__.py
telemetry/catapult_base/__init__.py
# Copyright 2015 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. # All files in this directory should be moved to catapult/base/ after moving # to the new repo.
Add catapult_base folder to tools/telemetry to make the refactor easier.
Add catapult_base folder to tools/telemetry to make the refactor easier. This will make some of the refactoring more obvious and easy to review, as well as making the needed reafctoring after moving to the catapult repo easier. BUG=473414 Review URL: https://codereview.chromium.org/1168263002 Cr-Commit-Position: 97...
Python
bsd-3-clause
SummerLW/Perf-Insight-Report,catapult-project/catapult,benschmaus/catapult,catapult-project/catapult-csm,catapult-project/catapult-csm,SummerLW/Perf-Insight-Report,SummerLW/Perf-Insight-Report,sahiljain/catapult,catapult-project/catapult,sahiljain/catapult,benschmaus/catapult,catapult-project/catapult-csm,catapult-proj...
Add catapult_base folder to tools/telemetry to make the refactor easier. This will make some of the refactoring more obvious and easy to review, as well as making the needed reafctoring after moving to the catapult repo easier. BUG=473414 Review URL: https://codereview.chromium.org/1168263002 Cr-Commit-Position: 97...
# Copyright 2015 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. # All files in this directory should be moved to catapult/base/ after moving # to the new repo.
<commit_before><commit_msg>Add catapult_base folder to tools/telemetry to make the refactor easier. This will make some of the refactoring more obvious and easy to review, as well as making the needed reafctoring after moving to the catapult repo easier. BUG=473414 Review URL: https://codereview.chromium.org/1168263...
# Copyright 2015 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. # All files in this directory should be moved to catapult/base/ after moving # to the new repo.
Add catapult_base folder to tools/telemetry to make the refactor easier. This will make some of the refactoring more obvious and easy to review, as well as making the needed reafctoring after moving to the catapult repo easier. BUG=473414 Review URL: https://codereview.chromium.org/1168263002 Cr-Commit-Position: 97...
<commit_before><commit_msg>Add catapult_base folder to tools/telemetry to make the refactor easier. This will make some of the refactoring more obvious and easy to review, as well as making the needed reafctoring after moving to the catapult repo easier. BUG=473414 Review URL: https://codereview.chromium.org/1168263...
cfa98dfb045b8130add85366215b26a6bf04d5ec
cogs/pandentia/tempvoice.py
cogs/pandentia/tempvoice.py
from discord.ext import commands from cogs.utils import checks from cogs.utils.dataIO import dataIO import discord import asyncio class TemporaryVoice: """A cog to create TeamSpeak-like voice channels.""" def __init__(self, liara): self.liara = liara self.config = dataIO.load_json('pandentia.t...
Add a temporary voice channel cog
Add a temporary voice channel cog
Python
mit
Thessia/Liara
Add a temporary voice channel cog
from discord.ext import commands from cogs.utils import checks from cogs.utils.dataIO import dataIO import discord import asyncio class TemporaryVoice: """A cog to create TeamSpeak-like voice channels.""" def __init__(self, liara): self.liara = liara self.config = dataIO.load_json('pandentia.t...
<commit_before><commit_msg>Add a temporary voice channel cog<commit_after>
from discord.ext import commands from cogs.utils import checks from cogs.utils.dataIO import dataIO import discord import asyncio class TemporaryVoice: """A cog to create TeamSpeak-like voice channels.""" def __init__(self, liara): self.liara = liara self.config = dataIO.load_json('pandentia.t...
Add a temporary voice channel cogfrom discord.ext import commands from cogs.utils import checks from cogs.utils.dataIO import dataIO import discord import asyncio class TemporaryVoice: """A cog to create TeamSpeak-like voice channels.""" def __init__(self, liara): self.liara = liara self.confi...
<commit_before><commit_msg>Add a temporary voice channel cog<commit_after>from discord.ext import commands from cogs.utils import checks from cogs.utils.dataIO import dataIO import discord import asyncio class TemporaryVoice: """A cog to create TeamSpeak-like voice channels.""" def __init__(self, liara): ...
4b8a7e3506982cf155bb7f51ef1779799f4e3b85
name/validators.py
name/validators.py
from django.core.exceptions import ValidationError def follow_merged_with(name): """A generator to get the merged_with relationship of a Name object. This will return a Name object until it reaches a Name that does not have a merged_with relationship. """ while name: merged_into = nam...
Rework the validator so it is aware of the model instance and the merged with model.
Rework the validator so it is aware of the model instance and the merged with model.
Python
bsd-3-clause
damonkelley/django-name,damonkelley/django-name,unt-libraries/django-name,unt-libraries/django-name,unt-libraries/django-name,damonkelley/django-name
Rework the validator so it is aware of the model instance and the merged with model.
from django.core.exceptions import ValidationError def follow_merged_with(name): """A generator to get the merged_with relationship of a Name object. This will return a Name object until it reaches a Name that does not have a merged_with relationship. """ while name: merged_into = nam...
<commit_before><commit_msg>Rework the validator so it is aware of the model instance and the merged with model.<commit_after>
from django.core.exceptions import ValidationError def follow_merged_with(name): """A generator to get the merged_with relationship of a Name object. This will return a Name object until it reaches a Name that does not have a merged_with relationship. """ while name: merged_into = nam...
Rework the validator so it is aware of the model instance and the merged with model.from django.core.exceptions import ValidationError def follow_merged_with(name): """A generator to get the merged_with relationship of a Name object. This will return a Name object until it reaches a Name that does no...
<commit_before><commit_msg>Rework the validator so it is aware of the model instance and the merged with model.<commit_after>from django.core.exceptions import ValidationError def follow_merged_with(name): """A generator to get the merged_with relationship of a Name object. This will return a Name object...
0f6f829120d7ccca1803e74a7620aef3e8bfa73f
__init__.py
__init__.py
# Copyright 2022 DeepMind Technologies Limited # # 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 agr...
Make XManager a regular package rather than a namespace package.
Make XManager a regular package rather than a namespace package. PiperOrigin-RevId: 426942901 Change-Id: I9fae90c19996755abbca4f87dad38254aa2e174e GitOrigin-RevId: 7ca0daad14db366fe4610488539d37fc08e78dc9
Python
apache-2.0
deepmind/xmanager,deepmind/xmanager
Make XManager a regular package rather than a namespace package. PiperOrigin-RevId: 426942901 Change-Id: I9fae90c19996755abbca4f87dad38254aa2e174e GitOrigin-RevId: 7ca0daad14db366fe4610488539d37fc08e78dc9
# Copyright 2022 DeepMind Technologies Limited # # 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 agr...
<commit_before><commit_msg>Make XManager a regular package rather than a namespace package. PiperOrigin-RevId: 426942901 Change-Id: I9fae90c19996755abbca4f87dad38254aa2e174e GitOrigin-RevId: 7ca0daad14db366fe4610488539d37fc08e78dc9<commit_after>
# Copyright 2022 DeepMind Technologies Limited # # 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 agr...
Make XManager a regular package rather than a namespace package. PiperOrigin-RevId: 426942901 Change-Id: I9fae90c19996755abbca4f87dad38254aa2e174e GitOrigin-RevId: 7ca0daad14db366fe4610488539d37fc08e78dc9# Copyright 2022 DeepMind Technologies Limited # # Licensed under the Apache License, Version 2.0 (the "License"); ...
<commit_before><commit_msg>Make XManager a regular package rather than a namespace package. PiperOrigin-RevId: 426942901 Change-Id: I9fae90c19996755abbca4f87dad38254aa2e174e GitOrigin-RevId: 7ca0daad14db366fe4610488539d37fc08e78dc9<commit_after># Copyright 2022 DeepMind Technologies Limited # # Licensed under the Apac...
e9eb2f37b3972cc840525682d9b607b160859d8e
tests/sc_utils_test.py
tests/sc_utils_test.py
import unittest import context class TestEssStates(unittest.TestCase): def test_safe_add(self): from sc_utils import safeadd self.assertTrue(safeadd() is None) self.assertTrue(safeadd(None, None) is None) self.assertTrue(safeadd(1, None) == 1) self.assertTrue(safeadd(1, 2, 3) == 6) self.assertTrue(safead...
Add unit test module for sc_utils (to be expanded over time).
Add unit test module for sc_utils (to be expanded over time).
Python
mit
victronenergy/dbus-systemcalc-py
Add unit test module for sc_utils (to be expanded over time).
import unittest import context class TestEssStates(unittest.TestCase): def test_safe_add(self): from sc_utils import safeadd self.assertTrue(safeadd() is None) self.assertTrue(safeadd(None, None) is None) self.assertTrue(safeadd(1, None) == 1) self.assertTrue(safeadd(1, 2, 3) == 6) self.assertTrue(safead...
<commit_before><commit_msg>Add unit test module for sc_utils (to be expanded over time).<commit_after>
import unittest import context class TestEssStates(unittest.TestCase): def test_safe_add(self): from sc_utils import safeadd self.assertTrue(safeadd() is None) self.assertTrue(safeadd(None, None) is None) self.assertTrue(safeadd(1, None) == 1) self.assertTrue(safeadd(1, 2, 3) == 6) self.assertTrue(safead...
Add unit test module for sc_utils (to be expanded over time).import unittest import context class TestEssStates(unittest.TestCase): def test_safe_add(self): from sc_utils import safeadd self.assertTrue(safeadd() is None) self.assertTrue(safeadd(None, None) is None) self.assertTrue(safeadd(1, None) == 1) se...
<commit_before><commit_msg>Add unit test module for sc_utils (to be expanded over time).<commit_after>import unittest import context class TestEssStates(unittest.TestCase): def test_safe_add(self): from sc_utils import safeadd self.assertTrue(safeadd() is None) self.assertTrue(safeadd(None, None) is None) se...
3e718763a00aa7055d6e4c6b2f0fcbff853d6d0d
dbaas/workflow/steps/util/region_migration/update_zabbix_host.py
dbaas/workflow/steps/util/region_migration/update_zabbix_host.py
# -*- coding: utf-8 -*- import logging from util import full_stack from dbaas_credentials.credential import Credential from dbaas_credentials.models import CredentialType from dbaas_zabbix import factory_for from workflow.steps.util.base import BaseStep from workflow.exceptions.error_codes import DBAAS_0012 LOG = logg...
Add step to update zabbix host
Add step to update zabbix host
Python
bsd-3-clause
globocom/database-as-a-service,globocom/database-as-a-service,globocom/database-as-a-service,globocom/database-as-a-service
Add step to update zabbix host
# -*- coding: utf-8 -*- import logging from util import full_stack from dbaas_credentials.credential import Credential from dbaas_credentials.models import CredentialType from dbaas_zabbix import factory_for from workflow.steps.util.base import BaseStep from workflow.exceptions.error_codes import DBAAS_0012 LOG = logg...
<commit_before><commit_msg>Add step to update zabbix host<commit_after>
# -*- coding: utf-8 -*- import logging from util import full_stack from dbaas_credentials.credential import Credential from dbaas_credentials.models import CredentialType from dbaas_zabbix import factory_for from workflow.steps.util.base import BaseStep from workflow.exceptions.error_codes import DBAAS_0012 LOG = logg...
Add step to update zabbix host# -*- coding: utf-8 -*- import logging from util import full_stack from dbaas_credentials.credential import Credential from dbaas_credentials.models import CredentialType from dbaas_zabbix import factory_for from workflow.steps.util.base import BaseStep from workflow.exceptions.error_codes...
<commit_before><commit_msg>Add step to update zabbix host<commit_after># -*- coding: utf-8 -*- import logging from util import full_stack from dbaas_credentials.credential import Credential from dbaas_credentials.models import CredentialType from dbaas_zabbix import factory_for from workflow.steps.util.base import Base...
0705d32787a1e9eba49ddc514161c505be572622
web/premises/migrations/0018_premise_supporters.py
web/premises/migrations/0018_premise_supporters.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('premises', '0017_auto_20141030_0353'), ...
Add migration file for supporting functionality
Add migration file for supporting functionality
Python
mit
beratdogan/arguman.org,Arthur2e5/arguman.org,arguman/arguman.org,bahattincinic/arguman.org,arguman/arguman.org,omeripek/arguman.org,donkawechico/arguman.org,taiansu/arguman.org,Arthur2e5/arguman.org,taiansu/arguman.org,donkawechico/arguman.org,taiansu/arguman.org,arguman/arguman.org,donkawechico/arguman.org,omeripek/ar...
Add migration file for supporting functionality
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('premises', '0017_auto_20141030_0353'), ...
<commit_before><commit_msg>Add migration file for supporting functionality<commit_after>
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('premises', '0017_auto_20141030_0353'), ...
Add migration file for supporting functionality# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ...
<commit_before><commit_msg>Add migration file for supporting functionality<commit_after># -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_d...
a2fda40514a499f9980300276ec84e7065cd39b5
mistral/db/sqlalchemy/migration/alembic_migrations/versions/038_delete_delayed_calls_with_empty_key.py
mistral/db/sqlalchemy/migration/alembic_migrations/versions/038_delete_delayed_calls_with_empty_key.py
# Copyright 2020 Nokia Software. # # 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 writin...
Add a migration that deletes redundant delayed calls
Add a migration that deletes redundant delayed calls * Due to the bug https://bugs.launchpad.net/mistral/+bug/1861988 some Mistral installations may have redundant delayed calls with the empty "key" column. This patch adds a DB migration that cleans them up. Change-Id: Ic46d3d711a03fbd6364809a0fddcbb48f3e28d2a ...
Python
apache-2.0
openstack/mistral,openstack/mistral
Add a migration that deletes redundant delayed calls * Due to the bug https://bugs.launchpad.net/mistral/+bug/1861988 some Mistral installations may have redundant delayed calls with the empty "key" column. This patch adds a DB migration that cleans them up. Change-Id: Ic46d3d711a03fbd6364809a0fddcbb48f3e28d2a ...
# Copyright 2020 Nokia Software. # # 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 writin...
<commit_before><commit_msg>Add a migration that deletes redundant delayed calls * Due to the bug https://bugs.launchpad.net/mistral/+bug/1861988 some Mistral installations may have redundant delayed calls with the empty "key" column. This patch adds a DB migration that cleans them up. Change-Id: Ic46d3d711a03fb...
# Copyright 2020 Nokia Software. # # 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 writin...
Add a migration that deletes redundant delayed calls * Due to the bug https://bugs.launchpad.net/mistral/+bug/1861988 some Mistral installations may have redundant delayed calls with the empty "key" column. This patch adds a DB migration that cleans them up. Change-Id: Ic46d3d711a03fbd6364809a0fddcbb48f3e28d2a ...
<commit_before><commit_msg>Add a migration that deletes redundant delayed calls * Due to the bug https://bugs.launchpad.net/mistral/+bug/1861988 some Mistral installations may have redundant delayed calls with the empty "key" column. This patch adds a DB migration that cleans them up. Change-Id: Ic46d3d711a03fb...
943d258bdbd86940d259d3b288968645814ff91f
Lib/fontTools/pens/ttGlyphPen_test.py
Lib/fontTools/pens/ttGlyphPen_test.py
from __future__ import print_function, division, absolute_import from fontTools.misc.py23 import * import os import unittest from fontTools import ttLib from fontTools.pens.ttGlyphPen import TTGlyphPen class TTGlyphPenTest(unittest.TestCase): def setUp(self): #self.font = ttLib.TTFont(recalcBBoxes=False...
Add a test using existing test data
[TTGlyphPen] Add a test using existing test data
Python
mit
fonttools/fonttools,googlefonts/fonttools
[TTGlyphPen] Add a test using existing test data
from __future__ import print_function, division, absolute_import from fontTools.misc.py23 import * import os import unittest from fontTools import ttLib from fontTools.pens.ttGlyphPen import TTGlyphPen class TTGlyphPenTest(unittest.TestCase): def setUp(self): #self.font = ttLib.TTFont(recalcBBoxes=False...
<commit_before><commit_msg>[TTGlyphPen] Add a test using existing test data<commit_after>
from __future__ import print_function, division, absolute_import from fontTools.misc.py23 import * import os import unittest from fontTools import ttLib from fontTools.pens.ttGlyphPen import TTGlyphPen class TTGlyphPenTest(unittest.TestCase): def setUp(self): #self.font = ttLib.TTFont(recalcBBoxes=False...
[TTGlyphPen] Add a test using existing test datafrom __future__ import print_function, division, absolute_import from fontTools.misc.py23 import * import os import unittest from fontTools import ttLib from fontTools.pens.ttGlyphPen import TTGlyphPen class TTGlyphPenTest(unittest.TestCase): def setUp(self): ...
<commit_before><commit_msg>[TTGlyphPen] Add a test using existing test data<commit_after>from __future__ import print_function, division, absolute_import from fontTools.misc.py23 import * import os import unittest from fontTools import ttLib from fontTools.pens.ttGlyphPen import TTGlyphPen class TTGlyphPenTest(unit...
7b5625a722a9b3e69636ffe3a89b9d314a1ce8e3
netbox/extras/management/commands/clearcache.py
netbox/extras/management/commands/clearcache.py
from django.core.cache import cache from django.core.management.base import BaseCommand class Command(BaseCommand): """Command to clear the entire cache.""" help = 'Clears the cache.' def handle(self, *args, **kwargs): cache.clear() self.stdout.write('Cache has been cleared.', ending="\n"...
Add management command for clearing cache
Add management command for clearing cache
Python
apache-2.0
digitalocean/netbox,digitalocean/netbox,digitalocean/netbox,digitalocean/netbox
Add management command for clearing cache
from django.core.cache import cache from django.core.management.base import BaseCommand class Command(BaseCommand): """Command to clear the entire cache.""" help = 'Clears the cache.' def handle(self, *args, **kwargs): cache.clear() self.stdout.write('Cache has been cleared.', ending="\n"...
<commit_before><commit_msg>Add management command for clearing cache<commit_after>
from django.core.cache import cache from django.core.management.base import BaseCommand class Command(BaseCommand): """Command to clear the entire cache.""" help = 'Clears the cache.' def handle(self, *args, **kwargs): cache.clear() self.stdout.write('Cache has been cleared.', ending="\n"...
Add management command for clearing cachefrom django.core.cache import cache from django.core.management.base import BaseCommand class Command(BaseCommand): """Command to clear the entire cache.""" help = 'Clears the cache.' def handle(self, *args, **kwargs): cache.clear() self.stdout.wri...
<commit_before><commit_msg>Add management command for clearing cache<commit_after>from django.core.cache import cache from django.core.management.base import BaseCommand class Command(BaseCommand): """Command to clear the entire cache.""" help = 'Clears the cache.' def handle(self, *args, **kwargs): ...
10070529a5b5954095deca0a7653ab46c83d10c4
numba/typesystem/exttypes/vtabtype.py
numba/typesystem/exttypes/vtabtype.py
# -*- coding: utf-8 -*- """ Virtual method table types and ordering. """ from numba import error from numba.typesystem import * #------------------------------------------------------------------------ # Virtual Method Ordering #------------------------------------------------------------------------ def unordered(...
Add virtual method table type and ordering
Add virtual method table type and ordering
Python
bsd-2-clause
shiquanwang/numba,sklam/numba,IntelLabs/numba,stefanseefeld/numba,GaZ3ll3/numba,ssarangi/numba,sklam/numba,stonebig/numba,sklam/numba,numba/numba,seibert/numba,pitrou/numba,numba/numba,ssarangi/numba,pitrou/numba,jriehl/numba,numba/numba,seibert/numba,stonebig/numba,pombredanne/numba,cpcloud/numba,seibert/numba,gmarkal...
Add virtual method table type and ordering
# -*- coding: utf-8 -*- """ Virtual method table types and ordering. """ from numba import error from numba.typesystem import * #------------------------------------------------------------------------ # Virtual Method Ordering #------------------------------------------------------------------------ def unordered(...
<commit_before><commit_msg>Add virtual method table type and ordering<commit_after>
# -*- coding: utf-8 -*- """ Virtual method table types and ordering. """ from numba import error from numba.typesystem import * #------------------------------------------------------------------------ # Virtual Method Ordering #------------------------------------------------------------------------ def unordered(...
Add virtual method table type and ordering# -*- coding: utf-8 -*- """ Virtual method table types and ordering. """ from numba import error from numba.typesystem import * #------------------------------------------------------------------------ # Virtual Method Ordering #----------------------------------------------...
<commit_before><commit_msg>Add virtual method table type and ordering<commit_after># -*- coding: utf-8 -*- """ Virtual method table types and ordering. """ from numba import error from numba.typesystem import * #------------------------------------------------------------------------ # Virtual Method Ordering #-----...
faea42e32ddcaaa398214d6775fc521c67a3a0f8
dev-tools/get-bwc-version.py
dev-tools/get-bwc-version.py
# Licensed to Elasticsearch under one or more contributor # license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright # ownership. Elasticsearch licenses this file to you under # the Apache License, Version 2.0 (the "License"); you may # not use this file except...
Add script to grab ES version for BWC tests.
Tools: Add script to grab ES version for BWC tests. closes #7653
Python
apache-2.0
fubuki/elasticsearch,fubuki/elasticsearch,aparo/elasticsearch,fubuki/elasticsearch,fubuki/elasticsearch,aparo/elasticsearch,fubuki/elasticsearch,aparo/elasticsearch,fubuki/elasticsearch,aparo/elasticsearch,aparo/elasticsearch,aparo/elasticsearch
Tools: Add script to grab ES version for BWC tests. closes #7653
# Licensed to Elasticsearch under one or more contributor # license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright # ownership. Elasticsearch licenses this file to you under # the Apache License, Version 2.0 (the "License"); you may # not use this file except...
<commit_before><commit_msg>Tools: Add script to grab ES version for BWC tests. closes #7653<commit_after>
# Licensed to Elasticsearch under one or more contributor # license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright # ownership. Elasticsearch licenses this file to you under # the Apache License, Version 2.0 (the "License"); you may # not use this file except...
Tools: Add script to grab ES version for BWC tests. closes #7653# Licensed to Elasticsearch under one or more contributor # license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright # ownership. Elasticsearch licenses this file to you under # the Apache License...
<commit_before><commit_msg>Tools: Add script to grab ES version for BWC tests. closes #7653<commit_after># Licensed to Elasticsearch under one or more contributor # license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright # ownership. Elasticsearch licenses th...
047e7c017f40b7c23b80151db137ed73230911ce
Proxmox/commands.py
Proxmox/commands.py
from django.http import HttpResponse def runcommand(request, proxmox): command = request.GET.get('command', 'none') if command == 'addcomplete': nodeLocation = request.POST.get('node', '') vmid = request.POST.get('vmid', '') template = request.POST.get('template', '') hostname = request.POST.get('hostname', ...
Add Server wizard now working
Add Server wizard now working
Python
mit
Tomcuzz/OctaHomeAutomation,Tomcuzz/OctaHomeAutomation,Tomcuzz/OctaHomeAutomation,Tomcuzz/OctaHomeAutomation
Add Server wizard now working
from django.http import HttpResponse def runcommand(request, proxmox): command = request.GET.get('command', 'none') if command == 'addcomplete': nodeLocation = request.POST.get('node', '') vmid = request.POST.get('vmid', '') template = request.POST.get('template', '') hostname = request.POST.get('hostname', ...
<commit_before><commit_msg>Add Server wizard now working<commit_after>
from django.http import HttpResponse def runcommand(request, proxmox): command = request.GET.get('command', 'none') if command == 'addcomplete': nodeLocation = request.POST.get('node', '') vmid = request.POST.get('vmid', '') template = request.POST.get('template', '') hostname = request.POST.get('hostname', ...
Add Server wizard now workingfrom django.http import HttpResponse def runcommand(request, proxmox): command = request.GET.get('command', 'none') if command == 'addcomplete': nodeLocation = request.POST.get('node', '') vmid = request.POST.get('vmid', '') template = request.POST.get('template', '') hostname = ...
<commit_before><commit_msg>Add Server wizard now working<commit_after>from django.http import HttpResponse def runcommand(request, proxmox): command = request.GET.get('command', 'none') if command == 'addcomplete': nodeLocation = request.POST.get('node', '') vmid = request.POST.get('vmid', '') template = reque...
420ec092626d72ea465ee33115ff6635b39f0cd3
src/julia/tests/test_runtests.py
src/julia/tests/test_runtests.py
import subprocess import sys from textwrap import dedent from julia.core import _enviorn from .test_compatible_exe import run def test_runtests_failure(tmp_path): testfile = tmp_path / "test.py" testcode = u""" def test_THIS_TEST_MUST_FAIL(): assert False """ testfile.write_text(dedent(t...
Test julia.runtests can fail properly
Test julia.runtests can fail properly
Python
mit
JuliaPy/pyjulia,JuliaLang/pyjulia,JuliaPy/pyjulia
Test julia.runtests can fail properly
import subprocess import sys from textwrap import dedent from julia.core import _enviorn from .test_compatible_exe import run def test_runtests_failure(tmp_path): testfile = tmp_path / "test.py" testcode = u""" def test_THIS_TEST_MUST_FAIL(): assert False """ testfile.write_text(dedent(t...
<commit_before><commit_msg>Test julia.runtests can fail properly<commit_after>
import subprocess import sys from textwrap import dedent from julia.core import _enviorn from .test_compatible_exe import run def test_runtests_failure(tmp_path): testfile = tmp_path / "test.py" testcode = u""" def test_THIS_TEST_MUST_FAIL(): assert False """ testfile.write_text(dedent(t...
Test julia.runtests can fail properlyimport subprocess import sys from textwrap import dedent from julia.core import _enviorn from .test_compatible_exe import run def test_runtests_failure(tmp_path): testfile = tmp_path / "test.py" testcode = u""" def test_THIS_TEST_MUST_FAIL(): assert False ...
<commit_before><commit_msg>Test julia.runtests can fail properly<commit_after>import subprocess import sys from textwrap import dedent from julia.core import _enviorn from .test_compatible_exe import run def test_runtests_failure(tmp_path): testfile = tmp_path / "test.py" testcode = u""" def test_THIS_T...
b7af7aa6cb15421b140adea41c4436d1960367f9
bin/validate_file.py
bin/validate_file.py
#!/usr/bin/env python3 import argparse import validator.validator as vv parser = argparse.ArgumentParser() parser.add_argument('--config', help="configuration file for file validator") parser.add_argument('--file', help="file to validate") args = parser.parse_args() v = vv.Validate() v.validate_file(args.config, arg...
Add validator scripts which use the validator class
Add validator scripts which use the validator class
Python
mit
iestynpryce/file-validator
Add validator scripts which use the validator class
#!/usr/bin/env python3 import argparse import validator.validator as vv parser = argparse.ArgumentParser() parser.add_argument('--config', help="configuration file for file validator") parser.add_argument('--file', help="file to validate") args = parser.parse_args() v = vv.Validate() v.validate_file(args.config, arg...
<commit_before><commit_msg>Add validator scripts which use the validator class<commit_after>
#!/usr/bin/env python3 import argparse import validator.validator as vv parser = argparse.ArgumentParser() parser.add_argument('--config', help="configuration file for file validator") parser.add_argument('--file', help="file to validate") args = parser.parse_args() v = vv.Validate() v.validate_file(args.config, arg...
Add validator scripts which use the validator class#!/usr/bin/env python3 import argparse import validator.validator as vv parser = argparse.ArgumentParser() parser.add_argument('--config', help="configuration file for file validator") parser.add_argument('--file', help="file to validate") args = parser.parse_args() ...
<commit_before><commit_msg>Add validator scripts which use the validator class<commit_after>#!/usr/bin/env python3 import argparse import validator.validator as vv parser = argparse.ArgumentParser() parser.add_argument('--config', help="configuration file for file validator") parser.add_argument('--file', help="file ...
150248cbcdcc114f996ef6746e74f8cd8294190f
setup.py
setup.py
from setuptools import setup, find_packages # import os, sys def parse_requirements(requirements): # load from requirements.txt with open(requirements) as f: lines = [l for l in f] # remove spaces stripped = map((lambda x: x.strip()), lines) # remove comments nocomments...
from setuptools import setup, find_packages # import os, sys def parse_requirements(requirements): # load from requirements.txt with open(requirements) as f: lines = [l for l in f] # remove spaces stripped = map((lambda x: x.strip()), lines) # remove comments nocomments...
Update project name from dejavu to PyDejavu
Update project name from dejavu to PyDejavu
Python
mit
IskrenStanislavov/dejavu,worldveil/dejavu,shantanoo/dejavu,thanhquanky/dejavu,nicktimko/dejavu,VikramTiwari/dejavu,nmerad/dejavu,karthiks1995/dejavu,vasanthkalingeri/dejavu,snd/dejavu,davidmashburn/dejavu,midroid/dejavu,davidmashburn/dejavu,nmtoan91/dejavu,thanhquanky/dejavu,snd/dejavu,VikramTiwari/dejavu,karthiks1995/...
from setuptools import setup, find_packages # import os, sys def parse_requirements(requirements): # load from requirements.txt with open(requirements) as f: lines = [l for l in f] # remove spaces stripped = map((lambda x: x.strip()), lines) # remove comments nocomments...
from setuptools import setup, find_packages # import os, sys def parse_requirements(requirements): # load from requirements.txt with open(requirements) as f: lines = [l for l in f] # remove spaces stripped = map((lambda x: x.strip()), lines) # remove comments nocomments...
<commit_before>from setuptools import setup, find_packages # import os, sys def parse_requirements(requirements): # load from requirements.txt with open(requirements) as f: lines = [l for l in f] # remove spaces stripped = map((lambda x: x.strip()), lines) # remove comments ...
from setuptools import setup, find_packages # import os, sys def parse_requirements(requirements): # load from requirements.txt with open(requirements) as f: lines = [l for l in f] # remove spaces stripped = map((lambda x: x.strip()), lines) # remove comments nocomments...
from setuptools import setup, find_packages # import os, sys def parse_requirements(requirements): # load from requirements.txt with open(requirements) as f: lines = [l for l in f] # remove spaces stripped = map((lambda x: x.strip()), lines) # remove comments nocomments...
<commit_before>from setuptools import setup, find_packages # import os, sys def parse_requirements(requirements): # load from requirements.txt with open(requirements) as f: lines = [l for l in f] # remove spaces stripped = map((lambda x: x.strip()), lines) # remove comments ...
bb79b0a66a41106db220b1a0fb0e3bb8db9b5072
utils.py
utils.py
from keras.preprocessing.sequence import pad_sequences import numpy as np def to_one_hot_sequences(x, nb_classes=None, seq_len=30, start=0, stop=None, step=0): if nb_classes is None: nb_classes = _guess_nb_classes(x) if stop is None: stop = len(x) - seq_len if step...
Add an utility to transform an integer sequence into one hot sequence and sequences
Add an utility to transform an integer sequence into one hot sequence and sequences
Python
mit
xiongliyang219/physics_music
Add an utility to transform an integer sequence into one hot sequence and sequences
from keras.preprocessing.sequence import pad_sequences import numpy as np def to_one_hot_sequences(x, nb_classes=None, seq_len=30, start=0, stop=None, step=0): if nb_classes is None: nb_classes = _guess_nb_classes(x) if stop is None: stop = len(x) - seq_len if step...
<commit_before><commit_msg>Add an utility to transform an integer sequence into one hot sequence and sequences<commit_after>
from keras.preprocessing.sequence import pad_sequences import numpy as np def to_one_hot_sequences(x, nb_classes=None, seq_len=30, start=0, stop=None, step=0): if nb_classes is None: nb_classes = _guess_nb_classes(x) if stop is None: stop = len(x) - seq_len if step...
Add an utility to transform an integer sequence into one hot sequence and sequencesfrom keras.preprocessing.sequence import pad_sequences import numpy as np def to_one_hot_sequences(x, nb_classes=None, seq_len=30, start=0, stop=None, step=0): if nb_classes is None: nb_classes = _g...
<commit_before><commit_msg>Add an utility to transform an integer sequence into one hot sequence and sequences<commit_after>from keras.preprocessing.sequence import pad_sequences import numpy as np def to_one_hot_sequences(x, nb_classes=None, seq_len=30, start=0, stop=None, step=0): if nb...
a61a9ab1182eedefcf594f1966272d04f66f41da
webcomictocbz/tests/test_search.py
webcomictocbz/tests/test_search.py
from webcomictocbz.search import search from webcomictocbz.comic import Comic def test_search_searchable_website(): searchable_website = search("https://xkcd.com/1/") assert searchable_website.url == "https://xkcd.com/1/" assert searchable_website.next_page_selector == "//*[@*[contains(., '{}')]]//@href".f...
Add tests for search function
Add tests for search function
Python
mit
J-CPelletier/webcomix,J-CPelletier/WebComicToCBZ,J-CPelletier/webcomix
Add tests for search function
from webcomictocbz.search import search from webcomictocbz.comic import Comic def test_search_searchable_website(): searchable_website = search("https://xkcd.com/1/") assert searchable_website.url == "https://xkcd.com/1/" assert searchable_website.next_page_selector == "//*[@*[contains(., '{}')]]//@href".f...
<commit_before><commit_msg>Add tests for search function<commit_after>
from webcomictocbz.search import search from webcomictocbz.comic import Comic def test_search_searchable_website(): searchable_website = search("https://xkcd.com/1/") assert searchable_website.url == "https://xkcd.com/1/" assert searchable_website.next_page_selector == "//*[@*[contains(., '{}')]]//@href".f...
Add tests for search functionfrom webcomictocbz.search import search from webcomictocbz.comic import Comic def test_search_searchable_website(): searchable_website = search("https://xkcd.com/1/") assert searchable_website.url == "https://xkcd.com/1/" assert searchable_website.next_page_selector == "//*[@*[...
<commit_before><commit_msg>Add tests for search function<commit_after>from webcomictocbz.search import search from webcomictocbz.comic import Comic def test_search_searchable_website(): searchable_website = search("https://xkcd.com/1/") assert searchable_website.url == "https://xkcd.com/1/" assert searchab...
770e732d76f5e4f4dbb9f2d2d87c3b49440d906b
tests/unit/doc_test.py
tests/unit/doc_test.py
# -*- coding: utf-8 -*- ''' tests.unit.doc_test ~~~~~~~~~~~~~~~~~~~~ ''' # Import Python libs from __future__ import absolute_import import os # Import Salt Testing libs from salttesting import TestCase from salttesting.helpers import ensure_in_syspath # Import Salt libs import salt.modules.cmdmod ensure_in...
Add a unit test to search for new doc markup refs
Add a unit test to search for new doc markup refs
Python
apache-2.0
saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt
Add a unit test to search for new doc markup refs
# -*- coding: utf-8 -*- ''' tests.unit.doc_test ~~~~~~~~~~~~~~~~~~~~ ''' # Import Python libs from __future__ import absolute_import import os # Import Salt Testing libs from salttesting import TestCase from salttesting.helpers import ensure_in_syspath # Import Salt libs import salt.modules.cmdmod ensure_in...
<commit_before><commit_msg>Add a unit test to search for new doc markup refs<commit_after>
# -*- coding: utf-8 -*- ''' tests.unit.doc_test ~~~~~~~~~~~~~~~~~~~~ ''' # Import Python libs from __future__ import absolute_import import os # Import Salt Testing libs from salttesting import TestCase from salttesting.helpers import ensure_in_syspath # Import Salt libs import salt.modules.cmdmod ensure_in...
Add a unit test to search for new doc markup refs# -*- coding: utf-8 -*- ''' tests.unit.doc_test ~~~~~~~~~~~~~~~~~~~~ ''' # Import Python libs from __future__ import absolute_import import os # Import Salt Testing libs from salttesting import TestCase from salttesting.helpers import ensure_in_syspath # Impor...
<commit_before><commit_msg>Add a unit test to search for new doc markup refs<commit_after># -*- coding: utf-8 -*- ''' tests.unit.doc_test ~~~~~~~~~~~~~~~~~~~~ ''' # Import Python libs from __future__ import absolute_import import os # Import Salt Testing libs from salttesting import TestCase from salttesting....
8d548b31905b79f324bffff43b876b96d95a3525
cli.py
cli.py
#!/usr/bin/env python import argparse import requests import sys URL = 'https://r1d2.herokuapp.com' def get_json(url): return requests.get(url).json() def get_menu(json): return json['menu'] def format_item(name, price): return '{} (CHF {:.2f})'.format(name, price) def print_menu(menu, day=None): ...
Add example CLI program that uses the API.
Add example CLI program that uses the API.
Python
mit
kdungs/R1D2
Add example CLI program that uses the API.
#!/usr/bin/env python import argparse import requests import sys URL = 'https://r1d2.herokuapp.com' def get_json(url): return requests.get(url).json() def get_menu(json): return json['menu'] def format_item(name, price): return '{} (CHF {:.2f})'.format(name, price) def print_menu(menu, day=None): ...
<commit_before><commit_msg>Add example CLI program that uses the API.<commit_after>
#!/usr/bin/env python import argparse import requests import sys URL = 'https://r1d2.herokuapp.com' def get_json(url): return requests.get(url).json() def get_menu(json): return json['menu'] def format_item(name, price): return '{} (CHF {:.2f})'.format(name, price) def print_menu(menu, day=None): ...
Add example CLI program that uses the API.#!/usr/bin/env python import argparse import requests import sys URL = 'https://r1d2.herokuapp.com' def get_json(url): return requests.get(url).json() def get_menu(json): return json['menu'] def format_item(name, price): return '{} (CHF {:.2f})'.format(name,...
<commit_before><commit_msg>Add example CLI program that uses the API.<commit_after>#!/usr/bin/env python import argparse import requests import sys URL = 'https://r1d2.herokuapp.com' def get_json(url): return requests.get(url).json() def get_menu(json): return json['menu'] def format_item(name, price): ...
83a5e3ea71a263718c9c5e43936e7426629e4e85
src/mmw/apps/modeling/migrations/0039_override_sedaadjust_for_old_scenarios.py
src/mmw/apps/modeling/migrations/0039_override_sedaadjust_for_old_scenarios.py
# Generated by Django 3.2.10 on 2021-12-27 19:26 import json from django.db import migrations def override_sedaadjust_for_old_projects(apps, schema_editor): """ The default value of SedAAdjust is being changed from 1.5 to 1.25 for all new projects, which will use the high resolution "nhdhr" stream data. F...
Use old SedAAdjust in all existing NHD projects
Use old SedAAdjust in all existing NHD projects The new SedAAdjust value applies to those projects using the NHD Hi Res dataset. For older projects using NHD Medium Res, the old value is more appropriate. This migration sets that value to all old projects, unless that had already been overridden by a user.
Python
apache-2.0
WikiWatershed/model-my-watershed,WikiWatershed/model-my-watershed,WikiWatershed/model-my-watershed,WikiWatershed/model-my-watershed,WikiWatershed/model-my-watershed
Use old SedAAdjust in all existing NHD projects The new SedAAdjust value applies to those projects using the NHD Hi Res dataset. For older projects using NHD Medium Res, the old value is more appropriate. This migration sets that value to all old projects, unless that had already been overridden by a user.
# Generated by Django 3.2.10 on 2021-12-27 19:26 import json from django.db import migrations def override_sedaadjust_for_old_projects(apps, schema_editor): """ The default value of SedAAdjust is being changed from 1.5 to 1.25 for all new projects, which will use the high resolution "nhdhr" stream data. F...
<commit_before><commit_msg>Use old SedAAdjust in all existing NHD projects The new SedAAdjust value applies to those projects using the NHD Hi Res dataset. For older projects using NHD Medium Res, the old value is more appropriate. This migration sets that value to all old projects, unless that had already been overr...
# Generated by Django 3.2.10 on 2021-12-27 19:26 import json from django.db import migrations def override_sedaadjust_for_old_projects(apps, schema_editor): """ The default value of SedAAdjust is being changed from 1.5 to 1.25 for all new projects, which will use the high resolution "nhdhr" stream data. F...
Use old SedAAdjust in all existing NHD projects The new SedAAdjust value applies to those projects using the NHD Hi Res dataset. For older projects using NHD Medium Res, the old value is more appropriate. This migration sets that value to all old projects, unless that had already been overridden by a user.# Generated...
<commit_before><commit_msg>Use old SedAAdjust in all existing NHD projects The new SedAAdjust value applies to those projects using the NHD Hi Res dataset. For older projects using NHD Medium Res, the old value is more appropriate. This migration sets that value to all old projects, unless that had already been overr...
808d8deebc154822473316cea7838bab41c4daf1
CodeFights/secondRightmostZeroBit.py
CodeFights/secondRightmostZeroBit.py
#!/usr/local/bin/python # Code Second Right-most Zero Bit (Core) Problem def secondRightmostZeroBit(n): # print('Number: {}\nBinary: {}'.format(n, bin(n))) # Solution: # return (((((n + 1) | n) + 1) | n) - n) return [2**i for i in range(len(bin(n)[2:])) if (n >> i) % 2 == 0][1] def main(): tests...
Solve Code Fights second rightmost zero bit problem
Solve Code Fights second rightmost zero bit problem
Python
mit
HKuz/Test_Code
Solve Code Fights second rightmost zero bit problem
#!/usr/local/bin/python # Code Second Right-most Zero Bit (Core) Problem def secondRightmostZeroBit(n): # print('Number: {}\nBinary: {}'.format(n, bin(n))) # Solution: # return (((((n + 1) | n) + 1) | n) - n) return [2**i for i in range(len(bin(n)[2:])) if (n >> i) % 2 == 0][1] def main(): tests...
<commit_before><commit_msg>Solve Code Fights second rightmost zero bit problem<commit_after>
#!/usr/local/bin/python # Code Second Right-most Zero Bit (Core) Problem def secondRightmostZeroBit(n): # print('Number: {}\nBinary: {}'.format(n, bin(n))) # Solution: # return (((((n + 1) | n) + 1) | n) - n) return [2**i for i in range(len(bin(n)[2:])) if (n >> i) % 2 == 0][1] def main(): tests...
Solve Code Fights second rightmost zero bit problem#!/usr/local/bin/python # Code Second Right-most Zero Bit (Core) Problem def secondRightmostZeroBit(n): # print('Number: {}\nBinary: {}'.format(n, bin(n))) # Solution: # return (((((n + 1) | n) + 1) | n) - n) return [2**i for i in range(len(bin(n)[2:]...
<commit_before><commit_msg>Solve Code Fights second rightmost zero bit problem<commit_after>#!/usr/local/bin/python # Code Second Right-most Zero Bit (Core) Problem def secondRightmostZeroBit(n): # print('Number: {}\nBinary: {}'.format(n, bin(n))) # Solution: # return (((((n + 1) | n) + 1) | n) - n) r...
4ad05d8e05c115ed5f881351752f7c25fd611bdd
test/test_basic.py
test/test_basic.py
from __future__ import nested_scopes from twisted.internet import reactor import unittest from twistedsnmp.test import basetestcase from twistedsnmp import tableretriever, agentproxy from twistedsnmp.pysnmpproto import v2c,v1, error class BasicProxyTests( basetestcase.BaseTestCase ): version = 'v2c' def testBulkRequ...
Test for very basic operations
Test for very basic operations
Python
bsd-3-clause
mmattice/TwistedSNMP
Test for very basic operations
from __future__ import nested_scopes from twisted.internet import reactor import unittest from twistedsnmp.test import basetestcase from twistedsnmp import tableretriever, agentproxy from twistedsnmp.pysnmpproto import v2c,v1, error class BasicProxyTests( basetestcase.BaseTestCase ): version = 'v2c' def testBulkRequ...
<commit_before><commit_msg>Test for very basic operations<commit_after>
from __future__ import nested_scopes from twisted.internet import reactor import unittest from twistedsnmp.test import basetestcase from twistedsnmp import tableretriever, agentproxy from twistedsnmp.pysnmpproto import v2c,v1, error class BasicProxyTests( basetestcase.BaseTestCase ): version = 'v2c' def testBulkRequ...
Test for very basic operationsfrom __future__ import nested_scopes from twisted.internet import reactor import unittest from twistedsnmp.test import basetestcase from twistedsnmp import tableretriever, agentproxy from twistedsnmp.pysnmpproto import v2c,v1, error class BasicProxyTests( basetestcase.BaseTestCase ): ver...
<commit_before><commit_msg>Test for very basic operations<commit_after>from __future__ import nested_scopes from twisted.internet import reactor import unittest from twistedsnmp.test import basetestcase from twistedsnmp import tableretriever, agentproxy from twistedsnmp.pysnmpproto import v2c,v1, error class BasicProx...
d111aeb7270b68b0dc845f0a7e32a41e687920b9
test/test_board.py
test/test_board.py
import unittest import board class BoardTest(unittest.TestCase): def setUp(self): self.board_size = 9 self.testBoard = board.Board(self.board_size) #self.testBoard.place_piece(2, 3) def test_create_board(self): self.assertEqual(self.board_size, self.testBoard.board_size) ...
Add frame for unit test on board
Add frame for unit test on board
Python
mit
jonbrohauge/pySudokuSolver
Add frame for unit test on board
import unittest import board class BoardTest(unittest.TestCase): def setUp(self): self.board_size = 9 self.testBoard = board.Board(self.board_size) #self.testBoard.place_piece(2, 3) def test_create_board(self): self.assertEqual(self.board_size, self.testBoard.board_size) ...
<commit_before><commit_msg>Add frame for unit test on board<commit_after>
import unittest import board class BoardTest(unittest.TestCase): def setUp(self): self.board_size = 9 self.testBoard = board.Board(self.board_size) #self.testBoard.place_piece(2, 3) def test_create_board(self): self.assertEqual(self.board_size, self.testBoard.board_size) ...
Add frame for unit test on boardimport unittest import board class BoardTest(unittest.TestCase): def setUp(self): self.board_size = 9 self.testBoard = board.Board(self.board_size) #self.testBoard.place_piece(2, 3) def test_create_board(self): self.assertEqual(self.board_size,...
<commit_before><commit_msg>Add frame for unit test on board<commit_after>import unittest import board class BoardTest(unittest.TestCase): def setUp(self): self.board_size = 9 self.testBoard = board.Board(self.board_size) #self.testBoard.place_piece(2, 3) def test_create_board(self): ...
4a99f17a80da11655bc97372572220f1f0bb0d15
tools/reformat.py
tools/reformat.py
#!/usr/bin/python3 # Searches the assets/bibs/ directory and reformat all json files import json import os DIR = 'opacclient/opacapp/src/main/assets/bibs/' for filename in os.listdir(DIR): f = os.path.join(DIR, filename) data = json.load(open(f)) json.dump(data, open(f, 'w'), indent=4, sort_keys=True)
Add tool for re-indenting JSON files
Add tool for re-indenting JSON files
Python
mit
ruediger-w/opacclient,johan12345/opacclient,raphaelm/opacclient,raphaelm/opacclient,ruediger-w/opacclient,opacapp/opacclient,simon04/opacclient,ruediger-w/opacclient,simon04/opacclient,johan12345/opacclient,johan12345/opacclient,ruediger-w/opacclient,opacapp/opacclient,hurzl/opacclient,ruediger-w/opacclient,thesebas/op...
Add tool for re-indenting JSON files
#!/usr/bin/python3 # Searches the assets/bibs/ directory and reformat all json files import json import os DIR = 'opacclient/opacapp/src/main/assets/bibs/' for filename in os.listdir(DIR): f = os.path.join(DIR, filename) data = json.load(open(f)) json.dump(data, open(f, 'w'), indent=4, sort_keys=True)
<commit_before><commit_msg>Add tool for re-indenting JSON files<commit_after>
#!/usr/bin/python3 # Searches the assets/bibs/ directory and reformat all json files import json import os DIR = 'opacclient/opacapp/src/main/assets/bibs/' for filename in os.listdir(DIR): f = os.path.join(DIR, filename) data = json.load(open(f)) json.dump(data, open(f, 'w'), indent=4, sort_keys=True)
Add tool for re-indenting JSON files#!/usr/bin/python3 # Searches the assets/bibs/ directory and reformat all json files import json import os DIR = 'opacclient/opacapp/src/main/assets/bibs/' for filename in os.listdir(DIR): f = os.path.join(DIR, filename) data = json.load(open(f)) json.dump(data, open(f,...
<commit_before><commit_msg>Add tool for re-indenting JSON files<commit_after>#!/usr/bin/python3 # Searches the assets/bibs/ directory and reformat all json files import json import os DIR = 'opacclient/opacapp/src/main/assets/bibs/' for filename in os.listdir(DIR): f = os.path.join(DIR, filename) data = json....
a65187bebdec6ec99a9b5e967e818948ffb70969
test_pcalg.py
test_pcalg.py
# -*- coding: utf-8 -*- ''' Test suite for pcalg ''' import networkx as nx import numpy as np from gsq.ci_tests import ci_test_bin, ci_test_dis from gsq.gsq_testdata import bin_data, dis_data import pytest from pcalg import estimate_cpdag from pcalg import estimate_skeleton @pytest.mark.parametrize(('indep_test_fun...
Add test to verify fixed_edges option
test: Add test to verify fixed_edges option Signed-off-by: limjcst <[email protected]>
Python
bsd-2-clause
keiichishima/pcalg
test: Add test to verify fixed_edges option Signed-off-by: limjcst <[email protected]>
# -*- coding: utf-8 -*- ''' Test suite for pcalg ''' import networkx as nx import numpy as np from gsq.ci_tests import ci_test_bin, ci_test_dis from gsq.gsq_testdata import bin_data, dis_data import pytest from pcalg import estimate_cpdag from pcalg import estimate_skeleton @pytest.mark.parametrize(('indep_test_fun...
<commit_before><commit_msg>test: Add test to verify fixed_edges option Signed-off-by: limjcst <[email protected]><commit_after>
# -*- coding: utf-8 -*- ''' Test suite for pcalg ''' import networkx as nx import numpy as np from gsq.ci_tests import ci_test_bin, ci_test_dis from gsq.gsq_testdata import bin_data, dis_data import pytest from pcalg import estimate_cpdag from pcalg import estimate_skeleton @pytest.mark.parametrize(('indep_test_fun...
test: Add test to verify fixed_edges option Signed-off-by: limjcst <[email protected]># -*- coding: utf-8 -*- ''' Test suite for pcalg ''' import networkx as nx import numpy as np from gsq.ci_tests import ci_test_bin, ci_test_dis from gsq.gsq_testdata import bin_data, dis_data import p...
<commit_before><commit_msg>test: Add test to verify fixed_edges option Signed-off-by: limjcst <[email protected]><commit_after># -*- coding: utf-8 -*- ''' Test suite for pcalg ''' import networkx as nx import numpy as np from gsq.ci_tests import ci_test_bin, ci_test_dis from gsq.gsq_tes...
ed08bb7cb943c6299c97d44b1c4bd0c53d581cfb
omftools/cli/enumize_translation.py
omftools/cli/enumize_translation.py
import argparse import re from omftools.pyshadowdive.language import LanguageFile re_non_alphanumeric = re.compile(r'[\W]+') def txt(text: str) -> str: o = text.replace(' ', '_') o = re.sub(re_non_alphanumeric, '', o) o = o.upper() return o def generate_enum(in_file: str, out_file: str): langu...
Add tool for generating transtions enum
Add tool for generating transtions enum
Python
mit
omf2097/pyomftools,omf2097/pyomftools
Add tool for generating transtions enum
import argparse import re from omftools.pyshadowdive.language import LanguageFile re_non_alphanumeric = re.compile(r'[\W]+') def txt(text: str) -> str: o = text.replace(' ', '_') o = re.sub(re_non_alphanumeric, '', o) o = o.upper() return o def generate_enum(in_file: str, out_file: str): langu...
<commit_before><commit_msg>Add tool for generating transtions enum<commit_after>
import argparse import re from omftools.pyshadowdive.language import LanguageFile re_non_alphanumeric = re.compile(r'[\W]+') def txt(text: str) -> str: o = text.replace(' ', '_') o = re.sub(re_non_alphanumeric, '', o) o = o.upper() return o def generate_enum(in_file: str, out_file: str): langu...
Add tool for generating transtions enumimport argparse import re from omftools.pyshadowdive.language import LanguageFile re_non_alphanumeric = re.compile(r'[\W]+') def txt(text: str) -> str: o = text.replace(' ', '_') o = re.sub(re_non_alphanumeric, '', o) o = o.upper() return o def generate_enum(...
<commit_before><commit_msg>Add tool for generating transtions enum<commit_after>import argparse import re from omftools.pyshadowdive.language import LanguageFile re_non_alphanumeric = re.compile(r'[\W]+') def txt(text: str) -> str: o = text.replace(' ', '_') o = re.sub(re_non_alphanumeric, '', o) o = o....
b7a6463313c46d5d4545b17d49a3eca2e58fa2d3
benchmark/mini_bench.py
benchmark/mini_bench.py
# -*- coding: utf-8 -*- # Copyright 2015 moco_beta # # 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 agr...
Add a tiny benchmark script.
Add a tiny benchmark script.
Python
apache-2.0
mocobeta/janome,mocobeta/janome,nakagami/janome,nakagami/janome
Add a tiny benchmark script.
# -*- coding: utf-8 -*- # Copyright 2015 moco_beta # # 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 agr...
<commit_before><commit_msg>Add a tiny benchmark script.<commit_after>
# -*- coding: utf-8 -*- # Copyright 2015 moco_beta # # 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 agr...
Add a tiny benchmark script.# -*- coding: utf-8 -*- # Copyright 2015 moco_beta # # 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 requi...
<commit_before><commit_msg>Add a tiny benchmark script.<commit_after># -*- coding: utf-8 -*- # Copyright 2015 moco_beta # # 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....
c7895f0c799bc57e106c7e2f532af05609142f1b
helusers/management/commands/sync_helusers.py
helusers/management/commands/sync_helusers.py
from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.core.management.base import BaseCommand from django.contrib.sites.models import Site from allauth.socialaccount.models import SocialApp from helusers.providers.helsinki.provider import HelsinkiProvider class Command(B...
Add management command for keeping helsinki SocialApp in sync
Add management command for keeping helsinki SocialApp in sync
Python
bsd-2-clause
City-of-Helsinki/django-helusers,City-of-Helsinki/django-helusers
Add management command for keeping helsinki SocialApp in sync
from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.core.management.base import BaseCommand from django.contrib.sites.models import Site from allauth.socialaccount.models import SocialApp from helusers.providers.helsinki.provider import HelsinkiProvider class Command(B...
<commit_before><commit_msg>Add management command for keeping helsinki SocialApp in sync<commit_after>
from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.core.management.base import BaseCommand from django.contrib.sites.models import Site from allauth.socialaccount.models import SocialApp from helusers.providers.helsinki.provider import HelsinkiProvider class Command(B...
Add management command for keeping helsinki SocialApp in syncfrom django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.core.management.base import BaseCommand from django.contrib.sites.models import Site from allauth.socialaccount.models import SocialApp from helusers.provider...
<commit_before><commit_msg>Add management command for keeping helsinki SocialApp in sync<commit_after>from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.core.management.base import BaseCommand from django.contrib.sites.models import Site from allauth.socialaccount.model...
b589e6791ffdb85dfb7f11b331f090e6a9a0d874
senlin/db/sqlalchemy/migrate_repo/versions/006_node_cluster_dependents_column.py
senlin/db/sqlalchemy/migrate_repo/versions/006_node_cluster_dependents_column.py
# 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, software # distributed unde...
Add dependents column to node and cluster tables
Add dependents column to node and cluster tables This patch adds a new column 'dependents' to node and cluster tables. 'dependents' column will be used to store the relationship between vm node/cluster and container node/cluster. Change-Id: Ib4ebb3eafb986ed776dead5f616062606631190c
Python
apache-2.0
stackforge/senlin,openstack/senlin,openstack/senlin,stackforge/senlin,openstack/senlin
Add dependents column to node and cluster tables This patch adds a new column 'dependents' to node and cluster tables. 'dependents' column will be used to store the relationship between vm node/cluster and container node/cluster. Change-Id: Ib4ebb3eafb986ed776dead5f616062606631190c
# 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, software # distributed unde...
<commit_before><commit_msg>Add dependents column to node and cluster tables This patch adds a new column 'dependents' to node and cluster tables. 'dependents' column will be used to store the relationship between vm node/cluster and container node/cluster. Change-Id: Ib4ebb3eafb986ed776dead5f616062606631190c<commit_...
# 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, software # distributed unde...
Add dependents column to node and cluster tables This patch adds a new column 'dependents' to node and cluster tables. 'dependents' column will be used to store the relationship between vm node/cluster and container node/cluster. Change-Id: Ib4ebb3eafb986ed776dead5f616062606631190c# Licensed under the Apache License...
<commit_before><commit_msg>Add dependents column to node and cluster tables This patch adds a new column 'dependents' to node and cluster tables. 'dependents' column will be used to store the relationship between vm node/cluster and container node/cluster. Change-Id: Ib4ebb3eafb986ed776dead5f616062606631190c<commit_...
3c627a70c53488526d11911b612ce524c3799092
src/dashboard/src/main/migrations/0052_correct_extract_packages_fallback_link.py
src/dashboard/src/main/migrations/0052_correct_extract_packages_fallback_link.py
# -*- coding: utf-8 -*- """0052_correct_extact_packages_fallback_link.py Migration to ensure that if extract contents from compressed archives fails that the workflow doesn't continue to trudge along to completion where there is a likelihood of other errors. """ from __future__ import unicode_literals from django.db ...
Update defaultNextChainLink for extract packages
Update defaultNextChainLink for extract packages There are two extract packages microservices which continue to process data even if they have failed to extract content, or the service itself has failed for some other reason. Make sure that the Task falls back to 'Failed Transfer' so that the user knows and a decision...
Python
agpl-3.0
artefactual/archivematica,artefactual/archivematica,artefactual/archivematica,artefactual/archivematica
Update defaultNextChainLink for extract packages There are two extract packages microservices which continue to process data even if they have failed to extract content, or the service itself has failed for some other reason. Make sure that the Task falls back to 'Failed Transfer' so that the user knows and a decision...
# -*- coding: utf-8 -*- """0052_correct_extact_packages_fallback_link.py Migration to ensure that if extract contents from compressed archives fails that the workflow doesn't continue to trudge along to completion where there is a likelihood of other errors. """ from __future__ import unicode_literals from django.db ...
<commit_before><commit_msg>Update defaultNextChainLink for extract packages There are two extract packages microservices which continue to process data even if they have failed to extract content, or the service itself has failed for some other reason. Make sure that the Task falls back to 'Failed Transfer' so that th...
# -*- coding: utf-8 -*- """0052_correct_extact_packages_fallback_link.py Migration to ensure that if extract contents from compressed archives fails that the workflow doesn't continue to trudge along to completion where there is a likelihood of other errors. """ from __future__ import unicode_literals from django.db ...
Update defaultNextChainLink for extract packages There are two extract packages microservices which continue to process data even if they have failed to extract content, or the service itself has failed for some other reason. Make sure that the Task falls back to 'Failed Transfer' so that the user knows and a decision...
<commit_before><commit_msg>Update defaultNextChainLink for extract packages There are two extract packages microservices which continue to process data even if they have failed to extract content, or the service itself has failed for some other reason. Make sure that the Task falls back to 'Failed Transfer' so that th...
1ba2365678c3118b8b3e7629767bf2bfa4ec04e6
editorconfig.py
editorconfig.py
import os from ini import EditorConfigParser def get_filenames(path, filename): """Yield full filepath for filename in each directory in and above path""" while True: yield os.path.join(path, filename) newpath = os.path.dirname(path) if path == newpath: break path ...
Add class to locate and parse EditorConfig files
Add class to locate and parse EditorConfig files
Python
bsd-2-clause
dublebuble/editorconfig-gedit,dublebuble/editorconfig-gedit,pocke/editorconfig-vim,benjifisher/editorconfig-vim,johnfraney/editorconfig-vim,benjifisher/editorconfig-vim,johnfraney/editorconfig-vim,VictorBjelkholm/editorconfig-vim,VictorBjelkholm/editorconfig-vim,pocke/editorconfig-vim,VictorBjelkholm/editorconfig-vim,d...
Add class to locate and parse EditorConfig files
import os from ini import EditorConfigParser def get_filenames(path, filename): """Yield full filepath for filename in each directory in and above path""" while True: yield os.path.join(path, filename) newpath = os.path.dirname(path) if path == newpath: break path ...
<commit_before><commit_msg>Add class to locate and parse EditorConfig files<commit_after>
import os from ini import EditorConfigParser def get_filenames(path, filename): """Yield full filepath for filename in each directory in and above path""" while True: yield os.path.join(path, filename) newpath = os.path.dirname(path) if path == newpath: break path ...
Add class to locate and parse EditorConfig filesimport os from ini import EditorConfigParser def get_filenames(path, filename): """Yield full filepath for filename in each directory in and above path""" while True: yield os.path.join(path, filename) newpath = os.path.dirname(path) if ...
<commit_before><commit_msg>Add class to locate and parse EditorConfig files<commit_after>import os from ini import EditorConfigParser def get_filenames(path, filename): """Yield full filepath for filename in each directory in and above path""" while True: yield os.path.join(path, filename) ne...
8e195ab55be87cdd300c71b00d2dc64bb0d6c3ca
app/admin/forms.py
app/admin/forms.py
from flask.ext.wtf import Form from wtforms import StringField, TextAreaField, SubmitField from wtforms.validators import Required, Length, Email, Optional class ProfileForm(Form): name = StringField('Nafn', validators=[Optional(), Length(1,64)]) location = Strin...
Add a ProfileForm to modify the user profile
Add a ProfileForm to modify the user profile
Python
mit
finnurtorfa/aflafrettir.is,finnurtorfa/aflafrettir.is,finnurtorfa/aflafrettir.is,finnurtorfa/aflafrettir.is
Add a ProfileForm to modify the user profile
from flask.ext.wtf import Form from wtforms import StringField, TextAreaField, SubmitField from wtforms.validators import Required, Length, Email, Optional class ProfileForm(Form): name = StringField('Nafn', validators=[Optional(), Length(1,64)]) location = Strin...
<commit_before><commit_msg>Add a ProfileForm to modify the user profile<commit_after>
from flask.ext.wtf import Form from wtforms import StringField, TextAreaField, SubmitField from wtforms.validators import Required, Length, Email, Optional class ProfileForm(Form): name = StringField('Nafn', validators=[Optional(), Length(1,64)]) location = Strin...
Add a ProfileForm to modify the user profilefrom flask.ext.wtf import Form from wtforms import StringField, TextAreaField, SubmitField from wtforms.validators import Required, Length, Email, Optional class ProfileForm(Form): name = StringField('Nafn', validators=[Optional(), ...
<commit_before><commit_msg>Add a ProfileForm to modify the user profile<commit_after>from flask.ext.wtf import Form from wtforms import StringField, TextAreaField, SubmitField from wtforms.validators import Required, Length, Email, Optional class ProfileForm(Form): name = StringField('Nafn', validators=[Optiona...
a8d8027b8610d5f710638511cd0adb277de381c2
solutions/uppg2.py
solutions/uppg2.py
# coding: utf-8 def load_book(path): d = {} for rad in open('bok.txt'): (namn, _, nummer) = rad.partition(';') d[namn] = nummer.strip() return d def save_book(book, path): f = open('bok.txt', 'w') for name in book: f.write('%s;%s\n' % (name, book[name])) def print_menu(...
Add solution to problem 2
Add solution to problem 2
Python
mit
objarni/telefonboken
Add solution to problem 2
# coding: utf-8 def load_book(path): d = {} for rad in open('bok.txt'): (namn, _, nummer) = rad.partition(';') d[namn] = nummer.strip() return d def save_book(book, path): f = open('bok.txt', 'w') for name in book: f.write('%s;%s\n' % (name, book[name])) def print_menu(...
<commit_before><commit_msg>Add solution to problem 2<commit_after>
# coding: utf-8 def load_book(path): d = {} for rad in open('bok.txt'): (namn, _, nummer) = rad.partition(';') d[namn] = nummer.strip() return d def save_book(book, path): f = open('bok.txt', 'w') for name in book: f.write('%s;%s\n' % (name, book[name])) def print_menu(...
Add solution to problem 2# coding: utf-8 def load_book(path): d = {} for rad in open('bok.txt'): (namn, _, nummer) = rad.partition(';') d[namn] = nummer.strip() return d def save_book(book, path): f = open('bok.txt', 'w') for name in book: f.write('%s;%s\n' % (name, book[...
<commit_before><commit_msg>Add solution to problem 2<commit_after># coding: utf-8 def load_book(path): d = {} for rad in open('bok.txt'): (namn, _, nummer) = rad.partition(';') d[namn] = nummer.strip() return d def save_book(book, path): f = open('bok.txt', 'w') for name in book:...
f486504e4ae3758fee37ac2f94dc289c861ebcdd
data/.scripts/parse_foreign_languages_listing.py
data/.scripts/parse_foreign_languages_listing.py
#!/usr/bin/env python3 import bs4 from bs4 import BeautifulSoup from collections import defaultdict def get_table_tbody(soup): return soup.body.table.tbody.contents def extract_course_from_tr(tr): tds = tr.find_all('td') if tds[0].a is None: return None return { 'courseNumber': tds[...
Add script for parsing foreign language listing
Add script for parsing foreign language listing
Python
bsd-2-clause
mDibyo/berkeley-scheduler,mDibyo/berkeley-scheduler,mDibyo/berkeley-scheduler,mDibyo/berkeley-scheduler,mDibyo/berkeley-scheduler
Add script for parsing foreign language listing
#!/usr/bin/env python3 import bs4 from bs4 import BeautifulSoup from collections import defaultdict def get_table_tbody(soup): return soup.body.table.tbody.contents def extract_course_from_tr(tr): tds = tr.find_all('td') if tds[0].a is None: return None return { 'courseNumber': tds[...
<commit_before><commit_msg>Add script for parsing foreign language listing<commit_after>
#!/usr/bin/env python3 import bs4 from bs4 import BeautifulSoup from collections import defaultdict def get_table_tbody(soup): return soup.body.table.tbody.contents def extract_course_from_tr(tr): tds = tr.find_all('td') if tds[0].a is None: return None return { 'courseNumber': tds[...
Add script for parsing foreign language listing#!/usr/bin/env python3 import bs4 from bs4 import BeautifulSoup from collections import defaultdict def get_table_tbody(soup): return soup.body.table.tbody.contents def extract_course_from_tr(tr): tds = tr.find_all('td') if tds[0].a is None: return...
<commit_before><commit_msg>Add script for parsing foreign language listing<commit_after>#!/usr/bin/env python3 import bs4 from bs4 import BeautifulSoup from collections import defaultdict def get_table_tbody(soup): return soup.body.table.tbody.contents def extract_course_from_tr(tr): tds = tr.find_all('td'...
5d2f96836d0d63c68eb3acd5b8477cef231c5746
json2csv_business.py
json2csv_business.py
import json def main(): # print the header of output csv file print 'business_id,city,latitude,longitude' # for each entry in input json file print one csv row for line in open("data/yelp_academic_dataset_business.json"): input_json = json.loads(line) business_id = input_json['busines...
Add conversion from json to csv format for businesses
Add conversion from json to csv format for businesses
Python
mit
aysent/yelp-photo-explorer
Add conversion from json to csv format for businesses
import json def main(): # print the header of output csv file print 'business_id,city,latitude,longitude' # for each entry in input json file print one csv row for line in open("data/yelp_academic_dataset_business.json"): input_json = json.loads(line) business_id = input_json['busines...
<commit_before><commit_msg>Add conversion from json to csv format for businesses<commit_after>
import json def main(): # print the header of output csv file print 'business_id,city,latitude,longitude' # for each entry in input json file print one csv row for line in open("data/yelp_academic_dataset_business.json"): input_json = json.loads(line) business_id = input_json['busines...
Add conversion from json to csv format for businessesimport json def main(): # print the header of output csv file print 'business_id,city,latitude,longitude' # for each entry in input json file print one csv row for line in open("data/yelp_academic_dataset_business.json"): input_json = json....
<commit_before><commit_msg>Add conversion from json to csv format for businesses<commit_after>import json def main(): # print the header of output csv file print 'business_id,city,latitude,longitude' # for each entry in input json file print one csv row for line in open("data/yelp_academic_dataset_bu...
fed96a269df3f36deb1f37b80e0eb85f6abbb030
extract-patterns.py
extract-patterns.py
#!/usr/bin/env python """ Usage: extract-patterns.py FILE Print patterns in the structure of parse trees in FILE """ from sexp import sexps, tokenize, isterminal import re import sys filename = sys.argv[1] def remove_coindex(s): return re.sub('-\d+$', '', s) def get_verb(sexp): if isterminal(sexp): ...
Add improved script for extracting sentence patts
Add improved script for extracting sentence patts
Python
cc0-1.0
cordarei/ptb.py
Add improved script for extracting sentence patts
#!/usr/bin/env python """ Usage: extract-patterns.py FILE Print patterns in the structure of parse trees in FILE """ from sexp import sexps, tokenize, isterminal import re import sys filename = sys.argv[1] def remove_coindex(s): return re.sub('-\d+$', '', s) def get_verb(sexp): if isterminal(sexp): ...
<commit_before><commit_msg>Add improved script for extracting sentence patts<commit_after>
#!/usr/bin/env python """ Usage: extract-patterns.py FILE Print patterns in the structure of parse trees in FILE """ from sexp import sexps, tokenize, isterminal import re import sys filename = sys.argv[1] def remove_coindex(s): return re.sub('-\d+$', '', s) def get_verb(sexp): if isterminal(sexp): ...
Add improved script for extracting sentence patts#!/usr/bin/env python """ Usage: extract-patterns.py FILE Print patterns in the structure of parse trees in FILE """ from sexp import sexps, tokenize, isterminal import re import sys filename = sys.argv[1] def remove_coindex(s): return re.sub('-\d+$', '', s) d...
<commit_before><commit_msg>Add improved script for extracting sentence patts<commit_after>#!/usr/bin/env python """ Usage: extract-patterns.py FILE Print patterns in the structure of parse trees in FILE """ from sexp import sexps, tokenize, isterminal import re import sys filename = sys.argv[1] def remove_coindex...
14d6748e26c86c887cddc2ff0eb716c9db63a766
kNN.py
kNN.py
""" The program to classify the randomly generated data using the k-Nearest Neighbours algorithm """ import sys import numpy as np import math def loadData(fname='train.txt'): """ Function to load the randomly generated data Keyword arguments: fname -- The file name to load the data in to the nump...
Add the initial skeleton of the classifier
Add the initial skeleton of the classifier
Python
mit
Anirudh-Swaminathan/kNN_py
Add the initial skeleton of the classifier
""" The program to classify the randomly generated data using the k-Nearest Neighbours algorithm """ import sys import numpy as np import math def loadData(fname='train.txt'): """ Function to load the randomly generated data Keyword arguments: fname -- The file name to load the data in to the nump...
<commit_before><commit_msg>Add the initial skeleton of the classifier<commit_after>
""" The program to classify the randomly generated data using the k-Nearest Neighbours algorithm """ import sys import numpy as np import math def loadData(fname='train.txt'): """ Function to load the randomly generated data Keyword arguments: fname -- The file name to load the data in to the nump...
Add the initial skeleton of the classifier""" The program to classify the randomly generated data using the k-Nearest Neighbours algorithm """ import sys import numpy as np import math def loadData(fname='train.txt'): """ Function to load the randomly generated data Keyword arguments: fname -- The...
<commit_before><commit_msg>Add the initial skeleton of the classifier<commit_after>""" The program to classify the randomly generated data using the k-Nearest Neighbours algorithm """ import sys import numpy as np import math def loadData(fname='train.txt'): """ Function to load the randomly generated data...
e3728beb16dfb72a7be71cdf8ea53adb730827ad
examples/share-amis-boto3.py
examples/share-amis-boto3.py
import os import boto3 import botocore from boto3.core.session import Session os.environ['AWS_CONFIG_FILE'] = "/etc/profiles.cfg" orig_owner = "" shared_owner = "" region = "us-west-2" session = botocore.session.get_session() session.profile = 'beta' session = Session(session=session) ec2_conn = session.connect_to(...
Update the example via boto3
Update the example via boto3
Python
apache-2.0
henrysher/kamboo,henrysher/kamboo
Update the example via boto3
import os import boto3 import botocore from boto3.core.session import Session os.environ['AWS_CONFIG_FILE'] = "/etc/profiles.cfg" orig_owner = "" shared_owner = "" region = "us-west-2" session = botocore.session.get_session() session.profile = 'beta' session = Session(session=session) ec2_conn = session.connect_to(...
<commit_before><commit_msg>Update the example via boto3<commit_after>
import os import boto3 import botocore from boto3.core.session import Session os.environ['AWS_CONFIG_FILE'] = "/etc/profiles.cfg" orig_owner = "" shared_owner = "" region = "us-west-2" session = botocore.session.get_session() session.profile = 'beta' session = Session(session=session) ec2_conn = session.connect_to(...
Update the example via boto3import os import boto3 import botocore from boto3.core.session import Session os.environ['AWS_CONFIG_FILE'] = "/etc/profiles.cfg" orig_owner = "" shared_owner = "" region = "us-west-2" session = botocore.session.get_session() session.profile = 'beta' session = Session(session=session) ec...
<commit_before><commit_msg>Update the example via boto3<commit_after>import os import boto3 import botocore from boto3.core.session import Session os.environ['AWS_CONFIG_FILE'] = "/etc/profiles.cfg" orig_owner = "" shared_owner = "" region = "us-west-2" session = botocore.session.get_session() session.profile = 'bet...
8b7941e488bc902f7fa831b8c020b3eb07a154c0
flexget/tests/test_serialization.py
flexget/tests/test_serialization.py
import datetime from flexget import entry from flexget.utils import qualities class TestSerialization: def test_entry_serialization(self): entry1 = entry.Entry({ 'title': 'blah', 'url': 'http://blah', 'listfield': ['a', 'b', 1, 2], 'dictfield': {'a': 1, 'b'...
Add a test for serialization functionality
Add a test for serialization functionality
Python
mit
ianstalk/Flexget,Flexget/Flexget,malkavi/Flexget,malkavi/Flexget,crawln45/Flexget,Flexget/Flexget,ianstalk/Flexget,Flexget/Flexget,crawln45/Flexget,malkavi/Flexget,crawln45/Flexget,Flexget/Flexget,malkavi/Flexget,ianstalk/Flexget,crawln45/Flexget
Add a test for serialization functionality
import datetime from flexget import entry from flexget.utils import qualities class TestSerialization: def test_entry_serialization(self): entry1 = entry.Entry({ 'title': 'blah', 'url': 'http://blah', 'listfield': ['a', 'b', 1, 2], 'dictfield': {'a': 1, 'b'...
<commit_before><commit_msg>Add a test for serialization functionality<commit_after>
import datetime from flexget import entry from flexget.utils import qualities class TestSerialization: def test_entry_serialization(self): entry1 = entry.Entry({ 'title': 'blah', 'url': 'http://blah', 'listfield': ['a', 'b', 1, 2], 'dictfield': {'a': 1, 'b'...
Add a test for serialization functionalityimport datetime from flexget import entry from flexget.utils import qualities class TestSerialization: def test_entry_serialization(self): entry1 = entry.Entry({ 'title': 'blah', 'url': 'http://blah', 'listfield': ['a', 'b', 1,...
<commit_before><commit_msg>Add a test for serialization functionality<commit_after>import datetime from flexget import entry from flexget.utils import qualities class TestSerialization: def test_entry_serialization(self): entry1 = entry.Entry({ 'title': 'blah', 'url': 'http://blah...
0d210930c48cf490435e2ff310955650e8f606aa
db/player_game.py
db/player_game.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from .common import Base from .player import Player class PlayerGame(Base): __tablename__ = 'player_games' __autoload__ = True STANDARD_ATTRS = [ "position", "no", "goals", "assists", "primary_assists", "secondary_assists", "points", "plus_mi...
Introduce initial version of player game item
Introduce initial version of player game item
Python
mit
leaffan/pynhldb
Introduce initial version of player game item
#!/usr/bin/env python # -*- coding: utf-8 -*- from .common import Base from .player import Player class PlayerGame(Base): __tablename__ = 'player_games' __autoload__ = True STANDARD_ATTRS = [ "position", "no", "goals", "assists", "primary_assists", "secondary_assists", "points", "plus_mi...
<commit_before><commit_msg>Introduce initial version of player game item<commit_after>
#!/usr/bin/env python # -*- coding: utf-8 -*- from .common import Base from .player import Player class PlayerGame(Base): __tablename__ = 'player_games' __autoload__ = True STANDARD_ATTRS = [ "position", "no", "goals", "assists", "primary_assists", "secondary_assists", "points", "plus_mi...
Introduce initial version of player game item#!/usr/bin/env python # -*- coding: utf-8 -*- from .common import Base from .player import Player class PlayerGame(Base): __tablename__ = 'player_games' __autoload__ = True STANDARD_ATTRS = [ "position", "no", "goals", "assists", "primary_assists", ...
<commit_before><commit_msg>Introduce initial version of player game item<commit_after>#!/usr/bin/env python # -*- coding: utf-8 -*- from .common import Base from .player import Player class PlayerGame(Base): __tablename__ = 'player_games' __autoload__ = True STANDARD_ATTRS = [ "position", "no", ...
b7b30695022314a28a8d14878ce13566b8dd9522
code2html/tests/unit/test_util.py
code2html/tests/unit/test_util.py
# -*- coding: utf-8 -*- import unittest from code2html.util import get_subdir_name, included class GetSubdirNameTest(unittest.TestCase): def test_root_starts_with_dot(self): root = '.' dir_name = './first/second' self.assertEqual(get_subdir_name(root, dir_name), 'first/second') def ...
Add unit tests for utils
Add unit tests for utils
Python
mit
kfei/code2html
Add unit tests for utils
# -*- coding: utf-8 -*- import unittest from code2html.util import get_subdir_name, included class GetSubdirNameTest(unittest.TestCase): def test_root_starts_with_dot(self): root = '.' dir_name = './first/second' self.assertEqual(get_subdir_name(root, dir_name), 'first/second') def ...
<commit_before><commit_msg>Add unit tests for utils<commit_after>
# -*- coding: utf-8 -*- import unittest from code2html.util import get_subdir_name, included class GetSubdirNameTest(unittest.TestCase): def test_root_starts_with_dot(self): root = '.' dir_name = './first/second' self.assertEqual(get_subdir_name(root, dir_name), 'first/second') def ...
Add unit tests for utils# -*- coding: utf-8 -*- import unittest from code2html.util import get_subdir_name, included class GetSubdirNameTest(unittest.TestCase): def test_root_starts_with_dot(self): root = '.' dir_name = './first/second' self.assertEqual(get_subdir_name(root, dir_name), '...
<commit_before><commit_msg>Add unit tests for utils<commit_after># -*- coding: utf-8 -*- import unittest from code2html.util import get_subdir_name, included class GetSubdirNameTest(unittest.TestCase): def test_root_starts_with_dot(self): root = '.' dir_name = './first/second' self.asser...
2baaa4d754838cfc8196c678f86a8419ca139c12
test/single_test.py
test/single_test.py
import sys import unittest from unittest import TestSuite def suite(test_name): suite = unittest.TestSuite() suite.addTest(unittest.defaultTestLoader.loadTestsFromName(test_name)) return suite if __name__ == "__main__": if len(sys.argv) < 2: print("Usage {test_name}") sys.exit(1) ...
Add utility that allows debugging of single test
Add utility that allows debugging of single test
Python
mit
JakubPetriska/poker-cfr,JakubPetriska/poker-cfr
Add utility that allows debugging of single test
import sys import unittest from unittest import TestSuite def suite(test_name): suite = unittest.TestSuite() suite.addTest(unittest.defaultTestLoader.loadTestsFromName(test_name)) return suite if __name__ == "__main__": if len(sys.argv) < 2: print("Usage {test_name}") sys.exit(1) ...
<commit_before><commit_msg>Add utility that allows debugging of single test<commit_after>
import sys import unittest from unittest import TestSuite def suite(test_name): suite = unittest.TestSuite() suite.addTest(unittest.defaultTestLoader.loadTestsFromName(test_name)) return suite if __name__ == "__main__": if len(sys.argv) < 2: print("Usage {test_name}") sys.exit(1) ...
Add utility that allows debugging of single testimport sys import unittest from unittest import TestSuite def suite(test_name): suite = unittest.TestSuite() suite.addTest(unittest.defaultTestLoader.loadTestsFromName(test_name)) return suite if __name__ == "__main__": if len(sys.argv) < 2: pr...
<commit_before><commit_msg>Add utility that allows debugging of single test<commit_after>import sys import unittest from unittest import TestSuite def suite(test_name): suite = unittest.TestSuite() suite.addTest(unittest.defaultTestLoader.loadTestsFromName(test_name)) return suite if __name__ == "__main...
33be10064a7f2eb80b826e0d26fa9856f1c5f231
tests/test_model.py
tests/test_model.py
import unittest from gb import db,app from gb.models import (Wig, WigValue, BasePair, Bed, Annotation, Fasta, User, Track, View, ViewTrack) import logging logging.basicConfig() LOG = logging.getLogger(__name__) class TestSetUp(unittest.TestCase): def setUp(self): app...
Add beginnings of tests for model
Add beginnings of tests for model
Python
mit
mbiokyle29/geno-browser,mbiokyle29/geno-browser,mbiokyle29/geno-browser
Add beginnings of tests for model
import unittest from gb import db,app from gb.models import (Wig, WigValue, BasePair, Bed, Annotation, Fasta, User, Track, View, ViewTrack) import logging logging.basicConfig() LOG = logging.getLogger(__name__) class TestSetUp(unittest.TestCase): def setUp(self): app...
<commit_before><commit_msg>Add beginnings of tests for model<commit_after>
import unittest from gb import db,app from gb.models import (Wig, WigValue, BasePair, Bed, Annotation, Fasta, User, Track, View, ViewTrack) import logging logging.basicConfig() LOG = logging.getLogger(__name__) class TestSetUp(unittest.TestCase): def setUp(self): app...
Add beginnings of tests for modelimport unittest from gb import db,app from gb.models import (Wig, WigValue, BasePair, Bed, Annotation, Fasta, User, Track, View, ViewTrack) import logging logging.basicConfig() LOG = logging.getLogger(__name__) class TestSetUp(unittest.TestCase): ...
<commit_before><commit_msg>Add beginnings of tests for model<commit_after>import unittest from gb import db,app from gb.models import (Wig, WigValue, BasePair, Bed, Annotation, Fasta, User, Track, View, ViewTrack) import logging logging.basicConfig() LOG = logging.getLogger(__name_...
5303ad1f603d2d357d20f270f6342edf7b05cb9d
pylp/utils/paths.py
pylp/utils/paths.py
""" Some useful functions for using paths. Copyright (C) 2017 The Pylp Authors. This file is under the MIT License. """ import os.path # Make a path more "readable" def make_readable_path(path): home = os.path.expanduser("~") if path.startswith(home): path = "~" + path[len(home):] return path...
Make pylpfile path more readable
Make pylpfile path more readable
Python
mit
pylp/pylp
Make pylpfile path more readable
""" Some useful functions for using paths. Copyright (C) 2017 The Pylp Authors. This file is under the MIT License. """ import os.path # Make a path more "readable" def make_readable_path(path): home = os.path.expanduser("~") if path.startswith(home): path = "~" + path[len(home):] return path...
<commit_before><commit_msg>Make pylpfile path more readable<commit_after>
""" Some useful functions for using paths. Copyright (C) 2017 The Pylp Authors. This file is under the MIT License. """ import os.path # Make a path more "readable" def make_readable_path(path): home = os.path.expanduser("~") if path.startswith(home): path = "~" + path[len(home):] return path...
Make pylpfile path more readable""" Some useful functions for using paths. Copyright (C) 2017 The Pylp Authors. This file is under the MIT License. """ import os.path # Make a path more "readable" def make_readable_path(path): home = os.path.expanduser("~") if path.startswith(home): path = "~" + p...
<commit_before><commit_msg>Make pylpfile path more readable<commit_after>""" Some useful functions for using paths. Copyright (C) 2017 The Pylp Authors. This file is under the MIT License. """ import os.path # Make a path more "readable" def make_readable_path(path): home = os.path.expanduser("~") if path...
5781c36567aac9bd41d126d641be1e7cafdac1de
inselect/tests/test_basic.py
inselect/tests/test_basic.py
from inselect.image_viewer import ImageViewer import os import sys from PySide import QtGui import numpy as np from skimage import data_dir def test_main(): app = QtGui.QApplication(sys.argv) window = ImageViewer() window.open(os.path.join(data_dir, 'chelsea.png')) window.segment()
Add basic GUI instantiation test
Add basic GUI instantiation test
Python
bsd-3-clause
NaturalHistoryMuseum/inselect,NaturalHistoryMuseum/inselect
Add basic GUI instantiation test
from inselect.image_viewer import ImageViewer import os import sys from PySide import QtGui import numpy as np from skimage import data_dir def test_main(): app = QtGui.QApplication(sys.argv) window = ImageViewer() window.open(os.path.join(data_dir, 'chelsea.png')) window.segment()
<commit_before><commit_msg>Add basic GUI instantiation test<commit_after>
from inselect.image_viewer import ImageViewer import os import sys from PySide import QtGui import numpy as np from skimage import data_dir def test_main(): app = QtGui.QApplication(sys.argv) window = ImageViewer() window.open(os.path.join(data_dir, 'chelsea.png')) window.segment()
Add basic GUI instantiation testfrom inselect.image_viewer import ImageViewer import os import sys from PySide import QtGui import numpy as np from skimage import data_dir def test_main(): app = QtGui.QApplication(sys.argv) window = ImageViewer() window.open(os.path.join(data_dir, 'chelsea.png')) w...
<commit_before><commit_msg>Add basic GUI instantiation test<commit_after>from inselect.image_viewer import ImageViewer import os import sys from PySide import QtGui import numpy as np from skimage import data_dir def test_main(): app = QtGui.QApplication(sys.argv) window = ImageViewer() window.open(os....
1019631b883c00550b6d3344de3649d7e9a98ef1
tests/test_irc_formatter.py
tests/test_irc_formatter.py
# -*- coding: utf-8 -*- """ Pygments HTML formatter tests ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from __future__ import print_function import io import os import re import unittest import tempfile fr...
Add basic test for irc formatter
Add basic test for irc formatter
Python
bsd-2-clause
pygments/pygments,dscorbett/pygments,pygments/pygments,dscorbett/pygments,dscorbett/pygments,dscorbett/pygments,dscorbett/pygments,pygments/pygments,dscorbett/pygments,dscorbett/pygments,pygments/pygments,pygments/pygments,pygments/pygments,pygments/pygments,pygments/pygments,dscorbett/pygments,dscorbett/pygments,dscor...
Add basic test for irc formatter
# -*- coding: utf-8 -*- """ Pygments HTML formatter tests ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from __future__ import print_function import io import os import re import unittest import tempfile fr...
<commit_before><commit_msg>Add basic test for irc formatter<commit_after>
# -*- coding: utf-8 -*- """ Pygments HTML formatter tests ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from __future__ import print_function import io import os import re import unittest import tempfile fr...
Add basic test for irc formatter# -*- coding: utf-8 -*- """ Pygments HTML formatter tests ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from __future__ import print_function import io import os import re im...
<commit_before><commit_msg>Add basic test for irc formatter<commit_after># -*- coding: utf-8 -*- """ Pygments HTML formatter tests ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from __future__ import print_f...
1a5f1431886b3b7517db7180fa0f53d71c779901
tests/test_indentxml.py
tests/test_indentxml.py
from unittest import TestCase import sublime class IndentXmlBase(TestCase): src = "" def set_text(self, string): self.view.run_command("insert", {"characters": string}) def get_text(self): return self.view.substr(sublime.Region(0, self.view.size())) def setUp(self): self.v...
Add unit-tests for the plugin
Add unit-tests for the plugin Unit-tests are using https://github.com/randy3k/UnitTesting
Python
mit
alek-sys/sublimetext_indentxml,alek-sys/sublimetext_indentxml
Add unit-tests for the plugin Unit-tests are using https://github.com/randy3k/UnitTesting
from unittest import TestCase import sublime class IndentXmlBase(TestCase): src = "" def set_text(self, string): self.view.run_command("insert", {"characters": string}) def get_text(self): return self.view.substr(sublime.Region(0, self.view.size())) def setUp(self): self.v...
<commit_before><commit_msg>Add unit-tests for the plugin Unit-tests are using https://github.com/randy3k/UnitTesting<commit_after>
from unittest import TestCase import sublime class IndentXmlBase(TestCase): src = "" def set_text(self, string): self.view.run_command("insert", {"characters": string}) def get_text(self): return self.view.substr(sublime.Region(0, self.view.size())) def setUp(self): self.v...
Add unit-tests for the plugin Unit-tests are using https://github.com/randy3k/UnitTestingfrom unittest import TestCase import sublime class IndentXmlBase(TestCase): src = "" def set_text(self, string): self.view.run_command("insert", {"characters": string}) def get_text(self): return ...
<commit_before><commit_msg>Add unit-tests for the plugin Unit-tests are using https://github.com/randy3k/UnitTesting<commit_after>from unittest import TestCase import sublime class IndentXmlBase(TestCase): src = "" def set_text(self, string): self.view.run_command("insert", {"characters": string})...
4a81ee90a39c4831dca186ae269184c703ddbf2e
src/autobot/src/udpRemote.py
src/autobot/src/udpRemote.py
#!/usr/bin/env python import rospy import socket from autobot.msg import drive_param """ Warning: This code has not been tested at all Protocol could be comma delimited Vaa.aa;Abb.bb TODO - [ ] Unit test - [ ] Define protocol - [ ] Use select() for non-blocking operation - [ ] Use a timeout for setting drive/angle ...
Add code for udp remote
Add code for udp remote This code is untested and is still WIP.
Python
mit
atkvo/masters-bot,atkvo/masters-bot,atkvo/masters-bot,atkvo/masters-bot,atkvo/masters-bot
Add code for udp remote This code is untested and is still WIP.
#!/usr/bin/env python import rospy import socket from autobot.msg import drive_param """ Warning: This code has not been tested at all Protocol could be comma delimited Vaa.aa;Abb.bb TODO - [ ] Unit test - [ ] Define protocol - [ ] Use select() for non-blocking operation - [ ] Use a timeout for setting drive/angle ...
<commit_before><commit_msg>Add code for udp remote This code is untested and is still WIP.<commit_after>
#!/usr/bin/env python import rospy import socket from autobot.msg import drive_param """ Warning: This code has not been tested at all Protocol could be comma delimited Vaa.aa;Abb.bb TODO - [ ] Unit test - [ ] Define protocol - [ ] Use select() for non-blocking operation - [ ] Use a timeout for setting drive/angle ...
Add code for udp remote This code is untested and is still WIP.#!/usr/bin/env python import rospy import socket from autobot.msg import drive_param """ Warning: This code has not been tested at all Protocol could be comma delimited Vaa.aa;Abb.bb TODO - [ ] Unit test - [ ] Define protocol - [ ] Use select() for non...
<commit_before><commit_msg>Add code for udp remote This code is untested and is still WIP.<commit_after>#!/usr/bin/env python import rospy import socket from autobot.msg import drive_param """ Warning: This code has not been tested at all Protocol could be comma delimited Vaa.aa;Abb.bb TODO - [ ] Unit test - [ ] D...
c5546da1d84c7969f51d186bb84298a4fea8bef6
bindings/python/examples/return_region.py
bindings/python/examples/return_region.py
#!/usr/bin/env python # Copyright 2019 Stanford University # # 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 applicabl...
Test returning regions from tasks.
python: Test returning regions from tasks.
Python
apache-2.0
StanfordLegion/legion,StanfordLegion/legion,StanfordLegion/legion,StanfordLegion/legion,StanfordLegion/legion,StanfordLegion/legion,StanfordLegion/legion,StanfordLegion/legion
python: Test returning regions from tasks.
#!/usr/bin/env python # Copyright 2019 Stanford University # # 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 applicabl...
<commit_before><commit_msg>python: Test returning regions from tasks.<commit_after>
#!/usr/bin/env python # Copyright 2019 Stanford University # # 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 applicabl...
python: Test returning regions from tasks.#!/usr/bin/env python # Copyright 2019 Stanford University # # 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/LI...
<commit_before><commit_msg>python: Test returning regions from tasks.<commit_after>#!/usr/bin/env python # Copyright 2019 Stanford University # # 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 ...
0ca5e2fa612687533c4a60dd1e2463fde6fc0bd6
Utilities/ConvertLanguage.py
Utilities/ConvertLanguage.py
#!/usr/bin/env python ################################################################################ # ConvertLanguage.py - converts an old 3RVX version 2.X language file to the new # 3.X format. A 'template' file is used to provide the missing strings that # didn't exist in the old 2.X translations. # # Matthew Male...
Add script to convert old language files
Add script to convert old language files
Python
bsd-2-clause
malensek/3RVX,Soulflare3/3RVX,Soulflare3/3RVX,malensek/3RVX,malensek/3RVX,Soulflare3/3RVX
Add script to convert old language files
#!/usr/bin/env python ################################################################################ # ConvertLanguage.py - converts an old 3RVX version 2.X language file to the new # 3.X format. A 'template' file is used to provide the missing strings that # didn't exist in the old 2.X translations. # # Matthew Male...
<commit_before><commit_msg>Add script to convert old language files<commit_after>
#!/usr/bin/env python ################################################################################ # ConvertLanguage.py - converts an old 3RVX version 2.X language file to the new # 3.X format. A 'template' file is used to provide the missing strings that # didn't exist in the old 2.X translations. # # Matthew Male...
Add script to convert old language files#!/usr/bin/env python ################################################################################ # ConvertLanguage.py - converts an old 3RVX version 2.X language file to the new # 3.X format. A 'template' file is used to provide the missing strings that # didn't exist in th...
<commit_before><commit_msg>Add script to convert old language files<commit_after>#!/usr/bin/env python ################################################################################ # ConvertLanguage.py - converts an old 3RVX version 2.X language file to the new # 3.X format. A 'template' file is used to provide the ...
ff92928b063ff36bb71945b6ff1c75d149411bc7
helloTurtle.py
helloTurtle.py
# drawing out a hello world with the python turtle library! # extension: different modules for each turtle so letter color, etc. can be easily changed. # TODO: fix angle errors, draw the rest of the letters import turtle wn = turtle.Screen() h = turtle.Turtle() # move module to the left side of the screen h.penup() ...
Add the .py file to the repo.
Add the .py file to the repo. This file is where the actual program is!
Python
cc0-1.0
slohmes/Hello-Turtle
Add the .py file to the repo. This file is where the actual program is!
# drawing out a hello world with the python turtle library! # extension: different modules for each turtle so letter color, etc. can be easily changed. # TODO: fix angle errors, draw the rest of the letters import turtle wn = turtle.Screen() h = turtle.Turtle() # move module to the left side of the screen h.penup() ...
<commit_before><commit_msg>Add the .py file to the repo. This file is where the actual program is!<commit_after>
# drawing out a hello world with the python turtle library! # extension: different modules for each turtle so letter color, etc. can be easily changed. # TODO: fix angle errors, draw the rest of the letters import turtle wn = turtle.Screen() h = turtle.Turtle() # move module to the left side of the screen h.penup() ...
Add the .py file to the repo. This file is where the actual program is!# drawing out a hello world with the python turtle library! # extension: different modules for each turtle so letter color, etc. can be easily changed. # TODO: fix angle errors, draw the rest of the letters import turtle wn = turtle.Screen() h = ...
<commit_before><commit_msg>Add the .py file to the repo. This file is where the actual program is!<commit_after># drawing out a hello world with the python turtle library! # extension: different modules for each turtle so letter color, etc. can be easily changed. # TODO: fix angle errors, draw the rest of the letters...
6886dc54980b5c2c66bac585a36f0d24e7cc9eb0
tests/test_tools.py
tests/test_tools.py
"""Test the functions in the tools file.""" import bibpy.tools def test_version_format(): assert bibpy.tools.version_format().format('0.1.0') == '%(prog)s v0.1.0' program_name = dict(prog='tool_name') assert (bibpy.tools.version_format() % program_name).format('2.3') ==\ 'tool_name v2.3' def t...
Add initial tests for bibpy tools
Add initial tests for bibpy tools
Python
mit
MisanthropicBit/bibpy,MisanthropicBit/bibpy
Add initial tests for bibpy tools
"""Test the functions in the tools file.""" import bibpy.tools def test_version_format(): assert bibpy.tools.version_format().format('0.1.0') == '%(prog)s v0.1.0' program_name = dict(prog='tool_name') assert (bibpy.tools.version_format() % program_name).format('2.3') ==\ 'tool_name v2.3' def t...
<commit_before><commit_msg>Add initial tests for bibpy tools<commit_after>
"""Test the functions in the tools file.""" import bibpy.tools def test_version_format(): assert bibpy.tools.version_format().format('0.1.0') == '%(prog)s v0.1.0' program_name = dict(prog='tool_name') assert (bibpy.tools.version_format() % program_name).format('2.3') ==\ 'tool_name v2.3' def t...
Add initial tests for bibpy tools"""Test the functions in the tools file.""" import bibpy.tools def test_version_format(): assert bibpy.tools.version_format().format('0.1.0') == '%(prog)s v0.1.0' program_name = dict(prog='tool_name') assert (bibpy.tools.version_format() % program_name).format('2.3') ==\...
<commit_before><commit_msg>Add initial tests for bibpy tools<commit_after>"""Test the functions in the tools file.""" import bibpy.tools def test_version_format(): assert bibpy.tools.version_format().format('0.1.0') == '%(prog)s v0.1.0' program_name = dict(prog='tool_name') assert (bibpy.tools.version_f...
81a77ec5e354448f328fa4d65154cea65709eac0
backend/scripts/fixdrafts.py
backend/scripts/fixdrafts.py
#!/usr/bin/env python import rethinkdb as r import optparse if __name__ == "__main__": parser = optparse.OptionParser() parser.add_option("-P", "--port", dest="port", type="int", help="rethinkdb port", default=30815) (options, args) = parser.parse_args() conn = r.connect('localho...
Add script to fix Emmanuelle's messed up drafts.
Add script to fix Emmanuelle's messed up drafts.
Python
mit
materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org
Add script to fix Emmanuelle's messed up drafts.
#!/usr/bin/env python import rethinkdb as r import optparse if __name__ == "__main__": parser = optparse.OptionParser() parser.add_option("-P", "--port", dest="port", type="int", help="rethinkdb port", default=30815) (options, args) = parser.parse_args() conn = r.connect('localho...
<commit_before><commit_msg>Add script to fix Emmanuelle's messed up drafts.<commit_after>
#!/usr/bin/env python import rethinkdb as r import optparse if __name__ == "__main__": parser = optparse.OptionParser() parser.add_option("-P", "--port", dest="port", type="int", help="rethinkdb port", default=30815) (options, args) = parser.parse_args() conn = r.connect('localho...
Add script to fix Emmanuelle's messed up drafts.#!/usr/bin/env python import rethinkdb as r import optparse if __name__ == "__main__": parser = optparse.OptionParser() parser.add_option("-P", "--port", dest="port", type="int", help="rethinkdb port", default=30815) (options, args) = p...
<commit_before><commit_msg>Add script to fix Emmanuelle's messed up drafts.<commit_after>#!/usr/bin/env python import rethinkdb as r import optparse if __name__ == "__main__": parser = optparse.OptionParser() parser.add_option("-P", "--port", dest="port", type="int", help="rethinkdb port...
4890ec7d794918cb642a27778ac48ecdc28e02ab
pyfermod/ferfmrc.py
pyfermod/ferfmrc.py
''' Represents a forecast-model-run collection in Ferret ''' from __future__ import print_function import pyferret class FerFMRC(pyferret.FerAggDSet): ''' A forecast-model-run collection dataset in Ferret. Variables in this dataset (FerFMRCVar objects) have restrictions on the time and forecast axes, an...
Add initial FerFMRC object - very incomplete
Add initial FerFMRC object - very incomplete git-svn-id: 77c6ae948ca0f9b1480c5330e5e23bcf0afa938f@23147 fdbf22ae-c210-0410-be80-ca943da6b8f8
Python
unlicense
NOAA-PMEL/PyFerret,NOAA-PMEL/PyFerret,NOAA-PMEL/PyFerret,NOAA-PMEL/PyFerret,NOAA-PMEL/PyFerret
Add initial FerFMRC object - very incomplete git-svn-id: 77c6ae948ca0f9b1480c5330e5e23bcf0afa938f@23147 fdbf22ae-c210-0410-be80-ca943da6b8f8
''' Represents a forecast-model-run collection in Ferret ''' from __future__ import print_function import pyferret class FerFMRC(pyferret.FerAggDSet): ''' A forecast-model-run collection dataset in Ferret. Variables in this dataset (FerFMRCVar objects) have restrictions on the time and forecast axes, an...
<commit_before><commit_msg>Add initial FerFMRC object - very incomplete git-svn-id: 77c6ae948ca0f9b1480c5330e5e23bcf0afa938f@23147 fdbf22ae-c210-0410-be80-ca943da6b8f8<commit_after>
''' Represents a forecast-model-run collection in Ferret ''' from __future__ import print_function import pyferret class FerFMRC(pyferret.FerAggDSet): ''' A forecast-model-run collection dataset in Ferret. Variables in this dataset (FerFMRCVar objects) have restrictions on the time and forecast axes, an...
Add initial FerFMRC object - very incomplete git-svn-id: 77c6ae948ca0f9b1480c5330e5e23bcf0afa938f@23147 fdbf22ae-c210-0410-be80-ca943da6b8f8''' Represents a forecast-model-run collection in Ferret ''' from __future__ import print_function import pyferret class FerFMRC(pyferret.FerAggDSet): ''' A forecast-mo...
<commit_before><commit_msg>Add initial FerFMRC object - very incomplete git-svn-id: 77c6ae948ca0f9b1480c5330e5e23bcf0afa938f@23147 fdbf22ae-c210-0410-be80-ca943da6b8f8<commit_after>''' Represents a forecast-model-run collection in Ferret ''' from __future__ import print_function import pyferret class FerFMRC(pyferr...
35e9088db9c47ab9e59489c23d6975c5747c43b8
studygroups/migrations/0107_auto_20181115_1004.py
studygroups/migrations/0107_auto_20181115_1004.py
# -*- coding: utf-8 -*- # Generated by Django 1.11.6 on 2018-11-15 10:04 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('studygroups', '0106_studygroup_country_en'), ] operations = [ migrations.Al...
Add migration for remove blank=True on country_en field
Add migration for remove blank=True on country_en field
Python
mit
p2pu/learning-circles,p2pu/learning-circles,p2pu/learning-circles,p2pu/learning-circles
Add migration for remove blank=True on country_en field
# -*- coding: utf-8 -*- # Generated by Django 1.11.6 on 2018-11-15 10:04 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('studygroups', '0106_studygroup_country_en'), ] operations = [ migrations.Al...
<commit_before><commit_msg>Add migration for remove blank=True on country_en field<commit_after>
# -*- coding: utf-8 -*- # Generated by Django 1.11.6 on 2018-11-15 10:04 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('studygroups', '0106_studygroup_country_en'), ] operations = [ migrations.Al...
Add migration for remove blank=True on country_en field# -*- coding: utf-8 -*- # Generated by Django 1.11.6 on 2018-11-15 10:04 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('studygroups', '0106_studygroup_countr...
<commit_before><commit_msg>Add migration for remove blank=True on country_en field<commit_after># -*- coding: utf-8 -*- # Generated by Django 1.11.6 on 2018-11-15 10:04 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ...
3b3c3c68c52f586db0be44e22fe5ba9400c5e53c
familias/migrations/0008_auto_20170303_2331.py
familias/migrations/0008_auto_20170303_2331.py
# -*- coding: utf-8 -*- # Generated by Django 1.10.2 on 2017-03-03 23:31 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('familias', '0007_merge_20170228_1344'), ] operations = [ migrations.AlterFi...
Create appropriate migrations for changes in models
Create appropriate migrations for changes in models
Python
mit
erikiado/jp2_online,erikiado/jp2_online,erikiado/jp2_online
Create appropriate migrations for changes in models
# -*- coding: utf-8 -*- # Generated by Django 1.10.2 on 2017-03-03 23:31 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('familias', '0007_merge_20170228_1344'), ] operations = [ migrations.AlterFi...
<commit_before><commit_msg>Create appropriate migrations for changes in models<commit_after>
# -*- coding: utf-8 -*- # Generated by Django 1.10.2 on 2017-03-03 23:31 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('familias', '0007_merge_20170228_1344'), ] operations = [ migrations.AlterFi...
Create appropriate migrations for changes in models# -*- coding: utf-8 -*- # Generated by Django 1.10.2 on 2017-03-03 23:31 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('familias', '0007_merge_20170228_1344'), ...
<commit_before><commit_msg>Create appropriate migrations for changes in models<commit_after># -*- coding: utf-8 -*- # Generated by Django 1.10.2 on 2017-03-03 23:31 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('...
479275674916e45c0a2b70a372962f3d0c271e4f
SatNOGS/base/management/commands/update_all_tle.py
SatNOGS/base/management/commands/update_all_tle.py
from orbit import satellite from django.core.management.base import BaseCommand from base.utils import update_all_satellites from base.models import Satellite class Command(BaseCommand): help = 'Create initial fixtures' def handle(self, *args, **options): satellites = Satellite.objets.all() ...
Add management command to update all existing satellite tle data
Add management command to update all existing satellite tle data
Python
agpl-3.0
cshields/satnogs-network,cshields/satnogs-network,cshields/satnogs-network,cshields/satnogs-network
Add management command to update all existing satellite tle data
from orbit import satellite from django.core.management.base import BaseCommand from base.utils import update_all_satellites from base.models import Satellite class Command(BaseCommand): help = 'Create initial fixtures' def handle(self, *args, **options): satellites = Satellite.objets.all() ...
<commit_before><commit_msg>Add management command to update all existing satellite tle data<commit_after>
from orbit import satellite from django.core.management.base import BaseCommand from base.utils import update_all_satellites from base.models import Satellite class Command(BaseCommand): help = 'Create initial fixtures' def handle(self, *args, **options): satellites = Satellite.objets.all() ...
Add management command to update all existing satellite tle datafrom orbit import satellite from django.core.management.base import BaseCommand from base.utils import update_all_satellites from base.models import Satellite class Command(BaseCommand): help = 'Create initial fixtures' def handle(self, *args,...
<commit_before><commit_msg>Add management command to update all existing satellite tle data<commit_after>from orbit import satellite from django.core.management.base import BaseCommand from base.utils import update_all_satellites from base.models import Satellite class Command(BaseCommand): help = 'Create initi...
9baf9ede15fa988b5da711605b67cc5bbbbc5b36
wanorlan/wanorlan.py
wanorlan/wanorlan.py
import time import datetime import subprocess import json import sys import re PING_RTT_REGEX = re.compile('rtt.+=\s*([\d.]+)') def get_status(ip, timeout): t0 = time.time() error = subprocess.call(['ping', '-c', '1', '-W', str(timeout), ip], stdout=sys.stderr.fileno(), ...
Add simple script for logging to diagnose WAN vs LAN connection issues
Add simple script for logging to diagnose WAN vs LAN connection issues
Python
mit
DouglasOrr/Snippets,DouglasOrr/Snippets,DouglasOrr/Snippets,DouglasOrr/Snippets,DouglasOrr/Snippets,DouglasOrr/Snippets,DouglasOrr/Snippets,DouglasOrr/Snippets
Add simple script for logging to diagnose WAN vs LAN connection issues
import time import datetime import subprocess import json import sys import re PING_RTT_REGEX = re.compile('rtt.+=\s*([\d.]+)') def get_status(ip, timeout): t0 = time.time() error = subprocess.call(['ping', '-c', '1', '-W', str(timeout), ip], stdout=sys.stderr.fileno(), ...
<commit_before><commit_msg>Add simple script for logging to diagnose WAN vs LAN connection issues<commit_after>
import time import datetime import subprocess import json import sys import re PING_RTT_REGEX = re.compile('rtt.+=\s*([\d.]+)') def get_status(ip, timeout): t0 = time.time() error = subprocess.call(['ping', '-c', '1', '-W', str(timeout), ip], stdout=sys.stderr.fileno(), ...
Add simple script for logging to diagnose WAN vs LAN connection issuesimport time import datetime import subprocess import json import sys import re PING_RTT_REGEX = re.compile('rtt.+=\s*([\d.]+)') def get_status(ip, timeout): t0 = time.time() error = subprocess.call(['ping', '-c', '1', '-W', str(timeout), ...
<commit_before><commit_msg>Add simple script for logging to diagnose WAN vs LAN connection issues<commit_after>import time import datetime import subprocess import json import sys import re PING_RTT_REGEX = re.compile('rtt.+=\s*([\d.]+)') def get_status(ip, timeout): t0 = time.time() error = subprocess.call...
28067277adb659465f1762bd1437a45404fe15e6
cobs2/_cobspy.py
cobs2/_cobspy.py
""" Consistent Overhead Byte Stuffing (COBS) This version is for Python 2.x. """ class DecodeError(Exception): pass def encode(in_bytes): """Encode a string using Consistent Overhead Byte Stuffing (COBS). Input is any byte string. Output is also a byte string. Encoding guarantees no zero ...
Add Python 2.x pure Python implementation.
Add Python 2.x pure Python implementation.
Python
mit
cmcqueen/cobs-python,cmcqueen/cobs-python
Add Python 2.x pure Python implementation.
""" Consistent Overhead Byte Stuffing (COBS) This version is for Python 2.x. """ class DecodeError(Exception): pass def encode(in_bytes): """Encode a string using Consistent Overhead Byte Stuffing (COBS). Input is any byte string. Output is also a byte string. Encoding guarantees no zero ...
<commit_before><commit_msg>Add Python 2.x pure Python implementation.<commit_after>
""" Consistent Overhead Byte Stuffing (COBS) This version is for Python 2.x. """ class DecodeError(Exception): pass def encode(in_bytes): """Encode a string using Consistent Overhead Byte Stuffing (COBS). Input is any byte string. Output is also a byte string. Encoding guarantees no zero ...
Add Python 2.x pure Python implementation.""" Consistent Overhead Byte Stuffing (COBS) This version is for Python 2.x. """ class DecodeError(Exception): pass def encode(in_bytes): """Encode a string using Consistent Overhead Byte Stuffing (COBS). Input is any byte string. Output is also a byte str...
<commit_before><commit_msg>Add Python 2.x pure Python implementation.<commit_after>""" Consistent Overhead Byte Stuffing (COBS) This version is for Python 2.x. """ class DecodeError(Exception): pass def encode(in_bytes): """Encode a string using Consistent Overhead Byte Stuffing (COBS). Input is a...