commit
stringlengths
40
40
old_file
stringlengths
4
236
new_file
stringlengths
4
236
old_contents
stringlengths
1
3.26k
new_contents
stringlengths
16
4.43k
subject
stringlengths
16
624
message
stringlengths
17
3.29k
lang
stringclasses
5 values
license
stringclasses
13 values
repos
stringlengths
5
91.5k
68e51fd9772aaf4bd382ffe05721e27da6bddde6
argus/exceptions.py
argus/exceptions.py
# Copyright 2014 Cloudbase Solutions Srl # 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 r...
# Copyright 2014 Cloudbase Solutions Srl # 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 r...
Add exception for Logic Errors
Add exception for Logic Errors
Python
apache-2.0
stefan-caraiman/cloudbase-init-ci,cloudbase/cloudbase-init-ci,micumatei/cloudbase-init-ci
2eb4fcb2d75e6f93f33b1ae41098919f6d4ebc92
neovim/__init__.py
neovim/__init__.py
from client import Client from uv_stream import UvStream __all__ = ['Client', 'UvStream', 'c']
from client import Client from uv_stream import UvStream __all__ = ['connect'] def connect(address, port=None): client = Client(UvStream(address, port)) client.discover_api() return client.vim
Add helper function for connecting with Neovim
Add helper function for connecting with Neovim
Python
apache-2.0
fwalch/python-client,Shougo/python-client,bfredl/python-client,brcolow/python-client,starcraftman/python-client,traverseda/python-client,justinmk/python-client,neovim/python-client,meitham/python-client,meitham/python-client,0x90sled/python-client,justinmk/python-client,zchee/python-client,traverseda/python-client,bfre...
f71897270d9a040930bfb41801bf955ea3d0a36e
slave/skia_slave_scripts/android_run_gm.py
slave/skia_slave_scripts/android_run_gm.py
#!/usr/bin/env python # Copyright (c) 2013 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. """ Run GM on an Android device. """ from android_build_step import AndroidBuildStep from build_step import BuildStep from run_gm ...
#!/usr/bin/env python # Copyright (c) 2013 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. """ Run GM on an Android device. """ from android_build_step import AndroidBuildStep from build_step import BuildStep from run_gm ...
Increase timeout for GM on Android
Increase timeout for GM on Android Unreviewed. (SkipBuildbotRuns) Review URL: https://codereview.chromium.org/18845002 git-svn-id: 32fc27f4dcfb6c0385cd9719852b95fe6680452d@9906 2bbb7eff-a529-9590-31e7-b0007b416f81
Python
bsd-3-clause
google/skia-buildbot,Tiger66639/skia-buildbot,google/skia-buildbot,Tiger66639/skia-buildbot,google/skia-buildbot,google/skia-buildbot,Tiger66639/skia-buildbot,google/skia-buildbot,Tiger66639/skia-buildbot,google/skia-buildbot,Tiger66639/skia-buildbot,google/skia-buildbot,Tiger66639/skia-buildbot,google/skia-buildbot,Ti...
3e1033637d0bb5dd8856052ffd1667df0ccceb5d
entity.py
entity.py
"""This module contains base classes for defining game objects as well as their individual components and behaviours. """ from pygame.sprite import Sprite class Entity(Sprite): """An object within the game. It contains several Component objects that are used to define how it is handled graphically and ph...
"""This module contains base classes for defining game objects as well as their individual components and behaviours. """ from pygame.sprite import Sprite class Entity(Sprite): """An object within the game. It contains several Component objects that are used to define how it is handled graphically and ph...
Remove components as class attribute
Entity: Remove components as class attribute It is meant to be an instance attribute and should be defined in init() instead.
Python
unlicense
MarquisLP/gamehappy
ec91f28dfe4e1f48f7ff92f1fe499944aa366763
tools/checkdependencies.py
tools/checkdependencies.py
#!/usr/bin/env python import sys, os # list of (packagename, filename) DEPENDENCIES = [ ('zlib1g-dev / zlib-devel', '/usr/include/zlib.h'), ('g++ / gcc-c++', '/usr/bin/g++'), ('wget', '/usr/bin/wget'), ('libsqlite3-dev / sqlite-devel', '/usr/include/sqlite3.h'), ] if os.environ.get('BOOST_INCLUDE', ''): D...
#!/usr/bin/env python import sys, os # list of (packagename, filename) DEPENDENCIES = [ ('zlib1g-dev / zlib-devel', '/usr/include/zlib.h'), ('libbz2-dev / bzip2-devel', '/usr/include/bzlib.h'), ('g++ / gcc-c++', '/usr/bin/g++'), ('wget', '/usr/bin/wget'), ('libsqlite3-dev / sqlite-devel', '/usr/include/sql...
Add libbz2-dev dependency for PinPlay
[build] Add libbz2-dev dependency for PinPlay
Python
mit
abanaiyan/sniper,abanaiyan/sniper,abanaiyan/sniper,abanaiyan/sniper,abanaiyan/sniper
368e2d6407cb021d80fe3679c65737581c3cc221
bliski_publikator/institutions/serializers.py
bliski_publikator/institutions/serializers.py
from rest_framework import serializers from .models import Institution class InstitutionSerializer(serializers.HyperlinkedModelSerializer): on_site = serializers.CharField(source='get_absolute_url', read_only=True) class Meta: model = Institution fields = ('on_site', 'url',...
from rest_framework import serializers from .models import Institution class InstitutionSerializer(serializers.HyperlinkedModelSerializer): on_site = serializers.CharField(source='get_absolute_url', read_only=True) class Meta: model = Institution fields = ('on_site', 'url',...
Make user field read-only in InstitutionSerializer
Make user field read-only in InstitutionSerializer
Python
mit
watchdogpolska/bliski_publikator,watchdogpolska/bliski_publikator,watchdogpolska/bliski_publikator,watchdogpolska/bliski_publikator
5cadfe1b0a8da0f46950ff63786bf79c42af9b90
tutorials/forms.py
tutorials/forms.py
from django import forms from .models import Tutorial class TutorialForm(forms.ModelForm): # ToDO: Set required fields?? class Meta: model = Tutorial fields = ('title', 'html', 'markdown')
from django import forms from .models import Tutorial class TutorialForm(forms.ModelForm): # ToDO: Set required fields?? class Meta: model = Tutorial fields = ('category', 'title', 'markdown', 'level')
Add new model fields to form
Add new model fields to form
Python
agpl-3.0
openego/oeplatform,openego/oeplatform,openego/oeplatform,openego/oeplatform
1abb838a1fa56af25b9c6369dff93c65e17fbc3a
manage.py
manage.py
import os COV = None if os.environ.get('FLASK_COVERAGE'): import coverage COV = coverage.coverage(branch=True, include='app/*') COV.start() from flask_script import Manager from flask_migrate import Migrate, MigrateCommand from app import app, db from config import BASE_DIR app.config.from_object(os.ge...
import os COV = None if os.environ.get('FLASK_COVERAGE'): import coverage COV = coverage.coverage(branch=True, include='app/*') COV.start() from flask_script import Manager from flask_migrate import Migrate, MigrateCommand from app import app, db from config import BASE_DIR app.config.from_object(os.ge...
Remove erase of coverage file as it's needed by coveralls
Remove erase of coverage file as it's needed by coveralls
Python
apache-2.0
atindale/business-glossary,atindale/business-glossary
1be8c268f2da618e9e9e13d55d53599d637d3a6a
abel/tests/test_tools.py
abel/tests/test_tools.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function import os.path import numpy as np from numpy.testing import assert_allclose from abel.tools import calculate_speeds DATA_DIR = os.path.join(os.path.split(__file__)[0], 'data') def assert_equal(x, y, messa...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import os.path import numpy as np from numpy.testing import assert_allclose, assert_equal from abel.tools import calculate_speeds, center_image DATA_DIR = os.path.join(os.path.split(__file__)[0], 'data') ...
Test to enforce that center_image preserves shape
Test to enforce that center_image preserves shape
Python
mit
rth/PyAbel,huletlab/PyAbel,DhrubajyotiDas/PyAbel,PyAbel/PyAbel,stggh/PyAbel
85a873c79e3c3c7289a23da6fe3673259fac9cbd
sympy/sets/conditionset.py
sympy/sets/conditionset.py
from __future__ import print_function, division from sympy.core.basic import Basic from sympy.logic.boolalg import And, Or, Not, true, false from sympy.sets.sets import (Set, Interval, Intersection, EmptySet, Union, FiniteSet) from sympy.core.singleton import Singleton, S from sympy.core.s...
from __future__ import print_function, division from sympy.core.basic import Basic from sympy.logic.boolalg import And, Or, Not, true, false from sympy.sets.sets import (Set, Interval, Intersection, EmptySet, Union, FiniteSet) from sympy.core.singleton import Singleton, S from sympy.core.s...
Remove redundant _is_multivariate in ConditionSet
Remove redundant _is_multivariate in ConditionSet Signed-off-by: Harsh Gupta <c4bd8559369e527b4bb1785ff84e8ff50fde87c0@gmail.com>
Python
bsd-3-clause
sampadsaha5/sympy,VaibhavAgarwalVA/sympy,mcdaniel67/sympy,MechCoder/sympy,farhaanbukhsh/sympy,abhiii5459/sympy,MechCoder/sympy,madan96/sympy,kaushik94/sympy,jaimahajan1997/sympy,skidzo/sympy,ahhda/sympy,abhiii5459/sympy,mafiya69/sympy,Curious72/sympy,shikil/sympy,aktech/sympy,hargup/sympy,Vishluck/sympy,oliverlee/sympy...
14c86e3c93bd5114b74c125fdb8213b22342c95c
tests/manual_cleanup.py
tests/manual_cleanup.py
from globus_cli.services.transfer import get_client as get_tc from tests.framework.cli_testcase import default_test_config try: from mock import patch except ImportError: from unittest.mock import patch def cleanup_bookmarks(tc): for bm in tc.bookmark_list(): tc.delete_bookmark(bm['id']) @patch...
#!/usr/bin/env python import click from globus_cli.services.transfer import get_client as get_tc from tests.framework.cli_testcase import default_test_config try: from mock import patch except ImportError: from unittest.mock import patch def cleanup_bookmarks(tc): for bm in tc.bookmark_list(): t...
Add `--cancel-jobs` to manual cleanup script
Add `--cancel-jobs` to manual cleanup script Add an option to this script to cancel all ACTIVE,INACTIVE tasks (i.e. not SUCCEDED,FAILED). While this can disrupt a run of the tests pretty badly if you run it while the tets are running, it's pretty much the only way to "fix it" if the tests go off the rails because of a...
Python
apache-2.0
globus/globus-cli,globus/globus-cli
a3d087b2d7ec42eb5afe9f0064785d25500af11b
bitforge/errors.py
bitforge/errors.py
class BitforgeError(Exception): def __init__(self, *args, **kwargs): self.cause = kwargs.pop('cause', None) self.prepare(*args, **kwargs) self.message = self.__doc__.format(**self.__dict__) def prepare(self): pass def __str__(self): return self.message class Obje...
class BitforgeError(Exception): def __init__(self, *args, **kwargs): self.cause = kwargs.pop('cause', None) self.prepare(*args, **kwargs) message = self.__doc__.format(**self.__dict__) super(BitforgeError, self).__init__(message) def prepare(self): pass def __str__...
Call super constructor for BitforgeError
Call super constructor for BitforgeError
Python
mit
muun/bitforge,coinforge/bitforge
c19a64ecdbde5a387a84dec880c2ebea1013c3d6
canopus/auth/token_factory.py
canopus/auth/token_factory.py
from datetime import datetime, timedelta from ..schema import UserSchema class TokenFactory(object): def __init__(self, request, user): self.user = user self.request = request def create_access_token(self): user = self.user if user.last_signed_in is None: user.wel...
from datetime import datetime, timedelta from ..schema import UserSchema class TokenFactory(object): def __init__(self, request, user): self.user = user self.request = request def create_access_token(self): user = self.user user.last_signed_in = datetime.now() token ...
Include user in create_access_token return value
Include user in create_access_token return value
Python
mit
josuemontano/api-starter,josuemontano/API-platform,josuemontano/pyramid-angularjs-starter,josuemontano/API-platform,josuemontano/API-platform,josuemontano/api-starter,josuemontano/api-starter,josuemontano/pyramid-angularjs-starter,josuemontano/pyramid-angularjs-starter,josuemontano/API-platform
72f03f05adc39a3d920ee8372f4108b5c8c8671c
modules/pwnchecker.py
modules/pwnchecker.py
#!/usr/bin/python3 import requests import pprint import argparse parser = argparse.ArgumentParser(description='A tool to check if your email account has been in a breach By Jay Townsend') parser.add_argument('-e', '--email-account', help='Email account to lookup', required=True) args = parser.parse_args() headers = ...
#!/usr/bin/python3 import requests import pprint import argparse parser = argparse.ArgumentParser(description='A tool to check if your email account has been in a breach By Jay Townsend') parser.add_argument('-e', '--email-account', help='Email account to lookup', required=True) parser.add_argument('-k', '--api-key',...
Update to the v3 api
Update to the v3 api
Python
bsd-3-clause
L1ghtn1ng/usaf,L1ghtn1ng/usaf
31a9b285a0445c895aeff02b2abbeda12bf7f3d7
wagtail/admin/tests/pages/test_content_type_use_view.py
wagtail/admin/tests/pages/test_content_type_use_view.py
from django.test import TestCase from django.urls import reverse from wagtail.tests.utils import WagtailTestUtils class TestContentTypeUse(TestCase, WagtailTestUtils): fixtures = ['test.json'] def setUp(self): self.user = self.login() def test_content_type_use(self): # Get use of event ...
from django.test import TestCase from django.urls import reverse from django.utils.http import urlencode from wagtail.tests.testapp.models import EventPage from wagtail.tests.utils import WagtailTestUtils class TestContentTypeUse(TestCase, WagtailTestUtils): fixtures = ['test.json'] def setUp(self): ...
Add test for button URLs including a 'next' parameter
Add test for button URLs including a 'next' parameter
Python
bsd-3-clause
torchbox/wagtail,FlipperPA/wagtail,gasman/wagtail,gasman/wagtail,mixxorz/wagtail,thenewguy/wagtail,mixxorz/wagtail,torchbox/wagtail,torchbox/wagtail,thenewguy/wagtail,gasman/wagtail,rsalmaso/wagtail,mixxorz/wagtail,wagtail/wagtail,takeflight/wagtail,FlipperPA/wagtail,torchbox/wagtail,zerolab/wagtail,thenewguy/wagtail,t...
11fd3e5c8a2c7f591dff1ba1949508d178d1e5d5
byceps/util/irc.py
byceps/util/irc.py
""" byceps.util.irc ~~~~~~~~~~~~~~~ Send IRC messages to a bot via HTTP. :Copyright: 2006-2020 Jochen Kupperschmidt :License: Modified BSD, see LICENSE for details. """ from time import sleep from typing import List from flask import current_app import requests DEFAULT_BOT_URL = 'http://127.0.0.1:12345/' DEFAULT_...
""" byceps.util.irc ~~~~~~~~~~~~~~~ Send IRC messages to a bot via HTTP. :Copyright: 2006-2020 Jochen Kupperschmidt :License: Modified BSD, see LICENSE for details. """ from time import sleep from typing import List from flask import current_app import requests DEFAULT_BOT_URL = 'http://127.0.0.1:12345/' DEFAULT_...
Make IRC message delay configurable
Make IRC message delay configurable
Python
bsd-3-clause
homeworkprod/byceps,homeworkprod/byceps,homeworkprod/byceps
6942497dc04683e2d627042b168476fd756dcbda
tasks/check_rd2_enablement.py
tasks/check_rd2_enablement.py
import simple_salesforce from cumulusci.tasks.salesforce import BaseSalesforceApiTask class is_rd2_enabled(BaseSalesforceApiTask): def _run_task(self): try: settings = self.sf.query( "SELECT npsp__IsRecurringDonations2Enabled__c " "FROM npe03__Recurring_Donations...
import simple_salesforce from cumulusci.tasks.salesforce import BaseSalesforceApiTask class is_rd2_enabled(BaseSalesforceApiTask): def _run_task(self): try: settings = self.sf.query( "SELECT IsRecurringDonations2Enabled__c " "FROM npe03__Recurring_Donations_Setti...
Remove namespace from RD2 enablement check
Remove namespace from RD2 enablement check
Python
bsd-3-clause
SalesforceFoundation/Cumulus,SalesforceFoundation/Cumulus,SalesforceFoundation/Cumulus,SalesforceFoundation/Cumulus
0c42909e5649b78260d9efa4e6ff7b77c82b1934
runtests.py
runtests.py
#!/usr/bin/env python # coding: utf-8 import sys from os.path import abspath from os.path import dirname # Load Django-related settings; necessary for tests to run and for Django # imports to work. import local_settings from django.test.simple import DjangoTestSuiteRunner def runtests(): parent_dir = dirname(ab...
#!/usr/bin/env python # coding: utf-8 import sys from argparse import ArgumentParser from os.path import abspath from os.path import dirname # Load Django-related settings; necessary for tests to run and for Django # imports to work. import local_settings # Now, imports from Django will work properly without raising e...
Allow testing of specific apps.
Allow testing of specific apps.
Python
mit
seler/djoauth2,seler/djoauth2,vden/djoauth2-ng,Locu/djoauth2,vden/djoauth2-ng,Locu/djoauth2
d9844f5bcf6d48bde1a60d32998ccdaa87e99676
cloud_browser/__init__.py
cloud_browser/__init__.py
"""Cloud browser application. Provides a simple filesystem-like browser interface for cloud blob datastores. """ VERSION = (0, 2, 1) __version__ = ".".join(str(v) for v in VERSION) __version_full__ = __version__ + "".join(str(v) for v in VERSION)
"""Cloud browser application. Provides a simple filesystem-like browser interface for cloud blob datastores. """ VERSION = (0, 2, 1) __version__ = ".".join(str(v) for v in VERSION) __version_full__ = __version__
Fix __version_full__ for new scheme.
Version: Fix __version_full__ for new scheme.
Python
mit
ryan-roemer/django-cloud-browser,UrbanDaddy/django-cloud-browser,UrbanDaddy/django-cloud-browser,ryan-roemer/django-cloud-browser,ryan-roemer/django-cloud-browser
e9b3865e37c1f4a275c323dcbf778696a27d69bd
testapp/testapp/management.py
testapp/testapp/management.py
from bitcategory import models from django.dispatch import receiver from django.db.models.signals import post_syncdb @receiver(post_syncdb, sender=models) def load_test_categories(sender, **kwargs): r1, c = models.Category.objects.get_or_create(name="root1") r2, c = models.Category.objects.get_or_create(name=...
from bitcategory import models from django.dispatch import receiver from django.db.models.signals import post_migrate @receiver(post_migrate, sender=models) def load_test_categories(sender, **kwargs): r1, c = models.Category.objects.get_or_create(name="root1") r2, c = models.Category.objects.get_or_create(nam...
Update tests to work under django 1.8+
Update tests to work under django 1.8+
Python
bsd-3-clause
atheiste/django-bit-category,atheiste/django-bit-category,atheiste/django-bit-category
67b50cde0fa1885dce936b95d58d82fc64316c85
src/satosa/micro_services/processors/scope_extractor_processor.py
src/satosa/micro_services/processors/scope_extractor_processor.py
from ..attribute_processor import AttributeProcessorError from .base_processor import BaseProcessor CONFIG_KEY_MAPPEDATTRIBUTE = 'mapped_attribute' CONFIG_DEFAULT_MAPPEDATTRIBUTE = '' class ScopeExtractorProcessor(BaseProcessor): """ Extracts the scope from a scoped attribute and maps that to another a...
from ..attribute_processor import AttributeProcessorError, AttributeProcessorWarning from .base_processor import BaseProcessor CONFIG_KEY_MAPPEDATTRIBUTE = 'mapped_attribute' CONFIG_DEFAULT_MAPPEDATTRIBUTE = '' class ScopeExtractorProcessor(BaseProcessor): """ Extracts the scope from a scoped attribute and ...
Allow processor to handle the fact that the attribute might have no values, or that they are not scoped
Allow processor to handle the fact that the attribute might have no values, or that they are not scoped
Python
apache-2.0
SUNET/SATOSA,its-dirg/SATOSA,irtnog/SATOSA,SUNET/SATOSA,irtnog/SATOSA
5749d976dee7d8a51e25842b528448a077a8f800
report_compassion/models/ir_actions_report.py
report_compassion/models/ir_actions_report.py
# Copyright (c) 2018 Emanuel Cino <ecino@compassion.ch> from odoo import models, api class IrActionsReport(models.Model): _inherit = "ir.actions.report" @api.multi def behaviour(self): """ Change behaviour to return user preference in priority. :return: report action for printin...
# Copyright (c) 2018 Emanuel Cino <ecino@compassion.ch> from odoo import models, api class IrActionsReport(models.Model): _inherit = "ir.actions.report" @api.multi def behaviour(self): """ Change behaviour to return user preference in priority. :return: report action for printin...
FIX default behaviour of printing
FIX default behaviour of printing
Python
agpl-3.0
CompassionCH/compassion-switzerland,eicher31/compassion-switzerland,eicher31/compassion-switzerland,CompassionCH/compassion-switzerland,CompassionCH/compassion-switzerland,eicher31/compassion-switzerland
a1a8ef302ac24d56a36d0671eb692943d14c4ddf
whats_open/website/urls.py
whats_open/website/urls.py
# Future Imports from __future__ import (absolute_import, division, print_function, unicode_literals) # Django Imports from django.conf.urls import include, url # App Imports from .views import CategoryViewSet, FacilityViewSet, ScheduleViewSet # Other Imports from rest_framework.routers impor...
# Future Imports from __future__ import (absolute_import, division, print_function, unicode_literals) # Django Imports from django.conf.urls import include, url from django.views.generic.base import RedirectView # App Imports from .views import CategoryViewSet, FacilityViewSet, ScheduleViewSet...
Add a redirect for / -> /api
refactor: Add a redirect for / -> /api - This got really annoying in development to remember to go to /api all the time - Potentially in the future we will build a test landing page on / to test that the API works instead of having to rely on third party tools or just manual clicks - Until then, this will make life e...
Python
apache-2.0
srct/whats-open,srct/whats-open,srct/whats-open
d3f4d43b36b8d21a3102389d53bf3f1af4e00d79
st2common/st2common/runners/base_action.py
st2common/st2common/runners/base_action.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...
# 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 _all__ to the module.
Add _all__ to the module.
Python
apache-2.0
StackStorm/st2,nzlosh/st2,Plexxi/st2,nzlosh/st2,Plexxi/st2,nzlosh/st2,Plexxi/st2,Plexxi/st2,StackStorm/st2,StackStorm/st2,nzlosh/st2,StackStorm/st2
715733fce547aa010ae94239bf856453b9b62869
containers/default/pythia.py
containers/default/pythia.py
import json import sys import shutil import os #Copy /ro/task (which is read-only) in /task. Everything will be executed there shutil.copytree("/ro/task","/task") #Change directory to /task os.chdir("/task") #Parse input to return stupid output input = json.loads(sys.stdin.readline()) problems = {} for boxId in inpu...
import json import sys import shutil import os import resource import subprocess #Copy /ro/task (which is read-only) in /task. Everything will be executed there shutil.copytree("/ro/task","/task") #Change directory to /task os.chdir("/task") #Parse input to return stupid output input = json.loads(sys.stdin.readline(...
Insert a valid test task
Insert a valid test task
Python
agpl-3.0
GuillaumeDerval/INGInious,GuillaumeDerval/INGInious,layus/INGInious,layus/INGInious,layus/INGInious,GuillaumeDerval/INGInious,GuillaumeDerval/INGInious,layus/INGInious
873833d777536de5aa716a509e590ad1b076198a
scripts/examples/OpenMV/99-Tests/unittests.py
scripts/examples/OpenMV/99-Tests/unittests.py
# OpenMV Unit Tests. # import os, sensor, gc TEST_DIR = "unittest" TEMP_DIR = "unittest/temp" DATA_DIR = "unittest/data" SCRIPT_DIR = "unittest/script" if not (TEST_DIR in os.listdir("")): raise Exception('Unittest dir not found!') print("") test_failed = False def print_result(test, result): s = ...
# OpenMV Unit Tests. # import os, sensor, gc TEST_DIR = "unittest" TEMP_DIR = "unittest/temp" DATA_DIR = "unittest/data" SCRIPT_DIR = "unittest/script" if not (TEST_DIR in os.listdir("")): raise Exception('Unittest dir not found!') print("") test_failed = False def print_result(test, result): s = ...
Fix unit-test failing on disabled functions.
Fix unit-test failing on disabled functions.
Python
mit
kwagyeman/openmv,openmv/openmv,iabdalkader/openmv,openmv/openmv,openmv/openmv,iabdalkader/openmv,iabdalkader/openmv,openmv/openmv,kwagyeman/openmv,kwagyeman/openmv,kwagyeman/openmv,iabdalkader/openmv
ee6c7caabdfcd0bddd9b92d05cddd8b6be7cbe10
tests/functional/test_pip_runner_script.py
tests/functional/test_pip_runner_script.py
import os from pathlib import Path from pip import __version__ from tests.lib import PipTestEnvironment def test_runner_work_in_environments_with_no_pip( script: PipTestEnvironment, pip_src: Path ) -> None: runner = pip_src / "src" / "pip" / "__pip-runner__.py" # Ensure there's no pip installed in the e...
import os from pathlib import Path from pip import __version__ from tests.lib import PipTestEnvironment def test_runner_work_in_environments_with_no_pip( script: PipTestEnvironment, pip_src: Path ) -> None: runner = pip_src / "src" / "pip" / "__pip-runner__.py" # Ensure there's no pip installed in the e...
Fix test_runner_work_in_environments_with_no_pip to work under --use-zipapp
Fix test_runner_work_in_environments_with_no_pip to work under --use-zipapp
Python
mit
pradyunsg/pip,pypa/pip,pfmoore/pip,pfmoore/pip,sbidoul/pip,pradyunsg/pip,sbidoul/pip,pypa/pip
ab00a69ee0d5c556af118d9cf76b5b9a0db25e6d
telemetry/telemetry/page/page_test_results.py
telemetry/telemetry/page/page_test_results.py
# Copyright (c) 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import traceback import unittest class PageTestResults(unittest.TestResult): def __init__(self): super(PageTestResults, self).__init__() self....
# Copyright (c) 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import traceback import unittest class PageTestResults(unittest.TestResult): def __init__(self): super(PageTestResults, self).__init__() self....
Add skipped and addSkip() to PageTestResults, for Python < 2.7.
[telemetry] Add skipped and addSkip() to PageTestResults, for Python < 2.7. Fixing bots after https://chromiumcodereview.appspot.com/15153003/ Also fix typo in addSuccess(). successes is only used by record_wpr, so that mistake had no effect on the bots. TBR=tonyg@chromium.org BUG=None. TEST=None. Review URL: https:...
Python
bsd-3-clause
benschmaus/catapult,catapult-project/catapult,SummerLW/Perf-Insight-Report,sahiljain/catapult,benschmaus/catapult,sahiljain/catapult,catapult-project/catapult,catapult-project/catapult-csm,catapult-project/catapult-csm,SummerLW/Perf-Insight-Report,catapult-project/catapult-csm,catapult-project/catapult-csm,catapult-pro...
0e835c6381374c5b00b7387057d056d679f635c4
zproject/legacy_urls.py
zproject/legacy_urls.py
from django.conf.urls import url import zerver.views import zerver.views.streams import zerver.views.auth import zerver.views.tutorial import zerver.views.report # Future endpoints should add to urls.py, which includes these legacy urls legacy_urls = [ # These are json format views used by the web client. They r...
from django.urls import path import zerver.views import zerver.views.streams import zerver.views.auth import zerver.views.tutorial import zerver.views.report # Future endpoints should add to urls.py, which includes these legacy urls legacy_urls = [ # These are json format views used by the web client. They requi...
Migrate legacy urls to use modern django pattern.
urls: Migrate legacy urls to use modern django pattern.
Python
apache-2.0
shubhamdhama/zulip,punchagan/zulip,kou/zulip,showell/zulip,hackerkid/zulip,timabbott/zulip,eeshangarg/zulip,kou/zulip,andersk/zulip,zulip/zulip,synicalsyntax/zulip,zulip/zulip,andersk/zulip,shubhamdhama/zulip,showell/zulip,kou/zulip,hackerkid/zulip,shubhamdhama/zulip,andersk/zulip,eeshangarg/zulip,brainwane/zulip,shubh...
5b6026bac75ae906d55410c583ebe4a756232dd7
cla_backend/apps/cla_eventlog/management/commands/find_and_delete_old_cases.py
cla_backend/apps/cla_eventlog/management/commands/find_and_delete_old_cases.py
from django.core.management.base import BaseCommand from dateutil.relativedelta import relativedelta from legalaid.models import Case from cla_butler.tasks import DeleteOldData class FindAndDeleteCasesUsingCreationTime(DeleteOldData): def get_eligible_cases(self): self._setup() two_years = self.n...
import sys from django.core.management.base import BaseCommand from dateutil.relativedelta import relativedelta from legalaid.models import Case from cla_butler.tasks import DeleteOldData class FindAndDeleteCasesUsingCreationTime(DeleteOldData): def get_eligible_cases(self): two_years = self.now - relati...
Change functionality depending on where command is called from
Change functionality depending on where command is called from
Python
mit
ministryofjustice/cla_backend,ministryofjustice/cla_backend,ministryofjustice/cla_backend,ministryofjustice/cla_backend
fe47651ddd32a5795dab28ca998230b042a70c59
app/views/comment_view.py
app/views/comment_view.py
from flask_classy import FlaskView from flask_user import current_user, login_required from ..models import CommentModel, PostModel from ..forms import CommentForm class Comment(FlaskView): def get(self): pass def all(self, post_id): comment = CommentModel() comment.query.add_filter(...
from flask import jsonify from flask_classy import FlaskView from flask_user import current_user, login_required from ..models import CommentModel, PostModel from ..forms import CommentForm class Comment(FlaskView): def get(self): pass def all(self, post_id): comment = CommentModel() ...
Comment all view return a json of all comments
Comment all view return a json of all comments
Python
mit
oldani/nanodegree-blog,oldani/nanodegree-blog,oldani/nanodegree-blog
5b9f0270aaa53a562ca65fa74769885621da4a8e
website/addons/s3/__init__.py
website/addons/s3/__init__.py
import os from . import model from . import routes from . import views MODELS = [model.AddonS3UserSettings, model.AddonS3NodeSettings, model.S3GuidFile] USER_SETTINGS_MODEL = model.AddonS3UserSettings NODE_SETTINGS_MODEL = model.AddonS3NodeSettings ROUTES = [routes.settings_routes] SHORT_NAME = 's3' FULL_NAME = 'Am...
import os from . import model from . import routes from . import views MODELS = [model.AddonS3UserSettings, model.AddonS3NodeSettings, model.S3GuidFile] USER_SETTINGS_MODEL = model.AddonS3UserSettings NODE_SETTINGS_MODEL = model.AddonS3NodeSettings ROUTES = [routes.settings_routes] SHORT_NAME = 's3' FULL_NAME = 'Am...
Change S3 full name to Amazon S3
Change S3 full name to Amazon S3
Python
apache-2.0
hmoco/osf.io,jmcarp/osf.io,abought/osf.io,amyshi188/osf.io,brandonPurvis/osf.io,sloria/osf.io,barbour-em/osf.io,lyndsysimon/osf.io,GageGaskins/osf.io,brandonPurvis/osf.io,HarryRybacki/osf.io,pattisdr/osf.io,HalcyonChimera/osf.io,wearpants/osf.io,TomBaxter/osf.io,samanehsan/osf.io,zachjanicki/osf.io,mluo613/osf.io,Zobai...
d18ff30bbddde5049ffbe23bce19288c3c47e41b
posts/views.py
posts/views.py
from django.views.generic.list import ListView from django.views.generic.detail import DetailView from .models import Post class PostListView(ListView): model = Post context_object_name = 'posts' class PostDetailView(DetailView): model = Post context_object_name = 'post'
from django.views.generic.list import ListView from django.views.generic.detail import DetailView from .models import Post class PostListView(ListView): model = Post context_object_name = 'posts' def get_queryset(self): """ Order posts by the day they were added, from newest, to oldest....
Order posts from newest to oldest
posts: Order posts from newest to oldest
Python
mit
rtrembecky/roots,tbabej/roots,rtrembecky/roots,tbabej/roots,matus-stehlik/roots,matus-stehlik/roots,matus-stehlik/glowing-batman,matus-stehlik/roots,matus-stehlik/glowing-batman,rtrembecky/roots,tbabej/roots
dae8420456280fdf1f0971301986995c21fd8027
static_template_view/views.py
static_template_view/views.py
# View for semi-static templatized content. # # List of valid templates is explicitly managed for (short-term) # security reasons. from mitxmako.shortcuts import render_to_response, render_to_string from django.shortcuts import redirect from django.core.context_processors import csrf from django.conf import settings ...
# View for semi-static templatized content. # # List of valid templates is explicitly managed for (short-term) # security reasons. from mitxmako.shortcuts import render_to_response, render_to_string from django.shortcuts import redirect from django.core.context_processors import csrf from django.conf import settings ...
Support for static pages added
Support for static pages added
Python
agpl-3.0
appliedx/edx-platform,SivilTaram/edx-platform,inares/edx-platform,shurihell/testasia,zofuthan/edx-platform,wwj718/edx-platform,abdoosh00/edx-rtl-final,10clouds/edx-platform,unicri/edx-platform,Edraak/edx-platform,praveen-pal/edx-platform,jruiperezv/ANALYSE,fly19890211/edx-platform,Lektorium-LLC/edx-platform,morenopc/ed...
b583c5fb00d1ebfa0458a6233be85d8b56173abf
python/printbag.py
python/printbag.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """Print a rosbag file. """ import sys import logging import numpy as np # suppress logging warnings due to rospy logging.basicConfig(filename='/dev/null') import rosbag from antlia.dtype import LIDAR_CONVERTED_DTYPE def print_bag(bag, topics=None): if topics is No...
#!/usr/bin/env python # -*- coding: utf-8 -*- """Print a rosbag file. """ import sys import logging # suppress logging warnings due to rospy logging.basicConfig(filename='/dev/null') import rosbag def print_bag(bag, topics=None): for message in bag.read_messages(topics=topics): print(message) if __name...
Add argument to specify bag topics
Add argument to specify bag topics
Python
bsd-2-clause
oliverlee/antlia
ca06bf1d52cd51ccec178c98ad407bfe59f1ada1
strobe.py
strobe.py
import RPi.GPIO as GPIO from time import sleep def onoff(period, pin): """Symmetric square wave, equal time on/off""" half_cycle = period / 2.0 GPIO.output(pin, GPIO.HIGH) sleep(half_cycle) GPIO.output(pin, GPIO.LOW) sleep(half_cycle) def strobe(freq, dur, pin): nflashes = freq * dur s...
# Adapted from code by Rahul Kar # http://www.rpiblog.com/2012/09/using-gpio-of-raspberry-pi-to-blink-led.html import RPi.GPIO as GPIO from time import sleep def onoff(ontime, offtime, pin): GPIO.output(pin, GPIO.HIGH) sleep(ontime) GPIO.output(pin, GPIO.LOW) sleep(offtime) def strobe(freq, dur, pin)...
Make onoff function more versatile
Make onoff function more versatile
Python
mit
zimolzak/Raspberry-Pi-newbie,zimolzak/Raspberry-Pi-newbie,zimolzak/Raspberry-Pi-newbie,zimolzak/Raspberry-Pi-newbie,zimolzak/Raspberry-Pi-newbie
aca17ff2fddd35bd50d78d62dc6dab7e47fb8e4e
controllers/default.py
controllers/default.py
import os def index(): def GET(): return locals() @request.restful() def api(): response.view = 'generic.json' def GET(resource,resource_id): if not resource=='study': raise HTTP(400) # return the correct nexson of study_id return _get_nexson(resource_id) def POST(resou...
import os def index(): def GET(): return locals() @request.restful() def api(): response.view = 'generic.json' def GET(resource,resource_id): if not resource=='study': raise HTTP(400) # return the correct nexson of study_id return _get_nexson(resource_id) def POST(resou...
Use the new location of study NexSON
Use the new location of study NexSON Each study now has a distinct directory. Currently we only plan to store a single JSON file in each directory, until one becomes larger than 50MB. Additionally, this allows various metadata/artifacts about a study to live near the actually study data.
Python
bsd-2-clause
OpenTreeOfLife/phylesystem-api,OpenTreeOfLife/phylesystem-api,OpenTreeOfLife/phylesystem-api
a08de1d3c7f7dfc72c8b3b8e9019d1b7b5ad004e
mdtraj/tests/test_load.py
mdtraj/tests/test_load.py
############################################################################## # MDTraj: A Python Library for Loading, Saving, and Manipulating # Molecular Dynamics Trajectories. # Copyright 2012-2013 Stanford University and the Authors # # Authors: Robert McGibbon # Contributors: # # MDTraj is free software: y...
from mdtraj import load from mdtraj.testing import get_fn def test_load_single(): """ Just check for any raised errors coming from loading a single file. """ load(get_fn('frame0.pdb')) def test_load_single_list(): """ See if a single-element list of files is successfully loaded. """ lo...
Fix test for loading multiple trajectories.
Fix test for loading multiple trajectories.
Python
lgpl-2.1
msultan/mdtraj,rmcgibbo/mdtraj,tcmoore3/mdtraj,mdtraj/mdtraj,jchodera/mdtraj,msultan/mdtraj,ctk3b/mdtraj,ctk3b/mdtraj,mdtraj/mdtraj,msultan/mdtraj,mattwthompson/mdtraj,jchodera/mdtraj,jchodera/mdtraj,leeping/mdtraj,gph82/mdtraj,rmcgibbo/mdtraj,gph82/mdtraj,jchodera/mdtraj,mdtraj/mdtraj,leeping/mdtraj,tcmoore3/mdtraj,ct...
b3400070d47d95bfa2eeac3a9f696b8957d88128
conjureup/controllers/clouds/tui.py
conjureup/controllers/clouds/tui.py
from conjureup import controllers, events, juju, utils from conjureup.app_config import app from conjureup.consts import cloud_types from .common import BaseCloudController class CloudsController(BaseCloudController): def __controller_exists(self, controller): return juju.get_controller(controller) is no...
from conjureup import controllers, events, juju, utils from conjureup.app_config import app from conjureup.consts import cloud_types from .common import BaseCloudController class CloudsController(BaseCloudController): def __controller_exists(self, controller): return juju.get_controller(controller) is no...
Fix issue where non localhost headless clouds werent calling finish
Fix issue where non localhost headless clouds werent calling finish Signed-off-by: Adam Stokes <49c255c1d074742f60d19fdba5e2aa5a34add567@users.noreply.github.com>
Python
mit
conjure-up/conjure-up,Ubuntu-Solutions-Engineering/conjure,ubuntu/conjure-up,Ubuntu-Solutions-Engineering/conjure,conjure-up/conjure-up,ubuntu/conjure-up
b123001ea0d4fb475184727c39eafd5b46cc0964
shopit_app/urls.py
shopit_app/urls.py
from django.conf import settings from django.conf.urls import include, patterns, url from rest_framework_nested import routers from shopit_app.views import IndexView from authentication_app.views import AccountViewSet, LoginView router = routers.SimpleRouter() router.register(r'accounts', AccountViewSet) urlpattern...
from django.conf import settings from django.conf.urls import include, patterns, url from rest_framework_nested import routers from shopit_app.views import IndexView from authentication_app.views import AccountViewSet, LoginView, LogoutView router = routers.SimpleRouter() router.register(r'accounts', AccountViewSet)...
Add the endpoint for the logout.
Add the endpoint for the logout.
Python
mit
mvpgomes/shopit-app,mvpgomes/shopit-app,mvpgomes/shopit-app,mvpgomes/shopit-app
0d7921b4dcf5e3b511fdb54fc30ebc0547b14d47
django_dzenlog/urls.py
django_dzenlog/urls.py
from django.conf.urls.defaults import * from models import GeneralPost from feeds import LatestPosts post_list = { 'queryset': GeneralPost.objects.all(), } feeds = { 'all': LatestPosts, } urlpatterns = patterns('django.views.generic', (r'^(?P<slug>[a-z0-9-]+)/$', 'list_detail.object_detail', post_list, 'd...
from django.conf.urls.defaults import * from models import GeneralPost from feeds import latest post_list = { 'queryset': GeneralPost.objects.all(), } feeds = { 'all': latest(GeneralPost, 'dzenlog-post-list'), } urlpatterns = patterns('django.views.generic', (r'^(?P<slug>[a-z0-9-]+)/$', 'list_detail.objec...
Use 'latest' to generate feed for GeneralPost.
Use 'latest' to generate feed for GeneralPost.
Python
bsd-3-clause
svetlyak40wt/django-dzenlog
7269322106911fcb1fb71160421fc3e011fbee1d
byceps/config_defaults.py
byceps/config_defaults.py
""" byceps.config_defaults ~~~~~~~~~~~~~~~~~~~~~~ Default configuration values :Copyright: 2006-2021 Jochen Kupperschmidt :License: Revised BSD (see `LICENSE` file for details) """ from datetime import timedelta from pathlib import Path # database connection SQLALCHEMY_ECHO = False # Avoid connection errors after...
""" byceps.config_defaults ~~~~~~~~~~~~~~~~~~~~~~ Default configuration values :Copyright: 2006-2021 Jochen Kupperschmidt :License: Revised BSD (see `LICENSE` file for details) """ from datetime import timedelta from pathlib import Path # database connection SQLALCHEMY_ECHO = False # Avoid connection errors after...
Remove superseded config default for `ROOT_REDIRECT_STATUS_CODE`
Remove superseded config default for `ROOT_REDIRECT_STATUS_CODE`
Python
bsd-3-clause
homeworkprod/byceps,homeworkprod/byceps,homeworkprod/byceps
cab0f9ea3471cf88dd03da7a243ae55579b44b65
client.py
client.py
#!/usr/env/bin python import RPi.GPIO as io import requests import sys class Switch(object): def __init__(self, **kwargs): self.pin = kwargs["pin"] io.setup(self.pin, io.IN) @property def is_on(self): return io.input(self.pin) PINS = (8, 16, 18) switches = set() def has_free(): ...
#!/usr/env/bin python import RPi.GPIO as io import sys class Switch(object): def __init__(self, **kwargs): self.pin = kwargs["pin"] io.setup(self.pin, io.IN) @property def is_on(self): return io.input(self.pin) PINS = (8, 16, 18) server_url = sys.argv[1] switches = set() def has_...
Set server URL with command line argument
Set server URL with command line argument
Python
mit
madebymany/isthetoiletfree
384beaa77e2eaad642ec7f764acd09c2c3e04350
res_company.py
res_company.py
from openerp.osv import osv, fields from openerp.tools.translate import _ class res_company(osv.Model): _inherit = "res.company" _columns = { 'remittance_letter_top': fields.text( _('Remittance Letter - top message'), help=_('Message to write at the top of Remittance Letter ' ...
from openerp.osv import osv, fields from openerp.tools.translate import _ class res_company(osv.Model): _inherit = "res.company" _columns = { 'remittance_letter_top': fields.text( _('Remittance Letter - top message'), help=_('Message to write at the top of Remittance Letter ' ...
Make Remittance Letter config messages translatable
Make Remittance Letter config messages translatable
Python
agpl-3.0
xcgd/account_streamline
a0c656f89829ca18c383f1884e3186103b9e5fa6
fabfile.py
fabfile.py
from fabric.api import cd, run, task try: import fabfile_local _pyflakes = fabfile_local except ImportError: pass @task def update(): with cd("~/vagrant-installers"): run("git pull")
from fabric.api import cd, env, run, task try: import fabfile_local _pyflakes = fabfile_local except ImportError: pass @task def update(): with cd("~/vagrant-installers"): run("git pull") @task def all(): "Run the task against all hosts." for _, value in env.roledefs.iteritems(): ...
Allow the targetting of specific roles with fabric
Allow the targetting of specific roles with fabric
Python
mit
redhat-developer-tooling/vagrant-installers,mitchellh/vagrant-installers,chrisroberts/vagrant-installers,mitchellh/vagrant-installers,chrisroberts/vagrant-installers,mitchellh/vagrant-installers,mitchellh/vagrant-installers,chrisroberts/vagrant-installers,chrisroberts/vagrant-installers,redhat-developer-tooling/vagrant...
813dd27a2057d2e32726ff6b43ab8ca1411303c7
fabfile.py
fabfile.py
from fabric.api import * from fabric.colors import * env.colorize_errors = True env.hosts = ['sanaprotocolbuilder.me'] env.user = 'root' env.project_root = '/opt/sana.protocol_builder' def prepare_deploy(): local('python sana_builder/manage.py syncdb') local('python sana_builder/manage...
from fabric.api import * from fabric.colors import * env.colorize_errors = True env.hosts = ['sanaprotocolbuilder.me'] env.user = 'root' env.project_root = '/opt/sana.protocol_builder' def prepare_deploy(): local('python sana_builder/manage.py syncdb') local('python sana_builder/manage...
Prepare for deploy in deploy script.
Prepare for deploy in deploy script.
Python
bsd-3-clause
SanaMobile/sana.protocol_builder,SanaMobile/sana.protocol_builder,SanaMobile/sana.protocol_builder,SanaMobile/sana.protocol_builder,SanaMobile/sana.protocol_builder
e8f8407ee422375af07027af2846a95c9cfaad37
fabfile.py
fabfile.py
#!/usr/bin/env python from fabric.api import env, run, sudo, task from fabric.context_managers import cd, prefix from fabric.contrib.project import rsync_project env.use_ssh_config = True home = '~/jarvis2' @task def pull_code(): with cd(home): run('git pull --rebase') @task def push_code(): rsync...
#!/usr/bin/env python from fabric.api import env, run, sudo, task from fabric.context_managers import cd, prefix from fabric.contrib.project import rsync_project env.use_ssh_config = True home = '~/jarvis2' @task def pull_code(): with cd(home): run('git pull --rebase') @task def push_code(): rsync...
Use checksum when pushing code with rsync
Use checksum when pushing code with rsync
Python
mit
Foxboron/Frank,Foxboron/Frank,mpolden/jarvis2,Foxboron/Frank,martinp/jarvis2,martinp/jarvis2,mpolden/jarvis2,mpolden/jarvis2,martinp/jarvis2
b374221d8d0e902494066d666570c1a882c962bc
s3img_magic.py
s3img_magic.py
from IPython.display import Image import boto def parse_s3_uri(uri): if uri.startswith('s3://'): uri = uri[5:] return uri.split('/', 1) def get_s3_key(uri): bucket_name, key_name = parse_s3_uri(uri) conn = boto.connect_s3() bucket = conn.get_bucket(bucket_name) return bucket.get_k...
from StringIO import StringIO from IPython.core.magic import Magics, magics_class, line_magic from IPython.display import Image import boto def parse_s3_uri(uri): if uri.startswith('s3://'): uri = uri[5:] return uri.split('/', 1) def get_s3_bucket(bucket_name): conn = boto.connect_s3() r...
Add magic to save a Matplotlib figure to S3
Add magic to save a Matplotlib figure to S3
Python
mit
AustinRochford/s3img-ipython-magic,AustinRochford/s3img-ipython-magic
b7aa7e85064430dc95e74a0f676f0484fee12733
tests/cli/test_pinout.py
tests/cli/test_pinout.py
from __future__ import ( unicode_literals, absolute_import, print_function, division, ) str = type('') import pytest from gpiozero.cli import pinout def test_args_incorrect(): with pytest.raises(SystemExit) as ex: pinout.parse_args(['--nonexistentarg']) def test_args_color(): a...
from __future__ import ( unicode_literals, absolute_import, print_function, division, ) str = type('') import pytest from gpiozero.cli.pinout import main def test_args_incorrect(): with pytest.raises(SystemExit) as ex: main(['pinout', '--nonexistentarg']) def test_args_color(): ...
Fix up pinout tests so they work with new structure
Fix up pinout tests so they work with new structure
Python
bsd-3-clause
MrHarcombe/python-gpiozero,waveform80/gpio-zero,RPi-Distro/python-gpiozero
0ef346389b680e81ab618d4d782239640c1926f5
tests/test_collection.py
tests/test_collection.py
import unittest from indigo.models import Collection from indigo.models.errors import UniqueException from nose.tools import raises class NodeTest(unittest.TestCase): def test_a_create_root(self): Collection.create(name="test_root", parent=None, path="/") coll = Collection.find("test_root") ...
import unittest from indigo.models import Collection from indigo.models.errors import UniqueException from nose.tools import raises class NodeTest(unittest.TestCase): def test_a_create_root(self): Collection.create(name="test_root", parent=None, path="/") coll = Collection.find("test_root") ...
Remove unnecessary test of collection children
Remove unnecessary test of collection children
Python
agpl-3.0
UMD-DRASTIC/drastic
afa10a27aa1fe1eaa719d988902c2f3f4d5d0928
webapp/controllers/contact.py
webapp/controllers/contact.py
# -*- coding: utf-8 -*- ### required - do no delete def user(): return dict(form=auth()) def download(): return response.download(request,db) def call(): return service() ### end requires def index(): return dict()
# -*- coding: utf-8 -*- from opentreewebapputil import (get_opentree_services_method_urls, fetch_current_TNRS_context_names) ### required - do no delete def user(): return dict(form=auth()) def download(): return response.download(request,db) def call(): return service() ### end requir...
Fix missing search-context list on Contact page.
Fix missing search-context list on Contact page.
Python
bsd-2-clause
OpenTreeOfLife/opentree,OpenTreeOfLife/opentree,OpenTreeOfLife/opentree,OpenTreeOfLife/opentree,OpenTreeOfLife/opentree,OpenTreeOfLife/opentree
6858e4a2e2047c906a3b8f69b7cd7b04a0cbf666
pivoteer/writer/censys.py
pivoteer/writer/censys.py
""" Classes and functions for writing IndicatorRecord objects with a record type of "CE" (Censys Record) """ from pivoteer.writer.core import CsvWriter class CensysCsvWriter(CsvWriter): """ A CsvWriter implementation for IndicatorRecords with a record type of "CE" (Censys Record) """ def __init__(se...
""" Classes and functions for writing IndicatorRecord objects with a record type of "CE" (Censys Record) """ from pivoteer.writer.core import CsvWriter class CensysCsvWriter(CsvWriter): """ A CsvWriter implementation for IndicatorRecords with a record type of "CE" (Censys Record) """ def __init__(se...
Resolve issues with exporting empty dataset for certificate list
Resolve issues with exporting empty dataset for certificate list
Python
mit
gdit-cnd/RAPID,gdit-cnd/RAPID,LindaTNguyen/RAPID,gdit-cnd/RAPID,gdit-cnd/RAPID,LindaTNguyen/RAPID,gdit-cnd/RAPID,LindaTNguyen/RAPID,LindaTNguyen/RAPID,LindaTNguyen/RAPID
4a6a2155878d309e6bc96a948811daafa4a92908
protocols/no_reconnect.py
protocols/no_reconnect.py
try: from .. import api, shared as G from ... import editor from ..exc_fmt import str_e from ..protocols import floo_proto except (ImportError, ValueError): from floo import editor from floo.common import api, shared as G from floo.common.exc_fmt import str_e from floo.common.protocols i...
try: from .. import api, shared as G from ... import editor from ..exc_fmt import str_e from ..protocols import floo_proto except (ImportError, ValueError): from floo import editor from floo.common import api, shared as G from floo.common.exc_fmt import str_e from floo.common.protocols i...
Call connect instead of reconnect.
Call connect instead of reconnect.
Python
apache-2.0
Floobits/plugin-common-python
87d1801fefcd048f60c944c28bfc005101c5704b
dynd/tests/test_nd_groupby.py
dynd/tests/test_nd_groupby.py
import sys import unittest from dynd import nd, ndt class TestGroupBy(unittest.TestCase): def test_immutable(self): a = nd.array([ ('x', 0), ('y', 1), ('x', 2), ('x', 3), ('y', 4)], dtype='{A: string; B: int32}'...
import sys import unittest from dynd import nd, ndt class TestGroupBy(unittest.TestCase): def test_immutable(self): a = nd.array([ ('x', 0), ('y', 1), ('x', 2), ('x', 3), ('y', 4)], dtype='{A: string; B: int32}'...
Add some more simple nd.groupby tests
Add some more simple nd.groupby tests
Python
bsd-2-clause
cpcloud/dynd-python,izaid/dynd-python,aterrel/dynd-python,michaelpacer/dynd-python,mwiebe/dynd-python,insertinterestingnamehere/dynd-python,aterrel/dynd-python,cpcloud/dynd-python,cpcloud/dynd-python,izaid/dynd-python,aterrel/dynd-python,mwiebe/dynd-python,michaelpacer/dynd-python,mwiebe/dynd-python,pombredanne/dynd-py...
7b935b23e17ef873a060fdfbefbfdf232fe8b8de
git_release/release.py
git_release/release.py
import subprocess from git_release import errors, git_helpers def _parse_tag(tag): major, minor = tag.split('.') return int(major), int(minor) def _increment_tag(tag, release_type): major, minor = _parse_tag(tag) if release_type == 'major': new_major = major + 1 new_minor = 0 else...
import subprocess from git_release import errors, git_helpers def _parse_tag(tag): major, minor = tag.split('.') return int(major), int(minor) def _increment_tag(tag, release_type): major, minor = _parse_tag(tag) if release_type == 'major': new_major = major + 1 new_minor = 0 else...
Add missing argument to _increment_tag call
Add missing argument to _increment_tag call
Python
mit
Authentise/git-release
14f4fe95be0501142f929a9b7bec807fd14e3d6f
eva/layers/residual_block.py
eva/layers/residual_block.py
from keras.layers import Convolution2D, Merge from keras.layers.advanced_activations import PReLU from keras.engine.topology import merge from eva.layers.masked_convolution2d import MaskedConvolution2D def ResidualBlock(model, filters): # 2h -> h block = Convolution2D(filters//2, 1, 1)(model) block = PReL...
from keras.layers import Convolution2D, Merge from keras.layers.advanced_activations import PReLU from eva.layers.masked_convolution2d import MaskedConvolution2D def ResidualBlock(model, filters): # 2h -> h block = PReLU()(model) block = MaskedConvolution2D(filters//2, 1, 1)(block) # h 3x3 -> h b...
Fix residual blocks to be on-par with paper.
Fix residual blocks to be on-par with paper.
Python
apache-2.0
israelg99/eva
fcfceb59cbd368ddaee87906d3f53f15bbb30072
examples/tornado/auth_demo.py
examples/tornado/auth_demo.py
from mongrel2.config import * main = Server( uuid="f400bf85-4538-4f7a-8908-67e313d515c2", access_log="/logs/access.log", error_log="/logs/error.log", chroot="./", default_host="localhost", name="test", pid_file="/run/mongrel2.pid", port=6767, hosts = [ Host(name="localhost"...
from mongrel2.config import * main = Server( uuid="f400bf85-4538-4f7a-8908-67e313d515c2", access_log="/logs/access.log", error_log="/logs/error.log", chroot="./", default_host="localhost", name="test", pid_file="/run/mongrel2.pid", port=6767, hosts = [ Host(name="localhost"...
Add the settings to the authdemo.
Add the settings to the authdemo.
Python
bsd-3-clause
solidrails/mongrel2,solidrails/mongrel2,solidrails/mongrel2,solidrails/mongrel2
f783d8ac4314923f1259208eb221c8874c03884a
calexicon/fn/iso.py
calexicon/fn/iso.py
from datetime import date as vanilla_date, timedelta from overflow import OverflowDate def iso_to_gregorian(year, week, weekday): if week < 1 or week > 54: raise ValueError( "Week number %d is invalid for an ISO calendar." % (week, ) ) jan_8 = vanilla_date(year, 1, 8)....
from datetime import date as vanilla_date, timedelta from overflow import OverflowDate def _check_week(week): if week < 1 or week > 54: raise ValueError( "Week number %d is invalid for an ISO calendar." % (week, ) ) def iso_to_gregorian(year, week, weekday): _check_w...
Move check for week number out into function.
Move check for week number out into function.
Python
apache-2.0
jwg4/qual,jwg4/calexicon
11aab47e3c8c0d4044042aead7c01c990a152bea
tests/integration/customer/test_dispatcher.py
tests/integration/customer/test_dispatcher.py
from django.test import TestCase from django.core import mail from oscar.core.compat import get_user_model from oscar.apps.customer.utils import Dispatcher from oscar.apps.customer.models import CommunicationEventType from oscar.test.factories import create_order User = get_user_model() class TestDispatcher(TestCa...
from django.test import TestCase from django.core import mail from oscar.core.compat import get_user_model from oscar.apps.customer.utils import Dispatcher from oscar.apps.customer.models import CommunicationEventType from oscar.test.factories import create_order User = get_user_model() class TestDispatcher(TestCa...
Add tests for sending messages to emails without account.
Add tests for sending messages to emails without account.
Python
bsd-3-clause
sonofatailor/django-oscar,solarissmoke/django-oscar,okfish/django-oscar,okfish/django-oscar,django-oscar/django-oscar,sasha0/django-oscar,sonofatailor/django-oscar,django-oscar/django-oscar,django-oscar/django-oscar,solarissmoke/django-oscar,django-oscar/django-oscar,okfish/django-oscar,sonofatailor/django-oscar,okfish...
ec7647c264bb702d4211779ef55ca5a694307faf
ibmcnx/doc/DataSources.py
ibmcnx/doc/DataSources.py
###### # Check ExId (GUID) by Email through JDBC # # Author: Christoph Stoettner # Mail: christoph.stoettner@stoeps.de # Documentation: http://scripting101.stoeps.de # # Version: 2.0 # Date: 2014-06-04 # # License: Apache 2.0 # # Check ExId of a User in all Connections Appli...
###### # Check ExId (GUID) by Email through JDBC # # Author: Christoph Stoettner # Mail: christoph.stoettner@stoeps.de # Documentation: http://scripting101.stoeps.de # # Version: 2.0 # Date: 2014-06-04 # # License: Apache 2.0 # # Check ExId of a User in all Connections Appli...
Create documentation of DataSource Settings
: Create documentation of DataSource Settings Task-Url:
Python
apache-2.0
stoeps13/ibmcnx2,stoeps13/ibmcnx2
1bdf4e29daaf896fb6bf3416e0cae65cd8144e6f
falcon_hateoas/middleware.py
falcon_hateoas/middleware.py
import json import decimal import sqlalchemy class AlchemyJSONEncoder(json.JSONEncoder): def default(self, o): # if isinstance(getattr(o, 'metadata'), sqlalchemy.schema.MetaData): if issubclass(o.__class__, sqlalchemy.ext.declarative.DeclarativeMeta): d = {} ...
import json import decimal import sqlalchemy class AlchemyJSONEncoder(json.JSONEncoder): def _is_alchemy_object(self, obj): try: sqlalchemy.orm.base.object_mapper(obj) return True except sqlalchemy.orm.exc.UnmappedInstanceError: return False def default(sel...
Use SQLAlchemy object_mapper for testing Alchemy objects
Use SQLAlchemy object_mapper for testing Alchemy objects Signed-off-by: Michal Juranyi <29976087921aeab920eafb9b583221faa738f3f4@vnet.eu>
Python
mit
Vnet-as/falcon-hateoas
c4103c00b51ddb9cb837d65b43c972505e533bdc
tilescraper.py
tilescraper.py
from PIL import Image import json, StringIO, requests import time service = "http://dlss-dev-azaroth.stanford.edu/services/iiif/f1rc/" resp = requests.get(service + "info.json") js = json.loads(resp.text) h = js['height'] w = js['width'] img = Image.new("RGB", (w,h), "white") tilesize = 400 for x in range(w/tilesize+...
from PIL import Image import json, StringIO, requests import time import robotparser import re host = "http://dlss-dev-azaroth.stanford.edu/" service = host + "services/iiif/f1rc/" resp = requests.get(service + "info.json") js = json.loads(resp.text) h = js['height'] w = js['width'] img = Image.new("RGB", (w,h), "whi...
Add in good practices for crawling
Add in good practices for crawling
Python
apache-2.0
azaroth42/iiif-harvester
f3efb01c530db87f48d813b118f80a2ee1fd5996
dthm4kaiako/users/apps.py
dthm4kaiako/users/apps.py
"""Application configuration for the chapters application.""" from django.apps import AppConfig class UsersAppConfig(AppConfig): """Configuration object for the chapters application.""" name = "users" verbose_name = "Users" def ready(self): """Import signals upon intialising application."""...
"""Application configuration for the chapters application.""" from django.apps import AppConfig class UsersAppConfig(AppConfig): """Configuration object for the chapters application.""" name = "users" verbose_name = "Users" def ready(self): """Import signals upon intialising application."""...
Exclude import from style checking
Exclude import from style checking
Python
mit
uccser/cs4teachers,uccser/cs4teachers,uccser/cs4teachers,uccser/cs4teachers
6454372da6550455735cbcb3a86a966e61c134a1
elasticsearch/__init__.py
elasticsearch/__init__.py
from __future__ import absolute_import VERSION = (0, 4, 3) __version__ = VERSION __versionstr__ = '.'.join(map(str, VERSION)) from elasticsearch.client import Elasticsearch from elasticsearch.transport import Transport from elasticsearch.connection_pool import ConnectionPool, ConnectionSelector, \ RoundRobinSelec...
from __future__ import absolute_import VERSION = (0, 4, 3) __version__ = VERSION __versionstr__ = '.'.join(map(str, VERSION)) from elasticsearch.client import Elasticsearch from elasticsearch.transport import Transport from elasticsearch.connection_pool import ConnectionPool, ConnectionSelector, \ RoundRobinSelec...
Allow people to import ThriftConnection from elasticsearch package itself
Allow people to import ThriftConnection from elasticsearch package itself
Python
apache-2.0
veatch/elasticsearch-py,chrisseto/elasticsearch-py,Garrett-R/elasticsearch-py,brunobell/elasticsearch-py,tailhook/elasticsearch-py,AlexMaskovyak/elasticsearch-py,brunobell/elasticsearch-py,mjhennig/elasticsearch-py,thomdixon/elasticsearch-py,kelp404/elasticsearch-py,gardsted/elasticsearch-py,elastic/elasticsearch-py,el...
4a37feed87efa3dd05e38ad6f85afe392afd3a16
gitless/cli/gl_switch.py
gitless/cli/gl_switch.py
# -*- coding: utf-8 -*- # Gitless - a version control system built on top of Git. # Licensed under GNU GPL v2. """gl switch - Switch branches.""" from __future__ import unicode_literals from clint.textui import colored from . import pprint def parser(subparsers, _): """Adds the switch parser to the given subpa...
# -*- coding: utf-8 -*- # Gitless - a version control system built on top of Git. # Licensed under GNU GPL v2. """gl switch - Switch branches.""" from __future__ import unicode_literals from clint.textui import colored from . import pprint def parser(subparsers, _): """Adds the switch parser to the given subpa...
Fix ui bug in switch
Fix ui bug in switch
Python
mit
sdg-mit/gitless,sdg-mit/gitless
56446567f764625e88d8efdbfa2849e0a579d5c4
indra/tests/test_rest_api.py
indra/tests/test_rest_api.py
import requests from nose.plugins.attrib import attr @attr('webservice') def test_rest_api_responsive(): stmt_str = '{"statements": [{"sbo": "http://identifiers.org/sbo/SBO:0000526", "type": "Complex", "id": "acc6d47c-f622-41a4-8ae9-d7b0f3d24a2f", "members": [{"db_refs": {"TEXT": "MEK", "FPLX": "MEK"}, "name": "ME...
import requests from nose.plugins.attrib import attr @attr('webservice') def test_rest_api_responsive(): stmt_str = '{"statements": [{"sbo": "http://identifiers.org/sbo/SBO:0000526", "type": "Complex", "id": "acc6d47c-f622-41a4-8ae9-d7b0f3d24a2f", "members": [{"db_refs": {"TEXT": "MEK", "FPLX": "MEK"}, "name": "ME...
Update REST API address in test
Update REST API address in test
Python
bsd-2-clause
sorgerlab/belpy,sorgerlab/indra,sorgerlab/belpy,bgyori/indra,pvtodorov/indra,bgyori/indra,sorgerlab/indra,johnbachman/belpy,pvtodorov/indra,pvtodorov/indra,sorgerlab/indra,pvtodorov/indra,johnbachman/belpy,bgyori/indra,sorgerlab/belpy,johnbachman/belpy,johnbachman/indra,johnbachman/indra,johnbachman/indra
6bdbbf4d5e100856acbaba1c5fc024a9f7f78718
tests/tools.py
tests/tools.py
""" Test tools required by multiple suites. """ __author__ = 'mbach' import contextlib import shutil import subprocess import tempfile @contextlib.contextmanager def devpi_server(port=2414): server_dir = tempfile.mkdtemp() try: subprocess.check_call(['devpi-server', '--start', '--serverdir={}'.form...
""" Test tools required by multiple suites. """ __author__ = 'mbach' import contextlib import shutil import subprocess import tempfile from brandon import devpi @contextlib.contextmanager def devpi_server(port=2414): server_dir = tempfile.mkdtemp() try: subprocess.check_call(['devpi-server', '--sta...
Test tool to create temporary devpi index.
Test tool to create temporary devpi index.
Python
bsd-3-clause
tylerdave/devpi-builder
392bdf5845be19ece8f582f79caf2d09a0af0dfb
manage.py
manage.py
#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "apps.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
#!/usr/bin/env python # manage.py script of cronos import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "apps.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
Add header, needed for the upcoming changes in the update_cronos.sh script
Add header, needed for the upcoming changes in the update_cronos.sh script
Python
agpl-3.0
LinuxTeam-teilar/cronos.teilar.gr,LinuxTeam-teilar/cronos.teilar.gr,LinuxTeam-teilar/cronos.teilar.gr
6dfd6a4ae687dc9c7567c74a6c3ef3bd0f9dc5a1
ci_scripts/buildLinuxWheels.py
ci_scripts/buildLinuxWheels.py
from subprocess import call, check_output import sys import os isPython3 = sys.version_info.major == 3 # https://stackoverflow.com/a/3357357 command = 'git log --format=%B -n 1'.split() out = check_output(command) if b'build wheels' not in out.lower() or not isPython3: exit(0) path = os.path.abspath(sys.argv[1]...
from subprocess import call, check_output import sys import os isPython3 = sys.version_info.major == 3 # https://stackoverflow.com/a/3357357 command = 'git log --format=%B -n 1'.split() out = check_output(command) if b'build wheels' not in out.lower() or not isPython3: exit(0) path = os.path.abspath(sys.argv[1]...
Fix build wheels and upload 5.
Fix build wheels and upload 5.
Python
bsd-3-clause
jr-garcia/AssimpCy,jr-garcia/AssimpCy
6d291571dca59243c0a92f9955776e1acd2e87da
falmer/content/queries.py
falmer/content/queries.py
import graphene from django.http import Http404 from graphql import GraphQLError from wagtail.core.models import Page from . import types class Query(graphene.ObjectType): page = graphene.Field(types.Page, path=graphene.String()) all_pages = graphene.List(types.Page, path=graphene.String()) def resolve_...
import graphene from django.http import Http404 from graphql import GraphQLError from wagtail.core.models import Page from . import types class Query(graphene.ObjectType): page = graphene.Field(types.Page, path=graphene.String()) all_pages = graphene.List(types.Page, path=graphene.String()) def resolve_...
Return empty result rather than graphql error
Return empty result rather than graphql error
Python
mit
sussexstudent/falmer,sussexstudent/falmer,sussexstudent/falmer,sussexstudent/falmer
d63905158f5148b07534e823d271326262369d42
pavement.py
pavement.py
import os import re from paver.easy import * from paver.setuputils import setup def get_version(): """ Grab the version from irclib.py. """ here = os.path.dirname(__file__) irclib = os.path.join(here, 'irclib.py') with open(irclib) as f: content = f.read() VERSION = eval(re.search(...
import os import re from paver.easy import * from paver.setuputils import setup def get_version(): """ Grab the version from irclib.py. """ here = os.path.dirname(__file__) irclib = os.path.join(here, 'irclib.py') with open(irclib) as f: content = f.read() VERSION = eval(re.search(...
Use context manager to read README
Use context manager to read README
Python
mit
jaraco/irc
6453baefa8c2f6ab9841efd3961da0a65aaa688f
test/test_packages.py
test/test_packages.py
import pytest @pytest.mark.parametrize("name", [ ("apt-file"), ("apt-transport-https"), ("atom"), ("blktrace"), ("ca-certificates"), ("chromium-browser"), ("cron"), ("curl"), ("diod"), ("docker-ce"), ("fonts-font-awesome"), ("git"), ("gnupg"), ("gnupg2"), ("gnupg-agent"), ("handbrake"),...
import pytest @pytest.mark.parametrize("name", [ ("apt-file"), ("apt-transport-https"), ("atom"), ("blktrace"), ("ca-certificates"), ("chromium-browser"), ("cron"), ("curl"), ("diod"), ("docker-ce"), ("fonts-font-awesome"), ("git"), ("gnupg"), ("gnupg2"), ("gnupg-agent"), ("handbrake"),...
Add a test for sysdig
Add a test for sysdig
Python
mit
wicksy/laptop-build,wicksy/laptop-build,wicksy/laptop-build,wicksy/laptop-build
8db4213d20486a60abda1ba486438f54c3b830c0
ci_scripts/installPandoc.py
ci_scripts/installPandoc.py
import os from subprocess import call, check_output import sys from shutil import copy2 def checkAndInstall(): try: check_output('pandoc -v'.split()) except OSError: cudir = os.path.abspath(os.curdir) os.chdir('downloads') from requests import get pandocFile = 'pandoc...
import os from subprocess import call, check_output import sys from shutil import copy2 platform = sys.platform def checkAndInstall(): try: check_output('pandoc -v'.split()) except OSError: cudir = os.path.abspath(os.curdir) os.chdir(os.path.abspath(os.path.join(os.path.pardir, 'downl...
Fix build wheels with Pandoc.
Fix build wheels with Pandoc.
Python
bsd-3-clause
jr-garcia/AssimpCy,jr-garcia/AssimpCy
d407f1bcd95daf4f4bd8dfe8ae3b4b9e68061cb5
cref/sequence/fragment.py
cref/sequence/fragment.py
def fragment(sequence, size=5): """ Fragment a string sequence using a sliding window given by size :param sequence: String containing the sequence :param size: Size of the window :return: a fragment of the sequence with the given size """ for i in range(len(sequence) - size + 1): ...
def fragment(sequence, size=5): """ Fragment a string sequence using a sliding window given by size :param sequence: String containing the sequence :param size: Size of the window :return: a fragment of the sequence with the given size """ if size > 0: for i in range(len(sequence)...
Handle sliding window with size 0
Handle sliding window with size 0
Python
mit
mchelem/cref2,mchelem/cref2,mchelem/cref2
dc186adbb1b49c821911af724725df4512fbf9f5
socialregistration/templatetags/facebook_tags.py
socialregistration/templatetags/facebook_tags.py
from django import template from django.conf import settings from socialregistration.utils import _https register = template.Library() @register.inclusion_tag('socialregistration/facebook_js.html') def facebook_js(): return {'facebook_api_key' : settings.FACEBOOK_API_KEY, 'is_https' : bool(_https())} @register.i...
from django import template from django.conf import settings from socialregistration.utils import _https register = template.Library() @register.inclusion_tag('socialregistration/facebook_js.html') def facebook_js(): return {'facebook_api_key' : settings.FACEBOOK_API_KEY, 'is_https' : bool(_https())} @register.i...
Use syntax compatible with Python 2.4
Use syntax compatible with Python 2.4
Python
mit
bopo/django-socialregistration,bopo/django-socialregistration,bopo/django-socialregistration,kapt/django-socialregistration,lgapontes/django-socialregistration,mark-adams/django-socialregistration,0101/django-socialregistration,praekelt/django-socialregistration,flashingpumpkin/django-socialregistration,itmustbejj/djan...
2f16eb25db856b72138f6dfb7d19e799bd460287
tests/test_helpers.py
tests/test_helpers.py
# -*- coding: utf-8 -*- import pytest from os.path import basename from helpers import utils, fixture @pytest.mark.skipif(pytest.config.getoption("--application") is not False, reason="application passed; skipping base module tests") class TestHelpers(): def test_wildcards1(): d = utils.get_wildcards([('"...
# -*- coding: utf-8 -*- import pytest from os.path import basename from helpers import utils, fixture pytestmark = pytest.mark.skipif(pytest.config.getoption("--application") is not False, reason="application passed; skipping base module tests") def test_wildcards1(): d = utils.get_wildcards([('"{prefix}.bam"', ...
Use global pytestmark to skip tests; deprecate class
Use global pytestmark to skip tests; deprecate class
Python
mit
percyfal/snakemake-rules,percyfal/snakemake-rules,percyfal/snakemakelib-rules,percyfal/snakemakelib-rules,percyfal/snakemakelib-rules
723d7410b48fd4fc42ed9afe470ba3b37381599a
noxfile.py
noxfile.py
"""Development automation.""" import nox def _install_this_editable(session, *, extras=None): if extras is None: extras = [] session.install("flit") session.run( "flit", "install", "-s", "--deps=production", "--extras", ",".join(extras), si...
"""Development automation.""" import nox def _install_this_editable(session, *, extras=None): if extras is None: extras = [] session.install("flit") session.run( "flit", "install", "-s", "--deps=production", "--extras", ",".join(extras), si...
Add docs-live to perform demo-runs
Add docs-live to perform demo-runs
Python
mit
GaretJax/sphinx-autobuild
41209aa3e27673f003ed62a46c9bfae0c19d0bf3
il2fb/ds/airbridge/typing.py
il2fb/ds/airbridge/typing.py
# coding: utf-8 from pathlib import Path from typing import Callable, Optional, List, Union from il2fb.parsers.events.events import Event EventOrNone = Optional[Event] EventHandler = Callable[[Event], None] IntOrNone = Optional[int] StringProducer = Callable[[], str] StringHandler = Callable[[str], None] StringO...
# coding: utf-8 from pathlib import Path from typing import Callable, Optional, List, Union from il2fb.commons.events import Event EventOrNone = Optional[Event] EventHandler = Callable[[Event], None] IntOrNone = Optional[int] StringProducer = Callable[[], str] StringHandler = Callable[[str], None] StringOrNone =...
Update import of Event class
Update import of Event class
Python
mit
IL2HorusTeam/il2fb-ds-airbridge
7ee86e9b52292a8824dfa7bab632526cbb365b51
routes.py
routes.py
# -*- coding:utf-8 -*- from flask import request, redirect import requests cookiename = 'openAMUserCookieName' amURL = 'https://openam.example.com/' validTokenAPI = amURL + 'openam/identity/istokenvalid?tokenid=' loginURL = amURL + 'openam/UI/Login' def session_required(f): @wraps(f) def decorated_function(*args...
# -*- coding:utf-8 -*- from flask import request, redirect import requests cookiename = 'openAMUserCookieName' amURL = 'https://openam.example.com/' validTokenAPI = amURL + 'openam/json/sessions/{token}?_action=validate' loginURL = amURL + 'openam/UI/Login' def session_required(f): @wraps(f) def decorated_functi...
Use new OpenAM token validation endpoint
Use new OpenAM token validation endpoint
Python
unlicense
timhberry/openam-flask-decorator
463abcce738ca1c47729cc0e465da9dc399e21dd
examples/remote_download.py
examples/remote_download.py
#!/usr/bin/env python # -*- encoding:utf-8 -*- from xunleipy.remote import XunLeiRemote def remote_download(username, password, rk_username, rk_password, download_links, proxy=None, path='C:/TD/', peer=0): remote_client = XunLeiRemote(username, password, rk_username, rk_password, proxy=proxy) remote_client.l...
#!/usr/bin/env python # -*- encoding:utf-8 -*- import sys import os from xunleipy.remote import XunLeiRemote sys.path.append('/Users/gunner/workspace/xunleipy') def remote_download(username, password, rk_username, rk_password, download_l...
Change example style for python3
Change example style for python3
Python
mit
lazygunner/xunleipy
ab47c678b37527a7b8a970b365503b65ffccda87
populous/cli.py
populous/cli.py
import click from .loader import load_yaml from .blueprint import Blueprint from .exceptions import ValidationError, YAMLError def get_blueprint(*files): try: return Blueprint.from_description(load_yaml(*files)) except (YAMLError, ValidationError) as e: raise click.ClickException(e.message) ...
import click from .loader import load_yaml from .blueprint import Blueprint from .exceptions import ValidationError, YAMLError def get_blueprint(*files): try: return Blueprint.from_description(load_yaml(*files)) except (YAMLError, ValidationError) as e: raise click.ClickException(e.message) ...
Handle unexpected errors properly in load_blueprint
Handle unexpected errors properly in load_blueprint
Python
mit
novafloss/populous
0485e6dcaf19061812d0e571890e58b85b5dea12
lava_results_app/utils.py
lava_results_app/utils.py
import os import yaml import logging from django.utils.translation import ungettext_lazy from django.conf import settings def help_max_length(max_length): return ungettext_lazy( u"Maximum length: {0} character", u"Maximum length: {0} characters", max_length).format(max_length) class Stre...
import os import yaml import logging from django.utils.translation import ungettext_lazy from django.conf import settings def help_max_length(max_length): return ungettext_lazy( u"Maximum length: {0} character", u"Maximum length: {0} characters", max_length).format(max_length) class Stre...
Return an empty dict if no data
Return an empty dict if no data Avoids a HTTP500 on slow instances where the file may be created before data is written, causing the YAML parser to return None. Change-Id: I13b92941f3e368839a9665fe3197c706babd9335
Python
agpl-3.0
Linaro/lava-server,Linaro/lava-server,Linaro/lava-server,Linaro/lava-server
28c6af1381a1fc38b20ce05e85f494f3ae2beeb4
arcutils/masquerade/templatetags/masquerade.py
arcutils/masquerade/templatetags/masquerade.py
from django import template from .. import perms from ..settings import get_user_attr register = template.Library() @register.filter def is_masquerading(user): info = getattr(user, get_user_attr()) return info['is_masquerading'] @register.filter def can_masquerade(user): return perms.can_masquerade(u...
from django import template from .. import perms from ..settings import get_user_attr, is_enabled register = template.Library() @register.filter def is_masquerading(user): if not is_enabled(): return False info = getattr(user, get_user_attr(), None) return info['is_masquerading'] @register.fi...
Make is_masquerading template tag more robust
Make is_masquerading template tag more robust When masquerading is not enabled, immediately return False to avoid checking for a request attribute that won't be present.
Python
mit
PSU-OIT-ARC/django-arcutils,wylee/django-arcutils,wylee/django-arcutils,PSU-OIT-ARC/django-arcutils
98c2c311ad1a0797205da58ce4d3b7d9b4c66c57
nova/policies/pause_server.py
nova/policies/pause_server.py
# Copyright 2016 Cloudbase Solutions Srl # 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 r...
# Copyright 2016 Cloudbase Solutions Srl # 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 r...
Introduce scope_types in pause server policy
Introduce scope_types in pause server policy oslo.policy introduced the scope_type feature which can control the access level at system-level and project-level. - https://docs.openstack.org/oslo.policy/latest/user/usage.html#setting-scope - http://specs.openstack.org/openstack/keystone-specs/specs/keystone/queens/sy...
Python
apache-2.0
openstack/nova,klmitch/nova,klmitch/nova,mahak/nova,mahak/nova,mahak/nova,klmitch/nova,openstack/nova,openstack/nova,klmitch/nova
263e517004df36938b430d8802d4fc80067fadf5
djangoreact/urls.py
djangoreact/urls.py
from django.conf.urls import url, include from django.contrib import admin from rest_framework import routers from server import views router = routers.DefaultRouter() router.register(r'users', views.UserViewSet) router.register(r'groups', views.GroupViewSet) urlpatterns = [ url(r'^$', views.index), url(r'^ap...
from django.conf.urls import url, include from django.contrib import admin from rest_framework import routers from server import views router = routers.DefaultRouter() router.register(r'users', views.UserViewSet) router.register(r'groups', views.GroupViewSet) urlpatterns = [ url(r'^api/auth/', include('rest_auth....
Fix to use react-router for all unmatched routes.
Fix to use react-router for all unmatched routes.
Python
mit
willy-claes/django-react,willy-claes/django-react,willy-claes/django-react
f83282b1747e255d35e18e9fecad1750d1564f9e
do_record/record.py
do_record/record.py
"""DigitalOcean DNS Records.""" from certbot_dns_auth.printer import printer from do_record import http class Record(object): """Handle DigitalOcean DNS records.""" def __init__(self, api_key, domain, hostname): self._number = None self.domain = domain self.hostname = hostname ...
"""DigitalOcean DNS Records.""" from certbot_dns_auth.printer import printer from do_record import http class Record(object): """Handle DigitalOcean DNS records.""" def __init__(self, api_key, domain, hostname): self._number = None self.domain = domain self.hostname = hostname ...
Remove Code That Doesn't Have a Test
Remove Code That Doesn't Have a Test
Python
apache-2.0
Jitsusama/lets-do-dns
1633b9a1ace74a5a7cbf445ce7ceb790d0411e79
modules/__init__.py
modules/__init__.py
#pipe2py modules package #Author: Greg Gaughan __all__ = ['pipefetch', 'pipefetchdata', 'pipedatebuilder', 'pipeurlbuilder', 'pipetextinput', 'pipeurlinput', 'pipefilter', 'pipeunion', 'pipeoutput', ]
#pipe2py modules package #Author: Greg Gaughan #Note: each module name must match the name used internally by Yahoo, preceded by pipe __all__ = ['pipefetch', 'pipefetchdata', 'pipedatebuilder', 'pipeurlbuilder', 'pipetextinput', 'pipeurlinput', 'pipef...
Add comment about module naming
Add comment about module naming
Python
mit
nerevu/riko,nerevu/riko
413c3e9e8a093e3f336e27a663f347f5ea9866a6
performanceplatform/collector/ga/__init__.py
performanceplatform/collector/ga/__init__.py
from pkgutil import extend_path __path__ = extend_path(__path__, __name__) from performanceplatform.collector.ga.core \ import create_client, query_documents_for, send_data from performanceplatform.collector.write import DataSet def main(credentials, data_set_config, query, options, start_at, end_at): clien...
from pkgutil import extend_path __path__ = extend_path(__path__, __name__) from performanceplatform.collector.ga.core \ import create_client, query_documents_for, send_data from performanceplatform.collector.write import DataSet def main(credentials, data_set_config, query, options, start_at, end_at): clien...
Allow the 'dataType' field to be overriden
Allow the 'dataType' field to be overriden The 'dataType' field in records predates data groups and data types. As such they don't always match the new world order of data types. It's fine to change in all cases other than Licensing which is run on limelight, that we don't really want to touch.
Python
mit
alphagov/performanceplatform-collector,alphagov/performanceplatform-collector,alphagov/performanceplatform-collector
95542ab1b7c22a6e0160e242349c66f2cef7e390
syntacticframes_project/syntacticframes/management/commands/check_correspondance_errors.py
syntacticframes_project/syntacticframes/management/commands/check_correspondance_errors.py
from django.core.management.base import BaseCommand from syntacticframes.models import VerbNetClass from parsecorrespondance import parse from loadmapping import mapping class Command(BaseCommand): def handle(self, *args, **options): for vn_class in VerbNetClass.objects.all(): try: ...
from django.core.management.base import BaseCommand from syntacticframes.models import VerbNetFrameSet from parsecorrespondance import parse from loadmapping import mapping class Command(BaseCommand): def handle(self, *args, **options): for frameset in VerbNetFrameSet.objects.all(): print("{}:...
Check correspondances in framesets now
Check correspondances in framesets now
Python
mit
aymara/verbenet-editor,aymara/verbenet-editor,aymara/verbenet-editor
6c54fc230e8c889a2351f20b524382a5c6e29d1c
examples/apps.py
examples/apps.py
# coding: utf-8 import os import sys from pysuru import TsuruClient TSURU_TARGET = os.environ.get('TSURU_TARGET', None) TSURU_TOKEN = os.environ.get('TSURU_TOKEN', None) if not TSURU_TARGET or not TSURU_TOKEN: print('You must set TSURU_TARGET and TSURU_TOKEN.') sys.exit(1) api = TsuruClient(TSURU_TARGET, T...
# coding: utf-8 import os import sys from pysuru import TsuruClient TSURU_TARGET = os.environ.get('TSURU_TARGET', None) TSURU_TOKEN = os.environ.get('TSURU_TOKEN', None) if not TSURU_TARGET or not TSURU_TOKEN: print('You must set TSURU_TARGET and TSURU_TOKEN env variables.') sys.exit(1) # Creating TsuruCli...
Update examples to match docs
Update examples to match docs Use the interface defined in the docs in the examples scripts.
Python
mit
rcmachado/pysuru
5af4ef36ff7a56b34fc8d30df37c82a6837918e3
pambox/speech/__init__.py
pambox/speech/__init__.py
""" The :mod:`pambox.speech` module gather speech intelligibility models. """ from __future__ import absolute_import from .binauralsepsm import BinauralSepsm from .sepsm import Sepsm from .mrsepsm import MrSepsm from .sii import Sii from .material import Material from .experiment import Experiment __all__ = [ 'Bi...
""" The :mod:`pambox.speech` module gather speech intelligibility models. """ from __future__ import absolute_import from .binauralsepsm import BinauralSepsm from .binauralmrsepsm import BinauralMrSepsm from .sepsm import Sepsm from .mrsepsm import MrSepsm from .sii import Sii from .material import Material from .expe...
Include both binaural mr-sEPSM and sEPSM
Include both binaural mr-sEPSM and sEPSM
Python
bsd-3-clause
achabotl/pambox
b5a8e7b6926bf7224abed6bd335d62b3f1ad1fb1
performance_testing/command_line.py
performance_testing/command_line.py
import os import yaml from performance_testing.errors import ConfigFileError, ConfigKeyError from performance_testing import web from datetime import datetime as date from time import time class Tool: def __init__(self, config='config.yml', result_directory='result'): self.read_config(config_file=config) ...
import os import yaml from performance_testing.errors import ConfigFileError, ConfigKeyError from performance_testing import web from performance_testing.config import Config from performance_testing.result import Result class Tool: def __init__(self, config='config.yml', result_directory='result'): self....
Use Config and Result class in Tool
Use Config and Result class in Tool
Python
mit
BakeCode/performance-testing,BakeCode/performance-testing
5fc699b89eae0c41923a813ac48281729c4d80b8
orderable_inlines/inlines.py
orderable_inlines/inlines.py
from django.contrib.admin import StackedInline, TabularInline from django.template.defaultfilters import slugify class OrderableInlineMixin(object): class Media: js = ( 'js/jquery.browser.min.js', 'js/orderable-inline-jquery-ui.js', 'js/orderable-inline.js', ) ...
from django.contrib.admin import StackedInline, TabularInline from django.template.defaultfilters import slugify class OrderableInlineMixin(object): class Media: js = ( 'js/jquery.browser.min.js', 'js/orderable-inline-jquery-ui.js', 'js/orderable-inline.js', ) ...
Make this hack compatible with Django 1.9
Make this hack compatible with Django 1.9
Python
bsd-2-clause
frx0119/django-orderable-inlines,frx0119/django-orderable-inlines
533fb21586322c26fd9696213108d6a9e45ada64
lib/ansible/cache/base.py
lib/ansible/cache/base.py
import exceptions class BaseCacheModule(object): def get(self, key): raise exceptions.NotImplementedError def set(self, key, value): raise exceptions.NotImplementedError def keys(self): raise exceptions.NotImplementedError def contains(self, key): raise exceptions.No...
# (c) 2014, Brian Coca, Josh Drake, et al # # This file is part of Ansible # # Ansible 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 copyright header, let me know if corrections are needed.
Add copyright header, let me know if corrections are needed.
Python
mit
thaim/ansible,thaim/ansible
aff0eba2c0f7f5a0c9bebbfc9402f04c2c9d6d11
preference/miExecPref.py
preference/miExecPref.py
import os import json SCRIPT_PATH = os.path.dirname(__file__) def getPreference(): """ Load pref json data nad return as dict""" prefFile = open(os.path.join(SCRIPT_PATH, "miExecPref.json"), 'r') prefDict = json.load(prefFile) prefFile.close() return prefDict def getWindowSe...
import os import json import maya.cmds as cmds SCRIPT_PATH = os.path.dirname(__file__) MAYA_SCRIPT_DIR = cmds.internalVar(userScriptDir=True) def getPreference(): """ Load pref json data nad return as dict""" for root, dirs, files in os.walk(MAYA_SCRIPT_DIR): if 'miExecPref.json' in file...
Load user pref file if exists in the maya user script directory
Load user pref file if exists in the maya user script directory
Python
mit
minoue/miExecutor
64ed32aa5e2e36ce58209b0e356f7482137a81f2
getMesosStats.py
getMesosStats.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import urllib2 import json import argparse def get_metric(host, port, metric): response = urllib2.urlopen( 'http://' + host + ':' + port + '/metrics/snapshot') data = json.load(response) # print json.dumps(data, indent=4, sort_keys=Tru...
#!/usr/bin/env python # -*- coding: utf-8 -*- import urllib2 import json import argparse def get_metric(host, port, metric): response = urllib2.urlopen( 'http://' + host + ':' + port + '/metrics/snapshot') data = json.load(response) # print json.dumps(data, indent=4, sort_keys=Tru...
Add KeyError exception and ZBX_NOT_SUPPORTED message.
Add KeyError exception and ZBX_NOT_SUPPORTED message.
Python
mit
zolech/zabbix-mesos-template
7b5850d1b89d34ff9a60c3862d18691961c86656
poisson/tests/test_irf.py
poisson/tests/test_irf.py
#!/usr/bin/env python from numpy.testing import assert_almost_equal, assert_array_less import numpy as np from poisson import BmiPoisson def test_grid_initialize(): model = BmiPoisson() model.initialize() assert_almost_equal(model.get_current_time(), 0.) assert_array_less(model.get_value('land_surfa...
#!/usr/bin/env python from nose.tools import assert_equal from numpy.testing import assert_almost_equal, assert_array_less import numpy as np from poisson import BmiPoisson def test_initialize_defaults(): model = BmiPoisson() model.initialize() assert_almost_equal(model.get_current_time(), 0.) asser...
Test initialize with filename and file-like.
Test initialize with filename and file-like.
Python
mit
mperignon/bmi-delta,mperignon/bmi-STM,mperignon/bmi-STM,mperignon/bmi-delta
8ebe0966c64f344b79c450782661f4c6cab6a312
modish/__init__.py
modish/__init__.py
# -*- coding: utf-8 -*- from .model import ModalityModel from .estimator import ModalityEstimator from .visualize import MODALITY_TO_COLOR, MODALITY_ORDER, MODALITY_PALETTE,\ MODALITY_TO_CMAP, ModalitiesViz, violinplot, barplot __author__ = 'Olga Botvinnik' __email__ = 'olga.botvinnik@gmail.com' __version__ = '0.1...
# -*- coding: utf-8 -*- from .model import ModalityModel from .estimator import ModalityEstimator, ModalityPredictor from .visualize import MODALITY_TO_COLOR, MODALITY_ORDER, MODALITY_PALETTE,\ MODALITY_TO_CMAP, ModalitiesViz, violinplot, barplot __author__ = 'Olga Botvinnik' __email__ = 'olga.botvinnik@gmail.com'...
Add modality predictor to output
Add modality predictor to output
Python
bsd-3-clause
YeoLab/anchor,olgabot/modish,olgabot/anchor
7c68e3b00e7c66c0223617447e16a7159118d284
goldstone/addons/utils.py
goldstone/addons/utils.py
"""Addon utilities.""" # Copyright 2015 Solinea, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law ...
"""Addon utilities.""" # Copyright 2015 Solinea, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law ...
Change update_addon_node() to return the Addon node, whether created or found.
Change update_addon_node() to return the Addon node, whether created or found.
Python
apache-2.0
slashk/goldstone-server,slashk/goldstone-server,Solinea/goldstone-server,slashk/goldstone-server,slashk/goldstone-server,Solinea/goldstone-server,Solinea/goldstone-server,Solinea/goldstone-server,Solinea/goldstone-server,slashk/goldstone-server
9c7d0895dca2909143d633a1e335a811f43481b2
examples/fabfile.py
examples/fabfile.py
"""Example of integration between Fabric and Datadog. """ from fabric.api import * from fabric.colors import * from dogapi.fab import setup, notify setup(api_key = "YOUR API KEY HERE") # Make sure @notify is just above @task @notify @task(default=True, alias="success") def sweet_task(some_arg, other_arg): """Alw...
"""Example of integration between Fabric and Datadog. """ from fabric.api import * from fabric.colors import * from dogapi.fab import setup, notify setup(api_key = "YOUR API KEY HERE") # Make sure @notify is just below @task @task(default=True, alias="success") @notify def sweet_task(some_arg, other_arg): """Alw...
Update fabric examples to reflect changes.
Update fabric examples to reflect changes.
Python
bsd-3-clause
DataDog/dogapi,DataDog/dogapi