commit
stringlengths
40
40
old_file
stringlengths
4
150
new_file
stringlengths
4
150
old_contents
stringlengths
0
3.26k
new_contents
stringlengths
1
4.43k
subject
stringlengths
15
501
message
stringlengths
15
4.06k
lang
stringclasses
4 values
license
stringclasses
13 values
repos
stringlengths
5
91.5k
diff
stringlengths
0
4.35k
5ad9bcd6da4c3f4d8333397169f6af76f8946330
django_afip/migrations/0012_taxpayer_profile_one_to_one.py
django_afip/migrations/0012_taxpayer_profile_one_to_one.py
# -*- coding: utf-8 -*- # Generated by Django 1.9 on 2016-02-03 02:56 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('afip', '0011_receipt_entry_vat'), ] operations = [ ...
Add missing migration for 4503f10
Add missing migration for 4503f10
Python
isc
hobarrera/django-afip,hobarrera/django-afip
--- +++ @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9 on 2016-02-03 02:56 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('afip', '0011_receipt_en...
d6e9fd27633882274cd272c707097a2646b2f129
tt/tests/unit/tables/test_static_methods_truth_table.py
tt/tests/unit/tables/test_static_methods_truth_table.py
from ._helpers import TruthTableTestCase from ....tables import TruthTable class TestStaticMethodsTruthTable(TruthTableTestCase): def test_generate_symbols_0(self): """Test generating 0 symbols.""" self.assertEqual( TruthTable.generate_symbols(0), []) def test_generat...
Add tests for TruthTable class static methods
Add tests for TruthTable class static methods
Python
mit
welchbj/tt,welchbj/tt,welchbj/tt
--- +++ @@ -0,0 +1,53 @@ +from ._helpers import TruthTableTestCase +from ....tables import TruthTable + + +class TestStaticMethodsTruthTable(TruthTableTestCase): + + def test_generate_symbols_0(self): + """Test generating 0 symbols.""" + self.assertEqual( + TruthTable.generate_symbols(0), ...
46b1fe384f6d7f282c70f10dbb7911c7a2cb53e7
plugins/CoD4_MW.py
plugins/CoD4_MW.py
import os from lib.base_plugin import BasePlugin from lib.paths import SteamGamesPath class CoD4MWPlugin(BasePlugin): Name = "Call of Duty 4: Modern Warfare" support_os = ["Windows"] def backup(self, _): _.add_folder('Profiles', os.path.join(SteamGamesPath, 'Call of Duty 4'), 'players') def ...
Call of Duty 4: Modern Warfare plugin
Call of Duty 4: Modern Warfare plugin
Python
mit
Pr0Ger/SGSB
--- +++ @@ -0,0 +1,19 @@ +import os +from lib.base_plugin import BasePlugin +from lib.paths import SteamGamesPath + + +class CoD4MWPlugin(BasePlugin): + Name = "Call of Duty 4: Modern Warfare" + support_os = ["Windows"] + + def backup(self, _): + _.add_folder('Profiles', os.path.join(SteamGamesPath, '...
51fd06209a46ce8162cf59b53667b07c9d6cfe52
test/frmwrk_1/test_frmwrk_1.py
test/frmwrk_1/test_frmwrk_1.py
import os import pathlib import subprocess def setup_module(): rm_paths = [ '.*testsuite.sv', '.testrunner.gold', '.testrunner.gold.tmp', '.testrunner.sv', '.svunit_top.sv', '.testsuite.gold', '.testsuite.gold.tmp', 'test_unit_test.sv', 'test...
Create pytest version of frmwrk_1 test
Create pytest version of frmwrk_1 test
Python
apache-2.0
svunit/svunit,svunit/svunit,svunit/svunit,nosnhojn/svunit-code,nosnhojn/svunit-code,nosnhojn/svunit-code
--- +++ @@ -0,0 +1,46 @@ +import os +import pathlib +import subprocess + + +def setup_module(): + rm_paths = [ + '.*testsuite.sv', + '.testrunner.gold', + '.testrunner.gold.tmp', + '.testrunner.sv', + '.svunit_top.sv', + '.testsuite.gold', + '.testsuite.gold.tmp', +...
e3012a79401d47d02fe6a2245fe0f65c1e3fce06
tests/acceptance/test_build.py
tests/acceptance/test_build.py
#!/usr/bin/python # Copyright 2016 Mender Software AS # # 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 ...
Add test to make sure our server certificate check stays up to date.
Add test to make sure our server certificate check stays up to date. Signed-off-by: Kristian Amlie <505e66ae45028a0596c853559221f0b72c1cee21@mender.io>
Python
apache-2.0
bboozzoo/meta-mender,bboozzoo/meta-mender,bboozzoo/meta-mender,bboozzoo/meta-mender
--- +++ @@ -0,0 +1,31 @@ +#!/usr/bin/python +# Copyright 2016 Mender Software AS +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LIC...
4acbf2c0675eeb5491616ba854ee2cc93812813f
abusehelper/contrib/experts/iscexpert.py
abusehelper/contrib/experts/iscexpert.py
import idiokit from abusehelper.core import bot, events, utils from combiner import Expert import socket import json ISC_IP_API_URL = "http://isc.sans.edu/api/ip" def is_ipv4(ip): try: socket.inet_aton(ip) except (ValueError, socket.error): return False return True class IscExpert(Expert)...
Add Internet Storm Center IP API expert.
Add Internet Storm Center IP API expert.
Python
mit
abusesa/abusehelper
--- +++ @@ -0,0 +1,49 @@ +import idiokit +from abusehelper.core import bot, events, utils +from combiner import Expert +import socket +import json + +ISC_IP_API_URL = "http://isc.sans.edu/api/ip" + +def is_ipv4(ip): + try: + socket.inet_aton(ip) + except (ValueError, socket.error): + return False ...
db150068c0985bd2b87bebdc3909f0ec7bd08e56
py/keyboard-row.py
py/keyboard-row.py
class Solution(object): def findWords(self, words): """ :type words: List[str] :rtype: List[str] """ rows = [ set('qwertyuiop'), set('asdfghjkl'), set('zxcvbnm'), ] return filter(lambda w: not all([len(se...
Add py solution for 500. Keyboard Row
Add py solution for 500. Keyboard Row 500. Keyboard Row: https://leetcode.com/problems/keyboard-row/
Python
apache-2.0
ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode
--- +++ @@ -0,0 +1,12 @@ +class Solution(object): + def findWords(self, words): + """ + :type words: List[str] + :rtype: List[str] + """ + rows = [ + set('qwertyuiop'), + set('asdfghjkl'), + set('zxcvbnm'), + ] + ...
8db34671110ab0161704a2d1f52b050502dea5d0
qnd/config_test.py
qnd/config_test.py
import sys import unittest import tensorflow as tf from .config import * class TestConfig(unittest.TestCase): def test_def_config(self): config = def_config() self.assertTrue(isinstance(config(), tf.contrib.learn.ClusterConfig)) def append_argv(): sys.argv += [ "--ps_hosts", "localhost:4242", ...
Add test of config module
Add test of config module
Python
unlicense
raviqqe/tensorflow-qnd,raviqqe/tensorflow-qnd
--- +++ @@ -0,0 +1,26 @@ +import sys +import unittest + +import tensorflow as tf + +from .config import * + + + +class TestConfig(unittest.TestCase): + def test_def_config(self): + config = def_config() + self.assertTrue(isinstance(config(), tf.contrib.learn.ClusterConfig)) + + +def append_argv(): + sys.argv ...
986d0e103588cd2754c887ebb6a2db3769508553
st2actions/tests/unit/test_actionchain_params_rendering.py
st2actions/tests/unit/test_actionchain_params_rendering.py
# Licensed to the StackStorm, Inc ('StackStorm') under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use th...
Add unit test for action_context params rendering in chain
Add unit test for action_context params rendering in chain
Python
apache-2.0
StackStorm/st2,pixelrebel/st2,peak6/st2,dennybaa/st2,tonybaloney/st2,armab/st2,lakshmi-kannan/st2,Plexxi/st2,punalpatel/st2,punalpatel/st2,dennybaa/st2,armab/st2,dennybaa/st2,punalpatel/st2,Plexxi/st2,Itxaka/st2,emedvedev/st2,StackStorm/st2,Plexxi/st2,lakshmi-kannan/st2,pixelrebel/st2,Itxaka/st2,peak6/st2,lakshmi-kanna...
--- +++ @@ -0,0 +1,64 @@ +# Licensed to the StackStorm, Inc ('StackStorm') under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (th...
fb725482a68d0418c1bb563e4787e0389138f2ca
ecosystem/python/sdk/account_address.py
ecosystem/python/sdk/account_address.py
# Copyright (c) Aptos # SPDX-License-Identifier: Apache-2.0 from __future__ import annotations import hashlib import io import typing import unittest from bcs import Deserializer, Serializer import ed25519 class AccountAddress: address: bytes LENGTH: int = 32 def __init__(self, address: bytes): ...
Add support for account address
[python-sdk] Add support for account address While there's not much to account addresses, having convenience to move from hex, bytes, and public keys is useful. Much of this will need to be moved to the authenticator library as it is built out.
Python
apache-2.0
aptos-labs/aptos-core,aptos-labs/aptos-core,aptos-labs/aptos-core,aptos-labs/aptos-core,aptos-labs/aptos-core,aptos-labs/aptos-core,aptos-labs/aptos-core
--- +++ @@ -0,0 +1,53 @@ +# Copyright (c) Aptos +# SPDX-License-Identifier: Apache-2.0 + +from __future__ import annotations +import hashlib +import io +import typing +import unittest + +from bcs import Deserializer, Serializer +import ed25519 + +class AccountAddress: + address: bytes + LENGTH: int = 32 + + ...
e0b5807948b7994d036c4f4354714aba0c194b4d
scripts/tidy_ecr_repo.py
scripts/tidy_ecr_repo.py
#!/usr/bin/env python # -*- encoding: utf-8 import datetime as dt import getpass import boto3 import click def role_arn_to_session(**kwargs): client = boto3.client("sts") response = client.assume_role(**kwargs) return boto3.Session( aws_access_key_id=response["Credentials"]["AccessKeyId"], ...
Add a script for deleting ECR images older than N days
Add a script for deleting ECR images older than N days
Python
mit
wellcometrust/platform-api,wellcometrust/platform-api,wellcometrust/platform-api,wellcometrust/platform-api
--- +++ @@ -0,0 +1,55 @@ +#!/usr/bin/env python +# -*- encoding: utf-8 + +import datetime as dt +import getpass + +import boto3 +import click + + +def role_arn_to_session(**kwargs): + client = boto3.client("sts") + response = client.assume_role(**kwargs) + return boto3.Session( + aws_access_key_id=res...
5503b6f20ed6bfb28c5d3285b36c7ec809ced55d
salt/modules/philips_hue.py
salt/modules/philips_hue.py
# -*- coding: utf-8 -*- ''' Philips HUE lamps module for proxy. ''' from __future__ import absolute_import import sys __virtualname__ = 'hue' __proxyenabled__ = ['philips_hue'] def _proxy(): ''' Get proxy. ''' return __opts__['proxymodule'] def __virtual__(): ''' Start the Philips HUE only...
Implement Philips HUE wrapper caller for Minion Proxy
Implement Philips HUE wrapper caller for Minion Proxy
Python
apache-2.0
saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt
--- +++ @@ -0,0 +1,36 @@ +# -*- coding: utf-8 -*- +''' +Philips HUE lamps module for proxy. +''' + +from __future__ import absolute_import +import sys + +__virtualname__ = 'hue' +__proxyenabled__ = ['philips_hue'] + + +def _proxy(): + ''' + Get proxy. + ''' + return __opts__['proxymodule'] + + +def __virt...
9e7363f3ad7521914eeb85d20f6dc3a6987400c4
examples/example_test_coverage_upload.py
examples/example_test_coverage_upload.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import glob import datetime from teamscale_client import TeamscaleClient from teamscale_client.constants import CoverageFormats TEAMSCALE_URL = "http://localhost:8080" ...
Add example for coverage upload
Add example for coverage upload
Python
apache-2.0
cqse/teamscale-client-python
--- +++ @@ -0,0 +1,24 @@ +from __future__ import absolute_import +from __future__ import division +from __future__ import print_function +from __future__ import unicode_literals + +import glob +import datetime + +from teamscale_client import TeamscaleClient +from teamscale_client.constants import CoverageFormats + +T...
15f930276b8922d4fd58885cee282793e7dd7a96
scripts/dummytemperature.py
scripts/dummytemperature.py
#!/usr/bin/env python from dbus.mainloop.glib import DBusGMainLoop import gobject import argparse import logging import sys import os # our own packages sys.path.insert(1, os.path.join(os.path.dirname(__file__), '../ext/velib_python')) from dbusdummyservice import DbusDummyService from logger import setup_logging # ...
Add dummy temperature script (for testing).
Add dummy temperature script (for testing).
Python
mit
victronenergy/dbus-systemcalc-py
--- +++ @@ -0,0 +1,46 @@ +#!/usr/bin/env python + +from dbus.mainloop.glib import DBusGMainLoop +import gobject +import argparse +import logging +import sys +import os + +# our own packages +sys.path.insert(1, os.path.join(os.path.dirname(__file__), '../ext/velib_python')) +from dbusdummyservice import DbusDummyServi...
a00c9f1d7d25daa149305d211d1c653e7f0b72f3
scripts/download-jamendo.py
scripts/download-jamendo.py
#!/usr/bin/env python # Jamendo database dumps can be fetched from: http://img.jamendo.com/data/dbdump_artistalbumtrack.xml.gz import xml.etree.cElementTree as ElementTree import sys, gzip, time, os.path, urllib class DownloadJamendo: def __init__(self, destination): if not os.path.exists(destination): os.m...
Add a script to download all the fully free tracks from Jamendo (as Ogg Vorbis)
Add a script to download all the fully free tracks from Jamendo (as Ogg Vorbis)
Python
agpl-3.0
foocorp/gnu-fm,foocorp/gnu-fm,foocorp/gnu-fm,foocorp/gnu-fm,foocorp/gnu-fm,foocorp/gnu-fm,foocorp/gnu-fm,foocorp/gnu-fm,foocorp/gnu-fm
--- +++ @@ -0,0 +1,78 @@ +#!/usr/bin/env python + +# Jamendo database dumps can be fetched from: http://img.jamendo.com/data/dbdump_artistalbumtrack.xml.gz + +import xml.etree.cElementTree as ElementTree +import sys, gzip, time, os.path, urllib + + +class DownloadJamendo: + + + def __init__(self, destination): + if ...
0b32ce31d3c066f83565e678d66faeb58e835ae9
bvg_cli.py
bvg_cli.py
import requests from lxml import html BVG_URL = 'http://mobil.bvg.de/Fahrinfo/bin/stboard.bin/dox?' def request_station_ids(station_name): ''' Requests the station ids for the provided station name. The function has two different outcomes dependend on how distinctive the station name is. A list of poss...
Add function to request station ids
Add function to request station ids
Python
mit
behrtam/bvg-cli,behrtam/bvg-cli
--- +++ @@ -0,0 +1,41 @@ +import requests +from lxml import html + + +BVG_URL = 'http://mobil.bvg.de/Fahrinfo/bin/stboard.bin/dox?' + + +def request_station_ids(station_name): + ''' Requests the station ids for the provided station name. + + The function has two different outcomes dependend on how distinctive +...
0f853e6044be1a3430f92b3ec14f83432aa3635c
intelmq/bots/outputs/misp/output_api.py
intelmq/bots/outputs/misp/output_api.py
"""Connect to MISP instance and add event as MISPObject if not reported already. SPDX-FileCopyrightText: 2020 Intevation GmbH <https://intevation.de> SPDX-License-Identifier: AGPL-3.0-or-later Funding: of initial version by SUNET Author(s): * Bernhard Reiter <bernhard@intevation.de> Parameters: - misp_url: URL o...
Add stub for output bot misp api
Add stub for output bot misp api
Python
agpl-3.0
certtools/intelmq,aaronkaplan/intelmq,aaronkaplan/intelmq,certtools/intelmq,certtools/intelmq,aaronkaplan/intelmq
--- +++ @@ -0,0 +1,79 @@ +"""Connect to MISP instance and add event as MISPObject if not reported already. + +SPDX-FileCopyrightText: 2020 Intevation GmbH <https://intevation.de> +SPDX-License-Identifier: AGPL-3.0-or-later + +Funding: of initial version by SUNET +Author(s): + * Bernhard Reiter <bernhard@intevation.d...
2936357c27dfcb91b55c12c83ac8dd1bbc42be14
src/DataSounds/editops.py
src/DataSounds/editops.py
#/usr/bin/env python # -*- coding: utf-8 -*- from difflib import SequenceMatcher try: from StringIO import StringIO except ImportError: from io import StringIO from sebastian.lilypond.interp import parse from sebastian.midi.write_midi import SMF from DataSounds.sounds import build_scale def tone_down(note,...
Add a new method, edit operations.
Add a new method, edit operations. * Still need to think more, but for now we have four operations: replace, equal, delete, insert. These operation are mapped to rest note, repeat or stretch note, go down one tone, go up one tone. * Use sebastian for tone up/tone down, current functions are too hackish.
Python
bsd-3-clause
DataSounds/DataSounds
--- +++ @@ -0,0 +1,58 @@ +#/usr/bin/env python +# -*- coding: utf-8 -*- + +from difflib import SequenceMatcher +try: + from StringIO import StringIO +except ImportError: + from io import StringIO + +from sebastian.lilypond.interp import parse +from sebastian.midi.write_midi import SMF + +from DataSounds.sounds ...
b3d44b52dac01a2f161e43872e2fdd86a0cd1b3e
accounting/apps/clients/urls.py
accounting/apps/clients/urls.py
from django.conf.urls import patterns, url from . import views urlpatterns = patterns('', # Clients url(r'^client/$', views.ClientListView.as_view(), name="client-list"), url(r'^client/create/$', views.ClientCreateView.as_view(), name="client-create"), url(r'^client/(...
from django.conf.urls import patterns, url from . import views urlpatterns = patterns('', # Clients url(r'^client/$', views.ClientListView.as_view(), name="client-list"), url(r'^client/create/$', views.ClientCreateView.as_view(), name="client-create"), url(r'^client/(...
Support client after the 9th :dancer:
Support client after the 9th :dancer:
Python
mit
kenjhim/django-accounting,dulaccc/django-accounting,dulaccc/django-accounting,kenjhim/django-accounting,dulaccc/django-accounting,dulaccc/django-accounting,kenjhim/django-accounting,kenjhim/django-accounting
--- +++ @@ -12,10 +12,10 @@ url(r'^client/create/$', views.ClientCreateView.as_view(), name="client-create"), - url(r'^client/(?P<pk>\d)/edit/$', + url(r'^client/(?P<pk>\d+)/edit/$', views.ClientUpdateView.as_view(), name="client-edit"), - url(r'^client/(?P<pk>\d)/det...
db409d2d5f8a4862e6119e40852d5305f9dbbb9a
scripts/random-system-sound.py
scripts/random-system-sound.py
import os import random import subprocess SOUNDS_DIR = '/System/Library/Sounds' SOUNDS = os.listdir(SOUNDS_DIR) if random.randrange(0, 100) < 4: to_play = os.path.join(SOUNDS_DIR, random.choice(SOUNDS)) subprocess.call(['afplay', '-v', str(random.choice(range(10, 51))), to_play])
Add script to play random system sound
Add script to play random system sound
Python
unlicense
epochblue/annoy-a-tron,epochblue/annoy-a-tron
--- +++ @@ -0,0 +1,11 @@ +import os +import random +import subprocess + +SOUNDS_DIR = '/System/Library/Sounds' +SOUNDS = os.listdir(SOUNDS_DIR) + +if random.randrange(0, 100) < 4: + to_play = os.path.join(SOUNDS_DIR, random.choice(SOUNDS)) + subprocess.call(['afplay', '-v', str(random.choice(range(10, 51))), to...
8bd3aac86d6ea22f87d3f4d88f9916f128c426ee
mne/preprocessing/tests/test_maxwell.py
mne/preprocessing/tests/test_maxwell.py
# Author: Mark Wronkiewicz <wronk@uw.edu> # # License: BSD (3-clause) import os.path as op import warnings from nose.tools import assert_true, assert_equal from numpy.testing import assert_array_almost_equal import numpy as np from ...io import Raw from ..maxwell import _sss_basis, maxwell_filter, _sph_harmonic fro...
Add tests for maxwell filtering
ENH: Add tests for maxwell filtering
Python
bsd-3-clause
matthew-tucker/mne-python,yousrabk/mne-python,wronk/mne-python,Eric89GXL/mne-python,lorenzo-desantis/mne-python,kingjr/mne-python,mne-tools/mne-python,ARudiuk/mne-python,matthew-tucker/mne-python,adykstra/mne-python,antiface/mne-python,trachelr/mne-python,antiface/mne-python,olafhauk/mne-python,drammock/mne-python,wron...
--- +++ @@ -0,0 +1,37 @@ +# Author: Mark Wronkiewicz <wronk@uw.edu> +# +# License: BSD (3-clause) + +import os.path as op +import warnings + +from nose.tools import assert_true, assert_equal +from numpy.testing import assert_array_almost_equal +import numpy as np + +from ...io import Raw +from ..maxwell import _sss_b...
0323189a504f27f14d60c8c3ebdb40ea160d7f79
source/clique/collection.py
source/clique/collection.py
# :coding: utf-8 # :copyright: Copyright (c) 2013 Martin Pengelly-Phillips # :license: See LICENSE.txt. import re class Collection(object): '''Represent group of items that differ only by numerical component.''' def __init__(self, head, tail, padding, indexes=None): '''Initialise collection. ...
Add initial interface for Collection class with stubs for methods.
Add initial interface for Collection class with stubs for methods. A Collection will represent a group of items with a common numerical component.
Python
apache-2.0
4degrees/clique
--- +++ @@ -0,0 +1,93 @@ +# :coding: utf-8 +# :copyright: Copyright (c) 2013 Martin Pengelly-Phillips +# :license: See LICENSE.txt. + +import re + + +class Collection(object): + '''Represent group of items that differ only by numerical component.''' + + def __init__(self, head, tail, padding, indexes=None): + ...
d79a6877efab4ee4346bc085cb564a4e315e6293
scripts/convert_kanjidic2.py
scripts/convert_kanjidic2.py
#!/usr/bin/env python2 import json with open("kanjidic2.json", "rb") as f: raw = f.read() kanjidic2 = json.loads(raw) # Makes a dictionary where each key is a kanji, instead of a big list of objects transformed = {kanjidic2[i]["literal"]: kanjidic2[i] for i in xrange(len(kanjidic2))} with ope...
Add script for converting kanjidic2
Add script for converting kanjidic2
Python
apache-2.0
Tenchi2xh/rem-v2,Tenchi2xh/rem-v2,Tenchi2xh/rem-v2
--- +++ @@ -0,0 +1,14 @@ +#!/usr/bin/env python2 + +import json + +with open("kanjidic2.json", "rb") as f: + raw = f.read() + kanjidic2 = json.loads(raw) + +# Makes a dictionary where each key is a kanji, instead of a big list of objects +transformed = {kanjidic2[i]["literal"]: kanjidic2[i] + for ...
ec894ced711d7c4ad6c0e0146792df8b05b998b3
cyder/base/eav/tests/test_utils.py
cyder/base/eav/tests/test_utils.py
from django.core.exceptions import ValidationError from django.test import TestCase from cyder.base.eav import utils as u class TestUtils(TestCase): def _valid(self, func, value_list): for value in value_list: self.assertTrue(func(value)) def _invalid(self, func, value_list): fo...
Add tests for is_hex_byte and is_hex_byte_sequence
Add tests for is_hex_byte and is_hex_byte_sequence
Python
bsd-3-clause
OSU-Net/cyder,murrown/cyder,murrown/cyder,akeym/cyder,drkitty/cyder,akeym/cyder,drkitty/cyder,zeeman/cyder,OSU-Net/cyder,akeym/cyder,drkitty/cyder,OSU-Net/cyder,murrown/cyder,drkitty/cyder,OSU-Net/cyder,zeeman/cyder,zeeman/cyder,akeym/cyder,murrown/cyder,zeeman/cyder
--- +++ @@ -0,0 +1,36 @@ +from django.core.exceptions import ValidationError +from django.test import TestCase + +from cyder.base.eav import utils as u + + +class TestUtils(TestCase): + def _valid(self, func, value_list): + for value in value_list: + self.assertTrue(func(value)) + + + def _inv...
af75ac1c52026e704f586dbd2dd709bb43a9184e
extruder/extrude_template.py
extruder/extrude_template.py
from __future__ import print_function, division, absolute_import from argparse import ArgumentParser def main(args=None): if args is None: parser = ArgumentParser('Tool for generating skeleton package-' 'building directory.') parser.add_argument('--appveyor-secret'...
Add stub of script to generate a skeleton build directory
Add stub of script to generate a skeleton build directory
Python
bsd-3-clause
astropy/conda-build-tools,astropy/conda-build-tools
--- +++ @@ -0,0 +1,18 @@ +from __future__ import print_function, division, absolute_import + +from argparse import ArgumentParser + + +def main(args=None): + if args is None: + parser = ArgumentParser('Tool for generating skeleton package-' + 'building directory.') + pa...
256829c6ab4b04ce1b576d26597f4630e050309c
src/ggrc_gdrive_integration/migrations/versions/20170311201102_5405cc1ae721_fix_audit_context_on_folders.py
src/ggrc_gdrive_integration/migrations/versions/20170311201102_5405cc1ae721_fix_audit_context_on_folders.py
# Copyright (C) 2017 Google Inc. # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> """ Fix audit context on folders Create Date: 2017-03-11 20:11:02.652252 """ # disable Invalid constant name pylint warning for mandatory Alembic variables. # pylint: disable=invalid-name from alembic impo...
Fix audit context for object_folders
Fix audit context for object_folders
Python
apache-2.0
AleksNeStu/ggrc-core,plamut/ggrc-core,AleksNeStu/ggrc-core,AleksNeStu/ggrc-core,AleksNeStu/ggrc-core,plamut/ggrc-core,plamut/ggrc-core,plamut/ggrc-core
--- +++ @@ -0,0 +1,36 @@ +# Copyright (C) 2017 Google Inc. +# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> + +""" +Fix audit context on folders + +Create Date: 2017-03-11 20:11:02.652252 +""" +# disable Invalid constant name pylint warning for mandatory Alembic variables. +# pylint: di...
1909e42563dff9b711795ac4da2a954dd53737cd
tempest/api/identity/admin/v3/test_users_negative.py
tempest/api/identity/admin/v3/test_users_negative.py
# Copyright 2015 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.apache.org/licenses/LICENSE-2.0 # # Unless requ...
Add keystone v3 user negative cases
Add keystone v3 user negative cases Implement the keystone v3 user negative case: test_create_user_for_non_existent_domain Change-Id: I644cfb0bea4abe2932a759ff86f446043170488d Partial-Bug: 1513748
Python
apache-2.0
LIS/lis-tempest,Juniper/tempest,sebrandon1/tempest,openstack/tempest,masayukig/tempest,Tesora/tesora-tempest,zsoltdudas/lis-tempest,bigswitch/tempest,masayukig/tempest,vedujoshi/tempest,LIS/lis-tempest,sebrandon1/tempest,Juniper/tempest,bigswitch/tempest,Tesora/tesora-tempest,cisco-openstack/tempest,openstack/tempest,c...
--- +++ @@ -0,0 +1,35 @@ +# Copyright 2015 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.apache.org/lice...
4f88f23104c2f15e2f0919931033ce9047a68036
src/diamond/handler/Handler.py
src/diamond/handler/Handler.py
# coding=utf-8 import logging import threading import traceback class Handler(object): """ Handlers process metrics that are collected by Collectors. """ def __init__(self, config=None): """ Create a new instance of the Handler class """ # Initialize Log self.l...
# coding=utf-8 import logging import threading import traceback class Handler(object): """ Handlers process metrics that are collected by Collectors. """ def __init__(self, config=None): """ Create a new instance of the Handler class """ # Initialize Log self.l...
Change to using threading.Lock instead of threading.Condition, and check lock state before trying to release it during the finally block
Change to using threading.Lock instead of threading.Condition, and check lock state before trying to release it during the finally block
Python
mit
zoidbergwill/Diamond,Netuitive/Diamond,EzyInsights/Diamond,mfriedenhagen/Diamond,codepython/Diamond,thardie/Diamond,acquia/Diamond,cannium/Diamond,timchenxiaoyu/Diamond,Clever/Diamond,janisz/Diamond-1,datafiniti/Diamond,tuenti/Diamond,krbaker/Diamond,Ensighten/Diamond,mfriedenhagen/Diamond,tusharmakkar08/Diamond,sebbra...
--- +++ @@ -18,7 +18,7 @@ # Initialize Data self.config = config # Initialize Lock - self.lock = threading.Condition(threading.Lock()) + self.lock = threading.Lock() def _process(self, metric): """ @@ -31,9 +31,10 @@ self.process(metric) ...
a2841c9e5c1f69f14c3870381def382cc6d0ddf9
mrbelvedereci/repository/migrations/0002_auto_20171028_1509.py
mrbelvedereci/repository/migrations/0002_auto_20171028_1509.py
# -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2017-10-28 15:09 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('repository', '0001_initial'), ] operations = [ migrations.AlterModelOptions( ...
Add migration for Meta changes on Branch and Repository
Add migration for Meta changes on Branch and Repository
Python
bsd-3-clause
SalesforceFoundation/mrbelvedereci,SalesforceFoundation/mrbelvedereci,SalesforceFoundation/mrbelvedereci,SalesforceFoundation/mrbelvedereci
--- +++ @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10.7 on 2017-10-28 15:09 +from __future__ import unicode_literals + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('repository', '0001_initial'), + ] + + operations = [ + ...
f2820ad7022c6db78186d04d11a1ded1f02fa7e6
landlab/components/stream_power/examples/test_voronoi_sp.py
landlab/components/stream_power/examples/test_voronoi_sp.py
from landlab import VoronoiDelaunayGrid # , RasterModelGrid from landlab.components.flow_routing.route_flow_dn import FlowRouter from landlab.components.stream_power.stream_power import StreamPowerEroder import numpy as np x, y = np.random.rand(50), np.random.rand(50) mg = VoronoiDelaunayGrid(x,y) #mg = RasterModelGr...
Test driver for Voronoi stream power
Test driver for Voronoi stream power What it says on the tin. Very simple.
Python
mit
RondaStrauch/landlab,laijingtao/landlab,Carralex/landlab,cmshobe/landlab,Carralex/landlab,amandersillinois/landlab,ManuSchmi88/landlab,cmshobe/landlab,ManuSchmi88/landlab,SiccarPoint/landlab,SiccarPoint/landlab,landlab/landlab,landlab/landlab,Carralex/landlab,RondaStrauch/landlab,ManuSchmi88/landlab,csherwood-usgs/land...
--- +++ @@ -0,0 +1,17 @@ +from landlab import VoronoiDelaunayGrid # , RasterModelGrid +from landlab.components.flow_routing.route_flow_dn import FlowRouter +from landlab.components.stream_power.stream_power import StreamPowerEroder +import numpy as np + +x, y = np.random.rand(50), np.random.rand(50) +mg = VoronoiDel...
deb281740b10855f1d419445b29d07e41619da49
src/inv_kinematics.py
src/inv_kinematics.py
#!/usr/bin/env python3 import math def get_angles(x, y, z): """Return joint angles based on passed position.""" # Values below are given in milimeters b = 35 # Shoulder width l1 = 120 # Shoulder to elbow length l2 = 100 # elbow to hand length # Shoulder to hand length d = math.sqrt(x ** 2...
Add function to solve inverse kinematics task
Add function to solve inverse kinematics task
Python
mit
saleone/bachelor-thesis
--- +++ @@ -0,0 +1,51 @@ +#!/usr/bin/env python3 +import math + +def get_angles(x, y, z): + """Return joint angles based on passed position.""" + + # Values below are given in milimeters + b = 35 # Shoulder width + l1 = 120 # Shoulder to elbow length + l2 = 100 # elbow to hand length + + # Shoulder ...
011111f423d8a50fc66a383c0f28c76a9854105a
heat/tests/test_barbican_client.py
heat/tests/test_barbican_client.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 # ...
Add test for barbican client
Add test for barbican client Change-Id: I9236e62f3259cfd560e3837830191012d107e853 Partial-Bug: #1461967
Python
apache-2.0
jasondunsmore/heat,cryptickp/heat,noironetworks/heat,cwolferh/heat-scratch,maestro-hybrid-cloud/heat,noironetworks/heat,rh-s/heat,miguelgrinberg/heat,jasondunsmore/heat,steveb/heat,gonzolino/heat,dragorosson/heat,pratikmallya/heat,srznew/heat,steveb/heat,dims/heat,pratikmallya/heat,dragorosson/heat,cwolferh/heat-scratc...
--- +++ @@ -0,0 +1,24 @@ +# +# 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 ...
653e8e229e27001ff66d7c9f886fae272e0446b9
examples/trafos/wavelet_trafo.py
examples/trafos/wavelet_trafo.py
# Copyright 2014-2016 The ODL development group # # This file is part of ODL. # # ODL is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. #...
Add example on how to use WaveletTransform
DOC: Add example on how to use WaveletTransform
Python
mpl-2.0
odlgroup/odl,aringh/odl,kohr-h/odl,aringh/odl,odlgroup/odl,kohr-h/odl
--- +++ @@ -0,0 +1,45 @@ +# Copyright 2014-2016 The ODL development group +# +# This file is part of ODL. +# +# ODL is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (a...
13dffb897617f87aaaee247095107d7011e002d5
kubernetes/test/test_api_client.py
kubernetes/test/test_api_client.py
# coding: utf-8 import atexit import weakref import unittest import kubernetes class TestApiClient(unittest.TestCase): def test_context_manager_closes_threadpool(self): with kubernetes.client.ApiClient() as client: self.assertIsNotNone(client.pool) pool_ref = weakref.ref(client...
Add test to ensure kubernetes client threadpool is cleaned up
Add test to ensure kubernetes client threadpool is cleaned up
Python
apache-2.0
kubernetes-client/python,kubernetes-client/python
--- +++ @@ -0,0 +1,25 @@ +# coding: utf-8 + + +import atexit +import weakref +import unittest + +import kubernetes + + +class TestApiClient(unittest.TestCase): + + def test_context_manager_closes_threadpool(self): + with kubernetes.client.ApiClient() as client: + self.assertIsNotNone(client.pool)...
0ab00b948be0096cbb71642c27d554b5f3666914
django_summernote/migrations/0002_update-help_text.py
django_summernote/migrations/0002_update-help_text.py
# -*- coding: utf-8 -*- # Generated by Django 1.11.4 on 2017-09-11 07:47 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('django_summernote', '0001_initial'), ] operations = [ migrations.AlterField...
Add a migration for updating help_text
Add a migration for updating help_text
Python
mit
lqez/django-summernote,summernote/django-summernote,lqez/django-summernote,lqez/django-summernote,summernote/django-summernote,summernote/django-summernote
--- +++ @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.4 on 2017-09-11 07:47 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('django_summernote', '0001_initial'), + ] + + ope...
e65921311135c60c0f2409da98e412e3646c2be7
tempest/api/network/admin/test_negative_quotas.py
tempest/api/network/admin/test_negative_quotas.py
# Copyright 2015 Cloudwatt # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by app...
Add network quota exceeding negative test
Add network quota exceeding negative test A quota on the network resource is set. More network resources than allowed are created. The quota exceeding exception is then catched. Change-Id: Ic6b846a42276a4cccc0b95fc8654f8c2c16d75c5 Implements: blueprint add-test-for-quota-exceeding Signed-off-by: Antoine Eiche <7eb7c8...
Python
apache-2.0
zsoltdudas/lis-tempest,Juniper/tempest,vedujoshi/tempest,openstack/tempest,openstack/tempest,masayukig/tempest,zsoltdudas/lis-tempest,vedujoshi/tempest,sebrandon1/tempest,LIS/lis-tempest,Tesora/tesora-tempest,bigswitch/tempest,bigswitch/tempest,sebrandon1/tempest,cisco-openstack/tempest,cisco-openstack/tempest,LIS/lis-...
--- +++ @@ -0,0 +1,68 @@ +# Copyright 2015 Cloudwatt +# 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/LICENS...
a88d5414e7762e87c052ca9a28fe36a28b7d4d46
oscar/apps/partner/prices.py
oscar/apps/partner/prices.py
class TaxNotKnown(Exception): """ Exception for when a tax-inclusive price is requested but we don't know what the tax applicable is (yet). """ class Base(object): #: Whether any prices exist exists = False #: Whether tax is known for this product (and session) is_tax_known = False ...
class TaxNotKnown(Exception): """ Exception for when a tax-inclusive price is requested but we don't know what the tax applicable is (yet). """ class Base(object): """ The interface that any pricing policy must support """ #: Whether any prices exist exists = False #: Whether...
Add currency property to pricing policies
Add currency property to pricing policies
Python
bsd-3-clause
pdonadeo/django-oscar,jinnykoo/wuyisj.com,WillisXChen/django-oscar,bschuon/django-oscar,saadatqadri/django-oscar,kapari/django-oscar,adamend/django-oscar,adamend/django-oscar,bnprk/django-oscar,sonofatailor/django-oscar,Jannes123/django-oscar,faratro/django-oscar,MatthewWilkes/django-oscar,sasha0/django-oscar,anentropi...
--- +++ @@ -6,14 +6,21 @@ class Base(object): + """ + The interface that any pricing policy must support + """ + #: Whether any prices exist exists = False - #: Whether tax is known for this product (and session) + #: Whether tax is known is_tax_known = False - # Normal price...
3786aea82868eb6b08d99a0caa59b9f7ae6446c9
integration_test_generateSyntheticData.py
integration_test_generateSyntheticData.py
# -*- coding: utf-8 -*- import unittest import numpy as np import numpy.testing as npt from dipy.core.gradients import gradient_table from generateSyntheticData import (generateSyntheticInputs, generateSyntheticOutputsFromMultiTensorModel) class integration_test_generateSyntheticDa...
Test that shapes of input and output match up
Test that shapes of input and output match up
Python
bsd-3-clause
jsjol/GaussianProcessRegressionForDiffusionMRI,jsjol/GaussianProcessRegressionForDiffusionMRI
--- +++ @@ -0,0 +1,60 @@ +# -*- coding: utf-8 -*- + + +import unittest +import numpy as np +import numpy.testing as npt +from dipy.core.gradients import gradient_table +from generateSyntheticData import (generateSyntheticInputs, + generateSyntheticOutputsFromMultiTensorModel) + +clas...
4919ef51a5681eb329a4e9fc9a96f1c7706e829a
taiga/projects/notifications/migrations/0006_auto_20151103_0954.py
taiga/projects/notifications/migrations/0006_auto_20151103_0954.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('notifications', '0005_auto_20151005_1357'), ] operations = [ migrations.AlterField( model_name='notifypolicy', ...
Create missing migration in taiga.projects.notifications
[Backport] Create missing migration in taiga.projects.notifications
Python
agpl-3.0
Rademade/taiga-back,dayatz/taiga-back,bdang2012/taiga-back-casting,bdang2012/taiga-back-casting,xdevelsistemas/taiga-back-community,gam-phon/taiga-back,Rademade/taiga-back,gam-phon/taiga-back,taigaio/taiga-back,taigaio/taiga-back,xdevelsistemas/taiga-back-community,Rademade/taiga-back,bdang2012/taiga-back-casting,dayat...
--- +++ @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('notifications', '0005_auto_20151005_1357'), + ] + + operations = [ + migrations.AlterField(...
4c22b9529b9a7ac13c50bbac3ca81e450297b998
maintainers/scripts/hydra-eval-failures.py
maintainers/scripts/hydra-eval-failures.py
#!/usr/bin/env nix-shell #!nix-shell -i python -p pythonFull pythonPackages.requests pythonPackages.pyquery pythonPackages.click # To use, just execute this script with --help to display help. import subprocess import json import click import requests from pyquery import PyQuery as pq maintainers_json = subprocess...
Add a script to get failures for hydra eval /cc @globin
Add a script to get failures for hydra eval /cc @globin
Python
mit
NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,NixOS/nixpkgs,NixOS/nixpkgs,SymbiFlow/nixpkgs,SymbiFlow/nixpkgs,Symb...
--- +++ @@ -0,0 +1,89 @@ +#!/usr/bin/env nix-shell +#!nix-shell -i python -p pythonFull pythonPackages.requests pythonPackages.pyquery pythonPackages.click + +# To use, just execute this script with --help to display help. + +import subprocess +import json + +import click +import requests +from pyquery import PyQuery...
af994bff6378c045aed40573c7a6ccaa2bb84560
tests/writer/test_file.py
tests/writer/test_file.py
import unittest, argparse, os, tempfile from echolalia.writer.file import Writer class FileTestCase(unittest.TestCase): def setUp(self): self.parser = argparse.ArgumentParser() self.data = [{chr(i): i - 96} for i in xrange(97, 123)] self.writer = Writer() def test_add_args(self): new_parser = sel...
Add tests for writer file
Add tests for writer file
Python
mit
eiri/echolalia-prototype
--- +++ @@ -0,0 +1,28 @@ +import unittest, argparse, os, tempfile +from echolalia.writer.file import Writer + +class FileTestCase(unittest.TestCase): + + def setUp(self): + self.parser = argparse.ArgumentParser() + self.data = [{chr(i): i - 96} for i in xrange(97, 123)] + self.writer = Writer() + + def tes...
f49283377c7c1908afe67439a637c7414ce401f1
tests/query_test/test_chars.py
tests/query_test/test_chars.py
#!/usr/bin/env python # Copyright (c) 2012 Cloudera, Inc. All rights reserved. # import logging import pytest from copy import copy from tests.common.test_vector import * from tests.common.impala_test_suite import * class TestStringQueries(ImpalaTestSuite): @classmethod def get_workload(cls): return 'function...
#!/usr/bin/env python # Copyright (c) 2012 Cloudera, Inc. All rights reserved. # import logging import pytest from copy import copy from tests.common.test_vector import * from tests.common.impala_test_suite import * class TestStringQueries(ImpalaTestSuite): @classmethod def get_workload(cls): return 'function...
Fix char test to only run on test/none.
Fix char test to only run on test/none. Change-Id: I8f5ac5a6e7399ce2fdbe78d07ae24deaa1d7532d Reviewed-on: http://gerrit.sjc.cloudera.com:8080/4326 Tested-by: jenkins Reviewed-by: Alex Behm <fe1626037acfc2dc542d2aa723a6d14f2464a20c@cloudera.com>
Python
apache-2.0
theyaa/Impala,caseyching/Impala,theyaa/Impala,XiaominZhang/Impala,brightchen/Impala,bratatidas9/Impala-1,XiaominZhang/Impala,tempbottle/Impala,brightchen/Impala,bratatidas9/Impala-1,cchanning/Impala,brightchen/Impala,cloudera/recordservice,bratatidas9/Impala-1,brightchen/Impala,kapilrastogi/Impala,tempbottle/Impala,lir...
--- +++ @@ -36,7 +36,8 @@ cls.TestMatrix.add_dimension( create_exec_option_dimension(disable_codegen_options=[True])) cls.TestMatrix.add_constraint(lambda v:\ - v.get_value('table_format').file_format in ['text']) + v.get_value('table_format').file_format in ['text'] and + v.get_...
b6803d63107f74641f01930716f2c52d326d59d6
pycalphad/tests/test_plot.py
pycalphad/tests/test_plot.py
""" The plot test module verifies that the eqplot produces plots without error. """ from pycalphad import Database, eqplot, equilibrium import pycalphad.variables as v from pycalphad.tests.datasets import * from matplotlib.axes import Axes ALFE_DBF = Database(ALFE_TDB) ALCOCRNI_DBF = Database(ALCOCRNI_TDB) def tes...
Add integration tests for eqplot
TST: Add integration tests for eqplot
Python
mit
tkphd/pycalphad,tkphd/pycalphad,tkphd/pycalphad
--- +++ @@ -0,0 +1,39 @@ +""" +The plot test module verifies that the eqplot produces plots without error. +""" + +from pycalphad import Database, eqplot, equilibrium +import pycalphad.variables as v +from pycalphad.tests.datasets import * +from matplotlib.axes import Axes + + +ALFE_DBF = Database(ALFE_TDB) +ALCOCRNI...
c674a32f0138447923a548c0d21e0b4c7b031145
mrbelvedereci/plan/migrations/0005_plan_junit_path.py
mrbelvedereci/plan/migrations/0005_plan_junit_path.py
# -*- coding: utf-8 -*- # Generated by Django 1.10.3 on 2017-05-30 22:20 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('plan', '0004_remove_plan_devhub'), ] operations = [ migrations.AddField( ...
Add migration for junit_path field
Add migration for junit_path field
Python
bsd-3-clause
SalesforceFoundation/mrbelvedereci,SalesforceFoundation/mrbelvedereci,SalesforceFoundation/mrbelvedereci,SalesforceFoundation/mrbelvedereci
--- +++ @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10.3 on 2017-05-30 22:20 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('plan', '0004_remove_plan_devhub'), + ] + + opera...
ebbba9cfe923b86da28b9801515406efa1bdba4e
recipe_modules/raw_io/test_api.py
recipe_modules/raw_io/test_api.py
from slave import recipe_test_api class RawIOTestApi(recipe_test_api.RecipeTestApi): # pragma: no cover @recipe_test_api.placeholder_step_data @staticmethod def output(data, retcode=None): return data, retcode
Add the API available inside GenTests method for the raw_io module.
Add the API available inside GenTests method for the raw_io module. This CL makes the raw_io module ready to have its output mocked in GenTests. R=agable@chromium.org Review URL: https://codereview.chromium.org/160143003 git-svn-id: 239fca9b83025a0b6f823aeeca02ba5be3d9fd76@250773 0039d316-1c4b-4281-b951-d872f2087c9...
Python
bsd-3-clause
shishkander/recipes-py,shishkander/recipes-py,luci/recipes-py,luci/recipes-py
--- +++ @@ -0,0 +1,7 @@ +from slave import recipe_test_api + +class RawIOTestApi(recipe_test_api.RecipeTestApi): # pragma: no cover + @recipe_test_api.placeholder_step_data + @staticmethod + def output(data, retcode=None): + return data, retcode
71fcb6294e1a5e30c88fcf2045b4406764ebd803
IPython/frontend/qt/console/tests/test_console_widget.py
IPython/frontend/qt/console/tests/test_console_widget.py
# Standard library imports import unittest # System library imports from IPython.external.qt import QtGui # Local imports from IPython.frontend.qt.console.console_widget import ConsoleWidget class TestConsoleWidget(unittest.TestCase): @classmethod def setUpClass(cls): """ Create the application for...
Add tests to check the actual output on the console.
TST: Add tests to check the actual output on the console.
Python
bsd-3-clause
ipython/ipython,ipython/ipython
--- +++ @@ -0,0 +1,40 @@ +# Standard library imports +import unittest + +# System library imports +from IPython.external.qt import QtGui + +# Local imports +from IPython.frontend.qt.console.console_widget import ConsoleWidget + + +class TestConsoleWidget(unittest.TestCase): + + @classmethod + def setUpClass(cls...
30b8e75af44315576ff1ab010bee6668b8f90782
add_artists.py
add_artists.py
#!/Users/julian/.local/share/virtualenvs/great/bin/pypy """ * group by artist * canonical case * find existing artist """ import csv import subprocess import sys from great.models import music from great.web import engine_from_config from sqlalchemy import sql e = engine_from_config() def copy(text): subproces...
Add a temporary semi-interactive way to add artists.
Add a temporary semi-interactive way to add artists.
Python
mit
Julian/Great,Julian/Great,Julian/Great
--- +++ @@ -0,0 +1,48 @@ +#!/Users/julian/.local/share/virtualenvs/great/bin/pypy +""" +* group by artist +* canonical case +* find existing artist +""" +import csv +import subprocess +import sys + +from great.models import music +from great.web import engine_from_config +from sqlalchemy import sql + + +e = engine_fr...
2b83c83ceb9215bda88872a5a39f8b6006788ca5
count_labelsets.py
count_labelsets.py
"""Create multilabel data set with normalized spelling. The input consists of a directory of text files containing the dataset in historic spelling. The data set consists of: <sentence id>\t<sentence>\tEmotie_Liefde (embodied emotions labels separated by _) <sentence id>\t<sentence>\tNone ('None' if no words were tagg...
Add script to count label set statistics
Add script to count label set statistics Added a script that outputs statistics about label sets in the data.
Python
apache-2.0
NLeSC/embodied-emotions-scripts,NLeSC/embodied-emotions-scripts
--- +++ @@ -0,0 +1,57 @@ +"""Create multilabel data set with normalized spelling. +The input consists of a directory of text files containing the dataset in +historic spelling. + +The data set consists of: +<sentence id>\t<sentence>\tEmotie_Liefde (embodied emotions labels separated by +_) +<sentence id>\t<sentence>\...
678a27d21f9d8166c320180aebc91a0d2abe528d
tests/test_tagreplacement.py
tests/test_tagreplacement.py
# import pytest import sdsc #True # tagtype = str(tagsreplaced.group(1)) # tokens = int(tagsreplaced.group(2)) @pytest.mark.parametrize("text,result", ( # 0 - normal text, no op ('noop',(False, None, 1)), # 1 - regular tag replacement ('##@cooltag-1##',(True, 'cooltag', 1)), # 2 -...
Add test cases for tag replacement finder
Add test cases for tag replacement finder
Python
lgpl-2.1
sknorr/suse-doc-style-checker,sknorr/suse-doc-style-checker,sknorr/suse-doc-style-checker
--- +++ @@ -0,0 +1,32 @@ +# + +import pytest +import sdsc + +#True +# tagtype = str(tagsreplaced.group(1)) +# tokens = int(tagsreplaced.group(2)) + +@pytest.mark.parametrize("text,result", + ( + # 0 - normal text, no op + ('noop',(False, None, 1)), + # 1 - regular tag replacement + ('##@coo...
031a595900595bea181b2dc51c34eff44dab56a1
tests/treebrd/test_schema.py
tests/treebrd/test_schema.py
from unittest import TestCase from rapt.treebrd.errors import RelationReferenceError from rapt.treebrd.schema import Schema class TestSchema(TestCase): def test_contains_when_empty(self): self.assertFalse(Schema({}).contains('Relation')) def test_contains_when_false(self): self.assertFalse(Sc...
Add a test class for Schema.
Add a test class for Schema.
Python
mit
pyrapt/rapt
--- +++ @@ -0,0 +1,37 @@ +from unittest import TestCase +from rapt.treebrd.errors import RelationReferenceError +from rapt.treebrd.schema import Schema + + +class TestSchema(TestCase): + def test_contains_when_empty(self): + self.assertFalse(Schema({}).contains('Relation')) + + def test_contains_when_fal...
22ddf4ed423eabf86ff3aa3b7dcb183b96f700c7
HadithHouseWebsite/hadiths/migrations/0005_create_fulltextsearch_index.py
HadithHouseWebsite/hadiths/migrations/0005_create_fulltextsearch_index.py
from django.db import migrations from django.db.transaction import atomic from hadiths.initial_data import * from hadiths.models import Person, Hadith, HadithTag, Chain, ChainPersonRel, Book, HadithTagRel class Migration(migrations.Migration): dependencies = [ ('hadiths', '0004_add_first_hadiths'), ] oper...
Create full text indexes on 'text' and 'simple_text'
chore(text-fields): Create full text indexes on 'text' and 'simple_text' #228
Python
mit
hadithhouse/hadithhouse,hadithhouse/hadithhouse,hadithhouse/hadithhouse,rafidka/hadithhouse,rafidka/hadithhouse,rafidka/hadithhouse,hadithhouse/hadithhouse,hadithhouse/hadithhouse,rafidka/hadithhouse,hadithhouse/hadithhouse,rafidka/hadithhouse,rafidka/hadithhouse
--- +++ @@ -0,0 +1,18 @@ +from django.db import migrations +from django.db.transaction import atomic + +from hadiths.initial_data import * +from hadiths.models import Person, Hadith, HadithTag, Chain, ChainPersonRel, Book, HadithTagRel + + +class Migration(migrations.Migration): + dependencies = [ + ('hadiths', '...
789bb6a7454f029e9f101689ae604469412dae6e
tools/convert_mat_to_json.py
tools/convert_mat_to_json.py
# Script to convert proprietary .mat files into json import sys import os import glob import json import numpy as np from scipy.io import loadmat def main(mat_dir, out_dir): """ Script to convert all .mat files in mat_dir into corresponding json files in out_dir Any Matlab arrays are converted to lis...
Add script to convert .mat files to JSON
Add script to convert .mat files to JSON * This allows us to avoid having proprietary .mat files in our test data
Python
apache-2.0
voicesauce/opensauce-python,voicesauce/opensauce-python,voicesauce/opensauce-python
--- +++ @@ -0,0 +1,51 @@ +# Script to convert proprietary .mat files into json + +import sys +import os +import glob +import json +import numpy as np +from scipy.io import loadmat + +def main(mat_dir, out_dir): + """ Script to convert all .mat files in mat_dir into corresponding json files + in out_dir + + ...
7a09ee3ebf72bb2644f40b9ded208b266cfb6ff1
show_samples_cifar_conditional.py
show_samples_cifar_conditional.py
from pylearn2.utils import serial import sys _, model_path = sys.argv model = serial.load(model_path) space = model.generator.get_output_space() from pylearn2.config import yaml_parse from pylearn2.format.target_format import OneHotFormatter from pylearn2.gui.patch_viewer import PatchViewer import numpy as np dataset ...
Add model visualizer for CIFAR conditional
Add model visualizer for CIFAR conditional
Python
bsd-3-clause
hans/adversarial
--- +++ @@ -0,0 +1,54 @@ +from pylearn2.utils import serial +import sys +_, model_path = sys.argv +model = serial.load(model_path) +space = model.generator.get_output_space() +from pylearn2.config import yaml_parse +from pylearn2.format.target_format import OneHotFormatter +from pylearn2.gui.patch_viewer import Patch...
909ac33b64275b436209d77f9eba791e086cdb0e
notify_levure_app_of_save.py
notify_levure_app_of_save.py
import sublime import sublime_plugin import re class LevureAppNotify(sublime_plugin.EventListener): def on_post_save(self, view): # 1. Get script only stack name. line 1: script "Name" [done] # 2. Get project key from project settings # 3. Send notification over socket with project key and ...
Add python file that is triggered when saving a file
[WIP] Add python file that is triggered when saving a file
Python
mit
trevordevore/livecode-sublimetext
--- +++ @@ -0,0 +1,20 @@ +import sublime +import sublime_plugin +import re + +class LevureAppNotify(sublime_plugin.EventListener): + def on_post_save(self, view): + # 1. Get script only stack name. line 1: script "Name" [done] + # 2. Get project key from project settings + # 3. Send notificati...
21219c2ba2e6dbd82c8c9d226de96dafb5c9bb4e
Communication/mavtester.py
Communication/mavtester.py
#!/usr/bin/env python ''' test mavlink messages Do not forget to precise the baudrate (default 115200) ''' import sys, struct, time, os from curses import ascii from pymavlink import mavutil from argparse import ArgumentParser parser = ArgumentParser(description=__doc__) parser.add_argument("--baudrate", type=int,...
Add a script to test mavlink connection (read heartbeat)
Add a script to test mavlink connection (read heartbeat)
Python
mit
baptistelabat/robokite,baptistelabat/robokite,baptistelabat/robokite,baptistelabat/robokite,baptistelabat/robokite,baptistelabat/robokite,baptistelabat/robokite,baptistelabat/robokite
--- +++ @@ -0,0 +1,34 @@ +#!/usr/bin/env python + +''' +test mavlink messages +Do not forget to precise the baudrate (default 115200) +''' + +import sys, struct, time, os +from curses import ascii + +from pymavlink import mavutil + +from argparse import ArgumentParser +parser = ArgumentParser(description=__doc__) + +...
a0c75c6bff9934bff4c99d60297d0f3580e27612
misc/get_transformer_objects.py
misc/get_transformer_objects.py
# -*- encoding: utf-8 """ Snippet. AWLC: When I'm trying to diagnose failures on the transformer queue, I save the queue contents with sqs_freezeray [1], and then I want to go through them to analyse the failures. Our transformer messages contain pointers to S3, not the records themselves. This snippet gets messages ...
Add my script for handling transformer failures
Add my script for handling transformer failures
Python
mit
wellcometrust/platform-api,wellcometrust/platform-api,wellcometrust/platform-api,wellcometrust/platform-api
--- +++ @@ -0,0 +1,58 @@ +# -*- encoding: utf-8 +""" +Snippet. + +AWLC: When I'm trying to diagnose failures on the transformer queue, +I save the queue contents with sqs_freezeray [1], and then I want to +go through them to analyse the failures. + +Our transformer messages contain pointers to S3, not the records the...
bc8926d62c05549127e0fd9713e5a16f3d7565f7
tests/projects/test_views.py
tests/projects/test_views.py
import pytest from django.core.urlresolvers import reverse @pytest.mark.django_db def test_hide_private_projects(client, user, project_factory): public = project_factory() private = project_factory(is_public=False) private.participants.add(user) client.login(username=user, password='password') ur...
Add test to ensure private projects are not shown in the project list
Add test to ensure private projects are not shown in the project list
Python
agpl-3.0
liqd/a4-meinberlin,liqd/a4-meinberlin,liqd/a4-meinberlin,liqd/a4-meinberlin
--- +++ @@ -0,0 +1,18 @@ +import pytest +from django.core.urlresolvers import reverse + + +@pytest.mark.django_db +def test_hide_private_projects(client, user, project_factory): + public = project_factory() + private = project_factory(is_public=False) + private.participants.add(user) + + client.login(user...
2622c2ac4ecfc499f947d749b76ea1538148d4bb
heat/db/sqlalchemy/migrate_repo/versions/013_owner_id_uuid.py
heat/db/sqlalchemy/migrate_repo/versions/013_owner_id_uuid.py
from sqlalchemy import * from migrate import * from heat.common import utils def upgrade(migrate_engine): meta = MetaData(bind=migrate_engine) stack = Table('stack', meta, autoload=True) dialect = migrate_engine.url.get_dialect().name if not dialect.startswith('sqlite'): fkeys = list(stack....
Allow stack.owner_id to store a uuid.
Allow stack.owner_id to store a uuid. Fixes bug 1078854 Change-Id: I3dae1502968853d563ba52bc1d6656c48d5d18ba
Python
apache-2.0
JioCloud/heat,ntt-sic/heat,openstack/heat,citrix-openstack-build/heat,rickerc/heat_audit,steveb/heat,noironetworks/heat,steveb/heat,NeCTAR-RC/heat,dragorosson/heat,noironetworks/heat,dims/heat,cryptickp/heat,srznew/heat,cwolferh/heat-scratch,dims/heat,pratikmallya/heat,JioCloud/heat,gonzolino/heat,redhat-openstack/heat...
--- +++ @@ -0,0 +1,63 @@ +from sqlalchemy import * +from migrate import * +from heat.common import utils + + +def upgrade(migrate_engine): + meta = MetaData(bind=migrate_engine) + + stack = Table('stack', meta, autoload=True) + + dialect = migrate_engine.url.get_dialect().name + + if not dialect.startswit...
45667354abd56a3ec47cf9978959f5a00e3d46a9
heat_integrationtests/functional/test_conditional_exposure.py
heat_integrationtests/functional/test_conditional_exposure.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 test for resource exposure
Add functional test for resource exposure These simple tests check that Sahara resources can not be created and are not listed in the resource-type-list. If we ever decide to install Sahara on the Heat functional tests gate, tests should be changed to use other not installed but in principle supported service and res...
Python
apache-2.0
steveb/heat,cryptickp/heat,srznew/heat,cwolferh/heat-scratch,jasondunsmore/heat,dragorosson/heat,srznew/heat,jasondunsmore/heat,miguelgrinberg/heat,pratikmallya/heat,pratikmallya/heat,miguelgrinberg/heat,gonzolino/heat,takeshineshiro/heat,cwolferh/heat-scratch,dragorosson/heat,gonzolino/heat,cryptickp/heat,noironetwork...
--- +++ @@ -0,0 +1,82 @@ +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agr...
0dee40cb737121b0fcc141597c04bd3b39d8fbca
tests/unit/test_blake.py
tests/unit/test_blake.py
# Import nacl libs import libnacl.blake # Import python libs import unittest class TestBlake(unittest.TestCase): ''' Test sign functions ''' def test_keyless_blake(self): msg1 = b'Are you suggesting coconuts migrate?' msg2 = b'Not at all, they could be carried.' chash1 = libna...
Add tests for high level blake hash class
Add tests for high level blake hash class
Python
apache-2.0
RaetProtocol/libnacl,mindw/libnacl,cachedout/libnacl,saltstack/libnacl,johnttan/libnacl,coinkite/libnacl
--- +++ @@ -0,0 +1,39 @@ +# Import nacl libs +import libnacl.blake + +# Import python libs +import unittest + + +class TestBlake(unittest.TestCase): + ''' + Test sign functions + ''' + def test_keyless_blake(self): + msg1 = b'Are you suggesting coconuts migrate?' + msg2 = b'Not at all, they ...
bbe1c2aed3e6da1bd95f856e37c85e4562d6c1f0
crmapp/urls.py
crmapp/urls.py
from django.conf.urls import patterns, include, url from django.contrib import admin admin.autodiscover() from marketing.views import HomePage from accounts.views import AccountList from accounts.urls import account_urls from contacts.urls import contact_urls urlpatterns = patterns('', # Marketing pages url...
from django.conf.urls import patterns, include, url from django.contrib import admin admin.autodiscover() from marketing.views import HomePage from accounts.views import AccountList from accounts.urls import account_urls from contacts.urls import contact_urls urlpatterns = patterns('', # Marketing pages url...
Create the Contacts App - Part II > New Contact - Create URL
Create the Contacts App - Part II > New Contact - Create URL
Python
mit
tabdon/crmeasyapp,deenaariff/Django,tabdon/crmeasyapp
--- +++ @@ -39,6 +39,9 @@ url(r'^account/(?P<uuid>[\w-]+)/', include(account_urls)), # Contact related URLS + url(r'^contact/new/$', + 'crmapp.contacts.views.contact_cru', name='contact_new' + ), url(r'^contact/(?P<uuid>[\w-]+)/', include(contact_urls)), # Communication related UR...
8ccf9d141a7524d1450a883c9a7a853d7863e423
us_ignite/dummy/locations.py
us_ignite/dummy/locations.py
from __future__ import division import math import random # Geographic centre of the USA: longitude = float(39.8281418) latitude = float(-98.6419404) def get_location(radius=90): lng_min = longitude - radius / abs(math.cos(math.radians(latitude)) * 69) lng_max = longitude + radius / abs(math.cos(math.radians...
Add component to generate random lng/lat points.
Add component to generate random lng/lat points.
Python
bsd-3-clause
us-ignite/us_ignite,us-ignite/us_ignite,us-ignite/us_ignite,us-ignite/us_ignite,us-ignite/us_ignite
--- +++ @@ -0,0 +1,17 @@ +from __future__ import division +import math +import random + +# Geographic centre of the USA: +longitude = float(39.8281418) +latitude = float(-98.6419404) + + +def get_location(radius=90): + lng_min = longitude - radius / abs(math.cos(math.radians(latitude)) * 69) + lng_max = longitu...
aa9e4547fafb204af2815d3af97b5b716ba1164e
mysite/search/tests.py
mysite/search/tests.py
import django.test from search.models import Project class NonJavascriptSearch(django.test.TestCase): fixtures = ['bugs-for-two-projects.json'] def testSearch(self): response = self.client.get('/search/') for n in range(1, 11): self.assertContains(response, 'Title #%d' % n) ...
Add a trivial empty-search test
Add a trivial empty-search test
Python
agpl-3.0
campbe13/openhatch,openhatch/oh-mainline,willingc/oh-mainline,sudheesh001/oh-mainline,mzdaniel/oh-mainline,onceuponatimeforever/oh-mainline,moijes12/oh-mainline,vipul-sharma20/oh-mainline,moijes12/oh-mainline,waseem18/oh-mainline,ojengwa/oh-mainline,eeshangarg/oh-mainline,heeraj123/oh-mainline,onceuponatimeforever/oh-m...
--- +++ @@ -0,0 +1,11 @@ +import django.test +from search.models import Project + +class NonJavascriptSearch(django.test.TestCase): + fixtures = ['bugs-for-two-projects.json'] + + def testSearch(self): + response = self.client.get('/search/') + for n in range(1, 11): + self.assertContai...
272d81e2efaf94cc60ba5ecf95882fd5182c5cc8
tests/sentry/web/frontend/test_organization_audit_log.py
tests/sentry/web/frontend/test_organization_audit_log.py
from __future__ import absolute_import from django.core.urlresolvers import reverse from sentry.models import AuditLogEntry, AuditLogEntryEvent from sentry.testutils import TestCase class OrganizationAuditLogTest(TestCase): def test_renders_with_context(self): organization = self.create_organization(nam...
Add test for audit log
Add test for audit log
Python
bsd-3-clause
JTCunning/sentry,gg7/sentry,ngonzalvez/sentry,korealerts1/sentry,kevinlondon/sentry,looker/sentry,nicholasserra/sentry,1tush/sentry,looker/sentry,vperron/sentry,llonchj/sentry,beeftornado/sentry,Kryz/sentry,llonchj/sentry,wujuguang/sentry,BuildingLink/sentry,fotinakis/sentry,fuziontech/sentry,songyi199111/sentry,JamesM...
--- +++ @@ -0,0 +1,32 @@ +from __future__ import absolute_import + +from django.core.urlresolvers import reverse + +from sentry.models import AuditLogEntry, AuditLogEntryEvent +from sentry.testutils import TestCase + + +class OrganizationAuditLogTest(TestCase): + def test_renders_with_context(self): + organ...
ea5bcdb8864fe326fcaa66f43313311d954ed759
arx/sources/test/s3.py
arx/sources/test/s3.py
import pytest from ...decorators import InvalidScheme from ..s3 import S3, S3Jar, S3Tar, Invalid def test_http(): src = S3('s3://bucket/key') assert src.authority == 'bucket' assert src.path == '/key' assert src.fragment is None with pytest.raises(Invalid): src = S3('s3://bucket/key#piec...
Test S3 parsing and validation
Test S3 parsing and validation
Python
mit
drcloud/arx
--- +++ @@ -0,0 +1,47 @@ +import pytest + +from ...decorators import InvalidScheme +from ..s3 import S3, S3Jar, S3Tar, Invalid + + +def test_http(): + src = S3('s3://bucket/key') + assert src.authority == 'bucket' + assert src.path == '/key' + assert src.fragment is None + + with pytest.raises(Invalid)...
466d7fb81e0b14c9f1f7bc573f5dd29373b2db04
comics/crawler/crawlers/threepanelsoul.py
comics/crawler/crawlers/threepanelsoul.py
from comics.crawler.crawlers import BaseComicCrawler class ComicCrawler(BaseComicCrawler): def _get_url(self): self.parse_feed('http://www.rsspect.com/rss/threeps.xml') for entry in self.feed.entries: if self.timestamp_to_date(entry.updated_parsed) == self.pub_date: sel...
Add 'Three Panel Soul' crawler
Add 'Three Panel Soul' crawler
Python
agpl-3.0
jodal/comics,datagutten/comics,datagutten/comics,klette/comics,jodal/comics,jodal/comics,klette/comics,klette/comics,datagutten/comics,jodal/comics,datagutten/comics
--- +++ @@ -0,0 +1,17 @@ +from comics.crawler.crawlers import BaseComicCrawler + +class ComicCrawler(BaseComicCrawler): + def _get_url(self): + self.parse_feed('http://www.rsspect.com/rss/threeps.xml') + + for entry in self.feed.entries: + if self.timestamp_to_date(entry.updated_parsed) ==...
606c94e5ccdd3310dbc450215a3ef140819a4623
pennathletics/parse.py
pennathletics/parse.py
"""Utilities for parsing pages""" from collections import namedtuple Home = namedtuple('Home', ['town', 'school']) def ht_feet_to_inches(ht_str): """Take in height in ft-in format, and return inches >>> ht_feet_to_inches("6-0") 72 """ feet, inches = ht_str.split("-") return int(feet) * 12 +...
Add some parsing util funcs
Add some parsing util funcs
Python
mit
pennlabs/pennathletics
--- +++ @@ -0,0 +1,26 @@ +"""Utilities for parsing pages""" + +from collections import namedtuple + +Home = namedtuple('Home', ['town', 'school']) + + +def ht_feet_to_inches(ht_str): + """Take in height in ft-in format, and return inches + + >>> ht_feet_to_inches("6-0") + 72 + """ + feet, inches = ht_s...
ffebad0b3e23e03b650408e3486933317e9675e7
pysc2/tests/observer_test.py
pysc2/tests/observer_test.py
#!/usr/bin/python # Copyright 2017 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
Add a test that verifies you can observe two built in bots playing against each other.
Add a test that verifies you can observe two built in bots playing against each other. PiperOrigin-RevId: 183666331
Python
apache-2.0
deepmind/pysc2
--- +++ @@ -0,0 +1,69 @@ +#!/usr/bin/python +# Copyright 2017 Google Inc. 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/...
bfd8d1126e771702dfe4869923927b8f4fb81ef1
openstack/tests/functional/network/v2/test_extension.py
openstack/tests/functional/network/v2/test_extension.py
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t...
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t...
Remove namespace from network ext test
Remove namespace from network ext test Change-Id: Id9b97d67ac6745fe962a76ccd9c0e4f7cbed4a89
Python
apache-2.0
mtougeron/python-openstacksdk,briancurtin/python-openstacksdk,stackforge/python-openstacksdk,stackforge/python-openstacksdk,dudymas/python-openstacksdk,dtroyer/python-openstacksdk,dtroyer/python-openstacksdk,mtougeron/python-openstacksdk,briancurtin/python-openstacksdk,openstack/python-openstacksdk,openstack/python-ope...
--- +++ @@ -23,5 +23,4 @@ for ext in extensions: self.assertIsInstance(ext.name, six.string_types) - self.assertIsInstance(ext.namespace, six.string_types) self.assertIsInstance(ext.alias, six.string_types)
17a5275c87f90d08ffea12d2300526c5a4f27265
tdbwriter.py
tdbwriter.py
from datetime import datetime from time import sleep import random from tempodb import Client, DataPoint import tempodb from os import getenv API_KEY = getenv('API_KEY') assert API_KEY, "API_KEY is required" API_SECRET = getenv('API_SECRET') assert API_SECRET, "API_SECRET is required" SERIES_KEY = getenv('SERIES_KEY...
Write a PRNG datapoint every second
Write a PRNG datapoint every second
Python
mit
InPermutation/tdbwriter
--- +++ @@ -0,0 +1,23 @@ +from datetime import datetime +from time import sleep +import random +from tempodb import Client, DataPoint +import tempodb +from os import getenv + +API_KEY = getenv('API_KEY') +assert API_KEY, "API_KEY is required" + +API_SECRET = getenv('API_SECRET') +assert API_SECRET, "API_SECRET is req...
d5eaaa3a6e748ca251c01a77f34f4dc322d9ff56
integration/mc-integration.py
integration/mc-integration.py
#!/usr/bin/env python3 # Usage: mc-integration.py N seed # N is the number of random points to draw # Seed is used in the Python RNG to ensure repeatability of results import random import sys # INITIALIZATION----------------- try: N = int(sys.argv[1]) except IndexError: N = 100 try: seed = int(sys.argv[...
Include a basic Monte Carlo integrator of 1 - x^2.
Include a basic Monte Carlo integrator of 1 - x^2.
Python
mpl-2.0
DanielBrookRoberge/MonteCarloExamples
--- +++ @@ -0,0 +1,41 @@ +#!/usr/bin/env python3 +# Usage: mc-integration.py N seed +# N is the number of random points to draw +# Seed is used in the Python RNG to ensure repeatability of results + +import random +import sys + +# INITIALIZATION----------------- +try: + N = int(sys.argv[1]) +except IndexError: + ...
f4fdcc573714787dfecc5e2e713b4137b170102a
saleor/payment/gateways/adyen/tests/test_adyen_version.py
saleor/payment/gateways/adyen/tests/test_adyen_version.py
from Adyen.settings import API_CHECKOUT_VERSION, API_PAYMENT_VERSION def test_adyen_api_version_not_changed(): # We shouldn't bump the Adyen API version when we make a path release. # We could bump Adyen API when we make a major or minor release. # If we bump Adyen API we should provide it as breaking cha...
Add test for Adyen API version
Add test for Adyen API version
Python
bsd-3-clause
mociepka/saleor,mociepka/saleor,mociepka/saleor
--- +++ @@ -0,0 +1,10 @@ +from Adyen.settings import API_CHECKOUT_VERSION, API_PAYMENT_VERSION + + +def test_adyen_api_version_not_changed(): + # We shouldn't bump the Adyen API version when we make a path release. + # We could bump Adyen API when we make a major or minor release. + # If we bump Adyen API we...
ee99b706f4b7fe238c729c704eaf241b60f6ce2b
ui/app_list/PRESUBMIT.py
ui/app_list/PRESUBMIT.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. """Presubmit script for app_list. See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for more details about the presubmit API built...
Add git cl format presubmit warning.
ui/app_list: Add git cl format presubmit warning. Upon patch upload 'git cl format' is run on the diff and outputs a warning if the diff has style violations, saving manual review time for coding style. BUG=None TEST=None R=xiyuan@chromium.org Review URL: https://codereview.chromium.org/169003002 git-svn-id: de016e...
Python
bsd-3-clause
hgl888/chromium-crosswalk,anirudhSK/chromium,axinging/chromium-crosswalk,Just-D/chromium-1,markYoungH/chromium.src,chuan9/chromium-crosswalk,ltilve/chromium,crosswalk-project/chromium-crosswalk-efl,jaruba/chromium.src,hgl888/chromium-crosswalk-efl,patrickm/chromium.src,ltilve/chromium,mohamed--abdel-maksoud/chromium.sr...
--- +++ @@ -0,0 +1,14 @@ +# 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. + +"""Presubmit script for app_list. + +See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts +for more de...
01732179f923394bee6e46ae1bbee0f316df8297
amostra/tests/test_revert.py
amostra/tests/test_revert.py
from hypothesis import given, strategies as st from hypothesis.strategies import text from hypothesis import settings import random alphabet_list = '' for i in range(26): alphabet_list = alphabet_list + chr(97 + i) @given(names = st.lists(st.text(alphabet=alphabet_list, min_size=1, max_size=4), min_size=3, max_...
Add a revert function test
TST: Add a revert function test
Python
bsd-3-clause
NSLS-II/amostra
--- +++ @@ -0,0 +1,30 @@ +from hypothesis import given, strategies as st +from hypothesis.strategies import text +from hypothesis import settings +import random + + +alphabet_list = '' +for i in range(26): + alphabet_list = alphabet_list + chr(97 + i) + + +@given(names = st.lists(st.text(alphabet=alphabet_list, mi...
29f3a8dd5ee1faf4bad1e5ec969c8f975d8539b0
alembic/versions/4e435ff8ba74_add_unsubscribe_column_to_user_table.py
alembic/versions/4e435ff8ba74_add_unsubscribe_column_to_user_table.py
"""Add unsubscribe column to user table Revision ID: 4e435ff8ba74 Revises: bbba2255e00 Create Date: 2015-02-09 10:36:45.935116 """ # revision identifiers, used by Alembic. revision = '4e435ff8ba74' down_revision = 'bbba2255e00' from alembic import op import sqlalchemy as sa def upgrade(): op.add_column('user'...
Add Column to get notifications.
Add Column to get notifications.
Python
agpl-3.0
jean/pybossa,inteligencia-coletiva-lsd/pybossa,geotagx/pybossa,OpenNewsLabs/pybossa,jean/pybossa,inteligencia-coletiva-lsd/pybossa,Scifabric/pybossa,stefanhahmann/pybossa,PyBossa/pybossa,geotagx/pybossa,PyBossa/pybossa,stefanhahmann/pybossa,OpenNewsLabs/pybossa,Scifabric/pybossa
--- +++ @@ -0,0 +1,24 @@ +"""Add unsubscribe column to user table + +Revision ID: 4e435ff8ba74 +Revises: bbba2255e00 +Create Date: 2015-02-09 10:36:45.935116 + +""" + +# revision identifiers, used by Alembic. +revision = '4e435ff8ba74' +down_revision = 'bbba2255e00' + +from alembic import op +import sqlalchemy as sa ...
ee0eca16bca122b4d4c7c06cb9459ef8a9861b3c
site_settings-example.py
site_settings-example.py
# Site-specifig django settings. DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( ('Your name', 'your-email@example.org'), ) SERVER_EMAIL = 'root' MANAGERS = ADMINS DATABASE_ENGINE = 'postgresql_psycopg2' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. DATABASE_NAME = 'tjrapid' ...
Add site_settings example for new installations.
Add site_settings example for new installations.
Python
mit
peterkuma/tjrapid,peterkuma/tjrapid,peterkuma/tjrapid
--- +++ @@ -0,0 +1,49 @@ +# Site-specifig django settings. + +DEBUG = True +TEMPLATE_DEBUG = DEBUG + +ADMINS = ( + ('Your name', 'your-email@example.org'), +) + +SERVER_EMAIL = 'root' + +MANAGERS = ADMINS + +DATABASE_ENGINE = 'postgresql_psycopg2' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracl...
6e3247b417bdb5812e0f7818552aa667855b8ed4
pylearn2/costs/tests/test_lp_norm_cost.py
pylearn2/costs/tests/test_lp_norm_cost.py
""" Test LpNorm cost """ import numpy import theano from theano import tensor as T from nose.tools import raises def test_shared_variables(): ''' LpNorm should handle shared variables. ''' assert False def test_symbolic_expressions_of_shared_variables(): ''' LpNorm should handle symbolic exp...
Add unit test for LpNorm
Add unit test for LpNorm
Python
bsd-3-clause
hantek/pylearn2,lisa-lab/pylearn2,shiquanwang/pylearn2,hantek/pylearn2,daemonmaker/pylearn2,hantek/pylearn2,bartvm/pylearn2,lamblin/pylearn2,CIFASIS/pylearn2,abergeron/pylearn2,abergeron/pylearn2,skearnes/pylearn2,pkainz/pylearn2,fishcorn/pylearn2,daemonmaker/pylearn2,nouiz/pylearn2,kose-y/pylearn2,theoryno3/pylearn2,C...
--- +++ @@ -0,0 +1,35 @@ +""" +Test LpNorm cost +""" +import numpy +import theano +from theano import tensor as T +from nose.tools import raises + + +def test_shared_variables(): + ''' + LpNorm should handle shared variables. + ''' + assert False + + +def test_symbolic_expressions_of_shared_variables(): +...
d8579de24cdd1b381678617953fd79fc49f87952
affine/tests/test_rotation.py
affine/tests/test_rotation.py
from math import sqrt from affine import Affine def test_rotation_angle(): """A positive angle rotates a vector counter clockwise (1.0, 0.0): | | | | 0---------* Affine.rotation(45.0) * (1.0, 0.0) == (0.707..., 0.707...) | | * | ...
Add a clear test of rotation angle
Add a clear test of rotation angle With an illustration, as a guard against regressions.
Python
bsd-3-clause
ToddSmall/affine
--- +++ @@ -0,0 +1,27 @@ +from math import sqrt + +from affine import Affine + + +def test_rotation_angle(): + """A positive angle rotates a vector counter clockwise + + (1.0, 0.0): + + | + | + | + | + 0---------* + + Affine.rotation(45.0) * (1.0, 0.0) == (0.707..., 0.707.....
a2a118186892ed30b5c0a3c4f1893ec1b9d3dba5
src/greplin/scales/util_test.py
src/greplin/scales/util_test.py
# Copyright 2012 The scales Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in w...
Add unit tests for AtomicValue methods.
Add unit tests for AtomicValue methods.
Python
apache-2.0
Cue/scales,URXtech/scales
--- +++ @@ -0,0 +1,44 @@ +# Copyright 2012 The scales Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required...
3b0649706b1e01c52045bdcb33f8aeb61aef2635
test/test_conduit/test_compound.py
test/test_conduit/test_compound.py
import unittest utils = __import__('utils') # Suppress PyCharm warning from picdump import conduit class DummySource: def __init__(self, src): self.src = src self.it = None self.reset() def __next__(self): return next(self.it) def reset(self): self.it = iter(sel...
Add conduit compound test. (join test)
Add conduit compound test. (join test)
Python
mit
kanosaki/PicDump,kanosaki/PicDump
--- +++ @@ -0,0 +1,32 @@ +import unittest +utils = __import__('utils') # Suppress PyCharm warning + +from picdump import conduit + + +class DummySource: + def __init__(self, src): + self.src = src + self.it = None + self.reset() + + def __next__(self): + return next(self.it) + + ...
f55cc53892540da871394d88835249b7f594f573
beavy/common/morphing_schema.py
beavy/common/morphing_schema.py
class MorphingSchema(): def dump(self, obj): return self._get_serializer(obj).dump(obj) def _obj_to_name(self, obj): return obj.__mapper__.polymorphic_identity def _get_serializer(self, obj): name = self._obj_to_name(obj) return self.registry.get(name, self.FALLBACK)()
Add missing Morphing Schema File
Add missing Morphing Schema File
Python
mpl-2.0
beavyHQ/beavy,beavyHQ/beavy,beavyHQ/beavy,beavyHQ/beavy
--- +++ @@ -0,0 +1,11 @@ +class MorphingSchema(): + + def dump(self, obj): + return self._get_serializer(obj).dump(obj) + + def _obj_to_name(self, obj): + return obj.__mapper__.polymorphic_identity + + def _get_serializer(self, obj): + name = self._obj_to_name(obj) + return self.r...
a558672d790a07edbf42f84524db77e472de33b2
pandas_patch/htest.py
pandas_patch/htest.py
""" @author: efourrier Purpose : This module is designed to provide custom test assertion return in True or False so you can quickly include them into tests against your DataFrame """ ######################################################### # Import Packages and Constants ###########################################...
Add helpers for to do consistency tests on pandas DataFrame
Add helpers for to do consistency tests on pandas DataFrame
Python
mit
ericfourrier/pandas-patch
--- +++ @@ -0,0 +1,70 @@ +""" +@author: efourrier + +Purpose : This module is designed to provide custom test assertion return in True or +False so you can quickly include them into tests against your DataFrame + +""" + +######################################################### +# Import Packages and Constants +#####...
6bf8f2076f5b4f154359832fe69bfa877b52012e
polemarch/main/migrations/0029_auto_20171124_0625.py
polemarch/main/migrations/0029_auto_20171124_0625.py
# -*- coding: utf-8 -*- # Generated by Django 1.11.6 on 2017-11-24 06:25 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('main', '0028_auto_20171123_0532'), ] operations = ...
Use inventory files from project (forgotten migration)
Use inventory files from project (forgotten migration)
Python
agpl-3.0
vstconsulting/polemarch,vstconsulting/polemarch,vstconsulting/polemarch,vstconsulting/polemarch
--- +++ @@ -0,0 +1,30 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.6 on 2017-11-24 06:25 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('main', '0028_auto_20...
eb19b1f428f2e5d98a128a94dd6607e4ad6965ba
alembic/versions/9a83475c60c3_add_favorites_user_ids.py
alembic/versions/9a83475c60c3_add_favorites_user_ids.py
"""Add favorites user_ids Revision ID: 9a83475c60c3 Revises: 8ce9b3da799e Create Date: 2017-03-28 11:37:03.861572 """ # revision identifiers, used by Alembic. revision = '9a83475c60c3' down_revision = '8ce9b3da799e' from alembic import op import sqlalchemy as sa from sqlalchemy.dialects import postgresql field = '...
Add ARRAY column to handle user favorites.
Add ARRAY column to handle user favorites.
Python
agpl-3.0
Scifabric/pybossa,PyBossa/pybossa,Scifabric/pybossa,PyBossa/pybossa
--- +++ @@ -0,0 +1,24 @@ +"""Add favorites user_ids + +Revision ID: 9a83475c60c3 +Revises: 8ce9b3da799e +Create Date: 2017-03-28 11:37:03.861572 + +""" + +# revision identifiers, used by Alembic. +revision = '9a83475c60c3' +down_revision = '8ce9b3da799e' + +from alembic import op +import sqlalchemy as sa +from sqlalc...
c8432c6c7696bc9b60e3ad25a88b6e9f10fc8f11
src/ggrc/migrations/versions/20160223152916_204540106539_assessment_titles.py
src/ggrc/migrations/versions/20160223152916_204540106539_assessment_titles.py
# Copyright (C) 2016 Google Inc., authors, and contributors <see AUTHORS file> # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> # Created By: ivan@reciprocitylabs.com # Maintained By: ivan@reciprocitylabs.com """Assessment titles Revision ID: 204540106539 Revises: 4e989ef86619 Create Dat...
Make assessment titles not unique
Make assessment titles not unique
Python
apache-2.0
kr41/ggrc-core,josthkko/ggrc-core,prasannav7/ggrc-core,AleksNeStu/ggrc-core,plamut/ggrc-core,kr41/ggrc-core,NejcZupec/ggrc-core,edofic/ggrc-core,VinnieJohns/ggrc-core,prasannav7/ggrc-core,andrei-karalionak/ggrc-core,josthkko/ggrc-core,j0gurt/ggrc-core,josthkko/ggrc-core,selahssea/ggrc-core,AleksNeStu/ggrc-core,edofic/g...
--- +++ @@ -0,0 +1,29 @@ +# Copyright (C) 2016 Google Inc., authors, and contributors <see AUTHORS file> +# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> +# Created By: ivan@reciprocitylabs.com +# Maintained By: ivan@reciprocitylabs.com + +"""Assessment titles + +Revision ID: 2045401065...
4e9ebd21a980894c058cdf8c17a416bf7699b12f
blackjack/test/test_dealer.py
blackjack/test/test_dealer.py
#!/usr/bin/python import os import sys sys.path.append(os.path.join(os.getcwd(), '../')) import pytest import blackjack.dealer as dealer import blackjack.table as table def test_dummy(): for i in range(5): t = table.Table() def test_string_representation(): name = 'Lob' assert "Dealer %s" % name...
Add dummy Dealer test module
Add dummy Dealer test module
Python
mit
suhasgaddam/blackjack-python,suhasgaddam/blackjack-python
--- +++ @@ -0,0 +1,18 @@ +#!/usr/bin/python + +import os +import sys +sys.path.append(os.path.join(os.getcwd(), '../')) + +import pytest +import blackjack.dealer as dealer +import blackjack.table as table + +def test_dummy(): + for i in range(5): + t = table.Table() + +def test_string_representation(): + ...
49e88e23792c685832148b7d6f2549ecc8d30344
django/website/main/tests/test_merge_coverage_filtering.py
django/website/main/tests/test_merge_coverage_filtering.py
import os import xml.etree.ElementTree as ET from main.management.commands.merge_coverage_files import Command, PACKAGES_LIST def test_filtering_xml_when_no_package_filters_includes_all_packages_in_list(): merge_coverage_files_command = Command() file_path = os.path.join(os.path.dirname(__file__), 'sample_c...
Add tests for filtering coverage content
Add tests for filtering coverage content
Python
agpl-3.0
aptivate/alfie,aptivate/kashana,aptivate/kashana,aptivate/alfie,aptivate/alfie,aptivate/kashana,daniell/kashana,daniell/kashana,aptivate/kashana,daniell/kashana,daniell/kashana,aptivate/alfie
--- +++ @@ -0,0 +1,65 @@ +import os +import xml.etree.ElementTree as ET + +from main.management.commands.merge_coverage_files import Command, PACKAGES_LIST + + +def test_filtering_xml_when_no_package_filters_includes_all_packages_in_list(): + merge_coverage_files_command = Command() + + file_path = os.path.join...
67e76cc83f117ff20f260d25326775bcd58afc92
account/tests/test_email_address.py
account/tests/test_email_address.py
from account.models import EmailAddress from django.contrib.auth import authenticate from django.contrib.auth.models import User from django.forms import ValidationError from django.test import TestCase, override_settings @override_settings(ACCOUNT_EMAIL_UNIQUE=True) class UniqueEmailAddressTestCase(TestCase): de...
Add test case for email unique validate
Add test case for email unique validate
Python
mit
pinax/django-user-accounts,pinax/django-user-accounts
--- +++ @@ -0,0 +1,25 @@ +from account.models import EmailAddress +from django.contrib.auth import authenticate +from django.contrib.auth.models import User +from django.forms import ValidationError +from django.test import TestCase, override_settings + + +@override_settings(ACCOUNT_EMAIL_UNIQUE=True) +class UniqueEm...
52cf32557d0badba934472acf7e2af8387aa260e
sgraph-show-with-nx-layout.py
sgraph-show-with-nx-layout.py
import networkx as nx g = nx.Graph() # put the nodes and edges from the SGraph into a NetworkX graph g.add_nodes_from(list(sg.vertices['__id'])) g.add_edges_from([(e['__src_id'], e['__dst_id']) for e in sg.edges]) # create the layout with NetworkX and convert to regular Python types # you can substitute any of the la...
Add example for SGraph.show with NetworkX layout.
Add example for SGraph.show with NetworkX layout.
Python
cc0-1.0
srikris/how-to,nagyistoce/how-to-graphlab-create,dato-code/how-to
--- +++ @@ -0,0 +1,17 @@ +import networkx as nx +g = nx.Graph() + +# put the nodes and edges from the SGraph into a NetworkX graph +g.add_nodes_from(list(sg.vertices['__id'])) +g.add_edges_from([(e['__src_id'], e['__dst_id']) for e in sg.edges]) + +# create the layout with NetworkX and convert to regular Python types...
bfb819eb58e28d15d55d6d4def6137e75ad0db18
benchmarks/bench_plot_ward.py
benchmarks/bench_plot_ward.py
""" Bench the scikit's ward implement compared to scipy's """ import time import numpy as np from scipy.cluster import hierarchy import pylab as pl from scikits.learn.cluster import Ward ward = Ward(n_clusters=15) n_samples = np.logspace(.5, 2, 9) n_features = np.logspace(1, 3.5, 7) N_samples, N_features = np.mesh...
Add a benchmark for ward
ENH: Add a benchmark for ward Comparing the scikits and scipy
Python
bsd-3-clause
IssamLaradji/scikit-learn,marcocaccin/scikit-learn,walterreade/scikit-learn,appapantula/scikit-learn,poryfly/scikit-learn,rohanp/scikit-learn,Srisai85/scikit-learn,saiwing-yeung/scikit-learn,amueller/scikit-learn,icdishb/scikit-learn,jm-begon/scikit-learn,marcocaccin/scikit-learn,mehdidc/scikit-learn,bikong2/scikit-lea...
--- +++ @@ -0,0 +1,43 @@ +""" +Bench the scikit's ward implement compared to scipy's +""" + +import time + +import numpy as np +from scipy.cluster import hierarchy +import pylab as pl + +from scikits.learn.cluster import Ward + +ward = Ward(n_clusters=15) + +n_samples = np.logspace(.5, 2, 9) +n_features = np.logspace...
63eb9f3dc26d33c4f6113011428a45b703a1886e
axelrod/__init__.py
axelrod/__init__.py
from __future__ import absolute_import # The order of imports matters! from .random_ import random_choice from .plot import Plot from .game import DefaultGame, Game from .player import is_basic, is_cheater, update_histories, Player from .mock_player import MockPlayer, simulate_play from .round_robin import RoundRobin ...
from __future__ import absolute_import # The order of imports matters! from .random_ import random_choice from .plot import Plot from .game import DefaultGame, Game from .player import is_basic, is_cheater, update_histories, Player from .mock_player import MockPlayer, simulate_play from .round_robin import RoundRobin ...
Fix implicit imports for tournament repo
Fix implicit imports for tournament repo
Python
mit
ranjinidas/Axelrod,ranjinidas/Axelrod,marcharper/Axelrod,marcharper/Axelrod
--- +++ @@ -13,3 +13,4 @@ from .tournament_manager_factory import TournamentManagerFactory from .result_set import ResultSet from .ecosystem import Ecosystem +from .utils import run_tournaments, setup_logging
24bb3d632561794b0785dad0977b58bb28a5273e
better_raw_modes.py
better_raw_modes.py
import hexchat try: from .util import no_recursion except SystemError: # Add addons path to sys.path for win32 # See https://github.com/hexchat/hexchat/issues/1396 import os import sys if sys.platform == "win32": addons_path = os.path.join(hexchat.get_info("configdir"), "addons") ...
Add raw mode hooker that reduces redundant stuff
Add raw mode hooker that reduces redundant stuff
Python
mit
FichteFoll/hexchat-addons
--- +++ @@ -0,0 +1,57 @@ +import hexchat + +try: + from .util import no_recursion +except SystemError: + # Add addons path to sys.path for win32 + # See https://github.com/hexchat/hexchat/issues/1396 + import os + import sys + + if sys.platform == "win32": + addons_path = os.path.join(hexchat...
5bc1544f23542f2187448512fedad2deafe4966d
parse_stuff.py
parse_stuff.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import os from parsers.main_parser import MainParser if __name__ == '__main__': src = r"D:\nhl\official_and_json\2016-17\2017-02\2017-02-01.zip" # src = r"D:\nhl\official_and_json\2016-17\2017-02\2017-02-20" # src = r"D:\nhl\official_and_json\_2015-16\2016-...
Add initial version of parsing application
Add initial version of parsing application
Python
mit
leaffan/pynhldb
--- +++ @@ -0,0 +1,33 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import os + +from parsers.main_parser import MainParser + + +if __name__ == '__main__': + + src = r"D:\nhl\official_and_json\2016-17\2017-02\2017-02-01.zip" + # src = r"D:\nhl\official_and_json\2016-17\2017-02\2017-02-20" + # src = r...
9137431ef3d57363bbf6e9a5912d4ca5399c08c0
control/test/test_heading_filter.py
control/test/test_heading_filter.py
"""Tests the heading Kalman Filter.""" import math import numpy import operator import random import unittest from heading_filter import HeadingFilter #pylint: disable=protected-access #pylint: disable=too-many-public-methods class TestHeadingFilter(unittest.TestCase): """Tests the heading Kalman filter.""" ...
Add Kalman filter for heading
Add Kalman filter for heading
Python
mit
bskari/sparkfun-avc,bskari/sparkfun-avc,bskari/sparkfun-avc,bskari/sparkfun-avc,bskari/sparkfun-avc,bskari/sparkfun-avc
--- +++ @@ -0,0 +1,111 @@ +"""Tests the heading Kalman Filter.""" + +import math +import numpy +import operator +import random +import unittest + +from heading_filter import HeadingFilter + +#pylint: disable=protected-access +#pylint: disable=too-many-public-methods + + +class TestHeadingFilter(unittest.TestCase): + ...
af7d9c137f198d6ab11da134d4cfe3b07dd0438c
nutsurv/dashboard/migrations/0006_auto_20150413_0901.py
nutsurv/dashboard/migrations/0006_auto_20150413_0901.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import jsonfield.fields import dashboard.models class Migration(migrations.Migration): dependencies = [ ('dashboard', '0005_auto_20150409_1509'), ] operations = [ migrations.CreateMo...
Add migrations for training module prep
Add migrations for training module prep
Python
agpl-3.0
johanneswilm/eha-nutsurv-django,eHealthAfrica/nutsurv,eHealthAfrica/nutsurv,eHealthAfrica/nutsurv,johanneswilm/eha-nutsurv-django,johanneswilm/eha-nutsurv-django
--- +++ @@ -0,0 +1,64 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations +import jsonfield.fields +import dashboard.models + + +class Migration(migrations.Migration): + + dependencies = [ + ('dashboard', '0005_auto_20150409_1509'), + ] + + ...
d96aefe57fab9ee2c2915ebd6f5a659be1c9cec1
bin_search.py
bin_search.py
"""You're going to write a binary search function. You should use an iterative approach - meaning using loops. Your function should take two inputs: a Python list to search through, and the value you're searching for. Assume the list only has distinct elements, meaning there are no repeated values, and elements are in ...
Add Binary Search source code
Add Binary Search source code
Python
mit
rav1n/basic-algorithms
--- +++ @@ -0,0 +1,56 @@ +"""You're going to write a binary search function. +You should use an iterative approach - meaning +using loops. +Your function should take two inputs: +a Python list to search through, and the value +you're searching for. +Assume the list only has distinct elements, +meaning there are no re...
5997adbb07b05c6ef4439d106a80c1342e38b9c7
mothermayi/entryway.py
mothermayi/entryway.py
import pkg_resources def get_entries(name): entries = [] for entry in pkg_resources.iter_entry_points(group='mothermayi'): if entry.name != name: continue runner = entry.load() entries.append(runner) return entries
Add a function for getting plugin entry points
Add a function for getting plugin entry points This will be how we pull up plugins that have been installed in the environment and execute them
Python
mit
EliRibble/mothermayi
--- +++ @@ -0,0 +1,10 @@ +import pkg_resources + +def get_entries(name): + entries = [] + for entry in pkg_resources.iter_entry_points(group='mothermayi'): + if entry.name != name: + continue + runner = entry.load() + entries.append(runner) + return entries
6e58e0fbf059f137bfcfef070968191f2ea42655
tests/libpeas/plugins/extension-python/extension-python.py
tests/libpeas/plugins/extension-python/extension-python.py
# -*- coding: utf-8 -*- # ex:set ts=4 et sw=4 ai: from gi.repository import GObject, Introspection, Peas class ExtensionPythonPlugin(GObject.Object, Peas.Activatable, Introspection.Base, Introspection.Callable, Introspection.PropertiesPrerequisite, ...
# -*- coding: utf-8 -*- # ex:set ts=4 et sw=4 ai: from gi.repository import GObject, Introspection, Peas class ExtensionPythonPlugin(GObject.Object, Peas.Activatable, Introspection.Base, Introspection.Callable, Introspection.PropertiesPrerequisite, ...
Fix style issues in python test plugin
Fix style issues in python test plugin https://bugzilla.gnome.org/show_bug.cgi?id=678339
Python
lgpl-2.1
Distrotech/libpeas,chergert/libpeas,gregier/libpeas,chergert/libpeas,GNOME/libpeas,gregier/libpeas,gregier/libpeas,gregier/libpeas,Distrotech/libpeas,Distrotech/libpeas,GNOME/libpeas,chergert/libpeas
--- +++ @@ -26,7 +26,6 @@ def do_update_state(self): pass - def do_get_plugin_info(self): return self.plugin_info @@ -34,7 +33,7 @@ return self.plugin_info.get_settings(None) def do_call_with_return(self): - return "Hello, World!"; + return "Hello, World!"...
4faecdf426af4b2d9a14ef65efe3e72fa088cdb3
src/examples/tutorial/example_bpmhistogramdescriptors.py
src/examples/tutorial/example_bpmhistogramdescriptors.py
import sys from essentia.standard import * from essentia import Pool import pylab as plt try: input_file = sys.argv[1] except: print "usage:", sys.argv[0], "<input_file>" sys.exit() audio = MonoLoader(filename=input_file)() bpm, _, _, _, intervals = RhythmExtractor2013()(audio) peak1_bpm, peak1_weight, p...
Add python examples for BpmHistogramDescriptors
Add python examples for BpmHistogramDescriptors
Python
agpl-3.0
MTG/essentia,MTG/essentia,carthach/essentia,MTG/essentia,carthach/essentia,carthach/essentia,carthach/essentia,MTG/essentia,MTG/essentia,carthach/essentia
--- +++ @@ -0,0 +1,27 @@ +import sys +from essentia.standard import * +from essentia import Pool +import pylab as plt + +try: + input_file = sys.argv[1] +except: + print "usage:", sys.argv[0], "<input_file>" + sys.exit() + +audio = MonoLoader(filename=input_file)() +bpm, _, _, _, intervals = RhythmExtractor2...
32e227941d10b6e4ae478d28adb0deb7b7fc463f
tools/serialization_time.py
tools/serialization_time.py
""" :author: samu :created: 4/17/13 10:37 PM """ import timeit from smartrpyc.utils import serialization import msgpack def run_test(module): module.unpackb(module.packb({ 'string': "This is a strijng", 'unicode': u"This is a unicode", 'None': None, 'True': True, 'False':...
Add script to time serialization functions
Add script to time serialization functions
Python
apache-2.0
xk0/SmartRPyC,xk0/SmartRPyC
--- +++ @@ -0,0 +1,41 @@ +""" +:author: samu +:created: 4/17/13 10:37 PM +""" + +import timeit + +from smartrpyc.utils import serialization +import msgpack + + +def run_test(module): + module.unpackb(module.packb({ + 'string': "This is a strijng", + 'unicode': u"This is a unicode", + 'None': N...