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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3d6e79c4099015d556e58d63d73f9ee0fac71754 | BBBC017-mongo.py | BBBC017-mongo.py | #!/usr/bin/env python
# BBBC017-image.py <metadata.json> <features-mongo.json> <screen-info.json>
import json
import os
from pymongo import MongoClient
import sys
def main(argv=None):
metadata_file = argv[1]
metadata = []
with open(metadata_file) as f:
for line in f:
metadata.append(j... | Add script used to add BBB017 sample documents | Add script used to add BBB017 sample documents
| Python | bsd-3-clause | microscopium/microscopium-scripts,microscopium/microscopium-scripts | Add script used to add BBB017 sample documents | #!/usr/bin/env python
# BBBC017-image.py <metadata.json> <features-mongo.json> <screen-info.json>
import json
import os
from pymongo import MongoClient
import sys
def main(argv=None):
metadata_file = argv[1]
metadata = []
with open(metadata_file) as f:
for line in f:
metadata.append(j... | <commit_before><commit_msg>Add script used to add BBB017 sample documents<commit_after> | #!/usr/bin/env python
# BBBC017-image.py <metadata.json> <features-mongo.json> <screen-info.json>
import json
import os
from pymongo import MongoClient
import sys
def main(argv=None):
metadata_file = argv[1]
metadata = []
with open(metadata_file) as f:
for line in f:
metadata.append(j... | Add script used to add BBB017 sample documents#!/usr/bin/env python
# BBBC017-image.py <metadata.json> <features-mongo.json> <screen-info.json>
import json
import os
from pymongo import MongoClient
import sys
def main(argv=None):
metadata_file = argv[1]
metadata = []
with open(metadata_file) as f:
... | <commit_before><commit_msg>Add script used to add BBB017 sample documents<commit_after>#!/usr/bin/env python
# BBBC017-image.py <metadata.json> <features-mongo.json> <screen-info.json>
import json
import os
from pymongo import MongoClient
import sys
def main(argv=None):
metadata_file = argv[1]
metadata = []
... | |
378f3f87b68ca054bbdd86adee4b887a5aaa8374 | tests/test_utils.py | tests/test_utils.py | #!/usr/bin/env python3
from __future__ import print_function, division
import numpy as np
from sht.utils import l_to_lm
def test_l_to_lm():
L = 10
x = np.random.randn(L)
# Test without fill_zeros
y = l_to_lm(x)
for i in range(L):
assert np.array_equal(y[i**2:(i+1)**2], x[i] * np.ones(2 *... | Add a test for l_to_lm. | Add a test for l_to_lm.
| Python | mit | praveenv253/sht,praveenv253/sht | Add a test for l_to_lm. | #!/usr/bin/env python3
from __future__ import print_function, division
import numpy as np
from sht.utils import l_to_lm
def test_l_to_lm():
L = 10
x = np.random.randn(L)
# Test without fill_zeros
y = l_to_lm(x)
for i in range(L):
assert np.array_equal(y[i**2:(i+1)**2], x[i] * np.ones(2 *... | <commit_before><commit_msg>Add a test for l_to_lm.<commit_after> | #!/usr/bin/env python3
from __future__ import print_function, division
import numpy as np
from sht.utils import l_to_lm
def test_l_to_lm():
L = 10
x = np.random.randn(L)
# Test without fill_zeros
y = l_to_lm(x)
for i in range(L):
assert np.array_equal(y[i**2:(i+1)**2], x[i] * np.ones(2 *... | Add a test for l_to_lm.#!/usr/bin/env python3
from __future__ import print_function, division
import numpy as np
from sht.utils import l_to_lm
def test_l_to_lm():
L = 10
x = np.random.randn(L)
# Test without fill_zeros
y = l_to_lm(x)
for i in range(L):
assert np.array_equal(y[i**2:(i+1)*... | <commit_before><commit_msg>Add a test for l_to_lm.<commit_after>#!/usr/bin/env python3
from __future__ import print_function, division
import numpy as np
from sht.utils import l_to_lm
def test_l_to_lm():
L = 10
x = np.random.randn(L)
# Test without fill_zeros
y = l_to_lm(x)
for i in range(L):
... | |
92cc938b83d56f70b45d0ba3856cae56fa6db77e | skyfield/constellationlib.py | skyfield/constellationlib.py | """
http://cdsarc.u-strasbg.fr/viz-bin/Cat?VI/42
https://iopscience.iop.org/article/10.1086/132034/pdf
"""
| Add reference to constellation paper | Add reference to constellation paper
| Python | mit | skyfielders/python-skyfield,skyfielders/python-skyfield | Add reference to constellation paper | """
http://cdsarc.u-strasbg.fr/viz-bin/Cat?VI/42
https://iopscience.iop.org/article/10.1086/132034/pdf
"""
| <commit_before><commit_msg>Add reference to constellation paper<commit_after> | """
http://cdsarc.u-strasbg.fr/viz-bin/Cat?VI/42
https://iopscience.iop.org/article/10.1086/132034/pdf
"""
| Add reference to constellation paper"""
http://cdsarc.u-strasbg.fr/viz-bin/Cat?VI/42
https://iopscience.iop.org/article/10.1086/132034/pdf
"""
| <commit_before><commit_msg>Add reference to constellation paper<commit_after>"""
http://cdsarc.u-strasbg.fr/viz-bin/Cat?VI/42
https://iopscience.iop.org/article/10.1086/132034/pdf
"""
| |
b06d6acf77c1894a1fbe1c92b8f46af1d9f4dfb3 | tool/greedy_test.py | tool/greedy_test.py | #!/usr/bin/env python
#
# This script tests the functions in GreedyEmbedding. It also shows
# how to calculate the distance of any two points in Poincare disk.
#
# Reference:
# R. Kleinberg - Geographic routing using hyperbolic space
# A. Cvetkovski - Hyperbolic Embedding and Routing for Dynamic Graphs
#
# Liang Wang... | Add test module for GreedyEmbedding | Add test module for GreedyEmbedding
| Python | lgpl-2.1 | ryanrhymes/mobiccnx,ryanrhymes/mobiccnx,ryanrhymes/mobiccnx,ryanrhymes/mobiccnx,ryanrhymes/mobiccnx,ryanrhymes/mobiccnx | Add test module for GreedyEmbedding | #!/usr/bin/env python
#
# This script tests the functions in GreedyEmbedding. It also shows
# how to calculate the distance of any two points in Poincare disk.
#
# Reference:
# R. Kleinberg - Geographic routing using hyperbolic space
# A. Cvetkovski - Hyperbolic Embedding and Routing for Dynamic Graphs
#
# Liang Wang... | <commit_before><commit_msg>Add test module for GreedyEmbedding<commit_after> | #!/usr/bin/env python
#
# This script tests the functions in GreedyEmbedding. It also shows
# how to calculate the distance of any two points in Poincare disk.
#
# Reference:
# R. Kleinberg - Geographic routing using hyperbolic space
# A. Cvetkovski - Hyperbolic Embedding and Routing for Dynamic Graphs
#
# Liang Wang... | Add test module for GreedyEmbedding#!/usr/bin/env python
#
# This script tests the functions in GreedyEmbedding. It also shows
# how to calculate the distance of any two points in Poincare disk.
#
# Reference:
# R. Kleinberg - Geographic routing using hyperbolic space
# A. Cvetkovski - Hyperbolic Embedding and Routin... | <commit_before><commit_msg>Add test module for GreedyEmbedding<commit_after>#!/usr/bin/env python
#
# This script tests the functions in GreedyEmbedding. It also shows
# how to calculate the distance of any two points in Poincare disk.
#
# Reference:
# R. Kleinberg - Geographic routing using hyperbolic space
# A. Cve... | |
68ff568d4761b2aa3adc2c077f8cd6c9fc893c1e | src/pretix/urls.py | src/pretix/urls.py | from django.conf.urls import patterns, include, url
from django.contrib import admin
from django.conf import settings
import pretixcontrol.urls
import pretixpresale.urls
urlpatterns = patterns('',
url(r'^control/', include(pretixcontrol.urls, namespace='control')),
url(r'^admin/', include(admin.site.urls)),
... | from django.conf.urls import patterns, include, url
from django.contrib import admin
from django.conf import settings
import pretixcontrol.urls
import pretixpresale.urls
urlpatterns = patterns('',
url(r'^control/', include(pretixcontrol.urls, namespace='control')),
url(r'^admin/', include(admin.site.urls)),
... | Move URLconfig around to fix Django Debug Toolbar | Move URLconfig around to fix Django Debug Toolbar
| Python | apache-2.0 | awg24/pretix,Unicorn-rzl/pretix,lab2112/pretix,lab2112/pretix,awg24/pretix,Flamacue/pretix,Unicorn-rzl/pretix,lab2112/pretix,lab2112/pretix,Flamacue/pretix,akuks/pretix,Unicorn-rzl/pretix,Flamacue/pretix,akuks/pretix,Flamacue/pretix,Unicorn-rzl/pretix,awg24/pretix,akuks/pretix,awg24/pretix,akuks/pretix | from django.conf.urls import patterns, include, url
from django.contrib import admin
from django.conf import settings
import pretixcontrol.urls
import pretixpresale.urls
urlpatterns = patterns('',
url(r'^control/', include(pretixcontrol.urls, namespace='control')),
url(r'^admin/', include(admin.site.urls)),
... | from django.conf.urls import patterns, include, url
from django.contrib import admin
from django.conf import settings
import pretixcontrol.urls
import pretixpresale.urls
urlpatterns = patterns('',
url(r'^control/', include(pretixcontrol.urls, namespace='control')),
url(r'^admin/', include(admin.site.urls)),
... | <commit_before>from django.conf.urls import patterns, include, url
from django.contrib import admin
from django.conf import settings
import pretixcontrol.urls
import pretixpresale.urls
urlpatterns = patterns('',
url(r'^control/', include(pretixcontrol.urls, namespace='control')),
url(r'^admin/', include(admi... | from django.conf.urls import patterns, include, url
from django.contrib import admin
from django.conf import settings
import pretixcontrol.urls
import pretixpresale.urls
urlpatterns = patterns('',
url(r'^control/', include(pretixcontrol.urls, namespace='control')),
url(r'^admin/', include(admin.site.urls)),
... | from django.conf.urls import patterns, include, url
from django.contrib import admin
from django.conf import settings
import pretixcontrol.urls
import pretixpresale.urls
urlpatterns = patterns('',
url(r'^control/', include(pretixcontrol.urls, namespace='control')),
url(r'^admin/', include(admin.site.urls)),
... | <commit_before>from django.conf.urls import patterns, include, url
from django.contrib import admin
from django.conf import settings
import pretixcontrol.urls
import pretixpresale.urls
urlpatterns = patterns('',
url(r'^control/', include(pretixcontrol.urls, namespace='control')),
url(r'^admin/', include(admi... |
5a2774bb90b98e413e69a2ea53afb1b0a6fafff4 | mxreverse.py | mxreverse.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import dns.resolver
import dns.reversename
import json
import urlparse
def resolve_mx(hostname):
response = []
for data in dns.resolver.query(hostname, 'MX'):
response.append((data.exchange.to_text(), data.preference))
return response
def resolve_ip... | Add API for check MX | Add API for check MX
| Python | mit | eduardoklosowski/mxreverse,eduardoklosowski/mxreverse,eduardoklosowski/mxreverse | Add API for check MX | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import dns.resolver
import dns.reversename
import json
import urlparse
def resolve_mx(hostname):
response = []
for data in dns.resolver.query(hostname, 'MX'):
response.append((data.exchange.to_text(), data.preference))
return response
def resolve_ip... | <commit_before><commit_msg>Add API for check MX<commit_after> | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import dns.resolver
import dns.reversename
import json
import urlparse
def resolve_mx(hostname):
response = []
for data in dns.resolver.query(hostname, 'MX'):
response.append((data.exchange.to_text(), data.preference))
return response
def resolve_ip... | Add API for check MX#!/usr/bin/env python
# -*- coding: utf-8 -*-
import dns.resolver
import dns.reversename
import json
import urlparse
def resolve_mx(hostname):
response = []
for data in dns.resolver.query(hostname, 'MX'):
response.append((data.exchange.to_text(), data.preference))
return respo... | <commit_before><commit_msg>Add API for check MX<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import dns.resolver
import dns.reversename
import json
import urlparse
def resolve_mx(hostname):
response = []
for data in dns.resolver.query(hostname, 'MX'):
response.append((data.exchange.to_t... | |
e111ef984c06202f9c7c3b0e882121befa33bb47 | Control/controlFromMobile.py | Control/controlFromMobile.py | import os
import sys
import threading
import time
import numpy as np
sys.path.append(os.getcwd())
sys.path.append('/media/bat/DATA/Baptiste/Nautilab/kite_project/robokite/ObjectTracking')
import mobileState
import serial
mobile = mobileState.mobileState()
a = threading.Thread(None, mobileState.mobileState.checkUpdate, ... | Add a script to be able to control the motor based on mobile phone inclination. This can be used to control the kite while launching it if alone | Add a script to be able to control the motor based on mobile phone inclination. This can be used to control the kite while launching it if alone
| Python | mit | baptistelabat/robokite,baptistelabat/robokite,baptistelabat/robokite,baptistelabat/robokite,baptistelabat/robokite,baptistelabat/robokite,baptistelabat/robokite,baptistelabat/robokite | Add a script to be able to control the motor based on mobile phone inclination. This can be used to control the kite while launching it if alone | import os
import sys
import threading
import time
import numpy as np
sys.path.append(os.getcwd())
sys.path.append('/media/bat/DATA/Baptiste/Nautilab/kite_project/robokite/ObjectTracking')
import mobileState
import serial
mobile = mobileState.mobileState()
a = threading.Thread(None, mobileState.mobileState.checkUpdate, ... | <commit_before><commit_msg>Add a script to be able to control the motor based on mobile phone inclination. This can be used to control the kite while launching it if alone<commit_after> | import os
import sys
import threading
import time
import numpy as np
sys.path.append(os.getcwd())
sys.path.append('/media/bat/DATA/Baptiste/Nautilab/kite_project/robokite/ObjectTracking')
import mobileState
import serial
mobile = mobileState.mobileState()
a = threading.Thread(None, mobileState.mobileState.checkUpdate, ... | Add a script to be able to control the motor based on mobile phone inclination. This can be used to control the kite while launching it if aloneimport os
import sys
import threading
import time
import numpy as np
sys.path.append(os.getcwd())
sys.path.append('/media/bat/DATA/Baptiste/Nautilab/kite_project/robokite/Objec... | <commit_before><commit_msg>Add a script to be able to control the motor based on mobile phone inclination. This can be used to control the kite while launching it if alone<commit_after>import os
import sys
import threading
import time
import numpy as np
sys.path.append(os.getcwd())
sys.path.append('/media/bat/DATA/Bapt... | |
4b344091370263a98630623fdb6a083b680a9403 | update_manifest.py | update_manifest.py | #!/usr/bin/python
import json
import os
import sys
import tempfile
import urllib2
import zipfile
# Get the manifest urls.
req = urllib2.Request(
"https://www.bungie.net//platform/Destiny/Manifest/",
headers={'X-API-Key': sys.argv[1]},
)
resp = json.loads(urllib2.urlopen(req).read())
if resp['ErrorCode'] != 1:... | Add a script to download the manifest database. | Add a script to download the manifest database.
| Python | mit | zhirsch/destinykioskstatus,zhirsch/destinykioskstatus | Add a script to download the manifest database. | #!/usr/bin/python
import json
import os
import sys
import tempfile
import urllib2
import zipfile
# Get the manifest urls.
req = urllib2.Request(
"https://www.bungie.net//platform/Destiny/Manifest/",
headers={'X-API-Key': sys.argv[1]},
)
resp = json.loads(urllib2.urlopen(req).read())
if resp['ErrorCode'] != 1:... | <commit_before><commit_msg>Add a script to download the manifest database.<commit_after> | #!/usr/bin/python
import json
import os
import sys
import tempfile
import urllib2
import zipfile
# Get the manifest urls.
req = urllib2.Request(
"https://www.bungie.net//platform/Destiny/Manifest/",
headers={'X-API-Key': sys.argv[1]},
)
resp = json.loads(urllib2.urlopen(req).read())
if resp['ErrorCode'] != 1:... | Add a script to download the manifest database.#!/usr/bin/python
import json
import os
import sys
import tempfile
import urllib2
import zipfile
# Get the manifest urls.
req = urllib2.Request(
"https://www.bungie.net//platform/Destiny/Manifest/",
headers={'X-API-Key': sys.argv[1]},
)
resp = json.loads(urllib2.... | <commit_before><commit_msg>Add a script to download the manifest database.<commit_after>#!/usr/bin/python
import json
import os
import sys
import tempfile
import urllib2
import zipfile
# Get the manifest urls.
req = urllib2.Request(
"https://www.bungie.net//platform/Destiny/Manifest/",
headers={'X-API-Key': s... | |
567e12bfb8d0f4e2a4f6fddf0fab9ffbcbf6d49f | requests/_bug.py | requests/_bug.py | """Module containing bug report helper(s)."""
from __future__ import print_function
import json
import platform
import sys
import ssl
from . import __version__ as requests_version
try:
from .packages.urllib3.contrib import pyopenssl
except ImportError:
pyopenssl = None
OpenSSL = None
cryptography = N... | Add debugging submodule for bug reporters | Add debugging submodule for bug reporters
The suggested usage in a bug report would be
python -c 'from requests import _bug; _bug.print_information()'
This should generate most of the information we tend to ask for
repeatedly from bug reporters.
| Python | apache-2.0 | psf/requests | Add debugging submodule for bug reporters
The suggested usage in a bug report would be
python -c 'from requests import _bug; _bug.print_information()'
This should generate most of the information we tend to ask for
repeatedly from bug reporters. | """Module containing bug report helper(s)."""
from __future__ import print_function
import json
import platform
import sys
import ssl
from . import __version__ as requests_version
try:
from .packages.urllib3.contrib import pyopenssl
except ImportError:
pyopenssl = None
OpenSSL = None
cryptography = N... | <commit_before><commit_msg>Add debugging submodule for bug reporters
The suggested usage in a bug report would be
python -c 'from requests import _bug; _bug.print_information()'
This should generate most of the information we tend to ask for
repeatedly from bug reporters.<commit_after> | """Module containing bug report helper(s)."""
from __future__ import print_function
import json
import platform
import sys
import ssl
from . import __version__ as requests_version
try:
from .packages.urllib3.contrib import pyopenssl
except ImportError:
pyopenssl = None
OpenSSL = None
cryptography = N... | Add debugging submodule for bug reporters
The suggested usage in a bug report would be
python -c 'from requests import _bug; _bug.print_information()'
This should generate most of the information we tend to ask for
repeatedly from bug reporters."""Module containing bug report helper(s)."""
from __future__ import... | <commit_before><commit_msg>Add debugging submodule for bug reporters
The suggested usage in a bug report would be
python -c 'from requests import _bug; _bug.print_information()'
This should generate most of the information we tend to ask for
repeatedly from bug reporters.<commit_after>"""Module containing bug re... | |
7989d123453e7d0f2898f2ee4c229f9295ef17cb | src/ggrc_basic_permissions/migrations/versions/20170311142655_3ab8b37b04_clear_user_roles_with_invalid_context.py | src/ggrc_basic_permissions/migrations/versions/20170311142655_3ab8b37b04_clear_user_roles_with_invalid_context.py | # Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""
Clear user roles with invalid context
Create Date: 2017-03-11 14:26:55.133169
"""
# disable Invalid constant name pylint warning for mandatory Alembic variables.
# pylint: disable=invalid-name
from ale... | Remove invalid user role entries | Remove invalid user role entries
| Python | apache-2.0 | plamut/ggrc-core,plamut/ggrc-core,AleksNeStu/ggrc-core,AleksNeStu/ggrc-core,AleksNeStu/ggrc-core,plamut/ggrc-core,plamut/ggrc-core,AleksNeStu/ggrc-core | Remove invalid user role entries | # Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""
Clear user roles with invalid context
Create Date: 2017-03-11 14:26:55.133169
"""
# disable Invalid constant name pylint warning for mandatory Alembic variables.
# pylint: disable=invalid-name
from ale... | <commit_before><commit_msg>Remove invalid user role entries<commit_after> | # Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""
Clear user roles with invalid context
Create Date: 2017-03-11 14:26:55.133169
"""
# disable Invalid constant name pylint warning for mandatory Alembic variables.
# pylint: disable=invalid-name
from ale... | Remove invalid user role entries# Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""
Clear user roles with invalid context
Create Date: 2017-03-11 14:26:55.133169
"""
# disable Invalid constant name pylint warning for mandatory Alembic variables.
# pylint... | <commit_before><commit_msg>Remove invalid user role entries<commit_after># Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""
Clear user roles with invalid context
Create Date: 2017-03-11 14:26:55.133169
"""
# disable Invalid constant name pylint warning ... | |
3f2a9a7a7438b72459fb2f0fbf0fb960c685cbe2 | plumeria/plugins/myanimelist.py | plumeria/plugins/myanimelist.py | import aiohttp
from bs4 import BeautifulSoup
from plumeria import config
from plumeria.command import commands, CommandError
from plumeria.util import http
from plumeria.util.message import strip_html
from plumeria.util.ratelimit import rate_limit
username = config.create("myanimelist", "username", fallback="",
... | Add MyAnimeList plugin for searching animes. | Add MyAnimeList plugin for searching animes.
| Python | mit | sk89q/Plumeria,sk89q/Plumeria,sk89q/Plumeria | Add MyAnimeList plugin for searching animes. | import aiohttp
from bs4 import BeautifulSoup
from plumeria import config
from plumeria.command import commands, CommandError
from plumeria.util import http
from plumeria.util.message import strip_html
from plumeria.util.ratelimit import rate_limit
username = config.create("myanimelist", "username", fallback="",
... | <commit_before><commit_msg>Add MyAnimeList plugin for searching animes.<commit_after> | import aiohttp
from bs4 import BeautifulSoup
from plumeria import config
from plumeria.command import commands, CommandError
from plumeria.util import http
from plumeria.util.message import strip_html
from plumeria.util.ratelimit import rate_limit
username = config.create("myanimelist", "username", fallback="",
... | Add MyAnimeList plugin for searching animes.import aiohttp
from bs4 import BeautifulSoup
from plumeria import config
from plumeria.command import commands, CommandError
from plumeria.util import http
from plumeria.util.message import strip_html
from plumeria.util.ratelimit import rate_limit
username = config.create("... | <commit_before><commit_msg>Add MyAnimeList plugin for searching animes.<commit_after>import aiohttp
from bs4 import BeautifulSoup
from plumeria import config
from plumeria.command import commands, CommandError
from plumeria.util import http
from plumeria.util.message import strip_html
from plumeria.util.ratelimit impo... | |
8298b23f48028861985d7431fb8514ba5a4bfff6 | 17B-162/spw_setup.py | 17B-162/spw_setup.py |
# Line SPW setup for 17B-162 w/ rest frequencies
linespw_dict = {0: ["HI", "1.420405752GHz"],
1: ["H166alp", "1.42473GHz"],
2: ["H164alp", "1.47734GHz"],
3: ["OH1612", "1.612231GHz"],
4: ["H158alp", "1.65154GHz"],
5: ["OH1665", "1.6654018... | Add dict of rest freqs for 17B | Add dict of rest freqs for 17B
| Python | mit | e-koch/VLA_Lband,e-koch/VLA_Lband | Add dict of rest freqs for 17B |
# Line SPW setup for 17B-162 w/ rest frequencies
linespw_dict = {0: ["HI", "1.420405752GHz"],
1: ["H166alp", "1.42473GHz"],
2: ["H164alp", "1.47734GHz"],
3: ["OH1612", "1.612231GHz"],
4: ["H158alp", "1.65154GHz"],
5: ["OH1665", "1.6654018... | <commit_before><commit_msg>Add dict of rest freqs for 17B<commit_after> |
# Line SPW setup for 17B-162 w/ rest frequencies
linespw_dict = {0: ["HI", "1.420405752GHz"],
1: ["H166alp", "1.42473GHz"],
2: ["H164alp", "1.47734GHz"],
3: ["OH1612", "1.612231GHz"],
4: ["H158alp", "1.65154GHz"],
5: ["OH1665", "1.6654018... | Add dict of rest freqs for 17B
# Line SPW setup for 17B-162 w/ rest frequencies
linespw_dict = {0: ["HI", "1.420405752GHz"],
1: ["H166alp", "1.42473GHz"],
2: ["H164alp", "1.47734GHz"],
3: ["OH1612", "1.612231GHz"],
4: ["H158alp", "1.65154GHz"],
... | <commit_before><commit_msg>Add dict of rest freqs for 17B<commit_after>
# Line SPW setup for 17B-162 w/ rest frequencies
linespw_dict = {0: ["HI", "1.420405752GHz"],
1: ["H166alp", "1.42473GHz"],
2: ["H164alp", "1.47734GHz"],
3: ["OH1612", "1.612231GHz"],
... | |
5eaa607ce4e0b04dfd6ee050d964119064ad68f1 | scripts/create_dataset_toml.py | scripts/create_dataset_toml.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import glob
import os
import re
import argparse
import h5py
import numpy as np
import pytoml as toml
from diluvian.util import get_nonzero_aabb
def create_dataset_conf_from_files(path, file_pattern, name_regex, name_format, mask_... | Add old script for creating dataset TOML from HDF5 | Add old script for creating dataset TOML from HDF5
| Python | mit | aschampion/diluvian | Add old script for creating dataset TOML from HDF5 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import glob
import os
import re
import argparse
import h5py
import numpy as np
import pytoml as toml
from diluvian.util import get_nonzero_aabb
def create_dataset_conf_from_files(path, file_pattern, name_regex, name_format, mask_... | <commit_before><commit_msg>Add old script for creating dataset TOML from HDF5<commit_after> | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import glob
import os
import re
import argparse
import h5py
import numpy as np
import pytoml as toml
from diluvian.util import get_nonzero_aabb
def create_dataset_conf_from_files(path, file_pattern, name_regex, name_format, mask_... | Add old script for creating dataset TOML from HDF5#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import glob
import os
import re
import argparse
import h5py
import numpy as np
import pytoml as toml
from diluvian.util import get_nonzero_aabb
def create_dataset_conf_from_files(... | <commit_before><commit_msg>Add old script for creating dataset TOML from HDF5<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import glob
import os
import re
import argparse
import h5py
import numpy as np
import pytoml as toml
from diluvian.util import get_nonzero_a... | |
c51062a8e4e621fc50c3ed393f6d3dad8e19b4c3 | cs4teachers/tests/events/models/test_location.py | cs4teachers/tests/events/models/test_location.py | from tests.BaseTest import BaseTest
from events.models import Location
class LocationModelTest(BaseTest):
def test_location(self):
location = self.event_data.create_location(1)
query_result = Location.objects.get(slug="location-1")
self.assertEqual(
query_result,
l... | Add tests for events Location model | Add tests for events Location model
| Python | mit | uccser/cs4teachers,uccser/cs4teachers,uccser/cs4teachers,uccser/cs4teachers | Add tests for events Location model | from tests.BaseTest import BaseTest
from events.models import Location
class LocationModelTest(BaseTest):
def test_location(self):
location = self.event_data.create_location(1)
query_result = Location.objects.get(slug="location-1")
self.assertEqual(
query_result,
l... | <commit_before><commit_msg>Add tests for events Location model<commit_after> | from tests.BaseTest import BaseTest
from events.models import Location
class LocationModelTest(BaseTest):
def test_location(self):
location = self.event_data.create_location(1)
query_result = Location.objects.get(slug="location-1")
self.assertEqual(
query_result,
l... | Add tests for events Location modelfrom tests.BaseTest import BaseTest
from events.models import Location
class LocationModelTest(BaseTest):
def test_location(self):
location = self.event_data.create_location(1)
query_result = Location.objects.get(slug="location-1")
self.assertEqual(
... | <commit_before><commit_msg>Add tests for events Location model<commit_after>from tests.BaseTest import BaseTest
from events.models import Location
class LocationModelTest(BaseTest):
def test_location(self):
location = self.event_data.create_location(1)
query_result = Location.objects.get(slug="lo... | |
21fa0a82ce89e5b71bc146591aaa2dac3fa0d04a | sv-comp/witness-isomorphism.py | sv-comp/witness-isomorphism.py | #!/usr/bin/python3
import sys
import networkx as nx
# def witness_node_match(n1, n2):
# return True
witness_node_match = nx.algorithms.isomorphism.categorical_node_match(
["entry", "sink", "violation", "invariant", "invariant.scope"],
[False, False, False, None, None]
)
# def witness_edge_match(e1, e2):
... | Add script for checking witness isomorphism | Add script for checking witness isomorphism
| Python | mit | goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer | Add script for checking witness isomorphism | #!/usr/bin/python3
import sys
import networkx as nx
# def witness_node_match(n1, n2):
# return True
witness_node_match = nx.algorithms.isomorphism.categorical_node_match(
["entry", "sink", "violation", "invariant", "invariant.scope"],
[False, False, False, None, None]
)
# def witness_edge_match(e1, e2):
... | <commit_before><commit_msg>Add script for checking witness isomorphism<commit_after> | #!/usr/bin/python3
import sys
import networkx as nx
# def witness_node_match(n1, n2):
# return True
witness_node_match = nx.algorithms.isomorphism.categorical_node_match(
["entry", "sink", "violation", "invariant", "invariant.scope"],
[False, False, False, None, None]
)
# def witness_edge_match(e1, e2):
... | Add script for checking witness isomorphism#!/usr/bin/python3
import sys
import networkx as nx
# def witness_node_match(n1, n2):
# return True
witness_node_match = nx.algorithms.isomorphism.categorical_node_match(
["entry", "sink", "violation", "invariant", "invariant.scope"],
[False, False, False, None, ... | <commit_before><commit_msg>Add script for checking witness isomorphism<commit_after>#!/usr/bin/python3
import sys
import networkx as nx
# def witness_node_match(n1, n2):
# return True
witness_node_match = nx.algorithms.isomorphism.categorical_node_match(
["entry", "sink", "violation", "invariant", "invariant.... | |
757b82071bda164342acd86ebb1df26239dafa5a | enable/tools/drop_tool.py | enable/tools/drop_tool.py | #------------------------------------------------------------------------------
# Copyright (c) 2014, Enthought, Inc.
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in LICENSE.txt and may be redistributed only
# under the conditions described in the a... | Add base tool to facilitate drag and drop support. | Add base tool to facilitate drag and drop support.
| Python | bsd-3-clause | tommy-u/enable,tommy-u/enable,tommy-u/enable,tommy-u/enable | Add base tool to facilitate drag and drop support. | #------------------------------------------------------------------------------
# Copyright (c) 2014, Enthought, Inc.
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in LICENSE.txt and may be redistributed only
# under the conditions described in the a... | <commit_before><commit_msg>Add base tool to facilitate drag and drop support.<commit_after> | #------------------------------------------------------------------------------
# Copyright (c) 2014, Enthought, Inc.
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in LICENSE.txt and may be redistributed only
# under the conditions described in the a... | Add base tool to facilitate drag and drop support.#------------------------------------------------------------------------------
# Copyright (c) 2014, Enthought, Inc.
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in LICENSE.txt and may be redistribu... | <commit_before><commit_msg>Add base tool to facilitate drag and drop support.<commit_after>#------------------------------------------------------------------------------
# Copyright (c) 2014, Enthought, Inc.
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license incl... | |
a893223d4964f946d9413a17e62871e2660843a8 | flexget/plugins/input_listdir.py | flexget/plugins/input_listdir.py | import logging
from flexget.plugin import *
log = logging.getLogger('listdir')
class InputListdir:
"""
Uses local path content as an input.
Example:
listdir: /storage/movies/
"""
def validator(self):
from flexget import validator
root = valid... | import logging
from flexget.plugin import register_plugin
log = logging.getLogger('listdir')
class InputListdir:
"""
Uses local path content as an input.
Example:
listdir: /storage/movies/
"""
def validator(self):
from flexget import validator
root = validator.f... | Fix url of entries made by listdir on Windows. | Fix url of entries made by listdir on Windows.
git-svn-id: ad91b9aa7ba7638d69f912c9f5d012e3326e9f74@1586 3942dd89-8c5d-46d7-aeed-044bccf3e60c
| Python | mit | LynxyssCZ/Flexget,thalamus/Flexget,tvcsantos/Flexget,ibrahimkarahan/Flexget,patsissons/Flexget,oxc/Flexget,dsemi/Flexget,qvazzler/Flexget,poulpito/Flexget,crawln45/Flexget,Flexget/Flexget,ZefQ/Flexget,malkavi/Flexget,malkavi/Flexget,oxc/Flexget,JorisDeRieck/Flexget,crawln45/Flexget,sean797/Flexget,jawilson/Flexget,dsem... | import logging
from flexget.plugin import *
log = logging.getLogger('listdir')
class InputListdir:
"""
Uses local path content as an input.
Example:
listdir: /storage/movies/
"""
def validator(self):
from flexget import validator
root = valid... | import logging
from flexget.plugin import register_plugin
log = logging.getLogger('listdir')
class InputListdir:
"""
Uses local path content as an input.
Example:
listdir: /storage/movies/
"""
def validator(self):
from flexget import validator
root = validator.f... | <commit_before>import logging
from flexget.plugin import *
log = logging.getLogger('listdir')
class InputListdir:
"""
Uses local path content as an input.
Example:
listdir: /storage/movies/
"""
def validator(self):
from flexget import validator
... | import logging
from flexget.plugin import register_plugin
log = logging.getLogger('listdir')
class InputListdir:
"""
Uses local path content as an input.
Example:
listdir: /storage/movies/
"""
def validator(self):
from flexget import validator
root = validator.f... | import logging
from flexget.plugin import *
log = logging.getLogger('listdir')
class InputListdir:
"""
Uses local path content as an input.
Example:
listdir: /storage/movies/
"""
def validator(self):
from flexget import validator
root = valid... | <commit_before>import logging
from flexget.plugin import *
log = logging.getLogger('listdir')
class InputListdir:
"""
Uses local path content as an input.
Example:
listdir: /storage/movies/
"""
def validator(self):
from flexget import validator
... |
bc80e5df435c5be01db2bc1547d66788276366eb | test/test_script.py | test/test_script.py | # -*- coding: UTF-8 -*-
"""
Tests for pyftpsync
"""
from __future__ import print_function
import os
import sys
import unittest
from ftpsync import pyftpsync, __version__
from test.fixture_tools import _SyncTestBase, PYFTPSYNC_TEST_FOLDER
try:
from io import StringIO
except ImportError:
from cStri... | Add tests for command line script | Add tests for command line script
| Python | mit | mar10/pyftpsync | Add tests for command line script | # -*- coding: UTF-8 -*-
"""
Tests for pyftpsync
"""
from __future__ import print_function
import os
import sys
import unittest
from ftpsync import pyftpsync, __version__
from test.fixture_tools import _SyncTestBase, PYFTPSYNC_TEST_FOLDER
try:
from io import StringIO
except ImportError:
from cStri... | <commit_before><commit_msg>Add tests for command line script<commit_after> | # -*- coding: UTF-8 -*-
"""
Tests for pyftpsync
"""
from __future__ import print_function
import os
import sys
import unittest
from ftpsync import pyftpsync, __version__
from test.fixture_tools import _SyncTestBase, PYFTPSYNC_TEST_FOLDER
try:
from io import StringIO
except ImportError:
from cStri... | Add tests for command line script# -*- coding: UTF-8 -*-
"""
Tests for pyftpsync
"""
from __future__ import print_function
import os
import sys
import unittest
from ftpsync import pyftpsync, __version__
from test.fixture_tools import _SyncTestBase, PYFTPSYNC_TEST_FOLDER
try:
from io import StringIO
e... | <commit_before><commit_msg>Add tests for command line script<commit_after># -*- coding: UTF-8 -*-
"""
Tests for pyftpsync
"""
from __future__ import print_function
import os
import sys
import unittest
from ftpsync import pyftpsync, __version__
from test.fixture_tools import _SyncTestBase, PYFTPSYNC_TEST_FOLD... | |
d5fbbc55286d249c320ed5b54460b2091a023419 | concurren-futures.py | concurren-futures.py | from concurrent.futures import ProcessPoolExecutor, ThreadPoolExecutor
import multiprocessing
from multiprocessing.pool import ThreadPool
import threading
import time
def bar(i=0):
if i == 0:
raise ValueError("bar raise")
return i ** 2
def main_Thread():
thread = threading.Thread(target=bar)
... | Add concurrent futures benchmark script | Add concurrent futures benchmark script | Python | mit | voidabhi/python-scripts,voidabhi/python-scripts,voidabhi/python-scripts,voidabhi/python-scripts,voidabhi/python-scripts | Add concurrent futures benchmark script | from concurrent.futures import ProcessPoolExecutor, ThreadPoolExecutor
import multiprocessing
from multiprocessing.pool import ThreadPool
import threading
import time
def bar(i=0):
if i == 0:
raise ValueError("bar raise")
return i ** 2
def main_Thread():
thread = threading.Thread(target=bar)
... | <commit_before><commit_msg>Add concurrent futures benchmark script<commit_after> | from concurrent.futures import ProcessPoolExecutor, ThreadPoolExecutor
import multiprocessing
from multiprocessing.pool import ThreadPool
import threading
import time
def bar(i=0):
if i == 0:
raise ValueError("bar raise")
return i ** 2
def main_Thread():
thread = threading.Thread(target=bar)
... | Add concurrent futures benchmark scriptfrom concurrent.futures import ProcessPoolExecutor, ThreadPoolExecutor
import multiprocessing
from multiprocessing.pool import ThreadPool
import threading
import time
def bar(i=0):
if i == 0:
raise ValueError("bar raise")
return i ** 2
def main_Thread():
th... | <commit_before><commit_msg>Add concurrent futures benchmark script<commit_after>from concurrent.futures import ProcessPoolExecutor, ThreadPoolExecutor
import multiprocessing
from multiprocessing.pool import ThreadPool
import threading
import time
def bar(i=0):
if i == 0:
raise ValueError("bar raise")
... | |
ee36e70c572f1ca6651b889a7fe1139c4fa7297e | plugins/playing_maps.py | plugins/playing_maps.py | from bs4 import BeautifulSoup
from plugin import CommandPlugin
import requests
import json
class PlayingMaps(CommandPlugin):
"""
Parses Overcast's maps page and prints currently playing maps
"""
ocn_maps_link = 'https://oc.tc/maps'
def __init__(self):
CommandPlugin.__init__(self)
... | Add command for listing playing OCN maps | Add command for listing playing OCN maps
| Python | mit | Plastix/nimbus,itsmartin/nimbus,bcbwilla/nimbus,Brottweiler/nimbus | Add command for listing playing OCN maps | from bs4 import BeautifulSoup
from plugin import CommandPlugin
import requests
import json
class PlayingMaps(CommandPlugin):
"""
Parses Overcast's maps page and prints currently playing maps
"""
ocn_maps_link = 'https://oc.tc/maps'
def __init__(self):
CommandPlugin.__init__(self)
... | <commit_before><commit_msg>Add command for listing playing OCN maps<commit_after> | from bs4 import BeautifulSoup
from plugin import CommandPlugin
import requests
import json
class PlayingMaps(CommandPlugin):
"""
Parses Overcast's maps page and prints currently playing maps
"""
ocn_maps_link = 'https://oc.tc/maps'
def __init__(self):
CommandPlugin.__init__(self)
... | Add command for listing playing OCN mapsfrom bs4 import BeautifulSoup
from plugin import CommandPlugin
import requests
import json
class PlayingMaps(CommandPlugin):
"""
Parses Overcast's maps page and prints currently playing maps
"""
ocn_maps_link = 'https://oc.tc/maps'
def __init__(self):
... | <commit_before><commit_msg>Add command for listing playing OCN maps<commit_after>from bs4 import BeautifulSoup
from plugin import CommandPlugin
import requests
import json
class PlayingMaps(CommandPlugin):
"""
Parses Overcast's maps page and prints currently playing maps
"""
ocn_maps_link = 'https://... | |
5752df3cf5e77e76836376846db6c3cbcbfe2ef7 | troposphere/ecs.py | troposphere/ecs.py | from . import AWSObject, AWSProperty
from .validators import boolean, network_port, integer
class Cluster(AWSObject):
resource_type = "AWS::ECS::Cluster"
props = {}
class LoadBalancer(AWSProperty):
props = {
'ContainerName': (basestring, False),
'ContainerPort': (network_port, False),
... | Add EC2 Container Service (ECS) | Add EC2 Container Service (ECS) | Python | bsd-2-clause | Yipit/troposphere,xxxVxxx/troposphere,samcrang/troposphere,ptoraskar/troposphere,horacio3/troposphere,jdc0589/troposphere,amosshapira/troposphere,7digital/troposphere,micahhausler/troposphere,LouTheBrew/troposphere,ikben/troposphere,cloudtools/troposphere,johnctitus/troposphere,cryptickp/troposphere,cloudtools/troposph... | Add EC2 Container Service (ECS) | from . import AWSObject, AWSProperty
from .validators import boolean, network_port, integer
class Cluster(AWSObject):
resource_type = "AWS::ECS::Cluster"
props = {}
class LoadBalancer(AWSProperty):
props = {
'ContainerName': (basestring, False),
'ContainerPort': (network_port, False),
... | <commit_before><commit_msg>Add EC2 Container Service (ECS)<commit_after> | from . import AWSObject, AWSProperty
from .validators import boolean, network_port, integer
class Cluster(AWSObject):
resource_type = "AWS::ECS::Cluster"
props = {}
class LoadBalancer(AWSProperty):
props = {
'ContainerName': (basestring, False),
'ContainerPort': (network_port, False),
... | Add EC2 Container Service (ECS)from . import AWSObject, AWSProperty
from .validators import boolean, network_port, integer
class Cluster(AWSObject):
resource_type = "AWS::ECS::Cluster"
props = {}
class LoadBalancer(AWSProperty):
props = {
'ContainerName': (basestring, False),
'Container... | <commit_before><commit_msg>Add EC2 Container Service (ECS)<commit_after>from . import AWSObject, AWSProperty
from .validators import boolean, network_port, integer
class Cluster(AWSObject):
resource_type = "AWS::ECS::Cluster"
props = {}
class LoadBalancer(AWSProperty):
props = {
'ContainerName'... | |
a443c1bf29cc27ea8e1e58f22444d1e6b6587975 | config.py | config.py | from tabs.bitcoin import BitcoinPrice, Bitcoind
from tabs.sysinfo import SystemStats, DiskUsage
from tabs.uptime import WebsiteUptime
import os
# Add any tabs you want to be visible here
tabs = [ # Track a running Bitcoin node
#Bitcoind({"host": "http://127.0.0.1:8332",
# "username": "bitco... | Fix some issues with Bitcoind and WebsiteUptime tabs | Fix some issues with Bitcoind and WebsiteUptime tabs
| Python | unlicense | Matoking/SHOWtime,Matoking/SHOWtime,Matoking/SHOWtime | Fix some issues with Bitcoind and WebsiteUptime tabs | from tabs.bitcoin import BitcoinPrice, Bitcoind
from tabs.sysinfo import SystemStats, DiskUsage
from tabs.uptime import WebsiteUptime
import os
# Add any tabs you want to be visible here
tabs = [ # Track a running Bitcoin node
#Bitcoind({"host": "http://127.0.0.1:8332",
# "username": "bitco... | <commit_before><commit_msg>Fix some issues with Bitcoind and WebsiteUptime tabs<commit_after> | from tabs.bitcoin import BitcoinPrice, Bitcoind
from tabs.sysinfo import SystemStats, DiskUsage
from tabs.uptime import WebsiteUptime
import os
# Add any tabs you want to be visible here
tabs = [ # Track a running Bitcoin node
#Bitcoind({"host": "http://127.0.0.1:8332",
# "username": "bitco... | Fix some issues with Bitcoind and WebsiteUptime tabsfrom tabs.bitcoin import BitcoinPrice, Bitcoind
from tabs.sysinfo import SystemStats, DiskUsage
from tabs.uptime import WebsiteUptime
import os
# Add any tabs you want to be visible here
tabs = [ # Track a running Bitcoin node
#Bitcoind({"host": "http://127... | <commit_before><commit_msg>Fix some issues with Bitcoind and WebsiteUptime tabs<commit_after>from tabs.bitcoin import BitcoinPrice, Bitcoind
from tabs.sysinfo import SystemStats, DiskUsage
from tabs.uptime import WebsiteUptime
import os
# Add any tabs you want to be visible here
tabs = [ # Track a running Bitcoin nod... | |
3debec0c40472d0eb43f94b6769ef1d8cc80383d | py/reverse-string-ii.py | py/reverse-string-ii.py | class Solution(object):
def reverseStr(self, s, k):
"""
:type s: str
:type k: int
:rtype: str
"""
ans = []
for i in xrange(0, len(s), k * 2):
ans.append(s[i:i + k][::-1] + s[i + k:i + 2 * k])
return ''.join(ans)
| Add py solution for 541. Reverse String II | Add py solution for 541. Reverse String II
541. Reverse String II: https://leetcode.com/problems/reverse-string-ii/
| Python | apache-2.0 | ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode | Add py solution for 541. Reverse String II
541. Reverse String II: https://leetcode.com/problems/reverse-string-ii/ | class Solution(object):
def reverseStr(self, s, k):
"""
:type s: str
:type k: int
:rtype: str
"""
ans = []
for i in xrange(0, len(s), k * 2):
ans.append(s[i:i + k][::-1] + s[i + k:i + 2 * k])
return ''.join(ans)
| <commit_before><commit_msg>Add py solution for 541. Reverse String II
541. Reverse String II: https://leetcode.com/problems/reverse-string-ii/<commit_after> | class Solution(object):
def reverseStr(self, s, k):
"""
:type s: str
:type k: int
:rtype: str
"""
ans = []
for i in xrange(0, len(s), k * 2):
ans.append(s[i:i + k][::-1] + s[i + k:i + 2 * k])
return ''.join(ans)
| Add py solution for 541. Reverse String II
541. Reverse String II: https://leetcode.com/problems/reverse-string-ii/class Solution(object):
def reverseStr(self, s, k):
"""
:type s: str
:type k: int
:rtype: str
"""
ans = []
for i in xrange(0, len(s), k * 2):
... | <commit_before><commit_msg>Add py solution for 541. Reverse String II
541. Reverse String II: https://leetcode.com/problems/reverse-string-ii/<commit_after>class Solution(object):
def reverseStr(self, s, k):
"""
:type s: str
:type k: int
:rtype: str
"""
ans = []
... | |
30f7dd1c1d36fffe98147c7de76f09bb81a3a5be | src/split_node.py | src/split_node.py | class SplitNode:
# TODO Naming convention
"""
Type: Node
Function: Splits the dataset into 2 sets
Input port requirements: DATASET, PERCENTAGES
Output port promises: a tuple that contains the 2 new sets
"""
def __init__(self, input_port, output_port1, output_port2):
self.input_port = input_port
... | Split Node initial commit. Class is created with its primary feature | Split Node initial commit. Class is created with its primary feature
| Python | mit | sshihata/mash | Split Node initial commit. Class is created with its primary feature | class SplitNode:
# TODO Naming convention
"""
Type: Node
Function: Splits the dataset into 2 sets
Input port requirements: DATASET, PERCENTAGES
Output port promises: a tuple that contains the 2 new sets
"""
def __init__(self, input_port, output_port1, output_port2):
self.input_port = input_port
... | <commit_before><commit_msg>Split Node initial commit. Class is created with its primary feature<commit_after> | class SplitNode:
# TODO Naming convention
"""
Type: Node
Function: Splits the dataset into 2 sets
Input port requirements: DATASET, PERCENTAGES
Output port promises: a tuple that contains the 2 new sets
"""
def __init__(self, input_port, output_port1, output_port2):
self.input_port = input_port
... | Split Node initial commit. Class is created with its primary featureclass SplitNode:
# TODO Naming convention
"""
Type: Node
Function: Splits the dataset into 2 sets
Input port requirements: DATASET, PERCENTAGES
Output port promises: a tuple that contains the 2 new sets
"""
def __init__(self, input_po... | <commit_before><commit_msg>Split Node initial commit. Class is created with its primary feature<commit_after>class SplitNode:
# TODO Naming convention
"""
Type: Node
Function: Splits the dataset into 2 sets
Input port requirements: DATASET, PERCENTAGES
Output port promises: a tuple that contains the 2 new ... | |
ad08e17bef38a1efc7f395d02938b08643756706 | test_documents.py | test_documents.py | #!/bin/python
import MySQLdb
import argparse
import os
parser = argparse.ArgumentParser(description='Test documents of SugarCRM')
parser.add_argument('--remove', type=bool, default=False,
help='delete documents')
args = parser.parse_args()
HOST = "localhost"
USER = "database_user"
PASSWD = "database_password"
DB ... | Add script to test if documents exist | Add script to test if documents exist
| Python | mit | pokoli/sugarcrm_document_uploader | Add script to test if documents exist | #!/bin/python
import MySQLdb
import argparse
import os
parser = argparse.ArgumentParser(description='Test documents of SugarCRM')
parser.add_argument('--remove', type=bool, default=False,
help='delete documents')
args = parser.parse_args()
HOST = "localhost"
USER = "database_user"
PASSWD = "database_password"
DB ... | <commit_before><commit_msg>Add script to test if documents exist<commit_after> | #!/bin/python
import MySQLdb
import argparse
import os
parser = argparse.ArgumentParser(description='Test documents of SugarCRM')
parser.add_argument('--remove', type=bool, default=False,
help='delete documents')
args = parser.parse_args()
HOST = "localhost"
USER = "database_user"
PASSWD = "database_password"
DB ... | Add script to test if documents exist#!/bin/python
import MySQLdb
import argparse
import os
parser = argparse.ArgumentParser(description='Test documents of SugarCRM')
parser.add_argument('--remove', type=bool, default=False,
help='delete documents')
args = parser.parse_args()
HOST = "localhost"
USER = "database_u... | <commit_before><commit_msg>Add script to test if documents exist<commit_after>#!/bin/python
import MySQLdb
import argparse
import os
parser = argparse.ArgumentParser(description='Test documents of SugarCRM')
parser.add_argument('--remove', type=bool, default=False,
help='delete documents')
args = parser.parse_args... | |
a634d90e4ac80027466782975007de33afcb4c28 | etc/wpt-summarize.py | etc/wpt-summarize.py | #!/usr/bin/env python
# Copyright 2019 The Servo Project Developers. See the COPYRIGHT
# file at the top-level directory of this distribution.
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
# <LICENSE-MIT or http://opensource.org/l... | Add a script to extra logs for particular test filenames from full WPT logs. | Add a script to extra logs for particular test filenames from full WPT logs. | Python | mpl-2.0 | KiChjang/servo,DominoTree/servo,splav/servo,splav/servo,DominoTree/servo,KiChjang/servo,KiChjang/servo,DominoTree/servo,splav/servo,DominoTree/servo,splav/servo,splav/servo,KiChjang/servo,DominoTree/servo,splav/servo,DominoTree/servo,DominoTree/servo,splav/servo,DominoTree/servo,KiChjang/servo,splav/servo,DominoTree/se... | Add a script to extra logs for particular test filenames from full WPT logs. | #!/usr/bin/env python
# Copyright 2019 The Servo Project Developers. See the COPYRIGHT
# file at the top-level directory of this distribution.
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
# <LICENSE-MIT or http://opensource.org/l... | <commit_before><commit_msg>Add a script to extra logs for particular test filenames from full WPT logs.<commit_after> | #!/usr/bin/env python
# Copyright 2019 The Servo Project Developers. See the COPYRIGHT
# file at the top-level directory of this distribution.
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
# <LICENSE-MIT or http://opensource.org/l... | Add a script to extra logs for particular test filenames from full WPT logs.#!/usr/bin/env python
# Copyright 2019 The Servo Project Developers. See the COPYRIGHT
# file at the top-level directory of this distribution.
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# http://www.apache.org/licens... | <commit_before><commit_msg>Add a script to extra logs for particular test filenames from full WPT logs.<commit_after>#!/usr/bin/env python
# Copyright 2019 The Servo Project Developers. See the COPYRIGHT
# file at the top-level directory of this distribution.
#
# Licensed under the Apache License, Version 2.0 <LICENSE... | |
17a632d3474d66652f4fa15b3365ab14c7316870 | Graphs/check_bst.py | Graphs/check_bst.py | """
Write a program to check if a given binary tree is bst or not.
"""
"""
Approach 1:
1. For each node, check that node's value is greater than max_value in its left subtree and smaller than
min_value in its right subtree.
2. This approach is not efficient as each node is traversed multiple times.
Approach 2:
1. ... | Check if binary tree is a BST | Check if binary tree is a BST
| Python | mit | prathamtandon/g4gproblems | Check if binary tree is a BST | """
Write a program to check if a given binary tree is bst or not.
"""
"""
Approach 1:
1. For each node, check that node's value is greater than max_value in its left subtree and smaller than
min_value in its right subtree.
2. This approach is not efficient as each node is traversed multiple times.
Approach 2:
1. ... | <commit_before><commit_msg>Check if binary tree is a BST<commit_after> | """
Write a program to check if a given binary tree is bst or not.
"""
"""
Approach 1:
1. For each node, check that node's value is greater than max_value in its left subtree and smaller than
min_value in its right subtree.
2. This approach is not efficient as each node is traversed multiple times.
Approach 2:
1. ... | Check if binary tree is a BST"""
Write a program to check if a given binary tree is bst or not.
"""
"""
Approach 1:
1. For each node, check that node's value is greater than max_value in its left subtree and smaller than
min_value in its right subtree.
2. This approach is not efficient as each node is traversed mul... | <commit_before><commit_msg>Check if binary tree is a BST<commit_after>"""
Write a program to check if a given binary tree is bst or not.
"""
"""
Approach 1:
1. For each node, check that node's value is greater than max_value in its left subtree and smaller than
min_value in its right subtree.
2. This approach is no... | |
1528b501e0125db0e054c2fd27820ec4384807a1 | experiments/pc_hybridization.py | experiments/pc_hybridization.py | """Solve a mixed Helmholtz problem
sigma + grad(u) = 0,
u + div(sigma) = f,
using hybridisation with SLATE performing the forward elimination and
backwards reconstructions. The corresponding finite element variational
problem is:
dot(sigma, tau)*dx - u*div(tau)*dx + lambdar*dot(tau, n)*dS = 0
div(sigma)*v*dx + u*v*d... | Add complete hybridization test with python PC | Add complete hybridization test with python PC
| Python | mit | thomasgibson/tabula-rasa | Add complete hybridization test with python PC | """Solve a mixed Helmholtz problem
sigma + grad(u) = 0,
u + div(sigma) = f,
using hybridisation with SLATE performing the forward elimination and
backwards reconstructions. The corresponding finite element variational
problem is:
dot(sigma, tau)*dx - u*div(tau)*dx + lambdar*dot(tau, n)*dS = 0
div(sigma)*v*dx + u*v*d... | <commit_before><commit_msg>Add complete hybridization test with python PC<commit_after> | """Solve a mixed Helmholtz problem
sigma + grad(u) = 0,
u + div(sigma) = f,
using hybridisation with SLATE performing the forward elimination and
backwards reconstructions. The corresponding finite element variational
problem is:
dot(sigma, tau)*dx - u*div(tau)*dx + lambdar*dot(tau, n)*dS = 0
div(sigma)*v*dx + u*v*d... | Add complete hybridization test with python PC"""Solve a mixed Helmholtz problem
sigma + grad(u) = 0,
u + div(sigma) = f,
using hybridisation with SLATE performing the forward elimination and
backwards reconstructions. The corresponding finite element variational
problem is:
dot(sigma, tau)*dx - u*div(tau)*dx + lamb... | <commit_before><commit_msg>Add complete hybridization test with python PC<commit_after>"""Solve a mixed Helmholtz problem
sigma + grad(u) = 0,
u + div(sigma) = f,
using hybridisation with SLATE performing the forward elimination and
backwards reconstructions. The corresponding finite element variational
problem is:
... | |
22a500afb9e03f59d33a6c9ee02a5fee6b164cba | SizeDocGenerator.py | SizeDocGenerator.py | import os, re;
# I got the actual size of the binary code wrong on the site once - this script should help prevent that.
dsDoc_by_sArch = {"w32": "x86", "w64": "x64", "win": "x86+x64"};
with open("build_info.txt", "rb") as oFile:
iBuildNumber = int(re.search(r"build number\: (\d+)", oFile.read(), re.M).group(1)... | Add script to generate the site documentation containing the sizes of the binary shellcodes. | Add script to generate the site documentation containing the sizes of the binary shellcodes. | Python | bsd-3-clause | CryptXor/win-exec-calc-shellcode,r3dbrain/win-exec-calc-shellcode,CryptXor/win-exec-calc-shellcode,r3dbrain/win-exec-calc-shellcode,Templario17/win-exec-calc-shellcode,Templario17/win-exec-calc-shellcode | Add script to generate the site documentation containing the sizes of the binary shellcodes. | import os, re;
# I got the actual size of the binary code wrong on the site once - this script should help prevent that.
dsDoc_by_sArch = {"w32": "x86", "w64": "x64", "win": "x86+x64"};
with open("build_info.txt", "rb") as oFile:
iBuildNumber = int(re.search(r"build number\: (\d+)", oFile.read(), re.M).group(1)... | <commit_before><commit_msg>Add script to generate the site documentation containing the sizes of the binary shellcodes.<commit_after> | import os, re;
# I got the actual size of the binary code wrong on the site once - this script should help prevent that.
dsDoc_by_sArch = {"w32": "x86", "w64": "x64", "win": "x86+x64"};
with open("build_info.txt", "rb") as oFile:
iBuildNumber = int(re.search(r"build number\: (\d+)", oFile.read(), re.M).group(1)... | Add script to generate the site documentation containing the sizes of the binary shellcodes.import os, re;
# I got the actual size of the binary code wrong on the site once - this script should help prevent that.
dsDoc_by_sArch = {"w32": "x86", "w64": "x64", "win": "x86+x64"};
with open("build_info.txt", "rb") as ... | <commit_before><commit_msg>Add script to generate the site documentation containing the sizes of the binary shellcodes.<commit_after>import os, re;
# I got the actual size of the binary code wrong on the site once - this script should help prevent that.
dsDoc_by_sArch = {"w32": "x86", "w64": "x64", "win": "x86+x64"... | |
7d26f961a4e6eff6f9dad7b42a04a8648efdefb8 | .travis-output.py | .travis-output.py | #!/usr/bin/python3
import io
import pexpect
import string
import sys
import time
sys.stdin = io.TextIOWrapper(sys.stdin.detach(), newline='')
output_to=sys.stdout
args = list(sys.argv[1:])
logfile = open(args.pop(0), "w")
child = pexpect.spawn(' '.join(args))
def output_line(line_bits, last_skip):
line = "".join... | Clean up the travis log output. | Clean up the travis log output.
| Python | apache-2.0 | litex-hub/litex-conda-ci,litex-hub/litex-conda-ci | Clean up the travis log output. | #!/usr/bin/python3
import io
import pexpect
import string
import sys
import time
sys.stdin = io.TextIOWrapper(sys.stdin.detach(), newline='')
output_to=sys.stdout
args = list(sys.argv[1:])
logfile = open(args.pop(0), "w")
child = pexpect.spawn(' '.join(args))
def output_line(line_bits, last_skip):
line = "".join... | <commit_before><commit_msg>Clean up the travis log output.<commit_after> | #!/usr/bin/python3
import io
import pexpect
import string
import sys
import time
sys.stdin = io.TextIOWrapper(sys.stdin.detach(), newline='')
output_to=sys.stdout
args = list(sys.argv[1:])
logfile = open(args.pop(0), "w")
child = pexpect.spawn(' '.join(args))
def output_line(line_bits, last_skip):
line = "".join... | Clean up the travis log output.#!/usr/bin/python3
import io
import pexpect
import string
import sys
import time
sys.stdin = io.TextIOWrapper(sys.stdin.detach(), newline='')
output_to=sys.stdout
args = list(sys.argv[1:])
logfile = open(args.pop(0), "w")
child = pexpect.spawn(' '.join(args))
def output_line(line_bit... | <commit_before><commit_msg>Clean up the travis log output.<commit_after>#!/usr/bin/python3
import io
import pexpect
import string
import sys
import time
sys.stdin = io.TextIOWrapper(sys.stdin.detach(), newline='')
output_to=sys.stdout
args = list(sys.argv[1:])
logfile = open(args.pop(0), "w")
child = pexpect.spawn(... | |
f11f82e39d115129081c733e99b9cadff93a27ec | candidates/tests/test_signup.py | candidates/tests/test_signup.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from usersettings.shortcuts import get_current_usersettings
from django_webtest import WebTest
from django.core.urlresolvers import reverse
from .settings import SettingsMixin
class SettingsTests(SettingsMixin, WebTest):
def test_signup_allowed(... | Test to check switching off user signup | Test to check switching off user signup
| Python | agpl-3.0 | mysociety/yournextmp-popit,mysociety/yournextrepresentative,mysociety/yournextrepresentative,mysociety/yournextrepresentative,mysociety/yournextmp-popit,mysociety/yournextmp-popit,mysociety/yournextrepresentative,mysociety/yournextrepresentative,mysociety/yournextmp-popit,mysociety/yournextmp-popit | Test to check switching off user signup | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from usersettings.shortcuts import get_current_usersettings
from django_webtest import WebTest
from django.core.urlresolvers import reverse
from .settings import SettingsMixin
class SettingsTests(SettingsMixin, WebTest):
def test_signup_allowed(... | <commit_before><commit_msg>Test to check switching off user signup<commit_after> | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from usersettings.shortcuts import get_current_usersettings
from django_webtest import WebTest
from django.core.urlresolvers import reverse
from .settings import SettingsMixin
class SettingsTests(SettingsMixin, WebTest):
def test_signup_allowed(... | Test to check switching off user signup# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from usersettings.shortcuts import get_current_usersettings
from django_webtest import WebTest
from django.core.urlresolvers import reverse
from .settings import SettingsMixin
class SettingsTests(SettingsMixin, ... | <commit_before><commit_msg>Test to check switching off user signup<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from usersettings.shortcuts import get_current_usersettings
from django_webtest import WebTest
from django.core.urlresolvers import reverse
from .settings import SettingsMi... | |
632fecc86b5b431e77cbb046268f17f7e2fa0b5a | web.py | web.py | from flask import Flask
from database_setup import User, session
app = Flask(__name__)
@app.route('/')
@app.route('/hello')
def HelloWorld():
users = session.query(User)
output = ''
for user in users:
output += user.username
output += '</br>'
return output
if __name__ == '__main__':
... | Add a minimal Flask application | Add a minimal Flask application
| Python | unknown | gregcowell/BAM,gregcowell/PFT,gregcowell/PFT,gregcowell/BAM | Add a minimal Flask application | from flask import Flask
from database_setup import User, session
app = Flask(__name__)
@app.route('/')
@app.route('/hello')
def HelloWorld():
users = session.query(User)
output = ''
for user in users:
output += user.username
output += '</br>'
return output
if __name__ == '__main__':
... | <commit_before><commit_msg>Add a minimal Flask application<commit_after> | from flask import Flask
from database_setup import User, session
app = Flask(__name__)
@app.route('/')
@app.route('/hello')
def HelloWorld():
users = session.query(User)
output = ''
for user in users:
output += user.username
output += '</br>'
return output
if __name__ == '__main__':
... | Add a minimal Flask applicationfrom flask import Flask
from database_setup import User, session
app = Flask(__name__)
@app.route('/')
@app.route('/hello')
def HelloWorld():
users = session.query(User)
output = ''
for user in users:
output += user.username
output += '</br>'
return outp... | <commit_before><commit_msg>Add a minimal Flask application<commit_after>from flask import Flask
from database_setup import User, session
app = Flask(__name__)
@app.route('/')
@app.route('/hello')
def HelloWorld():
users = session.query(User)
output = ''
for user in users:
output += user.username
... | |
b2415a08ca5e8688cb0e5e8ffe38d5b842171ecb | wrench/reftest-debugger.py | wrench/reftest-debugger.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/.
import subprocess
with open('reftest.log', "w") as out:
try:
subprocess.check_call(['./h... | Add a script to run reftests and spawn reftest analyzer. | Add a script to run reftests and spawn reftest analyzer.
This probably only works on Linux, and will need some changes
to support running on Mac and Windows.
Fixes #1863.
| Python | mpl-2.0 | servo/webrender,servo/webrender,servo/webrender,servo/webrender,servo/webrender,servo/webrender | Add a script to run reftests and spawn reftest analyzer.
This probably only works on Linux, and will need some changes
to support running on Mac and Windows.
Fixes #1863. | #!/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/.
import subprocess
with open('reftest.log', "w") as out:
try:
subprocess.check_call(['./h... | <commit_before><commit_msg>Add a script to run reftests and spawn reftest analyzer.
This probably only works on Linux, and will need some changes
to support running on Mac and Windows.
Fixes #1863.<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/.
import subprocess
with open('reftest.log', "w") as out:
try:
subprocess.check_call(['./h... | Add a script to run reftests and spawn reftest analyzer.
This probably only works on Linux, and will need some changes
to support running on Mac and Windows.
Fixes #1863.#!/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... | <commit_before><commit_msg>Add a script to run reftests and spawn reftest analyzer.
This probably only works on Linux, and will need some changes
to support running on Mac and Windows.
Fixes #1863.<commit_after>#!/usr/bin/python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0.... | |
0f1b0dec702e314c4e891115b7b72adac7896402 | src/ggrc/converters/__init__.py | src/ggrc/converters/__init__.py | # Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: [email protected]
# Maintained By: [email protected]
from ggrc.models import (
Audit, Control, ControlAssessment, DataAsset, Dire... | Add convertes folder with init python file | Add convertes folder with init python file
Add the folder that will contain all files related to import export. The
init file contains:
- Column order for csv files.
- Mapping rules that will be used for setting mapping columns
- List of all objects that are/should be importable.
| Python | apache-2.0 | edofic/ggrc-core,prasannav7/ggrc-core,jmakov/ggrc-core,prasannav7/ggrc-core,plamut/ggrc-core,prasannav7/ggrc-core,prasannav7/ggrc-core,plamut/ggrc-core,hyperNURb/ggrc-core,VinnieJohns/ggrc-core,jmakov/ggrc-core,hasanalom/ggrc-core,andrei-karalionak/ggrc-core,j0gurt/ggrc-core,josthkko/ggrc-core,hyperNURb/ggrc-core,jmako... | Add convertes folder with init python file
Add the folder that will contain all files related to import export. The
init file contains:
- Column order for csv files.
- Mapping rules that will be used for setting mapping columns
- List of all objects that are/should be importable. | # Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: [email protected]
# Maintained By: [email protected]
from ggrc.models import (
Audit, Control, ControlAssessment, DataAsset, Dire... | <commit_before><commit_msg>Add convertes folder with init python file
Add the folder that will contain all files related to import export. The
init file contains:
- Column order for csv files.
- Mapping rules that will be used for setting mapping columns
- List of all objects that are/should be importable.<commit_aft... | # Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: [email protected]
# Maintained By: [email protected]
from ggrc.models import (
Audit, Control, ControlAssessment, DataAsset, Dire... | Add convertes folder with init python file
Add the folder that will contain all files related to import export. The
init file contains:
- Column order for csv files.
- Mapping rules that will be used for setting mapping columns
- List of all objects that are/should be importable.# Copyright (C) 2015 Google Inc., auth... | <commit_before><commit_msg>Add convertes folder with init python file
Add the folder that will contain all files related to import export. The
init file contains:
- Column order for csv files.
- Mapping rules that will be used for setting mapping columns
- List of all objects that are/should be importable.<commit_aft... | |
9f7e1acdaa5a86c25c3d9f9bc6cd84a55b31b83f | speech/unit_tests/test_result.py | speech/unit_tests/test_result.py | # Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | Add test file for Result class. | Add test file for Result class.
| Python | apache-2.0 | jonparrott/gcloud-python,tseaver/gcloud-python,GoogleCloudPlatform/gcloud-python,calpeyser/google-cloud-python,tseaver/google-cloud-python,dhermes/google-cloud-python,dhermes/google-cloud-python,jonparrott/google-cloud-python,dhermes/gcloud-python,GoogleCloudPlatform/gcloud-python,tswast/google-cloud-python,googleapis/... | Add test file for Result class. | # Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | <commit_before><commit_msg>Add test file for Result class.<commit_after> | # Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | Add test file for Result class.# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | <commit_before><commit_msg>Add test file for Result class.<commit_after># Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LIC... | |
114f9c1c887a4fc6f92165edf8f62576687e314b | scripts/find_nested_projects.py | scripts/find_nested_projects.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Helper to get a list of all projects that are nested within another project."""
from website.project.model import Node
from modularodm import Q
from tests.base import OsfTestCase
from tests.factories import ProjectFactory
def find_nested_projects():
return [node ... | Add script to get nested projects | Add script to get nested projects
| Python | apache-2.0 | laurenrevere/osf.io,ckc6cz/osf.io,petermalcolm/osf.io,baylee-d/osf.io,zachjanicki/osf.io,chrisseto/osf.io,petermalcolm/osf.io,petermalcolm/osf.io,ckc6cz/osf.io,cwisecarver/osf.io,RomanZWang/osf.io,cslzchen/osf.io,TomHeatwole/osf.io,himanshuo/osf.io,jeffreyliu3230/osf.io,lyndsysimon/osf.io,amyshi188/osf.io,samchrisinger... | Add script to get nested projects | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Helper to get a list of all projects that are nested within another project."""
from website.project.model import Node
from modularodm import Q
from tests.base import OsfTestCase
from tests.factories import ProjectFactory
def find_nested_projects():
return [node ... | <commit_before><commit_msg>Add script to get nested projects<commit_after> | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Helper to get a list of all projects that are nested within another project."""
from website.project.model import Node
from modularodm import Q
from tests.base import OsfTestCase
from tests.factories import ProjectFactory
def find_nested_projects():
return [node ... | Add script to get nested projects#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Helper to get a list of all projects that are nested within another project."""
from website.project.model import Node
from modularodm import Q
from tests.base import OsfTestCase
from tests.factories import ProjectFactory
def find_nes... | <commit_before><commit_msg>Add script to get nested projects<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Helper to get a list of all projects that are nested within another project."""
from website.project.model import Node
from modularodm import Q
from tests.base import OsfTestCase
from tests.facto... | |
a6d3b4b8a322a2642a575fe7ab81eee4d3ac40a7 | scripts/update_rows_from_csv.py | scripts/update_rows_from_csv.py | # The purpose of this script to update database with a CSV
import os
import sys
import psycopg2
import dotenv
# Load environment variable from a .env file
dotenv.load_dotenv('.env')
csv_path = sys.argv[1]
postgres_url = os.getenv('DATABASE_URL')[11:]
user_tokens = postgres_url.split(':')
user_name = user_tokens[0]
... | Add a script to update users with a CSV | Add a script to update users with a CSV
| Python | agpl-3.0 | rohitdatta/pepper,rohitdatta/pepper,rohitdatta/pepper | Add a script to update users with a CSV | # The purpose of this script to update database with a CSV
import os
import sys
import psycopg2
import dotenv
# Load environment variable from a .env file
dotenv.load_dotenv('.env')
csv_path = sys.argv[1]
postgres_url = os.getenv('DATABASE_URL')[11:]
user_tokens = postgres_url.split(':')
user_name = user_tokens[0]
... | <commit_before><commit_msg>Add a script to update users with a CSV<commit_after> | # The purpose of this script to update database with a CSV
import os
import sys
import psycopg2
import dotenv
# Load environment variable from a .env file
dotenv.load_dotenv('.env')
csv_path = sys.argv[1]
postgres_url = os.getenv('DATABASE_URL')[11:]
user_tokens = postgres_url.split(':')
user_name = user_tokens[0]
... | Add a script to update users with a CSV# The purpose of this script to update database with a CSV
import os
import sys
import psycopg2
import dotenv
# Load environment variable from a .env file
dotenv.load_dotenv('.env')
csv_path = sys.argv[1]
postgres_url = os.getenv('DATABASE_URL')[11:]
user_tokens = postgres_url... | <commit_before><commit_msg>Add a script to update users with a CSV<commit_after># The purpose of this script to update database with a CSV
import os
import sys
import psycopg2
import dotenv
# Load environment variable from a .env file
dotenv.load_dotenv('.env')
csv_path = sys.argv[1]
postgres_url = os.getenv('DATAB... | |
c4541bc0947cd6f5fd81ed1750de3d7046184d68 | beta_plotting.py | beta_plotting.py | #!/usr/bin/env python
import numpy as np
#import matplotlib
#matplotlib.use('agg')
import matplotlib.pyplot as plt
import castep_isotope_sub
def plot_beta(Ts, betas):
Tsm1 = 1E6/(Ts**2.0)
fix, ax1 = plt.subplots()
ax1.plot(Tsm1, betas, "b-")
ax1.set_ylabel("1000 * ln beta")
ax1.set_xlabel("1000... | Add tool to plot beta | Add tool to plot beta
| Python | bsd-3-clause | andreww/isofrac | Add tool to plot beta | #!/usr/bin/env python
import numpy as np
#import matplotlib
#matplotlib.use('agg')
import matplotlib.pyplot as plt
import castep_isotope_sub
def plot_beta(Ts, betas):
Tsm1 = 1E6/(Ts**2.0)
fix, ax1 = plt.subplots()
ax1.plot(Tsm1, betas, "b-")
ax1.set_ylabel("1000 * ln beta")
ax1.set_xlabel("1000... | <commit_before><commit_msg>Add tool to plot beta<commit_after> | #!/usr/bin/env python
import numpy as np
#import matplotlib
#matplotlib.use('agg')
import matplotlib.pyplot as plt
import castep_isotope_sub
def plot_beta(Ts, betas):
Tsm1 = 1E6/(Ts**2.0)
fix, ax1 = plt.subplots()
ax1.plot(Tsm1, betas, "b-")
ax1.set_ylabel("1000 * ln beta")
ax1.set_xlabel("1000... | Add tool to plot beta#!/usr/bin/env python
import numpy as np
#import matplotlib
#matplotlib.use('agg')
import matplotlib.pyplot as plt
import castep_isotope_sub
def plot_beta(Ts, betas):
Tsm1 = 1E6/(Ts**2.0)
fix, ax1 = plt.subplots()
ax1.plot(Tsm1, betas, "b-")
ax1.set_ylabel("1000 * ln beta")
... | <commit_before><commit_msg>Add tool to plot beta<commit_after>#!/usr/bin/env python
import numpy as np
#import matplotlib
#matplotlib.use('agg')
import matplotlib.pyplot as plt
import castep_isotope_sub
def plot_beta(Ts, betas):
Tsm1 = 1E6/(Ts**2.0)
fix, ax1 = plt.subplots()
ax1.plot(Tsm1, betas, "b-")... | |
e1bb23fa54e8ec3fc022d55bbc4c6a954f5b76c3 | dpmm.py | dpmm.py | """ Going to try algorithm 1 from Neal (2000)
"""
import numpy as np
import bisect
def pick_discrete(p):
"""Pick a discrete integer between 0 and len(p) - 1 with probability given by p array."""
c = np.cumsum(p)
u = np.random.uniform()
return bisect.bisect_left(c, u)
class DPMM(object):
"""Diri... | Create Dirichlet Process Mixture Model class. | Create Dirichlet Process Mixture Model class.
| Python | bsd-2-clause | jmeyers314/DPMM | Create Dirichlet Process Mixture Model class. | """ Going to try algorithm 1 from Neal (2000)
"""
import numpy as np
import bisect
def pick_discrete(p):
"""Pick a discrete integer between 0 and len(p) - 1 with probability given by p array."""
c = np.cumsum(p)
u = np.random.uniform()
return bisect.bisect_left(c, u)
class DPMM(object):
"""Diri... | <commit_before><commit_msg>Create Dirichlet Process Mixture Model class.<commit_after> | """ Going to try algorithm 1 from Neal (2000)
"""
import numpy as np
import bisect
def pick_discrete(p):
"""Pick a discrete integer between 0 and len(p) - 1 with probability given by p array."""
c = np.cumsum(p)
u = np.random.uniform()
return bisect.bisect_left(c, u)
class DPMM(object):
"""Diri... | Create Dirichlet Process Mixture Model class.""" Going to try algorithm 1 from Neal (2000)
"""
import numpy as np
import bisect
def pick_discrete(p):
"""Pick a discrete integer between 0 and len(p) - 1 with probability given by p array."""
c = np.cumsum(p)
u = np.random.uniform()
return bisect.bisect... | <commit_before><commit_msg>Create Dirichlet Process Mixture Model class.<commit_after>""" Going to try algorithm 1 from Neal (2000)
"""
import numpy as np
import bisect
def pick_discrete(p):
"""Pick a discrete integer between 0 and len(p) - 1 with probability given by p array."""
c = np.cumsum(p)
u = np.... | |
c0cc71c51e95fd9b254c64e2557673d302ec0b9d | perfscale_mass_model_destruction.py | perfscale_mass_model_destruction.py | #!/usr/bin/env python
"""Perfscale test measuring adding and destroying a large number of models.
Steps taken in this test:
- Bootstraps a provider
- Creates x amount of models and waits for them to be ready
- Delete all the models at once.
"""
import argparse
from datetime import datetime
import logging
import... | Add mass model destruction test. | Add mass model destruction test. | Python | agpl-3.0 | mjs/juju,mjs/juju,mjs/juju,mjs/juju,mjs/juju,mjs/juju,mjs/juju | Add mass model destruction test. | #!/usr/bin/env python
"""Perfscale test measuring adding and destroying a large number of models.
Steps taken in this test:
- Bootstraps a provider
- Creates x amount of models and waits for them to be ready
- Delete all the models at once.
"""
import argparse
from datetime import datetime
import logging
import... | <commit_before><commit_msg>Add mass model destruction test.<commit_after> | #!/usr/bin/env python
"""Perfscale test measuring adding and destroying a large number of models.
Steps taken in this test:
- Bootstraps a provider
- Creates x amount of models and waits for them to be ready
- Delete all the models at once.
"""
import argparse
from datetime import datetime
import logging
import... | Add mass model destruction test.#!/usr/bin/env python
"""Perfscale test measuring adding and destroying a large number of models.
Steps taken in this test:
- Bootstraps a provider
- Creates x amount of models and waits for them to be ready
- Delete all the models at once.
"""
import argparse
from datetime impor... | <commit_before><commit_msg>Add mass model destruction test.<commit_after>#!/usr/bin/env python
"""Perfscale test measuring adding and destroying a large number of models.
Steps taken in this test:
- Bootstraps a provider
- Creates x amount of models and waits for them to be ready
- Delete all the models at once.... | |
fcaaad56c3b532e2f1b5845a69c46f8aa9845846 | hub/tests/test_globalsettings.py | hub/tests/test_globalsettings.py | # coding: utf-8
import constance
from constance.test import override_config
from django.urls import reverse
from django.test import TestCase
class GlobalSettingsTestCase(TestCase):
fixtures = ['test_data']
@override_config(MFA_ENABLED=True)
def test_mfa_enabled(self):
self.client.login(username=... | Add test to valide MFA status in JS | Add test to valide MFA status in JS
| Python | agpl-3.0 | kobotoolbox/kpi,kobotoolbox/kpi,kobotoolbox/kpi,kobotoolbox/kpi,kobotoolbox/kpi | Add test to valide MFA status in JS | # coding: utf-8
import constance
from constance.test import override_config
from django.urls import reverse
from django.test import TestCase
class GlobalSettingsTestCase(TestCase):
fixtures = ['test_data']
@override_config(MFA_ENABLED=True)
def test_mfa_enabled(self):
self.client.login(username=... | <commit_before><commit_msg>Add test to valide MFA status in JS<commit_after> | # coding: utf-8
import constance
from constance.test import override_config
from django.urls import reverse
from django.test import TestCase
class GlobalSettingsTestCase(TestCase):
fixtures = ['test_data']
@override_config(MFA_ENABLED=True)
def test_mfa_enabled(self):
self.client.login(username=... | Add test to valide MFA status in JS# coding: utf-8
import constance
from constance.test import override_config
from django.urls import reverse
from django.test import TestCase
class GlobalSettingsTestCase(TestCase):
fixtures = ['test_data']
@override_config(MFA_ENABLED=True)
def test_mfa_enabled(self):
... | <commit_before><commit_msg>Add test to valide MFA status in JS<commit_after># coding: utf-8
import constance
from constance.test import override_config
from django.urls import reverse
from django.test import TestCase
class GlobalSettingsTestCase(TestCase):
fixtures = ['test_data']
@override_config(MFA_ENABL... | |
7b94c8390f4756aa69a0e88737b9f4f749e13acd | test/test_sparql_base_ref.py | test/test_sparql_base_ref.py | from rdflib import ConjunctiveGraph, Literal
from StringIO import StringIO
import unittest
test_data = """
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
<http://example.org/alice> a foaf:Person;
foaf:name "Alice";
foaf:knows <http://exa... | Test for use of BASE <..> | Test for use of BASE <..>
| Python | bsd-3-clause | yingerj/rdflib,yingerj/rdflib,marma/rdflib,avorio/rdflib,marma/rdflib,avorio/rdflib,yingerj/rdflib,RDFLib/rdflib,avorio/rdflib,armandobs14/rdflib,dbs/rdflib,armandobs14/rdflib,ssssam/rdflib,armandobs14/rdflib,ssssam/rdflib,avorio/rdflib,dbs/rdflib,armandobs14/rdflib,ssssam/rdflib,marma/rdflib,RDFLib/rdflib,RDFLib/rdfli... | Test for use of BASE <..> | from rdflib import ConjunctiveGraph, Literal
from StringIO import StringIO
import unittest
test_data = """
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
<http://example.org/alice> a foaf:Person;
foaf:name "Alice";
foaf:knows <http://exa... | <commit_before><commit_msg>Test for use of BASE <..><commit_after> | from rdflib import ConjunctiveGraph, Literal
from StringIO import StringIO
import unittest
test_data = """
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
<http://example.org/alice> a foaf:Person;
foaf:name "Alice";
foaf:knows <http://exa... | Test for use of BASE <..>from rdflib import ConjunctiveGraph, Literal
from StringIO import StringIO
import unittest
test_data = """
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
<http://example.org/alice> a foaf:Person;
foaf:name "Alice";
... | <commit_before><commit_msg>Test for use of BASE <..><commit_after>from rdflib import ConjunctiveGraph, Literal
from StringIO import StringIO
import unittest
test_data = """
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
<http://example.org/alice... | |
ba84af2586e5d0cc70ffd95f8899d28659c36d9f | mopidy/frontends/mpd/__init__.py | mopidy/frontends/mpd/__init__.py | """The MPD server frontend.
MPD stands for Music Player Daemon. MPD is an independent project and server.
Mopidy implements the MPD protocol, and is thus compatible with clients for the
original MPD server.
**Dependencies:**
- None
**Settings:**
- :attr:`mopidy.settings.MPD_SERVER_HOSTNAME`
- :attr:`mopidy.setting... | """The MPD server frontend.
MPD stands for Music Player Daemon. MPD is an independent project and server.
Mopidy implements the MPD protocol, and is thus compatible with clients for the
original MPD server.
**Dependencies:**
- None
**Settings:**
- :attr:`mopidy.settings.MPD_SERVER_HOSTNAME`
- :attr:`mopidy.setting... | Add list of unsupported MPD features | mpd: Add list of unsupported MPD features
| Python | apache-2.0 | woutervanwijk/mopidy,rawdlite/mopidy,diandiankan/mopidy,ZenithDK/mopidy,dbrgn/mopidy,SuperStarPL/mopidy,diandiankan/mopidy,mokieyue/mopidy,dbrgn/mopidy,abarisain/mopidy,jmarsik/mopidy,pacificIT/mopidy,abarisain/mopidy,rawdlite/mopidy,vrs01/mopidy,swak/mopidy,liamw9534/mopidy,mokieyue/mopidy,kingosticks/mopidy,glogiotat... | """The MPD server frontend.
MPD stands for Music Player Daemon. MPD is an independent project and server.
Mopidy implements the MPD protocol, and is thus compatible with clients for the
original MPD server.
**Dependencies:**
- None
**Settings:**
- :attr:`mopidy.settings.MPD_SERVER_HOSTNAME`
- :attr:`mopidy.setting... | """The MPD server frontend.
MPD stands for Music Player Daemon. MPD is an independent project and server.
Mopidy implements the MPD protocol, and is thus compatible with clients for the
original MPD server.
**Dependencies:**
- None
**Settings:**
- :attr:`mopidy.settings.MPD_SERVER_HOSTNAME`
- :attr:`mopidy.setting... | <commit_before>"""The MPD server frontend.
MPD stands for Music Player Daemon. MPD is an independent project and server.
Mopidy implements the MPD protocol, and is thus compatible with clients for the
original MPD server.
**Dependencies:**
- None
**Settings:**
- :attr:`mopidy.settings.MPD_SERVER_HOSTNAME`
- :attr:... | """The MPD server frontend.
MPD stands for Music Player Daemon. MPD is an independent project and server.
Mopidy implements the MPD protocol, and is thus compatible with clients for the
original MPD server.
**Dependencies:**
- None
**Settings:**
- :attr:`mopidy.settings.MPD_SERVER_HOSTNAME`
- :attr:`mopidy.setting... | """The MPD server frontend.
MPD stands for Music Player Daemon. MPD is an independent project and server.
Mopidy implements the MPD protocol, and is thus compatible with clients for the
original MPD server.
**Dependencies:**
- None
**Settings:**
- :attr:`mopidy.settings.MPD_SERVER_HOSTNAME`
- :attr:`mopidy.setting... | <commit_before>"""The MPD server frontend.
MPD stands for Music Player Daemon. MPD is an independent project and server.
Mopidy implements the MPD protocol, and is thus compatible with clients for the
original MPD server.
**Dependencies:**
- None
**Settings:**
- :attr:`mopidy.settings.MPD_SERVER_HOSTNAME`
- :attr:... |
bec0104e8268eca321fec39a471adc241c06200e | workshops/test/test_debrief.py | workshops/test/test_debrief.py | import datetime
from django.core.urlresolvers import reverse
from ..models import Event, Task, Role
from .base import TestBase
class TestDebrief(TestBase):
def setUp(self):
super().setUp()
self._setUpUsersAndLogin()
self.today = datetime.date.today()
self.tomorrow = self.today +... | Add test for debrief view | Add test for debrief view
| Python | mit | swcarpentry/amy,wking/swc-amy,shapiromatron/amy,shapiromatron/amy,pbanaszkiewicz/amy,vahtras/amy,wking/swc-amy,vahtras/amy,swcarpentry/amy,shapiromatron/amy,wking/swc-amy,swcarpentry/amy,pbanaszkiewicz/amy,vahtras/amy,pbanaszkiewicz/amy,wking/swc-amy | Add test for debrief view | import datetime
from django.core.urlresolvers import reverse
from ..models import Event, Task, Role
from .base import TestBase
class TestDebrief(TestBase):
def setUp(self):
super().setUp()
self._setUpUsersAndLogin()
self.today = datetime.date.today()
self.tomorrow = self.today +... | <commit_before><commit_msg>Add test for debrief view<commit_after> | import datetime
from django.core.urlresolvers import reverse
from ..models import Event, Task, Role
from .base import TestBase
class TestDebrief(TestBase):
def setUp(self):
super().setUp()
self._setUpUsersAndLogin()
self.today = datetime.date.today()
self.tomorrow = self.today +... | Add test for debrief viewimport datetime
from django.core.urlresolvers import reverse
from ..models import Event, Task, Role
from .base import TestBase
class TestDebrief(TestBase):
def setUp(self):
super().setUp()
self._setUpUsersAndLogin()
self.today = datetime.date.today()
sel... | <commit_before><commit_msg>Add test for debrief view<commit_after>import datetime
from django.core.urlresolvers import reverse
from ..models import Event, Task, Role
from .base import TestBase
class TestDebrief(TestBase):
def setUp(self):
super().setUp()
self._setUpUsersAndLogin()
self.... | |
ae131028eee40c6e187296ca9c3c748fa8afe057 | cron/tunnelcrypt.py | cron/tunnelcrypt.py | """This module crypts the message of ping"""
from __future__ import division
from string import ascii_lowercase
symbols = list('0123456789')
symbols.append(' ')
for i in ascii_lowercase:
symbols.append(i)
symbols.extend(list(',.-_#@!()'))
def _convert_to_symbols(message):
"""
Convert a list of characters... | Implement a simple cryptography functions using a key | Implement a simple cryptography functions using a key
| Python | apache-2.0 | OrkoHunter/ping-me | Implement a simple cryptography functions using a key | """This module crypts the message of ping"""
from __future__ import division
from string import ascii_lowercase
symbols = list('0123456789')
symbols.append(' ')
for i in ascii_lowercase:
symbols.append(i)
symbols.extend(list(',.-_#@!()'))
def _convert_to_symbols(message):
"""
Convert a list of characters... | <commit_before><commit_msg>Implement a simple cryptography functions using a key<commit_after> | """This module crypts the message of ping"""
from __future__ import division
from string import ascii_lowercase
symbols = list('0123456789')
symbols.append(' ')
for i in ascii_lowercase:
symbols.append(i)
symbols.extend(list(',.-_#@!()'))
def _convert_to_symbols(message):
"""
Convert a list of characters... | Implement a simple cryptography functions using a key"""This module crypts the message of ping"""
from __future__ import division
from string import ascii_lowercase
symbols = list('0123456789')
symbols.append(' ')
for i in ascii_lowercase:
symbols.append(i)
symbols.extend(list(',.-_#@!()'))
def _convert_to_symbo... | <commit_before><commit_msg>Implement a simple cryptography functions using a key<commit_after>"""This module crypts the message of ping"""
from __future__ import division
from string import ascii_lowercase
symbols = list('0123456789')
symbols.append(' ')
for i in ascii_lowercase:
symbols.append(i)
symbols.extend(... | |
670e9be8cefb176e9012c82413c2e76aa1448a83 | scipy/integrate/_ivp/tests/test_rk_coefficients.py | scipy/integrate/_ivp/tests/test_rk_coefficients.py | import pytest
from numpy.testing import assert_allclose
import numpy as np
from scipy.integrate import RK23, RK45
@pytest.mark.parametrize("solver", [RK23, RK45])
def test_coefficient_properties(solver):
assert_allclose(np.sum(solver.B), 1, rtol=1e-15)
assert_allclose(np.sum(solver.A, axis=1), solver.C, rtol=... | Add a test for Runge-Kutta coefficient properties | TST: Add a test for Runge-Kutta coefficient properties
| Python | bsd-3-clause | mdhaber/scipy,perimosocordiae/scipy,andyfaff/scipy,rgommers/scipy,matthew-brett/scipy,WarrenWeckesser/scipy,vigna/scipy,nmayorov/scipy,jamestwebber/scipy,ilayn/scipy,Eric89GXL/scipy,WarrenWeckesser/scipy,tylerjereddy/scipy,lhilt/scipy,Stefan-Endres/scipy,person142/scipy,ilayn/scipy,endolith/scipy,ilayn/scipy,aeklant/sc... | TST: Add a test for Runge-Kutta coefficient properties | import pytest
from numpy.testing import assert_allclose
import numpy as np
from scipy.integrate import RK23, RK45
@pytest.mark.parametrize("solver", [RK23, RK45])
def test_coefficient_properties(solver):
assert_allclose(np.sum(solver.B), 1, rtol=1e-15)
assert_allclose(np.sum(solver.A, axis=1), solver.C, rtol=... | <commit_before><commit_msg>TST: Add a test for Runge-Kutta coefficient properties<commit_after> | import pytest
from numpy.testing import assert_allclose
import numpy as np
from scipy.integrate import RK23, RK45
@pytest.mark.parametrize("solver", [RK23, RK45])
def test_coefficient_properties(solver):
assert_allclose(np.sum(solver.B), 1, rtol=1e-15)
assert_allclose(np.sum(solver.A, axis=1), solver.C, rtol=... | TST: Add a test for Runge-Kutta coefficient propertiesimport pytest
from numpy.testing import assert_allclose
import numpy as np
from scipy.integrate import RK23, RK45
@pytest.mark.parametrize("solver", [RK23, RK45])
def test_coefficient_properties(solver):
assert_allclose(np.sum(solver.B), 1, rtol=1e-15)
ass... | <commit_before><commit_msg>TST: Add a test for Runge-Kutta coefficient properties<commit_after>import pytest
from numpy.testing import assert_allclose
import numpy as np
from scipy.integrate import RK23, RK45
@pytest.mark.parametrize("solver", [RK23, RK45])
def test_coefficient_properties(solver):
assert_allclose... | |
d09361ba946d547155ef84b211d101f91ebee090 | tools/push-to-trunk/generate_version.py | tools/push-to-trunk/generate_version.py | #!/usr/bin/env python
# Copyright 2014 the V8 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.
"""
Script to set v8's version file to the version given by the latest tag.
"""
import os
import re
import subprocess
import sys
... | Add script to generate the v8 version. | Add script to generate the v8 version.
BUG=chromium:446166
LOG=n
[email protected]
NOTRY=true
Review URL: https://codereview.chromium.org/835903003
Cr-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03eb8f276f7@{#25964}
| Python | mit | UniversalFuture/moosh,UniversalFuture/moosh,UniversalFuture/moosh,UniversalFuture/moosh | Add script to generate the v8 version.
BUG=chromium:446166
LOG=n
[email protected]
NOTRY=true
Review URL: https://codereview.chromium.org/835903003
Cr-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03eb8f276f7@{#25964} | #!/usr/bin/env python
# Copyright 2014 the V8 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.
"""
Script to set v8's version file to the version given by the latest tag.
"""
import os
import re
import subprocess
import sys
... | <commit_before><commit_msg>Add script to generate the v8 version.
BUG=chromium:446166
LOG=n
[email protected]
NOTRY=true
Review URL: https://codereview.chromium.org/835903003
Cr-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03eb8f276f7@{#25964}<commit_after> | #!/usr/bin/env python
# Copyright 2014 the V8 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.
"""
Script to set v8's version file to the version given by the latest tag.
"""
import os
import re
import subprocess
import sys
... | Add script to generate the v8 version.
BUG=chromium:446166
LOG=n
[email protected]
NOTRY=true
Review URL: https://codereview.chromium.org/835903003
Cr-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03eb8f276f7@{#25964}#!/usr/bin/env python
# Copyright 2014 the V8 project authors. All rights reserved.
# Use o... | <commit_before><commit_msg>Add script to generate the v8 version.
BUG=chromium:446166
LOG=n
[email protected]
NOTRY=true
Review URL: https://codereview.chromium.org/835903003
Cr-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03eb8f276f7@{#25964}<commit_after>#!/usr/bin/env python
# Copyright 2014 the V8 proj... | |
9db0136cef3965d20b6b138af5a0c9a5aafc36e4 | setup.py | setup.py | #!/usr/bin/python -tt
from distutils.core import setup
setup(
name='pymajka',
version='1.0',
description='Python interface to morphological analyser majka',
author='Marek marx Grac',
author_email='[email protected]',
url='http://github.com/marxsk/pymajka',
py_modules=['pymajka']
) | Use distutils to install pymajka as standard module | [build] Use distutils to install pymajka as standard module
The installation of majka itself is not covered.
| Python | apache-2.0 | marxsk/pymajka | [build] Use distutils to install pymajka as standard module
The installation of majka itself is not covered. | #!/usr/bin/python -tt
from distutils.core import setup
setup(
name='pymajka',
version='1.0',
description='Python interface to morphological analyser majka',
author='Marek marx Grac',
author_email='[email protected]',
url='http://github.com/marxsk/pymajka',
py_modules=['pymajka']
) | <commit_before><commit_msg>[build] Use distutils to install pymajka as standard module
The installation of majka itself is not covered.<commit_after> | #!/usr/bin/python -tt
from distutils.core import setup
setup(
name='pymajka',
version='1.0',
description='Python interface to morphological analyser majka',
author='Marek marx Grac',
author_email='[email protected]',
url='http://github.com/marxsk/pymajka',
py_modules=['pymajka']
) | [build] Use distutils to install pymajka as standard module
The installation of majka itself is not covered.#!/usr/bin/python -tt
from distutils.core import setup
setup(
name='pymajka',
version='1.0',
description='Python interface to morphological analyser majka',
author='Marek marx Grac',
author_email='grac@ma... | <commit_before><commit_msg>[build] Use distutils to install pymajka as standard module
The installation of majka itself is not covered.<commit_after>#!/usr/bin/python -tt
from distutils.core import setup
setup(
name='pymajka',
version='1.0',
description='Python interface to morphological analyser majka',
author=... | |
ba23b9845da33682f4b37eaa22b955846786d9af | views.py | views.py | from django.shortcuts import render_to_response
from django.template import RequestContext
from feincms.models import Page
def handler(request, path):
page = Page.objects.page_for_path_or_404(path)
return render_to_response(page.template.path, {
'page': page,
}, context_instance=RequestConte... | Add basic cms page handler | Add basic cms page handler
| Python | bsd-3-clause | hgrimelid/feincms,nickburlett/feincms,joshuajonah/feincms,matthiask/feincms2-content,nickburlett/feincms,hgrimelid/feincms,matthiask/feincms2-content,michaelkuty/feincms,matthiask/django-content-editor,joshuajonah/feincms,feincms/feincms,michaelkuty/feincms,pjdelport/feincms,michaelkuty/feincms,joshuajonah/feincms,mjl/... | Add basic cms page handler | from django.shortcuts import render_to_response
from django.template import RequestContext
from feincms.models import Page
def handler(request, path):
page = Page.objects.page_for_path_or_404(path)
return render_to_response(page.template.path, {
'page': page,
}, context_instance=RequestConte... | <commit_before><commit_msg>Add basic cms page handler<commit_after> | from django.shortcuts import render_to_response
from django.template import RequestContext
from feincms.models import Page
def handler(request, path):
page = Page.objects.page_for_path_or_404(path)
return render_to_response(page.template.path, {
'page': page,
}, context_instance=RequestConte... | Add basic cms page handlerfrom django.shortcuts import render_to_response
from django.template import RequestContext
from feincms.models import Page
def handler(request, path):
page = Page.objects.page_for_path_or_404(path)
return render_to_response(page.template.path, {
'page': page,
}, con... | <commit_before><commit_msg>Add basic cms page handler<commit_after>from django.shortcuts import render_to_response
from django.template import RequestContext
from feincms.models import Page
def handler(request, path):
page = Page.objects.page_for_path_or_404(path)
return render_to_response(page.template.pat... | |
d83f04659f429683627600a8887ca33fe0a49043 | OnionLauncher/main.py | OnionLauncher/main.py | import sys
from PyQt5.QtWidgets import QApplication, QMainWindow
from PyQt5.uic import loadUi
class MainWindow(QMainWindow):
def __init__(self, *args):
super(MainWindow, self).__init__(*args)
loadUi("ui_files/main.ui", self)
if __name__ == "__main__":
app = QApplication(sys.argv)
mw = MainWindow()
mw.show()
... | Add initial code for launching UI | Add initial code for launching UI
| Python | bsd-2-clause | neelchauhan/OnionLauncher | Add initial code for launching UI | import sys
from PyQt5.QtWidgets import QApplication, QMainWindow
from PyQt5.uic import loadUi
class MainWindow(QMainWindow):
def __init__(self, *args):
super(MainWindow, self).__init__(*args)
loadUi("ui_files/main.ui", self)
if __name__ == "__main__":
app = QApplication(sys.argv)
mw = MainWindow()
mw.show()
... | <commit_before><commit_msg>Add initial code for launching UI<commit_after> | import sys
from PyQt5.QtWidgets import QApplication, QMainWindow
from PyQt5.uic import loadUi
class MainWindow(QMainWindow):
def __init__(self, *args):
super(MainWindow, self).__init__(*args)
loadUi("ui_files/main.ui", self)
if __name__ == "__main__":
app = QApplication(sys.argv)
mw = MainWindow()
mw.show()
... | Add initial code for launching UIimport sys
from PyQt5.QtWidgets import QApplication, QMainWindow
from PyQt5.uic import loadUi
class MainWindow(QMainWindow):
def __init__(self, *args):
super(MainWindow, self).__init__(*args)
loadUi("ui_files/main.ui", self)
if __name__ == "__main__":
app = QApplication(sys.arg... | <commit_before><commit_msg>Add initial code for launching UI<commit_after>import sys
from PyQt5.QtWidgets import QApplication, QMainWindow
from PyQt5.uic import loadUi
class MainWindow(QMainWindow):
def __init__(self, *args):
super(MainWindow, self).__init__(*args)
loadUi("ui_files/main.ui", self)
if __name__ =... | |
6f5e0338dd19d77d41400d5c2e46fb755337a727 | render_particle.py | render_particle.py | import pygame
pygame.init()
#-- SCREEN CHARACTERISTICS ------------------------->>>
background_color = (255,255,255)
(width, height) = (300, 200)
class Particle:
def __init__(self, (x, y), radius):
self.x = x
self.y = y
self.radius = radius
self.color = (255, 0, 0)
self.t... | Add module capable of rendering a circle-shaped Particle object | Add module capable of rendering a circle-shaped Particle object
| Python | mit | withtwoemms/pygame-explorations | Add module capable of rendering a circle-shaped Particle object | import pygame
pygame.init()
#-- SCREEN CHARACTERISTICS ------------------------->>>
background_color = (255,255,255)
(width, height) = (300, 200)
class Particle:
def __init__(self, (x, y), radius):
self.x = x
self.y = y
self.radius = radius
self.color = (255, 0, 0)
self.t... | <commit_before><commit_msg>Add module capable of rendering a circle-shaped Particle object<commit_after> | import pygame
pygame.init()
#-- SCREEN CHARACTERISTICS ------------------------->>>
background_color = (255,255,255)
(width, height) = (300, 200)
class Particle:
def __init__(self, (x, y), radius):
self.x = x
self.y = y
self.radius = radius
self.color = (255, 0, 0)
self.t... | Add module capable of rendering a circle-shaped Particle objectimport pygame
pygame.init()
#-- SCREEN CHARACTERISTICS ------------------------->>>
background_color = (255,255,255)
(width, height) = (300, 200)
class Particle:
def __init__(self, (x, y), radius):
self.x = x
self.y = y
self.... | <commit_before><commit_msg>Add module capable of rendering a circle-shaped Particle object<commit_after>import pygame
pygame.init()
#-- SCREEN CHARACTERISTICS ------------------------->>>
background_color = (255,255,255)
(width, height) = (300, 200)
class Particle:
def __init__(self, (x, y), radius):
se... | |
856c5576e13eb89c433bfe873d59c55971232555 | microcosm_postgres/createall.py | microcosm_postgres/createall.py | """
Create databases.
"""
from argparse import ArgumentParser
from microcosm_postgres.operations import create_all, drop_all
def parse_args(graph):
parser = ArgumentParser()
parser.add_argument("--drop", "-D", action="store_true")
return parser.parse_args()
def main(graph):
"""
Create and drop... | Add create all CLI entry point | Add create all CLI entry point
| Python | apache-2.0 | globality-corp/microcosm-postgres,globality-corp/microcosm-postgres | Add create all CLI entry point | """
Create databases.
"""
from argparse import ArgumentParser
from microcosm_postgres.operations import create_all, drop_all
def parse_args(graph):
parser = ArgumentParser()
parser.add_argument("--drop", "-D", action="store_true")
return parser.parse_args()
def main(graph):
"""
Create and drop... | <commit_before><commit_msg>Add create all CLI entry point<commit_after> | """
Create databases.
"""
from argparse import ArgumentParser
from microcosm_postgres.operations import create_all, drop_all
def parse_args(graph):
parser = ArgumentParser()
parser.add_argument("--drop", "-D", action="store_true")
return parser.parse_args()
def main(graph):
"""
Create and drop... | Add create all CLI entry point"""
Create databases.
"""
from argparse import ArgumentParser
from microcosm_postgres.operations import create_all, drop_all
def parse_args(graph):
parser = ArgumentParser()
parser.add_argument("--drop", "-D", action="store_true")
return parser.parse_args()
def main(graph... | <commit_before><commit_msg>Add create all CLI entry point<commit_after>"""
Create databases.
"""
from argparse import ArgumentParser
from microcosm_postgres.operations import create_all, drop_all
def parse_args(graph):
parser = ArgumentParser()
parser.add_argument("--drop", "-D", action="store_true")
re... | |
c5bfe8550c50977750561bd5759db5da8bcab48d | problem1/gml_read.py | problem1/gml_read.py | import networkx as nx
# from gml_read import read_gml2
# g = read_gml2("steiner-small.gml")
def read_gml2(path):
# Read file lines
f = open(path)
lines = f.readlines()
f.close()
# Split lines into symbols
syms = []
for line in lines:
line = line.strip().split(' ')
... | Add a fast GML reader (reads in seconds). | Add a fast GML reader (reads in seconds).
| Python | mit | karulont/combopt | Add a fast GML reader (reads in seconds). | import networkx as nx
# from gml_read import read_gml2
# g = read_gml2("steiner-small.gml")
def read_gml2(path):
# Read file lines
f = open(path)
lines = f.readlines()
f.close()
# Split lines into symbols
syms = []
for line in lines:
line = line.strip().split(' ')
... | <commit_before><commit_msg>Add a fast GML reader (reads in seconds).<commit_after> | import networkx as nx
# from gml_read import read_gml2
# g = read_gml2("steiner-small.gml")
def read_gml2(path):
# Read file lines
f = open(path)
lines = f.readlines()
f.close()
# Split lines into symbols
syms = []
for line in lines:
line = line.strip().split(' ')
... | Add a fast GML reader (reads in seconds).import networkx as nx
# from gml_read import read_gml2
# g = read_gml2("steiner-small.gml")
def read_gml2(path):
# Read file lines
f = open(path)
lines = f.readlines()
f.close()
# Split lines into symbols
syms = []
for line in lines:... | <commit_before><commit_msg>Add a fast GML reader (reads in seconds).<commit_after>import networkx as nx
# from gml_read import read_gml2
# g = read_gml2("steiner-small.gml")
def read_gml2(path):
# Read file lines
f = open(path)
lines = f.readlines()
f.close()
# Split lines into symbo... | |
d567f2dcb5204cf8103ce9abcc983c187c6a8844 | src/tests/python/dummyserver.py | src/tests/python/dummyserver.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
PORT = 50007
# Echo server program
import socket
import sys
import json
HOST = None # Symbolic name meaning all available interfaces
def bindto(host, port):
s = None
for res in socket.getaddrinfo(host, port, socket.AF_UNSPEC, socket.SOCK_STREAM, 0, s... | Add a dummy python socket server | [src/test] Add a dummy python socket server
| Python | mit | C4ptainCrunch/info-f-209,C4ptainCrunch/info-f-209,C4ptainCrunch/info-f-209 | [src/test] Add a dummy python socket server | #!/usr/bin/python
# -*- coding: utf-8 -*-
PORT = 50007
# Echo server program
import socket
import sys
import json
HOST = None # Symbolic name meaning all available interfaces
def bindto(host, port):
s = None
for res in socket.getaddrinfo(host, port, socket.AF_UNSPEC, socket.SOCK_STREAM, 0, s... | <commit_before><commit_msg>[src/test] Add a dummy python socket server<commit_after> | #!/usr/bin/python
# -*- coding: utf-8 -*-
PORT = 50007
# Echo server program
import socket
import sys
import json
HOST = None # Symbolic name meaning all available interfaces
def bindto(host, port):
s = None
for res in socket.getaddrinfo(host, port, socket.AF_UNSPEC, socket.SOCK_STREAM, 0, s... | [src/test] Add a dummy python socket server#!/usr/bin/python
# -*- coding: utf-8 -*-
PORT = 50007
# Echo server program
import socket
import sys
import json
HOST = None # Symbolic name meaning all available interfaces
def bindto(host, port):
s = None
for res in socket.getaddrinfo(host, port,... | <commit_before><commit_msg>[src/test] Add a dummy python socket server<commit_after>#!/usr/bin/python
# -*- coding: utf-8 -*-
PORT = 50007
# Echo server program
import socket
import sys
import json
HOST = None # Symbolic name meaning all available interfaces
def bindto(host, port):
s = None
... | |
bc0ed201ee94fcd279372cd028e48f06502e03af | iddfs.py | iddfs.py | # -*- coding: utf-8 -*-
import draw
import grid
import util
def iddfs(g, start, goal):
for i in range(40):
path = iddfs_rec(g, start, goal, [start], i)
if path != None:
return path
return None
def iddfs_rec(g, pos, goal, path, max_depth):
if len(path) > max_depth:
retur... | Add Iterative Deepening Depth-First Search | Add Iterative Deepening Depth-First Search
| Python | mit | XeryusTC/search | Add Iterative Deepening Depth-First Search | # -*- coding: utf-8 -*-
import draw
import grid
import util
def iddfs(g, start, goal):
for i in range(40):
path = iddfs_rec(g, start, goal, [start], i)
if path != None:
return path
return None
def iddfs_rec(g, pos, goal, path, max_depth):
if len(path) > max_depth:
retur... | <commit_before><commit_msg>Add Iterative Deepening Depth-First Search<commit_after> | # -*- coding: utf-8 -*-
import draw
import grid
import util
def iddfs(g, start, goal):
for i in range(40):
path = iddfs_rec(g, start, goal, [start], i)
if path != None:
return path
return None
def iddfs_rec(g, pos, goal, path, max_depth):
if len(path) > max_depth:
retur... | Add Iterative Deepening Depth-First Search# -*- coding: utf-8 -*-
import draw
import grid
import util
def iddfs(g, start, goal):
for i in range(40):
path = iddfs_rec(g, start, goal, [start], i)
if path != None:
return path
return None
def iddfs_rec(g, pos, goal, path, max_depth):
... | <commit_before><commit_msg>Add Iterative Deepening Depth-First Search<commit_after># -*- coding: utf-8 -*-
import draw
import grid
import util
def iddfs(g, start, goal):
for i in range(40):
path = iddfs_rec(g, start, goal, [start], i)
if path != None:
return path
return None
def id... | |
cd7ce7b8e76c6b756ea42c5f3fc08f923963bcbc | codingame/easy/mars_lander.py | codingame/easy/mars_lander.py | N = int(raw_input()) # the number of points used to draw the surface of Mars.
for i in xrange(N):
# LAND_X: X coordinate of a surface point. (0 to 6999)
# LAND_Y: Y coordinate of a surface point. By linking all the points together in a sequential fashion, you form the surface of Mars.
LAND_X, LAND_Y = [int(i) for i ... | Add a naive solution for Mars Lander | Add a naive solution for Mars Lander
| Python | mit | AntoineAugusti/katas,AntoineAugusti/katas,AntoineAugusti/katas | Add a naive solution for Mars Lander | N = int(raw_input()) # the number of points used to draw the surface of Mars.
for i in xrange(N):
# LAND_X: X coordinate of a surface point. (0 to 6999)
# LAND_Y: Y coordinate of a surface point. By linking all the points together in a sequential fashion, you form the surface of Mars.
LAND_X, LAND_Y = [int(i) for i ... | <commit_before><commit_msg>Add a naive solution for Mars Lander<commit_after> | N = int(raw_input()) # the number of points used to draw the surface of Mars.
for i in xrange(N):
# LAND_X: X coordinate of a surface point. (0 to 6999)
# LAND_Y: Y coordinate of a surface point. By linking all the points together in a sequential fashion, you form the surface of Mars.
LAND_X, LAND_Y = [int(i) for i ... | Add a naive solution for Mars LanderN = int(raw_input()) # the number of points used to draw the surface of Mars.
for i in xrange(N):
# LAND_X: X coordinate of a surface point. (0 to 6999)
# LAND_Y: Y coordinate of a surface point. By linking all the points together in a sequential fashion, you form the surface of Ma... | <commit_before><commit_msg>Add a naive solution for Mars Lander<commit_after>N = int(raw_input()) # the number of points used to draw the surface of Mars.
for i in xrange(N):
# LAND_X: X coordinate of a surface point. (0 to 6999)
# LAND_Y: Y coordinate of a surface point. By linking all the points together in a seque... | |
67ec8503b2fafbf9a2728b9175f222a448a6df02 | extras/globalmod.py | extras/globalmod.py | #!/usr/bin/python
import sys
from redis import Redis
db = Redis()
session_id = sys.argv[2]
if sys.argv[1]=='add':
db.sadd('global-mods', session_id)
print 'Added to global mods list.'
for chat in db.smembers('session.'+session_id+'.chats'):
print 'Setting group in '+chat+' to globalmod.'
... | Create script for adding/removing global mods. | Create script for adding/removing global mods.
| Python | mit | MSPARP/MSPARP,MSPARP/MSPARP,MSPARP/MSPARP | Create script for adding/removing global mods. | #!/usr/bin/python
import sys
from redis import Redis
db = Redis()
session_id = sys.argv[2]
if sys.argv[1]=='add':
db.sadd('global-mods', session_id)
print 'Added to global mods list.'
for chat in db.smembers('session.'+session_id+'.chats'):
print 'Setting group in '+chat+' to globalmod.'
... | <commit_before><commit_msg>Create script for adding/removing global mods.<commit_after> | #!/usr/bin/python
import sys
from redis import Redis
db = Redis()
session_id = sys.argv[2]
if sys.argv[1]=='add':
db.sadd('global-mods', session_id)
print 'Added to global mods list.'
for chat in db.smembers('session.'+session_id+'.chats'):
print 'Setting group in '+chat+' to globalmod.'
... | Create script for adding/removing global mods.#!/usr/bin/python
import sys
from redis import Redis
db = Redis()
session_id = sys.argv[2]
if sys.argv[1]=='add':
db.sadd('global-mods', session_id)
print 'Added to global mods list.'
for chat in db.smembers('session.'+session_id+'.chats'):
print 'Se... | <commit_before><commit_msg>Create script for adding/removing global mods.<commit_after>#!/usr/bin/python
import sys
from redis import Redis
db = Redis()
session_id = sys.argv[2]
if sys.argv[1]=='add':
db.sadd('global-mods', session_id)
print 'Added to global mods list.'
for chat in db.smembers('session.... | |
6f59fe88fa00c0c05d985ae11b0373eaf8b21303 | data/test-biochemists-zinb-ae.py | data/test-biochemists-zinb-ae.py | import numpy as np
import tensorflow as tf
from autoencoder.io import read_text, preprocess
from autoencoder.api import autoencode
import keras.backend as K
# for full reproducibility
np.random.seed(1)
tf.set_random_seed(1)
sess = tf.Session(config=tf.ConfigProto(intra_op_parallelism_threads=1,
... | Add a fully reproducible autoencoder test code | Add a fully reproducible autoencoder test code
Former-commit-id: fef07285a8dd84dabd37eb73de7cb298b0b50944 | Python | apache-2.0 | theislab/dca,theislab/dca,theislab/dca | Add a fully reproducible autoencoder test code
Former-commit-id: fef07285a8dd84dabd37eb73de7cb298b0b50944 | import numpy as np
import tensorflow as tf
from autoencoder.io import read_text, preprocess
from autoencoder.api import autoencode
import keras.backend as K
# for full reproducibility
np.random.seed(1)
tf.set_random_seed(1)
sess = tf.Session(config=tf.ConfigProto(intra_op_parallelism_threads=1,
... | <commit_before><commit_msg>Add a fully reproducible autoencoder test code
Former-commit-id: fef07285a8dd84dabd37eb73de7cb298b0b50944<commit_after> | import numpy as np
import tensorflow as tf
from autoencoder.io import read_text, preprocess
from autoencoder.api import autoencode
import keras.backend as K
# for full reproducibility
np.random.seed(1)
tf.set_random_seed(1)
sess = tf.Session(config=tf.ConfigProto(intra_op_parallelism_threads=1,
... | Add a fully reproducible autoencoder test code
Former-commit-id: fef07285a8dd84dabd37eb73de7cb298b0b50944import numpy as np
import tensorflow as tf
from autoencoder.io import read_text, preprocess
from autoencoder.api import autoencode
import keras.backend as K
# for full reproducibility
np.random.seed(1)
tf.set_ran... | <commit_before><commit_msg>Add a fully reproducible autoencoder test code
Former-commit-id: fef07285a8dd84dabd37eb73de7cb298b0b50944<commit_after>import numpy as np
import tensorflow as tf
from autoencoder.io import read_text, preprocess
from autoencoder.api import autoencode
import keras.backend as K
# for full rep... | |
347ab0f2635bc1e91747822e3d10588e1344b6f6 | hstsb/directsb.py | hstsb/directsb.py | #!/usr/bin/env python
# encoding: utf-8
"""
Module for directly estimating SB by adding up the light of stars in the Brown
catalog and transforming that total light into an SDSS magnitude.
"""
from astropy import log
import numpy as np
from sqlalchemy.orm import aliased
from starplex.database import connect_to_server... | Load HST photometry from Starplex catalog | Load HST photometry from Starplex catalog
| Python | bsd-3-clause | jonathansick/synthsb | Load HST photometry from Starplex catalog | #!/usr/bin/env python
# encoding: utf-8
"""
Module for directly estimating SB by adding up the light of stars in the Brown
catalog and transforming that total light into an SDSS magnitude.
"""
from astropy import log
import numpy as np
from sqlalchemy.orm import aliased
from starplex.database import connect_to_server... | <commit_before><commit_msg>Load HST photometry from Starplex catalog<commit_after> | #!/usr/bin/env python
# encoding: utf-8
"""
Module for directly estimating SB by adding up the light of stars in the Brown
catalog and transforming that total light into an SDSS magnitude.
"""
from astropy import log
import numpy as np
from sqlalchemy.orm import aliased
from starplex.database import connect_to_server... | Load HST photometry from Starplex catalog#!/usr/bin/env python
# encoding: utf-8
"""
Module for directly estimating SB by adding up the light of stars in the Brown
catalog and transforming that total light into an SDSS magnitude.
"""
from astropy import log
import numpy as np
from sqlalchemy.orm import aliased
from s... | <commit_before><commit_msg>Load HST photometry from Starplex catalog<commit_after>#!/usr/bin/env python
# encoding: utf-8
"""
Module for directly estimating SB by adding up the light of stars in the Brown
catalog and transforming that total light into an SDSS magnitude.
"""
from astropy import log
import numpy as np
... | |
06a8d1b387709a630b6b3d7b946d3acec81cc5fe | test/copies/gyptest-attribs.py | test/copies/gyptest-attribs.py | #!/usr/bin/env python
# Copyright (c) 2013 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies that copying files preserves file attributes.
"""
import TestGyp
import os
import stat
import sys
def check_attribs(path, e... | #!/usr/bin/env python
# Copyright (c) 2013 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies that copying files preserves file attributes.
"""
import TestGyp
import os
import stat
import sys
def check_attribs(path, e... | Disable new test from r1779 for the android generator. | Disable new test from r1779 for the android generator.
BUG=gyp:379
[email protected]
Review URL: https://codereview.chromium.org/68333002
git-svn-id: e7e1075985beda50ea81ac4472467b4f6e91fc78@1782 78cadc50-ecff-11dd-a971-7dbc132099af
| Python | bsd-3-clause | turbulenz/gyp,saghul/gyn,omasanori/gyp,chromium/gyp,luvit/gyp,pandaxcl/gyp,bnoordhuis/gyp,bulldy80/gyp_unofficial,alexcrichton/gyp,springmeyer/gyp,mapbox/gyp,LazyCodingCat/gyp,LazyCodingCat/gyp,Danath/gyp,Phuehvk/gyp,chromium/gyp,bnq4ever/gypgoogle,android-ia/platform_external_chromium_org_tools_gyp,adblockplus/gyp,cla... | #!/usr/bin/env python
# Copyright (c) 2013 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies that copying files preserves file attributes.
"""
import TestGyp
import os
import stat
import sys
def check_attribs(path, e... | #!/usr/bin/env python
# Copyright (c) 2013 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies that copying files preserves file attributes.
"""
import TestGyp
import os
import stat
import sys
def check_attribs(path, e... | <commit_before>#!/usr/bin/env python
# Copyright (c) 2013 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies that copying files preserves file attributes.
"""
import TestGyp
import os
import stat
import sys
def check_... | #!/usr/bin/env python
# Copyright (c) 2013 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies that copying files preserves file attributes.
"""
import TestGyp
import os
import stat
import sys
def check_attribs(path, e... | #!/usr/bin/env python
# Copyright (c) 2013 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies that copying files preserves file attributes.
"""
import TestGyp
import os
import stat
import sys
def check_attribs(path, e... | <commit_before>#!/usr/bin/env python
# Copyright (c) 2013 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies that copying files preserves file attributes.
"""
import TestGyp
import os
import stat
import sys
def check_... |
f6b8611b18348b2015c8b17f2b951214395fa612 | migrations/versions/0190_another_letter_org.py | migrations/versions/0190_another_letter_org.py | """empty message
Revision ID: 0190_another_letter_org
Revises: 0189_ft_billing_data_type
Create Date: 2017-06-29 12:44:16.815039
"""
# revision identifiers, used by Alembic.
revision = '0190_another_letter_org'
down_revision = '0189_ft_billing_data_type'
from alembic import op
NEW_ORGANISATIONS = [
('506', 'T... | Add letter logos for TWFRS and Thames Valley Police | Add letter logos for TWFRS and Thames Valley Police
| Python | mit | alphagov/notifications-api,alphagov/notifications-api | Add letter logos for TWFRS and Thames Valley Police | """empty message
Revision ID: 0190_another_letter_org
Revises: 0189_ft_billing_data_type
Create Date: 2017-06-29 12:44:16.815039
"""
# revision identifiers, used by Alembic.
revision = '0190_another_letter_org'
down_revision = '0189_ft_billing_data_type'
from alembic import op
NEW_ORGANISATIONS = [
('506', 'T... | <commit_before><commit_msg>Add letter logos for TWFRS and Thames Valley Police<commit_after> | """empty message
Revision ID: 0190_another_letter_org
Revises: 0189_ft_billing_data_type
Create Date: 2017-06-29 12:44:16.815039
"""
# revision identifiers, used by Alembic.
revision = '0190_another_letter_org'
down_revision = '0189_ft_billing_data_type'
from alembic import op
NEW_ORGANISATIONS = [
('506', 'T... | Add letter logos for TWFRS and Thames Valley Police"""empty message
Revision ID: 0190_another_letter_org
Revises: 0189_ft_billing_data_type
Create Date: 2017-06-29 12:44:16.815039
"""
# revision identifiers, used by Alembic.
revision = '0190_another_letter_org'
down_revision = '0189_ft_billing_data_type'
from alemb... | <commit_before><commit_msg>Add letter logos for TWFRS and Thames Valley Police<commit_after>"""empty message
Revision ID: 0190_another_letter_org
Revises: 0189_ft_billing_data_type
Create Date: 2017-06-29 12:44:16.815039
"""
# revision identifiers, used by Alembic.
revision = '0190_another_letter_org'
down_revision ... | |
a769d91d20de4cefb49a32769f648c658e31bcbb | dedupe/simplify.py | dedupe/simplify.py | from collections import defaultdict
from glob import glob
import networkx as nx
import json
import os
from pprint import pprint
import re
import subprocess
import sys
import time
import uuid
def main():
universe = nx.read_graphml(sys.argv[1])
beings = filter(lambda x: x[1]["type"] == "Being", unive... | Convert entity graphs to visually simpler graphs | Convert entity graphs to visually simpler graphs
| Python | cc0-1.0 | influence-usa/lobbying_federal_domestic | Convert entity graphs to visually simpler graphs | from collections import defaultdict
from glob import glob
import networkx as nx
import json
import os
from pprint import pprint
import re
import subprocess
import sys
import time
import uuid
def main():
universe = nx.read_graphml(sys.argv[1])
beings = filter(lambda x: x[1]["type"] == "Being", unive... | <commit_before><commit_msg>Convert entity graphs to visually simpler graphs<commit_after> | from collections import defaultdict
from glob import glob
import networkx as nx
import json
import os
from pprint import pprint
import re
import subprocess
import sys
import time
import uuid
def main():
universe = nx.read_graphml(sys.argv[1])
beings = filter(lambda x: x[1]["type"] == "Being", unive... | Convert entity graphs to visually simpler graphsfrom collections import defaultdict
from glob import glob
import networkx as nx
import json
import os
from pprint import pprint
import re
import subprocess
import sys
import time
import uuid
def main():
universe = nx.read_graphml(sys.argv[1])
beings =... | <commit_before><commit_msg>Convert entity graphs to visually simpler graphs<commit_after>from collections import defaultdict
from glob import glob
import networkx as nx
import json
import os
from pprint import pprint
import re
import subprocess
import sys
import time
import uuid
def main():
universe = nx.re... | |
c08675733d7471895103a9cb4dcdecd532ddbe17 | hashsum/run_test.py | hashsum/run_test.py | #!/usr/bin/env python
import os
import sys
import shutil
import unittest
import hashsum
print('hashsum: v%s' % hashsum.VERSION)
print('Python: %s' % sys.version)
shutil.copytree(os.path.join(os.environ['SRC_DIR'], 'tests'), 'tests')
from tests.test_hashsum import *
try:
unittest.main(verbosity=2)
finally:
... | Enable automatic testing for hash sum | Enable automatic testing for hash sum
| Python | mit | avalentino/conda-recipes | Enable automatic testing for hash sum | #!/usr/bin/env python
import os
import sys
import shutil
import unittest
import hashsum
print('hashsum: v%s' % hashsum.VERSION)
print('Python: %s' % sys.version)
shutil.copytree(os.path.join(os.environ['SRC_DIR'], 'tests'), 'tests')
from tests.test_hashsum import *
try:
unittest.main(verbosity=2)
finally:
... | <commit_before><commit_msg>Enable automatic testing for hash sum<commit_after> | #!/usr/bin/env python
import os
import sys
import shutil
import unittest
import hashsum
print('hashsum: v%s' % hashsum.VERSION)
print('Python: %s' % sys.version)
shutil.copytree(os.path.join(os.environ['SRC_DIR'], 'tests'), 'tests')
from tests.test_hashsum import *
try:
unittest.main(verbosity=2)
finally:
... | Enable automatic testing for hash sum#!/usr/bin/env python
import os
import sys
import shutil
import unittest
import hashsum
print('hashsum: v%s' % hashsum.VERSION)
print('Python: %s' % sys.version)
shutil.copytree(os.path.join(os.environ['SRC_DIR'], 'tests'), 'tests')
from tests.test_hashsum import *
try:
un... | <commit_before><commit_msg>Enable automatic testing for hash sum<commit_after>#!/usr/bin/env python
import os
import sys
import shutil
import unittest
import hashsum
print('hashsum: v%s' % hashsum.VERSION)
print('Python: %s' % sys.version)
shutil.copytree(os.path.join(os.environ['SRC_DIR'], 'tests'), 'tests')
from... | |
87eb29de6ae7a7e15e1b5d2112c504835350450f | Sensor_prototype/PIR_skeleton.py | Sensor_prototype/PIR_skeleton.py | # Detect motion from PIR module
# SKELETON code modified from http://www.raspberrypi-spy.co.uk
# Added computation of voltage time from PIR and checks
# by AC Jan 06 2014
# Import required Python libraries
import RPi.GPIO as GPIO, time
# Use BCM GPIO references instead of physical pin numbers
GPIO.setmode(GPIO.BCM)
... | Add skeleton code for PIR motion sensor | Add skeleton code for PIR motion sensor
| Python | apache-2.0 | ThatGeoGuy/ENGO500,Bjtrenth/ENGO500_Old | Add skeleton code for PIR motion sensor | # Detect motion from PIR module
# SKELETON code modified from http://www.raspberrypi-spy.co.uk
# Added computation of voltage time from PIR and checks
# by AC Jan 06 2014
# Import required Python libraries
import RPi.GPIO as GPIO, time
# Use BCM GPIO references instead of physical pin numbers
GPIO.setmode(GPIO.BCM)
... | <commit_before><commit_msg>Add skeleton code for PIR motion sensor<commit_after> | # Detect motion from PIR module
# SKELETON code modified from http://www.raspberrypi-spy.co.uk
# Added computation of voltage time from PIR and checks
# by AC Jan 06 2014
# Import required Python libraries
import RPi.GPIO as GPIO, time
# Use BCM GPIO references instead of physical pin numbers
GPIO.setmode(GPIO.BCM)
... | Add skeleton code for PIR motion sensor# Detect motion from PIR module
# SKELETON code modified from http://www.raspberrypi-spy.co.uk
# Added computation of voltage time from PIR and checks
# by AC Jan 06 2014
# Import required Python libraries
import RPi.GPIO as GPIO, time
# Use BCM GPIO references instead of physi... | <commit_before><commit_msg>Add skeleton code for PIR motion sensor<commit_after># Detect motion from PIR module
# SKELETON code modified from http://www.raspberrypi-spy.co.uk
# Added computation of voltage time from PIR and checks
# by AC Jan 06 2014
# Import required Python libraries
import RPi.GPIO as GPIO, time
#... | |
ff4eea250d030f09c7c4deb70328bf7de1f0231c | tests/lib/test_bio.py | tests/lib/test_bio.py | """Testing functions in lib/bio."""
from hypothesis import given
import hypothesis.strategies as st
import lib.bio as bio
DNA = 'ACGTUWSMKRYBDHVNXacgtuwsmkrybdhvnx'
REVERSIBLE = 'ACGTWSMKRYBDHVNXacgtwsmkrybdhvnx' # 'U's removed
PROTEIN = 'EFILPQefilpq'
HAS_PROTEIN = '[{}]*[{}]+[{}]*'.format(DNA, PROTEIN, DNA)
@giv... | Add tests for lib/bio module | Add tests for lib/bio module
| Python | bsd-3-clause | juliema/aTRAM | Add tests for lib/bio module | """Testing functions in lib/bio."""
from hypothesis import given
import hypothesis.strategies as st
import lib.bio as bio
DNA = 'ACGTUWSMKRYBDHVNXacgtuwsmkrybdhvnx'
REVERSIBLE = 'ACGTWSMKRYBDHVNXacgtwsmkrybdhvnx' # 'U's removed
PROTEIN = 'EFILPQefilpq'
HAS_PROTEIN = '[{}]*[{}]+[{}]*'.format(DNA, PROTEIN, DNA)
@giv... | <commit_before><commit_msg>Add tests for lib/bio module<commit_after> | """Testing functions in lib/bio."""
from hypothesis import given
import hypothesis.strategies as st
import lib.bio as bio
DNA = 'ACGTUWSMKRYBDHVNXacgtuwsmkrybdhvnx'
REVERSIBLE = 'ACGTWSMKRYBDHVNXacgtwsmkrybdhvnx' # 'U's removed
PROTEIN = 'EFILPQefilpq'
HAS_PROTEIN = '[{}]*[{}]+[{}]*'.format(DNA, PROTEIN, DNA)
@giv... | Add tests for lib/bio module"""Testing functions in lib/bio."""
from hypothesis import given
import hypothesis.strategies as st
import lib.bio as bio
DNA = 'ACGTUWSMKRYBDHVNXacgtuwsmkrybdhvnx'
REVERSIBLE = 'ACGTWSMKRYBDHVNXacgtwsmkrybdhvnx' # 'U's removed
PROTEIN = 'EFILPQefilpq'
HAS_PROTEIN = '[{}]*[{}]+[{}]*'.form... | <commit_before><commit_msg>Add tests for lib/bio module<commit_after>"""Testing functions in lib/bio."""
from hypothesis import given
import hypothesis.strategies as st
import lib.bio as bio
DNA = 'ACGTUWSMKRYBDHVNXacgtuwsmkrybdhvnx'
REVERSIBLE = 'ACGTWSMKRYBDHVNXacgtwsmkrybdhvnx' # 'U's removed
PROTEIN = 'EFILPQefi... | |
1869dd0a450411b77f651ac528543fbb22e723e4 | thespian/test/test_badmessage.py | thespian/test/test_badmessage.py | from thespian.actors import *
from thespian.test import *
import time
from datetime import timedelta
import sys
max_response_delay = timedelta(seconds=1.0)
class BadMessage(object):
def __init__(self, val):
self.val = val
def __str__(self):
return 'Using an invalid member: ' + str(self.this_... | Add tests for bad messages, and actor message retries. | Add tests for bad messages, and actor message retries.
| Python | mit | kquick/Thespian,kquick/Thespian | Add tests for bad messages, and actor message retries. | from thespian.actors import *
from thespian.test import *
import time
from datetime import timedelta
import sys
max_response_delay = timedelta(seconds=1.0)
class BadMessage(object):
def __init__(self, val):
self.val = val
def __str__(self):
return 'Using an invalid member: ' + str(self.this_... | <commit_before><commit_msg>Add tests for bad messages, and actor message retries.<commit_after> | from thespian.actors import *
from thespian.test import *
import time
from datetime import timedelta
import sys
max_response_delay = timedelta(seconds=1.0)
class BadMessage(object):
def __init__(self, val):
self.val = val
def __str__(self):
return 'Using an invalid member: ' + str(self.this_... | Add tests for bad messages, and actor message retries.from thespian.actors import *
from thespian.test import *
import time
from datetime import timedelta
import sys
max_response_delay = timedelta(seconds=1.0)
class BadMessage(object):
def __init__(self, val):
self.val = val
def __str__(self):
... | <commit_before><commit_msg>Add tests for bad messages, and actor message retries.<commit_after>from thespian.actors import *
from thespian.test import *
import time
from datetime import timedelta
import sys
max_response_delay = timedelta(seconds=1.0)
class BadMessage(object):
def __init__(self, val):
se... | |
489ffcda5143a2ef28d4cbcf5418babd963f2b0f | tests/test_signals.py | tests/test_signals.py | from twisted.internet import defer
from twisted.trial import unittest
from scrapy import signals, Request, Spider
from scrapy.utils.test import get_crawler
from tests.mockserver import MockServer
class ItemSpider(Spider):
name = 'itemspider'
def start_requests(self):
for _ in range(10):
... | Add a test for an async item_scraped handler. | Add a test for an async item_scraped handler.
| Python | bsd-3-clause | scrapy/scrapy,eLRuLL/scrapy,scrapy/scrapy,elacuesta/scrapy,elacuesta/scrapy,pawelmhm/scrapy,scrapy/scrapy,eLRuLL/scrapy,elacuesta/scrapy,starrify/scrapy,dangra/scrapy,dangra/scrapy,starrify/scrapy,pablohoffman/scrapy,pawelmhm/scrapy,pablohoffman/scrapy,pablohoffman/scrapy,starrify/scrapy,dangra/scrapy,pawelmhm/scrapy,e... | Add a test for an async item_scraped handler. | from twisted.internet import defer
from twisted.trial import unittest
from scrapy import signals, Request, Spider
from scrapy.utils.test import get_crawler
from tests.mockserver import MockServer
class ItemSpider(Spider):
name = 'itemspider'
def start_requests(self):
for _ in range(10):
... | <commit_before><commit_msg>Add a test for an async item_scraped handler.<commit_after> | from twisted.internet import defer
from twisted.trial import unittest
from scrapy import signals, Request, Spider
from scrapy.utils.test import get_crawler
from tests.mockserver import MockServer
class ItemSpider(Spider):
name = 'itemspider'
def start_requests(self):
for _ in range(10):
... | Add a test for an async item_scraped handler.from twisted.internet import defer
from twisted.trial import unittest
from scrapy import signals, Request, Spider
from scrapy.utils.test import get_crawler
from tests.mockserver import MockServer
class ItemSpider(Spider):
name = 'itemspider'
def start_requests(s... | <commit_before><commit_msg>Add a test for an async item_scraped handler.<commit_after>from twisted.internet import defer
from twisted.trial import unittest
from scrapy import signals, Request, Spider
from scrapy.utils.test import get_crawler
from tests.mockserver import MockServer
class ItemSpider(Spider):
name... | |
1302421f613ee12f62f6610fe50ff98610d41000 | vcirc.py | vcirc.py | #!/usr/bin/env python
# -----------------------------------------------------------------------------
# GENHERNQUIST.VCIRC
# Laura L Watkins [[email protected]]
# -----------------------------------------------------------------------------
from numpy import *
from astropy import units as u, constants as c
from ... | Add routine to calculate circular velocity. | Add routine to calculate circular velocity.
| Python | bsd-2-clause | lauralwatkins/genhernquist | Add routine to calculate circular velocity. | #!/usr/bin/env python
# -----------------------------------------------------------------------------
# GENHERNQUIST.VCIRC
# Laura L Watkins [[email protected]]
# -----------------------------------------------------------------------------
from numpy import *
from astropy import units as u, constants as c
from ... | <commit_before><commit_msg>Add routine to calculate circular velocity.<commit_after> | #!/usr/bin/env python
# -----------------------------------------------------------------------------
# GENHERNQUIST.VCIRC
# Laura L Watkins [[email protected]]
# -----------------------------------------------------------------------------
from numpy import *
from astropy import units as u, constants as c
from ... | Add routine to calculate circular velocity.#!/usr/bin/env python
# -----------------------------------------------------------------------------
# GENHERNQUIST.VCIRC
# Laura L Watkins [[email protected]]
# -----------------------------------------------------------------------------
from numpy import *
from astr... | <commit_before><commit_msg>Add routine to calculate circular velocity.<commit_after>#!/usr/bin/env python
# -----------------------------------------------------------------------------
# GENHERNQUIST.VCIRC
# Laura L Watkins [[email protected]]
# -------------------------------------------------------------------... | |
53bca73d70db98b3657b65c071b32240e8403010 | bin/2000/shape_msa_blockgroup.py | bin/2000/shape_msa_blockgroup.py | """shape_msa_blockgroup.py
Output one shapefile per MSA containing all the blockgroups it contains
"""
import os
import csv
import fiona
#
# Import MSA to blockgroup crosswalk
#
msa_to_bg = {}
with open('data/2000/crosswalks/msa_blockgroup.csv', 'r') as source:
reader = csv.reader(source, delimiter='\t')
re... | Add script to extract the shape of blockgroups and aggregate them per msa | Add script to extract the shape of blockgroups and aggregate them per msa
| Python | bsd-2-clause | scities/2000-us-metro-atlas | Add script to extract the shape of blockgroups and aggregate them per msa | """shape_msa_blockgroup.py
Output one shapefile per MSA containing all the blockgroups it contains
"""
import os
import csv
import fiona
#
# Import MSA to blockgroup crosswalk
#
msa_to_bg = {}
with open('data/2000/crosswalks/msa_blockgroup.csv', 'r') as source:
reader = csv.reader(source, delimiter='\t')
re... | <commit_before><commit_msg>Add script to extract the shape of blockgroups and aggregate them per msa<commit_after> | """shape_msa_blockgroup.py
Output one shapefile per MSA containing all the blockgroups it contains
"""
import os
import csv
import fiona
#
# Import MSA to blockgroup crosswalk
#
msa_to_bg = {}
with open('data/2000/crosswalks/msa_blockgroup.csv', 'r') as source:
reader = csv.reader(source, delimiter='\t')
re... | Add script to extract the shape of blockgroups and aggregate them per msa"""shape_msa_blockgroup.py
Output one shapefile per MSA containing all the blockgroups it contains
"""
import os
import csv
import fiona
#
# Import MSA to blockgroup crosswalk
#
msa_to_bg = {}
with open('data/2000/crosswalks/msa_blockgroup.csv... | <commit_before><commit_msg>Add script to extract the shape of blockgroups and aggregate them per msa<commit_after>"""shape_msa_blockgroup.py
Output one shapefile per MSA containing all the blockgroups it contains
"""
import os
import csv
import fiona
#
# Import MSA to blockgroup crosswalk
#
msa_to_bg = {}
with open... | |
c81f577153a258176cabedb1c194fdb58d8c1d67 | telemetry/telemetry/page/actions/action_runner_unittest.py | telemetry/telemetry/page/actions/action_runner_unittest.py | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from telemetry.core.backends.chrome import tracing_backend
from telemetry.core.timeline import model
from telemetry.page.actions import action_runner as actio... | Add test for action_runner.BeginInteraction and action_runner.EndInteraction. | Add test for action_runner.BeginInteraction and action_runner.EndInteraction.
BUG=368767
Review URL: https://codereview.chromium.org/294943006
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@272549 0039d316-1c4b-4281-b951-d872f2087c98
| Python | bsd-3-clause | catapult-project/catapult-csm,sahiljain/catapult,catapult-project/catapult,sahiljain/catapult,benschmaus/catapult,catapult-project/catapult-csm,SummerLW/Perf-Insight-Report,SummerLW/Perf-Insight-Report,catapult-project/catapult,benschmaus/catapult,benschmaus/catapult,benschmaus/catapult,catapult-project/catapult-csm,ca... | Add test for action_runner.BeginInteraction and action_runner.EndInteraction.
BUG=368767
Review URL: https://codereview.chromium.org/294943006
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@272549 0039d316-1c4b-4281-b951-d872f2087c98 | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from telemetry.core.backends.chrome import tracing_backend
from telemetry.core.timeline import model
from telemetry.page.actions import action_runner as actio... | <commit_before><commit_msg>Add test for action_runner.BeginInteraction and action_runner.EndInteraction.
BUG=368767
Review URL: https://codereview.chromium.org/294943006
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@272549 0039d316-1c4b-4281-b951-d872f2087c98<commit_after> | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from telemetry.core.backends.chrome import tracing_backend
from telemetry.core.timeline import model
from telemetry.page.actions import action_runner as actio... | Add test for action_runner.BeginInteraction and action_runner.EndInteraction.
BUG=368767
Review URL: https://codereview.chromium.org/294943006
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@272549 0039d316-1c4b-4281-b951-d872f2087c98# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this sour... | <commit_before><commit_msg>Add test for action_runner.BeginInteraction and action_runner.EndInteraction.
BUG=368767
Review URL: https://codereview.chromium.org/294943006
git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@272549 0039d316-1c4b-4281-b951-d872f2087c98<commit_after># Copyright 2014 The Chromium Authors... | |
f06aeb490fe5c57c1924b46595be26909f579178 | tests/cpydiff/syntax_assign_expr.py | tests/cpydiff/syntax_assign_expr.py | """
categories: Syntax,Operators
description: MicroPython allows using := to assign to the variable of a comprehension, CPython raises a SyntaxError.
cause: MicroPython is optimised for code size and doesn't check this case.
workaround: Do not rely on this behaviour if writing CPython compatible code.
"""
print([i := -... | Add CPy diff test for assignment expression behaviour. | tests/cpydiff: Add CPy diff test for assignment expression behaviour.
| Python | mit | pfalcon/micropython,pfalcon/micropython,pfalcon/micropython,pfalcon/micropython,pfalcon/micropython | tests/cpydiff: Add CPy diff test for assignment expression behaviour. | """
categories: Syntax,Operators
description: MicroPython allows using := to assign to the variable of a comprehension, CPython raises a SyntaxError.
cause: MicroPython is optimised for code size and doesn't check this case.
workaround: Do not rely on this behaviour if writing CPython compatible code.
"""
print([i := -... | <commit_before><commit_msg>tests/cpydiff: Add CPy diff test for assignment expression behaviour.<commit_after> | """
categories: Syntax,Operators
description: MicroPython allows using := to assign to the variable of a comprehension, CPython raises a SyntaxError.
cause: MicroPython is optimised for code size and doesn't check this case.
workaround: Do not rely on this behaviour if writing CPython compatible code.
"""
print([i := -... | tests/cpydiff: Add CPy diff test for assignment expression behaviour."""
categories: Syntax,Operators
description: MicroPython allows using := to assign to the variable of a comprehension, CPython raises a SyntaxError.
cause: MicroPython is optimised for code size and doesn't check this case.
workaround: Do not rely on... | <commit_before><commit_msg>tests/cpydiff: Add CPy diff test for assignment expression behaviour.<commit_after>"""
categories: Syntax,Operators
description: MicroPython allows using := to assign to the variable of a comprehension, CPython raises a SyntaxError.
cause: MicroPython is optimised for code size and doesn't ch... | |
56992cc873c5837da0907a44af562646b54ed173 | scripts/run_gunicorn_server.py | scripts/run_gunicorn_server.py | import subprocess
import argparse
import pwd
import os
def _get_user_home_dir(user):
return os.path.expanduser('~' + user)
def build_parser():
def _get_current_user():
return pwd.getpwuid(os.getuid())[0]
DEFAULTS = {
'workers': 3,
'user': _get_current_user(),
'group': _... | Add a convenience script for running gunicorn workers | Add a convenience script for running gunicorn workers
| Python | bsd-3-clause | mlalic/TumCampusAppBackend,mlalic/TumCampusAppBackend | Add a convenience script for running gunicorn workers | import subprocess
import argparse
import pwd
import os
def _get_user_home_dir(user):
return os.path.expanduser('~' + user)
def build_parser():
def _get_current_user():
return pwd.getpwuid(os.getuid())[0]
DEFAULTS = {
'workers': 3,
'user': _get_current_user(),
'group': _... | <commit_before><commit_msg>Add a convenience script for running gunicorn workers<commit_after> | import subprocess
import argparse
import pwd
import os
def _get_user_home_dir(user):
return os.path.expanduser('~' + user)
def build_parser():
def _get_current_user():
return pwd.getpwuid(os.getuid())[0]
DEFAULTS = {
'workers': 3,
'user': _get_current_user(),
'group': _... | Add a convenience script for running gunicorn workersimport subprocess
import argparse
import pwd
import os
def _get_user_home_dir(user):
return os.path.expanduser('~' + user)
def build_parser():
def _get_current_user():
return pwd.getpwuid(os.getuid())[0]
DEFAULTS = {
'workers': 3,
... | <commit_before><commit_msg>Add a convenience script for running gunicorn workers<commit_after>import subprocess
import argparse
import pwd
import os
def _get_user_home_dir(user):
return os.path.expanduser('~' + user)
def build_parser():
def _get_current_user():
return pwd.getpwuid(os.getuid())[0]
... | |
b5c02ab5789d228876ef647f35acdf287166256f | csl-add-updated.py | csl-add-updated.py | # Python script to add timestamp to style with empty updated field
# Author: Rintze M. Zelle
# Version: 2011-12-17
# * Requires lxml library (http://lxml.de/)
import os, glob, re
from lxml import etree
path = 'C:\Documents and Settings\zelle\My Documents\CSL\styles\dependent\\'
verbatims = {}
for independentStyle in... | Add old script to add cs:updated element to styles. | Add old script to add cs:updated element to styles.
| Python | mit | citation-style-language/utilities,citation-style-language/utilities,citation-style-language/utilities,citation-style-language/utilities | Add old script to add cs:updated element to styles. | # Python script to add timestamp to style with empty updated field
# Author: Rintze M. Zelle
# Version: 2011-12-17
# * Requires lxml library (http://lxml.de/)
import os, glob, re
from lxml import etree
path = 'C:\Documents and Settings\zelle\My Documents\CSL\styles\dependent\\'
verbatims = {}
for independentStyle in... | <commit_before><commit_msg>Add old script to add cs:updated element to styles.<commit_after> | # Python script to add timestamp to style with empty updated field
# Author: Rintze M. Zelle
# Version: 2011-12-17
# * Requires lxml library (http://lxml.de/)
import os, glob, re
from lxml import etree
path = 'C:\Documents and Settings\zelle\My Documents\CSL\styles\dependent\\'
verbatims = {}
for independentStyle in... | Add old script to add cs:updated element to styles.# Python script to add timestamp to style with empty updated field
# Author: Rintze M. Zelle
# Version: 2011-12-17
# * Requires lxml library (http://lxml.de/)
import os, glob, re
from lxml import etree
path = 'C:\Documents and Settings\zelle\My Documents\CSL\styles\d... | <commit_before><commit_msg>Add old script to add cs:updated element to styles.<commit_after># Python script to add timestamp to style with empty updated field
# Author: Rintze M. Zelle
# Version: 2011-12-17
# * Requires lxml library (http://lxml.de/)
import os, glob, re
from lxml import etree
path = 'C:\Documents and... | |
6bd463c7f2627782816896f42e92f36f7f07b3b9 | scripts/hidefast.py | scripts/hidefast.py | from optparse import OptionParser
from queue import LifoQueue
from typing import Iterator, List
import requests
from logger import logger
BASE_URL = 'http://showfast.sc.couchbase.com'
def get_menu() -> dict:
return requests.get(url=BASE_URL + '/static/menu.json').json()
def get_benchmarks(component: str, cate... | Add a script for hiding old ShowFast results | Add a script for hiding old ShowFast results
The script keeps the specified number of the most recent results
per release and hides everything else. It is helpful for keeping
ShowFast clean and normalized.
Here is an example of hiding Spock results for XDCR and Views:
$ env/bin/python scripts/hideslow.py --component... | Python | apache-2.0 | couchbase/perfrunner,couchbase/perfrunner,pavel-paulau/perfrunner,pavel-paulau/perfrunner,pavel-paulau/perfrunner,pavel-paulau/perfrunner,couchbase/perfrunner,couchbase/perfrunner,pavel-paulau/perfrunner,couchbase/perfrunner,couchbase/perfrunner | Add a script for hiding old ShowFast results
The script keeps the specified number of the most recent results
per release and hides everything else. It is helpful for keeping
ShowFast clean and normalized.
Here is an example of hiding Spock results for XDCR and Views:
$ env/bin/python scripts/hideslow.py --component... | from optparse import OptionParser
from queue import LifoQueue
from typing import Iterator, List
import requests
from logger import logger
BASE_URL = 'http://showfast.sc.couchbase.com'
def get_menu() -> dict:
return requests.get(url=BASE_URL + '/static/menu.json').json()
def get_benchmarks(component: str, cate... | <commit_before><commit_msg>Add a script for hiding old ShowFast results
The script keeps the specified number of the most recent results
per release and hides everything else. It is helpful for keeping
ShowFast clean and normalized.
Here is an example of hiding Spock results for XDCR and Views:
$ env/bin/python scri... | from optparse import OptionParser
from queue import LifoQueue
from typing import Iterator, List
import requests
from logger import logger
BASE_URL = 'http://showfast.sc.couchbase.com'
def get_menu() -> dict:
return requests.get(url=BASE_URL + '/static/menu.json').json()
def get_benchmarks(component: str, cate... | Add a script for hiding old ShowFast results
The script keeps the specified number of the most recent results
per release and hides everything else. It is helpful for keeping
ShowFast clean and normalized.
Here is an example of hiding Spock results for XDCR and Views:
$ env/bin/python scripts/hideslow.py --component... | <commit_before><commit_msg>Add a script for hiding old ShowFast results
The script keeps the specified number of the most recent results
per release and hides everything else. It is helpful for keeping
ShowFast clean and normalized.
Here is an example of hiding Spock results for XDCR and Views:
$ env/bin/python scri... | |
3fe44d5aecbc80d2db3bacaf61aca69a3e36e388 | plot_graph.py | plot_graph.py | from graphviz import Digraph
#Add the path of graphviz to render the graph
import os
os.environ["PATH"] += os.pathsep + 'C:/Program Files/graphviz-2.38/bin'
dot = Digraph(comment='The Round Table')
#add nodes
dot.node('I', 'Inflow')
dot.node('V', 'Volume')
dot.node('O', 'Outflow')
#add edges
dot.edge('I', 'V', label='... | Add naive code for generating and rendering casual model and state graph visualization | Add naive code for generating and rendering casual model and state graph visualization
| Python | mit | Kaleidophon/puzzled-platypus | Add naive code for generating and rendering casual model and state graph visualization | from graphviz import Digraph
#Add the path of graphviz to render the graph
import os
os.environ["PATH"] += os.pathsep + 'C:/Program Files/graphviz-2.38/bin'
dot = Digraph(comment='The Round Table')
#add nodes
dot.node('I', 'Inflow')
dot.node('V', 'Volume')
dot.node('O', 'Outflow')
#add edges
dot.edge('I', 'V', label='... | <commit_before><commit_msg>Add naive code for generating and rendering casual model and state graph visualization<commit_after> | from graphviz import Digraph
#Add the path of graphviz to render the graph
import os
os.environ["PATH"] += os.pathsep + 'C:/Program Files/graphviz-2.38/bin'
dot = Digraph(comment='The Round Table')
#add nodes
dot.node('I', 'Inflow')
dot.node('V', 'Volume')
dot.node('O', 'Outflow')
#add edges
dot.edge('I', 'V', label='... | Add naive code for generating and rendering casual model and state graph visualizationfrom graphviz import Digraph
#Add the path of graphviz to render the graph
import os
os.environ["PATH"] += os.pathsep + 'C:/Program Files/graphviz-2.38/bin'
dot = Digraph(comment='The Round Table')
#add nodes
dot.node('I', 'Inflow')
... | <commit_before><commit_msg>Add naive code for generating and rendering casual model and state graph visualization<commit_after>from graphviz import Digraph
#Add the path of graphviz to render the graph
import os
os.environ["PATH"] += os.pathsep + 'C:/Program Files/graphviz-2.38/bin'
dot = Digraph(comment='The Round Ta... | |
9d2269dc8d7fd487f1107733efcba5426d65dd95 | gmn/src/d1_gmn/tests/conftest.py | gmn/src/d1_gmn/tests/conftest.py | # -*- coding: utf-8 -*-
# This work was created by participants in the DataONE project, and is
# jointly copyrighted by participating institutions in DataONE. For
# more information on DataONE, see our web site at http://dataone.org.
#
# Copyright 2009-2016 DataONE
#
# Licensed under the Apache License, Version 2.0 ... | Fix hidden unit test dependencies | Fix hidden unit test dependencies
| Python | apache-2.0 | DataONEorg/d1_python,DataONEorg/d1_python,DataONEorg/d1_python,DataONEorg/d1_python | Fix hidden unit test dependencies | # -*- coding: utf-8 -*-
# This work was created by participants in the DataONE project, and is
# jointly copyrighted by participating institutions in DataONE. For
# more information on DataONE, see our web site at http://dataone.org.
#
# Copyright 2009-2016 DataONE
#
# Licensed under the Apache License, Version 2.0 ... | <commit_before><commit_msg>Fix hidden unit test dependencies<commit_after> | # -*- coding: utf-8 -*-
# This work was created by participants in the DataONE project, and is
# jointly copyrighted by participating institutions in DataONE. For
# more information on DataONE, see our web site at http://dataone.org.
#
# Copyright 2009-2016 DataONE
#
# Licensed under the Apache License, Version 2.0 ... | Fix hidden unit test dependencies# -*- coding: utf-8 -*-
# This work was created by participants in the DataONE project, and is
# jointly copyrighted by participating institutions in DataONE. For
# more information on DataONE, see our web site at http://dataone.org.
#
# Copyright 2009-2016 DataONE
#
# Licensed under... | <commit_before><commit_msg>Fix hidden unit test dependencies<commit_after># -*- coding: utf-8 -*-
# This work was created by participants in the DataONE project, and is
# jointly copyrighted by participating institutions in DataONE. For
# more information on DataONE, see our web site at http://dataone.org.
#
# Copyr... | |
b17d1d72513e46b1c43664ea89dd37bc7f8d137c | problem_38.py | problem_38.py | from time import time
from itertools import permutations
DIGITS = 123456789
def is_pandigital_product(num):
for l in range(1, len(str(num))):
candidate_num = int(str(num)[0:l])
if candidate_num > 2 * int(str(num)[l:]):
break
product_idx = 2
products = [str(candidate... | Add problem 38, pandigital multiples | Add problem 38, pandigital multiples
| Python | mit | dimkarakostas/project-euler | Add problem 38, pandigital multiples | from time import time
from itertools import permutations
DIGITS = 123456789
def is_pandigital_product(num):
for l in range(1, len(str(num))):
candidate_num = int(str(num)[0:l])
if candidate_num > 2 * int(str(num)[l:]):
break
product_idx = 2
products = [str(candidate... | <commit_before><commit_msg>Add problem 38, pandigital multiples<commit_after> | from time import time
from itertools import permutations
DIGITS = 123456789
def is_pandigital_product(num):
for l in range(1, len(str(num))):
candidate_num = int(str(num)[0:l])
if candidate_num > 2 * int(str(num)[l:]):
break
product_idx = 2
products = [str(candidate... | Add problem 38, pandigital multiplesfrom time import time
from itertools import permutations
DIGITS = 123456789
def is_pandigital_product(num):
for l in range(1, len(str(num))):
candidate_num = int(str(num)[0:l])
if candidate_num > 2 * int(str(num)[l:]):
break
product_idx =... | <commit_before><commit_msg>Add problem 38, pandigital multiples<commit_after>from time import time
from itertools import permutations
DIGITS = 123456789
def is_pandigital_product(num):
for l in range(1, len(str(num))):
candidate_num = int(str(num)[0:l])
if candidate_num > 2 * int(str(num)[l:]):... | |
ae556bc7878ce3da255cf3286dfad12b92324c3b | contract.v.py | contract.v.py | # Ethereum flashcards smart-contract v1.0
#
# This contract is used to place/execute sell and buy
# orders for flashcard categories in codingchili/flashcards-webapp.git
# maps category owners to a category and its cost.
categories: {
category: bytes32,
owner: address,
cost: wei_value,
}[bytes32]
... | Add first draft of ethereum trading contract in Viper. | Add first draft of ethereum trading contract in Viper.
| Python | mit | codingchili/flashcards-webapp,codingchili/flashcards-webapp,codingchili/flashcards-webapp,codingchili/flashcards-webapp,codingchili/flashcards-webapp | Add first draft of ethereum trading contract in Viper. | # Ethereum flashcards smart-contract v1.0
#
# This contract is used to place/execute sell and buy
# orders for flashcard categories in codingchili/flashcards-webapp.git
# maps category owners to a category and its cost.
categories: {
category: bytes32,
owner: address,
cost: wei_value,
}[bytes32]
... | <commit_before><commit_msg>Add first draft of ethereum trading contract in Viper.<commit_after> | # Ethereum flashcards smart-contract v1.0
#
# This contract is used to place/execute sell and buy
# orders for flashcard categories in codingchili/flashcards-webapp.git
# maps category owners to a category and its cost.
categories: {
category: bytes32,
owner: address,
cost: wei_value,
}[bytes32]
... | Add first draft of ethereum trading contract in Viper.# Ethereum flashcards smart-contract v1.0
#
# This contract is used to place/execute sell and buy
# orders for flashcard categories in codingchili/flashcards-webapp.git
# maps category owners to a category and its cost.
categories: {
category: bytes32,
... | <commit_before><commit_msg>Add first draft of ethereum trading contract in Viper.<commit_after># Ethereum flashcards smart-contract v1.0
#
# This contract is used to place/execute sell and buy
# orders for flashcard categories in codingchili/flashcards-webapp.git
# maps category owners to a category and its cost.... | |
ef66a692305bfd580071095906ae42feb988f3bd | ha-server-details.py | ha-server-details.py | #!/usr/bin/env python
#usage: ha-server-details UUID
import sys
import pyrax
import getopt
import pprint
from common import init_pyrax
def main(argv):
if len(argv) != 1:
print "usage: ha-server-details UUID";
return
init_pyrax()
for ha in pyrax.cloud_databases.list_ha():
if ha.i... | Add a script to get server details. | Add a script to get server details.
| Python | apache-2.0 | ddaeschler/rackspace-ha-dbtools,ddaeschler/rackspace-ha-dbtools | Add a script to get server details. | #!/usr/bin/env python
#usage: ha-server-details UUID
import sys
import pyrax
import getopt
import pprint
from common import init_pyrax
def main(argv):
if len(argv) != 1:
print "usage: ha-server-details UUID";
return
init_pyrax()
for ha in pyrax.cloud_databases.list_ha():
if ha.i... | <commit_before><commit_msg>Add a script to get server details.<commit_after> | #!/usr/bin/env python
#usage: ha-server-details UUID
import sys
import pyrax
import getopt
import pprint
from common import init_pyrax
def main(argv):
if len(argv) != 1:
print "usage: ha-server-details UUID";
return
init_pyrax()
for ha in pyrax.cloud_databases.list_ha():
if ha.i... | Add a script to get server details.#!/usr/bin/env python
#usage: ha-server-details UUID
import sys
import pyrax
import getopt
import pprint
from common import init_pyrax
def main(argv):
if len(argv) != 1:
print "usage: ha-server-details UUID";
return
init_pyrax()
for ha in pyrax.cloud_d... | <commit_before><commit_msg>Add a script to get server details.<commit_after>#!/usr/bin/env python
#usage: ha-server-details UUID
import sys
import pyrax
import getopt
import pprint
from common import init_pyrax
def main(argv):
if len(argv) != 1:
print "usage: ha-server-details UUID";
return
... | |
abaccb07d3acc13a49765c5d203bc886a06b6a4e | python/039.py | python/039.py | '''
Integer Right Triangles
=======================
If p is the perimeter of a right angle triangle with integral length sides,
{a,b,c}, there are exactly three solutions for p = 120.
{20,48,52}, {24,45,51}, {30,40,50}
For which value of p ≤ 1000, is the number of solutions maximised?
'''
# I... | Add python implementation for problem 39. | Add python implementation for problem 39.
| Python | apache-2.0 | daithiocrualaoich/euler | Add python implementation for problem 39. | '''
Integer Right Triangles
=======================
If p is the perimeter of a right angle triangle with integral length sides,
{a,b,c}, there are exactly three solutions for p = 120.
{20,48,52}, {24,45,51}, {30,40,50}
For which value of p ≤ 1000, is the number of solutions maximised?
'''
# I... | <commit_before><commit_msg>Add python implementation for problem 39.<commit_after> | '''
Integer Right Triangles
=======================
If p is the perimeter of a right angle triangle with integral length sides,
{a,b,c}, there are exactly three solutions for p = 120.
{20,48,52}, {24,45,51}, {30,40,50}
For which value of p ≤ 1000, is the number of solutions maximised?
'''
# I... | Add python implementation for problem 39.'''
Integer Right Triangles
=======================
If p is the perimeter of a right angle triangle with integral length sides,
{a,b,c}, there are exactly three solutions for p = 120.
{20,48,52}, {24,45,51}, {30,40,50}
For which value of p ≤ 1000, is th... | <commit_before><commit_msg>Add python implementation for problem 39.<commit_after>'''
Integer Right Triangles
=======================
If p is the perimeter of a right angle triangle with integral length sides,
{a,b,c}, there are exactly three solutions for p = 120.
{20,48,52}, {24,45,51}, {30,40,50... | |
5f6befdd8a90de3257b9d5bca9a103d1bdb43cfa | onebot/plugins/psa.py | onebot/plugins/psa.py | # -*- coding: utf-8 -*-
"""
================================================
:mod:`onebot.plugins.psa` PSA
================================================
This plugin allows admins to send broadcasts
"""
from irc3 import plugin
from irc3.plugins.command import command
@plugin
class PSAPlugin(object):
"""PSA Pl... | Create PSA plugin, only accessible for admins | Create PSA plugin, only accessible for admins
| Python | bsd-3-clause | thomwiggers/onebot | Create PSA plugin, only accessible for admins | # -*- coding: utf-8 -*-
"""
================================================
:mod:`onebot.plugins.psa` PSA
================================================
This plugin allows admins to send broadcasts
"""
from irc3 import plugin
from irc3.plugins.command import command
@plugin
class PSAPlugin(object):
"""PSA Pl... | <commit_before><commit_msg>Create PSA plugin, only accessible for admins<commit_after> | # -*- coding: utf-8 -*-
"""
================================================
:mod:`onebot.plugins.psa` PSA
================================================
This plugin allows admins to send broadcasts
"""
from irc3 import plugin
from irc3.plugins.command import command
@plugin
class PSAPlugin(object):
"""PSA Pl... | Create PSA plugin, only accessible for admins# -*- coding: utf-8 -*-
"""
================================================
:mod:`onebot.plugins.psa` PSA
================================================
This plugin allows admins to send broadcasts
"""
from irc3 import plugin
from irc3.plugins.command import command
@... | <commit_before><commit_msg>Create PSA plugin, only accessible for admins<commit_after># -*- coding: utf-8 -*-
"""
================================================
:mod:`onebot.plugins.psa` PSA
================================================
This plugin allows admins to send broadcasts
"""
from irc3 import plugin
fro... | |
5d9b4af15b60f5f597179fdfc66f0539acc48798 | phonetics_download.py | phonetics_download.py | '''
Created on 2013-12-20
@author: bn
'''
# -*- coding: gbk -*-
import re
try:
input = raw_input
except NameError:
pass
try:
import urllib.request
#import urllib.parse
except ImportError:
import urllib
urllib.request = __import__('urllib2')
urllib.parse = __import__('urlparse')
urlope... | Add phonetics download from aiciba, can download more things from aiciba in future | Add phonetics download from aiciba, can download more things from aiciba in future
| Python | apache-2.0 | crike/crike,crike/crike,crike/crike,crike/crike | Add phonetics download from aiciba, can download more things from aiciba in future | '''
Created on 2013-12-20
@author: bn
'''
# -*- coding: gbk -*-
import re
try:
input = raw_input
except NameError:
pass
try:
import urllib.request
#import urllib.parse
except ImportError:
import urllib
urllib.request = __import__('urllib2')
urllib.parse = __import__('urlparse')
urlope... | <commit_before><commit_msg>Add phonetics download from aiciba, can download more things from aiciba in future<commit_after> | '''
Created on 2013-12-20
@author: bn
'''
# -*- coding: gbk -*-
import re
try:
input = raw_input
except NameError:
pass
try:
import urllib.request
#import urllib.parse
except ImportError:
import urllib
urllib.request = __import__('urllib2')
urllib.parse = __import__('urlparse')
urlope... | Add phonetics download from aiciba, can download more things from aiciba in future'''
Created on 2013-12-20
@author: bn
'''
# -*- coding: gbk -*-
import re
try:
input = raw_input
except NameError:
pass
try:
import urllib.request
#import urllib.parse
except ImportError:
import urllib
urllib.... | <commit_before><commit_msg>Add phonetics download from aiciba, can download more things from aiciba in future<commit_after>'''
Created on 2013-12-20
@author: bn
'''
# -*- coding: gbk -*-
import re
try:
input = raw_input
except NameError:
pass
try:
import urllib.request
#import urllib.parse
except I... | |
3cb3572b4542235cc62828ff6559546746578d68 | import_mp3.py | import_mp3.py | import argparse
import os.path
from fore import database
parser = argparse.ArgumentParser(description="Bulk-import MP3 files into the appension database",
epilog="Story, lyrics, and comments will all be blank.")
parser.add_argument("filename", nargs="+", help="MP3 file(s) to import")
parser.add_argument("--submitter"... | Introduce a bulk importer, partly to prove how easy it is | Introduce a bulk importer, partly to prove how easy it is
| Python | artistic-2.0 | MikeiLL/appension,Rosuav/appension,Rosuav/appension,Rosuav/appension,MikeiLL/appension,MikeiLL/appension,MikeiLL/appension,Rosuav/appension | Introduce a bulk importer, partly to prove how easy it is | import argparse
import os.path
from fore import database
parser = argparse.ArgumentParser(description="Bulk-import MP3 files into the appension database",
epilog="Story, lyrics, and comments will all be blank.")
parser.add_argument("filename", nargs="+", help="MP3 file(s) to import")
parser.add_argument("--submitter"... | <commit_before><commit_msg>Introduce a bulk importer, partly to prove how easy it is<commit_after> | import argparse
import os.path
from fore import database
parser = argparse.ArgumentParser(description="Bulk-import MP3 files into the appension database",
epilog="Story, lyrics, and comments will all be blank.")
parser.add_argument("filename", nargs="+", help="MP3 file(s) to import")
parser.add_argument("--submitter"... | Introduce a bulk importer, partly to prove how easy it isimport argparse
import os.path
from fore import database
parser = argparse.ArgumentParser(description="Bulk-import MP3 files into the appension database",
epilog="Story, lyrics, and comments will all be blank.")
parser.add_argument("filename", nargs="+", help="... | <commit_before><commit_msg>Introduce a bulk importer, partly to prove how easy it is<commit_after>import argparse
import os.path
from fore import database
parser = argparse.ArgumentParser(description="Bulk-import MP3 files into the appension database",
epilog="Story, lyrics, and comments will all be blank.")
parser.a... | |
24788a676642a77be7d8859d4835e496b348f155 | src/scripts/combine_relnotes.py | src/scripts/combine_relnotes.py | #!/usr/bin/python
import re
import sys
def main(args = None):
if args is None:
args = sys.argv
re_version = re.compile('Version (\d+\.\d+\.\d+), ([0-9]{4}-[0-9]{2}-[0-9]{2})$')
re_nyr = re.compile('Version (\d+\.\d+\.\d+), Not Yet Released$')
version_contents = {}
version_date = {}
v... | Add a script for combining version .rst files | Add a script for combining version .rst files
| Python | bsd-2-clause | webmaster128/botan,Rohde-Schwarz-Cybersecurity/botan,randombit/botan,Rohde-Schwarz-Cybersecurity/botan,webmaster128/botan,randombit/botan,randombit/botan,Rohde-Schwarz-Cybersecurity/botan,Rohde-Schwarz-Cybersecurity/botan,randombit/botan,Rohde-Schwarz-Cybersecurity/botan,webmaster128/botan,randombit/botan,Rohde-Schwarz... | Add a script for combining version .rst files | #!/usr/bin/python
import re
import sys
def main(args = None):
if args is None:
args = sys.argv
re_version = re.compile('Version (\d+\.\d+\.\d+), ([0-9]{4}-[0-9]{2}-[0-9]{2})$')
re_nyr = re.compile('Version (\d+\.\d+\.\d+), Not Yet Released$')
version_contents = {}
version_date = {}
v... | <commit_before><commit_msg>Add a script for combining version .rst files<commit_after> | #!/usr/bin/python
import re
import sys
def main(args = None):
if args is None:
args = sys.argv
re_version = re.compile('Version (\d+\.\d+\.\d+), ([0-9]{4}-[0-9]{2}-[0-9]{2})$')
re_nyr = re.compile('Version (\d+\.\d+\.\d+), Not Yet Released$')
version_contents = {}
version_date = {}
v... | Add a script for combining version .rst files#!/usr/bin/python
import re
import sys
def main(args = None):
if args is None:
args = sys.argv
re_version = re.compile('Version (\d+\.\d+\.\d+), ([0-9]{4}-[0-9]{2}-[0-9]{2})$')
re_nyr = re.compile('Version (\d+\.\d+\.\d+), Not Yet Released$')
vers... | <commit_before><commit_msg>Add a script for combining version .rst files<commit_after>#!/usr/bin/python
import re
import sys
def main(args = None):
if args is None:
args = sys.argv
re_version = re.compile('Version (\d+\.\d+\.\d+), ([0-9]{4}-[0-9]{2}-[0-9]{2})$')
re_nyr = re.compile('Version (\d+\... | |
c6566b2917adce3f94cd1233671ecba07f7ea4e0 | problem_3/solution.py | problem_3/solution.py | def largest_prime_factor(n, h):
for i in xrange(2, n+1):
d, m = divmod(n, i)
if m == 0:
largest_prime_factor(d, i)
break
if n == 1: print h
largest_prime_factor(600851475143, 0)
| Add python implementation for problem 3 | Add python implementation for problem 3
| Python | mit | mdsrosa/project_euler,mdsrosa/project_euler,mdsrosa/project_euler,mdsrosa/project_euler,mdsrosa/project_euler,mdsrosa/project_euler,mdsrosa/project_euler,mdsrosa/project_euler | Add python implementation for problem 3 | def largest_prime_factor(n, h):
for i in xrange(2, n+1):
d, m = divmod(n, i)
if m == 0:
largest_prime_factor(d, i)
break
if n == 1: print h
largest_prime_factor(600851475143, 0)
| <commit_before><commit_msg>Add python implementation for problem 3<commit_after> | def largest_prime_factor(n, h):
for i in xrange(2, n+1):
d, m = divmod(n, i)
if m == 0:
largest_prime_factor(d, i)
break
if n == 1: print h
largest_prime_factor(600851475143, 0)
| Add python implementation for problem 3def largest_prime_factor(n, h):
for i in xrange(2, n+1):
d, m = divmod(n, i)
if m == 0:
largest_prime_factor(d, i)
break
if n == 1: print h
largest_prime_factor(600851475143, 0)
| <commit_before><commit_msg>Add python implementation for problem 3<commit_after>def largest_prime_factor(n, h):
for i in xrange(2, n+1):
d, m = divmod(n, i)
if m == 0:
largest_prime_factor(d, i)
break
if n == 1: print h
largest_prime_factor(600851475143, 0)
| |
208522ad6cf627d50953e4146e5361e42d5b9e13 | pyes/tests/errors.py | pyes/tests/errors.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Unit tests for pyes. These require an es server with thrift plugin running on the default port (localhost:9500).
"""
import unittest
from pyes.tests import ESTestCase
import pyes.exceptions
class ErrorReportingTestCase(ESTestCase):
def setUp(self):
super(Error... | Add test of the AlreadyExistsException and the NotFoundException, when creating or deleting databases | Add test of the AlreadyExistsException and the NotFoundException, when creating or deleting databases
| Python | bsd-3-clause | mavarick/pyes,rookdev/pyes,Fiedzia/pyes,haiwen/pyes,Fiedzia/pyes,mavarick/pyes,jayzeng/pyes,HackLinux/pyes,HackLinux/pyes,rookdev/pyes,jayzeng/pyes,aparo/pyes,aparo/pyes,mavarick/pyes,Fiedzia/pyes,haiwen/pyes,mouadino/pyes,haiwen/pyes,mouadino/pyes,jayzeng/pyes,HackLinux/pyes,aparo/pyes | Add test of the AlreadyExistsException and the NotFoundException, when creating or deleting databases | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Unit tests for pyes. These require an es server with thrift plugin running on the default port (localhost:9500).
"""
import unittest
from pyes.tests import ESTestCase
import pyes.exceptions
class ErrorReportingTestCase(ESTestCase):
def setUp(self):
super(Error... | <commit_before><commit_msg>Add test of the AlreadyExistsException and the NotFoundException, when creating or deleting databases<commit_after> | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Unit tests for pyes. These require an es server with thrift plugin running on the default port (localhost:9500).
"""
import unittest
from pyes.tests import ESTestCase
import pyes.exceptions
class ErrorReportingTestCase(ESTestCase):
def setUp(self):
super(Error... | Add test of the AlreadyExistsException and the NotFoundException, when creating or deleting databases#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Unit tests for pyes. These require an es server with thrift plugin running on the default port (localhost:9500).
"""
import unittest
from pyes.tests import ESTestCase
impor... | <commit_before><commit_msg>Add test of the AlreadyExistsException and the NotFoundException, when creating or deleting databases<commit_after>#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Unit tests for pyes. These require an es server with thrift plugin running on the default port (localhost:9500).
"""
import unittes... | |
f8e2e57a4f31faf69137dbd986fea15255dc35cf | tests/test_classloader.py | tests/test_classloader.py | from jawa.cf import ClassFile
from jawa.util.classloader import ClassLoader
from jawa.transforms.simple_swap import simple_swap
from jawa.assemble import assemble
def test_load_from_class():
"""Ensure we can add ClassFile's directly to the ClassLoader."""
cl = ClassLoader()
cf = ClassFile.create('TestCla... | Add a test for ClassLoader default transforms and default transform overriding. | Add a test for ClassLoader default transforms and default transform overriding.
| Python | mit | TkTech/Jawa,TkTech/Jawa | Add a test for ClassLoader default transforms and default transform overriding. | from jawa.cf import ClassFile
from jawa.util.classloader import ClassLoader
from jawa.transforms.simple_swap import simple_swap
from jawa.assemble import assemble
def test_load_from_class():
"""Ensure we can add ClassFile's directly to the ClassLoader."""
cl = ClassLoader()
cf = ClassFile.create('TestCla... | <commit_before><commit_msg>Add a test for ClassLoader default transforms and default transform overriding.<commit_after> | from jawa.cf import ClassFile
from jawa.util.classloader import ClassLoader
from jawa.transforms.simple_swap import simple_swap
from jawa.assemble import assemble
def test_load_from_class():
"""Ensure we can add ClassFile's directly to the ClassLoader."""
cl = ClassLoader()
cf = ClassFile.create('TestCla... | Add a test for ClassLoader default transforms and default transform overriding.from jawa.cf import ClassFile
from jawa.util.classloader import ClassLoader
from jawa.transforms.simple_swap import simple_swap
from jawa.assemble import assemble
def test_load_from_class():
"""Ensure we can add ClassFile's directly to... | <commit_before><commit_msg>Add a test for ClassLoader default transforms and default transform overriding.<commit_after>from jawa.cf import ClassFile
from jawa.util.classloader import ClassLoader
from jawa.transforms.simple_swap import simple_swap
from jawa.assemble import assemble
def test_load_from_class():
"""... | |
57e3b5f4224a8cf72b8378d2198d5b627a955b67 | website/tests/test_csp.py | website/tests/test_csp.py | # -*- coding: utf-8 -*-
##
# Copyright (C) 2015 Jessica Tallon & Matt Molyneaux
#
# This file is part of Inboxen.
#
# Inboxen is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either versio... | Test CSP logging view returns a 200 | Test CSP logging view returns a 200
Touch #81
| Python | agpl-3.0 | Inboxen/Inboxen,Inboxen/Inboxen,Inboxen/Inboxen,Inboxen/Inboxen | Test CSP logging view returns a 200
Touch #81 | # -*- coding: utf-8 -*-
##
# Copyright (C) 2015 Jessica Tallon & Matt Molyneaux
#
# This file is part of Inboxen.
#
# Inboxen is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either versio... | <commit_before><commit_msg>Test CSP logging view returns a 200
Touch #81<commit_after> | # -*- coding: utf-8 -*-
##
# Copyright (C) 2015 Jessica Tallon & Matt Molyneaux
#
# This file is part of Inboxen.
#
# Inboxen is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either versio... | Test CSP logging view returns a 200
Touch #81# -*- coding: utf-8 -*-
##
# Copyright (C) 2015 Jessica Tallon & Matt Molyneaux
#
# This file is part of Inboxen.
#
# Inboxen is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# ... | <commit_before><commit_msg>Test CSP logging view returns a 200
Touch #81<commit_after># -*- coding: utf-8 -*-
##
# Copyright (C) 2015 Jessica Tallon & Matt Molyneaux
#
# This file is part of Inboxen.
#
# Inboxen is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero ... | |
45b65a851f258f808143e674bd904599adb7a468 | ctypeslib/test/test_toolchain.py | ctypeslib/test/test_toolchain.py | import unittest
import sys
from ctypeslib import h2xml, xml2py
class ToolchainTest(unittest.TestCase):
if sys.platform == "win32":
def test(self):
h2xml.main(["h2xml", "-q",
"-D WIN32_LEAN_AND_MEAN",
"-D _UNICODE", "-D UNICODE",
... | Test the complete h2xml and xml2py toolchain on Windows by running it over 'windows.h'. | Test the complete h2xml and xml2py toolchain on Windows by running it
over 'windows.h'.
| Python | mit | sugarmanz/ctypeslib | Test the complete h2xml and xml2py toolchain on Windows by running it
over 'windows.h'. | import unittest
import sys
from ctypeslib import h2xml, xml2py
class ToolchainTest(unittest.TestCase):
if sys.platform == "win32":
def test(self):
h2xml.main(["h2xml", "-q",
"-D WIN32_LEAN_AND_MEAN",
"-D _UNICODE", "-D UNICODE",
... | <commit_before><commit_msg>Test the complete h2xml and xml2py toolchain on Windows by running it
over 'windows.h'.<commit_after> | import unittest
import sys
from ctypeslib import h2xml, xml2py
class ToolchainTest(unittest.TestCase):
if sys.platform == "win32":
def test(self):
h2xml.main(["h2xml", "-q",
"-D WIN32_LEAN_AND_MEAN",
"-D _UNICODE", "-D UNICODE",
... | Test the complete h2xml and xml2py toolchain on Windows by running it
over 'windows.h'.import unittest
import sys
from ctypeslib import h2xml, xml2py
class ToolchainTest(unittest.TestCase):
if sys.platform == "win32":
def test(self):
h2xml.main(["h2xml", "-q",
"-D WIN32_... | <commit_before><commit_msg>Test the complete h2xml and xml2py toolchain on Windows by running it
over 'windows.h'.<commit_after>import unittest
import sys
from ctypeslib import h2xml, xml2py
class ToolchainTest(unittest.TestCase):
if sys.platform == "win32":
def test(self):
h2xml.main(["h2xml",... | |
03329897f8730702eee03114eeb4b529c5067b53 | crmapp/urls.py | crmapp/urls.py | from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
from marketing.views import HomePage
urlpatterns = patterns('',
# Marketing pages
url(r'^$', HomePage.as_view(), name="home"),
# Subscriber related URLs
url(r'^signup/$',
'crmapp.subscr... | from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
from marketing.views import HomePage
from accounts.views import AccountList
urlpatterns = patterns('',
# Marketing pages
url(r'^$', HomePage.as_view(), name="home"),
# Subscriber related URLs
u... | Create the Account List > List Accounts - Create URL | Create the Account List > List Accounts - Create URL
| Python | mit | deenaariff/Django,tabdon/crmeasyapp,tabdon/crmeasyapp | from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
from marketing.views import HomePage
urlpatterns = patterns('',
# Marketing pages
url(r'^$', HomePage.as_view(), name="home"),
# Subscriber related URLs
url(r'^signup/$',
'crmapp.subscr... | from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
from marketing.views import HomePage
from accounts.views import AccountList
urlpatterns = patterns('',
# Marketing pages
url(r'^$', HomePage.as_view(), name="home"),
# Subscriber related URLs
u... | <commit_before>from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
from marketing.views import HomePage
urlpatterns = patterns('',
# Marketing pages
url(r'^$', HomePage.as_view(), name="home"),
# Subscriber related URLs
url(r'^signup/$',
... | from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
from marketing.views import HomePage
from accounts.views import AccountList
urlpatterns = patterns('',
# Marketing pages
url(r'^$', HomePage.as_view(), name="home"),
# Subscriber related URLs
u... | from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
from marketing.views import HomePage
urlpatterns = patterns('',
# Marketing pages
url(r'^$', HomePage.as_view(), name="home"),
# Subscriber related URLs
url(r'^signup/$',
'crmapp.subscr... | <commit_before>from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
from marketing.views import HomePage
urlpatterns = patterns('',
# Marketing pages
url(r'^$', HomePage.as_view(), name="home"),
# Subscriber related URLs
url(r'^signup/$',
... |
c3e08edd09b860e3ffbc2ae56df730f794fb17e5 | bin/oneoffs/load_external_data.py | bin/oneoffs/load_external_data.py | #!/usr/bin/env python
import bson
import copy
import datetime
import dateutil.parser
import json
from api import config
## DEFAULTS ##
USER_ID = "[email protected]"
SAFE_FILE_HASH = "v0-sha384-a8d0d1bd9368e5385f31d3582db07f9bc257537d5e1f207d36a91fdd3d2f188fff56616c0874bb3535c37fdf761a446c"
PROJECT_ID = "5a26... | Add script for loading external data for testing | Add script for loading external data for testing
| Python | mit | scitran/api,scitran/core,scitran/core,scitran/core,scitran/core,scitran/api | Add script for loading external data for testing | #!/usr/bin/env python
import bson
import copy
import datetime
import dateutil.parser
import json
from api import config
## DEFAULTS ##
USER_ID = "[email protected]"
SAFE_FILE_HASH = "v0-sha384-a8d0d1bd9368e5385f31d3582db07f9bc257537d5e1f207d36a91fdd3d2f188fff56616c0874bb3535c37fdf761a446c"
PROJECT_ID = "5a26... | <commit_before><commit_msg>Add script for loading external data for testing<commit_after> | #!/usr/bin/env python
import bson
import copy
import datetime
import dateutil.parser
import json
from api import config
## DEFAULTS ##
USER_ID = "[email protected]"
SAFE_FILE_HASH = "v0-sha384-a8d0d1bd9368e5385f31d3582db07f9bc257537d5e1f207d36a91fdd3d2f188fff56616c0874bb3535c37fdf761a446c"
PROJECT_ID = "5a26... | Add script for loading external data for testing#!/usr/bin/env python
import bson
import copy
import datetime
import dateutil.parser
import json
from api import config
## DEFAULTS ##
USER_ID = "[email protected]"
SAFE_FILE_HASH = "v0-sha384-a8d0d1bd9368e5385f31d3582db07f9bc257537d5e1f207d36a91fdd3d2f188fff56... | <commit_before><commit_msg>Add script for loading external data for testing<commit_after>#!/usr/bin/env python
import bson
import copy
import datetime
import dateutil.parser
import json
from api import config
## DEFAULTS ##
USER_ID = "[email protected]"
SAFE_FILE_HASH = "v0-sha384-a8d0d1bd9368e5385f31d3582db... | |
f8a99aadc362c1b5a83fd62ff5829b6d92aba3cd | funbox/strings.py | funbox/strings.py | #! /usr/bin/env python
"""Tools for strings.
"""
def join(sep):
"""join(sep)(iterable) Join strings in iterable with sep.
str -> [str] -> str
>>> comma_separate = join(', ')
>>> comma_separate(['a', 'b', 'c', 'd'])
'a, b, c, d'
"""
def join_sep(iterable):
return sep.join(iterable... | Add curried join from my old functoolsx module. | Add curried join from my old functoolsx module.
| Python | mit | nmbooker/python-funbox,nmbooker/python-funbox | Add curried join from my old functoolsx module. | #! /usr/bin/env python
"""Tools for strings.
"""
def join(sep):
"""join(sep)(iterable) Join strings in iterable with sep.
str -> [str] -> str
>>> comma_separate = join(', ')
>>> comma_separate(['a', 'b', 'c', 'd'])
'a, b, c, d'
"""
def join_sep(iterable):
return sep.join(iterable... | <commit_before><commit_msg>Add curried join from my old functoolsx module.<commit_after> | #! /usr/bin/env python
"""Tools for strings.
"""
def join(sep):
"""join(sep)(iterable) Join strings in iterable with sep.
str -> [str] -> str
>>> comma_separate = join(', ')
>>> comma_separate(['a', 'b', 'c', 'd'])
'a, b, c, d'
"""
def join_sep(iterable):
return sep.join(iterable... | Add curried join from my old functoolsx module.#! /usr/bin/env python
"""Tools for strings.
"""
def join(sep):
"""join(sep)(iterable) Join strings in iterable with sep.
str -> [str] -> str
>>> comma_separate = join(', ')
>>> comma_separate(['a', 'b', 'c', 'd'])
'a, b, c, d'
"""
def join_... | <commit_before><commit_msg>Add curried join from my old functoolsx module.<commit_after>#! /usr/bin/env python
"""Tools for strings.
"""
def join(sep):
"""join(sep)(iterable) Join strings in iterable with sep.
str -> [str] -> str
>>> comma_separate = join(', ')
>>> comma_separate(['a', 'b', 'c', 'd'... | |
cde10eba16094920d074079bbf0fe779a42c8bf4 | interface/net/udp/nitroshare.py | interface/net/udp/nitroshare.py | #!/usr/bin/env python
"""
Attempt to comunicate with Nitroshare.
[x] listen nitroshare broadcasts and show who is available
[x] listen for UDP packets on port 40816
"""
# --- communicating.. networking.. ---
import socket
IP4 = socket.AF_INET
UDP = socket.SOCK_DGRAM
class UDPSocketStream(object):
""" Conver... | Add first draft of Nitroshare UDP discovery | Add first draft of Nitroshare UDP discovery
| Python | unlicense | techtonik/discovery,techtonik/discovery,techtonik/discovery | Add first draft of Nitroshare UDP discovery | #!/usr/bin/env python
"""
Attempt to comunicate with Nitroshare.
[x] listen nitroshare broadcasts and show who is available
[x] listen for UDP packets on port 40816
"""
# --- communicating.. networking.. ---
import socket
IP4 = socket.AF_INET
UDP = socket.SOCK_DGRAM
class UDPSocketStream(object):
""" Conver... | <commit_before><commit_msg>Add first draft of Nitroshare UDP discovery<commit_after> | #!/usr/bin/env python
"""
Attempt to comunicate with Nitroshare.
[x] listen nitroshare broadcasts and show who is available
[x] listen for UDP packets on port 40816
"""
# --- communicating.. networking.. ---
import socket
IP4 = socket.AF_INET
UDP = socket.SOCK_DGRAM
class UDPSocketStream(object):
""" Conver... | Add first draft of Nitroshare UDP discovery#!/usr/bin/env python
"""
Attempt to comunicate with Nitroshare.
[x] listen nitroshare broadcasts and show who is available
[x] listen for UDP packets on port 40816
"""
# --- communicating.. networking.. ---
import socket
IP4 = socket.AF_INET
UDP = socket.SOCK_DGRAM
... | <commit_before><commit_msg>Add first draft of Nitroshare UDP discovery<commit_after>#!/usr/bin/env python
"""
Attempt to comunicate with Nitroshare.
[x] listen nitroshare broadcasts and show who is available
[x] listen for UDP packets on port 40816
"""
# --- communicating.. networking.. ---
import socket
IP4 =... | |
c1099e9410b8ad35e69d59e1d27f36903495cd67 | scripts/migrate_categories.py | scripts/migrate_categories.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
from tests.base import OsfTestCase
from tests.factories import NodeFactory
from website.project.model import Node
logger = logging.getLogger(__name__)
# legacy => new category
MIGRATE_MAP = {
'category': '',
'measure': 'methods and measures',
}
... | Add script for migrating categories | Add script for migrating categories
| Python | apache-2.0 | rdhyee/osf.io,mluo613/osf.io,cldershem/osf.io,sbt9uc/osf.io,KAsante95/osf.io,zachjanicki/osf.io,danielneis/osf.io,caseyrollins/osf.io,jeffreyliu3230/osf.io,CenterForOpenScience/osf.io,danielneis/osf.io,caneruguz/osf.io,himanshuo/osf.io,Ghalko/osf.io,icereval/osf.io,ckc6cz/osf.io,arpitar/osf.io,MerlinZhang/osf.io,reinaH... | Add script for migrating categories | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
from tests.base import OsfTestCase
from tests.factories import NodeFactory
from website.project.model import Node
logger = logging.getLogger(__name__)
# legacy => new category
MIGRATE_MAP = {
'category': '',
'measure': 'methods and measures',
}
... | <commit_before><commit_msg>Add script for migrating categories<commit_after> | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
from tests.base import OsfTestCase
from tests.factories import NodeFactory
from website.project.model import Node
logger = logging.getLogger(__name__)
# legacy => new category
MIGRATE_MAP = {
'category': '',
'measure': 'methods and measures',
}
... | Add script for migrating categories#!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
from tests.base import OsfTestCase
from tests.factories import NodeFactory
from website.project.model import Node
logger = logging.getLogger(__name__)
# legacy => new category
MIGRATE_MAP = {
'category': '',
'mea... | <commit_before><commit_msg>Add script for migrating categories<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
from tests.base import OsfTestCase
from tests.factories import NodeFactory
from website.project.model import Node
logger = logging.getLogger(__name__)
# legacy => new category
MIG... | |
00687827e0290fd862455adf34d6e64b1fe0b9f8 | maxwellbloch/tests/test_sigma.py | maxwellbloch/tests/test_sigma.py | """Unit tests for the sigma module.
Thomas Ogden <[email protected]>
"""
import sys
import unittest
import numpy as np
import qutip as qu
from maxwellbloch import sigma
class TestSigma(unittest.TestCase):
""" Tests for sigma.sigma. """
def test_sigma_2_0_0(self):
""" Test |0><0| for a two-level system. ""... | Add sigma tests from OB | Add sigma tests from OB
| Python | mit | tommyogden/maxwellbloch,tommyogden/maxwellbloch | Add sigma tests from OB | """Unit tests for the sigma module.
Thomas Ogden <[email protected]>
"""
import sys
import unittest
import numpy as np
import qutip as qu
from maxwellbloch import sigma
class TestSigma(unittest.TestCase):
""" Tests for sigma.sigma. """
def test_sigma_2_0_0(self):
""" Test |0><0| for a two-level system. ""... | <commit_before><commit_msg>Add sigma tests from OB<commit_after> | """Unit tests for the sigma module.
Thomas Ogden <[email protected]>
"""
import sys
import unittest
import numpy as np
import qutip as qu
from maxwellbloch import sigma
class TestSigma(unittest.TestCase):
""" Tests for sigma.sigma. """
def test_sigma_2_0_0(self):
""" Test |0><0| for a two-level system. ""... | Add sigma tests from OB"""Unit tests for the sigma module.
Thomas Ogden <[email protected]>
"""
import sys
import unittest
import numpy as np
import qutip as qu
from maxwellbloch import sigma
class TestSigma(unittest.TestCase):
""" Tests for sigma.sigma. """
def test_sigma_2_0_0(self):
""" Test |0><0| for... | <commit_before><commit_msg>Add sigma tests from OB<commit_after>"""Unit tests for the sigma module.
Thomas Ogden <[email protected]>
"""
import sys
import unittest
import numpy as np
import qutip as qu
from maxwellbloch import sigma
class TestSigma(unittest.TestCase):
""" Tests for sigma.sigma. """
def test_sigma... | |
e4cfb0cdba360bc65621ebec6d8c184725b11749 | test_aps_eventlet.py | test_aps_eventlet.py | #!/usr/bin/env python2.7
from pytz import utc
import time
import eventlet
from apscheduler.schedulers.background import BackgroundScheduler
def test_aps_eventlet():
def showMessage():
print "Show this message"
sh = BackgroundScheduler()
sh.start()
sh.add_job(showMessage, 'interval', seconds... | Test APS 3.0 with eventlet | Test APS 3.0 with eventlet
| Python | apache-2.0 | lakshmi-kannan/python-scratchpad | Test APS 3.0 with eventlet | #!/usr/bin/env python2.7
from pytz import utc
import time
import eventlet
from apscheduler.schedulers.background import BackgroundScheduler
def test_aps_eventlet():
def showMessage():
print "Show this message"
sh = BackgroundScheduler()
sh.start()
sh.add_job(showMessage, 'interval', seconds... | <commit_before><commit_msg>Test APS 3.0 with eventlet<commit_after> | #!/usr/bin/env python2.7
from pytz import utc
import time
import eventlet
from apscheduler.schedulers.background import BackgroundScheduler
def test_aps_eventlet():
def showMessage():
print "Show this message"
sh = BackgroundScheduler()
sh.start()
sh.add_job(showMessage, 'interval', seconds... | Test APS 3.0 with eventlet#!/usr/bin/env python2.7
from pytz import utc
import time
import eventlet
from apscheduler.schedulers.background import BackgroundScheduler
def test_aps_eventlet():
def showMessage():
print "Show this message"
sh = BackgroundScheduler()
sh.start()
sh.add_job(showMe... | <commit_before><commit_msg>Test APS 3.0 with eventlet<commit_after>#!/usr/bin/env python2.7
from pytz import utc
import time
import eventlet
from apscheduler.schedulers.background import BackgroundScheduler
def test_aps_eventlet():
def showMessage():
print "Show this message"
sh = BackgroundSchedul... | |
d41dec0e206f4c2904e83ab7d4934d224bea0a95 | tests/test_anonymous_json.py | tests/test_anonymous_json.py | from __future__ import print_function, unicode_literals
from aspen import json
from gittip.elsewhere.twitter import TwitterAccount
from gittip.testing import Harness
from gittip.testing.client import TestClient
class Tests(Harness):
def hit_anonymous(self, method='GET', expected_code=200):
user, ignore... | Add a few tests for anonymous.json | Add a few tests for anonymous.json
| Python | mit | gratipay/gratipay.com,mccolgst/www.gittip.com,studio666/gratipay.com,studio666/gratipay.com,studio666/gratipay.com,studio666/gratipay.com,eXcomm/gratipay.com,eXcomm/gratipay.com,eXcomm/gratipay.com,eXcomm/gratipay.com,mccolgst/www.gittip.com,mccolgst/www.gittip.com,gratipay/gratipay.com,gratipay/gratipay.com,gratipay/g... | Add a few tests for anonymous.json | from __future__ import print_function, unicode_literals
from aspen import json
from gittip.elsewhere.twitter import TwitterAccount
from gittip.testing import Harness
from gittip.testing.client import TestClient
class Tests(Harness):
def hit_anonymous(self, method='GET', expected_code=200):
user, ignore... | <commit_before><commit_msg>Add a few tests for anonymous.json<commit_after> | from __future__ import print_function, unicode_literals
from aspen import json
from gittip.elsewhere.twitter import TwitterAccount
from gittip.testing import Harness
from gittip.testing.client import TestClient
class Tests(Harness):
def hit_anonymous(self, method='GET', expected_code=200):
user, ignore... | Add a few tests for anonymous.jsonfrom __future__ import print_function, unicode_literals
from aspen import json
from gittip.elsewhere.twitter import TwitterAccount
from gittip.testing import Harness
from gittip.testing.client import TestClient
class Tests(Harness):
def hit_anonymous(self, method='GET', expect... | <commit_before><commit_msg>Add a few tests for anonymous.json<commit_after>from __future__ import print_function, unicode_literals
from aspen import json
from gittip.elsewhere.twitter import TwitterAccount
from gittip.testing import Harness
from gittip.testing.client import TestClient
class Tests(Harness):
def... | |
ebc31e8c510559c4bc862283de284247700088ea | numpy/core/tests/test_dtype.py | numpy/core/tests/test_dtype.py | import numpy as np
from numpy.testing import *
class TestBuiltin(TestCase):
def test_run(self):
"""Only test hash runs at all."""
for t in [np.int, np.float, np.complex, np.int32, np.str, np.object,
np.unicode]:
dt = np.dtype(t)
hash(dt)
class TestRecord(Tes... | Add some unit tests for the hashing protocol of dtype (fail currently). | Add some unit tests for the hashing protocol of dtype (fail currently).
| Python | bsd-3-clause | brandon-rhodes/numpy,AustereCuriosity/numpy,nguyentu1602/numpy,BabeNovelty/numpy,MSeifert04/numpy,drasmuss/numpy,njase/numpy,ogrisel/numpy,charris/numpy,ahaldane/numpy,bringingheavendown/numpy,stefanv/numpy,MichaelAquilina/numpy,mathdd/numpy,skwbc/numpy,ChanderG/numpy,larsmans/numpy,mwiebe/numpy,ChristopherHogan/numpy,... | Add some unit tests for the hashing protocol of dtype (fail currently). | import numpy as np
from numpy.testing import *
class TestBuiltin(TestCase):
def test_run(self):
"""Only test hash runs at all."""
for t in [np.int, np.float, np.complex, np.int32, np.str, np.object,
np.unicode]:
dt = np.dtype(t)
hash(dt)
class TestRecord(Tes... | <commit_before><commit_msg>Add some unit tests for the hashing protocol of dtype (fail currently).<commit_after> | import numpy as np
from numpy.testing import *
class TestBuiltin(TestCase):
def test_run(self):
"""Only test hash runs at all."""
for t in [np.int, np.float, np.complex, np.int32, np.str, np.object,
np.unicode]:
dt = np.dtype(t)
hash(dt)
class TestRecord(Tes... | Add some unit tests for the hashing protocol of dtype (fail currently).import numpy as np
from numpy.testing import *
class TestBuiltin(TestCase):
def test_run(self):
"""Only test hash runs at all."""
for t in [np.int, np.float, np.complex, np.int32, np.str, np.object,
np.unicode]:
... | <commit_before><commit_msg>Add some unit tests for the hashing protocol of dtype (fail currently).<commit_after>import numpy as np
from numpy.testing import *
class TestBuiltin(TestCase):
def test_run(self):
"""Only test hash runs at all."""
for t in [np.int, np.float, np.complex, np.int32, np.str,... | |
d8411d654e9ca1de67b44e5384eadc476c99e0b9 | tests/test_arrays.py | tests/test_arrays.py | from thinglang.thinglang import run
def test_simple_arrays():
assert run("""
thing Program
does start
array names = ["yotam", "andrew", "john"]
Output.write(names)
""").output == """['yotam', 'andrew', 'john']"""
| Add test for simple array initialziation | Add test for simple array initialziation
| Python | mit | ytanay/thinglang,ytanay/thinglang,ytanay/thinglang,ytanay/thinglang | Add test for simple array initialziation | from thinglang.thinglang import run
def test_simple_arrays():
assert run("""
thing Program
does start
array names = ["yotam", "andrew", "john"]
Output.write(names)
""").output == """['yotam', 'andrew', 'john']"""
| <commit_before><commit_msg>Add test for simple array initialziation<commit_after> | from thinglang.thinglang import run
def test_simple_arrays():
assert run("""
thing Program
does start
array names = ["yotam", "andrew", "john"]
Output.write(names)
""").output == """['yotam', 'andrew', 'john']"""
| Add test for simple array initialziationfrom thinglang.thinglang import run
def test_simple_arrays():
assert run("""
thing Program
does start
array names = ["yotam", "andrew", "john"]
Output.write(names)
""").output == """['yotam', 'andrew', 'john']"""
| <commit_before><commit_msg>Add test for simple array initialziation<commit_after>from thinglang.thinglang import run
def test_simple_arrays():
assert run("""
thing Program
does start
array names = ["yotam", "andrew", "john"]
Output.write(names)
""").output == """['yotam', 'andrew', 'john'... | |
85801ea57f2b8477ca1d73fa350b82e3def40303 | tests/test_rtnorm.py | tests/test_rtnorm.py |
# This should plot a histogram looking like a gaussian
# ... It does.
## CONFIGURATION (play with different values)
samples = int(1e6)
minimum = 0.
maximum = 15.
center = 7.
stddev = 5.
## VARIABLES FROM RANDOM TRUNCATED NORMAL DISTRIBUTION
from lib.rtnorm import rtnorm
variables = rtnorm(minimum, maximum, mu=c... | Add a little test for rtnorm, to make sure this is not the problem. It is not, apparently. | Add a little test for rtnorm, to make sure this is not the problem. It is not, apparently.
| Python | mit | irap-omp/deconv3d,irap-omp/deconv3d | Add a little test for rtnorm, to make sure this is not the problem. It is not, apparently. |
# This should plot a histogram looking like a gaussian
# ... It does.
## CONFIGURATION (play with different values)
samples = int(1e6)
minimum = 0.
maximum = 15.
center = 7.
stddev = 5.
## VARIABLES FROM RANDOM TRUNCATED NORMAL DISTRIBUTION
from lib.rtnorm import rtnorm
variables = rtnorm(minimum, maximum, mu=c... | <commit_before><commit_msg>Add a little test for rtnorm, to make sure this is not the problem. It is not, apparently.<commit_after> |
# This should plot a histogram looking like a gaussian
# ... It does.
## CONFIGURATION (play with different values)
samples = int(1e6)
minimum = 0.
maximum = 15.
center = 7.
stddev = 5.
## VARIABLES FROM RANDOM TRUNCATED NORMAL DISTRIBUTION
from lib.rtnorm import rtnorm
variables = rtnorm(minimum, maximum, mu=c... | Add a little test for rtnorm, to make sure this is not the problem. It is not, apparently.
# This should plot a histogram looking like a gaussian
# ... It does.
## CONFIGURATION (play with different values)
samples = int(1e6)
minimum = 0.
maximum = 15.
center = 7.
stddev = 5.
## VARIABLES FROM RANDOM TRUNCATED NOR... | <commit_before><commit_msg>Add a little test for rtnorm, to make sure this is not the problem. It is not, apparently.<commit_after>
# This should plot a histogram looking like a gaussian
# ... It does.
## CONFIGURATION (play with different values)
samples = int(1e6)
minimum = 0.
maximum = 15.
center = 7.
stddev = 5.... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.