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
6607e50686d2b0b8998ffb993e9f785668a498c9
Bump version
scraperwiki/data-services-helpers
setup.py
setup.py
from distutils.core import setup setup(name='dshelpers', version='1.2.0', description="Provides some helpers functions used by the ScraperWiki Data Services team.", long_description="Provides some helpers functions used by the ScraperWiki Data Services team.", classifiers=["Development Status ::...
from distutils.core import setup setup(name='dshelpers', version='1.1.0', description="Provides some helpers functions used by the ScraperWiki Data Services team.", long_description="Provides some helpers functions used by the ScraperWiki Data Services team.", classifiers=["Development Status ::...
bsd-2-clause
Python
77dd2ff03a9685e86e457234844006580c5c9df3
Bump version to 2.0.7
UCBerkeleySETI/blimpy,UCBerkeleySETI/blimpy
setup.py
setup.py
""" setup.py -- setup script for use of packages. """ from setuptools import setup, find_packages __version__ = '2.0.7' with open("README.md", "r") as fh: long_description = fh.read() # create entry points # see http://astropy.readthedocs.org/en/latest/development/scripts.html entry_points = { 'console_scrip...
""" setup.py -- setup script for use of packages. """ from setuptools import setup, find_packages __version__ = '2.0.6' with open("README.md", "r") as fh: long_description = fh.read() # create entry points # see http://astropy.readthedocs.org/en/latest/development/scripts.html entry_points = { 'console_scrip...
bsd-3-clause
Python
b07f20d8cb1cb0db3c32909b8ec1d7c1965b9b2e
Remove unused 'setup.py publish'
adamchainz/pytest-restrict
setup.py
setup.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function, unicode_literals import re try: from setuptools import setup except ImportError: from distutils.core import setup def get_version(filename): """ Return package version as listed in `__vers...
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function, unicode_literals import os import re import sys try: from setuptools import setup except ImportError: from distutils.core import setup def get_version(filename): """ Return package version...
mit
Python
8a145334f250246292259c50a115bcd89cbd3e98
FIX revised sequence location
jungmannlab/picasso,jungmannlab/picasso,jungmannlab/picasso
setup.py
setup.py
from setuptools import setup setup( name="picasso", version="0.3.1", author="Joerg Schnitzbauer, Maximilian T. Strauss", author_email=( "joschnitzbauer (at) gmail.com, straussmaximilian (at) gmail.com" ), url="https://github.com/jungmannlab/picasso", packages=["picasso", "picasso.gu...
from setuptools import setup setup( name="picasso", version="0.3.1", author="Joerg Schnitzbauer, Maximilian T. Strauss", author_email=( "joschnitzbauer (at) gmail.com, straussmaximilian (at) gmail.com" ), url="https://github.com/jungmannlab/picasso", packages=["picasso", "picasso.gu...
mit
Python
566c69d0b9cca4fe9c3d009df7b522d4d527791b
Update readme in setup.
kplindegaard/smbus2
setup.py
setup.py
from setuptools import setup readme = """ Introduction ------------ smbus2 is (yet another) pure Python implementation of of the [python-smbus](http://www.lm-sensors.org/browser/i2c-tools/trunk/py-smbus/) package. It was designed from the ground up with two goals in mind: 1. It should be a drop-in replacement of sm...
from setuptools import setup readme = """ Tullball """ setup( name="smbus2", version="0.1.0", author="Karl-Petter Lindegaard", author_email="kp.lindegaard@gmail.com", description="A drop-in replacement for smbus-cffi/smbus-python in pure Python", license="MIT", keywords= "smbus python i2c ...
mit
Python
672f9586668c8be42d4b667facc006415056b643
Add tests and utils to distributed dirs and bump version.
quantopian/pgcontents
setup.py
setup.py
from __future__ import print_function from setuptools import setup from os.path import join, dirname import sys def fail(msg): print(msg, file=sys.stderr) sys.exit(1) def main(): try: import IPython if IPython.version_info[0] < 3: fail("PGContents requires IPython 3.0 or grea...
from __future__ import print_function from setuptools import setup from os.path import join, dirname import sys def fail(msg): print(msg, file=sys.stderr) sys.exit(1) def main(): try: import IPython if IPython.version_info[0] < 3: fail("PGContents requires IPython 3.0 or grea...
apache-2.0
Python
ebad4d3a2112b3bc33db19154795cae37411e06b
Make pypi happy
mpenning/shellsnmp,mpenning/shellsnmp
setup.py
setup.py
#!/usr/bin/env python ## Ref https://docs.python.org/2/distutils/introduction.html ## Ref https://the-hitchhikers-guide-to-packaging.readthedocs.org/en/latest/ ## Ref http://www.ibm.com/developerworks/library/os-pythonpackaging/ from setuptools import setup, find_packages import sys import os CURRENT_PATH=os.path.join...
#!/usr/bin/env python ## Ref https://docs.python.org/2/distutils/introduction.html ## Ref https://the-hitchhikers-guide-to-packaging.readthedocs.org/en/latest/ ## Ref http://www.ibm.com/developerworks/library/os-pythonpackaging/ from setuptools import setup, find_packages import sys import os CURRENT_PATH=os.path.join...
mit
Python
95bb17baed4e7b831433dd04b117554e2fcd471e
Update version in setup.py
anyman/pyschema,pombredanne/pyschema,spotify/pyschema
setup.py
setup.py
# Copyright (c) 2013 Spotify AB # # Licensed under the Apache License, Version 2.0 (the "License"); you may not # use this file except in compliance with the License. You may obtain a copy of # the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
# Copyright (c) 2013 Spotify AB # # Licensed under the Apache License, Version 2.0 (the "License"); you may not # use this file except in compliance with the License. You may obtain a copy of # the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
apache-2.0
Python
195b6c1b3db484e6d9bde1315b1200f63aca20b2
add dependency on `backports.inspect`
agoraplex/anodi
setup.py
setup.py
from setuptools import setup requirements = { 'install': [ 'distribute', 'backports.inspect>=0.0.2', ], 'extras': { 'docs': [ 'sphinx>=1.1', 'agoraplex.themes.sphinx>=0.1.3', ], 'tests': [ 'nose>=1.2.1', 'covera...
from setuptools import setup requirements = { 'install': [ 'distribute', ], 'extras': { 'docs': [ 'sphinx>=1.1', 'agoraplex.themes.sphinx>=0.1.3', ], 'tests': [ 'nose>=1.2.1', 'coverage>=3.6', 'pinocchio>=0....
bsd-3-clause
Python
91c4b034b76debb3469401544fa953338e8b293c
update version
kbefus/pyres
setup.py
setup.py
import sys from setuptools import setup # To use: # python setup.py bdist --format=wininst # trap someone trying to install pyres with something other # than python 2 or 3 if not sys.version_info[0] in [2, 3]: print('Sorry, pyres not supported in your Python version') print(' Supported versions: 2 and 3')...
import sys from setuptools import setup # To use: # python setup.py bdist --format=wininst # trap someone trying to install pyres with something other # than python 2 or 3 if not sys.version_info[0] in [2, 3]: print('Sorry, pyres not supported in your Python version') print(' Supported versions: 2 and 3')...
bsd-3-clause
Python
dcd355b162ab5bac59cb0e52d0b2b93a6b324553
Fix missing 'services' package (#254)
picklepete/pyicloud,picklepete/pyicloud
setup.py
setup.py
from setuptools import setup, find_packages with open('requirements.txt') as f: required = f.read().splitlines() setup( name='pyicloud', version='0.9.6', url='https://github.com/picklepete/pyicloud', description=( 'PyiCloud is a module which allows pythonistas to ' 'interact with...
from setuptools import setup, find_packages with open('requirements.txt') as f: required = f.read().splitlines() setup( name='pyicloud', version='0.9.6', url='https://github.com/picklepete/pyicloud', description=( 'PyiCloud is a module which allows pythonistas to ' 'interact with...
mit
Python
db10e59240a7d29c1e80f4d1551a5704a263f31e
Bump version
nkrishnaswami/uscensus,nkrishnaswami/census
setup.py
setup.py
#!/usr/bin/env python from setuptools import setup, find_packages setup( name="uscensus", version="0.1.9", packages=find_packages(), description="US Census API discovery wrappers", long_description="""This module fetches metadata for the Census Data API to make it easier to find relevant data sets ...
#!/usr/bin/env python from setuptools import setup, find_packages setup( name="uscensus", version="0.1.8", packages=find_packages(), description="US Census API discovery wrappers", long_description="""This module fetches metadata for the Census Data API to make it easier to find relevant data sets ...
apache-2.0
Python
bf9c04719e9c4847412e7e790914e529ff952e33
install all requirements before building the parser
johnyf/openpromela
setup.py
setup.py
import pip from setuptools import setup description = ( 'Generalized reactive(1) synthesis from Promela specifications.') README = 'README.md' VERSION_FILE = 'openpromela/_version.py' MAJOR = 0 MINOR = 0 MICRO = 1 version = '{major}.{minor}.{micro}'.format( major=MAJOR, minor=MINOR, micro=MICRO) s = ( '# ...
import pip from setuptools import setup description = ( 'Generalized reactive(1) synthesis from Promela specifications.') README = 'README.md' VERSION_FILE = 'openpromela/_version.py' MAJOR = 0 MINOR = 0 MICRO = 1 version = '{major}.{minor}.{micro}'.format( major=MAJOR, minor=MINOR, micro=MICRO) s = ( '# ...
bsd-3-clause
Python
b226613004ceb9ebfb298a8eca502214e7e2ce77
Add tests
MasterFacilityList/mfl_api,MasterFacilityList/mfl_api,urandu/mfl_api,urandu/mfl_api,urandu/mfl_api,MasterFacilityList/mfl_api,urandu/mfl_api,MasterFacilityList/mfl_api,MasterFacilityList/mfl_api
mfl_gis/tests/test_views.py
mfl_gis/tests/test_views.py
from rest_framework.test import APITestCase from common.tests.test_views import LoginMixin from django.core.urlresolvers import reverse from model_mommy import mommy from ..models import ( WorldBorder, CountyBoundary, ConstituencyBoundary, WardBoundary ) from ..serializers import WorldBorderDetailSeri...
from rest_framework.test import APITestCase from common.tests.test_views import LoginMixin from django.core.urlresolvers import reverse from model_mommy import mommy from ..models import ( WorldBorder, CountyBoundary, ConstituencyBoundary, WardBoundary ) from ..serializers import WorldBorderDetailSeri...
mit
Python
cef0daa9606257a1e9dc41e0dd55bbedf5b0a30e
remove unnecessary else
chrisseto/modular-file-renderer,mfraezz/modular-file-renderer,Johnetordoff/modular-file-renderer,mfraezz/modular-file-renderer,chrisseto/modular-file-renderer,CenterForOpenScience/modular-file-renderer,chrisseto/modular-file-renderer,CenterForOpenScience/modular-file-renderer,TomBaxter/modular-file-renderer,CenterForOp...
mfr_docx/tests/test_docx.py
mfr_docx/tests/test_docx.py
import sys import pytest import mfr # Pydocx .3.14 does not support python 3 if not sys.version_info >= (3, 0): from mfr_docx import Handler as DocxFileHandler from mfr_docx.render import render_docx @pytest.mark.skipif(sys.version_info >= (3, 0), reason="pydocx 0.3.14 does not support ...
import sys import pytest import mfr if not sys.version_info >= (3, 0): from mfr_docx import Handler as DocxFileHandler from mfr_docx.render import render_docx else: DocxFileHandler = render_docx = None @pytest.mark.skipif(sys.version_info >= (3, 0), reason="pydocx 0.3.14 does not sup...
apache-2.0
Python
ed84b73db5cbede0792cdc3efc2103ccdcc36ad1
add _write_file utility
matthew-brett/delocate,matthew-brett/delocate,matthew-brett/delocate
delocate/tests/test_tools.py
delocate/tests/test_tools.py
""" Test tools module """ from __future__ import division, print_function import os from os.path import join as pjoin, split as psplit, abspath, dirname import shutil from ..tools import back_tick, ensure_writable, zip2dir, dir2zip from ..tmpdirs import InTemporaryDirectory from nose.tools import assert_true, asser...
""" Test tools module """ from __future__ import division, print_function import os from os.path import join as pjoin, split as psplit, abspath, dirname import shutil from ..tools import back_tick, ensure_writable, zip2dir, dir2zip from ..tmpdirs import InTemporaryDirectory from nose.tools import assert_true, asser...
bsd-2-clause
Python
81562b02528072e4bac98152bbbc07704ae9e431
Refactor MultiPlotSpeedTest.py
meganbkratz/acq4,campagnola/acq4,pbmanis/acq4,pbmanis/acq4,campagnola/acq4,acq4/acq4,acq4/acq4,meganbkratz/acq4,acq4/acq4,acq4/acq4,meganbkratz/acq4,pbmanis/acq4,pbmanis/acq4,meganbkratz/acq4,campagnola/acq4,campagnola/acq4
examples/MultiPlotSpeedTest.py
examples/MultiPlotSpeedTest.py
#!/usr/bin/python # -*- coding: utf-8 -*- """ Test the speed of rapidly updating multiple plot curves """ ## Add path to library (just for examples; you do not need this) import initExample from pyqtgraph.Qt import QtGui, QtCore import numpy as np import pyqtgraph as pg from pyqtgraph.ptime import time app = QtGui.Q...
#!/usr/bin/python # -*- coding: utf-8 -*- """ Test the speed of rapidly updating multiple plot curves """ ## Add path to library (just for examples; you do not need this) import initExample from pyqtgraph.Qt import QtGui, QtCore import numpy as np import pyqtgraph as pg from pyqtgraph.ptime import time #QtGui.QAppli...
mit
Python
2a2365854a9ab54ffcc9e7d82b13aa2f32431fc4
Fix some missing licenses (#365)
lewisc/spark-tk,Haleyo/spark-tk,aayushidwivedi01/spark-tk,grehx/spark-tk,WafaaT/spark-tk,karthikvadla16/spark-tk,rodorad/spark-tk,WafaaT/spark-tk,grehx/spark-tk,joyeshmishra/spark-tk,blbarker/spark-tk,karthikvadla16/spark-tk,rodorad/spark-tk,anjalisood/spark-tk,karthikvadla16/spark-tk,blbarker/spark-tk,aayushidwivedi01...
python/sparktk/models/__init__.py
python/sparktk/models/__init__.py
# vim: set encoding=utf-8 # Copyright (c) 2016 Intel Corporation  # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # #       http://www.apache.org/licenses/LICENSE-2.0 # # Unless require...
# vim: set encoding=utf-8 # Copyright (c) 2016 Intel Corporation  # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # #       http://www.apache.org/licenses/LICENSE-2.0 # # Unless require...
apache-2.0
Python
1c0302c7137af550314b05f6e3cc87134c9bdc65
Rename blueprint static_pages to staticpages and rename staticpages.show to staticpages.page
jarus/flask-rst
flaskrst/modules/staticpages/__init__.py
flaskrst/modules/staticpages/__init__.py
# -*- coding: utf-8 -*- """ flask-rst.modules.staticfiles ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2011 by Christoph Heer. :license: BSD, see LICENSE for more details. """ from flask import Blueprint, current_app, render_template, safe_join from flaskrst.parsers import rstDocument staticpages = ...
# -*- coding: utf-8 -*- """ flask-rst.modules.staticfiles ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2011 by Christoph Heer. :license: BSD, see LICENSE for more details. """ import os from flask import Blueprint, current_app, render_template from flaskrst.parsers import rstDocument static_pages =...
bsd-3-clause
Python
6bcb1892912f821d46ec339446f6091feff481de
increase usability
iw3hxn/LibrERP,iw3hxn/LibrERP,iw3hxn/LibrERP,iw3hxn/LibrERP,iw3hxn/LibrERP
project_extended/__openerp__.py
project_extended/__openerp__.py
# -*- encoding: utf-8 -*- ############################################################################## # # Copyright (C) 2013-2016 Didotech SRL # # 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 F...
# -*- encoding: utf-8 -*- ############################################################################## # # Copyright (C) 2013-2016 Didotech SRL # # 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 F...
agpl-3.0
Python
83ce575f1b2b9463c5b546bb94b6b89319ef0a61
enable context aware commits (#17)
googleapis/java-memcache,googleapis/java-memcache,googleapis/java-memcache
synth.py
synth.py
# Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
# Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
apache-2.0
Python
fcf71baa0c3ccf51ae83c5da9dcdb1eefb432473
clean up (#201)
googleapis/nodejs-talent,googleapis/nodejs-talent
synth.py
synth.py
# Copyright 2018 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
# Copyright 2018 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
apache-2.0
Python
1b7ddb013c1a117c60f96ffa12db57d5bf22c850
set AUTOSYNTH_MULTIPLE_COMMITS=true for context aware commits (#55)
googleapis/nodejs-recommender,googleapis/nodejs-recommender,googleapis/nodejs-recommender
synth.py
synth.py
# Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
# Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
apache-2.0
Python
65b5529cae4ebd9e5cb8ce3d8078f38166307625
Update tornado task
RCOSDP/waterbutler,icereval/waterbutler,rdhyee/waterbutler,chrisseto/waterbutler,TomBaxter/waterbutler,CenterForOpenScience/waterbutler,Johnetordoff/waterbutler,cosenal/waterbutler,Ghalko/waterbutler,hmoco/waterbutler,kwierman/waterbutler,felliott/waterbutler,rafaeldelucena/waterbutler
tasks.py
tasks.py
# encoding: utf-8 from invoke import task from waterbutler.server import settings @task def tornado(port=settings.PORT, address=settings.ADDRESS, debug=settings.DEBUG): from waterbutler.server import serve serve(port, address, debug)
# encoding: utf-8 from invoke import task from server import settings @task def tornado(port=settings.PORT, address=settings.ADDRESS, debug=settings.DEBUG): from server import main main.main(port, address, debug)
apache-2.0
Python
87670af9aa1b45b8702d8a795bfd2b8ba6daeedd
add extra step to edit changelog
fivejjs/pyuv,fivejjs/pyuv,saghul/pyuv,saghul/pyuv,fivejjs/pyuv,saghul/pyuv
tasks.py
tasks.py
import invoke import datetime import re import sys cmd = 'git log $(git describe --tags --abbrev=0)..HEAD --format=" - %s" | tac' changelog_template = 'Version %s\n=============\n%s\n' tag_template = '%s - pyuv version %s\n\n%s\n' def get_version(): return re.search(r"""__version__\s+=\s+(?P<quote>['"])(?P<ve...
import invoke import datetime import re import sys cmd = 'git log $(git describe --tags --abbrev=0)..HEAD --format=" - %s" | tac' changelog_template = 'Version %s\n=============\n%s\n' tag_template = '%s - pyuv version %s\n\n%s\n' def get_version(): return re.search(r"""__version__\s+=\s+(?P<quote>['"])(?P<ve...
mit
Python
eea0f026a8fed261283c081d7bc447ec480ff6e5
Fix bug that raised error when generating coverage
caleb531/ssh-wp-backup,caleb531/ssh-wp-backup
tasks.py
tasks.py
#!/usr/bin/env python3 import os import subprocess from invoke import task @task def test(): # invoke.run() does not respect colored output, unfortunately nosetests = subprocess.Popen(['nosetests', '--rednose']) nosetests.wait() @task def cover(): try: os.mkdir('cover') except OSError: ...
#!/usr/bin/env python3 import subprocess from invoke import task @task def test(): # invoke.run() does not color output, unfortunately nosetests = subprocess.Popen(['nosetests', '--rednose']) nosetests.wait() @task def cover(): nosetests = subprocess.Popen(['nosetests', '--with-coverage', ...
mit
Python
bc626644d0c08dd4e49a3aeb6c89ccd7d3258bb1
improve asserts in tests
drgarcia1986/muffin-elasticsearch
tests.py
tests.py
import muffin import pytest @pytest.fixture(scope='session') def app(loop): return muffin.Application( 'elasticsearch_app', loop=loop, PLUGINS=('muffin_elasticsearch',) ) def test_plugin_register(app): assert 'elasticsearch' in app.ps assert app.ps.elasticsearch.conn @pytest.mark.a...
import muffin import pytest @pytest.fixture(scope='session') def app(loop): return muffin.Application( 'elasticsearch_app', loop=loop, PLUGINS=('muffin_elasticsearch',) ) def test_plugin_register(app): assert 'elasticsearch' in app.ps assert app.ps.elasticsearch.conn @pytest.mark.a...
mit
Python
745276079824fa929ba6b9502bf713c982fef8f3
rearrange matplotlib import fix for travis
jdoepfert/roipoly.py
tests.py
tests.py
import unittest import os import numpy as np import matplotlib if os.environ.get('DISPLAY', '') == '': print('No DISPLAY found. Using non-interactive "Agg"backend.') matplotlib.use('Agg') from matplotlib import pyplot as plt from roipoly import RoiPoly class TestRoiPoly(unittest.TestCase): def setUp(...
import unittest import os import numpy as np from matplotlib import pyplot as plt import matplotlib from roipoly import RoiPoly if os.environ.get('DISPLAY', '') == '': print('No DISPLAY found. Using non-interactive "Agg" backend.') matplotlib.use('Agg') class TestRoiPoly(unittest.TestCase): def setUp(...
apache-2.0
Python
3e21d6dc38d249dad4cfae76dbb2744967ac1ab5
Add left and right square bracket tokens
Zac-Garby/pluto-lang
token.py
token.py
# etc... EOF = "EOF" ILLEGAL = "ILLEGAL" # Literals NUM = "number" STR = "string" ID = "identifier" PARAM = "param" # Punctuation PLUS = "plus" MINUS = "minus" STAR = "star" SLASH = "slash" HASH = "hash" LPAREN = "lparen" RPAREN = "rparen" LT = "less-than" GT = "greater-than" LBRAC...
# etc... EOF = "EOF" ILLEGAL = "ILLEGAL" # Literals NUM = "number" STR = "string" ID = "identifier" PARAM = "param" # Punctuation PLUS = "plus" MINUS = "minus" STAR = "star" SLASH = "slash" HASH = "hash" LPAREN = "lparen" RPAREN = "rparen" LT = "less-than" GT = "greater-than" LBRACE = "lbra...
mit
Python
8e0a8da411c156b369f9163bca5a93c1093cde88
Update to preserve expected sid output
royragsdale/picoCTF,picoCTF/picoCTF,picoCTF/picoCTF,royragsdale/picoCTF,royragsdale/picoCTF,royragsdale/picoCTF,picoCTF/picoCTF,royragsdale/picoCTF,royragsdale/picoCTF,picoCTF/picoCTF,picoCTF/picoCTF,royragsdale/picoCTF,picoCTF/picoCTF
ansible/roles/pico-web/files/add_shell_server.py
ansible/roles/pico-web/files/add_shell_server.py
#!/usr/bin/env python3 # Simple script to programmatically add a shell server to a running picoCTF web # instance. If using a custom APP_SETTINGS_FILE, ensure the appropriate # environment variable is set prior to running this script. This script is best # run from the pico-web role (ansible/roles/pico-web/tasks/main...
#!/usr/bin/env python3 # Simple script to programmatically add a shell server to a running picoCTF web # instance. If using a custom APP_SETTINGS_FILE, ensure the appropriate # environment variable is set prior to running this script. This script is best # run from the pico-web role (ansible/roles/pico-web/tasks/main...
mit
Python
a04828384f049e5b9d663b433b9a2ef173726c66
Tidy up
Humantrashcan/prices
exchanges/bitstamp.py
exchanges/bitstamp.py
from decimal import Decimal from helpers import get_datetime, get_response TICKER_URL = 'https://bitstamp.net/api/ticker/' def get_current_price(): data = get_response(TICKER_URL) price = data['last'] return Decimal(price) def get_current_bid(): data = get_response(TICKER_URL) price = data['bid']...
from decimal import Decimal from helpers import get_datetime, get_response TICKER_URL = 'https://bitstamp.net/api/ticker/' def get_current_price(): data = get_response(TICKER_URL) price = data['last'] return Decimal(price) def get_current_bid(): data = get_response(TICKER_URL) price = data['bid']...
mit
Python
b0d66236a50f89bdc73e684a845356de7562e2d8
add comment
ImageMarkup/isic-archive,ImageMarkup/isic-archive,ImageMarkup/isic-archive,ImageMarkup/isic-archive
isic_archive/models/segmentation_helpers/__init__.py
isic_archive/models/segmentation_helpers/__init__.py
#!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### # Copyright Kitware Inc. # # Licensed under the Apache License, Version 2.0 ( the "License" ); # you may not use this file except in compliance with the License. # You may obtain a copy of ...
#!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### # Copyright Kitware Inc. # # Licensed under the Apache License, Version 2.0 ( the "License" ); # you may not use this file except in compliance with the License. # You may obtain a copy of ...
apache-2.0
Python
7776d31b7c968e850b6ef3d6bc38c53387720e8b
bump purchase_requisition_bid_selection
duanyp1991/purchase-workflow,numerigraphe/purchase-workflow,credativUK/purchase-workflow,Eficent/purchase-workflow,credativUK/purchase-workflow,Antiun/purchase-workflow,SerpentCS/purchase-workflow,NovaPointGroup/purchase-workflow,xpansa/purchase-workflow,lepistone/purchase-workflow,mtelahun/purchase-workflow,adhoc-dev/...
purchase_requisition_bid_selection/__openerp__.py
purchase_requisition_bid_selection/__openerp__.py
# -*- coding: utf-8 -*- # # # Copyright 2013, 2014 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) an...
# -*- coding: utf-8 -*- # # # Copyright 2013, 2014 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) an...
agpl-3.0
Python
03392a208d0515c6317d0b872857ad6b4d3c5454
stop swallowing exceptions raised by the callback passed to run_in_bg
CanonicalLtd/subiquity,CanonicalLtd/subiquity
subiquitycore/controller.py
subiquitycore/controller.py
# Copyright 2015 Canonical, Ltd. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any later version. # # This program is distribute...
# Copyright 2015 Canonical, Ltd. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any later version. # # This program is distribute...
agpl-3.0
Python
6ef6a5f7f1caf09f77876267c5427e620f853dac
Fix file format (#848)
bazelbuild/buildtools,bazelbuild/buildtools,bazelbuild/buildtools,bazelbuild/buildtools,bazelbuild/buildtools
lang/defs.bzl
lang/defs.bzl
def _generate_tables_impl(ctx): args = ctx.actions.args() args.add("-input", ctx.file.src) args.add("-output", ctx.outputs.out) ctx.actions.run( executable = ctx.executable.bin, inputs = [ctx.file.src], outputs = [ctx.outputs.out], arguments = [args], ) generate_tabl...
def _generate_tables_impl(ctx): args = ctx.actions.args() args.add("-input", ctx.file.src) args.add("-output", ctx.outputs.out) ctx.actions.run( executable = ctx.executable.bin, inputs = [ctx.file.src], outputs = [ctx.outputs.out], arguments = [args], ) generate_tabl...
apache-2.0
Python
3251b8bc223412cb700c953b47b9115106d81fc1
modify conaryserver plugin to use generated config file
sassoftware/rbm,sassoftware/rbm,sassoftware/rbm
raaplugins/rPath/conaryserver/srv/conaryserver.py
raaplugins/rPath/conaryserver/srv/conaryserver.py
# # Copyright (c) 2005-2006 rPath, Inc. # # All rights reserved # import os from raa.modules.raasrvplugin import rAASrvPlugin from conary.repository.netrepos.netserver import ServerConfig from conary.lib.cfgtypes import CfgEnvironmentError class ConaryServer(rAASrvPlugin): cnrPath = '/srv/conary/repository.cnr' ...
# # Copyright (c) 2005-2006 rPath, Inc. # # All rights reserved # import os from raa.modules.raasrvplugin import rAASrvPlugin from conary.repository.netrepos.netserver import ServerConfig from conary.lib.cfgtypes import CfgEnvironmentError class ConaryServer(rAASrvPlugin): cnrPath = '/srv/conary/repository.cnr' ...
apache-2.0
Python
ba115c2087b7fc5b07073ee42af6e2548d462245
Use `spotify-now` to get current song info in i3blocks
iAmMrinal0/dotfiles,iAmMrinal0/dotfiles
scripts/scripts/current_track.py
scripts/scripts/current_track.py
import subprocess def text_split(text): new_text = text.split() new_text_len = len(new_text) if new_text_len < 2: return new_text[0] elif new_text_len == 2: return text else: return " ".join(new_text[0:2]) + "..." def main(): st = subprocess.getoutput("mpc") lin = ...
import subprocess def main(): st = subprocess.getoutput("mpc") lin = st.split("\n") if len(lin) > 1: sn_status = lin[1] duration = lin[1].split() if "paused" in sn_status: print(lin[0].split("-")[-1] + " [paused]") elif "playing" in sn_status: print(...
mit
Python
ae2daeaf3b7df55759d26bd6fea0ba12ec0fa4a7
Remove unused logger
rollbar/pyrollbar
rollbar/contrib/fastapi/logger.py
rollbar/contrib/fastapi/logger.py
__all__ = ['LoggerMiddleware'] from fastapi import __version__ from rollbar.contrib.asgi.integration import integrate from rollbar.contrib.starlette import LoggerMiddleware as StarletteLoggerMiddleware @integrate(framework_name=f'fastapi {__version__}') class LoggerMiddleware(StarletteLoggerMiddleware): ...
__all__ = ['LoggerMiddleware'] import logging from fastapi import __version__ from rollbar.contrib.asgi.integration import integrate from rollbar.contrib.starlette import LoggerMiddleware as StarletteLoggerMiddleware log = logging.getLogger(__name__) @integrate(framework_name=f'fastapi {__version__}') class Logger...
mit
Python
90e0b82a188be61c85988c2a4ada9c37a633f23f
Fix total number of ports per LPU used in scaling over number of LPUs benchmark.
cerrno/neurokernel
examples/timing/run_lpu_gpu.py
examples/timing/run_lpu_gpu.py
#!/usr/bin/env python """ Run timing test (GPU) scaled over number of LPUs. """ import numpy as np import csv import re import subprocess import sys script_name = 'timing_demo_gpu.py' w = csv.writer(sys.stdout) total_spike = 1000 for lpus in xrange(2, 9): average_step_sync_time_list = [] average_throughput...
#!/usr/bin/env python """ Run timing test (GPU) scaled over number of LPUs. """ import numpy as np import csv import re import subprocess import sys script_name = 'timing_demo_gpu.py' w = csv.writer(sys.stdout) for lpus in xrange(2, 9): average_step_sync_time_list = [] average_throughput_list = [] tota...
bsd-3-clause
Python
381b17c577fbd7d142e586116fffbf531d1864bd
fix root initialize
ShiZhan/seed,ShiZhan/fs-crawler,ShiZhan/seed
utils.py
utils.py
#coding=utf-8 """SEED program utility helper classes and functions SeedLog: Global logger for internal use InitLogger: Configure global logger Version: Check code version from local repository Initialize: Initialize '.seed' bucket for holding meta data NodeURI: Generate node URI for Pyro4 object using ip, port and Def...
#coding=utf-8 """SEED program utility helper classes and functions SeedLog: Global logger for internal use InitLogger: Configure global logger Version: Check code version from local repository Initialize: Initialize '.seed' bucket for holding meta data NodeURI: Generate node URI for Pyro4 object using ip, port and Def...
apache-2.0
Python
bf55395221932ee860e12fc509688faf32bbbcc3
rename to AddGroupTest
alexzoo/python
selenium_tests/test_add_group.py
selenium_tests/test_add_group.py
# -*- coding: utf-8 -*- from selenium.webdriver.firefox.webdriver import WebDriver from selenium.webdriver.common.action_chains import ActionChains import time, unittest def is_alert_present(wd): try: wd.switch_to_alert().text return True except: return False class TestAddGroup(unittes...
# -*- coding: utf-8 -*- from selenium.webdriver.firefox.webdriver import WebDriver from selenium.webdriver.common.action_chains import ActionChains import time, unittest def is_alert_present(wd): try: wd.switch_to_alert().text return True except: return False class test_add_group(unitt...
apache-2.0
Python
e7ebc2be8da33621a626ecbd7365b04498855ad2
Remove trailing whitespace
wolfy1339/Python-IRC-Bot
utils.py
utils.py
commands = {} perms = {} def add_cmd(name, alias=None, owner=False, admin=False): def real_command(func): global commands global perms commands[name] = func perms[name] = [admin, owner] if alias: commands[alias] = func return real_command def call_command(...
commands = {} perms = {} def add_cmd(name, alias=None, owner=False, admin=False): def real_command(func): global commands global perms commands[name] = func perms[name] = [admin, owner] if alias: commands[alias] = func return real_command def call_command(...
mit
Python
9dbb75bc943dabb427854301fefe1800f2b0a12c
use fixed list of lfp teams for tests
dmartin35/pronosfoot,dmartin35/pronosfoot,dmartin35/pronosfoot
external/tests/test_lfp_api.py
external/tests/test_lfp_api.py
import unittest from unittest import mock import logging logging.basicConfig() from external import SCORE_URL from external.lfp_api import get_score, get_calendar from tools.web import get_url_content as _url_download from . import TEST_LFP_TEAM_MAP class TestLFPApi(unittest.TestCase): @mock.patch.dict('external...
import unittest from unittest import mock import logging logging.basicConfig() from external import SCORE_URL from external.lfp_api import get_score, get_calendar from tools.web import get_url_content as _url_download class TestLFPApi(unittest.TestCase): @mock.patch('external.lfp_api.get_url_content') def ...
mit
Python
9640fb86440e1a23c62abcd5dffe35a5e6ffc381
Apply code review suggestions - update validate_price_amount validator
mociepka/saleor,mociepka/saleor,mociepka/saleor
saleor/graphql/core/validators.py
saleor/graphql/core/validators.py
from typing import TYPE_CHECKING, Optional from django.conf import settings from django.core.exceptions import ValidationError from django_prices.utils.formatting import get_currency_fraction from graphql.error import GraphQLError if TYPE_CHECKING: from decimal import Decimal def validate_one_of_args_is_in_quer...
from typing import TYPE_CHECKING from django.conf import settings from django.core.exceptions import ValidationError from django_prices.utils.formatting import get_currency_fraction from graphql.error import GraphQLError if TYPE_CHECKING: from decimal import Decimal def validate_one_of_args_is_in_query(arg1_nam...
bsd-3-clause
Python
01089582bba76c0988174a251f9521901345bacb
Add more required code
walles/px,walles/px
px/px_load_bar.py
px/px_load_bar.py
class PxLoadBar(object): """ Visualizes system load in a horizontal bar. Inputs are: * System load * Number of physical cores * Number of logical cores * How many columns wide the horizontal bar should be The output is a horizontal bar string. Load below the number of physical cor...
class PxLoadBar(object): """ Visualizes system load in a horizontal bar. Inputs are: * System load * Number of physical cores * Number of logical cores * How many columns wide the horizontal bar should be The output is a horizontal bar string. Load below the number of physical cor...
mit
Python
5ebd910a5665402b68e50f540d8480d8c3bd4e64
Add outlines of functions and code for soundspeeds.
ihuston/pyflation,ihuston/pyflation
pyflation/analysis/deltaprel.py
pyflation/analysis/deltaprel.py
''' pyflation.analysis.deltaprel - Module to calculate relative pressure perturbations. Author: Ian Huston For license and copyright information see LICENSE.txt which was distributed with this file. ''' def soundspeeds(Vphi, phidot, H): """Sound speeds of the background fields Arguments --------- ...
''' pyflation.analysis.deltaprel - Module to calculate relative pressure perturbations. Author: Ian Huston For license and copyright information see LICENSE.txt which was distributed with this file. '''
bsd-3-clause
Python
4e6c41c884269ec9dda5788b8f095af0a5b1e432
Add the preprocess tweet function into utils
iamhuy/rumour-veracity-verification
src/features/utils.py
src/features/utils.py
from dateutil import parser import preprocessor as p def timestamp_to_date(timestamp): """ Conver a twitter timestamp to a datetime object :param timestamp: a string represent the timestamp :return: a datetime object """ return parser.parse(timestamp) def day_diff(timestamp1, timestamp2)...
from dateutil import parser def timestamp_to_date(timestamp): """ Conver a twitter timestamp to a datetime object :param timestamp: a string represent the timestamp :return: a datetime object """ return parser.parse(timestamp) def day_diff(timestamp1, timestamp2): """ Number...
mit
Python
af42edaf0978d6d4ef517f6848edcc24a9236815
sort imports
aevri/mel,aevri/mel
py/mel/cmd/mel.py
py/mel/cmd/mel.py
"""Mel - a command-line utility to help with mole management.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import argparse import mel.cmd.addcluster import mel.cmd.addsingle import mel.cmd.list import mel.cmd.microadd import mel.cmd.microanalyse impo...
"""Mel - a command-line utility to help with mole management.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import argparse import mel.cmd.addcluster import mel.cmd.addsingle import mel.cmd.list import mel.cmd.microadd import mel.cmd.microview import ...
apache-2.0
Python
6cd4c9fbfdb3c795d08c6af4b2d88d3fb384c296
Remove deprecated NT apis
robotpy/pynetworktables2js,robotpy/pynetworktables2js,robotpy/pynetworktables2js,amorygalili/pynetworktables2js,amorygalili/pynetworktables2js,robotpy/pynetworktables2js,amorygalili/pynetworktables2js,amorygalili/pynetworktables2js
pynetworktables2js/nt_serial.py
pynetworktables2js/nt_serial.py
try: import ujson as json except ImportError: import json from networktables import NetworkTables __all__ = ["NTSerial"] class NTSerial(object): """ A utility class for synchronizing NetworkTables over a serial connection. """ def __init__(self, update_callback): """ :pa...
try: import ujson as json except ImportError: import json from networktables import NetworkTables __all__ = ["NTSerial"] class NTSerial(object): """ A utility class for synchronizing NetworkTables over a serial connection. """ def __init__(self, update_callback): """ :pa...
mit
Python
05bd6135424a2ef8e0469311cd51a287d44acf43
Add continuous mode
mitchgu/TAMProxy-pyHost
tamproxy/devices/encoder.py
tamproxy/devices/encoder.py
from .device import Device from .. import config as c class Encoder(Device): DEVICE_CODE = c.devices.encoder.code WRITE_CODE = c.devices.encoder.write_code READ_CODE = c.devices.encoder.read_code def __init__(self, tamproxy, pin_a, pin_b, continuous=True): self.pin_a = pin_a ...
from .device import Device from .. import config as c class Encoder(Device): DEVICE_CODE = c.devices.encoder.code WRITE_CODE = c.devices.encoder.write_code READ_CODE = c.devices.encoder.read_code def __init__(self, tamproxy, pin_a, pin_b): self.pin_a = pin_a self.pin_b = pin_...
mit
Python
095c1121bff4cd482408f3e212ee27414a15da7d
allow override
jmstaley/filebrowser
views.py
views.py
from django.conf import settings from django.shortcuts import render_to_response from django.db.models import get_model def browse(request, file_type): files_info = [] if file_type == 'image': model_name, appname = settings.BROWSER_IMAGE fieldname = getattr(settings, 'BROWSER_IMAGE_FIELD', 'im...
import os from django.conf import settings from django.shortcuts import render_to_response from django.db.models import get_model def browse(request, file_type): image_model, appname = settings.BROWSER_IMAGE file_model, appname = settings.BROWSER_FILE files_info = [] if file_type == 'image': m...
mit
Python
af8e59ccf8c198e9b4d3afc966f146381c4ae9da
fix imports for error handling
infowantstobeseen/pyglet-darwincore,infowantstobeseen/pyglet-darwincore,infowantstobeseen/pyglet-darwincore,infowantstobeseen/pyglet-darwincore,infowantstobeseen/pyglet-darwincore
pyglet/GL/info.py
pyglet/GL/info.py
#!/usr/bin/env python '''Cached information about version and extensions of current GL implementation. ''' __docformat__ = 'restructuredtext' __version__ = '$Id: $' import warnings # We have to wait until a context is created (with a window) until any # information is available. _have_context = False # The informa...
#!/usr/bin/env python '''Cached information about version and extensions of current GL implementation. ''' __docformat__ = 'restructuredtext' __version__ = '$Id: $' import warnings # We have to wait until a context is created (with a window) until any # information is available. _have_context = False # The informa...
bsd-3-clause
Python
bf8cfc379bcf6e89122076979a7d067df4f569fb
drop sqlalchemy ext #35
Maxence1/flask-wtf,Maxence1/flask-wtf
flask_wtf/__init__.py
flask_wtf/__init__.py
# -*- coding: utf-8 -*- """ flask.ext.wtf ~~~~~~~~~~~~ Flask-WTF extension :copyright: (c) 2010 by Dan Jacob. :license: BSD, see LICENSE for more details. """ # flake8: noqa from __future__ import absolute_import from wtforms import fields, widgets, validators from wtforms.fields import * from wt...
# -*- coding: utf-8 -*- """ flask.ext.wtf ~~~~~~~~~~~~ Flask-WTF extension :copyright: (c) 2010 by Dan Jacob. :license: BSD, see LICENSE for more details. """ # flake8: noqa from __future__ import absolute_import try: import sqlalchemy _is_sqlalchemy = True except ImportError: _is_sql...
bsd-3-clause
Python
8ce001318e3ca3bedf4dedf0deeda2e00d2be4f3
Fix StringSession(None)
LonamiWebs/Telethon,LonamiWebs/Telethon,LonamiWebs/Telethon,expectocode/Telethon,LonamiWebs/Telethon
telethon/sessions/string.py
telethon/sessions/string.py
import base64 import ipaddress import struct from .memory import MemorySession from ..crypto import AuthKey CURRENT_VERSION = '1' class StringSession(MemorySession): """ This minimal session file can be easily saved and loaded as a string. It is thought to be used where you don't want to create any on-...
import base64 import ipaddress import struct from .memory import MemorySession from ..crypto import AuthKey CURRENT_VERSION = '1' class StringSession(MemorySession): """ This minimal session file can be easily saved and loaded as a string. It is thought to be used where you don't want to create any on-...
mit
Python
7fe413a28585d4e07c2fe3a8dcda1f4088d9df14
allow all hosts
petropavel13/2photo-api-playbook
templates/local_settings.py
templates/local_settings.py
# -*- coding: utf-8 -*- from __future__ import (absolute_import, division, print_function, unicode_literals) DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': '{{ db.name }}', 'HOST': '{{ db.host }}', 'USER': '{{ db.user ...
# -*- coding: utf-8 -*- from __future__ import (absolute_import, division, print_function, unicode_literals) DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': '{{ db.name }}', 'HOST': '{{ db.host }}', 'USER': '{{ db.user ...
mit
Python
482b4c01871906db3bc792c63f013c2e58151ede
Update python example to new api
tieto/farstream,kakaroto/farstream,ahmedammar/skype_farsight2,shadeslayer/farstream,pexip/farstream,ahmedammar/skype_farsight2,kakaroto/farstream,pexip/farstream,ahmedammar/skype_farsight2,shadeslayer/farstream,pexip/farstream,kakaroto/farstream,ahmedammar/skype_farsight2,kakaroto/farstream,tieto/farstream,pexip/farstr...
python/example.py
python/example.py
import pygst pygst.require('0.10') import farsight, gst, gobject, sys loop = gobject.MainLoop() pipeline = gst.Pipeline () conference = gst.element_factory_make ("fsrtpconference") conference.set_property ("sdes-cname", sys.argv[1] + "@1.2.3.4") pipeline.add (conference) session = conference.new_session (farsight.ME...
import pygst pygst.require('0.10') import farsight, gst, gobject, sys loop = gobject.MainLoop() pipeline = gst.Pipeline () conference = gst.element_factory_make ("fsrtpconference") conference.set_property ("sdes-cname", sys.argv[1] + "@1.2.3.4") pipeline.add (conference) session = conference.new_session (farsight.ME...
lgpl-2.1
Python
89fe241690e662f6dc8861d407d43b1da5f25aae
fix DRF3 error source matching the field name
CCI-MOC/GUI-Backend,CCI-MOC/GUI-Backend,CCI-MOC/GUI-Backend,CCI-MOC/GUI-Backend
api/serializers/allocation_request_serializer.py
api/serializers/allocation_request_serializer.py
from core.models.request import AllocationRequest from rest_framework import serializers class AllocationRequestSerializer(serializers.ModelSerializer): id = serializers.CharField(read_only=True, source="uuid") created_by = serializers.SlugRelatedField( slug_field='username', read_only=True) statu...
from core.models.request import AllocationRequest from rest_framework import serializers class AllocationRequestSerializer(serializers.ModelSerializer): id = serializers.CharField(read_only=True, source="uuid") created_by = serializers.SlugRelatedField( slug_field='username', source='created_by', read...
apache-2.0
Python
5887d587ee9b6c1e35424d8da7cf43be364d818e
include errors in IPython.parallel namespace
ipython/ipython,ipython/ipython
IPython/parallel/__init__.py
IPython/parallel/__init__.py
"""The IPython ZMQ-based parallel computing interface. Authors: * MinRK """ #----------------------------------------------------------------------------- # Copyright (C) 2011 The IPython Development Team # # Distributed under the terms of the BSD License. The full license is in # the file COPYING, distributed as...
"""The IPython ZMQ-based parallel computing interface. Authors: * MinRK """ #----------------------------------------------------------------------------- # Copyright (C) 2011 The IPython Development Team # # Distributed under the terms of the BSD License. The full license is in # the file COPYING, distributed as...
bsd-3-clause
Python
1fa85359c4cbe05055206b9f93fc85dd6140f15d
Add Google AdSense to sfp_webanalytics
smicallef/spiderfoot,smicallef/spiderfoot,smicallef/spiderfoot
modules/sfp_webanalytics.py
modules/sfp_webanalytics.py
# -*- coding: utf-8 -*- # ------------------------------------------------------------------------------- # Name: sfp_webanalytics # Purpose: SpiderFoot plug-in for scanning retrieved content by other # modules (such as sfp_spider) and identifying web analytics IDs. # # Author: Brendan C...
# -*- coding: utf-8 -*- # ------------------------------------------------------------------------------- # Name: sfp_webanalytics # Purpose: SpiderFoot plug-in for scanning retrieved content by other # modules (such as sfp_spider) and identifying web analytics IDs. # # Author: Brendan C...
mit
Python
ce9d547af419ec46c1e659a0ca630a752e59e01c
Increase the PMG API timeout, since it's slow at the moment
mysociety/pombola,mysociety/pombola,mysociety/pombola,mysociety/pombola,mysociety/pombola,mysociety/pombola
pombola/south_africa/views/constants.py
pombola/south_africa/views/constants.py
# For requests to external APIs, timeout after 3 seconds: API_REQUESTS_TIMEOUT = 6.05
# For requests to external APIs, timeout after 3 seconds: API_REQUESTS_TIMEOUT = 3.05
agpl-3.0
Python
ee3c99aa01cdb2f9c2c10250593abb6d53cb7ba6
Update test_dashboard.py
IATI/IATI-Website-Tests
tests/test_dashboard.py
tests/test_dashboard.py
from datetime import datetime, timedelta from dateutil import parser as date_parser import pytest import pytz from web_test_base import * class TestIATIDashboard(WebTestBase): requests_to_load = { 'Dashboard Homepage': { 'url': 'http://dashboard.iatistandard.org/' }, 'Page Gene...
from datetime import datetime, timedelta from dateutil import parser as date_parser import pytest import pytz from web_test_base import * class TestIATIDashboard(WebTestBase): requests_to_load = { 'Dashboard Homepage': { 'url': 'http://dashboard.iatistandard.org/' }, 'Page Gene...
mit
Python
8caedaa1e25e7f46a47fb1f2c248e2406277a77a
Update common.py
DOAJ/doaj,DOAJ/doaj,DOAJ/doaj,DOAJ/doaj
portality/api/v2/data_objects/common.py
portality/api/v2/data_objects/common.py
def _check_for_script(data): for key, value in data.items(): if value: if isinstance(value, dict): if _check_for_script(value): return True elif isinstance(value, str): if "<script>" in value: return True ...
def _check_for_script(data): print(data) for key, value in data.items(): if value: if isinstance(value, dict): if _check_for_script(value): return True elif isinstance(value, str): if "<script>" in value: ret...
apache-2.0
Python
e5909df57f2349a27544bcd0554c726c54f2135e
Fix flake8
bebatut/enasearch
tests/test_enasearch.py
tests/test_enasearch.py
#!/usr/bin/env python import os import sys sys.path.insert( 0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) try: import enasearch except: raise def cmp(la, lb): """Compare two lists""" return all(s in lb for s in la) and all(s in la for s in lb) def test_get_results(): ...
#!/usr/bin/env python import os import sys sys.path.insert( 0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) try: import enasearch except: raise def cmp(la, lb): """Compare two lists""" return all(s in lb for s in la) and all(s in la for s in lb) def test_get_results(): ...
mit
Python
4f1147b45feb78355e08a85b67b2b1a0d2903479
Fix more permissions.
micolous/tollgate,micolous/tollgate,micolous/tollgate
scripts/management/commands/repair_permissions.py
scripts/management/commands/repair_permissions.py
#!/usr/bin/env python """ tollgate management command: repair script permissions Copyright 2008-2012 Michael Farrell 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 Lic...
#!/usr/bin/env python """ tollgate management command: repair script permissions Copyright 2008-2012 Michael Farrell 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 Lic...
agpl-3.0
Python
e2b9144cee3b27abaf47a05cc081d120ba64a342
Test changes
9and3r/mopidy-ttsgpio
tests/test_extension.py
tests/test_extension.py
from __future__ import unicode_literals import mock import unittest from mopidy_ttsgpio import frontend from mopidy_ttsgpio import Extension class ExtensionTest(unittest.TestCase): def test_get_default_config(self): ext = Extension() config = ext.get_default_config() # ext = frontend.Tt...
from __future__ import unicode_literals import unittest # from mopidy_ttsgpio import frontend as frontend_lib from mopidy_ttsgpio import Extension class ExtensionTest(unittest.TestCase): def test_get_default_config(self): ext = Extension() config = ext.get_default_config() self.assert...
apache-2.0
Python
65af9ed0c1aa8e26e2a911d56640e88593c8667c
improve test coverage
TheGhouls/zerolog
tests/test_forwarder.py
tests/test_forwarder.py
import time import socket from multiprocessing import Process from unittest.mock import patch import zmq import pytest from zerolog.forwarder import start_forwarder @pytest.fixture(scope='module') def forwarder(): """Return a process for forwarder""" p = Process(target=start_forwarder, args=(6002, 6001, 650...
import time import socket from multiprocessing import Process from unittest.mock import patch import zmq import pytest from zerolog.forwarder import start_forwarder @pytest.fixture(scope='module') def forwarder(): """Return a process for forwarder""" p = Process(target=start_forwarder, args=(6002, 6001, 650...
mit
Python
d81027d477810d0bc67b87d052864a5f01057b8b
Fix docstring typo.
obytes/django-prometheus,korfuri/django-prometheus,obytes/django-prometheus,korfuri/django-prometheus
django_prometheus/exports.py
django_prometheus/exports.py
from django.http import HttpResponse from django.conf import settings import os import prometheus_client def SetupPrometheusEndpointOnPort(port, addr=''): """Exports Prometheus metrics on an HTTPServer running in its own thread. The server runs on the given port and is by default listenning on all interf...
from django.http import HttpResponse from django.conf import settings import os import prometheus_client def SetupPrometheusEndpointOnPort(port, addr=''): """Exports Prometheus metrics on an HTTPServer running in its own thread. The server runs on the given port and is by default listenning on all interf...
apache-2.0
Python
7dc36b6713f078ab3b2dec369029863c1a10b250
Add test for invalid URLs
phalt/beckett
tests/test_resources.py
tests/test_resources.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ test_resources ---------------------------------- Tests for `beckett.resources` module. """ from beckett.resources import BaseResource from tests.fixtures import PeopleResource, HypermediaBlogsResource def test_base_resource_attributes(): """ Base class te...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ test_resources ---------------------------------- Tests for `beckett.resources` module. """ from beckett.resources import BaseResource from tests.fixtures import PeopleResource, HypermediaBlogsResource def test_base_resource_attributes(): """ Base class te...
isc
Python
e8ae588be9559ab622715c5b628c571ac76bbf91
Add emoticons
oroszgy/spaCy.hu,oroszgy/spaCy.hu,spacy-io/spaCy,explosion/spaCy,recognai/spaCy,raphael0202/spaCy,aikramer2/spaCy,recognai/spaCy,Gregory-Howard/spaCy,recognai/spaCy,Gregory-Howard/spaCy,banglakit/spaCy,raphael0202/spaCy,oroszgy/spaCy.hu,aikramer2/spaCy,explosion/spaCy,explosion/spaCy,honnibal/spaCy,spacy-io/spaCy,rapha...
spacy/language_data/emoticons.py
spacy/language_data/emoticons.py
# encoding: utf8 from __future__ import unicode_literals EMOTICONS = set(""" :) :-) :)) :-)) :))) :-))) (: (-: =) (= :] :-] [: [-: :o) (o: :} :-} 8) 8-) (-8 ;) ;-) (; (-; :( :-( :(( :-(( :((( :-((( ): )-: =( >:( :') :'-) :'( :'-( :/ :-/ =/ :| :-| :1 :P :-P :p :-p :O :-O :o :-o :0 :-0 :() >:o :* :-* :3 :-3 =3 :...
# encoding: utf8 from __future__ import unicode_literals EMOTICONS = set(""" :) :-) :)) :-)) :))) :-))) (: (-: =) (= :] :-] [: [-: :o) (o: :} :-} 8) 8-) (-8 ;) ;-) (; (-; :( :-( :(( :-(( :((( :-((( ): )-: =( :') :'-) :'( :'-( :/ :-/ =/ :| :-| :P :-P :p :-p :O :-O :o :-o :0 :-0 :() :* :-* :3 :-3 =3 :> :-> :X :...
mit
Python
7b485152b13e5a619b9c07a74608ccb5b677c60b
Add function descriptor thingies under functions.
jaredmanning/learning,jaredmanning/learning
lpthw/ex35.py
lpthw/ex35.py
from sys import exit def gold_room(): """This is a function for the room of gold!""" print "This room is full of gold. How much do you take?" next = raw_input("> ") try: how_much = int(next) except ValueError: dead("Man, learn to type a number.") if how_much < 50: prin...
from sys import exit def gold_room(): """This is a function for the room of gold!""" print "This room is full of gold. How much do you take?" next = raw_input("> ") try: how_much = int(next) except ValueError: dead("Man, learn to type a number.") if how_much < 50: prin...
mit
Python
d2d216aa06ef29bd80be8aefb5d2fdeca9edf0e7
remove URL that no longer works from tests.
chrismattmann/tika-python
tika/tests/test_tika.py
tika/tests/test_tika.py
#!/usr/bin/env python # encoding: 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...
#!/usr/bin/env python # encoding: 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...
apache-2.0
Python
6ebcdbb423f10c59ad5c5f04f45d1fbc1005baef
Add method to query if interval is open
lauft/timew-report
timewreport/interval.py
timewreport/interval.py
import dateutil.parser from datetime import datetime from dateutil.tz import tz class TimeWarriorInterval(object): def __init__(self, start, end, tags): self.__start = self.__get_local_datetime(start) self.__end = self.__get_local_datetime(end) self.__tags = tags def __eq__(self, oth...
import dateutil.parser from datetime import datetime from dateutil.tz import tz class TimeWarriorInterval(object): def __init__(self, start, end, tags): self.__start = self.__get_local_datetime(start) self.__end = self.__get_local_datetime(end) self.__tags = tags def __eq__(self, oth...
mit
Python
92954ac8295e447b9c38dd87f242a16a6839e543
Introduce a cached_property decorator
philpep/testinfra
testinfra/utils/__init__.py
testinfra/utils/__init__.py
# coding: utf-8 # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # dist...
# coding: utf-8 # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # dist...
apache-2.0
Python
bb4adff2029a5f869c6e4930de3b7346d37114ed
Fix incorrect computation of exceedance probabilities
pySTEPS/pysteps
pysteps/postprocessing/ensemblestats.py
pysteps/postprocessing/ensemblestats.py
import numpy as np def mean(X, ignore_nan=False, X_thr=None): """Compute the mean value from a forecast ensemble field. Parameters ---------- X : array_like Array of shape (n_members,m,n) containing an ensemble of forecast fields of shape (m,n). ignore_nan : bool If T...
import numpy as np def mean(X, ignore_nan=False, X_thr=None): """Compute the mean value from a forecast ensemble field. Parameters ---------- X : array_like Array of shape (n_members,m,n) containing an ensemble of forecast fields of shape (m,n). ignore_nan : bool If T...
bsd-3-clause
Python
177c7bbcffefc42aa61229237e51cb836d447820
archive -> sources
rosedu/vmchecker,cojocar/vmchecker,calin-iorgulescu/vmchecker,rosedu/vmchecker,calin-iorgulescu/vmchecker,calin-iorgulescu/vmchecker,calin-iorgulescu/vmchecker,rosedu/vmchecker,rosedu/vmchecker,cojocar/vmchecker,cojocar/vmchecker,cojocar/vmchecker,calin-iorgulescu/vmchecker,cojocar/vmchecker,rosedu/vmchecker,cojocar/vm...
lib/submit.py
lib/submit.py
"""Functions to store a submission and send it for evaluation""" import shutil import os from . import sql, VmcheckerError SOURCES_FILE = 'sources.zip' def store(sources, assignment_id, user_id, upload = None): """Stores sources into the corresponding location. Submission is stored at: <assignmen...
"""Functions to store a submission and send it for evaluation""" import shutil import os from . import sql, VmcheckerError SOURCES_FILE = 'sources.zip' def store(archive, assignment_id, user_id, upload = None): """Stores archive into the corresponding location. Submission is stored at: <assignmen...
mit
Python
00aec961c36c5ebad269b32e87d3fd06279f2f99
Fix typo in volume layer state
glue-viz/glue-vispy-viewers,glue-viz/glue-3d-viewer,astrofrog/glue-vispy-viewers,astrofrog/glue-3d-viewer,PennyQ/astro-vispy
glue_vispy_viewers/volume/layer_state.py
glue_vispy_viewers/volume/layer_state.py
from __future__ import absolute_import, division, print_function from glue.core import Subset from glue.external.echo import (CallbackProperty, SelectionCallbackProperty, delay_callback) from glue.core.state_objects import StateAttributeLimitsHelper from glue.core.data_combo_helper impo...
from __future__ import absolute_import, division, print_function from glue.core import Subset from glue.external.echo import (CallbackProperty, SelectionCallbackProperty, delay_callback) from glue.core.state_objects import StateAttributeLimitsHelper from glue.core.data_combo_helper impo...
bsd-2-clause
Python
d8bdf74b850d7f4226aa31e5f5a73b981144486b
Remove explicit lxml import in lxml_tools
subeax/grab,istinspring/grab,subeax/grab,pombredanne/grab-1,codevlabs/grab,giserh/grab,DDShadoww/grab,shaunstanislaus/grab,huiyi1990/grab,SpaceAppsXploration/grab,istinspring/grab,maurobaraldi/grab,DDShadoww/grab,huiyi1990/grab,raybuhr/grab,pombredanne/grab-1,lorien/grab,alihalabyah/grab,lorien/grab,giserh/grab,mauroba...
grab/tools/lxml_tools.py
grab/tools/lxml_tools.py
""" Functions to process content of lxml nodes. """ from StringIO import StringIO from text import normalize_space as normalize_space_func, find_number def get_node_text(node, smart=False, normalize_space=True): """ Extract text content of the `node` and all its descendants. In smart mode `get_node_text`...
""" Functions to process content of lxml nodes. """ from StringIO import StringIO import lxml.html from text import normalize_space as normalize_space_func, find_number def get_node_text(node, smart=False, normalize_space=True): """ Extract text content of the `node` and all its descendants. In smart mod...
mit
Python
6d918e3f0850432d4e508068761ba9a3d9e94885
print GURLs as strings
gavinp/chromium,yitian134/chromium,Crystalnix/house-of-life-chromium,ropik/chromium,Crystalnix/house-of-life-chromium,adobe/chromium,adobe/chromium,ropik/chromium,adobe/chromium,yitian134/chromium,ropik/chromium,Crystalnix/house-of-life-chromium,ropik/chromium,gavinp/chromium,Crystalnix/house-of-life-chromium,yitian134...
tools/gdb/gdb_chrome.py
tools/gdb/gdb_chrome.py
#!/usr/bin/python # Copyright (c) 2011 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. """GDB support for Chrome types. Add this to your gdb by amending your ~/.gdbinit as follows: python import sys sys.path.insert(...
#!/usr/bin/python # Copyright (c) 2011 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. """GDB support for Chrome types. Add this to your gdb by amending your ~/.gdbinit as follows: python import sys sys.path.insert(...
bsd-3-clause
Python
f0731dbc98bb71cf0e7dab30485fef6700c76855
Create download_and_install_cloudbolt.py
CloudBoltSoftware/cloudbolt-forge,CloudBoltSoftware/cloudbolt-forge,CloudBoltSoftware/cloudbolt-forge,CloudBoltSoftware/cloudbolt-forge
blueprints/cloudbolt/download_and_install_cloudbolt.py
blueprints/cloudbolt/download_and_install_cloudbolt.py
#!/bin/sh echo "Removing any old CB installers, in case they exist" rm -f cloudbolt_installer_*.tgz echo "Opening up incoming traffic on TCP ports 80 & 443" iptables -I INPUT 2 -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT iptables -I INPUT 2 -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT ...
#!/bin/sh # edit on 06122017 echo "Removing any old CB installers, in case they exist" rm -f cloudbolt_installer_*.tgz echo "Opening up incoming traffic on TCP ports 80 & 443" iptables -I INPUT 2 -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT iptables -I INPUT 2 -m state --state NEW -m tcp -p tcp --d...
apache-2.0
Python
b612d7a6d67e999f96917de642230946ccf02106
Fix help message of --min_eval_frequency flag
raviqqe/tensorflow-qnd,raviqqe/tensorflow-qnd
qnd/experiment.py
qnd/experiment.py
import tensorflow as tf from .flag import FLAGS, FlagAdder from .estimator import def_estimator from .inputs import def_def_train_input_fn, def_def_eval_input_fn def def_def_experiment_fn(batch_inputs=True, prepare_filename_queues=True, distributed=False): adde...
import tensorflow as tf from .flag import FLAGS, FlagAdder from .estimator import def_estimator from .inputs import def_def_train_input_fn, def_def_eval_input_fn def def_def_experiment_fn(batch_inputs=True, prepare_filename_queues=True, distributed=False): adde...
unlicense
Python
507583359cee50cd644bbb05055713304c3f8b6c
raise dev version
trichter/qopen
qopen/__init__.py
qopen/__init__.py
"""Qopen: Seperation of intrinsic and scattering Q by envelope inversion""" from qopen.core import run __version__ = '1.7-dev'
"""Qopen: Seperation of intrinsic and scattering Q by envelope inversion""" from qopen.core import run __version__ = '1.6'
mit
Python
4624602c87c9287de1a8a0bcb2a68f827af49ccb
Bump version: 0.4.2
what-studio/gauge
gauge/__about__.py
gauge/__about__.py
# -*- coding: utf-8 -*- """ gauge.__about__ ~~~~~~~~~~~~~~~ """ __version__ = '0.4.2' __license__ = 'BSD' __author__ = 'What! Studio' __maintainer__ = 'Heungsub Lee' __maintainer_email__ = 'sub@nexon.co.kr'
# -*- coding: utf-8 -*- """ gauge.__about__ ~~~~~~~~~~~~~~~ """ __version__ = '0.4.1' __license__ = 'BSD' __author__ = 'What! Studio' __maintainer__ = 'Heungsub Lee' __maintainer_email__ = 'sub@nexon.co.kr'
bsd-3-clause
Python
33a6ed4d36f42adc80eb02fefd17a8f98aa47ef2
Change of 'permissions class to Findingaids
emory-libraries/findingaids,mprefer/findingaids,mprefer/findingaids,emory-libraries/findingaids
findingaids/fa_admin/models.py
findingaids/fa_admin/models.py
from datetime import datetime from celery.result import AsyncResult from celery.signals import task_prerun, task_postrun from django.db import models class Findingaids(models.Model): """ This model is used as a place holder for custom permissions needed with the admin portion of the site. """ pass ...
from datetime import datetime from celery.result import AsyncResult from celery.signals import task_prerun, task_postrun from django.db import models class Permissions(models.Model): pass class Meta: permissions =( ("can_publish", "Can publish a finding aid"), ("can_prev...
apache-2.0
Python
2a8816e07eec2cfc4680c76c1c5e080a78f149b4
Add displaying integration status on GitHub
apptentive/apptentive-ios,sahara108/apptentive-ios,Jawbone/apptentive-ios,hibu/apptentive-ios,ALHariPrasad/apptentive-ios,apptentive/apptentive-ios,hibu/apptentive-ios,apptentive/apptentive-ios,hibu/apptentive-ios,sahara108/apptentive-ios,Jawbone/apptentive-ios,ALHariPrasad/apptentive-ios
etc/bin/xcode_bot_script.py
etc/bin/xcode_bot_script.py
# This script should be copied into the Run Script trigger of an Xcode Bot # `Xcode Bot > Edit Bot > Triggers > After Integration > Run Script` # Utilizes `cavejohnson` for various integrations # https://github.com/drewcrawford/CaveJohnson #!/bin/bash PATH=/Library/Frameworks/Python.framework/Versions/3.4/bin:$PATH ...
# This script should be copied into the Run Script trigger of an Xcode Bot # `Xcode Bot > Edit Bot > Triggers > After Integration > Run Script`
bsd-3-clause
Python
18d01d4a19b070599f76eaf60bbf41dca3935c9a
Update SwapPairNodes_001.py
Chasego/codi,Chasego/codirit,cc13ny/algo,cc13ny/Allin,Chasego/codirit,cc13ny/algo,cc13ny/Allin,Chasego/codi,Chasego/cod,cc13ny/algo,Chasego/cod,Chasego/codi,Chasego/codirit,cc13ny/algo,Chasego/cod,Chasego/codirit,cc13ny/Allin,Chasego/cod,cc13ny/algo,cc13ny/Allin,Chasego/cod,cc13ny/Allin,Chasego/codirit,Chasego/codi,Cha...
leetcode/024-Swap-Nodes-in-Pairs/SwapPairNodes_001.py
leetcode/024-Swap-Nodes-in-Pairs/SwapPairNodes_001.py
#@author: cchen class Solution: # @param a ListNode # @return a ListNode def swapPairs(self, head): if head == None or head.next == None: return head dummy = ListNode(0); dummy.next = head p = dummy while p.next and p.next.next: tmp = p.next.next ...
class Solution: # @param a ListNode # @return a ListNode def swapPairs(self, head): if head == None or head.next == None: return head dummy = ListNode(0); dummy.next = head p = dummy while p.next and p.next.next: tmp = p.next.next p.next.ne...
mit
Python
ac1bf94f6702fe1d88f9e9a7e5e7d16521e7830f
increase timeout for wsn430
jasonatran/RIOT,kYc0o/RIOT,josephnoir/RIOT,aeneby/RIOT,authmillenon/RIOT,toonst/RIOT,kbumsik/RIOT,kaspar030/RIOT,gebart/RIOT,josephnoir/RIOT,smlng/RIOT,jasonatran/RIOT,biboc/RIOT,gebart/RIOT,mtausig/RIOT,avmelnikoff/RIOT,kbumsik/RIOT,yogo1212/RIOT,ant9000/RIOT,lazytech-org/RIOT,kYc0o/RIOT,neiljay/RIOT,rfuentess/RIOT,cl...
tests/float/tests/01-run.py
tests/float/tests/01-run.py
#!/usr/bin/env python3 # Copyright (C) 2017 Freie Universität Berlin # # This file is subject to the terms and conditions of the GNU Lesser # General Public License v2.1. See the file LICENSE in the top level # directory for more details. import os import sys # It takes 35 seconds on wsn430, so add some margin TIMEO...
#!/usr/bin/env python3 # Copyright (C) 2017 Freie Universität Berlin # # This file is subject to the terms and conditions of the GNU Lesser # General Public License v2.1. See the file LICENSE in the top level # directory for more details. import os import sys def testfunc(child): child.expect_exact("Testing flo...
lgpl-2.1
Python
e2776e9c3ee51bbfde749f93cc5e50e072851d3a
add import for parse.py
nikken1/patentprocessor,funginstitute/patentprocessor,yngcan/patentprocessor,funginstitute/patentprocessor,funginstitute/patentprocessor,yngcan/patentprocessor,nikken1/patentprocessor,yngcan/patentprocessor,nikken1/patentprocessor
couch_patent/couch_patent.py
couch_patent/couch_patent.py
#!/usr/bin/env python import sys import couchdb import unittest sys.path.append('../lib') from patXML import * sys.path.append('..') import parse basedir = os.path.join(os.curdir, '../test') testdir = os.path.join(basedir, 'fixtures/xml/') class TestCouchPatent(unittest.TestCase): def setUp(self): #s...
#!/usr/bin/env python import sys import couchdb import unittest sys.path.append('../lib') from patXML import * basedir = os.path.join(os.curdir, '../test') testdir = os.path.join(basedir, 'fixtures/xml/') class TestCouchPatent(unittest.TestCase): def setUp(self): #setup CouchDB self.couch = co...
bsd-2-clause
Python
be17c98b1424f4abec27452df41ab9e5511055a8
test user restriction
byteweaver/django-coupons,byteweaver/django-coupons
coupons/tests/forms_tests.py
coupons/tests/forms_tests.py
from django.contrib.auth.models import User from django.test import TestCase from coupons.forms import CouponGenerationForm, CouponForm from coupons.models import Coupon class CouponGenerationFormTestCase(TestCase): def test_form(self): form_data = {'quantity': 23, 'value': 42, 'type': 'monetary'} ...
from django.test import TestCase from coupons.forms import CouponGenerationForm, CouponForm from coupons.models import Coupon class CouponGenerationFormTestCase(TestCase): def test_form(self): form_data = {'quantity': 23, 'value': 42, 'type': 'monetary'} form = CouponGenerationForm(data=form_data)...
bsd-3-clause
Python
e121cd90bfd625667f9504a700c9b9f60d2de2c7
add test case for segmented code generation
rsalmaso/django-fluo-coupons,rsalmaso/django-fluo-coupons
coupons/tests/test_models.py
coupons/tests/test_models.py
from datetime import timedelta import re from django.utils import timezone from django.test import TestCase from coupons.models import Coupon from coupons.settings import ( CODE_LENGTH, CODE_CHARS, SEGMENT_LENGTH, SEGMENT_SEPARATOR, ) class CouponTestCase(TestCase): def test_generate_code(self):...
from datetime import timedelta import re from django.utils import timezone from django.test import TestCase from coupons.models import Coupon from coupons.settings import CODE_LENGTH, CODE_CHARS class CouponTestCase(TestCase): def test_generate_code(self): self.assertIsNotNone(re.match("^[%s]{%d}" % (CO...
bsd-3-clause
Python
53ea29cb0e3248058c6f744e1374817a3eeb3cad
Update views.py
jmennen/group5,jmennen/group5,jmennen/group5,jmennen/group5
Code/buzzit/buzzit_admin/views.py
Code/buzzit/buzzit_admin/views.py
from django.shortcuts import render # Create your views here. class AdminFrontpageView(): class UserReportDetailsView(): class MessageReportDetailsView(): class AdminOverviewView(): @login_required def delete_reported_post(): @login_required def promote_user_to_admin(): @login_required def demote_admin_to...
from django.shortcuts import render # Create your views here. class AdminFrontpageView(): class UserReportDetailsView(): class PostReportDetailsView(): class AdminOverviewView(): @login_required def delete_reported_post(): @login_required def promote_user_to_admin(): @login_required def demote_admin_to_us...
bsd-2-clause
Python
65aa1b23c84cf856c814fda7000fdb49eb4a5beb
fix bugs
sidenver/ConstituentRetrofit,sidenver/ConstituentRetrofit
generatePhrases.py
generatePhrases.py
import re from collections import Counter import json import numpy as np import os dataPath = "/fs/clip-scratch/shing/webbase_all/" phraseDir = "/fs/clip-scratch/shing/" phraseCount = Counter() for filename in os.listdir(dataPath): if filename.split('.')[-1] == "possf2": print 'processing ' + filename + ...
import re from collections import Counter import json import numpy as np import os dataPath = "/fs/clip-scratch/shing/webbase_all/" phraseDir = "/fs/clip-scratch/shing/" phraseCount = Counter() for filename in os.listdir(dataPath): if filename.split('.')[-1] == "possf2": print 'processing ' + filename + ...
apache-2.0
Python
a354975996d10da670d5598b5ac910d6a0c27d27
fix signature_base which be used for creating txhash fix typo add detail AttributeError for __init__
nelisky/py-stellar-base,StellarCN/py-stellar-base
transaction_envelopo.py
transaction_envelopo.py
# coding: utf-8 from .network import Network from .hash import hash from .stellarxdr import StellarXDR_pack as Xdr import base64 class TransactionEnvelope(object): def __init__(self, tx, opts=None): self.tx = tx try: self.signatures = opts.get('signatures') except AttributeErr...
# coding: utf-8 from .network import Network from .hash import hash from .stellarxdr import StellarXDR_pack as Xdr import base64 class TransactionEnvelope(object): def __init__(self, tx, opts=None): self.tx = tx try: self.signatures = opts.get('signatures') except: ...
apache-2.0
Python
e2aa41bb84984fea4c6b8ea475caf7f7af051dd9
Use positional argument to improve clarity
amolenaar/gaphor,amolenaar/gaphor
gaphor/codegen/codegen.py
gaphor/codegen/codegen.py
#!/usr/bin/env python """The Gaphor code generator CLI. Provides the CLI for the code generator which transforms a Gaphor models (with .gaphor file extension) in to a data model in Python. """ import argparse from distutils.util import byte_compile from pathlib import Path from gaphor.codegen import profile_coder, u...
#!/usr/bin/env python """The Gaphor code generator CLI. Provides the CLI for the code generator which transforms a Gaphor models (with .gaphor file extension) in to a data model in Python. """ import argparse from distutils.util import byte_compile from pathlib import Path from gaphor.codegen import profile_coder, u...
lgpl-2.1
Python
d193fddad734d6d99d3b90baaabfb32e3763fbce
update tests to v1.2.0 (#1277)
smalley/python,exercism/xpython,behrtam/xpython,exercism/xpython,jmluy/xpython,smalley/python,N-Parsons/exercism-python,exercism/python,N-Parsons/exercism-python,exercism/python,behrtam/xpython,jmluy/xpython
exercises/difference-of-squares/difference_of_squares_test.py
exercises/difference-of-squares/difference_of_squares_test.py
import unittest from difference_of_squares import difference, square_of_sum, sum_of_squares # Tests adapted from `problem-specifications//canonical-data.json` @ v1.2.0 class DifferenceOfSquaresTest(unittest.TestCase): def test_square_of_sum_1(self): self.assertEqual(square_of_sum(1), 1) def test_sq...
import unittest from difference_of_squares import difference, square_of_sum, sum_of_squares # Tests adapted from `problem-specifications//canonical-data.json` @ v1.1.0 class DifferenceOfSquaresTest(unittest.TestCase): def test_square_of_sum_1(self): self.assertEqual(square_of_sum(1), 1) def test_sq...
mit
Python
7f8d89c54f0ae084851cbde5984b1bda88ec3533
set default test settings to test without mapentity_weasyprint
Anaethelion/Geotrek,mabhub/Geotrek,makinacorpus/Geotrek,Anaethelion/Geotrek,Anaethelion/Geotrek,GeotrekCE/Geotrek-admin,mabhub/Geotrek,mabhub/Geotrek,makinacorpus/Geotrek,johan--/Geotrek,mabhub/Geotrek,GeotrekCE/Geotrek-admin,GeotrekCE/Geotrek-admin,Anaethelion/Geotrek,johan--/Geotrek,GeotrekCE/Geotrek-admin,johan--/Ge...
geotrek/settings/tests.py
geotrek/settings/tests.py
from .default import * # NOQA # # Django Tests # .......................... TEST = True TEST_EXCLUDE = ('django',) LOGGING['handlers']['console']['level'] = 'CRITICAL' LANGUAGE_CODE = 'en' SOUTH_TESTS_MIGRATE = False MAPENTITY_CONFIG['MAPENTITY_WEASYPRINT'] = False
from .default import * # NOQA # # Django Tests # .......................... TEST = True TEST_EXCLUDE = ('django',) LOGGING['handlers']['console']['level'] = 'CRITICAL' LANGUAGE_CODE = 'en' SOUTH_TESTS_MIGRATE = False MAPENTITY_CONFIG['MAPENTITY_WEASYPRINT'] = True
bsd-2-clause
Python
f5d00ed283da255b8cd2c82b36e19ab9504a7dd4
Check before creating default super user.
weijia/webmanager,weijia/webmanager,weijia/webmanager
webmanager/management/commands/create_default_super_user.py
webmanager/management/commands/create_default_super_user.py
from django.contrib.auth.models import User from django.core.management.base import BaseCommand from djangoautoconf.local_key_manager import get_local_key, ConfigurableAttributeGetter from web_manage_tools.user_creator import create_admin def create_default_admin(): super_username = get_local_key("admin_account....
from django.core.management.base import BaseCommand from djangoautoconf.local_key_manager import get_local_key, ConfigurableAttributeGetter from web_manage_tools.user_creator import create_admin def create_default_admin(): super_username = get_local_key("admin_account.admin_username", "webmanager.keys_default") ...
bsd-3-clause
Python
65806edb0abb7f9ada4150cc3c836263d7365200
check if datadir need to be created
melmothx/jsonbot,melmothx/jsonbot,melmothx/jsonbot
gozerlib/utils/log.py
gozerlib/utils/log.py
# gozerlib/utils/log.py # # """ log module. """ ## basic imports import logging import logging.handlers import os import getpass ## defines LEVELS = {'debug': logging.DEBUG, 'info': logging.INFO, 'warning': logging.WARNING, 'warn': logging.WARNING, 'error': logging.ERROR, ...
# gozerlib/utils/log.py # # """ log module. """ ## basic imports import logging import logging.handlers import os import getpass ## defines LEVELS = {'debug': logging.DEBUG, 'info': logging.INFO, 'warning': logging.WARNING, 'warn': logging.WARNING, 'error': logging.ERROR, ...
mit
Python
4156466fde76dfb815ac1a33a170375572c1dd66
optimize example
akolpakov/paynova-api-python-client
examples/initial_payment.py
examples/initial_payment.py
from paynova_api_python_client import Paynova, PaynovaException import logging logging.basicConfig(level='DEBUG') # test client client = Paynova('<MERCHANT ID>', '<API Password>') try: # create order # For more information about parameters, see http://docs.paynova.com/display/API/Create+Order response ...
from paynova_api_python_client import Paynova, PaynovaException import logging logging.basicConfig(level='DEBUG') # test client client = Paynova('<MERCHANT ID>', '<API Password>') try: # create order # For more information about parameters, see http://docs.paynova.com/display/API/Create+Order response ...
mit
Python
dd2acfc297dc56cf3418eb2ff8d69cca5e9af2e0
remove todo
yunity/foodsaving-backend,yunity/yunity-core,yunity/foodsaving-backend,yunity/foodsaving-backend,yunity/yunity-core
foodsaving/groups/receivers.py
foodsaving/groups/receivers.py
from django.dispatch import receiver from foodsaving.groups.models import Group from foodsaving.invitations.signals import invitation_accepted from foodsaving.users.api import pre_user_delete @receiver(pre_user_delete) def delete_user_handler(sender, **kwargs): user = kwargs.get('user') for _ in Group.object...
from django.dispatch import receiver from foodsaving.groups.models import Group from foodsaving.invitations.signals import invitation_accepted from foodsaving.users.api import pre_user_delete @receiver(pre_user_delete) def delete_user_handler(sender, **kwargs): user = kwargs.get('user') for _ in Group.object...
agpl-3.0
Python
d9c1c391bca0d74e959fca218c204cfd66533988
Fix optional data payload in Prowl messaging service (#48868)
toddeye/home-assistant,toddeye/home-assistant,mezz64/home-assistant,GenericStudent/home-assistant,home-assistant/home-assistant,mezz64/home-assistant,rohitranjan1991/home-assistant,jawilson/home-assistant,rohitranjan1991/home-assistant,nkgilley/home-assistant,aronsky/home-assistant,kennedyshead/home-assistant,nkgilley/...
homeassistant/components/prowl/notify.py
homeassistant/components/prowl/notify.py
"""Prowl notification service.""" import asyncio import logging import async_timeout import voluptuous as vol from homeassistant.components.notify import ( ATTR_DATA, ATTR_TITLE, ATTR_TITLE_DEFAULT, PLATFORM_SCHEMA, BaseNotificationService, ) from homeassistant.const import CONF_API_KEY, HTTP_OK f...
"""Prowl notification service.""" import asyncio import logging import async_timeout import voluptuous as vol from homeassistant.components.notify import ( ATTR_DATA, ATTR_TITLE, ATTR_TITLE_DEFAULT, PLATFORM_SCHEMA, BaseNotificationService, ) from homeassistant.const import CONF_API_KEY, HTTP_OK f...
apache-2.0
Python