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
b7db8dd62a323b2f6707c2e660acd94471037f10
Add configuration url to Surepetcare (#58039)
aronsky/home-assistant,home-assistant/home-assistant,toddeye/home-assistant,aronsky/home-assistant,rohitranjan1991/home-assistant,jawilson/home-assistant,jawilson/home-assistant,nkgilley/home-assistant,lukas-hetzenecker/home-assistant,GenericStudent/home-assistant,GenericStudent/home-assistant,lukas-hetzenecker/home-as...
homeassistant/components/surepetcare/entity.py
homeassistant/components/surepetcare/entity.py
"""Entity for Surepetcare.""" from __future__ import annotations from abc import abstractmethod from surepy.entities import SurepyEntity from homeassistant.core import callback from homeassistant.helpers.entity import DeviceInfo from homeassistant.helpers.update_coordinator import CoordinatorEntity from . import Su...
"""Entity for Surepetcare.""" from __future__ import annotations from abc import abstractmethod from surepy.entities import SurepyEntity from homeassistant.core import callback from homeassistant.helpers.entity import DeviceInfo from homeassistant.helpers.update_coordinator import CoordinatorEntity from . import Su...
apache-2.0
Python
2a772ed74613d8842de2efb10282830c9b368174
Add new layers to docs_api. Change: 128179419
jeffzheng1/tensorflow,aselle/tensorflow,ppwwyyxx/tensorflow,manipopopo/tensorflow,ran5515/DeepDecision,freedomtan/tensorflow,eaplatanios/tensorflow,arborh/tensorflow,dongjoon-hyun/tensorflow,ZhangXinNan/tensorflow,Bismarrck/tensorflow,SnakeJenny/TensorFlow,jart/tensorflow,Intel-Corporation/tensorflow,cxxgtxy/tensorflow...
tensorflow/contrib/layers/__init__.py
tensorflow/contrib/layers/__init__.py
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
Python
f247e3d31b25908a46cb64754166fca2a421edd9
Update P1_lookingBusy.py added docstring
JoseALermaIII/python-tutorials,JoseALermaIII/python-tutorials
pythontutorials/books/AutomateTheBoringStuff/Ch18/Projects/P1_lookingBusy.py
pythontutorials/books/AutomateTheBoringStuff/Ch18/Projects/P1_lookingBusy.py
"""Looking busy Write a script to nudge your mouse cursor slightly every ten seconds. The nudge should be small enough so that it won’t get in the way if you do happen to need to use your computer while the script is running. """ import pyautogui, time def main(): while True: time.sleep(10) pya...
# Write a script to nudge your mouse cursor slightly every ten seconds. # The nudge should be small enough so that it won’t get in the way if # you do happen to need to use your computer while the script is running. import pyautogui, time def main(): while True: time.sleep(10) pyautogui.moveRel(1...
mit
Python
e8e3a7daaa1e6afc4c8f9853f6db77dcd557f4d3
Call 'lower()' on the input
instagrambot/instabot,ohld/instabot,instagrambot/instabot
examples/black-whitelist/whitelist_generator.py
examples/black-whitelist/whitelist_generator.py
""" instabot example Whitelist generator: generates a list of users which will not be unfollowed. """ import sys import os import random sys.path.append(os.path.join(sys.path[0], '../../')) from instabot import Bot bot = Bot() bot.login() print("This script will generate whitelist.txt file with users" ...
""" instabot example Whitelist generator: generates a list of users which will not be unfollowed. """ import sys import os import random sys.path.append(os.path.join(sys.path[0], '../../')) from instabot import Bot bot = Bot() bot.login() print("This script will generate whitelist.txt file with users" ...
apache-2.0
Python
c2bbc9b3c977377083dacf475715ed38a6def539
Update package_utils.py
inetprocess/docker-lamp,inetprocess/docker-lamp,edyan/stakkr,edyan/stakkr,inetprocess/docker-lamp,edyan/stakkr
stakkr/package_utils.py
stakkr/package_utils.py
"""Gives useful information about the current virtualenv, files locations if stakkr is installed as a package or directly cloned""" import os import sys from distutils.sysconfig import get_config_vars, get_python_lib def get_venv_basedir(): """Returns the base directory of the virtualenv, useful to read configur...
"""Gives useful information about the current virtualenv, files locations if stakkr is installed as a package or directly cloned""" import os import sys from distutils.sysconfig import get_config_vars, get_python_lib def get_venv_basedir(): """Returns the base directory of the virtualenv, useful to read configur...
apache-2.0
Python
9917150d995bcb4956afdec73256319bd7d042d4
Update ELU layer
explosion/thinc,explosion/thinc,spacy-io/thinc,explosion/thinc,explosion/thinc,spacy-io/thinc,spacy-io/thinc
thinc/neural/_classes/elu.py
thinc/neural/_classes/elu.py
from .affine import Affine from ... import describe from ...describe import Dimension, Synapses, Biases class ELU(Affine): def predict(self, input__BI): output__BO = Affine.predict(self, input__BI) self.ops.elu(output__BO, inplace=True) return output__BO def begin_update(self, input__...
from .affine import Affine from ... import describe from ...describe import Dimension, Synapses, Biases class ELU(Affine): def predict(self, input__BI): output__BO = Affine.predict(self, input__BI) self.ops.elu(output__BO, inplace=True) return output__BO def begin_update(self, input__...
mit
Python
02616c3edbe3cd5abf18cc9b8ece7e627898776b
Fix RemovedInDjango19Warning
HonzaKral/django-threadedcomments,HonzaKral/django-threadedcomments
threadedcomments/__init__.py
threadedcomments/__init__.py
""" Change the attributes you want to customize """ # following PEP 440 __version__ = "1.0" def get_model(): from threadedcomments.models import ThreadedComment return ThreadedComment def get_form(): from threadedcomments.forms import ThreadedCommentForm return ThreadedCommentForm
""" Change the attributes you want to customize """ from threadedcomments.models import ThreadedComment from threadedcomments.forms import ThreadedCommentForm # following PEP 440 __version__ = "1.0" def get_model(): return ThreadedComment def get_form(): return ThreadedCommentForm
bsd-3-clause
Python
b575ea3b68cdc8022e4490217a5321f6da75bb1f
Fix to function to check if grid engine is present
benedictpaten/jobTree,BD2KGenomics/slugflow,cooketho/jobTree,BD2KGenomics/toil-old,BD2KGenomics/slugflow,harvardinformatics/jobTree
src/common.py
src/common.py
"""Wrapper functions for running the various programs in the jobTree package. """ #Copyright (C) 2011 by Benedict Paten (benedictpaten@gmail.com) # #Permission is hereby granted, free of charge, to any person obtaining a copy #of this software and associated documentation files (the "Software"), to deal #in the Softwa...
"""Wrapper functions for running the various programs in the jobTree package. """ #Copyright (C) 2011 by Benedict Paten (benedictpaten@gmail.com) # #Permission is hereby granted, free of charge, to any person obtaining a copy #of this software and associated documentation files (the "Software"), to deal #in the Softwa...
mit
Python
40aae5592603005a84ee2222eaa07a879f99309d
fix test
aleneum/kogniserver,aleneum/kogniserver
tests/test_bridge.py
tests/test_bridge.py
# -*- coding: utf-8 -*- from unittest import TestCase from kogniserver.services import create_rsb_config from kogniserver.pubsub import PubSubBridge from mock import MagicMock class TestKogniServerBridge(TestCase): def setUp(self): self.config = create_rsb_config() def tearDown(self): self....
# -*- coding: utf-8 -*- from unittest import TestCase from kogniserver.services import create_rsb_config, Bridge from mock import MagicMock class TestKogniServerBridge(TestCase): def setUp(self): self.config = create_rsb_config() def tearDown(self): self.b.deactivate() #def __init__(se...
mit
Python
aee7b9b50c27bc9f645316c9422b3b187e54e192
set backend to avoid errors in Travis
mroberge/hydrofunctions
tests/test_charts.py
tests/test_charts.py
# -*- coding: utf-8 -*- """ test_charts.py Tests for the charts.py module. """ from __future__ import absolute_import, print_function import unittest import matplotlib # Recommended that I use this line to avoid errors in TravisCI # See https://matplotlib.org/faq/howto_faq.html # Basically, matplotlib usually uses an ...
# -*- coding: utf-8 -*- """ test_charts.py Tests for the charts.py module. """ from __future__ import absolute_import, print_function import unittest import matplotlib import pandas as pd from hydrofunctions import charts dummy = {'col1': [1, 2, 3, 38, 23, 1, 19], 'col2': [3, 4, 45, 23, 2, 4, 76]} class T...
mit
Python
7faffbef68faf268bd310d07df1c24368379dfb9
Fix PEP8 for errorck
aidancully/rust,jashank/rust,mdinger/rust,carols10cents/rust,XMPPwocky/rust,hauleth/rust,aidancully/rust,AerialX/rust-rt-minimal,miniupnp/rust,aneeshusa/rust,philyoon/rust,mdinger/rust,mvdnes/rust,richo/rust,sae-bom/rust,rprichard/rust,zachwick/rust,bombless/rust,TheNeikos/rust,mahkoh/rust,untitaker/rust,TheNeikos/rust...
src/etc/errorck.py
src/etc/errorck.py
# Copyright 2015 The Rust Project Developers. See the COPYRIGHT # file at the top-level directory of this distribution and at # http://rust-lang.org/COPYRIGHT. # # Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or # http://www.apache.org/licenses/LICENSE-2.0> or the MIT license # <LICENSE-MIT or http://...
# Copyright 2015 The Rust Project Developers. See the COPYRIGHT # file at the top-level directory of this distribution and at # http://rust-lang.org/COPYRIGHT. # # Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or # http://www.apache.org/licenses/LICENSE-2.0> or the MIT license # <LICENSE-MIT or http://...
apache-2.0
Python
e0c0b7676d9e1f2a05610c04c41959ea678c6d8b
Adjust startChar and endChar indices
clarinsi/reldi-lib
restore_all.py
restore_all.py
#!/usr/bin/python from reldi.restorer import DiacriticRestorer from getpass import getpass import json import argparse import os user='user' coding='utf8' def write(result,file): final=set() text=result['text'] for token,norm in zip(result['tokens']['token'],result['orthography']['correction']): if...
#!/usr/bin/python from reldi.restorer import DiacriticRestorer from getpass import getpass import json import argparse import os user='user' coding='utf8' def write(result,file): final=set() text=result['text'] for token,norm in zip(result['tokens']['token'],result['orthography']['correction']): if...
apache-2.0
Python
9868cd4e810d6545d292fe1480d8fa413d00a8cd
truncate long title
hasgeek/funnel,hasgeek/funnel,hasgeek/funnel,hasgeek/funnel,hasgeek/funnel
funnel/extapi/boxoffice.py
funnel/extapi/boxoffice.py
# -*- coding: utf-8 -*- import requests from ..util import extract_twitter_handle from .. import app __all__ = ['Boxoffice'] class Boxoffice(object): """ An interface that enables data retrieval from Boxoffice. """ def __init__(self, access_token): self.access_token = access_token se...
# -*- coding: utf-8 -*- import requests from ..util import extract_twitter_handle from .. import app __all__ = ['Boxoffice'] class Boxoffice(object): """ An interface that enables data retrieval from Boxoffice. """ def __init__(self, access_token): self.access_token = access_token se...
agpl-3.0
Python
13bb256fade89f3882d0a08786f4cb02dbdcaed4
Fix multidispatch type inference for Group
amolenaar/gaphor,amolenaar/gaphor
gaphor/diagram/grouping.py
gaphor/diagram/grouping.py
""" Grouping functionality allows to nest one item within another item (parent item). This is useful in several use cases - artifact deployed within a node - a class within a package or a component - composite structures (i.e. component within a node) The grouping adapters has to implement three methods, see `Abstrac...
""" Grouping functionality allows to nest one item within another item (parent item). This is useful in several use cases - artifact deployed within a node - a class within a package or a component - composite structures (i.e. component within a node) The grouping adapters has to implement three methods, see `Abstrac...
lgpl-2.1
Python
518711c908eece77f0f989930fdbada5a01797d6
Convert test_people.py to py.test test functions
edx/repo-tools,edx/repo-tools
tests/test_people.py
tests/test_people.py
"""Tests of people.py""" import datetime from people import People SAMPLE_PEOPLE = """\ ned: institution: edX before: 2012-10-01: institution: freelance 2010-12-01: institution: Hewlett Packard 2007-05-01: institution: Tabblo 2006-01-09: ...
"""Tests of people.py""" import datetime import unittest from people import People SAMPLE_PEOPLE = """\ ned: institution: edX before: 2012-10-01: institution: freelance 2010-12-01: institution: Hewlett Packard 2007-05-01: institution: Tabblo ...
apache-2.0
Python
60056d8573d4c8a9f69dc7f3e41af91ca79c9e8b
Remove an unnecessary call to pyramid.threadlocal.get_current_request()
fedora-infra/github2fedmsg,pombredanne/github2fedmsg,fedora-infra/github2fedmsg,pombredanne/github2fedmsg
github2fedmsg/traversal.py
github2fedmsg/traversal.py
from hashlib import md5 import tw2.core as twc import github2fedmsg.models import github2fedmsg.widgets from pyramid.security import authenticated_userid def make_root(request): return RootApp(request) class RootApp(dict): __name__ = None __parent__ = None def __init__(self, request): dict...
from hashlib import md5 import tw2.core as twc import github2fedmsg.models import github2fedmsg.widgets import pyramid.threadlocal from pyramid.security import authenticated_userid def make_root(request): return RootApp(request) class RootApp(dict): __name__ = None __parent__ = None def __init__(s...
agpl-3.0
Python
9812fce48153955e179755ea7a58413c3bee182f
Update stamp.py
ralphwetzel/theonionbox,ralphwetzel/theonionbox,ralphwetzel/theonionbox,ralphwetzel/theonionbox,ralphwetzel/theonionbox
theonionbox/stamp.py
theonionbox/stamp.py
__title__ = 'The Onion Box' __description__ = 'Dashboard to monitor Tor node operations.' __version__ = '20.2' __stamp__ = '20200119|095654'
__title__ = 'The Onion Box' __description__ = 'Dashboard to monitor Tor node operations.' __version__ = '20.2rc1' __stamp__ = '20200119|095654'
mit
Python
56bc9c79522fd534f2a756bd5a18193635e2adae
Fix missing mock and rename variable
gogoair/foremast,gogoair/foremast
tests/test_default_security_groups.py
tests/test_default_security_groups.py
"""Test default Security Groups.""" from unittest import mock from foremast.securitygroup.create_securitygroup import SpinnakerSecurityGroup @mock.patch('foremast.securitygroup.create_securitygroup.get_details') @mock.patch('foremast.securitygroup.create_securitygroup.get_properties') def test_default_security_group...
"""Test default Security Groups.""" from unittest import mock from foremast.securitygroup.create_securitygroup import SpinnakerSecurityGroup @mock.patch('foremast.securitygroup.create_securitygroup.get_properties') def test_default_security_groups(mock_properties): """Make sure default Security Groups are added ...
apache-2.0
Python
6cf4901344033b50c6e56a9c878a7e89f33d3880
Fix 2to3 fixers to work with Python 3.
ProgVal/Limnoria-test,Ban3/Limnoria,ProgVal/Limnoria-test,Ban3/Limnoria
2to3/fix_reload.py
2to3/fix_reload.py
# Based on fix_intern.py. Original copyright: # Copyright 2006 Georg Brandl. # Licensed to PSF under a Contributor Agreement. """Fixer for intern(). intern(s) -> sys.intern(s)""" # Local imports from lib2to3 import pytree from lib2to3 import fixer_base from lib2to3.fixer_util import Name, Attr, touch_import class ...
# Based on fix_intern.py. Original copyright: # Copyright 2006 Georg Brandl. # Licensed to PSF under a Contributor Agreement. """Fixer for intern(). intern(s) -> sys.intern(s)""" # Local imports from lib2to3 import pytree from lib2to3 import fixer_base from lib2to3.fixer_util import Name, Attr, touch_import class ...
bsd-3-clause
Python
c1a291c362df384b11bdc9b829b75c5ecd505aa9
add config for new session cam
BerlinUnited/NaoTH,BerlinUnited/NaoTH,BerlinUnited/NaoTH,BerlinUnited/NaoTH,BerlinUnited/NaoTH,BerlinUnited/NaoTH,BerlinUnited/NaoTH
Utils/py/GoPro/config.py
Utils/py/GoPro/config.py
from goprocam.constants import * # NaoCam / a1b0a1b0a1 # NAOCAM_2 / a1b0a1b0a1 # NAOCAM_3 / a1b0a1b0a1 # GP26329941 / family3887 / D6:B9:D4:D7:B7:40 # GP26297683 / epic0546 / F8:D2:E9:F0:AC:0B ssid = 'GP26329941' passwd = 'family3887' mac = 'D6:B9:D4:D7:B7:40' retries = -1 # if the following configs are set, the ca...
from goprocam.constants import * # NaoCam / a1b0a1b0a1 # NAOCAM_2 / a1b0a1b0a1 # GP26329941 / family3887 / D6:B9:D4:D7:B7:40 # GP26297683 / epic0546 / F8:D2:E9:F0:AC:0B ssid = 'GP26329941' passwd = 'family3887' mac = 'D6:B9:D4:D7:B7:40' retries = -1 # if the following configs are set, the cam tries to set them befo...
apache-2.0
Python
fb1d55de93ae2ef49feea278a4c99013a690c858
Fix unicode_literals issue
theatlantic/django-south,theatlantic/django-south
south/utils/__init__.py
south/utils/__init__.py
""" Generally helpful utility functions. """ def _ask_for_it_by_name(name): "Returns an object referenced by absolute path." bits = str(name).split(".") ## what if there is no absolute reference? if len(bits) > 1: modulename = ".".join(bits[:-1]) else: modulename = bits[0] mo...
""" Generally helpful utility functions. """ def _ask_for_it_by_name(name): "Returns an object referenced by absolute path." bits = name.split(".") ## what if there is no absolute reference? if len(bits)>1: modulename = ".".join(bits[:-1]) else: modulename=bits[0] module = __...
apache-2.0
Python
ec5d0bde476e71ff26a6f249017abef86781144f
Load 'database_backup' model
adhoc-dev/odoo-infrastructure,bmya/odoo-infrastructure,yelizariev/odoo-infrastructure,dvitme/odoo-infrastructure,online-sanaullah/odoo-infrastructure,ingadhoc/infrastructure,ingadhoc/odoo-infrastructure,fevxie/odoo-infrastructure,aek/odoo-infrastructure,steingabelgaard/odoo-infrastructure
infrastructure/__init__.py
infrastructure/__init__.py
# -*- coding: utf-8 -*- import command import database import database_type import database_backup import db_back_up_policy import db_filter import environment import environment_repository import environment_version import instance import instance_host import mailserver import partner import repository import reposit...
# -*- coding: utf-8 -*- import command import database import database_type import db_back_up_policy import db_filter import environment import environment_repository import environment_version import instance import instance_host import mailserver import partner import repository import repository_branch import serve...
agpl-3.0
Python
3bbcdc74ad277c71cdb08bedd5e1da0eeddc436e
Add delete override for Submission model with directory path debug msg
ktalik/django-subeval,ktalik/django-subeval
submission/models.py
submission/models.py
import time import uuid import shutil from django.db import models from django.template.defaultfilters import filesizeformat from django.contrib.auth.models import User from django.utils import timezone from django.utils.translation import ugettext_lazy as _ import forms DB_NAME_LENGTH = 100 class Team(models.Mod...
import time import uuid from django.db import models from django.template.defaultfilters import filesizeformat from django.contrib.auth.models import User from django.utils import timezone from django.utils.translation import ugettext_lazy as _ import forms DB_NAME_LENGTH = 100 class Team(models.Model): id = ...
agpl-3.0
Python
515e1dc6fd3741afe8df7ce7a7c94b1ffa2db8c3
Remove useless imports from `tmserver/__init__.py`
TissueMAPS/TmServer
tmserver/__init__.py
tmserver/__init__.py
# TmServer - TissueMAPS server application. # Copyright (C) 2016 Markus D. Herrmann, University of Zurich and Robin Hafen # # 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...
# TmServer - TissueMAPS server application. # Copyright (C) 2016 Markus D. Herrmann, University of Zurich and Robin Hafen # # 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...
agpl-3.0
Python
d53d344e770bbeeb839323500f526400692e554b
Fix test failing on Python 2.7
h2oai/h2o-3,h2oai/h2o-3,michalkurka/h2o-3,h2oai/h2o-3,michalkurka/h2o-3,michalkurka/h2o-3,michalkurka/h2o-3,michalkurka/h2o-3,michalkurka/h2o-3,h2oai/h2o-3,h2oai/h2o-3,michalkurka/h2o-3,h2oai/h2o-3,h2oai/h2o-3,h2oai/h2o-3
h2o-py/tests/testdir_jira/pyunit_pubdev_6394.py
h2o-py/tests/testdir_jira/pyunit_pubdev_6394.py
# -*- coding: utf-8 -*- from h2o import H2OFrame from tests import pyunit_utils def pubdev_6394(): # JUnit tests are to be found in RapidsTest class data = [['location'], ['X県 A市'], ['X県 B市'], ['X県 B市'], ['Y県 C市'], ['Y県 C市']] original...
from h2o import H2OFrame from tests import pyunit_utils def pubdev_6394(): # JUnit tests are to be found in RapidsTest class data = [['location'], ['X県 A市'], ['X県 B市'], ['X県 B市'], ['Y県 C市'], ['Y県 C市']] originalFrame = H2OFrame(data, he...
apache-2.0
Python
6e000645b909970416fbe9f1b37af658eee5202a
Update event.py
davidbstein/moderator,davidbstein/moderator,davidbstein/moderator,davidbstein/moderator
src/model/event.py
src/model/event.py
import secure from model.helpers import ( r2d, DB, PermissionError, ) from model.user import User from model.org import Org class Event: def __init__(self): raise Exception("This class is a db wrapper and should not be instantiated.") @classmethod def get(cls, event_id, user_email, **__): user = ...
import secure from model.helpers import ( r2d, DB, PermissionError, ) from model.user import User from model.org import Org class Event: def __init__(self): raise Exception("This class is a db wrapper and should not be instantiated.") @classmethod def get(cls, event_id, user_email, **__): user = ...
mit
Python
1ddfee2d2db59e8f188e26daf098186600cebd50
add __repr__()
TaiSakuma/AlphaTwirl,alphatwirl/alphatwirl,alphatwirl/alphatwirl,alphatwirl/alphatwirl,TaiSakuma/AlphaTwirl,alphatwirl/alphatwirl
AlphaTwirl/ProgressBar/ProgressBar.py
AlphaTwirl/ProgressBar/ProgressBar.py
# Tai Sakuma <tai.sakuma@cern.ch> import time import sys, collections ##__________________________________________________________________|| class ProgressBar(object): def __init__(self): self.reports = collections.OrderedDict() self.lines = [ ] self.interval = 0.1 # [second] self._...
# Tai Sakuma <tai.sakuma@cern.ch> import time import sys, collections ##__________________________________________________________________|| class ProgressBar(object): def __init__(self): self.reports = collections.OrderedDict() self.lines = [ ] self.interval = 0.1 # [second] self._...
bsd-3-clause
Python
28bf23ef6e76c076243153affec2a4ccef04c306
add util to print lexer output.
abadger/Bento,abadger/Bento,cournape/Bento,cournape/Bento,abadger/Bento,cournape/Bento,abadger/Bento,cournape/Bento
toydist/core/parser/utils.py
toydist/core/parser/utils.py
# Generator to enable "peeking" the next item: # >>> a = [1, 2, 3, 4] # >>> peeker = Peeker(a) # >>> for i in peeker: # >>> try: # >>> next = peeker.peek() # >>> print "Next to %d is %d" % (i, next) # >>> except StopIteration: # >>> print "End of stream", i # >>> class Peeker(ob...
# Generator to enable "peeking" the next item: # >>> a = [1, 2, 3, 4] # >>> peeker = Peeker(a) # >>> for i in peeker: # >>> try: # >>> next = peeker.peek() # >>> print "Next to %d is %d" % (i, next) # >>> except StopIteration: # >>> print "End of stream", i # >>> class Peeker(ob...
bsd-3-clause
Python
b438da2080f06e319ecd70fc771a934e3ce53044
Fix Organization API reference
jphnoel/udata,etalab/udata,grouan/udata,davidbgk/udata,opendatateam/udata,etalab/udata,grouan/udata,jphnoel/udata,opendatateam/udata,grouan/udata,davidbgk/udata,jphnoel/udata,etalab/udata,davidbgk/udata,opendatateam/udata
udata/core/organization/api_fields.py
udata/core/organization/api_fields.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from flask import url_for from udata.api import api, pager, fields from .models import ORG_ROLES, MEMBERSHIP_STATUS @api.model(fields={ 'id': fields.String(description='The organization identifier', required=True), 'name': fields.String(descri...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from flask import url_for from udata.api import api, pager, fields from .models import ORG_ROLES, MEMBERSHIP_STATUS @api.model(fields={ 'id': fields.String(description='The organization identifier', required=True), 'name': fields.String(descri...
agpl-3.0
Python
9bac47925e604a92df068f8644559741dc24769c
clean up
JonathanPetit/MovieSerieTorrent
src/renamer.py
src/renamer.py
from parser import Parser import os class Renamer: def __init__(self): self.infos = None self.excess = None self.parse_file = None self.rename_file = [] self.compteur = 0 self.filename = None def rename(self, files): self.parse_file = Parser().parse(fil...
from parser import Parser import os class Renamer: def __init__(self): self.infos = None self.excess = None self.parse_file = None self.rename_file = [] self.compteur = 0 self.filename = None def rename(self, files): self.parse_file = Parser().parse(f...
mit
Python
c6df07ce73063ab8bbf1ed9660fa6d37580ab2f1
Update version
woefe/studip-sync,popeye123/studip-sync
studip_sync/__init__.py
studip_sync/__init__.py
"""Stud.IP file synchronization tool. A command line tool that keeps track of new files on Stud.IP and downloads them to your computer. """ __license__ = "Unlicense" __version__ = "2.0.0" __author__ = __maintainer__ = "Wolfgang Popp" __email__ = "mail@wolfgang-popp.de" def _get_config_path(): import os pref...
"""Stud.IP file synchronization tool. A command line tool that keeps track of new files on Stud.IP and downloads them to your computer. """ __license__ = "Unlicense" __version__ = "0.4.0" __author__ = __maintainer__ = "Wolfgang Popp" __email__ = "mail@wolfgang-popp.de" def _get_config_path(): import os pref...
unlicense
Python
57882e6754f6d5897690c97dfda2db371989206e
Fix test ModifiedHamiltonianExchange resuming
andrrizzi/yank,andrrizzi/yank,andrrizzi/yank,choderalab/yank,choderalab/yank
Yank/tests/test_sampling.py
Yank/tests/test_sampling.py
#!/usr/local/bin/env python """ Test sampling.py facility. """ # ============================================================================== # GLOBAL IMPORTS # ============================================================================== from openmmtools import testsystems from mdtraj.utils import enter_temp_di...
#!/usr/local/bin/env python """ Test sampling.py facility. """ # ============================================================================== # GLOBAL IMPORTS # ============================================================================== from openmmtools import testsystems from mdtraj.utils import enter_temp_di...
mit
Python
3ec0f7fa6ee03052118d7d7e6db257f903ce8748
Fix capitalization to default style.
instana/python-sensor,instana/python-sensor
instana/http_propagator.py
instana/http_propagator.py
from __future__ import absolute_import import opentracing as ot from basictracer.context import SpanContext from instana import util, log prefix_tracer_state = 'X-Instana-' field_name_trace_id = prefix_tracer_state + 'T' field_name_span_id = prefix_tracer_state + 'S' field_count = 2 class HTTPPropagator(): """A ...
from __future__ import absolute_import import opentracing as ot from basictracer.context import SpanContext from instana import util, log prefix_tracer_state = 'X-INSTANA-' field_name_trace_id = prefix_tracer_state + 'T' field_name_span_id = prefix_tracer_state + 'S' field_count = 2 class HTTPPropagator(): """A ...
mit
Python
53790af64ca601832872d3a21ab8264ce4c9be10
Update the build version
vlegoff/cocomud
src/version.py
src/version.py
BUILD = 44
BUILD = 43
bsd-3-clause
Python
c54223c1b4dd8701a49dd47d51d0947d858b7f79
add __unicode__ methods (omg why)
hackerspace-silesia/jakniedojade,hackerspace-silesia/jakniedojade,hackerspace-silesia/jakniedojade
jakniedojade/app/models.py
jakniedojade/app/models.py
from django.db import models from django_resized import ResizedImageField class Core(models.Model): id = models.AutoField(primary_key=True) last_modified = models.DateTimeField(auto_now=True) created = models.DateTimeField(auto_now_add=True) class Meta: abstract = True class Image(Core): ...
from django.db import models from django_resized import ResizedImageField class Core(models.Model): id = models.AutoField(primary_key=True) last_modified = models.DateTimeField(auto_now=True) created = models.DateTimeField(auto_now_add=True) class Meta: abstract = True class Image(Core): ...
mit
Python
6508db3283ec6d419064e679e1315ffa79765010
Read config from envvar
devxoul/schoool
schoool/app.py
schoool/app.py
# -*- coding: utf-8 -*- import json import os from bs4 import BeautifulSoup from flask import Flask, request, Response import requests from werkzeug.exceptions import default_exceptions from schoool import cache from schoool.views import blueprints def create_app(config=None): app = Flask(__name__) if conf...
# -*- coding: utf-8 -*- import json import os from bs4 import BeautifulSoup from flask import Flask, request, Response import requests from werkzeug.exceptions import default_exceptions from schoool import cache from schoool.views import blueprints def create_app(config=None): app = Flask(__name__) if conf...
mit
Python
c2f480cf1709b06cfe7b1373165efa968e4096e3
bump version number
AcademicTorrents/python-r-api
academictorrents/version.py
academictorrents/version.py
__version__ = "2.0.12"
__version__ = "2.0.11"
mit
Python
0823c5266caf97f05524b1ff3b1e7f99f95e1911
make shell context
varnish/varnish-microservice-monitor,varnish/varnish-microservice-monitor,varnish/zipnish,varnish/varnish-microservice-monitor,varnish/zipnish,varnish/zipnish,varnish/varnish-microservice-monitor,varnish/varnish-microservice-monitor,varnish/zipnish,varnish/zipnish
ui/manage.py
ui/manage.py
#!/usr/bin/env python import os from app import create_app from flask.ext.script import Shell, Manager app = create_app(os.getenv('APP_CONFIG') or 'default') manager = Manager(app) def make_shell_context(): return dict(app=app) if __name__ == '__main__': manager.run()
#!/usr/bin/env python import os from app import create_app from flask.ext.script import Shell, Manager app = create_app(os.getenv('APP_CONFIG') or 'default') manager = Manager(app) if __name__ == '__main__': manager.run()
bsd-2-clause
Python
3b94cc59b444e166467e6cb81e2e07e80bdebf28
disable cache-flushing again, leave caching for only 1 hour
total-impact/total-impact-core,Impactstory/total-impact-core,Impactstory/total-impact-core,total-impact/total-impact-core,total-impact/total-impact-core,Impactstory/total-impact-core,total-impact/total-impact-core,Impactstory/total-impact-core
totalimpact/cache.py
totalimpact/cache.py
import os import pylibmc import hashlib import logging import json from cPickle import PicklingError from totalimpact.utils import Retry # set up logging logger = logging.getLogger("ti.cache") class CacheException(Exception): pass class Cache(object): """ Maintains a cache of URL responses in memcached """ ...
import os import pylibmc import hashlib import logging import json from cPickle import PicklingError from totalimpact.utils import Retry # set up logging logger = logging.getLogger("ti.cache") class CacheException(Exception): pass class Cache(object): """ Maintains a cache of URL responses in memcached """ ...
mit
Python
3163d016db3849c3c9e801c1cdb9e6e907afa313
install python files to libxml2 prefix instead of python prefix and ignore non-python files when activating
TheTimmy/spack,skosukhin/spack,EmreAtes/spack,krafczyk/spack,tmerrick1/spack,iulian787/spack,matthiasdiener/spack,iulian787/spack,matthiasdiener/spack,iulian787/spack,TheTimmy/spack,EmreAtes/spack,lgarren/spack,LLNL/spack,EmreAtes/spack,skosukhin/spack,lgarren/spack,TheTimmy/spack,skosukhin/spack,lgarren/spack,krafczyk...
var/spack/packages/libxml2/package.py
var/spack/packages/libxml2/package.py
from spack import * import os class Libxml2(Package): """Libxml2 is the XML C parser and toolkit developed for the Gnome project (but usable outside of the Gnome platform), it is free software available under the MIT License.""" homepage = "http://xmlsoft.org" url = "http://xmlsoft.org/s...
from spack import * class Libxml2(Package): """Libxml2 is the XML C parser and toolkit developed for the Gnome project (but usable outside of the Gnome platform), it is free software available under the MIT License.""" homepage = "http://xmlsoft.org" url = "http://xmlsoft.org/sources/lib...
lgpl-2.1
Python
84929e01bfb9236fd0f51d82ee514d513d018408
Sort dimensins to reduce code
CubicComet/exercism-python-solutions
triangle/triangle.py
triangle/triangle.py
class TriangleError(Exception): pass class Triangle(object): def __init__(self, *dims): if not self.is_valid(dims): raise TriangleError("Invalid dimensions: {}".format(dims)) self.dims = sorted(dims) def kind(self): a, b, c = self.dims if a == b and b == c: # i...
class TriangleError(Exception): pass class Triangle(object): def __init__(self, *dims): if not self.is_valid(dims): raise TriangleError("Invalid dimensions: {}".format(dims)) self.dims = dims def kind(self): a, b, c = self.dims if a == b and b == c: ...
agpl-3.0
Python
45f253560e2c0da9472285fccc7f3cba652fde69
Test fade to white
guglielmino/selfie-o-matic
tasks/task_countdown.py
tasks/task_countdown.py
import sys, os import time try: from picamera.array import PiRGBArray from picamera import PiCamera except: pass import cv2 from cv2 import VideoCapture import numpy as np import logging import settings from PIL import Image from image_lib import overlay_image, overlay_np_image_pi, overlay_pil_image_pi...
import sys, os import time try: from picamera.array import PiRGBArray from picamera import PiCamera except: pass import cv2 from cv2 import VideoCapture import numpy as np import logging import settings from PIL import Image from image_lib import overlay_image, overlay_np_image_pi, overlay_pil_image_pi...
mit
Python
41db16ee01600a14703e68ec9ec529150359c27e
Remove unused import
mesosphere-mergebot/mergebot-test-dcos,dcos/dcos,mesosphere-mergebot/dcos,mesosphere-mergebot/dcos,dcos/dcos,kensipe/dcos,dcos/dcos,kensipe/dcos,dcos/dcos,dcos/dcos,mesosphere-mergebot/dcos,GoelDeepak/dcos,mesosphere-mergebot/mergebot-test-dcos,GoelDeepak/dcos,mesosphere-mergebot/dcos,kensipe/dcos,GoelDeepak/dcos,mesos...
packages/dcos-integration-test/extra/test_metronome.py
packages/dcos-integration-test/extra/test_metronome.py
__maintainer__ = 'ichernetsky' __contact__ = 'marathon-team@mesosphere.io' def test_metronome(dcos_api_session): job = { 'description': 'Test Metronome API regressions', 'id': 'test.metronome', 'run': { 'cmd': 'ls', 'docker': {'image': 'busybox:latest'}, ...
import pytest __maintainer__ = 'ichernetsky' __contact__ = 'marathon-team@mesosphere.io' def test_metronome(dcos_api_session): job = { 'description': 'Test Metronome API regressions', 'id': 'test.metronome', 'run': { 'cmd': 'ls', 'docker': {'image': 'busybox:latest...
apache-2.0
Python
4712e44b11cb7cb276c98691d6de05e21e25d118
improve coverage
chfw/django-excel,fondelsur/todopinturas,chfw/django-excel,fondelsur/todopinturas,fondelsur/todopinturas,fondelsur/todopinturas,chfw/django-excel
django_excel/__init__.py
django_excel/__init__.py
from django.core.files.uploadhandler import MemoryFileUploadHandler, TemporaryFileUploadHandler from django.core.files.uploadedfile import InMemoryUploadedFile, TemporaryUploadedFile from django.http import HttpResponse import pyexcel as pe import pyexcel_webio as webio class ExcelMemoryFile(webio.ExcelInput, InMemor...
from django.core.files.uploadhandler import MemoryFileUploadHandler, TemporaryFileUploadHandler from django.core.files.uploadedfile import InMemoryUploadedFile, TemporaryUploadedFile from django.http import HttpResponse import pyexcel as pe import pyexcel_webio as webio class ExcelMemoryFile(webio.ExcelInput, InMemor...
bsd-3-clause
Python
b143c7ae9bbfa7b67ad5111ffce417f380e7f0ea
Bump version to 1.0a1 for dev.
carljm/django-secure,bocman/django-secure,bocman/django-secure,carljm/django-secure
djangosecure/__init__.py
djangosecure/__init__.py
__version__ = "1.0.a1"
__version__ = "0.1.3"
bsd-3-clause
Python
f085c1eb9fabf2266376b884b414b85575c2677a
update version
bird-house/twitcher,bird-house/pywps-proxy,bird-house/pywps-proxy
twitcher/__init__.py
twitcher/__init__.py
import logging logger = logging.getLogger(__name__) __version__ = '0.3.1' def main(global_config, **settings): """ This function returns a Pyramid WSGI application. """ from pyramid.config import Configurator config = Configurator(settings=settings) # include twitcher components config....
import logging logger = logging.getLogger(__name__) __version__ = '0.3.0' def main(global_config, **settings): """ This function returns a Pyramid WSGI application. """ from pyramid.config import Configurator config = Configurator(settings=settings) # include twitcher components config....
apache-2.0
Python
c6d285dd2a80ae713e1399ce1efaf9b514878755
Fix test
github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql
python/ql/test/library-tests/frameworks/aiopg/test.py
python/ql/test/library-tests/frameworks/aiopg/test.py
import aiopg # Only a cursor can execute sql. async def test_cursor(): # Create connection directly conn = await aiopg.connect() cur = await conn.cursor() await cur.execute("sql") # $ getSql="sql" constructedSql="sql" # Create connection via pool async with aiopg.create_pool() as pool: ...
import aiopg # Only a cursor can execute sql. async def test_cursor(): # Create connection directly conn = await aiopg.connect() cur = await conn.cursor() await cur.execute("sql") # $ getSql="sql" constructedSql="sql" # Create connection via pool async with aiopg.create_pool() as pool: ...
mit
Python
eb34c605fc970a70b9f97a79094997757940c9e8
Fix boilerplate.
whilp/statzlogger
statzlogger.py
statzlogger.py
import logging try: NullHandler = logging.NullHandler except AttributeError: class NullHandler(logging.Handler): def emit(self, record): pass logging.getLogger().addHandler(NullHandler()) class StatsLogger(logging.Logger): """A statistics logger. Methods stolen from szl: ...
import logging try: NullHandler = logging.NullHandler except ImportError: class NullHandler(logging.Handler): def emit(self, record): pass logging.getLogger().addHandler(NullHandler()) class StatsLogger(logging.Logger): """A statistics logger. Methods stolen from szl: col...
isc
Python
426aba0b0fa278e721dfc663db1b60d15dba16d5
Test staticfiles.json beginning string
bulv1ne/django-utils,bulv1ne/django-utils
utils/tests/test_pipeline.py
utils/tests/test_pipeline.py
import os from io import StringIO from django.conf import settings from django.core.management import call_command from django.core.management.base import CommandError from django.test import TestCase class PipelineTestCase(TestCase): def setUp(self): self.file_path = os.path.join(settings.STATIC_ROOT, '...
import os from io import StringIO from django.conf import settings from django.core.management import call_command from django.core.management.base import CommandError from django.test import TestCase class PipelineTestCase(TestCase): def setUp(self): file_path = os.path.join(settings.STATIC_ROOT, 'stati...
mit
Python
ea08b388e29c83fdbbcc6d35d88627d4afe5f859
Clean unused cruft
thiderman/storm
storm/cloud.py
storm/cloud.py
import sys import pyinotify as inf import asyncore import logbook from storm import util from storm import conf from storm import bolt class EventHandler(inf.ProcessEvent): font = conf.CONFIG['font']['name'] separator_color = conf.CONFIG['colors']['sep'] width = util.get_screen_size() def __init__(...
import sys import pyinotify as inf import asyncore import logbook from storm import util from storm import conf from storm import bolt class EventHandler(inf.ProcessEvent): # Setup some static vars that should really be in a conf file. # TODO: Conf file plz. font = conf.CONFIG['font']['name'] separat...
mit
Python
7954487cdf7607497e62322690eb5c497798a401
Fix pep8 issue
alfredhq/alfred-collector
alfred_collector/process.py
alfred_collector/process.py
import msgpack import multiprocessing import zmq from alfred_db.models import Report, Fix from datetime import datetime from markdown import markdown from sqlalchemy import create_engine class CollectorProcess(multiprocessing.Process): def __init__(self, database_uri, socket_address): super().__init__() ...
import msgpack import multiprocessing import zmq from alfred_db.models import Report, Fix from datetime import datetime from markdown import markdown from sqlalchemy import create_engine class CollectorProcess(multiprocessing.Process): def __init__(self, database_uri, socket_address): super().__init__() ...
isc
Python
95a25b401d5430fd8cbfcfcb3bc6c691bf2c40ad
Remove unnecessary import
adangtran87/gbf-weap
summon_list.py
summon_list.py
class SummonList: def __init__(self, my_summons, helper_summons): self.my_summons = my_summons self.helper_summons = helper_summons # Pair your summon with each friend list summon # @return List of summon pairs @property def summon_pairs(self): summon_pair_list = [] ...
from wep_types import SummonType, Summon class SummonList: def __init__(self, my_summons, helper_summons): self.my_summons = my_summons self.helper_summons = helper_summons # Pair your summon with each friend list summon # @return List of summon pairs @property def summon_pairs(sel...
mit
Python
52f30bb037241ddb4b12fd5f6e3d72c6de49c0dc
make survey closed url matching a bit more restrictive
mysociety/manchester-survey,mysociety/manchester-survey,mysociety/manchester-survey,mysociety/manchester-survey,mysociety/manchester-survey
survey/urls.py
survey/urls.py
from django.conf.urls import patterns, url, include from survey.views import * urlpatterns = patterns('', url(r'^about', 'survey.views.about', name='about'), url(r'^management', 'survey.views.management', name='management'), url(r'^contact', 'survey.views.contact', name='contact'), url(r'^survey2/(?P<...
from django.conf.urls import patterns, url, include from survey.views import * urlpatterns = patterns('', url(r'^about', 'survey.views.about', name='about'), url(r'^management', 'survey.views.management', name='management'), url(r'^contact', 'survey.views.contact', name='contact'), url(r'^survey2/(?P<...
agpl-3.0
Python
8ae94fbc42d1999d12f4dd765ce2b2b7c6ddf3ad
Update test_tasks.py
lafranceinsoumise/api-django,lafranceinsoumise/api-django,lafranceinsoumise/api-django,lafranceinsoumise/api-django
agir/people/tests/test_tasks.py
agir/people/tests/test_tasks.py
from django.test import TestCase from django.core import mail from agir.people.models import Person from agir.people import tasks class PeopleTasksTestCase(TestCase): def setUp(self): self.person = Person.objects.create_insoumise("me@me.org", create_role=True) def test_welcome_mail(self): ta...
from django.test import TestCase from django.core import mail from agir.people.models import Person from agir.people import tasks class PeopleTasksTestCase(TestCase): def setUp(self): self.person = Person.objects.create_insoumise("me@me.org", create_role=True) def test_welcome_mail(self): ta...
agpl-3.0
Python
29ef0c329425c0dcdc89b496a27f7c2e98134074
update chgcar example
gkc1000/pyscf,gkc1000/pyscf,sunqm/pyscf,gkc1000/pyscf,gkc1000/pyscf,sunqm/pyscf,gkc1000/pyscf,sunqm/pyscf,sunqm/pyscf
examples/tools/06-chgcar.py
examples/tools/06-chgcar.py
#!/usr/bin/env python ''' Write orbitals, electron density in VASP CHGCAR format. ''' import numpy as np from pyscf.pbc import gto, scf from pyscf.tools import chgcar # # Regular CHGCAR file for crystal cell # cell = gto.M(atom='H 0 0 0; H 0 0 1', a=np.eye(3)*3) mf = scf.RHF(cell).run() # electron density chgcar.de...
#!/usr/bin/env python ''' Write orbitals, electron density, molecular electrostatic potential in Gaussian cube file format. ''' import numpy as np from pyscf.pbc import gto, scf from pyscf.tools import chgcar # # Regular CHGCAR file for crystal cell # cell = gto.M(atom='H 0 0 0; H 0 0 1', a=np.eye(3)*3) mf = scf.RHF...
apache-2.0
Python
eeebc0d51e7d46af82fc2e27d975f540c5e56a4f
Replace old manage.py script used for testing with the default one created by django-admin
rockneurotiko/wirecloud,rockneurotiko/wirecloud,rockneurotiko/wirecloud,jpajuelo/wirecloud,jpajuelo/wirecloud,rockneurotiko/wirecloud,jpajuelo/wirecloud,jpajuelo/wirecloud
src/manage.py
src/manage.py
#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
#!/usr/bin/env python #...............................licence........................................... # # (C) Copyright 2008 Telefonica Investigacion y Desarrollo # S.A.Unipersonal (Telefonica I+D) # # This file is part of Morfeo EzWeb Platform. # # Morfeo EzWeb Platform is free software: you can re...
agpl-3.0
Python
b323ad25f62ae82468ef3ca7f4e6a4b72e550dbc
remove default ordering in apireport
sunlightlabs/django-locksmith,sunlightlabs/django-locksmith,sunlightlabs/django-locksmith
locksmith/auth/management/commands/apireport.py
locksmith/auth/management/commands/apireport.py
import datetime from urlparse import urljoin from django.core.management.base import BaseCommand, CommandError from django.conf import settings from django.db.models import get_model, Count from locksmith.common import apicall APP = getattr(settings, 'LOCKSMITH_STATS_APP', 'api') MODEL = getattr(settings, 'LOCKSMITH_S...
import datetime from urlparse import urljoin from django.core.management.base import BaseCommand, CommandError from django.conf import settings from django.db.models import get_model, Count from locksmith.common import apicall APP = getattr(settings, 'LOCKSMITH_STATS_APP', 'api') MODEL = getattr(settings, 'LOCKSMITH_S...
bsd-3-clause
Python
c7d30ed5e5b22aeb24e378c8f74dec64100d1dd1
remove marks for testing transposability with X = None
theislab/anndata
anndata/tests/test_transpose.py
anndata/tests/test_transpose.py
from scipy import sparse import pytest from anndata.tests.helpers import gen_adata, assert_equal def test_transpose_orig(): """ Original test for transpose, should be covered by more thorough tests below, but keeping around just in case. """ adata = gen_adata((5, 3)) adata.varp = {f"varp_{k}...
from scipy import sparse import pytest from anndata.tests.helpers import gen_adata, assert_equal def test_transpose_orig(): """ Original test for transpose, should be covered by more thorough tests below, but keeping around just in case. """ adata = gen_adata((5, 3)) adata.varp = {f"varp_{k}...
bsd-3-clause
Python
581220d46d6568c33148298feb1c21d4184720f5
Fix year import.
fi-ksi/web-backend,fi-ksi/web-backend
util/year.py
util/year.py
# -*- coding: utf-8 -*- from db import session import model from util import config import util def to_json(year, sum_points=None): if sum_points is None: sum_points = util.task.max_points_year_dict()[year.id] print sum_points return { 'id': year.id, 'index': year.id, 'year': year.year, 'sum_points': sum_...
# -*- coding: utf-8 -*- from db import session import model from util import config def to_json(year, sum_points=None): if sum_points is None: sum_points = util.task.max_points_year_dict()[year.id] print sum_points return { 'id': year.id, 'index': year.id, 'year': year.year, 'sum_points': sum_points[0], ...
mit
Python
0fe82c97db166953d821513c12b0c3662e8faa96
Fix PyLint warnings.
ymoch/apyori
test/test_apriori.py
test/test_apriori.py
""" Tests for apyori.apriori. """ from nose.tools import eq_ from mock import Mock from apyori import TransactionManager from apyori import SupportRecord from apyori import RelationRecord from apyori import OrderedStatistic from apyori import apriori def test_empty(): """ Test for empty data. """ tr...
""" Tests for apyori.apriori. """ from nose.tools import eq_ from mock import Mock from apyori import TransactionManager from apyori import SupportRecord from apyori import RelationRecord from apyori import OrderedStatistic from apyori import apriori def test_empty(): """ Test for empty data. """ tr...
mit
Python
1ba16f0bbfa203ee4a0d2fa0d15318912757f840
set an analog and a digital pin
MrYsLab/PyMata
examples/capability_test.py
examples/capability_test.py
#!/usr/bin/python """ Copyright (c) 2013-2015 Alan Yorinks All rights reserved. This program 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...
#!/usr/bin/python __author__ = 'Copyright (c) 2015 Alan Yorinks All rights reserved.' """ Copyright (c) 2013 Alan Yorinks All rights reserved. This program 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; eithe...
agpl-3.0
Python
40d01669d64bbdfb06f73b28db019a1806a544e8
Fix call to train_test_split in plot_latent_crf example. Scikit-learn's train_test_split changed its behaviour for nd samples in version 0.15.
amueller/pystruct,pystruct/pystruct,pystruct/pystruct,d-mittal/pystruct,d-mittal/pystruct,massmutual/pystruct,massmutual/pystruct,wattlebird/pystruct,wattlebird/pystruct,amueller/pystruct
examples/plot_latent_crf.py
examples/plot_latent_crf.py
""" =================== Latent Dynamics CRF =================== Solving a 2d grid problem by introducing latent variable interactions. The input data is the same as in plot_grid_crf, a cross pattern. But now, the center is not given an extra state. That makes the problem much harder to solve for a pairwise model. We c...
""" =================== Latent Dynamics CRF =================== Solving a 2d grid problem by introducing latent variable interactions. The input data is the same as in plot_grid_crf, a cross pattern. But now, the center is not given an extra state. That makes the problem much harder to solve for a pairwise model. We c...
bsd-2-clause
Python
6502243f05a69a2cc1ec4ef2f4e36af1f2e9797f
Update version.py
CGATOxford/UMI-tools
umi_tools/version.py
umi_tools/version.py
__version__ = "0.2.5"
__version__ = "0.2.4"
mit
Python
f3bc6b072aee3bcf194733dc2e06a7f199def59a
Fix DNS information expiration
guillaume-philippon/aquilon,quattor/aquilon,stdweird/aquilon,quattor/aquilon,guillaume-philippon/aquilon,quattor/aquilon,guillaume-philippon/aquilon,stdweird/aquilon,stdweird/aquilon
lib/python2.6/aquilon/server/dbwrappers/dns.py
lib/python2.6/aquilon/server/dbwrappers/dns.py
# ex: set expandtab softtabstop=4 shiftwidth=4: -*- cpy-indent-level: 4; indent-tabs-mode: nil -*- # # Copyright (C) 2008,2009,2010,2011 Contributor # # This program is free software; you can redistribute it and/or modify # it under the terms of the EU DataGrid Software License. You should # have received a copy of t...
# ex: set expandtab softtabstop=4 shiftwidth=4: -*- cpy-indent-level: 4; indent-tabs-mode: nil -*- # # Copyright (C) 2008,2009,2010,2011 Contributor # # This program is free software; you can redistribute it and/or modify # it under the terms of the EU DataGrid Software License. You should # have received a copy of t...
apache-2.0
Python
9a3f69964d405def11454175937204f1b20b9d81
update inidb.py, considering if it's still necessary
Jailman/RaspberryPiRobot,Jailman/RaspberryPiRobot,Jailman/RaspberryPiRobot,Jailman/RaspberryPiRobot
Web-Terminal/Modules/initDB.py
Web-Terminal/Modules/initDB.py
#!/usr/bin/env python # -*- coding: UTF-8 -*- """ Init database Create tables Insert data Query data """ from sqlalchemy import * from sqlalchemy.orm import * #define egine engine = create_engine('sqlite:///../DB/raspberrypi.db') #bind metadata metadata = MetaData(engine) #create tables, init database # pilot = Ta...
#!/usr/bin/env python # -*- coding: UTF-8 -*- """ Init database Create tables Insert data Query data """ from sqlalchemy import * from sqlalchemy.orm import * #define egine engine = create_engine('sqlite:///../DB/raspberrypirobot.db') #bind metadata metadata = MetaData(engine) #create tables, init database pilot =...
apache-2.0
Python
ddc5a7f3868c5ba311e307a4d84777a3c0a5c087
add utf8 note
vtmp/restro-tracer
rtracer/util/__init__.py
rtracer/util/__init__.py
# -*- coding: utf-8 -*- from .data_handling import *
from .data_handling import *
mit
Python
dde43f917bc12d269c3320174527a934bdfb4e70
add geocoords
clld/glottolog3,clld/glottolog3
migrations/versions/20b0b763f2f9_iso_updates.py
migrations/versions/20b0b763f2f9_iso_updates.py
# coding=utf-8 """iso updates Revision ID: 20b0b763f2f9 Revises: 53f4e74ce460 Create Date: 2014-10-09 12:51:21.612004 """ # revision identifiers, used by Alembic. revision = '20b0b763f2f9' down_revision = '53f4e74ce460' import datetime from alembic import op import sqlalchemy as sa def upgrade(): """ gmo ...
# coding=utf-8 """iso updates Revision ID: 20b0b763f2f9 Revises: 53f4e74ce460 Create Date: 2014-10-09 12:51:21.612004 """ # revision identifiers, used by Alembic. revision = '20b0b763f2f9' down_revision = '53f4e74ce460' import datetime from alembic import op import sqlalchemy as sa def upgrade(): pass def d...
mit
Python
7b85834a7c3e8b56fbaf2c3f347714e0bed08e13
Bump app version to 2019.5.2
kernelci/kernelci-backend,kernelci/kernelci-backend
app/handlers/__init__.py
app/handlers/__init__.py
__version__ = "2019.5.2" __versionfull__ = __version__
__version__ = "2019.5.1" __versionfull__ = __version__
lgpl-2.1
Python
d331a36abbedc144fcffa75acf0f601209b8e2fb
Improve the handling of ssl._create_unverified_context()
William-Yeh/ansible-monit
files/check-latest-monit.py
files/check-latest-monit.py
#!/usr/bin/env python # # Check the version of latest binary distribution of monit. # # USAGE: # progname # # # @see https://mmonit.com/monit/dist/binary/ # import sys import re import urllib import ssl MONIT_DIST_LINK = "http://mmonit.com/monit/dist/binary/" REGEX_MONIT_LIST = re.compile('\salt="\[DIR\]"></td>...
#!/usr/bin/env python # # Check the version of latest binary distribution of monit. # # USAGE: # progname # # # @see https://mmonit.com/monit/dist/binary/ # import sys import re import urllib import ssl MONIT_DIST_LINK = "http://mmonit.com/monit/dist/binary/" REGEX_MONIT_LIST = re.compile('\salt="\[DIR\]"></td>...
mit
Python
3dd23df07d7d1f84e361c87345aafcfefeff636a
Order agonistic options to control vacuum gripper
pazeshun/jsk_apc,pazeshun/jsk_apc,pazeshun/jsk_apc,pazeshun/jsk_apc,pazeshun/jsk_apc
jsk_2016_01_baxter_apc/node_scripts/control_vacuum_gripper.py
jsk_2016_01_baxter_apc/node_scripts/control_vacuum_gripper.py
#!/usr/bin/env python from __future__ import absolute_import from __future__ import division from __future__ import print_function import argparse import rospy from std_msgs.msg import Bool def main(): parser = argparse.ArgumentParser() parser.add_argument('-l', '--left', action='store_true', ...
#!/usr/bin/env python from __future__ import absolute_import from __future__ import division from __future__ import print_function import argparse import rospy from std_msgs.msg import Bool def main(): parser = argparse.ArgumentParser() parser.add_argument('action', type=str, choices=['start', 'stop']) ...
bsd-3-clause
Python
74e9f4f4f64ed0c9501d2527b3948dbcde423cc6
Increase log verbosity on exception
tdickman/jetcom-crawl
jetcomcrawl/modes/items.py
jetcomcrawl/modes/items.py
from bs4 import BeautifulSoup import logging from jetcomcrawl import browser import jetcomcrawl.libs.queue class Worker(object): def __init__(self): self.queue_categories = jetcomcrawl.libs.queue.Queue('queue_categories') self.queue_items = jetcomcrawl.libs.queue.Queue('queue_items') def wor...
from bs4 import BeautifulSoup import logging from jetcomcrawl import browser import jetcomcrawl.libs.queue class Worker(object): def __init__(self): self.queue_categories = jetcomcrawl.libs.queue.Queue('queue_categories') self.queue_items = jetcomcrawl.libs.queue.Queue('queue_items') def wor...
mit
Python
e6720d0ccab5377195d469c158192087ca591fae
fix example
openafs-contrib/afspy,openafs-contrib/afspy
examples/showVolumeGroup.py
examples/showVolumeGroup.py
#!/usr/bin/env python import sys, os sys.path.append("..") from afs.util.AfsConfig import AfsConfig, setupDefaultConfig from afs.util.options import define, options from afs.service.VolService import VolService import afs setupDefaultConfig() afs.defaultConfig.AFSCell="desy.de" volMng = VolService() VolName="root.cel...
#!/usr/bin/env python import sys, os sys.path.append("..") from afs.util.AfsConfig import AfsConfig, setupDefaultConfig from afs.util.options import define, options from afs.service.VolService import VolService import afs setupDefaultConfig() afs.defaultConfig.AFSCell="desy.de" volMng = VolService() VolName="root.cel...
bsd-2-clause
Python
eb575e511369b9ece61bb3543496f47ff37fdc3d
Fix socket transport
polyaxon/polyaxon,polyaxon/polyaxon,polyaxon/polyaxon
polyaxon_client/transport/socket_transport.py
polyaxon_client/transport/socket_transport.py
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function import json import websocket from polyaxon_client.logger import logger class SocketTransportMixin(object): """Socket operations transport.""" def socket(self, url, message_handler, headers=None): webs = websock...
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function import json import threading import websocket from polyaxon_client.logger import logger from polyaxon_client.workers.socket_worker import SocketWorker class SocketTransportMixin(object): """Socket operations transport.""" ...
apache-2.0
Python
c8a9ef23668582098fe5c8beff0cf83530108c93
implement test for different unit comparison
morgenst/pyfluka
tests/Calculators.py
tests/Calculators.py
import unittest import utils.PhysicsQuantities as PQ from plugins.SimpleCalculator import AoverLECalculator, SpecificActivityCalculator from utils import ureg class TestCalculator(unittest.TestCase): def setUp(self): self.dataIsotopeSpecificAct = {"det1": {'Isotope': [PQ.Isotope(3, 1)], 'SpecificActivity'...
import unittest import utils.PhysicsQuantities as PQ from plugins.SimpleCalculator import AoverLECalculator, SpecificActivityCalculator from utils import ureg class TestCalculator(unittest.TestCase): def setUp(self): self.dataIsotopeSpecificAct = {"det1": {'Isotope': [PQ.Isotope(3, 1)], 'SpecificActivity'...
mit
Python
5dbb552bc54904b1e3f4f4ac45d7192fe6107c3c
Read stopwords.txt when initialize, to avoid reading it in every update.
crista/exercises-in-programming-style,jw0201/exercises-in-programming-style,mathkann/exercises-in-programming-style,jim-thisplace/exercises-in-programming-style,Drooids/exercises-in-programming-style,aaron-goshine/exercises-in-programming-style,aaron-goshine/exercises-in-programming-style,placrosse/exercises-in-program...
32-trinity/tf-32.py
32-trinity/tf-32.py
#!/usr/bin/env python import sys, re, operator, collections class WordFrequenciesModel: """ Models the data. In this case, we're only interested in words and their frequencies as an end result """ freqs = {} stopwords = set(open('../stop_words.txt').read().split(',')) def __init__(self, path_to_fi...
#!/usr/bin/env python import sys, re, operator, collections class WordFrequenciesModel: """ Models the data. In this case, we're only interested in words and their frequencies as an end result """ freqs = {} def __init__(self, path_to_file): self.update(path_to_file) def update(self, path...
mit
Python
4578de68e7486d33fff6b1117293777af91679c4
Redact data from zwave_js diagnostics (#68348)
nkgilley/home-assistant,w1ll1am23/home-assistant,toddeye/home-assistant,toddeye/home-assistant,mezz64/home-assistant,mezz64/home-assistant,w1ll1am23/home-assistant,nkgilley/home-assistant
homeassistant/components/zwave_js/diagnostics.py
homeassistant/components/zwave_js/diagnostics.py
"""Provides diagnostics for Z-Wave JS.""" from __future__ import annotations from zwave_js_server.client import Client from zwave_js_server.dump import dump_msgs from zwave_js_server.model.node import NodeDataType from homeassistant.components.diagnostics.util import async_redact_data from homeassistant.config_entrie...
"""Provides diagnostics for Z-Wave JS.""" from __future__ import annotations from zwave_js_server.client import Client from zwave_js_server.dump import dump_msgs from zwave_js_server.model.node import NodeDataType from homeassistant.config_entries import ConfigEntry from homeassistant.const import CONF_URL from homea...
apache-2.0
Python
734b8c99ebbbc03fd0c0f4323b110cfe785d7340
add length to table_field()
olebole/astrometry.net,olebole/astrometry.net,olebole/astrometry.net,olebole/astrometry.net,olebole/astrometry.net,olebole/astrometry.net,olebole/astrometry.net,olebole/astrometry.net
util/pyfits_utils.py
util/pyfits_utils.py
import pyfits class tabledata(object): def __init__(self): self._length = 0 def __setattr__(self, name, val): object.__setattr__(self, name, val) def set(self, name,val): self.__setattr__(name, val) def getcolumn(self, name): return self.__dict__[name.lower()] def __len__(self): return self._length def...
import pyfits class tabledata(object): def __setattr__(self, name, val): object.__setattr__(self, name, val) def set(self, name,val): self.__setattr__(name, val) def getcolumn(self, name): return self.__dict__[name.lower()] def table_fields(dataorfn): pf = None if isinstance(dataorfn, str): pf = pyfits.o...
bsd-3-clause
Python
10245467b393dcf6d8ee2733365afb0d8257c9e4
Test commit
kurtwood/sw_assignment3,kurtwood/sw_assignment3,kurtwood/sw_assignment3
facebook_calculate_likes.py
facebook_calculate_likes.py
# This is a test by Timo # First, let's query for all of the likes in your social # network and store them in a slightly more convenient # data structure as a dictionary keyed on each friend's # name. import facebook from prettytable import PrettyTable from collections import Counter # Create a connection to the Graph...
# First, let's query for all of the likes in your social # network and store them in a slightly more convenient # data structure as a dictionary keyed on each friend's # name. import facebook from prettytable import PrettyTable from collections import Counter # Create a connection to the Graph API with your access tok...
bsd-3-clause
Python
bf0e192b190efbde1b594cdf85c6552b343c2f0c
Use new API correctly, v2...
janmedlock/HIV-95-vaccine
run_samples.py
run_samples.py
#!/usr/bin/python3 ''' Run simulations with parameter samples. ''' import model countries = model.datasheet.get_country_list() # Move these to the front. countries_to_plot = ['United States of America', 'South Africa', 'Uganda', 'Nigeria', ...
#!/usr/bin/python3 ''' Run simulations with parameter samples. ''' import model countries = model.datasheet.get_country_list() # Move these to the front. countries_to_plot = ['United States of America', 'South Africa', 'Uganda', 'Nigeria', ...
agpl-3.0
Python
29cc8951e4485d0edeade28c5e6711ccaefe9551
fix concatenation while editing files
sbhs-forkbombers/sbhs-timetable-python,sbhs-forkbombers/sbhs-timetable-python,sbhs-forkbombers/sbhs-timetable-python
sbhstimetable/jsconcat.py
sbhstimetable/jsconcat.py
# sbhs-timetable-python # Copyright (C) 2015 Simon Shields, James Ye # # 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 later ver...
# sbhs-timetable-python # Copyright (C) 2015 Simon Shields, James Ye # # 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 later ver...
agpl-3.0
Python
f6b02f3959172e2f196dbc45cbdb8df46898f6ec
add call_back to run_tardis (#860)
kaushik94/tardis,kaushik94/tardis,kaushik94/tardis,kaushik94/tardis
tardis/base.py
tardis/base.py
# functions that are important for the general usage of TARDIS def run_tardis(config, atom_data=None, simulation_callbacks=[]): """ This function is one of the core functions to run TARDIS from a given config object. It will return a model object containing Parameters ---------- config: ...
# functions that are important for the general usage of TARDIS def run_tardis(config, atom_data=None): """ This function is one of the core functions to run TARDIS from a given config object. It will return a model object containing Parameters ---------- config: ~str or ~dict fil...
bsd-3-clause
Python
9576a3077f8fff0d68267dbf5bb2e821ef92c46c
remove storage use in download
FederatedAI/FATE,FederatedAI/FATE,FederatedAI/FATE
fate_flow/utils/download.py
fate_flow/utils/download.py
# # Copyright 2019 The FATE Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
# # Copyright 2019 The FATE Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
apache-2.0
Python
d063aab1277fff1ec711bb85f6a925d95df58e15
Add test_set_insert_customer_text_msg
chenyang14/electronic-blackboard,SWLBot/electronic-blackboard,SWLBot/electronic-blackboard,Billy4195/electronic-blackboard,stvreumi/electronic-blackboard,stvreumi/electronic-blackboard,Billy4195/electronic-blackboard,chenyang14/electronic-blackboard,Billy4195/electronic-blackboard,SWLBot/electronic-blackboard,chenyang1...
test/test_server_api.py
test/test_server_api.py
import unittest import os,sys cur_dir = os.path.dirname(__file__) par_dir = os.path.dirname(cur_dir) sys.path.append(par_dir) from server_api import * from mysql import * class Server_api(unittest.TestCase): def test_find_now_schedule(self): with mysql() as db: db.connect() self.ass...
import unittest import os,sys cur_dir = os.path.dirname(__file__) par_dir = os.path.dirname(cur_dir) sys.path.append(par_dir) from server_api import * from mysql import * class Server_api(unittest.TestCase): def test_find_now_schedule(self): with mysql() as db: db.connect() self.ass...
apache-2.0
Python
6f462b45d7dd6bc5a0d49a3329c592d32c610b9f
Update archivebox/core/forms.py
pirate/bookmark-archiver,pirate/bookmark-archiver,pirate/bookmark-archiver
archivebox/core/forms.py
archivebox/core/forms.py
__package__ = 'archivebox.core' from django import forms from ..util import URL_REGEX from .utils_taggit import edit_string_for_tags, parse_tags CHOICES = ( ('0', 'depth = 0 (archive just these URLs)'), ('1', 'depth = 1 (archive these URLs and all URLs one hop away)'), ) from ..extractors import get_default...
__package__ = 'archivebox.core' from django import forms from ..util import URL_REGEX from .utils_taggit import edit_string_for_tags, parse_tags CHOICES = ( ('0', 'depth = 0 (archive just these URLs)'), ('1', 'depth = 1 (archive these URLs and all URLs one hop away)'), ) ARCHIVE_METHODS = [ ('title', 't...
mit
Python
75f9eba8a20d93132a888c4f01d65e8962bd3d7d
add id field to MetaDataSerializer
spatialdev/onadata,awemulya/fieldsight-kobocat,piqoni/onadata,GeoODK/onadata,spatialdev/onadata,smn/onadata,hnjamba/onaclone,kobotoolbox/kobocat,hnjamba/onaclone,sounay/flaminggo-test,jomolinare/kobocat,spatialdev/onadata,mainakibui/kobocat,awemulya/fieldsight-kobocat,piqoni/onadata,jomolinare/kobocat,qlands/onadata,ko...
onadata/libs/serializers/metadata_serializer.py
onadata/libs/serializers/metadata_serializer.py
from django.utils.translation import ugettext as _ from rest_framework import serializers from onadata.apps.main.models.meta_data import MetaData METADATA_TYPES = ( ('data_license', _(u"Data License")), ('form_license', _(u"Form License")), ('mapbox_layer', _(u"Mapbox Layer")), ('media', _(u"Media")),...
from django.utils.translation import ugettext as _ from rest_framework import serializers from onadata.apps.main.models.meta_data import MetaData METADATA_TYPES = ( ('data_license', _(u"Data License")), ('form_license', _(u"Form License")), ('mapbox_layer', _(u"Mapbox Layer")), ('media', _(u"Media")),...
bsd-2-clause
Python
320fe2d32ed58f15c841f604f32f2a1e3eb2aba6
Update test-install
brookehus/msmbuilder,rafwiewiora/msmbuilder,cxhernandez/msmbuilder,dr-nate/msmbuilder,Eigenstate/msmbuilder,peastman/msmbuilder,dr-nate/msmbuilder,rafwiewiora/msmbuilder,mpharrigan/mixtape,dr-nate/msmbuilder,cxhernandez/msmbuilder,dr-nate/msmbuilder,mpharrigan/mixtape,msultan/msmbuilder,mpharrigan/mixtape,msultan/msmbu...
msmbuilder/project_templates/0-test-install.py
msmbuilder/project_templates/0-test-install.py
"""This script tests your python installation as it pertains to running project templates. MSMBuilder supports Python 2.7 and 3.3+ and has some necessary dependencies like numpy, scipy, and scikit-learn. This templated project enforces some more stringent requirements to make sure all the users are more-or-less on the...
"""This script tests your python installation as it pertains to running project templates. MSMBuilder supports Python 2.7 and 3.3+ and has some necessary dependencies like numpy, scipy, and scikit-learn. This templated project enforces some more stringent requirements to make sure all the users are more-or-less on the...
lgpl-2.1
Python
a61433f4de497d517c41226477d2d96885ad92ea
Add the current site domain to the email template context
mferenca/HMS-ecommerce,edx/ecommerce,eduNEXT/edunext-ecommerce,eduNEXT/edunext-ecommerce,eduNEXT/edunext-ecommerce,mferenca/HMS-ecommerce,eduNEXT/edunext-ecommerce,edx/ecommerce,edx/ecommerce,edx/ecommerce,mferenca/HMS-ecommerce
ecommerce/notifications/notifications.py
ecommerce/notifications/notifications.py
import logging from oscar.core.loading import get_model, get_class from premailer import transform from ecommerce.extensions.analytics.utils import parse_tracking_context log = logging.getLogger(__name__) CommunicationEventType = get_model('customer', 'CommunicationEventType') Dispatcher = get_class('customer.utils...
import logging from oscar.core.loading import get_model, get_class from premailer import transform from ecommerce.extensions.analytics.utils import parse_tracking_context log = logging.getLogger(__name__) CommunicationEventType = get_model('customer', 'CommunicationEventType') Dispatcher = get_class('customer.utils...
agpl-3.0
Python
9a4f02b3716a3a775ad6e9e0b0a09fb777cd1b4c
make the engines pass the start function
saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt
salt/engines/__init__.py
salt/engines/__init__.py
''' Initialize the engines system. This plugin system allows for complex services to be encapsulated within the salt plugin environment ''' # Import python libs import multiprocessing # Import salt libs import salt class Engine(multiprocessing.Process): ''' Execute the given engine in a new process ''' ...
''' Initialize the engines system. This plugin system allows for complex services to be encapsulated within the salt plugin environment ''' # Import python libs import multiprocessing # Import salt libs import salt class Engine(multiprocessing.Process): ''' Execute the given engine in a new process ''' ...
apache-2.0
Python
cb29a43639989825d465199be9ae79d46a3f1458
Remove --no-db/-db option from AIM CLI
noironetworks/aci-integration-module,noironetworks/aci-integration-module
aim/tools/cli/groups/aimcli.py
aim/tools/cli/groups/aimcli.py
# Copyright (c) 2016 Cisco Systems # 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 require...
# Copyright (c) 2016 Cisco Systems # 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 require...
apache-2.0
Python
27b0a5b95e188a5bd77ae662bbb43e06dfde4749
Use the id of the channel and unquote all of the text first.
DuaneGarber/slack-meme,joeynebula/slack-meme,tezzutezzu/slack-meme,nicolewhite/slack-meme
slack/views.py
slack/views.py
from flask import Flask, request import requests from urllib import unquote app = Flask(__name__) @app.route("/") def meme(): domain = request.args["team_domain"] slackbot = request.args["slackbot"] text = request.args["text"] channel = request.args["channel_id"] text = unquote(text) text = t...
from flask import Flask, request import requests from urllib import unquote app = Flask(__name__) @app.route("/") def meme(): domain = request.args["team_domain"] slackbot = request.args["slackbot"] text = request.args["text"] channel = request.args["channel_name"] text = text[:-1] if text[-1] ==...
mit
Python
732124f5c5d75243682a4603fe5f30bfcd018c98
use symbolic name for default route
stackforge/akanda-appliance,openstack/akanda-appliance,stackforge/akanda-appliance,dreamhost/akanda-appliance,dreamhost/akanda-appliance,openstack/akanda-appliance
akanda/router/drivers/route.py
akanda/router/drivers/route.py
import logging from akanda.router.drivers import base LOG = logging.getLogger(__name__) class RouteManager(base.Manager): EXECUTABLE = '/sbin/route' def __init__(self, root_helper='sudo'): super(RouteManager, self).__init__(root_helper) def update_default(self, config): for net in con...
import logging from akanda.router.drivers import base LOG = logging.getLogger(__name__) class RouteManager(base.Manager): EXECUTABLE = '/sbin/route' def __init__(self, root_helper='sudo'): super(RouteManager, self).__init__(root_helper) def update_default(self, config): for net in con...
apache-2.0
Python
8df06e8ba6b06fee4155fee34ec9dc5e5d407b78
bump version
Lionardo/aldryn-stripe-shop,Lionardo/aldryn-stripe-shop,Lionardo/aldryn-stripe-shop
aldryn_stripe_shop/__init__.py
aldryn_stripe_shop/__init__.py
# -*- coding: utf-8 -*- __version__ = '0.0.3'
# -*- coding: utf-8 -*- __version__ = '0.0.2'
bsd-3-clause
Python
20595878e127db9ca10d124d412dd29242b51c4e
add mock
osallou/codetesting-with-python-training
tests/sample_test.py
tests/sample_test.py
from nose.tools import * from nose.plugins.attrib import attr from mysamplecode.samplecode import SampleCode import mock from mock import patch import logging import unittest class MockLdapConn(object): ldap_user = 'sampleuser' ldap_user_email = 'ldap@no-reply.org' STRATEGY_SYNC = 0 AUTH_SIMPLE = 0 STRA...
from nose.tools import * from nose.plugins.attrib import attr from mysamplecode.samplecode import SampleCode import mock from mock import patch import logging import unittest class Test(unittest.TestCase): def setUp(self): self.counter = 0 def tearDown(self): pass @attr('count') ...
apache-2.0
Python
8583e5d4cd0e19c5177547833e590a6253a4cbc9
Fix import name
econ-ark/HARK,econ-ark/HARK
examples/Calibration/SCF_distributions.py
examples/Calibration/SCF_distributions.py
# -*- coding: utf-8 -*- """ Created on Mon Jan 18 13:57:50 2021 @author: Mateo """ from HARK.datasets.SCF.WealthIncomeDist.SCFDistTools import income_wealth_dists_from_scf import seaborn as sns from itertools import product, starmap import pandas as pd # List the education levels and years educ_lvls = ["NoHS", "HS",...
# -*- coding: utf-8 -*- """ Created on Mon Jan 18 13:57:50 2021 @author: Mateo """ from HARK.datasets.SCF.WealthIncomeDist.parser import income_wealth_dists_from_scf import seaborn as sns from itertools import product, starmap import pandas as pd # List the education levels and years educ_lvls = ["NoHS", "HS", "Coll...
apache-2.0
Python
71a7d3197719ee64bd488704a0ba990a140a2971
fix event filter in sms
sunlightlabs/tcamp,sunlightlabs/tcamp,sunlightlabs/tcamp,sunlightlabs/tcamp
tcamp/sms/views.py
tcamp/sms/views.py
from django_twilio.views import sms from django_twilio.decorators import twilio_view from django.utils import timezone from dateutil.parser import parse as dateparse from sked.models import Event, Session @twilio_view def coming_up(request, message, to=None, sender=None, action=None, method=None, statu...
from django_twilio.views import sms from django_twilio.decorators import twilio_view from django.utils import timezone from dateutil.parser import parse as dateparse from sked.models import Event, Session @twilio_view def coming_up(request, message, to=None, sender=None, action=None, method=None, statu...
bsd-3-clause
Python
0d0ac33dcb17692555a673883d42505f4716fcbd
Fix whitespace
glasnost/kremlin,glasnost/kremlin,glasnost/kremlin
kremlin/config_defaults.py
kremlin/config_defaults.py
""" # # #### ##### # # ##### # # # # # # # # # ## ## # # # ## # # ### #### #### # # # # # # # # ##### # # # # # # # # ## # # # # # # ##### # # # # # # # # Kremlin Mag...
""" # # #### ##### # # ##### # # # # # # # # # ## ## # # # ## # # ### #### #### # # # # # # # # ##### # # # # # # # # ## # # # # # # ##### # # # # # # # # Kremlin Mag...
bsd-2-clause
Python
ddd45afa0708682bb11d606e03e38aed111d7b9c
Implement Big Banana, Deviate Banana, Rotten Banana
liujimj/fireplace,Ragowit/fireplace,butozerca/fireplace,butozerca/fireplace,smallnamespace/fireplace,amw2104/fireplace,smallnamespace/fireplace,beheh/fireplace,NightKev/fireplace,Meerkov/fireplace,Meerkov/fireplace,liujimj/fireplace,oftc-ftw/fireplace,Ragowit/fireplace,amw2104/fireplace,jleclanche/fireplace,oftc-ftw/fi...
fireplace/cards/game/all.py
fireplace/cards/game/all.py
""" GAME set and other special cards """ from ..utils import * # The Coin class GAME_005: play = ManaThisTurn(CONTROLLER, 1) # Big Banana class TB_006: play = Buff(TARGET, "TB_006e") # Deviate Banana class TB_007: play = Buff(TARGET, "TB_007e") # Rotten Banana class TB_008: play = Hit(TARGET, 1)
""" GAME set and other special cards """ from ..utils import * # The Coin class GAME_005: play = ManaThisTurn(CONTROLLER, 1)
agpl-3.0
Python
cef855415f447f802c3777468f34e19e85ca7238
undo doc test change for linux/mac
simpeg/discretize,simpeg/discretize,simpeg/discretize
tests/docs/test_docs.py
tests/docs/test_docs.py
import subprocess import unittest import os import platform class Doc_Test(unittest.TestCase): @property def path_to_docs(self): dirname, file_name = os.path.split(os.path.abspath(__file__)) return dirname.split(os.path.sep)[:-2] + ["docs"] def test_html(self): wd = os.getcwd() ...
import subprocess import unittest import os import platform class Doc_Test(unittest.TestCase): @property def path_to_docs(self): dirname, file_name = os.path.split(os.path.abspath(__file__)) return dirname.split(os.path.sep)[:-2] + ["docs"] def test_html(self): wd = os.getcwd() ...
mit
Python
ee7f9316246246a02e1cf91ac1f41b431a592a38
Solve for ini3
DanZBishop/Rosalind
ini3/ini3.py
ini3/ini3.py
#!/usr/bin/python import argparse parser = argparse.ArgumentParser(description="Slices a given string between given indices") parser.add_argument("input_string", type=str, nargs=1, help="String to slice") parser.add_argument("slice_ranges", type=int, nargs=4, help="Indices to slice") args = parser.parse_args() stri...
#!/usr/bin/python
apache-2.0
Python
4198429c7049b156561a6cb5fe0e7dbc27fb8648
add tests for some properties with predefined interger types
ClusterHQ/pyzfs
tests/test_nvlist.py
tests/test_nvlist.py
import json from libzfs_core.nvlist import * from libzfs_core.nvlist import _lib props_in = { "key1": "str", "key2": 10, "key3": { "skey1": True, "skey2": None, "skey3": [ True, False, True ] }, "key4": [ "ab", "bc" ], "key5": [ 2 ** 64 - 1, 1, 2, 3 ], "key6": [ uint32_t(10), ...
import json from libzfs_core.nvlist import * from libzfs_core.nvlist import _lib props_in = { "key1": "str", "key2": 10, "key3": { "skey1": True, "skey2": None, "skey3": [ True, False, True ] }, "key4": [ "ab", "bc" ], "key5": [ 2 ** 64 - 1, 1, 2, 3 ], "key6": [ uint32_t(10), ...
apache-2.0
Python