commit
stringlengths
40
40
subject
stringlengths
4
1.73k
repos
stringlengths
5
127k
old_file
stringlengths
2
751
new_file
stringlengths
2
751
new_contents
stringlengths
1
8.98k
old_contents
stringlengths
0
6.59k
license
stringclasses
13 values
lang
stringclasses
23 values
9e041ef89f32f85919540c9be38f499807f7a18e
add list of lists
techytux/oertube,techytux/oertube,techytux/oertube
oertube/controllers.py
oertube/controllers.py
import os from flask import Flask, request, Response from flask import render_template, url_for, redirect, send_from_directory from flask import send_file, make_response, abort from oertube import app # routing for API endpoints, generated from the models designated as API_MODELS from oertube.core import api_manager...
import os from flask import Flask, request, Response from flask import render_template, url_for, redirect, send_from_directory from flask import send_file, make_response, abort from oertube import app # routing for API endpoints, generated from the models designated as API_MODELS from oertube.core import api_manager...
mit
Python
24680b61df921496a5035006628c8e9b3ef07ad9
Implement funtion to get intraday data
RomelTorres/alpha_vantage
alpha-vantage/alphavantage.py
alpha-vantage/alphavantage.py
try: # Python 3 import from urllib.request import urlopen except ImportError: # Python 2.* import from urllib2 import urlopen from simplejson import loads class AlphaVantage: """ This class is in charge of creating a python interface between the Alpha Vantage restful API and your p...
try: # Python 3 import from urllib.request import urlopen except ImportError: # Python 2.* import from urllib2 import urlopen from simplejson import loads class AlphaVantage: """ This class is in charge of creating a python interface between the Alpha Vantage restful API and your p...
mit
Python
19dd810c5acb35ce5d7565ee57a55ae725194bd1
Add finalize method to Integration.
danbradham/mvp
mvp/integration.py
mvp/integration.py
# -*- coding: utf-8 -*- class Integration(object): name = None description = None icon = None banner = None requires_confirmation = False enabled_by_default = False columns = 1 def __init__(self): self.set_enabled(self.enabled_by_default) def fields(self): '''Ret...
# -*- coding: utf-8 -*- class Integration(object): name = None description = None icon = None banner = None requires_confirmation = False enabled_by_default = False columns = 1 def __init__(self): self.set_enabled(self.enabled_by_default) def fields(self): '''Ret...
mit
Python
b83a4bf53bfb893ca953c5301d9beee1f3dee320
change wording for podcast privacy settings
gpodder/mygpo,gpodder/mygpo,gpodder/mygpo,gpodder/mygpo
mygpo/web/forms.py
mygpo/web/forms.py
from django import forms from django.utils.translation import ugettext as _ from mygpo.api.models import Device, DEVICE_TYPES, SyncGroup from mygpo.log import log import re class UserAccountForm(forms.Form): email = forms.EmailField(label=_('Your Email Address')) public = forms.BooleanField(required=False, lab...
from django import forms from django.utils.translation import ugettext as _ from mygpo.api.models import Device, DEVICE_TYPES, SyncGroup from mygpo.log import log import re class UserAccountForm(forms.Form): email = forms.EmailField(label=_('Your Email Address')) public = forms.BooleanField(required=False, lab...
agpl-3.0
Python
5225857a4a3e481871e64910cae7c579974869d6
Use argparse for the output
datto/zfs-tests,stevenburgess/zfs-tests
MultiReceive.py
MultiReceive.py
import time import datetime import subprocess import multiprocessing import argparse import TestConfig import Configs import ZfsApi import Pid import Common import MonitorThread import ReceiveThread import Results parser = argparse.ArgumentParser() parser.add_argument('-v', '--verbose', action="store_true", he...
import time import datetime import subprocess import multiprocessing import TestConfig import Configs import ZfsApi import Pid import Common import MonitorThread import ReceiveThread import Results # Use TestConfig to ensure this computer is set up properly TestConfig.check_all() # This test case will use the test sen...
mit
Python
82a7a79264e4667124d73c8eda00a6c44d69bb8a
Update the admin table to allow the insert of course cert settings LEARNER-1787
mitocw/edx-platform,msegado/edx-platform,eduNEXT/edx-platform,pepeportela/edx-platform,arbrandes/edx-platform,stvstnfrd/edx-platform,Stanford-Online/edx-platform,stvstnfrd/edx-platform,ahmedaljazzar/edx-platform,stvstnfrd/edx-platform,TeachAtTUM/edx-platform,BehavioralInsightsTeam/edx-platform,BehavioralInsightsTeam/ed...
lms/djangoapps/certificates/admin.py
lms/djangoapps/certificates/admin.py
""" django admin pages for certificates models """ from config_models.admin import ConfigurationModelAdmin from django import forms from django.contrib import admin from certificates.models import ( CertificateGenerationConfiguration, CertificateGenerationCourseSetting, CertificateHtmlViewConfiguration, ...
""" django admin pages for certificates models """ from config_models.admin import ConfigurationModelAdmin from django import forms from django.contrib import admin from certificates.models import ( CertificateGenerationConfiguration, CertificateGenerationCourseSetting, CertificateHtmlViewConfiguration, ...
agpl-3.0
Python
2916048b8e0bb170685cbfa931cfa9120d0344de
Add project_fields option to output parameters
firedrakeproject/gusto,firedrakeproject/dcore
dcore/configuration.py
dcore/configuration.py
""" Some simple tools for making model configuration nicer. """ class Configuration(object): def __init__(self, **kwargs): for name, value in kwargs.iteritems(): self.__setattr__(name, value) def __setattr__(self, name, value): """Cause setting an unknown attribute to be an erro...
""" Some simple tools for making model configuration nicer. """ class Configuration(object): def __init__(self, **kwargs): for name, value in kwargs.iteritems(): self.__setattr__(name, value) def __setattr__(self, name, value): """Cause setting an unknown attribute to be an erro...
mit
Python
1f63f84fde3a557077c60a6466c4399fdfc3711d
Update version to 2.0b2-dev
jwinzer/OpenSlides,rolandgeider/OpenSlides,boehlke/OpenSlides,ostcar/OpenSlides,rolandgeider/OpenSlides,jwinzer/OpenSlides,FinnStutzenstein/OpenSlides,emanuelschuetze/OpenSlides,jwinzer/OpenSlides,normanjaeckel/OpenSlides,CatoTH/OpenSlides,tsiegleauq/OpenSlides,emanuelschuetze/OpenSlides,ostcar/OpenSlides,boehlke/OpenS...
openslides/__init__.py
openslides/__init__.py
__author__ = 'OpenSlides Team <support@openslides.org>' __description__ = 'Presentation and assembly system' __version__ = '2.0b2-dev'
__author__ = 'OpenSlides Team <support@openslides.org>' __description__ = 'Presentation and assembly system' __version__ = '2.0b1'
mit
Python
80e94bd64ca23d78e57fe0937a9924e4df08072a
Fix #445 -- UnicodeDecodeError in SQLSelectForm.
pevzi/django-debug-toolbar,ChristosChristofidis/django-debug-toolbar,ChristosChristofidis/django-debug-toolbar,ivelum/django-debug-toolbar,barseghyanartur/django-debug-toolbar,spookylukey/django-debug-toolbar,Endika/django-debug-toolbar,stored/django-debug-toolbar,jazzband/django-debug-toolbar,ivelum/django-debug-toolb...
debug_toolbar/forms.py
debug_toolbar/forms.py
from __future__ import unicode_literals import json import hashlib from django import forms from django.conf import settings from django.db import connections from django.utils.encoding import force_text from django.utils.functional import cached_property from django.core.exceptions import ValidationError from debug...
from __future__ import unicode_literals import json import hashlib from django import forms from django.conf import settings from django.db import connections from django.utils.encoding import force_text from django.utils.functional import cached_property from django.core.exceptions import ValidationError from debug...
bsd-3-clause
Python
bb0fdba3db129d7eed38622e01c4881ec42ba6a3
Fix indentation
lyuboraykov/pizza-delivery,lyuboraykov/pizza-delivery,lyuboraykov/pizza-delivery,lyuboraykov/pizza-delivery,lyuboraykov/pizza-delivery
core/lib/pizzas_repository.py
core/lib/pizzas_repository.py
import sys sys.path.append('../gen-py') from pizza_delivery import ttypes from lib.db import db class PizzasRepository(object): @classmethod def get_available_pizzas(cls): pizzas_dict = db.get('/pizzas', None) pizzas = {} for pizza_id, pizza_dict in pizzas_dict.iteritems(): ...
import sys sys.path.append('../gen-py') from pizza_delivery import ttypes from lib.db import db class PizzasRepository(object): @classmethod def get_available_pizzas(cls): pizzas_dict = db.get('/pizzas', None) pizzas = {} for pizza_id, pizza_dict in pizzas_dict.iteritems(): ...
mit
Python
1396f52bb0aae7f6b50c3c41b66ac56c1afa0006
Fix tweeton bug
joshcvt/natinal
notifiers/TwitterNotifier.py
notifiers/TwitterNotifier.py
from NotifierClass import Notifier import twitter from datetime import datetime, timedelta import time import threading class TwitterNotifier(Notifier): def __init__(self,cfgParser,insec): self.header = insec try: self.screenname = cfgParser.get(insec,"username").strip() except: self.screenname = '' s...
from NotifierClass import Notifier import twitter from datetime import datetime, timedelta import time import threading class TwitterNotifier(Notifier): def __init__(self,cfgParser,insec): self.header = insec try: self.screenname = cfgParser.get(insec,"username").strip() except: self.screenname = '' s...
mit
Python
4718ee6ecd3fffea2f314d2929fc18dea86fc370
add cython_anchor
CharlesShang/FastMaskRCNN,CharlesShang/FastMaskRCNN,CharlesShang/FastMaskRCNN,CharlesShang/FastMaskRCNN
libs/boxes/__init__.py
libs/boxes/__init__.py
# -------------------------------------------------------- # Fast R-CNN # Copyright (c) 2015 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by Ross Girshick # -------------------------------------------------------- from . import cython_nms from . import cython_bbox import nms import tim...
# -------------------------------------------------------- # Fast R-CNN # Copyright (c) 2015 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by Ross Girshick # -------------------------------------------------------- from . import cython_nms from . import cython_bbox import nms import tim...
apache-2.0
Python
69358c5dce13f4a031b51d254824b6b3d4355847
Move some code from typesystem.__init__
ssarangi/numba,numba/numba,numba/numba,jriehl/numba,stefanseefeld/numba,shiquanwang/numba,IntelLabs/numba,sklam/numba,pombredanne/numba,cpcloud/numba,stonebig/numba,gmarkall/numba,shiquanwang/numba,seibert/numba,gmarkall/numba,cpcloud/numba,jriehl/numba,gdementen/numba,pombredanne/numba,GaZ3ll3/numba,stonebig/numba,num...
numba/typesystem/__init__.py
numba/typesystem/__init__.py
from basetypes import * from exttypes import * from closuretypes import * from ssatypes import * from templatetypes import * from typemapper import * from shorthands import * __all__ = minitypes.__all__ + [ 'O', 'b1', 'i1', 'i2', 'i4', 'i8', 'u1', 'u2', 'u4', 'u8', 'f4', 'f8', 'f16', 'c8', 'c16', 'c32', 'temp...
from basetypes import * from exttypes import * from closuretypes import * from ssatypes import * from templatetypes import * from typemapper import * __all__ = minitypes.__all__ + [ 'O', 'b1', 'i1', 'i2', 'i4', 'i8', 'u1', 'u2', 'u4', 'u8', 'f4', 'f8', 'f16', 'c8', 'c16', 'c32', 'template', ] #---------------...
bsd-2-clause
Python
3ac9c53ffc6feb926ebde8dfe930f9235b2b6817
Use explicit status
avanov/Rhetoric,avanov/Rhetoric
rhetoric/config/rendering.py
rhetoric/config/rendering.py
from django.http import HttpResponse from django.core.serializers.json import DjangoJSONEncoder from django.shortcuts import render json_encode = DjangoJSONEncoder().encode class JsonRendererFactory(object): def __init__(self, name): self.name = name def __call__(self, request, view_response): ...
from django.http import HttpResponse from django.core.serializers.json import DjangoJSONEncoder from django.shortcuts import render json_encode = DjangoJSONEncoder().encode class JsonRendererFactory(object): def __init__(self, name): self.name = name def __call__(self, request, view_response): ...
mit
Python
8b90343deb066df5173e860796f6eb399f3a9ffb
Update tests to version 1.1.0
jmluy/xpython,exercism/python,behrtam/xpython,N-Parsons/exercism-python,pheanex/xpython,pheanex/xpython,exercism/xpython,exercism/xpython,exercism/python,behrtam/xpython,smalley/python,jmluy/xpython,N-Parsons/exercism-python,smalley/python
exercises/rotational-cipher/rotational_cipher_test.py
exercises/rotational-cipher/rotational_cipher_test.py
import unittest import rotational_cipher # Tests adapted from `problem-specifications//canonical-data.json` @ v1.1.0 class RotationalCipher(unittest.TestCase): def test_rotate_a_by_0(self): self.assertEqual(rotational_cipher.rotate('a', 0), 'a') def test_rotate_a_by_1(self): self.assertEqua...
import unittest import rotational_cipher # test cases adapted from `x-common//canonical-data.json` @ version: 1.0.0 class RotationalCipher(unittest.TestCase): def test_rotate_a_by_1(self): self.assertEqual(rotational_cipher.rotate('a', 1), 'b') def test_rotate_a_by_26(self): self.assertEqua...
mit
Python
6bdcd8df3ca419cc9dcadc9d234e33133f489778
Add test for find-qca-path.
bgyori/bioagents,sorgerlab/bioagents
tests/qca_test.py
tests/qca_test.py
import json import unittest import requests from ndex.beta.path_scoring import PathScoring from bioagents.qca import QCA from kqml.kqml_list import KQMLList from tests.util import ekb_from_text from bioagents.qca.qca_module import QCA_Module # BELOW ARE OLD QCA TESTS def test_improved_path_ranking(): qca = QCA()...
import json import unittest import requests from ndex.beta.path_scoring import PathScoring from bioagents.qca import QCA # BELOW ARE OLD QCA TESTS def test_improved_path_ranking(): qca = QCA() sources = ["E2F1"] targets = ["PTEN"] qca_results2 = qca.find_causal_path(targets, sources) print(qca_re...
bsd-2-clause
Python
3fb07d4d9d2adfcee4ed9550750b7c474e5b8ccc
fix sql migrations not being committed
pajlada/tyggbot,pajlada/pajbot,pajlada/tyggbot,pajlada/pajbot,pajlada/tyggbot,pajlada/tyggbot,pajlada/pajbot,pajlada/pajbot
pajbot/migration/db.py
pajbot/migration/db.py
from contextlib import contextmanager class DatabaseMigratable: def __init__(self, conn): self.conn = conn @contextmanager def create_resource(self): with self.conn.cursor() as cursor: try: cursor.execute("CREATE TABLE IF NOT EXISTS schema_version(revision_id I...
from contextlib import contextmanager class DatabaseMigratable: def __init__(self, conn): self.conn = conn @contextmanager def create_resource(self): with self.conn.cursor() as cursor: # begins a transaction automatically cursor.execute("CREATE TABLE IF NOT EXISTS...
mit
Python
293101edfd5226a4804c9b01360acb5c6dca4342
Bump version
renalreg/radar,renalreg/radar,renalreg/radar,renalreg/radar
radar/__init__.py
radar/__init__.py
__version__ = '2.45.3'
__version__ = '2.45.2'
agpl-3.0
Python
704b10469628c9432c030ada3e8126594f8cf774
Bump version
renalreg/radar,renalreg/radar,renalreg/radar,renalreg/radar
radar/__init__.py
radar/__init__.py
__version__ = '2.45.1'
__version__ = '2.45.0'
agpl-3.0
Python
a6ed415e887930322e821ba646e43755e15ac157
add attribute accuracy to semantic_segmentation_loss
pfnet/chainercv,chainer/chainercv,yuyu2172/chainercv,yuyu2172/chainercv,chainer/chainercv
chainercv/links/loss/semantic_segmentation_loss.py
chainercv/links/loss/semantic_segmentation_loss.py
import chainer from chainer import cuda import chainer.functions as F from chainer import reporter import numpy as np from chainercv.evaluations import eval_semantic_segmentation class PixelwiseSoftmaxClassifier(chainer.Chain): def __init__(self, model, ignore_label=-1, class_weight=None, comp...
import chainer from chainer import cuda import chainer.functions as F from chainer import reporter import numpy as np from chainercv.evaluations import eval_semantic_segmentation class PixelwiseSoftmaxClassifier(chainer.Chain): def __init__(self, model, ignore_label=-1, class_weight=None, comp...
mit
Python
ad04cf539a689af9609d8c7eea925e2fcbc0fa70
Add limit and where options to rebuild_text_index
NUKnightLab/cityhallmonitor,NUKnightLab/cityhallmonitor,NUKnightLab/cityhallmonitor,NUKnightLab/cityhallmonitor
cityhallmonitor/management/commands/rebuild_text_index.py
cityhallmonitor/management/commands/rebuild_text_index.py
import logging from django.core.management.base import BaseCommand from cityhallmonitor.models import Document logger = logging.getLogger(__name__) class Command(BaseCommand): help = 'For each document, force an update of its related fields and its postgres text index' def add_arguments(self, parser): ...
import logging from django.core.management.base import BaseCommand from cityhallmonitor.models import Document logger = logging.getLogger(__name__) class Command(BaseCommand): help = 'For each document, force an update of its related fields and its postgres text index' logger.info('Rebuilding text index') ...
mit
Python
dca4357f0ef91125378f5a576fb18b4ef2202b8e
update cloudcare urls
qedsoftware/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq
corehq/apps/cloudcare/urls.py
corehq/apps/cloudcare/urls.py
from django.conf.urls import patterns, url, include from corehq.apps.cloudcare.views import ( EditCloudcareUserPermissionsView, CloudcareMain, form_context, get_cases, filter_cases, get_apps_api, get_app_api, get_fixtures, get_sessions, get_session_context, get_ledgers, render_form, sync_db_api, de...
from django.conf.urls import patterns, url, include from corehq.apps.cloudcare.views import ( EditCloudcareUserPermissionsView, CloudcareMain, ) app_urls = patterns('corehq.apps.cloudcare.views', url(r'^view/(?P<app_id>[\w-]+)/modules-(?P<module_id>[\w-]+)/forms-(?P<form_id>[\w-]+)/context/$', 'fo...
bsd-3-clause
Python
0480867b7ba9ae519d7ef7ab37bfb9c9a1553287
Bump version
renalreg/radar,renalreg/radar,renalreg/radar,renalreg/radar
radar/__init__.py
radar/__init__.py
__version__ = '2.5.1'
__version__ = '2.5.0'
agpl-3.0
Python
66795b04e27a6de4f0d0ed4d52064cd3ba6e76b5
Bump version
renalreg/radar,renalreg/radar,renalreg/radar,renalreg/radar
radar/__init__.py
radar/__init__.py
__version__ = '2.11.3'
__version__ = '2.11.2'
agpl-3.0
Python
c5cec60bc6b4c3e785bd616bcb5d5cff5770e408
Add PPV tests along all LOS; correct lwidth comparisons
e-koch/TurbuStat,Astroua/TurbuStat
turbustat/simulator/tests/test_ppv.py
turbustat/simulator/tests/test_ppv.py
from ..make_cube import make_ppv from ..gen_field import make_3dfield import pytest import numpy as np import numpy.testing as npt import astropy.units as u import astropy.constants as c try: from spectral_cube import SpectralCube SPECCUBE_INSTALL = True except ImportError: SPECCUBE_INSTALL = False @py...
from ..make_cube import make_ppv from ..gen_field import make_3dfield import pytest import numpy as np import numpy.testing as npt import astropy.units as u try: from spectral_cube import SpectralCube SPECCUBE_INSTALL = True except ImportError: SPECCUBE_INSTALL = False @pytest.mark.skipif("not SPECCUBE...
mit
Python
61c1c5eb2bf62fe41dde2643356731cbf6b1b435
Add TODO to file_verification()
ronrest/convenience_py,ronrest/convenience_py
convenience/file_convenience/file_verification.py
convenience/file_convenience/file_verification.py
import hashlib def file_verification(file, v_type, v_val): # TODO: do dummy proofing for input values. v_types = {"md5": hashlib.md5, "sha1": hashlib.sha1, "sha256": hashlib.sha256, "sha512": hashlib.sha512 } with open(file, 'rb') as fileObj: ...
import hashlib def file_verification(file, v_type, v_val): v_types = {"md5": hashlib.md5, "sha1": hashlib.sha1, "sha256": hashlib.sha256, "sha512": hashlib.sha512 } with open(file, 'rb') as fileObj: content = fileObj.read() hash = v_types[...
apache-2.0
Python
bb46136c70f63f6a34ac36b418f4984b62dae0c2
Bring in json_safe_payload method (#3643)
facebookresearch/ParlAI,facebookresearch/ParlAI,facebookresearch/ParlAI,facebookresearch/ParlAI,facebookresearch/ParlAI
parlai/core/message.py
parlai/core/message.py
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. """ File for Message object and associated functions. The Message object's key function is to prevent users from editing...
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. """ File for Message object and associated functions. The Message object's key function is to prevent users from editing...
mit
Python
c970cab38d846c4774aee52e52c23ed2452af96a
Remove unused and buggy import
openfisca/openfisca-france-data,openfisca/openfisca-france-data,openfisca/openfisca-france-data
openfisca_france_data/tests/base.py
openfisca_france_data/tests/base.py
# -*- coding: utf-8 -*- from openfisca_core.tools import assert_near from openfisca_france.tests.base import get_cached_composed_reform, get_cached_reform from .. import france_data_tax_benefit_system __all__ = [ 'assert_near', 'france_data_tax_benefit_system', 'get_cached_composed_reform', 'get_c...
# -*- coding: utf-8 -*- from openfisca_core.tools import assert_near from openfisca_france.tests.base import get_cached_composed_reform, get_cached_reform from .. import france_data_tax_benefit_system, FranceDataTaxBenefitSystem __all__ = [ 'assert_near', 'france_data_tax_benefit_system', 'FranceDataT...
agpl-3.0
Python
78df33ee8ecb167f3d88ef326be1b5f501b8eb00
fix doc
chainer/chainercv,pfnet/chainercv,chainer/chainercv,yuyu2172/chainercv,yuyu2172/chainercv
chainercv/utils/testing/generate_random_bbox.py
chainercv/utils/testing/generate_random_bbox.py
import numpy as np def generate_random_bbox(n, img_size, min_length, max_length): """Generate valid bounding boxes with random position and shape. Args: n (int): The number of bounding boxes. img_size (tuple): A tuple of length 2. The width and the height of the image on which bou...
import numpy as np def generate_random_bbox(n, img_size, min_length, max_length): """Generate valid bounding boxes with random position and shape. Args: n (int): The number of bounding boxes. img_size (tuple): A tuple of length 2. The width and the height of the image on which bou...
mit
Python
fd3f5334f8614fdc7ea581fffd7626aa32e974f7
Bump version to 0.7.1
jsvine/pdfplumber
pdfplumber/_version.py
pdfplumber/_version.py
version_info = (0, 7, 1) __version__ = ".".join(map(str, version_info))
version_info = (0, 7, 0) __version__ = ".".join(map(str, version_info))
mit
Python
02edaec8eae6a67cb24a1948d2de3b40d3922b50
Fix syntax error
Majavapaja/Mursushakki,Majavapaja/Mursushakki,Majavapaja/Mursushakki,Majavapaja/Mursushakki,Majavapaja/Mursushakki,Majavapaja/Mursushakki
deployment/cosmosdb.py
deployment/cosmosdb.py
import logging from azure.cosmos.cosmos_client import CosmosClient from azure.cosmos.errors import HTTPFailure from config import Mongo log = logging.getLogger(__name__) def configure_database_with_shared_throughput(db_name, master_key, url_connection): client = CosmosClient(url_connection=url_connection, auth={"...
import logging from azure.cosmos.cosmos_client import CosmosClient from azure.cosmos.errors import HTTPFailure from config import Mongo log = logging.getLogger(__name__) def configure_database_with_shared_throughput(db_name, master_key, url_connection): client = CosmosClient(url_connection=url_connection, auth={"...
mit
Python
365e06e98bcaa0b1d664b0c39252dd5605c8ab09
Update importchannel management command to support local import
rtibbles/kolibri,learningequality/kolibri,jonboiser/kolibri,indirectlylit/kolibri,MingDai/kolibri,aronasorman/kolibri,jtamiace/kolibri,jonboiser/kolibri,jayoshih/kolibri,jonboiser/kolibri,learningequality/kolibri,lyw07/kolibri,christianmemije/kolibri,rtibbles/kolibri,benjaoming/kolibri,indirectlylit/kolibri,mrpau/kolib...
kolibri/content/management/commands/importchannel.py
kolibri/content/management/commands/importchannel.py
import logging as logger from django.core.management.base import CommandError from kolibri.tasks.management.commands.base import AsyncCommand from ...utils import annotation, paths, transfer logging = logger.getLogger(__name__) # constants to specify the transfer method to be used DOWNLOAD_METHOD = "download" COPY_...
import logging as logger from kolibri.tasks.management.commands.base import AsyncCommand from ...utils import annotation, paths, transfer logging = logger.getLogger(__name__) class Command(AsyncCommand): def add_arguments(self, parser): parser.add_argument("channel_id", type=str) def handle_async...
mit
Python
d8377a8143a0ee20d2e90cefa5d60f48991d0e6b
Fix SpiHardwareLightBank.py
rec/echomesh,rec/echomesh,rec/echomesh,rec/echomesh,rec/echomesh,rec/echomesh
code/python/echomesh/light/SpiHardwareLightBank.py
code/python/echomesh/light/SpiHardwareLightBank.py
from __future__ import absolute_import, division, print_function, unicode_literals from echomesh.base import Config from echomesh.light import SetupDebianSpiLights from echomesh.light.SpiLightBank import SpiLightBank from echomesh.util import Log LOGGER = Log.logger(__name__) _LATCH_BYTE_COUNT = 3 _LATCH = bytearray...
from __future__ import absolute_import, division, print_function, unicode_literals from echomesh.base import Config from echomesh.light import SetupDebianSpiLights from echomesh.light.SpiLightBank import SpiLightBank from echomesh.util import Log LOGGER = Log.logger(__name__) _LATCH_BYTE_COUNT = 3 _LATCH = bytearray...
mit
Python
1f6db6ae815b3a62a91971f07ddd8eb3890e20bd
remove unused imports
wwf5067/statsmodels,bavardage/statsmodels,jstoxrocky/statsmodels,cbmoore/statsmodels,bzero/statsmodels,YihaoLu/statsmodels,saketkc/statsmodels,cbmoore/statsmodels,adammenges/statsmodels,astocko/statsmodels,waynenilsen/statsmodels,bavardage/statsmodels,huongttlan/statsmodels,hainm/statsmodels,Averroes/statsmodels,saketk...
lib/neuroimaging/algorithms/statistics/regression.py
lib/neuroimaging/algorithms/statistics/regression.py
""" This module provides various regression analysis techniques to model the relationship between the dependent and independent variables. """ import gc import numpy as N from neuroimaging import traits class LinearModelIterator(traits.HasTraits): iterator = traits.Any() outputs = traits.List() def __i...
""" This module provides various regression analysis techniques to model the relationship between the dependent and independent variables. """ import gc import numpy as N import numpy.linalg as L from neuroimaging import traits from scipy.sandbox.models.regression import OLSModel, WLSModel, ARModel, Results class Li...
bsd-3-clause
Python
ef4d5abc8c664d349bfd791bb6763b23cb0b920e
Correct mistakes in androidServer.py
jpedrorl/LightSwitch,jpedrorl/LightSwitch
androidServer.py
androidServer.py
import socket import sys import threading class Server: def __init__(self, port, relay): self.port = port self.running = False self.thread = threading.Thread(target = self.__startServer) self.thread.setDaemon(True) # dies with main thread self.sock = socket.socket(socket....
import socket import sys import threading class Server: def __init__(self, port, relay): self.port = port self.running = False self.thread = threading.Thread(target = self.__startServer) self.thread.setDaemon(True) # dies with main thread self.sock = socket.socket(socket....
mit
Python
16bc8c8b27012867224fe472a53cbe23c6824c58
test `Video.to_json()` with actual data
pculture/vidscraper,pculture/vidscraper
vidscraper/tests/unit/test_video.py
vidscraper/tests/unit/test_video.py
# Copyright 2012 - Participatory Culture Foundation # # This file is part of vidscraper. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # 1. Redistributions of source code must retain the above copyright # notic...
# Copyright 2012 - Participatory Culture Foundation # # This file is part of vidscraper. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # 1. Redistributions of source code must retain the above copyright # notic...
bsd-3-clause
Python
25fa54fa570d279cc215e1bbde73534349647236
fix minor error
vincentadam87/gatsby-hackathon-seizure,vincentadam87/gatsby-hackathon-seizure
code/python/seizures/submission/SubmissionFile.py
code/python/seizures/submission/SubmissionFile.py
import os from pandas import DataFrame, read_csv from pandas.DataFrame import to_csv from seizures.features.FeatureExtractBase import FeatureExtractBase from seizures.prediction.PredictorBase import PredictorBase class SubmissionFile(): """ Class to generate submission files @author Heiko """ ...
import os from pandas import DataFrame, read_csv from pandas.DataFrame import to_csv from seizures.features.FeatureExtractBase import FeatureExtractBase from seizures.prediction.PredictorBase import PredictorBase class SubmissionFile(): """ Class to generate submission files @author Heiko """ ...
bsd-2-clause
Python
3a2003f05ade8316bd2ff7d98f679d66740bf009
Add API test for node recover action
stackforge/senlin,stackforge/senlin,openstack/senlin,openstack/senlin,openstack/senlin
senlin/tests/tempest/api/nodes/test_node_action.py
senlin/tests/tempest/api/nodes/test_node_action.py
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t...
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t...
apache-2.0
Python
1bf98e80b828af508cbd73efabc1eaa6b75b19c5
Remove unused imports
Duke-GCB/DukeDSHandoverService,Duke-GCB/DukeDSHandoverService,Duke-GCB/DukeDSHandoverService
d4s2_api_v2/tests_serializers.py
d4s2_api_v2/tests_serializers.py
from django.test import TestCase from d4s2_api_v2.serializers import DDSDeliveryPreviewSerializer class DeliveryPreviewSerializerTestCase(TestCase): def setUp(self): self.data = { 'project_id': 'project-1234', 'from_user_id': 'user-5678', 'to_user_id': 'user-9999', ...
from django.test import TestCase from d4s2_api_v2.models import DDSDeliveryPreview from d4s2_api_v2.serializers import DDSDeliveryPreviewSerializer from mock import MagicMock class DeliveryPreviewSerializerTestCase(TestCase): def setUp(self): self.data = { 'project_id': 'project-1234', ...
mit
Python
bd9b3ce8fe22e039554f5e86744aa4828d3c5ed8
set default auto field
centralniak/cmsplugin_gallery,centralniak/cmsplugin_gallery
tests/settings.py
tests/settings.py
#!/usr/bin/env python # -*- coding: utf-8 -*- HELPER_SETTINGS = { 'INSTALLED_APPS': [ 'easy_thumbnails', 'filer', 'mptt', ], 'ALLOWED_HOSTS': ['localhost'], 'CMS_LANGUAGES': { 1: [{ 'code': 'en', 'name': 'English', }] }, 'LANGUAGE_...
#!/usr/bin/env python # -*- coding: utf-8 -*- HELPER_SETTINGS = { 'INSTALLED_APPS': [ 'easy_thumbnails', 'filer', 'mptt', ], 'ALLOWED_HOSTS': ['localhost'], 'CMS_LANGUAGES': { 1: [{ 'code': 'en', 'name': 'English', }] }, 'LANGUAGE_...
bsd-2-clause
Python
e0b9ab8cd745c9f43fb1d7a484a2649b30e4b8e6
include auth
wq/django-rest-pandas,wq/django-rest-pandas,wq/django-rest-pandas,wq/django-rest-pandas
tests/settings.py
tests/settings.py
SECRET_KEY = '1234' INSTALLED_APPS = ( 'django.contrib.contenttypes', 'django.contrib.auth', 'tests.testapp', ) DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': ':memory:', } } ROOT_URLCONF = "tests.urls"
SECRET_KEY = '1234' INSTALLED_APPS = ( 'django.contrib.contenttypes', 'tests.testapp', ) DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': ':memory:', } } ROOT_URLCONF = "tests.urls"
mit
Python
bcda52191b504e7157e1439c6ee1cc3a1ddf7fca
Add __all__ and license in __init__.py
joshua-stone/DerPyBooru
derpibooru/__init__.py
derpibooru/__init__.py
# Copyright (c) 2014, Joshua Stone # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this # list of conditions and the f...
from .search import Search from .lists import Lists
bsd-2-clause
Python
34bfc972b783d8a7035d43b3d14d128f01375982
Add Print filter.
fhirschmann/penchy,fhirschmann/penchy
penchy/jobs/filters.py
penchy/jobs/filters.py
""" This module provides filters. """ from penchy.jobs.elements import Filter class Tamiflex(Filter): pass class HProf(Filter): pass class Dacapo(Filter): pass class Send(Filter): pass class Receive(Filter): pass class Print(Filter): """ Prints everything fed to it on stdout. ""...
""" This module provides filters. """ from penchy.jobs.elements import Filter class Tamiflex(Filter): pass class HProf(Filter): pass class Dacapo(Filter): pass class Send(Filter): pass class Receive(Filter): pass class Print(Filter): pass
mit
Python
f2700febc193353a8c88ce365cbd58b152fe64b2
Create email_lib.py
aescoda/TFG
email_lib.py
email_lib.py
# -*- coding: utf-8 -*- from email.mime.text import MIMEText from smtplib import SMTP sender_email = os.environ.get('MAIL_USER', None) sender_pass = os.environ.get('MAIL_PASS', None) server_email = os.environ.get('MAIL_SERVER', None) port_email = os.environ.get('MAIL_PORT', None) SSL_email = os.environ.get('MA...
# -*- coding: utf-8 -*- from email.mime.text import MIMEText from smtplib import SMTP sender_email = os.environ.get('MAIL_USER', None) sender_pass = os.environ.get('MAIL_PASS', None) server_email = os.environ.get('MAIL_SERVER', None) port_email = os.environ.get('MAIL_PORT', None) SSL_email = os.environ.get('MA...
apache-2.0
Python
151599602b9d626ebcfe5ae6960ea216b767fec2
Update distutils patch to monkeypatch all paths from sys.path to ensure that distutils is never imported except from the same path as setuptools. Assert that 'distutils' is not already in sys.modules.
pypa/setuptools,pypa/setuptools,pypa/setuptools
setuptools/distutils_patch.py
setuptools/distutils_patch.py
""" Ensure that the local copy of distutils is preferred over stdlib. See https://github.com/pypa/setuptools/issues/417#issuecomment-392298401 for more motivation. """ import sys import importlib import contextlib from os.path import dirname @contextlib.contextmanager def patch_sys_path(): orig = sys.path[:] ...
""" Ensure that the local copy of distutils is preferred over stdlib. See https://github.com/pypa/setuptools/issues/417#issuecomment-392298401 for more motivation. """ import sys import importlib from os.path import dirname sys.path.insert(0, dirname(dirname(__file__))) importlib.import_module('distutils') sys.path...
mit
Python
9d1abf3a7d91826f9e499b2fc1490d2656a45d18
add rest 接口测试
DXCChina/pms,WX-DongXing/pms,WX-DongXing/pms,DXCChina/pms,DXCChina/pms,WX-DongXing/pms,WX-DongXing/pms,DXCChina/pms
api/test_user.py
api/test_user.py
from hypothesis import given, example from hypothesis.strategies import tuples, booleans, lists, text, integers import random import string from app import app from model import user from flask import json def test_user_model(): username = ''.join(random.sample('abcdefghijklmnopqrstuvwxyz', 6)) email = userna...
from hypothesis import given, example from hypothesis.strategies import tuples, booleans, lists, text, integers import random import string from app import app from model import user def test_user_model(): username = ''.join(random.sample('abcdefghijklmnopqrstuvwxyz', 6)) email = username + '@' + 'qq.com' ...
mit
Python
b5d1e9f209d143169195514f80b74e1350799b03
FIX quickshift nosetest with different xyz color conversion
michaelpacer/scikit-image,SamHames/scikit-image,chintak/scikit-image,ofgulban/scikit-image,michaelaye/scikit-image,keflavich/scikit-image,Midafi/scikit-image,Hiyorimi/scikit-image,bennlich/scikit-image,newville/scikit-image,WarrenWeckesser/scikits-image,keflavich/scikit-image,warmspringwinds/scikit-image,jwiggins/sciki...
skimage/segmentation/tests/test_quickshift.py
skimage/segmentation/tests/test_quickshift.py
import numpy as np from numpy.testing import assert_equal, assert_array_equal from nose.tools import assert_true from skimage._shared.testing import assert_greater from skimage.segmentation import quickshift def test_grey(): rnd = np.random.RandomState(0) img = np.zeros((20, 21)) img[:10, 10:] = 0.2 i...
import numpy as np from numpy.testing import assert_equal, assert_array_equal from nose.tools import assert_true from skimage._shared.testing import assert_greater from skimage.segmentation import quickshift def test_grey(): rnd = np.random.RandomState(0) img = np.zeros((20, 21)) img[:10, 10:] = 0.2 i...
bsd-3-clause
Python
81b69ed9fe844c4313badc8335fb2751d3800aef
Remove requests parameter
BakeCode/performance-testing,BakeCode/performance-testing
performance/routine.py
performance/routine.py
from performance import web class Tool: def __init__(self, config): if not isinstance(config, Config): raise TypeError('No performance.routine.Config object') self.config = config def run(self): pass class Config: def __init__(self, host, requests_per_client=10, clie...
from performance import web class Tool: def __init__(self, config): if not isinstance(config, Config): raise TypeError('No performance.routine.Config object') self.config = config def run(self): pass class Config: def __init__(self, host, requests=None, requests_per_...
mit
Python
90188224e13cf8bcaf234be4da107bf1b0bb45ac
Update micro benchmark: generator; Add more loop variant instruction to the hot loop
wdv4758h/ZipPy,wdv4758h/ZipPy,wdv4758h/ZipPy,wdv4758h/ZipPy,wdv4758h/ZipPy,wdv4758h/ZipPy,wdv4758h/ZipPy,wdv4758h/ZipPy
graal/edu.uci.python.benchmark/src/micro/generator.py
graal/edu.uci.python.benchmark/src/micro/generator.py
# zwei 12/17/13 # subscribe simple generator import time def generator(n): for i in range(n): yield i * 2 def call_generator(num, iteration): item = 0 for t in range(iteration): num += t % 5 for i in generator(num): item = i + item % 5 return item def measure(): print("Start timing...") start = time...
# zwei 12/17/13 # subscribe simple generator import time def gen(n): for i in range(n): yield i def call_generator(num, iteration): for t in range(iteration): for i in gen(num): item = i return item def measure(): print("Start timing...") start = time.time() num = 1000 last_item = call_generator(nu...
bsd-3-clause
Python
9028deadf3ebf6146ada17afdf71de68953206b0
Fix plugin issue
RazvanRotari/iaP,RazvanRotari/iaP,RazvanRotari/iaP,RazvanRotari/iaP,RazvanRotari/iaP
services/inserter/plugins/categories_extractor.py
services/inserter/plugins/categories_extractor.py
from nltk import word_tokenize from nltk.corpus import stopwords from nltk.stem import WordNetLemmatizer import string def tokenize(sentence): sentence = sentence.lower() tokens = word_tokenize(sentence) blacklisted_words = stopwords.words('english') + list(string.punctuation) return [word for word in ...
from nltk import word_tokenize from nltk.corpus import stopwords from nltk.stem import WordNetLemmatizer import string def tokenize(sentence): sentence = sentence.lower() tokens = word_tokenize(sentence) blacklisted_words = stopwords.words('english') + list(string.punctuation) return [word for word in ...
mit
Python
744fd29b2fb8f7201305037817c6c15aa07fb330
Handle function-based middleware in null_technical_500_response
django-extensions/django-extensions,django-extensions/django-extensions,django-extensions/django-extensions
django_extensions/management/technical_response.py
django_extensions/management/technical_response.py
# -*- coding: utf-8 -*- import threading import six from django.core.handlers.wsgi import WSGIHandler tld = threading.local() tld.wsgi_tb = None def null_technical_500_response(request, exc_type, exc_value, tb, status_code=500): """Function to override django.views.debug.technical_500_response. Django's co...
# -*- coding: utf-8 -*- import threading import six from django.core.handlers.wsgi import WSGIHandler tld = threading.local() tld.wsgi_tb = None def null_technical_500_response(request, exc_type, exc_value, tb, status_code=500): """Function to override django.views.debug.technical_500_response. Django's co...
mit
Python
de23099e04d0a5823d6917f6f991d66e25b9002b
Add support for rendering with a URL prefix
hyperair/django-medusa
django_medusa/management/commands/staticsitegen.py
django_medusa/management/commands/staticsitegen.py
from django.conf import settings from django.core.management.base import BaseCommand from django.core.urlresolvers import set_script_prefix from django_medusa.renderers import StaticSiteRenderer from django_medusa.utils import get_static_renderers class Command(BaseCommand): can_import_settings = True help =...
from django.core.management.base import BaseCommand from django_medusa.renderers import StaticSiteRenderer from django_medusa.utils import get_static_renderers class Command(BaseCommand): can_import_settings = True help = 'Looks for \'renderers.py\' in each INSTALLED_APP, which defines '\ 'a class...
mit
Python
9ec79f738b1fcd5002590b5fc31a302b241561e2
implement option to disable interactive mode
morgenst/PyAnalysisTools,morgenst/PyAnalysisTools,morgenst/PyAnalysisTools
run_scripts/print_cutflow.py
run_scripts/print_cutflow.py
#!/usr/bin/env python import ROOT ROOT.PyConfig.IgnoreCommandLineOptions = True import os import sys from PyAnalysisTools.AnalysisTools.CutFlowAnalyser import CutflowAnalyser as ca from PyAnalysisTools.AnalysisTools.CutFlowAnalyser import ExtendedCutFlowAnalyser as eca from PyAnalysisTools.base import * try: from ...
#!/usr/bin/env python import ROOT ROOT.PyConfig.IgnoreCommandLineOptions = True import os import sys from PyAnalysisTools.AnalysisTools.CutFlowAnalyser import CutflowAnalyser as ca from PyAnalysisTools.AnalysisTools.CutFlowAnalyser import ExtendedCutFlowAnalyser as eca from PyAnalysisTools.base import * try: from ...
mit
Python
a3d24859d23ef9d299c75fe5ebdfcf187451041b
make sure it works, well sort of...
akrherz/pyWWA,akrherz/pyWWA
meso_afd.py
meso_afd.py
# Process special AFD for BMX import sys, re import traceback import StringIO import secret from pyIEM import nws_text from pyxmpp.jid import JID from pyxmpp.jabber.simple import send_message errors = StringIO.StringIO() raw = sys.stdin.read() import pg postgisdb = pg.connect(secret.dbname, secret.dbhost, user=sec...
# Process special AFD for BMX import sys, re import traceback import StringIO import secret from pyIEM import nws_text from pyxmpp.jid import JID from pyxmpp.jabber.simple import send_message errors = StringIO.StringIO() raw = sys.stdin.read() import pg postgisdb = pg.connect(secret.dbname, secret.dbhost, user=sec...
mit
Python
3c5d82ced00da284fc8dc48fea34462958a8883e
Fix cross-platform process communication.
joeyespo/grip,ssundarraj/grip,joeyespo/grip,ssundarraj/grip
tests/test_cli.py
tests/test_cli.py
""" Tests the Grip command-line interface. """ from __future__ import print_function, unicode_literals from subprocess import PIPE, STDOUT, CalledProcessError, Popen import pytest from grip.command import usage, version def run(*args, **kwargs): command = kwargs.pop('command', 'grip') stdin = kwargs.pop('s...
""" Tests the Grip command-line interface. """ from __future__ import print_function, unicode_literals from subprocess import PIPE, STDOUT, CalledProcessError, Popen import pytest from grip.command import usage, version def run(*args, **kwargs): command = kwargs.pop('command', 'grip') stdin = kwargs.pop('s...
mit
Python
8cf225cae6e3b57fa068ec56373905835f9bc64d
Add automatic selection of default value if not provided
uccser/cs-unplugged,uccser/cs-unplugged,uccser/cs-unplugged,uccser/cs-unplugged
csunplugged/resources/utils/resource_parameters.py
csunplugged/resources/utils/resource_parameters.py
from lxml import etree from django.utils.translation import ugettext as _ class ResourceParameter(object): def __init__(self, name="", description=""): self.name = name self.description = description def html_element(self): legend = etree.Element('legend') legend.text = self.de...
from lxml import etree from django.utils.translation import ugettext as _ class ResourceParameter(object): def __init__(self, name="", description=""): self.name = name self.description = description def html_element(self): legend = etree.Element('legend') legend.text = self.de...
mit
Python
5db86f0ede5c95f8b08ebb8c5f536e8d431662cb
fix daiquiri_path script
aipescience/django-daiquiri,aipescience/django-daiquiri,aipescience/django-daiquiri
daiquiri/core/management/commands/daiquiri_path.py
daiquiri/core/management/commands/daiquiri_path.py
import imp from django.core.management.base import BaseCommand class Command(BaseCommand): requires_system_checks = False can_import_settings = False def handle(self, *args, **options): print(imp.find_module('daiquiri')[1])
import imp from django.core.management.base import BaseCommand class Command(BaseCommand): def handle(self, *args, **options): print(imp.find_module('daiquiri')[1])
apache-2.0
Python
fc2ca6994c10e6f5781965f1d5ad2f651249f6c6
cover test for warnings
Woile/commitizen,Woile/commitizen
tests/test_cli.py
tests/test_cli.py
import sys import pytest from commitizen import cli from commitizen.__version__ import __version__ def test_sysexit_no_argv(mocker, capsys): testargs = ["cz"] mocker.patch.object(sys, "argv", testargs) with pytest.raises(SystemExit): cli.main() out, _ = capsys.readouterr() asser...
import sys import pytest from commitizen import cli from commitizen.__version__ import __version__ def test_sysexit_no_argv(mocker, capsys): testargs = ["cz"] mocker.patch.object(sys, "argv", testargs) with pytest.raises(SystemExit): cli.main() out, _ = capsys.readouterr() asser...
mit
Python
5f09835f9aa62abb5f891c4d3896206eedd9fe12
fix somewherein url
banglakit/corpus-builder
corpus_builder/spiders/public_blog/somewherein.py
corpus_builder/spiders/public_blog/somewherein.py
# -*- coding: utf-8 -*- import scrapy from scrapy.linkextractors import LinkExtractor from scrapy.spiders import Rule from corpus_builder.templates.spider import CommonSpider class SomewhereInSpider(CommonSpider): name = 'somewherein' allowed_domains = ['www.somewhereinblog.net', 'somewhereinblog.net'] b...
# -*- coding: utf-8 -*- import scrapy from scrapy.linkextractors import LinkExtractor from scrapy.spiders import Rule from corpus_builder.templates.spider import CommonSpider class SomewhereInSpider(CommonSpider): name = 'somewherein' allowed_domains = ['www.somewhereinblog.net', 'somewhereinblog.net'] b...
mit
Python
38dba247fbc5855dd830a02e52531d8c98964693
Update ipc_lista1.4.py
any1m1c/ipc20161
lista1/ipc_lista1.4.py
lista1/ipc_lista1.4.py
#ipc_lista1.4 #Professor: Jucimar Junior #Any Mendes Carvalho - 1615310044 # # # # #Faça um Programa que peça as 4 notas bimestrais e mostre a media nota1 = int(input("Digite a primeira nota do bimestre: ")) nota2 = int(input("Digite a segunda nota do bimestre: ")) nota3 = int(input("Digite a terceira nota do bismestr...
#ipc_lista1.4 #Professor: Jucimar Junior #Any Mendes Carvalho - 1615310044 # # # # #Faça um Programa que peça as 4 notas bimestrais e mostre a media nota1 = int(input("Digite a primeira nota do bimestre: ")) nota2 = int(input("Digite a segunda nota do bimestre: ")) nota3 = int(input("Digite a terceira nota do bismestr...
apache-2.0
Python
0311ff1b0d3bdb40a8840293aa1acc5667b5db43
Update ipc_lista1.5.py
any1m1c/ipc20161
lista1/ipc_lista1.5.py
lista1/ipc_lista1.5.py
#ipc_lista1.5 #Professor: Jucimar Junior #Any Mendes Carvalho - 1615310044 # # # # #Faça um programa que converta metros para centímetros.
#ipc_lista1.5 #Professor: Jucimar Junior #Any Mendes Carvalho - 1615310044 # # # # #Faça um programa que converta metros para centímetros.
apache-2.0
Python
6bc6487d2659b33a15e93b998058bde637e83993
Update ipc_lista1.5.py
any1m1c/ipc20161
lista1/ipc_lista1.5.py
lista1/ipc_lista1.5.py
#ipc_lista1.5 #Professor: Jucimar Junior #Any Mendes Carvalho - 1615310044 # # # # #Faça um programa que converta metros para centímetros. metros = input("Digite o valor em metros que deseja
#ipc_lista1.5 #Professor: Jucimar Junior #Any Mendes Carvalho - 1615310044 # # # # #Faça um programa que converta metros para centímetros. metros = input("Digite o valor em metros que
apache-2.0
Python
e579e03f70bfbea3942647059ebd2a8a3e0043a3
update sphinx rendering to use built in jinja rendering for .js/.css files
zzzeek/mako,zzzeek/mako,sqlalchemy/mako,mindw/mako,sqlalchemy/mako,mindw/mako,Distrotech/mako,Distrotech/mako,wujuguang/mako,wujuguang/mako
doc/build/builder/builders.py
doc/build/builder/builders.py
from sphinx.application import TemplateBridge from sphinx.builders.html import StandaloneHTMLBuilder from sphinx.highlighting import PygmentsBridge from sphinx.jinja2glue import BuiltinTemplateLoader from pygments import highlight from pygments.lexer import RegexLexer, bygroups, using from pygments.token import * from ...
from sphinx.application import TemplateBridge from sphinx.builders.html import StandaloneHTMLBuilder from sphinx.highlighting import PygmentsBridge from pygments import highlight from pygments.lexer import RegexLexer, bygroups, using from pygments.token import * from pygments.filter import Filter, apply_filters from py...
mit
Python
6959a95e204599cb18db7211ac4cce005918142c
update utils
dssg/wikienergy,dssg/wikienergy,dssg/wikienergy,dssg/wikienergy,dssg/wikienergy
disaggregator/utils.py
disaggregator/utils.py
import appliance import pandas def concatenate_traces(traces, metadata=None, how="strict"): ''' Given a list of appliance traces, returns a single concatenated trace. With how="strict" option, must be sampled at the same rate and consecutive, without overlapping datapoints. ''' if not metadata:...
from ApplianceTrace import ApplianceTrace from ApplianceInstance import ApplianceInstance from ApplianceType import ApplianceType from ApplianceSet import ApplianceSet from pandas import concat def concatenate_traces(traces, metadata=None, how="strict"): ''' Given a list of appliance traces, returns a single c...
mit
Python
03da52f9098e05f564ff7c258a6d60e84bd2cf56
Make sure the test runner use the local filesystem.
us-ignite/us_ignite,us-ignite/us_ignite,us-ignite/us_ignite,us-ignite/us_ignite,us-ignite/us_ignite
us_ignite/settings/testing.py
us_ignite/settings/testing.py
# Testing settings for us_ignite from us_ignite.settings import * SECRET_KEY = 'c!lizso+53#4dhm*o2qyh9t(n14p#wr5!+%1bfjtrqa#vsc$@h' DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': 'us-ignite-test.db', 'USER': '', 'PASSWORD': '', 'HOST': '', ...
# Testing settings for us_ignite from us_ignite.settings import * SECRET_KEY = 'c!lizso+53#4dhm*o2qyh9t(n14p#wr5!+%1bfjtrqa#vsc$@h' DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': 'us-ignite-test.db', 'USER': '', 'PASSWORD': '', 'HOST': '', ...
bsd-3-clause
Python
85aa0455d5accb392cf6bc3b5fc44bc8b8da4350
Add retry when tag reference was lost
pixelated-project/pixelated-user-agent,pixelated/pixelated-user-agent,pixelated/pixelated-user-agent,pixelated-project/pixelated-user-agent,pixelated-project/pixelated-user-agent,pixelated/pixelated-user-agent,pixelated/pixelated-user-agent,pixelated-project/pixelated-user-agent,pixelated-project/pixelated-user-agent,p...
service/test/functional/features/steps/tag_list.py
service/test/functional/features/steps/tag_list.py
# # Copyright (c) 2014 ThoughtWorks, Inc. # # Pixelated is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Pixelated is distrib...
# # Copyright (c) 2014 ThoughtWorks, Inc. # # Pixelated is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Pixelated is distrib...
agpl-3.0
Python
895a40c9e92af1700cc174e32472c833e83140be
Use replace instead of strip
jdgwartney/boundary-plugin-shell,jdgwartney/boundary-plugin-shell,boundary/boundary-plugin-shell,boundary/boundary-plugin-shell
exec_proc.py
exec_proc.py
#!/usr/bin/env python # Copyright 2014 Boundary, 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 o...
#!/usr/bin/env python # Copyright 2014 Boundary, 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 o...
apache-2.0
Python
d5293bc83495e1d9ddcf8918dd99f983c185f475
clean formatting
DeadSix27/python_cross_compile_script
packages/dependencies/libsndfile.py
packages/dependencies/libsndfile.py
{ 'repo_type' : 'git', 'url' : 'https://github.com/erikd/libsndfile.git', 'configure_options' : '--host={target_host} --prefix={target_prefix} --disable-shared --enable-static --enable-sqlite --disable-test-coverage --enable-external-libs --enable-experimental', 'run_post_patch' : [ 'autoreconf -fiv -I M4', ], ...
{ 'repo_type' : 'git', #'branch' : '81a71e08c09b20b0255aa66e40fce293008b9525', # 'd2ca7f4afc776d7c0c14c9a9a5ba94d9ae3affb8', 'url' : 'https://github.com/erikd/libsndfile.git', 'configure_options' : '--host={target_host} --prefix={target_prefix} --disable-shared --enable-static --enable-sqlite --disable-test-coverag...
mpl-2.0
Python
08eff1cd735e43a8697fb56047ca4e04120a12e6
Set url scheme to 'https' when executing through AWS API Gateway
dgnorth/drift,dgnorth/drift,dgnorth/drift
drift/fixers.py
drift/fixers.py
# -*- coding: utf-8 -*- """ This module includes various helpers and fixers. """ from flask.json import JSONEncoder from datetime import date class CustomJSONEncoder(JSONEncoder): '''Extend the JSON encoder to treat date-time objects as strict rfc3339 types. ''' def default(self, obj): fro...
# -*- coding: utf-8 -*- """ This module includes various helpers and fixers. """ from flask.json import JSONEncoder from datetime import date class CustomJSONEncoder(JSONEncoder): '''Extend the JSON encoder to treat date-time objects as strict rfc3339 types. ''' def default(self, obj): fro...
mit
Python
94705d1f4d63e47d2ef677bba13a54daa1d1745c
allow skextremes.models.classic import
kikocorreoso/scikit-extremes
skextremes/models/__init__.py
skextremes/models/__init__.py
from . import wind from . import engineering from . import classic
from . import wind from . import engineering
mit
Python
2111c840c11fe2046c87a2767f00b3781a5e2eac
Update dumpling.client.python.py
leculver/dotnet-reliability,leculver/dotnet-reliability,leculver/dotnet-reliability,leculver/dotnet-reliability,leculver/dotnet-reliability,leculver/dotnet-reliability
src/dumpling-service/dumpling.python-client/dumpling.client.python.py
src/dumpling-service/dumpling.python-client/dumpling.client.python.py
import requests class DumplingService: _dumplingUri = 'http://dotnetrp.azurewebsites.net'; @staticmethod def SayHelloAs(username): hello_url = DumplingService._dumplingUri + '/dumpling/test/hi/im/%s'%(username) response = requests.get(hello_url) return response.content @stati...
import requests class DumplingService: _dumplingUri = 'http://dotnetrp.azurewebsites.net'; @staticmethod def SayHelloAs(username): hello_url = DumplingService._dumplingUri + '/dumpling/test/hi/im/%s'%(username) response = requests.get(hello_url) return response.content @stati...
mit
Python
182f1ab71ff7abcbf54340c59dc438cacf80d066
Update report API ext method names to match URLs
cneill/designate,kiall/designate-py3,cneill/designate-testing,ionrock/designate,kiall/designate-py3,ionrock/designate,cneill/designate,melodous/designate,melodous/designate,grahamhayes/designate,kiall/designate-py3,ramsateesh/designate,openstack/designate,NeCTAR-RC/designate,kiall/designate-py3,melodous/designate,kiall...
moniker/api/v1/extensions/reports.py
moniker/api/v1/extensions/reports.py
# Copyright 2012 Hewlett-Packard Development Company, L.P. All Rights Reserved. # # Author: Simon McCartney <simon.mccartney@hp.com> # # 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 # # h...
# Copyright 2012 Hewlett-Packard Development Company, L.P. All Rights Reserved. # # Author: Simon McCartney <simon.mccartney@hp.com> # # 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 # # h...
apache-2.0
Python
91f7e96758f048f1473de11d8f6a919be8b98e23
make filename of rected unique and copy files that were imported correctly to central dir
ddsc/ddsc-worker
ddsc_worker/localsettings_example_with_comments.py
ddsc_worker/localsettings_example_with_comments.py
DATABASES = { 'default': { 'NAME': 'ddsc', 'ENGINE': 'django.contrib.gis.db.backends.postgis', 'USER': 'xxxx', 'PASSWORD': 'xxxxxxxx', 'HOST': 'xx.xx.xxx.xxx', 'PORT': '', } } CASSANDRA = { 'servers': [ 'xxx.xxx.xxx.xx:9160', 'xx.xxx.xxx.xx:91...
DATABASES = { 'default': { 'NAME': 'ddsc', 'ENGINE': 'django.contrib.gis.db.backends.postgis', 'USER': 'xxxx', 'PASSWORD': 'xxxxxxxx', 'HOST': 'xx.xx.xxx.xxx', 'PORT': '', } } CASSANDRA = { 'servers': [ 'xxx.xxx.xxx.xx:9160', 'xx.xxx.xxx.xx:91...
mit
Python
c7ae246fce12748f9e6a3e7584e2ca045a1d9138
add version variable
devsim/devsim,devsim/devsim,devsim/devsim
dist/__init__.py
dist/__init__.py
import sys #TODO: #https://stackoverflow.com/questions/6677424/how-do-i-import-variable-packages-in-python-like-using-variable-variables-i #imported = getattr(__import__(package, fromlist=[name]), name) if sys.version_info[0] == 2: from devsim_py27 import * from devsim_py27 import __version__ elif sys.version_inf...
import sys #TODO: #https://stackoverflow.com/questions/6677424/how-do-i-import-variable-packages-in-python-like-using-variable-variables-i #imported = getattr(__import__(package, fromlist=[name]), name) if sys.version_info[0] == 2: from devsim_py27 import * elif sys.version_info[0] == 3 and sys.version_info[1] == 6...
apache-2.0
Python
9caf6f3992c74613e0002f142982fce20f42ec4c
update tests that were not passing
mdietrichc2c/vertical-ngo,jorsea/vertical-ngo,yvaucher/vertical-ngo,jorsea/vertical-ngo
framework_agreement_sourcing/tests/test_check_sourcing.py
framework_agreement_sourcing/tests/test_check_sourcing.py
# Author: Leonardo Pistone # Copyright 2014 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any la...
# Author: Leonardo Pistone # Copyright 2014 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any la...
agpl-3.0
Python
d16d715898bae287520841a5936217c6e53788e0
Bump version to 3.5.0rc14
platformio/platformio,platformio/platformio-core,platformio/platformio-core
platformio/__init__.py
platformio/__init__.py
# Copyright (c) 2014-present PlatformIO <contact@platformio.org> # # 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 appli...
# Copyright (c) 2014-present PlatformIO <contact@platformio.org> # # 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 appli...
apache-2.0
Python
b115430447cc489e6cb83f7bfb954e72aef7927b
comment updated
scottpurdy/NAB,numenta/NAB,kimhungGCZ/combinedAL,scottpurdy/NAB,scottpurdy/NAB,BoltzmannBrain/NAB,kimhungGCZ/combinedAL,rhyolight/NAB,subutai/NAB,rhyolight/NAB,numenta/NAB,kimhungGCZ/combinedAL,breznak/NAB,rhyolight/NAB,BoltzmannBrain/NAB,numenta/NAB,subutai/NAB,breznak/NAB,breznak/NAB,numenta/NAB,subutai/NAB
nab/detectors/numenta/numentaTM_detector.py
nab/detectors/numenta/numentaTM_detector.py
# ---------------------------------------------------------------------- # Copyright (C) 2016, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This program is free software: you can redistribute it and/or mo...
# ---------------------------------------------------------------------- # Copyright (C) 2016, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This program is free software: you can redistribute it and/or mo...
agpl-3.0
Python
dc67190ae855de30f0ee33f4d8b34462d44667e9
Change URL scheme `user` to `users`
avinassh/nightreads,avinassh/nightreads
nightreads/urls.py
nightreads/urls.py
"""nightreads URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.9/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-...
"""nightreads URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.9/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-...
mit
Python
7b0f08235a6a27b3f9d6615c1211ddb6f9c8fea1
update setup
DynaSlum/SateliteImaging,DynaSlum/SatelliteImaging,DynaSlum/SatelliteImaging,DynaSlum/SateliteImaging
Python/setup.py
Python/setup.py
from __future__ import absolute_import, print_function import io import os from setuptools import find_packages, setup def read(*names, **kwargs): with io.open( os.path.join(os.path.dirname(__file__), *names), encoding=kwargs.get('encoding', 'utf8'), ) as fp: return fp.read() readm...
from __future__ import absolute_import, print_function import io import os from setuptools import find_packages, setup def read(*names, **kwargs): with io.open( os.path.join(os.path.dirname(__file__), *names), encoding=kwargs.get('encoding', 'utf8'), ) as fp: return fp.read() readm...
apache-2.0
Python
dee8c9791947c517cac6563234368362cbe5b1d7
bump version
nluedtke/brochat-bot
common.py
common.py
VERSION_YEAR = 2019 VERSION_MONTH = 4 VERSION_DAY = 28 VERSION_REV = 0 whos_in = None twitter = None users = {} twilio_client = None ARGS = {} smmry_api_key = None pubg_api_key = None pubg_api = None # Variable hold trumps last tweet id last_id = 0 trump_chance_roll_rdy = False # Runtime stats duels_conducted = 0 it...
VERSION_YEAR = 2019 VERSION_MONTH = 3 VERSION_DAY = 3 VERSION_REV = 0 whos_in = None twitter = None users = {} twilio_client = None ARGS = {} smmry_api_key = None pubg_api_key = None pubg_api = None # Variable hold trumps last tweet id last_id = 0 trump_chance_roll_rdy = False # Runtime stats duels_conducted = 0 ite...
mit
Python
28770cf4d0995697f7b2c8edad7a56fb8aeabea5
Send email to client working
shahariarrabby/Mail_Server
Sendy.py
Sendy.py
# coding: utf-8 # ! /usr/bin/python __author__ = 'Shahariar Rabby' # This will read details and send email to clint # # Sendy # ### Importing Send mail file # In[6]: from Sendmail import * # ** Take user email, text plan massage, HTML file ** # In[7]: TO_EMAIL = raw_input("Enter reciver email : ") #Taking Reciv...
# coding: utf-8 # ! /usr/bin/python __author__ = 'Shahariar Rabby' # # Sendy # ### Importing Send mail file # In[6]: from Sendmail import * # ** Take user email, text plan massage, HTML file ** # In[7]: TO_EMAIL = raw_input("Enter reciver email : ") #Taking Reciver email as input subject = raw_input("Enter Mail...
mit
Python
48a63de70673ce96ead7a81709fdd81e872a847d
Revert changes
joshloyal/scikit-learn,alexeyum/scikit-learn,abhishekgahlot/scikit-learn,RomainBrault/scikit-learn,murali-munna/scikit-learn,RPGOne/scikit-learn,cauchycui/scikit-learn,Sentient07/scikit-learn,shahankhatch/scikit-learn,lin-credible/scikit-learn,Achuth17/scikit-learn,eg-zhang/scikit-learn,nrhine1/scikit-learn,jblackburne...
examples/ensemble/plot_forest_importances_faces.py
examples/ensemble/plot_forest_importances_faces.py
""" ======================================= Pixel importances with forests of trees ======================================= This example shows the use of forests of trees to evaluate the importance of the pixels in an image classification task (faces). The hotter the pixel, the more important. """ print __doc__ impor...
""" ======================================= Pixel importances with forests of trees ======================================= This example shows the use of forests of trees to evaluate the importance of the pixels in an image classification task (faces). The hotter the pixel, the more important. """ print __doc__ impor...
bsd-3-clause
Python
918421a26c762a5afc0161d874ab4fec6ff11cb0
add url
dictoss/osmmarkerstorage,dictoss/osmmarkerstorage,dictoss/osmmarkerstorage,dictoss/osmmarkerstorage
webapp/osmproj1/markerstorage/urls.py
webapp/osmproj1/markerstorage/urls.py
from django.conf.urls import url from django.contrib.staticfiles.urls import staticfiles_urlpatterns from . import views urlpatterns = [ url(r'^markerdata/$', views.markerdata_list), url(r'^markerdata/(?P<pk>[0-9]+)/$', views.markerdata_detail), # url(r'^osm/index.html', views.osm_index), url(r'^o...
from django.conf.urls import url from django.contrib.staticfiles.urls import staticfiles_urlpatterns from . import views urlpatterns = [ url(r'^markerdata/$', views.markerdata_list), url(r'^markerdata/(?P<pk>[0-9]+)/$', views.markerdata_detail), # url(r'^osm/index.html', views.osm_index), url(r'^o...
bsd-2-clause
Python
d316513501d21bd04cb64091133b93cacd9bcd3b
Switch RawConfigParser -> ConfigParser.
pkexcellent/luigi,Yoone/luigi,ChrisBeaumont/luigi,graingert/luigi,rayrrr/luigi,realgo/luigi,leafjungle/luigi,ehdr/luigi,JackDanger/luigi,theoryno3/luigi,fabriziodemaria/luigi,ChrisBeaumont/luigi,alkemics/luigi,dstandish/luigi,mfcabrera/luigi,samuell/luigi,moritzschaefer/luigi,fw1121/luigi,aeron15/luigi,slvnperron/luigi...
luigi/configuration.py
luigi/configuration.py
import logging from ConfigParser import ConfigParser, NoOptionError, NoSectionError class LuigiConfigParser(ConfigParser): NO_DEFAULT = object() _instance = None _config_paths = ['/etc/luigi/client.cfg', 'client.cfg'] @classmethod def add_config_path(cls, path): cls._config_paths.append(...
import logging from ConfigParser import RawConfigParser, NoOptionError, NoSectionError class LuigiConfigParser(RawConfigParser): NO_DEFAULT = object() _instance = None _config_paths = ['/etc/luigi/client.cfg', 'client.cfg'] @classmethod def add_config_path(cls, path): cls._config_paths.a...
apache-2.0
Python
550fd8bc4a9f9e7f780a99b9d925b95883e046ea
remove extra log statement
CitrineInformatics/pif-dft
dfttopif/web.py
dfttopif/web.py
import sys import json import logging import requests from pypif import pif from flask import Flask, request from flask_cors import CORS from dfttopif import * # Configure flask app = Flask(__name__) CORS(app) # Configure logging logging.basicConfig(stream=sys.stdout, level=logging.DEBUG) @app.route('/convert/from...
import sys import json import logging import requests from pypif import pif from flask import Flask, request from flask_cors import CORS from dfttopif import * # Configure flask app = Flask(__name__) CORS(app) # Configure logging logging.basicConfig(stream=sys.stdout, level=logging.DEBUG) @app.route('/convert/from...
apache-2.0
Python
36b15658906685ea7eaaa3289678c416bc2d23af
Remove sleep from sample script, it was slowing down the tests.
cfe-lab/Kive,cfe-lab/Kive,cfe-lab/Kive,cfe-lab/Kive,cfe-lab/Kive
samplecode/generic_script.py
samplecode/generic_script.py
#! /usr/bin/env python import argparse import csv import sys # In order to work with kive, scripts which having a inputs # and b inputs must have a+b command line arguments, the first a # arguments specifying paths of input files, the subsequent b # arguments specifying the paths of where outputs are written] script...
#! /usr/bin/env python import argparse import csv import sys import time # In order to work with kive, scripts which having a inputs # and b inputs must have a+b command line arguments, the first a # arguments specifying paths of input files, the subsequent b # arguments specifying the paths of where outputs are writ...
bsd-3-clause
Python
b4c1eb9acba9e5ce74da3ccfda177ccf41c07ab5
Bump revision number
cread/ecks,cread/ecks
ecks/__init__.py
ecks/__init__.py
""" A simple way to get data out of a remote machine using SNMP without having to deal with a single MIB or OID The goal of Ecks is simple - make it really easy to get get any data from an SNMP service. Ecks is made up of a core class that will collect data via SNMP, and a set of plugins that cont...
""" A simple way to get data out of a remote machine using SNMP without having to deal with a single MIB or OID The goal of Ecks is simple - make it really easy to get get any data from an SNMP service. Ecks is made up of a core class that will collect data via SNMP, and a set of plugins that cont...
apache-2.0
Python
39980bd4063cd55e86f715ecf4c1a0eef48dadce
Update bucket listing to return key names
bahoo/django-dbbackup,bahoo/django-dbbackup
dbbackup/storage/s3_storage.py
dbbackup/storage/s3_storage.py
""" S3 Storage object. """ import os import boto from boto.s3.key import Key from django.conf import settings from .base import BaseStorage, StorageError ################################ # S3 Storage Object ################################ class Storage(BaseStorage): """ S3 API Storage. """ S3_BUCKET = ge...
""" S3 Storage object. """ import os import boto from boto.s3.key import Key from django.conf import settings from .base import BaseStorage, StorageError ################################ # S3 Storage Object ################################ class Storage(BaseStorage): """ S3 API Storage. """ S3_BUCKET = ge...
bsd-3-clause
Python
812031ff7e3017dfcbff4c3434fbd3c2437dcb33
print the information of testcase which is on failure
F30/storm,0x726d77/storm,kevpeek/storm,ujfjhz/storm,kevinconaway/storm,carl34/storm,hmcl/storm-apache,kevpeek/storm,ujfjhz/storm,srdo/storm,ujfjhz/storm,kevpeek/storm,0x726d77/storm,srishtyagrawal/storm,kevpeek/storm,F30/storm,kamleshbhatt/storm,srdo/storm,kamleshbhatt/storm,carl34/storm,pczb/storm,srishtyagrawal/storm...
dev-tools/travis/print-errors-from-test-reports.py
dev-tools/travis/print-errors-from-test-reports.py
#!/usr/bin/python # -*- coding: utf-8 -*- # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed t...
#!/usr/bin/python # -*- coding: utf-8 -*- # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed t...
apache-2.0
Python
8c9da7ada644e806926937087d6b4b06e5b62d54
Allow publish_trajectory to be gracefully interrupted without killing kernel
openhumanoids/exotica,openhumanoids/exotica,openhumanoids/exotica,openhumanoids/exotica
exotica_python/src/pyexotica/publish_trajectory.py
exotica_python/src/pyexotica/publish_trajectory.py
from time import sleep import matplotlib.pyplot as plt import signal def sigIntHandler(signal, frame): raise KeyboardInterrupt def publishPose(q, problem, t=0.0): problem.getScene().Update(q, t) problem.getScene().getSolver().publishFrames() def publishTrajectory(traj, T, problem): signal.signal(s...
#!/usr/bin/env python from time import sleep import matplotlib.pyplot as plt import signal trajectoryPlaybackIsShutdown = False def sigIntHandler(signal, frame): global trajectoryPlaybackIsShutdown trajectoryPlaybackIsShutdown = True raise KeyboardInterrupt def is_shutdown(): signal.signal(signal.SI...
bsd-3-clause
Python
f92d054a6ea8db18ef225b75af34aafb045d3492
Add DOCUMENTS_URL to config
alphagov/digitalmarketplace-admin-frontend,mtekel/digitalmarketplace-admin-frontend,alphagov/digitalmarketplace-admin-frontend,alphagov/digitalmarketplace-admin-frontend,mtekel/digitalmarketplace-admin-frontend,mtekel/digitalmarketplace-admin-frontend,mtekel/digitalmarketplace-admin-frontend,alphagov/digitalmarketplace...
config.py
config.py
import os import jinja2 basedir = os.path.abspath(os.path.dirname(__file__)) class Config(object): DEBUG = True S3_DOCUMENT_BUCKET = os.getenv('DM_S3_DOCUMENT_BUCKET') DOCUMENTS_URL = 'https://assets.dev.digitalmarketplace.service.gov.uk' API_URL = os.getenv('DM_API_URL') API_AUTH_TOKEN = os.gete...
import os import jinja2 basedir = os.path.abspath(os.path.dirname(__file__)) class Config(object): DEBUG = True S3_DOCUMENT_BUCKET = os.getenv('DM_S3_DOCUMENT_BUCKET') API_URL = os.getenv('DM_API_URL') API_AUTH_TOKEN = os.getenv('DM_ADMIN_FRONTEND_API_AUTH_TOKEN') BASE_TEMPLATE_DATA = {} SECR...
mit
Python
0cb45bbc1c7b6b5f1a2722e85159b97c8a555e0c
Update the docblock of the example
ets-labs/dependency_injector,rmk135/dependency_injector,ets-labs/python-dependency-injector,rmk135/objects
examples/providers/factory_deep_init_injections.py
examples/providers/factory_deep_init_injections.py
"""`Factory` providers - building a complex object graph with deep init injections example.""" from dependency_injector import providers class Regularizer: def __init__(self, alpha): self.alpha = alpha class Loss: def __init__(self, regularizer): self.regularizer = regularizer class Class...
"""`Factory` providers deep init injections example.""" from dependency_injector import providers class Regularizer: def __init__(self, alpha): self.alpha = alpha class Loss: def __init__(self, regularizer): self.regularizer = regularizer class ClassificationTask: def __init__(self, l...
bsd-3-clause
Python
b98839de990e3c4b1cd1a5730df512c2f9bc472a
add test models
LegoStormtroopr/django-spaghetti-and-meatballs,LegoStormtroopr/django-spaghetti-and-meatballs
django_spaghetti/tests/models.py
django_spaghetti/tests/models.py
from django.db import models class PoliceOfficer(models.Model): """ An officer of the NYPD """ badge_number = models.IntegerField(max_length=10, primary_key=True) first_name = models.CharField(max_length=200) surname = models.CharField(max_length=200) rank = models.CharField(max_length=200)...
from django.db import models class PoliceOfficer(models.Model): """ An officer of the NYPD """ badge_number = models.IntegerField(max_length=10, primary_key=True) first_name = models.CharField(max_length=200) surname = models.CharField(max_length=200) rank = models.CharField(max_length=200)...
mit
Python
2e69a9d7512faed13d876d4f58375fbb454e7fcb
test to get_group method use of mock
Jarsa/addons-jarsa,odoo-jarsa/addons-jarsa,odoo-jarsa/addons-jarsa,Jarsa/addons-jarsa,Jarsa-dev/addons-jarsa,Jarsa-dev/addons-jarsa
connector_cva/tests/test_cva_config_settings.py
connector_cva/tests/test_cva_config_settings.py
# -*- coding: utf-8 -*- # © <2016> <Jarsa Sistemas, S.A. de C.V.> # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from openerp.tests.common import TransactionCase from mock import MagicMock from lxml import etree class TestCvaConfigSettings(TransactionCase): """ This will test model cva ...
# -*- coding: utf-8 -*- # © <2016> <Jarsa Sistemas, S.A. de C.V.> # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from openerp.tests.common import TransactionCase class TestCvaConfigSettings(TransactionCase): """ This will test model cva config settings """ def setUp(self): ...
agpl-3.0
Python
e394d8b0550c0398d96b01ff3d49bb1e7b692908
Bump version
thombashi/DateTimeRange
datetimerange/__version__.py
datetimerange/__version__.py
# encoding: utf-8 from datetime import datetime __author__ = "Tsuyoshi Hombashi" __copyright__ = "Copyright 2016-{}, {}".format(datetime.now().year, __author__) __license__ = "MIT License" __version__ = "0.6.1" __maintainer__ = __author__ __email__ = "tsuyoshi.hombashi@gmail.com"
# encoding: utf-8 from datetime import datetime __author__ = "Tsuyoshi Hombashi" __copyright__ = "Copyright 2016-{}, {}".format(datetime.now().year, __author__) __license__ = "MIT License" __version__ = "0.6.0" __maintainer__ = __author__ __email__ = "tsuyoshi.hombashi@gmail.com"
mit
Python
945a90c7e1ad379b8310382ce7ceb61cf79f1e1d
make config.py output directly applicable
b3yond/ticketfrei,b3yond/ticketfrei,b3yond/ticketfrei
config.py
config.py
import pytoml as toml import os def load_env(): """ load environment variables from the environment. If empty, use default values from config.toml.example. :return: config dictionary of dictionaries. """ with open('config.toml.example') as defaultconf: configdict = toml.load(defaultco...
import pytoml as toml import os def load_env(): """ load environment variables from the environment. If empty, use default values from config.toml.example. :return: config dictionary of dictionaries. """ with open('config.toml.example') as defaultconf: configdict = toml.load(defaultco...
isc
Python
83d0f621daa538524f381408081a86fcd7412573
Improve YAML examples - windows/win_iis_webapplication.py (#19402)
thaim/ansible,thaim/ansible
lib/ansible/modules/windows/win_iis_webapplication.py
lib/ansible/modules/windows/win_iis_webapplication.py
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Henrik Wallström <henrik@wallstroms.nu> # # 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 t...
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Henrik Wallström <henrik@wallstroms.nu> # # 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 t...
mit
Python
913ecdd419943af603f4556e4f44c5b59df17462
Improve plan filters
globocom/database-as-a-service,globocom/database-as-a-service,globocom/database-as-a-service,globocom/database-as-a-service
dbaas/physical/admin/plan.py
dbaas/physical/admin/plan.py
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from django.contrib import admin from django_services import admin as services_admin from ..service.plan import PlanService from ..models import PlanAttribute from dbaas_cloudstack.models import PlanAttr from dbaas_nfsaas.models import Pla...
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from django.contrib import admin from django_services import admin as services_admin from ..service.plan import PlanService from ..models import PlanAttribute from dbaas_cloudstack.models import PlanAttr from dbaas_nfsaas.models import Pla...
bsd-3-clause
Python
a4603e1233aaf816d68c10376799679ae36b4e42
use string format to generate cache key
jairhenrique/django-elephant
elephant/keys.py
elephant/keys.py
# -*- coding: utf-8 -*- from collections import OrderedDict import inspect def _namespace(obj): module = obj.__module__ or __name__ if hasattr(obj, '__qualname__'): name = obj.__qualname__ return '.'.join((module, name)) klass = getattr(obj, '__self__', None) if klass and not inspec...
# -*- coding: utf-8 -*- from collections import OrderedDict import inspect def _namespace(obj): module = obj.__module__ or __name__ if hasattr(obj, '__qualname__'): name = obj.__qualname__ return '.'.join((module, name)) klass = getattr(obj, '__self__', None) if klass and not inspec...
bsd-2-clause
Python
465c36fddb0727622a901ead3a0c936aa13b56ce
Disable CSRF_TOKEN in config.py
lasa/website,lasa/website,lasa/website
config.py
config.py
import os basedir = os.path.abspath(os.path.dirname(__file__)) WTF_CSRF_ENABLED = False SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(basedir, 'app.db') SQLALCHEMY_MIGRATE_REPO = os.path.join(basedir, 'db_repository')
import os basedir = os.path.abspath(os.path.dirname(__file__)) SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(basedir, 'app.db') SQLALCHEMY_MIGRATE_REPO = os.path.join(basedir, 'db_repository')
agpl-3.0
Python