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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f3e68a8c256a13316e96a45a956a632a14221d3f | Files/MoveData.py | Files/MoveData.py | def move_data(token, member_id, from_path, to_path):
url = 'https://api.dropboxapi.com/1/fileops/move'
headers = {'Authorization': 'Bearer %s' % token, 'X-Dropbox-Perform-As-Team-Member': member_id}
data = {'root': 'auto', 'from_path': from_path, 'to_path': to_path}
print 'Moving "%s" to "%s" (member_id: %s)' % (f... | Move Data Function for Python | Move Data Function for Python | Python | apache-2.0 | dropbox/DropboxBusinessScripts,dropbox/DropboxBusinessScripts | Move Data Function for Python | def move_data(token, member_id, from_path, to_path):
url = 'https://api.dropboxapi.com/1/fileops/move'
headers = {'Authorization': 'Bearer %s' % token, 'X-Dropbox-Perform-As-Team-Member': member_id}
data = {'root': 'auto', 'from_path': from_path, 'to_path': to_path}
print 'Moving "%s" to "%s" (member_id: %s)' % (f... | <commit_before><commit_msg>Move Data Function for Python<commit_after> | def move_data(token, member_id, from_path, to_path):
url = 'https://api.dropboxapi.com/1/fileops/move'
headers = {'Authorization': 'Bearer %s' % token, 'X-Dropbox-Perform-As-Team-Member': member_id}
data = {'root': 'auto', 'from_path': from_path, 'to_path': to_path}
print 'Moving "%s" to "%s" (member_id: %s)' % (f... | Move Data Function for Pythondef move_data(token, member_id, from_path, to_path):
url = 'https://api.dropboxapi.com/1/fileops/move'
headers = {'Authorization': 'Bearer %s' % token, 'X-Dropbox-Perform-As-Team-Member': member_id}
data = {'root': 'auto', 'from_path': from_path, 'to_path': to_path}
print 'Moving "%s" ... | <commit_before><commit_msg>Move Data Function for Python<commit_after>def move_data(token, member_id, from_path, to_path):
url = 'https://api.dropboxapi.com/1/fileops/move'
headers = {'Authorization': 'Bearer %s' % token, 'X-Dropbox-Perform-As-Team-Member': member_id}
data = {'root': 'auto', 'from_path': from_path, ... | |
db5f287a7581294bffd49b0f10d7f1d5f73ba1cd | fileuploads/migrations/0038_auto_20170110_1622.py | fileuploads/migrations/0038_auto_20170110_1622.py | # -*- coding: utf-8 -*-
# Generated by Django 1.10.dev20160107235441 on 2017-01-10 21:22
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('signals', '0016_process_file_id'),
('fileuploads', '0037_auto_201701... | Add migration files for previous previous commit (file graph link change) | Add migration files for previous previous commit (file graph link change)
| Python | mit | yayoiukai/signalserver,yayoiukai/signalserver,yayoiukai/signalserver,yayoiukai/signalserver | Add migration files for previous previous commit (file graph link change) | # -*- coding: utf-8 -*-
# Generated by Django 1.10.dev20160107235441 on 2017-01-10 21:22
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('signals', '0016_process_file_id'),
('fileuploads', '0037_auto_201701... | <commit_before><commit_msg>Add migration files for previous previous commit (file graph link change)<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.10.dev20160107235441 on 2017-01-10 21:22
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('signals', '0016_process_file_id'),
('fileuploads', '0037_auto_201701... | Add migration files for previous previous commit (file graph link change)# -*- coding: utf-8 -*-
# Generated by Django 1.10.dev20160107235441 on 2017-01-10 21:22
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('sig... | <commit_before><commit_msg>Add migration files for previous previous commit (file graph link change)<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.10.dev20160107235441 on 2017-01-10 21:22
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migrat... | |
3bfc40c0e0c81723ae43b3dfd4932ba48c3b67e7 | yak/rest_social_auth/backends/yak_instagram.py | yak/rest_social_auth/backends/yak_instagram.py | from instagram import InstagramAPI
from social.backends.instagram import InstagramOAuth2
from yak.rest_social_auth.backends.base import ExtraDataAbstractMixin, ExtraActionsAbstractMixin
class Instagram(ExtraActionsAbstractMixin, ExtraDataAbstractMixin, InstagramOAuth2):
@staticmethod
def save_extra_data(respo... | from instagram import InstagramAPI, helper
from social.backends.instagram import InstagramOAuth2
from yak.rest_social_auth.backends.base import ExtraDataAbstractMixin, ExtraActionsAbstractMixin
class Instagram(ExtraActionsAbstractMixin, ExtraDataAbstractMixin, InstagramOAuth2):
@staticmethod
def save_extra_da... | Fix for undocumented timestamp filtering in python-instagram | Fix for undocumented timestamp filtering in python-instagram
| Python | mit | yeti/YAK-server,sventech/YAK-server,ParableSciences/YAK-server,sventech/YAK-server,ParableSciences/YAK-server,yeti/YAK-server | from instagram import InstagramAPI
from social.backends.instagram import InstagramOAuth2
from yak.rest_social_auth.backends.base import ExtraDataAbstractMixin, ExtraActionsAbstractMixin
class Instagram(ExtraActionsAbstractMixin, ExtraDataAbstractMixin, InstagramOAuth2):
@staticmethod
def save_extra_data(respo... | from instagram import InstagramAPI, helper
from social.backends.instagram import InstagramOAuth2
from yak.rest_social_auth.backends.base import ExtraDataAbstractMixin, ExtraActionsAbstractMixin
class Instagram(ExtraActionsAbstractMixin, ExtraDataAbstractMixin, InstagramOAuth2):
@staticmethod
def save_extra_da... | <commit_before>from instagram import InstagramAPI
from social.backends.instagram import InstagramOAuth2
from yak.rest_social_auth.backends.base import ExtraDataAbstractMixin, ExtraActionsAbstractMixin
class Instagram(ExtraActionsAbstractMixin, ExtraDataAbstractMixin, InstagramOAuth2):
@staticmethod
def save_e... | from instagram import InstagramAPI, helper
from social.backends.instagram import InstagramOAuth2
from yak.rest_social_auth.backends.base import ExtraDataAbstractMixin, ExtraActionsAbstractMixin
class Instagram(ExtraActionsAbstractMixin, ExtraDataAbstractMixin, InstagramOAuth2):
@staticmethod
def save_extra_da... | from instagram import InstagramAPI
from social.backends.instagram import InstagramOAuth2
from yak.rest_social_auth.backends.base import ExtraDataAbstractMixin, ExtraActionsAbstractMixin
class Instagram(ExtraActionsAbstractMixin, ExtraDataAbstractMixin, InstagramOAuth2):
@staticmethod
def save_extra_data(respo... | <commit_before>from instagram import InstagramAPI
from social.backends.instagram import InstagramOAuth2
from yak.rest_social_auth.backends.base import ExtraDataAbstractMixin, ExtraActionsAbstractMixin
class Instagram(ExtraActionsAbstractMixin, ExtraDataAbstractMixin, InstagramOAuth2):
@staticmethod
def save_e... |
a9663c9164bf1ef4ba276a499e4802afb363b1e3 | tests/unit/test_hashable.py | tests/unit/test_hashable.py | from butter.eventfd import Eventfd
from butter.fanotify import Fanotify
from butter.inotify import Inotify
from butter.signalfd import Signalfd
from butter.timerfd import Timerfd
import pytest
@pytest.fixture(params=[Eventfd, Fanotify, Inotify, Signalfd, Timerfd])
def obj(Obj):
o = Obj.__new__(Obj)
retur... | Add test for hashable objects | Add test for hashable objects
| Python | bsd-3-clause | dasSOZO/python-butter,wdv4758h/butter | Add test for hashable objects | from butter.eventfd import Eventfd
from butter.fanotify import Fanotify
from butter.inotify import Inotify
from butter.signalfd import Signalfd
from butter.timerfd import Timerfd
import pytest
@pytest.fixture(params=[Eventfd, Fanotify, Inotify, Signalfd, Timerfd])
def obj(Obj):
o = Obj.__new__(Obj)
retur... | <commit_before><commit_msg>Add test for hashable objects<commit_after> | from butter.eventfd import Eventfd
from butter.fanotify import Fanotify
from butter.inotify import Inotify
from butter.signalfd import Signalfd
from butter.timerfd import Timerfd
import pytest
@pytest.fixture(params=[Eventfd, Fanotify, Inotify, Signalfd, Timerfd])
def obj(Obj):
o = Obj.__new__(Obj)
retur... | Add test for hashable objectsfrom butter.eventfd import Eventfd
from butter.fanotify import Fanotify
from butter.inotify import Inotify
from butter.signalfd import Signalfd
from butter.timerfd import Timerfd
import pytest
@pytest.fixture(params=[Eventfd, Fanotify, Inotify, Signalfd, Timerfd])
def obj(Obj):
o = Ob... | <commit_before><commit_msg>Add test for hashable objects<commit_after>from butter.eventfd import Eventfd
from butter.fanotify import Fanotify
from butter.inotify import Inotify
from butter.signalfd import Signalfd
from butter.timerfd import Timerfd
import pytest
@pytest.fixture(params=[Eventfd, Fanotify, Inotify, Sig... | |
8d3f235af5acd47857939c19563080a1a74b0924 | pxe_manager/tests/test_pxemanager.py | pxe_manager/tests/test_pxemanager.py | from pxe_manager.pxemanager import PxeManager
from resource_manager.client import ResourceManagerClient
import httpretty
@httpretty.activate
def test_defaults():
client = ResourceManagerClient()
cobbler_url = "http://cobbler.example.com/cobbler_api"
cobbler_user = "user"
cobbler_password = "password"
... | Add pxemanager basic unit test | Add pxemanager basic unit test
| Python | apache-2.0 | tbeckham/DeploymentManager,tbeckham/DeploymentManager,tbeckham/DeploymentManager,ccassler/DeploymentManager,ccassler/DeploymentManager,ccassler/DeploymentManager | Add pxemanager basic unit test | from pxe_manager.pxemanager import PxeManager
from resource_manager.client import ResourceManagerClient
import httpretty
@httpretty.activate
def test_defaults():
client = ResourceManagerClient()
cobbler_url = "http://cobbler.example.com/cobbler_api"
cobbler_user = "user"
cobbler_password = "password"
... | <commit_before><commit_msg>Add pxemanager basic unit test<commit_after> | from pxe_manager.pxemanager import PxeManager
from resource_manager.client import ResourceManagerClient
import httpretty
@httpretty.activate
def test_defaults():
client = ResourceManagerClient()
cobbler_url = "http://cobbler.example.com/cobbler_api"
cobbler_user = "user"
cobbler_password = "password"
... | Add pxemanager basic unit testfrom pxe_manager.pxemanager import PxeManager
from resource_manager.client import ResourceManagerClient
import httpretty
@httpretty.activate
def test_defaults():
client = ResourceManagerClient()
cobbler_url = "http://cobbler.example.com/cobbler_api"
cobbler_user = "user"
c... | <commit_before><commit_msg>Add pxemanager basic unit test<commit_after>from pxe_manager.pxemanager import PxeManager
from resource_manager.client import ResourceManagerClient
import httpretty
@httpretty.activate
def test_defaults():
client = ResourceManagerClient()
cobbler_url = "http://cobbler.example.com/cob... | |
ed9a02a769a64edae6aa0e4a06acf7a8fe31cd89 | scripts/create_windows_virtenv.py | scripts/create_windows_virtenv.py | #!/usr/bin/env python
import platform
import shutil
import subprocess
import sys
from os.path import dirname, isdir, join as join_path
file_path = dirname(__file__)
requirements_path = '/'.join(file_path.split('/')[:-1]) + "/requirements"
root_path = file_path.split('/')[:-2]
root_path = '/'.join(root_path)
class V... | Create virtual builder for windows OS | Create virtual builder for windows OS
| Python | mit | Rositsazz/hack33,Rositsazz/hack33,Rositsazz/hack33,Rositsazz/hack33 | Create virtual builder for windows OS | #!/usr/bin/env python
import platform
import shutil
import subprocess
import sys
from os.path import dirname, isdir, join as join_path
file_path = dirname(__file__)
requirements_path = '/'.join(file_path.split('/')[:-1]) + "/requirements"
root_path = file_path.split('/')[:-2]
root_path = '/'.join(root_path)
class V... | <commit_before><commit_msg>Create virtual builder for windows OS<commit_after> | #!/usr/bin/env python
import platform
import shutil
import subprocess
import sys
from os.path import dirname, isdir, join as join_path
file_path = dirname(__file__)
requirements_path = '/'.join(file_path.split('/')[:-1]) + "/requirements"
root_path = file_path.split('/')[:-2]
root_path = '/'.join(root_path)
class V... | Create virtual builder for windows OS#!/usr/bin/env python
import platform
import shutil
import subprocess
import sys
from os.path import dirname, isdir, join as join_path
file_path = dirname(__file__)
requirements_path = '/'.join(file_path.split('/')[:-1]) + "/requirements"
root_path = file_path.split('/')[:-2]
root... | <commit_before><commit_msg>Create virtual builder for windows OS<commit_after>#!/usr/bin/env python
import platform
import shutil
import subprocess
import sys
from os.path import dirname, isdir, join as join_path
file_path = dirname(__file__)
requirements_path = '/'.join(file_path.split('/')[:-1]) + "/requirements"
r... | |
c08a7f6d095fd68213efefa2f969fb0b02189794 | tests/test_deconv_sanity.py | tests/test_deconv_sanity.py | """
Simple sanity check for deconvolution layer.
"""
import numpy as np
from numpy.testing import assert_array_almost_equal
from pylearn2.models.mlp import MLP
from pylearn2.space import Conv2DSpace
import theano
from adversarial.deconv import Deconv
input_space = Conv2DSpace(shape=(2, 1), num_channels=16, axes=('c... | Add simple sanity check test for deconvolution | Add simple sanity check test for deconvolution
| Python | bsd-3-clause | hans/adversarial | Add simple sanity check test for deconvolution | """
Simple sanity check for deconvolution layer.
"""
import numpy as np
from numpy.testing import assert_array_almost_equal
from pylearn2.models.mlp import MLP
from pylearn2.space import Conv2DSpace
import theano
from adversarial.deconv import Deconv
input_space = Conv2DSpace(shape=(2, 1), num_channels=16, axes=('c... | <commit_before><commit_msg>Add simple sanity check test for deconvolution<commit_after> | """
Simple sanity check for deconvolution layer.
"""
import numpy as np
from numpy.testing import assert_array_almost_equal
from pylearn2.models.mlp import MLP
from pylearn2.space import Conv2DSpace
import theano
from adversarial.deconv import Deconv
input_space = Conv2DSpace(shape=(2, 1), num_channels=16, axes=('c... | Add simple sanity check test for deconvolution"""
Simple sanity check for deconvolution layer.
"""
import numpy as np
from numpy.testing import assert_array_almost_equal
from pylearn2.models.mlp import MLP
from pylearn2.space import Conv2DSpace
import theano
from adversarial.deconv import Deconv
input_space = Conv2... | <commit_before><commit_msg>Add simple sanity check test for deconvolution<commit_after>"""
Simple sanity check for deconvolution layer.
"""
import numpy as np
from numpy.testing import assert_array_almost_equal
from pylearn2.models.mlp import MLP
from pylearn2.space import Conv2DSpace
import theano
from adversarial.d... | |
b848c73bf4f7bfbb5c4256457131e480ed6b82e9 | VS_BeforeBuild.py | VS_BeforeBuild.py | """
This routine is executed on Before Build every time user build a Visual Studio project.
TODO:
CHM web template with logo.
Custom Icon Strip for CHM Files.
Author: Tony Ho @ AR-MA 2018
"""
from subprocess import call
import os
import fnmatch
def Run():
GenerateDocsInRhino()
Gene... | Integrate with armacode Visual Studio project. This generate htmlhelp CHM file to be distributed with armacode. | Integrate with armacode Visual Studio project.
This generate htmlhelp CHM file to be distributed with armacode.
| Python | mit | theTonyHo/armacode,theTonyHo/armacode,theTonyHo/armacode,theTonyHo/armacode | Integrate with armacode Visual Studio project.
This generate htmlhelp CHM file to be distributed with armacode. | """
This routine is executed on Before Build every time user build a Visual Studio project.
TODO:
CHM web template with logo.
Custom Icon Strip for CHM Files.
Author: Tony Ho @ AR-MA 2018
"""
from subprocess import call
import os
import fnmatch
def Run():
GenerateDocsInRhino()
Gene... | <commit_before><commit_msg>Integrate with armacode Visual Studio project.
This generate htmlhelp CHM file to be distributed with armacode.<commit_after> | """
This routine is executed on Before Build every time user build a Visual Studio project.
TODO:
CHM web template with logo.
Custom Icon Strip for CHM Files.
Author: Tony Ho @ AR-MA 2018
"""
from subprocess import call
import os
import fnmatch
def Run():
GenerateDocsInRhino()
Gene... | Integrate with armacode Visual Studio project.
This generate htmlhelp CHM file to be distributed with armacode."""
This routine is executed on Before Build every time user build a Visual Studio project.
TODO:
CHM web template with logo.
Custom Icon Strip for CHM Files.
Author: Tony Ho @ AR-MA 2018
"""... | <commit_before><commit_msg>Integrate with armacode Visual Studio project.
This generate htmlhelp CHM file to be distributed with armacode.<commit_after>"""
This routine is executed on Before Build every time user build a Visual Studio project.
TODO:
CHM web template with logo.
Custom Icon Strip for CHM Fi... | |
5229d5bbf1f823b9a7e49a4004e87da043643af7 | scripts/remove_after_use/remove_duped_subject.py | scripts/remove_after_use/remove_duped_subject.py | # -*- coding: utf-8 -*-
import sys
import logging
from dateutil.parser import parse
from website.app import setup_django
setup_django()
from osf.models import PreprintService, Subject
from scripts import utils as script_utils
logger = logging.getLogger(__name__)
CUSTOM_TAXONOMY_APPLIED_DATE = '2018-07-17T22:56:02.2... | Remove duplicate psyarxiv custom subject. | Remove duplicate psyarxiv custom subject.
* Remove from existing preprints.
* Replace with correct subject on new preprints.
h/t @mfraezz
| Python | apache-2.0 | saradbowman/osf.io,felliott/osf.io,cslzchen/osf.io,baylee-d/osf.io,pattisdr/osf.io,HalcyonChimera/osf.io,CenterForOpenScience/osf.io,Johnetordoff/osf.io,adlius/osf.io,baylee-d/osf.io,caseyrollins/osf.io,felliott/osf.io,aaxelb/osf.io,cslzchen/osf.io,mfraezz/osf.io,pattisdr/osf.io,adlius/osf.io,pattisdr/osf.io,mfraezz/os... | Remove duplicate psyarxiv custom subject.
* Remove from existing preprints.
* Replace with correct subject on new preprints.
h/t @mfraezz | # -*- coding: utf-8 -*-
import sys
import logging
from dateutil.parser import parse
from website.app import setup_django
setup_django()
from osf.models import PreprintService, Subject
from scripts import utils as script_utils
logger = logging.getLogger(__name__)
CUSTOM_TAXONOMY_APPLIED_DATE = '2018-07-17T22:56:02.2... | <commit_before><commit_msg>Remove duplicate psyarxiv custom subject.
* Remove from existing preprints.
* Replace with correct subject on new preprints.
h/t @mfraezz<commit_after> | # -*- coding: utf-8 -*-
import sys
import logging
from dateutil.parser import parse
from website.app import setup_django
setup_django()
from osf.models import PreprintService, Subject
from scripts import utils as script_utils
logger = logging.getLogger(__name__)
CUSTOM_TAXONOMY_APPLIED_DATE = '2018-07-17T22:56:02.2... | Remove duplicate psyarxiv custom subject.
* Remove from existing preprints.
* Replace with correct subject on new preprints.
h/t @mfraezz# -*- coding: utf-8 -*-
import sys
import logging
from dateutil.parser import parse
from website.app import setup_django
setup_django()
from osf.models import PreprintService, Sub... | <commit_before><commit_msg>Remove duplicate psyarxiv custom subject.
* Remove from existing preprints.
* Replace with correct subject on new preprints.
h/t @mfraezz<commit_after># -*- coding: utf-8 -*-
import sys
import logging
from dateutil.parser import parse
from website.app import setup_django
setup_django()
fr... | |
3f17c3aa44b281b4b33d2c587f7bfb498df3ac0f | deepLearningWithNeuralNetworks/create_sentiment_featuresets.py | deepLearningWithNeuralNetworks/create_sentiment_featuresets.py | # -*- coding: utf-8 -*-
"""Creates sentiment featuresets by preprocessing the data with nltk."""
import pickle
from nltk.tokenize import word_tokenize
from nltk.stem import WordNetLemmatizer
import numpy as np
import random
from collections import Counter
lemmatizer = WordNetLemmatizer()
hm_lines = 10000000
def crea... | Add script to pre-process data for deep learning | Add script to pre-process data for deep learning
| Python | mit | a-holm/MachinelearningAlgorithms,a-holm/MachinelearningAlgorithms | Add script to pre-process data for deep learning | # -*- coding: utf-8 -*-
"""Creates sentiment featuresets by preprocessing the data with nltk."""
import pickle
from nltk.tokenize import word_tokenize
from nltk.stem import WordNetLemmatizer
import numpy as np
import random
from collections import Counter
lemmatizer = WordNetLemmatizer()
hm_lines = 10000000
def crea... | <commit_before><commit_msg>Add script to pre-process data for deep learning<commit_after> | # -*- coding: utf-8 -*-
"""Creates sentiment featuresets by preprocessing the data with nltk."""
import pickle
from nltk.tokenize import word_tokenize
from nltk.stem import WordNetLemmatizer
import numpy as np
import random
from collections import Counter
lemmatizer = WordNetLemmatizer()
hm_lines = 10000000
def crea... | Add script to pre-process data for deep learning# -*- coding: utf-8 -*-
"""Creates sentiment featuresets by preprocessing the data with nltk."""
import pickle
from nltk.tokenize import word_tokenize
from nltk.stem import WordNetLemmatizer
import numpy as np
import random
from collections import Counter
lemmatizer = Wo... | <commit_before><commit_msg>Add script to pre-process data for deep learning<commit_after># -*- coding: utf-8 -*-
"""Creates sentiment featuresets by preprocessing the data with nltk."""
import pickle
from nltk.tokenize import word_tokenize
from nltk.stem import WordNetLemmatizer
import numpy as np
import random
from co... | |
9540d890991eb60838a927df6d83e0f89fd7f7ea | distarray/tests/ipcluster.py | distarray/tests/ipcluster.py | """
Simple runner for `ipcluster start` or `ipcluster stop` on Python 2 or 3, as
appropriate.
"""
import sys
import six
from subprocess import Popen, PIPE
if six.PY2:
ipcluster_cmd = 'ipcluster'
elif six.PY3:
ipcluster_cmd = 'ipcluster3'
else:
raise NotImplementedError("Not run with Python 2 *or* 3?")
... | """
Simple runner for `ipcluster start` or `ipcluster stop` on Python 2 or 3, as
appropriate.
"""
import sys
import six
from subprocess import Popen, PIPE
if six.PY2:
ipcluster_cmd = 'ipcluster'
elif six.PY3:
ipcluster_cmd = 'ipcluster3'
else:
raise NotImplementedError("Not run with Python 2 *or* 3?")
... | Change the default number of engines to 4. | Change the default number of engines to 4.
Only 4 are needed for our current tests. | Python | bsd-3-clause | RaoUmer/distarray,enthought/distarray,RaoUmer/distarray,enthought/distarray | """
Simple runner for `ipcluster start` or `ipcluster stop` on Python 2 or 3, as
appropriate.
"""
import sys
import six
from subprocess import Popen, PIPE
if six.PY2:
ipcluster_cmd = 'ipcluster'
elif six.PY3:
ipcluster_cmd = 'ipcluster3'
else:
raise NotImplementedError("Not run with Python 2 *or* 3?")
... | """
Simple runner for `ipcluster start` or `ipcluster stop` on Python 2 or 3, as
appropriate.
"""
import sys
import six
from subprocess import Popen, PIPE
if six.PY2:
ipcluster_cmd = 'ipcluster'
elif six.PY3:
ipcluster_cmd = 'ipcluster3'
else:
raise NotImplementedError("Not run with Python 2 *or* 3?")
... | <commit_before>"""
Simple runner for `ipcluster start` or `ipcluster stop` on Python 2 or 3, as
appropriate.
"""
import sys
import six
from subprocess import Popen, PIPE
if six.PY2:
ipcluster_cmd = 'ipcluster'
elif six.PY3:
ipcluster_cmd = 'ipcluster3'
else:
raise NotImplementedError("Not run with Python... | """
Simple runner for `ipcluster start` or `ipcluster stop` on Python 2 or 3, as
appropriate.
"""
import sys
import six
from subprocess import Popen, PIPE
if six.PY2:
ipcluster_cmd = 'ipcluster'
elif six.PY3:
ipcluster_cmd = 'ipcluster3'
else:
raise NotImplementedError("Not run with Python 2 *or* 3?")
... | """
Simple runner for `ipcluster start` or `ipcluster stop` on Python 2 or 3, as
appropriate.
"""
import sys
import six
from subprocess import Popen, PIPE
if six.PY2:
ipcluster_cmd = 'ipcluster'
elif six.PY3:
ipcluster_cmd = 'ipcluster3'
else:
raise NotImplementedError("Not run with Python 2 *or* 3?")
... | <commit_before>"""
Simple runner for `ipcluster start` or `ipcluster stop` on Python 2 or 3, as
appropriate.
"""
import sys
import six
from subprocess import Popen, PIPE
if six.PY2:
ipcluster_cmd = 'ipcluster'
elif six.PY3:
ipcluster_cmd = 'ipcluster3'
else:
raise NotImplementedError("Not run with Python... |
05f53e2a39d4947ae4bf6b37f5e7a8389d833ed2 | migrations/versions/970_add_downloaded_at_column_to_direct_.py | migrations/versions/970_add_downloaded_at_column_to_direct_.py | """add downloaded_at column to direct award projects
Revision ID: 970
Revises: 960
Create Date: 2017-09-04 09:25:41.968481
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '970'
down_revision = '960'
def upgrade():
# ### commands auto generated by Alembic... | Add migration for database to add downloaded_at column | Add migration for database to add downloaded_at column
| Python | mit | alphagov/digitalmarketplace-api,alphagov/digitalmarketplace-api,alphagov/digitalmarketplace-api | Add migration for database to add downloaded_at column | """add downloaded_at column to direct award projects
Revision ID: 970
Revises: 960
Create Date: 2017-09-04 09:25:41.968481
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '970'
down_revision = '960'
def upgrade():
# ### commands auto generated by Alembic... | <commit_before><commit_msg>Add migration for database to add downloaded_at column<commit_after> | """add downloaded_at column to direct award projects
Revision ID: 970
Revises: 960
Create Date: 2017-09-04 09:25:41.968481
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '970'
down_revision = '960'
def upgrade():
# ### commands auto generated by Alembic... | Add migration for database to add downloaded_at column"""add downloaded_at column to direct award projects
Revision ID: 970
Revises: 960
Create Date: 2017-09-04 09:25:41.968481
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '970'
down_revision = '960'
def u... | <commit_before><commit_msg>Add migration for database to add downloaded_at column<commit_after>"""add downloaded_at column to direct award projects
Revision ID: 970
Revises: 960
Create Date: 2017-09-04 09:25:41.968481
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revis... | |
2bfe6ac9e0408fa418dd3faea4c1e0bbd224949e | nixkeyboard.py | nixkeyboard.py | def read_device_file():
from pathlib import Path
event_files = Path('/dev/input/by-id').glob('*-event-kbd')
for event_file in event_files:
if '-if01-' not in event_file.name:
break
with event_file.open('rb') as events:
while True:
yield events.read(1)
def liste... | Add initial structure for Unix support | Add initial structure for Unix support
| Python | mit | glitchassassin/keyboard,boppreh/keyboard | Add initial structure for Unix support | def read_device_file():
from pathlib import Path
event_files = Path('/dev/input/by-id').glob('*-event-kbd')
for event_file in event_files:
if '-if01-' not in event_file.name:
break
with event_file.open('rb') as events:
while True:
yield events.read(1)
def liste... | <commit_before><commit_msg>Add initial structure for Unix support<commit_after> | def read_device_file():
from pathlib import Path
event_files = Path('/dev/input/by-id').glob('*-event-kbd')
for event_file in event_files:
if '-if01-' not in event_file.name:
break
with event_file.open('rb') as events:
while True:
yield events.read(1)
def liste... | Add initial structure for Unix supportdef read_device_file():
from pathlib import Path
event_files = Path('/dev/input/by-id').glob('*-event-kbd')
for event_file in event_files:
if '-if01-' not in event_file.name:
break
with event_file.open('rb') as events:
while True:
... | <commit_before><commit_msg>Add initial structure for Unix support<commit_after>def read_device_file():
from pathlib import Path
event_files = Path('/dev/input/by-id').glob('*-event-kbd')
for event_file in event_files:
if '-if01-' not in event_file.name:
break
with event_file.open('... | |
e53f3eb1676f851362d6c81171c713877215a99b | google/colab/_serverextension/_resource_monitor.py | google/colab/_serverextension/_resource_monitor.py | """Methods for tracking resource consumption of Colab kernels."""
import csv
import os
import re
import subprocess
from distutils import spawn
_cmd_regex = re.compile(r'.+kernel-(.+)\.json.*')
def get_gpu_usage():
"""Reports total and per-kernel GPU memory usage.
Returns:
A dict of the form {
usage: ... | Add library for monitoring RAM/GPU Memory | Add library for monitoring RAM/GPU Memory
PiperOrigin-RevId: 208935123
| Python | apache-2.0 | googlecolab/colabtools,googlecolab/colabtools | Add library for monitoring RAM/GPU Memory
PiperOrigin-RevId: 208935123 | """Methods for tracking resource consumption of Colab kernels."""
import csv
import os
import re
import subprocess
from distutils import spawn
_cmd_regex = re.compile(r'.+kernel-(.+)\.json.*')
def get_gpu_usage():
"""Reports total and per-kernel GPU memory usage.
Returns:
A dict of the form {
usage: ... | <commit_before><commit_msg>Add library for monitoring RAM/GPU Memory
PiperOrigin-RevId: 208935123<commit_after> | """Methods for tracking resource consumption of Colab kernels."""
import csv
import os
import re
import subprocess
from distutils import spawn
_cmd_regex = re.compile(r'.+kernel-(.+)\.json.*')
def get_gpu_usage():
"""Reports total and per-kernel GPU memory usage.
Returns:
A dict of the form {
usage: ... | Add library for monitoring RAM/GPU Memory
PiperOrigin-RevId: 208935123"""Methods for tracking resource consumption of Colab kernels."""
import csv
import os
import re
import subprocess
from distutils import spawn
_cmd_regex = re.compile(r'.+kernel-(.+)\.json.*')
def get_gpu_usage():
"""Reports total and per-kern... | <commit_before><commit_msg>Add library for monitoring RAM/GPU Memory
PiperOrigin-RevId: 208935123<commit_after>"""Methods for tracking resource consumption of Colab kernels."""
import csv
import os
import re
import subprocess
from distutils import spawn
_cmd_regex = re.compile(r'.+kernel-(.+)\.json.*')
def get_gpu... | |
5231979e72624de6c0cbb26b8d531ff0ed046131 | rftest/topo-4sw-4host-mn2.py | rftest/topo-4sw-4host-mn2.py | """Custom topology example
author: Marcelo Nascimento ([email protected])
Four switches connected in mesh topology plus a host for each switch:
h1 --- sA ---- sB --- h2
| \ |
| \ |
| \ |
| \ |
h3 --- sC ---- sD --- h4
Adding the ... | Add mininet2 topology file for rftest2 | Add mininet2 topology file for rftest2
Signed-off-by: Joe Stringer <[email protected]>
| Python | apache-2.0 | rsanger/RouteFlow,raphaelvrosa/RouteFlow,c3m3gyanesh/RouteFlow-OpenConfig,ralph-mikera/RouteFlow-1,ralph-mikera/RouteFlow-1,routeflow/RouteFlow,c3m3gyanesh/RouteFlow-OpenConfig,srijanmishra/RouteFlow,ralph-mikera/RouteFlow-1,srijanmishra/RouteFlow,arazmj/RouteFlow,raphaelvrosa/RouteFlow,routeflow/RouteFlow,CPqD/RouteFl... | Add mininet2 topology file for rftest2
Signed-off-by: Joe Stringer <[email protected]> | """Custom topology example
author: Marcelo Nascimento ([email protected])
Four switches connected in mesh topology plus a host for each switch:
h1 --- sA ---- sB --- h2
| \ |
| \ |
| \ |
| \ |
h3 --- sC ---- sD --- h4
Adding the ... | <commit_before><commit_msg>Add mininet2 topology file for rftest2
Signed-off-by: Joe Stringer <[email protected]><commit_after> | """Custom topology example
author: Marcelo Nascimento ([email protected])
Four switches connected in mesh topology plus a host for each switch:
h1 --- sA ---- sB --- h2
| \ |
| \ |
| \ |
| \ |
h3 --- sC ---- sD --- h4
Adding the ... | Add mininet2 topology file for rftest2
Signed-off-by: Joe Stringer <[email protected]>"""Custom topology example
author: Marcelo Nascimento ([email protected])
Four switches connected in mesh topology plus a host for each switch:
h1 --- sA ---- sB --- h2
| ... | <commit_before><commit_msg>Add mininet2 topology file for rftest2
Signed-off-by: Joe Stringer <[email protected]><commit_after>"""Custom topology example
author: Marcelo Nascimento ([email protected])
Four switches connected in mesh topology plus a host for each switch:
h1... | |
bde2509df82a901a1530bc0189a4f1f5443375c6 | tests/test_completion_skin_rainmeter_section.py | tests/test_completion_skin_rainmeter_section.py | import sys
from unittest import TestCase
rainmeter_section = sys.modules["Rainmeter.completion.skin.rainmeter_section"]
class TestFunctions(TestCase):
def test_completion_skin_rainmeter_section_with_not_rainmeter_should_return_none(self):
"""
The given section is 'Different' but we are moving i... | Add initial test for skin rainmeter section | Add initial test for skin rainmeter section
| Python | mit | thatsIch/sublime-rainmeter | Add initial test for skin rainmeter section | import sys
from unittest import TestCase
rainmeter_section = sys.modules["Rainmeter.completion.skin.rainmeter_section"]
class TestFunctions(TestCase):
def test_completion_skin_rainmeter_section_with_not_rainmeter_should_return_none(self):
"""
The given section is 'Different' but we are moving i... | <commit_before><commit_msg>Add initial test for skin rainmeter section<commit_after> | import sys
from unittest import TestCase
rainmeter_section = sys.modules["Rainmeter.completion.skin.rainmeter_section"]
class TestFunctions(TestCase):
def test_completion_skin_rainmeter_section_with_not_rainmeter_should_return_none(self):
"""
The given section is 'Different' but we are moving i... | Add initial test for skin rainmeter sectionimport sys
from unittest import TestCase
rainmeter_section = sys.modules["Rainmeter.completion.skin.rainmeter_section"]
class TestFunctions(TestCase):
def test_completion_skin_rainmeter_section_with_not_rainmeter_should_return_none(self):
"""
The given... | <commit_before><commit_msg>Add initial test for skin rainmeter section<commit_after>import sys
from unittest import TestCase
rainmeter_section = sys.modules["Rainmeter.completion.skin.rainmeter_section"]
class TestFunctions(TestCase):
def test_completion_skin_rainmeter_section_with_not_rainmeter_should_return_... | |
a0924b2a68d05ad778e5b792aace2dbac7bd6a7c | tests/test_encrypt.py | tests/test_encrypt.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from future.utils import bytes_to_native_str as n
from base64 import b64decode
import os
import boto3
import pytest
from figgypy.utils import kms_encrypt
@pytest.mark.skipif(os.environ.get('INTEGRATION') is None,
reason="credential... | Create integration test to verify KMS encryption | Create integration test to verify KMS encryption
| Python | mit | theherk/figgypy | Create integration test to verify KMS encryption | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from future.utils import bytes_to_native_str as n
from base64 import b64decode
import os
import boto3
import pytest
from figgypy.utils import kms_encrypt
@pytest.mark.skipif(os.environ.get('INTEGRATION') is None,
reason="credential... | <commit_before><commit_msg>Create integration test to verify KMS encryption<commit_after> | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from future.utils import bytes_to_native_str as n
from base64 import b64decode
import os
import boto3
import pytest
from figgypy.utils import kms_encrypt
@pytest.mark.skipif(os.environ.get('INTEGRATION') is None,
reason="credential... | Create integration test to verify KMS encryption# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from future.utils import bytes_to_native_str as n
from base64 import b64decode
import os
import boto3
import pytest
from figgypy.utils import kms_encrypt
@pytest.mark.skipif(os.environ.get('INTEGRATION')... | <commit_before><commit_msg>Create integration test to verify KMS encryption<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from future.utils import bytes_to_native_str as n
from base64 import b64decode
import os
import boto3
import pytest
from figgypy.utils import kms_encrypt
@pytest.... | |
5ca43c4c1e357042a371cf876f4a55259fdebf2b | src/epiweb/apps/survey/management.py | src/epiweb/apps/survey/management.py | from django.dispatch import dispatcher
from django.db.models import signals
from epiweb.apps.survey import models
def post_syncdb(sender, **kwargs):
app = kwargs['app']
created_models = kwargs['created_models']
if (app == models) and (models.Survey in created_models):
survey = models.Survey()
... | Add dummy data to Survey model. | Add dummy data to Survey model.
| Python | agpl-3.0 | ISIFoundation/influenzanet-website,ISIFoundation/influenzanet-website,ISIFoundation/influenzanet-website,ISIFoundation/influenzanet-website,ISIFoundation/influenzanet-website,ISIFoundation/influenzanet-website,ISIFoundation/influenzanet-website | Add dummy data to Survey model. | from django.dispatch import dispatcher
from django.db.models import signals
from epiweb.apps.survey import models
def post_syncdb(sender, **kwargs):
app = kwargs['app']
created_models = kwargs['created_models']
if (app == models) and (models.Survey in created_models):
survey = models.Survey()
... | <commit_before><commit_msg>Add dummy data to Survey model.<commit_after> | from django.dispatch import dispatcher
from django.db.models import signals
from epiweb.apps.survey import models
def post_syncdb(sender, **kwargs):
app = kwargs['app']
created_models = kwargs['created_models']
if (app == models) and (models.Survey in created_models):
survey = models.Survey()
... | Add dummy data to Survey model.from django.dispatch import dispatcher
from django.db.models import signals
from epiweb.apps.survey import models
def post_syncdb(sender, **kwargs):
app = kwargs['app']
created_models = kwargs['created_models']
if (app == models) and (models.Survey in created_models):
... | <commit_before><commit_msg>Add dummy data to Survey model.<commit_after>from django.dispatch import dispatcher
from django.db.models import signals
from epiweb.apps.survey import models
def post_syncdb(sender, **kwargs):
app = kwargs['app']
created_models = kwargs['created_models']
if (app == models) and ... | |
e75aecc3e8606559fa722f7ffb081e2df258b60f | py/search-in-rotated-sorted-array.py | py/search-in-rotated-sorted-array.py | class Solution(object):
def search(self, nums, target):
"""
:type nums: List[int]
:type target: int
:rtype: int
"""
if len(nums) == 1:
return 0 if nums[0] == target else -1
if target >= nums[0]:
L, U = -1, len(nums)
while L ... | Add py solution for Search in Rotated Sorted Array | Add py solution for Search in Rotated Sorted Array
Search in Rotated Sorted Array: https://leetcode.com/problems/search-in-rotated-sorted-array/
| Python | apache-2.0 | ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode | Add py solution for Search in Rotated Sorted Array
Search in Rotated Sorted Array: https://leetcode.com/problems/search-in-rotated-sorted-array/ | class Solution(object):
def search(self, nums, target):
"""
:type nums: List[int]
:type target: int
:rtype: int
"""
if len(nums) == 1:
return 0 if nums[0] == target else -1
if target >= nums[0]:
L, U = -1, len(nums)
while L ... | <commit_before><commit_msg>Add py solution for Search in Rotated Sorted Array
Search in Rotated Sorted Array: https://leetcode.com/problems/search-in-rotated-sorted-array/<commit_after> | class Solution(object):
def search(self, nums, target):
"""
:type nums: List[int]
:type target: int
:rtype: int
"""
if len(nums) == 1:
return 0 if nums[0] == target else -1
if target >= nums[0]:
L, U = -1, len(nums)
while L ... | Add py solution for Search in Rotated Sorted Array
Search in Rotated Sorted Array: https://leetcode.com/problems/search-in-rotated-sorted-array/class Solution(object):
def search(self, nums, target):
"""
:type nums: List[int]
:type target: int
:rtype: int
"""
if len(... | <commit_before><commit_msg>Add py solution for Search in Rotated Sorted Array
Search in Rotated Sorted Array: https://leetcode.com/problems/search-in-rotated-sorted-array/<commit_after>class Solution(object):
def search(self, nums, target):
"""
:type nums: List[int]
:type target: int
... | |
4bac6dab8168170cca42f70f2c13dad5467d3cbb | ffdc/plugins/date_time_utils.py | ffdc/plugins/date_time_utils.py | #!/usr/bin/env python
r"""
This module contains functions having to do with date time filter.
"""
from datetime import datetime
def convert_string_dateime(date_str, date_format, desired_format):
r"""
Return a date time formatted from a string datetime.
Description of arguments(s):
date_str ... | Add date time util module | Plugin: Add date time util module
Change-Id: I6ab1d8bb8df63b8590ce7800e60415d90ea3bad3
Signed-off-by: George Keishing <[email protected]>
| Python | apache-2.0 | openbmc/openbmc-test-automation,openbmc/openbmc-test-automation | Plugin: Add date time util module
Change-Id: I6ab1d8bb8df63b8590ce7800e60415d90ea3bad3
Signed-off-by: George Keishing <[email protected]> | #!/usr/bin/env python
r"""
This module contains functions having to do with date time filter.
"""
from datetime import datetime
def convert_string_dateime(date_str, date_format, desired_format):
r"""
Return a date time formatted from a string datetime.
Description of arguments(s):
date_str ... | <commit_before><commit_msg>Plugin: Add date time util module
Change-Id: I6ab1d8bb8df63b8590ce7800e60415d90ea3bad3
Signed-off-by: George Keishing <[email protected]><commit_after> | #!/usr/bin/env python
r"""
This module contains functions having to do with date time filter.
"""
from datetime import datetime
def convert_string_dateime(date_str, date_format, desired_format):
r"""
Return a date time formatted from a string datetime.
Description of arguments(s):
date_str ... | Plugin: Add date time util module
Change-Id: I6ab1d8bb8df63b8590ce7800e60415d90ea3bad3
Signed-off-by: George Keishing <[email protected]>#!/usr/bin/env python
r"""
This module contains functions having to do with date time filter.
"""
from datetime import datetime
def convert_stri... | <commit_before><commit_msg>Plugin: Add date time util module
Change-Id: I6ab1d8bb8df63b8590ce7800e60415d90ea3bad3
Signed-off-by: George Keishing <[email protected]><commit_after>#!/usr/bin/env python
r"""
This module contains functions having to do with date time filter.
"""
from da... | |
c0041317494eab24ec7eef92eb7716d0b00be8fa | api/management/commands/generate_certificate.py | api/management/commands/generate_certificate.py | # coding=utf8
from django.core.management.base import BaseCommand, CommandError
from certificates.generator import *
from api.models import Event
class Command(BaseCommand):
args = '<event-id> [<event-id>, ...]'
help = """
Generates or regenerates a certificate for a given event.
"""
def handle(se... | Add a command for manual certificate regeneration | Add a command for manual certificate regeneration
Sometimes we may need to test or regenerate a certificate manually, in
case the procedure failed the first time.
| Python | mit | codeeu/coding-events,codeeu/coding-events,codeeu/coding-events,codeeu/coding-events,codeeu/coding-events | Add a command for manual certificate regeneration
Sometimes we may need to test or regenerate a certificate manually, in
case the procedure failed the first time. | # coding=utf8
from django.core.management.base import BaseCommand, CommandError
from certificates.generator import *
from api.models import Event
class Command(BaseCommand):
args = '<event-id> [<event-id>, ...]'
help = """
Generates or regenerates a certificate for a given event.
"""
def handle(se... | <commit_before><commit_msg>Add a command for manual certificate regeneration
Sometimes we may need to test or regenerate a certificate manually, in
case the procedure failed the first time.<commit_after> | # coding=utf8
from django.core.management.base import BaseCommand, CommandError
from certificates.generator import *
from api.models import Event
class Command(BaseCommand):
args = '<event-id> [<event-id>, ...]'
help = """
Generates or regenerates a certificate for a given event.
"""
def handle(se... | Add a command for manual certificate regeneration
Sometimes we may need to test or regenerate a certificate manually, in
case the procedure failed the first time.# coding=utf8
from django.core.management.base import BaseCommand, CommandError
from certificates.generator import *
from api.models import Event
class Comm... | <commit_before><commit_msg>Add a command for manual certificate regeneration
Sometimes we may need to test or regenerate a certificate manually, in
case the procedure failed the first time.<commit_after># coding=utf8
from django.core.management.base import BaseCommand, CommandError
from certificates.generator import *... | |
fd332ab34d1380d103b89dae942fbf2ca4334749 | scripts/find_missing_miro_records.py | scripts/find_missing_miro_records.py | #!/usr/bin/env python3
# -*- encoding: utf-8 -*-
"""
This is a diagnostic script for finding Miro records that have been
pushed into DynamoDB but aren't available in the API -- which may be an
indicator that the pipeline is leaking somewhere.
"""
import pprint
import sys
import boto3
import requests
def api_miro_id... | Check in my script for finding missing Miro IDs | Check in my script for finding missing Miro IDs
| Python | mit | wellcometrust/platform-api,wellcometrust/platform-api,wellcometrust/platform-api,wellcometrust/platform-api | Check in my script for finding missing Miro IDs | #!/usr/bin/env python3
# -*- encoding: utf-8 -*-
"""
This is a diagnostic script for finding Miro records that have been
pushed into DynamoDB but aren't available in the API -- which may be an
indicator that the pipeline is leaking somewhere.
"""
import pprint
import sys
import boto3
import requests
def api_miro_id... | <commit_before><commit_msg>Check in my script for finding missing Miro IDs<commit_after> | #!/usr/bin/env python3
# -*- encoding: utf-8 -*-
"""
This is a diagnostic script for finding Miro records that have been
pushed into DynamoDB but aren't available in the API -- which may be an
indicator that the pipeline is leaking somewhere.
"""
import pprint
import sys
import boto3
import requests
def api_miro_id... | Check in my script for finding missing Miro IDs#!/usr/bin/env python3
# -*- encoding: utf-8 -*-
"""
This is a diagnostic script for finding Miro records that have been
pushed into DynamoDB but aren't available in the API -- which may be an
indicator that the pipeline is leaking somewhere.
"""
import pprint
import sys
... | <commit_before><commit_msg>Check in my script for finding missing Miro IDs<commit_after>#!/usr/bin/env python3
# -*- encoding: utf-8 -*-
"""
This is a diagnostic script for finding Miro records that have been
pushed into DynamoDB but aren't available in the API -- which may be an
indicator that the pipeline is leaking ... | |
0a4dc6c864387b2a70d85279623523003700affb | py509/utils.py | py509/utils.py | def tree(node, _depth=1):
"""Print a tree.
Sometimes it's useful to print datastructures as a tree. This function prints
out a pretty tree with root `node`. A tree is represented as a :class:`dict`,
whose keys are node names and values are :class:`dict` objects for sub-trees
and :class:`None` for terminals.
... | Add a few utilities for printing results | Add a few utilities for printing results
1) Copy over the ``tree`` function from sholsapp/powertools repository.
2) Add a ``assemble_chain`` function for pretty printing verification
results.
| Python | apache-2.0 | sholsapp/py509 | Add a few utilities for printing results
1) Copy over the ``tree`` function from sholsapp/powertools repository.
2) Add a ``assemble_chain`` function for pretty printing verification
results. | def tree(node, _depth=1):
"""Print a tree.
Sometimes it's useful to print datastructures as a tree. This function prints
out a pretty tree with root `node`. A tree is represented as a :class:`dict`,
whose keys are node names and values are :class:`dict` objects for sub-trees
and :class:`None` for terminals.
... | <commit_before><commit_msg>Add a few utilities for printing results
1) Copy over the ``tree`` function from sholsapp/powertools repository.
2) Add a ``assemble_chain`` function for pretty printing verification
results.<commit_after> | def tree(node, _depth=1):
"""Print a tree.
Sometimes it's useful to print datastructures as a tree. This function prints
out a pretty tree with root `node`. A tree is represented as a :class:`dict`,
whose keys are node names and values are :class:`dict` objects for sub-trees
and :class:`None` for terminals.
... | Add a few utilities for printing results
1) Copy over the ``tree`` function from sholsapp/powertools repository.
2) Add a ``assemble_chain`` function for pretty printing verification
results.def tree(node, _depth=1):
"""Print a tree.
Sometimes it's useful to print datastructures as a tree. This function print... | <commit_before><commit_msg>Add a few utilities for printing results
1) Copy over the ``tree`` function from sholsapp/powertools repository.
2) Add a ``assemble_chain`` function for pretty printing verification
results.<commit_after>def tree(node, _depth=1):
"""Print a tree.
Sometimes it's useful to print data... | |
02ad46a4463afdedc87aabd14b75fc9968b8ea64 | src/waldur_mastermind/marketplace/management/commands/import_marketplace_orders.py | src/waldur_mastermind/marketplace/management/commands/import_marketplace_orders.py | from django.core.management.base import BaseCommand
from waldur_core.core.models import User
from waldur_mastermind.marketplace.models import Order, OrderItem, Resource
class Command(BaseCommand):
help = """Create marketplace order for each resource if it does not yet exist."""
def handle(self, *args, **opt... | Implement management command to import orders for existing resources. | Implement management command to import orders for existing resources.
| Python | mit | opennode/nodeconductor-assembly-waldur,opennode/nodeconductor-assembly-waldur,opennode/waldur-mastermind,opennode/waldur-mastermind,opennode/waldur-mastermind,opennode/waldur-mastermind,opennode/nodeconductor-assembly-waldur | Implement management command to import orders for existing resources. | from django.core.management.base import BaseCommand
from waldur_core.core.models import User
from waldur_mastermind.marketplace.models import Order, OrderItem, Resource
class Command(BaseCommand):
help = """Create marketplace order for each resource if it does not yet exist."""
def handle(self, *args, **opt... | <commit_before><commit_msg>Implement management command to import orders for existing resources.<commit_after> | from django.core.management.base import BaseCommand
from waldur_core.core.models import User
from waldur_mastermind.marketplace.models import Order, OrderItem, Resource
class Command(BaseCommand):
help = """Create marketplace order for each resource if it does not yet exist."""
def handle(self, *args, **opt... | Implement management command to import orders for existing resources.from django.core.management.base import BaseCommand
from waldur_core.core.models import User
from waldur_mastermind.marketplace.models import Order, OrderItem, Resource
class Command(BaseCommand):
help = """Create marketplace order for each res... | <commit_before><commit_msg>Implement management command to import orders for existing resources.<commit_after>from django.core.management.base import BaseCommand
from waldur_core.core.models import User
from waldur_mastermind.marketplace.models import Order, OrderItem, Resource
class Command(BaseCommand):
help =... | |
6844fb64dd855f9d05d93b7e5b2dc84e467b53e1 | arc_distance/arc_distance_theano.py | arc_distance/arc_distance_theano.py | # Authors: Frederic Bastien
# License: MIT
import theano
import theano.tensor as tensor
def arc_distance_theano_alloc_prepare(dtype='float64'):
"""
Calculates the pairwise arc distance between all points in vector a and b.
"""
a = tensor.matrix(dtype=str(dtype))
b = tensor.matrix(dtype=str(dtype))... | Add arc distance for theano. | Add arc distance for theano.
| Python | mit | numfocus/python-benchmarks,numfocus/python-benchmarks | Add arc distance for theano. | # Authors: Frederic Bastien
# License: MIT
import theano
import theano.tensor as tensor
def arc_distance_theano_alloc_prepare(dtype='float64'):
"""
Calculates the pairwise arc distance between all points in vector a and b.
"""
a = tensor.matrix(dtype=str(dtype))
b = tensor.matrix(dtype=str(dtype))... | <commit_before><commit_msg>Add arc distance for theano.<commit_after> | # Authors: Frederic Bastien
# License: MIT
import theano
import theano.tensor as tensor
def arc_distance_theano_alloc_prepare(dtype='float64'):
"""
Calculates the pairwise arc distance between all points in vector a and b.
"""
a = tensor.matrix(dtype=str(dtype))
b = tensor.matrix(dtype=str(dtype))... | Add arc distance for theano.# Authors: Frederic Bastien
# License: MIT
import theano
import theano.tensor as tensor
def arc_distance_theano_alloc_prepare(dtype='float64'):
"""
Calculates the pairwise arc distance between all points in vector a and b.
"""
a = tensor.matrix(dtype=str(dtype))
b = ten... | <commit_before><commit_msg>Add arc distance for theano.<commit_after># Authors: Frederic Bastien
# License: MIT
import theano
import theano.tensor as tensor
def arc_distance_theano_alloc_prepare(dtype='float64'):
"""
Calculates the pairwise arc distance between all points in vector a and b.
"""
a = te... | |
10b8a2e6fe104fa7bdbb2498733430f16254c545 | src/longest_common_prefix.py | src/longest_common_prefix.py | class Solution:
# @param {string []} strs
# @return {string}
def longestCommonPrefix(self, strs):
if not strs:
return ""
longestIndex = 0
foundNotMatched = False
for index in range(0, len(strs[0])):
if not foundNotMatched:
longestIndex ... | Solve the longest common prefix | Solve the longest common prefix
| Python | mit | chancyWu/leetcode | Solve the longest common prefix | class Solution:
# @param {string []} strs
# @return {string}
def longestCommonPrefix(self, strs):
if not strs:
return ""
longestIndex = 0
foundNotMatched = False
for index in range(0, len(strs[0])):
if not foundNotMatched:
longestIndex ... | <commit_before><commit_msg>Solve the longest common prefix<commit_after> | class Solution:
# @param {string []} strs
# @return {string}
def longestCommonPrefix(self, strs):
if not strs:
return ""
longestIndex = 0
foundNotMatched = False
for index in range(0, len(strs[0])):
if not foundNotMatched:
longestIndex ... | Solve the longest common prefixclass Solution:
# @param {string []} strs
# @return {string}
def longestCommonPrefix(self, strs):
if not strs:
return ""
longestIndex = 0
foundNotMatched = False
for index in range(0, len(strs[0])):
if not foundNotMatched... | <commit_before><commit_msg>Solve the longest common prefix<commit_after>class Solution:
# @param {string []} strs
# @return {string}
def longestCommonPrefix(self, strs):
if not strs:
return ""
longestIndex = 0
foundNotMatched = False
for index in range(0, len(strs... | |
4a182b614da8ced1650d0d81f20624120031e5b0 | timetracker/testing_utils.py | timetracker/testing_utils.py | import logging
from timetracker import models
def create_activity(title='Test Title', start_time=None, end_time=None,
logger=None):
"""Create an `Activity` instance for testing purposes.
The fields are given default values so that instances can be easily
created for testing purposes.... | Add testing utility to create activities. | Add testing utility to create activities.
| Python | mit | cdriehuys/django-timetracker | Add testing utility to create activities. | import logging
from timetracker import models
def create_activity(title='Test Title', start_time=None, end_time=None,
logger=None):
"""Create an `Activity` instance for testing purposes.
The fields are given default values so that instances can be easily
created for testing purposes.... | <commit_before><commit_msg>Add testing utility to create activities.<commit_after> | import logging
from timetracker import models
def create_activity(title='Test Title', start_time=None, end_time=None,
logger=None):
"""Create an `Activity` instance for testing purposes.
The fields are given default values so that instances can be easily
created for testing purposes.... | Add testing utility to create activities.import logging
from timetracker import models
def create_activity(title='Test Title', start_time=None, end_time=None,
logger=None):
"""Create an `Activity` instance for testing purposes.
The fields are given default values so that instances can be... | <commit_before><commit_msg>Add testing utility to create activities.<commit_after>import logging
from timetracker import models
def create_activity(title='Test Title', start_time=None, end_time=None,
logger=None):
"""Create an `Activity` instance for testing purposes.
The fields are give... | |
b1edcbe02e2e1b2c54fd96c994e2c83e27e9b7b9 | test/client/local_recognizer_test.py | test/client/local_recognizer_test.py | import unittest
import os
from speech_recognition import WavFile
from mycroft.client.speech.listener import RecognizerLoop
__author__ = 'seanfitz'
DATA_DIR = os.path.join(os.path.abspath(os.path.dirname(__file__)), "data")
class LocalRecognizerTest(unittest.TestCase):
def setUp(self):
self.recognizer ... | import unittest
import os
from speech_recognition import WavFile
from mycroft.client.speech.listener import RecognizerLoop
__author__ = 'seanfitz'
DATA_DIR = os.path.join(os.path.abspath(os.path.dirname(__file__)), "data")
class LocalRecognizerTest(unittest.TestCase):
def setUp(self):
rl = RecognizerL... | Fix init of local recognizer | Fix init of local recognizer
| Python | apache-2.0 | MycroftAI/mycroft-core,aatchison/mycroft-core,linuxipho/mycroft-core,forslund/mycroft-core,Dark5ide/mycroft-core,linuxipho/mycroft-core,forslund/mycroft-core,MycroftAI/mycroft-core,Dark5ide/mycroft-core,aatchison/mycroft-core | import unittest
import os
from speech_recognition import WavFile
from mycroft.client.speech.listener import RecognizerLoop
__author__ = 'seanfitz'
DATA_DIR = os.path.join(os.path.abspath(os.path.dirname(__file__)), "data")
class LocalRecognizerTest(unittest.TestCase):
def setUp(self):
self.recognizer ... | import unittest
import os
from speech_recognition import WavFile
from mycroft.client.speech.listener import RecognizerLoop
__author__ = 'seanfitz'
DATA_DIR = os.path.join(os.path.abspath(os.path.dirname(__file__)), "data")
class LocalRecognizerTest(unittest.TestCase):
def setUp(self):
rl = RecognizerL... | <commit_before>import unittest
import os
from speech_recognition import WavFile
from mycroft.client.speech.listener import RecognizerLoop
__author__ = 'seanfitz'
DATA_DIR = os.path.join(os.path.abspath(os.path.dirname(__file__)), "data")
class LocalRecognizerTest(unittest.TestCase):
def setUp(self):
s... | import unittest
import os
from speech_recognition import WavFile
from mycroft.client.speech.listener import RecognizerLoop
__author__ = 'seanfitz'
DATA_DIR = os.path.join(os.path.abspath(os.path.dirname(__file__)), "data")
class LocalRecognizerTest(unittest.TestCase):
def setUp(self):
rl = RecognizerL... | import unittest
import os
from speech_recognition import WavFile
from mycroft.client.speech.listener import RecognizerLoop
__author__ = 'seanfitz'
DATA_DIR = os.path.join(os.path.abspath(os.path.dirname(__file__)), "data")
class LocalRecognizerTest(unittest.TestCase):
def setUp(self):
self.recognizer ... | <commit_before>import unittest
import os
from speech_recognition import WavFile
from mycroft.client.speech.listener import RecognizerLoop
__author__ = 'seanfitz'
DATA_DIR = os.path.join(os.path.abspath(os.path.dirname(__file__)), "data")
class LocalRecognizerTest(unittest.TestCase):
def setUp(self):
s... |
630ea6ba267673819d5a3f4b980276039f4773b4 | support/jenkins/buildAllModules.py | support/jenkins/buildAllModules.py | import os
from subprocess import call
modules = os.listdir("../../modules")
cmd = ["cmake"]
cmd.append("-DGHOUL_USE_DEVIL=OFF")
for m in modules:
cmd.append("-DOPENSPACE_MODULE_" + m.upper() + "=ON")
cmd.append(".")
call(cmd) | Add python script to make jenkins build all modules | Add python script to make jenkins build all modules
| Python | mit | OpenSpace/OpenSpace,OpenSpace/OpenSpace,OpenSpace/OpenSpace,OpenSpace/OpenSpace | Add python script to make jenkins build all modules | import os
from subprocess import call
modules = os.listdir("../../modules")
cmd = ["cmake"]
cmd.append("-DGHOUL_USE_DEVIL=OFF")
for m in modules:
cmd.append("-DOPENSPACE_MODULE_" + m.upper() + "=ON")
cmd.append(".")
call(cmd) | <commit_before><commit_msg>Add python script to make jenkins build all modules<commit_after> | import os
from subprocess import call
modules = os.listdir("../../modules")
cmd = ["cmake"]
cmd.append("-DGHOUL_USE_DEVIL=OFF")
for m in modules:
cmd.append("-DOPENSPACE_MODULE_" + m.upper() + "=ON")
cmd.append(".")
call(cmd) | Add python script to make jenkins build all modulesimport os
from subprocess import call
modules = os.listdir("../../modules")
cmd = ["cmake"]
cmd.append("-DGHOUL_USE_DEVIL=OFF")
for m in modules:
cmd.append("-DOPENSPACE_MODULE_" + m.upper() + "=ON")
cmd.append(".")
call(cmd) | <commit_before><commit_msg>Add python script to make jenkins build all modules<commit_after>import os
from subprocess import call
modules = os.listdir("../../modules")
cmd = ["cmake"]
cmd.append("-DGHOUL_USE_DEVIL=OFF")
for m in modules:
cmd.append("-DOPENSPACE_MODULE_" + m.upper() + "=ON")
cmd.append(".")
call(... | |
ce672e705056c4343e51b9e7d69446fc5f3ef58f | talks_keeper/forms.py | talks_keeper/forms.py | from django import forms
from .models import Label, Talk
class TalkForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
super(TalkForm, self).__init__(*args, **kwargs)
labels = Label.objects.all()
for label_ in labels:
self.fields.update({
'label_{}'.fo... | Add TalkFor (to use color labels) | Add TalkFor (to use color labels)
| Python | mit | samitnuk/talks_keeper,samitnuk/talks_keeper,samitnuk/talks_keeper | Add TalkFor (to use color labels) | from django import forms
from .models import Label, Talk
class TalkForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
super(TalkForm, self).__init__(*args, **kwargs)
labels = Label.objects.all()
for label_ in labels:
self.fields.update({
'label_{}'.fo... | <commit_before><commit_msg>Add TalkFor (to use color labels)<commit_after> | from django import forms
from .models import Label, Talk
class TalkForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
super(TalkForm, self).__init__(*args, **kwargs)
labels = Label.objects.all()
for label_ in labels:
self.fields.update({
'label_{}'.fo... | Add TalkFor (to use color labels)from django import forms
from .models import Label, Talk
class TalkForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
super(TalkForm, self).__init__(*args, **kwargs)
labels = Label.objects.all()
for label_ in labels:
self.fields.updat... | <commit_before><commit_msg>Add TalkFor (to use color labels)<commit_after>from django import forms
from .models import Label, Talk
class TalkForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
super(TalkForm, self).__init__(*args, **kwargs)
labels = Label.objects.all()
for label_... | |
c3aae42475966e8dbd71b8f2e16da5cbf81cf3cc | src/mmw/apps/modeling/migrations/0016_old_scenarios.py | src/mmw/apps/modeling/migrations/0016_old_scenarios.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
def clear_old_scenario_results(apps, schema_editor):
Scenario = apps.get_model('modeling', 'Scenario')
for scenario in Scenario.objects.all():
if 'pc_modified' not in scenario.results or 'pc_unmod... | Remove Incompatible Results from Scenarios | Remove Incompatible Results from Scenarios
This patch provides a data migratin which removes incompatible results
from scenarios created prior to
https://github.com/WikiWatershed/model-my-watershed/pull/716.
Connects #935
| Python | apache-2.0 | lliss/model-my-watershed,lliss/model-my-watershed,kdeloach/model-my-watershed,lliss/model-my-watershed,WikiWatershed/model-my-watershed,kdeloach/model-my-watershed,WikiWatershed/model-my-watershed,project-icp/bee-pollinator-app,kdeloach/model-my-watershed,project-icp/bee-pollinator-app,lliss/model-my-watershed,lliss/mo... | Remove Incompatible Results from Scenarios
This patch provides a data migratin which removes incompatible results
from scenarios created prior to
https://github.com/WikiWatershed/model-my-watershed/pull/716.
Connects #935 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
def clear_old_scenario_results(apps, schema_editor):
Scenario = apps.get_model('modeling', 'Scenario')
for scenario in Scenario.objects.all():
if 'pc_modified' not in scenario.results or 'pc_unmod... | <commit_before><commit_msg>Remove Incompatible Results from Scenarios
This patch provides a data migratin which removes incompatible results
from scenarios created prior to
https://github.com/WikiWatershed/model-my-watershed/pull/716.
Connects #935<commit_after> | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
def clear_old_scenario_results(apps, schema_editor):
Scenario = apps.get_model('modeling', 'Scenario')
for scenario in Scenario.objects.all():
if 'pc_modified' not in scenario.results or 'pc_unmod... | Remove Incompatible Results from Scenarios
This patch provides a data migratin which removes incompatible results
from scenarios created prior to
https://github.com/WikiWatershed/model-my-watershed/pull/716.
Connects #935# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, mi... | <commit_before><commit_msg>Remove Incompatible Results from Scenarios
This patch provides a data migratin which removes incompatible results
from scenarios created prior to
https://github.com/WikiWatershed/model-my-watershed/pull/716.
Connects #935<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_l... | |
843f689fd76344aa6921b94576a92d4ff7bba609 | test/load_unload/TestLoadUnload.py | test/load_unload/TestLoadUnload.py | """
Test that breakpoint by symbol name works correctly dlopen'ing a dynamic lib.
"""
import os, time
import unittest
import lldb
import lldbtest
class TestClassTypes(lldbtest.TestBase):
mydir = "load_unload"
def test_dead_strip(self):
"""Test breakpoint by name works correctly with dlopen'ing."""
... | Test that breakpoint by symbol name works correctly dlopen'ing a dynamic lib. | Test that breakpoint by symbol name works correctly dlopen'ing a dynamic lib.
git-svn-id: b33bab8abb5b18c12ee100cd7761ab452d00b2b0@107812 91177308-0d34-0410-b5e6-96231b3b80d8
| Python | apache-2.0 | llvm-mirror/lldb,apple/swift-lldb,apple/swift-lldb,apple/swift-lldb,apple/swift-lldb,llvm-mirror/lldb,apple/swift-lldb,apple/swift-lldb,llvm-mirror/lldb,llvm-mirror/lldb,llvm-mirror/lldb | Test that breakpoint by symbol name works correctly dlopen'ing a dynamic lib.
git-svn-id: b33bab8abb5b18c12ee100cd7761ab452d00b2b0@107812 91177308-0d34-0410-b5e6-96231b3b80d8 | """
Test that breakpoint by symbol name works correctly dlopen'ing a dynamic lib.
"""
import os, time
import unittest
import lldb
import lldbtest
class TestClassTypes(lldbtest.TestBase):
mydir = "load_unload"
def test_dead_strip(self):
"""Test breakpoint by name works correctly with dlopen'ing."""
... | <commit_before><commit_msg>Test that breakpoint by symbol name works correctly dlopen'ing a dynamic lib.
git-svn-id: b33bab8abb5b18c12ee100cd7761ab452d00b2b0@107812 91177308-0d34-0410-b5e6-96231b3b80d8<commit_after> | """
Test that breakpoint by symbol name works correctly dlopen'ing a dynamic lib.
"""
import os, time
import unittest
import lldb
import lldbtest
class TestClassTypes(lldbtest.TestBase):
mydir = "load_unload"
def test_dead_strip(self):
"""Test breakpoint by name works correctly with dlopen'ing."""
... | Test that breakpoint by symbol name works correctly dlopen'ing a dynamic lib.
git-svn-id: b33bab8abb5b18c12ee100cd7761ab452d00b2b0@107812 91177308-0d34-0410-b5e6-96231b3b80d8"""
Test that breakpoint by symbol name works correctly dlopen'ing a dynamic lib.
"""
import os, time
import unittest
import lldb
import lldbte... | <commit_before><commit_msg>Test that breakpoint by symbol name works correctly dlopen'ing a dynamic lib.
git-svn-id: b33bab8abb5b18c12ee100cd7761ab452d00b2b0@107812 91177308-0d34-0410-b5e6-96231b3b80d8<commit_after>"""
Test that breakpoint by symbol name works correctly dlopen'ing a dynamic lib.
"""
import os, time
... | |
32779ab1f6c2658771e69e58f8d8a451b23043b0 | var/spack/repos/builtin/packages/r-filehash/package.py | var/spack/repos/builtin/packages/r-filehash/package.py | from spack import *
class RFilehash(Package):
"""Implements a simple key-value style database where character string keys are associated with data values that are stored on the disk. A simple interface is provided for inserting, retrieving, and deleting data from the database. Utilities are provided that allow 'fi... | Add r-filehash to test version naming. | Add r-filehash to test version naming.
| Python | lgpl-2.1 | krafczyk/spack,mfherbst/spack,TheTimmy/spack,TheTimmy/spack,iulian787/spack,skosukhin/spack,krafczyk/spack,TheTimmy/spack,LLNL/spack,iulian787/spack,mfherbst/spack,lgarren/spack,skosukhin/spack,iulian787/spack,matthiasdiener/spack,lgarren/spack,matthiasdiener/spack,LLNL/spack,lgarren/spack,matthiasdiener/spack,krafczyk... | Add r-filehash to test version naming. | from spack import *
class RFilehash(Package):
"""Implements a simple key-value style database where character string keys are associated with data values that are stored on the disk. A simple interface is provided for inserting, retrieving, and deleting data from the database. Utilities are provided that allow 'fi... | <commit_before><commit_msg>Add r-filehash to test version naming.<commit_after> | from spack import *
class RFilehash(Package):
"""Implements a simple key-value style database where character string keys are associated with data values that are stored on the disk. A simple interface is provided for inserting, retrieving, and deleting data from the database. Utilities are provided that allow 'fi... | Add r-filehash to test version naming.from spack import *
class RFilehash(Package):
"""Implements a simple key-value style database where character string keys are associated with data values that are stored on the disk. A simple interface is provided for inserting, retrieving, and deleting data from the database.... | <commit_before><commit_msg>Add r-filehash to test version naming.<commit_after>from spack import *
class RFilehash(Package):
"""Implements a simple key-value style database where character string keys are associated with data values that are stored on the disk. A simple interface is provided for inserting, retriev... | |
463f907eb2b8c4cb1cebfed44ec8da0f76c4f7bb | cabby/data/metagraph/utils.py | cabby/data/metagraph/utils.py | # coding=utf-8
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... | Add KG graph building util. | Add KG graph building util.
| Python | apache-2.0 | googleinterns/cabby,googleinterns/cabby,googleinterns/cabby,googleinterns/cabby | Add KG graph building util. | # coding=utf-8
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... | <commit_before><commit_msg>Add KG graph building util.<commit_after> | # coding=utf-8
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... | Add KG graph building util.# coding=utf-8
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by a... | <commit_before><commit_msg>Add KG graph building util.<commit_after># coding=utf-8
# 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
#
# http://www.apache.org/lice... | |
e10e890ceadf166db76d92f5d6407683d1c30ba2 | jarbas/core/tests/test_loadsuppliers_command.py | jarbas/core/tests/test_loadsuppliers_command.py | from datetime import datetime
from django.test import TestCase
from jarbas.core.management.commands.loadsuppliers import Command
class TestStaticMethods(TestCase):
def setUp(self):
self.command = Command()
def test_to_float(self):
self.assertEqual(self.command.to_float(1), 1.0)
sel... | Add tests for loadsuppliers statics methods | Add tests for loadsuppliers statics methods
| Python | mit | Guilhermeslucas/jarbas,datasciencebr/serenata-de-amor,datasciencebr/jarbas,Guilhermeslucas/jarbas,datasciencebr/jarbas,marcusrehm/serenata-de-amor,marcusrehm/serenata-de-amor,datasciencebr/serenata-de-amor,datasciencebr/jarbas,rogeriochaves/jarbas,rogeriochaves/jarbas,rogeriochaves/jarbas,marcusrehm/serenata-de-amor,Gu... | Add tests for loadsuppliers statics methods | from datetime import datetime
from django.test import TestCase
from jarbas.core.management.commands.loadsuppliers import Command
class TestStaticMethods(TestCase):
def setUp(self):
self.command = Command()
def test_to_float(self):
self.assertEqual(self.command.to_float(1), 1.0)
sel... | <commit_before><commit_msg>Add tests for loadsuppliers statics methods<commit_after> | from datetime import datetime
from django.test import TestCase
from jarbas.core.management.commands.loadsuppliers import Command
class TestStaticMethods(TestCase):
def setUp(self):
self.command = Command()
def test_to_float(self):
self.assertEqual(self.command.to_float(1), 1.0)
sel... | Add tests for loadsuppliers statics methodsfrom datetime import datetime
from django.test import TestCase
from jarbas.core.management.commands.loadsuppliers import Command
class TestStaticMethods(TestCase):
def setUp(self):
self.command = Command()
def test_to_float(self):
self.assertEqual... | <commit_before><commit_msg>Add tests for loadsuppliers statics methods<commit_after>from datetime import datetime
from django.test import TestCase
from jarbas.core.management.commands.loadsuppliers import Command
class TestStaticMethods(TestCase):
def setUp(self):
self.command = Command()
def test... | |
18982181574bc69457d792848c028c3efd09b543 | tests/core/test_decorator.py | tests/core/test_decorator.py |
from fastats.core.decorator import fs
def square(x):
return x * x
@fs
def cube(x):
return x * x * x
@fs
def func(x):
a = square(x)
return a / 2
def test_fs_decorated_functions_as_kwargs_to_another():
assert square(2) == 4.0
assert square(3) == 9.0
assert cube(3) == 27.0
assert cub... | Add test for decorated kwargs to decorated function | Add test for decorated kwargs to decorated function
| Python | mit | fastats/fastats,dwillmer/fastats | Add test for decorated kwargs to decorated function |
from fastats.core.decorator import fs
def square(x):
return x * x
@fs
def cube(x):
return x * x * x
@fs
def func(x):
a = square(x)
return a / 2
def test_fs_decorated_functions_as_kwargs_to_another():
assert square(2) == 4.0
assert square(3) == 9.0
assert cube(3) == 27.0
assert cub... | <commit_before><commit_msg>Add test for decorated kwargs to decorated function<commit_after> |
from fastats.core.decorator import fs
def square(x):
return x * x
@fs
def cube(x):
return x * x * x
@fs
def func(x):
a = square(x)
return a / 2
def test_fs_decorated_functions_as_kwargs_to_another():
assert square(2) == 4.0
assert square(3) == 9.0
assert cube(3) == 27.0
assert cub... | Add test for decorated kwargs to decorated function
from fastats.core.decorator import fs
def square(x):
return x * x
@fs
def cube(x):
return x * x * x
@fs
def func(x):
a = square(x)
return a / 2
def test_fs_decorated_functions_as_kwargs_to_another():
assert square(2) == 4.0
assert square(... | <commit_before><commit_msg>Add test for decorated kwargs to decorated function<commit_after>
from fastats.core.decorator import fs
def square(x):
return x * x
@fs
def cube(x):
return x * x * x
@fs
def func(x):
a = square(x)
return a / 2
def test_fs_decorated_functions_as_kwargs_to_another():
a... | |
68dd135e43e78968796b9967f83361b5225961c0 | l10n_br_sale/models/sale-l10n_br_sale_service.py | l10n_br_sale/models/sale-l10n_br_sale_service.py | # Copyright (C) 2014 Renato Lima - Akretion
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from openerp import _, api, models
from openerp.exceptions import Warning as UserError
class SaleOrder(models.Model):
_inherit = "sale.order"
@api.model
def _prepare_invoice(self, order, lines):... | Move models from l10n_br_sale_service to l10n_br_sale. | [12.0][MIG][WIP] Move models from l10n_br_sale_service to l10n_br_sale.
| Python | agpl-3.0 | OCA/l10n-brazil,akretion/l10n-brazil,akretion/l10n-brazil,akretion/l10n-brazil,OCA/l10n-brazil,OCA/l10n-brazil | [12.0][MIG][WIP] Move models from l10n_br_sale_service to l10n_br_sale. | # Copyright (C) 2014 Renato Lima - Akretion
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from openerp import _, api, models
from openerp.exceptions import Warning as UserError
class SaleOrder(models.Model):
_inherit = "sale.order"
@api.model
def _prepare_invoice(self, order, lines):... | <commit_before><commit_msg>[12.0][MIG][WIP] Move models from l10n_br_sale_service to l10n_br_sale.<commit_after> | # Copyright (C) 2014 Renato Lima - Akretion
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from openerp import _, api, models
from openerp.exceptions import Warning as UserError
class SaleOrder(models.Model):
_inherit = "sale.order"
@api.model
def _prepare_invoice(self, order, lines):... | [12.0][MIG][WIP] Move models from l10n_br_sale_service to l10n_br_sale.# Copyright (C) 2014 Renato Lima - Akretion
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from openerp import _, api, models
from openerp.exceptions import Warning as UserError
class SaleOrder(models.Model):
_inherit = "sa... | <commit_before><commit_msg>[12.0][MIG][WIP] Move models from l10n_br_sale_service to l10n_br_sale.<commit_after># Copyright (C) 2014 Renato Lima - Akretion
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from openerp import _, api, models
from openerp.exceptions import Warning as UserError
class Sa... | |
aadbb5bc69aff6cc1bdffbc85da6499ab16f3e2c | tests/test_assembly_graph.py | tests/test_assembly_graph.py | import pytest # noqa
from phasm.assembly_graph import (AssemblyGraph, remove_tips, node_path_edges,
remove_transitive_edges, clean_graph)
def test_tip_removal():
g = AssemblyGraph()
g.add_edges_from(node_path_edges(['v1', 'v2', 'v3', 'v4', 'v5', 'v6', 'v7',
... | Add tests for a few assembly graph operations | Add tests for a few assembly graph operations
| Python | mit | AbeelLab/phasm,AbeelLab/phasm | Add tests for a few assembly graph operations | import pytest # noqa
from phasm.assembly_graph import (AssemblyGraph, remove_tips, node_path_edges,
remove_transitive_edges, clean_graph)
def test_tip_removal():
g = AssemblyGraph()
g.add_edges_from(node_path_edges(['v1', 'v2', 'v3', 'v4', 'v5', 'v6', 'v7',
... | <commit_before><commit_msg>Add tests for a few assembly graph operations<commit_after> | import pytest # noqa
from phasm.assembly_graph import (AssemblyGraph, remove_tips, node_path_edges,
remove_transitive_edges, clean_graph)
def test_tip_removal():
g = AssemblyGraph()
g.add_edges_from(node_path_edges(['v1', 'v2', 'v3', 'v4', 'v5', 'v6', 'v7',
... | Add tests for a few assembly graph operationsimport pytest # noqa
from phasm.assembly_graph import (AssemblyGraph, remove_tips, node_path_edges,
remove_transitive_edges, clean_graph)
def test_tip_removal():
g = AssemblyGraph()
g.add_edges_from(node_path_edges(['v1', 'v2', '... | <commit_before><commit_msg>Add tests for a few assembly graph operations<commit_after>import pytest # noqa
from phasm.assembly_graph import (AssemblyGraph, remove_tips, node_path_edges,
remove_transitive_edges, clean_graph)
def test_tip_removal():
g = AssemblyGraph()
g.add_... | |
2664406698c9f39527f005a3546740e2763c7d1f | benchmarks/expand4_sage.py | benchmarks/expand4_sage.py | print "import..."
from timeit import default_timer as clock
from sage.all import var
var("x")
e = 1
print "constructing expression..."
for i in range(1, 351):
e *= (i+x)**3
print "running benchmark..."
t1 = clock()
f = e.expand()
t2 = clock()
print "Total time:", t2-t1, "s"
| Add Sage benchmark for expand4 | Add Sage benchmark for expand4
| Python | mit | symengine/symengine.py,symengine/symengine.py,bjodah/symengine.py,symengine/symengine.py,bjodah/symengine.py,bjodah/symengine.py | Add Sage benchmark for expand4 | print "import..."
from timeit import default_timer as clock
from sage.all import var
var("x")
e = 1
print "constructing expression..."
for i in range(1, 351):
e *= (i+x)**3
print "running benchmark..."
t1 = clock()
f = e.expand()
t2 = clock()
print "Total time:", t2-t1, "s"
| <commit_before><commit_msg>Add Sage benchmark for expand4<commit_after> | print "import..."
from timeit import default_timer as clock
from sage.all import var
var("x")
e = 1
print "constructing expression..."
for i in range(1, 351):
e *= (i+x)**3
print "running benchmark..."
t1 = clock()
f = e.expand()
t2 = clock()
print "Total time:", t2-t1, "s"
| Add Sage benchmark for expand4print "import..."
from timeit import default_timer as clock
from sage.all import var
var("x")
e = 1
print "constructing expression..."
for i in range(1, 351):
e *= (i+x)**3
print "running benchmark..."
t1 = clock()
f = e.expand()
t2 = clock()
print "Total time:", t2-t1, "s"
| <commit_before><commit_msg>Add Sage benchmark for expand4<commit_after>print "import..."
from timeit import default_timer as clock
from sage.all import var
var("x")
e = 1
print "constructing expression..."
for i in range(1, 351):
e *= (i+x)**3
print "running benchmark..."
t1 = clock()
f = e.expand()
t2 = clock()
pr... | |
1cd217777c1c0f9643fe203c68cdd091e00fc909 | tests/test_validate_export.py | tests/test_validate_export.py | import Bio.Phylo
from io import StringIO
from pathlib import Path
import pytest
import sys
# we assume (and assert) that this script is running from the tests/ directory
sys.path.append(str(Path(__file__).parent.parent.parent))
from augur.export_v2 import convert_tree_to_json_structure
from augur.validate import Vali... | Add unit tests for ensure_no_duplicate_names | Add unit tests for ensure_no_duplicate_names
Adds minimal tests for validation of no duplicate names. Instead of
mocking up the tree JSON directly, these tests build a minimal BioPython
tree and use augur's own tree-to-JSON function to make the more verbose
JSON structure expected by the validation function.
| Python | agpl-3.0 | nextstrain/augur,nextstrain/augur,nextstrain/augur,blab/nextstrain-augur | Add unit tests for ensure_no_duplicate_names
Adds minimal tests for validation of no duplicate names. Instead of
mocking up the tree JSON directly, these tests build a minimal BioPython
tree and use augur's own tree-to-JSON function to make the more verbose
JSON structure expected by the validation function. | import Bio.Phylo
from io import StringIO
from pathlib import Path
import pytest
import sys
# we assume (and assert) that this script is running from the tests/ directory
sys.path.append(str(Path(__file__).parent.parent.parent))
from augur.export_v2 import convert_tree_to_json_structure
from augur.validate import Vali... | <commit_before><commit_msg>Add unit tests for ensure_no_duplicate_names
Adds minimal tests for validation of no duplicate names. Instead of
mocking up the tree JSON directly, these tests build a minimal BioPython
tree and use augur's own tree-to-JSON function to make the more verbose
JSON structure expected by the val... | import Bio.Phylo
from io import StringIO
from pathlib import Path
import pytest
import sys
# we assume (and assert) that this script is running from the tests/ directory
sys.path.append(str(Path(__file__).parent.parent.parent))
from augur.export_v2 import convert_tree_to_json_structure
from augur.validate import Vali... | Add unit tests for ensure_no_duplicate_names
Adds minimal tests for validation of no duplicate names. Instead of
mocking up the tree JSON directly, these tests build a minimal BioPython
tree and use augur's own tree-to-JSON function to make the more verbose
JSON structure expected by the validation function.import Bio... | <commit_before><commit_msg>Add unit tests for ensure_no_duplicate_names
Adds minimal tests for validation of no duplicate names. Instead of
mocking up the tree JSON directly, these tests build a minimal BioPython
tree and use augur's own tree-to-JSON function to make the more verbose
JSON structure expected by the val... | |
dc7e5a15eaba0a64c59afcb1d885f32347d95ebb | bluebottle/notifications/tests/test_effects.py | bluebottle/notifications/tests/test_effects.py | from django.core import mail
from bluebottle.events.messages import EventClosedOwnerMessage
from bluebottle.events.tests.factories import EventFactory
from bluebottle.notifications.effects import NotificationEffect
from bluebottle.test.factory_models.accounts import BlueBottleUserFactory
from bluebottle.test.utils imp... | Add effect test for notifications | Add effect test for notifications
| Python | bsd-3-clause | onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle | Add effect test for notifications | from django.core import mail
from bluebottle.events.messages import EventClosedOwnerMessage
from bluebottle.events.tests.factories import EventFactory
from bluebottle.notifications.effects import NotificationEffect
from bluebottle.test.factory_models.accounts import BlueBottleUserFactory
from bluebottle.test.utils imp... | <commit_before><commit_msg>Add effect test for notifications<commit_after> | from django.core import mail
from bluebottle.events.messages import EventClosedOwnerMessage
from bluebottle.events.tests.factories import EventFactory
from bluebottle.notifications.effects import NotificationEffect
from bluebottle.test.factory_models.accounts import BlueBottleUserFactory
from bluebottle.test.utils imp... | Add effect test for notificationsfrom django.core import mail
from bluebottle.events.messages import EventClosedOwnerMessage
from bluebottle.events.tests.factories import EventFactory
from bluebottle.notifications.effects import NotificationEffect
from bluebottle.test.factory_models.accounts import BlueBottleUserFacto... | <commit_before><commit_msg>Add effect test for notifications<commit_after>from django.core import mail
from bluebottle.events.messages import EventClosedOwnerMessage
from bluebottle.events.tests.factories import EventFactory
from bluebottle.notifications.effects import NotificationEffect
from bluebottle.test.factory_m... | |
c9b46dc1421ff56c45aab25cb849957a5c62ec9c | misc/cpp-support/iwyu-output-paths-normalizer.py | misc/cpp-support/iwyu-output-paths-normalizer.py | #!/usr/bin/python3
import fileinput
import re
import os.path
envisionRootDir = "/fast/Envision"
currentFile = "" # This is the file that needs its includes adjusted
currentFileRegex = re.compile(r'^(/.*) should (?:add|remove) these lines:$')
currentDir = ""
includeRegex = re.compile(r'^#include "(.+)".*$') # We pur... | Add a python script that normalizes paths in the output of the include-what-you-use tool | Add a python script that normalizes paths in the output of the include-what-you-use tool
| Python | bsd-3-clause | mgalbier/Envision,dimitar-asenov/Envision,Vaishal-shah/Envision,lukedirtwalker/Envision,Vaishal-shah/Envision,mgalbier/Envision,lukedirtwalker/Envision,mgalbier/Envision,dimitar-asenov/Envision,dimitar-asenov/Envision,Vaishal-shah/Envision,mgalbier/Envision,Vaishal-shah/Envision,lukedirtwalker/Envision,dimitar-asenov/E... | Add a python script that normalizes paths in the output of the include-what-you-use tool | #!/usr/bin/python3
import fileinput
import re
import os.path
envisionRootDir = "/fast/Envision"
currentFile = "" # This is the file that needs its includes adjusted
currentFileRegex = re.compile(r'^(/.*) should (?:add|remove) these lines:$')
currentDir = ""
includeRegex = re.compile(r'^#include "(.+)".*$') # We pur... | <commit_before><commit_msg>Add a python script that normalizes paths in the output of the include-what-you-use tool<commit_after> | #!/usr/bin/python3
import fileinput
import re
import os.path
envisionRootDir = "/fast/Envision"
currentFile = "" # This is the file that needs its includes adjusted
currentFileRegex = re.compile(r'^(/.*) should (?:add|remove) these lines:$')
currentDir = ""
includeRegex = re.compile(r'^#include "(.+)".*$') # We pur... | Add a python script that normalizes paths in the output of the include-what-you-use tool#!/usr/bin/python3
import fileinput
import re
import os.path
envisionRootDir = "/fast/Envision"
currentFile = "" # This is the file that needs its includes adjusted
currentFileRegex = re.compile(r'^(/.*) should (?:add|remove) the... | <commit_before><commit_msg>Add a python script that normalizes paths in the output of the include-what-you-use tool<commit_after>#!/usr/bin/python3
import fileinput
import re
import os.path
envisionRootDir = "/fast/Envision"
currentFile = "" # This is the file that needs its includes adjusted
currentFileRegex = re.c... | |
e107f3d6b895997c1ba2edb930dff30a93a89754 | tools/templates/build_docs.py | tools/templates/build_docs.py | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | Add example doc generator script. | Add example doc generator script.
PiperOrigin-RevId: 244258412
| Python | apache-2.0 | tensorflow/docs,tensorflow/docs,tensorflow/docs | Add example doc generator script.
PiperOrigin-RevId: 244258412 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | <commit_before><commit_msg>Add example doc generator script.
PiperOrigin-RevId: 244258412<commit_after> | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | Add example doc generator script.
PiperOrigin-RevId: 244258412# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www... | <commit_before><commit_msg>Add example doc generator script.
PiperOrigin-RevId: 244258412<commit_after># Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a ... | |
1d7f8caf0dd5aa28d626d5ae6b45f8d50566f39b | moksha/wsgiapp.py | moksha/wsgiapp.py | # This file is part of Moksha.
#
# Moksha is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Moksha is distributed in the hope that ... | Add the Moksha WSGI Application. | Add the Moksha WSGI Application.
This class handles resolving and dispatching to moksha applications.
It is instantiated and utilized by the MokshaMiddleware.
| Python | apache-2.0 | mokshaproject/moksha,lmacken/moksha,lmacken/moksha,pombredanne/moksha,ralphbean/moksha,pombredanne/moksha,mokshaproject/moksha,mokshaproject/moksha,lmacken/moksha,mokshaproject/moksha,pombredanne/moksha,pombredanne/moksha,ralphbean/moksha,ralphbean/moksha | Add the Moksha WSGI Application.
This class handles resolving and dispatching to moksha applications.
It is instantiated and utilized by the MokshaMiddleware. | # This file is part of Moksha.
#
# Moksha is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Moksha is distributed in the hope that ... | <commit_before><commit_msg>Add the Moksha WSGI Application.
This class handles resolving and dispatching to moksha applications.
It is instantiated and utilized by the MokshaMiddleware.<commit_after> | # This file is part of Moksha.
#
# Moksha is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Moksha is distributed in the hope that ... | Add the Moksha WSGI Application.
This class handles resolving and dispatching to moksha applications.
It is instantiated and utilized by the MokshaMiddleware.# This file is part of Moksha.
#
# Moksha is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publ... | <commit_before><commit_msg>Add the Moksha WSGI Application.
This class handles resolving and dispatching to moksha applications.
It is instantiated and utilized by the MokshaMiddleware.<commit_after># This file is part of Moksha.
#
# Moksha is free software: you can redistribute it and/or modify
# it under the terms ... | |
7471efd41006cb9344da23d65c7d605835324d37 | scenarios/update_replace_missed_cleanup_delete.py | scenarios/update_replace_missed_cleanup_delete.py | def check_resource_count(expected_count):
test.assertEqual(expected_count, len(reality.all_resources()))
def check_c_count(expected_count):
test.assertEqual(expected_count,
len(reality.resources_by_logical_name('C')))
example_template = Template({
'A': RsrcDef({'a': 'initial'}, []),
... | Add a test for issuing a delete during an update with replacement | Add a test for issuing a delete during an update with replacement
| Python | apache-2.0 | zaneb/heat-convergence-prototype | Add a test for issuing a delete during an update with replacement | def check_resource_count(expected_count):
test.assertEqual(expected_count, len(reality.all_resources()))
def check_c_count(expected_count):
test.assertEqual(expected_count,
len(reality.resources_by_logical_name('C')))
example_template = Template({
'A': RsrcDef({'a': 'initial'}, []),
... | <commit_before><commit_msg>Add a test for issuing a delete during an update with replacement<commit_after> | def check_resource_count(expected_count):
test.assertEqual(expected_count, len(reality.all_resources()))
def check_c_count(expected_count):
test.assertEqual(expected_count,
len(reality.resources_by_logical_name('C')))
example_template = Template({
'A': RsrcDef({'a': 'initial'}, []),
... | Add a test for issuing a delete during an update with replacementdef check_resource_count(expected_count):
test.assertEqual(expected_count, len(reality.all_resources()))
def check_c_count(expected_count):
test.assertEqual(expected_count,
len(reality.resources_by_logical_name('C')))
exampl... | <commit_before><commit_msg>Add a test for issuing a delete during an update with replacement<commit_after>def check_resource_count(expected_count):
test.assertEqual(expected_count, len(reality.all_resources()))
def check_c_count(expected_count):
test.assertEqual(expected_count,
len(reality... | |
7ac7583d714b15bb3e24bba1c5972bd1d0c235f2 | python/receive.py | python/receive.py | #!/usr/bin/env python
import pika
# Host in which RabbitMQ is running.
HOST = 'localhost'
# Name of the queue.
QUEUE = 'pages'
# Specifies what to do after consuming messages from RabbitMQ.
def handler(channel, method, properties, body):
print '-> Handled: [%s]' % body
# Getting the connection using pika.
# Cr... | Add consumer written in Python | Add consumer written in Python
| Python | apache-2.0 | jovannypcg/rabbitmq_usage,jovannypcg/rabbitmq_usage | Add consumer written in Python | #!/usr/bin/env python
import pika
# Host in which RabbitMQ is running.
HOST = 'localhost'
# Name of the queue.
QUEUE = 'pages'
# Specifies what to do after consuming messages from RabbitMQ.
def handler(channel, method, properties, body):
print '-> Handled: [%s]' % body
# Getting the connection using pika.
# Cr... | <commit_before><commit_msg>Add consumer written in Python<commit_after> | #!/usr/bin/env python
import pika
# Host in which RabbitMQ is running.
HOST = 'localhost'
# Name of the queue.
QUEUE = 'pages'
# Specifies what to do after consuming messages from RabbitMQ.
def handler(channel, method, properties, body):
print '-> Handled: [%s]' % body
# Getting the connection using pika.
# Cr... | Add consumer written in Python#!/usr/bin/env python
import pika
# Host in which RabbitMQ is running.
HOST = 'localhost'
# Name of the queue.
QUEUE = 'pages'
# Specifies what to do after consuming messages from RabbitMQ.
def handler(channel, method, properties, body):
print '-> Handled: [%s]' % body
# Getting t... | <commit_before><commit_msg>Add consumer written in Python<commit_after>#!/usr/bin/env python
import pika
# Host in which RabbitMQ is running.
HOST = 'localhost'
# Name of the queue.
QUEUE = 'pages'
# Specifies what to do after consuming messages from RabbitMQ.
def handler(channel, method, properties, body):
pri... | |
8f8812d6f5c2932dadc9e425d65bdc1e4cdaef45 | admin/metrics/migrations/0002_auto_20170130_1356.py | admin/metrics/migrations/0002_auto_20170130_1356.py | # -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2017-01-30 19:56
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('metrics', '0001_initial'),
]
operations = [
migrations.DeleteModel(
... | Remove OSFWebsiteStatistics model in favor of using Keen data | Remove OSFWebsiteStatistics model in favor of using Keen data
| Python | apache-2.0 | monikagrabowska/osf.io,acshi/osf.io,leb2dg/osf.io,caseyrollins/osf.io,acshi/osf.io,leb2dg/osf.io,cslzchen/osf.io,acshi/osf.io,hmoco/osf.io,adlius/osf.io,cwisecarver/osf.io,TomBaxter/osf.io,CenterForOpenScience/osf.io,cwisecarver/osf.io,Johnetordoff/osf.io,adlius/osf.io,felliott/osf.io,cslzchen/osf.io,sloria/osf.io,bria... | Remove OSFWebsiteStatistics model in favor of using Keen data | # -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2017-01-30 19:56
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('metrics', '0001_initial'),
]
operations = [
migrations.DeleteModel(
... | <commit_before><commit_msg>Remove OSFWebsiteStatistics model in favor of using Keen data<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2017-01-30 19:56
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('metrics', '0001_initial'),
]
operations = [
migrations.DeleteModel(
... | Remove OSFWebsiteStatistics model in favor of using Keen data# -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2017-01-30 19:56
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('metrics', '0001_initial'),
]
... | <commit_before><commit_msg>Remove OSFWebsiteStatistics model in favor of using Keen data<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2017-01-30 19:56
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
... | |
92b28dd2e6699423707604146de4a29656b8a8ba | runtests.py | runtests.py | #!/usr/bin/env python
import sys
import unittest
from os.path import dirname, abspath
import tests
def runtests(*test_args):
suite = unittest.TestLoader().loadTestsFromModule(tests)
result = unittest.TextTestRunner(verbosity=2).run(suite)
sys.exit(bool(result.failures))
if __name__ == '__main__':
ru... | #!/usr/bin/env python
import sys
import unittest
from os.path import dirname, abspath
import tests
def runtests(*test_args):
suite = unittest.TestLoader().loadTestsFromModule(tests)
result = unittest.TextTestRunner(verbosity=2).run(suite)
if result.failures:
sys.exit(1)
elif result.errors:
... | Return the proper exit codes in event of failure or error | Return the proper exit codes in event of failure or error
| Python | mit | zhang625272514/peewee,new-xiaji/peewee,jarrahwu/peewee,Dipsomaniac/peewee,new-xiaji/peewee,wenxer/peewee,bopo/peewee,Sunzhifeng/peewee,stas/peewee,mackjoner/peewee,new-xiaji/peewee,ronyb29/peewee,py4a/peewee,giserh/peewee,Dipsomaniac/peewee,wenxer/peewee,jnovinger/peewee,coreos/peewee,Dipsomaniac/peewee,d1hotpep/peewee... | #!/usr/bin/env python
import sys
import unittest
from os.path import dirname, abspath
import tests
def runtests(*test_args):
suite = unittest.TestLoader().loadTestsFromModule(tests)
result = unittest.TextTestRunner(verbosity=2).run(suite)
sys.exit(bool(result.failures))
if __name__ == '__main__':
ru... | #!/usr/bin/env python
import sys
import unittest
from os.path import dirname, abspath
import tests
def runtests(*test_args):
suite = unittest.TestLoader().loadTestsFromModule(tests)
result = unittest.TextTestRunner(verbosity=2).run(suite)
if result.failures:
sys.exit(1)
elif result.errors:
... | <commit_before>#!/usr/bin/env python
import sys
import unittest
from os.path import dirname, abspath
import tests
def runtests(*test_args):
suite = unittest.TestLoader().loadTestsFromModule(tests)
result = unittest.TextTestRunner(verbosity=2).run(suite)
sys.exit(bool(result.failures))
if __name__ == '__... | #!/usr/bin/env python
import sys
import unittest
from os.path import dirname, abspath
import tests
def runtests(*test_args):
suite = unittest.TestLoader().loadTestsFromModule(tests)
result = unittest.TextTestRunner(verbosity=2).run(suite)
if result.failures:
sys.exit(1)
elif result.errors:
... | #!/usr/bin/env python
import sys
import unittest
from os.path import dirname, abspath
import tests
def runtests(*test_args):
suite = unittest.TestLoader().loadTestsFromModule(tests)
result = unittest.TextTestRunner(verbosity=2).run(suite)
sys.exit(bool(result.failures))
if __name__ == '__main__':
ru... | <commit_before>#!/usr/bin/env python
import sys
import unittest
from os.path import dirname, abspath
import tests
def runtests(*test_args):
suite = unittest.TestLoader().loadTestsFromModule(tests)
result = unittest.TextTestRunner(verbosity=2).run(suite)
sys.exit(bool(result.failures))
if __name__ == '__... |
a45102e7a22c6fe34e0e4cca26602e90f99f8ead | gotify/migrations/0002_poly_meta.py | gotify/migrations/0002_poly_meta.py | # Generated by Django 2.0.6 on 2018-06-26 07:18
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('gotify', '0001_initial'),
]
operations = [
migrations.AlterModelOptions(
name='emailnotifier',
options={'base_manager_name':... | Add migration for gotify required by upgrade | Add migration for gotify required by upgrade
| Python | mit | akx/gentry,akx/gentry,akx/gentry,akx/gentry | Add migration for gotify required by upgrade | # Generated by Django 2.0.6 on 2018-06-26 07:18
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('gotify', '0001_initial'),
]
operations = [
migrations.AlterModelOptions(
name='emailnotifier',
options={'base_manager_name':... | <commit_before><commit_msg>Add migration for gotify required by upgrade<commit_after> | # Generated by Django 2.0.6 on 2018-06-26 07:18
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('gotify', '0001_initial'),
]
operations = [
migrations.AlterModelOptions(
name='emailnotifier',
options={'base_manager_name':... | Add migration for gotify required by upgrade# Generated by Django 2.0.6 on 2018-06-26 07:18
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('gotify', '0001_initial'),
]
operations = [
migrations.AlterModelOptions(
name='emailnotifier... | <commit_before><commit_msg>Add migration for gotify required by upgrade<commit_after># Generated by Django 2.0.6 on 2018-06-26 07:18
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('gotify', '0001_initial'),
]
operations = [
migrations.AlterMode... | |
f3acaa357a9b7e7e151e6bd42e08acbd9d817f25 | twitch_chat_reader.py | twitch_chat_reader.py | import socket
import sys
server = "irc.twitch.tv"
password = "oauth:8nq3rymmy4zakeut4p90hx9axnpywj"
nickname = "twitchlosescheckers"
channel = "#twitchlosescheckers"
try:
irc = socket.socket()
except socket.error as msg:
irc = None
try:
irc.connect((server, 6667))
print "connected to %s" %(server)
except socket.... | Connect to and read twitch chat | Connect to and read twitch chat
| Python | mit | mpoegel/TwitchPlaysCheckers | Connect to and read twitch chat | import socket
import sys
server = "irc.twitch.tv"
password = "oauth:8nq3rymmy4zakeut4p90hx9axnpywj"
nickname = "twitchlosescheckers"
channel = "#twitchlosescheckers"
try:
irc = socket.socket()
except socket.error as msg:
irc = None
try:
irc.connect((server, 6667))
print "connected to %s" %(server)
except socket.... | <commit_before><commit_msg>Connect to and read twitch chat<commit_after> | import socket
import sys
server = "irc.twitch.tv"
password = "oauth:8nq3rymmy4zakeut4p90hx9axnpywj"
nickname = "twitchlosescheckers"
channel = "#twitchlosescheckers"
try:
irc = socket.socket()
except socket.error as msg:
irc = None
try:
irc.connect((server, 6667))
print "connected to %s" %(server)
except socket.... | Connect to and read twitch chatimport socket
import sys
server = "irc.twitch.tv"
password = "oauth:8nq3rymmy4zakeut4p90hx9axnpywj"
nickname = "twitchlosescheckers"
channel = "#twitchlosescheckers"
try:
irc = socket.socket()
except socket.error as msg:
irc = None
try:
irc.connect((server, 6667))
print "connected ... | <commit_before><commit_msg>Connect to and read twitch chat<commit_after>import socket
import sys
server = "irc.twitch.tv"
password = "oauth:8nq3rymmy4zakeut4p90hx9axnpywj"
nickname = "twitchlosescheckers"
channel = "#twitchlosescheckers"
try:
irc = socket.socket()
except socket.error as msg:
irc = None
try:
irc.c... | |
69a00f52db2f1c48839d8035871937c3bf938503 | AutoCopyrightEventListener.py | AutoCopyrightEventListener.py | #
# Copyright (c) 2012 by Lifted Studios. All Rights Reserved.
#
import sublime
import sublime_plugin
class AutoCopyrightEventListener(sublime_plugin.EventListener):
'''
Listener for application events.
'''
def on_pre_save(self, view):
'''
Called just before the view is saved.
'''
view.run_... | Add event listener to automatically update the copyright. | Add event listener to automatically update the copyright.
| Python | mit | lifted-studios/AutoCopyright,lifted-studios/AutoCopyright | Add event listener to automatically update the copyright. | #
# Copyright (c) 2012 by Lifted Studios. All Rights Reserved.
#
import sublime
import sublime_plugin
class AutoCopyrightEventListener(sublime_plugin.EventListener):
'''
Listener for application events.
'''
def on_pre_save(self, view):
'''
Called just before the view is saved.
'''
view.run_... | <commit_before><commit_msg>Add event listener to automatically update the copyright.<commit_after> | #
# Copyright (c) 2012 by Lifted Studios. All Rights Reserved.
#
import sublime
import sublime_plugin
class AutoCopyrightEventListener(sublime_plugin.EventListener):
'''
Listener for application events.
'''
def on_pre_save(self, view):
'''
Called just before the view is saved.
'''
view.run_... | Add event listener to automatically update the copyright.#
# Copyright (c) 2012 by Lifted Studios. All Rights Reserved.
#
import sublime
import sublime_plugin
class AutoCopyrightEventListener(sublime_plugin.EventListener):
'''
Listener for application events.
'''
def on_pre_save(self, view):
'''
Ca... | <commit_before><commit_msg>Add event listener to automatically update the copyright.<commit_after>#
# Copyright (c) 2012 by Lifted Studios. All Rights Reserved.
#
import sublime
import sublime_plugin
class AutoCopyrightEventListener(sublime_plugin.EventListener):
'''
Listener for application events.
'''
de... | |
00376feb1140d75b47c226ec6752daccfa9a24e5 | doc/pyplots/cobsr_overhead.py | doc/pyplots/cobsr_overhead.py |
from matplotlib import pyplot as plt
import numpy as np
from cobs import cobs
from cobs import cobsr
def cobsr_overhead_calc(num_bytes):
return 257./256 - (255./256)**num_bytes
def cobsr_overhead_measure(num_bytes):
# TODO: review value
NUM_TESTS = 10000
overhead = 0
for _i in xrange(NUM_TESTS):... | Add program to graph theoretical vs experimental COBS/R overhead | Add program to graph theoretical vs experimental COBS/R overhead
I wrote this a long time ago, but didn't put it into version control
until now.
| Python | mit | cmcqueen/cobs-python,cmcqueen/cobs-python | Add program to graph theoretical vs experimental COBS/R overhead
I wrote this a long time ago, but didn't put it into version control
until now. |
from matplotlib import pyplot as plt
import numpy as np
from cobs import cobs
from cobs import cobsr
def cobsr_overhead_calc(num_bytes):
return 257./256 - (255./256)**num_bytes
def cobsr_overhead_measure(num_bytes):
# TODO: review value
NUM_TESTS = 10000
overhead = 0
for _i in xrange(NUM_TESTS):... | <commit_before><commit_msg>Add program to graph theoretical vs experimental COBS/R overhead
I wrote this a long time ago, but didn't put it into version control
until now.<commit_after> |
from matplotlib import pyplot as plt
import numpy as np
from cobs import cobs
from cobs import cobsr
def cobsr_overhead_calc(num_bytes):
return 257./256 - (255./256)**num_bytes
def cobsr_overhead_measure(num_bytes):
# TODO: review value
NUM_TESTS = 10000
overhead = 0
for _i in xrange(NUM_TESTS):... | Add program to graph theoretical vs experimental COBS/R overhead
I wrote this a long time ago, but didn't put it into version control
until now.
from matplotlib import pyplot as plt
import numpy as np
from cobs import cobs
from cobs import cobsr
def cobsr_overhead_calc(num_bytes):
return 257./256 - (255./256)**n... | <commit_before><commit_msg>Add program to graph theoretical vs experimental COBS/R overhead
I wrote this a long time ago, but didn't put it into version control
until now.<commit_after>
from matplotlib import pyplot as plt
import numpy as np
from cobs import cobs
from cobs import cobsr
def cobsr_overhead_calc(num_by... | |
3ca17ed50d1124d6590d7f4c172eeefbfaeb49dc | strassengezwitscher/strassengezwitscher/tests.py | strassengezwitscher/strassengezwitscher/tests.py | # pylint: disable=invalid-name,too-many-public-methods
from django.core.urlresolvers import reverse
from django.test import TestCase
class StrassengezwitscherTests(TestCase):
def test_serves_angular_tag(self):
response = self.client.get(reverse('index'))
self.assertEqual(response.status_code, 200)... | Test serving of frontend page. | Test serving of frontend page.
| Python | mit | Strassengezwitscher/Strassengezwitscher,Strassengezwitscher/Strassengezwitscher,Strassengezwitscher/Strassengezwitscher,Strassengezwitscher/Strassengezwitscher,Strassengezwitscher/Strassengezwitscher | Test serving of frontend page. | # pylint: disable=invalid-name,too-many-public-methods
from django.core.urlresolvers import reverse
from django.test import TestCase
class StrassengezwitscherTests(TestCase):
def test_serves_angular_tag(self):
response = self.client.get(reverse('index'))
self.assertEqual(response.status_code, 200)... | <commit_before><commit_msg>Test serving of frontend page.<commit_after> | # pylint: disable=invalid-name,too-many-public-methods
from django.core.urlresolvers import reverse
from django.test import TestCase
class StrassengezwitscherTests(TestCase):
def test_serves_angular_tag(self):
response = self.client.get(reverse('index'))
self.assertEqual(response.status_code, 200)... | Test serving of frontend page.# pylint: disable=invalid-name,too-many-public-methods
from django.core.urlresolvers import reverse
from django.test import TestCase
class StrassengezwitscherTests(TestCase):
def test_serves_angular_tag(self):
response = self.client.get(reverse('index'))
self.assertEq... | <commit_before><commit_msg>Test serving of frontend page.<commit_after># pylint: disable=invalid-name,too-many-public-methods
from django.core.urlresolvers import reverse
from django.test import TestCase
class StrassengezwitscherTests(TestCase):
def test_serves_angular_tag(self):
response = self.client.ge... | |
3aa25f590fcd1a59a7e5f9edde51e19cd0818d95 | app/data.py | app/data.py | import json
import os
from typing import Dict
from app.util import cached_function
class Projects():
def __init__(self) -> None:
self.data: Dict[str, Dict[str, Dict[str, str]]] = {}
@staticmethod
def load() -> 'Projects':
current_directory = os.path.dirname(os.path.realpath(__file__))
... | Add ability to load projects | Add ability to load projects
| Python | mit | albertyw/albertyw.com,albertyw/albertyw.com,albertyw/albertyw.com,albertyw/albertyw.com,albertyw/albertyw.com | Add ability to load projects | import json
import os
from typing import Dict
from app.util import cached_function
class Projects():
def __init__(self) -> None:
self.data: Dict[str, Dict[str, Dict[str, str]]] = {}
@staticmethod
def load() -> 'Projects':
current_directory = os.path.dirname(os.path.realpath(__file__))
... | <commit_before><commit_msg>Add ability to load projects<commit_after> | import json
import os
from typing import Dict
from app.util import cached_function
class Projects():
def __init__(self) -> None:
self.data: Dict[str, Dict[str, Dict[str, str]]] = {}
@staticmethod
def load() -> 'Projects':
current_directory = os.path.dirname(os.path.realpath(__file__))
... | Add ability to load projectsimport json
import os
from typing import Dict
from app.util import cached_function
class Projects():
def __init__(self) -> None:
self.data: Dict[str, Dict[str, Dict[str, str]]] = {}
@staticmethod
def load() -> 'Projects':
current_directory = os.path.dirname(os... | <commit_before><commit_msg>Add ability to load projects<commit_after>import json
import os
from typing import Dict
from app.util import cached_function
class Projects():
def __init__(self) -> None:
self.data: Dict[str, Dict[str, Dict[str, str]]] = {}
@staticmethod
def load() -> 'Projects':
... | |
411f6dfb62f5aa6c91d35aeb6acb0d7246961849 | examples/petstore/psflask.py | examples/petstore/psflask.py | import pickle
from flask import Flask, abort
app = Flask(__name__)
import petstore_impl
import petstore_server
store = petstore_impl.PetStore()
server = petstore_server.PetStore_server(store)
@app.route("/" + petstore_server.service_name + "/<args>")
def run_service(args):
try:
command, args, kwargs = p... | Add Flask equivalent for psserver and sample_rpc | Add Flask equivalent for psserver and sample_rpc
| Python | apache-2.0 | datawire/adaptive | Add Flask equivalent for psserver and sample_rpc | import pickle
from flask import Flask, abort
app = Flask(__name__)
import petstore_impl
import petstore_server
store = petstore_impl.PetStore()
server = petstore_server.PetStore_server(store)
@app.route("/" + petstore_server.service_name + "/<args>")
def run_service(args):
try:
command, args, kwargs = p... | <commit_before><commit_msg>Add Flask equivalent for psserver and sample_rpc<commit_after> | import pickle
from flask import Flask, abort
app = Flask(__name__)
import petstore_impl
import petstore_server
store = petstore_impl.PetStore()
server = petstore_server.PetStore_server(store)
@app.route("/" + petstore_server.service_name + "/<args>")
def run_service(args):
try:
command, args, kwargs = p... | Add Flask equivalent for psserver and sample_rpcimport pickle
from flask import Flask, abort
app = Flask(__name__)
import petstore_impl
import petstore_server
store = petstore_impl.PetStore()
server = petstore_server.PetStore_server(store)
@app.route("/" + petstore_server.service_name + "/<args>")
def run_service(a... | <commit_before><commit_msg>Add Flask equivalent for psserver and sample_rpc<commit_after>import pickle
from flask import Flask, abort
app = Flask(__name__)
import petstore_impl
import petstore_server
store = petstore_impl.PetStore()
server = petstore_server.PetStore_server(store)
@app.route("/" + petstore_server.se... | |
f2871ab4a98669b59e14f6748b47cce6327bf824 | examples/recurrent-memory.py | examples/recurrent-memory.py | #!/usr/bin/env python
import climate
import logging
import matplotlib.pyplot as plt
import numpy.random as rng
import theanets
climate.enable_default_logging()
TIME = 10
BATCH_SIZE = 32
e = theanets.Experiment(
theanets.recurrent.Autoencoder,
layers=(3, 100, 3),
recurrent_error_start=TIME - 1,
batch... | Add example for "memory" recurrent task. | Add example for "memory" recurrent task.
| Python | mit | lmjohns3/theanets,devdoer/theanets,chrinide/theanets | Add example for "memory" recurrent task. | #!/usr/bin/env python
import climate
import logging
import matplotlib.pyplot as plt
import numpy.random as rng
import theanets
climate.enable_default_logging()
TIME = 10
BATCH_SIZE = 32
e = theanets.Experiment(
theanets.recurrent.Autoencoder,
layers=(3, 100, 3),
recurrent_error_start=TIME - 1,
batch... | <commit_before><commit_msg>Add example for "memory" recurrent task.<commit_after> | #!/usr/bin/env python
import climate
import logging
import matplotlib.pyplot as plt
import numpy.random as rng
import theanets
climate.enable_default_logging()
TIME = 10
BATCH_SIZE = 32
e = theanets.Experiment(
theanets.recurrent.Autoencoder,
layers=(3, 100, 3),
recurrent_error_start=TIME - 1,
batch... | Add example for "memory" recurrent task.#!/usr/bin/env python
import climate
import logging
import matplotlib.pyplot as plt
import numpy.random as rng
import theanets
climate.enable_default_logging()
TIME = 10
BATCH_SIZE = 32
e = theanets.Experiment(
theanets.recurrent.Autoencoder,
layers=(3, 100, 3),
r... | <commit_before><commit_msg>Add example for "memory" recurrent task.<commit_after>#!/usr/bin/env python
import climate
import logging
import matplotlib.pyplot as plt
import numpy.random as rng
import theanets
climate.enable_default_logging()
TIME = 10
BATCH_SIZE = 32
e = theanets.Experiment(
theanets.recurrent.A... | |
a888a6456da32fc35b94015f0f9de8372ad960a7 | examples/example_baselines.py | examples/example_baselines.py | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import datetime
from teamscale_client import TeamscaleClient
from teamscale_client.constants import AssessmentMetricColors
from teamscale_client.data import Baseline
T... | Add example for adding and listing baselines | Add example for adding and listing baselines
| Python | apache-2.0 | cqse/teamscale-client-python | Add example for adding and listing baselines | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import datetime
from teamscale_client import TeamscaleClient
from teamscale_client.constants import AssessmentMetricColors
from teamscale_client.data import Baseline
T... | <commit_before><commit_msg>Add example for adding and listing baselines<commit_after> | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import datetime
from teamscale_client import TeamscaleClient
from teamscale_client.constants import AssessmentMetricColors
from teamscale_client.data import Baseline
T... | Add example for adding and listing baselinesfrom __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import datetime
from teamscale_client import TeamscaleClient
from teamscale_client.constants import AssessmentMetricColors
fr... | <commit_before><commit_msg>Add example for adding and listing baselines<commit_after>from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import datetime
from teamscale_client import TeamscaleClient
from teamscale_client.c... | |
1ed78df61ebe32f6d1edac490e5d07e8c0558451 | flake8/tests/test_reporter.py | flake8/tests/test_reporter.py | from __future__ import with_statement
import errno
import unittest
try:
from unittest import mock
except ImportError:
import mock # < PY33
from flake8 import reporter
def ioerror_report_factory(errno_code):
class IOErrorBaseQReport(reporter.BaseQReport):
def _process_main(self):
rai... | Add a regression test for EPIPE IOErrors | Add a regression test for EPIPE IOErrors
This should prevent bug 69 from regressing in the future and provides a
framework for testing the addition of new errnos to the ingore list.
| Python | mit | wdv4758h/flake8 | Add a regression test for EPIPE IOErrors
This should prevent bug 69 from regressing in the future and provides a
framework for testing the addition of new errnos to the ingore list. | from __future__ import with_statement
import errno
import unittest
try:
from unittest import mock
except ImportError:
import mock # < PY33
from flake8 import reporter
def ioerror_report_factory(errno_code):
class IOErrorBaseQReport(reporter.BaseQReport):
def _process_main(self):
rai... | <commit_before><commit_msg>Add a regression test for EPIPE IOErrors
This should prevent bug 69 from regressing in the future and provides a
framework for testing the addition of new errnos to the ingore list.<commit_after> | from __future__ import with_statement
import errno
import unittest
try:
from unittest import mock
except ImportError:
import mock # < PY33
from flake8 import reporter
def ioerror_report_factory(errno_code):
class IOErrorBaseQReport(reporter.BaseQReport):
def _process_main(self):
rai... | Add a regression test for EPIPE IOErrors
This should prevent bug 69 from regressing in the future and provides a
framework for testing the addition of new errnos to the ingore list.from __future__ import with_statement
import errno
import unittest
try:
from unittest import mock
except ImportError:
import mock... | <commit_before><commit_msg>Add a regression test for EPIPE IOErrors
This should prevent bug 69 from regressing in the future and provides a
framework for testing the addition of new errnos to the ingore list.<commit_after>from __future__ import with_statement
import errno
import unittest
try:
from unittest import... | |
f1abb5dbfb6fb5f13e574565954d147810df5aa0 | plugins/qrcode.py | plugins/qrcode.py | # -*- encoding:utf8 -*-
import csv
import cStringIO
import settings
from flask import url_for
from model.googledrive import GoogleDrive
from plugins.base.responsebase import IResponseBase
class QRCode(IResponseBase):
def hear_regex(self, **kwargs):
return "^(QRコード|QRCode)$"
def response(self, **k... | Add new response to show QRcode which original data is placed in GoogleDrive. | Add new response to show QRcode which original data is placed in GoogleDrive.
| Python | mit | supistar/Botnyan | Add new response to show QRcode which original data is placed in GoogleDrive. | # -*- encoding:utf8 -*-
import csv
import cStringIO
import settings
from flask import url_for
from model.googledrive import GoogleDrive
from plugins.base.responsebase import IResponseBase
class QRCode(IResponseBase):
def hear_regex(self, **kwargs):
return "^(QRコード|QRCode)$"
def response(self, **k... | <commit_before><commit_msg>Add new response to show QRcode which original data is placed in GoogleDrive.<commit_after> | # -*- encoding:utf8 -*-
import csv
import cStringIO
import settings
from flask import url_for
from model.googledrive import GoogleDrive
from plugins.base.responsebase import IResponseBase
class QRCode(IResponseBase):
def hear_regex(self, **kwargs):
return "^(QRコード|QRCode)$"
def response(self, **k... | Add new response to show QRcode which original data is placed in GoogleDrive.# -*- encoding:utf8 -*-
import csv
import cStringIO
import settings
from flask import url_for
from model.googledrive import GoogleDrive
from plugins.base.responsebase import IResponseBase
class QRCode(IResponseBase):
def hear_regex(s... | <commit_before><commit_msg>Add new response to show QRcode which original data is placed in GoogleDrive.<commit_after># -*- encoding:utf8 -*-
import csv
import cStringIO
import settings
from flask import url_for
from model.googledrive import GoogleDrive
from plugins.base.responsebase import IResponseBase
class QRC... | |
6d70b86b89d682d6bd83fcfc96aef6a582d00101 | readthedocs/rtd_tests/tests/test_core_management.py | readthedocs/rtd_tests/tests/test_core_management.py | from StringIO import StringIO
from django.test import TestCase
from mock import patch
from core.management.commands import run_docker
from projects.models import Project
from builds.models import Version
class TestRunDocker(TestCase):
'''Test run_docker command with good input and output'''
fixtures = ['te... | Add tests for run docker mgmt command | Add tests for run docker mgmt command
| Python | mit | asampat3090/readthedocs.org,atsuyim/readthedocs.org,hach-que/readthedocs.org,CedarLogic/readthedocs.org,davidfischer/readthedocs.org,wijerasa/readthedocs.org,agjohnson/readthedocs.org,cgourlay/readthedocs.org,LukasBoersma/readthedocs.org,tddv/readthedocs.org,d0ugal/readthedocs.org,raven47git/readthedocs.org,emawind84/r... | Add tests for run docker mgmt command | from StringIO import StringIO
from django.test import TestCase
from mock import patch
from core.management.commands import run_docker
from projects.models import Project
from builds.models import Version
class TestRunDocker(TestCase):
'''Test run_docker command with good input and output'''
fixtures = ['te... | <commit_before><commit_msg>Add tests for run docker mgmt command<commit_after> | from StringIO import StringIO
from django.test import TestCase
from mock import patch
from core.management.commands import run_docker
from projects.models import Project
from builds.models import Version
class TestRunDocker(TestCase):
'''Test run_docker command with good input and output'''
fixtures = ['te... | Add tests for run docker mgmt commandfrom StringIO import StringIO
from django.test import TestCase
from mock import patch
from core.management.commands import run_docker
from projects.models import Project
from builds.models import Version
class TestRunDocker(TestCase):
'''Test run_docker command with good inp... | <commit_before><commit_msg>Add tests for run docker mgmt command<commit_after>from StringIO import StringIO
from django.test import TestCase
from mock import patch
from core.management.commands import run_docker
from projects.models import Project
from builds.models import Version
class TestRunDocker(TestCase):
... | |
03f0d55c7a6a893a2cff66d7c1a17ea13b16c4c2 | pvpython_setup.py | pvpython_setup.py | #!/bin/bash
die () {
echo >&2 "$@"
exit 1
}
[ "$#" -eq 1 ] || die "Please provide path to pvpython"
echo "Installing requests ..."
REQUESTS_DIR=`mktemp -d`
wget --no-check-certificate https://github.com/kennethreitz/requests/tarball/v2.8.1 -O - | tar xz -C $REQUESTS_DIR
pushd .
cd $REQUESTS_DIR/*requests*
$... | Add bash script to install require packages in pvpython | Add bash script to install require packages in pvpython
| Python | apache-2.0 | Kitware/HPCCloud-deploy,Kitware/HPCCloud-deploy,Kitware/HPCCloud-deploy | Add bash script to install require packages in pvpython | #!/bin/bash
die () {
echo >&2 "$@"
exit 1
}
[ "$#" -eq 1 ] || die "Please provide path to pvpython"
echo "Installing requests ..."
REQUESTS_DIR=`mktemp -d`
wget --no-check-certificate https://github.com/kennethreitz/requests/tarball/v2.8.1 -O - | tar xz -C $REQUESTS_DIR
pushd .
cd $REQUESTS_DIR/*requests*
$... | <commit_before><commit_msg>Add bash script to install require packages in pvpython<commit_after> | #!/bin/bash
die () {
echo >&2 "$@"
exit 1
}
[ "$#" -eq 1 ] || die "Please provide path to pvpython"
echo "Installing requests ..."
REQUESTS_DIR=`mktemp -d`
wget --no-check-certificate https://github.com/kennethreitz/requests/tarball/v2.8.1 -O - | tar xz -C $REQUESTS_DIR
pushd .
cd $REQUESTS_DIR/*requests*
$... | Add bash script to install require packages in pvpython#!/bin/bash
die () {
echo >&2 "$@"
exit 1
}
[ "$#" -eq 1 ] || die "Please provide path to pvpython"
echo "Installing requests ..."
REQUESTS_DIR=`mktemp -d`
wget --no-check-certificate https://github.com/kennethreitz/requests/tarball/v2.8.1 -O - | tar xz... | <commit_before><commit_msg>Add bash script to install require packages in pvpython<commit_after>#!/bin/bash
die () {
echo >&2 "$@"
exit 1
}
[ "$#" -eq 1 ] || die "Please provide path to pvpython"
echo "Installing requests ..."
REQUESTS_DIR=`mktemp -d`
wget --no-check-certificate https://github.com/kennethre... | |
4fe36181a3a378fbaa80a5ddb1cfcb71aa6686a5 | indra/tests/test_databases.py | indra/tests/test_databases.py | from __future__ import absolute_import, print_function, unicode_literals
from builtins import dict, str
from indra.databases import get_identifiers_url
def test_chembl():
cid = '1229517'
assert get_identifiers_url('CHEMBL', cid) == \
'http://identifiers.org/chembl.compound/CHEMBL%s' % cid
assert g... | Add some tests for db URLs | Add some tests for db URLs
| Python | bsd-2-clause | sorgerlab/indra,johnbachman/belpy,sorgerlab/belpy,sorgerlab/belpy,pvtodorov/indra,johnbachman/indra,sorgerlab/indra,pvtodorov/indra,bgyori/indra,johnbachman/belpy,bgyori/indra,pvtodorov/indra,johnbachman/belpy,sorgerlab/indra,johnbachman/indra,pvtodorov/indra,bgyori/indra,sorgerlab/belpy,johnbachman/indra | Add some tests for db URLs | from __future__ import absolute_import, print_function, unicode_literals
from builtins import dict, str
from indra.databases import get_identifiers_url
def test_chembl():
cid = '1229517'
assert get_identifiers_url('CHEMBL', cid) == \
'http://identifiers.org/chembl.compound/CHEMBL%s' % cid
assert g... | <commit_before><commit_msg>Add some tests for db URLs<commit_after> | from __future__ import absolute_import, print_function, unicode_literals
from builtins import dict, str
from indra.databases import get_identifiers_url
def test_chembl():
cid = '1229517'
assert get_identifiers_url('CHEMBL', cid) == \
'http://identifiers.org/chembl.compound/CHEMBL%s' % cid
assert g... | Add some tests for db URLsfrom __future__ import absolute_import, print_function, unicode_literals
from builtins import dict, str
from indra.databases import get_identifiers_url
def test_chembl():
cid = '1229517'
assert get_identifiers_url('CHEMBL', cid) == \
'http://identifiers.org/chembl.compound/CH... | <commit_before><commit_msg>Add some tests for db URLs<commit_after>from __future__ import absolute_import, print_function, unicode_literals
from builtins import dict, str
from indra.databases import get_identifiers_url
def test_chembl():
cid = '1229517'
assert get_identifiers_url('CHEMBL', cid) == \
'... | |
2c229c36cc9f8b239bc6886e77aae55e08a38ee6 | go_optouts/tests/utils.py | go_optouts/tests/utils.py | from zope.interface import implements
import treq
from twisted.internet import reactor
from twisted.internet.defer import inlineCallbacks
from vumi.tests.helpers import IHelper
class SiteHelper(object):
""" Helper for testing HTTP Sites.
:type site:
twisted.web.server.Site
:param site:
... | Add helper utility for testing HTTP sites. | Add helper utility for testing HTTP sites.
| Python | bsd-3-clause | praekelt/go-optouts-api,praekelt/go-optouts-api | Add helper utility for testing HTTP sites. | from zope.interface import implements
import treq
from twisted.internet import reactor
from twisted.internet.defer import inlineCallbacks
from vumi.tests.helpers import IHelper
class SiteHelper(object):
""" Helper for testing HTTP Sites.
:type site:
twisted.web.server.Site
:param site:
... | <commit_before><commit_msg>Add helper utility for testing HTTP sites.<commit_after> | from zope.interface import implements
import treq
from twisted.internet import reactor
from twisted.internet.defer import inlineCallbacks
from vumi.tests.helpers import IHelper
class SiteHelper(object):
""" Helper for testing HTTP Sites.
:type site:
twisted.web.server.Site
:param site:
... | Add helper utility for testing HTTP sites.from zope.interface import implements
import treq
from twisted.internet import reactor
from twisted.internet.defer import inlineCallbacks
from vumi.tests.helpers import IHelper
class SiteHelper(object):
""" Helper for testing HTTP Sites.
:type site:
twisted... | <commit_before><commit_msg>Add helper utility for testing HTTP sites.<commit_after>from zope.interface import implements
import treq
from twisted.internet import reactor
from twisted.internet.defer import inlineCallbacks
from vumi.tests.helpers import IHelper
class SiteHelper(object):
""" Helper for testing HTT... | |
8216ba599b6c33207f413381b755d8db25c01440 | spacy/tests/en/tokenizer/test_text.py | spacy/tests/en/tokenizer/test_text.py | # coding: utf-8
"""Test that longer and mixed texts are tokenized correctly."""
from __future__ import unicode_literals
import pytest
def test_tokenizer_handles_long_text(en_tokenizer):
text = """Tributes pour in for late British Labour Party leader
Tributes poured in from around the world Thursday
to the lat... | Add tests for longer and mixed English texts | Add tests for longer and mixed English texts
| Python | mit | raphael0202/spaCy,banglakit/spaCy,honnibal/spaCy,oroszgy/spaCy.hu,aikramer2/spaCy,aikramer2/spaCy,banglakit/spaCy,raphael0202/spaCy,aikramer2/spaCy,Gregory-Howard/spaCy,Gregory-Howard/spaCy,aikramer2/spaCy,spacy-io/spaCy,spacy-io/spaCy,oroszgy/spaCy.hu,Gregory-Howard/spaCy,recognai/spaCy,banglakit/spaCy,banglakit/spaCy... | Add tests for longer and mixed English texts | # coding: utf-8
"""Test that longer and mixed texts are tokenized correctly."""
from __future__ import unicode_literals
import pytest
def test_tokenizer_handles_long_text(en_tokenizer):
text = """Tributes pour in for late British Labour Party leader
Tributes poured in from around the world Thursday
to the lat... | <commit_before><commit_msg>Add tests for longer and mixed English texts<commit_after> | # coding: utf-8
"""Test that longer and mixed texts are tokenized correctly."""
from __future__ import unicode_literals
import pytest
def test_tokenizer_handles_long_text(en_tokenizer):
text = """Tributes pour in for late British Labour Party leader
Tributes poured in from around the world Thursday
to the lat... | Add tests for longer and mixed English texts# coding: utf-8
"""Test that longer and mixed texts are tokenized correctly."""
from __future__ import unicode_literals
import pytest
def test_tokenizer_handles_long_text(en_tokenizer):
text = """Tributes pour in for late British Labour Party leader
Tributes poured ... | <commit_before><commit_msg>Add tests for longer and mixed English texts<commit_after># coding: utf-8
"""Test that longer and mixed texts are tokenized correctly."""
from __future__ import unicode_literals
import pytest
def test_tokenizer_handles_long_text(en_tokenizer):
text = """Tributes pour in for late Brit... | |
f9354e295ff88c8084021bc7474a18a2a78bd5f4 | apps/schools/migrations/0002_auto_20150519_2205.py | apps/schools/migrations/0002_auto_20150519_2205.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('schools', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='academicyear',
name='en... | Add start and end year in the academic year table and model - migrations file | Add start and end year in the academic year table and model - migrations file
| Python | mit | klpdotorg/tada,klpdotorg/tada | Add start and end year in the academic year table and model - migrations file | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('schools', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='academicyear',
name='en... | <commit_before><commit_msg>Add start and end year in the academic year table and model - migrations file<commit_after> | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('schools', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='academicyear',
name='en... | Add start and end year in the academic year table and model - migrations file# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('schools', '0001_initial'),
]
operations = [
mig... | <commit_before><commit_msg>Add start and end year in the academic year table and model - migrations file<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('schools', '0001_initial... | |
6eeeb98e4fab1edac2bf85b7a89cc5cdedead808 | cibopath/github_api.py | cibopath/github_api.py | # -*- coding: utf-8 -*-
import base64
import logging
import json
import aiohttp
logger = logging.getLogger('cibopath')
API_ROOT = 'https://api.github.com/'
API_README = API_ROOT + 'repos/{user}/{repo}/readme'
API_COOKIECUTTER_JSON = (
API_ROOT + 'repos/{user}/{repo}/contents/cookiecutter.json'
)
async def get(... | Implement async github api client | Implement async github api client
| Python | bsd-3-clause | hackebrot/cibopath | Implement async github api client | # -*- coding: utf-8 -*-
import base64
import logging
import json
import aiohttp
logger = logging.getLogger('cibopath')
API_ROOT = 'https://api.github.com/'
API_README = API_ROOT + 'repos/{user}/{repo}/readme'
API_COOKIECUTTER_JSON = (
API_ROOT + 'repos/{user}/{repo}/contents/cookiecutter.json'
)
async def get(... | <commit_before><commit_msg>Implement async github api client<commit_after> | # -*- coding: utf-8 -*-
import base64
import logging
import json
import aiohttp
logger = logging.getLogger('cibopath')
API_ROOT = 'https://api.github.com/'
API_README = API_ROOT + 'repos/{user}/{repo}/readme'
API_COOKIECUTTER_JSON = (
API_ROOT + 'repos/{user}/{repo}/contents/cookiecutter.json'
)
async def get(... | Implement async github api client# -*- coding: utf-8 -*-
import base64
import logging
import json
import aiohttp
logger = logging.getLogger('cibopath')
API_ROOT = 'https://api.github.com/'
API_README = API_ROOT + 'repos/{user}/{repo}/readme'
API_COOKIECUTTER_JSON = (
API_ROOT + 'repos/{user}/{repo}/contents/coo... | <commit_before><commit_msg>Implement async github api client<commit_after># -*- coding: utf-8 -*-
import base64
import logging
import json
import aiohttp
logger = logging.getLogger('cibopath')
API_ROOT = 'https://api.github.com/'
API_README = API_ROOT + 'repos/{user}/{repo}/readme'
API_COOKIECUTTER_JSON = (
API... | |
bb4e705d646c2c6d45b3fb146c1c318d1fd917ff | test/unittests/util/test_plugins.py | test/unittests/util/test_plugins.py | # Copyright 2020 Mycroft AI Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | Add unittests for the plugin util | Add unittests for the plugin util
| Python | apache-2.0 | MycroftAI/mycroft-core,forslund/mycroft-core,MycroftAI/mycroft-core,forslund/mycroft-core | Add unittests for the plugin util | # Copyright 2020 Mycroft AI Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | <commit_before><commit_msg>Add unittests for the plugin util<commit_after> | # Copyright 2020 Mycroft AI Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | Add unittests for the plugin util# Copyright 2020 Mycroft AI 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 appl... | <commit_before><commit_msg>Add unittests for the plugin util<commit_after># Copyright 2020 Mycroft AI 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/license... | |
ac1c8d10ac6106decf59bb20622f42aef670c8a4 | wafer/management/commands/wafer_add_default_groups.py | wafer/management/commands/wafer_add_default_groups.py | # -*- coding: utf-8 -*-
from django.core.management.base import BaseCommand
from django.contrib.auth.models import Group, Permission
class Command(BaseCommand):
help = "Add some useful default groups"
option_list = BaseCommand.option_list + tuple([
])
GROUPS = {
# Permissions are specified a... | Add a management command to add the default groups we want | Add a management command to add the default groups we want
| Python | isc | CTPUG/wafer,CarlFK/wafer,CarlFK/wafer,CTPUG/wafer,CTPUG/wafer,CarlFK/wafer,CTPUG/wafer,CarlFK/wafer | Add a management command to add the default groups we want | # -*- coding: utf-8 -*-
from django.core.management.base import BaseCommand
from django.contrib.auth.models import Group, Permission
class Command(BaseCommand):
help = "Add some useful default groups"
option_list = BaseCommand.option_list + tuple([
])
GROUPS = {
# Permissions are specified a... | <commit_before><commit_msg>Add a management command to add the default groups we want<commit_after> | # -*- coding: utf-8 -*-
from django.core.management.base import BaseCommand
from django.contrib.auth.models import Group, Permission
class Command(BaseCommand):
help = "Add some useful default groups"
option_list = BaseCommand.option_list + tuple([
])
GROUPS = {
# Permissions are specified a... | Add a management command to add the default groups we want# -*- coding: utf-8 -*-
from django.core.management.base import BaseCommand
from django.contrib.auth.models import Group, Permission
class Command(BaseCommand):
help = "Add some useful default groups"
option_list = BaseCommand.option_list + tuple([
... | <commit_before><commit_msg>Add a management command to add the default groups we want<commit_after># -*- coding: utf-8 -*-
from django.core.management.base import BaseCommand
from django.contrib.auth.models import Group, Permission
class Command(BaseCommand):
help = "Add some useful default groups"
option_l... | |
5b298e30fd5251bd9bf2c154c267bd86f1bc03cc | libexec/check_shinken_mem.py | libexec/check_shinken_mem.py | #!/usr/bin/env python
# Autor : David Hannequin <[email protected]>
# Date : 29 Nov 2011
#
# Script init
#
import sys
import os
import argparse
import getopt
#
# Usage
#
def usage():
print 'Usage :'
print sys.argv[0] + ' -w <80> -c <90>'
print '-p --port : snmp port by default 161'
pr... | Add shinken plugin to check memory usage | Add shinken plugin to check memory usage
| Python | agpl-3.0 | rledisez/shinken,staute/shinken_deb,peeyush-tm/shinken,h4wkmoon/shinken,fpeyre/shinken,savoirfairelinux/shinken,peeyush-tm/shinken,rledisez/shinken,Simage/shinken,ddurieux/alignak,kaji-project/shinken,rednach/krill,dfranco/shinken,fpeyre/shinken,lets-software/shinken,fpeyre/shinken,tal-nino/shinken,baloo/shinken,geekto... | Add shinken plugin to check memory usage | #!/usr/bin/env python
# Autor : David Hannequin <[email protected]>
# Date : 29 Nov 2011
#
# Script init
#
import sys
import os
import argparse
import getopt
#
# Usage
#
def usage():
print 'Usage :'
print sys.argv[0] + ' -w <80> -c <90>'
print '-p --port : snmp port by default 161'
pr... | <commit_before><commit_msg>Add shinken plugin to check memory usage<commit_after> | #!/usr/bin/env python
# Autor : David Hannequin <[email protected]>
# Date : 29 Nov 2011
#
# Script init
#
import sys
import os
import argparse
import getopt
#
# Usage
#
def usage():
print 'Usage :'
print sys.argv[0] + ' -w <80> -c <90>'
print '-p --port : snmp port by default 161'
pr... | Add shinken plugin to check memory usage#!/usr/bin/env python
# Autor : David Hannequin <[email protected]>
# Date : 29 Nov 2011
#
# Script init
#
import sys
import os
import argparse
import getopt
#
# Usage
#
def usage():
print 'Usage :'
print sys.argv[0] + ' -w <80> -c <90>'
print '-p --... | <commit_before><commit_msg>Add shinken plugin to check memory usage<commit_after>#!/usr/bin/env python
# Autor : David Hannequin <[email protected]>
# Date : 29 Nov 2011
#
# Script init
#
import sys
import os
import argparse
import getopt
#
# Usage
#
def usage():
print 'Usage :'
print sys.argv... | |
08ae11ddea167e8f42f3567cb3655d8c0571459b | custom/enikshay/integrations/tests/test_case_properties_changed.py | custom/enikshay/integrations/tests/test_case_properties_changed.py | from __future__ import absolute_import
import uuid
from django.test import TestCase, override_settings
from casexml.apps.case.mock import CaseBlock
from corehq.apps.domain.shortcuts import create_domain
from corehq.apps.hqcase.utils import submit_case_blocks
from corehq.form_processor.interfaces.dbaccessors import C... | Add test for case properties changed function | Add test for case properties changed function
| Python | bsd-3-clause | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | Add test for case properties changed function | from __future__ import absolute_import
import uuid
from django.test import TestCase, override_settings
from casexml.apps.case.mock import CaseBlock
from corehq.apps.domain.shortcuts import create_domain
from corehq.apps.hqcase.utils import submit_case_blocks
from corehq.form_processor.interfaces.dbaccessors import C... | <commit_before><commit_msg>Add test for case properties changed function<commit_after> | from __future__ import absolute_import
import uuid
from django.test import TestCase, override_settings
from casexml.apps.case.mock import CaseBlock
from corehq.apps.domain.shortcuts import create_domain
from corehq.apps.hqcase.utils import submit_case_blocks
from corehq.form_processor.interfaces.dbaccessors import C... | Add test for case properties changed functionfrom __future__ import absolute_import
import uuid
from django.test import TestCase, override_settings
from casexml.apps.case.mock import CaseBlock
from corehq.apps.domain.shortcuts import create_domain
from corehq.apps.hqcase.utils import submit_case_blocks
from corehq.f... | <commit_before><commit_msg>Add test for case properties changed function<commit_after>from __future__ import absolute_import
import uuid
from django.test import TestCase, override_settings
from casexml.apps.case.mock import CaseBlock
from corehq.apps.domain.shortcuts import create_domain
from corehq.apps.hqcase.util... | |
176889933feca3c1231634062b0507afde6ddac3 | skimage/io/tests/test_mpl_imshow.py | skimage/io/tests/test_mpl_imshow.py | from __future__ import division
import numpy as np
from skimage import io
io.use_plugin('matplotlib', 'imshow')
# test images. Note that they don't have their full range for their dtype,
# but we still expect the display range to equal the full dtype range.
im8 = np.array([[0, 64], [128, 240]], np.uint8)
im16 = im8... | Add tests for io.imshow mpl plugin | Add tests for io.imshow mpl plugin
| Python | bsd-3-clause | WarrenWeckesser/scikits-image,keflavich/scikit-image,bennlich/scikit-image,rjeli/scikit-image,robintw/scikit-image,rjeli/scikit-image,vighneshbirodkar/scikit-image,vighneshbirodkar/scikit-image,youprofit/scikit-image,michaelpacer/scikit-image,GaZ3ll3/scikit-image,pratapvardhan/scikit-image,Britefury/scikit-image,vighne... | Add tests for io.imshow mpl plugin | from __future__ import division
import numpy as np
from skimage import io
io.use_plugin('matplotlib', 'imshow')
# test images. Note that they don't have their full range for their dtype,
# but we still expect the display range to equal the full dtype range.
im8 = np.array([[0, 64], [128, 240]], np.uint8)
im16 = im8... | <commit_before><commit_msg>Add tests for io.imshow mpl plugin<commit_after> | from __future__ import division
import numpy as np
from skimage import io
io.use_plugin('matplotlib', 'imshow')
# test images. Note that they don't have their full range for their dtype,
# but we still expect the display range to equal the full dtype range.
im8 = np.array([[0, 64], [128, 240]], np.uint8)
im16 = im8... | Add tests for io.imshow mpl pluginfrom __future__ import division
import numpy as np
from skimage import io
io.use_plugin('matplotlib', 'imshow')
# test images. Note that they don't have their full range for their dtype,
# but we still expect the display range to equal the full dtype range.
im8 = np.array([[0, 64],... | <commit_before><commit_msg>Add tests for io.imshow mpl plugin<commit_after>from __future__ import division
import numpy as np
from skimage import io
io.use_plugin('matplotlib', 'imshow')
# test images. Note that they don't have their full range for their dtype,
# but we still expect the display range to equal the f... | |
bbbc5bf17ae50829bcee5d65156e0e03b7df3150 | gradefiles-assemble.py | gradefiles-assemble.py | #####################################################################
##
## gradefiles-assemble.py
##
## Script template for assembling a collection of gradefiles from
## a collection of graded submissions (processed using the grading
## script).
##
##
import os # File/folder work (walk, path, s... | Add script for assembling grade files and spreadsheet summary from graded submissions. | Add script for assembling grade files and spreadsheet summary from graded submissions.
| Python | mit | lapets/bu-gsubmit-grading | Add script for assembling grade files and spreadsheet summary from graded submissions. | #####################################################################
##
## gradefiles-assemble.py
##
## Script template for assembling a collection of gradefiles from
## a collection of graded submissions (processed using the grading
## script).
##
##
import os # File/folder work (walk, path, s... | <commit_before><commit_msg>Add script for assembling grade files and spreadsheet summary from graded submissions.<commit_after> | #####################################################################
##
## gradefiles-assemble.py
##
## Script template for assembling a collection of gradefiles from
## a collection of graded submissions (processed using the grading
## script).
##
##
import os # File/folder work (walk, path, s... | Add script for assembling grade files and spreadsheet summary from graded submissions.#####################################################################
##
## gradefiles-assemble.py
##
## Script template for assembling a collection of gradefiles from
## a collection of graded submissions (processed using the gr... | <commit_before><commit_msg>Add script for assembling grade files and spreadsheet summary from graded submissions.<commit_after>#####################################################################
##
## gradefiles-assemble.py
##
## Script template for assembling a collection of gradefiles from
## a collection of g... | |
a7af552f0959908e82c4bcd1736697337c35a6d3 | test/selenium/src/tests/test_people_groups_page.py | test/selenium/src/tests/test_people_groups_page.py | # Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: [email protected]
# Maintained By: [email protected]
"""All smoke tests relevant to program page"""
import pytest # pylint: di... | Add people groups page tests | Add people groups page tests
| Python | apache-2.0 | edofic/ggrc-core,plamut/ggrc-core,j0gurt/ggrc-core,prasannav7/ggrc-core,edofic/ggrc-core,selahssea/ggrc-core,plamut/ggrc-core,kr41/ggrc-core,andrei-karalionak/ggrc-core,VinnieJohns/ggrc-core,j0gurt/ggrc-core,prasannav7/ggrc-core,plamut/ggrc-core,VinnieJohns/ggrc-core,kr41/ggrc-core,plamut/ggrc-core,josthkko/ggrc-core,A... | Add people groups page tests | # Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: [email protected]
# Maintained By: [email protected]
"""All smoke tests relevant to program page"""
import pytest # pylint: di... | <commit_before><commit_msg>Add people groups page tests<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: [email protected]
# Maintained By: [email protected]
"""All smoke tests relevant to program page"""
import pytest # pylint: di... | Add people groups page tests# Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: [email protected]
# Maintained By: [email protected]
"""All smoke tests relevant to program page"""
i... | <commit_before><commit_msg>Add people groups page tests<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: [email protected]
# Maintained By: [email protected]
"""All s... | |
04f3cdc3ca261c747aab72e2866fe0718eb410b1 | tests/test_interoperables.py | tests/test_interoperables.py | import pytest
def test_default_app():
from repocribro.app import app
import flask
assert isinstance(app, flask.Flask)
def test_main_manager(capsys):
with pytest.raises(SystemExit):
import repocribro.__main__
out, err = capsys.readouterr()
assert 'usage' in out
assert 'arguments' ... | Test interfaces for std manipulation with app | Test interfaces for std manipulation with app
| Python | mit | MarekSuchanek/repocribro,MarekSuchanek/repocribro,MarekSuchanek/repocribro | Test interfaces for std manipulation with app | import pytest
def test_default_app():
from repocribro.app import app
import flask
assert isinstance(app, flask.Flask)
def test_main_manager(capsys):
with pytest.raises(SystemExit):
import repocribro.__main__
out, err = capsys.readouterr()
assert 'usage' in out
assert 'arguments' ... | <commit_before><commit_msg>Test interfaces for std manipulation with app<commit_after> | import pytest
def test_default_app():
from repocribro.app import app
import flask
assert isinstance(app, flask.Flask)
def test_main_manager(capsys):
with pytest.raises(SystemExit):
import repocribro.__main__
out, err = capsys.readouterr()
assert 'usage' in out
assert 'arguments' ... | Test interfaces for std manipulation with appimport pytest
def test_default_app():
from repocribro.app import app
import flask
assert isinstance(app, flask.Flask)
def test_main_manager(capsys):
with pytest.raises(SystemExit):
import repocribro.__main__
out, err = capsys.readouterr()
... | <commit_before><commit_msg>Test interfaces for std manipulation with app<commit_after>import pytest
def test_default_app():
from repocribro.app import app
import flask
assert isinstance(app, flask.Flask)
def test_main_manager(capsys):
with pytest.raises(SystemExit):
import repocribro.__main_... | |
b3aeb1b1270e86d8c85a286de3a5f8443cfee2e5 | planetstack/model_policies/model_policy_Slice.py | planetstack/model_policies/model_policy_Slice.py | from core.models import *
def handle(slice):
site_deployments = SiteDeployments.objects.all()
site_deploy_lookup = defaultdict(list)
for site_deployment in site_deployments:
site_deploy_lookup[site_deployment.site].append(site_deployment.deployment)
slice_deployments = SliceDeployments.objects.all()
slice_dep... | Add new slices to all deployments | Policy: Add new slices to all deployments
| Python | apache-2.0 | wathsalav/xos,zdw/xos,xmaruto/mcord,cboling/xos,cboling/xos,wathsalav/xos,zdw/xos,xmaruto/mcord,zdw/xos,cboling/xos,opencord/xos,jermowery/xos,open-cloud/xos,xmaruto/mcord,opencord/xos,wathsalav/xos,opencord/xos,jermowery/xos,cboling/xos,cboling/xos,jermowery/xos,zdw/xos,open-cloud/xos,jermowery/xos,wathsalav/xos,xmaru... | Policy: Add new slices to all deployments | from core.models import *
def handle(slice):
site_deployments = SiteDeployments.objects.all()
site_deploy_lookup = defaultdict(list)
for site_deployment in site_deployments:
site_deploy_lookup[site_deployment.site].append(site_deployment.deployment)
slice_deployments = SliceDeployments.objects.all()
slice_dep... | <commit_before><commit_msg>Policy: Add new slices to all deployments<commit_after> | from core.models import *
def handle(slice):
site_deployments = SiteDeployments.objects.all()
site_deploy_lookup = defaultdict(list)
for site_deployment in site_deployments:
site_deploy_lookup[site_deployment.site].append(site_deployment.deployment)
slice_deployments = SliceDeployments.objects.all()
slice_dep... | Policy: Add new slices to all deploymentsfrom core.models import *
def handle(slice):
site_deployments = SiteDeployments.objects.all()
site_deploy_lookup = defaultdict(list)
for site_deployment in site_deployments:
site_deploy_lookup[site_deployment.site].append(site_deployment.deployment)
slice_deployments = ... | <commit_before><commit_msg>Policy: Add new slices to all deployments<commit_after>from core.models import *
def handle(slice):
site_deployments = SiteDeployments.objects.all()
site_deploy_lookup = defaultdict(list)
for site_deployment in site_deployments:
site_deploy_lookup[site_deployment.site].append(site_deplo... | |
7b44e91065a5dd8428a06949f797cbfab81d3cd9 | lily/users/migrations/0024_auto_20171221_1325.py | lily/users/migrations/0024_auto_20171221_1325.py | # -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2017-12-21 13:25
from __future__ import unicode_literals
import django.contrib.auth.models
from django.db import migrations
import lily.users.models
class Migration(migrations.Migration):
dependencies = [
('users', '0023_userinvite'),
]
op... | Add migration for new manager on user | Add migration for new manager on user
| Python | agpl-3.0 | HelloLily/hellolily,HelloLily/hellolily,HelloLily/hellolily,HelloLily/hellolily | Add migration for new manager on user | # -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2017-12-21 13:25
from __future__ import unicode_literals
import django.contrib.auth.models
from django.db import migrations
import lily.users.models
class Migration(migrations.Migration):
dependencies = [
('users', '0023_userinvite'),
]
op... | <commit_before><commit_msg>Add migration for new manager on user<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2017-12-21 13:25
from __future__ import unicode_literals
import django.contrib.auth.models
from django.db import migrations
import lily.users.models
class Migration(migrations.Migration):
dependencies = [
('users', '0023_userinvite'),
]
op... | Add migration for new manager on user# -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2017-12-21 13:25
from __future__ import unicode_literals
import django.contrib.auth.models
from django.db import migrations
import lily.users.models
class Migration(migrations.Migration):
dependencies = [
('user... | <commit_before><commit_msg>Add migration for new manager on user<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2017-12-21 13:25
from __future__ import unicode_literals
import django.contrib.auth.models
from django.db import migrations
import lily.users.models
class Migration(migrations.Migrati... | |
1851dff98bea8b48266a76688d5370ea8a4b30b1 | tools/tools.py | tools/tools.py | import numpy as np
import cPickle as pickle
import os
def collage(data):
if type(data) is not list:
if data.shape[3] != 3:
data = data.transpose(0, 2, 3, 1)
images = [img for img in data]
else:
images = list(data)
side = int(np.ceil(len(images)**0.5))
f... | Add CIFAR reading and image collage. | Add CIFAR reading and image collage.
| Python | bsd-3-clause | michal-hradis/CNN_seminar | Add CIFAR reading and image collage. | import numpy as np
import cPickle as pickle
import os
def collage(data):
if type(data) is not list:
if data.shape[3] != 3:
data = data.transpose(0, 2, 3, 1)
images = [img for img in data]
else:
images = list(data)
side = int(np.ceil(len(images)**0.5))
f... | <commit_before><commit_msg>Add CIFAR reading and image collage.<commit_after> | import numpy as np
import cPickle as pickle
import os
def collage(data):
if type(data) is not list:
if data.shape[3] != 3:
data = data.transpose(0, 2, 3, 1)
images = [img for img in data]
else:
images = list(data)
side = int(np.ceil(len(images)**0.5))
f... | Add CIFAR reading and image collage.import numpy as np
import cPickle as pickle
import os
def collage(data):
if type(data) is not list:
if data.shape[3] != 3:
data = data.transpose(0, 2, 3, 1)
images = [img for img in data]
else:
images = list(data)
side = ... | <commit_before><commit_msg>Add CIFAR reading and image collage.<commit_after>import numpy as np
import cPickle as pickle
import os
def collage(data):
if type(data) is not list:
if data.shape[3] != 3:
data = data.transpose(0, 2, 3, 1)
images = [img for img in data]
else:... | |
c4d05d03629a056ef79f4dcd2cd2f2da24c35500 | third_party/tvcm/tvcm/generate_unittest.py | third_party/tvcm/tvcm/generate_unittest.py | # Copyright (c) 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import unittest
from tvcm import generate
from tvcm import fake_fs
from tvcm import project as project_module
from tvcm import resource_loader
from tvcm ... | Add smoke test for HTML generation | Add smoke test for HTML generation
git-svn-id: 3a56fcae908c7e16d23cb53443ea4795ac387cf2@1150 0e6d7f2b-9903-5b78-7403-59d27f066143
| Python | bsd-3-clause | bpsinc-native/src_third_party_trace-viewer,bpsinc-native/src_third_party_trace-viewer,bpsinc-native/src_third_party_trace-viewer,bpsinc-native/src_third_party_trace-viewer | Add smoke test for HTML generation
git-svn-id: 3a56fcae908c7e16d23cb53443ea4795ac387cf2@1150 0e6d7f2b-9903-5b78-7403-59d27f066143 | # Copyright (c) 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import unittest
from tvcm import generate
from tvcm import fake_fs
from tvcm import project as project_module
from tvcm import resource_loader
from tvcm ... | <commit_before><commit_msg>Add smoke test for HTML generation
git-svn-id: 3a56fcae908c7e16d23cb53443ea4795ac387cf2@1150 0e6d7f2b-9903-5b78-7403-59d27f066143<commit_after> | # Copyright (c) 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import unittest
from tvcm import generate
from tvcm import fake_fs
from tvcm import project as project_module
from tvcm import resource_loader
from tvcm ... | Add smoke test for HTML generation
git-svn-id: 3a56fcae908c7e16d23cb53443ea4795ac387cf2@1150 0e6d7f2b-9903-5b78-7403-59d27f066143# Copyright (c) 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import unittest
from tv... | <commit_before><commit_msg>Add smoke test for HTML generation
git-svn-id: 3a56fcae908c7e16d23cb53443ea4795ac387cf2@1150 0e6d7f2b-9903-5b78-7403-59d27f066143<commit_after># Copyright (c) 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in t... | |
3671e814810aa2c36e2c377ca16fcd0eae5766c5 | openid/test/test_codecutil.py | openid/test/test_codecutil.py | import unittest
from openid import codecutil # registers encoder
class EncoderTest(unittest.TestCase):
def test_handler_registered(self):
self.assertEqual(
"foo".encode('ascii', errors='oid_percent_escape'),
b"foo")
def test_encoding(self):
s = 'l\xa1m\U00101010n'
... | Add tests for new codecutil module -- very basic for now | Add tests for new codecutil module -- very basic for now
| Python | apache-2.0 | isagalaev/sm-openid,moreati/python3-openid,misli/python3-openid,misli/python3-openid,necaris/python3-openid,moreati/python3-openid,necaris/python3-openid,misli/python3-openid,moreati/python3-openid | Add tests for new codecutil module -- very basic for now | import unittest
from openid import codecutil # registers encoder
class EncoderTest(unittest.TestCase):
def test_handler_registered(self):
self.assertEqual(
"foo".encode('ascii', errors='oid_percent_escape'),
b"foo")
def test_encoding(self):
s = 'l\xa1m\U00101010n'
... | <commit_before><commit_msg>Add tests for new codecutil module -- very basic for now<commit_after> | import unittest
from openid import codecutil # registers encoder
class EncoderTest(unittest.TestCase):
def test_handler_registered(self):
self.assertEqual(
"foo".encode('ascii', errors='oid_percent_escape'),
b"foo")
def test_encoding(self):
s = 'l\xa1m\U00101010n'
... | Add tests for new codecutil module -- very basic for nowimport unittest
from openid import codecutil # registers encoder
class EncoderTest(unittest.TestCase):
def test_handler_registered(self):
self.assertEqual(
"foo".encode('ascii', errors='oid_percent_escape'),
b"foo")
def... | <commit_before><commit_msg>Add tests for new codecutil module -- very basic for now<commit_after>import unittest
from openid import codecutil # registers encoder
class EncoderTest(unittest.TestCase):
def test_handler_registered(self):
self.assertEqual(
"foo".encode('ascii', errors='oid_perce... | |
65d5f4f3947b115421f273b7edb22420035c3ca3 | obfsproxy/common/modexp.py | obfsproxy/common/modexp.py | import gmpy
def powMod( x, y, mod ):
"""
Efficiently calculate and return `x' to the power of `y' mod `mod'.
Before the modular exponentiation, the three numbers are converted to
GMPY's bignum representation which speeds up exponentiation.
"""
x = gmpy.mpz(x)
y = gmpy.mpz(y)
mod = gmp... | Add function for fast modular exponentiation. | Add function for fast modular exponentiation.
The function uses GMPY's bignum arithmetic which speeds up the calculation.
| Python | bsd-3-clause | qdzheng/obfsproxy,infinity0/obfsproxy,catinred2/obfsproxy,NullHypothesis/obfsproxy,isislovecruft/obfsproxy,Yawning/obfsproxy,masterkorp/obfsproxy,Yawning/obfsproxy-wfpadtools,sunsong/obfsproxy,david415/obfsproxy | Add function for fast modular exponentiation.
The function uses GMPY's bignum arithmetic which speeds up the calculation. | import gmpy
def powMod( x, y, mod ):
"""
Efficiently calculate and return `x' to the power of `y' mod `mod'.
Before the modular exponentiation, the three numbers are converted to
GMPY's bignum representation which speeds up exponentiation.
"""
x = gmpy.mpz(x)
y = gmpy.mpz(y)
mod = gmp... | <commit_before><commit_msg>Add function for fast modular exponentiation.
The function uses GMPY's bignum arithmetic which speeds up the calculation.<commit_after> | import gmpy
def powMod( x, y, mod ):
"""
Efficiently calculate and return `x' to the power of `y' mod `mod'.
Before the modular exponentiation, the three numbers are converted to
GMPY's bignum representation which speeds up exponentiation.
"""
x = gmpy.mpz(x)
y = gmpy.mpz(y)
mod = gmp... | Add function for fast modular exponentiation.
The function uses GMPY's bignum arithmetic which speeds up the calculation.import gmpy
def powMod( x, y, mod ):
"""
Efficiently calculate and return `x' to the power of `y' mod `mod'.
Before the modular exponentiation, the three numbers are converted to
G... | <commit_before><commit_msg>Add function for fast modular exponentiation.
The function uses GMPY's bignum arithmetic which speeds up the calculation.<commit_after>import gmpy
def powMod( x, y, mod ):
"""
Efficiently calculate and return `x' to the power of `y' mod `mod'.
Before the modular exponentiation,... | |
28ee0bca9ea36b61a48345271f0eef650896e17f | crawler/cocktails/spiders/kindredcocktails.py | crawler/cocktails/spiders/kindredcocktails.py | from scrapy.contrib.spiders import CrawlSpider, Rule
from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor
from scrapy.selector import HtmlXPathSelector
from lxml.cssselect import css_to_xpath
from cocktails.items import CocktailItem
from cocktails.utils import html_to_text
xp_ingredients = css_to_xpath('... | Add spider for Kindred Cocktails | Add spider for Kindred Cocktails
| Python | agpl-3.0 | snoack/cocktail-search,snoack/cocktail-search,snoack/cocktail-search,snoack/cocktail-search | Add spider for Kindred Cocktails | from scrapy.contrib.spiders import CrawlSpider, Rule
from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor
from scrapy.selector import HtmlXPathSelector
from lxml.cssselect import css_to_xpath
from cocktails.items import CocktailItem
from cocktails.utils import html_to_text
xp_ingredients = css_to_xpath('... | <commit_before><commit_msg>Add spider for Kindred Cocktails<commit_after> | from scrapy.contrib.spiders import CrawlSpider, Rule
from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor
from scrapy.selector import HtmlXPathSelector
from lxml.cssselect import css_to_xpath
from cocktails.items import CocktailItem
from cocktails.utils import html_to_text
xp_ingredients = css_to_xpath('... | Add spider for Kindred Cocktailsfrom scrapy.contrib.spiders import CrawlSpider, Rule
from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor
from scrapy.selector import HtmlXPathSelector
from lxml.cssselect import css_to_xpath
from cocktails.items import CocktailItem
from cocktails.utils import html_to_text
... | <commit_before><commit_msg>Add spider for Kindred Cocktails<commit_after>from scrapy.contrib.spiders import CrawlSpider, Rule
from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor
from scrapy.selector import HtmlXPathSelector
from lxml.cssselect import css_to_xpath
from cocktails.items import CocktailItem
... | |
82bf5a22e132827b5466ce541be40876e766fb88 | encoding/scrub_page.py | encoding/scrub_page.py | import re
import sys
def remove_lang_templates(string):
# Preserves text inside template, as it is displayed in the page.
re_str_lang = ur'{{lang\|.*?\|(.*?)}}'
return re.sub(re_str_lang, r'\1', string, re.U | re.S)
def remove_all_templates(string):
re_str_templates = ur'(\{\{.*?\}\})'
while re.se... | Add a script for cleaning a page | Add a script for cleaning a page
| Python | mit | madprime/wikipedia_squish | Add a script for cleaning a page | import re
import sys
def remove_lang_templates(string):
# Preserves text inside template, as it is displayed in the page.
re_str_lang = ur'{{lang\|.*?\|(.*?)}}'
return re.sub(re_str_lang, r'\1', string, re.U | re.S)
def remove_all_templates(string):
re_str_templates = ur'(\{\{.*?\}\})'
while re.se... | <commit_before><commit_msg>Add a script for cleaning a page<commit_after> | import re
import sys
def remove_lang_templates(string):
# Preserves text inside template, as it is displayed in the page.
re_str_lang = ur'{{lang\|.*?\|(.*?)}}'
return re.sub(re_str_lang, r'\1', string, re.U | re.S)
def remove_all_templates(string):
re_str_templates = ur'(\{\{.*?\}\})'
while re.se... | Add a script for cleaning a pageimport re
import sys
def remove_lang_templates(string):
# Preserves text inside template, as it is displayed in the page.
re_str_lang = ur'{{lang\|.*?\|(.*?)}}'
return re.sub(re_str_lang, r'\1', string, re.U | re.S)
def remove_all_templates(string):
re_str_templates = u... | <commit_before><commit_msg>Add a script for cleaning a page<commit_after>import re
import sys
def remove_lang_templates(string):
# Preserves text inside template, as it is displayed in the page.
re_str_lang = ur'{{lang\|.*?\|(.*?)}}'
return re.sub(re_str_lang, r'\1', string, re.U | re.S)
def remove_all_te... | |
e6303e7c43c0ac9727e7c110cac4d1b6b9b9784f | atlas/prodtask/management/commands/pthealthcheck.py | atlas/prodtask/management/commands/pthealthcheck.py | from django.core.management.base import BaseCommand, CommandError
import time
from django_celery_beat.models import PeriodicTask
from django.utils import timezone
from datetime import timedelta
from atlas.prodtask.views import send_alarm_message
class Command(BaseCommand):
args = 'None'
help = 'Check celery... | Add celery beat health check | Add celery beat health check
| Python | apache-2.0 | PanDAWMS/panda-bigmon-atlas,PanDAWMS/panda-bigmon-atlas,PanDAWMS/panda-bigmon-atlas,PanDAWMS/panda-bigmon-atlas | Add celery beat health check | from django.core.management.base import BaseCommand, CommandError
import time
from django_celery_beat.models import PeriodicTask
from django.utils import timezone
from datetime import timedelta
from atlas.prodtask.views import send_alarm_message
class Command(BaseCommand):
args = 'None'
help = 'Check celery... | <commit_before><commit_msg>Add celery beat health check<commit_after> | from django.core.management.base import BaseCommand, CommandError
import time
from django_celery_beat.models import PeriodicTask
from django.utils import timezone
from datetime import timedelta
from atlas.prodtask.views import send_alarm_message
class Command(BaseCommand):
args = 'None'
help = 'Check celery... | Add celery beat health checkfrom django.core.management.base import BaseCommand, CommandError
import time
from django_celery_beat.models import PeriodicTask
from django.utils import timezone
from datetime import timedelta
from atlas.prodtask.views import send_alarm_message
class Command(BaseCommand):
args = 'No... | <commit_before><commit_msg>Add celery beat health check<commit_after>from django.core.management.base import BaseCommand, CommandError
import time
from django_celery_beat.models import PeriodicTask
from django.utils import timezone
from datetime import timedelta
from atlas.prodtask.views import send_alarm_message
c... | |
c08df80a02791978b6677d2e2fbd8ebb885f024d | cfp/admin.py | cfp/admin.py | from django.contrib import admin
from cfp.models import CallForPaper, PaperApplication, Applicant
from django.core import urlresolvers
class ApplicantAdmin(admin.ModelAdmin):
readonly_fields = ('user',)
list_display = ('full_name', 'about', 'biography', 'speaker_experience', 'github', 'twitter')
fields = ... | from django.contrib import admin
from cfp.models import CallForPaper, PaperApplication, Applicant
from django.core import urlresolvers
class ApplicantAdmin(admin.ModelAdmin):
list_display = ('user', 'full_name', 'about', 'biography', 'speaker_experience', 'github', 'twitter')
fields = ('user', 'about', 'biogr... | Remove user from readonly fields | Remove user from readonly fields
So that we can add Applicants from the admin interface.
| Python | bsd-3-clause | denibertovic/conference-web,denibertovic/conference-web,WebCampZg/conference-web,WebCampZg/conference-web,denibertovic/conference-web,denibertovic/conference-web,denibertovic/conference-web,WebCampZg/conference-web | from django.contrib import admin
from cfp.models import CallForPaper, PaperApplication, Applicant
from django.core import urlresolvers
class ApplicantAdmin(admin.ModelAdmin):
readonly_fields = ('user',)
list_display = ('full_name', 'about', 'biography', 'speaker_experience', 'github', 'twitter')
fields = ... | from django.contrib import admin
from cfp.models import CallForPaper, PaperApplication, Applicant
from django.core import urlresolvers
class ApplicantAdmin(admin.ModelAdmin):
list_display = ('user', 'full_name', 'about', 'biography', 'speaker_experience', 'github', 'twitter')
fields = ('user', 'about', 'biogr... | <commit_before>from django.contrib import admin
from cfp.models import CallForPaper, PaperApplication, Applicant
from django.core import urlresolvers
class ApplicantAdmin(admin.ModelAdmin):
readonly_fields = ('user',)
list_display = ('full_name', 'about', 'biography', 'speaker_experience', 'github', 'twitter'... | from django.contrib import admin
from cfp.models import CallForPaper, PaperApplication, Applicant
from django.core import urlresolvers
class ApplicantAdmin(admin.ModelAdmin):
list_display = ('user', 'full_name', 'about', 'biography', 'speaker_experience', 'github', 'twitter')
fields = ('user', 'about', 'biogr... | from django.contrib import admin
from cfp.models import CallForPaper, PaperApplication, Applicant
from django.core import urlresolvers
class ApplicantAdmin(admin.ModelAdmin):
readonly_fields = ('user',)
list_display = ('full_name', 'about', 'biography', 'speaker_experience', 'github', 'twitter')
fields = ... | <commit_before>from django.contrib import admin
from cfp.models import CallForPaper, PaperApplication, Applicant
from django.core import urlresolvers
class ApplicantAdmin(admin.ModelAdmin):
readonly_fields = ('user',)
list_display = ('full_name', 'about', 'biography', 'speaker_experience', 'github', 'twitter'... |
11112ce48c8b1042fe5bb75f37db84b7d9162a6f | python/test/annotator/embeddings/bert_embeddings_test.py | python/test/annotator/embeddings/bert_embeddings_test.py | # Copyright 2017-2022 John Snow Labs
#
# 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... | Add a new unit test for BERT in Python [skip test] | Add a new unit test for BERT in Python [skip test]
| Python | apache-2.0 | JohnSnowLabs/spark-nlp,JohnSnowLabs/spark-nlp,JohnSnowLabs/spark-nlp,JohnSnowLabs/spark-nlp | Add a new unit test for BERT in Python [skip test] | # Copyright 2017-2022 John Snow Labs
#
# 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... | <commit_before><commit_msg>Add a new unit test for BERT in Python [skip test]<commit_after> | # Copyright 2017-2022 John Snow Labs
#
# 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... | Add a new unit test for BERT in Python [skip test]# Copyright 2017-2022 John Snow Labs
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#... | <commit_before><commit_msg>Add a new unit test for BERT in Python [skip test]<commit_after># Copyright 2017-2022 John Snow Labs
#
# 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
#
# htt... | |
212316c45a43d1d6a973ff81304837365139ab0e | python/ecep/portal/widgets.py | python/ecep/portal/widgets.py | from django.forms import widgets
from django.utils.safestring import mark_safe
class MapWidget(widgets.HiddenInput):
def render(self, name, value, attrs=None):
#import ipdb; ipdb.set_trace()
widget = super(MapWidget, self).render(name, value, attrs)
return mark_safe("""<input name="geom" r... | Add custom widget for input of Points and google map | Add custom widget for input of Points and google map
Custom widget includes input area for geometry which is automatically
filled upon geocoding or manual selection of a location.
Also includes a placeholder div for the google map on the page.
| Python | mit | smartchicago/chicago-early-learning,smartchicago/chicago-early-learning,smartchicago/chicago-early-learning,smartchicago/chicago-early-learning | Add custom widget for input of Points and google map
Custom widget includes input area for geometry which is automatically
filled upon geocoding or manual selection of a location.
Also includes a placeholder div for the google map on the page. | from django.forms import widgets
from django.utils.safestring import mark_safe
class MapWidget(widgets.HiddenInput):
def render(self, name, value, attrs=None):
#import ipdb; ipdb.set_trace()
widget = super(MapWidget, self).render(name, value, attrs)
return mark_safe("""<input name="geom" r... | <commit_before><commit_msg>Add custom widget for input of Points and google map
Custom widget includes input area for geometry which is automatically
filled upon geocoding or manual selection of a location.
Also includes a placeholder div for the google map on the page.<commit_after> | from django.forms import widgets
from django.utils.safestring import mark_safe
class MapWidget(widgets.HiddenInput):
def render(self, name, value, attrs=None):
#import ipdb; ipdb.set_trace()
widget = super(MapWidget, self).render(name, value, attrs)
return mark_safe("""<input name="geom" r... | Add custom widget for input of Points and google map
Custom widget includes input area for geometry which is automatically
filled upon geocoding or manual selection of a location.
Also includes a placeholder div for the google map on the page.from django.forms import widgets
from django.utils.safestring import mark_s... | <commit_before><commit_msg>Add custom widget for input of Points and google map
Custom widget includes input area for geometry which is automatically
filled upon geocoding or manual selection of a location.
Also includes a placeholder div for the google map on the page.<commit_after>from django.forms import widgets
f... | |
06bbb4f99e35deddb7dc26d01af4aaa431526afd | accelerator/migrations/0024_program_show_all_masschallenge_events.py | accelerator/migrations/0024_program_show_all_masschallenge_events.py | # Generated by Django 2.2.10 on 2020-06-30 17:47
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('accelerator', '023_alter_topics_field_office_hours'),
]
operations = [
migrations.AddField(
mo... | Fix migrations causing test failures | [AC-7750-fix] Fix migrations causing test failures
| Python | mit | masschallenge/django-accelerator,masschallenge/django-accelerator | [AC-7750-fix] Fix migrations causing test failures | # Generated by Django 2.2.10 on 2020-06-30 17:47
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('accelerator', '023_alter_topics_field_office_hours'),
]
operations = [
migrations.AddField(
mo... | <commit_before><commit_msg>[AC-7750-fix] Fix migrations causing test failures<commit_after> | # Generated by Django 2.2.10 on 2020-06-30 17:47
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('accelerator', '023_alter_topics_field_office_hours'),
]
operations = [
migrations.AddField(
mo... | [AC-7750-fix] Fix migrations causing test failures# Generated by Django 2.2.10 on 2020-06-30 17:47
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('accelerator', '023_alter_topics_field_office_hours'),
]
operatio... | <commit_before><commit_msg>[AC-7750-fix] Fix migrations causing test failures<commit_after># Generated by Django 2.2.10 on 2020-06-30 17:47
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('accelerator', '023_alter_topics_... | |
0a83c4c0b2728c04ec1b5b4eabdb612170e450bd | webkit/tools/layout_tests/test_types/fuzzy_image_diff.py | webkit/tools/layout_tests/test_types/fuzzy_image_diff.py | # Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Compares the image output of a test to the expected image output using
fuzzy matching.
"""
import errno
import logging
import os
import shutil
i... | Fix build: missed a file | Fix build: missed a file
TBR=tony
Review URL: http://codereview.chromium.org/13209
git-svn-id: http://src.chromium.org/svn/trunk/src@6449 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
Former-commit-id: b919e44b1d44926606de27cb569e7ad1b4724989 | Python | bsd-3-clause | meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-u... | Fix build: missed a file
TBR=tony
Review URL: http://codereview.chromium.org/13209
git-svn-id: http://src.chromium.org/svn/trunk/src@6449 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
Former-commit-id: b919e44b1d44926606de27cb569e7ad1b4724989 | # Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Compares the image output of a test to the expected image output using
fuzzy matching.
"""
import errno
import logging
import os
import shutil
i... | <commit_before><commit_msg>Fix build: missed a file
TBR=tony
Review URL: http://codereview.chromium.org/13209
git-svn-id: http://src.chromium.org/svn/trunk/src@6449 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
Former-commit-id: b919e44b1d44926606de27cb569e7ad1b4724989<commit_after> | # Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Compares the image output of a test to the expected image output using
fuzzy matching.
"""
import errno
import logging
import os
import shutil
i... | Fix build: missed a file
TBR=tony
Review URL: http://codereview.chromium.org/13209
git-svn-id: http://src.chromium.org/svn/trunk/src@6449 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
Former-commit-id: b919e44b1d44926606de27cb569e7ad1b4724989# Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
# Use of this... | <commit_before><commit_msg>Fix build: missed a file
TBR=tony
Review URL: http://codereview.chromium.org/13209
git-svn-id: http://src.chromium.org/svn/trunk/src@6449 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
Former-commit-id: b919e44b1d44926606de27cb569e7ad1b4724989<commit_after># Copyright (c) 2006-2008 The Chromium Au... | |
2f30d3d07d2c2a15c0eaad026d745682a9b94eec | scripts/export_temporal.py | scripts/export_temporal.py | """
Exports the data in db.grids.temporal.counties to CSV.
"""
import twitterproj
db = twitterproj.connect()
header = \
"""# COUNTS are tweet counts in 5 minute intervals: 24 * 60 / 5 columns
# weekday is the day of week, Mon=0, ..., Sun=6
# state_fips, county_fips, offset_to_eastern, year, month, day, weekday, CO... | Add script export build temporal collection. | Add script export build temporal collection.
| Python | unlicense | chebee7i/twitter,chebee7i/twitter,chebee7i/twitter | Add script export build temporal collection. | """
Exports the data in db.grids.temporal.counties to CSV.
"""
import twitterproj
db = twitterproj.connect()
header = \
"""# COUNTS are tweet counts in 5 minute intervals: 24 * 60 / 5 columns
# weekday is the day of week, Mon=0, ..., Sun=6
# state_fips, county_fips, offset_to_eastern, year, month, day, weekday, CO... | <commit_before><commit_msg>Add script export build temporal collection.<commit_after> | """
Exports the data in db.grids.temporal.counties to CSV.
"""
import twitterproj
db = twitterproj.connect()
header = \
"""# COUNTS are tweet counts in 5 minute intervals: 24 * 60 / 5 columns
# weekday is the day of week, Mon=0, ..., Sun=6
# state_fips, county_fips, offset_to_eastern, year, month, day, weekday, CO... | Add script export build temporal collection."""
Exports the data in db.grids.temporal.counties to CSV.
"""
import twitterproj
db = twitterproj.connect()
header = \
"""# COUNTS are tweet counts in 5 minute intervals: 24 * 60 / 5 columns
# weekday is the day of week, Mon=0, ..., Sun=6
# state_fips, county_fips, offs... | <commit_before><commit_msg>Add script export build temporal collection.<commit_after>"""
Exports the data in db.grids.temporal.counties to CSV.
"""
import twitterproj
db = twitterproj.connect()
header = \
"""# COUNTS are tweet counts in 5 minute intervals: 24 * 60 / 5 columns
# weekday is the day of week, Mon=0, .... | |
ce8ece0f2d7e27cc325e24a569c0b2a9761eac6f | f5_openstack_agent/utils/clean_partition.py | f5_openstack_agent/utils/clean_partition.py | # coding=utf-8
# Copyright 2016 F5 Networks 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 agr... | Create partition cleaning utility script | Create partition cleaning utility script
Issues:
Fixes #464
Problem:
In the event the agent to get out of sync with the neutron database,
it is helpful to clear all objects from the tenant partition without
having to navigate to the BIG-IP and delete manually or having to
revert to a saved config. This script will ta... | Python | apache-2.0 | F5Networks/f5-openstack-agent,richbrowne/f5-openstack-agent,F5Networks/f5-openstack-agent,richbrowne/f5-openstack-agent,richbrowne/f5-openstack-agent,F5Networks/f5-openstack-agent | Create partition cleaning utility script
Issues:
Fixes #464
Problem:
In the event the agent to get out of sync with the neutron database,
it is helpful to clear all objects from the tenant partition without
having to navigate to the BIG-IP and delete manually or having to
revert to a saved config. This script will ta... | # coding=utf-8
# Copyright 2016 F5 Networks 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 agr... | <commit_before><commit_msg>Create partition cleaning utility script
Issues:
Fixes #464
Problem:
In the event the agent to get out of sync with the neutron database,
it is helpful to clear all objects from the tenant partition without
having to navigate to the BIG-IP and delete manually or having to
revert to a saved ... | # coding=utf-8
# Copyright 2016 F5 Networks 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 agr... | Create partition cleaning utility script
Issues:
Fixes #464
Problem:
In the event the agent to get out of sync with the neutron database,
it is helpful to clear all objects from the tenant partition without
having to navigate to the BIG-IP and delete manually or having to
revert to a saved config. This script will ta... | <commit_before><commit_msg>Create partition cleaning utility script
Issues:
Fixes #464
Problem:
In the event the agent to get out of sync with the neutron database,
it is helpful to clear all objects from the tenant partition without
having to navigate to the BIG-IP and delete manually or having to
revert to a saved ... | |
cdf16c7f2dd9bbcfe79339cf9fb145e15f1ebfd6 | apps/mutations/management/commands/update_locus.py | apps/mutations/management/commands/update_locus.py | """
Take the csv/tsv data from coding and non-coding files and insert into
Gene Locus database.
"""
import logging
from collections import OrderedDict
from django.core.management.base import BaseCommand, CommandError
from apps.mutations.models import GeneLocus
LOGGER = logging.getLogger('apps.mutations')
class Com... | Add gene locus generator taking in tabular inputs and using fav lib | Add gene locus generator taking in tabular inputs and using fav lib
| Python | agpl-3.0 | IQSS/gentb-site,IQSS/gentb-site,IQSS/gentb-site,IQSS/gentb-site,IQSS/gentb-site,IQSS/gentb-site,IQSS/gentb-site,IQSS/gentb-site | Add gene locus generator taking in tabular inputs and using fav lib | """
Take the csv/tsv data from coding and non-coding files and insert into
Gene Locus database.
"""
import logging
from collections import OrderedDict
from django.core.management.base import BaseCommand, CommandError
from apps.mutations.models import GeneLocus
LOGGER = logging.getLogger('apps.mutations')
class Com... | <commit_before><commit_msg>Add gene locus generator taking in tabular inputs and using fav lib<commit_after> | """
Take the csv/tsv data from coding and non-coding files and insert into
Gene Locus database.
"""
import logging
from collections import OrderedDict
from django.core.management.base import BaseCommand, CommandError
from apps.mutations.models import GeneLocus
LOGGER = logging.getLogger('apps.mutations')
class Com... | Add gene locus generator taking in tabular inputs and using fav lib"""
Take the csv/tsv data from coding and non-coding files and insert into
Gene Locus database.
"""
import logging
from collections import OrderedDict
from django.core.management.base import BaseCommand, CommandError
from apps.mutations.models import... | <commit_before><commit_msg>Add gene locus generator taking in tabular inputs and using fav lib<commit_after>"""
Take the csv/tsv data from coding and non-coding files and insert into
Gene Locus database.
"""
import logging
from collections import OrderedDict
from django.core.management.base import BaseCommand, Comman... | |
2d6d087b7729357cac77eb6a4bfb129c50c217e9 | assess_isoform_quantification/test/test_options.py | assess_isoform_quantification/test/test_options.py | from assess_isoform_quantification.options import validate_file_option
from tempfile import NamedTemporaryFile
from schema import SchemaError
import pytest
def test_validate_file_option_returns_handle_for_file_that_exists():
file = NamedTemporaryFile()
file_name = file.name
assert validate_file_option(fi... | Add a few test cases for validate_file_option function. | Add a few test cases for validate_file_option function.
| Python | mit | COMBINE-lab/piquant,lweasel/piquant,lweasel/piquant | Add a few test cases for validate_file_option function. | from assess_isoform_quantification.options import validate_file_option
from tempfile import NamedTemporaryFile
from schema import SchemaError
import pytest
def test_validate_file_option_returns_handle_for_file_that_exists():
file = NamedTemporaryFile()
file_name = file.name
assert validate_file_option(fi... | <commit_before><commit_msg>Add a few test cases for validate_file_option function.<commit_after> | from assess_isoform_quantification.options import validate_file_option
from tempfile import NamedTemporaryFile
from schema import SchemaError
import pytest
def test_validate_file_option_returns_handle_for_file_that_exists():
file = NamedTemporaryFile()
file_name = file.name
assert validate_file_option(fi... | Add a few test cases for validate_file_option function.from assess_isoform_quantification.options import validate_file_option
from tempfile import NamedTemporaryFile
from schema import SchemaError
import pytest
def test_validate_file_option_returns_handle_for_file_that_exists():
file = NamedTemporaryFile()
f... | <commit_before><commit_msg>Add a few test cases for validate_file_option function.<commit_after>from assess_isoform_quantification.options import validate_file_option
from tempfile import NamedTemporaryFile
from schema import SchemaError
import pytest
def test_validate_file_option_returns_handle_for_file_that_exists... | |
72fd9ecb9eb068d86762d31429f70061aa907a47 | server/misc/twitter/tweets.py | server/misc/twitter/tweets.py | import json
import os
import pymongo
import tweepy
from libs.carmen import get_resolver
def search(query, pages):
_mongo = pymongo.MongoClient().minerva[query]
minerva_twitter_config = json.load(open(
os.path.join(os.path.dirname(__file__), "twitter.json")
))
auth = tweepy.OAuthHandler(miner... | Add script for twitter search api | Add script for twitter search api
| Python | apache-2.0 | Kitware/minerva,Kitware/minerva,Kitware/minerva | Add script for twitter search api | import json
import os
import pymongo
import tweepy
from libs.carmen import get_resolver
def search(query, pages):
_mongo = pymongo.MongoClient().minerva[query]
minerva_twitter_config = json.load(open(
os.path.join(os.path.dirname(__file__), "twitter.json")
))
auth = tweepy.OAuthHandler(miner... | <commit_before><commit_msg>Add script for twitter search api<commit_after> | import json
import os
import pymongo
import tweepy
from libs.carmen import get_resolver
def search(query, pages):
_mongo = pymongo.MongoClient().minerva[query]
minerva_twitter_config = json.load(open(
os.path.join(os.path.dirname(__file__), "twitter.json")
))
auth = tweepy.OAuthHandler(miner... | Add script for twitter search apiimport json
import os
import pymongo
import tweepy
from libs.carmen import get_resolver
def search(query, pages):
_mongo = pymongo.MongoClient().minerva[query]
minerva_twitter_config = json.load(open(
os.path.join(os.path.dirname(__file__), "twitter.json")
))
... | <commit_before><commit_msg>Add script for twitter search api<commit_after>import json
import os
import pymongo
import tweepy
from libs.carmen import get_resolver
def search(query, pages):
_mongo = pymongo.MongoClient().minerva[query]
minerva_twitter_config = json.load(open(
os.path.join(os.path.dirn... | |
a64b25499a9421a5e8dc371ab4cd540adcaaf38c | test/test_argument_parsing.py | test/test_argument_parsing.py | import pytest
from ros_get.__main__ import parse_args
def test_parse_no_command(capsys):
"""It should print an error message when no command is provided"""
with pytest.raises(SystemExit) as pytest_wrapped_e:
parse_args([])
assert pytest_wrapped_e.type == SystemExit
assert pytest_wrapped_e.valu... | Add test for running ros-get without arguments | Add test for running ros-get without arguments
| Python | mit | Rayman/ros-get,Rayman/ros-get | Add test for running ros-get without arguments | import pytest
from ros_get.__main__ import parse_args
def test_parse_no_command(capsys):
"""It should print an error message when no command is provided"""
with pytest.raises(SystemExit) as pytest_wrapped_e:
parse_args([])
assert pytest_wrapped_e.type == SystemExit
assert pytest_wrapped_e.valu... | <commit_before><commit_msg>Add test for running ros-get without arguments<commit_after> | import pytest
from ros_get.__main__ import parse_args
def test_parse_no_command(capsys):
"""It should print an error message when no command is provided"""
with pytest.raises(SystemExit) as pytest_wrapped_e:
parse_args([])
assert pytest_wrapped_e.type == SystemExit
assert pytest_wrapped_e.valu... | Add test for running ros-get without argumentsimport pytest
from ros_get.__main__ import parse_args
def test_parse_no_command(capsys):
"""It should print an error message when no command is provided"""
with pytest.raises(SystemExit) as pytest_wrapped_e:
parse_args([])
assert pytest_wrapped_e.type ... | <commit_before><commit_msg>Add test for running ros-get without arguments<commit_after>import pytest
from ros_get.__main__ import parse_args
def test_parse_no_command(capsys):
"""It should print an error message when no command is provided"""
with pytest.raises(SystemExit) as pytest_wrapped_e:
parse_a... | |
014788b5b78132f942b2411f33518ff56a1f0132 | tests/test_simple_features.py | tests/test_simple_features.py | import wordgraph
EPOCH_START = 1407109280
def test_monotonic_up_per_second():
datapoints = []
for i in range(10):
datapoints.append((float(i), EPOCH_START + i))
features = wordgraph.name_things(datapoints)
assert "" in features
| Test case for mononotic increasing graph | Test case for mononotic increasing graph
Verify feature description for simple linear graph increasing
monotonically with time.
| Python | apache-2.0 | tleeuwenburg/wordgraph,tleeuwenburg/wordgraph | Test case for mononotic increasing graph
Verify feature description for simple linear graph increasing
monotonically with time. | import wordgraph
EPOCH_START = 1407109280
def test_monotonic_up_per_second():
datapoints = []
for i in range(10):
datapoints.append((float(i), EPOCH_START + i))
features = wordgraph.name_things(datapoints)
assert "" in features
| <commit_before><commit_msg>Test case for mononotic increasing graph
Verify feature description for simple linear graph increasing
monotonically with time.<commit_after> | import wordgraph
EPOCH_START = 1407109280
def test_monotonic_up_per_second():
datapoints = []
for i in range(10):
datapoints.append((float(i), EPOCH_START + i))
features = wordgraph.name_things(datapoints)
assert "" in features
| Test case for mononotic increasing graph
Verify feature description for simple linear graph increasing
monotonically with time.import wordgraph
EPOCH_START = 1407109280
def test_monotonic_up_per_second():
datapoints = []
for i in range(10):
datapoints.append((float(i), EPOCH_START + i))
features ... | <commit_before><commit_msg>Test case for mononotic increasing graph
Verify feature description for simple linear graph increasing
monotonically with time.<commit_after>import wordgraph
EPOCH_START = 1407109280
def test_monotonic_up_per_second():
datapoints = []
for i in range(10):
datapoints.append((... | |
bd7ee6e783f1e6bad6a277f4f63438b995d4a3b1 | tests/unit/test_expression.py | tests/unit/test_expression.py | import unittest
from stencil import Template
class ExpressionTests(unittest.TestCase):
def test_function(self):
t = Template('Test {{f("abc")}}').render({"f": lambda x: x.title() })
self.assertEqual(t, 'Test Abc')
def test_function_argument(self):
def double(a):
return ... | Add tests for latest fix | Add tests for latest fix
| Python | mit | funkybob/stencil,funkybob/stencil | Add tests for latest fix | import unittest
from stencil import Template
class ExpressionTests(unittest.TestCase):
def test_function(self):
t = Template('Test {{f("abc")}}').render({"f": lambda x: x.title() })
self.assertEqual(t, 'Test Abc')
def test_function_argument(self):
def double(a):
return ... | <commit_before><commit_msg>Add tests for latest fix<commit_after> | import unittest
from stencil import Template
class ExpressionTests(unittest.TestCase):
def test_function(self):
t = Template('Test {{f("abc")}}').render({"f": lambda x: x.title() })
self.assertEqual(t, 'Test Abc')
def test_function_argument(self):
def double(a):
return ... | Add tests for latest fiximport unittest
from stencil import Template
class ExpressionTests(unittest.TestCase):
def test_function(self):
t = Template('Test {{f("abc")}}').render({"f": lambda x: x.title() })
self.assertEqual(t, 'Test Abc')
def test_function_argument(self):
def double... | <commit_before><commit_msg>Add tests for latest fix<commit_after>import unittest
from stencil import Template
class ExpressionTests(unittest.TestCase):
def test_function(self):
t = Template('Test {{f("abc")}}').render({"f": lambda x: x.title() })
self.assertEqual(t, 'Test Abc')
def test_fu... | |
e74177a0c668e2b4016b5b58780f92d63f29a222 | django_afip/migrations/0034_vat_condition_choices.py | django_afip/migrations/0034_vat_condition_choices.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-07-30 01:44
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('afip', '0033_receiptpdf__pdf_file__help_text'),
]
operations = [
migrations... | Add updated migrations for vat_conditions | Add updated migrations for vat_conditions
| Python | isc | hobarrera/django-afip,hobarrera/django-afip | Add updated migrations for vat_conditions | # -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-07-30 01:44
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('afip', '0033_receiptpdf__pdf_file__help_text'),
]
operations = [
migrations... | <commit_before><commit_msg>Add updated migrations for vat_conditions<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-07-30 01:44
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('afip', '0033_receiptpdf__pdf_file__help_text'),
]
operations = [
migrations... | Add updated migrations for vat_conditions# -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-07-30 01:44
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('afip', '0033_receiptpdf__pdf_file__help_text'),
... | <commit_before><commit_msg>Add updated migrations for vat_conditions<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-07-30 01:44
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('afip', '00... | |
8032fd5bf99b7c235e75617b45c77e38dcba4ec7 | core/migrations/0023_alter_homepage_featured_section_integer_block.py | core/migrations/0023_alter_homepage_featured_section_integer_block.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import wagtail.wagtailcore.fields
import wagtail.wagtailcore.blocks
import wagtail.wagtailimages.blocks
import wagtail.wagtailimages.models
class Migration(migrations.Migration):
dependencies = [
('c... | Add migration for homepage featured-section integer_block | Add migration for homepage featured-section integer_block
| Python | bsd-3-clause | PARINetwork/pari,PARINetwork/pari,PARINetwork/pari,PARINetwork/pari | Add migration for homepage featured-section integer_block | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import wagtail.wagtailcore.fields
import wagtail.wagtailcore.blocks
import wagtail.wagtailimages.blocks
import wagtail.wagtailimages.models
class Migration(migrations.Migration):
dependencies = [
('c... | <commit_before><commit_msg>Add migration for homepage featured-section integer_block<commit_after> | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import wagtail.wagtailcore.fields
import wagtail.wagtailcore.blocks
import wagtail.wagtailimages.blocks
import wagtail.wagtailimages.models
class Migration(migrations.Migration):
dependencies = [
('c... | Add migration for homepage featured-section integer_block# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import wagtail.wagtailcore.fields
import wagtail.wagtailcore.blocks
import wagtail.wagtailimages.blocks
import wagtail.wagtailimages.models
class Migration... | <commit_before><commit_msg>Add migration for homepage featured-section integer_block<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import wagtail.wagtailcore.fields
import wagtail.wagtailcore.blocks
import wagtail.wagtailimages.blocks
import wagta... | |
e80a92ad6e77d1fcf38c8830c29399099001c541 | sdks/python/apache_beam/ml/gcp/visionml_test_it.py | sdks/python/apache_beam/ml/gcp/visionml_test_it.py | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | Add integration test for AnnotateImage transform | Add integration test for AnnotateImage transform
| Python | apache-2.0 | robertwb/incubator-beam,apache/beam,apache/beam,robertwb/incubator-beam,chamikaramj/beam,iemejia/incubator-beam,robertwb/incubator-beam,apache/beam,chamikaramj/beam,chamikaramj/beam,lukecwik/incubator-beam,chamikaramj/beam,robertwb/incubator-beam,chamikaramj/beam,robertwb/incubator-beam,chamikaramj/beam,apache/beam,luk... | Add integration test for AnnotateImage transform | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | <commit_before><commit_msg>Add integration test for AnnotateImage transform<commit_after> | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | Add integration test for AnnotateImage transform#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache Licens... | <commit_before><commit_msg>Add integration test for AnnotateImage transform<commit_after>#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses... | |
7130a440b422ac3edeaafac5885be3d2a38c4dfc | sgt/accounts/migrations/0003_auto_20160507_1902.py | sgt/accounts/migrations/0003_auto_20160507_1902.py | # -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2016-05-07 19:02
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('accounts', '0002_auto_20150629_1908'),
]
operations = [
migrations.AlterField(... | Create migration file for accounts app | Create migration file for accounts app
| Python | mit | mazulo/SGT,mazulo/SGT | Create migration file for accounts app | # -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2016-05-07 19:02
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('accounts', '0002_auto_20150629_1908'),
]
operations = [
migrations.AlterField(... | <commit_before><commit_msg>Create migration file for accounts app<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2016-05-07 19:02
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('accounts', '0002_auto_20150629_1908'),
]
operations = [
migrations.AlterField(... | Create migration file for accounts app# -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2016-05-07 19:02
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('accounts', '0002_auto_20150629_1908'),
]
operati... | <commit_before><commit_msg>Create migration file for accounts app<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2016-05-07 19:02
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('accounts', '0002... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.