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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
623cdce39e1a14a2cbd80f116ab7e709c469e891 | read-python-dependency-graph.py | read-python-dependency-graph.py | # IPython log file
import itertools as it
with open('pypi-deps.txt', 'r') as fin:
lines = fin.readlines()
edges = [line.rstrip().split() for line in lines]
packages = set(list(it.chain(*edges)))
len(edges)
len(packages)
'skimage' in packages
import toolz as tz
from toolz import curried as c
dep_count... | Read in python dependency graph and clean up | Read in python dependency graph and clean up
| Python | bsd-3-clause | jni/useful-histories | Read in python dependency graph and clean up | # IPython log file
import itertools as it
with open('pypi-deps.txt', 'r') as fin:
lines = fin.readlines()
edges = [line.rstrip().split() for line in lines]
packages = set(list(it.chain(*edges)))
len(edges)
len(packages)
'skimage' in packages
import toolz as tz
from toolz import curried as c
dep_count... | <commit_before><commit_msg>Read in python dependency graph and clean up<commit_after> | # IPython log file
import itertools as it
with open('pypi-deps.txt', 'r') as fin:
lines = fin.readlines()
edges = [line.rstrip().split() for line in lines]
packages = set(list(it.chain(*edges)))
len(edges)
len(packages)
'skimage' in packages
import toolz as tz
from toolz import curried as c
dep_count... | Read in python dependency graph and clean up# IPython log file
import itertools as it
with open('pypi-deps.txt', 'r') as fin:
lines = fin.readlines()
edges = [line.rstrip().split() for line in lines]
packages = set(list(it.chain(*edges)))
len(edges)
len(packages)
'skimage' in packages
import toolz as... | <commit_before><commit_msg>Read in python dependency graph and clean up<commit_after># IPython log file
import itertools as it
with open('pypi-deps.txt', 'r') as fin:
lines = fin.readlines()
edges = [line.rstrip().split() for line in lines]
packages = set(list(it.chain(*edges)))
len(edges)
len(packag... | |
14d223068e2d8963dfe1f4e71854e9ea9c194bc5 | Datasnakes/Tools/sge/qsubber.py | Datasnakes/Tools/sge/qsubber.py | import argparse
import textwrap
from qstat import Qstat
__author__ = 'Datasnakes'
parser = argparse.ArgumentParser(
formatter_class=argparse.RawDescriptionHelpFormatter,
description=textwrap.dedent('''\
This is a command line wrapper for the SGE module.
... | Set up shell argparser for sge module | Set up shell argparser for sge module
| Python | mit | datasnakes/Datasnakes-Scripts,datasnakes/Datasnakes-Scripts,datasnakes/Datasnakes-Scripts,datasnakes/Datasnakes-Scripts,datasnakes/Datasnakes-Scripts,datasnakes/Datasnakes-Scripts | Set up shell argparser for sge module | import argparse
import textwrap
from qstat import Qstat
__author__ = 'Datasnakes'
parser = argparse.ArgumentParser(
formatter_class=argparse.RawDescriptionHelpFormatter,
description=textwrap.dedent('''\
This is a command line wrapper for the SGE module.
... | <commit_before><commit_msg>Set up shell argparser for sge module<commit_after> | import argparse
import textwrap
from qstat import Qstat
__author__ = 'Datasnakes'
parser = argparse.ArgumentParser(
formatter_class=argparse.RawDescriptionHelpFormatter,
description=textwrap.dedent('''\
This is a command line wrapper for the SGE module.
... | Set up shell argparser for sge moduleimport argparse
import textwrap
from qstat import Qstat
__author__ = 'Datasnakes'
parser = argparse.ArgumentParser(
formatter_class=argparse.RawDescriptionHelpFormatter,
description=textwrap.dedent('''\
This is a command line wra... | <commit_before><commit_msg>Set up shell argparser for sge module<commit_after>import argparse
import textwrap
from qstat import Qstat
__author__ = 'Datasnakes'
parser = argparse.ArgumentParser(
formatter_class=argparse.RawDescriptionHelpFormatter,
description=textwrap.dedent('''\
... | |
c267818a28018a6f386c6f4d11eefc9987efe7bd | py/find-mode-in-binary-search-tree.py | py/find-mode-in-binary-search-tree.py | # Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution(object):
def inOrder(self, cur):
if cur:
for x in self.inOrder(cur.left):
yield x
... | Add py solution for 501. Find Mode in Binary Search Tree | Add py solution for 501. Find Mode in Binary Search Tree
501. Find Mode in Binary Search Tree: https://leetcode.com/problems/find-mode-in-binary-search-tree/
| Python | apache-2.0 | ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode | Add py solution for 501. Find Mode in Binary Search Tree
501. Find Mode in Binary Search Tree: https://leetcode.com/problems/find-mode-in-binary-search-tree/ | # Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution(object):
def inOrder(self, cur):
if cur:
for x in self.inOrder(cur.left):
yield x
... | <commit_before><commit_msg>Add py solution for 501. Find Mode in Binary Search Tree
501. Find Mode in Binary Search Tree: https://leetcode.com/problems/find-mode-in-binary-search-tree/<commit_after> | # Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution(object):
def inOrder(self, cur):
if cur:
for x in self.inOrder(cur.left):
yield x
... | Add py solution for 501. Find Mode in Binary Search Tree
501. Find Mode in Binary Search Tree: https://leetcode.com/problems/find-mode-in-binary-search-tree/# Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right... | <commit_before><commit_msg>Add py solution for 501. Find Mode in Binary Search Tree
501. Find Mode in Binary Search Tree: https://leetcode.com/problems/find-mode-in-binary-search-tree/<commit_after># Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# ... | |
7914c46189634e1c4abf713fc2c70fa81a72101d | simple-cipher/simple_cipher_better.py | simple-cipher/simple_cipher_better.py | import re
import time
import random
random.seed(int(time.time()))
length = 100
keyinit = "".join([chr(random.randint(97,122)) for i in range(0,100)])
class Cipher(object):
def __init__(self, key=keyinit):
if not key.isalpha():
raise ValueError
if not key.islower():
raise Val... | Add better solution for simple cipher | Add better solution for simple cipher
| Python | mit | always-waiting/exercism-python | Add better solution for simple cipher | import re
import time
import random
random.seed(int(time.time()))
length = 100
keyinit = "".join([chr(random.randint(97,122)) for i in range(0,100)])
class Cipher(object):
def __init__(self, key=keyinit):
if not key.isalpha():
raise ValueError
if not key.islower():
raise Val... | <commit_before><commit_msg>Add better solution for simple cipher<commit_after> | import re
import time
import random
random.seed(int(time.time()))
length = 100
keyinit = "".join([chr(random.randint(97,122)) for i in range(0,100)])
class Cipher(object):
def __init__(self, key=keyinit):
if not key.isalpha():
raise ValueError
if not key.islower():
raise Val... | Add better solution for simple cipherimport re
import time
import random
random.seed(int(time.time()))
length = 100
keyinit = "".join([chr(random.randint(97,122)) for i in range(0,100)])
class Cipher(object):
def __init__(self, key=keyinit):
if not key.isalpha():
raise ValueError
if not... | <commit_before><commit_msg>Add better solution for simple cipher<commit_after>import re
import time
import random
random.seed(int(time.time()))
length = 100
keyinit = "".join([chr(random.randint(97,122)) for i in range(0,100)])
class Cipher(object):
def __init__(self, key=keyinit):
if not key.isalpha():
... | |
210a9809eef6743107b459b91980158ea87e75dc | openstack/common/fixture/lockutils.py | openstack/common/fixture/lockutils.py | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack Foundation.
# 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.apac... | Move LockFixture into a fixtures module | Move LockFixture into a fixtures module
In Nova and other projects, fixtures are in test-requirements.txt and
NOT in requirements.txt so updating nova to use latest lockutils.py
is not possible. So let us move LockFixture out into it a separate
fixtures.py module where in theory we can add other fixtures as
well. See ... | Python | apache-2.0 | openstack/oslotest,openstack/oslotest | Move LockFixture into a fixtures module
In Nova and other projects, fixtures are in test-requirements.txt and
NOT in requirements.txt so updating nova to use latest lockutils.py
is not possible. So let us move LockFixture out into it a separate
fixtures.py module where in theory we can add other fixtures as
well. See ... | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack Foundation.
# 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.apac... | <commit_before><commit_msg>Move LockFixture into a fixtures module
In Nova and other projects, fixtures are in test-requirements.txt and
NOT in requirements.txt so updating nova to use latest lockutils.py
is not possible. So let us move LockFixture out into it a separate
fixtures.py module where in theory we can add o... | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack Foundation.
# 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.apac... | Move LockFixture into a fixtures module
In Nova and other projects, fixtures are in test-requirements.txt and
NOT in requirements.txt so updating nova to use latest lockutils.py
is not possible. So let us move LockFixture out into it a separate
fixtures.py module where in theory we can add other fixtures as
well. See ... | <commit_before><commit_msg>Move LockFixture into a fixtures module
In Nova and other projects, fixtures are in test-requirements.txt and
NOT in requirements.txt so updating nova to use latest lockutils.py
is not possible. So let us move LockFixture out into it a separate
fixtures.py module where in theory we can add o... | |
ba9c1108a15bac713e7bda987865f8c4c1db92c7 | timm/loss/binary_cross_entropy.py | timm/loss/binary_cross_entropy.py | import torch
import torch.nn as nn
import torch.nn.functional as F
class DenseBinaryCrossEntropy(nn.Module):
""" BCE using one-hot from dense targets w/ label smoothing
NOTE for experiments comparing CE to BCE /w label smoothing, may remove
"""
def __init__(self, smoothing=0.1):
super(DenseBin... | Add a BCE loss impl that converts dense targets to sparse /w smoothing as an alternate to CE w/ smoothing. For training experiments. | Add a BCE loss impl that converts dense targets to sparse /w smoothing as an alternate to CE w/ smoothing. For training experiments.
| Python | apache-2.0 | rwightman/pytorch-image-models,rwightman/pytorch-image-models | Add a BCE loss impl that converts dense targets to sparse /w smoothing as an alternate to CE w/ smoothing. For training experiments. | import torch
import torch.nn as nn
import torch.nn.functional as F
class DenseBinaryCrossEntropy(nn.Module):
""" BCE using one-hot from dense targets w/ label smoothing
NOTE for experiments comparing CE to BCE /w label smoothing, may remove
"""
def __init__(self, smoothing=0.1):
super(DenseBin... | <commit_before><commit_msg>Add a BCE loss impl that converts dense targets to sparse /w smoothing as an alternate to CE w/ smoothing. For training experiments.<commit_after> | import torch
import torch.nn as nn
import torch.nn.functional as F
class DenseBinaryCrossEntropy(nn.Module):
""" BCE using one-hot from dense targets w/ label smoothing
NOTE for experiments comparing CE to BCE /w label smoothing, may remove
"""
def __init__(self, smoothing=0.1):
super(DenseBin... | Add a BCE loss impl that converts dense targets to sparse /w smoothing as an alternate to CE w/ smoothing. For training experiments.import torch
import torch.nn as nn
import torch.nn.functional as F
class DenseBinaryCrossEntropy(nn.Module):
""" BCE using one-hot from dense targets w/ label smoothing
NOTE for ... | <commit_before><commit_msg>Add a BCE loss impl that converts dense targets to sparse /w smoothing as an alternate to CE w/ smoothing. For training experiments.<commit_after>import torch
import torch.nn as nn
import torch.nn.functional as F
class DenseBinaryCrossEntropy(nn.Module):
""" BCE using one-hot from dense... | |
8c7f9a8286d3d1b5172af2fdfb74d1f73756790b | tests/app/main/views/test_history.py | tests/app/main/views/test_history.py | from tests.conftest import SERVICE_ONE_ID
def test_history(
client_request,
mock_get_service_history,
):
client_request.get('main.history', service_id=SERVICE_ONE_ID)
| Add a simple test for the history page | Add a simple test for the history page
| Python | mit | alphagov/notifications-admin,alphagov/notifications-admin,alphagov/notifications-admin,alphagov/notifications-admin | Add a simple test for the history page | from tests.conftest import SERVICE_ONE_ID
def test_history(
client_request,
mock_get_service_history,
):
client_request.get('main.history', service_id=SERVICE_ONE_ID)
| <commit_before><commit_msg>Add a simple test for the history page<commit_after> | from tests.conftest import SERVICE_ONE_ID
def test_history(
client_request,
mock_get_service_history,
):
client_request.get('main.history', service_id=SERVICE_ONE_ID)
| Add a simple test for the history pagefrom tests.conftest import SERVICE_ONE_ID
def test_history(
client_request,
mock_get_service_history,
):
client_request.get('main.history', service_id=SERVICE_ONE_ID)
| <commit_before><commit_msg>Add a simple test for the history page<commit_after>from tests.conftest import SERVICE_ONE_ID
def test_history(
client_request,
mock_get_service_history,
):
client_request.get('main.history', service_id=SERVICE_ONE_ID)
| |
b0243ac96d31693611cec20e60812739be92e3aa | tests/functional/test_connection.py | tests/functional/test_connection.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from sure import scenario
from pyeqs import QuerySet
from tests.helpers import prepare_data, cleanup_data, add_document
@scenario(prepare_data, cleanup_data)
def test_simple_search_with_host_string(context):
"""
Connect with host string
"""... | Add functional tests for connection change | Add functional tests for connection change
| Python | mit | Yipit/pyeqs | Add functional tests for connection change | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from sure import scenario
from pyeqs import QuerySet
from tests.helpers import prepare_data, cleanup_data, add_document
@scenario(prepare_data, cleanup_data)
def test_simple_search_with_host_string(context):
"""
Connect with host string
"""... | <commit_before><commit_msg>Add functional tests for connection change<commit_after> | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from sure import scenario
from pyeqs import QuerySet
from tests.helpers import prepare_data, cleanup_data, add_document
@scenario(prepare_data, cleanup_data)
def test_simple_search_with_host_string(context):
"""
Connect with host string
"""... | Add functional tests for connection change# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from sure import scenario
from pyeqs import QuerySet
from tests.helpers import prepare_data, cleanup_data, add_document
@scenario(prepare_data, cleanup_data)
def test_simple_search_with_host_string(context):
... | <commit_before><commit_msg>Add functional tests for connection change<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from sure import scenario
from pyeqs import QuerySet
from tests.helpers import prepare_data, cleanup_data, add_document
@scenario(prepare_data, cleanup_data)
def test_si... | |
bcd4ebd31f915825eb135420d56231e380589c5b | src/personalisation/migrations/0008_devicerule.py | src/personalisation/migrations/0008_devicerule.py | # -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-04-20 15:47
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import modelcluster.fields
class Migration(migrations.Migration):
dependencies = [
('personalisation', '0007_dayrule'... | Add missing migration for DeviceRule | Add missing migration for DeviceRule
| Python | mit | LabD/wagtail-personalisation,LabD/wagtail-personalisation,LabD/wagtail-personalisation | Add missing migration for DeviceRule | # -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-04-20 15:47
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import modelcluster.fields
class Migration(migrations.Migration):
dependencies = [
('personalisation', '0007_dayrule'... | <commit_before><commit_msg>Add missing migration for DeviceRule<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-04-20 15:47
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import modelcluster.fields
class Migration(migrations.Migration):
dependencies = [
('personalisation', '0007_dayrule'... | Add missing migration for DeviceRule# -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-04-20 15:47
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import modelcluster.fields
class Migration(migrations.Migration):
dependencies = [
... | <commit_before><commit_msg>Add missing migration for DeviceRule<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-04-20 15:47
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import modelcluster.fields
class Migration(migrations... | |
4be3afba45b39a77595d3db11db364f7f0f3c5c5 | test/buildbot/ensure_webcam_is_running.py | test/buildbot/ensure_webcam_is_running.py | #!/usr/bin/env python
# Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. ... | Add script to ensure virtual webcam is running. | Add script to ensure virtual webcam is running.
This script will check that a webcam is running and start it if it's
not currently running.
It's tailored to the way our buildbots are currently configured.
TEST=local execution on Windows, Mac and Linux.
BUG=none
R=phoglund@webrtc.org
Review URL: https://webrtc-codere... | Python | bsd-3-clause | Alkalyne/webrtctrunk,bpsinc-native/src_third_party_webrtc,jgcaaprom/android_external_chromium_org_third_party_webrtc,krieger-od/nwjs_chromium_webrtc,xin3liang/platform_external_chromium_org_third_party_webrtc,geekboxzone/lollipop_external_chromium_org_third_party_webrtc,geekboxzone/lollipop_external_chromium_org_third_... | Add script to ensure virtual webcam is running.
This script will check that a webcam is running and start it if it's
not currently running.
It's tailored to the way our buildbots are currently configured.
TEST=local execution on Windows, Mac and Linux.
BUG=none
R=phoglund@webrtc.org
Review URL: https://webrtc-codere... | #!/usr/bin/env python
# Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. ... | <commit_before><commit_msg>Add script to ensure virtual webcam is running.
This script will check that a webcam is running and start it if it's
not currently running.
It's tailored to the way our buildbots are currently configured.
TEST=local execution on Windows, Mac and Linux.
BUG=none
R=phoglund@webrtc.org
Review... | #!/usr/bin/env python
# Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. ... | Add script to ensure virtual webcam is running.
This script will check that a webcam is running and start it if it's
not currently running.
It's tailored to the way our buildbots are currently configured.
TEST=local execution on Windows, Mac and Linux.
BUG=none
R=phoglund@webrtc.org
Review URL: https://webrtc-codere... | <commit_before><commit_msg>Add script to ensure virtual webcam is running.
This script will check that a webcam is running and start it if it's
not currently running.
It's tailored to the way our buildbots are currently configured.
TEST=local execution on Windows, Mac and Linux.
BUG=none
R=phoglund@webrtc.org
Review... | |
d88a793badccb506b6afd62cf8fdce846ef7fe94 | txircd/modules/extra/customprefix.py | txircd/modules/extra/customprefix.py | from twisted.plugin import IPlugin
from twisted.python import log
from txircd.module_interface import IMode, IModuleData, Mode, ModuleData
from txircd.utils import ModeType
from zope.interface import implements
import logging
class CustomPrefix(ModuleData, Mode):
implements(IPlugin, IModuleData, IMode)
name =... | Implement the custom prefixes module | Implement the custom prefixes module
| Python | bsd-3-clause | ElementalAlchemist/txircd,Heufneutje/txircd | Implement the custom prefixes module | from twisted.plugin import IPlugin
from twisted.python import log
from txircd.module_interface import IMode, IModuleData, Mode, ModuleData
from txircd.utils import ModeType
from zope.interface import implements
import logging
class CustomPrefix(ModuleData, Mode):
implements(IPlugin, IModuleData, IMode)
name =... | <commit_before><commit_msg>Implement the custom prefixes module<commit_after> | from twisted.plugin import IPlugin
from twisted.python import log
from txircd.module_interface import IMode, IModuleData, Mode, ModuleData
from txircd.utils import ModeType
from zope.interface import implements
import logging
class CustomPrefix(ModuleData, Mode):
implements(IPlugin, IModuleData, IMode)
name =... | Implement the custom prefixes modulefrom twisted.plugin import IPlugin
from twisted.python import log
from txircd.module_interface import IMode, IModuleData, Mode, ModuleData
from txircd.utils import ModeType
from zope.interface import implements
import logging
class CustomPrefix(ModuleData, Mode):
implements(IPlu... | <commit_before><commit_msg>Implement the custom prefixes module<commit_after>from twisted.plugin import IPlugin
from twisted.python import log
from txircd.module_interface import IMode, IModuleData, Mode, ModuleData
from txircd.utils import ModeType
from zope.interface import implements
import logging
class CustomPref... | |
04c201a9db9eb2523febb81f5fc5601b2d86624e | tcamp/reg/management/commands/lobby_day_report.py | tcamp/reg/management/commands/lobby_day_report.py | from django.core.management.base import BaseCommand, CommandError
from reg.models import *
from optparse import make_option
import cStringIO, csv
from collections import defaultdict
class Command(BaseCommand):
help = 'Closes the specified poll for voting'
option_list = BaseCommand.option_list + (
make... | Add management command to export TCamp lobby day participants. | Add management command to export TCamp lobby day participants.
| Python | bsd-3-clause | sunlightlabs/tcamp,sunlightlabs/tcamp,sunlightlabs/tcamp,sunlightlabs/tcamp | Add management command to export TCamp lobby day participants. | from django.core.management.base import BaseCommand, CommandError
from reg.models import *
from optparse import make_option
import cStringIO, csv
from collections import defaultdict
class Command(BaseCommand):
help = 'Closes the specified poll for voting'
option_list = BaseCommand.option_list + (
make... | <commit_before><commit_msg>Add management command to export TCamp lobby day participants.<commit_after> | from django.core.management.base import BaseCommand, CommandError
from reg.models import *
from optparse import make_option
import cStringIO, csv
from collections import defaultdict
class Command(BaseCommand):
help = 'Closes the specified poll for voting'
option_list = BaseCommand.option_list + (
make... | Add management command to export TCamp lobby day participants.from django.core.management.base import BaseCommand, CommandError
from reg.models import *
from optparse import make_option
import cStringIO, csv
from collections import defaultdict
class Command(BaseCommand):
help = 'Closes the specified poll for voti... | <commit_before><commit_msg>Add management command to export TCamp lobby day participants.<commit_after>from django.core.management.base import BaseCommand, CommandError
from reg.models import *
from optparse import make_option
import cStringIO, csv
from collections import defaultdict
class Command(BaseCommand):
h... | |
fb123e3751bd0736fbc44098ff435199ece3b849 | tests/test_run_all_doctests.py | tests/test_run_all_doctests.py | # -*- coding: utf-8 -*-
#
# Copyright (c) 2007-2013 Parisson SARL
# This file is part of TimeSide.
# TimeSide 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 2 of the License, or
# (at your op... | Add a test collecting all doctests | Add a test collecting all doctests
| Python | agpl-3.0 | Parisson/TimeSide,Parisson/TimeSide,Parisson/TimeSide,Parisson/TimeSide,Parisson/TimeSide | Add a test collecting all doctests | # -*- coding: utf-8 -*-
#
# Copyright (c) 2007-2013 Parisson SARL
# This file is part of TimeSide.
# TimeSide 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 2 of the License, or
# (at your op... | <commit_before><commit_msg>Add a test collecting all doctests<commit_after> | # -*- coding: utf-8 -*-
#
# Copyright (c) 2007-2013 Parisson SARL
# This file is part of TimeSide.
# TimeSide 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 2 of the License, or
# (at your op... | Add a test collecting all doctests# -*- coding: utf-8 -*-
#
# Copyright (c) 2007-2013 Parisson SARL
# This file is part of TimeSide.
# TimeSide 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 ... | <commit_before><commit_msg>Add a test collecting all doctests<commit_after># -*- coding: utf-8 -*-
#
# Copyright (c) 2007-2013 Parisson SARL
# This file is part of TimeSide.
# TimeSide is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the ... | |
fe9dd692d07e1924c88622e3e00c75c2fe5c65db | examples/listradio.py | examples/listradio.py | import gobject
import gtk
from kiwi.ui.widgets.list import Column, List
class Object:
def __init__(self, name, value):
self.name, self.value = name, value
columns = [Column('name'),
Column('value', data_type=bool, radio=True, editable=True)]
win = gtk.Window()
win.set_size_request(300, 120)
w... | Test for radio buttons in lists | Test for radio buttons in lists | Python | lgpl-2.1 | stoq/kiwi | Test for radio buttons in lists | import gobject
import gtk
from kiwi.ui.widgets.list import Column, List
class Object:
def __init__(self, name, value):
self.name, self.value = name, value
columns = [Column('name'),
Column('value', data_type=bool, radio=True, editable=True)]
win = gtk.Window()
win.set_size_request(300, 120)
w... | <commit_before><commit_msg>Test for radio buttons in lists<commit_after> | import gobject
import gtk
from kiwi.ui.widgets.list import Column, List
class Object:
def __init__(self, name, value):
self.name, self.value = name, value
columns = [Column('name'),
Column('value', data_type=bool, radio=True, editable=True)]
win = gtk.Window()
win.set_size_request(300, 120)
w... | Test for radio buttons in listsimport gobject
import gtk
from kiwi.ui.widgets.list import Column, List
class Object:
def __init__(self, name, value):
self.name, self.value = name, value
columns = [Column('name'),
Column('value', data_type=bool, radio=True, editable=True)]
win = gtk.Window()
w... | <commit_before><commit_msg>Test for radio buttons in lists<commit_after>import gobject
import gtk
from kiwi.ui.widgets.list import Column, List
class Object:
def __init__(self, name, value):
self.name, self.value = name, value
columns = [Column('name'),
Column('value', data_type=bool, radio=Tr... | |
391de2d5920b4ebb12d488715cec4ef6839208d3 | zproject/local_settings_template.py | zproject/local_settings_template.py | # Template for Django settings for the Zulip local servers
import os
import platform
import re
# TODO: Rewrite this file to be more or less self-documenting as to
# how to generate each token securely and what other setup is needed.
# For now, we'll do that piecewise by component.
# Make this unique, and don't share ... | Add local settings template for local server instances. | Add local settings template for local server instances.
(imported from commit 96f59e6a041992f5b2c467558a2fcc14a951a8a9)
| Python | apache-2.0 | dawran6/zulip,amyliu345/zulip,arpitpanwar/zulip,brainwane/zulip,jphilipsen05/zulip,synicalsyntax/zulip,Drooids/zulip,PaulPetring/zulip,ericzhou2008/zulip,codeKonami/zulip,paxapy/zulip,wdaher/zulip,swinghu/zulip,so0k/zulip,aps-sids/zulip,Diptanshu8/zulip,moria/zulip,ikasumiwt/zulip,seapasulli/zulip,mansilladev/zulip,hac... | Add local settings template for local server instances.
(imported from commit 96f59e6a041992f5b2c467558a2fcc14a951a8a9) | # Template for Django settings for the Zulip local servers
import os
import platform
import re
# TODO: Rewrite this file to be more or less self-documenting as to
# how to generate each token securely and what other setup is needed.
# For now, we'll do that piecewise by component.
# Make this unique, and don't share ... | <commit_before><commit_msg>Add local settings template for local server instances.
(imported from commit 96f59e6a041992f5b2c467558a2fcc14a951a8a9)<commit_after> | # Template for Django settings for the Zulip local servers
import os
import platform
import re
# TODO: Rewrite this file to be more or less self-documenting as to
# how to generate each token securely and what other setup is needed.
# For now, we'll do that piecewise by component.
# Make this unique, and don't share ... | Add local settings template for local server instances.
(imported from commit 96f59e6a041992f5b2c467558a2fcc14a951a8a9)# Template for Django settings for the Zulip local servers
import os
import platform
import re
# TODO: Rewrite this file to be more or less self-documenting as to
# how to generate each token securel... | <commit_before><commit_msg>Add local settings template for local server instances.
(imported from commit 96f59e6a041992f5b2c467558a2fcc14a951a8a9)<commit_after># Template for Django settings for the Zulip local servers
import os
import platform
import re
# TODO: Rewrite this file to be more or less self-documenting a... | |
36d23fb7a3353a621e177a044a6c64335e1a79fb | src/sentry/digests/utilities.py | src/sentry/digests/utilities.py | from collections import Counter
# TODO(tkaemming): This should probably just be part of `build_digest`.t
def get_digest_metadata(digest):
start = None
end = None
counts = Counter()
for rule, groups in digest.iteritems():
counts.update(groups.keys())
for group, records in groups.iteri... | from collections import Counter
# TODO(tkaemming): This should probably just be part of `build_digest`.
def get_digest_metadata(digest):
start = None
end = None
counts = Counter()
for rule, groups in digest.iteritems():
counts.update(groups.keys())
for group, records in groups.iterit... | Fix typo in digest comment. | Fix typo in digest comment. | Python | bsd-3-clause | ifduyue/sentry,JamesMura/sentry,JackDanger/sentry,mvaled/sentry,BuildingLink/sentry,nicholasserra/sentry,BuildingLink/sentry,alexm92/sentry,gencer/sentry,beeftornado/sentry,JamesMura/sentry,alexm92/sentry,jean/sentry,nicholasserra/sentry,mvaled/sentry,JackDanger/sentry,ifduyue/sentry,BuildingLink/sentry,fotinakis/sentr... | from collections import Counter
# TODO(tkaemming): This should probably just be part of `build_digest`.t
def get_digest_metadata(digest):
start = None
end = None
counts = Counter()
for rule, groups in digest.iteritems():
counts.update(groups.keys())
for group, records in groups.iteri... | from collections import Counter
# TODO(tkaemming): This should probably just be part of `build_digest`.
def get_digest_metadata(digest):
start = None
end = None
counts = Counter()
for rule, groups in digest.iteritems():
counts.update(groups.keys())
for group, records in groups.iterit... | <commit_before>from collections import Counter
# TODO(tkaemming): This should probably just be part of `build_digest`.t
def get_digest_metadata(digest):
start = None
end = None
counts = Counter()
for rule, groups in digest.iteritems():
counts.update(groups.keys())
for group, records ... | from collections import Counter
# TODO(tkaemming): This should probably just be part of `build_digest`.
def get_digest_metadata(digest):
start = None
end = None
counts = Counter()
for rule, groups in digest.iteritems():
counts.update(groups.keys())
for group, records in groups.iterit... | from collections import Counter
# TODO(tkaemming): This should probably just be part of `build_digest`.t
def get_digest_metadata(digest):
start = None
end = None
counts = Counter()
for rule, groups in digest.iteritems():
counts.update(groups.keys())
for group, records in groups.iteri... | <commit_before>from collections import Counter
# TODO(tkaemming): This should probably just be part of `build_digest`.t
def get_digest_metadata(digest):
start = None
end = None
counts = Counter()
for rule, groups in digest.iteritems():
counts.update(groups.keys())
for group, records ... |
711aab80991f236232d3d1247f694d16e8ac0c4d | Charts/Testing/Python/TestLinePlot.py | Charts/Testing/Python/TestLinePlot.py | #!/usr/bin/env python
# Run this test like so:
# vtkpython TestLinePlot.py -D $VTK_DATA_ROOT \
# -B $VTK_DATA_ROOT/Baseline/Charts/
import os
import vtk
import vtk.test.Testing
import math
class TestLinePlot(vtk.test.Testing.vtkTest):
def testLinePlot(self):
"Test if line plots can be built with python"... | Add Python LinePlot Charts Test | Add Python LinePlot Charts Test
Largely a clone of the Cxx version save that the data arrays must
be manipulated directly since the vtkVariant based methods on vtkTable
aren't available to Python.
| Python | bsd-3-clause | ashray/VTK-EVM,berendkleinhaneveld/VTK,demarle/VTK,cjh1/VTK,collects/VTK,keithroe/vtkoptix,mspark93/VTK,gram526/VTK,SimVascular/VTK,spthaolt/VTK,msmolens/VTK,spthaolt/VTK,johnkit/vtk-dev,jeffbaumes/jeffbaumes-vtk,arnaudgelas/VTK,sumedhasingla/VTK,mspark93/VTK,ashray/VTK-EVM,biddisco/VTK,naucoin/VTKSlicerWidgets,jmerkow... | Add Python LinePlot Charts Test
Largely a clone of the Cxx version save that the data arrays must
be manipulated directly since the vtkVariant based methods on vtkTable
aren't available to Python. | #!/usr/bin/env python
# Run this test like so:
# vtkpython TestLinePlot.py -D $VTK_DATA_ROOT \
# -B $VTK_DATA_ROOT/Baseline/Charts/
import os
import vtk
import vtk.test.Testing
import math
class TestLinePlot(vtk.test.Testing.vtkTest):
def testLinePlot(self):
"Test if line plots can be built with python"... | <commit_before><commit_msg>Add Python LinePlot Charts Test
Largely a clone of the Cxx version save that the data arrays must
be manipulated directly since the vtkVariant based methods on vtkTable
aren't available to Python.<commit_after> | #!/usr/bin/env python
# Run this test like so:
# vtkpython TestLinePlot.py -D $VTK_DATA_ROOT \
# -B $VTK_DATA_ROOT/Baseline/Charts/
import os
import vtk
import vtk.test.Testing
import math
class TestLinePlot(vtk.test.Testing.vtkTest):
def testLinePlot(self):
"Test if line plots can be built with python"... | Add Python LinePlot Charts Test
Largely a clone of the Cxx version save that the data arrays must
be manipulated directly since the vtkVariant based methods on vtkTable
aren't available to Python.#!/usr/bin/env python
# Run this test like so:
# vtkpython TestLinePlot.py -D $VTK_DATA_ROOT \
# -B $VTK_DATA_ROOT/Baseli... | <commit_before><commit_msg>Add Python LinePlot Charts Test
Largely a clone of the Cxx version save that the data arrays must
be manipulated directly since the vtkVariant based methods on vtkTable
aren't available to Python.<commit_after>#!/usr/bin/env python
# Run this test like so:
# vtkpython TestLinePlot.py -D $V... | |
88e4d0beaca3adc561fc624e4d878c90c2750a8f | DataSources/BluetoothDataSource.py | DataSources/BluetoothDataSource.py | from time import sleep
from bluetooth import *
class BluetoothDataSource:
def __init__(self, params):
self.params = params
self.socket = BluetoothSocket(RFCOMM)
pass
def open(self):
try:
self.socket.connect((self.params['device'], self.params['port']))
sleep(0.4)
return True
except BluetoothError... | Add Bluetooth support. Still buggy but works. Mostly. If you are lucky. | Add Bluetooth support. Still buggy but works. Mostly. If you are lucky.
| Python | mit | Max-Might/Elmo-Scan | Add Bluetooth support. Still buggy but works. Mostly. If you are lucky. | from time import sleep
from bluetooth import *
class BluetoothDataSource:
def __init__(self, params):
self.params = params
self.socket = BluetoothSocket(RFCOMM)
pass
def open(self):
try:
self.socket.connect((self.params['device'], self.params['port']))
sleep(0.4)
return True
except BluetoothError... | <commit_before><commit_msg>Add Bluetooth support. Still buggy but works. Mostly. If you are lucky.<commit_after> | from time import sleep
from bluetooth import *
class BluetoothDataSource:
def __init__(self, params):
self.params = params
self.socket = BluetoothSocket(RFCOMM)
pass
def open(self):
try:
self.socket.connect((self.params['device'], self.params['port']))
sleep(0.4)
return True
except BluetoothError... | Add Bluetooth support. Still buggy but works. Mostly. If you are lucky.from time import sleep
from bluetooth import *
class BluetoothDataSource:
def __init__(self, params):
self.params = params
self.socket = BluetoothSocket(RFCOMM)
pass
def open(self):
try:
self.socket.connect((self.params['device'], sel... | <commit_before><commit_msg>Add Bluetooth support. Still buggy but works. Mostly. If you are lucky.<commit_after>from time import sleep
from bluetooth import *
class BluetoothDataSource:
def __init__(self, params):
self.params = params
self.socket = BluetoothSocket(RFCOMM)
pass
def open(self):
try:
self.s... | |
2a3c24b32e426e1cad65cdb72affeb81398f7b98 | scripts/hdf5_to_csv.py | scripts/hdf5_to_csv.py | #!/usr/bin/env python
from __future__ import print_function
from os.path import join, splitext
import glob
import pandas as pd
#import matplotlib.pyplot as plt
import multi_tracker_analysis as mta
def main():
#experiment_dir = 'choice_20210129_162648'
experiment_dir = '.'
def find_file_via_suffix(suf... | Add script to convert (some of) hdf5 tracking data to csv | Add script to convert (some of) hdf5 tracking data to csv
| Python | mit | tom-f-oconnell/multi_tracker,tom-f-oconnell/multi_tracker | Add script to convert (some of) hdf5 tracking data to csv | #!/usr/bin/env python
from __future__ import print_function
from os.path import join, splitext
import glob
import pandas as pd
#import matplotlib.pyplot as plt
import multi_tracker_analysis as mta
def main():
#experiment_dir = 'choice_20210129_162648'
experiment_dir = '.'
def find_file_via_suffix(suf... | <commit_before><commit_msg>Add script to convert (some of) hdf5 tracking data to csv<commit_after> | #!/usr/bin/env python
from __future__ import print_function
from os.path import join, splitext
import glob
import pandas as pd
#import matplotlib.pyplot as plt
import multi_tracker_analysis as mta
def main():
#experiment_dir = 'choice_20210129_162648'
experiment_dir = '.'
def find_file_via_suffix(suf... | Add script to convert (some of) hdf5 tracking data to csv#!/usr/bin/env python
from __future__ import print_function
from os.path import join, splitext
import glob
import pandas as pd
#import matplotlib.pyplot as plt
import multi_tracker_analysis as mta
def main():
#experiment_dir = 'choice_20210129_162648'
... | <commit_before><commit_msg>Add script to convert (some of) hdf5 tracking data to csv<commit_after>#!/usr/bin/env python
from __future__ import print_function
from os.path import join, splitext
import glob
import pandas as pd
#import matplotlib.pyplot as plt
import multi_tracker_analysis as mta
def main():
#ex... | |
e7ec8deb9fda8be9f85f1f26452646b6ddfe5367 | fuel_test/test_openstack.py | fuel_test/test_openstack.py | from openstack_site_pp_base import OpenStackSitePPBaseTestCase
import unittest
class OpenStackCase(OpenStackSitePPBaseTestCase):
def test_deploy_open_stack(self):
self.validate(
[self.controller1,self.controller2,self.compute1,self.compute2],
'puppet agent --test')
if __name__ == ... | from openstack_site_pp_base import OpenStackSitePPBaseTestCase
import unittest
class OpenStackCase(OpenStackSitePPBaseTestCase):
def test_deploy_open_stack(self):
self.validate(
[self.controller1,self.controller2,self.compute1,self.compute2],
'puppet agent --test')
for node... | Create snapshot after deploy openstack | Create snapshot after deploy openstack
| Python | apache-2.0 | slystopad/fuel-lib,Metaswitch/fuel-library,zhaochao/fuel-library,eayunstack/fuel-library,huntxu/fuel-library,SmartInfrastructures/fuel-library-dev,SmartInfrastructures/fuel-library-dev,ddepaoli3/fuel-library-dev,zhaochao/fuel-library,eayunstack/fuel-library,Metaswitch/fuel-library,zhaochao/fuel-library,zhaochao/fuel-li... | from openstack_site_pp_base import OpenStackSitePPBaseTestCase
import unittest
class OpenStackCase(OpenStackSitePPBaseTestCase):
def test_deploy_open_stack(self):
self.validate(
[self.controller1,self.controller2,self.compute1,self.compute2],
'puppet agent --test')
if __name__ == ... | from openstack_site_pp_base import OpenStackSitePPBaseTestCase
import unittest
class OpenStackCase(OpenStackSitePPBaseTestCase):
def test_deploy_open_stack(self):
self.validate(
[self.controller1,self.controller2,self.compute1,self.compute2],
'puppet agent --test')
for node... | <commit_before>from openstack_site_pp_base import OpenStackSitePPBaseTestCase
import unittest
class OpenStackCase(OpenStackSitePPBaseTestCase):
def test_deploy_open_stack(self):
self.validate(
[self.controller1,self.controller2,self.compute1,self.compute2],
'puppet agent --test')
... | from openstack_site_pp_base import OpenStackSitePPBaseTestCase
import unittest
class OpenStackCase(OpenStackSitePPBaseTestCase):
def test_deploy_open_stack(self):
self.validate(
[self.controller1,self.controller2,self.compute1,self.compute2],
'puppet agent --test')
for node... | from openstack_site_pp_base import OpenStackSitePPBaseTestCase
import unittest
class OpenStackCase(OpenStackSitePPBaseTestCase):
def test_deploy_open_stack(self):
self.validate(
[self.controller1,self.controller2,self.compute1,self.compute2],
'puppet agent --test')
if __name__ == ... | <commit_before>from openstack_site_pp_base import OpenStackSitePPBaseTestCase
import unittest
class OpenStackCase(OpenStackSitePPBaseTestCase):
def test_deploy_open_stack(self):
self.validate(
[self.controller1,self.controller2,self.compute1,self.compute2],
'puppet agent --test')
... |
4d065ff7fe1aab53dee472bfa4138f19ddc6774c | test/unittests/tts/test_espeak_tts.py | test/unittests/tts/test_espeak_tts.py | import unittest
from unittest import mock
from mycroft.tts.espeak_tts import ESpeak
@mock.patch('mycroft.tts.tts.PlaybackThread')
class TestMimic(unittest.TestCase):
@mock.patch('mycroft.tts.espeak_tts.subprocess')
def test_get_tts(self, mock_subprocess, _):
conf = {
"lang": "english-us",... | Add basic unittest for espeak | Add basic unittest for espeak
| Python | apache-2.0 | forslund/mycroft-core,MycroftAI/mycroft-core,forslund/mycroft-core,MycroftAI/mycroft-core | Add basic unittest for espeak | import unittest
from unittest import mock
from mycroft.tts.espeak_tts import ESpeak
@mock.patch('mycroft.tts.tts.PlaybackThread')
class TestMimic(unittest.TestCase):
@mock.patch('mycroft.tts.espeak_tts.subprocess')
def test_get_tts(self, mock_subprocess, _):
conf = {
"lang": "english-us",... | <commit_before><commit_msg>Add basic unittest for espeak<commit_after> | import unittest
from unittest import mock
from mycroft.tts.espeak_tts import ESpeak
@mock.patch('mycroft.tts.tts.PlaybackThread')
class TestMimic(unittest.TestCase):
@mock.patch('mycroft.tts.espeak_tts.subprocess')
def test_get_tts(self, mock_subprocess, _):
conf = {
"lang": "english-us",... | Add basic unittest for espeakimport unittest
from unittest import mock
from mycroft.tts.espeak_tts import ESpeak
@mock.patch('mycroft.tts.tts.PlaybackThread')
class TestMimic(unittest.TestCase):
@mock.patch('mycroft.tts.espeak_tts.subprocess')
def test_get_tts(self, mock_subprocess, _):
conf = {
... | <commit_before><commit_msg>Add basic unittest for espeak<commit_after>import unittest
from unittest import mock
from mycroft.tts.espeak_tts import ESpeak
@mock.patch('mycroft.tts.tts.PlaybackThread')
class TestMimic(unittest.TestCase):
@mock.patch('mycroft.tts.espeak_tts.subprocess')
def test_get_tts(self, m... | |
ded04b93d041a6b6274d7870ff2abea1fecea088 | examples/queue_mgt.py | examples/queue_mgt.py | import asyncio
import sys
import ampdclient
# This script demonstrates the lsinfo, addid and load command.
# It can be called on with the host and the path as argument:
# `python queue_mgt.py 127.0.0.1 testpl`
#
# If no argument is given, DEFAULT_HOST and DEFAULT_PATH will be used instead.
# MPD host
DEFAULT_HOST... | Add example for the load and addid command | Add example for the load and addid command
| Python | apache-2.0 | PierreRust/ampdclient | Add example for the load and addid command | import asyncio
import sys
import ampdclient
# This script demonstrates the lsinfo, addid and load command.
# It can be called on with the host and the path as argument:
# `python queue_mgt.py 127.0.0.1 testpl`
#
# If no argument is given, DEFAULT_HOST and DEFAULT_PATH will be used instead.
# MPD host
DEFAULT_HOST... | <commit_before><commit_msg>Add example for the load and addid command<commit_after> | import asyncio
import sys
import ampdclient
# This script demonstrates the lsinfo, addid and load command.
# It can be called on with the host and the path as argument:
# `python queue_mgt.py 127.0.0.1 testpl`
#
# If no argument is given, DEFAULT_HOST and DEFAULT_PATH will be used instead.
# MPD host
DEFAULT_HOST... | Add example for the load and addid commandimport asyncio
import sys
import ampdclient
# This script demonstrates the lsinfo, addid and load command.
# It can be called on with the host and the path as argument:
# `python queue_mgt.py 127.0.0.1 testpl`
#
# If no argument is given, DEFAULT_HOST and DEFAULT_PATH will... | <commit_before><commit_msg>Add example for the load and addid command<commit_after>import asyncio
import sys
import ampdclient
# This script demonstrates the lsinfo, addid and load command.
# It can be called on with the host and the path as argument:
# `python queue_mgt.py 127.0.0.1 testpl`
#
# If no argument is ... | |
57cfbc8b8d85306572fb37ade867faffc190cfb0 | flawless/lib/storage/redis_storage.py | flawless/lib/storage/redis_storage.py | #!/usr/bin/env python
#
# Copyright (c) 2011-2013, Shopkick Inc.
# All rights reserved.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
# ---
# Author: John Egan <jo... | Add beta version of redis storage | Add beta version of redis storage
| Python | mpl-2.0 | shopkick/flawless | Add beta version of redis storage | #!/usr/bin/env python
#
# Copyright (c) 2011-2013, Shopkick Inc.
# All rights reserved.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
# ---
# Author: John Egan <jo... | <commit_before><commit_msg>Add beta version of redis storage<commit_after> | #!/usr/bin/env python
#
# Copyright (c) 2011-2013, Shopkick Inc.
# All rights reserved.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
# ---
# Author: John Egan <jo... | Add beta version of redis storage#!/usr/bin/env python
#
# Copyright (c) 2011-2013, Shopkick Inc.
# All rights reserved.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/... | <commit_before><commit_msg>Add beta version of redis storage<commit_after>#!/usr/bin/env python
#
# Copyright (c) 2011-2013, Shopkick Inc.
# All rights reserved.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can ... | |
a216b64c9d4c156d4ef4342efa3b8203c89b13a5 | compare_packages.py | compare_packages.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# This script compares the npm packages version in the Luxembourg
# project with the ones in ngeo.
# Make sure to call "npm i" in the geoportal directory before running the script.
import json
with open('./geoportal/package.json') as json_file:
lux_deps = json.load(... | Add script to compare npm versions | Add script to compare npm versions
| Python | mit | Geoportail-Luxembourg/geoportailv3,Geoportail-Luxembourg/geoportailv3,Geoportail-Luxembourg/geoportailv3,Geoportail-Luxembourg/geoportailv3,Geoportail-Luxembourg/geoportailv3 | Add script to compare npm versions | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# This script compares the npm packages version in the Luxembourg
# project with the ones in ngeo.
# Make sure to call "npm i" in the geoportal directory before running the script.
import json
with open('./geoportal/package.json') as json_file:
lux_deps = json.load(... | <commit_before><commit_msg>Add script to compare npm versions<commit_after> | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# This script compares the npm packages version in the Luxembourg
# project with the ones in ngeo.
# Make sure to call "npm i" in the geoportal directory before running the script.
import json
with open('./geoportal/package.json') as json_file:
lux_deps = json.load(... | Add script to compare npm versions#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# This script compares the npm packages version in the Luxembourg
# project with the ones in ngeo.
# Make sure to call "npm i" in the geoportal directory before running the script.
import json
with open('./geoportal/package.json') as js... | <commit_before><commit_msg>Add script to compare npm versions<commit_after>#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# This script compares the npm packages version in the Luxembourg
# project with the ones in ngeo.
# Make sure to call "npm i" in the geoportal directory before running the script.
import json
wi... | |
abafda042fe35611d144cb45c6f6c7d010515353 | enhydris/hcore/migrations/0002_maintainers.py | enhydris/hcore/migrations/0002_maintainers.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('hcore', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='st... | Add migration about station maintainers | Add migration about station maintainers
This migration was apparently accidentally omitted in df653b5dcf.
| Python | agpl-3.0 | openmeteo/enhydris,kickapoo/enhydris,openmeteo/enhydris,aptiko/enhydris,kickapoo/enhydris,aptiko/enhydris,aptiko/enhydris,kickapoo/enhydris,openmeteo/enhydris,ellak-monades-aristeias/enhydris,ellak-monades-aristeias/enhydris,ellak-monades-aristeias/enhydris | Add migration about station maintainers
This migration was apparently accidentally omitted in df653b5dcf. | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('hcore', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='st... | <commit_before><commit_msg>Add migration about station maintainers
This migration was apparently accidentally omitted in df653b5dcf.<commit_after> | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('hcore', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='st... | Add migration about station maintainers
This migration was apparently accidentally omitted in df653b5dcf.# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('hc... | <commit_before><commit_msg>Add migration about station maintainers
This migration was apparently accidentally omitted in df653b5dcf.<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migra... | |
a82f3a601d1f890913d933a528ddfe773e260c01 | galpy/potential_src/SimpleWrapperPotential.py | galpy/potential_src/SimpleWrapperPotential.py | ###############################################################################
# SimpleWrapperPotential.py: Super-class for simple wrapper potentials
###############################################################################
from galpy.potential_src.Potential import Potential, _isNonAxi
from galpy.potential_src... | Add a super-class for simple wrappers (that wrap potentials independent of R,Z,phi | Add a super-class for simple wrappers (that wrap potentials independent of R,Z,phi
| Python | bsd-3-clause | jobovy/galpy,jobovy/galpy,jobovy/galpy,jobovy/galpy | Add a super-class for simple wrappers (that wrap potentials independent of R,Z,phi | ###############################################################################
# SimpleWrapperPotential.py: Super-class for simple wrapper potentials
###############################################################################
from galpy.potential_src.Potential import Potential, _isNonAxi
from galpy.potential_src... | <commit_before><commit_msg>Add a super-class for simple wrappers (that wrap potentials independent of R,Z,phi<commit_after> | ###############################################################################
# SimpleWrapperPotential.py: Super-class for simple wrapper potentials
###############################################################################
from galpy.potential_src.Potential import Potential, _isNonAxi
from galpy.potential_src... | Add a super-class for simple wrappers (that wrap potentials independent of R,Z,phi###############################################################################
# SimpleWrapperPotential.py: Super-class for simple wrapper potentials
###############################################################################
from ... | <commit_before><commit_msg>Add a super-class for simple wrappers (that wrap potentials independent of R,Z,phi<commit_after>###############################################################################
# SimpleWrapperPotential.py: Super-class for simple wrapper potentials
############################################... | |
108e23f67e01edc98a98ea646d42137a1b49f255 | ichnaea/alembic/versions/3be4004781bc_noop.py | ichnaea/alembic/versions/3be4004781bc_noop.py | """No-op migration for testing deploys
Revision ID: 3be4004781bc
Revises: a0ee5e10f44b
Create Date: 2019-11-04 18:56:29.459718
"""
import logging
log = logging.getLogger("alembic.migration")
revision = "3be4004781bc"
down_revision = "a0ee5e10f44b"
def upgrade():
pass
def downgrade():
pass
| Add no-op migration to test deploys | Add no-op migration to test deploys
| Python | apache-2.0 | mozilla/ichnaea,mozilla/ichnaea,mozilla/ichnaea,mozilla/ichnaea | Add no-op migration to test deploys | """No-op migration for testing deploys
Revision ID: 3be4004781bc
Revises: a0ee5e10f44b
Create Date: 2019-11-04 18:56:29.459718
"""
import logging
log = logging.getLogger("alembic.migration")
revision = "3be4004781bc"
down_revision = "a0ee5e10f44b"
def upgrade():
pass
def downgrade():
pass
| <commit_before><commit_msg>Add no-op migration to test deploys<commit_after> | """No-op migration for testing deploys
Revision ID: 3be4004781bc
Revises: a0ee5e10f44b
Create Date: 2019-11-04 18:56:29.459718
"""
import logging
log = logging.getLogger("alembic.migration")
revision = "3be4004781bc"
down_revision = "a0ee5e10f44b"
def upgrade():
pass
def downgrade():
pass
| Add no-op migration to test deploys"""No-op migration for testing deploys
Revision ID: 3be4004781bc
Revises: a0ee5e10f44b
Create Date: 2019-11-04 18:56:29.459718
"""
import logging
log = logging.getLogger("alembic.migration")
revision = "3be4004781bc"
down_revision = "a0ee5e10f44b"
def upgrade():
pass
def d... | <commit_before><commit_msg>Add no-op migration to test deploys<commit_after>"""No-op migration for testing deploys
Revision ID: 3be4004781bc
Revises: a0ee5e10f44b
Create Date: 2019-11-04 18:56:29.459718
"""
import logging
log = logging.getLogger("alembic.migration")
revision = "3be4004781bc"
down_revision = "a0ee5e... | |
344a3b7277be9476d9d9e8cdbfc838bb3671b82f | bayespy/inference/vmp/nodes/pdf.py | bayespy/inference/vmp/nodes/pdf.py | ######################################################################
# Copyright (C) 2015 Jaakko Luttinen
#
# This file is licensed under Version 3.0 of the GNU General Public
# License. See LICENSE for a text of the license.
######################################################################
####################... | Create file for the black box node | ENH: Create file for the black box node
| Python | mit | SalemAmeen/bayespy,bayespy/bayespy,jluttine/bayespy,fivejjs/bayespy | ENH: Create file for the black box node | ######################################################################
# Copyright (C) 2015 Jaakko Luttinen
#
# This file is licensed under Version 3.0 of the GNU General Public
# License. See LICENSE for a text of the license.
######################################################################
####################... | <commit_before><commit_msg>ENH: Create file for the black box node<commit_after> | ######################################################################
# Copyright (C) 2015 Jaakko Luttinen
#
# This file is licensed under Version 3.0 of the GNU General Public
# License. See LICENSE for a text of the license.
######################################################################
####################... | ENH: Create file for the black box node######################################################################
# Copyright (C) 2015 Jaakko Luttinen
#
# This file is licensed under Version 3.0 of the GNU General Public
# License. See LICENSE for a text of the license.
#####################################################... | <commit_before><commit_msg>ENH: Create file for the black box node<commit_after>######################################################################
# Copyright (C) 2015 Jaakko Luttinen
#
# This file is licensed under Version 3.0 of the GNU General Public
# License. See LICENSE for a text of the license.
############... | |
c56d00efdfe56c5854745ca282cc1a4df0b4cd6d | bootcamp/lesson2.py | bootcamp/lesson2.py | from core import test_helper
# Question 1
# ----------
# Given a list of strings, return the count of the number of strings where the string length
# is 2 or more and the first and last chars of the string are the same.
def match_ends(words):
pass
# Question 2
# ----------
# Given a list of strings, return a li... | Add problems for lesson 2 | Add problems for lesson 2
| Python | mit | infoscout/python-bootcamp-pv | Add problems for lesson 2 | from core import test_helper
# Question 1
# ----------
# Given a list of strings, return the count of the number of strings where the string length
# is 2 or more and the first and last chars of the string are the same.
def match_ends(words):
pass
# Question 2
# ----------
# Given a list of strings, return a li... | <commit_before><commit_msg>Add problems for lesson 2<commit_after> | from core import test_helper
# Question 1
# ----------
# Given a list of strings, return the count of the number of strings where the string length
# is 2 or more and the first and last chars of the string are the same.
def match_ends(words):
pass
# Question 2
# ----------
# Given a list of strings, return a li... | Add problems for lesson 2from core import test_helper
# Question 1
# ----------
# Given a list of strings, return the count of the number of strings where the string length
# is 2 or more and the first and last chars of the string are the same.
def match_ends(words):
pass
# Question 2
# ----------
# Given a lis... | <commit_before><commit_msg>Add problems for lesson 2<commit_after>from core import test_helper
# Question 1
# ----------
# Given a list of strings, return the count of the number of strings where the string length
# is 2 or more and the first and last chars of the string are the same.
def match_ends(words):
pass... | |
3cff7a8eb7dd1babeeb16da06239ad63d4f8c154 | src/keybar/tests/models/test_vault.py | src/keybar/tests/models/test_vault.py | import pytest
from keybar.tests.factories.vault import VaultFactory
@pytest.mark.django_db
class TestVault:
def test_simple(self):
vault = VaultFactory.create()
assert str(vault) == '{} ({})'.format(vault.name, vault.slug)
def test_slug(self):
vault = VaultFactory.create(name='This... | Add simple tests for models.Vault | Add simple tests for models.Vault
| Python | bsd-3-clause | keybar/keybar | Add simple tests for models.Vault | import pytest
from keybar.tests.factories.vault import VaultFactory
@pytest.mark.django_db
class TestVault:
def test_simple(self):
vault = VaultFactory.create()
assert str(vault) == '{} ({})'.format(vault.name, vault.slug)
def test_slug(self):
vault = VaultFactory.create(name='This... | <commit_before><commit_msg>Add simple tests for models.Vault<commit_after> | import pytest
from keybar.tests.factories.vault import VaultFactory
@pytest.mark.django_db
class TestVault:
def test_simple(self):
vault = VaultFactory.create()
assert str(vault) == '{} ({})'.format(vault.name, vault.slug)
def test_slug(self):
vault = VaultFactory.create(name='This... | Add simple tests for models.Vaultimport pytest
from keybar.tests.factories.vault import VaultFactory
@pytest.mark.django_db
class TestVault:
def test_simple(self):
vault = VaultFactory.create()
assert str(vault) == '{} ({})'.format(vault.name, vault.slug)
def test_slug(self):
vault... | <commit_before><commit_msg>Add simple tests for models.Vault<commit_after>import pytest
from keybar.tests.factories.vault import VaultFactory
@pytest.mark.django_db
class TestVault:
def test_simple(self):
vault = VaultFactory.create()
assert str(vault) == '{} ({})'.format(vault.name, vault.slug... | |
3d9c3c63758bf52b22be8c56a50a1cba2a441d12 | turbustat/tests/test_wrapper.py | turbustat/tests/test_wrapper.py | # Licensed under an MIT open source license - see LICENSE
from ..statistics import stats_wrapper
from ._testing_data import \
dataset1, dataset2
def test_wrapper():
run_wrapper = stats_wrapper(dataset1, dataset2)
| Add a test for the wrapper | Add a test for the wrapper
| Python | mit | Astroua/TurbuStat,e-koch/TurbuStat | Add a test for the wrapper | # Licensed under an MIT open source license - see LICENSE
from ..statistics import stats_wrapper
from ._testing_data import \
dataset1, dataset2
def test_wrapper():
run_wrapper = stats_wrapper(dataset1, dataset2)
| <commit_before><commit_msg>Add a test for the wrapper<commit_after> | # Licensed under an MIT open source license - see LICENSE
from ..statistics import stats_wrapper
from ._testing_data import \
dataset1, dataset2
def test_wrapper():
run_wrapper = stats_wrapper(dataset1, dataset2)
| Add a test for the wrapper# Licensed under an MIT open source license - see LICENSE
from ..statistics import stats_wrapper
from ._testing_data import \
dataset1, dataset2
def test_wrapper():
run_wrapper = stats_wrapper(dataset1, dataset2)
| <commit_before><commit_msg>Add a test for the wrapper<commit_after># Licensed under an MIT open source license - see LICENSE
from ..statistics import stats_wrapper
from ._testing_data import \
dataset1, dataset2
def test_wrapper():
run_wrapper = stats_wrapper(dataset1, dataset2)
| |
4ebf68bc3ae22f39be6f7c0a260323648537e65c | integration/experiment/common_args.py | integration/experiment/common_args.py | #
# Copyright (c) 2015, 2016, 2017, 2018, 2019, 2020, Intel Corporation
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, th... | Add helper methods for commonly added commandline options for experiments | Add helper methods for commonly added commandline options for experiments
Signed-off-by: Diana Guttman <98d11df29868673c9a01b97a41154316626a31b0@intel.com>
| Python | bsd-3-clause | geopm/geopm,cmcantalupo/geopm,cmcantalupo/geopm,cmcantalupo/geopm,geopm/geopm,geopm/geopm,cmcantalupo/geopm,geopm/geopm,geopm/geopm,cmcantalupo/geopm | Add helper methods for commonly added commandline options for experiments
Signed-off-by: Diana Guttman <98d11df29868673c9a01b97a41154316626a31b0@intel.com> | #
# Copyright (c) 2015, 2016, 2017, 2018, 2019, 2020, Intel Corporation
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, th... | <commit_before><commit_msg>Add helper methods for commonly added commandline options for experiments
Signed-off-by: Diana Guttman <98d11df29868673c9a01b97a41154316626a31b0@intel.com><commit_after> | #
# Copyright (c) 2015, 2016, 2017, 2018, 2019, 2020, Intel Corporation
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, th... | Add helper methods for commonly added commandline options for experiments
Signed-off-by: Diana Guttman <98d11df29868673c9a01b97a41154316626a31b0@intel.com>#
# Copyright (c) 2015, 2016, 2017, 2018, 2019, 2020, Intel Corporation
#
# Redistribution and use in source and binary forms, with or without
# modification, ar... | <commit_before><commit_msg>Add helper methods for commonly added commandline options for experiments
Signed-off-by: Diana Guttman <98d11df29868673c9a01b97a41154316626a31b0@intel.com><commit_after>#
# Copyright (c) 2015, 2016, 2017, 2018, 2019, 2020, Intel Corporation
#
# Redistribution and use in source and binary f... | |
ae580fb0dde2b6cce956733beb51dc4187183bab | flexget/plugins/cli/check_version.py | flexget/plugins/cli/check_version.py | from __future__ import unicode_literals, division, absolute_import
import re
from argparse import _VersionAction
import flexget
from flexget.utils import requests
from flexget.plugin import register_parser_option
class CheckVersion(_VersionAction):
def __call__(self, parser, namespace, values, option_string=None... | Add --check-version to see if you are on latest release. | Add --check-version to see if you are on latest release.
| Python | mit | dsemi/Flexget,tarzasai/Flexget,crawln45/Flexget,camon/Flexget,jawilson/Flexget,offbyone/Flexget,LynxyssCZ/Flexget,qvazzler/Flexget,ianstalk/Flexget,Danfocus/Flexget,grrr2/Flexget,cvium/Flexget,Flexget/Flexget,antivirtel/Flexget,ZefQ/Flexget,gazpachoking/Flexget,vfrc2/Flexget,qk4l/Flexget,tarzasai/Flexget,offbyone/Flexg... | Add --check-version to see if you are on latest release. | from __future__ import unicode_literals, division, absolute_import
import re
from argparse import _VersionAction
import flexget
from flexget.utils import requests
from flexget.plugin import register_parser_option
class CheckVersion(_VersionAction):
def __call__(self, parser, namespace, values, option_string=None... | <commit_before><commit_msg>Add --check-version to see if you are on latest release.<commit_after> | from __future__ import unicode_literals, division, absolute_import
import re
from argparse import _VersionAction
import flexget
from flexget.utils import requests
from flexget.plugin import register_parser_option
class CheckVersion(_VersionAction):
def __call__(self, parser, namespace, values, option_string=None... | Add --check-version to see if you are on latest release.from __future__ import unicode_literals, division, absolute_import
import re
from argparse import _VersionAction
import flexget
from flexget.utils import requests
from flexget.plugin import register_parser_option
class CheckVersion(_VersionAction):
def __ca... | <commit_before><commit_msg>Add --check-version to see if you are on latest release.<commit_after>from __future__ import unicode_literals, division, absolute_import
import re
from argparse import _VersionAction
import flexget
from flexget.utils import requests
from flexget.plugin import register_parser_option
class C... | |
f0c2494aeec0040fab6276ba0ddbb0812d27e09a | scripts/plots.py | scripts/plots.py | """
Plot user tweet activity.
"""
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import twitterproj
def plot_counts(collection, ax=None):
if ax is None:
ax = plt.gca()
tweets, db, conn = twitterproj.connect()
counts = []
for doc in collection.find():
counts... | Add simple scripts to plot frequencies. | Add simple scripts to plot frequencies.
| Python | unlicense | chebee7i/twitter,chebee7i/twitter,chebee7i/twitter | Add simple scripts to plot frequencies. | """
Plot user tweet activity.
"""
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import twitterproj
def plot_counts(collection, ax=None):
if ax is None:
ax = plt.gca()
tweets, db, conn = twitterproj.connect()
counts = []
for doc in collection.find():
counts... | <commit_before><commit_msg>Add simple scripts to plot frequencies.<commit_after> | """
Plot user tweet activity.
"""
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import twitterproj
def plot_counts(collection, ax=None):
if ax is None:
ax = plt.gca()
tweets, db, conn = twitterproj.connect()
counts = []
for doc in collection.find():
counts... | Add simple scripts to plot frequencies."""
Plot user tweet activity.
"""
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import twitterproj
def plot_counts(collection, ax=None):
if ax is None:
ax = plt.gca()
tweets, db, conn = twitterproj.connect()
counts = []
for d... | <commit_before><commit_msg>Add simple scripts to plot frequencies.<commit_after>"""
Plot user tweet activity.
"""
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import twitterproj
def plot_counts(collection, ax=None):
if ax is None:
ax = plt.gca()
tweets, db, conn = twitter... | |
9b4053dde1cd1baef2a71adbeb7ba1338a2b5093 | scripts/consistency/find_bad_registrations.py | scripts/consistency/find_bad_registrations.py | """
"""
from website.app import init_app
from website import models
from framework import Q
app = init_app()
known_schemas = [
'Open-Ended_Registration',
'OSF-Standard_Pre-Data_Collection_Registration',
'Replication_Recipe_(Brandt_et_al__!dot!__,_2013):_Pre-Registration',
'Replication_Recipe_(Brandt... | Add script to find bad / outdated registrations | Add script to find bad / outdated registrations
| Python | apache-2.0 | lamdnhan/osf.io,KAsante95/osf.io,jolene-esposito/osf.io,brianjgeiger/osf.io,SSJohns/osf.io,cwisecarver/osf.io,revanthkolli/osf.io,fabianvf/osf.io,GaryKriebel/osf.io,danielneis/osf.io,RomanZWang/osf.io,CenterForOpenScience/osf.io,petermalcolm/osf.io,HalcyonChimera/osf.io,kch8qx/osf.io,GageGaskins/osf.io,hmoco/osf.io,tic... | Add script to find bad / outdated registrations | """
"""
from website.app import init_app
from website import models
from framework import Q
app = init_app()
known_schemas = [
'Open-Ended_Registration',
'OSF-Standard_Pre-Data_Collection_Registration',
'Replication_Recipe_(Brandt_et_al__!dot!__,_2013):_Pre-Registration',
'Replication_Recipe_(Brandt... | <commit_before><commit_msg>Add script to find bad / outdated registrations<commit_after> | """
"""
from website.app import init_app
from website import models
from framework import Q
app = init_app()
known_schemas = [
'Open-Ended_Registration',
'OSF-Standard_Pre-Data_Collection_Registration',
'Replication_Recipe_(Brandt_et_al__!dot!__,_2013):_Pre-Registration',
'Replication_Recipe_(Brandt... | Add script to find bad / outdated registrations"""
"""
from website.app import init_app
from website import models
from framework import Q
app = init_app()
known_schemas = [
'Open-Ended_Registration',
'OSF-Standard_Pre-Data_Collection_Registration',
'Replication_Recipe_(Brandt_et_al__!dot!__,_2013):_Pre... | <commit_before><commit_msg>Add script to find bad / outdated registrations<commit_after>"""
"""
from website.app import init_app
from website import models
from framework import Q
app = init_app()
known_schemas = [
'Open-Ended_Registration',
'OSF-Standard_Pre-Data_Collection_Registration',
'Replication_... | |
a93ad6ce9a264a82717a37230e48ff00d9c642fc | pywikibot/families/wikidata_family.py | pywikibot/families/wikidata_family.py | # -*- coding: utf-8 -*-
__version__ = '$Id$'
from pywikibot import family
# The wikidata family
class Family(family.WikimediaFamily):
def __init__(self):
super(Family, self).__init__()
self.name = 'wikidata'
self.langs = {
'wikidata': 'www.wikidata.org',
'repo':... | # -*- coding: utf-8 -*-
__version__ = '$Id$'
from pywikibot import family
# The wikidata family
class Family(family.WikimediaFamily):
def __init__(self):
super(Family, self).__init__()
self.name = 'wikidata'
self.langs = {
'wikidata': 'www.wikidata.org',
'repo':... | Add moon (Q405) to the list of globes | Add moon (Q405) to the list of globes
Change-Id: I2dd9f87fcb1d748bff94328575f8439dc36035e3
| Python | mit | magul/pywikibot-core,wikimedia/pywikibot-core,happy5214/pywikibot-core,jayvdb/pywikibot-core,Darkdadaah/pywikibot-core,trishnaguha/pywikibot-core,VcamX/pywikibot-core,hasteur/g13bot_tools_new,h4ck3rm1k3/pywikibot-core,hasteur/g13bot_tools_new,wikimedia/pywikibot-core,hasteur/g13bot_tools_new,PersianWikipedia/pywikibot-... | # -*- coding: utf-8 -*-
__version__ = '$Id$'
from pywikibot import family
# The wikidata family
class Family(family.WikimediaFamily):
def __init__(self):
super(Family, self).__init__()
self.name = 'wikidata'
self.langs = {
'wikidata': 'www.wikidata.org',
'repo':... | # -*- coding: utf-8 -*-
__version__ = '$Id$'
from pywikibot import family
# The wikidata family
class Family(family.WikimediaFamily):
def __init__(self):
super(Family, self).__init__()
self.name = 'wikidata'
self.langs = {
'wikidata': 'www.wikidata.org',
'repo':... | <commit_before># -*- coding: utf-8 -*-
__version__ = '$Id$'
from pywikibot import family
# The wikidata family
class Family(family.WikimediaFamily):
def __init__(self):
super(Family, self).__init__()
self.name = 'wikidata'
self.langs = {
'wikidata': 'www.wikidata.org',
... | # -*- coding: utf-8 -*-
__version__ = '$Id$'
from pywikibot import family
# The wikidata family
class Family(family.WikimediaFamily):
def __init__(self):
super(Family, self).__init__()
self.name = 'wikidata'
self.langs = {
'wikidata': 'www.wikidata.org',
'repo':... | # -*- coding: utf-8 -*-
__version__ = '$Id$'
from pywikibot import family
# The wikidata family
class Family(family.WikimediaFamily):
def __init__(self):
super(Family, self).__init__()
self.name = 'wikidata'
self.langs = {
'wikidata': 'www.wikidata.org',
'repo':... | <commit_before># -*- coding: utf-8 -*-
__version__ = '$Id$'
from pywikibot import family
# The wikidata family
class Family(family.WikimediaFamily):
def __init__(self):
super(Family, self).__init__()
self.name = 'wikidata'
self.langs = {
'wikidata': 'www.wikidata.org',
... |
4ed6e80128c9ea51e73be0eb4a3f840f8bb13787 | scrapers/jyvaskyla.py | scrapers/jyvaskyla.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import requests
import requests_cache
from lxml import html
from utils import ScrapeError, submit_council_members
from finland import PARTIES
def scrape_council_group(url):
# E.g. http://www.jyvaskyla.fi/hallinto/valtuusto/valtuusto09/sdp
party = url.split('/')[-... | Add scraper for Jyväskylä city council members | Add scraper for Jyväskylä city council members
| Python | agpl-3.0 | kansanmuisti/datavaalit,kansanmuisti/datavaalit | Add scraper for Jyväskylä city council members | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import requests
import requests_cache
from lxml import html
from utils import ScrapeError, submit_council_members
from finland import PARTIES
def scrape_council_group(url):
# E.g. http://www.jyvaskyla.fi/hallinto/valtuusto/valtuusto09/sdp
party = url.split('/')[-... | <commit_before><commit_msg>Add scraper for Jyväskylä city council members<commit_after> | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import requests
import requests_cache
from lxml import html
from utils import ScrapeError, submit_council_members
from finland import PARTIES
def scrape_council_group(url):
# E.g. http://www.jyvaskyla.fi/hallinto/valtuusto/valtuusto09/sdp
party = url.split('/')[-... | Add scraper for Jyväskylä city council members#!/usr/bin/env python
# -*- coding: utf-8 -*-
import requests
import requests_cache
from lxml import html
from utils import ScrapeError, submit_council_members
from finland import PARTIES
def scrape_council_group(url):
# E.g. http://www.jyvaskyla.fi/hallinto/valtuust... | <commit_before><commit_msg>Add scraper for Jyväskylä city council members<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import requests
import requests_cache
from lxml import html
from utils import ScrapeError, submit_council_members
from finland import PARTIES
def scrape_council_group(url):
# E.g. ... | |
a6cbb7e0914afdebcb4a03078575e55ce86b3224 | extract_pairings.py | extract_pairings.py | import json
import re
from collections import defaultdict
def extract_ingredients_from_string(description):
if description:
cleaned_description = re.sub('[^a-z ]', '', description.lower())
return cleaned_description.split()
def make_pairing_store():
return defaultdict(lambda: defautdict(int))
def record_... | Add iteration over menu items | Add iteration over menu items
| Python | mit | keir/tastypair,keir/tastypair | Add iteration over menu items | import json
import re
from collections import defaultdict
def extract_ingredients_from_string(description):
if description:
cleaned_description = re.sub('[^a-z ]', '', description.lower())
return cleaned_description.split()
def make_pairing_store():
return defaultdict(lambda: defautdict(int))
def record_... | <commit_before><commit_msg>Add iteration over menu items<commit_after> | import json
import re
from collections import defaultdict
def extract_ingredients_from_string(description):
if description:
cleaned_description = re.sub('[^a-z ]', '', description.lower())
return cleaned_description.split()
def make_pairing_store():
return defaultdict(lambda: defautdict(int))
def record_... | Add iteration over menu itemsimport json
import re
from collections import defaultdict
def extract_ingredients_from_string(description):
if description:
cleaned_description = re.sub('[^a-z ]', '', description.lower())
return cleaned_description.split()
def make_pairing_store():
return defaultdict(lambda: ... | <commit_before><commit_msg>Add iteration over menu items<commit_after>import json
import re
from collections import defaultdict
def extract_ingredients_from_string(description):
if description:
cleaned_description = re.sub('[^a-z ]', '', description.lower())
return cleaned_description.split()
def make_pairi... | |
ff80cf04452c85ff0b93666feb867afa6e4d94f0 | examples/apc2016/train_fcn8s.py | examples/apc2016/train_fcn8s.py | #!/usr/bin/env python
import argparse
import os
import os.path as osp
import chainer
from chainer import cuda
import fcn
import datasets
def main():
parser = argparse.ArgumentParser()
parser.add_argument('--fcn16s', required=True)
parser.add_argument('--gpu', type=int, default=0)
parser.add_argume... | Add trainer for fcn8s on apc2016 | Add trainer for fcn8s on apc2016
| Python | mit | wkentaro/fcn | Add trainer for fcn8s on apc2016 | #!/usr/bin/env python
import argparse
import os
import os.path as osp
import chainer
from chainer import cuda
import fcn
import datasets
def main():
parser = argparse.ArgumentParser()
parser.add_argument('--fcn16s', required=True)
parser.add_argument('--gpu', type=int, default=0)
parser.add_argume... | <commit_before><commit_msg>Add trainer for fcn8s on apc2016<commit_after> | #!/usr/bin/env python
import argparse
import os
import os.path as osp
import chainer
from chainer import cuda
import fcn
import datasets
def main():
parser = argparse.ArgumentParser()
parser.add_argument('--fcn16s', required=True)
parser.add_argument('--gpu', type=int, default=0)
parser.add_argume... | Add trainer for fcn8s on apc2016#!/usr/bin/env python
import argparse
import os
import os.path as osp
import chainer
from chainer import cuda
import fcn
import datasets
def main():
parser = argparse.ArgumentParser()
parser.add_argument('--fcn16s', required=True)
parser.add_argument('--gpu', type=int, ... | <commit_before><commit_msg>Add trainer for fcn8s on apc2016<commit_after>#!/usr/bin/env python
import argparse
import os
import os.path as osp
import chainer
from chainer import cuda
import fcn
import datasets
def main():
parser = argparse.ArgumentParser()
parser.add_argument('--fcn16s', required=True)
... | |
d0dcdf7ed663f9909f2a8e889bb972c5731aef0f | src/ggrc/migrations/versions/20170302155757_2127ea770285_add_audit_fk_to_assessments_and_issues.py | src/ggrc/migrations/versions/20170302155757_2127ea770285_add_audit_fk_to_assessments_and_issues.py | # Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""
Add audit FK to assessments and issues
Create Date: 2017-03-02 15:57:57.006126
"""
# disable Invalid constant name pylint warning for mandatory Alembic variables.
# pylint: disable=invalid-name
import ... | Add audit foreign key to assessments and issues | Add audit foreign key to assessments and issues
| Python | apache-2.0 | AleksNeStu/ggrc-core,AleksNeStu/ggrc-core,AleksNeStu/ggrc-core,AleksNeStu/ggrc-core | Add audit foreign key to assessments and issues | # Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""
Add audit FK to assessments and issues
Create Date: 2017-03-02 15:57:57.006126
"""
# disable Invalid constant name pylint warning for mandatory Alembic variables.
# pylint: disable=invalid-name
import ... | <commit_before><commit_msg>Add audit foreign key to assessments and issues<commit_after> | # Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""
Add audit FK to assessments and issues
Create Date: 2017-03-02 15:57:57.006126
"""
# disable Invalid constant name pylint warning for mandatory Alembic variables.
# pylint: disable=invalid-name
import ... | Add audit foreign key to assessments and issues# Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""
Add audit FK to assessments and issues
Create Date: 2017-03-02 15:57:57.006126
"""
# disable Invalid constant name pylint warning for mandatory Alembic var... | <commit_before><commit_msg>Add audit foreign key to assessments and issues<commit_after># Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""
Add audit FK to assessments and issues
Create Date: 2017-03-02 15:57:57.006126
"""
# disable Invalid constant name... | |
e06642b2a3e679d9292bec6bd468d2cada2baf70 | h2o-py/tests/testdir_persist/pyunit_import_s3_parquet.py | h2o-py/tests/testdir_persist/pyunit_import_s3_parquet.py | import h2o
import os
from h2o.persist import set_s3_credentials
from tests import pyunit_utils
from pandas.testing import assert_frame_equal
def test_import_parquet_from_s3():
access_key_id = os.environ['AWS_ACCESS_KEY_ID']
secret_access_key = os.environ['AWS_SECRET_ACCESS_KEY']
assert access_key_id is ... | Add python test of importing Parquet files from S3 | Add python test of importing Parquet files from S3
| Python | apache-2.0 | h2oai/h2o-3,h2oai/h2o-3,h2oai/h2o-3,h2oai/h2o-3,h2oai/h2o-3,h2oai/h2o-3,h2oai/h2o-3,h2oai/h2o-3 | Add python test of importing Parquet files from S3 | import h2o
import os
from h2o.persist import set_s3_credentials
from tests import pyunit_utils
from pandas.testing import assert_frame_equal
def test_import_parquet_from_s3():
access_key_id = os.environ['AWS_ACCESS_KEY_ID']
secret_access_key = os.environ['AWS_SECRET_ACCESS_KEY']
assert access_key_id is ... | <commit_before><commit_msg>Add python test of importing Parquet files from S3<commit_after> | import h2o
import os
from h2o.persist import set_s3_credentials
from tests import pyunit_utils
from pandas.testing import assert_frame_equal
def test_import_parquet_from_s3():
access_key_id = os.environ['AWS_ACCESS_KEY_ID']
secret_access_key = os.environ['AWS_SECRET_ACCESS_KEY']
assert access_key_id is ... | Add python test of importing Parquet files from S3import h2o
import os
from h2o.persist import set_s3_credentials
from tests import pyunit_utils
from pandas.testing import assert_frame_equal
def test_import_parquet_from_s3():
access_key_id = os.environ['AWS_ACCESS_KEY_ID']
secret_access_key = os.environ['AW... | <commit_before><commit_msg>Add python test of importing Parquet files from S3<commit_after>import h2o
import os
from h2o.persist import set_s3_credentials
from tests import pyunit_utils
from pandas.testing import assert_frame_equal
def test_import_parquet_from_s3():
access_key_id = os.environ['AWS_ACCESS_KEY_ID... | |
1094ba0a4ee9443e6317e7fba8db8e69f09cfaa3 | pints/tests/test_transformation.py | pints/tests/test_transformation.py | #!/usr/bin/env python3
#
# Tests Transform functions in Pints
#
# This file is part of PINTS (https://github.com/pints-team/pints/) which is
# released under the BSD 3-clause license. See accompanying LICENSE.md for
# copyright notice and full license details.
#
from __future__ import division
import unittest
import pi... | Add first simple transformation tests | Add first simple transformation tests
| Python | bsd-3-clause | martinjrobins/hobo,martinjrobins/hobo,martinjrobins/hobo,martinjrobins/hobo | Add first simple transformation tests | #!/usr/bin/env python3
#
# Tests Transform functions in Pints
#
# This file is part of PINTS (https://github.com/pints-team/pints/) which is
# released under the BSD 3-clause license. See accompanying LICENSE.md for
# copyright notice and full license details.
#
from __future__ import division
import unittest
import pi... | <commit_before><commit_msg>Add first simple transformation tests<commit_after> | #!/usr/bin/env python3
#
# Tests Transform functions in Pints
#
# This file is part of PINTS (https://github.com/pints-team/pints/) which is
# released under the BSD 3-clause license. See accompanying LICENSE.md for
# copyright notice and full license details.
#
from __future__ import division
import unittest
import pi... | Add first simple transformation tests#!/usr/bin/env python3
#
# Tests Transform functions in Pints
#
# This file is part of PINTS (https://github.com/pints-team/pints/) which is
# released under the BSD 3-clause license. See accompanying LICENSE.md for
# copyright notice and full license details.
#
from __future__ impo... | <commit_before><commit_msg>Add first simple transformation tests<commit_after>#!/usr/bin/env python3
#
# Tests Transform functions in Pints
#
# This file is part of PINTS (https://github.com/pints-team/pints/) which is
# released under the BSD 3-clause license. See accompanying LICENSE.md for
# copyright notice and ful... | |
1bab2385382e188c332320b77b86cdf5ac214802 | allegedb/allegedb/tests/test_window.py | allegedb/allegedb/tests/test_window.py | from allegedb.cache import WindowDict
from itertools import cycle
testvs = ['a', 99, ['spam', 'eggs', 'ham'], {'foo': 'bar', 0: 1, '💧': '🔑'}]
testdata = []
for k, v in zip(range(100), cycle(testvs)):
testdata.append((k, v))
windd = WindowDict(testdata)
assert list(range(100)) == list(windd.keys())
for item i... | Add a new test for WindowDict | Add a new test for WindowDict
| Python | agpl-3.0 | LogicalDash/LiSE,LogicalDash/LiSE | Add a new test for WindowDict | from allegedb.cache import WindowDict
from itertools import cycle
testvs = ['a', 99, ['spam', 'eggs', 'ham'], {'foo': 'bar', 0: 1, '💧': '🔑'}]
testdata = []
for k, v in zip(range(100), cycle(testvs)):
testdata.append((k, v))
windd = WindowDict(testdata)
assert list(range(100)) == list(windd.keys())
for item i... | <commit_before><commit_msg>Add a new test for WindowDict<commit_after> | from allegedb.cache import WindowDict
from itertools import cycle
testvs = ['a', 99, ['spam', 'eggs', 'ham'], {'foo': 'bar', 0: 1, '💧': '🔑'}]
testdata = []
for k, v in zip(range(100), cycle(testvs)):
testdata.append((k, v))
windd = WindowDict(testdata)
assert list(range(100)) == list(windd.keys())
for item i... | Add a new test for WindowDictfrom allegedb.cache import WindowDict
from itertools import cycle
testvs = ['a', 99, ['spam', 'eggs', 'ham'], {'foo': 'bar', 0: 1, '💧': '🔑'}]
testdata = []
for k, v in zip(range(100), cycle(testvs)):
testdata.append((k, v))
windd = WindowDict(testdata)
assert list(range(100)) == ... | <commit_before><commit_msg>Add a new test for WindowDict<commit_after>from allegedb.cache import WindowDict
from itertools import cycle
testvs = ['a', 99, ['spam', 'eggs', 'ham'], {'foo': 'bar', 0: 1, '💧': '🔑'}]
testdata = []
for k, v in zip(range(100), cycle(testvs)):
testdata.append((k, v))
windd = WindowDic... | |
2a8fe5b8293dc68628479f1223e2e564d7757b87 | plyer/platforms/android/storagepath.py | plyer/platforms/android/storagepath.py | '''
Android Storage Path
--------------------
'''
from plyer.facades import StoragePath
from jnius import autoclass
from android import mActivity
Environment = autoclass('android.os.Environment')
Context = autoclass('android.content.Context')
class AndroidStoragePath(StoragePath):
def _get_home_dir(self):
... | Add android implementation of storage path | Add android implementation of storage path
| Python | mit | kivy/plyer,kivy/plyer,KeyWeeUsr/plyer,KeyWeeUsr/plyer,kivy/plyer,KeyWeeUsr/plyer | Add android implementation of storage path | '''
Android Storage Path
--------------------
'''
from plyer.facades import StoragePath
from jnius import autoclass
from android import mActivity
Environment = autoclass('android.os.Environment')
Context = autoclass('android.content.Context')
class AndroidStoragePath(StoragePath):
def _get_home_dir(self):
... | <commit_before><commit_msg>Add android implementation of storage path<commit_after> | '''
Android Storage Path
--------------------
'''
from plyer.facades import StoragePath
from jnius import autoclass
from android import mActivity
Environment = autoclass('android.os.Environment')
Context = autoclass('android.content.Context')
class AndroidStoragePath(StoragePath):
def _get_home_dir(self):
... | Add android implementation of storage path'''
Android Storage Path
--------------------
'''
from plyer.facades import StoragePath
from jnius import autoclass
from android import mActivity
Environment = autoclass('android.os.Environment')
Context = autoclass('android.content.Context')
class AndroidStoragePath(Storag... | <commit_before><commit_msg>Add android implementation of storage path<commit_after>'''
Android Storage Path
--------------------
'''
from plyer.facades import StoragePath
from jnius import autoclass
from android import mActivity
Environment = autoclass('android.os.Environment')
Context = autoclass('android.content.Co... | |
c97a0c3d5d5b5354cb4e5f6eb0e134eab89edc85 | pylab/website/tests/test_about_page.py | pylab/website/tests/test_about_page.py | import datetime
from django_webtest import WebTest
from django.contrib.auth.models import User
from pylab.core.models import Event
class AboutPageTests(WebTest):
def setUp(self):
self.user = User.objects.create(username='u1')
def test_no_events_on_about_page(self):
resp = self.app.get('/ab... | Add tests for about page. | Add tests for about page.
| Python | agpl-3.0 | python-dirbtuves/website,python-dirbtuves/website,python-dirbtuves/website | Add tests for about page. | import datetime
from django_webtest import WebTest
from django.contrib.auth.models import User
from pylab.core.models import Event
class AboutPageTests(WebTest):
def setUp(self):
self.user = User.objects.create(username='u1')
def test_no_events_on_about_page(self):
resp = self.app.get('/ab... | <commit_before><commit_msg>Add tests for about page.<commit_after> | import datetime
from django_webtest import WebTest
from django.contrib.auth.models import User
from pylab.core.models import Event
class AboutPageTests(WebTest):
def setUp(self):
self.user = User.objects.create(username='u1')
def test_no_events_on_about_page(self):
resp = self.app.get('/ab... | Add tests for about page.import datetime
from django_webtest import WebTest
from django.contrib.auth.models import User
from pylab.core.models import Event
class AboutPageTests(WebTest):
def setUp(self):
self.user = User.objects.create(username='u1')
def test_no_events_on_about_page(self):
... | <commit_before><commit_msg>Add tests for about page.<commit_after>import datetime
from django_webtest import WebTest
from django.contrib.auth.models import User
from pylab.core.models import Event
class AboutPageTests(WebTest):
def setUp(self):
self.user = User.objects.create(username='u1')
def te... | |
a8c5aa8dba3a9c45ae5933ee53f895f0fa1b2c47 | examples/crab_client.py | examples/crab_client.py | # -*- coding: utf-8 -*-
'''
This script prints all available information on the CRAB webservice.
'''
from crabpy.client import crab_factory
crab = crab_factory()
print crab
| Add example that prints info on the CRAB service. | Add example that prints info on the CRAB service.
| Python | mit | OnroerendErfgoed/crabpy | Add example that prints info on the CRAB service. | # -*- coding: utf-8 -*-
'''
This script prints all available information on the CRAB webservice.
'''
from crabpy.client import crab_factory
crab = crab_factory()
print crab
| <commit_before><commit_msg>Add example that prints info on the CRAB service.<commit_after> | # -*- coding: utf-8 -*-
'''
This script prints all available information on the CRAB webservice.
'''
from crabpy.client import crab_factory
crab = crab_factory()
print crab
| Add example that prints info on the CRAB service.# -*- coding: utf-8 -*-
'''
This script prints all available information on the CRAB webservice.
'''
from crabpy.client import crab_factory
crab = crab_factory()
print crab
| <commit_before><commit_msg>Add example that prints info on the CRAB service.<commit_after># -*- coding: utf-8 -*-
'''
This script prints all available information on the CRAB webservice.
'''
from crabpy.client import crab_factory
crab = crab_factory()
print crab
| |
59e6ad7ce222ad04ba2da64aa6fa20ba0133fac9 | cg-static-condensation/profile_cgsc.py | cg-static-condensation/profile_cgsc.py | from firedrake import *
import sys
parameters["pyop2_options"]["lazy_evaluation"] = False
def is_intstring(s):
try:
int(s)
return True
except ValueError:
return False
# NOTE: ksp_monitor is on to monitor convergence of the
# preconditioned (AMG) Krylov method
if '--scpc' in sys.argv... | Add profile script for comparisons | Add profile script for comparisons
| Python | mit | thomasgibson/tabula-rasa | Add profile script for comparisons | from firedrake import *
import sys
parameters["pyop2_options"]["lazy_evaluation"] = False
def is_intstring(s):
try:
int(s)
return True
except ValueError:
return False
# NOTE: ksp_monitor is on to monitor convergence of the
# preconditioned (AMG) Krylov method
if '--scpc' in sys.argv... | <commit_before><commit_msg>Add profile script for comparisons<commit_after> | from firedrake import *
import sys
parameters["pyop2_options"]["lazy_evaluation"] = False
def is_intstring(s):
try:
int(s)
return True
except ValueError:
return False
# NOTE: ksp_monitor is on to monitor convergence of the
# preconditioned (AMG) Krylov method
if '--scpc' in sys.argv... | Add profile script for comparisonsfrom firedrake import *
import sys
parameters["pyop2_options"]["lazy_evaluation"] = False
def is_intstring(s):
try:
int(s)
return True
except ValueError:
return False
# NOTE: ksp_monitor is on to monitor convergence of the
# preconditioned (AMG) Kry... | <commit_before><commit_msg>Add profile script for comparisons<commit_after>from firedrake import *
import sys
parameters["pyop2_options"]["lazy_evaluation"] = False
def is_intstring(s):
try:
int(s)
return True
except ValueError:
return False
# NOTE: ksp_monitor is on to monitor conv... | |
6db2328cee6d26d0db7a6abf4a58adb40b583799 | sym/tests/test_cse.py | sym/tests/test_cse.py | from .. import Backend
import pytest
backends = []
for bk in Backend.backends.keys():
try:
_be = Backend(bk)
except ImportError:
continue
_x = _be.Symbol('x')
try:
_be.cse([_x])
except:
continue
backends.append(bk)
def _inverse_cse(subs_cses, cse_exprs):
... | Add tests for cse for all supporting backends | Add tests for cse for all supporting backends
| Python | bsd-2-clause | bjodah/sym,bjodah/sym | Add tests for cse for all supporting backends | from .. import Backend
import pytest
backends = []
for bk in Backend.backends.keys():
try:
_be = Backend(bk)
except ImportError:
continue
_x = _be.Symbol('x')
try:
_be.cse([_x])
except:
continue
backends.append(bk)
def _inverse_cse(subs_cses, cse_exprs):
... | <commit_before><commit_msg>Add tests for cse for all supporting backends<commit_after> | from .. import Backend
import pytest
backends = []
for bk in Backend.backends.keys():
try:
_be = Backend(bk)
except ImportError:
continue
_x = _be.Symbol('x')
try:
_be.cse([_x])
except:
continue
backends.append(bk)
def _inverse_cse(subs_cses, cse_exprs):
... | Add tests for cse for all supporting backendsfrom .. import Backend
import pytest
backends = []
for bk in Backend.backends.keys():
try:
_be = Backend(bk)
except ImportError:
continue
_x = _be.Symbol('x')
try:
_be.cse([_x])
except:
continue
backends.append(bk)
... | <commit_before><commit_msg>Add tests for cse for all supporting backends<commit_after>from .. import Backend
import pytest
backends = []
for bk in Backend.backends.keys():
try:
_be = Backend(bk)
except ImportError:
continue
_x = _be.Symbol('x')
try:
_be.cse([_x])
except:
... | |
ba09c70dd02747cead96232a5b51c7b56a640df2 | docker/scripts/test-flask-mail-smtp.py | docker/scripts/test-flask-mail-smtp.py | import argparse, sys
from pybossa.core import create_app
from flask_mail import Mail
from flask_mail import Message
if __name__ == '__main__':
arg_parser = argparse.ArgumentParser()
arg_parser.add_argument('-s', '--from', dest='sender')
arg_parser.add_argument('-t', '--to')
args = arg_parser.parse_arg... | Add script to test sending email with Pybossa Flask-Mail config. | Add script to test sending email with Pybossa Flask-Mail config.
| Python | apache-2.0 | Goodly/pybossa-build,Goodly/pybossa-build | Add script to test sending email with Pybossa Flask-Mail config. | import argparse, sys
from pybossa.core import create_app
from flask_mail import Mail
from flask_mail import Message
if __name__ == '__main__':
arg_parser = argparse.ArgumentParser()
arg_parser.add_argument('-s', '--from', dest='sender')
arg_parser.add_argument('-t', '--to')
args = arg_parser.parse_arg... | <commit_before><commit_msg>Add script to test sending email with Pybossa Flask-Mail config.<commit_after> | import argparse, sys
from pybossa.core import create_app
from flask_mail import Mail
from flask_mail import Message
if __name__ == '__main__':
arg_parser = argparse.ArgumentParser()
arg_parser.add_argument('-s', '--from', dest='sender')
arg_parser.add_argument('-t', '--to')
args = arg_parser.parse_arg... | Add script to test sending email with Pybossa Flask-Mail config.import argparse, sys
from pybossa.core import create_app
from flask_mail import Mail
from flask_mail import Message
if __name__ == '__main__':
arg_parser = argparse.ArgumentParser()
arg_parser.add_argument('-s', '--from', dest='sender')
arg_p... | <commit_before><commit_msg>Add script to test sending email with Pybossa Flask-Mail config.<commit_after>import argparse, sys
from pybossa.core import create_app
from flask_mail import Mail
from flask_mail import Message
if __name__ == '__main__':
arg_parser = argparse.ArgumentParser()
arg_parser.add_argument... | |
3481f5d11a0ff51c510e599bb3ff72ddff9be622 | scripts/Parallelize.py | scripts/Parallelize.py | #!/usr/bin/env python3
import argparse
import datetime
import multiprocessing
import os
import subprocess
import sys
import time
def main():
#Parse arguments
parser = argparse.ArgumentParser(description='Parallize helper script.')
parser.add_argument('run_script', help='Find to do comments.')
parser.add_argument(... | Add single machine parallelism helper script | Add single machine parallelism helper script
| Python | mit | AgalmicVentures/Environment,AgalmicVentures/Environment,AgalmicVentures/Environment | Add single machine parallelism helper script | #!/usr/bin/env python3
import argparse
import datetime
import multiprocessing
import os
import subprocess
import sys
import time
def main():
#Parse arguments
parser = argparse.ArgumentParser(description='Parallize helper script.')
parser.add_argument('run_script', help='Find to do comments.')
parser.add_argument(... | <commit_before><commit_msg>Add single machine parallelism helper script<commit_after> | #!/usr/bin/env python3
import argparse
import datetime
import multiprocessing
import os
import subprocess
import sys
import time
def main():
#Parse arguments
parser = argparse.ArgumentParser(description='Parallize helper script.')
parser.add_argument('run_script', help='Find to do comments.')
parser.add_argument(... | Add single machine parallelism helper script#!/usr/bin/env python3
import argparse
import datetime
import multiprocessing
import os
import subprocess
import sys
import time
def main():
#Parse arguments
parser = argparse.ArgumentParser(description='Parallize helper script.')
parser.add_argument('run_script', help='... | <commit_before><commit_msg>Add single machine parallelism helper script<commit_after>#!/usr/bin/env python3
import argparse
import datetime
import multiprocessing
import os
import subprocess
import sys
import time
def main():
#Parse arguments
parser = argparse.ArgumentParser(description='Parallize helper script.')
... | |
d82b1f9d7334c1cd976624788da785a87cd5db8a | functional/tests/volume/v1/test_qos.py | functional/tests/volume/v1/test_qos.py | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | Add functional tests for volume qos | Add functional tests for volume qos
Change-Id: I80010b56b399bc027ac864304be60a3ee53bda00
| Python | apache-2.0 | openstack/python-openstackclient,redhat-openstack/python-openstackclient,BjoernT/python-openstackclient,BjoernT/python-openstackclient,openstack/python-openstackclient,dtroyer/python-openstackclient,redhat-openstack/python-openstackclient,dtroyer/python-openstackclient | Add functional tests for volume qos
Change-Id: I80010b56b399bc027ac864304be60a3ee53bda00 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | <commit_before><commit_msg>Add functional tests for volume qos
Change-Id: I80010b56b399bc027ac864304be60a3ee53bda00<commit_after> | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | Add functional tests for volume qos
Change-Id: I80010b56b399bc027ac864304be60a3ee53bda00# 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/LICE... | <commit_before><commit_msg>Add functional tests for volume qos
Change-Id: I80010b56b399bc027ac864304be60a3ee53bda00<commit_after># Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# ... | |
66f2a65ae393ffe1398c5d34f036940aebd170d3 | tools/send-webhook.py | tools/send-webhook.py | #!/bin/env python3
# Copyright 2016 Ruud van Asseldonk
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3. See
# the licence file in the root of the repository.
from json import dumps
from sys import argv
from urllib.error import H... | Add script to test webhooks | Add script to test webhooks
Searching for the right curl commands through my shell history gets
tedious. Let's add a bit of automation.
| Python | apache-2.0 | ruuda/hoff,ruuda/hoff | Add script to test webhooks
Searching for the right curl commands through my shell history gets
tedious. Let's add a bit of automation. | #!/bin/env python3
# Copyright 2016 Ruud van Asseldonk
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3. See
# the licence file in the root of the repository.
from json import dumps
from sys import argv
from urllib.error import H... | <commit_before><commit_msg>Add script to test webhooks
Searching for the right curl commands through my shell history gets
tedious. Let's add a bit of automation.<commit_after> | #!/bin/env python3
# Copyright 2016 Ruud van Asseldonk
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3. See
# the licence file in the root of the repository.
from json import dumps
from sys import argv
from urllib.error import H... | Add script to test webhooks
Searching for the right curl commands through my shell history gets
tedious. Let's add a bit of automation.#!/bin/env python3
# Copyright 2016 Ruud van Asseldonk
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License ... | <commit_before><commit_msg>Add script to test webhooks
Searching for the right curl commands through my shell history gets
tedious. Let's add a bit of automation.<commit_after>#!/bin/env python3
# Copyright 2016 Ruud van Asseldonk
#
# This program is free software: you can redistribute it and/or modify
# it under the... | |
d98ea2f891940a0251a470a8373dfc1b7df3b036 | test/test_sanity.py | test/test_sanity.py | #!/usr/bin/env python2
import unittest
class TestSanity(unittest.TestCase):
def setUp(self):
self.right_answer = 4
def test_sanity(self):
self.assertEqual(2 + 2, self.right_answer)
if __name__ == '__main__':
unittest.main()
| Add an extremely simple "sanity test" to the test suite. | Add an extremely simple "sanity test" to the test suite.
| Python | bsd-3-clause | blindsighttf2/Astron,pizcogirl/Astron,pizcogirl/Astron,ketoo/Astron,blindsighttf2/Astron,blindsighttf2/Astron,ketoo/Astron,pizcogirl/Astron,ketoo/Astron,blindsighttf2/Astron,ketoo/Astron,pizcogirl/Astron | Add an extremely simple "sanity test" to the test suite. | #!/usr/bin/env python2
import unittest
class TestSanity(unittest.TestCase):
def setUp(self):
self.right_answer = 4
def test_sanity(self):
self.assertEqual(2 + 2, self.right_answer)
if __name__ == '__main__':
unittest.main()
| <commit_before><commit_msg>Add an extremely simple "sanity test" to the test suite.<commit_after> | #!/usr/bin/env python2
import unittest
class TestSanity(unittest.TestCase):
def setUp(self):
self.right_answer = 4
def test_sanity(self):
self.assertEqual(2 + 2, self.right_answer)
if __name__ == '__main__':
unittest.main()
| Add an extremely simple "sanity test" to the test suite.#!/usr/bin/env python2
import unittest
class TestSanity(unittest.TestCase):
def setUp(self):
self.right_answer = 4
def test_sanity(self):
self.assertEqual(2 + 2, self.right_answer)
if __name__ == '__main__':
unittest.main()
| <commit_before><commit_msg>Add an extremely simple "sanity test" to the test suite.<commit_after>#!/usr/bin/env python2
import unittest
class TestSanity(unittest.TestCase):
def setUp(self):
self.right_answer = 4
def test_sanity(self):
self.assertEqual(2 + 2, self.right_answer)
if __name__ ==... | |
ddcc269f0f3a7d0e2e2505b0700197e4a4500984 | contentcuration/contentcuration/collectstatic_settings.py | contentcuration/contentcuration/collectstatic_settings.py | # Settings used by containers running collectstatic. Scope our services
# to the only ones needed to run collectstatic.
from .settings import *
CACHES['default']['BACKEND'] = "django_prometheus.cache.backends.locmem.LocMemCache"
| Make a special settings file for collectstatic | Make a special settings file for collectstatic
This is useful to minimize the services needed by a collectstatic container
| Python | mit | DXCanas/content-curation,DXCanas/content-curation,DXCanas/content-curation,DXCanas/content-curation | Make a special settings file for collectstatic
This is useful to minimize the services needed by a collectstatic container | # Settings used by containers running collectstatic. Scope our services
# to the only ones needed to run collectstatic.
from .settings import *
CACHES['default']['BACKEND'] = "django_prometheus.cache.backends.locmem.LocMemCache"
| <commit_before><commit_msg>Make a special settings file for collectstatic
This is useful to minimize the services needed by a collectstatic container<commit_after> | # Settings used by containers running collectstatic. Scope our services
# to the only ones needed to run collectstatic.
from .settings import *
CACHES['default']['BACKEND'] = "django_prometheus.cache.backends.locmem.LocMemCache"
| Make a special settings file for collectstatic
This is useful to minimize the services needed by a collectstatic container# Settings used by containers running collectstatic. Scope our services
# to the only ones needed to run collectstatic.
from .settings import *
CACHES['default']['BACKEND'] = "django_prometheus.... | <commit_before><commit_msg>Make a special settings file for collectstatic
This is useful to minimize the services needed by a collectstatic container<commit_after># Settings used by containers running collectstatic. Scope our services
# to the only ones needed to run collectstatic.
from .settings import *
CACHES['d... | |
0edf160f3f12697d896721eb86ff09052fdb1126 | tests/test_flask.py | tests/test_flask.py | import os
import socket
from webtest import TestApp
from nose.tools import eq_, assert_raises
from mock import MagicMock, patch
from flask import Flask
from bugsnag.six import Iterator
from bugsnag.flask import handle_exceptions
import bugsnag.notification
bugsnag.configuration.api_key = '066f5ad3590596f9aa8d601ea89a... | Add some tests for flask integration | Add some tests for flask integration
| Python | mit | overplumbum/bugsnag-python,bugsnag/bugsnag-python,overplumbum/bugsnag-python,bugsnag/bugsnag-python | Add some tests for flask integration | import os
import socket
from webtest import TestApp
from nose.tools import eq_, assert_raises
from mock import MagicMock, patch
from flask import Flask
from bugsnag.six import Iterator
from bugsnag.flask import handle_exceptions
import bugsnag.notification
bugsnag.configuration.api_key = '066f5ad3590596f9aa8d601ea89a... | <commit_before><commit_msg>Add some tests for flask integration<commit_after> | import os
import socket
from webtest import TestApp
from nose.tools import eq_, assert_raises
from mock import MagicMock, patch
from flask import Flask
from bugsnag.six import Iterator
from bugsnag.flask import handle_exceptions
import bugsnag.notification
bugsnag.configuration.api_key = '066f5ad3590596f9aa8d601ea89a... | Add some tests for flask integrationimport os
import socket
from webtest import TestApp
from nose.tools import eq_, assert_raises
from mock import MagicMock, patch
from flask import Flask
from bugsnag.six import Iterator
from bugsnag.flask import handle_exceptions
import bugsnag.notification
bugsnag.configuration.api... | <commit_before><commit_msg>Add some tests for flask integration<commit_after>import os
import socket
from webtest import TestApp
from nose.tools import eq_, assert_raises
from mock import MagicMock, patch
from flask import Flask
from bugsnag.six import Iterator
from bugsnag.flask import handle_exceptions
import bugsna... | |
a75cecd0291067cf8ce7624e4c929b64e2388052 | tests/unit/fakes.py | tests/unit/fakes.py | # Copyright 2012 Intel Inc, OpenStack LLC.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless... | Add common base weigher/weigher handler for filter scheduler | Add common base weigher/weigher handler for filter scheduler
Filter scheduler is being used for more than one core projects (Nova
and Cinder as of writing), the implementation shared a lot of common
code. This patch is to move base weigher (weighing function), weigher
handler for filter scheduler into oslo to reduce p... | Python | apache-2.0 | openstack/oslo.i18n,varunarya10/oslo.i18n | Add common base weigher/weigher handler for filter scheduler
Filter scheduler is being used for more than one core projects (Nova
and Cinder as of writing), the implementation shared a lot of common
code. This patch is to move base weigher (weighing function), weigher
handler for filter scheduler into oslo to reduce p... | # Copyright 2012 Intel Inc, OpenStack LLC.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless... | <commit_before><commit_msg>Add common base weigher/weigher handler for filter scheduler
Filter scheduler is being used for more than one core projects (Nova
and Cinder as of writing), the implementation shared a lot of common
code. This patch is to move base weigher (weighing function), weigher
handler for filter sche... | # Copyright 2012 Intel Inc, OpenStack LLC.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless... | Add common base weigher/weigher handler for filter scheduler
Filter scheduler is being used for more than one core projects (Nova
and Cinder as of writing), the implementation shared a lot of common
code. This patch is to move base weigher (weighing function), weigher
handler for filter scheduler into oslo to reduce p... | <commit_before><commit_msg>Add common base weigher/weigher handler for filter scheduler
Filter scheduler is being used for more than one core projects (Nova
and Cinder as of writing), the implementation shared a lot of common
code. This patch is to move base weigher (weighing function), weigher
handler for filter sche... | |
e3958525303be01b2800c48a494b586f62f74393 | tests/test_command.py | tests/test_command.py | # -*- coding: utf-8 -*-
from tornado.httpclient import AsyncHTTPClient
from tornado.testing import gen_test, AsyncTestCase
from blackgate import Command, component
class TestCommand(AsyncTestCase):
def setUp(self):
super(TestCommand, self).setUp()
component.pools.register_pool('test_command', max... | Test command fallback and queue. | Test command fallback and queue.
| Python | mit | soasme/blackgate | Test command fallback and queue. | # -*- coding: utf-8 -*-
from tornado.httpclient import AsyncHTTPClient
from tornado.testing import gen_test, AsyncTestCase
from blackgate import Command, component
class TestCommand(AsyncTestCase):
def setUp(self):
super(TestCommand, self).setUp()
component.pools.register_pool('test_command', max... | <commit_before><commit_msg>Test command fallback and queue.<commit_after> | # -*- coding: utf-8 -*-
from tornado.httpclient import AsyncHTTPClient
from tornado.testing import gen_test, AsyncTestCase
from blackgate import Command, component
class TestCommand(AsyncTestCase):
def setUp(self):
super(TestCommand, self).setUp()
component.pools.register_pool('test_command', max... | Test command fallback and queue.# -*- coding: utf-8 -*-
from tornado.httpclient import AsyncHTTPClient
from tornado.testing import gen_test, AsyncTestCase
from blackgate import Command, component
class TestCommand(AsyncTestCase):
def setUp(self):
super(TestCommand, self).setUp()
component.pools.r... | <commit_before><commit_msg>Test command fallback and queue.<commit_after># -*- coding: utf-8 -*-
from tornado.httpclient import AsyncHTTPClient
from tornado.testing import gen_test, AsyncTestCase
from blackgate import Command, component
class TestCommand(AsyncTestCase):
def setUp(self):
super(TestCommand... | |
62d1e162cdc34cf6b361b5334625323d9d13c7ed | possel/resources.py | possel/resources.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
possel.resources
----------------
This module defines a tornado-based RESTful (? - I don't know shit about REST) API for fetching the state of the possel
system over HTTP. This is coupled with a real time push mechanism that will be used to inform the client of new
res... | Add basic web api server | Add basic web api server
So far allows you to get and send lines but that's about it. Still, this means I can actually make pircel say shit \o/
| Python | bsd-3-clause | possel/possel,possel/possel,possel/possel,possel/possel | Add basic web api server
So far allows you to get and send lines but that's about it. Still, this means I can actually make pircel say shit \o/ | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
possel.resources
----------------
This module defines a tornado-based RESTful (? - I don't know shit about REST) API for fetching the state of the possel
system over HTTP. This is coupled with a real time push mechanism that will be used to inform the client of new
res... | <commit_before><commit_msg>Add basic web api server
So far allows you to get and send lines but that's about it. Still, this means I can actually make pircel say shit \o/<commit_after> | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
possel.resources
----------------
This module defines a tornado-based RESTful (? - I don't know shit about REST) API for fetching the state of the possel
system over HTTP. This is coupled with a real time push mechanism that will be used to inform the client of new
res... | Add basic web api server
So far allows you to get and send lines but that's about it. Still, this means I can actually make pircel say shit \o/#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
possel.resources
----------------
This module defines a tornado-based RESTful (? - I don't know shit about REST) API for fetc... | <commit_before><commit_msg>Add basic web api server
So far allows you to get and send lines but that's about it. Still, this means I can actually make pircel say shit \o/<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
possel.resources
----------------
This module defines a tornado-based RESTful (? - I... | |
4a6073e6c84391d9e67e08603b3ce429a4f58db4 | util/rom-ext-manifest-generator.py | util/rom-ext-manifest-generator.py | #!/usr/bin/env python3
# Copyright lowRISC contributors.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
import argparse
from pathlib import Path
import hjson
from mako.template import Template
from topgen.c import MemoryRegion, Name
DESC = """ROM_EXT... | Add python ROM_EXT manifest generator | [util] Add python ROM_EXT manifest generator
This script takes .hjson input file that contains ROM_EXT manifest
metadata. This metadata is parsed and fed into the mako that uses it
together with the template file to produce C header.
In future we could add the asm template to generate the `.S` file.
Signed-off-by: S... | Python | apache-2.0 | lowRISC/opentitan,lowRISC/opentitan,lowRISC/opentitan,lowRISC/opentitan,lowRISC/opentitan,lowRISC/opentitan | [util] Add python ROM_EXT manifest generator
This script takes .hjson input file that contains ROM_EXT manifest
metadata. This metadata is parsed and fed into the mako that uses it
together with the template file to produce C header.
In future we could add the asm template to generate the `.S` file.
Signed-off-by: S... | #!/usr/bin/env python3
# Copyright lowRISC contributors.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
import argparse
from pathlib import Path
import hjson
from mako.template import Template
from topgen.c import MemoryRegion, Name
DESC = """ROM_EXT... | <commit_before><commit_msg>[util] Add python ROM_EXT manifest generator
This script takes .hjson input file that contains ROM_EXT manifest
metadata. This metadata is parsed and fed into the mako that uses it
together with the template file to produce C header.
In future we could add the asm template to generate the `... | #!/usr/bin/env python3
# Copyright lowRISC contributors.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
import argparse
from pathlib import Path
import hjson
from mako.template import Template
from topgen.c import MemoryRegion, Name
DESC = """ROM_EXT... | [util] Add python ROM_EXT manifest generator
This script takes .hjson input file that contains ROM_EXT manifest
metadata. This metadata is parsed and fed into the mako that uses it
together with the template file to produce C header.
In future we could add the asm template to generate the `.S` file.
Signed-off-by: S... | <commit_before><commit_msg>[util] Add python ROM_EXT manifest generator
This script takes .hjson input file that contains ROM_EXT manifest
metadata. This metadata is parsed and fed into the mako that uses it
together with the template file to produce C header.
In future we could add the asm template to generate the `... | |
ebd34d996dc49679c232b40db44114f10fdb6c58 | scripts/tests/test_preprint_summary.py | scripts/tests/test_preprint_summary.py | import datetime
from tests.base import OsfTestCase
from osf_tests.factories import PreprintFactory, PreprintProviderFactory
from osf.models import PreprintService
from nose.tools import * # PEP8 asserts
from django.utils import timezone
from scripts.analytics.preprint_summary import PreprintSummary
class TestPrep... | Add test for Keen script for Preprint providers. | Add test for Keen script for Preprint providers.
| Python | apache-2.0 | HalcyonChimera/osf.io,TomBaxter/osf.io,adlius/osf.io,mfraezz/osf.io,caneruguz/osf.io,mattclark/osf.io,Johnetordoff/osf.io,Johnetordoff/osf.io,chennan47/osf.io,leb2dg/osf.io,felliott/osf.io,adlius/osf.io,chrisseto/osf.io,sloria/osf.io,caseyrollins/osf.io,icereval/osf.io,erinspace/osf.io,felliott/osf.io,caseyrollins/osf.... | Add test for Keen script for Preprint providers. | import datetime
from tests.base import OsfTestCase
from osf_tests.factories import PreprintFactory, PreprintProviderFactory
from osf.models import PreprintService
from nose.tools import * # PEP8 asserts
from django.utils import timezone
from scripts.analytics.preprint_summary import PreprintSummary
class TestPrep... | <commit_before><commit_msg>Add test for Keen script for Preprint providers.<commit_after> | import datetime
from tests.base import OsfTestCase
from osf_tests.factories import PreprintFactory, PreprintProviderFactory
from osf.models import PreprintService
from nose.tools import * # PEP8 asserts
from django.utils import timezone
from scripts.analytics.preprint_summary import PreprintSummary
class TestPrep... | Add test for Keen script for Preprint providers.import datetime
from tests.base import OsfTestCase
from osf_tests.factories import PreprintFactory, PreprintProviderFactory
from osf.models import PreprintService
from nose.tools import * # PEP8 asserts
from django.utils import timezone
from scripts.analytics.preprint_... | <commit_before><commit_msg>Add test for Keen script for Preprint providers.<commit_after>import datetime
from tests.base import OsfTestCase
from osf_tests.factories import PreprintFactory, PreprintProviderFactory
from osf.models import PreprintService
from nose.tools import * # PEP8 asserts
from django.utils import t... | |
fabcc39144e727c5c840554e229eb8f7ddd1e944 | Software/Python/grove_thumb_joystick.py | Software/Python/grove_thumb_joystick.py | # GrovePi + Grove Thumb Joystick
# http://www.seeedstudio.com/wiki/Grove_-_Thumb_Joystick
import time
import grovepi
# Connect the Thumb Joystick to analog port A0
# Uses two pins - one for the X axis and one for the Y axis
grovepi.pinMode(0,"INPUT")
grovepi.pinMode(1,"INPUT")
# The Thumb Joystick is an... | Add Grove Thumb Joystick example | Add Grove Thumb Joystick example
| Python | mit | NeuroRoboticTech/Jetduino,stwolny/GrovePi,karan259/GrovePi,karan259/GrovePi,karan259/GrovePi,NeuroRoboticTech/Jetduino,stwolny/GrovePi,stwolny/GrovePi,penoud/GrovePi,NeuroRoboticTech/Jetduino,rpedersen/GrovePi,karan259/GrovePi,penoud/GrovePi,rpedersen/GrovePi,stwolny/GrovePi,rpedersen/GrovePi,karan259/GrovePi,stwolny/G... | Add Grove Thumb Joystick example | # GrovePi + Grove Thumb Joystick
# http://www.seeedstudio.com/wiki/Grove_-_Thumb_Joystick
import time
import grovepi
# Connect the Thumb Joystick to analog port A0
# Uses two pins - one for the X axis and one for the Y axis
grovepi.pinMode(0,"INPUT")
grovepi.pinMode(1,"INPUT")
# The Thumb Joystick is an... | <commit_before><commit_msg>Add Grove Thumb Joystick example<commit_after> | # GrovePi + Grove Thumb Joystick
# http://www.seeedstudio.com/wiki/Grove_-_Thumb_Joystick
import time
import grovepi
# Connect the Thumb Joystick to analog port A0
# Uses two pins - one for the X axis and one for the Y axis
grovepi.pinMode(0,"INPUT")
grovepi.pinMode(1,"INPUT")
# The Thumb Joystick is an... | Add Grove Thumb Joystick example# GrovePi + Grove Thumb Joystick
# http://www.seeedstudio.com/wiki/Grove_-_Thumb_Joystick
import time
import grovepi
# Connect the Thumb Joystick to analog port A0
# Uses two pins - one for the X axis and one for the Y axis
grovepi.pinMode(0,"INPUT")
grovepi.pinMode(1,"INPUT... | <commit_before><commit_msg>Add Grove Thumb Joystick example<commit_after># GrovePi + Grove Thumb Joystick
# http://www.seeedstudio.com/wiki/Grove_-_Thumb_Joystick
import time
import grovepi
# Connect the Thumb Joystick to analog port A0
# Uses two pins - one for the X axis and one for the Y axis
grovepi.pin... | |
856cbe9049375ce277c4b3de2efa70fc4d68af4b | dakotathon/tests/test_run_component.py | dakotathon/tests/test_run_component.py | #!/usr/bin/env python
import os
import sys
import shutil
from nose.tools import raises, with_setup
from dakotathon.run_component import run_component, main
from dakotathon.dakota import Dakota
from . import start_dir, data_dir
run_dir = os.getcwd()
local_config_file = 'config.yaml'
config_file = os.path.join(data_di... | Create initial unit tests for run_component module | Create initial unit tests for run_component module
| Python | mit | csdms/dakota,csdms/dakota | Create initial unit tests for run_component module | #!/usr/bin/env python
import os
import sys
import shutil
from nose.tools import raises, with_setup
from dakotathon.run_component import run_component, main
from dakotathon.dakota import Dakota
from . import start_dir, data_dir
run_dir = os.getcwd()
local_config_file = 'config.yaml'
config_file = os.path.join(data_di... | <commit_before><commit_msg>Create initial unit tests for run_component module<commit_after> | #!/usr/bin/env python
import os
import sys
import shutil
from nose.tools import raises, with_setup
from dakotathon.run_component import run_component, main
from dakotathon.dakota import Dakota
from . import start_dir, data_dir
run_dir = os.getcwd()
local_config_file = 'config.yaml'
config_file = os.path.join(data_di... | Create initial unit tests for run_component module#!/usr/bin/env python
import os
import sys
import shutil
from nose.tools import raises, with_setup
from dakotathon.run_component import run_component, main
from dakotathon.dakota import Dakota
from . import start_dir, data_dir
run_dir = os.getcwd()
local_config_file ... | <commit_before><commit_msg>Create initial unit tests for run_component module<commit_after>#!/usr/bin/env python
import os
import sys
import shutil
from nose.tools import raises, with_setup
from dakotathon.run_component import run_component, main
from dakotathon.dakota import Dakota
from . import start_dir, data_dir
... | |
383784ca4533314d3313ca4901f70dcac40e776a | migrations/0.0.1.1/pre-0001_delete_inactive_investments.py | migrations/0.0.1.1/pre-0001_delete_inactive_investments.py | # coding=utf-8
from oopgrade import oopgrade
import netsvc
def up(cursor, installed_version):
logger= netsvc.Logger()
print "somenergia-generationkwh_0.0.1.1: Hem entrat al UP"
if not installed_version:
return
logger.notifyChannel('migration', netsvc.LOG_INFO, 'Changing ir_model_data from gis... | Add pre-script migration generationkwh module | Add pre-script migration generationkwh module
| Python | agpl-3.0 | Som-Energia/somenergia-generationkwh,Som-Energia/somenergia-generationkwh | Add pre-script migration generationkwh module | # coding=utf-8
from oopgrade import oopgrade
import netsvc
def up(cursor, installed_version):
logger= netsvc.Logger()
print "somenergia-generationkwh_0.0.1.1: Hem entrat al UP"
if not installed_version:
return
logger.notifyChannel('migration', netsvc.LOG_INFO, 'Changing ir_model_data from gis... | <commit_before><commit_msg>Add pre-script migration generationkwh module<commit_after> | # coding=utf-8
from oopgrade import oopgrade
import netsvc
def up(cursor, installed_version):
logger= netsvc.Logger()
print "somenergia-generationkwh_0.0.1.1: Hem entrat al UP"
if not installed_version:
return
logger.notifyChannel('migration', netsvc.LOG_INFO, 'Changing ir_model_data from gis... | Add pre-script migration generationkwh module# coding=utf-8
from oopgrade import oopgrade
import netsvc
def up(cursor, installed_version):
logger= netsvc.Logger()
print "somenergia-generationkwh_0.0.1.1: Hem entrat al UP"
if not installed_version:
return
logger.notifyChannel('migration', nets... | <commit_before><commit_msg>Add pre-script migration generationkwh module<commit_after># coding=utf-8
from oopgrade import oopgrade
import netsvc
def up(cursor, installed_version):
logger= netsvc.Logger()
print "somenergia-generationkwh_0.0.1.1: Hem entrat al UP"
if not installed_version:
return
... | |
4226b7d1df34d61e948d435272964d4665c63836 | tmp_gen.py | tmp_gen.py | import joblib
path_dict = joblib.load('data/filepath_dict.txt')
def tmp_gen():
for i in range(len(path_dict)):
path = path_dict[i]
with open(path) as document_file:
yield document_file.read()
| Add temporary corpus document generator - toolset need to be reworked. | Add temporary corpus document generator - toolset need to be reworked.
| Python | mit | theovasi/browsewiki,theovasi/browsewiki,theovasi/browsewiki | Add temporary corpus document generator - toolset need to be reworked. | import joblib
path_dict = joblib.load('data/filepath_dict.txt')
def tmp_gen():
for i in range(len(path_dict)):
path = path_dict[i]
with open(path) as document_file:
yield document_file.read()
| <commit_before><commit_msg>Add temporary corpus document generator - toolset need to be reworked.<commit_after> | import joblib
path_dict = joblib.load('data/filepath_dict.txt')
def tmp_gen():
for i in range(len(path_dict)):
path = path_dict[i]
with open(path) as document_file:
yield document_file.read()
| Add temporary corpus document generator - toolset need to be reworked.import joblib
path_dict = joblib.load('data/filepath_dict.txt')
def tmp_gen():
for i in range(len(path_dict)):
path = path_dict[i]
with open(path) as document_file:
yield document_file.read()
| <commit_before><commit_msg>Add temporary corpus document generator - toolset need to be reworked.<commit_after>import joblib
path_dict = joblib.load('data/filepath_dict.txt')
def tmp_gen():
for i in range(len(path_dict)):
path = path_dict[i]
with open(path) as document_file:
yield docu... | |
b864b771f57dbef9a26fbb7acd864f113bdeab96 | tests/test_missingmigrations.py | tests/test_missingmigrations.py | import cStringIO
from django.test import TestCase
from django.core.management import call_command
class MissingMigrationTest(TestCase):
def test_for_missing_migrations(self):
out = cStringIO.StringIO()
call_command('makemigrations', '--dry-run',
verbocity=3, interactive=Fal... | Add a test for missing migrations. | Add a test for missing migrations.
This commit detects missing migrations by running makemigrations
with the --dry-run flag and checking for the 'No changes detected'
message on stdout. Otherwise, the error includes information on
the migrations that are missing.
| Python | mit | jrief/djangocms-cascade,jrief/djangocms-cascade,haricot/djangocms-bs4forcascade,haricot/djangocms-bs4forcascade,jrief/djangocms-cascade | Add a test for missing migrations.
This commit detects missing migrations by running makemigrations
with the --dry-run flag and checking for the 'No changes detected'
message on stdout. Otherwise, the error includes information on
the migrations that are missing. | import cStringIO
from django.test import TestCase
from django.core.management import call_command
class MissingMigrationTest(TestCase):
def test_for_missing_migrations(self):
out = cStringIO.StringIO()
call_command('makemigrations', '--dry-run',
verbocity=3, interactive=Fal... | <commit_before><commit_msg>Add a test for missing migrations.
This commit detects missing migrations by running makemigrations
with the --dry-run flag and checking for the 'No changes detected'
message on stdout. Otherwise, the error includes information on
the migrations that are missing.<commit_after> | import cStringIO
from django.test import TestCase
from django.core.management import call_command
class MissingMigrationTest(TestCase):
def test_for_missing_migrations(self):
out = cStringIO.StringIO()
call_command('makemigrations', '--dry-run',
verbocity=3, interactive=Fal... | Add a test for missing migrations.
This commit detects missing migrations by running makemigrations
with the --dry-run flag and checking for the 'No changes detected'
message on stdout. Otherwise, the error includes information on
the migrations that are missing.import cStringIO
from django.test import TestCase
from... | <commit_before><commit_msg>Add a test for missing migrations.
This commit detects missing migrations by running makemigrations
with the --dry-run flag and checking for the 'No changes detected'
message on stdout. Otherwise, the error includes information on
the migrations that are missing.<commit_after>import cString... | |
c7a1b733ab274381fa01c96ffc5bf16967a721e5 | tests/unit/modules/test_ansiblegate.py | tests/unit/modules/test_ansiblegate.py | # -*- coding: utf-8 -*-
#
# Author: Bo Maryniuk <bo@suse.de>
#
# Copyright 2017 SUSE 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
#
# Unles... | Add scaffold for the unit test | Add scaffold for the unit test
| Python | apache-2.0 | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | Add scaffold for the unit test | # -*- coding: utf-8 -*-
#
# Author: Bo Maryniuk <bo@suse.de>
#
# Copyright 2017 SUSE 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
#
# Unles... | <commit_before><commit_msg>Add scaffold for the unit test<commit_after> | # -*- coding: utf-8 -*-
#
# Author: Bo Maryniuk <bo@suse.de>
#
# Copyright 2017 SUSE 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
#
# Unles... | Add scaffold for the unit test# -*- coding: utf-8 -*-
#
# Author: Bo Maryniuk <bo@suse.de>
#
# Copyright 2017 SUSE 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/... | <commit_before><commit_msg>Add scaffold for the unit test<commit_after># -*- coding: utf-8 -*-
#
# Author: Bo Maryniuk <bo@suse.de>
#
# Copyright 2017 SUSE 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 ... | |
336f3ab701dc5b50e5ba65b7789029e6cf403d4e | fetsy/migrations/0005_ticket_reminder.py | fetsy/migrations/0005_ticket_reminder.py | from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('fetsy', '0004_tags'),
]
operations = [
migrations.AddField(
model_name='ticket',
name='reminder',
field=models.PositiveIntegerField(verbose_name='Remind ... | Add migrations for reminder field. | Add migrations for reminder field.
| Python | mit | normanjaeckel/FeTSy,normanjaeckel/FeTSy,normanjaeckel/FeTSy | Add migrations for reminder field. | from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('fetsy', '0004_tags'),
]
operations = [
migrations.AddField(
model_name='ticket',
name='reminder',
field=models.PositiveIntegerField(verbose_name='Remind ... | <commit_before><commit_msg>Add migrations for reminder field.<commit_after> | from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('fetsy', '0004_tags'),
]
operations = [
migrations.AddField(
model_name='ticket',
name='reminder',
field=models.PositiveIntegerField(verbose_name='Remind ... | Add migrations for reminder field.from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('fetsy', '0004_tags'),
]
operations = [
migrations.AddField(
model_name='ticket',
name='reminder',
field=models.Positive... | <commit_before><commit_msg>Add migrations for reminder field.<commit_after>from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('fetsy', '0004_tags'),
]
operations = [
migrations.AddField(
model_name='ticket',
name='rem... | |
3d6519dd5f03e5ac87c4b6c45941199b8a12e3e7 | tests/test_model.py | tests/test_model.py | import uuid
from bloop import Column, UUID, Boolean, DateTime, String
missing = object()
def test_default_model_init(User):
''' Missing attributes aren't set to `None` or any other placeholder '''
user = User(id=uuid.uuid4(), email='user@domain.com')
assert user.email == 'user@domain.com'
assert getat... | Add unit tests for BaseModel | Add unit tests for BaseModel
| Python | mit | numberoverzero/bloop,numberoverzero/bloop | Add unit tests for BaseModel | import uuid
from bloop import Column, UUID, Boolean, DateTime, String
missing = object()
def test_default_model_init(User):
''' Missing attributes aren't set to `None` or any other placeholder '''
user = User(id=uuid.uuid4(), email='user@domain.com')
assert user.email == 'user@domain.com'
assert getat... | <commit_before><commit_msg>Add unit tests for BaseModel<commit_after> | import uuid
from bloop import Column, UUID, Boolean, DateTime, String
missing = object()
def test_default_model_init(User):
''' Missing attributes aren't set to `None` or any other placeholder '''
user = User(id=uuid.uuid4(), email='user@domain.com')
assert user.email == 'user@domain.com'
assert getat... | Add unit tests for BaseModelimport uuid
from bloop import Column, UUID, Boolean, DateTime, String
missing = object()
def test_default_model_init(User):
''' Missing attributes aren't set to `None` or any other placeholder '''
user = User(id=uuid.uuid4(), email='user@domain.com')
assert user.email == 'user@... | <commit_before><commit_msg>Add unit tests for BaseModel<commit_after>import uuid
from bloop import Column, UUID, Boolean, DateTime, String
missing = object()
def test_default_model_init(User):
''' Missing attributes aren't set to `None` or any other placeholder '''
user = User(id=uuid.uuid4(), email='user@dom... | |
dbc18d07160a0f08485234a3ffe766031144d951 | src/test_theme.py | src/test_theme.py | # This module is part of the GeoTag-X project builder.
# Copyright (C) 2015 UNITAR.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option... | Add a unit testing stub for the Theme object | Add a unit testing stub for the Theme object
| Python | agpl-3.0 | geotagx/geotagx-project-template,geotagx/geotagx-project-template | Add a unit testing stub for the Theme object | # This module is part of the GeoTag-X project builder.
# Copyright (C) 2015 UNITAR.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option... | <commit_before><commit_msg>Add a unit testing stub for the Theme object<commit_after> | # This module is part of the GeoTag-X project builder.
# Copyright (C) 2015 UNITAR.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option... | Add a unit testing stub for the Theme object# This module is part of the GeoTag-X project builder.
# Copyright (C) 2015 UNITAR.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either ve... | <commit_before><commit_msg>Add a unit testing stub for the Theme object<commit_after># This module is part of the GeoTag-X project builder.
# Copyright (C) 2015 UNITAR.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
... | |
a08604f85b82300a4a3b4f2e70f91c3ee129859b | openelex/tests/test_fetch.py | openelex/tests/test_fetch.py | from unittest import TestCase
from openelex.base.fetch import ErrorHandlingURLopener, HTTPError
class TestErrorHandlingURLopener(TestCase):
def setUp(self):
self.opener = ErrorHandlingURLopener()
def test_404(self):
url = "http://example.com/test.csv"
self.assertRaises(HTTPError, self... | Add missing test for ErrorHandlingURLopener | Add missing test for ErrorHandlingURLopener
I forgot to add this with commit
df9cfda52e952bb4d69cc0ee724e713cd6f468d5
| Python | mit | cathydeng/openelections-core,datamade/openelections-core,openelections/openelections-core,datamade/openelections-core,openelections/openelections-core,cathydeng/openelections-core | Add missing test for ErrorHandlingURLopener
I forgot to add this with commit
df9cfda52e952bb4d69cc0ee724e713cd6f468d5 | from unittest import TestCase
from openelex.base.fetch import ErrorHandlingURLopener, HTTPError
class TestErrorHandlingURLopener(TestCase):
def setUp(self):
self.opener = ErrorHandlingURLopener()
def test_404(self):
url = "http://example.com/test.csv"
self.assertRaises(HTTPError, self... | <commit_before><commit_msg>Add missing test for ErrorHandlingURLopener
I forgot to add this with commit
df9cfda52e952bb4d69cc0ee724e713cd6f468d5<commit_after> | from unittest import TestCase
from openelex.base.fetch import ErrorHandlingURLopener, HTTPError
class TestErrorHandlingURLopener(TestCase):
def setUp(self):
self.opener = ErrorHandlingURLopener()
def test_404(self):
url = "http://example.com/test.csv"
self.assertRaises(HTTPError, self... | Add missing test for ErrorHandlingURLopener
I forgot to add this with commit
df9cfda52e952bb4d69cc0ee724e713cd6f468d5from unittest import TestCase
from openelex.base.fetch import ErrorHandlingURLopener, HTTPError
class TestErrorHandlingURLopener(TestCase):
def setUp(self):
self.opener = ErrorHandlingURLo... | <commit_before><commit_msg>Add missing test for ErrorHandlingURLopener
I forgot to add this with commit
df9cfda52e952bb4d69cc0ee724e713cd6f468d5<commit_after>from unittest import TestCase
from openelex.base.fetch import ErrorHandlingURLopener, HTTPError
class TestErrorHandlingURLopener(TestCase):
def setUp(self)... | |
cc23bfe9980525c90ae32460cd8231458f8880a5 | lib/results_analysis/sim_result_tools.py | lib/results_analysis/sim_result_tools.py | __all__ = ['extract_ssi']
from datetime import datetime, timedelta
import h5py
import numpy as np
import numpy.ma as ma
# gzip compression flag
comp = 6
def extract_ssi(sim_fname, param_fname, result_fname, start_dt):
"""
Read a TOPKAPI simulation file and it's associated parameter file
and compute the ... | Add tool to extract SSI from TOPKAPI simulation results | ENH: Add tool to extract SSI from TOPKAPI simulation results
| Python | bsd-3-clause | sahg/PyTOPKAPI,scottza/PyTOPKAPI | ENH: Add tool to extract SSI from TOPKAPI simulation results | __all__ = ['extract_ssi']
from datetime import datetime, timedelta
import h5py
import numpy as np
import numpy.ma as ma
# gzip compression flag
comp = 6
def extract_ssi(sim_fname, param_fname, result_fname, start_dt):
"""
Read a TOPKAPI simulation file and it's associated parameter file
and compute the ... | <commit_before><commit_msg>ENH: Add tool to extract SSI from TOPKAPI simulation results<commit_after> | __all__ = ['extract_ssi']
from datetime import datetime, timedelta
import h5py
import numpy as np
import numpy.ma as ma
# gzip compression flag
comp = 6
def extract_ssi(sim_fname, param_fname, result_fname, start_dt):
"""
Read a TOPKAPI simulation file and it's associated parameter file
and compute the ... | ENH: Add tool to extract SSI from TOPKAPI simulation results__all__ = ['extract_ssi']
from datetime import datetime, timedelta
import h5py
import numpy as np
import numpy.ma as ma
# gzip compression flag
comp = 6
def extract_ssi(sim_fname, param_fname, result_fname, start_dt):
"""
Read a TOPKAPI simulation ... | <commit_before><commit_msg>ENH: Add tool to extract SSI from TOPKAPI simulation results<commit_after>__all__ = ['extract_ssi']
from datetime import datetime, timedelta
import h5py
import numpy as np
import numpy.ma as ma
# gzip compression flag
comp = 6
def extract_ssi(sim_fname, param_fname, result_fname, start_dt... | |
287855c67b8008a589e5009ba689cd0d9b35124a | backoff_retry_async.py | backoff_retry_async.py | import asyncio
import logging
import aiohttp
import backoff
@backoff.on_exception(backoff.expo,
aiohttp.errors.ClientError,
max_tries=8)
async def get_url(url):
async with aiohttp.ClientSession() as session:
async with session.get(url) as response:
... | Add backoff retry async example | Add backoff retry async example | Python | mit | voidabhi/python-scripts,voidabhi/python-scripts,voidabhi/python-scripts,voidabhi/python-scripts,voidabhi/python-scripts | Add backoff retry async example | import asyncio
import logging
import aiohttp
import backoff
@backoff.on_exception(backoff.expo,
aiohttp.errors.ClientError,
max_tries=8)
async def get_url(url):
async with aiohttp.ClientSession() as session:
async with session.get(url) as response:
... | <commit_before><commit_msg>Add backoff retry async example<commit_after> | import asyncio
import logging
import aiohttp
import backoff
@backoff.on_exception(backoff.expo,
aiohttp.errors.ClientError,
max_tries=8)
async def get_url(url):
async with aiohttp.ClientSession() as session:
async with session.get(url) as response:
... | Add backoff retry async exampleimport asyncio
import logging
import aiohttp
import backoff
@backoff.on_exception(backoff.expo,
aiohttp.errors.ClientError,
max_tries=8)
async def get_url(url):
async with aiohttp.ClientSession() as session:
async with session.get... | <commit_before><commit_msg>Add backoff retry async example<commit_after>import asyncio
import logging
import aiohttp
import backoff
@backoff.on_exception(backoff.expo,
aiohttp.errors.ClientError,
max_tries=8)
async def get_url(url):
async with aiohttp.ClientSession() a... | |
d9be46134972e88a01e74cefe61ff8ccd51b3fe2 | util/check-links.py | util/check-links.py | #!/usr/bin/env python2
from subprocess import Popen, PIPE
import os
import urllib2
import sys
utilDir = os.path.dirname(os.path.realpath(__file__))
ignores = ['localhost', '127.0.0.1', 'your-server', 'docker-ip',
'ghbtns', 'sphinx-doc']
def ignoreURL(url):
for ignore in ignores:
if ignore in ... | Add util script to check for broken links. | Add util script to check for broken links.
| Python | apache-2.0 | nhzandi/openface,nmabhi/Webface,xinfang/face-recognize,nmabhi/Webface,nhzandi/openface,xinfang/face-recognize,Alexx-G/openface,francisleunggie/openface,cmusatyalab/openface,Alexx-G/openface,francisleunggie/openface,nmabhi/Webface,xinfang/face-recognize,nmabhi/Webface,cmusatyalab/openface,cmusatyalab/openface,Alexx-G/op... | Add util script to check for broken links. | #!/usr/bin/env python2
from subprocess import Popen, PIPE
import os
import urllib2
import sys
utilDir = os.path.dirname(os.path.realpath(__file__))
ignores = ['localhost', '127.0.0.1', 'your-server', 'docker-ip',
'ghbtns', 'sphinx-doc']
def ignoreURL(url):
for ignore in ignores:
if ignore in ... | <commit_before><commit_msg>Add util script to check for broken links.<commit_after> | #!/usr/bin/env python2
from subprocess import Popen, PIPE
import os
import urllib2
import sys
utilDir = os.path.dirname(os.path.realpath(__file__))
ignores = ['localhost', '127.0.0.1', 'your-server', 'docker-ip',
'ghbtns', 'sphinx-doc']
def ignoreURL(url):
for ignore in ignores:
if ignore in ... | Add util script to check for broken links.#!/usr/bin/env python2
from subprocess import Popen, PIPE
import os
import urllib2
import sys
utilDir = os.path.dirname(os.path.realpath(__file__))
ignores = ['localhost', '127.0.0.1', 'your-server', 'docker-ip',
'ghbtns', 'sphinx-doc']
def ignoreURL(url):
fo... | <commit_before><commit_msg>Add util script to check for broken links.<commit_after>#!/usr/bin/env python2
from subprocess import Popen, PIPE
import os
import urllib2
import sys
utilDir = os.path.dirname(os.path.realpath(__file__))
ignores = ['localhost', '127.0.0.1', 'your-server', 'docker-ip',
'ghbtns',... | |
9ff6932eb887e4c1e05dd94107aa0c3438ae26a9 | Lib/gftools/actions/getlatestversion.py | Lib/gftools/actions/getlatestversion.py | import argparse
import subprocess
import os
from github import Github
import re
g = Github(os.environ["GITHUB_TOKEN"])
parser = argparse.ArgumentParser(description="Return the URL of a font's latest release artefact")
parser.add_argument('--user', help='the repository username', default="notofonts")
parser.add_argumen... | Add another module useful for GitHub actions: get a repo's latest release URL | Add another module useful for GitHub actions: get a repo's latest release URL | Python | apache-2.0 | googlefonts/gftools,googlefonts/gftools | Add another module useful for GitHub actions: get a repo's latest release URL | import argparse
import subprocess
import os
from github import Github
import re
g = Github(os.environ["GITHUB_TOKEN"])
parser = argparse.ArgumentParser(description="Return the URL of a font's latest release artefact")
parser.add_argument('--user', help='the repository username', default="notofonts")
parser.add_argumen... | <commit_before><commit_msg>Add another module useful for GitHub actions: get a repo's latest release URL<commit_after> | import argparse
import subprocess
import os
from github import Github
import re
g = Github(os.environ["GITHUB_TOKEN"])
parser = argparse.ArgumentParser(description="Return the URL of a font's latest release artefact")
parser.add_argument('--user', help='the repository username', default="notofonts")
parser.add_argumen... | Add another module useful for GitHub actions: get a repo's latest release URLimport argparse
import subprocess
import os
from github import Github
import re
g = Github(os.environ["GITHUB_TOKEN"])
parser = argparse.ArgumentParser(description="Return the URL of a font's latest release artefact")
parser.add_argument('--u... | <commit_before><commit_msg>Add another module useful for GitHub actions: get a repo's latest release URL<commit_after>import argparse
import subprocess
import os
from github import Github
import re
g = Github(os.environ["GITHUB_TOKEN"])
parser = argparse.ArgumentParser(description="Return the URL of a font's latest re... | |
d79607f320579b2b9d98f219c35d7c878173f10e | acoustics/doppler.py | acoustics/doppler.py | """
Doppler
=======
Doppler shift module.
"""
from __future__ import division
def velocity_from_doppler_shift(c, f1, f2):
"""
Calculate velocity based on measured frequency shifts due to Doppler shift.
The assumption is made that the velocity is constant between the observation times.
.. math:: ... | """
Doppler
=======
Doppler shift module.
"""
from __future__ import division
SOUNDSPEED = 343.0
"""Speed of sound
"""
def velocity_from_doppler_shift(f1, f2, c=SOUNDSPEED):
"""Calculate velocity based on measured frequency shifts due to Doppler shift.
:param c: Speed of sound :math:`c`.
:param f1: ... | Add simple equation to calculate Doppler shift | Add simple equation to calculate Doppler shift
| Python | bsd-3-clause | felipeacsi/python-acoustics,FRidh/python-acoustics,antiface/python-acoustics,python-acoustics/python-acoustics,giumas/python-acoustics | """
Doppler
=======
Doppler shift module.
"""
from __future__ import division
def velocity_from_doppler_shift(c, f1, f2):
"""
Calculate velocity based on measured frequency shifts due to Doppler shift.
The assumption is made that the velocity is constant between the observation times.
.. math:: ... | """
Doppler
=======
Doppler shift module.
"""
from __future__ import division
SOUNDSPEED = 343.0
"""Speed of sound
"""
def velocity_from_doppler_shift(f1, f2, c=SOUNDSPEED):
"""Calculate velocity based on measured frequency shifts due to Doppler shift.
:param c: Speed of sound :math:`c`.
:param f1: ... | <commit_before>"""
Doppler
=======
Doppler shift module.
"""
from __future__ import division
def velocity_from_doppler_shift(c, f1, f2):
"""
Calculate velocity based on measured frequency shifts due to Doppler shift.
The assumption is made that the velocity is constant between the observation times.
... | """
Doppler
=======
Doppler shift module.
"""
from __future__ import division
SOUNDSPEED = 343.0
"""Speed of sound
"""
def velocity_from_doppler_shift(f1, f2, c=SOUNDSPEED):
"""Calculate velocity based on measured frequency shifts due to Doppler shift.
:param c: Speed of sound :math:`c`.
:param f1: ... | """
Doppler
=======
Doppler shift module.
"""
from __future__ import division
def velocity_from_doppler_shift(c, f1, f2):
"""
Calculate velocity based on measured frequency shifts due to Doppler shift.
The assumption is made that the velocity is constant between the observation times.
.. math:: ... | <commit_before>"""
Doppler
=======
Doppler shift module.
"""
from __future__ import division
def velocity_from_doppler_shift(c, f1, f2):
"""
Calculate velocity based on measured frequency shifts due to Doppler shift.
The assumption is made that the velocity is constant between the observation times.
... |
3114c6d3dfde0c4e0f39b006bc212dd4cebc6acc | solr-external/update_zookeeper_config.py | solr-external/update_zookeeper_config.py | #!/usr/bin/env python
import argparse
from mc_solr.constants import *
from mc_solr.solr import update_zookeeper_solr_configuration
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Update Solr's configuration on ZooKeeper.",
epilog="This script does not... | Add script that updates Solr configuration on ZooKeeper | Add script that updates Solr configuration on ZooKeeper
| Python | agpl-3.0 | berkmancenter/mediacloud,berkmancenter/mediacloud,berkmancenter/mediacloud,berkmancenter/mediacloud,berkmancenter/mediacloud | Add script that updates Solr configuration on ZooKeeper | #!/usr/bin/env python
import argparse
from mc_solr.constants import *
from mc_solr.solr import update_zookeeper_solr_configuration
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Update Solr's configuration on ZooKeeper.",
epilog="This script does not... | <commit_before><commit_msg>Add script that updates Solr configuration on ZooKeeper<commit_after> | #!/usr/bin/env python
import argparse
from mc_solr.constants import *
from mc_solr.solr import update_zookeeper_solr_configuration
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Update Solr's configuration on ZooKeeper.",
epilog="This script does not... | Add script that updates Solr configuration on ZooKeeper#!/usr/bin/env python
import argparse
from mc_solr.constants import *
from mc_solr.solr import update_zookeeper_solr_configuration
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Update Solr's configuration on ZooKeeper.",
... | <commit_before><commit_msg>Add script that updates Solr configuration on ZooKeeper<commit_after>#!/usr/bin/env python
import argparse
from mc_solr.constants import *
from mc_solr.solr import update_zookeeper_solr_configuration
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Update Solr's... | |
562d23ecebaafcac3edf0662b4957f671a874a06 | recipes/skia.py | recipes/skia.py | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import sys
import recipe_util # pylint: disable=F0401
# This class doesn't need an __init__ method, so we disable the warning
# pylint: disable=W0232
cla... | Add fetch recipe for the Skia repository. | Add fetch recipe for the Skia repository.
Tested with the following command lines:
$ cd somewhere
$ mkdir some-test-dir
$ cd some-test-dir
$ fetch skia
$ cd skia
# confirm it is what we expected.
BUG=None
TEST=see above
R=agable@chromium.org
Review URL: https://codereview.chromium.org/746363003
git-svn-id: bd64dd... | Python | bsd-3-clause | svn2github/chromium-depot-tools,svn2github/chromium-depot-tools,svn2github/chromium-depot-tools | Add fetch recipe for the Skia repository.
Tested with the following command lines:
$ cd somewhere
$ mkdir some-test-dir
$ cd some-test-dir
$ fetch skia
$ cd skia
# confirm it is what we expected.
BUG=None
TEST=see above
R=agable@chromium.org
Review URL: https://codereview.chromium.org/746363003
git-svn-id: bd64dd... | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import sys
import recipe_util # pylint: disable=F0401
# This class doesn't need an __init__ method, so we disable the warning
# pylint: disable=W0232
cla... | <commit_before><commit_msg>Add fetch recipe for the Skia repository.
Tested with the following command lines:
$ cd somewhere
$ mkdir some-test-dir
$ cd some-test-dir
$ fetch skia
$ cd skia
# confirm it is what we expected.
BUG=None
TEST=see above
R=agable@chromium.org
Review URL: https://codereview.chromium.org/74... | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import sys
import recipe_util # pylint: disable=F0401
# This class doesn't need an __init__ method, so we disable the warning
# pylint: disable=W0232
cla... | Add fetch recipe for the Skia repository.
Tested with the following command lines:
$ cd somewhere
$ mkdir some-test-dir
$ cd some-test-dir
$ fetch skia
$ cd skia
# confirm it is what we expected.
BUG=None
TEST=see above
R=agable@chromium.org
Review URL: https://codereview.chromium.org/746363003
git-svn-id: bd64dd... | <commit_before><commit_msg>Add fetch recipe for the Skia repository.
Tested with the following command lines:
$ cd somewhere
$ mkdir some-test-dir
$ cd some-test-dir
$ fetch skia
$ cd skia
# confirm it is what we expected.
BUG=None
TEST=see above
R=agable@chromium.org
Review URL: https://codereview.chromium.org/74... | |
ddacad6879d955f46f58bbfefd3363246c256193 | examples/subclassing2.py | examples/subclassing2.py | from flask_table import Table, Col
class RawCol(Col):
"""Class that will just output whatever it is given and will not
escape it.
"""
def td_format(self, content):
return content
class ItemTable(Table):
name = Col('Name')
raw = RawCol('Raw')
def main():
items = [{'name': 'A', ... | Add subclassing example for RawCol | Add subclassing example for RawCol
| Python | bsd-3-clause | plumdog/flask_table,plumdog/flask_table,plumdog/flask_table | Add subclassing example for RawCol | from flask_table import Table, Col
class RawCol(Col):
"""Class that will just output whatever it is given and will not
escape it.
"""
def td_format(self, content):
return content
class ItemTable(Table):
name = Col('Name')
raw = RawCol('Raw')
def main():
items = [{'name': 'A', ... | <commit_before><commit_msg>Add subclassing example for RawCol<commit_after> | from flask_table import Table, Col
class RawCol(Col):
"""Class that will just output whatever it is given and will not
escape it.
"""
def td_format(self, content):
return content
class ItemTable(Table):
name = Col('Name')
raw = RawCol('Raw')
def main():
items = [{'name': 'A', ... | Add subclassing example for RawColfrom flask_table import Table, Col
class RawCol(Col):
"""Class that will just output whatever it is given and will not
escape it.
"""
def td_format(self, content):
return content
class ItemTable(Table):
name = Col('Name')
raw = RawCol('Raw')
def m... | <commit_before><commit_msg>Add subclassing example for RawCol<commit_after>from flask_table import Table, Col
class RawCol(Col):
"""Class that will just output whatever it is given and will not
escape it.
"""
def td_format(self, content):
return content
class ItemTable(Table):
name = Co... | |
aca69251d17bd76302c0d4c1403f54c9f8da4949 | mica/archive/tests/test_aca_hdr3.py | mica/archive/tests/test_aca_hdr3.py | """
Basic functionality and regression tests for ACA hdr3 (diagnostic) telemetry.
"""
import numpy as np
from .. import aca_hdr3
def test_MSIDset():
"""
Read all available MSIDs into a single MSIDset. Use the empirically determined
lengths as regression tests.
"""
msids = [hdr3['msid'] for hdr3... | Add minimal regression tests of reading ACA hdr3 data | Add minimal regression tests of reading ACA hdr3 data
| Python | bsd-3-clause | sot/mica,sot/mica | Add minimal regression tests of reading ACA hdr3 data | """
Basic functionality and regression tests for ACA hdr3 (diagnostic) telemetry.
"""
import numpy as np
from .. import aca_hdr3
def test_MSIDset():
"""
Read all available MSIDs into a single MSIDset. Use the empirically determined
lengths as regression tests.
"""
msids = [hdr3['msid'] for hdr3... | <commit_before><commit_msg>Add minimal regression tests of reading ACA hdr3 data<commit_after> | """
Basic functionality and regression tests for ACA hdr3 (diagnostic) telemetry.
"""
import numpy as np
from .. import aca_hdr3
def test_MSIDset():
"""
Read all available MSIDs into a single MSIDset. Use the empirically determined
lengths as regression tests.
"""
msids = [hdr3['msid'] for hdr3... | Add minimal regression tests of reading ACA hdr3 data"""
Basic functionality and regression tests for ACA hdr3 (diagnostic) telemetry.
"""
import numpy as np
from .. import aca_hdr3
def test_MSIDset():
"""
Read all available MSIDs into a single MSIDset. Use the empirically determined
lengths as regress... | <commit_before><commit_msg>Add minimal regression tests of reading ACA hdr3 data<commit_after>"""
Basic functionality and regression tests for ACA hdr3 (diagnostic) telemetry.
"""
import numpy as np
from .. import aca_hdr3
def test_MSIDset():
"""
Read all available MSIDs into a single MSIDset. Use the empi... | |
2598b189bf2b7f968ded928100132f301a07f1e5 | hours_slept_histogram.py | hours_slept_histogram.py | import plotly as py, plotly.graph_objs as go
from csvparser import parse
from os.path import basename, splitext
from sys import argv
data_file = argv[1]
raw_data = parse(data_file)
sleep_durations = []
for date, sleeps in raw_data.items():
total = 0
for s in sleeps:
sleep, wake, is_nap = s
del... | Add sleep duration histogram plotter | Add sleep duration histogram plotter
| Python | mit | f-jiang/sleep-pattern-grapher | Add sleep duration histogram plotter | import plotly as py, plotly.graph_objs as go
from csvparser import parse
from os.path import basename, splitext
from sys import argv
data_file = argv[1]
raw_data = parse(data_file)
sleep_durations = []
for date, sleeps in raw_data.items():
total = 0
for s in sleeps:
sleep, wake, is_nap = s
del... | <commit_before><commit_msg>Add sleep duration histogram plotter<commit_after> | import plotly as py, plotly.graph_objs as go
from csvparser import parse
from os.path import basename, splitext
from sys import argv
data_file = argv[1]
raw_data = parse(data_file)
sleep_durations = []
for date, sleeps in raw_data.items():
total = 0
for s in sleeps:
sleep, wake, is_nap = s
del... | Add sleep duration histogram plotterimport plotly as py, plotly.graph_objs as go
from csvparser import parse
from os.path import basename, splitext
from sys import argv
data_file = argv[1]
raw_data = parse(data_file)
sleep_durations = []
for date, sleeps in raw_data.items():
total = 0
for s in sleeps:
... | <commit_before><commit_msg>Add sleep duration histogram plotter<commit_after>import plotly as py, plotly.graph_objs as go
from csvparser import parse
from os.path import basename, splitext
from sys import argv
data_file = argv[1]
raw_data = parse(data_file)
sleep_durations = []
for date, sleeps in raw_data.items():
... | |
483c334a6272ee8fa19a43c353fa18b4c1a76fec | src/bindings/pygaia/scripts/classification/retrain_model.py | src/bindings/pygaia/scripts/classification/retrain_model.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2006-2019 Music Technology Group - Universitat Pompeu Fabra
#
# This file is part of Gaia
#
# Gaia is free software: you can redistribute it and/or modify it under
# the terms of the GNU Affero General Public License as published by the Free
# Software Fou... | Add script to retrain a model for a given param set | Add script to retrain a model for a given param set
| Python | agpl-3.0 | MTG/gaia,MTG/gaia,MTG/gaia,MTG/gaia | Add script to retrain a model for a given param set | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2006-2019 Music Technology Group - Universitat Pompeu Fabra
#
# This file is part of Gaia
#
# Gaia is free software: you can redistribute it and/or modify it under
# the terms of the GNU Affero General Public License as published by the Free
# Software Fou... | <commit_before><commit_msg>Add script to retrain a model for a given param set<commit_after> | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2006-2019 Music Technology Group - Universitat Pompeu Fabra
#
# This file is part of Gaia
#
# Gaia is free software: you can redistribute it and/or modify it under
# the terms of the GNU Affero General Public License as published by the Free
# Software Fou... | Add script to retrain a model for a given param set#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2006-2019 Music Technology Group - Universitat Pompeu Fabra
#
# This file is part of Gaia
#
# Gaia is free software: you can redistribute it and/or modify it under
# the terms of the GNU Affero General Pub... | <commit_before><commit_msg>Add script to retrain a model for a given param set<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2006-2019 Music Technology Group - Universitat Pompeu Fabra
#
# This file is part of Gaia
#
# Gaia is free software: you can redistribute it and/or modify it under
... | |
10db4c582f0e849807380ac763e002421f6604a1 | tests/api/views/aircraft_models_test.py | tests/api/views/aircraft_models_test.py | # coding=utf-8
from skylines.model import AircraftModel
def test_list_empty(db_session, client):
res = client.get('/aircraft-models')
assert res.status_code == 200
assert res.json == {
'models': [],
}
def test_list(db_session, client):
models = [
AircraftModel(name='Nimeta', kind... | Add tests for "GET /aircraft-models" | tests/api: Add tests for "GET /aircraft-models"
| Python | agpl-3.0 | RBE-Avionik/skylines,skylines-project/skylines,skylines-project/skylines,Harry-R/skylines,Harry-R/skylines,shadowoneau/skylines,shadowoneau/skylines,shadowoneau/skylines,Harry-R/skylines,RBE-Avionik/skylines,Turbo87/skylines,RBE-Avionik/skylines,skylines-project/skylines,skylines-project/skylines,Turbo87/skylines,Turbo... | tests/api: Add tests for "GET /aircraft-models" | # coding=utf-8
from skylines.model import AircraftModel
def test_list_empty(db_session, client):
res = client.get('/aircraft-models')
assert res.status_code == 200
assert res.json == {
'models': [],
}
def test_list(db_session, client):
models = [
AircraftModel(name='Nimeta', kind... | <commit_before><commit_msg>tests/api: Add tests for "GET /aircraft-models"<commit_after> | # coding=utf-8
from skylines.model import AircraftModel
def test_list_empty(db_session, client):
res = client.get('/aircraft-models')
assert res.status_code == 200
assert res.json == {
'models': [],
}
def test_list(db_session, client):
models = [
AircraftModel(name='Nimeta', kind... | tests/api: Add tests for "GET /aircraft-models"# coding=utf-8
from skylines.model import AircraftModel
def test_list_empty(db_session, client):
res = client.get('/aircraft-models')
assert res.status_code == 200
assert res.json == {
'models': [],
}
def test_list(db_session, client):
model... | <commit_before><commit_msg>tests/api: Add tests for "GET /aircraft-models"<commit_after># coding=utf-8
from skylines.model import AircraftModel
def test_list_empty(db_session, client):
res = client.get('/aircraft-models')
assert res.status_code == 200
assert res.json == {
'models': [],
}
def... | |
8fb8b19c75e4a331733b79f9d1d9384a0b3080be | karabo_data/tests/test_lsxfel.py | karabo_data/tests/test_lsxfel.py | from karabo_data import lsxfel
from karabo_data import H5File
def test_lsxfel_file(mock_lpd_data, capsys):
with H5File(mock_lpd_data) as f:
img_ds, index = lsxfel.find_image(f)
assert img_ds.ndim == 4
assert index['first'].shape == (480,)
lsxfel.summarise_file(mock_lpd_data)
out, e... | Add a couple of tests for lsxfel | Add a couple of tests for lsxfel
| Python | bsd-3-clause | European-XFEL/h5tools-py | Add a couple of tests for lsxfel | from karabo_data import lsxfel
from karabo_data import H5File
def test_lsxfel_file(mock_lpd_data, capsys):
with H5File(mock_lpd_data) as f:
img_ds, index = lsxfel.find_image(f)
assert img_ds.ndim == 4
assert index['first'].shape == (480,)
lsxfel.summarise_file(mock_lpd_data)
out, e... | <commit_before><commit_msg>Add a couple of tests for lsxfel<commit_after> | from karabo_data import lsxfel
from karabo_data import H5File
def test_lsxfel_file(mock_lpd_data, capsys):
with H5File(mock_lpd_data) as f:
img_ds, index = lsxfel.find_image(f)
assert img_ds.ndim == 4
assert index['first'].shape == (480,)
lsxfel.summarise_file(mock_lpd_data)
out, e... | Add a couple of tests for lsxfelfrom karabo_data import lsxfel
from karabo_data import H5File
def test_lsxfel_file(mock_lpd_data, capsys):
with H5File(mock_lpd_data) as f:
img_ds, index = lsxfel.find_image(f)
assert img_ds.ndim == 4
assert index['first'].shape == (480,)
lsxfel.summaris... | <commit_before><commit_msg>Add a couple of tests for lsxfel<commit_after>from karabo_data import lsxfel
from karabo_data import H5File
def test_lsxfel_file(mock_lpd_data, capsys):
with H5File(mock_lpd_data) as f:
img_ds, index = lsxfel.find_image(f)
assert img_ds.ndim == 4
assert index['fir... | |
fab3d35e7e2bd633f48d16a08914832a36eabb5e | numba/cuda/tests/cudapy/test_casting.py | numba/cuda/tests/cudapy/test_casting.py | from numba import unittest_support as unittest
import numpy as np
from numba import cuda, types
import struct
def float_to_int(x):
return np.int32(x)
def int_to_float(x):
return np.float64(x) / 2
def float_to_unsigned(x):
return types.uint32(x)
def float_to_complex(x):
return np.complex128(x)
... | Create CUDA cast tests based on CPU cast tests | Create CUDA cast tests based on CPU cast tests
| Python | bsd-2-clause | gdementen/numba,stuartarchibald/numba,stuartarchibald/numba,ssarangi/numba,stuartarchibald/numba,IntelLabs/numba,seibert/numba,pombredanne/numba,gmarkall/numba,ssarangi/numba,numba/numba,pombredanne/numba,pombredanne/numba,jriehl/numba,stefanseefeld/numba,numba/numba,numba/numba,gmarkall/numba,stefanseefeld/numba,stefa... | Create CUDA cast tests based on CPU cast tests | from numba import unittest_support as unittest
import numpy as np
from numba import cuda, types
import struct
def float_to_int(x):
return np.int32(x)
def int_to_float(x):
return np.float64(x) / 2
def float_to_unsigned(x):
return types.uint32(x)
def float_to_complex(x):
return np.complex128(x)
... | <commit_before><commit_msg>Create CUDA cast tests based on CPU cast tests<commit_after> | from numba import unittest_support as unittest
import numpy as np
from numba import cuda, types
import struct
def float_to_int(x):
return np.int32(x)
def int_to_float(x):
return np.float64(x) / 2
def float_to_unsigned(x):
return types.uint32(x)
def float_to_complex(x):
return np.complex128(x)
... | Create CUDA cast tests based on CPU cast testsfrom numba import unittest_support as unittest
import numpy as np
from numba import cuda, types
import struct
def float_to_int(x):
return np.int32(x)
def int_to_float(x):
return np.float64(x) / 2
def float_to_unsigned(x):
return types.uint32(x)
def float... | <commit_before><commit_msg>Create CUDA cast tests based on CPU cast tests<commit_after>from numba import unittest_support as unittest
import numpy as np
from numba import cuda, types
import struct
def float_to_int(x):
return np.int32(x)
def int_to_float(x):
return np.float64(x) / 2
def float_to_unsigned(x... | |
2636bf8f010de273c9713269a3402b16c83c912e | fellowms/migrations/0021_blog_status.py | fellowms/migrations/0021_blog_status.py | # -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-06-02 16:10
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('fellowms', '0020_auto_20160602_1607'),
]
operations = [
migrations.AddField(... | Create migration for blog status | Create migration for blog status
| Python | bsd-3-clause | softwaresaved/fat,softwaresaved/fat,softwaresaved/fat,softwaresaved/fat | Create migration for blog status | # -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-06-02 16:10
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('fellowms', '0020_auto_20160602_1607'),
]
operations = [
migrations.AddField(... | <commit_before><commit_msg>Create migration for blog status<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-06-02 16:10
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('fellowms', '0020_auto_20160602_1607'),
]
operations = [
migrations.AddField(... | Create migration for blog status# -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-06-02 16:10
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('fellowms', '0020_auto_20160602_1607'),
]
operations ... | <commit_before><commit_msg>Create migration for blog status<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-06-02 16:10
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('fellowms', '0020_aut... | |
1e361a431fc95304553852531427016215002cb0 | src/Harry_get_Citations_BlockingApps.py | src/Harry_get_Citations_BlockingApps.py | #!/bin/env python
# Get the number of apps blocked by each Motorola patent
# and plot agains the number of citations to that patent
import pandas as pd
import matplotlib as plt
Blocking = pd.read_csv("../data/Motorola_blocking_patents_1114.csv")
MotoPatents = pd.read_csv("../data/Motorola_Patents_Blocking_Citations.c... | Add script to get number of apps blocked without duplicates | Add script to get number of apps blocked without duplicates
| Python | bsd-2-clause | PatentBlocker/Motorola_Patent_Citations,PatentBlocker/Motorola_Patent_Citations | Add script to get number of apps blocked without duplicates | #!/bin/env python
# Get the number of apps blocked by each Motorola patent
# and plot agains the number of citations to that patent
import pandas as pd
import matplotlib as plt
Blocking = pd.read_csv("../data/Motorola_blocking_patents_1114.csv")
MotoPatents = pd.read_csv("../data/Motorola_Patents_Blocking_Citations.c... | <commit_before><commit_msg>Add script to get number of apps blocked without duplicates<commit_after> | #!/bin/env python
# Get the number of apps blocked by each Motorola patent
# and plot agains the number of citations to that patent
import pandas as pd
import matplotlib as plt
Blocking = pd.read_csv("../data/Motorola_blocking_patents_1114.csv")
MotoPatents = pd.read_csv("../data/Motorola_Patents_Blocking_Citations.c... | Add script to get number of apps blocked without duplicates#!/bin/env python
# Get the number of apps blocked by each Motorola patent
# and plot agains the number of citations to that patent
import pandas as pd
import matplotlib as plt
Blocking = pd.read_csv("../data/Motorola_blocking_patents_1114.csv")
MotoPatents =... | <commit_before><commit_msg>Add script to get number of apps blocked without duplicates<commit_after>#!/bin/env python
# Get the number of apps blocked by each Motorola patent
# and plot agains the number of citations to that patent
import pandas as pd
import matplotlib as plt
Blocking = pd.read_csv("../data/Motorola_... | |
ad3f121f43f07a2fa27525e25ef2afdca94475f9 | greatbigcrane/job_server/job_processor.py | greatbigcrane/job_server/job_processor.py | import os
os.environ['DJANGO_SETTINGS_MODULE'] = 'greatbigcrane.development'
import zmq
import time
import json
addr = 'tcp://127.0.0.1:5555'
context = zmq.Context()
socket = context.socket(zmq.REQ)
socket.connect(addr)
def bootstrap(project):
print("processing %s" % project)
command_map = {
'BOOTSTRAP': bo... | Add a simple boilerplate to process jobs. | Add a simple boilerplate to process jobs.
| Python | apache-2.0 | pnomolos/greatbigcrane,pnomolos/greatbigcrane | Add a simple boilerplate to process jobs. | import os
os.environ['DJANGO_SETTINGS_MODULE'] = 'greatbigcrane.development'
import zmq
import time
import json
addr = 'tcp://127.0.0.1:5555'
context = zmq.Context()
socket = context.socket(zmq.REQ)
socket.connect(addr)
def bootstrap(project):
print("processing %s" % project)
command_map = {
'BOOTSTRAP': bo... | <commit_before><commit_msg>Add a simple boilerplate to process jobs.<commit_after> | import os
os.environ['DJANGO_SETTINGS_MODULE'] = 'greatbigcrane.development'
import zmq
import time
import json
addr = 'tcp://127.0.0.1:5555'
context = zmq.Context()
socket = context.socket(zmq.REQ)
socket.connect(addr)
def bootstrap(project):
print("processing %s" % project)
command_map = {
'BOOTSTRAP': bo... | Add a simple boilerplate to process jobs.import os
os.environ['DJANGO_SETTINGS_MODULE'] = 'greatbigcrane.development'
import zmq
import time
import json
addr = 'tcp://127.0.0.1:5555'
context = zmq.Context()
socket = context.socket(zmq.REQ)
socket.connect(addr)
def bootstrap(project):
print("processing %s" % proj... | <commit_before><commit_msg>Add a simple boilerplate to process jobs.<commit_after>import os
os.environ['DJANGO_SETTINGS_MODULE'] = 'greatbigcrane.development'
import zmq
import time
import json
addr = 'tcp://127.0.0.1:5555'
context = zmq.Context()
socket = context.socket(zmq.REQ)
socket.connect(addr)
def bootstrap(p... | |
f0d501bec97e77b7f7efb427bdcbb051230a5e5a | store/tests/test_context_processor.py | store/tests/test_context_processor.py | """
Tests for Custom context processors.
"""
import os
from django.conf import settings
from django.test import TestCase, override_settings
class FooterCategoriesContextProcessorTests(TestCase):
"""
Tests for the ``store.context_processors.footer_categories`` processor.
"""
def test_custom_context_e... | Add tests for custom context processor | Add tests for custom context processor
| Python | bsd-3-clause | kevgathuku/compshop,kevgathuku/compshop,kevgathuku/compshop,kevgathuku/compshop,andela-kndungu/compshop,andela-kndungu/compshop,andela-kndungu/compshop,andela-kndungu/compshop | Add tests for custom context processor | """
Tests for Custom context processors.
"""
import os
from django.conf import settings
from django.test import TestCase, override_settings
class FooterCategoriesContextProcessorTests(TestCase):
"""
Tests for the ``store.context_processors.footer_categories`` processor.
"""
def test_custom_context_e... | <commit_before><commit_msg>Add tests for custom context processor<commit_after> | """
Tests for Custom context processors.
"""
import os
from django.conf import settings
from django.test import TestCase, override_settings
class FooterCategoriesContextProcessorTests(TestCase):
"""
Tests for the ``store.context_processors.footer_categories`` processor.
"""
def test_custom_context_e... | Add tests for custom context processor"""
Tests for Custom context processors.
"""
import os
from django.conf import settings
from django.test import TestCase, override_settings
class FooterCategoriesContextProcessorTests(TestCase):
"""
Tests for the ``store.context_processors.footer_categories`` processor.
... | <commit_before><commit_msg>Add tests for custom context processor<commit_after>"""
Tests for Custom context processors.
"""
import os
from django.conf import settings
from django.test import TestCase, override_settings
class FooterCategoriesContextProcessorTests(TestCase):
"""
Tests for the ``store.context_p... | |
b0b3e28df3807de5bb6b534bf21c2d2d027340e9 | osf/migrations/0002_auto_20170329_1251.py | osf/migrations/0002_auto_20170329_1251.py | # -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2017-03-29 17:51
from __future__ import unicode_literals
from django.db import migrations
import django.utils.timezone
import osf.utils.fields
class Migration(migrations.Migration):
dependencies = [
('osf', '0001_initial'),
]
operations = [
... | Add migration for auto_now removal | Add migration for auto_now removal
| Python | apache-2.0 | mfraezz/osf.io,icereval/osf.io,Johnetordoff/osf.io,icereval/osf.io,HalcyonChimera/osf.io,adlius/osf.io,Nesiehr/osf.io,HalcyonChimera/osf.io,saradbowman/osf.io,hmoco/osf.io,aaxelb/osf.io,laurenrevere/osf.io,cslzchen/osf.io,caseyrollins/osf.io,TomBaxter/osf.io,chrisseto/osf.io,cslzchen/osf.io,crcresearch/osf.io,adlius/os... | Add migration for auto_now removal | # -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2017-03-29 17:51
from __future__ import unicode_literals
from django.db import migrations
import django.utils.timezone
import osf.utils.fields
class Migration(migrations.Migration):
dependencies = [
('osf', '0001_initial'),
]
operations = [
... | <commit_before><commit_msg>Add migration for auto_now removal<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2017-03-29 17:51
from __future__ import unicode_literals
from django.db import migrations
import django.utils.timezone
import osf.utils.fields
class Migration(migrations.Migration):
dependencies = [
('osf', '0001_initial'),
]
operations = [
... | Add migration for auto_now removal# -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2017-03-29 17:51
from __future__ import unicode_literals
from django.db import migrations
import django.utils.timezone
import osf.utils.fields
class Migration(migrations.Migration):
dependencies = [
('osf', '0001_init... | <commit_before><commit_msg>Add migration for auto_now removal<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2017-03-29 17:51
from __future__ import unicode_literals
from django.db import migrations
import django.utils.timezone
import osf.utils.fields
class Migration(migrations.Migration):
de... | |
73bf27a95944f67feb254d90b90cfa31165dc4cb | tests/UselessSymbolsRemove/CycleTest.py | tests/UselessSymbolsRemove/CycleTest.py | #!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 19.08.2017 16:13
:Licence GNUv3
Part of grammpy-transforms
"""
from unittest import main, TestCase
from grammpy import *
from grammpy_transforms import *
class S(Nonterminal): pass
class A(Nonterminal): pass
class B(Nonterminal): pass
class C(Nonterminal): p... | Add cycle test of remove useless symbols | Add cycle test of remove useless symbols
| Python | mit | PatrikValkovic/grammpy | Add cycle test of remove useless symbols | #!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 19.08.2017 16:13
:Licence GNUv3
Part of grammpy-transforms
"""
from unittest import main, TestCase
from grammpy import *
from grammpy_transforms import *
class S(Nonterminal): pass
class A(Nonterminal): pass
class B(Nonterminal): pass
class C(Nonterminal): p... | <commit_before><commit_msg>Add cycle test of remove useless symbols<commit_after> | #!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 19.08.2017 16:13
:Licence GNUv3
Part of grammpy-transforms
"""
from unittest import main, TestCase
from grammpy import *
from grammpy_transforms import *
class S(Nonterminal): pass
class A(Nonterminal): pass
class B(Nonterminal): pass
class C(Nonterminal): p... | Add cycle test of remove useless symbols#!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 19.08.2017 16:13
:Licence GNUv3
Part of grammpy-transforms
"""
from unittest import main, TestCase
from grammpy import *
from grammpy_transforms import *
class S(Nonterminal): pass
class A(Nonterminal): pass
class B(No... | <commit_before><commit_msg>Add cycle test of remove useless symbols<commit_after>#!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 19.08.2017 16:13
:Licence GNUv3
Part of grammpy-transforms
"""
from unittest import main, TestCase
from grammpy import *
from grammpy_transforms import *
class S(Nonterminal): p... | |
2ae16c880d6b38c00b5eb48d99facacc5a3ccf7e | python/second-largest.py | python/second-largest.py | # You are given as input an unsorted array of n distinct numbers,
# where n is a power of 2.
# Give an algorithm that identifies the second-largest number in the array,
# and that uses at most n + log2n - 2 comparisons.
A = [4, 512, 8, 64, 16, 2, 32, 256] # Uses at most 9 comparisons
# def second_largest (Array):
... | Add solution to hamming numbers kata | Add solution to hamming numbers kata
| Python | mit | HiccupinGminor/tidbits,HiccupinGminor/tidbits | Add solution to hamming numbers kata | # You are given as input an unsorted array of n distinct numbers,
# where n is a power of 2.
# Give an algorithm that identifies the second-largest number in the array,
# and that uses at most n + log2n - 2 comparisons.
A = [4, 512, 8, 64, 16, 2, 32, 256] # Uses at most 9 comparisons
# def second_largest (Array):
... | <commit_before><commit_msg>Add solution to hamming numbers kata<commit_after> | # You are given as input an unsorted array of n distinct numbers,
# where n is a power of 2.
# Give an algorithm that identifies the second-largest number in the array,
# and that uses at most n + log2n - 2 comparisons.
A = [4, 512, 8, 64, 16, 2, 32, 256] # Uses at most 9 comparisons
# def second_largest (Array):
... | Add solution to hamming numbers kata# You are given as input an unsorted array of n distinct numbers,
# where n is a power of 2.
# Give an algorithm that identifies the second-largest number in the array,
# and that uses at most n + log2n - 2 comparisons.
A = [4, 512, 8, 64, 16, 2, 32, 256] # Uses at most 9 compari... | <commit_before><commit_msg>Add solution to hamming numbers kata<commit_after># You are given as input an unsorted array of n distinct numbers,
# where n is a power of 2.
# Give an algorithm that identifies the second-largest number in the array,
# and that uses at most n + log2n - 2 comparisons.
A = [4, 512, 8, 64,... | |
8137d5ae66dc6f6d08a674466a5d7c84efb12b6c | pyrsistent/typing.py | pyrsistent/typing.py | import six
class SubscriptableType(type):
def __getitem__(self, key):
return self
@six.add_metaclass(SubscriptableType)
class CheckedPMap(object):
pass
@six.add_metaclass(SubscriptableType)
class CheckedPSet(object):
pass
@six.add_metaclass(SubscriptableType)
class CheckedPVector(object):
... | Add shell class for type checkers | Add shell class for type checkers
| Python | mit | tobgu/pyrsistent,tobgu/pyrsistent,tobgu/pyrsistent | Add shell class for type checkers | import six
class SubscriptableType(type):
def __getitem__(self, key):
return self
@six.add_metaclass(SubscriptableType)
class CheckedPMap(object):
pass
@six.add_metaclass(SubscriptableType)
class CheckedPSet(object):
pass
@six.add_metaclass(SubscriptableType)
class CheckedPVector(object):
... | <commit_before><commit_msg>Add shell class for type checkers<commit_after> | import six
class SubscriptableType(type):
def __getitem__(self, key):
return self
@six.add_metaclass(SubscriptableType)
class CheckedPMap(object):
pass
@six.add_metaclass(SubscriptableType)
class CheckedPSet(object):
pass
@six.add_metaclass(SubscriptableType)
class CheckedPVector(object):
... | Add shell class for type checkersimport six
class SubscriptableType(type):
def __getitem__(self, key):
return self
@six.add_metaclass(SubscriptableType)
class CheckedPMap(object):
pass
@six.add_metaclass(SubscriptableType)
class CheckedPSet(object):
pass
@six.add_metaclass(SubscriptableType)... | <commit_before><commit_msg>Add shell class for type checkers<commit_after>import six
class SubscriptableType(type):
def __getitem__(self, key):
return self
@six.add_metaclass(SubscriptableType)
class CheckedPMap(object):
pass
@six.add_metaclass(SubscriptableType)
class CheckedPSet(object):
pas... | |
f6e384886d679d238b42e0fccd2185a07670353f | UM/VersionUpgrade.py | UM/VersionUpgrade.py | # Copyright (c) 2015 Ultimaker B.V.
# Cura is released under the terms of the AGPLv3 or higher.
from UM.Logger import Logger
from UM.PluginObject import PluginObject
## A type of plug-in that upgrades the preferences from an old file format to
# a newer one.
#
# Each version upgrade plug-in can convert machine i... | Add version upgrade plug-in object | Add version upgrade plug-in object
These are for plug-ins that upgrade preference files to newer versions of the application.
Contributes to issue CURA-844.
| Python | agpl-3.0 | onitake/Uranium,onitake/Uranium | Add version upgrade plug-in object
These are for plug-ins that upgrade preference files to newer versions of the application.
Contributes to issue CURA-844. | # Copyright (c) 2015 Ultimaker B.V.
# Cura is released under the terms of the AGPLv3 or higher.
from UM.Logger import Logger
from UM.PluginObject import PluginObject
## A type of plug-in that upgrades the preferences from an old file format to
# a newer one.
#
# Each version upgrade plug-in can convert machine i... | <commit_before><commit_msg>Add version upgrade plug-in object
These are for plug-ins that upgrade preference files to newer versions of the application.
Contributes to issue CURA-844.<commit_after> | # Copyright (c) 2015 Ultimaker B.V.
# Cura is released under the terms of the AGPLv3 or higher.
from UM.Logger import Logger
from UM.PluginObject import PluginObject
## A type of plug-in that upgrades the preferences from an old file format to
# a newer one.
#
# Each version upgrade plug-in can convert machine i... | Add version upgrade plug-in object
These are for plug-ins that upgrade preference files to newer versions of the application.
Contributes to issue CURA-844.# Copyright (c) 2015 Ultimaker B.V.
# Cura is released under the terms of the AGPLv3 or higher.
from UM.Logger import Logger
from UM.PluginObject import PluginOb... | <commit_before><commit_msg>Add version upgrade plug-in object
These are for plug-ins that upgrade preference files to newer versions of the application.
Contributes to issue CURA-844.<commit_after># Copyright (c) 2015 Ultimaker B.V.
# Cura is released under the terms of the AGPLv3 or higher.
from UM.Logger import Lo... | |
d729656703940304555a2d638d02c71f5a872434 | tests/unit/output/test_table_out.py | tests/unit/output/test_table_out.py | # -*- coding: utf-8 -*-
'''
unittests for table outputter
'''
# Import Python Libs
from __future__ import absolute_import, print_function, unicode_literals
# Import Salt Testing Libs
from tests.support.mixins import LoaderModuleMockMixin
from tests.support.unit import TestCase
# Import Salt Libs
import salt.output.t... | Add unit tests for table outputter | Add unit tests for table outputter
| Python | apache-2.0 | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | Add unit tests for table outputter | # -*- coding: utf-8 -*-
'''
unittests for table outputter
'''
# Import Python Libs
from __future__ import absolute_import, print_function, unicode_literals
# Import Salt Testing Libs
from tests.support.mixins import LoaderModuleMockMixin
from tests.support.unit import TestCase
# Import Salt Libs
import salt.output.t... | <commit_before><commit_msg>Add unit tests for table outputter<commit_after> | # -*- coding: utf-8 -*-
'''
unittests for table outputter
'''
# Import Python Libs
from __future__ import absolute_import, print_function, unicode_literals
# Import Salt Testing Libs
from tests.support.mixins import LoaderModuleMockMixin
from tests.support.unit import TestCase
# Import Salt Libs
import salt.output.t... | Add unit tests for table outputter# -*- coding: utf-8 -*-
'''
unittests for table outputter
'''
# Import Python Libs
from __future__ import absolute_import, print_function, unicode_literals
# Import Salt Testing Libs
from tests.support.mixins import LoaderModuleMockMixin
from tests.support.unit import TestCase
# Imp... | <commit_before><commit_msg>Add unit tests for table outputter<commit_after># -*- coding: utf-8 -*-
'''
unittests for table outputter
'''
# Import Python Libs
from __future__ import absolute_import, print_function, unicode_literals
# Import Salt Testing Libs
from tests.support.mixins import LoaderModuleMockMixin
from ... | |
c64b2e468f19b96c49d2a79e8f9165beb7ab55a2 | apps/competition/migrations/0015_auto_20190308_0215.py | apps/competition/migrations/0015_auto_20190308_0215.py | # -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2019-03-08 02:15
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('competition', '0014_auto_20180910_1931'),
]
operations = [
migrations.AlterFi... | Add migration that has been pending for a long time | Add migration that has been pending for a long time
| Python | mit | CasualGaming/studlan,dotKom/studlan,CasualGaming/studlan,CasualGaming/studlan,dotKom/studlan,CasualGaming/studlan,dotKom/studlan,dotKom/studlan | Add migration that has been pending for a long time | # -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2019-03-08 02:15
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('competition', '0014_auto_20180910_1931'),
]
operations = [
migrations.AlterFi... | <commit_before><commit_msg>Add migration that has been pending for a long time<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2019-03-08 02:15
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('competition', '0014_auto_20180910_1931'),
]
operations = [
migrations.AlterFi... | Add migration that has been pending for a long time# -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2019-03-08 02:15
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('competition', '0014_auto_20180910_1931'),
... | <commit_before><commit_msg>Add migration that has been pending for a long time<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2019-03-08 02:15
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('co... | |
3c8f25edfe6fb87c971fd1d60ee7cf0e2d18f36b | sahgutils/mpl_helpers.py | sahgutils/mpl_helpers.py | """
A collection of helper functions to aid the construction of custom
figures using Matplotlib and Basemap.
"""
from matplotlib.colors import ListedColormap
from _color_brewer import cdict
def _search_key(cmap_name):
cat_range = range(3, 13).reverse()
for cat in cat_range:
pal_name = '_%s_cat%s_dat... | Add a Matplotlib helper functions module | ENH: Add a Matplotlib helper functions module
* So far this only contains a function to create a ListedColormap from
ColorBrewer palette specs.
| Python | bsd-3-clause | sahg/SAHGutils | ENH: Add a Matplotlib helper functions module
* So far this only contains a function to create a ListedColormap from
ColorBrewer palette specs. | """
A collection of helper functions to aid the construction of custom
figures using Matplotlib and Basemap.
"""
from matplotlib.colors import ListedColormap
from _color_brewer import cdict
def _search_key(cmap_name):
cat_range = range(3, 13).reverse()
for cat in cat_range:
pal_name = '_%s_cat%s_dat... | <commit_before><commit_msg>ENH: Add a Matplotlib helper functions module
* So far this only contains a function to create a ListedColormap from
ColorBrewer palette specs.<commit_after> | """
A collection of helper functions to aid the construction of custom
figures using Matplotlib and Basemap.
"""
from matplotlib.colors import ListedColormap
from _color_brewer import cdict
def _search_key(cmap_name):
cat_range = range(3, 13).reverse()
for cat in cat_range:
pal_name = '_%s_cat%s_dat... | ENH: Add a Matplotlib helper functions module
* So far this only contains a function to create a ListedColormap from
ColorBrewer palette specs."""
A collection of helper functions to aid the construction of custom
figures using Matplotlib and Basemap.
"""
from matplotlib.colors import ListedColormap
from _color_br... | <commit_before><commit_msg>ENH: Add a Matplotlib helper functions module
* So far this only contains a function to create a ListedColormap from
ColorBrewer palette specs.<commit_after>"""
A collection of helper functions to aid the construction of custom
figures using Matplotlib and Basemap.
"""
from matplotlib.col... | |
a046376067c7e3055dc327246660b161b505dce6 | py/reverse-vowels-of-a-string.py | py/reverse-vowels-of-a-string.py | class Solution(object):
def reverseVowels(self, s):
"""
:type s: str
:rtype: str
"""
vowels = list(filter(lambda x:x in 'aeiouAEIOU', s))
ans = []
for c in s:
if c in 'aeiouAEIOU':
ans.append(vowels.pop())
else:
... | Add py solution for 345. Reverse Vowels of a String | Add py solution for 345. Reverse Vowels of a String
345. Reverse Vowels of a String: https://leetcode.com/problems/reverse-vowels-of-a-string/
| Python | apache-2.0 | ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode | Add py solution for 345. Reverse Vowels of a String
345. Reverse Vowels of a String: https://leetcode.com/problems/reverse-vowels-of-a-string/ | class Solution(object):
def reverseVowels(self, s):
"""
:type s: str
:rtype: str
"""
vowels = list(filter(lambda x:x in 'aeiouAEIOU', s))
ans = []
for c in s:
if c in 'aeiouAEIOU':
ans.append(vowels.pop())
else:
... | <commit_before><commit_msg>Add py solution for 345. Reverse Vowels of a String
345. Reverse Vowels of a String: https://leetcode.com/problems/reverse-vowels-of-a-string/<commit_after> | class Solution(object):
def reverseVowels(self, s):
"""
:type s: str
:rtype: str
"""
vowels = list(filter(lambda x:x in 'aeiouAEIOU', s))
ans = []
for c in s:
if c in 'aeiouAEIOU':
ans.append(vowels.pop())
else:
... | Add py solution for 345. Reverse Vowels of a String
345. Reverse Vowels of a String: https://leetcode.com/problems/reverse-vowels-of-a-string/class Solution(object):
def reverseVowels(self, s):
"""
:type s: str
:rtype: str
"""
vowels = list(filter(lambda x:x in 'aeiouAEIOU',... | <commit_before><commit_msg>Add py solution for 345. Reverse Vowels of a String
345. Reverse Vowels of a String: https://leetcode.com/problems/reverse-vowels-of-a-string/<commit_after>class Solution(object):
def reverseVowels(self, s):
"""
:type s: str
:rtype: str
"""
vowels ... | |
d423c5cc0756f621660598a4df2e331c6e5d97db | new-em-subvolumes.py | new-em-subvolumes.py | # IPython log file
from gala import imio
import numpy as np
slices = [(slice(None), slice(None, 625), slice(None, 625)),
(slice(None), slice(None, 625), slice(625, None)),
(slice(None), slice(625, None), slice(None, 625)),
(slice(None), slice(625, None), slice(625, None))]
gt = imio.re... | Add script used to subvolume new EM volumes | Add script used to subvolume new EM volumes
| Python | bsd-3-clause | jni/gala-scripts | Add script used to subvolume new EM volumes | # IPython log file
from gala import imio
import numpy as np
slices = [(slice(None), slice(None, 625), slice(None, 625)),
(slice(None), slice(None, 625), slice(625, None)),
(slice(None), slice(625, None), slice(None, 625)),
(slice(None), slice(625, None), slice(625, None))]
gt = imio.re... | <commit_before><commit_msg>Add script used to subvolume new EM volumes<commit_after> | # IPython log file
from gala import imio
import numpy as np
slices = [(slice(None), slice(None, 625), slice(None, 625)),
(slice(None), slice(None, 625), slice(625, None)),
(slice(None), slice(625, None), slice(None, 625)),
(slice(None), slice(625, None), slice(625, None))]
gt = imio.re... | Add script used to subvolume new EM volumes# IPython log file
from gala import imio
import numpy as np
slices = [(slice(None), slice(None, 625), slice(None, 625)),
(slice(None), slice(None, 625), slice(625, None)),
(slice(None), slice(625, None), slice(None, 625)),
(slice(None), slice(6... | <commit_before><commit_msg>Add script used to subvolume new EM volumes<commit_after># IPython log file
from gala import imio
import numpy as np
slices = [(slice(None), slice(None, 625), slice(None, 625)),
(slice(None), slice(None, 625), slice(625, None)),
(slice(None), slice(625, None), slice(Non... | |
bf8e308c9ebab2a2a8a14f9fff747d5a303f6f68 | sympy/parsing/tests/test_sympy_parser.py | sympy/parsing/tests/test_sympy_parser.py | from sympy.parsing.sympy_parser import parse_expr
from sympy import *
def test_implicit_multiplication_application():
x = Symbol('x')
inputs = {
'2*x': 2 * x,
'3.00': Float(3),
'22/7': Rational(22, 7),
'2+3j': 2 + 3*I,
'exp(x)': exp(x),
'x!': factorial(x),
... | Add some tests for sympy_parser | Add some tests for sympy_parser
| Python | bsd-3-clause | Mitchkoens/sympy,saurabhjn76/sympy,kmacinnis/sympy,pandeyadarsh/sympy,mafiya69/sympy,MechCoder/sympy,cccfran/sympy,liangjiaxing/sympy,hargup/sympy,mcdaniel67/sympy,jamesblunt/sympy,garvitr/sympy,ahhda/sympy,skidzo/sympy,Designist/sympy,hrashk/sympy,rahuldan/sympy,toolforger/sympy,grevutiu-gabriel/sympy,kaichogami/sympy... | Add some tests for sympy_parser | from sympy.parsing.sympy_parser import parse_expr
from sympy import *
def test_implicit_multiplication_application():
x = Symbol('x')
inputs = {
'2*x': 2 * x,
'3.00': Float(3),
'22/7': Rational(22, 7),
'2+3j': 2 + 3*I,
'exp(x)': exp(x),
'x!': factorial(x),
... | <commit_before><commit_msg>Add some tests for sympy_parser<commit_after> | from sympy.parsing.sympy_parser import parse_expr
from sympy import *
def test_implicit_multiplication_application():
x = Symbol('x')
inputs = {
'2*x': 2 * x,
'3.00': Float(3),
'22/7': Rational(22, 7),
'2+3j': 2 + 3*I,
'exp(x)': exp(x),
'x!': factorial(x),
... | Add some tests for sympy_parserfrom sympy.parsing.sympy_parser import parse_expr
from sympy import *
def test_implicit_multiplication_application():
x = Symbol('x')
inputs = {
'2*x': 2 * x,
'3.00': Float(3),
'22/7': Rational(22, 7),
'2+3j': 2 + 3*I,
'exp(x)': exp(x),
... | <commit_before><commit_msg>Add some tests for sympy_parser<commit_after>from sympy.parsing.sympy_parser import parse_expr
from sympy import *
def test_implicit_multiplication_application():
x = Symbol('x')
inputs = {
'2*x': 2 * x,
'3.00': Float(3),
'22/7': Rational(22, 7),
'2+3j... | |
f8e949019c7339a73bdd48e9b351843d458d99aa | gaphor/ui/tests/test_namespace.py | gaphor/ui/tests/test_namespace.py | import pytest
from gaphor import UML
from gaphor.core.modeling import Diagram
from gaphor.ui.namespace import Namespace, popup_model
@pytest.fixture
def namespace(event_manager, element_factory):
ns = Namespace(event_manager, element_factory)
scrolled_window = ns.open() # noqa: F841
assert ns.model
... | Add tests for Namespace component | Add tests for Namespace component
| Python | lgpl-2.1 | amolenaar/gaphor,amolenaar/gaphor | Add tests for Namespace component | import pytest
from gaphor import UML
from gaphor.core.modeling import Diagram
from gaphor.ui.namespace import Namespace, popup_model
@pytest.fixture
def namespace(event_manager, element_factory):
ns = Namespace(event_manager, element_factory)
scrolled_window = ns.open() # noqa: F841
assert ns.model
... | <commit_before><commit_msg>Add tests for Namespace component<commit_after> | import pytest
from gaphor import UML
from gaphor.core.modeling import Diagram
from gaphor.ui.namespace import Namespace, popup_model
@pytest.fixture
def namespace(event_manager, element_factory):
ns = Namespace(event_manager, element_factory)
scrolled_window = ns.open() # noqa: F841
assert ns.model
... | Add tests for Namespace componentimport pytest
from gaphor import UML
from gaphor.core.modeling import Diagram
from gaphor.ui.namespace import Namespace, popup_model
@pytest.fixture
def namespace(event_manager, element_factory):
ns = Namespace(event_manager, element_factory)
scrolled_window = ns.open() # no... | <commit_before><commit_msg>Add tests for Namespace component<commit_after>import pytest
from gaphor import UML
from gaphor.core.modeling import Diagram
from gaphor.ui.namespace import Namespace, popup_model
@pytest.fixture
def namespace(event_manager, element_factory):
ns = Namespace(event_manager, element_facto... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.