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
7a985d102a347e252b4e6be1776c6b6609fdcdea
Add sensible defaults for ElasticSearch settings
opencivicdata/pupa,datamade/pupa,influence-usa/pupa,datamade/pupa,opencivicdata/pupa,mileswwatkins/pupa,mileswwatkins/pupa,influence-usa/pupa,rshorey/pupa,rshorey/pupa
pupa/core/default_settings.py
pupa/core/default_settings.py
MONGO_HOST = 'localhost' MONGO_PORT = 27017 MONGO_DATABASE = 'pupa' SCRAPELIB_RPM = 60 SCRAPELIB_TIMEOUT = 60 SCRAPELIB_RETRY_ATTEMPTS = 3 SCRAPELIB_RETRY_WAIT_SECONDS = 20 ENABLE_ELASTICSEARCH = False ELASTICSEARCH_HOST = 'localhost' ELASTICSEARCH_TIMEOUT = 2 BILL_FILTERS = {} LEGISLATOR_FILTERS = {} EVENT_FILTERS ...
MONGO_HOST = 'localhost' MONGO_PORT = 27017 MONGO_DATABASE = 'pupa' SCRAPELIB_RPM = 60 SCRAPELIB_TIMEOUT = 60 SCRAPELIB_RETRY_ATTEMPTS = 3 SCRAPELIB_RETRY_WAIT_SECONDS = 20 ENABLE_ELASTICSEARCH = False BILL_FILTERS = {} LEGISLATOR_FILTERS = {} EVENT_FILTERS = {} LOGGING_CONFIG = { 'version': 1, 'disable_exi...
bsd-3-clause
Python
b5f7c2b77b29162ca459121f767eca39f80bdfd8
add adaptive to aggregation imports
pombreda/pyamg,pombreda/pyamg,pombreda/pyamg,pombreda/pyamg
pyamg/aggregation/__init__.py
pyamg/aggregation/__init__.py
"""Aggregation-based AMG""" #from info import __doc__ from adaptive import * from aggregate import * from aggregation import * from tentative import * from smooth import * __all__ = filter(lambda s:not s.startswith('_'),dir()) from scipy.testing.pkgtester import Tester test = Tester().test
"""Aggregation-based AMG""" #from info import __doc__ from aggregate import * from aggregation import * from tentative import * from smooth import * __all__ = filter(lambda s:not s.startswith('_'),dir()) from scipy.testing.pkgtester import Tester test = Tester().test
bsd-3-clause
Python
2c4dd25c26813daa685c144e07a975ee6cd73b8b
add finger_master to key module
saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt
salt/modules/key.py
salt/modules/key.py
# -*- coding: utf-8 -*- ''' Functions to view the minion's public key information ''' # Import python libs import os # Import Salt libs import salt.utils def finger(): ''' Return the minion's public key fingerprint CLI Example: dfasdf .. code-block:: bash salt '*' key.finger ''' ...
# -*- coding: utf-8 -*- ''' Functions to view the minion's public key information ''' # Import python libs import os # Import Salt libs import salt.utils def finger(): ''' Return the minion's public key fingerprint CLI Example: .. code-block:: bash salt '*' key.finger ''' return s...
apache-2.0
Python
bef35b51e9432cc61017bfc27283fe9fd8b9bd41
use a temp directory as workdir
redhat-cip/dci-control-server,goneri/dci-control-server,enovance/dci-control-server,goneri/dci-control-server,goneri/dci-control-server,redhat-cip/dci-control-server,goneri/dci-control-server,enovance/dci-control-server
sample/tox-agent.py
sample/tox-agent.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2015 eNovance SAS <licensing@enovance.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 # # http://www.apache.org/licenses/L...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2015 eNovance SAS <licensing@enovance.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 # # http://www.apache.org/licenses/L...
apache-2.0
Python
97746f1cc8540906990998fcf45a17a6a91c24bd
implement PUT /api/v1/object-issue
hgn/hippod,hgn/hippod,hgn/hippod,hgn/hippod
contestcolld/api.py
contestcolld/api.py
#!/usr/bin/python # coding: utf-8 import object_hasher import json import os import datetime from contestcolld import app from flask import jsonify from flask import request # common return type - always incluced in every # returned data set rt_fail = { "code": 400, "text": "foo bar message" } rt_s...
#!/usr/bin/python # coding: utf-8 from contestcolld import app from flask import jsonify tasks = [ { 'id': 1, 'title': u'Buy groceries', 'description': u'Milk, Cheese, Pizza, Fruit, Tylenol', 'done': False }, { 'id': 2, 'title': u'Learn Python', '...
mit
Python
570282339329239fabbfdcc3119f18656e89cfb3
fix coding style
sih4sing5hong5/tai5-uan5_gian5-gi2_phing5-tai5,sih4sing5hong5/tai5-uan5_gian5-gi2_phing5-thai5,sih4sing5hong5/tai5-uan5_gian5-gi2_phing5-tai5,sih4sing5hong5/tai5-uan5_gian5-gi2_phing5-tai5
臺灣言語平臺/介面/貢獻者.py
臺灣言語平臺/介面/貢獻者.py
# -*- coding: utf-8 -*- import random from django.http.response import JsonResponse from 臺灣言語資料庫.關係模型 import 文本校對表 def 貢獻者表(request): # 2 = 臺灣閩南語常用詞辭典, 269 = 台文華文線頂辭典 contributor_dict = {} for 文本 in 文本校對表.objects.all(): # 取出第一層 來源_id = 文本.舊文本.來源_id 來源名稱 = 文本.舊文本.來源.名 詞條名...
# -*- coding: utf-8 -*- import random from django.http.response import JsonResponse from 臺灣言語資料庫.關係模型 import 文本校對表 def 貢獻者表(request): # 2 = 臺灣閩南語常用詞辭典, 269 = 台文華文線頂辭典 contributor_dict = {} for 文本 in 文本校對表.objects.all(): # 取出第一層 來源_id = 文本.舊文本.來源_id 來源名稱 = 文本.舊文本.來源.名 詞條名...
mit
Python
06e855649be9d043f235e44f681796a0135c8df5
redefine select radius for cluster stars
adrn/globber,adrn/globber
globber/ngc5897.py
globber/ngc5897.py
from __future__ import division, print_function __author__ = "adrn <adrn@astro.columbia.edu>" # Third-party import astropy.coordinates as coord import astropy.units as u import numpy as np cluster_c = coord.SkyCoord(ra=229.352*u.degree, dec=-21.01*u.degree) cluster_pad = { 'inner': 6*u...
from __future__ import division, print_function __author__ = "adrn <adrn@astro.columbia.edu>" # Third-party import astropy.coordinates as coord import astropy.units as u import numpy as np cluster_c = coord.SkyCoord(ra=229.352*u.degree, dec=-21.01*u.degree) cluster_pad = { 'inner': 4*u...
mit
Python
3d8b368fc642274db6c60db295da93e2b78510fa
use runner from config (if not specified) on get_spider_list()
wangjun/scrapy,yarikoptic/scrapy,codebhendi/scrapy,pranjalpatil/scrapy,ndemir/scrapy,hectoruelo/scrapy,tntC4stl3/scrapy,nguyenhongson03/scrapy,cleydson/scrapy,zorojean/scrapy,kazitanvirahsan/scrapy,mgedmin/scrapy,hwsyy/scrapy,Timeship/scrapy,tagatac/scrapy,rolando-contrib/scrapy,cyrixhero/scrapy,liyy7/scrapy,w495/scrap...
scrapyd/utils.py
scrapyd/utils.py
import sys import os from subprocess import Popen, PIPE from ConfigParser import NoSectionError from scrapy.spiderqueue import SqliteSpiderQueue from scrapy.utils.python import stringify_dict, unicode_to_str from scrapyd.config import Config def get_spider_queues(config): """Return a dict of Spider Quees keyed by...
import sys import os from subprocess import Popen, PIPE from ConfigParser import NoSectionError from scrapy.spiderqueue import SqliteSpiderQueue from scrapy.utils.python import stringify_dict, unicode_to_str def get_spider_queues(config): """Return a dict of Spider Quees keyed by project name""" dbsdir = conf...
bsd-3-clause
Python
396894745bd6dec39f77cbb372f9c7f14fcca3b0
Add hardcoded camera values to avoid lots of scrolling to see the whole city
ekumenlabs/terminus,ekumenlabs/terminus
terminus/models/city.py
terminus/models/city.py
from city_model import CityModel # For the time being, the city will be our Gazebo world class City(CityModel): def __init__(self, name=None): super(City, self).__init__(name) self.ground_plane = None self.roads = [] self.blocks = [] self.buildings = [] def set_ground_...
from city_model import CityModel # For the time being, the city will be our Gazebo world class City(CityModel): def __init__(self, name=None): super(City, self).__init__(name) self.ground_plane = None self.roads = [] self.blocks = [] self.buildings = [] def set_ground_...
apache-2.0
Python
e5e23e965465aab31246240206376699d1847a74
update android version
kuastw/AP-API,JohnSounder/AP-API,JohnSounder/AP-API,kuastw/AP-API
src/kuas_api/modules/const.py
src/kuas_api/modules/const.py
#-*- coding: utf-8 -*- device_version = { "android": "2.1.0", "android_donate": "2.0.0", "ios": "1.4.3" } # Token duration in seconds token_duration = 3600 # HTTP Status Code ok = 200 no_content = 204
#-*- coding: utf-8 -*- device_version = { "android": "1.5.4", "android_donate": "2.0.0", "ios": "1.4.3" } # Token duration in seconds token_duration = 3600 # HTTP Status Code ok = 200 no_content = 204
mit
Python
6ed34c165874241008eb6760d0754d9f84f77fca
Add methods for count and add constructor parameters into Grammar class
PatrikValkovic/grammpy
grammpy/Grammar.py
grammpy/Grammar.py
#!/usr/bin/env python """ :Author Patrik Valkovic :Created 23.06.2017 16:39 :Licence GNUv3 Part of grammpy """ class Grammar: def __init__(self, terminals=[], nonterminals=[], rules=[]): self.__terminals = set() self.__nonterminals = set() # Term part def add_term(self, term): ra...
#!/usr/bin/env python """ :Author Patrik Valkovic :Created 23.06.2017 16:39 :Licence GNUv3 Part of grammpy """ class Grammar: def __init__(self): self.__terminals = set() self.__nonterminals = set() #Term part def add_term(self, term): raise NotImplementedError() def remov...
mit
Python
0334077462883a3d8a31d6aaeb1d6cd11b8e18cc
fix class name
hhatto/gruffy
gruffy/__init__.py
gruffy/__init__.py
from gruffy.accumulator_bar import AccumulatorBar from gruffy.area import Area from gruffy.bar import Bar from gruffy.bezier import Bezier from gruffy.dot import Dot from gruffy.line import Line from gruffy.pie import Pie from gruffy.sidebar import SideBar from gruffy.stacked_area import StackedArea from gruffy.stacked...
from gruffy.accumulator_bar import AccumulatorBar from gruffy.area import Area from gruffy.bar import Bar from gruffy.bezier import Bezier from gruffy.dot import Dot from gruffy.line import Line from gruffy.pie import Pie from gruffy.sidebar import SideBar from gruffy.stacked_area import StackedArea from gruffy.stacked...
mit
Python
0656f4b84baa03c5590f83a2c4785f2ce44ca548
Fix deletion test
blerer/cassandra-dtest,mambocab/cassandra-dtest,blerer/cassandra-dtest,bdeggleston/cassandra-dtest,carlyeks/cassandra-dtest,josh-mckenzie/cassandra-dtest,bdeggleston/cassandra-dtest,stef1927/cassandra-dtest,pcmanus/cassandra-dtest,aweisberg/cassandra-dtest,snazy/cassandra-dtest,riptano/cassandra-dtest,spodkowinski/cass...
deletion_test.py
deletion_test.py
from dtest import Tester from assertions import * import os, sys, time, tools from ccmlib.cluster import Cluster class TestDeletion(Tester): def gc_test(self): """ Test that tombstone are fully purge after gc_grace """ cluster = self.cluster cluster.populate(1).start() [node1] = ...
from dtest import Tester from assertions import * import os, sys, time, tools from ccmlib.cluster import Cluster class TestDeletion(Tester): def gc_test(self): """ Test that tombstone are fully purge after gc_grace """ cluster = self.cluster cluster.populate(1).start() [node1] = ...
apache-2.0
Python
76b851eb19798e992dad3f669f38cb3796f136e7
Update comments in InteriorPenalty method
firedrakeproject/gusto,firedrakeproject/dcore
gusto/diffusion.py
gusto/diffusion.py
from __future__ import absolute_import from abc import ABCMeta, abstractmethod from firedrake import TestFunction, TrialFunction, \ Function, inner, outer, grad, avg, dx, dS_h, dS_v, \ FacetNormal, LinearVariationalProblem, LinearVariationalSolver, action class Diffusion(object): """ Base class for di...
from __future__ import absolute_import from abc import ABCMeta, abstractmethod from firedrake import TestFunction, TrialFunction, \ Function, inner, outer, grad, avg, dx, dS_h, dS_v, \ FacetNormal, LinearVariationalProblem, LinearVariationalSolver, action class Diffusion(object): """ Base class for di...
mit
Python
2c07e51d6180bd4497bc01ea59e7373ecb501092
add top-level benchmarking command
Messaoud-Boudjada/dipy,JohnGriffiths/dipy,rfdougherty/dipy,sinkpoint/dipy,oesteban/dipy,jyeatman/dipy,FrancoisRheaultUS/dipy,samuelstjean/dipy,JohnGriffiths/dipy,mdesco/dipy,Messaoud-Boudjada/dipy,StongeEtienne/dipy,matthieudumont/dipy,samuelstjean/dipy,maurozucchelli/dipy,beni55/dipy,villalonreina/dipy,mdesco/dipy,vil...
dipy/__init__.py
dipy/__init__.py
""" DiPy: Analysis of MR diffusion imaging in Python ================================================ For more information, please visit http://dipy.org Subpackages ----------- :: align -- Registration, streamline alignment, volume resampling boots -- Bootstrapping algorithms core -- Sphe...
""" DiPy: Analysis of MR diffusion imaging in Python ================================================ For more information, please visit http://dipy.org Subpackages ----------- :: align -- Registration, streamline alignment, volume resampling boots -- Bootstrapping algorithms core -- Sphe...
bsd-3-clause
Python
af7d72d3699c1286b3f63e81344bb2a5c36f4bdb
Update admin.py
soplerproject/sopler,soplerproject/sopler,soplerproject/sopler
core/admin.py
core/admin.py
# -*- coding: utf-8 -*- from django.contrib import admin from core.models import List, Item, Comment from favit.models import Favorite class ListAdmin(admin.ModelAdmin): list_display = ["ListName","slug","ListOwner","ListOwnerState", "ListPubDate"] search_fields = ("ListName","slug","ListOwner") class Ite...
# -*- coding: utf-8 -*- from django.contrib import admin from core.models import List, Item, Comment from favit.models import Favorite class ListAdmin(admin.ModelAdmin): list_display = ["ListName","slug","ListOwner","ListOwnerState", "ListPubDate"] search_fields = ("ListName","slug","ListOwner") class Ite...
agpl-3.0
Python
4628f31e7fd08f9af2b831fccc6191295c7b6186
Update __init__.py
taspinar/siml
siml/__init__.py
siml/__init__.py
# siML # Copyright 2016-2020 Ahmet Taspinar # See LICENSE for details. """ Library implementing Machine Learning algorithms from scratch """ __version__ = '0.3.1' __author__ = 'Ahmet Taspinar' __license__ = 'MIT' from siml import *
# siML # Copyright 2016-2017 Ahmet Taspinar # See LICENSE for details. """ Library implementing Machine Learning algorithms from scratch """ __version__ = '0.3.0' __author__ = 'Ahmet Taspinar' __license__ = 'MIT' from siml import *
mit
Python
1be3ccc3307106e02793e521eec89c9f07753496
fix finger bug
smarttang/dnsfind
core/utils.py
core/utils.py
#coding:utf-8 import os, requests # 查报告是否存在 # 判断报告目录是否存在,不存在择新建 # 如果存在,则删除历史报告 def findreport(val): if not os.path.exists('result/'): os.mkdir('result/') else: target = 'result/'+val if os.path.exists(target): os.remove(target) # 1、查服务指纹 # 2、页面关键字筛选 class FindObj: def __init__(self,target,keyword=None)...
#coding:utf-8 import os, requests # 查报告是否存在 # 判断报告目录是否存在,不存在择新建 # 如果存在,则删除历史报告 def findreport(val): if not os.path.exists('result/'): os.mkdir('result/') else: target = 'result/'+val if os.path.exists(target): os.remove(target) # 1、查服务指纹 # 2、页面关键字筛选 class FindObj: def __init__(self,target,keyword=None)...
mit
Python
a8569dfe46c2cc44d35663d9465e18f0275306df
Use unnamed logger
singer-io/singer-python
singer/logger.py
singer/logger.py
import logging import logging.config import os def get_logger(): """Return a Logger instance appropriate for using in a Tap or a Target.""" this_dir, _ = os.path.split(__file__) path = os.path.join(this_dir, 'logging.conf') logging.config.fileConfig(path) return logging.getLogger()
import logging import logging.config import os def get_logger(): """Return a Logger instance appropriate for using in a Tap or a Target.""" this_dir, _ = os.path.split(__file__) path = os.path.join(this_dir, 'logging.conf') logging.config.fileConfig(path) return logging.getLogger('root')
apache-2.0
Python
e1025efd9432ad99ebd2d149e3527ba4609830fd
Add docstring to function
adamtheturtle/vws-python,adamtheturtle/vws-python
tests/test_exceptions/test_request_quota_reached.py
tests/test_exceptions/test_request_quota_reached.py
""" Tests for hitting the 'RequestQuotaReached' exception. """ def test_request_quota_reached() -> None: """ See https://github.com/adamtheturtle/vws-python/issues/822 for writing this test. """
""" Tests for hitting the 'RequestQuotaReached' exception. """ def test_request_quota_reached() -> None: # See https://github.com/adamtheturtle/vws-python/issues/822 for writing # this test. pass
mit
Python
96af4119986003a964aa3dfc25f8a22d9ad1c5ff
move change sign logic out of display_redis_stats()
MarcoGlauser/huey-queue-stats
huey_queue_stats/huey_queue_stats.py
huey_queue_stats/huey_queue_stats.py
#!/usr/bin/env python import os import click import redis import time from .queue import Queue @click.command() @click.option('--connection-string', '-c', default='redis://localhost:6379', help='Connection string to redis including database. for example redis://localhost:6379/0' ...
#!/usr/bin/env python import os import click import redis import time from .queue import Queue @click.command() @click.option('--connection-string', '-c', default='redis://localhost:6379', help='Connection string to redis including database. for example redis://localhost:6379/0' ...
mit
Python
248e91c5c928816c6a85a744f38a0cc64790908b
Update add_torrent.py
tpolich/transmission-remote_add_client
add_torrent.py
add_torrent.py
#!/usr/bin/env python import json import urllib2 import sys import os import base64 #load setting from the config.json file sitting in the same folder as this programs st = json.load(open(os.path.dirname(os.path.realpath(__file__))+'/config.json')) print sys.argv[1] headers = { 'content-type':'application/json', ...
#!/usr/bin/env python import json import urllib2 import sys import os import base64 #load setting from the config.json file sitting in the same folder as this programs st = json.load(open(os.path.dirname(os.path.realpath(__file__))+'/config.json')) headers = { 'content-type':'application/json', 'Authorization' : '...
mit
Python
e59c43c73689c64a4c28fa6e39783f13f606a3d0
Fix regression
ciarams87/PyU4V
PyU4V/__init__.py
PyU4V/__init__.py
# -*- coding: utf-8 -*- # __ # /__) / / / | \ / # / ( / / _/ / _ | \ / # / | """__init__.py.""" from .univmax_conn import U4VConn # noqa: F401 __title__ = 'pyu4v' __version__ = '3.0.0.17' __author__ = 'Dell EMC or its subsidiaries' __license__ = 'MIT' __copyright__ = 'Copyright 2...
# -*- coding: utf-8 -*- # __ # /__) / / / | \ / # / ( / / _/ / _ | \ / # / | """__init__.py.""" from .univmax_conn import U4VConn # noqa: F401 __title__ = 'pyu4v' __version__ = '3.0.0.17' __author__ = 'Dell EMC or it\'s subsidiaries' __license__ = 'MIT' __copyright__ = 'Copyright...
mit
Python
66cb28e797f4a5aaf03ed65d5d9685bd429bc9e9
remove old test
yashodhank/frappe,StrellaGroup/frappe,mhbu50/frappe,saurabh6790/frappe,almeidapaulopt/frappe,yashodhank/frappe,StrellaGroup/frappe,saurabh6790/frappe,adityahase/frappe,vjFaLk/frappe,yashodhank/frappe,vjFaLk/frappe,frappe/frappe,vjFaLk/frappe,mhbu50/frappe,frappe/frappe,almeidapaulopt/frappe,yashodhank/frappe,adityahase...
frappe/website/doctype/web_form/test_web_form.py
frappe/website/doctype/web_form/test_web_form.py
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt from __future__ import unicode_literals import frappe import unittest, json from frappe.website.render import build_page from frappe.website.doctype.web_form.web_form import accept test_records = frappe.get_test_records('Web Form'...
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt from __future__ import unicode_literals import frappe import unittest, json from frappe.website.render import build_page from frappe.website.doctype.web_form.web_form import accept test_records = frappe.get_test_records('Web Form'...
mit
Python
16d72852274310e2141e69435c594ede6cda8931
Fix the TimeoutManager test
Navisjon/uwh-refbox
refbox/timeoutmanager_test.py
refbox/timeoutmanager_test.py
from . import timeoutmanager from uwh.gamemanager import GameManager, GameState, TimeoutState, Penalty, TeamColor class Observable(object): def __init__(self): self._value = None def get(self): return self._value def set(self, x): self._value = x def test_click(): mgr = GameM...
from . import timeoutmanager from uwh.gamemanager import GameManager, GameState, TimeoutState, Penalty, TeamColor class Observable(object): def __init__(self): self._value = None def get(self): return self._value def set(self, x): self._value = x def test_click(): mgr = GameM...
bsd-3-clause
Python
c34f059b66bfe6ccc7c110ce959a1126db6cd8a9
fix email query (#5605)
frappe/frappe,adityahase/frappe,saurabh6790/frappe,frappe/frappe,RicardoJohann/frappe,yashodhank/frappe,ESS-LLP/frappe,adityahase/frappe,adityahase/frappe,saurabh6790/frappe,mhbu50/frappe,saurabh6790/frappe,neilLasrado/frappe,adityahase/frappe,StrellaGroup/frappe,neilLasrado/frappe,chdecultot/frappe,StrellaGroup/frappe...
frappe/email/__init__.py
frappe/email/__init__.py
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe from frappe.desk.reportview import build_match_conditions def sendmail_to_system_managers(subject, content): frappe.sendmail(recipients=get_system_managers(), subj...
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe from frappe.desk.reportview import build_match_conditions def sendmail_to_system_managers(subject, content): frappe.sendmail(recipients=get_system_managers(), subj...
mit
Python
9e8f2ed710ddf6459f4e623de89e22b6d93183fb
fix class ref
dmd/IBM-LPFK,dmd/IBM-LPFK,dmd/IBM-LPFK,dmd/IBM-LPFK
toggler.py
toggler.py
#!/usr/bin/env python from lpfk import lpfk def toggler(): lp = lpfk() while True: cmd = lp.get() if not len(cmd): continue if cmd == lp.RETRANSMIT: print ('got error, resending') lp.update_lights() continue cmd = ord(cmd) ...
#!/usr/bin/env python from lpfk import lpfk def toggler(): lp = lpfk() while True: cmd = lp.get() if not len(cmd): continue if cmd == lp.RETRANSMIT: print ('got error, resending') update_lights() continue cmd = ord(cmd) ...
apache-2.0
Python
1ef3c6b9b116ceb892b9777431cce3bb0f735814
Hide plugin settings page
indico/indico-plugins,indico/indico-plugins,indico/indico-plugins,indico/indico-plugins,ThiefMaster/indico-plugins,ThiefMaster/indico-plugins,ThiefMaster/indico-plugins,ThiefMaster/indico-plugins
importer/indico_importer/__init__.py
importer/indico_importer/__init__.py
# This file is part of Indico. # Copyright (C) 2002 - 2014 European Organization for Nuclear Research (CERN). # # Indico is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 3 of the # License, or (a...
# This file is part of Indico. # Copyright (C) 2002 - 2014 European Organization for Nuclear Research (CERN). # # Indico is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 3 of the # License, or (a...
mit
Python
1c07cfab20bd68af7a6ae1fb0a2a2e74a409998a
Add save_on_top in document admin
fin/froide,fin/froide,fin/froide,stefanw/froide,stefanw/froide,fin/froide,stefanw/froide,stefanw/froide,stefanw/froide
froide/document/admin.py
froide/document/admin.py
from django.contrib import admin from django.utils import timezone from django.utils.translation import ugettext_lazy as _ from .models import Document, Page, PageAnnotation from .tasks import process_document class PageInline(admin.StackedInline): model = Page raw_id_fields = ('document',) class DocumentA...
from django.contrib import admin from django.utils import timezone from django.utils.translation import ugettext_lazy as _ from .models import Document, Page, PageAnnotation from .tasks import process_document class PageInline(admin.StackedInline): model = Page raw_id_fields = ('document',) class DocumentA...
mit
Python
0497f140a4c8c6d9de30511d3dc084056f69badb
Add slug of collection title on collection upload
stefanw/froide,stefanw/froide,fin/froide,stefanw/froide,fin/froide,fin/froide,stefanw/froide,stefanw/froide,fin/froide
froide/document/forms.py
froide/document/forms.py
from django import forms from django.utils.translation import gettext_lazy as _ from django.conf import settings from django.template.defaultfilters import slugify from taggit.forms import TagField, TagWidget from froide.helper.widgets import BootstrapCheckboxInput from .tasks import store_document_upload from .mode...
from django import forms from django.utils.translation import gettext_lazy as _ from django.conf import settings from taggit.forms import TagField, TagWidget from froide.helper.widgets import BootstrapCheckboxInput from .tasks import store_document_upload from .models import Document, DocumentCollection class Docu...
mit
Python
0a2b15c20217b1213de5137f9029c2ca3da09b69
add dao.pws test
uw-it-aca/myuw,uw-it-aca/myuw,uw-it-aca/myuw,uw-it-aca/myuw
myuw/tests.py
myuw/tests.py
from django.test import TestCase from myuw.test.models import TestUserNotices from myuw.test.academic_events import TestAcademicEvents from myuw.test.dao import TestDao from myuw.test.dao.calendar_mapping import TestCalendarMapping from myuw.test.dao.calendar import TestCalendar from myuw.test.dao.course_color import T...
from django.test import TestCase from myuw.test.models import TestUserNotices from myuw.test.academic_events import TestAcademicEvents from myuw.test.dao import TestDao from myuw.test.dao.course_color import TestCourseColors from myuw.test.dao.registered_term import TestRegisteredTerm from myuw.test.dao.schedule import...
apache-2.0
Python
2459419b103aff1425b65be8bcbf876f7b4c1b12
update refresh method and stop calling it on failed requests
carlegbert/wholenote-cli
wnote/auth.py
wnote/auth.py
from base64 import b64encode from os import environ, makedirs, path import requests import click from wnote.exceptions import FailedRequestException WNOTE_LOCAL_DIR = path.join(environ['HOME'], '.local', 'wnote') REFRESH_TOKEN_LOC = path.join(WNOTE_LOCAL_DIR, 'rtkn') def construct_basic_header(email, password): ...
from base64 import b64encode from os import path import requests import click from wnote.exceptions import FailedRequestException def construct_basic_header(email, password): """Construct b64 encoded header for HTTP Basic auth""" empw = '{0}:{1}'.format(email, password) empw_enc = b64encode(empw.encode(...
mit
Python
c81005464efc0b32ba7a9002727bf4848b4c1f27
save bookmark: make timestamp optional
heutagogy/heutagogy-backend,heutagogy/heutagogy-backend
heutagogy/views.py
heutagogy/views.py
from heutagogy import app from flask import request, jsonify import sqlite3 import datetime conn = sqlite3.connect('heutagogy.sqlite3') c = conn.cursor() c.execute('''CREATE TABLE IF NOT EXISTS bookmarks (date text, url text, title text)''') conn.commit() @app.route('/') def index(): return 'Hello, ...
from heutagogy import app from flask import request, jsonify import sqlite3 conn = sqlite3.connect('heutagogy.sqlite3') c = conn.cursor() c.execute('''CREATE TABLE IF NOT EXISTS bookmarks (date text, url text, title text)''') conn.commit() @app.route('/') def index(): return 'Hello, world!' @app.ro...
agpl-3.0
Python
75d81aa1a16b527f1469c45cd999578da330fcc3
Update wrap_text.py to support Tab indentation
STealthy-and-haSTy/SublimeScraps,STealthy-and-haSTy/SublimeScraps
plugins/wrap_text.py
plugins/wrap_text.py
import sublime import sublime_plugin import textwrap # related reading: https://stackoverflow.com/a/46315431/4473405 class WrapTextCommand(sublime_plugin.TextCommand): """ Reflow the selected text to wrap after the specified width. This is handy for Python docstrings - sometimes you need to edit exis...
import sublime import sublime_plugin import textwrap # related reading: https://stackoverflow.com/a/46315431/4473405 class WrapTextCommand(sublime_plugin.TextCommand): """ Reflow the selected text to wrap after the specified width. This is handy for Python docstrings - sometimes you need to edit exis...
mit
Python
8df441d822cdff062e4476b4b85a4fdacb62b60c
Increment patchlevel to 2.2.3 (#399)
he7d3r/revscoring,wiki-ai/revscoring
revscoring/about.py
revscoring/about.py
__name__ = "revscoring" __version__ = "2.2.3" __author__ = "Aaron Halfaker" __author_email__ = "ahalfaker@wikimedia.org" __description__ = ("A set of utilities for generating quality scores for " + "MediaWiki revisions") __url__ = "https://github.com/wiki-ai/revscoring" __license__ = "MIT"
__name__ = "revscoring" __version__ = "2.2.2" __author__ = "Aaron Halfaker" __author_email__ = "ahalfaker@wikimedia.org" __description__ = ("A set of utilities for generating quality scores for " + "MediaWiki revisions") __url__ = "https://github.com/wiki-ai/revscoring" __license__ = "MIT"
mit
Python
b0df8e2893b244494abc87036e66dad4cc5223f4
Fix ReferenceError for logger
SonarWAN/sonarwan-core,SonarWAN/sonarwan-core
sonarwan/main.py
sonarwan/main.py
from arguments import Arguments from sonarwan import SonarWan from logger import logger def main(): parser = Arguments.create_parser() args = parser.parse_args() arguments = Arguments(args.json, args.patterns, args.inference, args.services, args.progress, args.output) sonarw...
from arguments import Arguments from sonarwan import SonarWan def main(): parser = Arguments.create_parser() args = parser.parse_args() arguments = Arguments(args.json, args.patterns, args.inference, args.services, args.progress, args.output) sonarwan = SonarWan(arguments) ...
mit
Python
cdffdb973886753183c47f0777829357edf4f914
fix up the compatible problem of python 2.x
tonyseek/docker-tunnel
docker_tunnel.py
docker_tunnel.py
#!/usr/bin/env python import os import subprocess import contextlib import distutils.spawn import click __version__ = '0.1.2' __all__ = ['local_forward_tunnel', 'main'] def devnull(mode): if hasattr(subprocess, 'DEVNULL'): return subprocess.DEVNULL else: return open(os.devnull, mode) @co...
#!/usr/bin/env python import os import subprocess import contextlib import distutils.spawn import click __version__ = '0.1.2' __all__ = ['local_forward_tunnel', 'main'] @contextlib.contextmanager def local_forward_tunnel(local_addr, remote_addr, hostname): cmd = distutils.spawn.find_executable('ssh') or '/usr...
mit
Python
8149f170c512ced86338863d0f115f7bc0058e14
update version
theonion/djes
djes/__init__.py
djes/__init__.py
__version__ = "0.1.93" default_app_config = "djes.apps.DJESConfig"
__version__ = "0.1.92" default_app_config = "djes.apps.DJESConfig"
mit
Python
8d18df92373c1fd4c2cfa2fb59f5f49a4f89b78f
Add option for determining requirement of 'state' parameter.
vden/djoauth2-ng,Locu/djoauth2,seler/djoauth2,vden/djoauth2-ng,seler/djoauth2,Locu/djoauth2
djoauth2/conf.py
djoauth2/conf.py
# coding: utf-8 from django.config import settings from appconf import AppConf class DJOAuthConf(AppConf): class Meta: prefix = 'djoauth' ACCESS_TOKEN_LENGTH = 30 ACCESS_TOKEN_LIFETIME = 3600 ACCESS_TOKENS_REFRESHABLE = True AUTHORIZATION_CODE_LENGTH = 30 AUTHORIZATION_CODE_LIFETIME = 120 CLIENT_K...
# coding: utf-8 from django.config import settings from appconf import AppConf class DJOAuthConf(AppConf): class Meta: prefix = 'djoauth' ACCESS_TOKEN_LENGTH = 30 ACCESS_TOKEN_LIFETIME = 3600 ACCESS_TOKENS_REFRESHABLE = True AUTHORIZATION_CODE_LENGTH = 30 AUTHORIZATION_CODE_LIFETIME = 120 CLIENT_K...
mit
Python
6a477802d885f2fb64a7dfa1d933ce2adfd597e0
bump version to 0.2.7
guyingbo/cowfish
cowfish/__init__.py
cowfish/__init__.py
"A useful asynchronous library that is built on top of aiobotocore" __version__ = "0.2.7"
"A useful asynchronous library that is built on top of aiobotocore" __version__ = "0.2.6"
mit
Python
1e91b4ad94dd4a986adce22350cec8bd24fa4865
Test correctly incrementing stream IDs.
Lukasa/spdypy
test/test_connection.py
test/test_connection.py
# -*- coding: utf-8 -*- """ test/test_connection ~~~~~~~~~~~~~~~~~~~~~ Tests for the SPDYConnection object. """ import spdypy import spdypy.connection from .test_stream import MockConnection class TestSPDYConnection(object): def test_can_create_connection(self): conn = spdypy.SPDYConnection(None) ...
# -*- coding: utf-8 -*- """ test/test_connection ~~~~~~~~~~~~~~~~~~~~~ Tests for the SPDYConnection object. """ import spdypy import spdypy.connection class TestSPDYConnection(object): def test_can_create_connection(self): conn = spdypy.SPDYConnection(None) assert conn class TestSPDYConnectionS...
mit
Python
e202cc8b8dc8a4067408256e88f4388bf251e1e0
fix api to report github issue
vedarthk/exreporter
exreporter/exreporter.py
exreporter/exreporter.py
# -*- coding: utf-8 -*- """ exporter.exporter ~~~~~~~~~~~~~~~~~ This module implements interface for Exporter library. :copyright: (c) 2014 by Vedarth Kulkarni. :license: MIT, see LICENSE for more details. """ from .stores import Stores from .reporter import Reporter def report_issue(credentials, store_name, **kw...
# -*- coding: utf-8 -*- """ exporter.exporter ~~~~~~~~~~~~~~~~~ This module implements interface for Exporter library. :copyright: (c) 2014 by Vedarth Kulkarni. :license: MIT, see LICENSE for more details. """ from .stores import Stores from .reporter import Reporter def report_issue(credentials, store_name, **kw...
mit
Python
22dec079249725ddfa3eddfb632db1ebbf2bc8d7
Bump version to 1.3.1
ecometrica/gdal2mbtiles
gdal2mbtiles/__init__.py
gdal2mbtiles/__init__.py
# -*- coding: utf-8 -*- # Licensed to Ecometrica under one or more contributor license # agreements. See the NOTICE file distributed with this work # for additional information regarding copyright ownership. # Ecometrica licenses this file to you under the Apache # License, Version 2.0 (the "License"); you may not us...
# -*- coding: utf-8 -*- # Licensed to Ecometrica under one or more contributor license # agreements. See the NOTICE file distributed with this work # for additional information regarding copyright ownership. # Ecometrica licenses this file to you under the Apache # License, Version 2.0 (the "License"); you may not us...
apache-2.0
Python
875473c711c56d7f593eadc96707dada7db280e0
Update docs version
pinax/pinax-ratings,arthur-wsw/pinax-ratings,predatell/agon-ratings,pinax/pinax-ratings,pinax/pinax-ratings,GeoNode/geonode-ratings,predatell/agon-ratings,rizumu/pinax-ratings,GeoNode/geonode-ratings,rizumu/pinax-ratings,arthur-wsw/pinax-ratings,predatell/agon-ratings,GeoNode/geonode-ratings,rizumu/pinax-ratings,arthur...
docs/conf.py
docs/conf.py
extensions = [] templates_path = [] source_suffix = '.rst' master_doc = 'index' project = u'agon_ratings' copyright = u'2011, Eldarion' version = '0.1.2' release = '0.1.2' exclude_patterns = ['_build'] pygments_style = 'sphinx' html_theme = 'default' html_static_path = [] htmlhelp_basename = 'agon_ratingsdoc' latex_doc...
extensions = [] templates_path = [] source_suffix = '.rst' master_doc = 'index' project = u'agon_ratings' copyright = u'2011, Eldarion' version = '0.1' release = '0.1' exclude_patterns = ['_build'] pygments_style = 'sphinx' html_theme = 'default' html_static_path = [] htmlhelp_basename = 'agon_ratingsdoc' latex_documen...
mit
Python
0c345309a50bd2c835ff1b9aa1d93979302630dc
bump version to 0.7.0
martin-hunt/hublib
hublib/__init__.py
hublib/__init__.py
from pint import UnitRegistry ureg = UnitRegistry() ureg.autoconvert_offset_to_baseunit = True Q_ = ureg.Quantity __version__ = "0.7.0"
from pint import UnitRegistry ureg = UnitRegistry() ureg.autoconvert_offset_to_baseunit = True Q_ = ureg.Quantity __version__ = "0.6.7"
mit
Python
e7e59baf49ecb60174c943e67f2a0ef878fe0f7f
add bb stuff to secrets template
Visgean/commitstats,Visgean/commitstats,Visgean/commitstats
secrets_template.py
secrets_template.py
username = 'visgean' personal_token = '' bitbucket_username = 'visgean' bitbucket_email = '' git_emails = ['']
username = 'visgean' personal_token = ''
mit
Python
0840f0870c663c6bf74e54043a5a12db6b154339
Add test_check_user_password
stvreumi/electronic-blackboard,stvreumi/electronic-blackboard,SWLBot/electronic-blackboard,chenyang14/electronic-blackboard,SWLBot/electronic-blackboard,Billy4195/electronic-blackboard,stvreumi/electronic-blackboard,chenyang14/electronic-blackboard,Billy4195/electronic-blackboard,SWLBot/electronic-blackboard,Billy4195/...
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
6200b0655f56ecfe85095d695c4914e390520536
Add maybe right connection for name
jamesturk/tot,jamesturk/tot,jamesturk/tot,jamesturk/tot,jamesturk/tot
preferences/forms.py
preferences/forms.py
from django import forms from registration.forms import RegistrationFormUniqueEmail from preferences.models import Preferences from opencivicdata.models.people_orgs import Person class CustomModelFilter(forms.ModelChoiceField): def label_from_instance(self, obj): return "%s" % (obj.name) class Preferen...
from django import forms from registration.forms import RegistrationFormUniqueEmail from preferences.models import Preferences from opencivicdata.models.people_orgs import Person class CustomModelFilter(forms.ModelChoiceField): def label_from_instance(self, obj): return "%s" % (obj.name) class Preferen...
mit
Python
e7bf61ea5d0fdbb5f319311e90911bbaf47dcdbd
use a module stash to not trip up coverage
sileht/urllib3,boyxuper/urllib3,mikelambert/urllib3,urllib3/urllib3,luca3m/urllib3,Disassem/urllib3,Geoion/urllib3,boyxuper/urllib3,silveringsea/urllib3,gardner/urllib3,Geoion/urllib3,haikuginger/urllib3,sileht/urllib3,Lukasa/urllib3,denim2x/urllib3,luca3m/urllib3,sigmavirus24/urllib3,silveringsea/urllib3,tutumcloud/ur...
test/test_zzz_no_ssl.py
test/test_zzz_no_ssl.py
""" Test what happens if Python was built without SSL * Everything that does not involve HTTPS should still work * HTTPS requests must fail with an error that points at the ssl module NOTE: This file is intentionally named to be sorted *last*. We mess with the import machinery which breaks mock, so we want t...
""" Test what happens if Python was built without SSL * Everything that does not involve HTTPS should still work * HTTPS requests must fail with an error that points at the ssl module NOTE: This file is intentionally named to be sorted *last*. We mess with the import machinery which breaks mock, so we want t...
mit
Python
d73be0911ee6a0fc299a0877c9aef80702a5e95e
improve default for critical_limit in the load module
eBrnd/i3pystatus,Elder-of-Ozone/i3pystatus,juliushaertl/i3pystatus,facetoe/i3pystatus,fmarchenko/i3pystatus,teto/i3pystatus,paulollivier/i3pystatus,plumps/i3pystatus,onkelpit/i3pystatus,teto/i3pystatus,ismaelpuerto/i3pystatus,claria/i3pystatus,facetoe/i3pystatus,schroeji/i3pystatus,onkelpit/i3pystatus,plumps/i3pystatus...
i3pystatus/load.py
i3pystatus/load.py
from i3pystatus import IntervalModule from multiprocessing import cpu_count class Load(IntervalModule): """ Shows system load """ format = "{avg1} {avg5}" settings = ( ("format", "format string used for output. {avg1}, {avg5} and {avg15} are the load average of the last one, five...
from i3pystatus import IntervalModule class Load(IntervalModule): """ Shows system load """ format = "{avg1} {avg5}" settings = ( ("format", "format string used for output. {avg1}, {avg5} and {avg15} are the load average of the last one, five and fifteen minutes, respectively. {t...
mit
Python
23af68f85908d42ca00d03f0ce65fb9a817eade1
add docs timeout
gdsfactory/gdsfactory,gdsfactory/gdsfactory
docs/conf.py
docs/conf.py
from gdsfactory.types import ComponentFactoryDict # from gdsfactory import types # type_aliases = autodoc_type_aliases = {type: str(type) for type in dir(types)} autodoc_type_aliases = {ComponentFactoryDict: "ComponentFactoryDict"} project = "gdsfactory" release = "4.1.0" copyright = "2019, PsiQ" author = "PsiQ" ht...
from gdsfactory.types import ComponentFactoryDict # from gdsfactory import types # type_aliases = autodoc_type_aliases = {type: str(type) for type in dir(types)} autodoc_type_aliases = {ComponentFactoryDict: "ComponentFactoryDict"} project = "gdsfactory" release = "4.1.0" copyright = "2019, PsiQ" author = "PsiQ" ht...
mit
Python
292ba352a931adcb159178f7d10a0261f196622b
Fix incorrect version in __init__.py
aspuru-guzik-group/selfies
selfies/__init__.py
selfies/__init__.py
#!/usr/bin/env python """ SELFIES: a robust representation of semantically constrained graphs with an example application in chemistry. SELFIES (SELF-referencIng Embedded Strings) is a general-purpose, sequence-based, robust representation of semantically constrained graphs. It is based on a Chomsky type-2 g...
#!/usr/bin/env python """ SELFIES: a robust representation of semantically constrained graphs with an example application in chemistry. SELFIES (SELF-referencIng Embedded Strings) is a general-purpose, sequence-based, robust representation of semantically constrained graphs. It is based on a Chomsky type-2 g...
apache-2.0
Python
73c72e3723c20019bb839ba7cd4494483fb65c0a
Update (c) year and line
pika/pika,vitaly-krugl/pika
docs/conf.py
docs/conf.py
# -*- coding: utf-8 -*- import sys sys.path.insert(0, '../') #needs_sphinx = '1.0' extensions = ['sphinx.ext.autodoc', 'sphinx.ext.viewcode', 'sphinx.ext.intersphinx'] intersphinx_mapping = {'python': ('https://docs.python.org/3/', 'https://docs.python.org/3/objects.inv...
# -*- coding: utf-8 -*- import sys sys.path.insert(0, '../') #needs_sphinx = '1.0' extensions = ['sphinx.ext.autodoc', 'sphinx.ext.viewcode', 'sphinx.ext.intersphinx'] intersphinx_mapping = {'python': ('https://docs.python.org/3/', 'https://docs.python.org/3/objects.inv...
bsd-3-clause
Python
818a88e7c6a5fee7522556be5b846710d9da4eee
fix intersphinx for PIL
numberoverzero/bloop,numberoverzero/bloop
docs/conf.py
docs/conf.py
import sys import pkg_resources import sphinx_rtd_theme extensions = [ 'sphinx.ext.autodoc', 'sphinx.ext.intersphinx', 'sphinx.ext.viewcode', 'sphinx.ext.napoleon' ] templates_path = ['_templates'] master_doc = 'index' project = 'bloop' copyright = '2016, Joe Cross' author = 'Joe Cross' try: re...
import sys import pkg_resources import sphinx_rtd_theme extensions = [ 'sphinx.ext.autodoc', 'sphinx.ext.intersphinx', 'sphinx.ext.viewcode', 'sphinx.ext.napoleon' ] templates_path = ['_templates'] master_doc = 'index' project = 'bloop' copyright = '2016, Joe Cross' author = 'Joe Cross' try: re...
mit
Python
3cfb623b16aa5e52f3617a8d250b58a74b30b65d
Revert "Should break travis integration"
pinax/pinax-project-forums,pinax/pinax-project-forums
project_name/wsgi.py
project_name/wsgi.py
""" WSGI config for {{ project_name }} project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via the ``WSGI_APP...
""" WSGI config for {{ project_name }} project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via the ``WSGI_APP...
mit
Python
0acc4520653f1af42d4d8e0c4951314f714da7ea
Bump version to 1.0.0
treyhunner/django-email-log,treyhunner/django-email-log
email_log/__init__.py
email_log/__init__.py
default_app_config = 'email_log.apps.EmailLogConfig' __version__ = '1.0.0'
default_app_config = 'email_log.apps.EmailLogConfig' __version__ = '0.2.0'
mit
Python
6557759188de0a6d2d2cdb4582d92c83462b0347
Fix Python 3.4 correctly.
tdaede/rd_tool,tdaede/rd_tool
utility.py
utility.py
#!/usr/bin/env python3 from datetime import datetime #our timestamping function, accurate to milliseconds #(remove [:-3] to display microseconds) def get_time(): return datetime.now().strftime("%Y-%m-%d %H:%M:%S.%f")[:-3] def rd_print(log, *args, **kwargs): print(get_time(), *args, **kwargs) if log: ...
#!/usr/bin/env python3 from datetime import datetime #our timestamping function, accurate to milliseconds #(remove [:-3] to display microseconds) def get_time(): return datetime.now().strftime("%Y-%m-%d %H:%M:%S.%f")[:-3] def rd_print(log, *args, **kwargs): print(get_time(), *args, **kwargs) if log: ...
bsd-2-clause
Python
4218ba48394eb5da35a8d1d34476b63b66c6bfa6
fix #19
PuZheng/lejian-backend,PuZheng/lejian-backend,PuZheng/lejian-backend,PuZheng/lejian-backend
genuine_ap/rcmd/views.py
genuine_ap/rcmd/views.py
# -*- coding: UTF-8 -*- from flask import jsonify, request from genuine_ap import utils, models from . import rcmd_ws_page @rcmd_ws_page.route('/rcmd-list') def rcmd_list(): spu_id = request.args['spu_id'] longitue = request.args.get('longitue', None) latitude = request.args.get('latitude', None) kind...
# -*- coding: UTF-8 -*- from flask import jsonify, request from genuine_ap import utils, models from . import rcmd_ws_page @rcmd_ws_page.route('/rcmd-list') def rcmd_list(): spu_id = request.args['spu_id'] longitue = request.args.get('longitue', None) latitude = request.args.get('latitude', None) kind...
mit
Python
baae1567d07e76b3b789b4eed388c677352f8181
update default message timeout
rdubigny/home-alarm,rdubigny/home-alarm
parameters.py
parameters.py
bluetooth_lookup_timeout = 3 brightpi_turnoff_timer = 5 camera_rotation = 0 door_hit_alert_duration = 1 door_opening_alert_duration = 15 lightup_duration = 120 main_interval_between_scan_while_armed = 30 main_interval_between_scan_while_disarmed = 300 message_timeout = 0.2 siren_alert_duration = 120 sms_min_interval_be...
bluetooth_lookup_timeout = 3 brightpi_turnoff_timer = 5 camera_rotation = 0 door_hit_alert_duration = 1 door_opening_alert_duration = 15 lightup_duration = 120 main_interval_between_scan_while_armed = 30 main_interval_between_scan_while_disarmed = 300 message_timeout = 0.1 siren_alert_duration = 120 sms_min_interval_be...
mit
Python
30ddc4ddde3703f35ba7a240bc12c827281ef1a2
Standardize to list of names for emoticons directly when parsing the list
Fantomas42/django-emoticons,Fantomas42/django-emoticons
emoticons/settings.py
emoticons/settings.py
"""Settings for emoticons app""" import re from django.conf import settings try: unicode = unicode except NameError: # Python 3 unicode = str basestring = (str, bytes) emoticons_default_list = ( (':(', 'sad.gif'), (';)', 'wink.gif'), ('o_O', 'eek.gif'), (':)', 'smile.gif'), (':D', '...
"""Settings for emoticons app""" import re from django.conf import settings try: unicode = unicode except NameError: # Python 3 unicode = str basestring = (str, bytes) emoticons_default_list = ( (':(', 'sad.gif'), (';)', 'wink.gif'), ('o_O', 'eek.gif'), (':)', 'smile.gif'), (':D', '...
bsd-3-clause
Python
88ca22bc6168c3a0086ca6d7e8cd41d0ce1baa95
Set version v1.14.3
atztogo/phono3py,atztogo/phono3py,atztogo/phono3py,atztogo/phono3py
phono3py/version.py
phono3py/version.py
# Copyright (C) 2013 Atsushi Togo # All rights reserved. # # This file is part of phonopy. # # 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 # notic...
# Copyright (C) 2013 Atsushi Togo # All rights reserved. # # This file is part of phonopy. # # 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 # notic...
bsd-3-clause
Python
10c1a8b67303d82863cec9ab58df10dbdcfa0250
make session currency code visible for accurate page caching
racitup/django-currencies,racitup/django-currencies,panosl/django-currencies,marcosalcazar/django-currencies,marcosalcazar/django-currencies,panosl/django-currencies
currencies/views.py
currencies/views.py
# -*- coding: utf-8 -*- from django.utils.http import is_safe_url from django.http import HttpResponseRedirect from django.views.decorators.cache import never_cache from .models import Currency from .conf import SESSION_KEY @never_cache def set_currency(request): next, currency_code = ( request.POST.get...
# -*- coding: utf-8 -*- from django.utils.http import is_safe_url from django.http import HttpResponseRedirect from django.views.decorators.cache import never_cache from .models import Currency from .conf import SESSION_KEY @never_cache def set_currency(request): next, currency_code = ( request.POST.get...
bsd-3-clause
Python
102a1e2f8f3d3544cb7c6c7b0fdbca3732088b78
Update version to 0.2.7-fork-edx-2
edx/django-oauth2-provider,fyber/django-oauth2-provider,sprintly/django-oauth2-provider,fyber/django-oauth2-provider,sprintly/django-oauth2-provider,edx/django-oauth2-provider
provider/__init__.py
provider/__init__.py
__version__ = "0.2.7-fork-edx-2"
__version__ = "0.2.7-fork-edx-1"
mit
Python
abf457301d72dce59fbc009e8d2b393674487c7c
Add versionadded to pkg beacon
saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt
salt/beacons/pkg.py
salt/beacons/pkg.py
# -*- coding: utf-8 -*- ''' Watch for pkgs that have upgrades, then fire an event. .. versionadded:: Boron ''' # Import python libs from __future__ import absolute_import __virtualname__ = 'pkg' import logging log = logging.getLogger(__name__) def __virtual__(): ''' Only load if strace is installed ''...
# -*- coding: utf-8 -*- ''' Watch for pkgs that have upgrades then fire an event ''' # Import python libs from __future__ import absolute_import __virtualname__ = 'pkg' import logging log = logging.getLogger(__name__) def __virtual__(): ''' Only load if strace is installed ''' return __virtualname_...
apache-2.0
Python
bb625fc1a8cb272010df440b2a79c8a410b7e10a
reformat code
rlowrance/python_lib,rlowrance/python_lib
pickle_utilities.py
pickle_utilities.py
import cPickle as pickle import os.path import pdb def unpickle_file( path=None, process_unpickled_object=None, on_EOFError=None, on_ValueError=None, on_FileNotExists=None, object_class_file=None, ): 'unpickle each object in the file at the path' # NOTE: caller must define the type...
import cPickle as pickle import os.path import pdb def unpickle_file(path=None, process_unpickled_object=None, on_EOFError=None, on_ValueError=None, on_FileNotExists=None): 'unpicckle each object in the file at the path' if not os.path.exists(path): if on_FileNotExists is None: return # s...
apache-2.0
Python
a507ce3b914e5a1e205340929b8cb9c92c4468e4
rearrange a few lines
yanguojun/pirate-get,jebaum/pirate-get,jebaum/pirate-get,eyalzek/pirate-get,vikstrous/pirate-get,vikstrous/pirate-get,vpavlin/pirate-get,yanguojun/pirate-get,eyalzek/pirate-get
pirate-get.py
pirate-get.py
#!/usr/bin/env python import webbrowser import urllib import urllib2 import re from HTMLParser import HTMLParser import argparse # create a subclass and override the handler methods class MyHTMLParser(HTMLParser): title = '' q = '' state = 'looking' results = [] def __init__(self, q): HTM...
#!/usr/bin/env python import webbrowser import urllib import urllib2 import re from HTMLParser import HTMLParser import argparse # create a subclass and override the handler methods class MyHTMLParser(HTMLParser): title = '' q = '' state = 'looking' results = [] def __init__(self, q): HTM...
agpl-3.0
Python
598274a278351b508a01232f3bcb8da359129297
Fix configure arg to libksba (#13352)
iulian787/spack,iulian787/spack,LLNL/spack,LLNL/spack,iulian787/spack,LLNL/spack,LLNL/spack,iulian787/spack,LLNL/spack,iulian787/spack
var/spack/repos/builtin/packages/libksba/package.py
var/spack/repos/builtin/packages/libksba/package.py
# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class Libksba(AutotoolsPackage): """Libksba is a library to make the tasks of working with X.509...
# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class Libksba(AutotoolsPackage): """Libksba is a library to make the tasks of working with X.509...
lgpl-2.1
Python
40414e289a125a0fe8ebbf9c7bb1bd21004a501b
Fix name of cron fiel in chmod command
quantopian/PenguinDome,quantopian/PenguinDome
client/initialize.py
client/initialize.py
#!/usr/bin/env python3 import argparse import os from tempfile import NamedTemporaryFile from textwrap import dedent import shutil from qlmdm import top_dir from qlmdm.prompts import get_bool os.chdir(top_dir) parser = argparse.ArgumentParser( description='Finalize installation of the qlmdm client.', ) parser...
#!/usr/bin/env python3 import argparse import os from tempfile import NamedTemporaryFile from textwrap import dedent import shutil from qlmdm import top_dir from qlmdm.prompts import get_bool os.chdir(top_dir) parser = argparse.ArgumentParser( description='Finalize installation of the qlmdm client.', ) parser...
apache-2.0
Python
5da7a079c57655184565c3a370f51ba7a132d3dc
Add BLOCK_COLORS to package namespace
radames/picraft,waveform80/picraft
picraft/__init__.py
picraft/__init__.py
# vim: set et sw=4 sts=4 fileencoding=utf-8: # # An alternate Python Minecraft library for the Rasperry-Pi # Copyright (c) 2013-2015 Dave Jones <dave@waveform.org.uk> # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # ...
# vim: set et sw=4 sts=4 fileencoding=utf-8: # # An alternate Python Minecraft library for the Rasperry-Pi # Copyright (c) 2013-2015 Dave Jones <dave@waveform.org.uk> # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # ...
bsd-3-clause
Python
029d3e8c399d07854db7717162cdf7594b91688f
Bump version #
matplotlib/basemap,guziy/basemap,guziy/basemap,matplotlib/basemap
data/setup.py
data/setup.py
from distutils.core import setup import os datadir = os.environ.get('BASEMAP_DATA_PATH') if not datadir: datadir ='share/basemap' setup( version = "0.8", description = "boundary data for basemap matplotlib toolkit", url = "http://matplotlib.sourceforge.net/toolkits.html", dow...
from distutils.core import setup import os datadir = os.environ.get('BASEMAP_DATA_PATH') if not datadir: datadir ='share/basemap' setup( version = "0.7", description = "boundary data for basemap matplotlib toolkit", url = "http://matplotlib.sourceforge.net/toolkits.html", dow...
mit
Python
fb61f14acfc08c737430d4709e6271ddf5bbf551
allow whitespace in inline config
myint/rstcheck,myint/rstcheck
src/rstcheck/inline_config.py
src/rstcheck/inline_config.py
"""Inline config comment functionality.""" import re import typing RSTCHECK_COMMENT_REGEX = re.compile(r"\.\. rstcheck:") class RstcheckCommentSyntaxError(Exception): """Syntax error for rstcheck inline config comments.""" def __init__(self, message: str, line_number: int) -> None: """Initialize th...
"""Inline config comment functionality.""" import re import typing RSTCHECK_COMMENT_REGEX = re.compile(r"\.\. rstcheck:") class RstcheckCommentSyntaxError(Exception): """Syntax error for rstcheck inline config comments.""" def __init__(self, message: str, line_number: int) -> None: """Initialize th...
mit
Python
deb5775d0c8adad078ce5d0976f7f6f49963ca2e
Test that the user is logged out
f3r3nc/connect,nlhkabu/connect,nlhkabu/connect,f3r3nc/connect,f3r3nc/connect,nlhkabu/connect,f3r3nc/connect,nlhkabu/connect
accounts/features/steps/logout.py
accounts/features/steps/logout.py
from behave import * # Unique to Scenario: User logs out @when('I click on the logout link') def impl(context): context.browser.find_link_by_text('Logout').first.click() @then('I am no longer authenticated') def impl(context): #Try to visit my profile page context.browser.visit(context.server_url + 'acco...
from behave import * # Unique to Scenario: User logs out @when('I click on the logout link') def impl(context): context.browser.find_link_by_text('Logout').first.click() @then('I am no longer authenticated') def impl(context): pass
bsd-3-clause
Python
2315a3f31f9821a5a21c26d619a814e8f4023d1f
Remove spam message
ucoin-io/cutecoin,ucoin-io/cutecoin,ucoin-io/cutecoin
src/sakia/tools/decorators.py
src/sakia/tools/decorators.py
import asyncio import functools import logging def cancel_once_task(object, fn): if getattr(object, "__tasks", None): tasks = getattr(object, "__tasks") if fn.__name__ in tasks and not tasks[fn.__name__].done(): logging.debug("Cancelling {0} ".format(fn.__name__)) getattr(o...
import asyncio import functools import logging def cancel_once_task(object, fn): if getattr(object, "__tasks", None): tasks = getattr(object, "__tasks") if fn.__name__ in tasks and not tasks[fn.__name__].done(): logging.debug("Cancelling {0} ".format(fn.__name__)) getattr(o...
mit
Python
dd50a2b3fb157eaa3add329d90de3641ef9ea1ec
Remove unneeded variable from test.
w4ngyi/flocker,mbrukman/flocker,w4ngyi/flocker,w4ngyi/flocker,AndyHuu/flocker,hackday-profilers/flocker,hackday-profilers/flocker,wallnerryan/flocker-profiles,hackday-profilers/flocker,mbrukman/flocker,mbrukman/flocker,AndyHuu/flocker,AndyHuu/flocker,wallnerryan/flocker-profiles,wallnerryan/flocker-profiles
flocker/docs/test/test_version_extensions.py
flocker/docs/test/test_version_extensions.py
from textwrap import dedent from twisted.python.filepath import FilePath from twisted.trial.unittest import SynchronousTestCase from flocker import __version__ as version from flocker.common.version import get_installable_version from flocker.testtools import run_process class VersionExtensionsTest(SynchronousTestC...
from textwrap import dedent from twisted.python.filepath import FilePath from twisted.trial.unittest import SynchronousTestCase from flocker import __version__ as version from flocker.common.version import get_installable_version from flocker.testtools import run_process class VersionExtensionsTest(SynchronousTestC...
apache-2.0
Python
0950442ea0d2679d44fee874dc844d55c2708231
Add awscli 1.16.308 (#14270)
LLNL/spack,LLNL/spack,iulian787/spack,LLNL/spack,iulian787/spack,iulian787/spack,iulian787/spack,LLNL/spack,LLNL/spack,iulian787/spack
var/spack/repos/builtin/packages/awscli/package.py
var/spack/repos/builtin/packages/awscli/package.py
############################################################################## # Copyright 2013-2018 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class Awscli(PythonPa...
############################################################################## # Copyright 2013-2018 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class Awscli(PythonPa...
lgpl-2.1
Python
c8c53cc7e76e399c3b02c9a194cc9c2b422bb0a2
Add extra version of py-pbr (#15049)
iulian787/spack,LLNL/spack,LLNL/spack,iulian787/spack,iulian787/spack,LLNL/spack,LLNL/spack,iulian787/spack,LLNL/spack,iulian787/spack
var/spack/repos/builtin/packages/py-pbr/package.py
var/spack/repos/builtin/packages/py-pbr/package.py
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class PyPbr(PythonPackage): """PBR is a library that injects some useful and sensible default ...
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class PyPbr(PythonPackage): """PBR is a library that injects some useful and sensible default ...
lgpl-2.1
Python
1d986c3790647382d19d6eef61447dee0b32aefc
Add extra version of py-pip (#15061)
iulian787/spack,iulian787/spack,LLNL/spack,iulian787/spack,LLNL/spack,LLNL/spack,iulian787/spack,LLNL/spack,LLNL/spack,iulian787/spack
var/spack/repos/builtin/packages/py-pip/package.py
var/spack/repos/builtin/packages/py-pip/package.py
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class PyPip(PythonPackage): """The PyPA recommended tool for installing Python packages.""" ...
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class PyPip(PythonPackage): """The PyPA recommended tool for installing Python packages.""" ...
lgpl-2.1
Python
882b8f9d427d3c9f983aa7d5b3a881b8cff4224a
add versions up to v1.16.1 (#21624)
LLNL/spack,LLNL/spack,LLNL/spack,LLNL/spack,LLNL/spack
var/spack/repos/builtin/packages/spglib/package.py
var/spack/repos/builtin/packages/spglib/package.py
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class Spglib(CMakePackage): """C library for finding and handling crystal symmetries.""" ho...
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class Spglib(CMakePackage): """C library for finding and handling crystal symmetries.""" ho...
lgpl-2.1
Python
19640af665c622160c84bc0f8991955758dc968b
Bump version to 1.2.1 after fixing tests
alphagov/nagios-plugins
plugins/__init__.py
plugins/__init__.py
__version__ = '1.2.1'
__version__ = '1.2.0'
mit
Python
db0ed0acefcdd40d1ceff71288f3d7d183e36b6e
Fix bug in angle computation
marianotepper/nmu_rfit,marianotepper/nmu_rfit
comdet/pme/vanishing.py
comdet/pme/vanishing.py
import numpy as np import matplotlib.pyplot as plt class VanishingPoint(): def __init__(self, data=None): self.point = None if data is not None: self.fit(data) @property def min_sample_size(self): return 2 def fit(self, data): if len(data) < self.min_sampl...
import numpy as np import matplotlib.pyplot as plt class VanishingPoint(): def __init__(self, data=None): self.point = None if data is not None: self.fit(data) @property def min_sample_size(self): return 2 def fit(self, data): if len(data) < self.min_sampl...
bsd-3-clause
Python
6b38ca9283b3b367aa19a2722f9f6eea22c6c90b
Add useful method to know if a chunk has a tag
devartis/django-cms-chunks
cms_chunks/models.py
cms_chunks/models.py
from django.db import models from cms.models.fields import PlaceholderField from managers import ChunkManager class Chunk(models.Model): tags = models.CharField(max_length=200) code = PlaceholderField('chunk_placeholder', related_name="chunks") priority = models.IntegerField() objects = ChunkManager(...
from django.db import models from cms.models.fields import PlaceholderField from managers import ChunkManager class Chunk(models.Model): tags = models.CharField(max_length=200) code = PlaceholderField('chunk_placeholder', related_name="chunks") priority = models.IntegerField() objects = ChunkManager(...
mit
Python
7d9a42d9c8285b6207c57e8ce436523388551c7e
Use venv instead of virtualenv (fix #2)
getweber/weber-cli
cob/bootstrapping.py
cob/bootstrapping.py
import os import subprocess import sys import logbook import venv from .defs import WEBER_CONFIG_FILE_NAME _logger = logbook.Logger(__name__) _PREVENT_REENTRY_ENV_VAR = 'WEBER_NO_REENTRY' _VIRTUALENV_PATH = '.cob-env' def ensure_project_bootstrapped(): if not os.path.isfile(WEBER_CONFIG_FILE_NAME): _lo...
import os import subprocess import sys import logbook import virtualenv from .defs import WEBER_CONFIG_FILE_NAME _logger = logbook.Logger(__name__) _PREVENT_REENTRY_ENV_VAR = 'WEBER_NO_REENTRY' _VIRTUALENV_PATH = '.cob-env' def ensure_project_bootstrapped(): if not os.path.isfile(WEBER_CONFIG_FILE_NAME): ...
bsd-3-clause
Python
fcdd42d61168f364eac213cab5f088f05b1b33d7
Use `dict.get`
sgaynetdinov/py-vkontakte
vk/wall.py
vk/wall.py
# coding=utf-8 from .fetch import fetch, fetch_field class Wall(object): """ https://vk.com/dev/post """ def __init__(self, data_json): self._data = data_json @property def id(self): return self._data.get('id') @property def owner_id(self): return self._data.g...
# coding=utf-8 from .fetch import fetch, fetch_field class Wall(object): """ https://vk.com/dev/post """ def __init__(self, data_json): self._data = data_json @property def id(self): return self._data['id'] @property def owner_id(self): return self._data['owne...
mit
Python
6252c666d315db71cdcc88fbc41716a3013919e2
Update q_scorer.py
ankittare/NLP_QuestionGeneration,ankittare/NLP_QuestionGeneration,ankittare/NLP_QuestionGeneration
src/ask/q_scorer.py
src/ask/q_scorer.py
#!/usr/bin/python # # q_scorer.py # # The QuestionScorer class contains all utilities used for scoring a question, # based on a probabilistic language model trained on the Brown corpus from # nltk. # import kenlm # Location of the training data corpus CORPUS_FILENAME = '../corpus/BrownCorpus.binary' # Target number of...
#!/usr/bin/python # # q_scorer.py # # The QuestionScorer class contains all utilities used for scoring a question, # based on a probabilistic language model trained on the Brown corpus from # nltk. # import kenlm ### CONSTANTS ### # Location of the training data corpus CORPUS_FILENAME = '../corpus/BrownCorpus.binary...
mit
Python
07c31e2fc8f74acc09464aa709a876af581c049e
Update stage2.py
OpenSourcePolicyCenter/taxdata
puf_stage2/stage2.py
puf_stage2/stage2.py
import os import glob import numpy as np import pandas as pd from dataprep import dataprep CUR_PATH = os.path.abspath(os.path.dirname(__file__)) # Read private CPS-matched-PUF file into a Pandas DataFrame puf = pd.read_csv(os.path.join(CUR_PATH, "../puf_data/cps-matched-puf.csv")) # Read stage1 factors and stage2 t...
import os import numpy as np import pandas as pd from dataprep import dataprep CUR_PATH = os.path.abspath(os.path.dirname(__file__)) # Read private CPS-matched-PUF file into a Pandas DataFrame puf = pd.read_csv(os.path.join(CUR_PATH, "../puf_data/cps-matched-puf.csv")) # Read stage1 factors and stage2 targets writt...
mit
Python
222fe6d1a01c69b577d7262c6068ac405828da8f
Fix document api after model changes
openkamer/openkamer,openkamer/openkamer,openkamer/openkamer,openkamer/openkamer
document/api.py
document/api.py
from rest_framework import serializers, viewsets from document.models import Document, Kamerstuk, Dossier class DossierSerializer(serializers.HyperlinkedModelSerializer): documents = serializers.HyperlinkedRelatedField(read_only=True, view_name='document-detail...
from rest_framework import serializers, viewsets from document.models import Document, Kamerstuk, Dossier class DossierSerializer(serializers.HyperlinkedModelSerializer): documents = serializers.HyperlinkedRelatedField(read_only=True, view_name='document-detail...
mit
Python
418362c48c355f477b71adc96e880748a4e3fe47
remove extra import and fix whitespace
aouelete/music-downloader
downTheMusic.py
downTheMusic.py
#!/usr/bin/env python # # downTheMusic.py # import os import sys from bs4 import BeautifulSoup from urllib.request import urlopen from urllib.parse import quote_plus as qp search = input("Enter songname / lyrics / artist ... or whatever\n> ") if search == "": sys.exit() print("Searching ...") # Magic happens he...
#!/usr/bin/env python # # downTheMusic.py # import os import sys import glob from bs4 import BeautifulSoup from urllib.request import urlopen from urllib.parse import quote_plus as qp search = input("Enter songname / lyrics / artist ... or whatever\n> ") if search == "": sys.exit() print("Searching ...") # Magi...
mit
Python
4539a1569f6ae69900583004ea88e9aec469f5db
Bump version to 1.4.0
laughingman7743/PyAthena
pyathena/__init__.py
pyathena/__init__.py
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import unicode_literals import datetime from pyathena.error import * # noqa __version__ = '1.4.0' # Globals https://www.python.org/dev/peps/pep-0249/#globals apilevel = '2.0' threadsafety = 3 paramstyle = 'pyformat' class DBAPITypeObj...
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import unicode_literals import datetime from pyathena.error import * # noqa __version__ = '1.3.0' # Globals https://www.python.org/dev/peps/pep-0249/#globals apilevel = '2.0' threadsafety = 3 paramstyle = 'pyformat' class DBAPITypeObj...
mit
Python
a726383aee287343b3e1d133c75aa00eb30c42ed
update dev version
bjodah/pycvodes,bjodah/pycvodes,bjodah/pycvodes,bjodah/pycvodes
pycvodes/_release.py
pycvodes/_release.py
__version__ = '0.12.0.dev0+git'
__version__ = '0.11.0.dev0+git'
bsd-2-clause
Python
75372629ec6208810b36429d6bcc0a78fe68f530
Make envelopes continue with same value after finishing
martinmcbride/pysound
pysound/envelopes.py
pysound/envelopes.py
# Author: Martin McBride # Created: 2018-04-21 # Copyright (C) 2018, Martin McBride # License: MIT from const import get_settings, t2s def ramp(settings=None, duration=1, start=0, end=1, repeat=False): ''' Signal starts at start value, ramps linearly up to end value rate - sample rate duration - soun...
# Author: Martin McBride # Created: 2018-04-21 # Copyright (C) 2018, Martin McBride # License: MIT from const import get_settings, t2s def ramp(settings=None, duration=1, start=0, end=1, repeat=False): ''' Signal starts at start value, ramps linearly up to end value rate - sample rate duration - soun...
mit
Python
73ede8b3e02dace38ceb8c34cfc7d1139e67f65c
Fix all kinds of stuff
jantuomi/chatserver-homework
client.py
client.py
#!/usr/bin/env python3 ''' Created on 29.3.2017 @author: T ''' import socket import time import threading from datetime import datetime import sys DEFAULT_HOST = "127.0.0.1" PORT = 5000 DEFAULT_NICK = "Anonymous" BUFFER_SIZE = 1024 DEBUG = False running = True def debug(string): if (DEBUG): print("{} DE...
''' Created on 29.3.2017 @author: T ''' import socket import time import threading from datetime import datetime import sys HOST = "127.0.0.1" BUFFER_SIZE = 1024 DEBUG = True def debug(string): if (DEBUG): print("{} DEBUG: {}".format(datetime.now(), string)) def connect(host, nick):...
mit
Python
db85e70d5a91f550ca920ccc61ec245cad28b92b
Use earlier pytest hook.
bigsassy/pytest-pythonpath
pytest_pythonpath.py
pytest_pythonpath.py
import sys import os import site def pytest_addoption(parser): # py.test has an issue where the cwd is not in the PYTHONPATH. Fix it here. if os.getcwd() not in sys.path: sys.path.insert(0, os.getcwd()) parser.addini("python_paths", type="pathlist", help="space seperated directory paths to add to ...
import sys import os import site def pytest_addoption(parser): # py.test has an issue where the cwd is not in the PYTHONPATH. Fix it here. if os.getcwd() not in sys.path: sys.path.insert(0, os.getcwd()) parser.addini("python_paths", type="pathlist", help="space seperated directory paths to add to ...
mit
Python
30e83f52df8ec732fde8c46292254b95196ea288
Handle reload properly
panoptes/POCS,joshwalawender/POCS,AstroHuntsman/POCS,panoptes/POCS,AstroHuntsman/POCS,panoptes/POCS,joshwalawender/POCS,AstroHuntsman/POCS,joshwalawender/POCS,panoptes/POCS,AstroHuntsman/POCS
web/app.py
web/app.py
import os import os.path import sys import tornado.escape import tornado.ioloop import tornado.web import tornado.httpserver import tornado.options sys.path.append(os.getenv('POCS', os.path.join(os.path.dirname(__file__), ".."))) from handlers import * import uimodules from panoptes.utils.config import load_config ...
import os import os.path import sys import tornado.escape import tornado.ioloop import tornado.web import tornado.httpserver import tornado.options sys.path.append(os.getenv('POCS', os.path.join(os.path.dirname(__file__), ".."))) from handlers import * import uimodules from panoptes.utils.config import load_config ...
mit
Python
d34fe7cecadcb5526574486e59051a86aeabd37a
Refactor data gathering code
andrewyang96/GutenbergsHorse
downloadtexts.py
downloadtexts.py
from gutenberg.acquire import load_etext from gutenberg.cleanup import strip_headers from nltk.tokenize.punkt import PunktSentenceTokenizer from mostpopular import MOSTPOPULAR import os import re import cPickle def downloadTexts(textIDs): d = [] for i in textIDs: print "Downloading", i text = s...
from gutenberg.acquire import load_etext from gutenberg.cleanup import strip_headers from nltk.tokenize.punkt import PunktSentenceTokenizer from mostpopular import MOSTPOPULAR import os import re import cPickle def downloadTexts(textIDs): d = [] for i in textIDs: print "Downloading", i text = s...
mit
Python
0037ba30ae6cb53de71fa18e1acfd8edecc8ffca
add logging for vector profiling
mozman/ezdxf,mozman/ezdxf,mozman/ezdxf,mozman/ezdxf,mozman/ezdxf
profiling/vector.py
profiling/vector.py
# Copyright (c) 2020, Manfred Moitzi # License: MIT License import sys import time from datetime import datetime from pathlib import Path from ezdxf.acc import USE_C_EXT if USE_C_EXT is False: print('C-extensions disabled or not available.') sys.exit(1) from ezdxf.math.vector import Vec3, Vec2 from ezdxf.acc....
# Copyright (c) 2020, Manfred Moitzi # License: MIT License import sys import time from ezdxf.acc import USE_C_EXT if USE_C_EXT is False: print('C-extensions disabled or not available.') sys.exit(1) from ezdxf.math.vector import Vec3 from ezdxf.acc.vector import Vec3 as CVec3 def profile_adding_vectors(VTyp...
mit
Python
ddc2797f38eeec805d20c1562677c59aef4fbf1e
Bump package version to 1.28.0
instana/python-sensor,instana/python-sensor
instana/version.py
instana/version.py
# Module version file. Used by setup.py and snapshot reporting. VERSION = '1.28.0'
# Module version file. Used by setup.py and snapshot reporting. VERSION = '1.27.3'
mit
Python
70e71f71a69b48ddf73ef2943f6988422c56c5b9
Fix variable access in Python 3.3 with a "smarter" algorithm to find the right context
thrasher-/eloipool,cinnamoncoin/eloipool-1,thrasher-/eloipool,thrasher-/eloipool,uingei/eloipool
interactivemode.py
interactivemode.py
# Eloipool - Python Bitcoin pool server # Copyright (C) 2011-2012 Luke Dashjr <luke-jr+eloipool@utopios.org> # # 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 # L...
# Eloipool - Python Bitcoin pool server # Copyright (C) 2011-2012 Luke Dashjr <luke-jr+eloipool@utopios.org> # # 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 # L...
agpl-3.0
Python
05a81ebc803a1009c575798af29eafec0b32086c
test for too short chunk added
tpltnt/py-hdlc
tests/test_baseframe.py
tests/test_baseframe.py
import sys sys.path.append('../py-hdlc') import pytest from hdlc import HDLCBaseFrame def test_plain_init(): foo = HDLCBaseFrame() def test_parse_address_string_input(baseframe): with pytest.raises(TypeError): baseframe.parse_address('test') def test_parse_address_float_input(baseframe): with ...
import sys sys.path.append('../py-hdlc') import pytest from hdlc import HDLCBaseFrame def test_plain_init(): foo = HDLCBaseFrame() def test_parse_address_string_input(baseframe): with pytest.raises(TypeError): baseframe.parse_address('test') def test_parse_address_float_input(baseframe): with ...
agpl-3.0
Python
e0adc3c185fba1852bf12c8b5b1f1b1bc452bbf2
Bump up host_migration_rate to 0.05
ucb-sts/sts,jmiserez/sts,ucb-sts/sts,jmiserez/sts
config/fuzzer_params.py
config/fuzzer_params.py
switch_failure_rate = 0.05 switch_recovery_rate = 0.05 dataplane_drop_rate = 0.0 dataplane_delay_rate = 0.0 controlplane_block_rate = 0.0 controlplane_unblock_rate = 1.0 ofp_message_receipt_rate = 1.0 link_failure_rate = 0.05 link_recovery_rate = 0.05 controller_crash_rate = 0.0 controller_recovery_rate = 0.0 traffic_g...
switch_failure_rate = 0.1 switch_recovery_rate = 0.1 dataplane_drop_rate = 0.0 dataplane_delay_rate = 0.0 controlplane_block_rate = 0.0 controlplane_unblock_rate = 1.0 ofp_message_receipt_rate = 1.0 link_failure_rate = 0.1 link_recovery_rate = 0.1 controller_crash_rate = 0.0 controller_recovery_rate = 0.0 traffic_gener...
apache-2.0
Python
971a180a5afab6ee53a9b15413341c649cda0a1c
Fix a bug in load_tags function
joowani/dtags
dtags/config.py
dtags/config.py
import os import json from dtags.utils import halt, expand_path TAGS = os.path.expanduser('~/.dtags') def load_tags(): """Load the tags from disk.""" if not os.path.exists(TAGS): try: with open(TAGS, "w") as config_file: json.dump({}, config_file) except (IOError,...
import os import json from dtags.utils import halt, expand_path TAGS = os.path.expanduser('~/.dtags') def load_tags(): """Load the tags from disk.""" if not os.path.exists(TAGS): try: with open(TAGS, "w") as config_file: json.dump({}, config_file) except (IOError,...
mit
Python