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
e30e5e9780cfe674a70856609ad6010056936263
Use requests instead of urllib.request
kanosaki/PicDump,kanosaki/PicDump
picdump/webadapter.py
picdump/webadapter.py
import requests class WebAdapter: def __init__(self): self.cookies = {} def get(self, urllike): res = requests.get(str(urllike), cookies=self.cookies) self.cookies = res.cookies return res.text
import urllib.request class WebAdapter: def get(self, urllike): url = self.mk_url(urllike) try: res = urllib.request.urlopen(url) return res.read() except Exception as e: raise e def open(self, urllike): url = self.mk_url(urllike) t...
mit
Python
a35abfda8af01f3c5bab4f4122060b630c118cac
Use ros-logging instead of print
bit-bots/bitbots_behaviour
bitbots_head_behavior/src/bitbots_head_behavior/actions/pattern_search.py
bitbots_head_behavior/src/bitbots_head_behavior/actions/pattern_search.py
import math from dynamic_stack_decider.abstract_action_element import AbstractActionElement class PatternSearch(AbstractActionElement): def __init__(self, blackboard, dsd, parameters=None): super(PatternSearch, self).__init__(blackboard, dsd, parameters) self.index = 0 self.pattern = self...
import math from dynamic_stack_decider.abstract_action_element import AbstractActionElement class PatternSearch(AbstractActionElement): def __init__(self, blackboard, dsd, parameters=None): super(PatternSearch, self).__init__(blackboard, dsd, parameters) self.index = 0 self.pattern = self...
bsd-3-clause
Python
80e7fbff75a51d9dea8716f74d7d06fb01155704
Add python3 compat boilerplate
thaim/ansible,thaim/ansible
lib/ansible/plugins/test/mathstuff.py
lib/ansible/plugins/test/mathstuff.py
# (c) 2016, Ansible, Inc # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is di...
# (c) 2016, Ansible, Inc # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is di...
mit
Python
6d7cf3575e02212ec68d16338a055b372ae6a9f5
Fix tabs
mithro/HDMI2USB-litex-firmware,cr1901/HDMI2USB-litex-firmware,cr1901/HDMI2USB-litex-firmware,mithro/HDMI2USB-litex-firmware,mithro/HDMI2USB-litex-firmware,mithro/HDMI2USB-litex-firmware,cr1901/HDMI2USB-litex-firmware,cr1901/HDMI2USB-litex-firmware
gateware/git_info.py
gateware/git_info.py
import binascii import os import subprocess import sys from litex.gen.fhdl import * from litex.soc.interconnect.csr import * def git_root(): if sys.platform == "win32": # Git on Windows is likely to use Unix-style paths (`/c/path/to/repo`), # whereas directories passed to Python should be Windows-...
import binascii import os import subprocess import sys from litex.gen.fhdl import * from litex.soc.interconnect.csr import * def git_root(): if sys.platform == "win32": # Git on Windows is likely to use Unix-style paths (`/c/path/to/repo`), # whereas directories passed to Python should be Windows-style paths #...
bsd-2-clause
Python
bf6f985d4746a42979184cca70daa039df484ab0
Update __init__.py
pv2b/zonetruck
zonetruck/__init__.py
zonetruck/__init__.py
import dns.resolver def main(): answers = dns.resolver.query('dnspython.org', 'MX') for rdata in answers: print 'Host', rdata.exchange, 'has preference', rdata.preference
import dnspython def main(): print ("Hello, world!")
mit
Python
8fec29601080c2cc0357b8d3882eb63d9d8cbe15
modify test unit
jhsrcmh/AlgoRun
suffix_tree/test_suffix_tree.py
suffix_tree/test_suffix_tree.py
#!/usr/bin/python #encoding=utf-8 ''' Authored by jhsrcmh in NCI ----------------------------- <strong> Wolf's MIS</strong> ----------------------------- ''' import unittest import codecs from suffix_tree import SuffixTree class SuffixTreeTest(unittest.TestCase): def test_empty_string(self): st = ...
#!/usr/bin/python #encoding=utf-8 ''' Authored by jhsrcmh in NCI ----------------------------- <strong> Wolf's MIS</strong> ----------------------------- ''' import unittest import codecs from suffix_tree import SuffixTree class SuffixTreeTest(unittest.TestCase): def test_empty_string(self): st = ...
apache-2.0
Python
7da8d040d5020809495f828ba9ea7bd14393af3a
Add `nullable` property to DataField template
chop-dbhi/serrano,rv816/serrano_night,rv816/serrano_night,chop-dbhi/serrano
serrano/resources/templates.py
serrano/resources/templates.py
# DataField core fields and properties DataCategory = { 'fields': [':pk', 'name', 'order', 'parent'], 'related': { 'parent': { 'fields': [':pk', 'name', 'order'], } } } DataField = { 'fields': [ ':pk', 'name', 'plural_name', 'description', 'keywords', 'categ...
# DataField core fields and properties DataCategory = { 'fields': [':pk', 'name', 'order', 'parent'], 'related': { 'parent': { 'fields': [':pk', 'name', 'order'], } } } DataField = { 'fields': [ ':pk', 'name', 'plural_name', 'description', 'keywords', 'categ...
bsd-2-clause
Python
a3d1d323c943c2bef763850dfa57adb1413abc32
fix static url
ktmud/david,ktmud/david,ktmud/david
david/ext/views/static.py
david/ext/views/static.py
# -*- coding: utf-8 -*- import os from flask import url_for, current_app, json from david.lib.cache import lc from config import APP_ROOT, STATIC_ROOT, DEBUG, SITE_ROOT class LazyStatic(object): def __init__(self, path): self.path = path def __get__(self, obj, type): return static_url(self.p...
# -*- coding: utf-8 -*- import os from flask import url_for, current_app, json from david.lib.cache import lc from config import APP_ROOT, STATIC_ROOT, DEBUG, SITE_ROOT class LazyStatic(object): def __init__(self, path): self.path = path def __get__(self, obj, type): return static_url(self.p...
mit
Python
4cedc5b496041d5d7ba3632302bc77d89c59f44b
Tweak how to handle fastq file name for 2 pass mapping
dgaston/ddb-ngsflow,dgaston/ddbio-ngsflow
ddb_ngsflow/rna/bowtie.py
ddb_ngsflow/rna/bowtie.py
""" .. module:: cufflinks :platform: Unix, OSX :synopsis: A module of methods for working with the bowtie alignment program into additional formats. .. moduleauthor:: Daniel Gaston <daniel.gaston@dal.ca> """ from ddb_ngsflow import pipeline def add_additional_options(command_list, config, flags): if ...
""" .. module:: cufflinks :platform: Unix, OSX :synopsis: A module of methods for working with the bowtie alignment program into additional formats. .. moduleauthor:: Daniel Gaston <daniel.gaston@dal.ca> """ from ddb_ngsflow import pipeline def add_additional_options(command_list, config, flags): if ...
mit
Python
379ffea89716a515e85de9cdaab2bc9c47a68fc4
Add LineWidthNode
vorburger/mcedit2,vorburger/mcedit2
src/mcedit2/rendering/scenegraph/misc.py
src/mcedit2/rendering/scenegraph/misc.py
""" misc """ from __future__ import absolute_import, division, print_function, unicode_literals import logging from OpenGL import GL from mcedit2.rendering.scenegraph.rendernode import RenderstateRenderNode, RenderNode from mcedit2.rendering.scenegraph.scenenode import Node log = logging.getLogger(__name__) clas...
""" misc """ from __future__ import absolute_import, division, print_function, unicode_literals import logging from OpenGL import GL from mcedit2.rendering.scenegraph.rendernode import RenderstateRenderNode, RenderNode from mcedit2.rendering.scenegraph.scenenode import Node log = logging.getLogger(__name__) clas...
bsd-3-clause
Python
ad36a4a6ae8376a779f9feb08adfb2ca4a59dbb4
add \x0c to whitespace characters, as per html5 standard
starrify/scrapy,eLRuLL/scrapy,pawelmhm/scrapy,finfish/scrapy,rolando/scrapy,dangra/scrapy,scrapy/scrapy,wujuguang/scrapy,eLRuLL/scrapy,darkrho/scrapy-scrapy,Parlin-Galanodel/scrapy,shaform/scrapy,finfish/scrapy,ssteo/scrapy,pablohoffman/scrapy,Ryezhang/scrapy,kmike/scrapy,kmike/scrapy,shaform/scrapy,ssteo/scrapy,umrash...
scrapy/linkextractors/regex.py
scrapy/linkextractors/regex.py
import re from six.moves.urllib.parse import urljoin from w3lib.html import remove_tags, replace_entities, replace_escape_chars, get_base_url from scrapy.link import Link from .sgml import SgmlLinkExtractor linkre = re.compile( "<a\s.*?href=(\"[.#]+?\"|\'[.#]+?\'|[^\s]+?)(>|\s.*?>)(.*?)<[/ ]?a>", re....
import re from six.moves.urllib.parse import urljoin from w3lib.html import remove_tags, replace_entities, replace_escape_chars, get_base_url from scrapy.link import Link from .sgml import SgmlLinkExtractor linkre = re.compile( "<a\s.*?href=(\"[.#]+?\"|\'[.#]+?\'|[^\s]+?)(>|\s.*?>)(.*?)<[/ ]?a>", re....
bsd-3-clause
Python
d531d03dfa19d1e785d71ac28e010531eefbca84
Add TODO
davidgasquez/kaggle-airbnb
scripts/generate_submission.py
scripts/generate_submission.py
#!/usr/bin/env python import pandas as pd from sklearn.preprocessing import LabelEncoder from xgboost.sklearn import XGBClassifier from sklearn.ensemble import BaggingClassifier from utils.io import generate_submission def main(): path = '../data/processed/' prefix = 'processed_' suffix = '1' train_u...
#!/usr/bin/env python import pandas as pd from sklearn.preprocessing import LabelEncoder from xgboost.sklearn import XGBClassifier from sklearn.ensemble import BaggingClassifier from utils.io import generate_submission def main(): path = '../data/processed/' prefix = 'processed_' suffix = '1' train_u...
mit
Python
a31d5f88f3761e2b77300a2c882424c19baae9b3
improve publishing of joint states
bit-bots/bitbots_misc,bit-bots/bitbots_misc,bit-bots/bitbots_misc
bitbots_bringup/scripts/motor_goals_viz_helper.py
bitbots_bringup/scripts/motor_goals_viz_helper.py
#!/usr/bin/env python3 import argparse import rospy from sensor_msgs.msg import JointState from bitbots_msgs.msg import JointCommand from humanoid_league_msgs.msg import Animation JOINT_NAMES = ['LHipYaw', 'LHipRoll', 'LHipPitch', 'LKnee', 'LAnklePitch', 'LAnkleRoll', 'RHipYaw', 'RHipRoll', 'RHipPitch', 'RKnee', 'RA...
#!/usr/bin/env python3 import argparse import rospy from sensor_msgs.msg import JointState from bitbots_msgs.msg import JointCommand from humanoid_league_msgs.msg import Animation class MotorVizHelper: def __init__(self): # get rid of addional ROS args when used in launch file args0 = rospy.myarg...
mit
Python
86ff28441a23762d30cbab9843a7abeb67bfd028
Improve printing in bucky's DebugClient
mistio/mist.monitor,mistio/mist.monitor
src/mist/bucky_extras/clients/debug_client.py
src/mist/bucky_extras/clients/debug_client.py
import sys import time import datetime from bucky.client import Client from bucky.names import statname class DebugClient(Client): out_path = None def __init__(self, cfg, pipe): super(DebugClient, self).__init__(pipe) if self.out_path: self.stdout = open(self.out_path, 'w') ...
import sys from bucky.client import Client class DebugClient(Client): out_path = None def __init__(self, cfg, pipe): super(DebugClient, self).__init__(pipe) if self.out_path: self.stdout = open(self.out_path, 'w') else: self.stdout = sys.stdout def send(s...
apache-2.0
Python
b50eb2f28aa4248e73c817fa4d73d23d0e9abcc1
fix @ Sat Sep 27 21:44:01 EDT 2014
f825f5242ed81a32cd04e5269665f40a/libmyolinux,f825f5242ed81a32cd04e5269665f40a/libmyolinux,f825f5242ed81a32cd04e5269665f40a/libmyolinux,f825f5242ed81a32cd04e5269665f40a/libmyolinux
src/pi/leds.py
src/pi/leds.py
#!/usr/bin/env python # leds.py import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BOARD) GPIO.setwarnings(False) GPIO.cleanup() GPIO.setup(7, GPIO.OUT) GPIO.setup(12, GPIO.OUT) while True: GPIO.output(7, GPIO.HIGH) time.sleep(1) GPIO.output(12, GPIO.HIGH) time.sleep(1) GPIO.cleanup()
#!/usr/bin/env python # leds.py import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BOARD) GPIO.setwarnings(False) GPIO.cleanup() GPIO.setup(7, GPIO.OUT) GPIO.setup(11, GPIO.OUT) GPIO.setup(12, GPIO.OUT) while True: GPIO.output(7, GPIO.HIGH) time.sleep(1) GPIO.output(11, GPIO.HIGH) time.sleep(1) GPIO.output(1...
mit
Python
4ed52f75df03ef52e93fa7897cbfbd01f9d20190
use matplotlib's triplot instead of pydec's
whereisravi/pydec,alejospina/pydec,ryanbressler/pydec,pkuwwt/pydec,DongliangGao/pydec,DongliangGao/pydec,alejospina/pydec,pkuwwt/pydec,whereisravi/pydec,wangregoon/pydec,ryanbressler/pydec,wangregoon/pydec
Examples/MakeMesh/make_mesh.py
Examples/MakeMesh/make_mesh.py
""" Reads ascii vertex and element files, writes a pydec mesh and displays it """ import scipy from pydec import SimplicialMesh, write_mesh, read_mesh from matplotlib.pylab import triplot, show vertices = scipy.loadtxt("v.txt") elements = scipy.loadtxt("s.txt",dtype='int32') - 1 mymesh = SimplicialMesh(vertices=verti...
""" Reads ascii vertex and element files, writes a pydec mesh and displays it """ import scipy from pydec import * from matplotlib.pylab import show vertices = scipy.loadtxt("v.txt") elements = scipy.loadtxt("s.txt",dtype='int32') - 1 mymesh = SimplicialMesh(vertices=vertices,indices=elements) write_mesh("square_8.xm...
bsd-3-clause
Python
f6e58c512b53db1443e5cfe6ad8ba6cbaf5b3726
Bump to version 0.30.0
reubano/meza,reubano/meza,reubano/tabutils,reubano/tabutils,reubano/tabutils,reubano/meza
meza/__init__.py
meza/__init__.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # vim: sw=4:ts=4:expandtab """ meza ~~~~ Provides methods for reading and processing data from tabular formatted files Attributes: CURRENCIES [tuple(unicode)]: Currency symbols to remove from decimal strings. ENCODING (str): Default file encoding. DEF...
#!/usr/bin/env python # -*- coding: utf-8 -*- # vim: sw=4:ts=4:expandtab """ meza ~~~~ Provides methods for reading and processing data from tabular formatted files Attributes: CURRENCIES [tuple(unicode)]: Currency symbols to remove from decimal strings. ENCODING (str): Default file encoding. DEF...
mit
Python
869ba7c298a56ff49d81516d7c5374ebbf3a0949
Add activity for assign/unassign
hongliang5623/sentry,TedaLIEz/sentry,wujuguang/sentry,ifduyue/sentry,mvaled/sentry,gencer/sentry,mvaled/sentry,wong2/sentry,zenefits/sentry,ifduyue/sentry,hongliang5623/sentry,wujuguang/sentry,gencer/sentry,fotinakis/sentry,ewdurbin/sentry,beeftornado/sentry,Natim/sentry,daevaorn/sentry,nicholasserra/sentry,korealerts1...
src/sentry/templatetags/sentry_activity.py
src/sentry/templatetags/sentry_activity.py
""" sentry.templatetags.sentry_activity ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import import logging from django import template from django.utils.html import esca...
""" sentry.templatetags.sentry_activity ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import import logging from django import template from django.utils.html import esca...
bsd-3-clause
Python
252784ccf5a381f5a611ca74cc486f74218b9ce6
disable tests on gcc11 (#26593)
LLNL/spack,LLNL/spack,LLNL/spack,LLNL/spack,LLNL/spack
var/spack/repos/builtin/packages/cppgsl/package.py
var/spack/repos/builtin/packages/cppgsl/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 Cppgsl(CMakePackage): """C++ Guideline Support Library""" homepage = "https://github....
# 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 Cppgsl(CMakePackage): """C++ Guideline Support Library""" homepage = "https://github....
lgpl-2.1
Python
6d5cd24480a53ea2bf75f1663de707cb84cda380
add version 0.8.0 (#23717)
LLNL/spack,LLNL/spack,LLNL/spack,LLNL/spack,LLNL/spack
var/spack/repos/builtin/packages/py-neo/package.py
var/spack/repos/builtin/packages/py-neo/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 PyNeo(PythonPackage): """Neo is a package for representing electrophysiology data in Pytho...
# 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 PyNeo(PythonPackage): """Neo is a package for representing electrophysiology data in Pytho...
lgpl-2.1
Python
d07e988fbcd7698a7776e71aecb7eaabdbdb05be
Fix py-pox build recipe (#14078)
LLNL/spack,iulian787/spack,LLNL/spack,iulian787/spack,LLNL/spack,iulian787/spack,LLNL/spack,iulian787/spack,LLNL/spack,iulian787/spack
var/spack/repos/builtin/packages/py-pox/package.py
var/spack/repos/builtin/packages/py-pox/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 PyPox(PythonPackage): """Utilities for filesystem exploration and automated builds.""" ...
# 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 PyPox(PythonPackage): """Utilities for filesystem exploration and automated builds.""" ...
lgpl-2.1
Python
6c05c8c91dcb7b631df932e19f363f67049e0872
Fix ValueError: path is on mount 'X:', start on mount 'D:' on Windows
josephcslater/scipy,perimosocordiae/scipy,Eric89GXL/scipy,dominicelse/scipy,rgommers/scipy,dominicelse/scipy,e-q/scipy,andyfaff/scipy,Stefan-Endres/scipy,jjhelmus/scipy,aeklant/scipy,jor-/scipy,aeklant/scipy,apbard/scipy,nmayorov/scipy,jakevdp/scipy,Stefan-Endres/scipy,jjhelmus/scipy,josephcslater/scipy,scipy/scipy,aar...
scipy/special/_precompute/expn_asy.py
scipy/special/_precompute/expn_asy.py
"""Precompute the polynomials for the asymptotic expansion of the generalized exponential integral. Sources ------- [1] NIST, Digital Library of Mathematical Functions, http://dlmf.nist.gov/8.20#ii """ from __future__ import division, print_function, absolute_import import os import warnings try: # Can remo...
"""Precompute the polynomials for the asymptotic expansion of the generalized exponential integral. Sources ------- [1] NIST, Digital Library of Mathematical Functions, http://dlmf.nist.gov/8.20#ii """ from __future__ import division, print_function, absolute_import import os import warnings try: # Can remo...
bsd-3-clause
Python
f3d4c9a485abe9b92894fadc4d4db7f075b4d4e1
Update python.py
vadimkantorov/wigwam
wigs/python.py
wigs/python.py
class python(Wig): git_uri = 'https://github.com/python/cpython' tarball_uri = 'https://github.com/python/cpython/archive/v$RELEASE_VERSION$.tar.gz' last_release_version = 'v2.7.13' dependencies = ['openssl', 'ncurses', 'readline', 'zlib', 'bz2']
class python(Wig): git_uri = 'https://github.com/python/cpython' tarball_uri = 'https://github.com/python/cpython/archive/v$RELEASE_VERSION$.tar.gz' last_release_version = 'v2.7.13' dependencies = ['openssl', 'ncurses']
mit
Python
bd8a31c675e86f52db2fe473be22e4b497ab5bd1
test on kvdb key count to get how many diary entries
bambooom/OMOOC2py,bambooom/OMOOC2py
_src/om2py5w/5wex0/index.wsgi
_src/om2py5w/5wex0/index.wsgi
# -*- coding: utf-8 -*- #!/usr/bin/env python # author: bambooom ''' MyDiary Web Application Open web browser and access http://bambooomdiary.sinaapp.com/ You can read the old diary and input new diary ''' from bottle import Bottle, request, route, run, template import sae import sae.kvdb from time import localtime, s...
# -*- coding: utf-8 -*- #!/usr/bin/env python # author: bambooom ''' MyDiary Web Application Open web browser and access http://bambooomdiary.sinaapp.com/ You can read the old diary and input new diary ''' from bottle import Bottle, request, route, run, template import sae import sae.kvdb from time import localtime, s...
mit
Python
e7e6cc998ab8ed5d1d1330c7f13c10e84826e131
Add the new fields in the alembic script
kushaldas/autocloud,kushaldas/autocloud,kushaldas/autocloud,kushaldas/autocloud
alembic/versions/1868e29e8306_add_compose_details_and_compose_job_.py
alembic/versions/1868e29e8306_add_compose_details_and_compose_job_.py
"""add compose details and compose job details table Revision ID: 1868e29e8306 Revises: 55932e5d6b3f Create Date: 2016-04-26 18:28:54.865917 """ # revision identifiers, used by Alembic. revision = '1868e29e8306' down_revision = '55932e5d6b3f' branch_labels = None depends_on = None from alembic import op import sqla...
"""add compose details and compose job details table Revision ID: 1868e29e8306 Revises: 55932e5d6b3f Create Date: 2016-04-26 18:28:54.865917 """ # revision identifiers, used by Alembic. revision = '1868e29e8306' down_revision = '55932e5d6b3f' branch_labels = None depends_on = None from alembic import op import sqla...
agpl-3.0
Python
6f2adf06d9f0385305472f200af06d869db3e9b3
Create some base views which call manager's synchronise function every time data is retrieved
remarkablerocket/django-vend,remarkablerocket/django-vend
django_vend/core/views.py
django_vend/core/views.py
from django.contrib.auth.mixins import LoginRequiredMixin class VendAuthMixin(LoginRequiredMixin): def get_queryset(self): retailer = self.request.user.vendprofile.retailer return self.model.objects.filter(retailer=retailer) class VendAuthSingleObjectSyncMixin(VendAuthMixin): def get_object(...
from django.shortcuts import render # Create your views here.
bsd-3-clause
Python
a406b42ab8f1cd2c7b53a3cbacc30d7fd5a0e820
Update to 0.0.96
KerkhoffTechnologies/django-connectwise,KerkhoffTechnologies/django-connectwise
djconnectwise/__init__.py
djconnectwise/__init__.py
# -*- coding: utf-8 -*- VERSION = (0, 0, 96, 'alpha') # pragma: no cover if VERSION[-1] != "final": __version__ = '.'.join(map(str, VERSION)) else: # pragma: no cover __version__ = '.'.join(map(str, VERSION[:-1]))
# -*- coding: utf-8 -*- VERSION = (0, 0, 95, 'alpha') # pragma: no cover if VERSION[-1] != "final": __version__ = '.'.join(map(str, VERSION)) else: # pragma: no cover __version__ = '.'.join(map(str, VERSION[:-1]))
mit
Python
b78ea2493b4fb6bea60ceb48237394b99ee8bcdd
fix unittest import in accessors
lixun910/pysal,hasecbinusr/pysal,TaylorOshan/pysal,jlaura/pysal,ljwolf/pysal_core,hasecbinusr/pysal,ljwolf/pysal,TaylorOshan/pysal,lixun910/pysal,ljwolf/pysal,pysal/pysal,hasecbinusr/pysal,ljwolf/pysal,sjsrey/pysal,pastephens/pysal,ljwolf/pysal_core,sjsrey/pysal_core,sjsrey/pysal_core,jlaura/pysal,pastephens/pysal,pedr...
pysal/contrib/geotable/ops/tests/test_accessors.py
pysal/contrib/geotable/ops/tests/test_accessors.py
from ....pdio import read_files as rf from .._accessors import __all__ as to_test import unittest as ut class Test_Accessors(ut.TestCase): def test_area(self): raise def test_bbox(self): raise def test_bounding_box(self): raise def test_centroid(self): raise def test...
from ....pdio import read_files as rf from .._accessors import __all__ as to_test from unittest as ut class Test_Accessors(ut.TestCase): def test_area(self): raise def test_bbox(self): raise def test_bounding_box(self): raise def test_centroid(self): raise def test_h...
bsd-3-clause
Python
a1590b4b91bab0174edb99e9b54d8a47e008ebc3
update version
globocom/GloboNetworkAPI-client-python
networkapiclient/__init__.py
networkapiclient/__init__.py
# -*- coding:utf-8 -*- # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "Lice...
# -*- coding:utf-8 -*- # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "Lice...
apache-2.0
Python
a78bc40c8f3548477ea0c42a92214132c380792a
resolve traceback on add followers and channels
dfang/odoo,hip-odoo/odoo,hip-odoo/odoo,ygol/odoo,ygol/odoo,dfang/odoo,dfang/odoo,ygol/odoo,ygol/odoo,ygol/odoo,ygol/odoo,hip-odoo/odoo,hip-odoo/odoo,ygol/odoo,dfang/odoo,dfang/odoo,hip-odoo/odoo,hip-odoo/odoo,dfang/odoo
addons/calendar/wizard/mail_invite.py
addons/calendar/wizard/mail_invite.py
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import api, models from odoo.addons.calendar.models.calendar import get_real_ids class MailInvite(models.TransientModel): _inherit = 'mail.wizard.invite' @api.model def default_get(self, fields...
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import models from odoo.addons.calendar.models.calendar import get_real_ids class MailInvite(models.TransientModel): _inherit = 'mail.wizard.invite' def default_get(self, fields): """ In ca...
agpl-3.0
Python
64b3cbae56f68ce9786ca8553e9ed2565102368a
clean up resolve logic using collections.Iterable (sapling split of 0848c2ad8b375e6a93f40eb9e6a24f5e4c85495e)
manasapte/pants,fkorotkov/pants,manasapte/pants,dturner-tw/pants,TansyArron/pants,dturner-tw/pants,areitz/pants,pombredanne/pants,tdyas/pants,slyphon/pants,digwanderlust/pants,qma/pants,benjyw/pants,dgomez10/xanon,foursquare/pants,scode/pants,landism/pants,mateor/pants,15Dkatz/pants,twitter/pants,UnrememberMe/pants,tej...
src/python/twitter/pants/targets/util.py
src/python/twitter/pants/targets/util.py
# ================================================================================================== # Copyright 2013 Foursquare Labs, Inc. # -------------------------------------------------------------------------------------------------- # Licensed under the Apache License, Version 2.0 (the "License"); # you may not...
# ================================================================================================== # Copyright 2013 Foursquare Labs, Inc. # -------------------------------------------------------------------------------------------------- # Licensed under the Apache License, Version 2.0 (the "License"); # you may not...
apache-2.0
Python
555cda8a6d9d696b8999a7a728111edd36835a73
Fix unit tests [WAL-1670]
opennode/waldur-mastermind,opennode/nodeconductor-assembly-waldur,opennode/nodeconductor-assembly-waldur,opennode/waldur-mastermind,opennode/waldur-mastermind,opennode/waldur-mastermind,opennode/nodeconductor-assembly-waldur
src/waldur_mastermind/marketplace/views.py
src/waldur_mastermind/marketplace/views.py
from __future__ import unicode_literals from django_filters.rest_framework import DjangoFilterBackend from waldur_core.core import views as core_views from waldur_core.structure import permissions as structure_permissions from . import serializers, models, filters class BaseMarketplaceView(core_views.ActionsViewSe...
from __future__ import unicode_literals from django_filters.rest_framework import DjangoFilterBackend from waldur_core.core import views as core_views from waldur_core.structure import filters as structure_filters from waldur_core.structure import permissions as structure_permissions from . import serializers, model...
mit
Python
4e09732945d7d81e48ac43be7e51637ba27d3a92
Update help messages
soslan/passgen
src/passgen.py
src/passgen.py
import string import random import argparse def passgen(length=12): """Generate a strong password with *length* characters""" pool = string.ascii_uppercase + string.ascii_lowercase + string.digits return ''.join(random.SystemRandom().choice(pool) for _ in range(length)) def main(): parser = argparse...
import string import random import argparse def passgen(length=12): """Generate a strong password with *length* characters""" pool = string.ascii_uppercase + string.ascii_lowercase + string.digits return ''.join(random.SystemRandom().choice(pool) for _ in range(length)) def main(): parser = argparse...
mit
Python
b38f465e512f9b7e79935c156c60ef56d6122387
Order HTTP methods in constant.
playpauseandstop/aiohttp-middlewares,playpauseandstop/aiohttp-middlewares
aiohttp_middlewares/constants.py
aiohttp_middlewares/constants.py
""" ============================= aiohttp_middlewares.constants ============================= Collection of constants for ``aiohttp_middlewares`` project. """ #: Set of idempotent HTTP methods IDEMPOTENT_METHODS = frozenset({'GET', 'HEAD', 'OPTIONS', 'TRACE'}) #: Set of non-idempotent HTTP methods NON_IDEMPOTENT_ME...
""" ============================= aiohttp_middlewares.constants ============================= Collection of constants for ``aiohttp_middlewares`` project. """ #: Set of idempotent HTTP methods IDEMPOTENT_METHODS = frozenset({'GET', 'HEAD', 'OPTIONS', 'TRACE'}) #: Set of non-idempotent HTTP methods NON_IDEMPOTENT_ME...
bsd-3-clause
Python
d2ec1eca12ee2f6356a96009e65f60b1975f9ecd
Fix typo in message
trungdong/cookiecutter-django,ryankanno/cookiecutter-django,ryankanno/cookiecutter-django,pydanny/cookiecutter-django,trungdong/cookiecutter-django,trungdong/cookiecutter-django,pydanny/cookiecutter-django,pydanny/cookiecutter-django,ryankanno/cookiecutter-django,trungdong/cookiecutter-django,pydanny/cookiecutter-djang...
{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/views.py
{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/users/views.py
from django.contrib import messages from django.contrib.auth import get_user_model from django.contrib.auth.mixins import LoginRequiredMixin from django.urls import reverse from django.utils.translation import gettext_lazy as _ from django.views.generic import DetailView, RedirectView, UpdateView User = get_user_model...
from django.contrib import messages from django.contrib.auth import get_user_model from django.contrib.auth.mixins import LoginRequiredMixin from django.urls import reverse from django.utils.translation import gettext_lazy as _ from django.views.generic import DetailView, RedirectView, UpdateView User = get_user_model...
bsd-3-clause
Python
fbb2c05aef76c02094c13f5edeaecd9b7428ff11
Update UI preferences model (dict)
Alignak-monitoring-contrib/alignak-backend,Alignak-monitoring-contrib/alignak-backend,Alignak-monitoring-contrib/alignak-backend,Alignak-monitoring-contrib/alignak-backend
alignak_backend/models/uipref.py
alignak_backend/models/uipref.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Resource information of host """ def get_name(): """ Get name of this resource :return: name of this resource :rtype: str """ return 'uipref' def get_schema(): """ Schema structure of this resource :return: schema dictionnary ...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Resource information of host """ def get_name(): """ Get name of this resource :return: name of this resource :rtype: str """ return 'uipref' def get_schema(): """ Schema structure of this resource :return: schema dictionnary ...
agpl-3.0
Python
5e2e06dcdc973663cba0677c185e5efdd4a01b8c
Use lxml to pretty-print cached XML. minidom inserts too many spaces!
redtoad/python-amazon-product-api,redtoad/python-amazon-product-api,redtoad/python-amazon-product-api
amazonproduct/contrib/caching.py
amazonproduct/contrib/caching.py
import os import tempfile from lxml import etree try: # make it python2.4 compatible! from hashlib import md5 except ImportError: # pragma: no cover from md5 import new as md5 from amazonproduct.api import API DEFAULT_CACHE_DIR = tempfile.mkdtemp(prefix='amzn_') class ResponseCachingAPI (API): """ ...
import os import tempfile import xml.dom.minidom try: # make it python2.4 compatible! from hashlib import md5 except ImportError: # pragma: no cover from md5 import new as md5 from amazonproduct.api import API DEFAULT_CACHE_DIR = tempfile.mkdtemp(prefix='amzn_') class ResponseCachingAPI (API): """ ...
bsd-3-clause
Python
ad1e6e26184bcc7219ac715bbf435bfdd26aa458
Fix indenting
nettitude/PoshC2,nettitude/PoshC2,nettitude/PoshC2,nettitude/PoshC2,nettitude/PoshC2,nettitude/PoshC2
CookieDecrypter.py
CookieDecrypter.py
#!/usr/bin/python from Colours import Colours from Core import decrypt from DB import get_keys import os, sys, re file = open(sys.argv[1], "r") result = get_keys() if result: for line in file: if re.search("SessionID", line): for i in result: try: ...
#!/usr/bin/python from Colours import Colours from Core import decrypt from DB import get_keys import os, sys, re file = open(sys.argv[1], "r") result = get_keys() for line in file: if re.search("SessionID", line): if result: for i in result: try: value = decrypt(i[0], line.split(...
bsd-3-clause
Python
53b9eff3ffc1768d3503021e7248351e24d59af7
Fix test http server, change to echo back request body
chop-dbhi/django-webhooks,pombredanne/django-webhooks,pombredanne/django-webhooks,chop-dbhi/django-webhooks
tests/httpd.py
tests/httpd.py
import BaseHTTPServer class Handler(BaseHTTPServer.BaseHTTPRequestHandler): def do_POST(self): content_type = self.headers.getheader('content-type') content_length = int(self.headers.getheader('content-length')) self.send_response(200) self.send_header('Content-Type', content_type) ...
import SimpleHTTPServer import BaseHTTPServer class Handler(SimpleHTTPServer.SimpleHTTPRequestHandler): def do_POST(s): s.send_response(200) s.end_headers() if __name__ == '__main__': server_class = BaseHTTPServer.HTTPServer httpd = server_class(('0.0.0.0', 8328), Handler) try: ...
bsd-2-clause
Python
698902a817ca081addc6cb71978c17cd8cf42a7b
fix error value output
zshimanchik/unconditioned-reflexes
NeuralNetwork/NeuralNetwork.py
NeuralNetwork/NeuralNetwork.py
from Layer import InputLayer, Layer, Readiness class NeuralNetwork: def __init__(self, shape): self.layers = [] self.shape = shape self.time = 0 self.input_layer = InputLayer(shape[0]) self.middle_layer = Layer(shape[1], self.input_layer.neurons) self.input_layer....
from Layer import InputLayer, Layer, Readiness class NeuralNetwork: def __init__(self, shape): self.layers = [] self.shape = shape self.time = 0 self.input_layer = InputLayer(shape[0]) self.middle_layer = Layer(shape[1], self.input_layer.neurons) self.input_layer....
mit
Python
b5235a67948da28fca6faf09337cb909c1f1825e
Read input
swank-rats/roboter-software
PythonTests/WebsocketClient.py
PythonTests/WebsocketClient.py
from ws4py.client.threadedclient import WebSocketClient import Adafruit_BBIO.GPIO as GPIO class DummyClient(WebSocketClient): def opened(self): #GPIO.setup("USR3", GPIO.OUT) #GPIO.setup("USR2", GPIO.IN) for i in range(0, 200, 25): self.send("#" * i) def closed(self, code...
from ws4py.client.threadedclient import WebSocketClient import Adafruit_BBIO.GPIO as GPIO class DummyClient(WebSocketClient): def opened(self): #GPIO.setup("USR3", GPIO.OUT) #GPIO.setup("USR2", GPIO.IN) for i in range(0, 200, 25): self.send("#" * i) def closed(self, code...
mit
Python
6d91240f3416e85bf525e72c0151964206912b57
Use https URLs for openstreetmap.org. The oauth endpoint must change soon, the rest is good practice
python-social-auth/social-core,python-social-auth/social-core
social_core/backends/openstreetmap.py
social_core/backends/openstreetmap.py
""" OpenStreetMap OAuth support. This adds support for OpenStreetMap OAuth service. An application must be registered first on OpenStreetMap and the settings SOCIAL_AUTH_OPENSTREETMAP_KEY and SOCIAL_AUTH_OPENSTREETMAP_SECRET must be defined with the corresponding values. More info: https://wiki.openstreetmap.org/wiki...
""" OpenStreetMap OAuth support. This adds support for OpenStreetMap OAuth service. An application must be registered first on OpenStreetMap and the settings SOCIAL_AUTH_OPENSTREETMAP_KEY and SOCIAL_AUTH_OPENSTREETMAP_SECRET must be defined with the corresponding values. More info: http://wiki.openstreetmap.org/wiki/...
bsd-3-clause
Python
51457d7c55a1e8e713d4407533e0b2159dd759c3
Improve display of validation error messages. [SDESK-5444] (#1977)
petrjasek/superdesk-core,petrjasek/superdesk-core,superdesk/superdesk-core,petrjasek/superdesk-core,superdesk/superdesk-core,petrjasek/superdesk-core,superdesk/superdesk-core,superdesk/superdesk-core
superdesk/macros/validate_for_publish.py
superdesk/macros/validate_for_publish.py
# -*- coding: utf-8; -*- # # This file is part of Superdesk. # # Copyright 2013, 2014 Sourcefabric z.u. and contributors. # # For the full copyright and license information, please see the # AUTHORS and LICENSE files distributed with this source code, or # at https://www.sourcefabric.org/superdesk/license from superde...
# -*- coding: utf-8; -*- # # This file is part of Superdesk. # # Copyright 2013, 2014 Sourcefabric z.u. and contributors. # # For the full copyright and license information, please see the # AUTHORS and LICENSE files distributed with this source code, or # at https://www.sourcefabric.org/superdesk/license from superde...
agpl-3.0
Python
8e0680013bd2b4791129aac386d48be54bef3a5b
clear command - debug logging even if log parameter is false
lukas-linhart/pageobject
pageobject/commands/clear.py
pageobject/commands/clear.py
from selenium.webdriver.common.keys import Keys def clear(self, log=True, press_enter=False): """ Clear the page object. :param bool log: whether to log or not (defualt is True) :param bool press_enter: whether to press enter key after the element is cleared (defualt is False) :returns: `...
from selenium.webdriver.common.keys import Keys def clear(self, log=True, press_enter=False): """ Clear the page object. :param bool log: whether to log or not (defualt is True) :param bool press_enter: whether to press enter key after the element is cleared (defualt is False) :returns: `...
mit
Python
b9143462c004af7d18a66fa92ad94585468751b9
Change IRFieldClassic to use 'encoded_str_type'
kata198/indexedredis,kata198/indexedredis
IndexedRedis/fields/classic.py
IndexedRedis/fields/classic.py
# Copyright (c) 2017 Timothy Savannah under LGPL version 2.1. See LICENSE for more information. # # fields.classic - The IRField type which behaves like the "classic" IndexedRedis string-named fields. # # vim: set ts=8 shiftwidth=8 softtabstop=8 noexpandtab : from . import IRField, IR_NULL_STRINGS, irNull from ..co...
# Copyright (c) 2017 Timothy Savannah under LGPL version 2.1. See LICENSE for more information. # # fields.classic - The IRField type which behaves like the "classic" IndexedRedis string-named fields. # # vim: set ts=8 shiftwidth=8 softtabstop=8 noexpandtab : from . import IRField, IR_NULL_STRINGS, irNull from ..co...
lgpl-2.1
Python
b6b59d93a8b290bebea99c4c7d095cf7ab91cc77
fix #88
rowhit/gitfs,PressLabs/gitfs,bussiere/gitfs,ksmaheshkumar/gitfs,PressLabs/gitfs
gitfs/utils/args.py
gitfs/utils/args.py
import os import grp import getpass import tempfile class Args(object): def __init__(self, parser): self.DEFAULTS = { "repos_path": self.get_repos_path, "user": self.get_current_user, "group": self.get_current_group, "foreground": True, "branch":...
import os import grp import getpass import tempfile class Args(object): def __init__(self, parser): self.DEFAULTS = { "repos_path": self.get_repos_path(), "user": self.get_current_user(), "group": self.get_current_group(), "foreground": True, "br...
apache-2.0
Python
e599e01b7602399bf3e13fcad67f1195f6dea2ed
fix after API change
Senseg/robotframework,userzimmermann/robotframework-python3,userzimmermann/robotframework-python3,userzimmermann/robotframework-python3,Senseg/robotframework,userzimmermann/robotframework-python3,Senseg/robotframework,userzimmermann/robotframework-python3,Senseg/robotframework,Senseg/robotframework
doc/libraries/lib2html.py
doc/libraries/lib2html.py
#!/usr/bin/env python """Usage: lib2html.py [ library | all ] Libraries: BuiltIn (bu) Collections (co) Dialogs (di) OperatingSystem (op) Screenshot (sc) String (st) Telnet (te) """ import sys import os import re ROOT = os.path.normpath(os.path.join(os.path.abspath(__file__),'..','..','..')) sys.path....
#!/usr/bin/env python """Usage: lib2html.py [ library | all ] Libraries: BuiltIn (bu) Collections (co) Dialogs (di) OperatingSystem (op) Screenshot (sc) String (st) Telnet (te) """ import sys import os import re ROOT = os.path.normpath(os.path.join(os.path.abspath(__file__),'..','..','..')) sys.path....
apache-2.0
Python
621549a0bd4c5d077bf3cebb75158c34ee6aa7d4
change useraccount/passwd
macauleycheng/AOS_OF_Example,macauleycheng/AOS_OF_Example
000-Netconf/01-AddController/edit-config-controller.py
000-Netconf/01-AddController/edit-config-controller.py
from ncclient import manager import ncclient import xml.etree.ElementTree as ET host = "192.168.1.1" username="netconfuser" password="netconfuser" #username="root" #password="root" ##NOTE: # below two colum shall change to switch CPU MAC # <id>00:00:70:72:cf:dc:9d:b2</id> # <datapat...
from ncclient import manager import ncclient import xml.etree.ElementTree as ET host = "192.168.1.1" username="root" password="root" ##NOTE: # below two colum shall change to switch CPU MAC # <id>00:00:70:72:cf:dc:9d:b2</id> # <datapath-id>00:00:70:72:cf:dc:9d:b2</datapath-id> ...
apache-2.0
Python
aa349dfaf6159227c5871c16a6ae6b0f9cad4713
use change_plan and dont' save twice
dimagi/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,puttarajubr/commcare-hq,puttarajubr/commcare-hq,puttarajubr/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,puttarajubr/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq
corehq/apps/accounting/management/commands/make_domain_enterprise_level.py
corehq/apps/accounting/management/commands/make_domain_enterprise_level.py
from django.core.management import BaseCommand from corehq import Domain from corehq.apps.accounting.exceptions import NewSubscriptionError from corehq.apps.accounting.models import ( BillingAccount, SoftwarePlanEdition, SoftwarePlanVersion, Subscription, BillingAccountType) class Command(BaseComm...
from django.core.management import BaseCommand from corehq import Domain from corehq.apps.accounting.exceptions import NewSubscriptionError from corehq.apps.accounting.models import ( BillingAccount, SoftwarePlanEdition, SoftwarePlanVersion, Subscription, BillingAccountType) class Command(BaseComm...
bsd-3-clause
Python
98941b6670bca96b56e3ffe2f69a0acbc5692fa0
Use link without variable in wsgi.py to fix cookiecutter generation
r0x73/django-template,r0x73/django-template,r0x73/django-template
{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/wsgi.py
{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/wsgi.py
""" WSGI config for {{ cookiecutter.project_slug }} project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/stable/howto/deployment/wsgi/ """ import os from {{ cookiecutter.project_slug }} import get_project_roo...
""" WSGI config for {{ cookiecutter.project_slug }} project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/{{ docs_version }}/howto/deployment/wsgi/ """ import os from {{ cookiecutter.project_slug }} import get...
mit
Python
effa5f84fc93ced38ad9e5d3b0a16bea2d3914ef
Allow column to be a property
makinacorpus/Geotrek,Anaethelion/Geotrek,mabhub/Geotrek,camillemonchicourt/Geotrek,Anaethelion/Geotrek,johan--/Geotrek,johan--/Geotrek,johan--/Geotrek,makinacorpus/Geotrek,camillemonchicourt/Geotrek,GeotrekCE/Geotrek-admin,mabhub/Geotrek,makinacorpus/Geotrek,Anaethelion/Geotrek,Anaethelion/Geotrek,GeotrekCE/Geotrek-adm...
caminae/common/templatetags/field_verbose_name.py
caminae/common/templatetags/field_verbose_name.py
from django import template from django.db.models.fields.related import FieldDoesNotExist register = template.Library() def field_verbose_name(obj, field): """Usage: {{ object|get_object_field }}""" try: return obj._meta.get_field(field).verbose_name except FieldDoesNotExist: a = getattr(o...
from django import template register = template.Library() def field_verbose_name(obj, field): """Usage: {{ object|get_object_field }}""" return obj._meta.get_field(field).verbose_name register.filter(field_verbose_name) register.filter('verbose', field_verbose_name)
bsd-2-clause
Python
5f91ca32ae3d8fccb916fdf06bd6f2f546e6032c
Update dev
thomasyu888/Genie,thomasyu888/Genie,thomasyu888/Genie,thomasyu888/Genie
genie/__version__.py
genie/__version__.py
__version__ = "8.0.0-dev"
__version__ = "7.0.0-dev"
mit
Python
1943daaa02b4d314c7aa722a05ae77b5586b46f1
Add a little explanation on usage
Klumhru/boost-python-bullet,Klumhru/boost-python-bullet,Klumhru/boost-python-bullet
linear_math_tests/test_motionstate.py
linear_math_tests/test_motionstate.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ linear_math_tests.test_motionstate """ from __future__ import unicode_literals, print_function, absolute_import import unittest import math import bullet class MyMotionState(bullet.btMotionState): def __init__(self): self.transform = bullet.btTransform.i...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ linear_math_tests.test_motionstate """ from __future__ import unicode_literals, print_function, absolute_import import unittest import math import bullet class MyMotionState(bullet.btMotionState): def __init__(self): self.transform = bullet.btTransform.i...
mit
Python
ac500b059ac02ff5a104a25d2f5ff9f4848f536d
set default re subprocess timeout to 0.1, since that should be quite enough.
ProgVal/Limnoria-test,ProgVal/Limnoria-test,frumiousbandersnatch/supybot-code,Ban3/Limnoria,haxwithaxe/supybot,buildbot/supybot,Ban3/Limnoria,jeffmahoney/supybot
plugins/String/config.py
plugins/String/config.py
### # Copyright (c) 2003-2005, Jeremiah Fincher # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, # this list of co...
### # Copyright (c) 2003-2005, Jeremiah Fincher # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, # this list of co...
bsd-3-clause
Python
c481c935af42e88c0e8688ad995247b37cc96f6a
fix anyurl plugin's title parser and add googlebot UA
jkent/jkent-pybot,jrspruitt/jkent-pybot
plugins/anyurl_plugin.py
plugins/anyurl_plugin.py
# -*- coding: utf-8 -*- # vim: set ts=4 et import cgi import requests from six.moves.html_parser import HTMLParser from plugin import * content_types = ( 'text/html', 'text/xml', 'application/xhtml+xml', 'application/xml' ) class TitleParser(HTMLParser): def __init__(self): HTMLParser._...
# -*- coding: utf-8 -*- # vim: set ts=4 et import cgi import requests from six.moves.html_parser import HTMLParser from plugin import * content_types = ( 'text/html', 'text/xml', 'application/xhtml+xml', 'application/xml' ) class TitleParser(HTMLParser): def __init__(self): HTMLParser._...
mit
Python
30e9368203c96900f5cc6dc993b1201a6face9bf
test for a logged in user implemented
ndraper2/old-learning-journal
features/steps.py
features/steps.py
from lettuce import before, after, world, step import datetime import os from contextlib import closing from journal import connect_db from journal import DB_SCHEMA from journal import INSERT_ENTRY from pyramid import testing TEST_DSN = 'dbname=test_learning_journal user=ndraper2' settings = {'db': TEST_DSN} INPUT_B...
from lettuce import before, after, world, step import datetime import os from contextlib import closing from journal import connect_db from journal import DB_SCHEMA from journal import INSERT_ENTRY from pyramid import testing TEST_DSN = 'dbname=test_learning_journal user=ndraper2' settings = {'db': TEST_DSN} @worl...
mit
Python
bdb78cd1bb13981a20ecb0cf9eb981d784c95b0e
Update form to handle home_lon and home_lat
softwaresaved/fat,softwaresaved/fat,softwaresaved/fat,softwaresaved/fat
fellowms/forms.py
fellowms/forms.py
from django.forms import ModelForm, widgets from .models import Fellow, Event, Expense, Blog class FellowForm(ModelForm): class Meta: model = Fellow exclude = [ "home_lon", "home_lat", "inauguration_year", "mentor", ] ...
from django.forms import ModelForm, widgets from .models import Fellow, Event, Expense, Blog class FellowForm(ModelForm): class Meta: model = Fellow exclude = [ "inauguration_year", "mentor", ] class EventForm(ModelForm): class Meta: mo...
bsd-3-clause
Python
7451f70fc86ab2c18b0debddde5638c5dcd34b2f
Revise doc string with complexity
bowen0701/algorithms_data_structures
alg_dijkstra_shortest_path.py
alg_dijkstra_shortest_path.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np from ds_min_priority_queue_tuple import MinPriorityQueue def dijkstra(w_graph_d, start_vertex): """Dijkstra algorithm for singel-source shortest path problem in a "weighted" graph...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np from ds_min_priority_queue_tuple import MinPriorityQueue def dijkstra(w_graph_d, start_vertex): """Dijkstra algorithm for "weighted" graph. Finds shortest path in a weighted graph...
bsd-2-clause
Python
ca2b02d551e9bb4c8625ae79f7878892673fa731
Add CommCare, CommTrack filters for DomainES
qedsoftware/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,puttarajubr/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,puttarajubr/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,puttarajubr/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,puttarajubr/commcare-hq
corehq/apps/es/domains.py
corehq/apps/es/domains.py
from .es_query import HQESQuery from . import filters class DomainES(HQESQuery): index = 'domains' @property def builtin_filters(self): return [ real_domains, commcare_domains, commconnect_domains, commtrack_domains, created, ] +...
from .es_query import HQESQuery from . import filters class DomainES(HQESQuery): index = 'domains' @property def builtin_filters(self): return [ real_domains, commconnect_domains, created, ] + super(DomainES, self).builtin_filters def real_domains(): ...
bsd-3-clause
Python
c6ba9edaab10492e8d24db8c28771489331b22eb
Fix spacing in adminendpoints
ollien/Timpani,ollien/Timpani,ollien/Timpani
timpani/webserver/endpoints/adminendpoints.py
timpani/webserver/endpoints/adminendpoints.py
import flask import os.path import json from ... import blog import uuid import magic import mimetypes from .. import webhelpers FILE_LOCATION = os.path.abspath(os.path.dirname(__file__)) UPLOAD_LOCATION = os.path.abspath(os.path.join(FILE_LOCATION, "../../../static/uploads")) blueprint = flask.Blueprint("adminEndpoi...
import flask import os.path import json from ... import blog import uuid import magic import mimetypes from .. import webhelpers FILE_LOCATION = os.path.abspath(os.path.dirname(__file__)) UPLOAD_LOCATION = os.path.abspath(os.path.join(FILE_LOCATION, "../../../static/uploads")) blueprint = flask.Blueprint("adminEndpoi...
mit
Python
10e86be9e8d97f2373ed9aee5925460c28f6782b
make isort happy
pennlabs/penn-mobile-server,pennlabs/penn-mobile-server
cron/save_laundry_data.py
cron/save_laundry_data.py
#!/usr/bin/env python # Add the following line into the labs crontab. # */15 * * * * /home/labs/penn-mobile-server/cron/save_laundry_data.py import os import sys sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) if True: import server server.laundry.save_data()
#!/usr/bin/env python # Add the following line into the labs crontab. # */15 * * * * /home/labs/penn-mobile-server/cron/save_laundry_data.py import os import sys sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) import server # noqa server.laundry.save_data()
mit
Python
f904dce3006184b464d414c0cafe930b8c10a95b
Update P03_writingExcel fixed warnings by changing depreciated methods
JoseALermaIII/python-tutorials,JoseALermaIII/python-tutorials
books/AutomateTheBoringStuffWithPython/Chapter12/P03_writingExcel.py
books/AutomateTheBoringStuffWithPython/Chapter12/P03_writingExcel.py
# This program uses the OpenPyXL module to manipulate Excel documents # Creating and Saving Excel Documents import openpyxl wb = openpyxl.Workbook() print(wb.sheetnames) sheet = wb.active print(sheet.title) sheet.title = "Spam Bacon Eggs Sheet" print(wb.sheetnames) wb = openpyxl.load_workbook("example.xlsx") sheet =...
# This program uses the OpenPyXL module to manipulate Excel documents # Creating and Saving Excel Documents import openpyxl wb = openpyxl.Workbook() print(wb.sheetnames) sheet = wb.active print(sheet.title) sheet.title = "Spam Bacon Eggs Sheet" print(wb.sheetnames) wb = openpyxl.load_workbook("example.xlsx") sheet =...
mit
Python
c34b1d8e2d78641fbfbf7cc644a57dde04b2e6d3
Update 03_Proximity_Indicator.py
userdw/RaspberryPi_3_Starter_Kit
03_Proximity_Indicator/03_Proximity_Indicator/03_Proximity_Indicator.py
03_Proximity_Indicator/03_Proximity_Indicator/03_Proximity_Indicator.py
import MCP3202 import wiringpi,time,os from time import strftime wiringpi.wiringPiSetup() wiringpi.pinMode(1,1) wiringpi.pinMode(21,1) def translate(value,leftMin,leftMax,rightMin,rightMax): # Figure out how 'wide' each range is leftSpan = leftMax - leftMin rightSpan = rightMax - rightMin # Convert the left range ...
import MCP3202 import wiringpi,time,os from time import strftime wiringpi.wiringPiSetup() wiringpi.pinMode(1,1) wiringpi.pinMode(21,1) def translate(value,leftMin,leftMax,rightMin,rightMax): # Figure out how 'wide' each range is leftSpan = leftMax - leftMin rightSpan = rightMax - rightMin # Convert the left range ...
mit
Python
f6216cdd9be3db07c6f2271d7f0bbe39efa39766
Use custom formatter in orgviz.cli
tkf/orgviz
orgviz/cli.py
orgviz/cli.py
""" OrgViz command line interface. """ import argparse import textwrap class Formatter(argparse.RawDescriptionHelpFormatter, argparse.ArgumentDefaultsHelpFormatter): pass def get_parser(commands): """ Generate argument parser given a list of subcommand specifications. :type command...
""" OrgViz command line interface. """ def get_parser(commands): """ Generate argument parser given a list of subcommand specifications. :type commands: list of (str, function, function) :arg commands: Each element must be a tuple ``(name, adder, runner)``. :param name: subcommand...
mit
Python
71e1e09f750eac6cdf8ebb718190f07ae560f6e6
Fix message
houqp/floyd-cli,mckayward/floyd-cli,mckayward/floyd-cli,houqp/floyd-cli
floyd/cli/auth.py
floyd/cli/auth.py
import click import webbrowser import floyd from floyd.client.auth import AuthClient from floyd.manager.auth_config import AuthConfigManager from floyd.model.access_token import AccessToken from floyd.log import logger as floyd_logger @click.command() def login(): """ Log into Floyd via Auth0. """ cl...
import click import webbrowser import floyd from floyd.client.auth import AuthClient from floyd.manager.auth_config import AuthConfigManager from floyd.model.access_token import AccessToken from floyd.log import logger as floyd_logger @click.command() def login(): """ Log into Floyd via Auth0. """ cl...
apache-2.0
Python
3e3c885a42ac1422e6e1be763c4fb8cb58d51595
remove print
1ookup/shadowsocks,wan-qy/shadowsocks,ellasafy/shadowsocks,wsjmnh/shadowsocks,ITJesse/shadowsocks,weddge/shadowsocks,Peterpig/shadowsocks,zswang/shadowsocks,monalisir/shadowsocks,murmuryu/shadowsocks,Axure/shadowsocks-1,YoungGit/shadowsocks,Yexiaoxing/shadowsocks,vinceyuan/shadowsocks,Martinho0330/shadowsocks,karrra/sh...
shadowsocks/encrypt_rc4_md5.py
shadowsocks/encrypt_rc4_md5.py
#!/usr/bin/env python # Copyright (c) 2014 clowwindy # # 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 Software without restriction, including without limitation the rights # to use, copy, modify, me...
#!/usr/bin/env python # Copyright (c) 2014 clowwindy # # 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 Software without restriction, including without limitation the rights # to use, copy, modify, me...
apache-2.0
Python
2a662d04caf68629fe357b45450e5be3f950f03e
remove typo
gopythongo/gopythongo,gopythongo/gopythongo
src/py/gopythongo/shared/aptly_base.py
src/py/gopythongo/shared/aptly_base.py
# -* encoding: utf-8 *- # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. from typing import Any, List import configargparse import gopythongo.shared.aptly_args as _aptl...
# -* encoding: utf-8 *- # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. from typing import Any, List import configargparse import gopythongo.shared.aptly_args as _aptl...
mpl-2.0
Python
54e618db2ef5fd226c5514dd15d8f792fd0d8320
test org role as child for team 400s
snahelou/awx,wwitzel3/awx,wwitzel3/awx,wwitzel3/awx,wwitzel3/awx,snahelou/awx,snahelou/awx,snahelou/awx
awx/main/tests/unit/api/test_views.py
awx/main/tests/unit/api/test_views.py
import mock import pytest from rest_framework.test import APIRequestFactory from rest_framework.test import force_authenticate from awx.api.views import ( ApiV1RootView, TeamRolesList, ) from awx.main.models import ( User, ) @pytest.fixture def mock_response_new(mocker): m = mocker.patch('awx.api.vi...
import pytest from awx.api.views import ( ApiV1RootView, ) @pytest.fixture def mock_response_new(mocker): m = mocker.patch('awx.api.views.Response.__new__') m.return_value = m return m class TestApiV1RootView: def test_get_endpoints(self, mocker, mock_response_new): endpoints = [ ...
apache-2.0
Python
26526e6860ad28588c77cd9c9ea376a636da53e8
debug for method name.
rockers7414/xmusic-crawler,rockers7414/xmusic
daemon/database/artistrepo.py
daemon/database/artistrepo.py
import logging from decorator.injectdbsession import inject_db_session from .entity import Artist from sqlalchemy.orm import lazyload @inject_db_session() class ArtistRepo: logger = logging.getLogger(__name__) def get_artists_by_page(self, index, offset): query = self._session.query(Artist).options(...
import logging from decorator.injectdbsession import inject_db_session from .entity import Artist from sqlalchemy.orm import lazyload @inject_db_session() class ArtistRepo: logger = logging.getLogger(__name__) def get_artists_by_pagecpp(self, index, offset): query = self._session.query(Artist).optio...
apache-2.0
Python
ae1642842fb945013741d576022c85eba49033d8
update Croydon import script for parl.2017-06-08
DemocracyClub/UK-Polling-Stations,chris48s/UK-Polling-Stations,DemocracyClub/UK-Polling-Stations,chris48s/UK-Polling-Stations,chris48s/UK-Polling-Stations,DemocracyClub/UK-Polling-Stations
polling_stations/apps/data_collection/management/commands/import_croydon.py
polling_stations/apps/data_collection/management/commands/import_croydon.py
from data_collection.management.commands import BaseXpressDCCsvInconsistentPostcodesImporter class Command(BaseXpressDCCsvInconsistentPostcodesImporter): council_id = 'E09000008' addresses_name = 'parl.2017-06-08/Version 2/Democracy_Club__08June2017 (16).tsv' stations_name = 'parl.2017-06-08/Version 2/Demo...
""" Import Harrow """ from time import sleep from django.contrib.gis.geos import Point from data_collection.management.commands import BaseCsvStationsCsvAddressesImporter from data_finder.helpers import geocode, geocode_point_only, PostcodeError from addressbase.models import Address class Command(BaseCsvStationsCs...
bsd-3-clause
Python
42d5553878673dcbc45e7146164c86f418312152
Add models to Admin
Kromey/akwriters,Kromey/fbxnano,Kromey/akwriters,Kromey/akwriters,Kromey/fbxnano,Kromey/fbxnano,Kromey/fbxnano,Kromey/akwriters
tools/admin.py
tools/admin.py
from django.contrib import admin from .models import Character,CharacterNotes,CharacterNotesAnswer # Register your models here. @admin.register(Character) class CharacterAdmin(admin.ModelAdmin): list_display = ('name','owner',) readonly_fields = ('owner',) @admin.register(CharacterNotes) class CharacterNo...
from django.contrib import admin # Register your models here.
mit
Python
29b8b4604460dc54331f0f10a93a6bb6803b3af3
fix example of plot_RGB_colourspaces_gamuts
colour-science/colour
colour/examples/plotting/examples_volume_plots.py
colour/examples/plotting/examples_volume_plots.py
# -*- coding: utf-8 -*- """ Showcases colour models volume and gamut plotting examples. """ import numpy as np from colour.plotting import (plot_RGB_colourspaces_gamuts, plot_RGB_scatter, colour_style) from colour.utilities import message_box message_box('Colour Models Volume and Gamut P...
# -*- coding: utf-8 -*- """ Showcases colour models volume and gamut plotting examples. """ import numpy as np from colour.plotting import (plot_RGB_colourspaces_gamuts, plot_RGB_scatter, colour_style) from colour.utilities import message_box message_box('Colour Models Volume and Gamut P...
bsd-3-clause
Python
11f933e986dd9e2c62b852ca38a37f959c10145e
Fix FindDepotToolsInPath not working in some cases
shaochangbin/crosswalk,rakuco/crosswalk,RafuCater/crosswalk,DonnaWuDongxia/crosswalk,tomatell/crosswalk,mrunalk/crosswalk,jpike88/crosswalk,dreamsxin/crosswalk,stonegithubs/crosswalk,weiyirong/crosswalk-1,siovene/crosswalk,baleboy/crosswalk,crosswalk-project/crosswalk,fujunwei/crosswalk,ZhengXinCN/crosswalk,minggangw/c...
tools/utils.py
tools/utils.py
#!/usr/bin/env python ''' This script provides utils for python scripts in cameo. ''' import os import sys import subprocess def TryAddDepotToolsToPythonPath(): depot_tools = FindDepotToolsInPath() if depot_tools: sys.path.append(depot_tools) def FindDepotToolsInPath(): paths = os.getenv('PATH').split(os....
#!/usr/bin/env python ''' This script provides utils for python scripts in cameo. ''' import os import sys import subprocess def TryAddDepotToolsToPythonPath(): depot_tools = FindDepotToolsInPath() if depot_tools: sys.path.append(depot_tools) def FindDepotToolsInPath(): paths = os.getenv('PATH').split(os....
bsd-3-clause
Python
2fe47e3b26b3fc888de4dba004cb04d31a2eb97d
Remove unnecessary getter
furbrain/tingbot-python
tingbot/platform_specific/sdl_wrapper.py
tingbot/platform_specific/sdl_wrapper.py
import pygame import os from ..graphics import Surface,color_map button_callback = None class Wrapper(Surface): def __init__(self): self.surface = pygame.display.set_mode((470, 353)) background = pygame.image.load(os.path.join(os.path.dirname(__file__), 'bot.png')) self.surface.blit(backgr...
import pygame import os from ..graphics import Surface,color_map button_callback = None class Wrapper(Surface): def __init__(self): self.surface = pygame.display.set_mode((470, 353)) background = pygame.image.load(os.path.join(os.path.dirname(__file__), 'bot.png')) self.surface.blit(backgr...
bsd-2-clause
Python
caf4e1f1e6ff9eac2750920fc4c5b5596b97c3a6
Update Input_csv_file.py
MounikaVanka/bme590hrm,MounikaVanka/bme590hrm
Code/Input_csv_file.py
Code/Input_csv_file.py
def read_in(): import csv import numpy """ Opens the ecg CSV file :param readCSV: pointer to the file :param times: the time from the signal :param Voltage: the voltage from the signal """ # with open('ecg_data.csv') as csvfile: # read_csv = csv.reader(csvfile, delimite...
def read_in(): import csv import numpy """ Opens the ecg CSV file :param readCSV: pointer to the file :param times: the time from the signal :param Voltage: the voltage from the signal """ # with open('ecg_data.csv') as csvfile: # read_csv = csv.reader(csvfile, delimite...
mit
Python
079c86d124961242b89b692d5e57964babf8c45e
Add initial support for the --quiet option. Remove unused imports. Fix arguments passed to Qt : only the remaining arguments should be passed.
thomasdeniau/pyfauxfur,thomasdeniau/pyfauxfur
PyMorphogenesis.py
PyMorphogenesis.py
#!/usr/bin/env python # encoding: utf-8 """ PyMorphogenesis.py Created by Olivier Le Floch on 2009-03-17. Program written by Thomas Deniau and Olivier Le Floch. Copyright (c) 2009. All rights reserved. """ import sys from optparse import OptionParser from PyQt4 import QtCore, QtGui from MainWindow import MainWindow ...
#!/usr/bin/env python # encoding: utf-8 """ PyMorphogenesis.py Created by Olivier Le Floch on 2009-03-17. Program written by Thomas Deniau and Olivier Le Floch. Copyright (c) 2009. All rights reserved. """ import sys import math from optparse import OptionParser from PyQt4 import QtCore, QtGui from MainWindow import...
bsd-3-clause
Python
11f3320413b9746d75470e623809e5e28ebbc712
Fix python run_webkit_tests wrapper script to work correctly regardless of whether you're running cygwin python or win32 python and regardless of where you're invoking the script from.
wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser,wistoch/meego-app-browser
webkit/tools/layout_tests/run_webkit_tests.py
webkit/tools/layout_tests/run_webkit_tests.py
#!/usr/bin/env python # Copyright (c) 2010 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Wrapper around third_party/WebKit/WebKitTools/Scripts/new-run-webkit-tests""" import os import subprocess import sys def mai...
#!/usr/bin/env python # Copyright (c) 2010 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Wrapper around third_party/WebKit/WebKitTools/Scripts/new-run-webkit-tests""" import os import subprocess import sys def mai...
bsd-3-clause
Python
1086652e37d8f0d23199e9d2f7ed0be51e17c905
change the update time
elixirhub/events-portal-scraping-scripts
ScheduleAddData.py
ScheduleAddData.py
__author__ = 'chuqiao' from apscheduler.schedulers.blocking import BlockingScheduler import EventsPortal import sys def scheduleUpdateSolr(sourceUrl,patternUrl,solrUrl): """ """ # logger.info('***Starting update every hour***') sched = BlockingScheduler() sched.add_job(EventsPortal.addDataTo...
__author__ = 'chuqiao' from apscheduler.schedulers.blocking import BlockingScheduler import EventsPortal import sys def scheduleUpdateSolr(sourceUrl,patternUrl,solrUrl): """ """ # logger.info('***Starting update every hour***') sched = BlockingScheduler() sched.add_job(EventsPortal.addDataTo...
mit
Python
6522a63d7431e5cddc59a8b04b32c3c3cdcb8352
disable a test on skipif_circleci
sdpython/ensae_teaching_cs,sdpython/ensae_teaching_cs,sdpython/ensae_teaching_cs,sdpython/ensae_teaching_cs,sdpython/ensae_teaching_cs,sdpython/ensae_teaching_cs
_unittests/ut_dnotebooks/test_nb_coverage_2018_2019.py
_unittests/ut_dnotebooks/test_nb_coverage_2018_2019.py
# -*- coding: utf-8 -*- """ @brief test log(time=88s) """ import os import unittest from pyquickhelper.loghelper import fLOG from pyquickhelper.ipythonhelper import test_notebook_execution_coverage from pyquickhelper.pycode import ( add_missing_development_version, ExtTestCase, skipif_circleci) import ensa...
# -*- coding: utf-8 -*- """ @brief test log(time=88s) """ import os import unittest from pyquickhelper.loghelper import fLOG from pyquickhelper.ipythonhelper import test_notebook_execution_coverage from pyquickhelper.pycode import add_missing_development_version, ExtTestCase import ensae_teaching_cs class TestNo...
mit
Python
81229e13aa3c9c8ef277bfb24a615c367164545c
Add multi cursor support, close #21
johyphenel/sublime-expand-region,johyphenel/sublime-expand-region,aronwoost/sublime-expand-region
ExpandRegion.py
ExpandRegion.py
import sublime, sublime_plugin, os try: import expand_region_handler except: from . import expand_region_handler class ExpandRegionCommand(sublime_plugin.TextCommand): def run(self, edit, debug=False): extension = "" if (self.view.file_name()): name, fileex = os.path.splitext(self.view.file_n...
import sublime, sublime_plugin, os try: import expand_region_handler except: from . import expand_region_handler class ExpandRegionCommand(sublime_plugin.TextCommand): def run(self, edit, debug=False): extension = "" if (self.view.file_name()): name, fileex = os.path.splitext(self.view.file_n...
mit
Python
91ff0fcb40d5d5318b71f0eb4b0873fb470265a0
Add downgrade started applications migration
loomchild/puffin,loomchild/puffin,loomchild/puffin,puffinrocks/puffin,puffinrocks/puffin,loomchild/jenca-puffin,loomchild/puffin,loomchild/jenca-puffin,loomchild/puffin
migrations/versions/f0c9c797c230_populate_application_settings_with_.py
migrations/versions/f0c9c797c230_populate_application_settings_with_.py
"""populate application_settings with started apps Revision ID: f0c9c797c230 Revises: 31850461ed3 Create Date: 2017-02-16 01:02:02.951573 """ # revision identifiers, used by Alembic. revision = 'f0c9c797c230' down_revision = '31850461ed3' from alembic import op import sqlalchemy as sa from puffin.core import docke...
"""populate application_settings with started apps Revision ID: f0c9c797c230 Revises: 31850461ed3 Create Date: 2017-02-16 01:02:02.951573 """ # revision identifiers, used by Alembic. revision = 'f0c9c797c230' down_revision = '31850461ed3' from alembic import op import sqlalchemy as sa from puffin.core import docke...
agpl-3.0
Python
ee4ab950e2a6748af9aefea0dd1cd8f227d6bca8
Fix linting issues
masschallenge/django-accelerator,masschallenge/django-accelerator
accelerator/migrations/0099_update_program_model.py
accelerator/migrations/0099_update_program_model.py
# Generated by Django 2.2.28 on 2022-04-20 13:05 from django.db import ( migrations, models, ) class Migration(migrations.Migration): dependencies = [ ('accelerator', '0098_update_startup_update_20220408_0441'), ] operations = [ migrations.AddField( model_name='prog...
# Generated by Django 2.2.28 on 2022-04-20 13:05 from django.db import ( migrations, models, ) class Migration(migrations.Migration): dependencies = [ ('accelerator', '0098_update_startup_update_20220408_0441'), ] operations = [ migrations.AddField( model_name='prog...
mit
Python
beae821d6997bf8257673c391ed6a1fe7f38c682
change sequence
yasokada/python-151127-7segLed_IPadrDisplay
IPadrDisplay.py
IPadrDisplay.py
from util7SegLED import info7seg_init, info7seg_on, info7seg_allOff from util7SegLED import info7seg_decimalPoint from util7SegLED import info7seg_onOff from util7SegLED import info7seg_onDecimalPointOff from utilNetworkIP import NetworkIP_get_ipAddress_eth0 import time ''' v0.2 2015/11/28 - disp IP address using u...
from util7SegLED import info7seg_init, info7seg_on, info7seg_allOff from util7SegLED import info7seg_decimalPoint from util7SegLED import info7seg_onOff from util7SegLED import info7seg_onDecimalPointOff from utilNetworkIP import NetworkIP_get_ipAddress_eth0 import time ''' v0.2 2015/11/28 - add disp_ipAddress() ...
mit
Python
3d2dc3b0d4116e6a875b8f8d8878e0e82639a1d1
update document
cnits/PyUtil
Lib/CPyMongo.py
Lib/CPyMongo.py
from pymongo import MongoClient try: from urllib.parse import quote_plus except Exception as e: from urllib import quote_plus class CPyMongo: def __init__(self, db_name, user=None, password=None, host=None, port=None): if host is None or host == "": host = 'localhost' if port i...
from pymongo import MongoClient try: from urllib.parse import quote_plus except Exception: from urllib import quote_plus class CPyMongo: def __init__(self, db_name, user=None, password=None, host=None, port=None): if host is None or host == "": host = 'localhost' if port is None...
apache-2.0
Python
4ef288afb497d20f31c1a8c68226b74a465f3d01
Update piece.py
xpchess/xpchess
Pieces/piece.py
Pieces/piece.py
class piece(object): def __init__(self,col): if col in ["Black","White"]: self.color = col else: raise TypeError def __str__(self): typ = str(type(self)).split(".")[1][:-2] return "{} {}".format(self.color,typ) def __repr__(self): typ...
class piece(object): def __init__(self,col): if col in ["Black","White"]: self.color = col else: raise TypeError def __str__(self): typ = str(type(self)).split(".")[1][:-2] return "{} {}".format(self.color,typ) def __repr__(self): typ...
bsd-2-clause
Python
35eca403a1ab9817b7e1538b84827c5e64ddab0a
Add suport for MERGE_MSG
aristidesfl/sublime-git-commit-message-auto-save
gitcommitautosave.py
gitcommitautosave.py
"""Git Commit Auto Save. Sublime Text 3 package to auto save commit messages when the window is closed. This allows the user to close the window without having to save before, or having to deal with the "Save File" popup. """ import sublime_plugin class GitCommitAutoSave(sublime_plugin.EventListener): def on_load(s...
"""Git Commit Auto Save. Sublime Text 3 package to auto save commit messages when the window is closed. This allows the user to close the window without having to save before, or having to deal with the "Save File" popup. """ import sublime_plugin class GitCommitAutoSave(sublime_plugin.EventListener): def on_load(s...
mit
Python
726eb82758ba6ceec8e31611b2854e5f4c0cee72
Mark RPI Power binary sensor as diagnostic (#76198)
w1ll1am23/home-assistant,mezz64/home-assistant,nkgilley/home-assistant,w1ll1am23/home-assistant,mezz64/home-assistant,nkgilley/home-assistant
homeassistant/components/rpi_power/binary_sensor.py
homeassistant/components/rpi_power/binary_sensor.py
""" A sensor platform which detects underruns and capped status from the official Raspberry Pi Kernel. Minimal Kernel needed is 4.14+ """ import logging from rpi_bad_power import UnderVoltage, new_under_voltage from homeassistant.components.binary_sensor import ( BinarySensorDeviceClass, BinarySensorEntity, ...
""" A sensor platform which detects underruns and capped status from the official Raspberry Pi Kernel. Minimal Kernel needed is 4.14+ """ import logging from rpi_bad_power import UnderVoltage, new_under_voltage from homeassistant.components.binary_sensor import ( BinarySensorDeviceClass, BinarySensorEntity, ...
apache-2.0
Python
f65cb4fa50c67ffdaf1b5ef26534bc03e8751dd0
add tests for program categories
RouxRC/weboob,laurent-george/weboob,frankrousseau/weboob,sputnick-dev/weboob,nojhan/weboob-devel,laurent-george/weboob,sputnick-dev/weboob,RouxRC/weboob,RouxRC/weboob,willprice/weboob,nojhan/weboob-devel,willprice/weboob,frankrousseau/weboob,nojhan/weboob-devel,Konubinix/weboob,sputnick-dev/weboob,Konubinix/weboob,Konu...
modules/arte/test.py
modules/arte/test.py
# -*- coding: utf-8 -*- # Copyright(C) 2010-2011 Romain Bignon # # This file is part of weboob. # # weboob 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...
# -*- coding: utf-8 -*- # Copyright(C) 2010-2011 Romain Bignon # # This file is part of weboob. # # weboob 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...
agpl-3.0
Python
a0ec9e4faba5f5342a7b0d2653f7552e2d19a67d
change prod setting
sunForest/AviPost,sunForest/AviPost
avipost/avipost/settings/prod.py
avipost/avipost/settings/prod.py
from .base import * INSTALLED_APPS += ( 'corsheaders', ) # need to be before django.middleware.common.CommonMiddleware MIDDLEWARE_CLASSES = ( 'corsheaders.middleware.CorsMiddleware', ) + MIDDLEWARE_CLASSES CORS_ORIGIN_ALLOW_ALL = True # TODO: set the database parameters ALLOWED_HOSTS = ["52.16.214.13", "12...
from .base import * INSTALLED_APPS += ( 'corsheaders', ) # need to be before django.middleware.common.CommonMiddleware MIDDLEWARE_CLASSES = ( 'corsheaders.middleware.CorsMiddleware', ) + MIDDLEWARE_CLASSES CORS_ORIGIN_ALLOW_ALL = True # TODO: set the database parameters
apache-2.0
Python
28c39136aadd34253ff0c925504427a19bccfd49
Update to version v0.0.4
jeffknupp/domain-parser,jeffknupp/domain-parser
domain_parser/__init__.py
domain_parser/__init__.py
__version__ = '0.0.4'
__version__ = '0.0.3.4'
apache-2.0
Python
8beee9b0b61789d0b54f4b3cd83f2d8d450da77d
Disable inbox_benchmark.Inbox.
axinging/chromium-crosswalk,Just-D/chromium-1,hgl888/chromium-crosswalk,Pluto-tv/chromium-crosswalk,PeterWangIntel/chromium-crosswalk,Pluto-tv/chromium-crosswalk,Fireblend/chromium-crosswalk,fujunwei/chromium-crosswalk,Pluto-tv/chromium-crosswalk,hgl888/chromium-crosswalk,hgl888/chromium-crosswalk,fujunwei/chromium-cro...
tools/perf/benchmarks/inbox_benchmark.py
tools/perf/benchmarks/inbox_benchmark.py
# Copyright 2015 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # TODO: Benchmark is failing; see crbug.com/452257. Comment out instead of # disabling because the failure happens before the Disabled check. #from page_sets...
# Copyright 2015 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from page_sets import inbox from telemetry import benchmark from telemetry.web_perf import timeline_based_measurement @benchmark.Disabled('android') class I...
bsd-3-clause
Python
d4eb6ddeb95a80b843c7dcbe9d92d483d13e8284
Rename variable
pwyf/IATI-Data-Quality,pwyf/IATI-Data-Quality,pwyf/IATI-Data-Quality,pwyf/IATI-Data-Quality
tracker/app.py
tracker/app.py
"""The app module, containing the app factory function.""" from flask import Flask, render_template from flask_security import SQLAlchemyUserDatastore from . import commands, core, survey, iati from .security.models import User, Role from .extensions import cache, db, debug_toolbar, migrate, webpack, security from .da...
"""The app module, containing the app factory function.""" from flask import Flask, render_template from flask_security import SQLAlchemyUserDatastore from . import commands, core, survey, iati from .security.models import User, Role from .extensions import cache, db, debug_toolbar, migrate, webpack, security from .da...
agpl-3.0
Python
51c25fba0ecfa627ac91e6a9ab83c2bd44fab29c
remove debug
podhub-io/follower
podhub/follower/views.py
podhub/follower/views.py
from . import app from feed import Feed from flask import jsonify, request @app.route('/') def index(): return jsonify() @app.route('/audio') def feed(): url = request.args.get('feed_url') index = request.args.get('index') if not index: index = -1 feed = Feed(url=url) try: ...
from . import app from feed import Feed from flask import jsonify, request @app.route('/') def index(): return jsonify() @app.route('/audio') def feed(): url = request.args.get('feed_url') index = request.args.get('index') if not index: index = -1 feed = Feed(url=url) entry = feed....
bsd-3-clause
Python
f1b93779783f462fb270393e6614b4a00f9c91e8
Refactor caching behaviour from api endpoints.
ecolell/pfamserver,ecolell/pfamserver,ecolell/pfamserver
backend/pfamserver/extensions.py
backend/pfamserver/extensions.py
"""Extensions builders.""" from flask_caching import Cache from flask_sqlalchemy import SQLAlchemy from flask_wtf.csrf import CSRFProtect from flask import request cache = Cache() csrf = CSRFProtect() db = SQLAlchemy() # session_options={"autoflush": False}) def make_cache_key(*args, **kwargs): path = request...
"""Extensions builders.""" from flask_caching import Cache from flask_sqlalchemy import SQLAlchemy from flask_wtf.csrf import CSRFProtect cache = Cache() csrf = CSRFProtect() db = SQLAlchemy() # session_options={"autoflush": False})
agpl-3.0
Python
13639181c2c63a800fdad754259b7282b0fbf63a
fix race condition in open-remote
nwjs/nw.js,nwjs/nw.js,nwjs/nw.js,nwjs/nw.js,nwjs/nw.js,nwjs/nw.js
test/sanity/open-remote/test.py
test/sanity/open-remote/test.py
import time import os import subprocess import sys sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from nw_util import * from selenium import webdriver from selenium.webdriver.chrome.options import Options from selenium.webdriver.common import utils chrome_options = Options() chrome_optio...
import time import os import subprocess import sys sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from nw_util import * from selenium import webdriver from selenium.webdriver.chrome.options import Options from selenium.webdriver.common import utils chrome_options = Options() chrome_optio...
mit
Python
6ef73bb54f0e5f403012d672a756591969567698
Add symbol method to Terminal class
PatrikValkovic/grammpy
grammpy/Terminal.py
grammpy/Terminal.py
#!/usr/bin/env python """ :Author Patrik Valkovic :Created 23.06.2017 16:39 :Licence GNUv3 Part of grammpy """ import copy class Terminal: def __init__(self, symbol, grammar): self.__symbol = symbol self.__grammar = grammar def __hash__(self): return hash((self.__symbol, id(self.__g...
#!/usr/bin/env python """ :Author Patrik Valkovic :Created 23.06.2017 16:39 :Licence GNUv3 Part of grammpy """ class Terminal: def __init__(self, symbol, grammar): self.__symbol = symbol self.__grammar = grammar def __hash__(self): return hash((self.__symbol, id(self.__grammar))) ...
mit
Python
dae5bb7174959aa50ee65b5992bae3d4fce8da18
Use the KeyBindingManager.
bitmonk/pgcli,thedrow/pgcli,johshoff/pgcli,bitemyapp/pgcli,TamasNo1/pgcli,w4ngyi/pgcli,MattOates/pgcli,dbcli/vcli,bitemyapp/pgcli,zhiyuanshi/pgcli,j-bennet/pgcli,nosun/pgcli,janusnic/pgcli,j-bennet/pgcli,johshoff/pgcli,lk1ngaa7/pgcli,dbcli/pgcli,lk1ngaa7/pgcli,bitmonk/pgcli,darikg/pgcli,dbcli/pgcli,darikg/pgcli,suzukaz...
pgcli/key_bindings.py
pgcli/key_bindings.py
import logging from prompt_toolkit.keys import Keys from prompt_toolkit.key_binding.manager import KeyBindingManager _logger = logging.getLogger(__name__) def pgcli_bindings(): """ Custom key bindings for pgcli. """ key_binding_manager = KeyBindingManager() @key_binding_manager.registry.add_bindi...
import logging from prompt_toolkit import filters from prompt_toolkit.keys import Keys from prompt_toolkit.key_binding.registry import Registry from prompt_toolkit.key_binding.bindings.emacs import load_emacs_bindings _logger = logging.getLogger(__name__) def pgcli_bindings(): """ Custom key bindings for pgcl...
bsd-3-clause
Python
8d1516535a499b65441ee39873f03e4d19a7426e
Bump version
virtuald/greenado,virtuald/greenado
greenado/version.py
greenado/version.py
__version__ = '0.2.1'
__version__ = '0.2.0'
apache-2.0
Python
864ad2dbb7e58b6aac7f9b02ba2babddeb7f8d53
rename sandbox to server for run command
plone/plone.server,plone/plone.server
src/plone.server/setup.py
src/plone.server/setup.py
# -*- coding: utf-8 -*- from setuptools import find_packages from setuptools import setup setup( name='plone.server', version=open('VERSION').read().strip(), long_description=(open('README.rst').read() + '\n' + open('CHANGELOG.rst').read()), classifiers=[ 'Framework :: Plo...
# -*- coding: utf-8 -*- from setuptools import find_packages from setuptools import setup setup( name='plone.server', version=open('VERSION').read().strip(), long_description=(open('README.rst').read() + '\n' + open('CHANGELOG.rst').read()), classifiers=[ 'Framework :: Plo...
bsd-2-clause
Python
ee9a30d2c6d6c7e7c9e7f073d1898ff016583142
Update database name
fernando24164/flask_api,fernando24164/flask_api
config.py
config.py
import os basedir = os.path.abspath(os.path.dirname(__file__)) class Config: SECRET_KEY = 'f63f65a3f7274455bfd49edf9c6b36bd' SQLALCHEMY_COMMIT_ON_TEARDOWN = True @staticmethod def init_app(app): pass class DevelopmentConfig(Config): DEBUG = True SQLALCHEMY_DATABASE_URI = 'sqlite:///...
import os basedir = os.path.abspath(os.path.dirname(__file__)) class Config: SECRET_KEY = 'f63f65a3f7274455bfd49edf9c6b36bd' SQLALCHEMY_COMMIT_ON_TEARDOWN = True @staticmethod def init_app(app): pass class DevelopmentConfig(Config): DEBUG = True SQLALCHEMY_DATABASE_URI = 'sqlite:///...
mit
Python