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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
839db09465562e80a9d5612a0fba3a779e99eeb0 | postgres/forms/interval_field.py | postgres/forms/interval_field.py | import datetime
import re
from django import forms
INTERVAL_RE = re.compile(
r'^((?P<days>\d+) days)?,?\W*'
r'((?P<hours>\d\d?)(:(?P<minutes>\d\d)(:(?P<seconds>\d\d))?)?)?'
)
def build_interval(data):
match = INTERVAL_RE.match(data)
if match:
return datetime.timedelta(**dict(
(key... | Add an INTERVAL form field. | Add an INTERVAL form field.
| Python | bsd-3-clause | wlanslovenija/django-postgres | Add an INTERVAL form field. | import datetime
import re
from django import forms
INTERVAL_RE = re.compile(
r'^((?P<days>\d+) days)?,?\W*'
r'((?P<hours>\d\d?)(:(?P<minutes>\d\d)(:(?P<seconds>\d\d))?)?)?'
)
def build_interval(data):
match = INTERVAL_RE.match(data)
if match:
return datetime.timedelta(**dict(
(key... | <commit_before><commit_msg>Add an INTERVAL form field.<commit_after> | import datetime
import re
from django import forms
INTERVAL_RE = re.compile(
r'^((?P<days>\d+) days)?,?\W*'
r'((?P<hours>\d\d?)(:(?P<minutes>\d\d)(:(?P<seconds>\d\d))?)?)?'
)
def build_interval(data):
match = INTERVAL_RE.match(data)
if match:
return datetime.timedelta(**dict(
(key... | Add an INTERVAL form field.import datetime
import re
from django import forms
INTERVAL_RE = re.compile(
r'^((?P<days>\d+) days)?,?\W*'
r'((?P<hours>\d\d?)(:(?P<minutes>\d\d)(:(?P<seconds>\d\d))?)?)?'
)
def build_interval(data):
match = INTERVAL_RE.match(data)
if match:
return datetime.timedel... | <commit_before><commit_msg>Add an INTERVAL form field.<commit_after>import datetime
import re
from django import forms
INTERVAL_RE = re.compile(
r'^((?P<days>\d+) days)?,?\W*'
r'((?P<hours>\d\d?)(:(?P<minutes>\d\d)(:(?P<seconds>\d\d))?)?)?'
)
def build_interval(data):
match = INTERVAL_RE.match(data)
... | |
87a316584c20c3a6589156ad304e9e81f784d726 | libtaxii/test/to_text_11_test.py | libtaxii/test/to_text_11_test.py |
import unittest
import os
import glob
import libtaxii.messages_11 as tm11
import libtaxii.taxii_default_query as tdq
# from libtaxii.validation import SchemaValidator
class To_text_11_test(unittest.TestCase):
input_path = os.path.join('input','1.1')
output_path = os.path.join('output','1.1')
def test_to... | Test to parse & serialize test documents to XML and text. | Test to parse & serialize test documents to XML and text. | Python | bsd-3-clause | stkyle/libtaxii,Intelworks/libtaxii,TAXIIProject/libtaxii | Test to parse & serialize test documents to XML and text. |
import unittest
import os
import glob
import libtaxii.messages_11 as tm11
import libtaxii.taxii_default_query as tdq
# from libtaxii.validation import SchemaValidator
class To_text_11_test(unittest.TestCase):
input_path = os.path.join('input','1.1')
output_path = os.path.join('output','1.1')
def test_to... | <commit_before><commit_msg>Test to parse & serialize test documents to XML and text.<commit_after> |
import unittest
import os
import glob
import libtaxii.messages_11 as tm11
import libtaxii.taxii_default_query as tdq
# from libtaxii.validation import SchemaValidator
class To_text_11_test(unittest.TestCase):
input_path = os.path.join('input','1.1')
output_path = os.path.join('output','1.1')
def test_to... | Test to parse & serialize test documents to XML and text.
import unittest
import os
import glob
import libtaxii.messages_11 as tm11
import libtaxii.taxii_default_query as tdq
# from libtaxii.validation import SchemaValidator
class To_text_11_test(unittest.TestCase):
input_path = os.path.join('input','1.1')
ou... | <commit_before><commit_msg>Test to parse & serialize test documents to XML and text.<commit_after>
import unittest
import os
import glob
import libtaxii.messages_11 as tm11
import libtaxii.taxii_default_query as tdq
# from libtaxii.validation import SchemaValidator
class To_text_11_test(unittest.TestCase):
input_... | |
ff8e52beb234fdd7050206b33bb4728512688b65 | python/itertools/combinations.py | python/itertools/combinations.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (c) 2012 Jérémie DECOCK (http://www.jdhp.org)
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including witho... | Add a snippet (Python itertools). | Add a snippet (Python itertools).
| Python | mit | jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets | Add a snippet (Python itertools). | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (c) 2012 Jérémie DECOCK (http://www.jdhp.org)
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including witho... | <commit_before><commit_msg>Add a snippet (Python itertools).<commit_after> | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (c) 2012 Jérémie DECOCK (http://www.jdhp.org)
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including witho... | Add a snippet (Python itertools).#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (c) 2012 Jérémie DECOCK (http://www.jdhp.org)
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software wit... | <commit_before><commit_msg>Add a snippet (Python itertools).<commit_after>#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (c) 2012 Jérémie DECOCK (http://www.jdhp.org)
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "... | |
f6dd79b19f5cf63c32db1d07bc1712185a6cbb6d | tests/api/test_lifecycle.py | tests/api/test_lifecycle.py | class TestShutdown:
async def test(self, mocker, monkeypatch, do_get):
"""
Test that a ``GET /api/lifecycle/shutdown`` results in :meth:`aiohttp.web.Application.shutdown` being called on
the Virtool application object. We check this be seeing if
"""
await do_get.init_clien... | Test the lifecycle shutdown API endpoint | Test the lifecycle shutdown API endpoint
| Python | mit | virtool/virtool,igboyes/virtool,igboyes/virtool,virtool/virtool | Test the lifecycle shutdown API endpoint | class TestShutdown:
async def test(self, mocker, monkeypatch, do_get):
"""
Test that a ``GET /api/lifecycle/shutdown`` results in :meth:`aiohttp.web.Application.shutdown` being called on
the Virtool application object. We check this be seeing if
"""
await do_get.init_clien... | <commit_before><commit_msg>Test the lifecycle shutdown API endpoint<commit_after> | class TestShutdown:
async def test(self, mocker, monkeypatch, do_get):
"""
Test that a ``GET /api/lifecycle/shutdown`` results in :meth:`aiohttp.web.Application.shutdown` being called on
the Virtool application object. We check this be seeing if
"""
await do_get.init_clien... | Test the lifecycle shutdown API endpointclass TestShutdown:
async def test(self, mocker, monkeypatch, do_get):
"""
Test that a ``GET /api/lifecycle/shutdown`` results in :meth:`aiohttp.web.Application.shutdown` being called on
the Virtool application object. We check this be seeing if
... | <commit_before><commit_msg>Test the lifecycle shutdown API endpoint<commit_after>class TestShutdown:
async def test(self, mocker, monkeypatch, do_get):
"""
Test that a ``GET /api/lifecycle/shutdown`` results in :meth:`aiohttp.web.Application.shutdown` being called on
the Virtool application... | |
25210e9fd08b24f3eb9a6f661ac3c060fcb6e43e | tests/test_build_failure.py | tests/test_build_failure.py | """Tests for handling failed builds"""
from dxr.testing import SingleFileTestCase, CommandFailure
class BuildFailureTests(SingleFileTestCase):
source = r"""A bunch of garbage"""
@classmethod
def setup_class(cls):
"""Make sure a failed build returns a non-zero status code."""
try:
... | Add a test that proves build_instance raises an exception if `make` (etc.) fails. | Add a test that proves build_instance raises an exception if `make` (etc.) fails.
From here, it's trivial to observe that dxr-build.py itself exits with a non-zero status code on build failure. Thus, our spurious deployment of a new instance even after the moz-central build failed must be the fault of a calling shell ... | Python | mit | pelmers/dxr,kleintom/dxr,jbradberry/dxr,gartung/dxr,jay-z007/dxr,pombredanne/dxr,KiemVM/Mozilla--dxr,pelmers/dxr,pombredanne/dxr,KiemVM/Mozilla--dxr,KiemVM/Mozilla--dxr,bozzmob/dxr,srenatus/dxr,srenatus/dxr,jbradberry/dxr,erikrose/dxr,pombredanne/dxr,gartung/dxr,nrc/dxr,nrc/dxr,kleintom/dxr,nrc/dxr,jay-z007/dxr,nrc/dxr... | Add a test that proves build_instance raises an exception if `make` (etc.) fails.
From here, it's trivial to observe that dxr-build.py itself exits with a non-zero status code on build failure. Thus, our spurious deployment of a new instance even after the moz-central build failed must be the fault of a calling shell ... | """Tests for handling failed builds"""
from dxr.testing import SingleFileTestCase, CommandFailure
class BuildFailureTests(SingleFileTestCase):
source = r"""A bunch of garbage"""
@classmethod
def setup_class(cls):
"""Make sure a failed build returns a non-zero status code."""
try:
... | <commit_before><commit_msg>Add a test that proves build_instance raises an exception if `make` (etc.) fails.
From here, it's trivial to observe that dxr-build.py itself exits with a non-zero status code on build failure. Thus, our spurious deployment of a new instance even after the moz-central build failed must be th... | """Tests for handling failed builds"""
from dxr.testing import SingleFileTestCase, CommandFailure
class BuildFailureTests(SingleFileTestCase):
source = r"""A bunch of garbage"""
@classmethod
def setup_class(cls):
"""Make sure a failed build returns a non-zero status code."""
try:
... | Add a test that proves build_instance raises an exception if `make` (etc.) fails.
From here, it's trivial to observe that dxr-build.py itself exits with a non-zero status code on build failure. Thus, our spurious deployment of a new instance even after the moz-central build failed must be the fault of a calling shell ... | <commit_before><commit_msg>Add a test that proves build_instance raises an exception if `make` (etc.) fails.
From here, it's trivial to observe that dxr-build.py itself exits with a non-zero status code on build failure. Thus, our spurious deployment of a new instance even after the moz-central build failed must be th... | |
6a56d00b409798fbeccf84e940847b6e2705bfdf | app/soc/modules/gci/logic/profile.py | app/soc/modules/gci/logic/profile.py | #!/usr/bin/env python2.5
#
# Copyright 2011 the Melange authors.
#
# 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 applic... | Implement a method that fetches all the mentors for a given organization. | Implement a method that fetches all the mentors for a given organization.
| Python | apache-2.0 | rhyolight/nupic.son,rhyolight/nupic.son,rhyolight/nupic.son | Implement a method that fetches all the mentors for a given organization. | #!/usr/bin/env python2.5
#
# Copyright 2011 the Melange authors.
#
# 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 applic... | <commit_before><commit_msg>Implement a method that fetches all the mentors for a given organization.<commit_after> | #!/usr/bin/env python2.5
#
# Copyright 2011 the Melange authors.
#
# 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 applic... | Implement a method that fetches all the mentors for a given organization.#!/usr/bin/env python2.5
#
# Copyright 2011 the Melange authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# ... | <commit_before><commit_msg>Implement a method that fetches all the mentors for a given organization.<commit_after>#!/usr/bin/env python2.5
#
# Copyright 2011 the Melange authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You ... | |
489dd26fd22c3e7820cf74d1582adfcff050a8bb | test/test_packages.py | test/test_packages.py | import pytest
@pytest.mark.parametrize("name", [
("bash-completion"),
("bind-utils"),
("bridge-utils"),
("docker"),
("epel-release"),
("git"),
("iptables-services"),
("libnfsidmap"),
("net-tools"),
("nfs-utils"),
("pyOpenSSL"),
("screen"),
("strace"),
("tcpdump"),
("wget"),
])
def test_p... | Add test for installed packages | Add test for installed packages
| Python | mit | wicksy/vagrant-openshift,wicksy/vagrant-openshift,wicksy/vagrant-openshift | Add test for installed packages | import pytest
@pytest.mark.parametrize("name", [
("bash-completion"),
("bind-utils"),
("bridge-utils"),
("docker"),
("epel-release"),
("git"),
("iptables-services"),
("libnfsidmap"),
("net-tools"),
("nfs-utils"),
("pyOpenSSL"),
("screen"),
("strace"),
("tcpdump"),
("wget"),
])
def test_p... | <commit_before><commit_msg>Add test for installed packages<commit_after> | import pytest
@pytest.mark.parametrize("name", [
("bash-completion"),
("bind-utils"),
("bridge-utils"),
("docker"),
("epel-release"),
("git"),
("iptables-services"),
("libnfsidmap"),
("net-tools"),
("nfs-utils"),
("pyOpenSSL"),
("screen"),
("strace"),
("tcpdump"),
("wget"),
])
def test_p... | Add test for installed packagesimport pytest
@pytest.mark.parametrize("name", [
("bash-completion"),
("bind-utils"),
("bridge-utils"),
("docker"),
("epel-release"),
("git"),
("iptables-services"),
("libnfsidmap"),
("net-tools"),
("nfs-utils"),
("pyOpenSSL"),
("screen"),
("strace"),
("tcpdum... | <commit_before><commit_msg>Add test for installed packages<commit_after>import pytest
@pytest.mark.parametrize("name", [
("bash-completion"),
("bind-utils"),
("bridge-utils"),
("docker"),
("epel-release"),
("git"),
("iptables-services"),
("libnfsidmap"),
("net-tools"),
("nfs-utils"),
("pyOpenSSL"... | |
cce6e292631d795a1d73fba8252f06b654d2f8fe | tests/test_timer.py | tests/test_timer.py | # -*- coding: utf-8 -*-
"""
tests.test_timer
~~~~~~~~~~~~~~~~~~~~~
"""
import time
import re
from yaspin import yaspin
def test_no_timer():
sp = yaspin(timer=False)
sp._freeze("")
assert re.search(r"\(\d+:\d{2}:\d{2}\)", sp._last_frame) is None
def test_timer_idle():
sp = yaspin(timer=True)
... | Add tests for timer functionality | Add tests for timer functionality
| Python | mit | pavdmyt/yaspin | Add tests for timer functionality | # -*- coding: utf-8 -*-
"""
tests.test_timer
~~~~~~~~~~~~~~~~~~~~~
"""
import time
import re
from yaspin import yaspin
def test_no_timer():
sp = yaspin(timer=False)
sp._freeze("")
assert re.search(r"\(\d+:\d{2}:\d{2}\)", sp._last_frame) is None
def test_timer_idle():
sp = yaspin(timer=True)
... | <commit_before><commit_msg>Add tests for timer functionality<commit_after> | # -*- coding: utf-8 -*-
"""
tests.test_timer
~~~~~~~~~~~~~~~~~~~~~
"""
import time
import re
from yaspin import yaspin
def test_no_timer():
sp = yaspin(timer=False)
sp._freeze("")
assert re.search(r"\(\d+:\d{2}:\d{2}\)", sp._last_frame) is None
def test_timer_idle():
sp = yaspin(timer=True)
... | Add tests for timer functionality# -*- coding: utf-8 -*-
"""
tests.test_timer
~~~~~~~~~~~~~~~~~~~~~
"""
import time
import re
from yaspin import yaspin
def test_no_timer():
sp = yaspin(timer=False)
sp._freeze("")
assert re.search(r"\(\d+:\d{2}:\d{2}\)", sp._last_frame) is None
def test_timer_idle()... | <commit_before><commit_msg>Add tests for timer functionality<commit_after># -*- coding: utf-8 -*-
"""
tests.test_timer
~~~~~~~~~~~~~~~~~~~~~
"""
import time
import re
from yaspin import yaspin
def test_no_timer():
sp = yaspin(timer=False)
sp._freeze("")
assert re.search(r"\(\d+:\d{2}:\d{2}\)", sp._la... | |
a1fd670f25141b176d276514adbce6e110b49e38 | comics/crawlers/slagoon.py | comics/crawlers/slagoon.py | from comics.crawler.base import BaseComicCrawler
from comics.crawler.meta import BaseComicMeta
class ComicMeta(BaseComicMeta):
name = "Sherman's Lagoon"
language = 'en'
url = 'http://www.slagoon.com/'
start_date = '1991-05-13'
history_capable_days = 32
schedule = 'Mo,Tu,We,Th,Fr,Sa,Su'
time... | Add crawler for 'Sherman's Lagoon' | Add crawler for 'Sherman's Lagoon'
| Python | agpl-3.0 | jodal/comics,jodal/comics,klette/comics,datagutten/comics,datagutten/comics,jodal/comics,datagutten/comics,klette/comics,klette/comics,datagutten/comics,jodal/comics | Add crawler for 'Sherman's Lagoon' | from comics.crawler.base import BaseComicCrawler
from comics.crawler.meta import BaseComicMeta
class ComicMeta(BaseComicMeta):
name = "Sherman's Lagoon"
language = 'en'
url = 'http://www.slagoon.com/'
start_date = '1991-05-13'
history_capable_days = 32
schedule = 'Mo,Tu,We,Th,Fr,Sa,Su'
time... | <commit_before><commit_msg>Add crawler for 'Sherman's Lagoon'<commit_after> | from comics.crawler.base import BaseComicCrawler
from comics.crawler.meta import BaseComicMeta
class ComicMeta(BaseComicMeta):
name = "Sherman's Lagoon"
language = 'en'
url = 'http://www.slagoon.com/'
start_date = '1991-05-13'
history_capable_days = 32
schedule = 'Mo,Tu,We,Th,Fr,Sa,Su'
time... | Add crawler for 'Sherman's Lagoon'from comics.crawler.base import BaseComicCrawler
from comics.crawler.meta import BaseComicMeta
class ComicMeta(BaseComicMeta):
name = "Sherman's Lagoon"
language = 'en'
url = 'http://www.slagoon.com/'
start_date = '1991-05-13'
history_capable_days = 32
schedule... | <commit_before><commit_msg>Add crawler for 'Sherman's Lagoon'<commit_after>from comics.crawler.base import BaseComicCrawler
from comics.crawler.meta import BaseComicMeta
class ComicMeta(BaseComicMeta):
name = "Sherman's Lagoon"
language = 'en'
url = 'http://www.slagoon.com/'
start_date = '1991-05-13'
... | |
ceea7edd9162e9a834be8888fea18dcd0da43561 | test/test_rendering_dot_files.py | test/test_rendering_dot_files.py | from __future__ import division
from __future__ import print_function
import glob
import os
import subprocess
import sys
from hashlib import sha256
import pydot_ng as pydot
PY3 = not sys.version_info < (3, 0, 0)
if PY3:
NULL_SEP = b''
xrange = range
else:
NULL_SEP = ''
bytes = str
DOT_BINARY_PATH =... | Add testing regressions of pydot vs graphviz | Add testing regressions of pydot vs graphviz
| Python | mit | pydot/pydot-ng | Add testing regressions of pydot vs graphviz | from __future__ import division
from __future__ import print_function
import glob
import os
import subprocess
import sys
from hashlib import sha256
import pydot_ng as pydot
PY3 = not sys.version_info < (3, 0, 0)
if PY3:
NULL_SEP = b''
xrange = range
else:
NULL_SEP = ''
bytes = str
DOT_BINARY_PATH =... | <commit_before><commit_msg>Add testing regressions of pydot vs graphviz<commit_after> | from __future__ import division
from __future__ import print_function
import glob
import os
import subprocess
import sys
from hashlib import sha256
import pydot_ng as pydot
PY3 = not sys.version_info < (3, 0, 0)
if PY3:
NULL_SEP = b''
xrange = range
else:
NULL_SEP = ''
bytes = str
DOT_BINARY_PATH =... | Add testing regressions of pydot vs graphvizfrom __future__ import division
from __future__ import print_function
import glob
import os
import subprocess
import sys
from hashlib import sha256
import pydot_ng as pydot
PY3 = not sys.version_info < (3, 0, 0)
if PY3:
NULL_SEP = b''
xrange = range
else:
NULL... | <commit_before><commit_msg>Add testing regressions of pydot vs graphviz<commit_after>from __future__ import division
from __future__ import print_function
import glob
import os
import subprocess
import sys
from hashlib import sha256
import pydot_ng as pydot
PY3 = not sys.version_info < (3, 0, 0)
if PY3:
NULL_SE... | |
bc21a64589535a3ed5689ff04f826893d45f4c45 | pygraphc/abstraction/mymethod.py | pygraphc/abstraction/mymethod.py |
class MyMethod(object):
def __init__(self, graph, clusters):
self.graph = graph
self.clusters = clusters
self.count_partitions = {}
def __get_count(self):
abstraction = []
for cluster_id, nodes in self.clusters.iteritems():
if len(nodes) > 1:
... | Add new method for abstraction | Add new method for abstraction
| Python | mit | studiawan/pygraphc | Add new method for abstraction |
class MyMethod(object):
def __init__(self, graph, clusters):
self.graph = graph
self.clusters = clusters
self.count_partitions = {}
def __get_count(self):
abstraction = []
for cluster_id, nodes in self.clusters.iteritems():
if len(nodes) > 1:
... | <commit_before><commit_msg>Add new method for abstraction<commit_after> |
class MyMethod(object):
def __init__(self, graph, clusters):
self.graph = graph
self.clusters = clusters
self.count_partitions = {}
def __get_count(self):
abstraction = []
for cluster_id, nodes in self.clusters.iteritems():
if len(nodes) > 1:
... | Add new method for abstraction
class MyMethod(object):
def __init__(self, graph, clusters):
self.graph = graph
self.clusters = clusters
self.count_partitions = {}
def __get_count(self):
abstraction = []
for cluster_id, nodes in self.clusters.iteritems():
if l... | <commit_before><commit_msg>Add new method for abstraction<commit_after>
class MyMethod(object):
def __init__(self, graph, clusters):
self.graph = graph
self.clusters = clusters
self.count_partitions = {}
def __get_count(self):
abstraction = []
for cluster_id, nodes in se... | |
21004e02d9aa43bdfe1d3412a9b92f16e9ecc0f1 | salt/states/influxdb_database.py | salt/states/influxdb_database.py | # -*- coding: utf-8 -*-
'''
Management of Influxdb databases
================================
(compatible with InfluxDB version 0.9+)
'''
def __virtual__():
'''
Only load if the influxdb module is available
'''
if 'influxdb.db_exists' in __salt__:
return 'influxdb_database'
return False
... | Add state module to manage InfluxDB databases | Add state module to manage InfluxDB databases
| Python | apache-2.0 | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | Add state module to manage InfluxDB databases | # -*- coding: utf-8 -*-
'''
Management of Influxdb databases
================================
(compatible with InfluxDB version 0.9+)
'''
def __virtual__():
'''
Only load if the influxdb module is available
'''
if 'influxdb.db_exists' in __salt__:
return 'influxdb_database'
return False
... | <commit_before><commit_msg>Add state module to manage InfluxDB databases<commit_after> | # -*- coding: utf-8 -*-
'''
Management of Influxdb databases
================================
(compatible with InfluxDB version 0.9+)
'''
def __virtual__():
'''
Only load if the influxdb module is available
'''
if 'influxdb.db_exists' in __salt__:
return 'influxdb_database'
return False
... | Add state module to manage InfluxDB databases# -*- coding: utf-8 -*-
'''
Management of Influxdb databases
================================
(compatible with InfluxDB version 0.9+)
'''
def __virtual__():
'''
Only load if the influxdb module is available
'''
if 'influxdb.db_exists' in __salt__:
... | <commit_before><commit_msg>Add state module to manage InfluxDB databases<commit_after># -*- coding: utf-8 -*-
'''
Management of Influxdb databases
================================
(compatible with InfluxDB version 0.9+)
'''
def __virtual__():
'''
Only load if the influxdb module is available
'''
if '... | |
0f38f94a283914d6aca289f8020e1c6a0551c4ee | plugins/ping_pong.py | plugins/ping_pong.py | """
# Config (valid YAML document) must be at __doc__.
name: ping_pong # Name of plugin, lowercase, match with
# file or package name.
description: "Example plugin for testing bot."
config: # Config variable that needed to set
- SHELDON_PING_PONG_REPLY: '>>>' # in environmen... | Add plugin for bot testing | Add plugin for bot testing
| Python | mit | lises/sheldon | Add plugin for bot testing | """
# Config (valid YAML document) must be at __doc__.
name: ping_pong # Name of plugin, lowercase, match with
# file or package name.
description: "Example plugin for testing bot."
config: # Config variable that needed to set
- SHELDON_PING_PONG_REPLY: '>>>' # in environmen... | <commit_before><commit_msg>Add plugin for bot testing<commit_after> | """
# Config (valid YAML document) must be at __doc__.
name: ping_pong # Name of plugin, lowercase, match with
# file or package name.
description: "Example plugin for testing bot."
config: # Config variable that needed to set
- SHELDON_PING_PONG_REPLY: '>>>' # in environmen... | Add plugin for bot testing"""
# Config (valid YAML document) must be at __doc__.
name: ping_pong # Name of plugin, lowercase, match with
# file or package name.
description: "Example plugin for testing bot."
config: # Config variable that needed to set
- SHELDON_PING_PONG_RE... | <commit_before><commit_msg>Add plugin for bot testing<commit_after>"""
# Config (valid YAML document) must be at __doc__.
name: ping_pong # Name of plugin, lowercase, match with
# file or package name.
description: "Example plugin for testing bot."
config: # Config variable th... | |
7ad8c853854395e34afe99a3b670596a27734e66 | suq1/rankeditems.py | suq1/rankeditems.py | # -*- coding: utf-8 -*-
# Suq1 -- An ad hoc Python toolbox for a web service
# By: Emmanuel Raviart <[email protected]>
#
# Copyright (C) 2009, 2010, 2011, 2012 Easter-eggs & Emmanuel Raviart
# Copyright (C) 2013, 2014 Easter-eggs, Etalab & Emmanuel Raviart
# https://github.com/eraviart/suq1
#
# This file is part ... | Add module to handle ranked items (for Condorcet-Schulze voting method). | Add module to handle ranked items (for Condorcet-Schulze voting method).
| Python | agpl-3.0 | plastic-data/suq1 | Add module to handle ranked items (for Condorcet-Schulze voting method). | # -*- coding: utf-8 -*-
# Suq1 -- An ad hoc Python toolbox for a web service
# By: Emmanuel Raviart <[email protected]>
#
# Copyright (C) 2009, 2010, 2011, 2012 Easter-eggs & Emmanuel Raviart
# Copyright (C) 2013, 2014 Easter-eggs, Etalab & Emmanuel Raviart
# https://github.com/eraviart/suq1
#
# This file is part ... | <commit_before><commit_msg>Add module to handle ranked items (for Condorcet-Schulze voting method).<commit_after> | # -*- coding: utf-8 -*-
# Suq1 -- An ad hoc Python toolbox for a web service
# By: Emmanuel Raviart <[email protected]>
#
# Copyright (C) 2009, 2010, 2011, 2012 Easter-eggs & Emmanuel Raviart
# Copyright (C) 2013, 2014 Easter-eggs, Etalab & Emmanuel Raviart
# https://github.com/eraviart/suq1
#
# This file is part ... | Add module to handle ranked items (for Condorcet-Schulze voting method).# -*- coding: utf-8 -*-
# Suq1 -- An ad hoc Python toolbox for a web service
# By: Emmanuel Raviart <[email protected]>
#
# Copyright (C) 2009, 2010, 2011, 2012 Easter-eggs & Emmanuel Raviart
# Copyright (C) 2013, 2014 Easter-eggs, Etalab & Em... | <commit_before><commit_msg>Add module to handle ranked items (for Condorcet-Schulze voting method).<commit_after># -*- coding: utf-8 -*-
# Suq1 -- An ad hoc Python toolbox for a web service
# By: Emmanuel Raviart <[email protected]>
#
# Copyright (C) 2009, 2010, 2011, 2012 Easter-eggs & Emmanuel Raviart
# Copyrigh... | |
951711b6c3e792de56b23423627a5f6faefe3353 | python/FresStream.py | python/FresStream.py | import threading
import time
from functools import partial
from queue import Empty
import msgpack
import zmq
import infupy.backends.fresenius as fresenius
zmqhost = '127.0.0.1'
zmqport = 4201
freseniusport = 'COM5'
def stateWorker(stopevent):
context = zmq.Context()
zmqsocket = context.socket(zmq.PUB)
c... | Add python script that uses the infupy library and streams to zmq | Add python script that uses the infupy library and streams to zmq
| Python | isc | jaj42/hsmedstream,jaj42/phystream | Add python script that uses the infupy library and streams to zmq | import threading
import time
from functools import partial
from queue import Empty
import msgpack
import zmq
import infupy.backends.fresenius as fresenius
zmqhost = '127.0.0.1'
zmqport = 4201
freseniusport = 'COM5'
def stateWorker(stopevent):
context = zmq.Context()
zmqsocket = context.socket(zmq.PUB)
c... | <commit_before><commit_msg>Add python script that uses the infupy library and streams to zmq<commit_after> | import threading
import time
from functools import partial
from queue import Empty
import msgpack
import zmq
import infupy.backends.fresenius as fresenius
zmqhost = '127.0.0.1'
zmqport = 4201
freseniusport = 'COM5'
def stateWorker(stopevent):
context = zmq.Context()
zmqsocket = context.socket(zmq.PUB)
c... | Add python script that uses the infupy library and streams to zmqimport threading
import time
from functools import partial
from queue import Empty
import msgpack
import zmq
import infupy.backends.fresenius as fresenius
zmqhost = '127.0.0.1'
zmqport = 4201
freseniusport = 'COM5'
def stateWorker(stopevent):
cont... | <commit_before><commit_msg>Add python script that uses the infupy library and streams to zmq<commit_after>import threading
import time
from functools import partial
from queue import Empty
import msgpack
import zmq
import infupy.backends.fresenius as fresenius
zmqhost = '127.0.0.1'
zmqport = 4201
freseniusport = 'CO... | |
a044a49b019f369aa5738e13004060a2e7d2a01c | evdemo/server/conf/connection_settings.py | evdemo/server/conf/connection_settings.py | # This file is auto-generated by the `evennia connections` wizard.
# Don't edit manually, your changes will be overwritten.
GAME_INDEX_ENABLED = True
GAME_INDEX_LISTING = \
{ 'game_status': 'launched',
'game_website': 'https://demo.evennia.com',
'listing_contact': '[email protected]',
'long_description': 'The Even... | Add demo connection setting to git | Add demo connection setting to git
| Python | bsd-3-clause | evennia/evdemo | Add demo connection setting to git | # This file is auto-generated by the `evennia connections` wizard.
# Don't edit manually, your changes will be overwritten.
GAME_INDEX_ENABLED = True
GAME_INDEX_LISTING = \
{ 'game_status': 'launched',
'game_website': 'https://demo.evennia.com',
'listing_contact': '[email protected]',
'long_description': 'The Even... | <commit_before><commit_msg>Add demo connection setting to git<commit_after> | # This file is auto-generated by the `evennia connections` wizard.
# Don't edit manually, your changes will be overwritten.
GAME_INDEX_ENABLED = True
GAME_INDEX_LISTING = \
{ 'game_status': 'launched',
'game_website': 'https://demo.evennia.com',
'listing_contact': '[email protected]',
'long_description': 'The Even... | Add demo connection setting to git# This file is auto-generated by the `evennia connections` wizard.
# Don't edit manually, your changes will be overwritten.
GAME_INDEX_ENABLED = True
GAME_INDEX_LISTING = \
{ 'game_status': 'launched',
'game_website': 'https://demo.evennia.com',
'listing_contact': '[email protected]',... | <commit_before><commit_msg>Add demo connection setting to git<commit_after># This file is auto-generated by the `evennia connections` wizard.
# Don't edit manually, your changes will be overwritten.
GAME_INDEX_ENABLED = True
GAME_INDEX_LISTING = \
{ 'game_status': 'launched',
'game_website': 'https://demo.evenni... | |
5c08f299c0022a2d94c77dbe9f91a5fb3dec5b4d | CASA_tools/casa_tools/mytools.py | CASA_tools/casa_tools/mytools.py |
'''
Define my own version of CASA tools that return python errors if they fail.
'''
from tasks import split, uvsub, concat, clean, rmtables
from .graceful_error_catch import catch_fail
def mysplit(**kwargs):
return catch_fail(split, **kwargs)
def myuvsub(**kwargs):
return catch_fail(uvsub, **kwargs)
de... | Define casa tasks that fail with python errors | Define casa tasks that fail with python errors
| Python | mit | e-koch/VLA_Lband,e-koch/VLA_Lband | Define casa tasks that fail with python errors |
'''
Define my own version of CASA tools that return python errors if they fail.
'''
from tasks import split, uvsub, concat, clean, rmtables
from .graceful_error_catch import catch_fail
def mysplit(**kwargs):
return catch_fail(split, **kwargs)
def myuvsub(**kwargs):
return catch_fail(uvsub, **kwargs)
de... | <commit_before><commit_msg>Define casa tasks that fail with python errors<commit_after> |
'''
Define my own version of CASA tools that return python errors if they fail.
'''
from tasks import split, uvsub, concat, clean, rmtables
from .graceful_error_catch import catch_fail
def mysplit(**kwargs):
return catch_fail(split, **kwargs)
def myuvsub(**kwargs):
return catch_fail(uvsub, **kwargs)
de... | Define casa tasks that fail with python errors
'''
Define my own version of CASA tools that return python errors if they fail.
'''
from tasks import split, uvsub, concat, clean, rmtables
from .graceful_error_catch import catch_fail
def mysplit(**kwargs):
return catch_fail(split, **kwargs)
def myuvsub(**kwargs... | <commit_before><commit_msg>Define casa tasks that fail with python errors<commit_after>
'''
Define my own version of CASA tools that return python errors if they fail.
'''
from tasks import split, uvsub, concat, clean, rmtables
from .graceful_error_catch import catch_fail
def mysplit(**kwargs):
return catch_fai... | |
f7a53f7dc09e44fd40367c7c973372314a476912 | ideascube/conf/kb_gin_conakry.py | ideascube/conf/kb_gin_conakry.py | # -*- coding: utf-8 -*-
"""KoomBook conf"""
from .kb import * # noqa
LANGUAGE_CODE = 'fr'
IDEASCUBE_NAME = 'CONAKRY'
HOME_CARDS = STAFF_HOME_CARDS + [
{
'id': 'koombookedu',
},
{
'id': 'bsfcampus',
},
]
| Add conf file for Conakry devices | Add conf file for Conakry devices
| Python | agpl-3.0 | ideascube/ideascube,ideascube/ideascube,ideascube/ideascube,ideascube/ideascube | Add conf file for Conakry devices | # -*- coding: utf-8 -*-
"""KoomBook conf"""
from .kb import * # noqa
LANGUAGE_CODE = 'fr'
IDEASCUBE_NAME = 'CONAKRY'
HOME_CARDS = STAFF_HOME_CARDS + [
{
'id': 'koombookedu',
},
{
'id': 'bsfcampus',
},
]
| <commit_before><commit_msg>Add conf file for Conakry devices<commit_after> | # -*- coding: utf-8 -*-
"""KoomBook conf"""
from .kb import * # noqa
LANGUAGE_CODE = 'fr'
IDEASCUBE_NAME = 'CONAKRY'
HOME_CARDS = STAFF_HOME_CARDS + [
{
'id': 'koombookedu',
},
{
'id': 'bsfcampus',
},
]
| Add conf file for Conakry devices# -*- coding: utf-8 -*-
"""KoomBook conf"""
from .kb import * # noqa
LANGUAGE_CODE = 'fr'
IDEASCUBE_NAME = 'CONAKRY'
HOME_CARDS = STAFF_HOME_CARDS + [
{
'id': 'koombookedu',
},
{
'id': 'bsfcampus',
},
]
| <commit_before><commit_msg>Add conf file for Conakry devices<commit_after># -*- coding: utf-8 -*-
"""KoomBook conf"""
from .kb import * # noqa
LANGUAGE_CODE = 'fr'
IDEASCUBE_NAME = 'CONAKRY'
HOME_CARDS = STAFF_HOME_CARDS + [
{
'id': 'koombookedu',
},
{
'id': 'bsfcampus',
},
]
| |
bed17c14920fdc2c4e1d9413da4188a64fc4352e | test_atmospheres.py | test_atmospheres.py | # coding: utf-8
""" Test the model atmosphere interpolator """
__author__ = "Andy Casey <[email protected]>"
import os
import logging
import numpy as np
import matplotlib.pyplot as plt
from atmosphere import AtmosphereInterpolator as atmospheres, \
parsers
atmosphere_type = "MARCS (20... | Test MARCS model atmosphere interpolator | Test MARCS model atmosphere interpolator
| Python | mit | andycasey/precise-objective-differential-spectroscopy | Test MARCS model atmosphere interpolator | # coding: utf-8
""" Test the model atmosphere interpolator """
__author__ = "Andy Casey <[email protected]>"
import os
import logging
import numpy as np
import matplotlib.pyplot as plt
from atmosphere import AtmosphereInterpolator as atmospheres, \
parsers
atmosphere_type = "MARCS (20... | <commit_before><commit_msg>Test MARCS model atmosphere interpolator<commit_after> | # coding: utf-8
""" Test the model atmosphere interpolator """
__author__ = "Andy Casey <[email protected]>"
import os
import logging
import numpy as np
import matplotlib.pyplot as plt
from atmosphere import AtmosphereInterpolator as atmospheres, \
parsers
atmosphere_type = "MARCS (20... | Test MARCS model atmosphere interpolator# coding: utf-8
""" Test the model atmosphere interpolator """
__author__ = "Andy Casey <[email protected]>"
import os
import logging
import numpy as np
import matplotlib.pyplot as plt
from atmosphere import AtmosphereInterpolator as atmospheres, \
... | <commit_before><commit_msg>Test MARCS model atmosphere interpolator<commit_after># coding: utf-8
""" Test the model atmosphere interpolator """
__author__ = "Andy Casey <[email protected]>"
import os
import logging
import numpy as np
import matplotlib.pyplot as plt
from atmosphere import AtmosphereInterpolator ... | |
9267d2c83087bb8a570109b60d3517abb8fc66cf | tests/test_reset.py | tests/test_reset.py | #!/usr/bin/python
import sys
import pycurl
saw_error = 1
def main():
global saw_error
pycurl.global_init(pycurl.GLOBAL_DEFAULT)
outf = file("/dev/null", "rb+")
cm = pycurl.CurlMulti()
# Set multi handle's options
cm.setopt(pycurl.M_PIPELINING, 1)
eh = pycur... | Test for reset fixes refcount bug | Test for reset fixes refcount bug
| Python | lgpl-2.1 | pycurl/pycurl,p/pycurl-archived,pycurl/pycurl,pycurl/pycurl,p/pycurl-archived,p/pycurl-archived | Test for reset fixes refcount bug | #!/usr/bin/python
import sys
import pycurl
saw_error = 1
def main():
global saw_error
pycurl.global_init(pycurl.GLOBAL_DEFAULT)
outf = file("/dev/null", "rb+")
cm = pycurl.CurlMulti()
# Set multi handle's options
cm.setopt(pycurl.M_PIPELINING, 1)
eh = pycur... | <commit_before><commit_msg>Test for reset fixes refcount bug<commit_after> | #!/usr/bin/python
import sys
import pycurl
saw_error = 1
def main():
global saw_error
pycurl.global_init(pycurl.GLOBAL_DEFAULT)
outf = file("/dev/null", "rb+")
cm = pycurl.CurlMulti()
# Set multi handle's options
cm.setopt(pycurl.M_PIPELINING, 1)
eh = pycur... | Test for reset fixes refcount bug#!/usr/bin/python
import sys
import pycurl
saw_error = 1
def main():
global saw_error
pycurl.global_init(pycurl.GLOBAL_DEFAULT)
outf = file("/dev/null", "rb+")
cm = pycurl.CurlMulti()
# Set multi handle's options
cm.setopt(pycurl.M_P... | <commit_before><commit_msg>Test for reset fixes refcount bug<commit_after>#!/usr/bin/python
import sys
import pycurl
saw_error = 1
def main():
global saw_error
pycurl.global_init(pycurl.GLOBAL_DEFAULT)
outf = file("/dev/null", "rb+")
cm = pycurl.CurlMulti()
# Set multi hand... | |
f9ff15636a62a8ca0f7872874721d42019af7e9c | tests/unit_tests.py | tests/unit_tests.py | __author__ = 'Michael'
from src import PClass
# Test for bias addition and correctness of range in init function
testClass = PClass(3)
assert testClass.weightList.size() == 4
for x in range(0, testClass.numInputs):
assert -1 <= testClass.weightList[x] & testClass.weightList[x] <= 1
| Create initial tests for code maintenance | Create initial tests for code maintenance
| Python | mit | michaellee1/ANN-PCML | Create initial tests for code maintenance | __author__ = 'Michael'
from src import PClass
# Test for bias addition and correctness of range in init function
testClass = PClass(3)
assert testClass.weightList.size() == 4
for x in range(0, testClass.numInputs):
assert -1 <= testClass.weightList[x] & testClass.weightList[x] <= 1
| <commit_before><commit_msg>Create initial tests for code maintenance<commit_after> | __author__ = 'Michael'
from src import PClass
# Test for bias addition and correctness of range in init function
testClass = PClass(3)
assert testClass.weightList.size() == 4
for x in range(0, testClass.numInputs):
assert -1 <= testClass.weightList[x] & testClass.weightList[x] <= 1
| Create initial tests for code maintenance__author__ = 'Michael'
from src import PClass
# Test for bias addition and correctness of range in init function
testClass = PClass(3)
assert testClass.weightList.size() == 4
for x in range(0, testClass.numInputs):
assert -1 <= testClass.weightList[x] & testClass.weightLis... | <commit_before><commit_msg>Create initial tests for code maintenance<commit_after>__author__ = 'Michael'
from src import PClass
# Test for bias addition and correctness of range in init function
testClass = PClass(3)
assert testClass.weightList.size() == 4
for x in range(0, testClass.numInputs):
assert -1 <= test... | |
06a12ada48c11a101eb138220cd0e0ca33a612be | tests/thread/stress_create.py | tests/thread/stress_create.py | # stress test for creating many threads
try:
import utime as time
except ImportError:
import time
import _thread
def thread_entry(n):
pass
thread_num = 0
while thread_num < 500:
try:
_thread.start_new_thread(thread_entry, (thread_num,))
thread_num += 1
except MemoryError:
... | Add stress-test for creating many threads. | tests/thread: Add stress-test for creating many threads.
| Python | mit | TDAbboud/micropython,Timmenem/micropython,deshipu/micropython,SHA2017-badge/micropython-esp32,alex-robbins/micropython,tobbad/micropython,lowRISC/micropython,oopy/micropython,deshipu/micropython,bvernoux/micropython,puuu/micropython,infinnovation/micropython,trezor/micropython,adafruit/micropython,oopy/micropython,trez... | tests/thread: Add stress-test for creating many threads. | # stress test for creating many threads
try:
import utime as time
except ImportError:
import time
import _thread
def thread_entry(n):
pass
thread_num = 0
while thread_num < 500:
try:
_thread.start_new_thread(thread_entry, (thread_num,))
thread_num += 1
except MemoryError:
... | <commit_before><commit_msg>tests/thread: Add stress-test for creating many threads.<commit_after> | # stress test for creating many threads
try:
import utime as time
except ImportError:
import time
import _thread
def thread_entry(n):
pass
thread_num = 0
while thread_num < 500:
try:
_thread.start_new_thread(thread_entry, (thread_num,))
thread_num += 1
except MemoryError:
... | tests/thread: Add stress-test for creating many threads.# stress test for creating many threads
try:
import utime as time
except ImportError:
import time
import _thread
def thread_entry(n):
pass
thread_num = 0
while thread_num < 500:
try:
_thread.start_new_thread(thread_entry, (thread_num,))
... | <commit_before><commit_msg>tests/thread: Add stress-test for creating many threads.<commit_after># stress test for creating many threads
try:
import utime as time
except ImportError:
import time
import _thread
def thread_entry(n):
pass
thread_num = 0
while thread_num < 500:
try:
_thread.start... | |
f2b261ea7af982653dfb3057b98e3b917c72b7a4 | test/test_simple_module_pass.py | test/test_simple_module_pass.py | import sys, unittest
from tools import SamplesTestCase
OUTPUT_FOR_GLOBALS = '''\
Found global named "gfloat": type = float*
Found global named "gppfloat": type = float***
Found global named "gint": type = i32*
'''
PROG = 'simple_module_pass'
class TestSimpleModulePass(SamplesTestCase):
def test_on_globals(self)... | Add a test for simple_module_pass | Add a test for simple_module_pass
| Python | unlicense | eliben/llvm-clang-samples,eliben/llvm-clang-samples,eliben/llvm-clang-samples,eliben/llvm-clang-samples,eliben/llvm-clang-samples,eliben/llvm-clang-samples | Add a test for simple_module_pass | import sys, unittest
from tools import SamplesTestCase
OUTPUT_FOR_GLOBALS = '''\
Found global named "gfloat": type = float*
Found global named "gppfloat": type = float***
Found global named "gint": type = i32*
'''
PROG = 'simple_module_pass'
class TestSimpleModulePass(SamplesTestCase):
def test_on_globals(self)... | <commit_before><commit_msg>Add a test for simple_module_pass<commit_after> | import sys, unittest
from tools import SamplesTestCase
OUTPUT_FOR_GLOBALS = '''\
Found global named "gfloat": type = float*
Found global named "gppfloat": type = float***
Found global named "gint": type = i32*
'''
PROG = 'simple_module_pass'
class TestSimpleModulePass(SamplesTestCase):
def test_on_globals(self)... | Add a test for simple_module_passimport sys, unittest
from tools import SamplesTestCase
OUTPUT_FOR_GLOBALS = '''\
Found global named "gfloat": type = float*
Found global named "gppfloat": type = float***
Found global named "gint": type = i32*
'''
PROG = 'simple_module_pass'
class TestSimpleModulePass(SamplesTestCas... | <commit_before><commit_msg>Add a test for simple_module_pass<commit_after>import sys, unittest
from tools import SamplesTestCase
OUTPUT_FOR_GLOBALS = '''\
Found global named "gfloat": type = float*
Found global named "gppfloat": type = float***
Found global named "gint": type = i32*
'''
PROG = 'simple_module_pass'
... | |
39646d3a7f3f8539dcb88ae9f79e57a3ad79a9f7 | monasca_setup/detection/plugins/octavia.py | monasca_setup/detection/plugins/octavia.py | # (C) Copyright 2016 Hewlett Packard Enterprise Development Company LP
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licens... | Add process monitoring for Octavia | Add process monitoring for Octavia
This change creates a octavia detection plugin and adds process
monitoring for octavia-api, octavia-worker, octavia-health-manager
and octavia-housekeeping processes.
Change-Id: I71411c640713ac0ab2b3bbb332dfab064b08379b
| Python | bsd-3-clause | sapcc/monasca-agent,sapcc/monasca-agent,sapcc/monasca-agent | Add process monitoring for Octavia
This change creates a octavia detection plugin and adds process
monitoring for octavia-api, octavia-worker, octavia-health-manager
and octavia-housekeeping processes.
Change-Id: I71411c640713ac0ab2b3bbb332dfab064b08379b | # (C) Copyright 2016 Hewlett Packard Enterprise Development Company LP
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licens... | <commit_before><commit_msg>Add process monitoring for Octavia
This change creates a octavia detection plugin and adds process
monitoring for octavia-api, octavia-worker, octavia-health-manager
and octavia-housekeeping processes.
Change-Id: I71411c640713ac0ab2b3bbb332dfab064b08379b<commit_after> | # (C) Copyright 2016 Hewlett Packard Enterprise Development Company LP
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licens... | Add process monitoring for Octavia
This change creates a octavia detection plugin and adds process
monitoring for octavia-api, octavia-worker, octavia-health-manager
and octavia-housekeeping processes.
Change-Id: I71411c640713ac0ab2b3bbb332dfab064b08379b# (C) Copyright 2016 Hewlett Packard Enterprise Development Comp... | <commit_before><commit_msg>Add process monitoring for Octavia
This change creates a octavia detection plugin and adds process
monitoring for octavia-api, octavia-worker, octavia-health-manager
and octavia-housekeeping processes.
Change-Id: I71411c640713ac0ab2b3bbb332dfab064b08379b<commit_after># (C) Copyright 2016 He... | |
0228ccc1a635408c3d4a27f27ac851b4d89b72b2 | takeyourmeds/reminders/reminders_calls/tests.py | takeyourmeds/reminders/reminders_calls/tests.py | from takeyourmeds.utils.test import TestCase
from ..enums import TypeEnum, SourceEnum
from .enums import StateEnum
class TwimlCallbackTest(TestCase):
def setUp(self):
super(TwimlCallbackTest, self).setUp()
self.call = self.user.reminders.create(
type=TypeEnum.call,
).instance... | Check we can create an url | Check we can create an url
| Python | mit | takeyourmeds/takeyourmeds-web,takeyourmeds/takeyourmeds-web,takeyourmeds/takeyourmeds-web,takeyourmeds/takeyourmeds-web | Check we can create an url | from takeyourmeds.utils.test import TestCase
from ..enums import TypeEnum, SourceEnum
from .enums import StateEnum
class TwimlCallbackTest(TestCase):
def setUp(self):
super(TwimlCallbackTest, self).setUp()
self.call = self.user.reminders.create(
type=TypeEnum.call,
).instance... | <commit_before><commit_msg>Check we can create an url<commit_after> | from takeyourmeds.utils.test import TestCase
from ..enums import TypeEnum, SourceEnum
from .enums import StateEnum
class TwimlCallbackTest(TestCase):
def setUp(self):
super(TwimlCallbackTest, self).setUp()
self.call = self.user.reminders.create(
type=TypeEnum.call,
).instance... | Check we can create an urlfrom takeyourmeds.utils.test import TestCase
from ..enums import TypeEnum, SourceEnum
from .enums import StateEnum
class TwimlCallbackTest(TestCase):
def setUp(self):
super(TwimlCallbackTest, self).setUp()
self.call = self.user.reminders.create(
type=TypeEnu... | <commit_before><commit_msg>Check we can create an url<commit_after>from takeyourmeds.utils.test import TestCase
from ..enums import TypeEnum, SourceEnum
from .enums import StateEnum
class TwimlCallbackTest(TestCase):
def setUp(self):
super(TwimlCallbackTest, self).setUp()
self.call = self.user.r... | |
c06f653cb6763f1d1b64797aa48e65820652f981 | tests/alerts/test_open_port_violation.py | tests/alerts/test_open_port_violation.py | from positive_alert_test_case import PositiveAlertTestCase
from negative_alert_test_case import NegativeAlertTestCase
from alert_test_suite import AlertTestSuite
class TestAlertOpenPortViolation(AlertTestSuite):
alert_filename = "open_port_violation"
# This event is the default positive event that will caus... | Add unit-tests for open port violation alert | Add unit-tests for open port violation alert
| Python | mpl-2.0 | Phrozyn/MozDef,ameihm0912/MozDef,ameihm0912/MozDef,jeffbryner/MozDef,jeffbryner/MozDef,mpurzynski/MozDef,mozilla/MozDef,mozilla/MozDef,jeffbryner/MozDef,gdestuynder/MozDef,mozilla/MozDef,mozilla/MozDef,Phrozyn/MozDef,mpurzynski/MozDef,mpurzynski/MozDef,gdestuynder/MozDef,ameihm0912/MozDef,gdestuynder/MozDef,Phrozyn/Moz... | Add unit-tests for open port violation alert | from positive_alert_test_case import PositiveAlertTestCase
from negative_alert_test_case import NegativeAlertTestCase
from alert_test_suite import AlertTestSuite
class TestAlertOpenPortViolation(AlertTestSuite):
alert_filename = "open_port_violation"
# This event is the default positive event that will caus... | <commit_before><commit_msg>Add unit-tests for open port violation alert<commit_after> | from positive_alert_test_case import PositiveAlertTestCase
from negative_alert_test_case import NegativeAlertTestCase
from alert_test_suite import AlertTestSuite
class TestAlertOpenPortViolation(AlertTestSuite):
alert_filename = "open_port_violation"
# This event is the default positive event that will caus... | Add unit-tests for open port violation alertfrom positive_alert_test_case import PositiveAlertTestCase
from negative_alert_test_case import NegativeAlertTestCase
from alert_test_suite import AlertTestSuite
class TestAlertOpenPortViolation(AlertTestSuite):
alert_filename = "open_port_violation"
# This event ... | <commit_before><commit_msg>Add unit-tests for open port violation alert<commit_after>from positive_alert_test_case import PositiveAlertTestCase
from negative_alert_test_case import NegativeAlertTestCase
from alert_test_suite import AlertTestSuite
class TestAlertOpenPortViolation(AlertTestSuite):
alert_filename =... | |
5314e142827016eed55c2a1c94faae853d2331e5 | tests/unit/modules/test_bigip.py | tests/unit/modules/test_bigip.py | # -*- coding: utf-8 -*-
"""
tests.unit.modules.test_bigip
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Unit tests for the bigip module
"""
from __future__ import absolute_import, print_function, unicode_literals
import logging
import salt.modules.bigip as bigip
from tests.support.mixins import LoaderModuleMockMixin
from tests.suppo... | Add tests to validate that bigip module requests session verifies SSL | Add tests to validate that bigip module requests session verifies SSL
| Python | apache-2.0 | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | Add tests to validate that bigip module requests session verifies SSL | # -*- coding: utf-8 -*-
"""
tests.unit.modules.test_bigip
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Unit tests for the bigip module
"""
from __future__ import absolute_import, print_function, unicode_literals
import logging
import salt.modules.bigip as bigip
from tests.support.mixins import LoaderModuleMockMixin
from tests.suppo... | <commit_before><commit_msg>Add tests to validate that bigip module requests session verifies SSL<commit_after> | # -*- coding: utf-8 -*-
"""
tests.unit.modules.test_bigip
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Unit tests for the bigip module
"""
from __future__ import absolute_import, print_function, unicode_literals
import logging
import salt.modules.bigip as bigip
from tests.support.mixins import LoaderModuleMockMixin
from tests.suppo... | Add tests to validate that bigip module requests session verifies SSL# -*- coding: utf-8 -*-
"""
tests.unit.modules.test_bigip
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Unit tests for the bigip module
"""
from __future__ import absolute_import, print_function, unicode_literals
import logging
import salt.modules.bigip as bigip
fr... | <commit_before><commit_msg>Add tests to validate that bigip module requests session verifies SSL<commit_after># -*- coding: utf-8 -*-
"""
tests.unit.modules.test_bigip
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Unit tests for the bigip module
"""
from __future__ import absolute_import, print_function, unicode_literals
import loggi... | |
6852c9ee1ff9baf7ea21e5e0e11e8984a8315fba | glance/registry/db/migrate_repo/versions/004_add_checksum.py | glance/registry/db/migrate_repo/versions/004_add_checksum.py | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack LLC.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/... | Add migration script for checksum column | Add migration script for checksum column | Python | apache-2.0 | akash1808/glance,jumpstarter-io/glance,cloudbau/glance,JioCloud/glance,tanglei528/glance,jumpstarter-io/glance,wkoathp/glance,paramite/glance,stevelle/glance,sigmavirus24/glance,cloudbau/glance,rajalokan/glance,redhat-openstack/glance,ozamiatin/glance,ntt-sic/glance,rickerc/glance_audit,darren-wang/gl,kfwang/Glance-OVA... | Add migration script for checksum column | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack LLC.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/... | <commit_before><commit_msg>Add migration script for checksum column<commit_after> | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack LLC.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/... | Add migration script for checksum column# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack LLC.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the Licen... | <commit_before><commit_msg>Add migration script for checksum column<commit_after># vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack LLC.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License... | |
371bb8f7d7a0f77e7f756ed691b5806a8da33326 | IPython/utils/tests/test_text.py | IPython/utils/tests/test_text.py | # encoding: utf-8
"""Tests for IPython.utils.text"""
#-----------------------------------------------------------------------------
# Copyright (C) 2011 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distributed as part of this software.... | Add failing test: columnize called with very long entries. | Add failing test: columnize called with very long entries.
Bug reported on-list.
| Python | bsd-3-clause | ipython/ipython,ipython/ipython | Add failing test: columnize called with very long entries.
Bug reported on-list. | # encoding: utf-8
"""Tests for IPython.utils.text"""
#-----------------------------------------------------------------------------
# Copyright (C) 2011 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distributed as part of this software.... | <commit_before><commit_msg>Add failing test: columnize called with very long entries.
Bug reported on-list.<commit_after> | # encoding: utf-8
"""Tests for IPython.utils.text"""
#-----------------------------------------------------------------------------
# Copyright (C) 2011 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distributed as part of this software.... | Add failing test: columnize called with very long entries.
Bug reported on-list.# encoding: utf-8
"""Tests for IPython.utils.text"""
#-----------------------------------------------------------------------------
# Copyright (C) 2011 The IPython Development Team
#
# Distributed under the terms of the BSD License. ... | <commit_before><commit_msg>Add failing test: columnize called with very long entries.
Bug reported on-list.<commit_after># encoding: utf-8
"""Tests for IPython.utils.text"""
#-----------------------------------------------------------------------------
# Copyright (C) 2011 The IPython Development Team
#
# Distribu... | |
f8c26bb11a3d064902fd6bb70b9933861ce7fe1d | rest/httpUtils.py | rest/httpUtils.py | from django.http import HttpResponse
from rest_framework.renderers import JSONRenderer
# Initially taken from
# http://www.django-rest-framework.org/tutorial/1-serialization/
class JSONResponse(HttpResponse):
"""
An HttpResponse that renders its content into JSON.
"""
def __init__(self, data, **kwargs)... | Add one place to get JSONResponse from. | Add one place to get JSONResponse from.
| Python | apache-2.0 | CMPUT404W17T06/CMPUT404-project,CMPUT404W17T06/CMPUT404-project,CMPUT404W17T06/CMPUT404-project | Add one place to get JSONResponse from. | from django.http import HttpResponse
from rest_framework.renderers import JSONRenderer
# Initially taken from
# http://www.django-rest-framework.org/tutorial/1-serialization/
class JSONResponse(HttpResponse):
"""
An HttpResponse that renders its content into JSON.
"""
def __init__(self, data, **kwargs)... | <commit_before><commit_msg>Add one place to get JSONResponse from.<commit_after> | from django.http import HttpResponse
from rest_framework.renderers import JSONRenderer
# Initially taken from
# http://www.django-rest-framework.org/tutorial/1-serialization/
class JSONResponse(HttpResponse):
"""
An HttpResponse that renders its content into JSON.
"""
def __init__(self, data, **kwargs)... | Add one place to get JSONResponse from.from django.http import HttpResponse
from rest_framework.renderers import JSONRenderer
# Initially taken from
# http://www.django-rest-framework.org/tutorial/1-serialization/
class JSONResponse(HttpResponse):
"""
An HttpResponse that renders its content into JSON.
"""... | <commit_before><commit_msg>Add one place to get JSONResponse from.<commit_after>from django.http import HttpResponse
from rest_framework.renderers import JSONRenderer
# Initially taken from
# http://www.django-rest-framework.org/tutorial/1-serialization/
class JSONResponse(HttpResponse):
"""
An HttpResponse th... | |
5a27d230c92215594d909c49f22ff2ff592806c3 | gaphor/UML/tests/test_diagram.py | gaphor/UML/tests/test_diagram.py | import gaphas
import pytest
from gaphor.services.eventmanager import EventManager
from gaphor.UML import Diagram
from gaphor.UML.elementfactory import ElementFactory
from gaphor.UML.presentation import Presentation
class Example(Presentation, gaphas.Element):
def unlink(self):
self.test_unlinked = True
... | Add some extra tests for Diagram | Add some extra tests for Diagram
| Python | lgpl-2.1 | amolenaar/gaphor,amolenaar/gaphor | Add some extra tests for Diagram | import gaphas
import pytest
from gaphor.services.eventmanager import EventManager
from gaphor.UML import Diagram
from gaphor.UML.elementfactory import ElementFactory
from gaphor.UML.presentation import Presentation
class Example(Presentation, gaphas.Element):
def unlink(self):
self.test_unlinked = True
... | <commit_before><commit_msg>Add some extra tests for Diagram<commit_after> | import gaphas
import pytest
from gaphor.services.eventmanager import EventManager
from gaphor.UML import Diagram
from gaphor.UML.elementfactory import ElementFactory
from gaphor.UML.presentation import Presentation
class Example(Presentation, gaphas.Element):
def unlink(self):
self.test_unlinked = True
... | Add some extra tests for Diagramimport gaphas
import pytest
from gaphor.services.eventmanager import EventManager
from gaphor.UML import Diagram
from gaphor.UML.elementfactory import ElementFactory
from gaphor.UML.presentation import Presentation
class Example(Presentation, gaphas.Element):
def unlink(self):
... | <commit_before><commit_msg>Add some extra tests for Diagram<commit_after>import gaphas
import pytest
from gaphor.services.eventmanager import EventManager
from gaphor.UML import Diagram
from gaphor.UML.elementfactory import ElementFactory
from gaphor.UML.presentation import Presentation
class Example(Presentation, g... | |
0a1dbf4d891feda44b1fd45beb7bf59a5737f797 | dataportal/__init__.py | dataportal/__init__.py | import sys
import logging
from .sources import *
logger = logging.getLogger(__name__)
__version__ = 'v0.0.5.post0'
| import sys
import logging
from .sources import *
logger = logging.getLogger(__name__)
__version__ = 'v0.0.5.post0'
from .broker import DataBroker
from .muxer import DataMuxer
| Make DataBroker and DataMuxer top-level. | API: Make DataBroker and DataMuxer top-level.
| Python | bsd-3-clause | ericdill/databroker,danielballan/dataportal,ericdill/datamuxer,tacaswell/dataportal,NSLS-II/datamuxer,NSLS-II/dataportal,danielballan/datamuxer,danielballan/datamuxer,tacaswell/dataportal,danielballan/dataportal,ericdill/datamuxer,NSLS-II/dataportal,ericdill/databroker | import sys
import logging
from .sources import *
logger = logging.getLogger(__name__)
__version__ = 'v0.0.5.post0'
API: Make DataBroker and DataMuxer top-level. | import sys
import logging
from .sources import *
logger = logging.getLogger(__name__)
__version__ = 'v0.0.5.post0'
from .broker import DataBroker
from .muxer import DataMuxer
| <commit_before>import sys
import logging
from .sources import *
logger = logging.getLogger(__name__)
__version__ = 'v0.0.5.post0'
<commit_msg>API: Make DataBroker and DataMuxer top-level.<commit_after> | import sys
import logging
from .sources import *
logger = logging.getLogger(__name__)
__version__ = 'v0.0.5.post0'
from .broker import DataBroker
from .muxer import DataMuxer
| import sys
import logging
from .sources import *
logger = logging.getLogger(__name__)
__version__ = 'v0.0.5.post0'
API: Make DataBroker and DataMuxer top-level.import sys
import logging
from .sources import *
logger = logging.getLogger(__name__)
__version__ = 'v0.0.5.post0'
from .broker import DataBroker
from .mux... | <commit_before>import sys
import logging
from .sources import *
logger = logging.getLogger(__name__)
__version__ = 'v0.0.5.post0'
<commit_msg>API: Make DataBroker and DataMuxer top-level.<commit_after>import sys
import logging
from .sources import *
logger = logging.getLogger(__name__)
__version__ = 'v0.0.5.post0'
... |
7d068af4cab1eeb9d7e4b78babb8216f60314f4f | portal/tests/test_views.py | portal/tests/test_views.py | from django.test import TestCase
from django.urls import reverse
# Create your tests here.
class HomeViewTestCase(TestCase):
"""HomeView test suite"""
expected_url = '/'
def test_desired_location(self):
resp = self.client.get(self.expected_url)
self.assertEqual(resp.status_code, 200)
... | Add view test cases for portal | Add view test cases for portal
| Python | mit | huangsam/chowist,huangsam/chowist,huangsam/chowist | Add view test cases for portal | from django.test import TestCase
from django.urls import reverse
# Create your tests here.
class HomeViewTestCase(TestCase):
"""HomeView test suite"""
expected_url = '/'
def test_desired_location(self):
resp = self.client.get(self.expected_url)
self.assertEqual(resp.status_code, 200)
... | <commit_before><commit_msg>Add view test cases for portal<commit_after> | from django.test import TestCase
from django.urls import reverse
# Create your tests here.
class HomeViewTestCase(TestCase):
"""HomeView test suite"""
expected_url = '/'
def test_desired_location(self):
resp = self.client.get(self.expected_url)
self.assertEqual(resp.status_code, 200)
... | Add view test cases for portalfrom django.test import TestCase
from django.urls import reverse
# Create your tests here.
class HomeViewTestCase(TestCase):
"""HomeView test suite"""
expected_url = '/'
def test_desired_location(self):
resp = self.client.get(self.expected_url)
self.assertEq... | <commit_before><commit_msg>Add view test cases for portal<commit_after>from django.test import TestCase
from django.urls import reverse
# Create your tests here.
class HomeViewTestCase(TestCase):
"""HomeView test suite"""
expected_url = '/'
def test_desired_location(self):
resp = self.client.get... | |
26b9bc9547865c9b4ea654504adbee15f21ed633 | backend/populate_dionyziz.py | backend/populate_dionyziz.py | from string import ascii_lowercase
import django
import os
import string
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'backend.settings')
django.setup()
from breach.models import Target, Victim
endpoint = 'https://dionyziz.com/breach-test/reflect.php?ref=%s'
prefix = 'imper'
alphabet = ascii_lowercase
secretlengt... | Add population script for dionyziz | Add population script for dionyziz
| Python | mit | dimkarakostas/rupture,dionyziz/rupture,dimkarakostas/rupture,esarafianou/rupture,dimriou/rupture,dionyziz/rupture,dimriou/rupture,dionyziz/rupture,dimriou/rupture,dimriou/rupture,esarafianou/rupture,dimkarakostas/rupture,dimkarakostas/rupture,esarafianou/rupture,dimkarakostas/rupture,esarafianou/rupture,dimriou/rupture... | Add population script for dionyziz | from string import ascii_lowercase
import django
import os
import string
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'backend.settings')
django.setup()
from breach.models import Target, Victim
endpoint = 'https://dionyziz.com/breach-test/reflect.php?ref=%s'
prefix = 'imper'
alphabet = ascii_lowercase
secretlengt... | <commit_before><commit_msg>Add population script for dionyziz<commit_after> | from string import ascii_lowercase
import django
import os
import string
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'backend.settings')
django.setup()
from breach.models import Target, Victim
endpoint = 'https://dionyziz.com/breach-test/reflect.php?ref=%s'
prefix = 'imper'
alphabet = ascii_lowercase
secretlengt... | Add population script for dionyzizfrom string import ascii_lowercase
import django
import os
import string
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'backend.settings')
django.setup()
from breach.models import Target, Victim
endpoint = 'https://dionyziz.com/breach-test/reflect.php?ref=%s'
prefix = 'imper'
alph... | <commit_before><commit_msg>Add population script for dionyziz<commit_after>from string import ascii_lowercase
import django
import os
import string
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'backend.settings')
django.setup()
from breach.models import Target, Victim
endpoint = 'https://dionyziz.com/breach-test/... | |
a355a9f76add5b7b91b31b9e8b07c4f0fbc9ce3a | docs/examples/core/ipython-get-history.py | docs/examples/core/ipython-get-history.py | #!/usr/bin/env python
"""Extract a session from the IPython input history.
Usage:
ipython-get-history.py sessionnumber [outputfile]
If outputfile is not given, the relevant history is written to stdout. If
outputfile has a .py extension, the translated history (without IPython's
special syntax) will be extracted.
... | Add example script for extracting history from the database. | Add example script for extracting history from the database.
| Python | bsd-3-clause | ipython/ipython,ipython/ipython | Add example script for extracting history from the database. | #!/usr/bin/env python
"""Extract a session from the IPython input history.
Usage:
ipython-get-history.py sessionnumber [outputfile]
If outputfile is not given, the relevant history is written to stdout. If
outputfile has a .py extension, the translated history (without IPython's
special syntax) will be extracted.
... | <commit_before><commit_msg>Add example script for extracting history from the database.<commit_after> | #!/usr/bin/env python
"""Extract a session from the IPython input history.
Usage:
ipython-get-history.py sessionnumber [outputfile]
If outputfile is not given, the relevant history is written to stdout. If
outputfile has a .py extension, the translated history (without IPython's
special syntax) will be extracted.
... | Add example script for extracting history from the database.#!/usr/bin/env python
"""Extract a session from the IPython input history.
Usage:
ipython-get-history.py sessionnumber [outputfile]
If outputfile is not given, the relevant history is written to stdout. If
outputfile has a .py extension, the translated his... | <commit_before><commit_msg>Add example script for extracting history from the database.<commit_after>#!/usr/bin/env python
"""Extract a session from the IPython input history.
Usage:
ipython-get-history.py sessionnumber [outputfile]
If outputfile is not given, the relevant history is written to stdout. If
outputfil... | |
64da0215068c789a0e5422e3829c3e876a6cc526 | scripts/osfstorage/repopulate_sha.py | scripts/osfstorage/repopulate_sha.py | import sys
import logging
from modularodm import Q
from website.app import init_app
from website.files.models import FileVersion
from scripts import utils as script_utils
from framework.transactions.context import TokuTransaction
logger = logging.getLogger(__name__)
def do_migration():
logger.info('Starting ... | Add a migration for repopulating sha256s of older osfstorage file versions | Add a migration for repopulating sha256s of older osfstorage file versions
| Python | apache-2.0 | kch8qx/osf.io,laurenrevere/osf.io,laurenrevere/osf.io,rdhyee/osf.io,haoyuchen1992/osf.io,HalcyonChimera/osf.io,pattisdr/osf.io,samanehsan/osf.io,brandonPurvis/osf.io,caneruguz/osf.io,TomHeatwole/osf.io,abought/osf.io,acshi/osf.io,leb2dg/osf.io,cslzchen/osf.io,Nesiehr/osf.io,zamattiac/osf.io,Ghalko/osf.io,mluke93/osf.io... | Add a migration for repopulating sha256s of older osfstorage file versions | import sys
import logging
from modularodm import Q
from website.app import init_app
from website.files.models import FileVersion
from scripts import utils as script_utils
from framework.transactions.context import TokuTransaction
logger = logging.getLogger(__name__)
def do_migration():
logger.info('Starting ... | <commit_before><commit_msg>Add a migration for repopulating sha256s of older osfstorage file versions<commit_after> | import sys
import logging
from modularodm import Q
from website.app import init_app
from website.files.models import FileVersion
from scripts import utils as script_utils
from framework.transactions.context import TokuTransaction
logger = logging.getLogger(__name__)
def do_migration():
logger.info('Starting ... | Add a migration for repopulating sha256s of older osfstorage file versionsimport sys
import logging
from modularodm import Q
from website.app import init_app
from website.files.models import FileVersion
from scripts import utils as script_utils
from framework.transactions.context import TokuTransaction
logger = lo... | <commit_before><commit_msg>Add a migration for repopulating sha256s of older osfstorage file versions<commit_after>import sys
import logging
from modularodm import Q
from website.app import init_app
from website.files.models import FileVersion
from scripts import utils as script_utils
from framework.transactions.con... | |
ee496c2e8e210124184a3b9b0e4be15dbbe1b01a | scripts/validate_schema.py | scripts/validate_schema.py | #!/usr/bin/env python
# Copyright 2017 Cargill Incorporated
#
# 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... | Add script to validate table metadata values exist | Add script to validate table metadata values exist
| Python | apache-2.0 | Cargill/pipewrench,Cargill/pipewrench | Add script to validate table metadata values exist | #!/usr/bin/env python
# Copyright 2017 Cargill Incorporated
#
# 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 script to validate table metadata values exist<commit_after> | #!/usr/bin/env python
# Copyright 2017 Cargill Incorporated
#
# 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... | Add script to validate table metadata values exist#!/usr/bin/env python
# Copyright 2017 Cargill Incorporated
#
# 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.a... | <commit_before><commit_msg>Add script to validate table metadata values exist<commit_after>#!/usr/bin/env python
# Copyright 2017 Cargill Incorporated
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a cop... | |
c405eb28fb15a7f2891f6630a550bf532d80494a | tests/GIR/test_401_workspace.py | tests/GIR/test_401_workspace.py | # coding=utf-8
import sys
import struct
import unittest
from test_000_config import TestConfig
from test_020_connection import TestConnection
from gi.repository import Midgard
from gi.repository import GObject
class TestWorkspace(unittest.TestCase):
mgd = None
manager = None
def setUp(self):
if self.mgd i... | Test workspace. Initial. Closes gh-181 | Test workspace. Initial. Closes gh-181
| Python | lgpl-2.1 | midgardproject/midgard-core,midgardproject/midgard-core,midgardproject/midgard-core,midgardproject/midgard-core | Test workspace. Initial. Closes gh-181 | # coding=utf-8
import sys
import struct
import unittest
from test_000_config import TestConfig
from test_020_connection import TestConnection
from gi.repository import Midgard
from gi.repository import GObject
class TestWorkspace(unittest.TestCase):
mgd = None
manager = None
def setUp(self):
if self.mgd i... | <commit_before><commit_msg>Test workspace. Initial. Closes gh-181<commit_after> | # coding=utf-8
import sys
import struct
import unittest
from test_000_config import TestConfig
from test_020_connection import TestConnection
from gi.repository import Midgard
from gi.repository import GObject
class TestWorkspace(unittest.TestCase):
mgd = None
manager = None
def setUp(self):
if self.mgd i... | Test workspace. Initial. Closes gh-181# coding=utf-8
import sys
import struct
import unittest
from test_000_config import TestConfig
from test_020_connection import TestConnection
from gi.repository import Midgard
from gi.repository import GObject
class TestWorkspace(unittest.TestCase):
mgd = None
manager = None... | <commit_before><commit_msg>Test workspace. Initial. Closes gh-181<commit_after># coding=utf-8
import sys
import struct
import unittest
from test_000_config import TestConfig
from test_020_connection import TestConnection
from gi.repository import Midgard
from gi.repository import GObject
class TestWorkspace(unittest... | |
b70fe116d3652202ea9ccee63f255f8b39cd0ebf | src/commands/fedex.py | src/commands/fedex.py | import urllib
import webbrowser
import qmk
class FedexCommand(qmk.Command):
'''Use the Fedex website to view the tracking info for the given
tracking number.'''
def __init__(self):
self._name = 'fedex'
self._help = self.__doc__
self.__baseURL = 'http://www.fedex.com/Tracking' \
... | Add Fedex command for tracking packages. | Add Fedex command for tracking packages.
| Python | mit | kivhift/qmk,kivhift/qmk | Add Fedex command for tracking packages. | import urllib
import webbrowser
import qmk
class FedexCommand(qmk.Command):
'''Use the Fedex website to view the tracking info for the given
tracking number.'''
def __init__(self):
self._name = 'fedex'
self._help = self.__doc__
self.__baseURL = 'http://www.fedex.com/Tracking' \
... | <commit_before><commit_msg>Add Fedex command for tracking packages.<commit_after> | import urllib
import webbrowser
import qmk
class FedexCommand(qmk.Command):
'''Use the Fedex website to view the tracking info for the given
tracking number.'''
def __init__(self):
self._name = 'fedex'
self._help = self.__doc__
self.__baseURL = 'http://www.fedex.com/Tracking' \
... | Add Fedex command for tracking packages.import urllib
import webbrowser
import qmk
class FedexCommand(qmk.Command):
'''Use the Fedex website to view the tracking info for the given
tracking number.'''
def __init__(self):
self._name = 'fedex'
self._help = self.__doc__
self.__baseURL... | <commit_before><commit_msg>Add Fedex command for tracking packages.<commit_after>import urllib
import webbrowser
import qmk
class FedexCommand(qmk.Command):
'''Use the Fedex website to view the tracking info for the given
tracking number.'''
def __init__(self):
self._name = 'fedex'
self._h... | |
f3e0f0340b146d7583ae4165549837497ea7a7b0 | scripts/get_bank_registry_cz.py | scripts/get_bank_registry_cz.py | import json
import csv
import requests
URL = "https://www.cnb.cz/cs/platebni-styk/.galleries/ucty_kody_bank/download/kody_bank_CR.csv"
registry = []
def process():
with requests.get(URL, stream=True) as csvfile:
count = 0
for row in csvfile.iter_lines():
if count != 0:
... | Add script to generate CZ bank bic codes registry | Add script to generate CZ bank bic codes registry
| Python | mit | figo-connect/schwifty | Add script to generate CZ bank bic codes registry | import json
import csv
import requests
URL = "https://www.cnb.cz/cs/platebni-styk/.galleries/ucty_kody_bank/download/kody_bank_CR.csv"
registry = []
def process():
with requests.get(URL, stream=True) as csvfile:
count = 0
for row in csvfile.iter_lines():
if count != 0:
... | <commit_before><commit_msg>Add script to generate CZ bank bic codes registry<commit_after> | import json
import csv
import requests
URL = "https://www.cnb.cz/cs/platebni-styk/.galleries/ucty_kody_bank/download/kody_bank_CR.csv"
registry = []
def process():
with requests.get(URL, stream=True) as csvfile:
count = 0
for row in csvfile.iter_lines():
if count != 0:
... | Add script to generate CZ bank bic codes registryimport json
import csv
import requests
URL = "https://www.cnb.cz/cs/platebni-styk/.galleries/ucty_kody_bank/download/kody_bank_CR.csv"
registry = []
def process():
with requests.get(URL, stream=True) as csvfile:
count = 0
for row in csvfile.iter_... | <commit_before><commit_msg>Add script to generate CZ bank bic codes registry<commit_after>import json
import csv
import requests
URL = "https://www.cnb.cz/cs/platebni-styk/.galleries/ucty_kody_bank/download/kody_bank_CR.csv"
registry = []
def process():
with requests.get(URL, stream=True) as csvfile:
c... | |
975aa908d01129129c3e103643648aaab994f426 | tests/unit/test_question_answer.py | tests/unit/test_question_answer.py | import os
from tests import PMGTestCase
from tests.fixtures import (
dbfixture, CommitteeQuestionData
)
class TestQuestionAnswer(PMGTestCase):
def setUp(self):
super(TestQuestionAnswer, self).setUp()
self.fx = dbfixture.data(
CommitteeQuestionData,
)
self.fx.setup(... | Add unit test for minister_questions_combined api endpoint | Add unit test for minister_questions_combined api endpoint
| Python | apache-2.0 | Code4SA/pmg-cms-2,Code4SA/pmg-cms-2,Code4SA/pmg-cms-2 | Add unit test for minister_questions_combined api endpoint | import os
from tests import PMGTestCase
from tests.fixtures import (
dbfixture, CommitteeQuestionData
)
class TestQuestionAnswer(PMGTestCase):
def setUp(self):
super(TestQuestionAnswer, self).setUp()
self.fx = dbfixture.data(
CommitteeQuestionData,
)
self.fx.setup(... | <commit_before><commit_msg>Add unit test for minister_questions_combined api endpoint<commit_after> | import os
from tests import PMGTestCase
from tests.fixtures import (
dbfixture, CommitteeQuestionData
)
class TestQuestionAnswer(PMGTestCase):
def setUp(self):
super(TestQuestionAnswer, self).setUp()
self.fx = dbfixture.data(
CommitteeQuestionData,
)
self.fx.setup(... | Add unit test for minister_questions_combined api endpointimport os
from tests import PMGTestCase
from tests.fixtures import (
dbfixture, CommitteeQuestionData
)
class TestQuestionAnswer(PMGTestCase):
def setUp(self):
super(TestQuestionAnswer, self).setUp()
self.fx = dbfixture.data(
... | <commit_before><commit_msg>Add unit test for minister_questions_combined api endpoint<commit_after>import os
from tests import PMGTestCase
from tests.fixtures import (
dbfixture, CommitteeQuestionData
)
class TestQuestionAnswer(PMGTestCase):
def setUp(self):
super(TestQuestionAnswer, self).setUp()
... | |
2d8f221d55b0c04280a1b44ef72588882946fdea | takeoutStrings.py | takeoutStrings.py | #!/usr/bin/env python
# coding=utf-8
'''
This script will help you take out all strings.xml(Placed in a language-region folder) from an Android projectDir
We now use it to provide the strings and upload them to Crowdin.
'''
from os import system,listdir,path
from sys import argv
def takeoutStrings(resPath):
for... | Add script for Taking out of strings.xml files | Add script for Taking out of strings.xml files
| Python | apache-2.0 | androidyue/DroidPy | Add script for Taking out of strings.xml files | #!/usr/bin/env python
# coding=utf-8
'''
This script will help you take out all strings.xml(Placed in a language-region folder) from an Android projectDir
We now use it to provide the strings and upload them to Crowdin.
'''
from os import system,listdir,path
from sys import argv
def takeoutStrings(resPath):
for... | <commit_before><commit_msg>Add script for Taking out of strings.xml files<commit_after> | #!/usr/bin/env python
# coding=utf-8
'''
This script will help you take out all strings.xml(Placed in a language-region folder) from an Android projectDir
We now use it to provide the strings and upload them to Crowdin.
'''
from os import system,listdir,path
from sys import argv
def takeoutStrings(resPath):
for... | Add script for Taking out of strings.xml files#!/usr/bin/env python
# coding=utf-8
'''
This script will help you take out all strings.xml(Placed in a language-region folder) from an Android projectDir
We now use it to provide the strings and upload them to Crowdin.
'''
from os import system,listdir,path
from sys imp... | <commit_before><commit_msg>Add script for Taking out of strings.xml files<commit_after>#!/usr/bin/env python
# coding=utf-8
'''
This script will help you take out all strings.xml(Placed in a language-region folder) from an Android projectDir
We now use it to provide the strings and upload them to Crowdin.
'''
from o... | |
824b616123ca8378e3540409a522708997368ea1 | crandom.py | crandom.py | from __future__ import print_function, division
import numpy as np
def randbool(n, rng=None):
if rng is None:
rng = np.random
return rng.randint(2, size=n) * 2 - 1
| Add random number generation utility module. | Add random number generation utility module.
| Python | bsd-3-clause | eddiejessup/ciabatta | Add random number generation utility module. | from __future__ import print_function, division
import numpy as np
def randbool(n, rng=None):
if rng is None:
rng = np.random
return rng.randint(2, size=n) * 2 - 1
| <commit_before><commit_msg>Add random number generation utility module.<commit_after> | from __future__ import print_function, division
import numpy as np
def randbool(n, rng=None):
if rng is None:
rng = np.random
return rng.randint(2, size=n) * 2 - 1
| Add random number generation utility module.from __future__ import print_function, division
import numpy as np
def randbool(n, rng=None):
if rng is None:
rng = np.random
return rng.randint(2, size=n) * 2 - 1
| <commit_before><commit_msg>Add random number generation utility module.<commit_after>from __future__ import print_function, division
import numpy as np
def randbool(n, rng=None):
if rng is None:
rng = np.random
return rng.randint(2, size=n) * 2 - 1
| |
634832b6ed70adfc3a54f6ca5a72e6b396f60d90 | symsynd/exceptions.py | symsynd/exceptions.py | class SymbolicationError(Exception):
message = None
def __init__(self, message):
if isinstance(message, bytes):
message = message.decode('utf-8', 'replace')
Exception.__init__(self, message)
self.message = message
def __str__(self):
return self.message.encode('u... | Move exception into common module and add unicode support | Move exception into common module and add unicode support
| Python | bsd-3-clause | getsentry/symsynd,getsentry/symsynd,getsentry/symsynd,getsentry/symsynd,getsentry/symsynd | Move exception into common module and add unicode support | class SymbolicationError(Exception):
message = None
def __init__(self, message):
if isinstance(message, bytes):
message = message.decode('utf-8', 'replace')
Exception.__init__(self, message)
self.message = message
def __str__(self):
return self.message.encode('u... | <commit_before><commit_msg>Move exception into common module and add unicode support<commit_after> | class SymbolicationError(Exception):
message = None
def __init__(self, message):
if isinstance(message, bytes):
message = message.decode('utf-8', 'replace')
Exception.__init__(self, message)
self.message = message
def __str__(self):
return self.message.encode('u... | Move exception into common module and add unicode supportclass SymbolicationError(Exception):
message = None
def __init__(self, message):
if isinstance(message, bytes):
message = message.decode('utf-8', 'replace')
Exception.__init__(self, message)
self.message = message
... | <commit_before><commit_msg>Move exception into common module and add unicode support<commit_after>class SymbolicationError(Exception):
message = None
def __init__(self, message):
if isinstance(message, bytes):
message = message.decode('utf-8', 'replace')
Exception.__init__(self, mes... | |
705b80fba3b165e35fa6d10656e3b888092aa86c | test/autopep8_vim.py | test/autopep8_vim.py | """Run autopep8 on the selected buffer in Vim.
map <C-I> :pyf <path_to>/autopep8_vim.py<CR>
"""
import autopep8
import vim
# TODO: Find out how to get the actual encoding from Vim.
encoding = 'utf-8'
options = autopep8.parse_args(['--range',
str(vim.current.range.start),
... | Add example of how to use autopep8 in Vim | Add example of how to use autopep8 in Vim
This example supports selecting a specific line range to format.
| Python | mit | MeteorAdminz/autopep8,hhatto/autopep8,Vauxoo/autopep8,Vauxoo/autopep8,vauxoo-dev/autopep8,MeteorAdminz/autopep8,hhatto/autopep8,vauxoo-dev/autopep8,SG345/autopep8,SG345/autopep8 | Add example of how to use autopep8 in Vim
This example supports selecting a specific line range to format. | """Run autopep8 on the selected buffer in Vim.
map <C-I> :pyf <path_to>/autopep8_vim.py<CR>
"""
import autopep8
import vim
# TODO: Find out how to get the actual encoding from Vim.
encoding = 'utf-8'
options = autopep8.parse_args(['--range',
str(vim.current.range.start),
... | <commit_before><commit_msg>Add example of how to use autopep8 in Vim
This example supports selecting a specific line range to format.<commit_after> | """Run autopep8 on the selected buffer in Vim.
map <C-I> :pyf <path_to>/autopep8_vim.py<CR>
"""
import autopep8
import vim
# TODO: Find out how to get the actual encoding from Vim.
encoding = 'utf-8'
options = autopep8.parse_args(['--range',
str(vim.current.range.start),
... | Add example of how to use autopep8 in Vim
This example supports selecting a specific line range to format."""Run autopep8 on the selected buffer in Vim.
map <C-I> :pyf <path_to>/autopep8_vim.py<CR>
"""
import autopep8
import vim
# TODO: Find out how to get the actual encoding from Vim.
encoding = 'utf-8'
options =... | <commit_before><commit_msg>Add example of how to use autopep8 in Vim
This example supports selecting a specific line range to format.<commit_after>"""Run autopep8 on the selected buffer in Vim.
map <C-I> :pyf <path_to>/autopep8_vim.py<CR>
"""
import autopep8
import vim
# TODO: Find out how to get the actual encodi... | |
a64c04bcdd39d3c4f734e790a8a1f1f072d31fac | example/tests/test_settings.py | example/tests/test_settings.py | from django_webtest import WebTest
from django.core.urlresolvers import reverse
from django.test.utils import override_settings
from . import factory
class AdminTestCase(WebTest):
def setUp(self):
super(AdminTestCase, self).setUp()
self.user = factory.create_superuser()
self.image = facto... | Test disabling inclusion of jQuery | Test disabling inclusion of jQuery
| Python | bsd-3-clause | winzard/django-image-cropping,henriquechehad/django-image-cropping,winzard/django-image-cropping,henriquechehad/django-image-cropping,winzard/django-image-cropping,henriquechehad/django-image-cropping | Test disabling inclusion of jQuery | from django_webtest import WebTest
from django.core.urlresolvers import reverse
from django.test.utils import override_settings
from . import factory
class AdminTestCase(WebTest):
def setUp(self):
super(AdminTestCase, self).setUp()
self.user = factory.create_superuser()
self.image = facto... | <commit_before><commit_msg>Test disabling inclusion of jQuery<commit_after> | from django_webtest import WebTest
from django.core.urlresolvers import reverse
from django.test.utils import override_settings
from . import factory
class AdminTestCase(WebTest):
def setUp(self):
super(AdminTestCase, self).setUp()
self.user = factory.create_superuser()
self.image = facto... | Test disabling inclusion of jQueryfrom django_webtest import WebTest
from django.core.urlresolvers import reverse
from django.test.utils import override_settings
from . import factory
class AdminTestCase(WebTest):
def setUp(self):
super(AdminTestCase, self).setUp()
self.user = factory.create_supe... | <commit_before><commit_msg>Test disabling inclusion of jQuery<commit_after>from django_webtest import WebTest
from django.core.urlresolvers import reverse
from django.test.utils import override_settings
from . import factory
class AdminTestCase(WebTest):
def setUp(self):
super(AdminTestCase, self).setUp(... | |
76139dd3bfab10256c05aed7998f3c1d79265ced | fireplace/cards/tgt/paladin.py | fireplace/cards/tgt/paladin.py | from ..utils import *
##
# Minions
# Murloc Knight
class AT_076:
inspire = Summon(CONTROLLER, RandomMurloc())
# Eadric the Pure
class AT_081:
play = Buff(ALL_MINIONS, "AT_081e")
##
# Spells
# Seal of Champions
class AT_074:
play = Buff(TARGET, "AT_074e2")
##
# Secrets
# Competitive Spirit
class A... | Implement Paladin cards for The Grand Tournament | Implement Paladin cards for The Grand Tournament
| Python | agpl-3.0 | Ragowit/fireplace,oftc-ftw/fireplace,smallnamespace/fireplace,Meerkov/fireplace,Ragowit/fireplace,liujimj/fireplace,smallnamespace/fireplace,amw2104/fireplace,beheh/fireplace,jleclanche/fireplace,liujimj/fireplace,NightKev/fireplace,Meerkov/fireplace,oftc-ftw/fireplace,amw2104/fireplace | Implement Paladin cards for The Grand Tournament | from ..utils import *
##
# Minions
# Murloc Knight
class AT_076:
inspire = Summon(CONTROLLER, RandomMurloc())
# Eadric the Pure
class AT_081:
play = Buff(ALL_MINIONS, "AT_081e")
##
# Spells
# Seal of Champions
class AT_074:
play = Buff(TARGET, "AT_074e2")
##
# Secrets
# Competitive Spirit
class A... | <commit_before><commit_msg>Implement Paladin cards for The Grand Tournament<commit_after> | from ..utils import *
##
# Minions
# Murloc Knight
class AT_076:
inspire = Summon(CONTROLLER, RandomMurloc())
# Eadric the Pure
class AT_081:
play = Buff(ALL_MINIONS, "AT_081e")
##
# Spells
# Seal of Champions
class AT_074:
play = Buff(TARGET, "AT_074e2")
##
# Secrets
# Competitive Spirit
class A... | Implement Paladin cards for The Grand Tournamentfrom ..utils import *
##
# Minions
# Murloc Knight
class AT_076:
inspire = Summon(CONTROLLER, RandomMurloc())
# Eadric the Pure
class AT_081:
play = Buff(ALL_MINIONS, "AT_081e")
##
# Spells
# Seal of Champions
class AT_074:
play = Buff(TARGET, "AT_074e... | <commit_before><commit_msg>Implement Paladin cards for The Grand Tournament<commit_after>from ..utils import *
##
# Minions
# Murloc Knight
class AT_076:
inspire = Summon(CONTROLLER, RandomMurloc())
# Eadric the Pure
class AT_081:
play = Buff(ALL_MINIONS, "AT_081e")
##
# Spells
# Seal of Champions
class... | |
71a29223077e6d447238789191446a0c5cc4cdd8 | scan.py | scan.py | #!/usr/bin/env python
# encoding: utf-8
from wand.image import Image
def rotate_image(filename, degrees):
"""Rotates filename degrees degrees."""
with Image(filename=filename) as image:
with image.clone() as rotated:
rotated.rotate(degrees)
rotated.save(filename=filename)
def ... | Add rotate_image() that rotates image a given amount of degrees | Add rotate_image() that rotates image a given amount of degrees
| Python | bsd-2-clause | sjktje/sjkscan,sjktje/sjkscan | Add rotate_image() that rotates image a given amount of degrees | #!/usr/bin/env python
# encoding: utf-8
from wand.image import Image
def rotate_image(filename, degrees):
"""Rotates filename degrees degrees."""
with Image(filename=filename) as image:
with image.clone() as rotated:
rotated.rotate(degrees)
rotated.save(filename=filename)
def ... | <commit_before><commit_msg>Add rotate_image() that rotates image a given amount of degrees<commit_after> | #!/usr/bin/env python
# encoding: utf-8
from wand.image import Image
def rotate_image(filename, degrees):
"""Rotates filename degrees degrees."""
with Image(filename=filename) as image:
with image.clone() as rotated:
rotated.rotate(degrees)
rotated.save(filename=filename)
def ... | Add rotate_image() that rotates image a given amount of degrees#!/usr/bin/env python
# encoding: utf-8
from wand.image import Image
def rotate_image(filename, degrees):
"""Rotates filename degrees degrees."""
with Image(filename=filename) as image:
with image.clone() as rotated:
rotated.ro... | <commit_before><commit_msg>Add rotate_image() that rotates image a given amount of degrees<commit_after>#!/usr/bin/env python
# encoding: utf-8
from wand.image import Image
def rotate_image(filename, degrees):
"""Rotates filename degrees degrees."""
with Image(filename=filename) as image:
with image.c... | |
3cf2eda808b9849a8bc57929b31826bbb95a41b9 | examples/test_window_switching.py | examples/test_window_switching.py | """
Sometimes tests open new tabs/windows, and you'll need
to switch to them first in order to interact with them.
The starting window is window(0). Then increments by 1.
"""
from seleniumbase import BaseCase
class TabSwitchingTests(BaseCase):
def test_switch_to_tabs(self):
self.open("data:tex... | Add an example test that has switching to a new tab/window | Add an example test that has switching to a new tab/window
| Python | mit | seleniumbase/SeleniumBase,seleniumbase/SeleniumBase,mdmintz/SeleniumBase,mdmintz/SeleniumBase,mdmintz/SeleniumBase,seleniumbase/SeleniumBase,mdmintz/SeleniumBase,seleniumbase/SeleniumBase | Add an example test that has switching to a new tab/window | """
Sometimes tests open new tabs/windows, and you'll need
to switch to them first in order to interact with them.
The starting window is window(0). Then increments by 1.
"""
from seleniumbase import BaseCase
class TabSwitchingTests(BaseCase):
def test_switch_to_tabs(self):
self.open("data:tex... | <commit_before><commit_msg>Add an example test that has switching to a new tab/window<commit_after> | """
Sometimes tests open new tabs/windows, and you'll need
to switch to them first in order to interact with them.
The starting window is window(0). Then increments by 1.
"""
from seleniumbase import BaseCase
class TabSwitchingTests(BaseCase):
def test_switch_to_tabs(self):
self.open("data:tex... | Add an example test that has switching to a new tab/window"""
Sometimes tests open new tabs/windows, and you'll need
to switch to them first in order to interact with them.
The starting window is window(0). Then increments by 1.
"""
from seleniumbase import BaseCase
class TabSwitchingTests(BaseCase):
d... | <commit_before><commit_msg>Add an example test that has switching to a new tab/window<commit_after>"""
Sometimes tests open new tabs/windows, and you'll need
to switch to them first in order to interact with them.
The starting window is window(0). Then increments by 1.
"""
from seleniumbase import BaseCase
cl... | |
0834e37317b44940c27cdcdd3ee9929498356220 | copperhead/runtime/np_interop.py | copperhead/runtime/np_interop.py | import numpy as np
import copperhead.compiler.backendtypes as ET
import copperhead.compiler.coretypes as T
from copperhead.compiler.conversions import back_to_front_type
def to_numpy(ary):
front_type = back_to_front_type(ary.type)
if not isinstance(front_type, T.Seq):
raise ValueError("Not convertible... | Add conversion function between cuarray and np.ndarray. | Add conversion function between cuarray and np.ndarray.
| Python | apache-2.0 | beni55/copperhead,copperhead/copperhead,shyamalschandra/copperhead,shyamalschandra/copperhead,beni55/copperhead,copperhead/copperhead | Add conversion function between cuarray and np.ndarray. | import numpy as np
import copperhead.compiler.backendtypes as ET
import copperhead.compiler.coretypes as T
from copperhead.compiler.conversions import back_to_front_type
def to_numpy(ary):
front_type = back_to_front_type(ary.type)
if not isinstance(front_type, T.Seq):
raise ValueError("Not convertible... | <commit_before><commit_msg>Add conversion function between cuarray and np.ndarray.<commit_after> | import numpy as np
import copperhead.compiler.backendtypes as ET
import copperhead.compiler.coretypes as T
from copperhead.compiler.conversions import back_to_front_type
def to_numpy(ary):
front_type = back_to_front_type(ary.type)
if not isinstance(front_type, T.Seq):
raise ValueError("Not convertible... | Add conversion function between cuarray and np.ndarray.import numpy as np
import copperhead.compiler.backendtypes as ET
import copperhead.compiler.coretypes as T
from copperhead.compiler.conversions import back_to_front_type
def to_numpy(ary):
front_type = back_to_front_type(ary.type)
if not isinstance(front_... | <commit_before><commit_msg>Add conversion function between cuarray and np.ndarray.<commit_after>import numpy as np
import copperhead.compiler.backendtypes as ET
import copperhead.compiler.coretypes as T
from copperhead.compiler.conversions import back_to_front_type
def to_numpy(ary):
front_type = back_to_front_ty... | |
3279d68859d947f2e618e2770a9fd1b7ce3f26c9 | tests/test_cardxml.py | tests/test_cardxml.py | from hearthstone.enums import GameTag, Rarity
import utils
def test_all_tags_known():
"""
Iterate through the card database and check that all specified GameTags
are known in hearthstone.enums.GameTag
"""
unknown_tags = set()
known_tags = list(GameTag)
known_rarities = list(Rarity)
# Check the db loaded cor... | Add a test to verify that all GameTags are known | Add a test to verify that all GameTags are known
| Python | agpl-3.0 | Ragowit/fireplace,smallnamespace/fireplace,jleclanche/fireplace,beheh/fireplace,amw2104/fireplace,amw2104/fireplace,smallnamespace/fireplace,NightKev/fireplace,Ragowit/fireplace | Add a test to verify that all GameTags are known | from hearthstone.enums import GameTag, Rarity
import utils
def test_all_tags_known():
"""
Iterate through the card database and check that all specified GameTags
are known in hearthstone.enums.GameTag
"""
unknown_tags = set()
known_tags = list(GameTag)
known_rarities = list(Rarity)
# Check the db loaded cor... | <commit_before><commit_msg>Add a test to verify that all GameTags are known<commit_after> | from hearthstone.enums import GameTag, Rarity
import utils
def test_all_tags_known():
"""
Iterate through the card database and check that all specified GameTags
are known in hearthstone.enums.GameTag
"""
unknown_tags = set()
known_tags = list(GameTag)
known_rarities = list(Rarity)
# Check the db loaded cor... | Add a test to verify that all GameTags are knownfrom hearthstone.enums import GameTag, Rarity
import utils
def test_all_tags_known():
"""
Iterate through the card database and check that all specified GameTags
are known in hearthstone.enums.GameTag
"""
unknown_tags = set()
known_tags = list(GameTag)
known_rar... | <commit_before><commit_msg>Add a test to verify that all GameTags are known<commit_after>from hearthstone.enums import GameTag, Rarity
import utils
def test_all_tags_known():
"""
Iterate through the card database and check that all specified GameTags
are known in hearthstone.enums.GameTag
"""
unknown_tags = set... | |
eaf44ba0daccf08fa223ecd3d6fc9c967851eeb5 | examples/stream_dealer_router.py | examples/stream_dealer_router.py | import asyncio
import aiozmq
import zmq
@asyncio.coroutine
def go():
router = yield from aiozmq.create_zmq_stream(
zmq.ROUTER,
bind='tcp://127.0.0.1:*')
addr = list(router.transport.bindings())[0]
dealer = yield from aiozmq.create_zmq_stream(
zmq.DEALER,
connect=addr)
... | Add example for zmq streams | Add example for zmq streams
| Python | bsd-2-clause | MetaMemoryT/aiozmq,aio-libs/aiozmq,asteven/aiozmq,claws/aiozmq | Add example for zmq streams | import asyncio
import aiozmq
import zmq
@asyncio.coroutine
def go():
router = yield from aiozmq.create_zmq_stream(
zmq.ROUTER,
bind='tcp://127.0.0.1:*')
addr = list(router.transport.bindings())[0]
dealer = yield from aiozmq.create_zmq_stream(
zmq.DEALER,
connect=addr)
... | <commit_before><commit_msg>Add example for zmq streams<commit_after> | import asyncio
import aiozmq
import zmq
@asyncio.coroutine
def go():
router = yield from aiozmq.create_zmq_stream(
zmq.ROUTER,
bind='tcp://127.0.0.1:*')
addr = list(router.transport.bindings())[0]
dealer = yield from aiozmq.create_zmq_stream(
zmq.DEALER,
connect=addr)
... | Add example for zmq streamsimport asyncio
import aiozmq
import zmq
@asyncio.coroutine
def go():
router = yield from aiozmq.create_zmq_stream(
zmq.ROUTER,
bind='tcp://127.0.0.1:*')
addr = list(router.transport.bindings())[0]
dealer = yield from aiozmq.create_zmq_stream(
zmq.DEALER,... | <commit_before><commit_msg>Add example for zmq streams<commit_after>import asyncio
import aiozmq
import zmq
@asyncio.coroutine
def go():
router = yield from aiozmq.create_zmq_stream(
zmq.ROUTER,
bind='tcp://127.0.0.1:*')
addr = list(router.transport.bindings())[0]
dealer = yield from aioz... | |
2050a52b9b3065a9d6211cb029a308dce054c28d | calexicon/dates/tests/test_bce.py | calexicon/dates/tests/test_bce.py | import unittest
from calexicon.dates import BCEDate
class TestBCEDate(unittest.TestCase):
def test_make_bce_date(self):
bd = BCEDate(-4713, 1, 1)
self.assertEqual(bd.julian_representation(), (-4713, 1, 1))
def test_equality(self):
self.assertEqual(BCEDate(-44, 3, 15), BCEDate(-44, 3,... | Add some tests for BCEDate. | Add some tests for BCEDate.
| Python | apache-2.0 | jwg4/calexicon,jwg4/qual | Add some tests for BCEDate. | import unittest
from calexicon.dates import BCEDate
class TestBCEDate(unittest.TestCase):
def test_make_bce_date(self):
bd = BCEDate(-4713, 1, 1)
self.assertEqual(bd.julian_representation(), (-4713, 1, 1))
def test_equality(self):
self.assertEqual(BCEDate(-44, 3, 15), BCEDate(-44, 3,... | <commit_before><commit_msg>Add some tests for BCEDate.<commit_after> | import unittest
from calexicon.dates import BCEDate
class TestBCEDate(unittest.TestCase):
def test_make_bce_date(self):
bd = BCEDate(-4713, 1, 1)
self.assertEqual(bd.julian_representation(), (-4713, 1, 1))
def test_equality(self):
self.assertEqual(BCEDate(-44, 3, 15), BCEDate(-44, 3,... | Add some tests for BCEDate.import unittest
from calexicon.dates import BCEDate
class TestBCEDate(unittest.TestCase):
def test_make_bce_date(self):
bd = BCEDate(-4713, 1, 1)
self.assertEqual(bd.julian_representation(), (-4713, 1, 1))
def test_equality(self):
self.assertEqual(BCEDate(-... | <commit_before><commit_msg>Add some tests for BCEDate.<commit_after>import unittest
from calexicon.dates import BCEDate
class TestBCEDate(unittest.TestCase):
def test_make_bce_date(self):
bd = BCEDate(-4713, 1, 1)
self.assertEqual(bd.julian_representation(), (-4713, 1, 1))
def test_equality(... | |
80f11c95d09a3538a6d67e6a01152fac7d2b6893 | tests/test_core_modules.py | tests/test_core_modules.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
from i3pystatus.core.modules import IntervalModule
class IntervalModuleMetaTest(unittest.TestCase):
def test_no_settings(self):
class NoSettings(IntervalModule):
pass
self.assertEqual(NoSettings.settings, ('interval',))
... | Add tests for adding interval setting automatically | Add tests for adding interval setting automatically
| Python | mit | teto/i3pystatus,enkore/i3pystatus,enkore/i3pystatus,fmarchenko/i3pystatus,Elder-of-Ozone/i3pystatus,ncoop/i3pystatus,onkelpit/i3pystatus,paulollivier/i3pystatus,Elder-of-Ozone/i3pystatus,eBrnd/i3pystatus,schroeji/i3pystatus,claria/i3pystatus,yang-ling/i3pystatus,opatut/i3pystatus,richese/i3pystatus,Arvedui/i3pystatus,y... | Add tests for adding interval setting automatically | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
from i3pystatus.core.modules import IntervalModule
class IntervalModuleMetaTest(unittest.TestCase):
def test_no_settings(self):
class NoSettings(IntervalModule):
pass
self.assertEqual(NoSettings.settings, ('interval',))
... | <commit_before><commit_msg>Add tests for adding interval setting automatically<commit_after> | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
from i3pystatus.core.modules import IntervalModule
class IntervalModuleMetaTest(unittest.TestCase):
def test_no_settings(self):
class NoSettings(IntervalModule):
pass
self.assertEqual(NoSettings.settings, ('interval',))
... | Add tests for adding interval setting automatically#!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
from i3pystatus.core.modules import IntervalModule
class IntervalModuleMetaTest(unittest.TestCase):
def test_no_settings(self):
class NoSettings(IntervalModule):
pass
sel... | <commit_before><commit_msg>Add tests for adding interval setting automatically<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
from i3pystatus.core.modules import IntervalModule
class IntervalModuleMetaTest(unittest.TestCase):
def test_no_settings(self):
class NoSettings(Inte... | |
bc2314b31a35e586eba14c8305b223de30fd041a | switch_mod/hawaii/unserved_load.py | switch_mod/hawaii/unserved_load.py | """Add an UnservedLoad component, which ensures the model is always feasible.
This is often useful when the model is constrained to the edge of infeasibility,
(e.g., when evaluating a pre-defined, just-feasible construction plan) to avoid
spurious reports of infeasibility."""
from pyomo.environ import *
def define_arg... | Define UservedLoad variable and penalty factor to relax infeasibility when needed. | Define UservedLoad variable and penalty factor to relax infeasibility when needed.
| Python | apache-2.0 | OCM-Lab-PUC/switch-chile,OCM-Lab-PUC/switch-chile,bmaluenda/switch | Define UservedLoad variable and penalty factor to relax infeasibility when needed. | """Add an UnservedLoad component, which ensures the model is always feasible.
This is often useful when the model is constrained to the edge of infeasibility,
(e.g., when evaluating a pre-defined, just-feasible construction plan) to avoid
spurious reports of infeasibility."""
from pyomo.environ import *
def define_arg... | <commit_before><commit_msg>Define UservedLoad variable and penalty factor to relax infeasibility when needed.<commit_after> | """Add an UnservedLoad component, which ensures the model is always feasible.
This is often useful when the model is constrained to the edge of infeasibility,
(e.g., when evaluating a pre-defined, just-feasible construction plan) to avoid
spurious reports of infeasibility."""
from pyomo.environ import *
def define_arg... | Define UservedLoad variable and penalty factor to relax infeasibility when needed."""Add an UnservedLoad component, which ensures the model is always feasible.
This is often useful when the model is constrained to the edge of infeasibility,
(e.g., when evaluating a pre-defined, just-feasible construction plan) to avoid... | <commit_before><commit_msg>Define UservedLoad variable and penalty factor to relax infeasibility when needed.<commit_after>"""Add an UnservedLoad component, which ensures the model is always feasible.
This is often useful when the model is constrained to the edge of infeasibility,
(e.g., when evaluating a pre-defined, ... | |
306416523edddb454ebb126c79e86a7dc7f2bd37 | setup.py | setup.py | #!/usr/bin/env python
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
import base32_crockford
package_data = {
'': ['LICENSE', 'README.rst'],
}
setup(
name='base32-crockford',
version='0.2.0',
description=("A Python implementation of Douglas Crockford'... | #!/usr/bin/env python
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
import base32_crockford
package_data = {
'': ['LICENSE', 'README.rst'],
}
setup(
name='base32-crockford',
version='0.2.0',
description=("A Python implementation of Douglas Crockford'... | Add Python 2.6 to the classifiers list | Add Python 2.6 to the classifiers list
| Python | bsd-3-clause | jbittel/base32-crockford,klaplong/baas32 | #!/usr/bin/env python
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
import base32_crockford
package_data = {
'': ['LICENSE', 'README.rst'],
}
setup(
name='base32-crockford',
version='0.2.0',
description=("A Python implementation of Douglas Crockford'... | #!/usr/bin/env python
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
import base32_crockford
package_data = {
'': ['LICENSE', 'README.rst'],
}
setup(
name='base32-crockford',
version='0.2.0',
description=("A Python implementation of Douglas Crockford'... | <commit_before>#!/usr/bin/env python
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
import base32_crockford
package_data = {
'': ['LICENSE', 'README.rst'],
}
setup(
name='base32-crockford',
version='0.2.0',
description=("A Python implementation of Dou... | #!/usr/bin/env python
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
import base32_crockford
package_data = {
'': ['LICENSE', 'README.rst'],
}
setup(
name='base32-crockford',
version='0.2.0',
description=("A Python implementation of Douglas Crockford'... | #!/usr/bin/env python
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
import base32_crockford
package_data = {
'': ['LICENSE', 'README.rst'],
}
setup(
name='base32-crockford',
version='0.2.0',
description=("A Python implementation of Douglas Crockford'... | <commit_before>#!/usr/bin/env python
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
import base32_crockford
package_data = {
'': ['LICENSE', 'README.rst'],
}
setup(
name='base32-crockford',
version='0.2.0',
description=("A Python implementation of Dou... |
a5bae9a5a9ffa53ab0c7da654e511ab150cb8ac9 | scripts/create_user.py | scripts/create_user.py | import sys
from brain.models.sqlobjects import User
from brain.helpers.sql import session_transaction
if len(sys.argv) not in (4, 5):
print("usage: {0} <username> <rmqvhost> <ftpuser> [quota]\n"
" with <username> a string\n"
" <rmqvhost> the rmqvhost used for the frontend\n"
... | Add sql user creation script | Add sql user creation script
| Python | apache-2.0 | quarkslab/irma,hirokihamasaki/irma,quarkslab/irma,quarkslab/irma,hirokihamasaki/irma,hirokihamasaki/irma,hirokihamasaki/irma,quarkslab/irma,hirokihamasaki/irma | Add sql user creation script | import sys
from brain.models.sqlobjects import User
from brain.helpers.sql import session_transaction
if len(sys.argv) not in (4, 5):
print("usage: {0} <username> <rmqvhost> <ftpuser> [quota]\n"
" with <username> a string\n"
" <rmqvhost> the rmqvhost used for the frontend\n"
... | <commit_before><commit_msg>Add sql user creation script<commit_after> | import sys
from brain.models.sqlobjects import User
from brain.helpers.sql import session_transaction
if len(sys.argv) not in (4, 5):
print("usage: {0} <username> <rmqvhost> <ftpuser> [quota]\n"
" with <username> a string\n"
" <rmqvhost> the rmqvhost used for the frontend\n"
... | Add sql user creation scriptimport sys
from brain.models.sqlobjects import User
from brain.helpers.sql import session_transaction
if len(sys.argv) not in (4, 5):
print("usage: {0} <username> <rmqvhost> <ftpuser> [quota]\n"
" with <username> a string\n"
" <rmqvhost> the rmqvhost ... | <commit_before><commit_msg>Add sql user creation script<commit_after>import sys
from brain.models.sqlobjects import User
from brain.helpers.sql import session_transaction
if len(sys.argv) not in (4, 5):
print("usage: {0} <username> <rmqvhost> <ftpuser> [quota]\n"
" with <username> a string\n"
... | |
b13ca26da67855f9d32f3209176af052ed46617f | wqflask/tests/utility/test_hmac.py | wqflask/tests/utility/test_hmac.py | # -*- coding: utf-8 -*-
"""Test hmac utility functions"""
import unittest
import mock
from utility.hmac import data_hmac
from utility.hmac import url_for_hmac
from utility.hmac import hmac_creation
class TestHmacUtil(unittest.TestCase):
"""Test Utility method for hmac creation"""
def test_hmac_creation(sel... | Add tests for hmac utility | Add tests for hmac utility
* wqflask/tests/utility/test_hmac.py: New tests.
| Python | agpl-3.0 | pjotrp/genenetwork2,zsloan/genenetwork2,zsloan/genenetwork2,genenetwork/genenetwork2,zsloan/genenetwork2,pjotrp/genenetwork2,pjotrp/genenetwork2,zsloan/genenetwork2,genenetwork/genenetwork2,pjotrp/genenetwork2,pjotrp/genenetwork2,genenetwork/genenetwork2,genenetwork/genenetwork2 | Add tests for hmac utility
* wqflask/tests/utility/test_hmac.py: New tests. | # -*- coding: utf-8 -*-
"""Test hmac utility functions"""
import unittest
import mock
from utility.hmac import data_hmac
from utility.hmac import url_for_hmac
from utility.hmac import hmac_creation
class TestHmacUtil(unittest.TestCase):
"""Test Utility method for hmac creation"""
def test_hmac_creation(sel... | <commit_before><commit_msg>Add tests for hmac utility
* wqflask/tests/utility/test_hmac.py: New tests.<commit_after> | # -*- coding: utf-8 -*-
"""Test hmac utility functions"""
import unittest
import mock
from utility.hmac import data_hmac
from utility.hmac import url_for_hmac
from utility.hmac import hmac_creation
class TestHmacUtil(unittest.TestCase):
"""Test Utility method for hmac creation"""
def test_hmac_creation(sel... | Add tests for hmac utility
* wqflask/tests/utility/test_hmac.py: New tests.# -*- coding: utf-8 -*-
"""Test hmac utility functions"""
import unittest
import mock
from utility.hmac import data_hmac
from utility.hmac import url_for_hmac
from utility.hmac import hmac_creation
class TestHmacUtil(unittest.TestCase):
... | <commit_before><commit_msg>Add tests for hmac utility
* wqflask/tests/utility/test_hmac.py: New tests.<commit_after># -*- coding: utf-8 -*-
"""Test hmac utility functions"""
import unittest
import mock
from utility.hmac import data_hmac
from utility.hmac import url_for_hmac
from utility.hmac import hmac_creation
c... | |
0eeb5baed7a4417ac083221805842019185ccec0 | web_page_replay_go/PRESUBMIT.py | web_page_replay_go/PRESUBMIT.py | # Copyright 2017 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.
"""Presubmit script for changes affecting web_page_replay_go/.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details ... | Add a presubmit script to run tests | [wpr-go] Add a presubmit script to run tests
Eventually, we would like to run webpagereplay tests on catapult continuous
build bots. For the time being, we run them as a presubmit step.
This is patched from nednguyen@'s CL at http://crrev.com/2989573002#ps1.
BUG=catapult:#3669
Review-Url: https://codereview.chromiu... | Python | bsd-3-clause | catapult-project/catapult,catapult-project/catapult,catapult-project/catapult,catapult-project/catapult,catapult-project/catapult,catapult-project/catapult,catapult-project/catapult | [wpr-go] Add a presubmit script to run tests
Eventually, we would like to run webpagereplay tests on catapult continuous
build bots. For the time being, we run them as a presubmit step.
This is patched from nednguyen@'s CL at http://crrev.com/2989573002#ps1.
BUG=catapult:#3669
Review-Url: https://codereview.chromiu... | # Copyright 2017 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.
"""Presubmit script for changes affecting web_page_replay_go/.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details ... | <commit_before><commit_msg>[wpr-go] Add a presubmit script to run tests
Eventually, we would like to run webpagereplay tests on catapult continuous
build bots. For the time being, we run them as a presubmit step.
This is patched from nednguyen@'s CL at http://crrev.com/2989573002#ps1.
BUG=catapult:#3669
Review-Url:... | # Copyright 2017 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.
"""Presubmit script for changes affecting web_page_replay_go/.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details ... | [wpr-go] Add a presubmit script to run tests
Eventually, we would like to run webpagereplay tests on catapult continuous
build bots. For the time being, we run them as a presubmit step.
This is patched from nednguyen@'s CL at http://crrev.com/2989573002#ps1.
BUG=catapult:#3669
Review-Url: https://codereview.chromiu... | <commit_before><commit_msg>[wpr-go] Add a presubmit script to run tests
Eventually, we would like to run webpagereplay tests on catapult continuous
build bots. For the time being, we run them as a presubmit step.
This is patched from nednguyen@'s CL at http://crrev.com/2989573002#ps1.
BUG=catapult:#3669
Review-Url:... | |
a9853ca2bbaa5a1c3a36e0c03aa08a2279d1b1aa | hashing_passwords.py | hashing_passwords.py | # coding: utf8
"""
Securely hash and check passwords using PBKDF2.
Use random salts to protect againt rainbow tables, many iterations against
brute-force, and constant-time comparaison againt timing attacks.
Keep parameters to the algorithm together with the hash so that we can
change the paramet... | Add some glue code to hash salted passwords wit PBKDF2. | Add some glue code to hash salted passwords wit PBKDF2.
| Python | bsd-3-clause | SimonSapin/snippets,SimonSapin/snippets | Add some glue code to hash salted passwords wit PBKDF2. | # coding: utf8
"""
Securely hash and check passwords using PBKDF2.
Use random salts to protect againt rainbow tables, many iterations against
brute-force, and constant-time comparaison againt timing attacks.
Keep parameters to the algorithm together with the hash so that we can
change the paramet... | <commit_before><commit_msg>Add some glue code to hash salted passwords wit PBKDF2.<commit_after> | # coding: utf8
"""
Securely hash and check passwords using PBKDF2.
Use random salts to protect againt rainbow tables, many iterations against
brute-force, and constant-time comparaison againt timing attacks.
Keep parameters to the algorithm together with the hash so that we can
change the paramet... | Add some glue code to hash salted passwords wit PBKDF2.# coding: utf8
"""
Securely hash and check passwords using PBKDF2.
Use random salts to protect againt rainbow tables, many iterations against
brute-force, and constant-time comparaison againt timing attacks.
Keep parameters to the algorithm toget... | <commit_before><commit_msg>Add some glue code to hash salted passwords wit PBKDF2.<commit_after># coding: utf8
"""
Securely hash and check passwords using PBKDF2.
Use random salts to protect againt rainbow tables, many iterations against
brute-force, and constant-time comparaison againt timing attacks.
... | |
9074375cd27de596eb5d697263b0a1096725a3a8 | hbase/hbase/tests.py | hbase/hbase/tests.py | # -*- coding: utf-8 -*-
from hbase.compat import PY26
from hbase.compat import comp_bytes
import mock
if PY26: # pragma: no cover
import unittest2 as unittest
else:
import unittest
class TableListTests(unittest.TestCase):
def _make_one(self):
from hbase import HBase
return HBase('loca... | Revert "haven't found a sensible way to test things" | Revert "haven't found a sensible way to test things"
This reverts commit 80821d7f46e0072f9df586a14b3d69fc85c216e1.
| Python | bsd-3-clause | fuzzy-id/midas,fuzzy-id/midas,fuzzy-id/midas | Revert "haven't found a sensible way to test things"
This reverts commit 80821d7f46e0072f9df586a14b3d69fc85c216e1. | # -*- coding: utf-8 -*-
from hbase.compat import PY26
from hbase.compat import comp_bytes
import mock
if PY26: # pragma: no cover
import unittest2 as unittest
else:
import unittest
class TableListTests(unittest.TestCase):
def _make_one(self):
from hbase import HBase
return HBase('loca... | <commit_before><commit_msg>Revert "haven't found a sensible way to test things"
This reverts commit 80821d7f46e0072f9df586a14b3d69fc85c216e1.<commit_after> | # -*- coding: utf-8 -*-
from hbase.compat import PY26
from hbase.compat import comp_bytes
import mock
if PY26: # pragma: no cover
import unittest2 as unittest
else:
import unittest
class TableListTests(unittest.TestCase):
def _make_one(self):
from hbase import HBase
return HBase('loca... | Revert "haven't found a sensible way to test things"
This reverts commit 80821d7f46e0072f9df586a14b3d69fc85c216e1.# -*- coding: utf-8 -*-
from hbase.compat import PY26
from hbase.compat import comp_bytes
import mock
if PY26: # pragma: no cover
import unittest2 as unittest
else:
import unittest
class Tabl... | <commit_before><commit_msg>Revert "haven't found a sensible way to test things"
This reverts commit 80821d7f46e0072f9df586a14b3d69fc85c216e1.<commit_after># -*- coding: utf-8 -*-
from hbase.compat import PY26
from hbase.compat import comp_bytes
import mock
if PY26: # pragma: no cover
import unittest2 as unitte... | |
3090f80fb75e28d76a2a9f5e25c507d095a695c8 | middleware/python/test_auth_middleware.py | middleware/python/test_auth_middleware.py | from tyk.decorators import *
from gateway import TykGateway as tyk
@CustomKeyCheck
def MyKeyCheck(request, session, metadata, spec):
print("Running MyKeyCheck?")
print("request:", request)
print("session:", session)
print("spec:", spec)
valid_token = 'aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d'
... | from tyk.decorators import *
from gateway import TykGateway as tyk
@CustomKeyCheck
def MyKeyCheck(request, session, metadata, spec):
print("Running MyKeyCheck?")
print("request:", request)
print("session:", session)
print("spec:", spec)
valid_token = 'aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d'
... | Use float in session fields | Use float in session fields
| Python | mpl-2.0 | nebolsin/tyk,nebolsin/tyk,mvdan/tyk,lonelycode/tyk,mvdan/tyk,lonelycode/tyk,nebolsin/tyk,nebolsin/tyk,mvdan/tyk,mvdan/tyk,mvdan/tyk,mvdan/tyk,lonelycode/tyk,nebolsin/tyk,mvdan/tyk,nebolsin/tyk,nebolsin/tyk,nebolsin/tyk,mvdan/tyk | from tyk.decorators import *
from gateway import TykGateway as tyk
@CustomKeyCheck
def MyKeyCheck(request, session, metadata, spec):
print("Running MyKeyCheck?")
print("request:", request)
print("session:", session)
print("spec:", spec)
valid_token = 'aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d'
... | from tyk.decorators import *
from gateway import TykGateway as tyk
@CustomKeyCheck
def MyKeyCheck(request, session, metadata, spec):
print("Running MyKeyCheck?")
print("request:", request)
print("session:", session)
print("spec:", spec)
valid_token = 'aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d'
... | <commit_before>from tyk.decorators import *
from gateway import TykGateway as tyk
@CustomKeyCheck
def MyKeyCheck(request, session, metadata, spec):
print("Running MyKeyCheck?")
print("request:", request)
print("session:", session)
print("spec:", spec)
valid_token = 'aaf4c61ddcc5e8a2dabede0f3b482c... | from tyk.decorators import *
from gateway import TykGateway as tyk
@CustomKeyCheck
def MyKeyCheck(request, session, metadata, spec):
print("Running MyKeyCheck?")
print("request:", request)
print("session:", session)
print("spec:", spec)
valid_token = 'aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d'
... | from tyk.decorators import *
from gateway import TykGateway as tyk
@CustomKeyCheck
def MyKeyCheck(request, session, metadata, spec):
print("Running MyKeyCheck?")
print("request:", request)
print("session:", session)
print("spec:", spec)
valid_token = 'aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d'
... | <commit_before>from tyk.decorators import *
from gateway import TykGateway as tyk
@CustomKeyCheck
def MyKeyCheck(request, session, metadata, spec):
print("Running MyKeyCheck?")
print("request:", request)
print("session:", session)
print("spec:", spec)
valid_token = 'aaf4c61ddcc5e8a2dabede0f3b482c... |
8f70af55a1cbe58eea64ca8b40b0f8d67d6a0b8b | migrations/versions/032_tighten_easuid.py | migrations/versions/032_tighten_easuid.py | """Tighten EAS constraints and fix easfoldersync state enum.
Revision ID: 3f96e92953e1
Revises: 55f0ff54c776
Create Date: 2014-05-21 17:43:44.556716
"""
# revision identifiers, used by Alembic.
revision = '3f96e92953e1'
down_revision = '55f0ff54c776'
from alembic import op
import sqlalchemy as sa
from sqlalchemy.ex... | Fix nullable constraints on EASUid and EASFoldersync state enum. | [SCHEMA] Fix nullable constraints on EASUid and EASFoldersync state enum.
Summary:
The former we tightened on Gmail at one point and didn't trickle it back
to EAS. The latter is a bug from way back.
We really need to figure out a better deal for what to do with EAS-only
migrations, but putting it here for now.
Depen... | Python | agpl-3.0 | ErinCall/sync-engine,jobscore/sync-engine,gale320/sync-engine,Eagles2F/sync-engine,nylas/sync-engine,Eagles2F/sync-engine,rmasters/inbox,gale320/sync-engine,Eagles2F/sync-engine,rmasters/inbox,PriviPK/privipk-sync-engine,gale320/sync-engine,nylas/sync-engine,Eagles2F/sync-engine,gale320/sync-engine,closeio/nylas,EthanB... | [SCHEMA] Fix nullable constraints on EASUid and EASFoldersync state enum.
Summary:
The former we tightened on Gmail at one point and didn't trickle it back
to EAS. The latter is a bug from way back.
We really need to figure out a better deal for what to do with EAS-only
migrations, but putting it here for now.
Depen... | """Tighten EAS constraints and fix easfoldersync state enum.
Revision ID: 3f96e92953e1
Revises: 55f0ff54c776
Create Date: 2014-05-21 17:43:44.556716
"""
# revision identifiers, used by Alembic.
revision = '3f96e92953e1'
down_revision = '55f0ff54c776'
from alembic import op
import sqlalchemy as sa
from sqlalchemy.ex... | <commit_before><commit_msg>[SCHEMA] Fix nullable constraints on EASUid and EASFoldersync state enum.
Summary:
The former we tightened on Gmail at one point and didn't trickle it back
to EAS. The latter is a bug from way back.
We really need to figure out a better deal for what to do with EAS-only
migrations, but putt... | """Tighten EAS constraints and fix easfoldersync state enum.
Revision ID: 3f96e92953e1
Revises: 55f0ff54c776
Create Date: 2014-05-21 17:43:44.556716
"""
# revision identifiers, used by Alembic.
revision = '3f96e92953e1'
down_revision = '55f0ff54c776'
from alembic import op
import sqlalchemy as sa
from sqlalchemy.ex... | [SCHEMA] Fix nullable constraints on EASUid and EASFoldersync state enum.
Summary:
The former we tightened on Gmail at one point and didn't trickle it back
to EAS. The latter is a bug from way back.
We really need to figure out a better deal for what to do with EAS-only
migrations, but putting it here for now.
Depen... | <commit_before><commit_msg>[SCHEMA] Fix nullable constraints on EASUid and EASFoldersync state enum.
Summary:
The former we tightened on Gmail at one point and didn't trickle it back
to EAS. The latter is a bug from way back.
We really need to figure out a better deal for what to do with EAS-only
migrations, but putt... | |
4e2120a7cc2429729436c6a8c4fda39936ce3523 | osfclient/tests/test_file.py | osfclient/tests/test_file.py | from unittest.mock import patch
from osfclient.models import OSFCore
from osfclient.models import File
from osfclient.models import Folder
from osfclient.tests import fake_responses
from osfclient.tests.mocks import FakeResponse
_files_url = 'https://api.osf.io/v2//nodes/f3szh/files/osfstorage/foo123'
@patch.objec... | Add test of Folder instances | Add test of Folder instances
| Python | bsd-3-clause | betatim/osf-cli,betatim/osf-cli | Add test of Folder instances | from unittest.mock import patch
from osfclient.models import OSFCore
from osfclient.models import File
from osfclient.models import Folder
from osfclient.tests import fake_responses
from osfclient.tests.mocks import FakeResponse
_files_url = 'https://api.osf.io/v2//nodes/f3szh/files/osfstorage/foo123'
@patch.objec... | <commit_before><commit_msg>Add test of Folder instances<commit_after> | from unittest.mock import patch
from osfclient.models import OSFCore
from osfclient.models import File
from osfclient.models import Folder
from osfclient.tests import fake_responses
from osfclient.tests.mocks import FakeResponse
_files_url = 'https://api.osf.io/v2//nodes/f3szh/files/osfstorage/foo123'
@patch.objec... | Add test of Folder instancesfrom unittest.mock import patch
from osfclient.models import OSFCore
from osfclient.models import File
from osfclient.models import Folder
from osfclient.tests import fake_responses
from osfclient.tests.mocks import FakeResponse
_files_url = 'https://api.osf.io/v2//nodes/f3szh/files/osfst... | <commit_before><commit_msg>Add test of Folder instances<commit_after>from unittest.mock import patch
from osfclient.models import OSFCore
from osfclient.models import File
from osfclient.models import Folder
from osfclient.tests import fake_responses
from osfclient.tests.mocks import FakeResponse
_files_url = 'https... | |
dcb230c1d06bc556c0b52df0c605a58f43baac64 | dipy/denoise/gibbs.py | dipy/denoise/gibbs.py | import numpy as np
def image_tv(x, fn=0, nn=3, a=0):
""" Computes total variation (TV) of matrix x along axis a in two
directions.
Parameters
----------
x : 2D ndarray
matrix x
fn : int
Distance of first neighbor to be included in TV calculation. If fn=0
the own point ... | Add total variation function need to access sub-voxel shifts | NF: Add total variation function need to access sub-voxel shifts
| Python | bsd-3-clause | FrancoisRheaultUS/dipy,FrancoisRheaultUS/dipy | NF: Add total variation function need to access sub-voxel shifts | import numpy as np
def image_tv(x, fn=0, nn=3, a=0):
""" Computes total variation (TV) of matrix x along axis a in two
directions.
Parameters
----------
x : 2D ndarray
matrix x
fn : int
Distance of first neighbor to be included in TV calculation. If fn=0
the own point ... | <commit_before><commit_msg>NF: Add total variation function need to access sub-voxel shifts<commit_after> | import numpy as np
def image_tv(x, fn=0, nn=3, a=0):
""" Computes total variation (TV) of matrix x along axis a in two
directions.
Parameters
----------
x : 2D ndarray
matrix x
fn : int
Distance of first neighbor to be included in TV calculation. If fn=0
the own point ... | NF: Add total variation function need to access sub-voxel shiftsimport numpy as np
def image_tv(x, fn=0, nn=3, a=0):
""" Computes total variation (TV) of matrix x along axis a in two
directions.
Parameters
----------
x : 2D ndarray
matrix x
fn : int
Distance of first neighbor ... | <commit_before><commit_msg>NF: Add total variation function need to access sub-voxel shifts<commit_after>import numpy as np
def image_tv(x, fn=0, nn=3, a=0):
""" Computes total variation (TV) of matrix x along axis a in two
directions.
Parameters
----------
x : 2D ndarray
matrix x
fn ... | |
5504aa44a1b47d6533c65c0f5884f11eda06359b | tests/rules/test_no_such_file.py | tests/rules/test_no_such_file.py | import pytest
from thefuck.rules.no_such_file import match, get_new_command
from tests.utils import Command
@pytest.mark.parametrize('command', [
Command(script='mv foo bar/foo', stderr="mv: cannot move 'foo' to 'bar/foo': No such file or directory"),
Command(script='mv foo bar/', stderr="mv: cannot move 'foo... | Add tests for the `no_such_file` rule | Add tests for the `no_such_file` rule
| Python | mit | petr-tichy/thefuck,princeofdarkness76/thefuck,PLNech/thefuck,mlk/thefuck,manashmndl/thefuck,bugaevc/thefuck,thinkerchan/thefuck,subajat1/thefuck,BertieJim/thefuck,suxinde2009/thefuck,ostree/thefuck,ytjiang/thefuck,bigplus/thefuck,mcarton/thefuck,vanita5/thefuck,BertieJim/thefuck,sekaiamber/thefuck,vanita5/thefuck,roth1... | Add tests for the `no_such_file` rule | import pytest
from thefuck.rules.no_such_file import match, get_new_command
from tests.utils import Command
@pytest.mark.parametrize('command', [
Command(script='mv foo bar/foo', stderr="mv: cannot move 'foo' to 'bar/foo': No such file or directory"),
Command(script='mv foo bar/', stderr="mv: cannot move 'foo... | <commit_before><commit_msg>Add tests for the `no_such_file` rule<commit_after> | import pytest
from thefuck.rules.no_such_file import match, get_new_command
from tests.utils import Command
@pytest.mark.parametrize('command', [
Command(script='mv foo bar/foo', stderr="mv: cannot move 'foo' to 'bar/foo': No such file or directory"),
Command(script='mv foo bar/', stderr="mv: cannot move 'foo... | Add tests for the `no_such_file` ruleimport pytest
from thefuck.rules.no_such_file import match, get_new_command
from tests.utils import Command
@pytest.mark.parametrize('command', [
Command(script='mv foo bar/foo', stderr="mv: cannot move 'foo' to 'bar/foo': No such file or directory"),
Command(script='mv fo... | <commit_before><commit_msg>Add tests for the `no_such_file` rule<commit_after>import pytest
from thefuck.rules.no_such_file import match, get_new_command
from tests.utils import Command
@pytest.mark.parametrize('command', [
Command(script='mv foo bar/foo', stderr="mv: cannot move 'foo' to 'bar/foo': No such file ... | |
fddfccdf1e9092a137aeadfd37a82dd6979205a6 | proc_opener.py | proc_opener.py | #!/usr/bin/python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# Print out each tab process created during a test run, and the test it was created during.
import s... | Add analyzer for which pids are open during which tests | Add analyzer for which pids are open during which tests
| Python | mpl-2.0 | amccreight/mochitest-logs | Add analyzer for which pids are open during which tests | #!/usr/bin/python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# Print out each tab process created during a test run, and the test it was created during.
import s... | <commit_before><commit_msg>Add analyzer for which pids are open during which tests<commit_after> | #!/usr/bin/python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# Print out each tab process created during a test run, and the test it was created during.
import s... | Add analyzer for which pids are open during which tests#!/usr/bin/python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# Print out each tab process created during a ... | <commit_before><commit_msg>Add analyzer for which pids are open during which tests<commit_after>#!/usr/bin/python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# Pri... | |
4232c1160008201d8d06f447695ad316a0c4a416 | examples/python_csq_xml_example.py | examples/python_csq_xml_example.py | __author__ = 'Dimitry Lvovsky'
# Copyright 2014 ReviewRank S.A ( ReviewPro )
#
# 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
#
... | Add example for CSQ XML | Add example for CSQ XML
| Python | apache-2.0 | reviewpro/api_connect,reviewpro/api_connect,reviewpro/connect_py,reviewpro/connect_py | Add example for CSQ XML | __author__ = 'Dimitry Lvovsky'
# Copyright 2014 ReviewRank S.A ( ReviewPro )
#
# 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
#
... | <commit_before><commit_msg>Add example for CSQ XML<commit_after> | __author__ = 'Dimitry Lvovsky'
# Copyright 2014 ReviewRank S.A ( ReviewPro )
#
# 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
#
... | Add example for CSQ XML__author__ = 'Dimitry Lvovsky'
# Copyright 2014 ReviewRank S.A ( ReviewPro )
#
# 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/... | <commit_before><commit_msg>Add example for CSQ XML<commit_after>__author__ = 'Dimitry Lvovsky'
# Copyright 2014 ReviewRank S.A ( ReviewPro )
#
# 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 Lice... | |
d3211f577e4c7f4d99f3c7bed8178310f9a48b83 | tests/test_lesson_1_greetings.py | tests/test_lesson_1_greetings.py | # This lesson teaches you how to define a function that takes an input, and then uses
# it to alter the output of that function.
# Much like last time, run your python command in your terminal to see your first failure.
# `python -m unittest -vf tests.test_lesson_1_greetings`
# Again, like last time, you should see ... | Add tests for lesson 1: greetings | Add tests for lesson 1: greetings
| Python | mit | thejessleigh/test_driven_python,thejessleigh/test_driven_python,thejessleigh/test_driven_python | Add tests for lesson 1: greetings | # This lesson teaches you how to define a function that takes an input, and then uses
# it to alter the output of that function.
# Much like last time, run your python command in your terminal to see your first failure.
# `python -m unittest -vf tests.test_lesson_1_greetings`
# Again, like last time, you should see ... | <commit_before><commit_msg>Add tests for lesson 1: greetings<commit_after> | # This lesson teaches you how to define a function that takes an input, and then uses
# it to alter the output of that function.
# Much like last time, run your python command in your terminal to see your first failure.
# `python -m unittest -vf tests.test_lesson_1_greetings`
# Again, like last time, you should see ... | Add tests for lesson 1: greetings# This lesson teaches you how to define a function that takes an input, and then uses
# it to alter the output of that function.
# Much like last time, run your python command in your terminal to see your first failure.
# `python -m unittest -vf tests.test_lesson_1_greetings`
# Again... | <commit_before><commit_msg>Add tests for lesson 1: greetings<commit_after># This lesson teaches you how to define a function that takes an input, and then uses
# it to alter the output of that function.
# Much like last time, run your python command in your terminal to see your first failure.
# `python -m unittest -v... | |
e8f8b08ffb011ed705701f40c6a1a952c13d7c41 | analytics/test_analytics.py | analytics/test_analytics.py | # -*- encoding: utf-8
import pytest
from reports import NGINX_LOG_REGEX
@pytest.mark.parametrize('log_line', [
# Unusual methods
'0.0.0.0 - - [01/Jan/2001:00:00:00 +0000] "HEAD /example HTTP/1.0" 200 0 "http://referrer.org" "Example user agent" "1.2.3.4"',
'0.0.0.0 - - [01/Jan/2001:00:00:00 +0000] "OPTI... | Add a few tests for the analytics code | Add a few tests for the analytics code
| Python | mit | alexwlchan/alexwlchan.net,alexwlchan/alexwlchan.net,alexwlchan/alexwlchan.net,alexwlchan/alexwlchan.net,alexwlchan/alexwlchan.net | Add a few tests for the analytics code | # -*- encoding: utf-8
import pytest
from reports import NGINX_LOG_REGEX
@pytest.mark.parametrize('log_line', [
# Unusual methods
'0.0.0.0 - - [01/Jan/2001:00:00:00 +0000] "HEAD /example HTTP/1.0" 200 0 "http://referrer.org" "Example user agent" "1.2.3.4"',
'0.0.0.0 - - [01/Jan/2001:00:00:00 +0000] "OPTI... | <commit_before><commit_msg>Add a few tests for the analytics code<commit_after> | # -*- encoding: utf-8
import pytest
from reports import NGINX_LOG_REGEX
@pytest.mark.parametrize('log_line', [
# Unusual methods
'0.0.0.0 - - [01/Jan/2001:00:00:00 +0000] "HEAD /example HTTP/1.0" 200 0 "http://referrer.org" "Example user agent" "1.2.3.4"',
'0.0.0.0 - - [01/Jan/2001:00:00:00 +0000] "OPTI... | Add a few tests for the analytics code# -*- encoding: utf-8
import pytest
from reports import NGINX_LOG_REGEX
@pytest.mark.parametrize('log_line', [
# Unusual methods
'0.0.0.0 - - [01/Jan/2001:00:00:00 +0000] "HEAD /example HTTP/1.0" 200 0 "http://referrer.org" "Example user agent" "1.2.3.4"',
'0.0.0.0 ... | <commit_before><commit_msg>Add a few tests for the analytics code<commit_after># -*- encoding: utf-8
import pytest
from reports import NGINX_LOG_REGEX
@pytest.mark.parametrize('log_line', [
# Unusual methods
'0.0.0.0 - - [01/Jan/2001:00:00:00 +0000] "HEAD /example HTTP/1.0" 200 0 "http://referrer.org" "Exam... | |
8f15591e90945b780a3a900f6eda7ffd3c712d1d | tools/3.7-migration.py | tools/3.7-migration.py | import argparse
import ConfigParser
import os
from qisys import ui
import qisys.parsers
import qisys.sh
import qisys.qixml
import qitoolchain.toolchain
def get_old_toolchains():
""" Return a dict name -> feed from the previous config format
"""
res = dict()
cfg_path = qisys.sh.get_config_path("qi", ... | Add a tool to ease 3.7 migration | Add a tool to ease 3.7 migration
Change-Id: I0fcb3a1dd3bffe719f1abfa45a328640002affa0
Reviewed-on: http://gerrit.aldebaran.lan/49630
Reviewed-by: dmerejkowsky <[email protected]>
Tested-by: dmerejkowsky <[email protected]>
| Python | bsd-3-clause | dmerejkowsky/qibuild,dmerejkowsky/qibuild,dmerejkowsky/qibuild,aldebaran/qibuild,aldebaran/qibuild,dmerejkowsky/qibuild,aldebaran/qibuild,dmerejkowsky/qibuild,aldebaran/qibuild | Add a tool to ease 3.7 migration
Change-Id: I0fcb3a1dd3bffe719f1abfa45a328640002affa0
Reviewed-on: http://gerrit.aldebaran.lan/49630
Reviewed-by: dmerejkowsky <[email protected]>
Tested-by: dmerejkowsky <[email protected]> | import argparse
import ConfigParser
import os
from qisys import ui
import qisys.parsers
import qisys.sh
import qisys.qixml
import qitoolchain.toolchain
def get_old_toolchains():
""" Return a dict name -> feed from the previous config format
"""
res = dict()
cfg_path = qisys.sh.get_config_path("qi", ... | <commit_before><commit_msg>Add a tool to ease 3.7 migration
Change-Id: I0fcb3a1dd3bffe719f1abfa45a328640002affa0
Reviewed-on: http://gerrit.aldebaran.lan/49630
Reviewed-by: dmerejkowsky <[email protected]>
Tested-by: dmerejkowsky <1e4b13000fa8777df4cefd2fd8215187e3deb062@a... | import argparse
import ConfigParser
import os
from qisys import ui
import qisys.parsers
import qisys.sh
import qisys.qixml
import qitoolchain.toolchain
def get_old_toolchains():
""" Return a dict name -> feed from the previous config format
"""
res = dict()
cfg_path = qisys.sh.get_config_path("qi", ... | Add a tool to ease 3.7 migration
Change-Id: I0fcb3a1dd3bffe719f1abfa45a328640002affa0
Reviewed-on: http://gerrit.aldebaran.lan/49630
Reviewed-by: dmerejkowsky <[email protected]>
Tested-by: dmerejkowsky <[email protected]>impor... | <commit_before><commit_msg>Add a tool to ease 3.7 migration
Change-Id: I0fcb3a1dd3bffe719f1abfa45a328640002affa0
Reviewed-on: http://gerrit.aldebaran.lan/49630
Reviewed-by: dmerejkowsky <[email protected]>
Tested-by: dmerejkowsky <1e4b13000fa8777df4cefd2fd8215187e3deb062@a... | |
4f2a7c64e8871b05679b71d2f79b9525c3ed40dd | dev/benchmark_for_elasticsearch.py | dev/benchmark_for_elasticsearch.py | # Simple benchmark script when searching similar strings by using elasticsearch instead of SimString.
# Since Elasticsearch uses Apache Lucene, TF/IDF based searching algorithm, the purpose for searching text will be different from this library.
from elasticsearch import Elasticsearch
from benchmarker import Benchmark... | Add benchmark script for elasticsearch | Add benchmark script for elasticsearch
| Python | mit | nullnull/simstring | Add benchmark script for elasticsearch | # Simple benchmark script when searching similar strings by using elasticsearch instead of SimString.
# Since Elasticsearch uses Apache Lucene, TF/IDF based searching algorithm, the purpose for searching text will be different from this library.
from elasticsearch import Elasticsearch
from benchmarker import Benchmark... | <commit_before><commit_msg>Add benchmark script for elasticsearch<commit_after> | # Simple benchmark script when searching similar strings by using elasticsearch instead of SimString.
# Since Elasticsearch uses Apache Lucene, TF/IDF based searching algorithm, the purpose for searching text will be different from this library.
from elasticsearch import Elasticsearch
from benchmarker import Benchmark... | Add benchmark script for elasticsearch# Simple benchmark script when searching similar strings by using elasticsearch instead of SimString.
# Since Elasticsearch uses Apache Lucene, TF/IDF based searching algorithm, the purpose for searching text will be different from this library.
from elasticsearch import Elasticse... | <commit_before><commit_msg>Add benchmark script for elasticsearch<commit_after># Simple benchmark script when searching similar strings by using elasticsearch instead of SimString.
# Since Elasticsearch uses Apache Lucene, TF/IDF based searching algorithm, the purpose for searching text will be different from this libr... | |
c3bd992d3b42255205b4f90cb3578bd81982f773 | opps/core/tests/source_models.py | opps/core/tests/source_models.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.db import IntegrityError
from django.test import TestCase
from opps.core.models.source import Source
class SourceModelTest(TestCase):
def setUp(self):
self.source = Source.objects.create(name=u'Test site',
slug=u'test-site')
| Create setup source model test use testcase | Create setup source model test use testcase
| Python | mit | jeanmask/opps,YACOWS/opps,jeanmask/opps,YACOWS/opps,YACOWS/opps,YACOWS/opps,jeanmask/opps,opps/opps,williamroot/opps,opps/opps,opps/opps,jeanmask/opps,williamroot/opps,williamroot/opps,opps/opps,williamroot/opps | Create setup source model test use testcase | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.db import IntegrityError
from django.test import TestCase
from opps.core.models.source import Source
class SourceModelTest(TestCase):
def setUp(self):
self.source = Source.objects.create(name=u'Test site',
slug=u'test-site')
| <commit_before><commit_msg>Create setup source model test use testcase<commit_after> | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.db import IntegrityError
from django.test import TestCase
from opps.core.models.source import Source
class SourceModelTest(TestCase):
def setUp(self):
self.source = Source.objects.create(name=u'Test site',
slug=u'test-site')
| Create setup source model test use testcase#!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.db import IntegrityError
from django.test import TestCase
from opps.core.models.source import Source
class SourceModelTest(TestCase):
def setUp(self):
self.source = Source.objects.create(name=u'Test sit... | <commit_before><commit_msg>Create setup source model test use testcase<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.db import IntegrityError
from django.test import TestCase
from opps.core.models.source import Source
class SourceModelTest(TestCase):
def setUp(self):
self.sourc... | |
aee00af4c8d04825b1f532bcac096c0f4e245fbd | samples/util/test.py | samples/util/test.py | # coding: utf-8
import os
import shutil
import cv2
def delete_and_make_directory(dir_path='./image_dir/'):
# Delete the entire directory tree if it exists.
if os.path.exists(dir_path):
shutil.rmtree(dir_path)
# Make the directory if it doesn't exist.
if not os.path.exists(dir_path):
os.makedirs(dir_path)... | Add util directory and a code | Add util directory and a code
| Python | mit | iShoto/testpy | Add util directory and a code | # coding: utf-8
import os
import shutil
import cv2
def delete_and_make_directory(dir_path='./image_dir/'):
# Delete the entire directory tree if it exists.
if os.path.exists(dir_path):
shutil.rmtree(dir_path)
# Make the directory if it doesn't exist.
if not os.path.exists(dir_path):
os.makedirs(dir_path)... | <commit_before><commit_msg>Add util directory and a code<commit_after> | # coding: utf-8
import os
import shutil
import cv2
def delete_and_make_directory(dir_path='./image_dir/'):
# Delete the entire directory tree if it exists.
if os.path.exists(dir_path):
shutil.rmtree(dir_path)
# Make the directory if it doesn't exist.
if not os.path.exists(dir_path):
os.makedirs(dir_path)... | Add util directory and a code# coding: utf-8
import os
import shutil
import cv2
def delete_and_make_directory(dir_path='./image_dir/'):
# Delete the entire directory tree if it exists.
if os.path.exists(dir_path):
shutil.rmtree(dir_path)
# Make the directory if it doesn't exist.
if not os.path.exists(dir_p... | <commit_before><commit_msg>Add util directory and a code<commit_after># coding: utf-8
import os
import shutil
import cv2
def delete_and_make_directory(dir_path='./image_dir/'):
# Delete the entire directory tree if it exists.
if os.path.exists(dir_path):
shutil.rmtree(dir_path)
# Make the directory if it do... | |
d1ee4b6d30f40653588bc5fc1b287e770457a79e | filters/remove-strong.py | filters/remove-strong.py | """
Convert strong text to normal text
EXAMPLE:
>>>> echo Lorem **ip sum** example | pandoc -F remove-strong.py
<p>Lorem ip sum example</p>
"""
import panflute as pf
def action(elem, doc):
if isinstance(elem, pf.Strong):
return list(elem.content)
#return elem.content.list
#return... | Add example that removes bold text | Add example that removes bold text
| Python | bsd-3-clause | sergiocorreia/panflute-filters | Add example that removes bold text | """
Convert strong text to normal text
EXAMPLE:
>>>> echo Lorem **ip sum** example | pandoc -F remove-strong.py
<p>Lorem ip sum example</p>
"""
import panflute as pf
def action(elem, doc):
if isinstance(elem, pf.Strong):
return list(elem.content)
#return elem.content.list
#return... | <commit_before><commit_msg>Add example that removes bold text<commit_after> | """
Convert strong text to normal text
EXAMPLE:
>>>> echo Lorem **ip sum** example | pandoc -F remove-strong.py
<p>Lorem ip sum example</p>
"""
import panflute as pf
def action(elem, doc):
if isinstance(elem, pf.Strong):
return list(elem.content)
#return elem.content.list
#return... | Add example that removes bold text"""
Convert strong text to normal text
EXAMPLE:
>>>> echo Lorem **ip sum** example | pandoc -F remove-strong.py
<p>Lorem ip sum example</p>
"""
import panflute as pf
def action(elem, doc):
if isinstance(elem, pf.Strong):
return list(elem.content)
#return... | <commit_before><commit_msg>Add example that removes bold text<commit_after>"""
Convert strong text to normal text
EXAMPLE:
>>>> echo Lorem **ip sum** example | pandoc -F remove-strong.py
<p>Lorem ip sum example</p>
"""
import panflute as pf
def action(elem, doc):
if isinstance(elem, pf.Strong):
... | |
32590cf52bfc699d9e003a5f64c125d9f232c141 | vumi/middleware/tests/test_address_translator.py | vumi/middleware/tests/test_address_translator.py | """Tests from vumi.middleware.address_translator."""
from twisted.trial.unittest import TestCase
from vumi.middleware.address_translator import AddressTranslationMiddleware
class AddressTranslationMiddlewareTestCase(TestCase):
def mk_addr_trans(self, outbound_map):
worker = object()
config = {'... | Add test for address translation middleware. | Add test for address translation middleware.
| Python | bsd-3-clause | vishwaprakashmishra/xmatrix,TouK/vumi,vishwaprakashmishra/xmatrix,TouK/vumi,vishwaprakashmishra/xmatrix,harrissoerja/vumi,TouK/vumi,harrissoerja/vumi,harrissoerja/vumi | Add test for address translation middleware. | """Tests from vumi.middleware.address_translator."""
from twisted.trial.unittest import TestCase
from vumi.middleware.address_translator import AddressTranslationMiddleware
class AddressTranslationMiddlewareTestCase(TestCase):
def mk_addr_trans(self, outbound_map):
worker = object()
config = {'... | <commit_before><commit_msg>Add test for address translation middleware.<commit_after> | """Tests from vumi.middleware.address_translator."""
from twisted.trial.unittest import TestCase
from vumi.middleware.address_translator import AddressTranslationMiddleware
class AddressTranslationMiddlewareTestCase(TestCase):
def mk_addr_trans(self, outbound_map):
worker = object()
config = {'... | Add test for address translation middleware."""Tests from vumi.middleware.address_translator."""
from twisted.trial.unittest import TestCase
from vumi.middleware.address_translator import AddressTranslationMiddleware
class AddressTranslationMiddlewareTestCase(TestCase):
def mk_addr_trans(self, outbound_map):
... | <commit_before><commit_msg>Add test for address translation middleware.<commit_after>"""Tests from vumi.middleware.address_translator."""
from twisted.trial.unittest import TestCase
from vumi.middleware.address_translator import AddressTranslationMiddleware
class AddressTranslationMiddlewareTestCase(TestCase):
... | |
885ec3ddcdb49f4f913c8c7230fc7613290ee5bb | python/rename_files.py | python/rename_files.py | # coding: utf-8
import argparse
import os
import re
import shutil
def rename_files_in_dir(directory, live_run=False):
if not live_run:
print("Performing dry run...")
files = [f for f in os.listdir(directory) if os.path.isfile(f)]
for old_path in files:
new_path = re.sub('[^0-9a-... | Add conservative rename Python script | Add conservative rename Python script
| Python | mit | joshsziegler/dotfiles,joshsziegler/dotfiles | Add conservative rename Python script | # coding: utf-8
import argparse
import os
import re
import shutil
def rename_files_in_dir(directory, live_run=False):
if not live_run:
print("Performing dry run...")
files = [f for f in os.listdir(directory) if os.path.isfile(f)]
for old_path in files:
new_path = re.sub('[^0-9a-... | <commit_before><commit_msg>Add conservative rename Python script<commit_after> | # coding: utf-8
import argparse
import os
import re
import shutil
def rename_files_in_dir(directory, live_run=False):
if not live_run:
print("Performing dry run...")
files = [f for f in os.listdir(directory) if os.path.isfile(f)]
for old_path in files:
new_path = re.sub('[^0-9a-... | Add conservative rename Python script# coding: utf-8
import argparse
import os
import re
import shutil
def rename_files_in_dir(directory, live_run=False):
if not live_run:
print("Performing dry run...")
files = [f for f in os.listdir(directory) if os.path.isfile(f)]
for old_path in file... | <commit_before><commit_msg>Add conservative rename Python script<commit_after># coding: utf-8
import argparse
import os
import re
import shutil
def rename_files_in_dir(directory, live_run=False):
if not live_run:
print("Performing dry run...")
files = [f for f in os.listdir(directory) if os.... | |
e5586830fc2afb655e52563f29fa1f4271c836be | indra/resources/ontology_graph.py | indra/resources/ontology_graph.py | import networkx
from indra.databases import hgnc_client
from indra.databases import uniprot_client
from indra.databases import chebi_client
from indra.databases import mesh_client
class IndraOntology(networkx.MultiDiGraph):
def __init__(self):
super().__init__()
self.add_hgnc_nodes()
self.... | Add initial implementation of ontology graph | Add initial implementation of ontology graph
| Python | bsd-2-clause | sorgerlab/belpy,johnbachman/belpy,bgyori/indra,sorgerlab/belpy,johnbachman/indra,sorgerlab/indra,johnbachman/indra,sorgerlab/indra,bgyori/indra,sorgerlab/belpy,bgyori/indra,johnbachman/belpy,sorgerlab/indra,johnbachman/indra,johnbachman/belpy | Add initial implementation of ontology graph | import networkx
from indra.databases import hgnc_client
from indra.databases import uniprot_client
from indra.databases import chebi_client
from indra.databases import mesh_client
class IndraOntology(networkx.MultiDiGraph):
def __init__(self):
super().__init__()
self.add_hgnc_nodes()
self.... | <commit_before><commit_msg>Add initial implementation of ontology graph<commit_after> | import networkx
from indra.databases import hgnc_client
from indra.databases import uniprot_client
from indra.databases import chebi_client
from indra.databases import mesh_client
class IndraOntology(networkx.MultiDiGraph):
def __init__(self):
super().__init__()
self.add_hgnc_nodes()
self.... | Add initial implementation of ontology graphimport networkx
from indra.databases import hgnc_client
from indra.databases import uniprot_client
from indra.databases import chebi_client
from indra.databases import mesh_client
class IndraOntology(networkx.MultiDiGraph):
def __init__(self):
super().__init__()... | <commit_before><commit_msg>Add initial implementation of ontology graph<commit_after>import networkx
from indra.databases import hgnc_client
from indra.databases import uniprot_client
from indra.databases import chebi_client
from indra.databases import mesh_client
class IndraOntology(networkx.MultiDiGraph):
def _... | |
8b03ba1940a2e234d09d03ccd40cf43e5060d2b1 | indra/sources/bbn/make_bbn_tsv.py | indra/sources/bbn/make_bbn_tsv.py | """This script produces a TSV that help map the BBN ontology
to the Eidos UN ontology based on entries and examples."""
import yaml
import requests
from indra.sources import bbn
def build_examples(node, tree, prefix):
if not prefix or prefix in ('entity', 'event'):
this_prefix = node
else:
t... | Add script to generate BBN TSV | Add script to generate BBN TSV
| Python | bsd-2-clause | pvtodorov/indra,sorgerlab/indra,sorgerlab/indra,johnbachman/belpy,sorgerlab/indra,johnbachman/indra,johnbachman/indra,sorgerlab/belpy,sorgerlab/belpy,pvtodorov/indra,johnbachman/belpy,sorgerlab/belpy,bgyori/indra,bgyori/indra,bgyori/indra,pvtodorov/indra,johnbachman/belpy,pvtodorov/indra,johnbachman/indra | Add script to generate BBN TSV | """This script produces a TSV that help map the BBN ontology
to the Eidos UN ontology based on entries and examples."""
import yaml
import requests
from indra.sources import bbn
def build_examples(node, tree, prefix):
if not prefix or prefix in ('entity', 'event'):
this_prefix = node
else:
t... | <commit_before><commit_msg>Add script to generate BBN TSV<commit_after> | """This script produces a TSV that help map the BBN ontology
to the Eidos UN ontology based on entries and examples."""
import yaml
import requests
from indra.sources import bbn
def build_examples(node, tree, prefix):
if not prefix or prefix in ('entity', 'event'):
this_prefix = node
else:
t... | Add script to generate BBN TSV"""This script produces a TSV that help map the BBN ontology
to the Eidos UN ontology based on entries and examples."""
import yaml
import requests
from indra.sources import bbn
def build_examples(node, tree, prefix):
if not prefix or prefix in ('entity', 'event'):
this_pre... | <commit_before><commit_msg>Add script to generate BBN TSV<commit_after>"""This script produces a TSV that help map the BBN ontology
to the Eidos UN ontology based on entries and examples."""
import yaml
import requests
from indra.sources import bbn
def build_examples(node, tree, prefix):
if not prefix or prefix... | |
5b27b3730e779b9d5e4428c069f5c52d2a403d69 | GetToken.py | GetToken.py | #!/usr/bin/env python
import getpass
import sys
from optparse import OptionParser
try:
from ZSI.client import AUTH
except ImportError:
print '==> Failed to import ZSI'
print '===> Please make sure you have it installed and locatable from PYTHONPATH'
print ' http://pywebsvcs.sourceforge.net/'
... | Add a basic module and command-line tool for generating tokens | Add a basic module and command-line tool for generating tokens
Signed-off-by: R. Tyler Ballance <[email protected]>
| Python | bsd-3-clause | rtyler/pyve | Add a basic module and command-line tool for generating tokens
Signed-off-by: R. Tyler Ballance <[email protected]> | #!/usr/bin/env python
import getpass
import sys
from optparse import OptionParser
try:
from ZSI.client import AUTH
except ImportError:
print '==> Failed to import ZSI'
print '===> Please make sure you have it installed and locatable from PYTHONPATH'
print ' http://pywebsvcs.sourceforge.net/'
... | <commit_before><commit_msg>Add a basic module and command-line tool for generating tokens
Signed-off-by: R. Tyler Ballance <[email protected]><commit_after> | #!/usr/bin/env python
import getpass
import sys
from optparse import OptionParser
try:
from ZSI.client import AUTH
except ImportError:
print '==> Failed to import ZSI'
print '===> Please make sure you have it installed and locatable from PYTHONPATH'
print ' http://pywebsvcs.sourceforge.net/'
... | Add a basic module and command-line tool for generating tokens
Signed-off-by: R. Tyler Ballance <[email protected]>#!/usr/bin/env python
import getpass
import sys
from optparse import OptionParser
try:
from ZSI.client import AUTH
except ImportError:
print '==> Failed to impo... | <commit_before><commit_msg>Add a basic module and command-line tool for generating tokens
Signed-off-by: R. Tyler Ballance <[email protected]><commit_after>#!/usr/bin/env python
import getpass
import sys
from optparse import OptionParser
try:
from ZSI.client import AUTH
except I... | |
1f5e9b39f9942be0a6b64d1e05283415ad839e47 | grammpy/IsMethodsRuleExtension.py | grammpy/IsMethodsRuleExtension.py | #!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 23.06.2017 16:39
:Licence GNUv3
Part of grammpy
"""
from .Rule import Rule
class IsMethodsRuleExtension(Rule):
@classmethod
def is_regular(cls):
return False
@classmethod
def is_contextfree(cls):
return False
@classmeth... | Add is_* methods from old commit | Add is_* methods from old commit
| Python | mit | PatrikValkovic/grammpy | Add is_* methods from old commit | #!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 23.06.2017 16:39
:Licence GNUv3
Part of grammpy
"""
from .Rule import Rule
class IsMethodsRuleExtension(Rule):
@classmethod
def is_regular(cls):
return False
@classmethod
def is_contextfree(cls):
return False
@classmeth... | <commit_before><commit_msg>Add is_* methods from old commit<commit_after> | #!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 23.06.2017 16:39
:Licence GNUv3
Part of grammpy
"""
from .Rule import Rule
class IsMethodsRuleExtension(Rule):
@classmethod
def is_regular(cls):
return False
@classmethod
def is_contextfree(cls):
return False
@classmeth... | Add is_* methods from old commit#!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 23.06.2017 16:39
:Licence GNUv3
Part of grammpy
"""
from .Rule import Rule
class IsMethodsRuleExtension(Rule):
@classmethod
def is_regular(cls):
return False
@classmethod
def is_contextfree(cls):
... | <commit_before><commit_msg>Add is_* methods from old commit<commit_after>#!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 23.06.2017 16:39
:Licence GNUv3
Part of grammpy
"""
from .Rule import Rule
class IsMethodsRuleExtension(Rule):
@classmethod
def is_regular(cls):
return False
@clas... | |
1343cbf191e1a665323c6e3a49dda15e5e65ad6b | presentationsapp/urls.py | presentationsapp/urls.py | from django.conf.urls import patterns, url
from presentationsapp import views
urlpatterns = patterns('',
#url(r'^(?P<course_id>[0-9]+)/$', views.courseDetails),
url(r'^$', views.index),
)
| Add URL routing to first view | Add URL routing to first view
| Python | mit | masonsbro/presentations | Add URL routing to first view | from django.conf.urls import patterns, url
from presentationsapp import views
urlpatterns = patterns('',
#url(r'^(?P<course_id>[0-9]+)/$', views.courseDetails),
url(r'^$', views.index),
)
| <commit_before><commit_msg>Add URL routing to first view<commit_after> | from django.conf.urls import patterns, url
from presentationsapp import views
urlpatterns = patterns('',
#url(r'^(?P<course_id>[0-9]+)/$', views.courseDetails),
url(r'^$', views.index),
)
| Add URL routing to first viewfrom django.conf.urls import patterns, url
from presentationsapp import views
urlpatterns = patterns('',
#url(r'^(?P<course_id>[0-9]+)/$', views.courseDetails),
url(r'^$', views.index),
)
| <commit_before><commit_msg>Add URL routing to first view<commit_after>from django.conf.urls import patterns, url
from presentationsapp import views
urlpatterns = patterns('',
#url(r'^(?P<course_id>[0-9]+)/$', views.courseDetails),
url(r'^$', views.index),
)
| |
e69c2f715093b7eda4a20a26e84af963fb5af9cf | regulations/tests/tasks_tests.py | regulations/tests/tasks_tests.py | import json
import mock
import six
from celery.exceptions import Retry, MaxRetriesExceededError
from requests.exceptions import RequestException
from django.test import SimpleTestCase, override_settings
from regulations.tasks import submit_comment
@mock.patch('regulations.models.FailedCommentSubmission.objects')
@m... | Add unit tests for the submit_comment task | Add unit tests for the submit_comment task
| Python | cc0-1.0 | 18F/regulations-site,eregs/regulations-site,eregs/regulations-site,eregs/regulations-site,tadhg-ohiggins/regulations-site,eregs/regulations-site,18F/regulations-site,tadhg-ohiggins/regulations-site,tadhg-ohiggins/regulations-site,18F/regulations-site,18F/regulations-site,tadhg-ohiggins/regulations-site | Add unit tests for the submit_comment task | import json
import mock
import six
from celery.exceptions import Retry, MaxRetriesExceededError
from requests.exceptions import RequestException
from django.test import SimpleTestCase, override_settings
from regulations.tasks import submit_comment
@mock.patch('regulations.models.FailedCommentSubmission.objects')
@m... | <commit_before><commit_msg>Add unit tests for the submit_comment task<commit_after> | import json
import mock
import six
from celery.exceptions import Retry, MaxRetriesExceededError
from requests.exceptions import RequestException
from django.test import SimpleTestCase, override_settings
from regulations.tasks import submit_comment
@mock.patch('regulations.models.FailedCommentSubmission.objects')
@m... | Add unit tests for the submit_comment taskimport json
import mock
import six
from celery.exceptions import Retry, MaxRetriesExceededError
from requests.exceptions import RequestException
from django.test import SimpleTestCase, override_settings
from regulations.tasks import submit_comment
@mock.patch('regulations.m... | <commit_before><commit_msg>Add unit tests for the submit_comment task<commit_after>import json
import mock
import six
from celery.exceptions import Retry, MaxRetriesExceededError
from requests.exceptions import RequestException
from django.test import SimpleTestCase, override_settings
from regulations.tasks import su... | |
40ad6b1dbdc715aa0e4dfdff4bd689bbe795561b | test_mccabe.py | test_mccabe.py | import unittest
import sys
try:
from StringIO import StringIO
except ImportError:
from io import StringIO
from mccabe import get_code_complexity
_GLOBAL = """\
for i in range(10):
pass
def a():
def b():
def c():
pass
c()
b()
"""
class McCabeTest(unittest.TestCase)... | Add simple test for McCabe checker | Add simple test for McCabe checker
| Python | mit | flintwork/mccabe,sigmavirus24/mccabe | Add simple test for McCabe checker | import unittest
import sys
try:
from StringIO import StringIO
except ImportError:
from io import StringIO
from mccabe import get_code_complexity
_GLOBAL = """\
for i in range(10):
pass
def a():
def b():
def c():
pass
c()
b()
"""
class McCabeTest(unittest.TestCase)... | <commit_before><commit_msg>Add simple test for McCabe checker<commit_after> | import unittest
import sys
try:
from StringIO import StringIO
except ImportError:
from io import StringIO
from mccabe import get_code_complexity
_GLOBAL = """\
for i in range(10):
pass
def a():
def b():
def c():
pass
c()
b()
"""
class McCabeTest(unittest.TestCase)... | Add simple test for McCabe checkerimport unittest
import sys
try:
from StringIO import StringIO
except ImportError:
from io import StringIO
from mccabe import get_code_complexity
_GLOBAL = """\
for i in range(10):
pass
def a():
def b():
def c():
pass
c()
b()
"""
c... | <commit_before><commit_msg>Add simple test for McCabe checker<commit_after>import unittest
import sys
try:
from StringIO import StringIO
except ImportError:
from io import StringIO
from mccabe import get_code_complexity
_GLOBAL = """\
for i in range(10):
pass
def a():
def b():
def c():
... | |
0c3c8a84f8c0bce983e8fe0951dd26314951142c | bin/switch-country.py | bin/switch-country.py | #!/usr/bin/env python
# coding=UTF-8
import os
from os.path import dirname, join, normpath, realpath
import sys
script_directory = dirname(realpath(sys.argv[0]))
root_directory = join(script_directory, '..')
root_directory = normpath(root_directory)
election_options = [
e for e in os.listdir(join(root_directory,... | Add a script to make it easier to switch between elections | Add a script to make it easier to switch between elections
| Python | agpl-3.0 | mysociety/yournextrepresentative,neavouli/yournextrepresentative,datamade/yournextmp-popit,mysociety/yournextmp-popit,DemocracyClub/yournextrepresentative,neavouli/yournextrepresentative,openstate/yournextrepresentative,mysociety/yournextrepresentative,openstate/yournextrepresentative,neavouli/yournextrepresentative,my... | Add a script to make it easier to switch between elections | #!/usr/bin/env python
# coding=UTF-8
import os
from os.path import dirname, join, normpath, realpath
import sys
script_directory = dirname(realpath(sys.argv[0]))
root_directory = join(script_directory, '..')
root_directory = normpath(root_directory)
election_options = [
e for e in os.listdir(join(root_directory,... | <commit_before><commit_msg>Add a script to make it easier to switch between elections<commit_after> | #!/usr/bin/env python
# coding=UTF-8
import os
from os.path import dirname, join, normpath, realpath
import sys
script_directory = dirname(realpath(sys.argv[0]))
root_directory = join(script_directory, '..')
root_directory = normpath(root_directory)
election_options = [
e for e in os.listdir(join(root_directory,... | Add a script to make it easier to switch between elections#!/usr/bin/env python
# coding=UTF-8
import os
from os.path import dirname, join, normpath, realpath
import sys
script_directory = dirname(realpath(sys.argv[0]))
root_directory = join(script_directory, '..')
root_directory = normpath(root_directory)
election_... | <commit_before><commit_msg>Add a script to make it easier to switch between elections<commit_after>#!/usr/bin/env python
# coding=UTF-8
import os
from os.path import dirname, join, normpath, realpath
import sys
script_directory = dirname(realpath(sys.argv[0]))
root_directory = join(script_directory, '..')
root_direct... | |
2ac80e13e983ee102a475a3c4e7783d38b2f8603 | cptm/experiment_prune_samples.py | cptm/experiment_prune_samples.py | import logging
import argparse
from os import remove
from cptm.utils.experiment import load_config, get_corpus, get_sampler
logger = logging.getLogger(__name__)
logging.basicConfig(format='%(levelname)s : %(message)s', level=logging.INFO)
logging.getLogger('gensim').setLevel(logging.ERROR)
logging.getLogger('CPTCor... | Add script to prune parameter sample files | Add script to prune parameter sample files
The parameter sample files for a decent experiment take up a lot of
space. Because don't need all of them, we remove 90%.
| Python | apache-2.0 | NLeSC/cptm,NLeSC/cptm | Add script to prune parameter sample files
The parameter sample files for a decent experiment take up a lot of
space. Because don't need all of them, we remove 90%. | import logging
import argparse
from os import remove
from cptm.utils.experiment import load_config, get_corpus, get_sampler
logger = logging.getLogger(__name__)
logging.basicConfig(format='%(levelname)s : %(message)s', level=logging.INFO)
logging.getLogger('gensim').setLevel(logging.ERROR)
logging.getLogger('CPTCor... | <commit_before><commit_msg>Add script to prune parameter sample files
The parameter sample files for a decent experiment take up a lot of
space. Because don't need all of them, we remove 90%.<commit_after> | import logging
import argparse
from os import remove
from cptm.utils.experiment import load_config, get_corpus, get_sampler
logger = logging.getLogger(__name__)
logging.basicConfig(format='%(levelname)s : %(message)s', level=logging.INFO)
logging.getLogger('gensim').setLevel(logging.ERROR)
logging.getLogger('CPTCor... | Add script to prune parameter sample files
The parameter sample files for a decent experiment take up a lot of
space. Because don't need all of them, we remove 90%.import logging
import argparse
from os import remove
from cptm.utils.experiment import load_config, get_corpus, get_sampler
logger = logging.getLogger(_... | <commit_before><commit_msg>Add script to prune parameter sample files
The parameter sample files for a decent experiment take up a lot of
space. Because don't need all of them, we remove 90%.<commit_after>import logging
import argparse
from os import remove
from cptm.utils.experiment import load_config, get_corpus, g... | |
6a90a4b27c3166b3b4d9f79791b511b9f403a682 | zerver/migrations/0416_set_default_emoji_style.py | zerver/migrations/0416_set_default_emoji_style.py | from django.db import migrations
from django.db.backends.postgresql.schema import BaseDatabaseSchemaEditor
from django.db.migrations.state import StateApps
def update_deprecated_emoji_style(apps: StateApps, schema_editor: BaseDatabaseSchemaEditor) -> None:
"""
This migration updates the emoji style for users ... | Switch users with blob emoji to use Google style. | emoji: Switch users with blob emoji to use Google style.
| Python | apache-2.0 | zulip/zulip,zulip/zulip,zulip/zulip,zulip/zulip,zulip/zulip,zulip/zulip,zulip/zulip | emoji: Switch users with blob emoji to use Google style. | from django.db import migrations
from django.db.backends.postgresql.schema import BaseDatabaseSchemaEditor
from django.db.migrations.state import StateApps
def update_deprecated_emoji_style(apps: StateApps, schema_editor: BaseDatabaseSchemaEditor) -> None:
"""
This migration updates the emoji style for users ... | <commit_before><commit_msg>emoji: Switch users with blob emoji to use Google style.<commit_after> | from django.db import migrations
from django.db.backends.postgresql.schema import BaseDatabaseSchemaEditor
from django.db.migrations.state import StateApps
def update_deprecated_emoji_style(apps: StateApps, schema_editor: BaseDatabaseSchemaEditor) -> None:
"""
This migration updates the emoji style for users ... | emoji: Switch users with blob emoji to use Google style.from django.db import migrations
from django.db.backends.postgresql.schema import BaseDatabaseSchemaEditor
from django.db.migrations.state import StateApps
def update_deprecated_emoji_style(apps: StateApps, schema_editor: BaseDatabaseSchemaEditor) -> None:
"... | <commit_before><commit_msg>emoji: Switch users with blob emoji to use Google style.<commit_after>from django.db import migrations
from django.db.backends.postgresql.schema import BaseDatabaseSchemaEditor
from django.db.migrations.state import StateApps
def update_deprecated_emoji_style(apps: StateApps, schema_editor:... | |
785f4bf4ca47fff6e955dc0894fd5a7ca744a201 | scrapy_cdr/es_download_hashes.py | scrapy_cdr/es_download_hashes.py | import argparse
import csv
import hashlib
import elasticsearch
from elasticsearch_dsl import Search
import tqdm
from w3lib.url import canonicalize_url
def main():
parser = argparse.ArgumentParser(
description='Download item hashes from ES index')
arg = parser.add_argument
arg('output', help='outp... | Add a script that downloads content hashes | Add a script that downloads content hashes
| Python | mit | TeamHG-Memex/scrapy-cdr | Add a script that downloads content hashes | import argparse
import csv
import hashlib
import elasticsearch
from elasticsearch_dsl import Search
import tqdm
from w3lib.url import canonicalize_url
def main():
parser = argparse.ArgumentParser(
description='Download item hashes from ES index')
arg = parser.add_argument
arg('output', help='outp... | <commit_before><commit_msg>Add a script that downloads content hashes<commit_after> | import argparse
import csv
import hashlib
import elasticsearch
from elasticsearch_dsl import Search
import tqdm
from w3lib.url import canonicalize_url
def main():
parser = argparse.ArgumentParser(
description='Download item hashes from ES index')
arg = parser.add_argument
arg('output', help='outp... | Add a script that downloads content hashesimport argparse
import csv
import hashlib
import elasticsearch
from elasticsearch_dsl import Search
import tqdm
from w3lib.url import canonicalize_url
def main():
parser = argparse.ArgumentParser(
description='Download item hashes from ES index')
arg = parser... | <commit_before><commit_msg>Add a script that downloads content hashes<commit_after>import argparse
import csv
import hashlib
import elasticsearch
from elasticsearch_dsl import Search
import tqdm
from w3lib.url import canonicalize_url
def main():
parser = argparse.ArgumentParser(
description='Download ite... | |
d41f777032f05e63c16b18bc74cb5a3d59b0ad82 | ui/gfx/compositor/PRESUBMIT.py | ui/gfx/compositor/PRESUBMIT.py | # Copyright (c) 2011 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.
"""Chromium presubmit script for src/chrome/browser/externsions.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more de... | Add aura compile testing by default to likely areas (2). | Add aura compile testing by default to likely areas (2).
BUG=chromium:107599
TEST=None
Review URL: http://codereview.chromium.org/8907045
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@114850 0039d316-1c4b-4281-b951-d872f2087c98
| Python | bsd-3-clause | gavinp/chromium,adobe/chromium,gavinp/chromium,yitian134/chromium,ropik/chromium,adobe/chromium,ropik/chromium,yitian134/chromium,gavinp/chromium,ropik/chromium,adobe/chromium,ropik/chromium,adobe/chromium,gavinp/chromium,ropik/chromium,yitian134/chromium,yitian134/chromium,yitian134/chromium,adobe/chromium,gavinp/chro... | Add aura compile testing by default to likely areas (2).
BUG=chromium:107599
TEST=None
Review URL: http://codereview.chromium.org/8907045
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@114850 0039d316-1c4b-4281-b951-d872f2087c98 | # Copyright (c) 2011 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.
"""Chromium presubmit script for src/chrome/browser/externsions.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more de... | <commit_before><commit_msg>Add aura compile testing by default to likely areas (2).
BUG=chromium:107599
TEST=None
Review URL: http://codereview.chromium.org/8907045
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@114850 0039d316-1c4b-4281-b951-d872f2087c98<commit_after> | # Copyright (c) 2011 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.
"""Chromium presubmit script for src/chrome/browser/externsions.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more de... | Add aura compile testing by default to likely areas (2).
BUG=chromium:107599
TEST=None
Review URL: http://codereview.chromium.org/8907045
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@114850 0039d316-1c4b-4281-b951-d872f2087c98# Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this sourc... | <commit_before><commit_msg>Add aura compile testing by default to likely areas (2).
BUG=chromium:107599
TEST=None
Review URL: http://codereview.chromium.org/8907045
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@114850 0039d316-1c4b-4281-b951-d872f2087c98<commit_after># Copyright (c) 2011 The Chromium Authors.... | |
9bdd3f7aea307fb72ab4999e28b56bd4ce7f46d2 | app/initial_tables.py | app/initial_tables.py | from tables import engine
def create_tables():
"""
Create tables the lazy way... with raw SQL.
"""
conn = engine.raw_connection()
cur = conn.cursor()
cur.execute(
"""
CREATE TABLE file_upload(
document_name TEXT
, time_uploaded TEXT DEFAULT now()
, filename TEXT NOT NULL
, word_... | Add module to create initial tables | Add module to create initial tables
| Python | mit | sprin/heroku-tut | Add module to create initial tables | from tables import engine
def create_tables():
"""
Create tables the lazy way... with raw SQL.
"""
conn = engine.raw_connection()
cur = conn.cursor()
cur.execute(
"""
CREATE TABLE file_upload(
document_name TEXT
, time_uploaded TEXT DEFAULT now()
, filename TEXT NOT NULL
, word_... | <commit_before><commit_msg>Add module to create initial tables<commit_after> | from tables import engine
def create_tables():
"""
Create tables the lazy way... with raw SQL.
"""
conn = engine.raw_connection()
cur = conn.cursor()
cur.execute(
"""
CREATE TABLE file_upload(
document_name TEXT
, time_uploaded TEXT DEFAULT now()
, filename TEXT NOT NULL
, word_... | Add module to create initial tablesfrom tables import engine
def create_tables():
"""
Create tables the lazy way... with raw SQL.
"""
conn = engine.raw_connection()
cur = conn.cursor()
cur.execute(
"""
CREATE TABLE file_upload(
document_name TEXT
, time_uploaded TEXT DEFAULT now()
,... | <commit_before><commit_msg>Add module to create initial tables<commit_after>from tables import engine
def create_tables():
"""
Create tables the lazy way... with raw SQL.
"""
conn = engine.raw_connection()
cur = conn.cursor()
cur.execute(
"""
CREATE TABLE file_upload(
document_name TEXT
... | |
54118be673602e7936a566d16185ed311e700ac2 | scripts/msvs_projects.py | scripts/msvs_projects.py | #!/usr/bin/python
#
# Copyright 2017 The ANGLE Project Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
# msvs_projects.py:
# A helper utility that generates Visual Studio projects for each of
# the available directories in 'out', ... | Add script to generate GN/MSVS projects. | Add script to generate GN/MSVS projects.
BUG=angleproject:1569
Change-Id: I0e47720d17cd1a29603e471482cac31d4c281ee5
Reviewed-on: https://chromium-review.googlesource.com/735059
Reviewed-by: Geoff Lang <[email protected]>
Commit-Queue: Jamie Madill <7e492b4f1c8458024932de3ba475cbf01... | Python | bsd-3-clause | ppy/angle,ppy/angle,ppy/angle,ppy/angle | Add script to generate GN/MSVS projects.
BUG=angleproject:1569
Change-Id: I0e47720d17cd1a29603e471482cac31d4c281ee5
Reviewed-on: https://chromium-review.googlesource.com/735059
Reviewed-by: Geoff Lang <[email protected]>
Commit-Queue: Jamie Madill <7e492b4f1c8458024932de3ba475cbf01... | #!/usr/bin/python
#
# Copyright 2017 The ANGLE Project Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
# msvs_projects.py:
# A helper utility that generates Visual Studio projects for each of
# the available directories in 'out', ... | <commit_before><commit_msg>Add script to generate GN/MSVS projects.
BUG=angleproject:1569
Change-Id: I0e47720d17cd1a29603e471482cac31d4c281ee5
Reviewed-on: https://chromium-review.googlesource.com/735059
Reviewed-by: Geoff Lang <[email protected]>
Commit-Queue: Jamie Madill <7e492b... | #!/usr/bin/python
#
# Copyright 2017 The ANGLE Project Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
# msvs_projects.py:
# A helper utility that generates Visual Studio projects for each of
# the available directories in 'out', ... | Add script to generate GN/MSVS projects.
BUG=angleproject:1569
Change-Id: I0e47720d17cd1a29603e471482cac31d4c281ee5
Reviewed-on: https://chromium-review.googlesource.com/735059
Reviewed-by: Geoff Lang <[email protected]>
Commit-Queue: Jamie Madill <7e492b4f1c8458024932de3ba475cbf01... | <commit_before><commit_msg>Add script to generate GN/MSVS projects.
BUG=angleproject:1569
Change-Id: I0e47720d17cd1a29603e471482cac31d4c281ee5
Reviewed-on: https://chromium-review.googlesource.com/735059
Reviewed-by: Geoff Lang <[email protected]>
Commit-Queue: Jamie Madill <7e492b... | |
2262e07f8e15879657409ff2b29696d128a2172c | python/image-tools/remove-all-exif-data.py | python/image-tools/remove-all-exif-data.py | #!/usr/bin/env python
import sys
# sudo pip3 install piexif
import piexif
if len(sys.argv) < 2:
sys.stderr.write('ERROR: Must provide a file to remove EXIF tags from\n')
sys.exit('Usage: {} FILE'.format(sys.argv[0]))
piexif.remove(sys.argv[1])
| Add script to remove all EXIF data from an image | Add script to remove all EXIF data from an image
| Python | mit | bmaupin/junkpile,bmaupin/junkpile,bmaupin/junkpile,bmaupin/junkpile,bmaupin/junkpile,bmaupin/junkpile,bmaupin/junkpile,bmaupin/junkpile,bmaupin/junkpile | Add script to remove all EXIF data from an image | #!/usr/bin/env python
import sys
# sudo pip3 install piexif
import piexif
if len(sys.argv) < 2:
sys.stderr.write('ERROR: Must provide a file to remove EXIF tags from\n')
sys.exit('Usage: {} FILE'.format(sys.argv[0]))
piexif.remove(sys.argv[1])
| <commit_before><commit_msg>Add script to remove all EXIF data from an image<commit_after> | #!/usr/bin/env python
import sys
# sudo pip3 install piexif
import piexif
if len(sys.argv) < 2:
sys.stderr.write('ERROR: Must provide a file to remove EXIF tags from\n')
sys.exit('Usage: {} FILE'.format(sys.argv[0]))
piexif.remove(sys.argv[1])
| Add script to remove all EXIF data from an image#!/usr/bin/env python
import sys
# sudo pip3 install piexif
import piexif
if len(sys.argv) < 2:
sys.stderr.write('ERROR: Must provide a file to remove EXIF tags from\n')
sys.exit('Usage: {} FILE'.format(sys.argv[0]))
piexif.remove(sys.argv[1])
| <commit_before><commit_msg>Add script to remove all EXIF data from an image<commit_after>#!/usr/bin/env python
import sys
# sudo pip3 install piexif
import piexif
if len(sys.argv) < 2:
sys.stderr.write('ERROR: Must provide a file to remove EXIF tags from\n')
sys.exit('Usage: {} FILE'.format(sys.argv[0]))
pi... | |
df1d517fbd3dbd921ff50b64d95869ad8605d43a | proselint/checks/garner/sexism.py | proselint/checks/garner/sexism.py | # -*- coding: utf-8 -*-
"""MAU103: Sexism.
---
layout: post
error_code: MAU103
source: Garner's Modern American Usage
source_url: http://amzn.to/15wF76r
title: sexism
date: 2014-06-10 12:31:19
categories: writing
---
Points out sexist language.
"""
from proselint.tools import memoize, preferred_fo... | Add rule on sexist language | Add rule on sexist language
#51
| Python | bsd-3-clause | amperser/proselint,jstewmon/proselint,amperser/proselint,jstewmon/proselint,amperser/proselint,jstewmon/proselint,amperser/proselint,amperser/proselint | Add rule on sexist language
#51 | # -*- coding: utf-8 -*-
"""MAU103: Sexism.
---
layout: post
error_code: MAU103
source: Garner's Modern American Usage
source_url: http://amzn.to/15wF76r
title: sexism
date: 2014-06-10 12:31:19
categories: writing
---
Points out sexist language.
"""
from proselint.tools import memoize, preferred_fo... | <commit_before><commit_msg>Add rule on sexist language
#51<commit_after> | # -*- coding: utf-8 -*-
"""MAU103: Sexism.
---
layout: post
error_code: MAU103
source: Garner's Modern American Usage
source_url: http://amzn.to/15wF76r
title: sexism
date: 2014-06-10 12:31:19
categories: writing
---
Points out sexist language.
"""
from proselint.tools import memoize, preferred_fo... | Add rule on sexist language
#51# -*- coding: utf-8 -*-
"""MAU103: Sexism.
---
layout: post
error_code: MAU103
source: Garner's Modern American Usage
source_url: http://amzn.to/15wF76r
title: sexism
date: 2014-06-10 12:31:19
categories: writing
---
Points out sexist language.
"""
from proselint.to... | <commit_before><commit_msg>Add rule on sexist language
#51<commit_after># -*- coding: utf-8 -*-
"""MAU103: Sexism.
---
layout: post
error_code: MAU103
source: Garner's Modern American Usage
source_url: http://amzn.to/15wF76r
title: sexism
date: 2014-06-10 12:31:19
categories: writing
---
Points ou... | |
10327654f40ec443be756cfebf3a51e7f037781b | cleanup-old-kernels.py | cleanup-old-kernels.py | #!/usr/bin/env python
import logging
import re
import os
import shutil
logger = logging.getLogger(__name__)
BOOT_FILE_PREFIXES = (u'initrd', u'System.map', u'vmlinuz', )
def discover_in_dir(directory, file_prefix):
version_pattern = u'(?P<version>[\\w.-]+catalin[\\w.-]*)'
kernel_file_pattern = u'{0}-{1}'.fo... | Add script that deletes previously installed kernels | Add script that deletes previously installed kernels
Only the bootloader needs to be manually adjusted afterwards.
| Python | mit | cataliniacob/misc,cataliniacob/misc | Add script that deletes previously installed kernels
Only the bootloader needs to be manually adjusted afterwards. | #!/usr/bin/env python
import logging
import re
import os
import shutil
logger = logging.getLogger(__name__)
BOOT_FILE_PREFIXES = (u'initrd', u'System.map', u'vmlinuz', )
def discover_in_dir(directory, file_prefix):
version_pattern = u'(?P<version>[\\w.-]+catalin[\\w.-]*)'
kernel_file_pattern = u'{0}-{1}'.fo... | <commit_before><commit_msg>Add script that deletes previously installed kernels
Only the bootloader needs to be manually adjusted afterwards.<commit_after> | #!/usr/bin/env python
import logging
import re
import os
import shutil
logger = logging.getLogger(__name__)
BOOT_FILE_PREFIXES = (u'initrd', u'System.map', u'vmlinuz', )
def discover_in_dir(directory, file_prefix):
version_pattern = u'(?P<version>[\\w.-]+catalin[\\w.-]*)'
kernel_file_pattern = u'{0}-{1}'.fo... | Add script that deletes previously installed kernels
Only the bootloader needs to be manually adjusted afterwards.#!/usr/bin/env python
import logging
import re
import os
import shutil
logger = logging.getLogger(__name__)
BOOT_FILE_PREFIXES = (u'initrd', u'System.map', u'vmlinuz', )
def discover_in_dir(directory, ... | <commit_before><commit_msg>Add script that deletes previously installed kernels
Only the bootloader needs to be manually adjusted afterwards.<commit_after>#!/usr/bin/env python
import logging
import re
import os
import shutil
logger = logging.getLogger(__name__)
BOOT_FILE_PREFIXES = (u'initrd', u'System.map', u'vml... | |
28b621677b3236684303a2145ce347cf053b8bdd | examples/kb_interrupt_handler.py | examples/kb_interrupt_handler.py | # -*- coding: utf-8 -*-
"""
examples.kb_interrupt_handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Handling keyboard interrupt (control+c) with
try-except block.
"""
import random
import time
from yaspin import yaspin
from yaspin.spinners import Spinners
def unpacker():
sp = yaspin(Spinners.simpleDotsScrolling, right=Tr... | Add example for handling keyboard interrupt | Add example for handling keyboard interrupt
| Python | mit | pavdmyt/yaspin | Add example for handling keyboard interrupt | # -*- coding: utf-8 -*-
"""
examples.kb_interrupt_handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Handling keyboard interrupt (control+c) with
try-except block.
"""
import random
import time
from yaspin import yaspin
from yaspin.spinners import Spinners
def unpacker():
sp = yaspin(Spinners.simpleDotsScrolling, right=Tr... | <commit_before><commit_msg>Add example for handling keyboard interrupt<commit_after> | # -*- coding: utf-8 -*-
"""
examples.kb_interrupt_handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Handling keyboard interrupt (control+c) with
try-except block.
"""
import random
import time
from yaspin import yaspin
from yaspin.spinners import Spinners
def unpacker():
sp = yaspin(Spinners.simpleDotsScrolling, right=Tr... | Add example for handling keyboard interrupt# -*- coding: utf-8 -*-
"""
examples.kb_interrupt_handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Handling keyboard interrupt (control+c) with
try-except block.
"""
import random
import time
from yaspin import yaspin
from yaspin.spinners import Spinners
def unpacker():
sp = ya... | <commit_before><commit_msg>Add example for handling keyboard interrupt<commit_after># -*- coding: utf-8 -*-
"""
examples.kb_interrupt_handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Handling keyboard interrupt (control+c) with
try-except block.
"""
import random
import time
from yaspin import yaspin
from yaspin.spinners impo... | |
e44ebe1e0132b34f666f81d750589a44beef11f0 | modernrpc/tests/test_jsonrpc_specific_features.py | modernrpc/tests/test_jsonrpc_specific_features.py | # coding: utf-8
from jsonrpcclient.http_client import HTTPClient
def test_call_with_named_args(live_server):
c = HTTPClient(live_server.url + '/all-rpc/')
result = c.divide(numerator=10, denominator=2, z=123)
assert result == 5.0
def test_notify(live_server):
c = HTTPClient(live_server.url + '/a... | Add tests for recently added features | Add tests for recently added features
| Python | mit | alorence/django-modern-rpc,alorence/django-modern-rpc | Add tests for recently added features | # coding: utf-8
from jsonrpcclient.http_client import HTTPClient
def test_call_with_named_args(live_server):
c = HTTPClient(live_server.url + '/all-rpc/')
result = c.divide(numerator=10, denominator=2, z=123)
assert result == 5.0
def test_notify(live_server):
c = HTTPClient(live_server.url + '/a... | <commit_before><commit_msg>Add tests for recently added features<commit_after> | # coding: utf-8
from jsonrpcclient.http_client import HTTPClient
def test_call_with_named_args(live_server):
c = HTTPClient(live_server.url + '/all-rpc/')
result = c.divide(numerator=10, denominator=2, z=123)
assert result == 5.0
def test_notify(live_server):
c = HTTPClient(live_server.url + '/a... | Add tests for recently added features# coding: utf-8
from jsonrpcclient.http_client import HTTPClient
def test_call_with_named_args(live_server):
c = HTTPClient(live_server.url + '/all-rpc/')
result = c.divide(numerator=10, denominator=2, z=123)
assert result == 5.0
def test_notify(live_server):
... | <commit_before><commit_msg>Add tests for recently added features<commit_after># coding: utf-8
from jsonrpcclient.http_client import HTTPClient
def test_call_with_named_args(live_server):
c = HTTPClient(live_server.url + '/all-rpc/')
result = c.divide(numerator=10, denominator=2, z=123)
assert result ==... | |
b99b056f0af8c07db063987a75b96ee65bd0975f | scripts/mbedtls_dev/bignum_mod.py | scripts/mbedtls_dev/bignum_mod.py | """Framework classes for generation of bignum mod test cases."""
# Copyright The Mbed TLS Contributors
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
... | Add script for generating mod test cases | Add script for generating mod test cases
This commit only adds the boilerplate, no actual tests are added.
Signed-off-by: Janos Follath <[email protected]>
| Python | apache-2.0 | Mbed-TLS/mbedtls,Mbed-TLS/mbedtls,Mbed-TLS/mbedtls,ARMmbed/mbedtls,ARMmbed/mbedtls,Mbed-TLS/mbedtls,ARMmbed/mbedtls,ARMmbed/mbedtls | Add script for generating mod test cases
This commit only adds the boilerplate, no actual tests are added.
Signed-off-by: Janos Follath <[email protected]> | """Framework classes for generation of bignum mod test cases."""
# Copyright The Mbed TLS Contributors
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
... | <commit_before><commit_msg>Add script for generating mod test cases
This commit only adds the boilerplate, no actual tests are added.
Signed-off-by: Janos Follath <[email protected]><commit_after> | """Framework classes for generation of bignum mod test cases."""
# Copyright The Mbed TLS Contributors
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
... | Add script for generating mod test cases
This commit only adds the boilerplate, no actual tests are added.
Signed-off-by: Janos Follath <[email protected]>"""Framework classes for generation of bignum mod test cases."""
# Copyright The Mbed TLS Contributors
# SPDX-License-Identifier: Ap... | <commit_before><commit_msg>Add script for generating mod test cases
This commit only adds the boilerplate, no actual tests are added.
Signed-off-by: Janos Follath <[email protected]><commit_after>"""Framework classes for generation of bignum mod test cases."""
# Copyright The Mbed TLS C... | |
d921af5066fff0ec7b623bdd7f563b69152f27eb | filter_plugins/custom_plugins.py | filter_plugins/custom_plugins.py | #
# Usage: {{ foo | vault }}
#
def vault(encrypted, env):
method = """
from keyczar import keyczar
import os.path
import sys
keydir = '.vault'
if not os.path.isdir(keydir):
keydir = os.path.expanduser('~/.decrypted_openconext_keystore_{env}')
crypter = keyczar.Crypter.Read(keydir)
sys.stdout.write(crypter.Decrypt(... | #
# Usage: {{ foo | vault }}
#
def vault(encrypted, env):
method = """
from keyczar import keyczar
import os.path
import sys
keydir = '.vault'
if not os.path.isdir(keydir):
keydir = os.path.expanduser('~/.decrypted_openconext_keystore_{env}')
crypter = keyczar.Crypter.Read(keydir)
sys.stdout.write(crypter.Decrypt(... | Use Popen which is available on RHEL6, but do check exit code | Use Popen which is available on RHEL6, but do check exit code
| Python | apache-2.0 | OpenConext/OpenConext-deploy,remold/OpenConext-deploy,OpenConext/OpenConext-deploy,remold/OpenConext-deploy,baszoetekouw/OpenConext-deploy,baszoetekouw/OpenConext-deploy,baszoetekouw/OpenConext-deploy,baszoetekouw/OpenConext-deploy,OpenConext/OpenConext-deploy,OpenConext/OpenConext-deploy,baszoetekouw/OpenConext-deploy... | #
# Usage: {{ foo | vault }}
#
def vault(encrypted, env):
method = """
from keyczar import keyczar
import os.path
import sys
keydir = '.vault'
if not os.path.isdir(keydir):
keydir = os.path.expanduser('~/.decrypted_openconext_keystore_{env}')
crypter = keyczar.Crypter.Read(keydir)
sys.stdout.write(crypter.Decrypt(... | #
# Usage: {{ foo | vault }}
#
def vault(encrypted, env):
method = """
from keyczar import keyczar
import os.path
import sys
keydir = '.vault'
if not os.path.isdir(keydir):
keydir = os.path.expanduser('~/.decrypted_openconext_keystore_{env}')
crypter = keyczar.Crypter.Read(keydir)
sys.stdout.write(crypter.Decrypt(... | <commit_before>#
# Usage: {{ foo | vault }}
#
def vault(encrypted, env):
method = """
from keyczar import keyczar
import os.path
import sys
keydir = '.vault'
if not os.path.isdir(keydir):
keydir = os.path.expanduser('~/.decrypted_openconext_keystore_{env}')
crypter = keyczar.Crypter.Read(keydir)
sys.stdout.write(c... | #
# Usage: {{ foo | vault }}
#
def vault(encrypted, env):
method = """
from keyczar import keyczar
import os.path
import sys
keydir = '.vault'
if not os.path.isdir(keydir):
keydir = os.path.expanduser('~/.decrypted_openconext_keystore_{env}')
crypter = keyczar.Crypter.Read(keydir)
sys.stdout.write(crypter.Decrypt(... | #
# Usage: {{ foo | vault }}
#
def vault(encrypted, env):
method = """
from keyczar import keyczar
import os.path
import sys
keydir = '.vault'
if not os.path.isdir(keydir):
keydir = os.path.expanduser('~/.decrypted_openconext_keystore_{env}')
crypter = keyczar.Crypter.Read(keydir)
sys.stdout.write(crypter.Decrypt(... | <commit_before>#
# Usage: {{ foo | vault }}
#
def vault(encrypted, env):
method = """
from keyczar import keyczar
import os.path
import sys
keydir = '.vault'
if not os.path.isdir(keydir):
keydir = os.path.expanduser('~/.decrypted_openconext_keystore_{env}')
crypter = keyczar.Crypter.Read(keydir)
sys.stdout.write(c... |
37604722a186a28ee2df7cca422bc47cfea1857e | migrations/versions/d6b40a745e5_.py | migrations/versions/d6b40a745e5_.py | """Add table usercache
Revision ID: d6b40a745e5
Revises: 1edda52b619f
Create Date: 2017-04-13 15:25:44.050719
"""
# revision identifiers, used by Alembic.
revision = 'd6b40a745e5'
down_revision = '1edda52b619f'
from alembic import op
import sqlalchemy as sa
def upgrade():
try:
op.create_table('usercac... | Add SQL migration for usercache | Add SQL migration for usercache
Working on #670
| Python | agpl-3.0 | jh23453/privacyidea,privacyidea/privacyidea,privacyidea/privacyidea,jh23453/privacyidea,privacyidea/privacyidea,wheldom01/privacyidea,wheldom01/privacyidea,jh23453/privacyidea,wheldom01/privacyidea,privacyidea/privacyidea,wheldom01/privacyidea,jh23453/privacyidea,privacyidea/privacyidea,jh23453/privacyidea,jh23453/priv... | Add SQL migration for usercache
Working on #670 | """Add table usercache
Revision ID: d6b40a745e5
Revises: 1edda52b619f
Create Date: 2017-04-13 15:25:44.050719
"""
# revision identifiers, used by Alembic.
revision = 'd6b40a745e5'
down_revision = '1edda52b619f'
from alembic import op
import sqlalchemy as sa
def upgrade():
try:
op.create_table('usercac... | <commit_before><commit_msg>Add SQL migration for usercache
Working on #670<commit_after> | """Add table usercache
Revision ID: d6b40a745e5
Revises: 1edda52b619f
Create Date: 2017-04-13 15:25:44.050719
"""
# revision identifiers, used by Alembic.
revision = 'd6b40a745e5'
down_revision = '1edda52b619f'
from alembic import op
import sqlalchemy as sa
def upgrade():
try:
op.create_table('usercac... | Add SQL migration for usercache
Working on #670"""Add table usercache
Revision ID: d6b40a745e5
Revises: 1edda52b619f
Create Date: 2017-04-13 15:25:44.050719
"""
# revision identifiers, used by Alembic.
revision = 'd6b40a745e5'
down_revision = '1edda52b619f'
from alembic import op
import sqlalchemy as sa
def upgr... | <commit_before><commit_msg>Add SQL migration for usercache
Working on #670<commit_after>"""Add table usercache
Revision ID: d6b40a745e5
Revises: 1edda52b619f
Create Date: 2017-04-13 15:25:44.050719
"""
# revision identifiers, used by Alembic.
revision = 'd6b40a745e5'
down_revision = '1edda52b619f'
from alembic imp... | |
c29b81e9ecc800898342c54cb6f4637a8371b1b4 | models/fallahi_eval/process_data.py | models/fallahi_eval/process_data.py | import pandas
from collections import defaultdict
rppa_file = 'data/TableS1-Split.xlsx'
cell_lines = ['C32', 'COLO858', 'K2', 'LOXIMVI', 'MMACSF', 'MZ7MEL',
'RVH421', 'SKMEL28', 'WM115', 'WM1552C']
def read_rppa_data(fname=rppa_file):
data = {}
for cell_line in cell_lines:
data[cell_lin... | Read in RPPA medians and stds | Read in RPPA medians and stds
| Python | bsd-2-clause | johnbachman/belpy,bgyori/indra,pvtodorov/indra,sorgerlab/belpy,pvtodorov/indra,pvtodorov/indra,johnbachman/indra,pvtodorov/indra,sorgerlab/indra,sorgerlab/indra,sorgerlab/belpy,bgyori/indra,sorgerlab/indra,sorgerlab/belpy,johnbachman/belpy,johnbachman/belpy,johnbachman/indra,bgyori/indra,johnbachman/indra | Read in RPPA medians and stds | import pandas
from collections import defaultdict
rppa_file = 'data/TableS1-Split.xlsx'
cell_lines = ['C32', 'COLO858', 'K2', 'LOXIMVI', 'MMACSF', 'MZ7MEL',
'RVH421', 'SKMEL28', 'WM115', 'WM1552C']
def read_rppa_data(fname=rppa_file):
data = {}
for cell_line in cell_lines:
data[cell_lin... | <commit_before><commit_msg>Read in RPPA medians and stds<commit_after> | import pandas
from collections import defaultdict
rppa_file = 'data/TableS1-Split.xlsx'
cell_lines = ['C32', 'COLO858', 'K2', 'LOXIMVI', 'MMACSF', 'MZ7MEL',
'RVH421', 'SKMEL28', 'WM115', 'WM1552C']
def read_rppa_data(fname=rppa_file):
data = {}
for cell_line in cell_lines:
data[cell_lin... | Read in RPPA medians and stdsimport pandas
from collections import defaultdict
rppa_file = 'data/TableS1-Split.xlsx'
cell_lines = ['C32', 'COLO858', 'K2', 'LOXIMVI', 'MMACSF', 'MZ7MEL',
'RVH421', 'SKMEL28', 'WM115', 'WM1552C']
def read_rppa_data(fname=rppa_file):
data = {}
for cell_line in cell... | <commit_before><commit_msg>Read in RPPA medians and stds<commit_after>import pandas
from collections import defaultdict
rppa_file = 'data/TableS1-Split.xlsx'
cell_lines = ['C32', 'COLO858', 'K2', 'LOXIMVI', 'MMACSF', 'MZ7MEL',
'RVH421', 'SKMEL28', 'WM115', 'WM1552C']
def read_rppa_data(fname=rppa_file)... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.