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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
07f64b443ad10b0bbb3740c1eb3e7a0a7bcfd001 | skimage/viewer/tests/test_viewer.py | skimage/viewer/tests/test_viewer.py | import skimage.data as data
from skimage.viewer import ImageViewer
from numpy.testing import assert_equal, assert_allclose
def setup_line_profile(image):
from skimage.viewer.plugins.lineprofile import LineProfile
viewer = ImageViewer(image)
plugin = LineProfile()
viewer += plugin
return plugin
d... | Add test for LineProfiler tool | Add test for LineProfiler tool
| Python | bsd-3-clause | robintw/scikit-image,Britefury/scikit-image,SamHames/scikit-image,michaelpacer/scikit-image,GaZ3ll3/scikit-image,chintak/scikit-image,youprofit/scikit-image,oew1v07/scikit-image,newville/scikit-image,emon10005/scikit-image,bennlich/scikit-image,chriscrosscutler/scikit-image,pratapvardhan/scikit-image,juliusbierk/scikit... | Add test for LineProfiler tool | import skimage.data as data
from skimage.viewer import ImageViewer
from numpy.testing import assert_equal, assert_allclose
def setup_line_profile(image):
from skimage.viewer.plugins.lineprofile import LineProfile
viewer = ImageViewer(image)
plugin = LineProfile()
viewer += plugin
return plugin
d... | <commit_before><commit_msg>Add test for LineProfiler tool<commit_after> | import skimage.data as data
from skimage.viewer import ImageViewer
from numpy.testing import assert_equal, assert_allclose
def setup_line_profile(image):
from skimage.viewer.plugins.lineprofile import LineProfile
viewer = ImageViewer(image)
plugin = LineProfile()
viewer += plugin
return plugin
d... | Add test for LineProfiler toolimport skimage.data as data
from skimage.viewer import ImageViewer
from numpy.testing import assert_equal, assert_allclose
def setup_line_profile(image):
from skimage.viewer.plugins.lineprofile import LineProfile
viewer = ImageViewer(image)
plugin = LineProfile()
viewer +... | <commit_before><commit_msg>Add test for LineProfiler tool<commit_after>import skimage.data as data
from skimage.viewer import ImageViewer
from numpy.testing import assert_equal, assert_allclose
def setup_line_profile(image):
from skimage.viewer.plugins.lineprofile import LineProfile
viewer = ImageViewer(image... | |
27977e3facfef020d56192beb2cb1b4fc87a57fa | src/text-extract/test.py | src/text-extract/test.py | #!/usr/bin/env python
fh = open('/home/ben/dump.txt', 'w')
import sys
for ln in sys.stdin:
print >> fh, "here"
print >> fh, ln
print >> fh, "input closed"
fh.close()
| Test for lisp external-program functionality | Test for lisp external-program functionality
| Python | apache-2.0 | BnMcGn/warflagger,BnMcGn/warflagger,BnMcGn/warflagger,BnMcGn/warflagger | Test for lisp external-program functionality | #!/usr/bin/env python
fh = open('/home/ben/dump.txt', 'w')
import sys
for ln in sys.stdin:
print >> fh, "here"
print >> fh, ln
print >> fh, "input closed"
fh.close()
| <commit_before><commit_msg>Test for lisp external-program functionality<commit_after> | #!/usr/bin/env python
fh = open('/home/ben/dump.txt', 'w')
import sys
for ln in sys.stdin:
print >> fh, "here"
print >> fh, ln
print >> fh, "input closed"
fh.close()
| Test for lisp external-program functionality#!/usr/bin/env python
fh = open('/home/ben/dump.txt', 'w')
import sys
for ln in sys.stdin:
print >> fh, "here"
print >> fh, ln
print >> fh, "input closed"
fh.close()
| <commit_before><commit_msg>Test for lisp external-program functionality<commit_after>#!/usr/bin/env python
fh = open('/home/ben/dump.txt', 'w')
import sys
for ln in sys.stdin:
print >> fh, "here"
print >> fh, ln
print >> fh, "input closed"
fh.close()
| |
c1aecc68a1561506dff3295536425b92e549fc5a | appengine_django/db/creation.py | appengine_django/db/creation.py | #!/usr/bin/python2.4
#
# Copyright 2008 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... | #!/usr/bin/python2.4
#
# Copyright 2008 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... | Update SUPPORTS_TRANSACTIONS attribute to what is expected by Django 1.2. | Update SUPPORTS_TRANSACTIONS attribute to what is expected by Django 1.2.
Patch contributed by Felix Leong. Thanks.
Fixes Issue #162.
| Python | apache-2.0 | ekkleesia3/google-app-engine-django,hitrust/google-app-engine-django,jackxiang/google-app-engine-django,brian-zhao/google-app-engine-django | #!/usr/bin/python2.4
#
# Copyright 2008 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... | #!/usr/bin/python2.4
#
# Copyright 2008 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... | <commit_before>#!/usr/bin/python2.4
#
# Copyright 2008 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 ap... | #!/usr/bin/python2.4
#
# Copyright 2008 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... | #!/usr/bin/python2.4
#
# Copyright 2008 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... | <commit_before>#!/usr/bin/python2.4
#
# Copyright 2008 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 ap... |
452c208a9be68f2fbfe513a15bdc94ed8fbb863f | util/hgfilesize.py | util/hgfilesize.py | from mercurial import context
from mercurial.i18n import _
'''
[extensions]
hgfilesize=~/m5/incoming/util/hgfilesize.py
[hooks]
pretxncommit = python:hgfilesize.limit_file_size
pretxnchangegroup = python:hgfilesize.limit_file_size
[limit_file_size]
maximum_file_size = 200000
'''
def limit_file_size(ui, repo, node=N... | Add a hook to limit the size of any individual file | hooks: Add a hook to limit the size of any individual file
| Python | bsd-3-clause | LingxiaoJIA/gem5,LingxiaoJIA/gem5,haowu4682/gem5,haowu4682/gem5,haowu4682/gem5,LingxiaoJIA/gem5,haowu4682/gem5,haowu4682/gem5,haowu4682/gem5,haowu4682/gem5,LingxiaoJIA/gem5,LingxiaoJIA/gem5,LingxiaoJIA/gem5,haowu4682/gem5,LingxiaoJIA/gem5,haowu4682/gem5 | hooks: Add a hook to limit the size of any individual file | from mercurial import context
from mercurial.i18n import _
'''
[extensions]
hgfilesize=~/m5/incoming/util/hgfilesize.py
[hooks]
pretxncommit = python:hgfilesize.limit_file_size
pretxnchangegroup = python:hgfilesize.limit_file_size
[limit_file_size]
maximum_file_size = 200000
'''
def limit_file_size(ui, repo, node=N... | <commit_before><commit_msg>hooks: Add a hook to limit the size of any individual file<commit_after> | from mercurial import context
from mercurial.i18n import _
'''
[extensions]
hgfilesize=~/m5/incoming/util/hgfilesize.py
[hooks]
pretxncommit = python:hgfilesize.limit_file_size
pretxnchangegroup = python:hgfilesize.limit_file_size
[limit_file_size]
maximum_file_size = 200000
'''
def limit_file_size(ui, repo, node=N... | hooks: Add a hook to limit the size of any individual filefrom mercurial import context
from mercurial.i18n import _
'''
[extensions]
hgfilesize=~/m5/incoming/util/hgfilesize.py
[hooks]
pretxncommit = python:hgfilesize.limit_file_size
pretxnchangegroup = python:hgfilesize.limit_file_size
[limit_file_size]
maximum_fi... | <commit_before><commit_msg>hooks: Add a hook to limit the size of any individual file<commit_after>from mercurial import context
from mercurial.i18n import _
'''
[extensions]
hgfilesize=~/m5/incoming/util/hgfilesize.py
[hooks]
pretxncommit = python:hgfilesize.limit_file_size
pretxnchangegroup = python:hgfilesize.limi... | |
efabb671a359a98df2b739288be4fcd21f5d202c | package/migrations/0005_auto_20190927_1616.py | package/migrations/0005_auto_20190927_1616.py | # Generated by Django 2.2.5 on 2019-09-27 16:16
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('package', '0004_auto_20180214_0617'),
]
operations = [
migrations.AlterField(
model_name='packa... | Add migrations that protects packages on category deletion | Add migrations that protects packages on category deletion
| Python | mit | pydanny/djangopackages,pydanny/djangopackages,pydanny/djangopackages | Add migrations that protects packages on category deletion | # Generated by Django 2.2.5 on 2019-09-27 16:16
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('package', '0004_auto_20180214_0617'),
]
operations = [
migrations.AlterField(
model_name='packa... | <commit_before><commit_msg>Add migrations that protects packages on category deletion<commit_after> | # Generated by Django 2.2.5 on 2019-09-27 16:16
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('package', '0004_auto_20180214_0617'),
]
operations = [
migrations.AlterField(
model_name='packa... | Add migrations that protects packages on category deletion# Generated by Django 2.2.5 on 2019-09-27 16:16
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('package', '0004_auto_20180214_0617'),
]
operations = [
... | <commit_before><commit_msg>Add migrations that protects packages on category deletion<commit_after># Generated by Django 2.2.5 on 2019-09-27 16:16
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('package', '0004_auto_2018... | |
cbf1c788e2ff492c007e17be2b1efeaac42759f1 | gobble/validation.py | gobble/validation.py | """Validate data-packages"""
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from json import dumps
from datetime import datetime
from future import standard_library
from collections import OrderedDict
from datapackag... | Write the Validation class (wrapper around the DataPackage class). | Write the Validation class (wrapper around the DataPackage class).
| Python | mit | openspending/gobble | Write the Validation class (wrapper around the DataPackage class). | """Validate data-packages"""
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from json import dumps
from datetime import datetime
from future import standard_library
from collections import OrderedDict
from datapackag... | <commit_before><commit_msg>Write the Validation class (wrapper around the DataPackage class).<commit_after> | """Validate data-packages"""
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from json import dumps
from datetime import datetime
from future import standard_library
from collections import OrderedDict
from datapackag... | Write the Validation class (wrapper around the DataPackage class)."""Validate data-packages"""
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from json import dumps
from datetime import datetime
from future import st... | <commit_before><commit_msg>Write the Validation class (wrapper around the DataPackage class).<commit_after>"""Validate data-packages"""
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from json import dumps
from datet... | |
614cdfc97698204c07e172d09ad99ce45e8c3210 | genealogio/migrations/0004_auto_20150220_1242.py | genealogio/migrations/0004_auto_20150220_1242.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('genealogio', '0003_auto_20150220_0733'),
]
operations = [
migrations.AlterModelOptions(
name='family',
... | Add ordering by family name to Family model. | Add ordering by family name to Family model.
| Python | bsd-3-clause | ugoertz/django-familio,ugoertz/django-familio,ugoertz/django-familio,ugoertz/django-familio | Add ordering by family name to Family model. | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('genealogio', '0003_auto_20150220_0733'),
]
operations = [
migrations.AlterModelOptions(
name='family',
... | <commit_before><commit_msg>Add ordering by family name to Family model.<commit_after> | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('genealogio', '0003_auto_20150220_0733'),
]
operations = [
migrations.AlterModelOptions(
name='family',
... | Add ordering by family name to Family model.# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('genealogio', '0003_auto_20150220_0733'),
]
operations = [
migrations.AlterModelO... | <commit_before><commit_msg>Add ordering by family name to Family model.<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('genealogio', '0003_auto_20150220_0733'),
]
oper... | |
6a8bf7122f57fc80290acbd61d7e14d4c1742fe9 | tests/parser/test_shadow_stdout.py | tests/parser/test_shadow_stdout.py | import pytest
import parser.log_file.shadow_stdout
good_shadow_text = '''root:!:16179:0:99999:7:::
vagrant:$6$5M8f9rEy$nFWJvEnn2KFQwFsm6oRMyxva3mVixbyxZIE3cYTJ.ARFMt6Nq6gsnqScUkZ/slZ8tQzhZovx1M2CnmSsF71JA1:16179:0:99999:7:::
vboxadd:!:16179::::::
'''
@pytest.fixture(scope='function')
def good_shadow(tmpdir):
p =... | Add testing for shadow_stdout parser module | Add testing for shadow_stdout parser module
| Python | mit | Doveps/mono,Doveps/mono,Doveps/bassist,Doveps/mono,Doveps/mono | Add testing for shadow_stdout parser module | import pytest
import parser.log_file.shadow_stdout
good_shadow_text = '''root:!:16179:0:99999:7:::
vagrant:$6$5M8f9rEy$nFWJvEnn2KFQwFsm6oRMyxva3mVixbyxZIE3cYTJ.ARFMt6Nq6gsnqScUkZ/slZ8tQzhZovx1M2CnmSsF71JA1:16179:0:99999:7:::
vboxadd:!:16179::::::
'''
@pytest.fixture(scope='function')
def good_shadow(tmpdir):
p =... | <commit_before><commit_msg>Add testing for shadow_stdout parser module<commit_after> | import pytest
import parser.log_file.shadow_stdout
good_shadow_text = '''root:!:16179:0:99999:7:::
vagrant:$6$5M8f9rEy$nFWJvEnn2KFQwFsm6oRMyxva3mVixbyxZIE3cYTJ.ARFMt6Nq6gsnqScUkZ/slZ8tQzhZovx1M2CnmSsF71JA1:16179:0:99999:7:::
vboxadd:!:16179::::::
'''
@pytest.fixture(scope='function')
def good_shadow(tmpdir):
p =... | Add testing for shadow_stdout parser moduleimport pytest
import parser.log_file.shadow_stdout
good_shadow_text = '''root:!:16179:0:99999:7:::
vagrant:$6$5M8f9rEy$nFWJvEnn2KFQwFsm6oRMyxva3mVixbyxZIE3cYTJ.ARFMt6Nq6gsnqScUkZ/slZ8tQzhZovx1M2CnmSsF71JA1:16179:0:99999:7:::
vboxadd:!:16179::::::
'''
@pytest.fixture(scope='... | <commit_before><commit_msg>Add testing for shadow_stdout parser module<commit_after>import pytest
import parser.log_file.shadow_stdout
good_shadow_text = '''root:!:16179:0:99999:7:::
vagrant:$6$5M8f9rEy$nFWJvEnn2KFQwFsm6oRMyxva3mVixbyxZIE3cYTJ.ARFMt6Nq6gsnqScUkZ/slZ8tQzhZovx1M2CnmSsF71JA1:16179:0:99999:7:::
vboxadd:!... | |
0b76510e58c4eaa71fb37c563b00fa6cc67d49fc | tests/print_view_hierarchy_test.py | tests/print_view_hierarchy_test.py | """Tests for scripts/print_view_hierarchy.py."""
import re
import unittest
from test_utils import import_utils
import_utils.prepare_lldb_import_or_exit()
import lldb
import_utils.prepare_for_scripts_imports()
from scripts import print_view_hierarchy
class PrintViewHierarchyTest(unittest.TestCase):
def testPrintV... | Add a test for |pv| command. | Add a test for |pv| command.
| Python | mit | mrhappyasthma/HappyDebugging,mrhappyasthma/happydebugging | Add a test for |pv| command. | """Tests for scripts/print_view_hierarchy.py."""
import re
import unittest
from test_utils import import_utils
import_utils.prepare_lldb_import_or_exit()
import lldb
import_utils.prepare_for_scripts_imports()
from scripts import print_view_hierarchy
class PrintViewHierarchyTest(unittest.TestCase):
def testPrintV... | <commit_before><commit_msg>Add a test for |pv| command.<commit_after> | """Tests for scripts/print_view_hierarchy.py."""
import re
import unittest
from test_utils import import_utils
import_utils.prepare_lldb_import_or_exit()
import lldb
import_utils.prepare_for_scripts_imports()
from scripts import print_view_hierarchy
class PrintViewHierarchyTest(unittest.TestCase):
def testPrintV... | Add a test for |pv| command."""Tests for scripts/print_view_hierarchy.py."""
import re
import unittest
from test_utils import import_utils
import_utils.prepare_lldb_import_or_exit()
import lldb
import_utils.prepare_for_scripts_imports()
from scripts import print_view_hierarchy
class PrintViewHierarchyTest(unittest... | <commit_before><commit_msg>Add a test for |pv| command.<commit_after>"""Tests for scripts/print_view_hierarchy.py."""
import re
import unittest
from test_utils import import_utils
import_utils.prepare_lldb_import_or_exit()
import lldb
import_utils.prepare_for_scripts_imports()
from scripts import print_view_hierarc... | |
96b9c9f0a3bb3fd96ff7dd2c289dd0e4dee2bbb0 | 14B-088/HI/analysis/rotation_curves/cube_subtract_rotation.py | 14B-088/HI/analysis/rotation_curves/cube_subtract_rotation.py |
from astropy.io import fits
from spectral_cube import SpectralCube
import astropy.units as u
import numpy as np
import os
from astropy.utils.console import ProgressBar
'''
Subtract a rotation model from a cube.
'''
# Load in my huge FITS creator
execfile(os.path.expanduser("~/Dropbox/code_development/ewky_scripts/wr... | Subtract a rotation curve from a cube | Subtract a rotation curve from a cube
| Python | mit | e-koch/VLA_Lband,e-koch/VLA_Lband | Subtract a rotation curve from a cube |
from astropy.io import fits
from spectral_cube import SpectralCube
import astropy.units as u
import numpy as np
import os
from astropy.utils.console import ProgressBar
'''
Subtract a rotation model from a cube.
'''
# Load in my huge FITS creator
execfile(os.path.expanduser("~/Dropbox/code_development/ewky_scripts/wr... | <commit_before><commit_msg>Subtract a rotation curve from a cube<commit_after> |
from astropy.io import fits
from spectral_cube import SpectralCube
import astropy.units as u
import numpy as np
import os
from astropy.utils.console import ProgressBar
'''
Subtract a rotation model from a cube.
'''
# Load in my huge FITS creator
execfile(os.path.expanduser("~/Dropbox/code_development/ewky_scripts/wr... | Subtract a rotation curve from a cube
from astropy.io import fits
from spectral_cube import SpectralCube
import astropy.units as u
import numpy as np
import os
from astropy.utils.console import ProgressBar
'''
Subtract a rotation model from a cube.
'''
# Load in my huge FITS creator
execfile(os.path.expanduser("~/Dro... | <commit_before><commit_msg>Subtract a rotation curve from a cube<commit_after>
from astropy.io import fits
from spectral_cube import SpectralCube
import astropy.units as u
import numpy as np
import os
from astropy.utils.console import ProgressBar
'''
Subtract a rotation model from a cube.
'''
# Load in my huge FITS c... | |
8d1216cae58f179e903b1f4e7873ba8282ca77bd | qtpy/tests/test_qtwebenginewidgets.py | qtpy/tests/test_qtwebenginewidgets.py | from __future__ import absolute_import
import pytest
def test_qtwebenginewidgets():
"""Test the qtpy.QtWebSockets namespace"""
from qtpy import QtWebEngineWidgets
assert QtWebEngineWidgets.QWebEnginePage is not None
assert QtWebEngineWidgets.QWebEngineView is not None
assert QtWebEngineWidgets.Q... | Add a test for QtWebEngineWidgets | Testing: Add a test for QtWebEngineWidgets
| Python | mit | davvid/qtpy,spyder-ide/qtpy,davvid/qtpy,goanpeca/qtpy,goanpeca/qtpy | Testing: Add a test for QtWebEngineWidgets | from __future__ import absolute_import
import pytest
def test_qtwebenginewidgets():
"""Test the qtpy.QtWebSockets namespace"""
from qtpy import QtWebEngineWidgets
assert QtWebEngineWidgets.QWebEnginePage is not None
assert QtWebEngineWidgets.QWebEngineView is not None
assert QtWebEngineWidgets.Q... | <commit_before><commit_msg>Testing: Add a test for QtWebEngineWidgets<commit_after> | from __future__ import absolute_import
import pytest
def test_qtwebenginewidgets():
"""Test the qtpy.QtWebSockets namespace"""
from qtpy import QtWebEngineWidgets
assert QtWebEngineWidgets.QWebEnginePage is not None
assert QtWebEngineWidgets.QWebEngineView is not None
assert QtWebEngineWidgets.Q... | Testing: Add a test for QtWebEngineWidgetsfrom __future__ import absolute_import
import pytest
def test_qtwebenginewidgets():
"""Test the qtpy.QtWebSockets namespace"""
from qtpy import QtWebEngineWidgets
assert QtWebEngineWidgets.QWebEnginePage is not None
assert QtWebEngineWidgets.QWebEngineView i... | <commit_before><commit_msg>Testing: Add a test for QtWebEngineWidgets<commit_after>from __future__ import absolute_import
import pytest
def test_qtwebenginewidgets():
"""Test the qtpy.QtWebSockets namespace"""
from qtpy import QtWebEngineWidgets
assert QtWebEngineWidgets.QWebEnginePage is not None
a... | |
8c9fa6d2b31cc08212cb42ca4b429ae4a2793b70 | tools/shared-packs.py | tools/shared-packs.py | import os
import sys
import yaml
import paste.util.multidict
possible_topdir = os.path.normpath(os.path.join(os.path.abspath(sys.argv[0]),
os.pardir,
os.pardir))
if os.path.exists(os.path.join(possible_topdir,
'devsta... | Add tool that will show the shared packages | Add tool that will show the shared packages
| Python | apache-2.0 | stackforge/anvil,mc2014/anvil,stackforge/anvil,mc2014/anvil | Add tool that will show the shared packages | import os
import sys
import yaml
import paste.util.multidict
possible_topdir = os.path.normpath(os.path.join(os.path.abspath(sys.argv[0]),
os.pardir,
os.pardir))
if os.path.exists(os.path.join(possible_topdir,
'devsta... | <commit_before><commit_msg>Add tool that will show the shared packages<commit_after> | import os
import sys
import yaml
import paste.util.multidict
possible_topdir = os.path.normpath(os.path.join(os.path.abspath(sys.argv[0]),
os.pardir,
os.pardir))
if os.path.exists(os.path.join(possible_topdir,
'devsta... | Add tool that will show the shared packagesimport os
import sys
import yaml
import paste.util.multidict
possible_topdir = os.path.normpath(os.path.join(os.path.abspath(sys.argv[0]),
os.pardir,
os.pardir))
if os.path.exists(os.path.join(possible_top... | <commit_before><commit_msg>Add tool that will show the shared packages<commit_after>import os
import sys
import yaml
import paste.util.multidict
possible_topdir = os.path.normpath(os.path.join(os.path.abspath(sys.argv[0]),
os.pardir,
os.pardir))
if... | |
ed9a152caf57db35c5bf7f86dd5148b0e8f582b4 | examples/widgets/generic_code_edit.py | examples/widgets/generic_code_edit.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
A simple example that shows how to setup CodeEdit.
In this example, we install a syntax highlighter mode (based on pygments), a
mode that highlights the current line and a _search and replace_ panel.
There are many other modes and panels, feel free to use this example... | Add a generic code edit example | Add a generic code edit example
| Python | mit | pyQode/pyqode.core,pyQode/pyqode.core,zwadar/pyqode.core | Add a generic code edit example | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
A simple example that shows how to setup CodeEdit.
In this example, we install a syntax highlighter mode (based on pygments), a
mode that highlights the current line and a _search and replace_ panel.
There are many other modes and panels, feel free to use this example... | <commit_before><commit_msg>Add a generic code edit example<commit_after> | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
A simple example that shows how to setup CodeEdit.
In this example, we install a syntax highlighter mode (based on pygments), a
mode that highlights the current line and a _search and replace_ panel.
There are many other modes and panels, feel free to use this example... | Add a generic code edit example#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
A simple example that shows how to setup CodeEdit.
In this example, we install a syntax highlighter mode (based on pygments), a
mode that highlights the current line and a _search and replace_ panel.
There are many other modes and panels... | <commit_before><commit_msg>Add a generic code edit example<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
A simple example that shows how to setup CodeEdit.
In this example, we install a syntax highlighter mode (based on pygments), a
mode that highlights the current line and a _search and replace_ pane... | |
101f26d8c21bed496aa3d465ccad690b711af612 | pyface/tests/test_split_application_window.py | pyface/tests/test_split_application_window.py | from __future__ import absolute_import
from traits.testing.unittest_tools import unittest, UnittestTools
from ..gui import GUI
from ..split_application_window import SplitApplicationWindow
class TestSplitApplicationWindow(unittest.TestCase, UnittestTools):
def setUp(self):
self.gui = GUI()
self... | Add test for split application window. | Add test for split application window.
| Python | bsd-3-clause | brett-patterson/pyface,geggo/pyface,geggo/pyface | Add test for split application window. | from __future__ import absolute_import
from traits.testing.unittest_tools import unittest, UnittestTools
from ..gui import GUI
from ..split_application_window import SplitApplicationWindow
class TestSplitApplicationWindow(unittest.TestCase, UnittestTools):
def setUp(self):
self.gui = GUI()
self... | <commit_before><commit_msg>Add test for split application window.<commit_after> | from __future__ import absolute_import
from traits.testing.unittest_tools import unittest, UnittestTools
from ..gui import GUI
from ..split_application_window import SplitApplicationWindow
class TestSplitApplicationWindow(unittest.TestCase, UnittestTools):
def setUp(self):
self.gui = GUI()
self... | Add test for split application window.from __future__ import absolute_import
from traits.testing.unittest_tools import unittest, UnittestTools
from ..gui import GUI
from ..split_application_window import SplitApplicationWindow
class TestSplitApplicationWindow(unittest.TestCase, UnittestTools):
def setUp(self):... | <commit_before><commit_msg>Add test for split application window.<commit_after>from __future__ import absolute_import
from traits.testing.unittest_tools import unittest, UnittestTools
from ..gui import GUI
from ..split_application_window import SplitApplicationWindow
class TestSplitApplicationWindow(unittest.TestCa... | |
2f8da2ff28fa9cc87c8ad810b67caf994a584100 | examples/lvm_cache.py | examples/lvm_cache.py | import os
from examples.common import print_devices
import blivet
from blivet.size import Size
from blivet.util import set_up_logging, create_sparse_tempfile
from blivet.devices.lvm import LVMCacheRequest
set_up_logging()
b = blivet.Blivet() # create an instance of Blivet (don't add system devices)
# create a dis... | Add example of LVM cache creation | Add example of LVM cache creation
Useful for testing as well as for users wondering how to do something like this.
| Python | lgpl-2.1 | jkonecny12/blivet,jkonecny12/blivet,rvykydal/blivet,rvykydal/blivet,vpodzime/blivet,rhinstaller/blivet,vojtechtrefny/blivet,vojtechtrefny/blivet,rhinstaller/blivet,vpodzime/blivet,AdamWill/blivet,AdamWill/blivet | Add example of LVM cache creation
Useful for testing as well as for users wondering how to do something like this. | import os
from examples.common import print_devices
import blivet
from blivet.size import Size
from blivet.util import set_up_logging, create_sparse_tempfile
from blivet.devices.lvm import LVMCacheRequest
set_up_logging()
b = blivet.Blivet() # create an instance of Blivet (don't add system devices)
# create a dis... | <commit_before><commit_msg>Add example of LVM cache creation
Useful for testing as well as for users wondering how to do something like this.<commit_after> | import os
from examples.common import print_devices
import blivet
from blivet.size import Size
from blivet.util import set_up_logging, create_sparse_tempfile
from blivet.devices.lvm import LVMCacheRequest
set_up_logging()
b = blivet.Blivet() # create an instance of Blivet (don't add system devices)
# create a dis... | Add example of LVM cache creation
Useful for testing as well as for users wondering how to do something like this.import os
from examples.common import print_devices
import blivet
from blivet.size import Size
from blivet.util import set_up_logging, create_sparse_tempfile
from blivet.devices.lvm import LVMCacheReques... | <commit_before><commit_msg>Add example of LVM cache creation
Useful for testing as well as for users wondering how to do something like this.<commit_after>import os
from examples.common import print_devices
import blivet
from blivet.size import Size
from blivet.util import set_up_logging, create_sparse_tempfile
from... | |
94f59e405a63ae6f08ec66a55cd40f6817b72ab6 | dimagi/utils/excel_importer.py | dimagi/utils/excel_importer.py | from dimagi.utils.excel import WorkbookJSONReader
from soil import DownloadBase
class ExcelImporter(object):
# TODO make sure people can't instantiate ExcelImporter directly
def __init__(self, task, file_ref_id):
self.task = task
self.progress = 0
if self.task:
DownloadBas... | Add helper class for excel importing | Add helper class for excel importing
| Python | bsd-3-clause | dimagi/commcare-hq,qedsoftware/commcare-hq,puttarajubr/commcare-hq,qedsoftware/commcare-hq,puttarajubr/commcare-hq,qedsoftware/commcare-hq,puttarajubr/commcare-hq,qedsoftware/commcare-hq,puttarajubr/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | Add helper class for excel importing | from dimagi.utils.excel import WorkbookJSONReader
from soil import DownloadBase
class ExcelImporter(object):
# TODO make sure people can't instantiate ExcelImporter directly
def __init__(self, task, file_ref_id):
self.task = task
self.progress = 0
if self.task:
DownloadBas... | <commit_before><commit_msg>Add helper class for excel importing<commit_after> | from dimagi.utils.excel import WorkbookJSONReader
from soil import DownloadBase
class ExcelImporter(object):
# TODO make sure people can't instantiate ExcelImporter directly
def __init__(self, task, file_ref_id):
self.task = task
self.progress = 0
if self.task:
DownloadBas... | Add helper class for excel importingfrom dimagi.utils.excel import WorkbookJSONReader
from soil import DownloadBase
class ExcelImporter(object):
# TODO make sure people can't instantiate ExcelImporter directly
def __init__(self, task, file_ref_id):
self.task = task
self.progress = 0
i... | <commit_before><commit_msg>Add helper class for excel importing<commit_after>from dimagi.utils.excel import WorkbookJSONReader
from soil import DownloadBase
class ExcelImporter(object):
# TODO make sure people can't instantiate ExcelImporter directly
def __init__(self, task, file_ref_id):
self.task = ... | |
c620ff34384cf15e6a236db6c306bcff6c53649f | Lib/test/crashers/modify_dict_attr.py | Lib/test/crashers/modify_dict_attr.py |
# http://python.org/sf/1303614
class Y(object):
pass
class type_with_modifiable_dict(type, Y):
pass
class MyClass(object):
"""This class has its __dict__ attribute indirectly
exposed via the __dict__ getter/setter of Y.
"""
__metaclass__ = type_with_modifiable_dict
if __name__ == '__main__... | Modify the segfaulting example to show why r53997 is not a solution to it. | Modify the segfaulting example to show why r53997 is not a solution to
it.
| Python | mit | sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator | Modify the segfaulting example to show why r53997 is not a solution to
it. |
# http://python.org/sf/1303614
class Y(object):
pass
class type_with_modifiable_dict(type, Y):
pass
class MyClass(object):
"""This class has its __dict__ attribute indirectly
exposed via the __dict__ getter/setter of Y.
"""
__metaclass__ = type_with_modifiable_dict
if __name__ == '__main__... | <commit_before><commit_msg>Modify the segfaulting example to show why r53997 is not a solution to
it.<commit_after> |
# http://python.org/sf/1303614
class Y(object):
pass
class type_with_modifiable_dict(type, Y):
pass
class MyClass(object):
"""This class has its __dict__ attribute indirectly
exposed via the __dict__ getter/setter of Y.
"""
__metaclass__ = type_with_modifiable_dict
if __name__ == '__main__... | Modify the segfaulting example to show why r53997 is not a solution to
it.
# http://python.org/sf/1303614
class Y(object):
pass
class type_with_modifiable_dict(type, Y):
pass
class MyClass(object):
"""This class has its __dict__ attribute indirectly
exposed via the __dict__ getter/setter of Y.
""... | <commit_before><commit_msg>Modify the segfaulting example to show why r53997 is not a solution to
it.<commit_after>
# http://python.org/sf/1303614
class Y(object):
pass
class type_with_modifiable_dict(type, Y):
pass
class MyClass(object):
"""This class has its __dict__ attribute indirectly
exposed vi... | |
9921774bf7b81bc21ae31b179c9a4af72f1410b9 | oneflow/settings/obi_1flow_io.py | oneflow/settings/obi_1flow_io.py | # -*- coding: utf-8 -*-
# Settings for obi.1flow.net (test)
import os
from sparks.django.settings import include_snippets
include_snippets(
os.path.dirname(__file__), (
# no debug on OBI, we need to be in "real-life-mode".
# Sentry will help us catch errors, anyway.
'00_production',
... | # -*- coding: utf-8 -*-
# Settings for obi.1flow.net (test)
import os
from sparks.django.settings import include_snippets
include_snippets(
os.path.dirname(__file__), (
# no debug on OBI, we need to be in "real-life-mode".
# Sentry will help us catch errors, anyway.
'00_production',
... | Use *_preview settings for OBI. | Use *_preview settings for OBI. | Python | agpl-3.0 | WillianPaiva/1flow,WillianPaiva/1flow,1flow/1flow,1flow/1flow,WillianPaiva/1flow,1flow/1flow,WillianPaiva/1flow,WillianPaiva/1flow,1flow/1flow,1flow/1flow | # -*- coding: utf-8 -*-
# Settings for obi.1flow.net (test)
import os
from sparks.django.settings import include_snippets
include_snippets(
os.path.dirname(__file__), (
# no debug on OBI, we need to be in "real-life-mode".
# Sentry will help us catch errors, anyway.
'00_production',
... | # -*- coding: utf-8 -*-
# Settings for obi.1flow.net (test)
import os
from sparks.django.settings import include_snippets
include_snippets(
os.path.dirname(__file__), (
# no debug on OBI, we need to be in "real-life-mode".
# Sentry will help us catch errors, anyway.
'00_production',
... | <commit_before># -*- coding: utf-8 -*-
# Settings for obi.1flow.net (test)
import os
from sparks.django.settings import include_snippets
include_snippets(
os.path.dirname(__file__), (
# no debug on OBI, we need to be in "real-life-mode".
# Sentry will help us catch errors, anyway.
'00_prod... | # -*- coding: utf-8 -*-
# Settings for obi.1flow.net (test)
import os
from sparks.django.settings import include_snippets
include_snippets(
os.path.dirname(__file__), (
# no debug on OBI, we need to be in "real-life-mode".
# Sentry will help us catch errors, anyway.
'00_production',
... | # -*- coding: utf-8 -*-
# Settings for obi.1flow.net (test)
import os
from sparks.django.settings import include_snippets
include_snippets(
os.path.dirname(__file__), (
# no debug on OBI, we need to be in "real-life-mode".
# Sentry will help us catch errors, anyway.
'00_production',
... | <commit_before># -*- coding: utf-8 -*-
# Settings for obi.1flow.net (test)
import os
from sparks.django.settings import include_snippets
include_snippets(
os.path.dirname(__file__), (
# no debug on OBI, we need to be in "real-life-mode".
# Sentry will help us catch errors, anyway.
'00_prod... |
edb66fa3323279bb005bf7201549fd3b6278da3c | src/icp/pollinator/src/pollinator/reclass/write_crop_type_json.py | src/icp/pollinator/src/pollinator/reclass/write_crop_type_json.py | from __future__ import print_function
import csv
import json
import sys
def init():
with open('../data/cdl_data_grouped.csv', mode='r') as cdl_data_grouped:
reader = csv.DictReader(cdl_data_grouped)
crop_types = {}
for row in reader:
crop_group = row['Attributes']
... | Add script to make json crop types look up | Add script to make json crop types look up
- Without script if there's an update to the group_ids and crop type mapping
you have to column copy paste the csv into `cropTypes.json`
| Python | apache-2.0 | project-icp/bee-pollinator-app,project-icp/bee-pollinator-app,project-icp/bee-pollinator-app,project-icp/bee-pollinator-app | Add script to make json crop types look up
- Without script if there's an update to the group_ids and crop type mapping
you have to column copy paste the csv into `cropTypes.json` | from __future__ import print_function
import csv
import json
import sys
def init():
with open('../data/cdl_data_grouped.csv', mode='r') as cdl_data_grouped:
reader = csv.DictReader(cdl_data_grouped)
crop_types = {}
for row in reader:
crop_group = row['Attributes']
... | <commit_before><commit_msg>Add script to make json crop types look up
- Without script if there's an update to the group_ids and crop type mapping
you have to column copy paste the csv into `cropTypes.json`<commit_after> | from __future__ import print_function
import csv
import json
import sys
def init():
with open('../data/cdl_data_grouped.csv', mode='r') as cdl_data_grouped:
reader = csv.DictReader(cdl_data_grouped)
crop_types = {}
for row in reader:
crop_group = row['Attributes']
... | Add script to make json crop types look up
- Without script if there's an update to the group_ids and crop type mapping
you have to column copy paste the csv into `cropTypes.json`from __future__ import print_function
import csv
import json
import sys
def init():
with open('../data/cdl_data_grouped.csv', mode='... | <commit_before><commit_msg>Add script to make json crop types look up
- Without script if there's an update to the group_ids and crop type mapping
you have to column copy paste the csv into `cropTypes.json`<commit_after>from __future__ import print_function
import csv
import json
import sys
def init():
with op... | |
99febc5ce4131d434ad861e2ecb4596b66a1be47 | src/nodeconductor_paas_oracle/migrations/0002_ovm_iaas_support.py | src/nodeconductor_paas_oracle/migrations/0002_ovm_iaas_support.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.core.validators
class Migration(migrations.Migration):
dependencies = [
('nodeconductor_paas_oracle', '0001_squashed_0007_change_support_requests'),
]
operations = [
mi... | Support simplified requests for non-DB deployments | Support simplified requests for non-DB deployments
| Python | mit | opennode/nodeconductor-paas-oracle | Support simplified requests for non-DB deployments | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.core.validators
class Migration(migrations.Migration):
dependencies = [
('nodeconductor_paas_oracle', '0001_squashed_0007_change_support_requests'),
]
operations = [
mi... | <commit_before><commit_msg>Support simplified requests for non-DB deployments<commit_after> | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.core.validators
class Migration(migrations.Migration):
dependencies = [
('nodeconductor_paas_oracle', '0001_squashed_0007_change_support_requests'),
]
operations = [
mi... | Support simplified requests for non-DB deployments# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.core.validators
class Migration(migrations.Migration):
dependencies = [
('nodeconductor_paas_oracle', '0001_squashed_0007_change_suppor... | <commit_before><commit_msg>Support simplified requests for non-DB deployments<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.core.validators
class Migration(migrations.Migration):
dependencies = [
('nodeconductor_paas_o... | |
8773a5072cf968999ed3b7f3a826c513513aefbf | taiga/users/migrations/0018_remove_vote_issues_in_roles_permissions_field.py | taiga/users/migrations/0018_remove_vote_issues_in_roles_permissions_field.py | # -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2016-04-04 09:32
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('users', '0017_auto_20160208_1751'),
]
operations = [
migrations.RunSQL(
... | Clean user role permissions: remove vote_issues in Role.permissions | [Backport] Clean user role permissions: remove vote_issues in Role.permissions
| Python | agpl-3.0 | xdevelsistemas/taiga-back-community,taigaio/taiga-back,dayatz/taiga-back,taigaio/taiga-back,dayatz/taiga-back,taigaio/taiga-back,Rademade/taiga-back,Rademade/taiga-back,Rademade/taiga-back,dayatz/taiga-back,xdevelsistemas/taiga-back-community,Rademade/taiga-back,xdevelsistemas/taiga-back-community,Rademade/taiga-back | [Backport] Clean user role permissions: remove vote_issues in Role.permissions | # -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2016-04-04 09:32
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('users', '0017_auto_20160208_1751'),
]
operations = [
migrations.RunSQL(
... | <commit_before><commit_msg>[Backport] Clean user role permissions: remove vote_issues in Role.permissions<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2016-04-04 09:32
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('users', '0017_auto_20160208_1751'),
]
operations = [
migrations.RunSQL(
... | [Backport] Clean user role permissions: remove vote_issues in Role.permissions# -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2016-04-04 09:32
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('users', '0017_auto_2016... | <commit_before><commit_msg>[Backport] Clean user role permissions: remove vote_issues in Role.permissions<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2016-04-04 09:32
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependenc... | |
e15869a34daf577c409a773358c82a7448d03033 | src/examples/tutorial/example_noveltycurve.py | src/examples/tutorial/example_noveltycurve.py | import sys
import essentia.standard as es
from essentia import *
import numpy
import pylab
try:
input_file = sys.argv[1]
except:
print "usage:", sys.argv[0], "<input_file>"
sys.exit()
frameSize = 2048
hopSize = 128
weight = 'hybrid'
print "Frame size:", frameSize
print "Hop size:", hopSize
print "weigh... | Add python example for NoveltyCurve use | Add python example for NoveltyCurve use
| Python | agpl-3.0 | MTG/essentia,carthach/essentia,MTG/essentia,MTG/essentia,MTG/essentia,carthach/essentia,MTG/essentia,carthach/essentia,carthach/essentia,carthach/essentia | Add python example for NoveltyCurve use | import sys
import essentia.standard as es
from essentia import *
import numpy
import pylab
try:
input_file = sys.argv[1]
except:
print "usage:", sys.argv[0], "<input_file>"
sys.exit()
frameSize = 2048
hopSize = 128
weight = 'hybrid'
print "Frame size:", frameSize
print "Hop size:", hopSize
print "weigh... | <commit_before><commit_msg>Add python example for NoveltyCurve use<commit_after> | import sys
import essentia.standard as es
from essentia import *
import numpy
import pylab
try:
input_file = sys.argv[1]
except:
print "usage:", sys.argv[0], "<input_file>"
sys.exit()
frameSize = 2048
hopSize = 128
weight = 'hybrid'
print "Frame size:", frameSize
print "Hop size:", hopSize
print "weigh... | Add python example for NoveltyCurve useimport sys
import essentia.standard as es
from essentia import *
import numpy
import pylab
try:
input_file = sys.argv[1]
except:
print "usage:", sys.argv[0], "<input_file>"
sys.exit()
frameSize = 2048
hopSize = 128
weight = 'hybrid'
print "Frame size:", frameSize
... | <commit_before><commit_msg>Add python example for NoveltyCurve use<commit_after>import sys
import essentia.standard as es
from essentia import *
import numpy
import pylab
try:
input_file = sys.argv[1]
except:
print "usage:", sys.argv[0], "<input_file>"
sys.exit()
frameSize = 2048
hopSize = 128
weight = ... | |
dfe116ebf8520cdb8d575b9c9bda9c93cdc3a54c | scripts/migration/migrate_date_modified_for_existing_nodes.py | scripts/migration/migrate_date_modified_for_existing_nodes.py | """
This will add a date_modified field to all nodes. Date_modified will be set equal to the date of the last log.
"""
import sys
import logging
from website import models
from website.app import init_app
logger = logging.getLogger(__name__)
def main():
init_app(routes=False)
dry_run = 'dry' in sys.argv
... | Add migration for date_modified field. | Add migration for date_modified field.
| Python | apache-2.0 | jnayak1/osf.io,rdhyee/osf.io,Johnetordoff/osf.io,doublebits/osf.io,Ghalko/osf.io,alexschiller/osf.io,pattisdr/osf.io,saradbowman/osf.io,caseyrollins/osf.io,RomanZWang/osf.io,KAsante95/osf.io,amyshi188/osf.io,RomanZWang/osf.io,aaxelb/osf.io,kwierman/osf.io,sloria/osf.io,asanfilippo7/osf.io,icereval/osf.io,aaxelb/osf.io,... | Add migration for date_modified field. | """
This will add a date_modified field to all nodes. Date_modified will be set equal to the date of the last log.
"""
import sys
import logging
from website import models
from website.app import init_app
logger = logging.getLogger(__name__)
def main():
init_app(routes=False)
dry_run = 'dry' in sys.argv
... | <commit_before><commit_msg>Add migration for date_modified field.<commit_after> | """
This will add a date_modified field to all nodes. Date_modified will be set equal to the date of the last log.
"""
import sys
import logging
from website import models
from website.app import init_app
logger = logging.getLogger(__name__)
def main():
init_app(routes=False)
dry_run = 'dry' in sys.argv
... | Add migration for date_modified field."""
This will add a date_modified field to all nodes. Date_modified will be set equal to the date of the last log.
"""
import sys
import logging
from website import models
from website.app import init_app
logger = logging.getLogger(__name__)
def main():
init_app(routes=Fal... | <commit_before><commit_msg>Add migration for date_modified field.<commit_after>"""
This will add a date_modified field to all nodes. Date_modified will be set equal to the date of the last log.
"""
import sys
import logging
from website import models
from website.app import init_app
logger = logging.getLogger(__name... | |
8d0fc0e317f6176764051eddd3d16237b65789cc | tests/api/test_roles.py | tests/api/test_roles.py | # -*- coding: utf-8 -*-
"""pytest Roles API wrapper tests and fixtures."""
import pytest
import ciscosparkapi
# Helper Functions
def get_list_of_roles(api, max=None):
return api.roles.list(max=max)
def get_role_by_id(api, roleId):
return api.roles.get(roleId)
def is_valid_role(obj):
return isinst... | Add tests and fixtures for the Roles API wrapper | Add tests and fixtures for the Roles API wrapper
| Python | mit | jbogarin/ciscosparkapi | Add tests and fixtures for the Roles API wrapper | # -*- coding: utf-8 -*-
"""pytest Roles API wrapper tests and fixtures."""
import pytest
import ciscosparkapi
# Helper Functions
def get_list_of_roles(api, max=None):
return api.roles.list(max=max)
def get_role_by_id(api, roleId):
return api.roles.get(roleId)
def is_valid_role(obj):
return isinst... | <commit_before><commit_msg>Add tests and fixtures for the Roles API wrapper<commit_after> | # -*- coding: utf-8 -*-
"""pytest Roles API wrapper tests and fixtures."""
import pytest
import ciscosparkapi
# Helper Functions
def get_list_of_roles(api, max=None):
return api.roles.list(max=max)
def get_role_by_id(api, roleId):
return api.roles.get(roleId)
def is_valid_role(obj):
return isinst... | Add tests and fixtures for the Roles API wrapper# -*- coding: utf-8 -*-
"""pytest Roles API wrapper tests and fixtures."""
import pytest
import ciscosparkapi
# Helper Functions
def get_list_of_roles(api, max=None):
return api.roles.list(max=max)
def get_role_by_id(api, roleId):
return api.roles.get(rol... | <commit_before><commit_msg>Add tests and fixtures for the Roles API wrapper<commit_after># -*- coding: utf-8 -*-
"""pytest Roles API wrapper tests and fixtures."""
import pytest
import ciscosparkapi
# Helper Functions
def get_list_of_roles(api, max=None):
return api.roles.list(max=max)
def get_role_by_id(a... | |
8fcc475f1891cf760ae3535cfbe0eb49bf367497 | whimbrel-client-core/python2_3/test/port_forward.py | whimbrel-client-core/python2_3/test/port_forward.py | import socket
import sys
import threading
import time
SERVER_THREADS = []
def start_server(local_port, remote_host, remote_port, out_file=None):
t = threading.Thread(target=server, kwargs={
"local_port": local_port,
"remote_host": remote_host,
"remote_port": remote_port,
... | Test for Amazon requests via a port forwarder. | Test for Amazon requests via a port forwarder.
| Python | apache-2.0 | groboclown/whimbrel,groboclown/whimbrel,groboclown/whimbrel,groboclown/whimbrel | Test for Amazon requests via a port forwarder. | import socket
import sys
import threading
import time
SERVER_THREADS = []
def start_server(local_port, remote_host, remote_port, out_file=None):
t = threading.Thread(target=server, kwargs={
"local_port": local_port,
"remote_host": remote_host,
"remote_port": remote_port,
... | <commit_before><commit_msg>Test for Amazon requests via a port forwarder.<commit_after> | import socket
import sys
import threading
import time
SERVER_THREADS = []
def start_server(local_port, remote_host, remote_port, out_file=None):
t = threading.Thread(target=server, kwargs={
"local_port": local_port,
"remote_host": remote_host,
"remote_port": remote_port,
... | Test for Amazon requests via a port forwarder.import socket
import sys
import threading
import time
SERVER_THREADS = []
def start_server(local_port, remote_host, remote_port, out_file=None):
t = threading.Thread(target=server, kwargs={
"local_port": local_port,
"remote_host": remote_ho... | <commit_before><commit_msg>Test for Amazon requests via a port forwarder.<commit_after>import socket
import sys
import threading
import time
SERVER_THREADS = []
def start_server(local_port, remote_host, remote_port, out_file=None):
t = threading.Thread(target=server, kwargs={
"local_port": loca... | |
a64f9c780000785f4dc9a08109b91ec9b2dfefc4 | tests/projects/test_models.py | tests/projects/test_models.py | import pytest
from frigg.projects.models import EnvironmentVariable, Project
@pytest.fixture
def project():
return Project(owner='frigg', name='frigg-hq')
def test_environment_variable__str__(project):
variable = EnvironmentVariable(project=project, key='PYPI_PASSWORD')
assert str(variable) == 'frigg /... | Add test for str in EnvironmentVariable | test: Add test for str in EnvironmentVariable
| Python | mit | frigg/frigg-hq,frigg/frigg-hq,frigg/frigg-hq | test: Add test for str in EnvironmentVariable | import pytest
from frigg.projects.models import EnvironmentVariable, Project
@pytest.fixture
def project():
return Project(owner='frigg', name='frigg-hq')
def test_environment_variable__str__(project):
variable = EnvironmentVariable(project=project, key='PYPI_PASSWORD')
assert str(variable) == 'frigg /... | <commit_before><commit_msg>test: Add test for str in EnvironmentVariable<commit_after> | import pytest
from frigg.projects.models import EnvironmentVariable, Project
@pytest.fixture
def project():
return Project(owner='frigg', name='frigg-hq')
def test_environment_variable__str__(project):
variable = EnvironmentVariable(project=project, key='PYPI_PASSWORD')
assert str(variable) == 'frigg /... | test: Add test for str in EnvironmentVariableimport pytest
from frigg.projects.models import EnvironmentVariable, Project
@pytest.fixture
def project():
return Project(owner='frigg', name='frigg-hq')
def test_environment_variable__str__(project):
variable = EnvironmentVariable(project=project, key='PYPI_PA... | <commit_before><commit_msg>test: Add test for str in EnvironmentVariable<commit_after>import pytest
from frigg.projects.models import EnvironmentVariable, Project
@pytest.fixture
def project():
return Project(owner='frigg', name='frigg-hq')
def test_environment_variable__str__(project):
variable = Environm... | |
90ae4c1bf85128df46cc13fa30f9b2198006282d | utilities/unicode_to_ascii.py | utilities/unicode_to_ascii.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Unicode to ASCII Utility
========================
"""
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
import codecs
import os
import unicodedata
__copyright__ = 'Copyright (C) 2013-2018 - Colour Developers'
__license__ = 'New BSD License - http://opensource.or... | Convert unicode characters to ASCII using Canonical Decomposition (NFD). | Convert unicode characters to ASCII using Canonical Decomposition (NFD).
| Python | bsd-3-clause | colour-science/colour-demosaicing | Convert unicode characters to ASCII using Canonical Decomposition (NFD). | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Unicode to ASCII Utility
========================
"""
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
import codecs
import os
import unicodedata
__copyright__ = 'Copyright (C) 2013-2018 - Colour Developers'
__license__ = 'New BSD License - http://opensource.or... | <commit_before><commit_msg>Convert unicode characters to ASCII using Canonical Decomposition (NFD).<commit_after> | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Unicode to ASCII Utility
========================
"""
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
import codecs
import os
import unicodedata
__copyright__ = 'Copyright (C) 2013-2018 - Colour Developers'
__license__ = 'New BSD License - http://opensource.or... | Convert unicode characters to ASCII using Canonical Decomposition (NFD).#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Unicode to ASCII Utility
========================
"""
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
import codecs
import os
import unicodedata
__copyright__ = 'Copyright (C) 2013-2018 - ... | <commit_before><commit_msg>Convert unicode characters to ASCII using Canonical Decomposition (NFD).<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Unicode to ASCII Utility
========================
"""
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
import codecs
import os
import unicodedata
__... | |
5700368356c0d3209cd7a60a67c471a936d645f9 | gitignore-update.py | gitignore-update.py | # encoding: utf-8
import os
import sys
from sh import git, pwd, sh
from workflow import Workflow, ICON_SYNC, web
def main(wf):
return_value = 0
if not repo_exists():
return_value = clone_repo()
else:
return_value = pull_repo()
if return_value:
print "ERROR. Templates could n... | Add script that downloads templates | Add script that downloads templates
A script has been added to download the templates from GitHub. The
templates are checked out as a Git repository, making it really easy to
download changes later on.
If the repository does not exist yet, "git clone" is executed to create
a local copy of the it. If it exists, "git p... | Python | mit | jdno/alfred2-gitignore | Add script that downloads templates
A script has been added to download the templates from GitHub. The
templates are checked out as a Git repository, making it really easy to
download changes later on.
If the repository does not exist yet, "git clone" is executed to create
a local copy of the it. If it exists, "git p... | # encoding: utf-8
import os
import sys
from sh import git, pwd, sh
from workflow import Workflow, ICON_SYNC, web
def main(wf):
return_value = 0
if not repo_exists():
return_value = clone_repo()
else:
return_value = pull_repo()
if return_value:
print "ERROR. Templates could n... | <commit_before><commit_msg>Add script that downloads templates
A script has been added to download the templates from GitHub. The
templates are checked out as a Git repository, making it really easy to
download changes later on.
If the repository does not exist yet, "git clone" is executed to create
a local copy of t... | # encoding: utf-8
import os
import sys
from sh import git, pwd, sh
from workflow import Workflow, ICON_SYNC, web
def main(wf):
return_value = 0
if not repo_exists():
return_value = clone_repo()
else:
return_value = pull_repo()
if return_value:
print "ERROR. Templates could n... | Add script that downloads templates
A script has been added to download the templates from GitHub. The
templates are checked out as a Git repository, making it really easy to
download changes later on.
If the repository does not exist yet, "git clone" is executed to create
a local copy of the it. If it exists, "git p... | <commit_before><commit_msg>Add script that downloads templates
A script has been added to download the templates from GitHub. The
templates are checked out as a Git repository, making it really easy to
download changes later on.
If the repository does not exist yet, "git clone" is executed to create
a local copy of t... | |
a554be928f6123ad78d97c0e988bf78c2978e877 | geotrek/infrastructure/migrations/0028_infrastructure_published_translation.py | geotrek/infrastructure/migrations/0028_infrastructure_published_translation.py | # Generated by Django 3.1.14 on 2022-03-11 15:06
from django.conf import settings
from django.db import migrations
def forward(apps, schema_editor):
with schema_editor.connection.cursor() as cursor:
cursor.execute(
f"SELECT 1 FROM information_schema.columns WHERE table_name='infrastructure_in... | Add migration fix published language | Add migration fix published language
| Python | bsd-2-clause | makinacorpus/Geotrek,makinacorpus/Geotrek,GeotrekCE/Geotrek-admin,GeotrekCE/Geotrek-admin,GeotrekCE/Geotrek-admin,makinacorpus/Geotrek,GeotrekCE/Geotrek-admin,makinacorpus/Geotrek | Add migration fix published language | # Generated by Django 3.1.14 on 2022-03-11 15:06
from django.conf import settings
from django.db import migrations
def forward(apps, schema_editor):
with schema_editor.connection.cursor() as cursor:
cursor.execute(
f"SELECT 1 FROM information_schema.columns WHERE table_name='infrastructure_in... | <commit_before><commit_msg>Add migration fix published language<commit_after> | # Generated by Django 3.1.14 on 2022-03-11 15:06
from django.conf import settings
from django.db import migrations
def forward(apps, schema_editor):
with schema_editor.connection.cursor() as cursor:
cursor.execute(
f"SELECT 1 FROM information_schema.columns WHERE table_name='infrastructure_in... | Add migration fix published language# Generated by Django 3.1.14 on 2022-03-11 15:06
from django.conf import settings
from django.db import migrations
def forward(apps, schema_editor):
with schema_editor.connection.cursor() as cursor:
cursor.execute(
f"SELECT 1 FROM information_schema.columns... | <commit_before><commit_msg>Add migration fix published language<commit_after># Generated by Django 3.1.14 on 2022-03-11 15:06
from django.conf import settings
from django.db import migrations
def forward(apps, schema_editor):
with schema_editor.connection.cursor() as cursor:
cursor.execute(
f... | |
33e5b3ea0567100d3145a566bd86f95ac6eb7d95 | survey/tests/test_pre_commit_normalization.py | survey/tests/test_pre_commit_normalization.py | import subprocess
import unittest
class TestPreCommitNormalization(unittest.TestCase):
def test_normalization(self):
""" We test if the code was properly formatted with pre-commit. """
pre_commit_command = ["pre-commit", "run", "--all-files"]
try:
subprocess.check_call(pre_comm... | Test - Add a test for pre-commit compliance | Test - Add a test for pre-commit compliance
| Python | agpl-3.0 | Pierre-Sassoulas/django-survey,Pierre-Sassoulas/django-survey,Pierre-Sassoulas/django-survey | Test - Add a test for pre-commit compliance | import subprocess
import unittest
class TestPreCommitNormalization(unittest.TestCase):
def test_normalization(self):
""" We test if the code was properly formatted with pre-commit. """
pre_commit_command = ["pre-commit", "run", "--all-files"]
try:
subprocess.check_call(pre_comm... | <commit_before><commit_msg>Test - Add a test for pre-commit compliance<commit_after> | import subprocess
import unittest
class TestPreCommitNormalization(unittest.TestCase):
def test_normalization(self):
""" We test if the code was properly formatted with pre-commit. """
pre_commit_command = ["pre-commit", "run", "--all-files"]
try:
subprocess.check_call(pre_comm... | Test - Add a test for pre-commit complianceimport subprocess
import unittest
class TestPreCommitNormalization(unittest.TestCase):
def test_normalization(self):
""" We test if the code was properly formatted with pre-commit. """
pre_commit_command = ["pre-commit", "run", "--all-files"]
try:... | <commit_before><commit_msg>Test - Add a test for pre-commit compliance<commit_after>import subprocess
import unittest
class TestPreCommitNormalization(unittest.TestCase):
def test_normalization(self):
""" We test if the code was properly formatted with pre-commit. """
pre_commit_command = ["pre-co... | |
2c4154f17af584dfa019ea9c2e71f0cc53389901 | pombola/south_africa/management/commands/south_africa_import_bios_from_json.py | pombola/south_africa/management/commands/south_africa_import_bios_from_json.py | from warnings import warn
import json
from django.core.management.base import LabelCommand, CommandError
from pombola.core.models import Person
# Expected JSON is an array of entries:
#
# [
# {
# "name": "John Smith",
# "bio": "Blah blah"
# },
# ....
# ]
class Command(LabelCommand):
... | Add import script to read in profile json. | Add import script to read in profile json.
| Python | agpl-3.0 | mysociety/pombola,geoffkilpin/pombola,geoffkilpin/pombola,patricmutwiri/pombola,patricmutwiri/pombola,hzj123/56th,ken-muturi/pombola,geoffkilpin/pombola,mysociety/pombola,hzj123/56th,hzj123/56th,mysociety/pombola,geoffkilpin/pombola,patricmutwiri/pombola,geoffkilpin/pombola,ken-muturi/pombola,hzj123/56th,mysociety/pomb... | Add import script to read in profile json. | from warnings import warn
import json
from django.core.management.base import LabelCommand, CommandError
from pombola.core.models import Person
# Expected JSON is an array of entries:
#
# [
# {
# "name": "John Smith",
# "bio": "Blah blah"
# },
# ....
# ]
class Command(LabelCommand):
... | <commit_before><commit_msg>Add import script to read in profile json.<commit_after> | from warnings import warn
import json
from django.core.management.base import LabelCommand, CommandError
from pombola.core.models import Person
# Expected JSON is an array of entries:
#
# [
# {
# "name": "John Smith",
# "bio": "Blah blah"
# },
# ....
# ]
class Command(LabelCommand):
... | Add import script to read in profile json.from warnings import warn
import json
from django.core.management.base import LabelCommand, CommandError
from pombola.core.models import Person
# Expected JSON is an array of entries:
#
# [
# {
# "name": "John Smith",
# "bio": "Blah blah"
# },
# .... | <commit_before><commit_msg>Add import script to read in profile json.<commit_after>from warnings import warn
import json
from django.core.management.base import LabelCommand, CommandError
from pombola.core.models import Person
# Expected JSON is an array of entries:
#
# [
# {
# "name": "John Smith",
# ... | |
f1fc422ef4d300fc1f4e47f26e03e762c7f7102d | meltingpot/python/utils/substrates/map_helpers.py | meltingpot/python/utils/substrates/map_helpers.py | # Copyright 2022 DeepMind Technologies Limited.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | Add map helpers for use in future melting pot version. | Add map helpers for use in future melting pot version.
PiperOrigin-RevId: 485877335
Change-Id: I852247fa319f3aefb0cf82a914df674254001e3b
| Python | apache-2.0 | deepmind/meltingpot,deepmind/meltingpot | Add map helpers for use in future melting pot version.
PiperOrigin-RevId: 485877335
Change-Id: I852247fa319f3aefb0cf82a914df674254001e3b | # Copyright 2022 DeepMind Technologies Limited.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | <commit_before><commit_msg>Add map helpers for use in future melting pot version.
PiperOrigin-RevId: 485877335
Change-Id: I852247fa319f3aefb0cf82a914df674254001e3b<commit_after> | # Copyright 2022 DeepMind Technologies Limited.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | Add map helpers for use in future melting pot version.
PiperOrigin-RevId: 485877335
Change-Id: I852247fa319f3aefb0cf82a914df674254001e3b# Copyright 2022 DeepMind Technologies Limited.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
... | <commit_before><commit_msg>Add map helpers for use in future melting pot version.
PiperOrigin-RevId: 485877335
Change-Id: I852247fa319f3aefb0cf82a914df674254001e3b<commit_after># Copyright 2022 DeepMind Technologies Limited.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this fil... | |
3667a7c6f79228086968ccc4785dfaebd6f1928d | data/file_level_aggregation_test.py | data/file_level_aggregation_test.py | # Copyright 2020 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | Add file level aggregation tests | Add file level aggregation tests
| Python | apache-2.0 | googleinterns/cl_analysis | Add file level aggregation tests | # Copyright 2020 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | <commit_before><commit_msg>Add file level aggregation tests<commit_after> | # Copyright 2020 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | Add file level aggregation tests# Copyright 2020 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | <commit_before><commit_msg>Add file level aggregation tests<commit_after># Copyright 2020 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LI... | |
60524d1681725a84491fd1f0de79d7557c4412ae | tests/data_layer/test_model_loader.py | tests/data_layer/test_model_loader.py | from pytest import raises
from smif.data_layer.model_loader import ModelLoader
def test_path_not_found():
"""Should error if module file is missing at path
"""
loader = ModelLoader()
with raises(FileNotFoundError) as ex:
loader.load({
'name': 'test',
'path': '/path/to/m... | Test FileNotFound error from ModelLoader | Test FileNotFound error from ModelLoader
| Python | mit | tomalrussell/smif,willu47/smif,willu47/smif,nismod/smif,tomalrussell/smif,nismod/smif,nismod/smif,nismod/smif,tomalrussell/smif,willu47/smif,willu47/smif,tomalrussell/smif | Test FileNotFound error from ModelLoader | from pytest import raises
from smif.data_layer.model_loader import ModelLoader
def test_path_not_found():
"""Should error if module file is missing at path
"""
loader = ModelLoader()
with raises(FileNotFoundError) as ex:
loader.load({
'name': 'test',
'path': '/path/to/m... | <commit_before><commit_msg>Test FileNotFound error from ModelLoader<commit_after> | from pytest import raises
from smif.data_layer.model_loader import ModelLoader
def test_path_not_found():
"""Should error if module file is missing at path
"""
loader = ModelLoader()
with raises(FileNotFoundError) as ex:
loader.load({
'name': 'test',
'path': '/path/to/m... | Test FileNotFound error from ModelLoaderfrom pytest import raises
from smif.data_layer.model_loader import ModelLoader
def test_path_not_found():
"""Should error if module file is missing at path
"""
loader = ModelLoader()
with raises(FileNotFoundError) as ex:
loader.load({
'name':... | <commit_before><commit_msg>Test FileNotFound error from ModelLoader<commit_after>from pytest import raises
from smif.data_layer.model_loader import ModelLoader
def test_path_not_found():
"""Should error if module file is missing at path
"""
loader = ModelLoader()
with raises(FileNotFoundError) as ex:
... | |
02d1c7a49b0813de4d2f7e7533f81d70f094175e | billjobs/tests/tests_user_admin_api.py | billjobs/tests/tests_user_admin_api.py | from django.test import TestCase
from django.contrib.auth.models import User
from rest_framework import status
from rest_framework.test import APIClient, APIRequestFactory, \
force_authenticate
from billjobs.views import UserAdmin
class UserAdminAPI(TestCase):
""" Test User Admin API REST endpoint """
... | Add test for user admin api | Add test for user admin api
| Python | mit | ioO/billjobs | Add test for user admin api | from django.test import TestCase
from django.contrib.auth.models import User
from rest_framework import status
from rest_framework.test import APIClient, APIRequestFactory, \
force_authenticate
from billjobs.views import UserAdmin
class UserAdminAPI(TestCase):
""" Test User Admin API REST endpoint """
... | <commit_before><commit_msg>Add test for user admin api<commit_after> | from django.test import TestCase
from django.contrib.auth.models import User
from rest_framework import status
from rest_framework.test import APIClient, APIRequestFactory, \
force_authenticate
from billjobs.views import UserAdmin
class UserAdminAPI(TestCase):
""" Test User Admin API REST endpoint """
... | Add test for user admin apifrom django.test import TestCase
from django.contrib.auth.models import User
from rest_framework import status
from rest_framework.test import APIClient, APIRequestFactory, \
force_authenticate
from billjobs.views import UserAdmin
class UserAdminAPI(TestCase):
""" Test User Admin... | <commit_before><commit_msg>Add test for user admin api<commit_after>from django.test import TestCase
from django.contrib.auth.models import User
from rest_framework import status
from rest_framework.test import APIClient, APIRequestFactory, \
force_authenticate
from billjobs.views import UserAdmin
class UserAd... | |
5711ff4b8cf17dabc5c0a35fa8ccc52f8e4a6322 | tools/find-iam-user-for-access-key.py | tools/find-iam-user-for-access-key.py | import boto.iam
import sys
TARGET_ACCESS_KEY = sys.argv[1]
iam = boto.connect_iam()
users = iam.get_all_users('/')['list_users_response']['list_users_result']['users']
def find_key():
for user in users:
for key_result in iam.get_all_access_keys(user['user_name'])['list_access_keys_response']['list_access_keys_re... | Add tool to find users for compromised keys on aws | Add tool to find users for compromised keys on aws
| Python | agpl-3.0 | cyplo/dotfiles,cyplo/dotfiles | Add tool to find users for compromised keys on aws | import boto.iam
import sys
TARGET_ACCESS_KEY = sys.argv[1]
iam = boto.connect_iam()
users = iam.get_all_users('/')['list_users_response']['list_users_result']['users']
def find_key():
for user in users:
for key_result in iam.get_all_access_keys(user['user_name'])['list_access_keys_response']['list_access_keys_re... | <commit_before><commit_msg>Add tool to find users for compromised keys on aws<commit_after> | import boto.iam
import sys
TARGET_ACCESS_KEY = sys.argv[1]
iam = boto.connect_iam()
users = iam.get_all_users('/')['list_users_response']['list_users_result']['users']
def find_key():
for user in users:
for key_result in iam.get_all_access_keys(user['user_name'])['list_access_keys_response']['list_access_keys_re... | Add tool to find users for compromised keys on awsimport boto.iam
import sys
TARGET_ACCESS_KEY = sys.argv[1]
iam = boto.connect_iam()
users = iam.get_all_users('/')['list_users_response']['list_users_result']['users']
def find_key():
for user in users:
for key_result in iam.get_all_access_keys(user['user_name'])... | <commit_before><commit_msg>Add tool to find users for compromised keys on aws<commit_after>import boto.iam
import sys
TARGET_ACCESS_KEY = sys.argv[1]
iam = boto.connect_iam()
users = iam.get_all_users('/')['list_users_response']['list_users_result']['users']
def find_key():
for user in users:
for key_result in i... | |
d6f6d41665f58e68833b57d8b0d04d113f2c86a9 | ideascube/conf/idb_jor_zaatari.py | ideascube/conf/idb_jor_zaatari.py | """Ideaxbox for Zaatari, Jordan"""
from .idb import * # noqa
from django.utils.translation import ugettext_lazy as _
IDEASCUBE_PLACE_NAME = _("city")
COUNTRIES_FIRST = ['SY', 'JO']
TIME_ZONE = 'Asia/Amman'
LANGUAGE_CODE = 'ar'
LOAN_DURATION = 14
MONITORING_ENTRY_EXPORT_FIELDS = ['serial', 'user_id', 'birth_year', 'ge... | """Ideaxbox for Zaatari, Jordan"""
from .idb_jor_azraq import * # noqa
ENTRY_ACTIVITY_CHOICES = []
| Make zaatari import from azraq | Make zaatari import from azraq
| Python | agpl-3.0 | ideascube/ideascube,ideascube/ideascube,ideascube/ideascube,ideascube/ideascube | """Ideaxbox for Zaatari, Jordan"""
from .idb import * # noqa
from django.utils.translation import ugettext_lazy as _
IDEASCUBE_PLACE_NAME = _("city")
COUNTRIES_FIRST = ['SY', 'JO']
TIME_ZONE = 'Asia/Amman'
LANGUAGE_CODE = 'ar'
LOAN_DURATION = 14
MONITORING_ENTRY_EXPORT_FIELDS = ['serial', 'user_id', 'birth_year', 'ge... | """Ideaxbox for Zaatari, Jordan"""
from .idb_jor_azraq import * # noqa
ENTRY_ACTIVITY_CHOICES = []
| <commit_before>"""Ideaxbox for Zaatari, Jordan"""
from .idb import * # noqa
from django.utils.translation import ugettext_lazy as _
IDEASCUBE_PLACE_NAME = _("city")
COUNTRIES_FIRST = ['SY', 'JO']
TIME_ZONE = 'Asia/Amman'
LANGUAGE_CODE = 'ar'
LOAN_DURATION = 14
MONITORING_ENTRY_EXPORT_FIELDS = ['serial', 'user_id', 'b... | """Ideaxbox for Zaatari, Jordan"""
from .idb_jor_azraq import * # noqa
ENTRY_ACTIVITY_CHOICES = []
| """Ideaxbox for Zaatari, Jordan"""
from .idb import * # noqa
from django.utils.translation import ugettext_lazy as _
IDEASCUBE_PLACE_NAME = _("city")
COUNTRIES_FIRST = ['SY', 'JO']
TIME_ZONE = 'Asia/Amman'
LANGUAGE_CODE = 'ar'
LOAN_DURATION = 14
MONITORING_ENTRY_EXPORT_FIELDS = ['serial', 'user_id', 'birth_year', 'ge... | <commit_before>"""Ideaxbox for Zaatari, Jordan"""
from .idb import * # noqa
from django.utils.translation import ugettext_lazy as _
IDEASCUBE_PLACE_NAME = _("city")
COUNTRIES_FIRST = ['SY', 'JO']
TIME_ZONE = 'Asia/Amman'
LANGUAGE_CODE = 'ar'
LOAN_DURATION = 14
MONITORING_ENTRY_EXPORT_FIELDS = ['serial', 'user_id', 'b... |
af5c2b786f83532f1df8f72cc5074ce998ba69cb | examples/mayavi/spherical_harmonics.py | examples/mayavi/spherical_harmonics.py |
from enthought.mayavi import mlab
import numpy as np
from scipy.special import sph_harm
# Create a sphere
r = 0.3
pi = np.pi
cos = np.cos
sin = np.sin
phi, theta = np.mgrid[0:pi:101j, 0:2*pi:101j]
x = r*sin(phi)*cos(theta)
y = r*sin(phi)*sin(theta)
z = r*cos(phi)
mlab.figure(1, bgcolor=(1, 1, 1), fgcolor=(0, 0, 0),... | Add a spherical harmonics example | Add a spherical harmonics example
| Python | bsd-3-clause | liulion/mayavi,dmsurti/mayavi,alexandreleroux/mayavi,alexandreleroux/mayavi,dmsurti/mayavi,liulion/mayavi | Add a spherical harmonics example |
from enthought.mayavi import mlab
import numpy as np
from scipy.special import sph_harm
# Create a sphere
r = 0.3
pi = np.pi
cos = np.cos
sin = np.sin
phi, theta = np.mgrid[0:pi:101j, 0:2*pi:101j]
x = r*sin(phi)*cos(theta)
y = r*sin(phi)*sin(theta)
z = r*cos(phi)
mlab.figure(1, bgcolor=(1, 1, 1), fgcolor=(0, 0, 0),... | <commit_before><commit_msg>Add a spherical harmonics example<commit_after> |
from enthought.mayavi import mlab
import numpy as np
from scipy.special import sph_harm
# Create a sphere
r = 0.3
pi = np.pi
cos = np.cos
sin = np.sin
phi, theta = np.mgrid[0:pi:101j, 0:2*pi:101j]
x = r*sin(phi)*cos(theta)
y = r*sin(phi)*sin(theta)
z = r*cos(phi)
mlab.figure(1, bgcolor=(1, 1, 1), fgcolor=(0, 0, 0),... | Add a spherical harmonics example
from enthought.mayavi import mlab
import numpy as np
from scipy.special import sph_harm
# Create a sphere
r = 0.3
pi = np.pi
cos = np.cos
sin = np.sin
phi, theta = np.mgrid[0:pi:101j, 0:2*pi:101j]
x = r*sin(phi)*cos(theta)
y = r*sin(phi)*sin(theta)
z = r*cos(phi)
mlab.figure(1, bgco... | <commit_before><commit_msg>Add a spherical harmonics example<commit_after>
from enthought.mayavi import mlab
import numpy as np
from scipy.special import sph_harm
# Create a sphere
r = 0.3
pi = np.pi
cos = np.cos
sin = np.sin
phi, theta = np.mgrid[0:pi:101j, 0:2*pi:101j]
x = r*sin(phi)*cos(theta)
y = r*sin(phi)*sin(t... | |
df1a411c7bd818b741e05edc9d0a94187c3ea102 | numba/tests/test_array_manipulation.py | numba/tests/test_array_manipulation.py | from __future__ import print_function
import unittest
import numpy as np
from numba.compiler import compile_isolated, Flags
from numba import types, utils
from numba.tests import usecases
enable_pyobj_flags = Flags()
enable_pyobj_flags.set("enable_pyobject")
force_pyobj_flags = Flags()
force_pyobj_flags.set("force_py... | Add tests for numpy array manipulation | Add tests for numpy array manipulation
| Python | bsd-2-clause | GaZ3ll3/numba,pombredanne/numba,jriehl/numba,pitrou/numba,pitrou/numba,GaZ3ll3/numba,pitrou/numba,sklam/numba,seibert/numba,numba/numba,sklam/numba,gdementen/numba,ssarangi/numba,sklam/numba,IntelLabs/numba,gmarkall/numba,jriehl/numba,stuartarchibald/numba,ssarangi/numba,ssarangi/numba,stonebig/numba,cpcloud/numba,ssar... | Add tests for numpy array manipulation | from __future__ import print_function
import unittest
import numpy as np
from numba.compiler import compile_isolated, Flags
from numba import types, utils
from numba.tests import usecases
enable_pyobj_flags = Flags()
enable_pyobj_flags.set("enable_pyobject")
force_pyobj_flags = Flags()
force_pyobj_flags.set("force_py... | <commit_before><commit_msg>Add tests for numpy array manipulation<commit_after> | from __future__ import print_function
import unittest
import numpy as np
from numba.compiler import compile_isolated, Flags
from numba import types, utils
from numba.tests import usecases
enable_pyobj_flags = Flags()
enable_pyobj_flags.set("enable_pyobject")
force_pyobj_flags = Flags()
force_pyobj_flags.set("force_py... | Add tests for numpy array manipulationfrom __future__ import print_function
import unittest
import numpy as np
from numba.compiler import compile_isolated, Flags
from numba import types, utils
from numba.tests import usecases
enable_pyobj_flags = Flags()
enable_pyobj_flags.set("enable_pyobject")
force_pyobj_flags = F... | <commit_before><commit_msg>Add tests for numpy array manipulation<commit_after>from __future__ import print_function
import unittest
import numpy as np
from numba.compiler import compile_isolated, Flags
from numba import types, utils
from numba.tests import usecases
enable_pyobj_flags = Flags()
enable_pyobj_flags.set(... | |
a8bae714090e6cfdc7541ea46a61b8802eba5d2b | numba/tests/test_create_arrays.py | numba/tests/test_create_arrays.py | from __future__ import print_function
import unittest
import numpy as np
from numba.compiler import compile_isolated, Flags
from numba import types, utils
from numba.tests import usecases
enable_pyobj_flags = Flags()
enable_pyobj_flags.set("enable_pyobject")
force_pyobj_flags = Flags()
force_pyobj_flags.set("force_py... | Add tests for numpy array creation | Add tests for numpy array creation
| Python | bsd-2-clause | stuartarchibald/numba,sklam/numba,pombredanne/numba,gdementen/numba,gdementen/numba,seibert/numba,ssarangi/numba,sklam/numba,ssarangi/numba,gmarkall/numba,IntelLabs/numba,stuartarchibald/numba,IntelLabs/numba,seibert/numba,jriehl/numba,stonebig/numba,IntelLabs/numba,pombredanne/numba,cpcloud/numba,stonebig/numba,cpclou... | Add tests for numpy array creation | from __future__ import print_function
import unittest
import numpy as np
from numba.compiler import compile_isolated, Flags
from numba import types, utils
from numba.tests import usecases
enable_pyobj_flags = Flags()
enable_pyobj_flags.set("enable_pyobject")
force_pyobj_flags = Flags()
force_pyobj_flags.set("force_py... | <commit_before><commit_msg>Add tests for numpy array creation<commit_after> | from __future__ import print_function
import unittest
import numpy as np
from numba.compiler import compile_isolated, Flags
from numba import types, utils
from numba.tests import usecases
enable_pyobj_flags = Flags()
enable_pyobj_flags.set("enable_pyobject")
force_pyobj_flags = Flags()
force_pyobj_flags.set("force_py... | Add tests for numpy array creationfrom __future__ import print_function
import unittest
import numpy as np
from numba.compiler import compile_isolated, Flags
from numba import types, utils
from numba.tests import usecases
enable_pyobj_flags = Flags()
enable_pyobj_flags.set("enable_pyobject")
force_pyobj_flags = Flags... | <commit_before><commit_msg>Add tests for numpy array creation<commit_after>from __future__ import print_function
import unittest
import numpy as np
from numba.compiler import compile_isolated, Flags
from numba import types, utils
from numba.tests import usecases
enable_pyobj_flags = Flags()
enable_pyobj_flags.set("ena... | |
8065ca1d6ff59272d23e71de3cd7c07c4bbd1a39 | examples/call_later.py | examples/call_later.py | import random
import transaction
from inevitable.core import Reactor
def callback():
for i in xrange(10000):
answer = i ** 3
if random.random() > 0.00001:
reactor.call_later(seconds=0, callback=callback)
reactor = Reactor(clock=transaction)
reactor.call_later(seconds=0, callback=callback)
r... | Add a time-based example for the functionality that exists so far. | Add a time-based example for the functionality that exists so far.
| Python | mit | Julian/Inevitable | Add a time-based example for the functionality that exists so far. | import random
import transaction
from inevitable.core import Reactor
def callback():
for i in xrange(10000):
answer = i ** 3
if random.random() > 0.00001:
reactor.call_later(seconds=0, callback=callback)
reactor = Reactor(clock=transaction)
reactor.call_later(seconds=0, callback=callback)
r... | <commit_before><commit_msg>Add a time-based example for the functionality that exists so far.<commit_after> | import random
import transaction
from inevitable.core import Reactor
def callback():
for i in xrange(10000):
answer = i ** 3
if random.random() > 0.00001:
reactor.call_later(seconds=0, callback=callback)
reactor = Reactor(clock=transaction)
reactor.call_later(seconds=0, callback=callback)
r... | Add a time-based example for the functionality that exists so far.import random
import transaction
from inevitable.core import Reactor
def callback():
for i in xrange(10000):
answer = i ** 3
if random.random() > 0.00001:
reactor.call_later(seconds=0, callback=callback)
reactor = Reactor(clo... | <commit_before><commit_msg>Add a time-based example for the functionality that exists so far.<commit_after>import random
import transaction
from inevitable.core import Reactor
def callback():
for i in xrange(10000):
answer = i ** 3
if random.random() > 0.00001:
reactor.call_later(seconds=0, c... | |
5efcdd6f74b842992a6479ec5d7978d84d2544a7 | jinja2_for_django.py | jinja2_for_django.py | """
A Jinja2 template loader for Django 1.2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Add the following to your settings.py file. (The comma is important!)
TEMPLATE_LOADERS = ('jinja2_for_django.Loader',)
Now use your templates as usual (with render_to_response, generic views or
an... | Add Jinja2 template loader for Django. | Add Jinja2 template loader for Django.
| Python | bsd-3-clause | SimonSapin/snippets,SimonSapin/snippets | Add Jinja2 template loader for Django. | """
A Jinja2 template loader for Django 1.2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Add the following to your settings.py file. (The comma is important!)
TEMPLATE_LOADERS = ('jinja2_for_django.Loader',)
Now use your templates as usual (with render_to_response, generic views or
an... | <commit_before><commit_msg>Add Jinja2 template loader for Django.<commit_after> | """
A Jinja2 template loader for Django 1.2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Add the following to your settings.py file. (The comma is important!)
TEMPLATE_LOADERS = ('jinja2_for_django.Loader',)
Now use your templates as usual (with render_to_response, generic views or
an... | Add Jinja2 template loader for Django."""
A Jinja2 template loader for Django 1.2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Add the following to your settings.py file. (The comma is important!)
TEMPLATE_LOADERS = ('jinja2_for_django.Loader',)
Now use your templates as usual (with rende... | <commit_before><commit_msg>Add Jinja2 template loader for Django.<commit_after>"""
A Jinja2 template loader for Django 1.2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Add the following to your settings.py file. (The comma is important!)
TEMPLATE_LOADERS = ('jinja2_for_django.Loader',)
No... | |
0851e5b9ae19da9f97aadfdcdbf6eac1d67abf5a | solvebio/test/test_beacon.py | solvebio/test/test_beacon.py | from __future__ import absolute_import
from solvebio.resource import Dataset
from .helper import SolveBioTestCase
class BeaconTests(SolveBioTestCase):
def test_beacon_request(self):
"""
Check that current Clinvar/Variants returns correct
fields for beacon
"""
dataset = Da... | Test cases for beacon requests | Test cases for beacon requests
| Python | mit | solvebio/solvebio-python,solvebio/solvebio-python,solvebio/solvebio-python | Test cases for beacon requests | from __future__ import absolute_import
from solvebio.resource import Dataset
from .helper import SolveBioTestCase
class BeaconTests(SolveBioTestCase):
def test_beacon_request(self):
"""
Check that current Clinvar/Variants returns correct
fields for beacon
"""
dataset = Da... | <commit_before><commit_msg>Test cases for beacon requests<commit_after> | from __future__ import absolute_import
from solvebio.resource import Dataset
from .helper import SolveBioTestCase
class BeaconTests(SolveBioTestCase):
def test_beacon_request(self):
"""
Check that current Clinvar/Variants returns correct
fields for beacon
"""
dataset = Da... | Test cases for beacon requestsfrom __future__ import absolute_import
from solvebio.resource import Dataset
from .helper import SolveBioTestCase
class BeaconTests(SolveBioTestCase):
def test_beacon_request(self):
"""
Check that current Clinvar/Variants returns correct
fields for beacon
... | <commit_before><commit_msg>Test cases for beacon requests<commit_after>from __future__ import absolute_import
from solvebio.resource import Dataset
from .helper import SolveBioTestCase
class BeaconTests(SolveBioTestCase):
def test_beacon_request(self):
"""
Check that current Clinvar/Variants ret... | |
f22113f925052eba881599aae62b79fe4dd6d715 | indra/databases/phosphosite_client.py | indra/databases/phosphosite_client.py | from __future__ import absolute_import, print_function, unicode_literals
from builtins import dict, str
from os.path import dirname, abspath, join
from collections import namedtuple, defaultdict
from indra.util import read_unicode_csv
PhosphoSite = namedtuple('PhosphoSite',
['GENE', 'PROTEIN',... | Load phosphosite data from dataset .tsv file | Load phosphosite data from dataset .tsv file
| Python | bsd-2-clause | sorgerlab/indra,bgyori/indra,pvtodorov/indra,johnbachman/belpy,pvtodorov/indra,bgyori/indra,pvtodorov/indra,johnbachman/indra,sorgerlab/indra,sorgerlab/belpy,pvtodorov/indra,johnbachman/indra,sorgerlab/belpy,johnbachman/indra,sorgerlab/belpy,sorgerlab/indra,johnbachman/belpy,bgyori/indra,johnbachman/belpy | Load phosphosite data from dataset .tsv file | from __future__ import absolute_import, print_function, unicode_literals
from builtins import dict, str
from os.path import dirname, abspath, join
from collections import namedtuple, defaultdict
from indra.util import read_unicode_csv
PhosphoSite = namedtuple('PhosphoSite',
['GENE', 'PROTEIN',... | <commit_before><commit_msg>Load phosphosite data from dataset .tsv file<commit_after> | from __future__ import absolute_import, print_function, unicode_literals
from builtins import dict, str
from os.path import dirname, abspath, join
from collections import namedtuple, defaultdict
from indra.util import read_unicode_csv
PhosphoSite = namedtuple('PhosphoSite',
['GENE', 'PROTEIN',... | Load phosphosite data from dataset .tsv filefrom __future__ import absolute_import, print_function, unicode_literals
from builtins import dict, str
from os.path import dirname, abspath, join
from collections import namedtuple, defaultdict
from indra.util import read_unicode_csv
PhosphoSite = namedtuple('PhosphoSite',
... | <commit_before><commit_msg>Load phosphosite data from dataset .tsv file<commit_after>from __future__ import absolute_import, print_function, unicode_literals
from builtins import dict, str
from os.path import dirname, abspath, join
from collections import namedtuple, defaultdict
from indra.util import read_unicode_csv
... | |
8676c850b7bf011d3844d7fceb146d70f21dd218 | nameless/lambda_calculus_ast.py | nameless/lambda_calculus_ast.py | #!/usr/bin/python
# -*- coding: UTF-8 -*-
"""
lexer.py
@author ejnp
"""
class Expression(object):
"""Abstract class for any lambda calculus expression."""
def children(self):
"""Returns a list of Expression objects."""
pass
class Variable(Expression):
"""Encapsulates a lambda calculus... | Implement an object-oriented lambda calculus AST | Implement an object-oriented lambda calculus AST
| Python | mit | ElliotPenson/nameless | Implement an object-oriented lambda calculus AST | #!/usr/bin/python
# -*- coding: UTF-8 -*-
"""
lexer.py
@author ejnp
"""
class Expression(object):
"""Abstract class for any lambda calculus expression."""
def children(self):
"""Returns a list of Expression objects."""
pass
class Variable(Expression):
"""Encapsulates a lambda calculus... | <commit_before><commit_msg>Implement an object-oriented lambda calculus AST<commit_after> | #!/usr/bin/python
# -*- coding: UTF-8 -*-
"""
lexer.py
@author ejnp
"""
class Expression(object):
"""Abstract class for any lambda calculus expression."""
def children(self):
"""Returns a list of Expression objects."""
pass
class Variable(Expression):
"""Encapsulates a lambda calculus... | Implement an object-oriented lambda calculus AST#!/usr/bin/python
# -*- coding: UTF-8 -*-
"""
lexer.py
@author ejnp
"""
class Expression(object):
"""Abstract class for any lambda calculus expression."""
def children(self):
"""Returns a list of Expression objects."""
pass
class Variable(Ex... | <commit_before><commit_msg>Implement an object-oriented lambda calculus AST<commit_after>#!/usr/bin/python
# -*- coding: UTF-8 -*-
"""
lexer.py
@author ejnp
"""
class Expression(object):
"""Abstract class for any lambda calculus expression."""
def children(self):
"""Returns a list of Expression obj... | |
a8834c9ed115e227b9d995685776dc5eda2991ee | luminoth/models/fasterrcnn/rcnn_target_test.py | luminoth/models/fasterrcnn/rcnn_target_test.py | import tensorflow as tf
import numpy as np
from easydict import EasyDict
from luminoth.models.fasterrcnn.rcnn_target import RCNNTarget
class RCNNTargetTest(tf.test.TestCase):
def setUp(self):
super(RCNNTargetTest, self).setUp()
# We don't care about the class labels or the batch number in most ... | Add a basic test for RCNNTarget | Add a basic test for RCNNTarget
| Python | bsd-3-clause | tryolabs/luminoth,tryolabs/luminoth,tryolabs/luminoth | Add a basic test for RCNNTarget | import tensorflow as tf
import numpy as np
from easydict import EasyDict
from luminoth.models.fasterrcnn.rcnn_target import RCNNTarget
class RCNNTargetTest(tf.test.TestCase):
def setUp(self):
super(RCNNTargetTest, self).setUp()
# We don't care about the class labels or the batch number in most ... | <commit_before><commit_msg>Add a basic test for RCNNTarget<commit_after> | import tensorflow as tf
import numpy as np
from easydict import EasyDict
from luminoth.models.fasterrcnn.rcnn_target import RCNNTarget
class RCNNTargetTest(tf.test.TestCase):
def setUp(self):
super(RCNNTargetTest, self).setUp()
# We don't care about the class labels or the batch number in most ... | Add a basic test for RCNNTargetimport tensorflow as tf
import numpy as np
from easydict import EasyDict
from luminoth.models.fasterrcnn.rcnn_target import RCNNTarget
class RCNNTargetTest(tf.test.TestCase):
def setUp(self):
super(RCNNTargetTest, self).setUp()
# We don't care about the class labe... | <commit_before><commit_msg>Add a basic test for RCNNTarget<commit_after>import tensorflow as tf
import numpy as np
from easydict import EasyDict
from luminoth.models.fasterrcnn.rcnn_target import RCNNTarget
class RCNNTargetTest(tf.test.TestCase):
def setUp(self):
super(RCNNTargetTest, self).setUp()
... | |
fd114dbd5036735a9c3bcbd49fd8d31c2e750a8a | nailgun/nailgun/test/unit/test_requirements.py | nailgun/nailgun/test/unit/test_requirements.py | # -*- coding: utf-8 -*-
# Copyright 2015 Mirantis, 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 requi... | Check if nailgun's requirements do not conflict | Check if nailgun's requirements do not conflict
Added simple test that will try to parse nailgun's
requirements and see if there are any problems with them.
Change-Id: I342eda0a3b019780e0d452455734591aab91f6e9
Closes-Bug: #1462281
| Python | apache-2.0 | huntxu/fuel-web,stackforge/fuel-web,eayunstack/fuel-web,prmtl/fuel-web,stackforge/fuel-web,prmtl/fuel-web,SmartInfrastructures/fuel-web-dev,prmtl/fuel-web,nebril/fuel-web,huntxu/fuel-web,eayunstack/fuel-web,eayunstack/fuel-web,SmartInfrastructures/fuel-web-dev,prmtl/fuel-web,eayunstack/fuel-web,SmartInfrastructures/fue... | Check if nailgun's requirements do not conflict
Added simple test that will try to parse nailgun's
requirements and see if there are any problems with them.
Change-Id: I342eda0a3b019780e0d452455734591aab91f6e9
Closes-Bug: #1462281 | # -*- coding: utf-8 -*-
# Copyright 2015 Mirantis, 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 requi... | <commit_before><commit_msg>Check if nailgun's requirements do not conflict
Added simple test that will try to parse nailgun's
requirements and see if there are any problems with them.
Change-Id: I342eda0a3b019780e0d452455734591aab91f6e9
Closes-Bug: #1462281<commit_after> | # -*- coding: utf-8 -*-
# Copyright 2015 Mirantis, 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 requi... | Check if nailgun's requirements do not conflict
Added simple test that will try to parse nailgun's
requirements and see if there are any problems with them.
Change-Id: I342eda0a3b019780e0d452455734591aab91f6e9
Closes-Bug: #1462281# -*- coding: utf-8 -*-
# Copyright 2015 Mirantis, Inc.
#
# Licensed under the Ap... | <commit_before><commit_msg>Check if nailgun's requirements do not conflict
Added simple test that will try to parse nailgun's
requirements and see if there are any problems with them.
Change-Id: I342eda0a3b019780e0d452455734591aab91f6e9
Closes-Bug: #1462281<commit_after># -*- coding: utf-8 -*-
# Copyright 2015 Mi... | |
cdd4357dbacdb16774916f746f129e534bc09866 | utils/AccessDump.py | utils/AccessDump.py | #!/usr/bin/env python
#
# AccessDump.py
# A simple script to dump the contents of a Microsoft Access Database.
# It depends upon the mdbtools suite:
# http://sourceforge.net/projects/mdbtools/
import string, sys, subprocess # the subprocess module is new in python v 2.4
DATABASE = sys.argv[1]
# Get the list of tab... | Add util script for dumping Access tables to .csv | Add util script for dumping Access tables to .csv
| Python | bsd-3-clause | uq-eresearch/uqam,uq-eresearch/uqam,uq-eresearch/uqam,uq-eresearch/uqam | Add util script for dumping Access tables to .csv | #!/usr/bin/env python
#
# AccessDump.py
# A simple script to dump the contents of a Microsoft Access Database.
# It depends upon the mdbtools suite:
# http://sourceforge.net/projects/mdbtools/
import string, sys, subprocess # the subprocess module is new in python v 2.4
DATABASE = sys.argv[1]
# Get the list of tab... | <commit_before><commit_msg>Add util script for dumping Access tables to .csv<commit_after> | #!/usr/bin/env python
#
# AccessDump.py
# A simple script to dump the contents of a Microsoft Access Database.
# It depends upon the mdbtools suite:
# http://sourceforge.net/projects/mdbtools/
import string, sys, subprocess # the subprocess module is new in python v 2.4
DATABASE = sys.argv[1]
# Get the list of tab... | Add util script for dumping Access tables to .csv#!/usr/bin/env python
#
# AccessDump.py
# A simple script to dump the contents of a Microsoft Access Database.
# It depends upon the mdbtools suite:
# http://sourceforge.net/projects/mdbtools/
import string, sys, subprocess # the subprocess module is new in python v 2... | <commit_before><commit_msg>Add util script for dumping Access tables to .csv<commit_after>#!/usr/bin/env python
#
# AccessDump.py
# A simple script to dump the contents of a Microsoft Access Database.
# It depends upon the mdbtools suite:
# http://sourceforge.net/projects/mdbtools/
import string, sys, subprocess # t... | |
60e7beefe0c20e2da232d83efac853ec6a9f40d9 | l10n_it_pec/partner.py | l10n_it_pec/partner.py | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | Fix CamelCase on PEC module | [Fix] Fix CamelCase on PEC module
| Python | agpl-3.0 | luca-vercelli/l10n-italy,alessandrocamilli/l10n-italy,scigghia/l10n-italy,OpenCode/l10n-italy,odoo-isa/l10n-italy,hurrinico/l10n-italy,abstract-open-solutions/l10n-italy,maxhome1/l10n-italy,linkitspa/l10n-italy,linkitspa/l10n-italy,ApuliaSoftware/l10n-italy,andrea4ever/l10n-italy,linkitspa/l10n-italy,yvaucher/l10n-ital... | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | <commit_before># -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the t... | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | <commit_before># -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the t... |
50182bf8bcfe5884820a61639924fbfa96aecccb | src/ggrc/migrations/versions/20151112145524_35e5344803b4_add_missing_constraints.py | src/ggrc/migrations/versions/20151112145524_35e5344803b4_add_missing_constraints.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: anze@reciprocitylabs.com
# Maintained By: anze@reciprocitylabs.com
from alembic import op
from ggrc.migrations.utils import resolve_duplicates
from... | Add unique constraint to vendor slug | Add unique constraint to vendor slug
| Python | apache-2.0 | kr41/ggrc-core,andrei-karalionak/ggrc-core,j0gurt/ggrc-core,j0gurt/ggrc-core,NejcZupec/ggrc-core,AleksNeStu/ggrc-core,plamut/ggrc-core,selahssea/ggrc-core,kr41/ggrc-core,prasannav7/ggrc-core,jmakov/ggrc-core,NejcZupec/ggrc-core,josthkko/ggrc-core,jmakov/ggrc-core,j0gurt/ggrc-core,andrei-karalionak/ggrc-core,selahssea/g... | Add unique constraint to vendor slug | # 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: anze@reciprocitylabs.com
# Maintained By: anze@reciprocitylabs.com
from alembic import op
from ggrc.migrations.utils import resolve_duplicates
from... | <commit_before><commit_msg>Add unique constraint to vendor slug<commit_after> | # 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: anze@reciprocitylabs.com
# Maintained By: anze@reciprocitylabs.com
from alembic import op
from ggrc.migrations.utils import resolve_duplicates
from... | Add unique constraint to vendor slug# 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: anze@reciprocitylabs.com
# Maintained By: anze@reciprocitylabs.com
from alembic import op
from ggrc.migrations.... | <commit_before><commit_msg>Add unique constraint to vendor slug<commit_after># 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: anze@reciprocitylabs.com
# Maintained By: anze@reciprocitylabs.com
fro... | |
584f13955cda8c1b92c1246417881a7a4458155c | account_product_fiscal_classification_test/tests/test_multicompany.py | account_product_fiscal_classification_test/tests/test_multicompany.py | # Copyright (C) 2020 David BEAL @ Akretion
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo.tests.common import TransactionCase
class MulticompanyTests(TransactionCase):
def setUp(self):
super().setUp()
def test_classif_in_multicompany(self):
prd = self.env.ref(... | FIX prd_classif: set taxes on all companies sharing classif | FIX prd_classif: set taxes on all companies sharing classif
| Python | agpl-3.0 | OCA/account-fiscal-rule,OCA/account-fiscal-rule | FIX prd_classif: set taxes on all companies sharing classif | # Copyright (C) 2020 David BEAL @ Akretion
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo.tests.common import TransactionCase
class MulticompanyTests(TransactionCase):
def setUp(self):
super().setUp()
def test_classif_in_multicompany(self):
prd = self.env.ref(... | <commit_before><commit_msg>FIX prd_classif: set taxes on all companies sharing classif<commit_after> | # Copyright (C) 2020 David BEAL @ Akretion
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo.tests.common import TransactionCase
class MulticompanyTests(TransactionCase):
def setUp(self):
super().setUp()
def test_classif_in_multicompany(self):
prd = self.env.ref(... | FIX prd_classif: set taxes on all companies sharing classif# Copyright (C) 2020 David BEAL @ Akretion
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo.tests.common import TransactionCase
class MulticompanyTests(TransactionCase):
def setUp(self):
super().setUp()
def test... | <commit_before><commit_msg>FIX prd_classif: set taxes on all companies sharing classif<commit_after># Copyright (C) 2020 David BEAL @ Akretion
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo.tests.common import TransactionCase
class MulticompanyTests(TransactionCase):
def setUp(sel... | |
3c948669c63be48c6762f4606c9bdae54328fdbc | education/migrations/0015_mark_implausible_responses.py | education/migrations/0015_mark_implausible_responses.py | # -*- coding: utf-8 -*-
from south.v2 import DataMigration
from education.models import Response
class Migration(DataMigration):
def forwards(self, orm):
implausibles = Response.objects.filter(has_errors=False,
message__direction='I',
... | Mark all implausibly large responses as having errors. | Mark all implausibly large responses as having errors.
| Python | bsd-3-clause | unicefuganda/edtrac,unicefuganda/edtrac,unicefuganda/edtrac | Mark all implausibly large responses as having errors. | # -*- coding: utf-8 -*-
from south.v2 import DataMigration
from education.models import Response
class Migration(DataMigration):
def forwards(self, orm):
implausibles = Response.objects.filter(has_errors=False,
message__direction='I',
... | <commit_before><commit_msg>Mark all implausibly large responses as having errors.<commit_after> | # -*- coding: utf-8 -*-
from south.v2 import DataMigration
from education.models import Response
class Migration(DataMigration):
def forwards(self, orm):
implausibles = Response.objects.filter(has_errors=False,
message__direction='I',
... | Mark all implausibly large responses as having errors.# -*- coding: utf-8 -*-
from south.v2 import DataMigration
from education.models import Response
class Migration(DataMigration):
def forwards(self, orm):
implausibles = Response.objects.filter(has_errors=False,
... | <commit_before><commit_msg>Mark all implausibly large responses as having errors.<commit_after># -*- coding: utf-8 -*-
from south.v2 import DataMigration
from education.models import Response
class Migration(DataMigration):
def forwards(self, orm):
implausibles = Response.objects.filter(has_errors=False,... | |
4ff83e0ee299dc521599ce38ef4eee27dcb15c3c | check_overcloud_controller_settings.py | check_overcloud_controller_settings.py | #!/usr/bin/env python
import os
import ConfigParser
MARIADB_MAX_CONNECTIONS_MIN = 4096
def find_mariadb_config_file():
potential_locations = [
'/etc/my.cnf.d/galera.cnf',
'/etc/my.cnf.d/server.cnf',
'/etc/my.cnf',
]
for filepath in potential_locations:
if os.access(filepat... | Validate mariadb config on the overcloud controller | Validate mariadb config on the overcloud controller
The script is meant to grow to validate more settings on the overcloud
controller.
| Python | apache-2.0 | coolsvap/clapper,coolsvap/clapper,rthallisey/clapper,coolsvap/clapper,rthallisey/clapper | Validate mariadb config on the overcloud controller
The script is meant to grow to validate more settings on the overcloud
controller. | #!/usr/bin/env python
import os
import ConfigParser
MARIADB_MAX_CONNECTIONS_MIN = 4096
def find_mariadb_config_file():
potential_locations = [
'/etc/my.cnf.d/galera.cnf',
'/etc/my.cnf.d/server.cnf',
'/etc/my.cnf',
]
for filepath in potential_locations:
if os.access(filepat... | <commit_before><commit_msg>Validate mariadb config on the overcloud controller
The script is meant to grow to validate more settings on the overcloud
controller.<commit_after> | #!/usr/bin/env python
import os
import ConfigParser
MARIADB_MAX_CONNECTIONS_MIN = 4096
def find_mariadb_config_file():
potential_locations = [
'/etc/my.cnf.d/galera.cnf',
'/etc/my.cnf.d/server.cnf',
'/etc/my.cnf',
]
for filepath in potential_locations:
if os.access(filepat... | Validate mariadb config on the overcloud controller
The script is meant to grow to validate more settings on the overcloud
controller.#!/usr/bin/env python
import os
import ConfigParser
MARIADB_MAX_CONNECTIONS_MIN = 4096
def find_mariadb_config_file():
potential_locations = [
'/etc/my.cnf.d/galera.cnf',... | <commit_before><commit_msg>Validate mariadb config on the overcloud controller
The script is meant to grow to validate more settings on the overcloud
controller.<commit_after>#!/usr/bin/env python
import os
import ConfigParser
MARIADB_MAX_CONNECTIONS_MIN = 4096
def find_mariadb_config_file():
potential_location... | |
f44c98a837c9dbd48f32ba698c59ed6a6369c293 | pygraphc/preprocess/CreateGraphModel.py | pygraphc/preprocess/CreateGraphModel.py | from pygraphc.preprocess.ParallelPreprocess import ParallelPreprocess
from pygraphc.similarity.JaroWinkler import JaroWinkler
import networkx as nx
from time import time
class CreateGraphModel(object):
def __init__(self, log_file):
self.log_file = log_file
self.unique_events = []
self.uniq... | Add create graph class based on parallel preprocess | Add create graph class based on parallel preprocess
| Python | mit | studiawan/pygraphc | Add create graph class based on parallel preprocess | from pygraphc.preprocess.ParallelPreprocess import ParallelPreprocess
from pygraphc.similarity.JaroWinkler import JaroWinkler
import networkx as nx
from time import time
class CreateGraphModel(object):
def __init__(self, log_file):
self.log_file = log_file
self.unique_events = []
self.uniq... | <commit_before><commit_msg>Add create graph class based on parallel preprocess<commit_after> | from pygraphc.preprocess.ParallelPreprocess import ParallelPreprocess
from pygraphc.similarity.JaroWinkler import JaroWinkler
import networkx as nx
from time import time
class CreateGraphModel(object):
def __init__(self, log_file):
self.log_file = log_file
self.unique_events = []
self.uniq... | Add create graph class based on parallel preprocessfrom pygraphc.preprocess.ParallelPreprocess import ParallelPreprocess
from pygraphc.similarity.JaroWinkler import JaroWinkler
import networkx as nx
from time import time
class CreateGraphModel(object):
def __init__(self, log_file):
self.log_file = log_fil... | <commit_before><commit_msg>Add create graph class based on parallel preprocess<commit_after>from pygraphc.preprocess.ParallelPreprocess import ParallelPreprocess
from pygraphc.similarity.JaroWinkler import JaroWinkler
import networkx as nx
from time import time
class CreateGraphModel(object):
def __init__(self, l... | |
8330636554c907054b171de55c9d5fe09a49d875 | pyheufybot/module_interface.py | pyheufybot/module_interface.py | from pyheufybot.message import IRCMessage
from pyheufybot.serverinfo import ServerInfo
from pyheufybot.heufybot import HeufyBot
class Module(object):
def __init__(self):
self.trigger = ""
self.messageTypes = []
self.helpText = "No help available for this module"
def excecute(self, mess... | Set up a proof of concept for the module API | Set up a proof of concept for the module API
| Python | mit | Heufneutje/PyHeufyBot,Heufneutje/PyHeufyBot | Set up a proof of concept for the module API | from pyheufybot.message import IRCMessage
from pyheufybot.serverinfo import ServerInfo
from pyheufybot.heufybot import HeufyBot
class Module(object):
def __init__(self):
self.trigger = ""
self.messageTypes = []
self.helpText = "No help available for this module"
def excecute(self, mess... | <commit_before><commit_msg>Set up a proof of concept for the module API<commit_after> | from pyheufybot.message import IRCMessage
from pyheufybot.serverinfo import ServerInfo
from pyheufybot.heufybot import HeufyBot
class Module(object):
def __init__(self):
self.trigger = ""
self.messageTypes = []
self.helpText = "No help available for this module"
def excecute(self, mess... | Set up a proof of concept for the module APIfrom pyheufybot.message import IRCMessage
from pyheufybot.serverinfo import ServerInfo
from pyheufybot.heufybot import HeufyBot
class Module(object):
def __init__(self):
self.trigger = ""
self.messageTypes = []
self.helpText = "No help available f... | <commit_before><commit_msg>Set up a proof of concept for the module API<commit_after>from pyheufybot.message import IRCMessage
from pyheufybot.serverinfo import ServerInfo
from pyheufybot.heufybot import HeufyBot
class Module(object):
def __init__(self):
self.trigger = ""
self.messageTypes = []
... | |
c5e370e2c226897c3a9863749f259a3735d2989a | apps/users/admin.py | apps/users/admin.py | from django.contrib import admin
from users.models import UserBan
class UserBanAdmin(admin.ModelAdmin):
fields = ('user', 'by', 'reason', 'is_active')
list_display = ('user', 'by', 'reason')
list_filter = ('is_active',)
raw_id_fields = ('user',)
search_fields = ('user__username', 'reason')
admi... | from django.contrib import admin
from users.models import UserBan
class UserBanAdmin(admin.ModelAdmin):
fields = ('user', 'by', 'reason', 'is_active')
list_display = ('user', 'by', 'reason')
list_filter = ('is_active', 'by')
raw_id_fields = ('user', 'by')
search_fields = ('user__username', 'reaso... | Add some more use of raw_id_fields for user bans, and more filter options. | Add some more use of raw_id_fields for user bans, and more filter options.
| Python | mpl-2.0 | surajssd/kuma,davidyezsetz/kuma,anaran/kuma,FrankBian/kuma,surajssd/kuma,a2sheppy/kuma,whip112/Whip112,darkwing/kuma,robhudson/kuma,bluemini/kuma,FrankBian/kuma,FrankBian/kuma,jgmize/kuma,chirilo/kuma,surajssd/kuma,darkwing/kuma,chirilo/kuma,yfdyh000/kuma,hoosteeno/kuma,openjck/kuma,utkbansal/kuma,varunkamra/kuma,anara... | from django.contrib import admin
from users.models import UserBan
class UserBanAdmin(admin.ModelAdmin):
fields = ('user', 'by', 'reason', 'is_active')
list_display = ('user', 'by', 'reason')
list_filter = ('is_active',)
raw_id_fields = ('user',)
search_fields = ('user__username', 'reason')
admi... | from django.contrib import admin
from users.models import UserBan
class UserBanAdmin(admin.ModelAdmin):
fields = ('user', 'by', 'reason', 'is_active')
list_display = ('user', 'by', 'reason')
list_filter = ('is_active', 'by')
raw_id_fields = ('user', 'by')
search_fields = ('user__username', 'reaso... | <commit_before>from django.contrib import admin
from users.models import UserBan
class UserBanAdmin(admin.ModelAdmin):
fields = ('user', 'by', 'reason', 'is_active')
list_display = ('user', 'by', 'reason')
list_filter = ('is_active',)
raw_id_fields = ('user',)
search_fields = ('user__username', '... | from django.contrib import admin
from users.models import UserBan
class UserBanAdmin(admin.ModelAdmin):
fields = ('user', 'by', 'reason', 'is_active')
list_display = ('user', 'by', 'reason')
list_filter = ('is_active', 'by')
raw_id_fields = ('user', 'by')
search_fields = ('user__username', 'reaso... | from django.contrib import admin
from users.models import UserBan
class UserBanAdmin(admin.ModelAdmin):
fields = ('user', 'by', 'reason', 'is_active')
list_display = ('user', 'by', 'reason')
list_filter = ('is_active',)
raw_id_fields = ('user',)
search_fields = ('user__username', 'reason')
admi... | <commit_before>from django.contrib import admin
from users.models import UserBan
class UserBanAdmin(admin.ModelAdmin):
fields = ('user', 'by', 'reason', 'is_active')
list_display = ('user', 'by', 'reason')
list_filter = ('is_active',)
raw_id_fields = ('user',)
search_fields = ('user__username', '... |
2c1ff4b06fb2e851231e27bccfea97a64e5659f5 | senlin/tests/test_common_serializers.py | senlin/tests/test_common_serializers.py | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed unde... | Test case for JSON serializer | Test case for JSON serializer
| Python | apache-2.0 | Alzon/senlin,stackforge/senlin,tengqm/senlin,tengqm/senlin-container,tengqm/senlin,openstack/senlin,Alzon/senlin,stackforge/senlin,tengqm/senlin-container,openstack/senlin,openstack/senlin | Test case for JSON serializer | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed unde... | <commit_before><commit_msg>Test case for JSON serializer<commit_after> | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed unde... | Test case for JSON serializer# 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>Test case for JSON serializer<commit_after># 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 ... | |
be8762886ae2157506f2960a42589ef3828f021e | numba/tests/test_itanium_mangler.py | numba/tests/test_itanium_mangler.py | from __future__ import print_function, absolute_import
from numba import unittest_support as unittest
from numba import itanium_mangler
from numba import int32, int64, uint32, uint64, float32, float64
from numba.types import range_iter32_type
class TestItaniumManager(unittest.TestCase):
def test_ident(self):
... | Add test for itanium mangler | Add test for itanium mangler
| Python | bsd-2-clause | stuartarchibald/numba,cpcloud/numba,GaZ3ll3/numba,seibert/numba,stefanseefeld/numba,cpcloud/numba,stonebig/numba,stefanseefeld/numba,ssarangi/numba,GaZ3ll3/numba,stefanseefeld/numba,jriehl/numba,gmarkall/numba,gmarkall/numba,sklam/numba,cpcloud/numba,IntelLabs/numba,numba/numba,IntelLabs/numba,ssarangi/numba,ssarangi/n... | Add test for itanium mangler | from __future__ import print_function, absolute_import
from numba import unittest_support as unittest
from numba import itanium_mangler
from numba import int32, int64, uint32, uint64, float32, float64
from numba.types import range_iter32_type
class TestItaniumManager(unittest.TestCase):
def test_ident(self):
... | <commit_before><commit_msg>Add test for itanium mangler<commit_after> | from __future__ import print_function, absolute_import
from numba import unittest_support as unittest
from numba import itanium_mangler
from numba import int32, int64, uint32, uint64, float32, float64
from numba.types import range_iter32_type
class TestItaniumManager(unittest.TestCase):
def test_ident(self):
... | Add test for itanium manglerfrom __future__ import print_function, absolute_import
from numba import unittest_support as unittest
from numba import itanium_mangler
from numba import int32, int64, uint32, uint64, float32, float64
from numba.types import range_iter32_type
class TestItaniumManager(unittest.TestCase):
... | <commit_before><commit_msg>Add test for itanium mangler<commit_after>from __future__ import print_function, absolute_import
from numba import unittest_support as unittest
from numba import itanium_mangler
from numba import int32, int64, uint32, uint64, float32, float64
from numba.types import range_iter32_type
class... | |
c8e70d820dde964361b804811d6ec15ef0ede10f | packaging/osx/trim.py | packaging/osx/trim.py | import shutil
import os
"""
Instructions
------------
# Build the app
# Look at the timestamps in the generated app directory
# Wait a bit
pushd pai/dist/Content/MacOS
# Find all the files that haven't been accessed since they were created
find . ! -atime -4m > unused.txt
# Don't remove any of the files that we kno... | Trim the package before it is turned into a .dmg file | Trim the package before it is turned into a .dmg file
| Python | mit | cropleyb/pentai,cropleyb/pentai,cropleyb/pentai | Trim the package before it is turned into a .dmg file | import shutil
import os
"""
Instructions
------------
# Build the app
# Look at the timestamps in the generated app directory
# Wait a bit
pushd pai/dist/Content/MacOS
# Find all the files that haven't been accessed since they were created
find . ! -atime -4m > unused.txt
# Don't remove any of the files that we kno... | <commit_before><commit_msg>Trim the package before it is turned into a .dmg file<commit_after> | import shutil
import os
"""
Instructions
------------
# Build the app
# Look at the timestamps in the generated app directory
# Wait a bit
pushd pai/dist/Content/MacOS
# Find all the files that haven't been accessed since they were created
find . ! -atime -4m > unused.txt
# Don't remove any of the files that we kno... | Trim the package before it is turned into a .dmg fileimport shutil
import os
"""
Instructions
------------
# Build the app
# Look at the timestamps in the generated app directory
# Wait a bit
pushd pai/dist/Content/MacOS
# Find all the files that haven't been accessed since they were created
find . ! -atime -4m > un... | <commit_before><commit_msg>Trim the package before it is turned into a .dmg file<commit_after>import shutil
import os
"""
Instructions
------------
# Build the app
# Look at the timestamps in the generated app directory
# Wait a bit
pushd pai/dist/Content/MacOS
# Find all the files that haven't been accessed since t... | |
64ccc46c9b48346aee20bf99f4ff0a3862947f70 | syutil/crypto/signing_key.py | syutil/crypto/signing_key.py | from syutil.base64util import encode_base64, decode_base64
import nacl.signing
NACL_ED25519 = "ed25519"
def generate_singing_key(version):
"""Generate a new signing key
Args:
version (str): Identifies this key out the keys for this entity.
Returns:
A SigningKey object.
"""
key = na... | Add utils for generating, reading and writing signing keys | Add utils for generating, reading and writing signing keys
| Python | apache-2.0 | matrix-org/syutil | Add utils for generating, reading and writing signing keys | from syutil.base64util import encode_base64, decode_base64
import nacl.signing
NACL_ED25519 = "ed25519"
def generate_singing_key(version):
"""Generate a new signing key
Args:
version (str): Identifies this key out the keys for this entity.
Returns:
A SigningKey object.
"""
key = na... | <commit_before><commit_msg>Add utils for generating, reading and writing signing keys<commit_after> | from syutil.base64util import encode_base64, decode_base64
import nacl.signing
NACL_ED25519 = "ed25519"
def generate_singing_key(version):
"""Generate a new signing key
Args:
version (str): Identifies this key out the keys for this entity.
Returns:
A SigningKey object.
"""
key = na... | Add utils for generating, reading and writing signing keysfrom syutil.base64util import encode_base64, decode_base64
import nacl.signing
NACL_ED25519 = "ed25519"
def generate_singing_key(version):
"""Generate a new signing key
Args:
version (str): Identifies this key out the keys for this entity.
... | <commit_before><commit_msg>Add utils for generating, reading and writing signing keys<commit_after>from syutil.base64util import encode_base64, decode_base64
import nacl.signing
NACL_ED25519 = "ed25519"
def generate_singing_key(version):
"""Generate a new signing key
Args:
version (str): Identifies th... | |
a97b70874144b0fc2ae1a794951729ef07d87c77 | set1/challenge-1.py | set1/challenge-1.py | import base64
def hex_to_base64(hex_string):
return base64.b64encode(base64.b16decode(hex_string, True))
if __name__ == '__main__':
hex_string = raw_input("> ")
print hex_to_base64(hex_string)
| Add solution to challenge 1. | Add solution to challenge 1.
| Python | mit | ericnorris/cryptopals-solutions | Add solution to challenge 1. | import base64
def hex_to_base64(hex_string):
return base64.b64encode(base64.b16decode(hex_string, True))
if __name__ == '__main__':
hex_string = raw_input("> ")
print hex_to_base64(hex_string)
| <commit_before><commit_msg>Add solution to challenge 1.<commit_after> | import base64
def hex_to_base64(hex_string):
return base64.b64encode(base64.b16decode(hex_string, True))
if __name__ == '__main__':
hex_string = raw_input("> ")
print hex_to_base64(hex_string)
| Add solution to challenge 1.import base64
def hex_to_base64(hex_string):
return base64.b64encode(base64.b16decode(hex_string, True))
if __name__ == '__main__':
hex_string = raw_input("> ")
print hex_to_base64(hex_string)
| <commit_before><commit_msg>Add solution to challenge 1.<commit_after>import base64
def hex_to_base64(hex_string):
return base64.b64encode(base64.b16decode(hex_string, True))
if __name__ == '__main__':
hex_string = raw_input("> ")
print hex_to_base64(hex_string)
| |
d1436ac95bfa1276b49fb2f7a5d7139fda622af4 | scripts/smoke-test.py | scripts/smoke-test.py | #!/usr/bin/env python
import sys
import urllib2
USER_AGENTS={
# iPhone 3 - gets smart styling
'smart': 'Mozilla/5.0 (iPhone; U; CPU iPhone OS 3_0 like Mac OS X; en-us) AppleWebKit/528.18 (KHTML, like Gecko) Version/4.0 Mobile/7A341 Safari/528.16',
# iPaq - gets dumb styling
'dumb': 'Mozilla/... | Add a smoke testing script (incomplete) | Add a smoke testing script (incomplete)
| Python | apache-2.0 | mollyproject/mollyproject,mollyproject/mollyproject,mollyproject/mollyproject | Add a smoke testing script (incomplete) | #!/usr/bin/env python
import sys
import urllib2
USER_AGENTS={
# iPhone 3 - gets smart styling
'smart': 'Mozilla/5.0 (iPhone; U; CPU iPhone OS 3_0 like Mac OS X; en-us) AppleWebKit/528.18 (KHTML, like Gecko) Version/4.0 Mobile/7A341 Safari/528.16',
# iPaq - gets dumb styling
'dumb': 'Mozilla/... | <commit_before><commit_msg>Add a smoke testing script (incomplete)<commit_after> | #!/usr/bin/env python
import sys
import urllib2
USER_AGENTS={
# iPhone 3 - gets smart styling
'smart': 'Mozilla/5.0 (iPhone; U; CPU iPhone OS 3_0 like Mac OS X; en-us) AppleWebKit/528.18 (KHTML, like Gecko) Version/4.0 Mobile/7A341 Safari/528.16',
# iPaq - gets dumb styling
'dumb': 'Mozilla/... | Add a smoke testing script (incomplete)#!/usr/bin/env python
import sys
import urllib2
USER_AGENTS={
# iPhone 3 - gets smart styling
'smart': 'Mozilla/5.0 (iPhone; U; CPU iPhone OS 3_0 like Mac OS X; en-us) AppleWebKit/528.18 (KHTML, like Gecko) Version/4.0 Mobile/7A341 Safari/528.16',
# iPaq - ... | <commit_before><commit_msg>Add a smoke testing script (incomplete)<commit_after>#!/usr/bin/env python
import sys
import urllib2
USER_AGENTS={
# iPhone 3 - gets smart styling
'smart': 'Mozilla/5.0 (iPhone; U; CPU iPhone OS 3_0 like Mac OS X; en-us) AppleWebKit/528.18 (KHTML, like Gecko) Version/4.0 Mobile... | |
8420a10364176f1b5fbb15774f72497b55b44d81 | flaskapp/tests/test_getters_setters.py | flaskapp/tests/test_getters_setters.py | import pytest
from appname.models import db, Tag
@pytest.mark.usefixtures("testapp")
class TestModels:
def test_Tag(self, testapp):
t = Tag('tagName')
assert t.namex == 'tagName'
t.namex = 'blah'
assert t.namex == 'blah'
assert t.idx == t.id
| Add get/set for Tags, and test | Add get/set for Tags, and test
| Python | bsd-3-clause | ikinsella/squall,ikinsella/squall,ikinsella/squall,ikinsella/squall | Add get/set for Tags, and test | import pytest
from appname.models import db, Tag
@pytest.mark.usefixtures("testapp")
class TestModels:
def test_Tag(self, testapp):
t = Tag('tagName')
assert t.namex == 'tagName'
t.namex = 'blah'
assert t.namex == 'blah'
assert t.idx == t.id
| <commit_before><commit_msg>Add get/set for Tags, and test<commit_after> | import pytest
from appname.models import db, Tag
@pytest.mark.usefixtures("testapp")
class TestModels:
def test_Tag(self, testapp):
t = Tag('tagName')
assert t.namex == 'tagName'
t.namex = 'blah'
assert t.namex == 'blah'
assert t.idx == t.id
| Add get/set for Tags, and testimport pytest
from appname.models import db, Tag
@pytest.mark.usefixtures("testapp")
class TestModels:
def test_Tag(self, testapp):
t = Tag('tagName')
assert t.namex == 'tagName'
t.namex = 'blah'
assert t.namex == 'blah'
assert t.idx == t.id
| <commit_before><commit_msg>Add get/set for Tags, and test<commit_after>import pytest
from appname.models import db, Tag
@pytest.mark.usefixtures("testapp")
class TestModels:
def test_Tag(self, testapp):
t = Tag('tagName')
assert t.namex == 'tagName'
t.namex = 'blah'
assert t.namex == 'blah'
assert t.idx =... | |
7268e528a39dafb28fe31e36b54af79b6fed4f93 | py/test/unit/selenium/webdriver/wpewebkit/wpewebkit_options_tests.py | py/test/unit/selenium/webdriver/wpewebkit/wpewebkit_options_tests.py | # Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | Add WPEWebKit options test case | [py] Add WPEWebKit options test case
| Python | apache-2.0 | joshmgrant/selenium,valfirst/selenium,SeleniumHQ/selenium,joshmgrant/selenium,Ardesco/selenium,titusfortner/selenium,valfirst/selenium,SeleniumHQ/selenium,titusfortner/selenium,HtmlUnit/selenium,HtmlUnit/selenium,SeleniumHQ/selenium,SeleniumHQ/selenium,joshmgrant/selenium,valfirst/selenium,SeleniumHQ/selenium,HtmlUnit/... | [py] Add WPEWebKit options test case | # Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | <commit_before><commit_msg>[py] Add WPEWebKit options test case<commit_after> | # Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | [py] Add WPEWebKit options test case# Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Versio... | <commit_before><commit_msg>[py] Add WPEWebKit options test case<commit_after># Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
... | |
79578c3ad23dfba9ffc1a15015cf6718c067b03a | perspective_reddit_bot/get_top_subreddits.py | perspective_reddit_bot/get_top_subreddits.py | """Small tool for scraping http://redditlist.com/"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import sys
from bs4 import BeautifulSoup
import requests
# Only getting SFW subreddits.
BASE = 'http://redditlist.com/sfw?page='
def fetch_page(page_n... | Add script for getting top subreddits. | Add script for getting top subreddits.
| Python | apache-2.0 | conversationai/conversationai-moderator-reddit,conversationai/conversationai-moderator-reddit,conversationai/conversationai-moderator-reddit,conversationai/conversationai-moderator-reddit | Add script for getting top subreddits. | """Small tool for scraping http://redditlist.com/"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import sys
from bs4 import BeautifulSoup
import requests
# Only getting SFW subreddits.
BASE = 'http://redditlist.com/sfw?page='
def fetch_page(page_n... | <commit_before><commit_msg>Add script for getting top subreddits.<commit_after> | """Small tool for scraping http://redditlist.com/"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import sys
from bs4 import BeautifulSoup
import requests
# Only getting SFW subreddits.
BASE = 'http://redditlist.com/sfw?page='
def fetch_page(page_n... | Add script for getting top subreddits."""Small tool for scraping http://redditlist.com/"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import sys
from bs4 import BeautifulSoup
import requests
# Only getting SFW subreddits.
BASE = 'http://redditlist.... | <commit_before><commit_msg>Add script for getting top subreddits.<commit_after>"""Small tool for scraping http://redditlist.com/"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import sys
from bs4 import BeautifulSoup
import requests
# Only getting S... | |
f01c3d82a5db95a7723232edfa4a5437f0d992cf | tf_agents/experimental/distributed/__init__.py | tf_agents/experimental/distributed/__init__.py | # coding=utf-8
# Copyright 2018 The TF-Agents Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | Add reverb_variable_container as a module. | Add reverb_variable_container as a module.
PiperOrigin-RevId: 332960465
Change-Id: I5ab58ad8529db359891f3296274176a002791436
| Python | apache-2.0 | tensorflow/agents,tensorflow/agents | Add reverb_variable_container as a module.
PiperOrigin-RevId: 332960465
Change-Id: I5ab58ad8529db359891f3296274176a002791436 | # coding=utf-8
# Copyright 2018 The TF-Agents Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | <commit_before><commit_msg>Add reverb_variable_container as a module.
PiperOrigin-RevId: 332960465
Change-Id: I5ab58ad8529db359891f3296274176a002791436<commit_after> | # coding=utf-8
# Copyright 2018 The TF-Agents Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | Add reverb_variable_container as a module.
PiperOrigin-RevId: 332960465
Change-Id: I5ab58ad8529db359891f3296274176a002791436# coding=utf-8
# Copyright 2018 The TF-Agents Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You... | <commit_before><commit_msg>Add reverb_variable_container as a module.
PiperOrigin-RevId: 332960465
Change-Id: I5ab58ad8529db359891f3296274176a002791436<commit_after># coding=utf-8
# Copyright 2018 The TF-Agents Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file exc... | |
bec56f40e6ed8114b34363383787507a64aead79 | ReadResults.py | ReadResults.py |
def read(filename):
f = open(filename)
line = f.readline()
print(line)
folds_res = line.split(',')
f.close()
return folds_res[1:11]
for i in range(1, 13):
filename = 'output/psl/auc_all_all_dataset' + str(i) + '.txt'
folds_res = read(filename)
lines = []
write_line = ''
f... | Read results and write to a txt file | Read results and write to a txt file
| Python | mit | HaoboGu/Structure-Similarity | Read results and write to a txt file |
def read(filename):
f = open(filename)
line = f.readline()
print(line)
folds_res = line.split(',')
f.close()
return folds_res[1:11]
for i in range(1, 13):
filename = 'output/psl/auc_all_all_dataset' + str(i) + '.txt'
folds_res = read(filename)
lines = []
write_line = ''
f... | <commit_before><commit_msg>Read results and write to a txt file<commit_after> |
def read(filename):
f = open(filename)
line = f.readline()
print(line)
folds_res = line.split(',')
f.close()
return folds_res[1:11]
for i in range(1, 13):
filename = 'output/psl/auc_all_all_dataset' + str(i) + '.txt'
folds_res = read(filename)
lines = []
write_line = ''
f... | Read results and write to a txt file
def read(filename):
f = open(filename)
line = f.readline()
print(line)
folds_res = line.split(',')
f.close()
return folds_res[1:11]
for i in range(1, 13):
filename = 'output/psl/auc_all_all_dataset' + str(i) + '.txt'
folds_res = read(filename)
... | <commit_before><commit_msg>Read results and write to a txt file<commit_after>
def read(filename):
f = open(filename)
line = f.readline()
print(line)
folds_res = line.split(',')
f.close()
return folds_res[1:11]
for i in range(1, 13):
filename = 'output/psl/auc_all_all_dataset' + str(i) + '.... | |
6ccccd125f3ca438b15903a1153d19d4bb869a4f | unittests/test_logging.py | unittests/test_logging.py | pytest_plugins = "logwatch"
def test_logwatch_source(testdir):
testdir.makeconftest("""
import mock
import pytest
pytest_plugins = 'logwatch'
mocksource = mock.Mock()
mocksource.capture = mock.Mock(
return_value=[('test_logwatch.txt', 'Error: This is a test er... | Add a simple unittest for logging support | Add a simple unittest for logging support
| Python | mpl-2.0 | sangoma/pytestlab | Add a simple unittest for logging support | pytest_plugins = "logwatch"
def test_logwatch_source(testdir):
testdir.makeconftest("""
import mock
import pytest
pytest_plugins = 'logwatch'
mocksource = mock.Mock()
mocksource.capture = mock.Mock(
return_value=[('test_logwatch.txt', 'Error: This is a test er... | <commit_before><commit_msg>Add a simple unittest for logging support<commit_after> | pytest_plugins = "logwatch"
def test_logwatch_source(testdir):
testdir.makeconftest("""
import mock
import pytest
pytest_plugins = 'logwatch'
mocksource = mock.Mock()
mocksource.capture = mock.Mock(
return_value=[('test_logwatch.txt', 'Error: This is a test er... | Add a simple unittest for logging supportpytest_plugins = "logwatch"
def test_logwatch_source(testdir):
testdir.makeconftest("""
import mock
import pytest
pytest_plugins = 'logwatch'
mocksource = mock.Mock()
mocksource.capture = mock.Mock(
return_value=[('test... | <commit_before><commit_msg>Add a simple unittest for logging support<commit_after>pytest_plugins = "logwatch"
def test_logwatch_source(testdir):
testdir.makeconftest("""
import mock
import pytest
pytest_plugins = 'logwatch'
mocksource = mock.Mock()
mocksource.capture = mo... | |
c6523a03f5a000a5b04724e8750fc1b19d1dc13d | scripts/message_prs_in_range.py | scripts/message_prs_in_range.py | """
Command-line script message pull requests in a range
"""
from os import path
import sys
import logging
import click
# Add top-level module path to sys.path before importing tubular code.
sys.path.append(path.dirname(path.dirname(path.abspath(__file__))))
from tubular.github_api import GitHubAPI # pylint: disable... | Add script to message PRs in a range | Add script to message PRs in a range
| Python | agpl-3.0 | eltoncarr/tubular,eltoncarr/tubular | Add script to message PRs in a range | """
Command-line script message pull requests in a range
"""
from os import path
import sys
import logging
import click
# Add top-level module path to sys.path before importing tubular code.
sys.path.append(path.dirname(path.dirname(path.abspath(__file__))))
from tubular.github_api import GitHubAPI # pylint: disable... | <commit_before><commit_msg>Add script to message PRs in a range<commit_after> | """
Command-line script message pull requests in a range
"""
from os import path
import sys
import logging
import click
# Add top-level module path to sys.path before importing tubular code.
sys.path.append(path.dirname(path.dirname(path.abspath(__file__))))
from tubular.github_api import GitHubAPI # pylint: disable... | Add script to message PRs in a range"""
Command-line script message pull requests in a range
"""
from os import path
import sys
import logging
import click
# Add top-level module path to sys.path before importing tubular code.
sys.path.append(path.dirname(path.dirname(path.abspath(__file__))))
from tubular.github_api... | <commit_before><commit_msg>Add script to message PRs in a range<commit_after>"""
Command-line script message pull requests in a range
"""
from os import path
import sys
import logging
import click
# Add top-level module path to sys.path before importing tubular code.
sys.path.append(path.dirname(path.dirname(path.absp... | |
13f271c7d6d259e8a478657fa05822f9584090c4 | tests/keras/utils/generic_utils_test.py | tests/keras/utils/generic_utils_test.py | import pytest
from keras.utils.generic_utils import custom_object_scope
from keras import activations
from keras import regularizers
def test_custom_objects_scope():
def custom_fn():
pass
class CustomClass(object):
pass
with custom_object_scope({'CustomClass': CustomClass,
... | Add unit test for custom objects scope. | Add unit test for custom objects scope. | Python | apache-2.0 | keras-team/keras,keras-team/keras | Add unit test for custom objects scope. | import pytest
from keras.utils.generic_utils import custom_object_scope
from keras import activations
from keras import regularizers
def test_custom_objects_scope():
def custom_fn():
pass
class CustomClass(object):
pass
with custom_object_scope({'CustomClass': CustomClass,
... | <commit_before><commit_msg>Add unit test for custom objects scope.<commit_after> | import pytest
from keras.utils.generic_utils import custom_object_scope
from keras import activations
from keras import regularizers
def test_custom_objects_scope():
def custom_fn():
pass
class CustomClass(object):
pass
with custom_object_scope({'CustomClass': CustomClass,
... | Add unit test for custom objects scope.import pytest
from keras.utils.generic_utils import custom_object_scope
from keras import activations
from keras import regularizers
def test_custom_objects_scope():
def custom_fn():
pass
class CustomClass(object):
pass
with custom_object_scope({'C... | <commit_before><commit_msg>Add unit test for custom objects scope.<commit_after>import pytest
from keras.utils.generic_utils import custom_object_scope
from keras import activations
from keras import regularizers
def test_custom_objects_scope():
def custom_fn():
pass
class CustomClass(object):
... | |
2d59af0c67eecf95c00c36cf93e1d563a489b390 | contentcuration/contentcuration/migrations/0091_auto_20180724_2243.py | contentcuration/contentcuration/migrations/0091_auto_20180724_2243.py | # -*- coding: utf-8 -*-
# Generated by Django 1.9.13 on 2018-07-24 22:43
from __future__ import unicode_literals
import django.contrib.postgres.fields.jsonb
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('contentcuration', '0090_auto_20180724_1625'),
]
... | Add migration for content defaults. | Add migration for content defaults.
| Python | mit | jayoshih/content-curation,fle-internal/content-curation,DXCanas/content-curation,jayoshih/content-curation,jayoshih/content-curation,DXCanas/content-curation,fle-internal/content-curation,DXCanas/content-curation,fle-internal/content-curation,fle-internal/content-curation,jayoshih/content-curation,DXCanas/content-curat... | Add migration for content defaults. | # -*- coding: utf-8 -*-
# Generated by Django 1.9.13 on 2018-07-24 22:43
from __future__ import unicode_literals
import django.contrib.postgres.fields.jsonb
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('contentcuration', '0090_auto_20180724_1625'),
]
... | <commit_before><commit_msg>Add migration for content defaults.<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.9.13 on 2018-07-24 22:43
from __future__ import unicode_literals
import django.contrib.postgres.fields.jsonb
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('contentcuration', '0090_auto_20180724_1625'),
]
... | Add migration for content defaults.# -*- coding: utf-8 -*-
# Generated by Django 1.9.13 on 2018-07-24 22:43
from __future__ import unicode_literals
import django.contrib.postgres.fields.jsonb
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('contentcuration', '00... | <commit_before><commit_msg>Add migration for content defaults.<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.9.13 on 2018-07-24 22:43
from __future__ import unicode_literals
import django.contrib.postgres.fields.jsonb
from django.db import migrations
class Migration(migrations.Migration):
depende... | |
06830b84693bb79375d61883f087dab503538709 | apps/jobs/cms_app.py | apps/jobs/cms_app.py | from cms.app_base import CMSApp
from cms.apphook_pool import apphook_pool
from django.utils.translation import ugettext_lazy as _
class JobsAppHook(CMSApp):
name = _("Jobs")
urls = ["apps.jobs.urls"]
apphook_pool.register(JobsAppHook)
| Allow app to be bound to CMS pages | Allow app to be bound to CMS pages
| Python | mit | MjAbuz/foundation,okfn/foundation,okfn/website,MjAbuz/foundation,MjAbuz/foundation,MjAbuz/foundation,okfn/foundation,okfn/website,okfn/foundation,okfn/website,okfn/website,okfn/foundation | Allow app to be bound to CMS pages | from cms.app_base import CMSApp
from cms.apphook_pool import apphook_pool
from django.utils.translation import ugettext_lazy as _
class JobsAppHook(CMSApp):
name = _("Jobs")
urls = ["apps.jobs.urls"]
apphook_pool.register(JobsAppHook)
| <commit_before><commit_msg>Allow app to be bound to CMS pages<commit_after> | from cms.app_base import CMSApp
from cms.apphook_pool import apphook_pool
from django.utils.translation import ugettext_lazy as _
class JobsAppHook(CMSApp):
name = _("Jobs")
urls = ["apps.jobs.urls"]
apphook_pool.register(JobsAppHook)
| Allow app to be bound to CMS pagesfrom cms.app_base import CMSApp
from cms.apphook_pool import apphook_pool
from django.utils.translation import ugettext_lazy as _
class JobsAppHook(CMSApp):
name = _("Jobs")
urls = ["apps.jobs.urls"]
apphook_pool.register(JobsAppHook)
| <commit_before><commit_msg>Allow app to be bound to CMS pages<commit_after>from cms.app_base import CMSApp
from cms.apphook_pool import apphook_pool
from django.utils.translation import ugettext_lazy as _
class JobsAppHook(CMSApp):
name = _("Jobs")
urls = ["apps.jobs.urls"]
apphook_pool.register(JobsAppHook)
| |
b4e3a38910202d077c21bff53febe07001c7848b | exercises/chapter_15/exercise_15_01/exercise_15_01.py | exercises/chapter_15/exercise_15_01/exercise_15_01.py | # 15-1. Cubes
import matplotlib.pyplot as plt
def plot_cubes(min_x, max_x):
"""Plots the cube of range of numbers"""
x_values = list(range(min_x, max_x))
y_values = [x**3 for x in x_values]
plt.scatter(x_values, y_values, s = 40)
plt.show()
start_x = 1
stop_x = 6
plot_cubes(start_x, stop_x)
start_x = 1
stop_x... | Add solution to exercise 15.1. | Add solution to exercise 15.1.
| Python | mit | HenrikSamuelsson/python-crash-course | Add solution to exercise 15.1. | # 15-1. Cubes
import matplotlib.pyplot as plt
def plot_cubes(min_x, max_x):
"""Plots the cube of range of numbers"""
x_values = list(range(min_x, max_x))
y_values = [x**3 for x in x_values]
plt.scatter(x_values, y_values, s = 40)
plt.show()
start_x = 1
stop_x = 6
plot_cubes(start_x, stop_x)
start_x = 1
stop_x... | <commit_before><commit_msg>Add solution to exercise 15.1.<commit_after> | # 15-1. Cubes
import matplotlib.pyplot as plt
def plot_cubes(min_x, max_x):
"""Plots the cube of range of numbers"""
x_values = list(range(min_x, max_x))
y_values = [x**3 for x in x_values]
plt.scatter(x_values, y_values, s = 40)
plt.show()
start_x = 1
stop_x = 6
plot_cubes(start_x, stop_x)
start_x = 1
stop_x... | Add solution to exercise 15.1.# 15-1. Cubes
import matplotlib.pyplot as plt
def plot_cubes(min_x, max_x):
"""Plots the cube of range of numbers"""
x_values = list(range(min_x, max_x))
y_values = [x**3 for x in x_values]
plt.scatter(x_values, y_values, s = 40)
plt.show()
start_x = 1
stop_x = 6
plot_cubes(start_... | <commit_before><commit_msg>Add solution to exercise 15.1.<commit_after># 15-1. Cubes
import matplotlib.pyplot as plt
def plot_cubes(min_x, max_x):
"""Plots the cube of range of numbers"""
x_values = list(range(min_x, max_x))
y_values = [x**3 for x in x_values]
plt.scatter(x_values, y_values, s = 40)
plt.show()
... | |
91242064c3e98d28ec05662dd0fddfc0fadecad5 | Communication/tcpClient.py | Communication/tcpClient.py | #!/usr/bin/env python
# This script was read data from a serial port forwarded to tcp with
# socat with the following command:
# sudo socat tcp-l:1234,reuseaddr,fork file:/dev/ttyACM0,nonblock,raw,echo=0,waitlock=/var/run/ttyACM0.lock,b9600
import socket
TCP_IP = '127.0.0.1'
TCP_PORT = 1234
BUFFER_SIZE = 1024
s = so... | Add a tcp client to read from tcp | Add a tcp client to read from tcp
| Python | mit | baptistelabat/robokite,baptistelabat/robokite,baptistelabat/robokite,baptistelabat/robokite,baptistelabat/robokite,baptistelabat/robokite,baptistelabat/robokite,baptistelabat/robokite | Add a tcp client to read from tcp | #!/usr/bin/env python
# This script was read data from a serial port forwarded to tcp with
# socat with the following command:
# sudo socat tcp-l:1234,reuseaddr,fork file:/dev/ttyACM0,nonblock,raw,echo=0,waitlock=/var/run/ttyACM0.lock,b9600
import socket
TCP_IP = '127.0.0.1'
TCP_PORT = 1234
BUFFER_SIZE = 1024
s = so... | <commit_before><commit_msg>Add a tcp client to read from tcp<commit_after> | #!/usr/bin/env python
# This script was read data from a serial port forwarded to tcp with
# socat with the following command:
# sudo socat tcp-l:1234,reuseaddr,fork file:/dev/ttyACM0,nonblock,raw,echo=0,waitlock=/var/run/ttyACM0.lock,b9600
import socket
TCP_IP = '127.0.0.1'
TCP_PORT = 1234
BUFFER_SIZE = 1024
s = so... | Add a tcp client to read from tcp#!/usr/bin/env python
# This script was read data from a serial port forwarded to tcp with
# socat with the following command:
# sudo socat tcp-l:1234,reuseaddr,fork file:/dev/ttyACM0,nonblock,raw,echo=0,waitlock=/var/run/ttyACM0.lock,b9600
import socket
TCP_IP = '127.0.0.1'
TCP_PORT ... | <commit_before><commit_msg>Add a tcp client to read from tcp<commit_after>#!/usr/bin/env python
# This script was read data from a serial port forwarded to tcp with
# socat with the following command:
# sudo socat tcp-l:1234,reuseaddr,fork file:/dev/ttyACM0,nonblock,raw,echo=0,waitlock=/var/run/ttyACM0.lock,b9600
impo... | |
faf35e328ffbea9d0a391b16a2aa8bb60589bce8 | altair/examples/scatter_alternate_axes_scale.py | altair/examples/scatter_alternate_axes_scale.py | """
Scatter Plots with alternate Y axis scale
---------------------------------
A few examples that make use of alternate Y axis scales.
"""
# category: simple charts
import altair as alt
import numpy as np
import pandas as pd
chart_df = pd.DataFrame(
{
'x': list(range(0,20)),
'y': [2** x for x in... | Add example for alternate axes scale. | Add example for alternate axes scale.
| Python | bsd-3-clause | jakevdp/altair,altair-viz/altair | Add example for alternate axes scale. | """
Scatter Plots with alternate Y axis scale
---------------------------------
A few examples that make use of alternate Y axis scales.
"""
# category: simple charts
import altair as alt
import numpy as np
import pandas as pd
chart_df = pd.DataFrame(
{
'x': list(range(0,20)),
'y': [2** x for x in... | <commit_before><commit_msg>Add example for alternate axes scale.<commit_after> | """
Scatter Plots with alternate Y axis scale
---------------------------------
A few examples that make use of alternate Y axis scales.
"""
# category: simple charts
import altair as alt
import numpy as np
import pandas as pd
chart_df = pd.DataFrame(
{
'x': list(range(0,20)),
'y': [2** x for x in... | Add example for alternate axes scale."""
Scatter Plots with alternate Y axis scale
---------------------------------
A few examples that make use of alternate Y axis scales.
"""
# category: simple charts
import altair as alt
import numpy as np
import pandas as pd
chart_df = pd.DataFrame(
{
'x': list(range... | <commit_before><commit_msg>Add example for alternate axes scale.<commit_after>"""
Scatter Plots with alternate Y axis scale
---------------------------------
A few examples that make use of alternate Y axis scales.
"""
# category: simple charts
import altair as alt
import numpy as np
import pandas as pd
chart_df = pd... | |
9ed1ee608b132f618358e2d16829c431ff46bd9b | mysite/search/tests.py | mysite/search/tests.py | import django.test
from search.models import Project
class NonJavascriptSearch(django.test.TestCase):
fixtures = ['bugs-for-two-projects.json']
def testSearch(self):
response = self.client.get('/search/')
for n in range(1, 11):
self.assertContains(response, 'Title #%d' % n)
... | import django.test
from search.models import Project
class NonJavascriptSearch(django.test.TestCase):
fixtures = ['bugs-for-two-projects.json']
def testSearch(self):
response = self.client.get('/search/')
for n in range(1, 11):
self.assertContains(response, 'Title #%d' % n)
... | Add a failing test (for a usability issue) | Add a failing test (for a usability issue)
| Python | agpl-3.0 | moijes12/oh-mainline,willingc/oh-mainline,sudheesh001/oh-mainline,campbe13/openhatch,vipul-sharma20/oh-mainline,nirmeshk/oh-mainline,SnappleCap/oh-mainline,onceuponatimeforever/oh-mainline,onceuponatimeforever/oh-mainline,onceuponatimeforever/oh-mainline,vipul-sharma20/oh-mainline,openhatch/oh-mainline,jledbetter/openh... | import django.test
from search.models import Project
class NonJavascriptSearch(django.test.TestCase):
fixtures = ['bugs-for-two-projects.json']
def testSearch(self):
response = self.client.get('/search/')
for n in range(1, 11):
self.assertContains(response, 'Title #%d' % n)
... | import django.test
from search.models import Project
class NonJavascriptSearch(django.test.TestCase):
fixtures = ['bugs-for-two-projects.json']
def testSearch(self):
response = self.client.get('/search/')
for n in range(1, 11):
self.assertContains(response, 'Title #%d' % n)
... | <commit_before>import django.test
from search.models import Project
class NonJavascriptSearch(django.test.TestCase):
fixtures = ['bugs-for-two-projects.json']
def testSearch(self):
response = self.client.get('/search/')
for n in range(1, 11):
self.assertContains(response, 'Title #%... | import django.test
from search.models import Project
class NonJavascriptSearch(django.test.TestCase):
fixtures = ['bugs-for-two-projects.json']
def testSearch(self):
response = self.client.get('/search/')
for n in range(1, 11):
self.assertContains(response, 'Title #%d' % n)
... | import django.test
from search.models import Project
class NonJavascriptSearch(django.test.TestCase):
fixtures = ['bugs-for-two-projects.json']
def testSearch(self):
response = self.client.get('/search/')
for n in range(1, 11):
self.assertContains(response, 'Title #%d' % n)
... | <commit_before>import django.test
from search.models import Project
class NonJavascriptSearch(django.test.TestCase):
fixtures = ['bugs-for-two-projects.json']
def testSearch(self):
response = self.client.get('/search/')
for n in range(1, 11):
self.assertContains(response, 'Title #%... |
be9c03b7903c1493fd7dc2721aa676d2b6c8ae31 | bin/stock_dashboard.py | bin/stock_dashboard.py | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
from __future__ import print_function
from grs import RealtimeTWSE
def main():
stock = RealtimeTWSE('0050')
data = stock.data['0050']
print("{0} {1}".format(
data['info']['name'].encode('utf-8'),
data['price']))
if __name__ == "__main__":
... | Add script to display stock for conky. | Add script to display stock for conky.
| Python | apache-2.0 | elleryq/oh-my-home,elleryq/oh-my-home,elleryq/oh-my-home | Add script to display stock for conky. | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
from __future__ import print_function
from grs import RealtimeTWSE
def main():
stock = RealtimeTWSE('0050')
data = stock.data['0050']
print("{0} {1}".format(
data['info']['name'].encode('utf-8'),
data['price']))
if __name__ == "__main__":
... | <commit_before><commit_msg>Add script to display stock for conky.<commit_after> | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
from __future__ import print_function
from grs import RealtimeTWSE
def main():
stock = RealtimeTWSE('0050')
data = stock.data['0050']
print("{0} {1}".format(
data['info']['name'].encode('utf-8'),
data['price']))
if __name__ == "__main__":
... | Add script to display stock for conky.#!/usr/bin/env python
# -*- encoding: utf-8 -*-
from __future__ import print_function
from grs import RealtimeTWSE
def main():
stock = RealtimeTWSE('0050')
data = stock.data['0050']
print("{0} {1}".format(
data['info']['name'].encode('utf-8'),
data['pri... | <commit_before><commit_msg>Add script to display stock for conky.<commit_after>#!/usr/bin/env python
# -*- encoding: utf-8 -*-
from __future__ import print_function
from grs import RealtimeTWSE
def main():
stock = RealtimeTWSE('0050')
data = stock.data['0050']
print("{0} {1}".format(
data['info']['... | |
1d028effaded2094d2dbc16b4c5aa04af13b55a7 | lava_scheduler_app/migrations/0013_auto_20160302_0404.py | lava_scheduler_app/migrations/0013_auto_20160302_0404.py | # -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2016-03-02 04:04
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('lava_scheduler_app', '0012_auto_20160208_1600'),
]
operations = [
migrations... | Add missing migration w.r.t. health check frequency. | Add missing migration w.r.t. health check frequency.
Change-Id: Ic6a40780bfe73245593fcb5f8cfbb8a6eb4d8dd6
| Python | agpl-3.0 | Linaro/lava-server,Linaro/lava-server,Linaro/lava-server,Linaro/lava-server | Add missing migration w.r.t. health check frequency.
Change-Id: Ic6a40780bfe73245593fcb5f8cfbb8a6eb4d8dd6 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2016-03-02 04:04
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('lava_scheduler_app', '0012_auto_20160208_1600'),
]
operations = [
migrations... | <commit_before><commit_msg>Add missing migration w.r.t. health check frequency.
Change-Id: Ic6a40780bfe73245593fcb5f8cfbb8a6eb4d8dd6<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2016-03-02 04:04
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('lava_scheduler_app', '0012_auto_20160208_1600'),
]
operations = [
migrations... | Add missing migration w.r.t. health check frequency.
Change-Id: Ic6a40780bfe73245593fcb5f8cfbb8a6eb4d8dd6# -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2016-03-02 04:04
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies =... | <commit_before><commit_msg>Add missing migration w.r.t. health check frequency.
Change-Id: Ic6a40780bfe73245593fcb5f8cfbb8a6eb4d8dd6<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2016-03-02 04:04
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(m... | |
4d4aea6f1077da609a527b70a9f24e38eda8669c | pybug/image/test/image_update_from_vector_test.py | pybug/image/test/image_update_from_vector_test.py | import numpy as np
from numpy.testing import assert_allclose
from pybug.image import *
from nose.tools import raises
def update_im_from_vector(im):
new_values = np.random.random(im.pixels.shape)
same_im = im.update_from_vector(new_values.flatten())
assert same_im is im
assert same_im.pixels.shape == n... | Add new tests for update from vector | Add new tests for update from vector
| Python | bsd-3-clause | jabooth/menpo-archive,jabooth/menpo-archive,mozata/menpo,patricksnape/menpo,mozata/menpo,jabooth/menpo-archive,patricksnape/menpo,menpo/menpo,yuxiang-zhou/menpo,yuxiang-zhou/menpo,menpo/menpo,menpo/menpo,grigorisg9gr/menpo,mozata/menpo,mozata/menpo,patricksnape/menpo,grigorisg9gr/menpo,yuxiang-zhou/menpo,grigorisg9gr/m... | Add new tests for update from vector | import numpy as np
from numpy.testing import assert_allclose
from pybug.image import *
from nose.tools import raises
def update_im_from_vector(im):
new_values = np.random.random(im.pixels.shape)
same_im = im.update_from_vector(new_values.flatten())
assert same_im is im
assert same_im.pixels.shape == n... | <commit_before><commit_msg>Add new tests for update from vector<commit_after> | import numpy as np
from numpy.testing import assert_allclose
from pybug.image import *
from nose.tools import raises
def update_im_from_vector(im):
new_values = np.random.random(im.pixels.shape)
same_im = im.update_from_vector(new_values.flatten())
assert same_im is im
assert same_im.pixels.shape == n... | Add new tests for update from vectorimport numpy as np
from numpy.testing import assert_allclose
from pybug.image import *
from nose.tools import raises
def update_im_from_vector(im):
new_values = np.random.random(im.pixels.shape)
same_im = im.update_from_vector(new_values.flatten())
assert same_im is im
... | <commit_before><commit_msg>Add new tests for update from vector<commit_after>import numpy as np
from numpy.testing import assert_allclose
from pybug.image import *
from nose.tools import raises
def update_im_from_vector(im):
new_values = np.random.random(im.pixels.shape)
same_im = im.update_from_vector(new_va... | |
46e0d823e1c8cd903b034630d58a0a7ff13aeb34 | tests/test_elsewhere_public_json.py | tests/test_elsewhere_public_json.py | from __future__ import print_function, unicode_literals
import json
#import datetime
#import pytz
from gittip.testing import Harness
class Tests(Harness):
def test_returns_json_if_not_opted_in(self, *classes):
for platform in self.platforms:
self.make_elsewhere(platform.name, 1, 'alice')
... | Add unit tests for elsewhere public.json | Add unit tests for elsewhere public.json
| Python | mit | eXcomm/gratipay.com,gratipay/gratipay.com,studio666/gratipay.com,mccolgst/www.gittip.com,gratipay/gratipay.com,eXcomm/gratipay.com,gratipay/gratipay.com,studio666/gratipay.com,studio666/gratipay.com,gratipay/gratipay.com,mccolgst/www.gittip.com,mccolgst/www.gittip.com,mccolgst/www.gittip.com,eXcomm/gratipay.com,studio6... | Add unit tests for elsewhere public.json | from __future__ import print_function, unicode_literals
import json
#import datetime
#import pytz
from gittip.testing import Harness
class Tests(Harness):
def test_returns_json_if_not_opted_in(self, *classes):
for platform in self.platforms:
self.make_elsewhere(platform.name, 1, 'alice')
... | <commit_before><commit_msg>Add unit tests for elsewhere public.json<commit_after> | from __future__ import print_function, unicode_literals
import json
#import datetime
#import pytz
from gittip.testing import Harness
class Tests(Harness):
def test_returns_json_if_not_opted_in(self, *classes):
for platform in self.platforms:
self.make_elsewhere(platform.name, 1, 'alice')
... | Add unit tests for elsewhere public.jsonfrom __future__ import print_function, unicode_literals
import json
#import datetime
#import pytz
from gittip.testing import Harness
class Tests(Harness):
def test_returns_json_if_not_opted_in(self, *classes):
for platform in self.platforms:
self.make... | <commit_before><commit_msg>Add unit tests for elsewhere public.json<commit_after>from __future__ import print_function, unicode_literals
import json
#import datetime
#import pytz
from gittip.testing import Harness
class Tests(Harness):
def test_returns_json_if_not_opted_in(self, *classes):
for platform... | |
d14daf8707701d06e27f0bc8b86fd83adaa52e31 | tools/model_surgery/save_weights.py | tools/model_surgery/save_weights.py | #!/usr/bin/env python
import sys
import os.path as osp
this_dir = osp.dirname(__file__)
sys.path.insert(0, osp.join(this_dir, '../../external/caffe-mpi/build/install/python/'))
import caffe
import argparse
import cPickle
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('def_fi... | Add a script to save trained cls and bbox weights. | Add a script to save trained cls and bbox weights.
| Python | mit | myfavouritekk/TPN | Add a script to save trained cls and bbox weights. | #!/usr/bin/env python
import sys
import os.path as osp
this_dir = osp.dirname(__file__)
sys.path.insert(0, osp.join(this_dir, '../../external/caffe-mpi/build/install/python/'))
import caffe
import argparse
import cPickle
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('def_fi... | <commit_before><commit_msg>Add a script to save trained cls and bbox weights.<commit_after> | #!/usr/bin/env python
import sys
import os.path as osp
this_dir = osp.dirname(__file__)
sys.path.insert(0, osp.join(this_dir, '../../external/caffe-mpi/build/install/python/'))
import caffe
import argparse
import cPickle
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('def_fi... | Add a script to save trained cls and bbox weights.#!/usr/bin/env python
import sys
import os.path as osp
this_dir = osp.dirname(__file__)
sys.path.insert(0, osp.join(this_dir, '../../external/caffe-mpi/build/install/python/'))
import caffe
import argparse
import cPickle
if __name__ == '__main__':
parser = argpars... | <commit_before><commit_msg>Add a script to save trained cls and bbox weights.<commit_after>#!/usr/bin/env python
import sys
import os.path as osp
this_dir = osp.dirname(__file__)
sys.path.insert(0, osp.join(this_dir, '../../external/caffe-mpi/build/install/python/'))
import caffe
import argparse
import cPickle
if __n... | |
307071147378990f1b038c0c29adb6d7f1ec8939 | tests/genmb_test.py | tests/genmb_test.py | """Tests for the general many-body problem."""
import pytest
from sympy import IndexedBase
from drudge import GenMBDrudge, CR, AN
@pytest.fixture(scope='module')
def genmb(spark_ctx):
"""Initialize the environment for a free algebra."""
dr = GenMBDrudge(spark_ctx)
return dr
def test_genmb_has_basic_p... | Add test for spin-orbital Hartree-Fock theory | Add test for spin-orbital Hartree-Fock theory
The actual value is not tested, which will be added when the
substitution facility is ready.
| Python | mit | tschijnmo/drudge,tschijnmo/drudge,tschijnmo/drudge | Add test for spin-orbital Hartree-Fock theory
The actual value is not tested, which will be added when the
substitution facility is ready. | """Tests for the general many-body problem."""
import pytest
from sympy import IndexedBase
from drudge import GenMBDrudge, CR, AN
@pytest.fixture(scope='module')
def genmb(spark_ctx):
"""Initialize the environment for a free algebra."""
dr = GenMBDrudge(spark_ctx)
return dr
def test_genmb_has_basic_p... | <commit_before><commit_msg>Add test for spin-orbital Hartree-Fock theory
The actual value is not tested, which will be added when the
substitution facility is ready.<commit_after> | """Tests for the general many-body problem."""
import pytest
from sympy import IndexedBase
from drudge import GenMBDrudge, CR, AN
@pytest.fixture(scope='module')
def genmb(spark_ctx):
"""Initialize the environment for a free algebra."""
dr = GenMBDrudge(spark_ctx)
return dr
def test_genmb_has_basic_p... | Add test for spin-orbital Hartree-Fock theory
The actual value is not tested, which will be added when the
substitution facility is ready."""Tests for the general many-body problem."""
import pytest
from sympy import IndexedBase
from drudge import GenMBDrudge, CR, AN
@pytest.fixture(scope='module')
def genmb(spark... | <commit_before><commit_msg>Add test for spin-orbital Hartree-Fock theory
The actual value is not tested, which will be added when the
substitution facility is ready.<commit_after>"""Tests for the general many-body problem."""
import pytest
from sympy import IndexedBase
from drudge import GenMBDrudge, CR, AN
@pytes... | |
ec25fd3099e5c921c9818cbafe48a520e991d87a | tests/test_jieba.py | tests/test_jieba.py | # encoding=utf-8
import unittest
import jieba
class TestJieba(unittest.TestCase):
def test_text_split(self):
sentence = "我爱北京天安门"
seg_list = jieba.cut(sentence) | ADD unit test for jieba | ADD unit test for jieba
| Python | apache-2.0 | Kaggle/docker-python,Kaggle/docker-python | ADD unit test for jieba | # encoding=utf-8
import unittest
import jieba
class TestJieba(unittest.TestCase):
def test_text_split(self):
sentence = "我爱北京天安门"
seg_list = jieba.cut(sentence) | <commit_before><commit_msg>ADD unit test for jieba<commit_after> | # encoding=utf-8
import unittest
import jieba
class TestJieba(unittest.TestCase):
def test_text_split(self):
sentence = "我爱北京天安门"
seg_list = jieba.cut(sentence) | ADD unit test for jieba# encoding=utf-8
import unittest
import jieba
class TestJieba(unittest.TestCase):
def test_text_split(self):
sentence = "我爱北京天安门"
seg_list = jieba.cut(sentence) | <commit_before><commit_msg>ADD unit test for jieba<commit_after># encoding=utf-8
import unittest
import jieba
class TestJieba(unittest.TestCase):
def test_text_split(self):
sentence = "我爱北京天安门"
seg_list = jieba.cut(sentence) | |
4e23e1f1790e609bd829c476b5948356feb15814 | tests/test_share.py | tests/test_share.py | from nose.tools import * # PEP8 asserts
from mock import patch
from tests.base import OsfTestCase
from website.search import share_search
class TestShareSearch(OsfTestCase):
@patch.object(share_search.share_es, 'search')
def test_share_search(self, mock_search):
mock_search.return_value = {
... | Add tests for share view functions | Add tests for share view functions
| Python | apache-2.0 | laurenrevere/osf.io,cslzchen/osf.io,abought/osf.io,brianjgeiger/osf.io,samanehsan/osf.io,monikagrabowska/osf.io,monikagrabowska/osf.io,adlius/osf.io,jeffreyliu3230/osf.io,HalcyonChimera/osf.io,amyshi188/osf.io,acshi/osf.io,mluo613/osf.io,GaryKriebel/osf.io,barbour-em/osf.io,caneruguz/osf.io,TomBaxter/osf.io,crcresearch... | Add tests for share view functions | from nose.tools import * # PEP8 asserts
from mock import patch
from tests.base import OsfTestCase
from website.search import share_search
class TestShareSearch(OsfTestCase):
@patch.object(share_search.share_es, 'search')
def test_share_search(self, mock_search):
mock_search.return_value = {
... | <commit_before><commit_msg>Add tests for share view functions<commit_after> | from nose.tools import * # PEP8 asserts
from mock import patch
from tests.base import OsfTestCase
from website.search import share_search
class TestShareSearch(OsfTestCase):
@patch.object(share_search.share_es, 'search')
def test_share_search(self, mock_search):
mock_search.return_value = {
... | Add tests for share view functionsfrom nose.tools import * # PEP8 asserts
from mock import patch
from tests.base import OsfTestCase
from website.search import share_search
class TestShareSearch(OsfTestCase):
@patch.object(share_search.share_es, 'search')
def test_share_search(self, mock_search):
mo... | <commit_before><commit_msg>Add tests for share view functions<commit_after>from nose.tools import * # PEP8 asserts
from mock import patch
from tests.base import OsfTestCase
from website.search import share_search
class TestShareSearch(OsfTestCase):
@patch.object(share_search.share_es, 'search')
def test_sh... | |
388b6236761c5b05e1919f725d6bfe32b8961d5a | tests/helper_tests.py | tests/helper_tests.py | # -*- coding: utf-8 -*-
"""
Tests for helper and utility methods
TODO: move integration tests (e.g. all that test a full request cycle)
into smaller, broken-up unit tests to simplify testing.
~~~~
Flask-CORS is a simple extension to Flask allowing you to support cross
origin resource sharing (CO... | Add tests for helper functions | Add tests for helper functions
| Python | mit | corydolphin/flask-cors,ashleysommer/sanic-cors | Add tests for helper functions | # -*- coding: utf-8 -*-
"""
Tests for helper and utility methods
TODO: move integration tests (e.g. all that test a full request cycle)
into smaller, broken-up unit tests to simplify testing.
~~~~
Flask-CORS is a simple extension to Flask allowing you to support cross
origin resource sharing (CO... | <commit_before><commit_msg>Add tests for helper functions<commit_after> | # -*- coding: utf-8 -*-
"""
Tests for helper and utility methods
TODO: move integration tests (e.g. all that test a full request cycle)
into smaller, broken-up unit tests to simplify testing.
~~~~
Flask-CORS is a simple extension to Flask allowing you to support cross
origin resource sharing (CO... | Add tests for helper functions# -*- coding: utf-8 -*-
"""
Tests for helper and utility methods
TODO: move integration tests (e.g. all that test a full request cycle)
into smaller, broken-up unit tests to simplify testing.
~~~~
Flask-CORS is a simple extension to Flask allowing you to support cross
... | <commit_before><commit_msg>Add tests for helper functions<commit_after># -*- coding: utf-8 -*-
"""
Tests for helper and utility methods
TODO: move integration tests (e.g. all that test a full request cycle)
into smaller, broken-up unit tests to simplify testing.
~~~~
Flask-CORS is a simple extension... | |
90b98d9b0f85f153ec90f2e8534f001774203aa0 | tests/nuclear_test.py | tests/nuclear_test.py | """Tests for special utilities related to nuclear problems."""
import pytest
from sympy import Symbol, simplify, latex
from drudge import NuclearBogoliubovDrudge
from drudge.nuclear import JOf, TildeOf, MOf, NOf, LOf, PiOf
@pytest.fixture(scope='module')
def nuclear(spark_ctx):
"""Set up the drudge to test."""
... | Add tests for nuclear QN accessors and dummies | Add tests for nuclear QN accessors and dummies
Here we just test the most basic printing and assumptions.
| Python | mit | tschijnmo/drudge,tschijnmo/drudge,tschijnmo/drudge | Add tests for nuclear QN accessors and dummies
Here we just test the most basic printing and assumptions. | """Tests for special utilities related to nuclear problems."""
import pytest
from sympy import Symbol, simplify, latex
from drudge import NuclearBogoliubovDrudge
from drudge.nuclear import JOf, TildeOf, MOf, NOf, LOf, PiOf
@pytest.fixture(scope='module')
def nuclear(spark_ctx):
"""Set up the drudge to test."""
... | <commit_before><commit_msg>Add tests for nuclear QN accessors and dummies
Here we just test the most basic printing and assumptions.<commit_after> | """Tests for special utilities related to nuclear problems."""
import pytest
from sympy import Symbol, simplify, latex
from drudge import NuclearBogoliubovDrudge
from drudge.nuclear import JOf, TildeOf, MOf, NOf, LOf, PiOf
@pytest.fixture(scope='module')
def nuclear(spark_ctx):
"""Set up the drudge to test."""
... | Add tests for nuclear QN accessors and dummies
Here we just test the most basic printing and assumptions."""Tests for special utilities related to nuclear problems."""
import pytest
from sympy import Symbol, simplify, latex
from drudge import NuclearBogoliubovDrudge
from drudge.nuclear import JOf, TildeOf, MOf, NOf,... | <commit_before><commit_msg>Add tests for nuclear QN accessors and dummies
Here we just test the most basic printing and assumptions.<commit_after>"""Tests for special utilities related to nuclear problems."""
import pytest
from sympy import Symbol, simplify, latex
from drudge import NuclearBogoliubovDrudge
from drud... | |
459e2dad7162c5091cd963edace8e2edb20e1e0e | migrations/versions/3a5eba38e4e8_set_g6_services_to_be_published_rather_.py | migrations/versions/3a5eba38e4e8_set_g6_services_to_be_published_rather_.py | """Set G6 services to be published rather than enabled
Revision ID: 3a5eba38e4e8
Revises: 3e6c454a6fc7
Create Date: 2015-04-02 16:18:30.609595
"""
# revision identifiers, used by Alembic.
revision = '3a5eba38e4e8'
down_revision = '3e6c454a6fc7'
from alembic import op
from sqlalchemy.sql import column, table
from sq... | Update 'enabled' services to 'published' | Update 'enabled' services to 'published'
The previous migration that added the 'status' field set all G6 services to 'enabled'. This was wrong - they should be 'published', as they are visible to everyone ('enabled' will be visible only to admin and the supplier of the service).
| Python | mit | mtekel/digitalmarketplace-api,mtekel/digitalmarketplace-api,alphagov/digitalmarketplace-api,alphagov/digitalmarketplace-api,alphagov/digitalmarketplace-api,RichardKnop/digitalmarketplace-api,RichardKnop/digitalmarketplace-api,mtekel/digitalmarketplace-api,RichardKnop/digitalmarketplace-api,RichardKnop/digitalmarketplac... | Update 'enabled' services to 'published'
The previous migration that added the 'status' field set all G6 services to 'enabled'. This was wrong - they should be 'published', as they are visible to everyone ('enabled' will be visible only to admin and the supplier of the service). | """Set G6 services to be published rather than enabled
Revision ID: 3a5eba38e4e8
Revises: 3e6c454a6fc7
Create Date: 2015-04-02 16:18:30.609595
"""
# revision identifiers, used by Alembic.
revision = '3a5eba38e4e8'
down_revision = '3e6c454a6fc7'
from alembic import op
from sqlalchemy.sql import column, table
from sq... | <commit_before><commit_msg>Update 'enabled' services to 'published'
The previous migration that added the 'status' field set all G6 services to 'enabled'. This was wrong - they should be 'published', as they are visible to everyone ('enabled' will be visible only to admin and the supplier of the service).<commit_after... | """Set G6 services to be published rather than enabled
Revision ID: 3a5eba38e4e8
Revises: 3e6c454a6fc7
Create Date: 2015-04-02 16:18:30.609595
"""
# revision identifiers, used by Alembic.
revision = '3a5eba38e4e8'
down_revision = '3e6c454a6fc7'
from alembic import op
from sqlalchemy.sql import column, table
from sq... | Update 'enabled' services to 'published'
The previous migration that added the 'status' field set all G6 services to 'enabled'. This was wrong - they should be 'published', as they are visible to everyone ('enabled' will be visible only to admin and the supplier of the service)."""Set G6 services to be published rathe... | <commit_before><commit_msg>Update 'enabled' services to 'published'
The previous migration that added the 'status' field set all G6 services to 'enabled'. This was wrong - they should be 'published', as they are visible to everyone ('enabled' will be visible only to admin and the supplier of the service).<commit_after... | |
146627e5e0b66dfe413b8993b3ba2bb11fa247e6 | inventory/migrations/0002_auto_20171107_2108.py | inventory/migrations/0002_auto_20171107_2108.py | # -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2017-11-07 21:08
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('inventory', '0001_initial'),
]
operations = [
migrations.RemoveField(
... | Add migrations file from server, after inventory update. | Add migrations file from server, after inventory update.
| Python | mit | hackerspace-ntnu/website,hackerspace-ntnu/website,hackerspace-ntnu/website | Add migrations file from server, after inventory update. | # -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2017-11-07 21:08
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('inventory', '0001_initial'),
]
operations = [
migrations.RemoveField(
... | <commit_before><commit_msg>Add migrations file from server, after inventory update.<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2017-11-07 21:08
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('inventory', '0001_initial'),
]
operations = [
migrations.RemoveField(
... | Add migrations file from server, after inventory update.# -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2017-11-07 21:08
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('inventory', '0001_initial'),
]
... | <commit_before><commit_msg>Add migrations file from server, after inventory update.<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2017-11-07 21:08
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
... | |
267516c0750cf698a02e52cc46ad90180533a985 | VehicleDetectionTracking/spatial_bin.py | VehicleDetectionTracking/spatial_bin.py | # Code given by Udacity, complete by Andres Guijarro
# Define a function that takes an image, a color space,
# and a new image size and returns a feature vector
import cv2
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
# Read in an image
# You can also read cutout2, 3, 4 etc. to see other examples
i... | Add scripts which define a function that takes an image, a color space, and a new image size and returns a feature vector | feat: Add scripts which define a function that takes an image, a color space, and a new image size and returns a feature vector
| Python | mit | aguijarro/SelfDrivingCar | feat: Add scripts which define a function that takes an image, a color space, and a new image size and returns a feature vector | # Code given by Udacity, complete by Andres Guijarro
# Define a function that takes an image, a color space,
# and a new image size and returns a feature vector
import cv2
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
# Read in an image
# You can also read cutout2, 3, 4 etc. to see other examples
i... | <commit_before><commit_msg>feat: Add scripts which define a function that takes an image, a color space, and a new image size and returns a feature vector<commit_after> | # Code given by Udacity, complete by Andres Guijarro
# Define a function that takes an image, a color space,
# and a new image size and returns a feature vector
import cv2
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
# Read in an image
# You can also read cutout2, 3, 4 etc. to see other examples
i... | feat: Add scripts which define a function that takes an image, a color space, and a new image size and returns a feature vector# Code given by Udacity, complete by Andres Guijarro
# Define a function that takes an image, a color space,
# and a new image size and returns a feature vector
import cv2
import matplotlib.py... | <commit_before><commit_msg>feat: Add scripts which define a function that takes an image, a color space, and a new image size and returns a feature vector<commit_after># Code given by Udacity, complete by Andres Guijarro
# Define a function that takes an image, a color space,
# and a new image size and returns a featur... | |
9751902bc25d08577f98a4346c4605a4cfbcec73 | src/collectors/users/test/testusers.py | src/collectors/users/test/testusers.py | #!/usr/bin/python
# coding=utf-8
################################################################################
from test import CollectorTestCase
from test import get_collector_config
from test import unittest
from mock import Mock
from mock import patch
from diamond.collector import Collector
from users import Us... | #!/usr/bin/python
# coding=utf-8
################################################################################
from test import CollectorTestCase
from test import get_collector_config
from test import unittest
from mock import Mock
from mock import patch
from diamond.collector import Collector
from users import Us... | Fix users count for unit test | Fix users count for unit test
| Python | mit | skbkontur/Diamond,rtoma/Diamond,python-diamond/Diamond,Nihn/Diamond-1,eMerzh/Diamond-1,TinLe/Diamond,skbkontur/Diamond,disqus/Diamond,russss/Diamond,tuenti/Diamond,codepython/Diamond,janisz/Diamond-1,sebbrandt87/Diamond,Nihn/Diamond-1,mfriedenhagen/Diamond,Ensighten/Diamond,bmhatfield/Diamond,actmd/Diamond,gg7/diamond,... | #!/usr/bin/python
# coding=utf-8
################################################################################
from test import CollectorTestCase
from test import get_collector_config
from test import unittest
from mock import Mock
from mock import patch
from diamond.collector import Collector
from users import Us... | #!/usr/bin/python
# coding=utf-8
################################################################################
from test import CollectorTestCase
from test import get_collector_config
from test import unittest
from mock import Mock
from mock import patch
from diamond.collector import Collector
from users import Us... | <commit_before>#!/usr/bin/python
# coding=utf-8
################################################################################
from test import CollectorTestCase
from test import get_collector_config
from test import unittest
from mock import Mock
from mock import patch
from diamond.collector import Collector
from ... | #!/usr/bin/python
# coding=utf-8
################################################################################
from test import CollectorTestCase
from test import get_collector_config
from test import unittest
from mock import Mock
from mock import patch
from diamond.collector import Collector
from users import Us... | #!/usr/bin/python
# coding=utf-8
################################################################################
from test import CollectorTestCase
from test import get_collector_config
from test import unittest
from mock import Mock
from mock import patch
from diamond.collector import Collector
from users import Us... | <commit_before>#!/usr/bin/python
# coding=utf-8
################################################################################
from test import CollectorTestCase
from test import get_collector_config
from test import unittest
from mock import Mock
from mock import patch
from diamond.collector import Collector
from ... |
ab42c5e8c3ac51c65ed7229dafb751c7baa667aa | examples/mnist-rica.py | examples/mnist-rica.py | #!/usr/bin/env python
import matplotlib.pyplot as plt
import numpy as np
import theanets
from utils import load_mnist, plot_layers, plot_images
class RICA(theanets.Autoencoder):
def J(self, weight_inverse=0, **kwargs):
cost = super(RICA, self).J(**kwargs)
if weight_inverse > 0:
cost ... | Add an example for computing sparse codes using RICA. | Add an example for computing sparse codes using RICA.
| Python | mit | lmjohns3/theanets,chrinide/theanets,devdoer/theanets | Add an example for computing sparse codes using RICA. | #!/usr/bin/env python
import matplotlib.pyplot as plt
import numpy as np
import theanets
from utils import load_mnist, plot_layers, plot_images
class RICA(theanets.Autoencoder):
def J(self, weight_inverse=0, **kwargs):
cost = super(RICA, self).J(**kwargs)
if weight_inverse > 0:
cost ... | <commit_before><commit_msg>Add an example for computing sparse codes using RICA.<commit_after> | #!/usr/bin/env python
import matplotlib.pyplot as plt
import numpy as np
import theanets
from utils import load_mnist, plot_layers, plot_images
class RICA(theanets.Autoencoder):
def J(self, weight_inverse=0, **kwargs):
cost = super(RICA, self).J(**kwargs)
if weight_inverse > 0:
cost ... | Add an example for computing sparse codes using RICA.#!/usr/bin/env python
import matplotlib.pyplot as plt
import numpy as np
import theanets
from utils import load_mnist, plot_layers, plot_images
class RICA(theanets.Autoencoder):
def J(self, weight_inverse=0, **kwargs):
cost = super(RICA, self).J(**kwa... | <commit_before><commit_msg>Add an example for computing sparse codes using RICA.<commit_after>#!/usr/bin/env python
import matplotlib.pyplot as plt
import numpy as np
import theanets
from utils import load_mnist, plot_layers, plot_images
class RICA(theanets.Autoencoder):
def J(self, weight_inverse=0, **kwargs):... | |
79fc87489595eebbc6c9f40d9d79a74af4e7494d | scripts/testdynamic.py | scripts/testdynamic.py | #!/usr/bin/env python
# -*- coding: utf-8
import Ice, IcePy, sys, tempfile
ice = Ice.initialize(sys.argv)
proxy = ice.stringToProxy('Meta:tcp -h 127.0.0.1 -p 6502')
slice = IcePy.Operation('getSlice', Ice.OperationMode.Idempotent, Ice.OperationMode.Idempotent, True, (), (), (), IcePy._t_string, ()).invoke(proxy, (()... | #!/usr/bin/env python
# -*- coding: utf-8
import Ice, IcePy, sys, tempfile
ice = Ice.initialize(sys.argv)
proxy = ice.stringToProxy('Meta:tcp -h 127.0.0.1 -p 6502')
try:
slice = IcePy.Operation('getSlice', Ice.OperationMode.Idempotent, Ice.OperationMode.Idempotent, True, (), (), (), IcePy._t_string, ()).invoke(pr... | Expand dynamic slice-fetch example to show fallback | Expand dynamic slice-fetch example to show fallback
| Python | bsd-3-clause | mkrautz/mumble-sbcelt,austinliou/mumble,unascribed/mumble,LuAPi/mumble,Githlar/mumble,chiefdome/mumble-code,panaschieren/mumble-test,ccpgames/mumble,unascribed/mumble,Zopieux/mumble,SuperNascher/mumble,Zopieux/mumble,Lartza/mumble,feld/mumble,feld/mumble,arrai/mumble-record,Lartza/mumble,unascribed/mumble,ccpgames/mumb... | #!/usr/bin/env python
# -*- coding: utf-8
import Ice, IcePy, sys, tempfile
ice = Ice.initialize(sys.argv)
proxy = ice.stringToProxy('Meta:tcp -h 127.0.0.1 -p 6502')
slice = IcePy.Operation('getSlice', Ice.OperationMode.Idempotent, Ice.OperationMode.Idempotent, True, (), (), (), IcePy._t_string, ()).invoke(proxy, (()... | #!/usr/bin/env python
# -*- coding: utf-8
import Ice, IcePy, sys, tempfile
ice = Ice.initialize(sys.argv)
proxy = ice.stringToProxy('Meta:tcp -h 127.0.0.1 -p 6502')
try:
slice = IcePy.Operation('getSlice', Ice.OperationMode.Idempotent, Ice.OperationMode.Idempotent, True, (), (), (), IcePy._t_string, ()).invoke(pr... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8
import Ice, IcePy, sys, tempfile
ice = Ice.initialize(sys.argv)
proxy = ice.stringToProxy('Meta:tcp -h 127.0.0.1 -p 6502')
slice = IcePy.Operation('getSlice', Ice.OperationMode.Idempotent, Ice.OperationMode.Idempotent, True, (), (), (), IcePy._t_string, ()).in... | #!/usr/bin/env python
# -*- coding: utf-8
import Ice, IcePy, sys, tempfile
ice = Ice.initialize(sys.argv)
proxy = ice.stringToProxy('Meta:tcp -h 127.0.0.1 -p 6502')
try:
slice = IcePy.Operation('getSlice', Ice.OperationMode.Idempotent, Ice.OperationMode.Idempotent, True, (), (), (), IcePy._t_string, ()).invoke(pr... | #!/usr/bin/env python
# -*- coding: utf-8
import Ice, IcePy, sys, tempfile
ice = Ice.initialize(sys.argv)
proxy = ice.stringToProxy('Meta:tcp -h 127.0.0.1 -p 6502')
slice = IcePy.Operation('getSlice', Ice.OperationMode.Idempotent, Ice.OperationMode.Idempotent, True, (), (), (), IcePy._t_string, ()).invoke(proxy, (()... | <commit_before>#!/usr/bin/env python
# -*- coding: utf-8
import Ice, IcePy, sys, tempfile
ice = Ice.initialize(sys.argv)
proxy = ice.stringToProxy('Meta:tcp -h 127.0.0.1 -p 6502')
slice = IcePy.Operation('getSlice', Ice.OperationMode.Idempotent, Ice.OperationMode.Idempotent, True, (), (), (), IcePy._t_string, ()).in... |
7cfcdc25492ffb1da7a03edcb885d2db1ae20062 | scratchpad/logger.py | scratchpad/logger.py | #!/usr/bin/env python3
from sense_hat import SenseHat
from pymongo import MongoClient
import time
import datetime
sense = SenseHat()
sense.clear()
client = MongoClient('localhost:27017')
db = client.g2x
def log(device, property, value):
now = datetime.datetime.utcnow()
print("[{0}] {1}:{2} = {3}".format(no... | Test logging of Sense data to mongodb | Test logging of Sense data to mongodb
| Python | mit | thelonious/g2x,gizmo-cda/g2x,thelonious/g2x,gizmo-cda/g2x,gizmo-cda/g2x,gizmo-cda/g2x | Test logging of Sense data to mongodb | #!/usr/bin/env python3
from sense_hat import SenseHat
from pymongo import MongoClient
import time
import datetime
sense = SenseHat()
sense.clear()
client = MongoClient('localhost:27017')
db = client.g2x
def log(device, property, value):
now = datetime.datetime.utcnow()
print("[{0}] {1}:{2} = {3}".format(no... | <commit_before><commit_msg>Test logging of Sense data to mongodb<commit_after> | #!/usr/bin/env python3
from sense_hat import SenseHat
from pymongo import MongoClient
import time
import datetime
sense = SenseHat()
sense.clear()
client = MongoClient('localhost:27017')
db = client.g2x
def log(device, property, value):
now = datetime.datetime.utcnow()
print("[{0}] {1}:{2} = {3}".format(no... | Test logging of Sense data to mongodb#!/usr/bin/env python3
from sense_hat import SenseHat
from pymongo import MongoClient
import time
import datetime
sense = SenseHat()
sense.clear()
client = MongoClient('localhost:27017')
db = client.g2x
def log(device, property, value):
now = datetime.datetime.utcnow()
... | <commit_before><commit_msg>Test logging of Sense data to mongodb<commit_after>#!/usr/bin/env python3
from sense_hat import SenseHat
from pymongo import MongoClient
import time
import datetime
sense = SenseHat()
sense.clear()
client = MongoClient('localhost:27017')
db = client.g2x
def log(device, property, value):
... | |
c171359ca9e50328a09f98af2cb5b0f6cd6f7e50 | pombola/south_africa/management/commands/south_africa_import_new_constituency_office_locations.py | pombola/south_africa/management/commands/south_africa_import_new_constituency_office_locations.py | """Command to import PMG's constitiency office data
PMG are undertaking an exercise to visit all the constituency
offices and collect accurate locations and photographs.
The data from this is available at
https://app.m4jam.com/app/campaigns/2298/export/
This script parses the resulting CSV file and updates our data
... | Add a script to import new constituency office locations. | Add a script to import new constituency office locations.
PMG are conducting an exercise to go to all the constituency offices
and get accurate locations for them and photographs. The data they
collect is available as a CSV, and this new management command
processes that CSV and updates our data with the improved loca... | Python | agpl-3.0 | mysociety/pombola,mysociety/pombola,mysociety/pombola,mysociety/pombola,mysociety/pombola,mysociety/pombola | Add a script to import new constituency office locations.
PMG are conducting an exercise to go to all the constituency offices
and get accurate locations for them and photographs. The data they
collect is available as a CSV, and this new management command
processes that CSV and updates our data with the improved loca... | """Command to import PMG's constitiency office data
PMG are undertaking an exercise to visit all the constituency
offices and collect accurate locations and photographs.
The data from this is available at
https://app.m4jam.com/app/campaigns/2298/export/
This script parses the resulting CSV file and updates our data
... | <commit_before><commit_msg>Add a script to import new constituency office locations.
PMG are conducting an exercise to go to all the constituency offices
and get accurate locations for them and photographs. The data they
collect is available as a CSV, and this new management command
processes that CSV and updates our ... | """Command to import PMG's constitiency office data
PMG are undertaking an exercise to visit all the constituency
offices and collect accurate locations and photographs.
The data from this is available at
https://app.m4jam.com/app/campaigns/2298/export/
This script parses the resulting CSV file and updates our data
... | Add a script to import new constituency office locations.
PMG are conducting an exercise to go to all the constituency offices
and get accurate locations for them and photographs. The data they
collect is available as a CSV, and this new management command
processes that CSV and updates our data with the improved loca... | <commit_before><commit_msg>Add a script to import new constituency office locations.
PMG are conducting an exercise to go to all the constituency offices
and get accurate locations for them and photographs. The data they
collect is available as a CSV, and this new management command
processes that CSV and updates our ... | |
f0d12bb2c3834365081fddcee200f6a5b779c8a4 | scripts/syncrules.py | scripts/syncrules.py | #!/usr/bin/env python3
import os
import shutil
import argparse
import logging
from snakemake_rules import SNAKEMAKE_RULES_PATH
from snakemake.workflow import Workflow
from snakemake.exceptions import print_exception
FORMAT = '%(levelname)s: %(asctime)-15s: %(message)s'
logging.basicConfig(level=logging.DEBUG)
logger =... | Add script to sync rules | Add script to sync rules
| Python | mit | percyfal/snakemake-rules,percyfal/snakemakelib-rules,percyfal/snakemakelib-rules,percyfal/snakemakelib-rules,percyfal/snakemake-rules | Add script to sync rules | #!/usr/bin/env python3
import os
import shutil
import argparse
import logging
from snakemake_rules import SNAKEMAKE_RULES_PATH
from snakemake.workflow import Workflow
from snakemake.exceptions import print_exception
FORMAT = '%(levelname)s: %(asctime)-15s: %(message)s'
logging.basicConfig(level=logging.DEBUG)
logger =... | <commit_before><commit_msg>Add script to sync rules<commit_after> | #!/usr/bin/env python3
import os
import shutil
import argparse
import logging
from snakemake_rules import SNAKEMAKE_RULES_PATH
from snakemake.workflow import Workflow
from snakemake.exceptions import print_exception
FORMAT = '%(levelname)s: %(asctime)-15s: %(message)s'
logging.basicConfig(level=logging.DEBUG)
logger =... | Add script to sync rules#!/usr/bin/env python3
import os
import shutil
import argparse
import logging
from snakemake_rules import SNAKEMAKE_RULES_PATH
from snakemake.workflow import Workflow
from snakemake.exceptions import print_exception
FORMAT = '%(levelname)s: %(asctime)-15s: %(message)s'
logging.basicConfig(level... | <commit_before><commit_msg>Add script to sync rules<commit_after>#!/usr/bin/env python3
import os
import shutil
import argparse
import logging
from snakemake_rules import SNAKEMAKE_RULES_PATH
from snakemake.workflow import Workflow
from snakemake.exceptions import print_exception
FORMAT = '%(levelname)s: %(asctime)-15... | |
ab03d7e0ffb4c3a82f5b9bee88d6b06a375f9276 | Utilities/Maintenance/GeneratePythonDownloadsPage.py | Utilities/Maintenance/GeneratePythonDownloadsPage.py | #!/usr/bin/env python
#=========================================================================
#
# Copyright Insight Software Consortium
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
... | Add script to generate download links used on simpleitk.org | Add script to generate download links used on simpleitk.org
| Python | apache-2.0 | blowekamp/SimpleITK,InsightSoftwareConsortium/SimpleITK,SimpleITK/SimpleITK,richardbeare/SimpleITK,InsightSoftwareConsortium/SimpleITK,InsightSoftwareConsortium/SimpleITK,richardbeare/SimpleITK,SimpleITK/SimpleITK,SimpleITK/SimpleITK,SimpleITK/SimpleITK,InsightSoftwareConsortium/SimpleITK,blowekamp/SimpleITK,richardbea... | Add script to generate download links used on simpleitk.org | #!/usr/bin/env python
#=========================================================================
#
# Copyright Insight Software Consortium
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
... | <commit_before><commit_msg>Add script to generate download links used on simpleitk.org<commit_after> | #!/usr/bin/env python
#=========================================================================
#
# Copyright Insight Software Consortium
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
... | Add script to generate download links used on simpleitk.org#!/usr/bin/env python
#=========================================================================
#
# Copyright Insight Software Consortium
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance wi... | <commit_before><commit_msg>Add script to generate download links used on simpleitk.org<commit_after>#!/usr/bin/env python
#=========================================================================
#
# Copyright Insight Software Consortium
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may ... | |
c552bfd620682d76afe17f6a70f901500e090b10 | Day1/PrimeTestCases.py | Day1/PrimeTestCases.py | #prime numbers function test cases
import unittest
from prime import prime_numbers
class PrimeTest(unittest.TestCase):
def test_returns_prime_numbers(self):
self.assertListEqual(prime_numbers(6), [2,3,5], msg="Range of 0-6 should return [2,3,5] as the prime numbers")
def test_input_is_a_number(self):
... | Add test cases for prime numbers generator | Add test cases for prime numbers generator
| Python | mit | JoshuaOndieki/joshua-ondieki-bootcamp-19 | Add test cases for prime numbers generator | #prime numbers function test cases
import unittest
from prime import prime_numbers
class PrimeTest(unittest.TestCase):
def test_returns_prime_numbers(self):
self.assertListEqual(prime_numbers(6), [2,3,5], msg="Range of 0-6 should return [2,3,5] as the prime numbers")
def test_input_is_a_number(self):
... | <commit_before><commit_msg>Add test cases for prime numbers generator<commit_after> | #prime numbers function test cases
import unittest
from prime import prime_numbers
class PrimeTest(unittest.TestCase):
def test_returns_prime_numbers(self):
self.assertListEqual(prime_numbers(6), [2,3,5], msg="Range of 0-6 should return [2,3,5] as the prime numbers")
def test_input_is_a_number(self):
... | Add test cases for prime numbers generator#prime numbers function test cases
import unittest
from prime import prime_numbers
class PrimeTest(unittest.TestCase):
def test_returns_prime_numbers(self):
self.assertListEqual(prime_numbers(6), [2,3,5], msg="Range of 0-6 should return [2,3,5] as the prime numbers... | <commit_before><commit_msg>Add test cases for prime numbers generator<commit_after>#prime numbers function test cases
import unittest
from prime import prime_numbers
class PrimeTest(unittest.TestCase):
def test_returns_prime_numbers(self):
self.assertListEqual(prime_numbers(6), [2,3,5], msg="Range of 0-6 s... | |
d243017affa1397a8a08f34b3c1a01177f6f315e | tests/test_helpers.py | tests/test_helpers.py | # -*- coding: utf-8 -*-
# Copyright (C) 2019 Tobias Gruetzmacher
from __future__ import absolute_import, division, print_function
import pytest
import re
from dosagelib.helpers import joinPathPartsNamer
class TestNamer(object):
"""
Tests for comic namer.
"""
def test_joinPathPartsNamer(self):
... | Add test for recently added helper | Add test for recently added helper
| Python | mit | webcomics/dosage,peterjanes/dosage,peterjanes/dosage,webcomics/dosage | Add test for recently added helper | # -*- coding: utf-8 -*-
# Copyright (C) 2019 Tobias Gruetzmacher
from __future__ import absolute_import, division, print_function
import pytest
import re
from dosagelib.helpers import joinPathPartsNamer
class TestNamer(object):
"""
Tests for comic namer.
"""
def test_joinPathPartsNamer(self):
... | <commit_before><commit_msg>Add test for recently added helper<commit_after> | # -*- coding: utf-8 -*-
# Copyright (C) 2019 Tobias Gruetzmacher
from __future__ import absolute_import, division, print_function
import pytest
import re
from dosagelib.helpers import joinPathPartsNamer
class TestNamer(object):
"""
Tests for comic namer.
"""
def test_joinPathPartsNamer(self):
... | Add test for recently added helper# -*- coding: utf-8 -*-
# Copyright (C) 2019 Tobias Gruetzmacher
from __future__ import absolute_import, division, print_function
import pytest
import re
from dosagelib.helpers import joinPathPartsNamer
class TestNamer(object):
"""
Tests for comic namer.
"""
def te... | <commit_before><commit_msg>Add test for recently added helper<commit_after># -*- coding: utf-8 -*-
# Copyright (C) 2019 Tobias Gruetzmacher
from __future__ import absolute_import, division, print_function
import pytest
import re
from dosagelib.helpers import joinPathPartsNamer
class TestNamer(object):
"""
T... | |
4c356d698b7abc59195989bcddcbcb210cc6c096 | tools/include_wash.py | tools/include_wash.py | #!/usr/bin/env python
from __future__ import print_function
import os
def check(fn):
l = []
for i in open(fn):
i = i.strip()
if len(i) == 0:
continue
if i[0] != "#":
continue
if i.find("include") == -1:
continue
if i.find('"') == -1:
l.append(i.split('<')[1].split('>')[0])
else:
l.append... | Make vrt.h include <stddef.h> and <stdint.h> | Make vrt.h include <stddef.h> and <stdint.h>
Originally we decided that the output of VCC should be 100%
stand-alone and therefore contain no #includes at all. This
was hoped to avoid unspecified trouble with C-compilers at runtime.
But C99 is old enough to drink now, so we move forward.
The script in tools/include... | Python | bsd-2-clause | gquintard/Varnish-Cache,gquintard/Varnish-Cache,gquintard/Varnish-Cache,gquintard/Varnish-Cache | Make vrt.h include <stddef.h> and <stdint.h>
Originally we decided that the output of VCC should be 100%
stand-alone and therefore contain no #includes at all. This
was hoped to avoid unspecified trouble with C-compilers at runtime.
But C99 is old enough to drink now, so we move forward.
The script in tools/include... | #!/usr/bin/env python
from __future__ import print_function
import os
def check(fn):
l = []
for i in open(fn):
i = i.strip()
if len(i) == 0:
continue
if i[0] != "#":
continue
if i.find("include") == -1:
continue
if i.find('"') == -1:
l.append(i.split('<')[1].split('>')[0])
else:
l.append... | <commit_before><commit_msg>Make vrt.h include <stddef.h> and <stdint.h>
Originally we decided that the output of VCC should be 100%
stand-alone and therefore contain no #includes at all. This
was hoped to avoid unspecified trouble with C-compilers at runtime.
But C99 is old enough to drink now, so we move forward.
... | #!/usr/bin/env python
from __future__ import print_function
import os
def check(fn):
l = []
for i in open(fn):
i = i.strip()
if len(i) == 0:
continue
if i[0] != "#":
continue
if i.find("include") == -1:
continue
if i.find('"') == -1:
l.append(i.split('<')[1].split('>')[0])
else:
l.append... | Make vrt.h include <stddef.h> and <stdint.h>
Originally we decided that the output of VCC should be 100%
stand-alone and therefore contain no #includes at all. This
was hoped to avoid unspecified trouble with C-compilers at runtime.
But C99 is old enough to drink now, so we move forward.
The script in tools/include... | <commit_before><commit_msg>Make vrt.h include <stddef.h> and <stdint.h>
Originally we decided that the output of VCC should be 100%
stand-alone and therefore contain no #includes at all. This
was hoped to avoid unspecified trouble with C-compilers at runtime.
But C99 is old enough to drink now, so we move forward.
... | |
96d7f942ca87c37485eaf95f2df67b376cf2ee40 | reporter/reporter/reports/scad/data_quality/duplicate_scad_id_in_civi.py | reporter/reporter/reports/scad/data_quality/duplicate_scad_id_in_civi.py | #!/usr/bin/env python3
from reporter.reports import Report
from reporter import (
get_contact_id_search_link, RECIPIENT_SCAD_ADMIN
)
class DuplicateScadIdInCivi(Report):
def __init__(self):
super().__init__(
introduction=("The following SCAD IDs are "
... | Duplicate SCAD ID in civi | Duplicate SCAD ID in civi
| Python | mit | LCBRU/reporter,LCBRU/reporter | Duplicate SCAD ID in civi | #!/usr/bin/env python3
from reporter.reports import Report
from reporter import (
get_contact_id_search_link, RECIPIENT_SCAD_ADMIN
)
class DuplicateScadIdInCivi(Report):
def __init__(self):
super().__init__(
introduction=("The following SCAD IDs are "
... | <commit_before><commit_msg>Duplicate SCAD ID in civi<commit_after> | #!/usr/bin/env python3
from reporter.reports import Report
from reporter import (
get_contact_id_search_link, RECIPIENT_SCAD_ADMIN
)
class DuplicateScadIdInCivi(Report):
def __init__(self):
super().__init__(
introduction=("The following SCAD IDs are "
... | Duplicate SCAD ID in civi#!/usr/bin/env python3
from reporter.reports import Report
from reporter import (
get_contact_id_search_link, RECIPIENT_SCAD_ADMIN
)
class DuplicateScadIdInCivi(Report):
def __init__(self):
super().__init__(
introduction=("The following SCAD IDs are "
... | <commit_before><commit_msg>Duplicate SCAD ID in civi<commit_after>#!/usr/bin/env python3
from reporter.reports import Report
from reporter import (
get_contact_id_search_link, RECIPIENT_SCAD_ADMIN
)
class DuplicateScadIdInCivi(Report):
def __init__(self):
super().__init__(
intr... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.