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 |
|---|---|---|---|---|---|---|---|---|
f32e2e2c17a4bd95d02b591df3359cb2869d3b7e | Fix selenium tests | simphony/simphony-remote,simphony/simphony-remote,simphony/simphony-remote,simphony/simphony-remote | selenium_tests/test_user_accounting.py | selenium_tests/test_user_accounting.py | from selenium_tests.AdminDriverTest import AdminDriverTest
from selenium.webdriver.common.by import By
import os
class TestUserAccounting(AdminDriverTest):
def test_create_new_entry_button(self):
self.click_first_element_located(By.LINK_TEXT, "Users")
self.click_first_button("Create New Entry")
... | from selenium_tests.AdminDriverTest import AdminDriverTest
from selenium.webdriver.common.by import By
import os
class TestUserAccounting(AdminDriverTest):
def test_create_new_entry_button(self):
self.click_first_element_located(By.LINK_TEXT, "Users")
self.click_first_button("Create New Entry")
... | bsd-3-clause | Python |
3efb2452b6904dc5b9660d9f54269baf0e1e3585 | Bump version | sloria/webtest-plus | webtest_plus/__init__.py | webtest_plus/__init__.py | # -*- coding: utf-8 -*-
from webtest_plus.app import TestApp
__version__ = '0.3.3'
__author__ = 'Steven Loria'
__license__ = "MIT"
__all__ = ['TestApp']
| # -*- coding: utf-8 -*-
from webtest_plus.app import TestApp
__version__ = '0.3.2'
__author__ = 'Steven Loria'
__license__ = "MIT"
__all__ = ['TestApp']
| mit | Python |
83178e6fc57321f121c62a07d54b8aa84f76289d | Add a note to myself to add a helper for constructing forwarding URLs | matthiask/django-keyed-urls,matthiask/django-keyed-urls,matthiask/django-keyed-urls | keyed_urls/__init__.py | keyed_urls/__init__.py | VERSION = (0, 1, 2)
__version__ = '.'.join(map(str, VERSION))
_none_type = 0xc0ffee
_available_languages = None
def get_url(key, language=None):
global _available_languages
from django.conf import settings
from django.core.cache import cache
from django.utils.translation import get_language, overri... | VERSION = (0, 1, 2)
__version__ = '.'.join(map(str, VERSION))
_none_type = 0xc0ffee
_available_languages = None
def get_url(key, language=None):
global _available_languages
from django.conf import settings
from django.core.cache import cache
from django.utils.translation import get_language, overri... | bsd-3-clause | Python |
c43ff7864416e41b682fe92b80365772ecb121a7 | Fix websocket_server | HPI-Hackathon/cartets,HPI-Hackathon/cartets,HPI-Hackathon/cartets | backend/websocket_server.py | backend/websocket_server.py | import thread
import json
from SimpleWebSocketServer import WebSocket, SimpleWebSocketServer
from game import Game
def client_thread(game, conn, data):
player = game.add_player(conn, data)
while True:
answer_data = game.wait_for_answer(player)
if answer_data:
conn.sendMessage(answ... | import thread
import json
from SimpleWebSocketServer import WebSocket, SimpleWebSocketServer
from game import Game
def client_thread(game, conn, data):
player = game.add_player(conn, data)
print player
class CartetsServer(WebSocket):
def handleMessage(self):
try:
data = json.loads(se... | mit | Python |
2ea15aa28caa010c9ec9c175cc259c4a2e558936 | update pxeserver agent version to 3.2.0 | zstackio/zstack-utility,zstackorg/zstack-utility,zstackorg/zstack-utility,zstackio/zstack-utility,zstackio/zstack-utility,zstackorg/zstack-utility | baremetalpxeserver/setup.py | baremetalpxeserver/setup.py | from setuptools import setup, find_packages
import sys, os
version = '3.2.0'
setup(name='baremetalpxeserver',
version=version,
description="ZStack baremetal pxeserver agent",
long_description="""\
ZStack baremetal pxeserver agent""",
classifiers=[], # Get strings from http://pypi.python.org/py... | from setuptools import setup, find_packages
import sys, os
version = '3.1.0'
setup(name='baremetalpxeserver',
version=version,
description="ZStack baremetal pxeserver agent",
long_description="""\
ZStack baremetal pxeserver agent""",
classifiers=[], # Get strings from http://pypi.python.org/py... | apache-2.0 | Python |
e74e4466c33484db240960995e6fcad904d0dee2 | Change sql.py to play nice with the documentation. | MerlijnWajer/SRL-Stats | sql.py | sql.py | import sqlalchemy
from sqlalchemy import create_engine
try
from stats_credentials import dbu, dbpwd, dwh, dbp, dbname
except ImportError, e:
print 'Cannot find stats_credentials!'
engine = create_engine("postgresql+psycopg2://%s:%s@%s:%s/%s" % (dbu, dbpwd,
dwh, dbp, dbname))
# Pass echo=True to see all S... | import sqlalchemy
from sqlalchemy import create_engine
from stats_credentials import dbu, dbpwd, dwh, dbp, dbname
engine = create_engine("postgresql+psycopg2://%s:%s@%s:%s/%s" % (dbu, dbpwd,
dwh, dbp, dbname))
# Pass echo=True to see all SQL queries
# When using MySQL; pass charset=utf8&use_unicode=1
from class... | agpl-3.0 | Python |
fba44cbf5f2cf0740e1579d70e79da4ab7d57aa0 | Use a sensible default port | prophile/libdiana | diana/socket.py | diana/socket.py | import socket
from . import packet
BLOCKSIZE = 4096
def connect(host, port=2010, connect=socket.create_connection):
sock = connect((host, port))
def tx(pack):
sock.send(packet.encode(pack))
def rx():
buf = b''
while True:
data = sock.recv(BLOCKSIZE)
buf += d... | import socket
from . import packet
BLOCKSIZE = 4096
def connect(host, port, connect=socket.create_connection):
sock = connect((host, port))
def tx(pack):
sock.send(packet.encode(pack))
def rx():
buf = b''
while True:
data = sock.recv(BLOCKSIZE)
buf += data
... | mit | Python |
615c6c2f78f431346cd9148af269260e0b798c5b | fix doc | yuyu2172/chainercv,chainer/chainercv,pfnet/chainercv,chainer/chainercv,yuyu2172/chainercv | chainercv/visualizations/vis_point.py | chainercv/visualizations/vis_point.py | from __future__ import division
import numpy as np
import six
from chainercv.visualizations.vis_image import vis_image
def vis_point(img, point, visible=None, ax=None):
"""Visualize points in an image.
Example:
>>> import chainercv
>>> import matplotlib.pyplot as plt
>>> dataset = ... | from __future__ import division
import numpy as np
import six
from chainercv.visualizations.vis_image import vis_image
def vis_point(img, point, visible=None, ax=None):
"""Visualize points in an image.
Example:
>>> import chainercv
>>> import matplotlib.pyplot as plt
>>> dataset = ... | mit | Python |
dfd493d232503928206172cd336f800d14384ba2 | Fix settings module setting in wsgi. | jlaunonen/kirppu,jlaunonen/kirppu,jlaunonen/kirppu,jlaunonen/kirppu | kirppu_project/wsgi.py | kirppu_project/wsgi.py | """
WSGI config for kirppu project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`` s... | """
WSGI config for kirppu project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`` s... | mit | Python |
1f5c196796d8f10bc19260c2d353d880b6147be7 | Set Sentry log level to warning | The-Fonz/adventure-track,The-Fonz/adventure-track,The-Fonz/adventure-track | backend/__init__.py | backend/__init__.py | #
# Centralized logging setup
#
import os
import logging
from .utils import getLogger
l = getLogger('backend')
logging.basicConfig(
level=logging.DEBUG,
format='[%(asctime)s][%(levelname)s] %(name)s '
'%(filename)s:%(funcName)s:%(lineno)d | %(message)s',
datefmt='%Y-%m-%d %H:%M:%S'
)
sentry_d... | #
# Centralized logging setup
#
import os
import logging
from .utils import getLogger
l = getLogger('backend')
logging.basicConfig(
level=logging.DEBUG,
format='[%(asctime)s][%(levelname)s] %(name)s '
'%(filename)s:%(funcName)s:%(lineno)d | %(message)s',
datefmt='%Y-%m-%d %H:%M:%S'
)
sentry_d... | mit | Python |
2223e8c7652df035d15b2f7d7d835bebdb7ff290 | Allow tests to run with python3 | kennethreitz/env | tests.py | tests.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import env
from os import environ
try:
from urlparse import urlparse as _urlparse
except ImportError:
from urllib.parse import urlparse as _urlparse
searchprefix = 'env1'
matchdata = {'env1TESTS1': 'aA', 'ENV1tests2': 'bB', 'env1tests3': 'cC'}
nomatchdata = {'env... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import env
from os import environ
from urlparse import urlparse as _urlparse
searchprefix = 'env1'
matchdata = {'env1TESTS1': 'aA', 'ENV1tests2': 'bB', 'env1tests3': 'cC'}
nomatchdata = {'env2TESTS4': 'dD', 'ENV2tests5': 'eE', 'env2tests6': 'fF'}
for matchvalue in matchd... | bsd-2-clause | Python |
b47c5452d6003d828a5da8fd21ec4c909113d813 | Bump version to 0.1a17 | letuananh/chirptext,letuananh/chirptext | chirptext/__version__.py | chirptext/__version__.py | # -*- coding: utf-8 -*-
# chirptext's package version information
__author__ = "Le Tuan Anh"
__email__ = "tuananh.ke@gmail.com"
__copyright__ = "Copyright (c) 2012, Le Tuan Anh"
__credits__ = []
__license__ = "MIT License"
__description__ = "ChirpText is a collection of text processing tools for Python."
__url__ = "ht... | # -*- coding: utf-8 -*-
# chirptext's package version information
__author__ = "Le Tuan Anh"
__email__ = "tuananh.ke@gmail.com"
__copyright__ = "Copyright (c) 2012, Le Tuan Anh"
__credits__ = []
__license__ = "MIT License"
__description__ = "ChirpText is a collection of text processing tools for Python."
__url__ = "ht... | mit | Python |
5c3b030a57bf850475ab02a85d731d97dcea406c | update exp6 | pupeng/hone,bolshoibooze/hone,bolshoibooze/hone,bolshoibooze/hone,pupeng/hone,bolshoibooze/hone,pupeng/hone,pupeng/hone | Controller/exp_exp6.py | Controller/exp_exp6.py | # Copyright (c) 2011-2013 Peng Sun. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the COPYRIGHT file.
# HONE application
# Exp6: evaluate the aggregation tree
from hone_lib import *
from subprocess import check_output
from math import *
import time
def connQ... | # Copyright (c) 2011-2013 Peng Sun. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the COPYRIGHT file.
# HONE application
# Exp6: evaluate the aggregation tree
from hone_lib import *
from subprocess import check_output
from math import *
import time
def connQ... | bsd-3-clause | Python |
6aeca91b978cc9692539fe1708633bb8868e4bbb | add chinese language | alephobjects/Cura,alephobjects/Cura,alephobjects/Cura | Cura/util/resources.py | Cura/util/resources.py | #coding:utf8
"""
Helper module to get easy access to the path where resources are stored.
This is because the resource location is depended on the packaging method and OS
"""
__copyright__ = "Copyright (C) 2013 David Braam - Released under terms of the AGPLv3 License"
import os
import sys
import glob
import gettext
... | #coding:utf8
"""
Helper module to get easy access to the path where resources are stored.
This is because the resource location is depended on the packaging method and OS
"""
__copyright__ = "Copyright (C) 2013 David Braam - Released under terms of the AGPLv3 License"
import os
import sys
import glob
import gettext
... | agpl-3.0 | Python |
86941327ed451026ee2748d43fc539e8a75e3ab8 | expand test coverage with key and reverse kwargs | bndl/cyheapq | tests.py | tests.py | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under th... | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under th... | apache-2.0 | Python |
d675dbcab18d56ae4c2c2f05d342159c1032b7b4 | Add Advance Voting stations to fake Exeter importer | DemocracyClub/UK-Polling-Stations,DemocracyClub/UK-Polling-Stations,DemocracyClub/UK-Polling-Stations | polling_stations/apps/data_importers/management/commands/import_fake_exeter.py | polling_stations/apps/data_importers/management/commands/import_fake_exeter.py | from django.contrib.gis.geos import Point
from addressbase.models import UprnToCouncil
from data_importers.mixins import AdvanceVotingMixin
from data_importers.management.commands import BaseXpressDemocracyClubCsvImporter
from pathlib import Path
from pollingstations.models import AdvanceVotingStation
def make_base... | from data_importers.management.commands import BaseXpressDemocracyClubCsvImporter
from pathlib import Path
def make_base_folder_path():
base_folder_path = Path.cwd() / Path("test_data/pollingstations_data/EXE")
return str(base_folder_path)
class Command(BaseXpressDemocracyClubCsvImporter):
local_files =... | bsd-3-clause | Python |
205969359539c60e76b91f04b0e9eed15ab534f5 | improve bug reports and implement tracking of reporters | ashbc/tgrsite,ashbc/tgrsite,ashbc/tgrsite | bugreports/views.py | bugreports/views.py | from django.shortcuts import render
from django.views import generic
from .models import Report
from django.contrib.auth.mixins import LoginRequiredMixin
class Index(LoginRequiredMixin, generic.ListView):
model = Report
class Detail(LoginRequiredMixin, generic.DetailView):
model = Report
class Create(LoginRequire... | from django.shortcuts import render
from django.views import generic
from .models import Report
# strictly these aren't necessary, as in the URLconf we can
# use, say, url('...', ListView.as_view(), model=Report, name=...)
class Index(generic.ListView):
model = Report
class Detail(generic.DetailView):
model=Report
cl... | isc | Python |
70e06c33f69810ab5b152ff12cc307590a872e64 | Remove some debugging | torifier/PyBitmessage,torifier/PyBitmessage,timothyparez/PyBitmessage,debguy0x/PyBitmessage,timothyparez/PyBitmessage,bmng-dev/PyBitmessage,hb9kns/PyBitmessage,hb9kns/PyBitmessage,torifier/PyBitmessage,bmng-dev/PyBitmessage,hb9kns/PyBitmessage,timothyparez/PyBitmessage,debguy0x/PyBitmessage,debguy0x/PyBitmessage,torifi... | src/bitmessageqt/languagebox.py | src/bitmessageqt/languagebox.py | import glob
import os
from PyQt4 import QtCore, QtGui
from shared import codePath, config
class LanguageBox(QtGui.QComboBox):
languageName = {"system": "System Settings", "eo": "Esperanto", "en_pirate": "Pirate English"}
def __init__(self, parent = None):
super(QtGui.QComboBox, self).__init__(parent)
... | import glob
import os
from PyQt4 import QtCore, QtGui
from debug import logger
from shared import codePath, config
class LanguageBox(QtGui.QComboBox):
languageName = {"system": "System Settings", "eo": "Esperanto", "en_pirate": "Pirate English"}
def __init__(self, parent = None):
super(QtGui.QComboBox... | mit | Python |
677c57a81a211d7e9133444bd3a7b598f5e56704 | add row tests for node model | CMPUT404Team/CMPUT404-project-socialdistribution,CMPUT404Team/CMPUT404-project-socialdistribution,CMPUT404Team/CMPUT404-project-socialdistribution | cmput404project/service/testNodeModel.py | cmput404project/service/testNodeModel.py | from django.test import TestCase
from models.Node import Node
from mock import MagicMock, Mock
from models.Author import Author
from django.contrib.auth.models import User
from unittest import skip
class NodeModelTests(TestCase):
def setUp(self):
su_username = "superuser"
su_password = "test1234"
... | from django.test import TestCase
from models.Node import Node
from mock import MagicMock, Mock
from models.Author import Author
from django.contrib.auth.models import User
from unittest import skip
class NodeModelTests(TestCase):
def setUp(self):
su_username = "superuser"
su_password = "test1234"
... | apache-2.0 | Python |
4e42e87234267ca8d0c4086bf56ceab245e09ea4 | Fix linting | CactusDev/CactusBot | cactusbot/cactus.py | cactusbot/cactus.py | """CactusBot!"""
import asyncio
import logging
import time
from .sepal import Sepal
__version__ = "v0.4-dev"
CACTUS_ART = r"""CactusBot initialized!
--`
` /++/- `
o+:. :+osy -/:.`
oo+o/ /osyy -+///`
/shh+ +oo+/ ./ooo`
//+o+ /+osy /soo+`
++//- :oyhy /hyo+`
/+oo/ /+/// -+/++`
... | """CactusBot!"""
import asyncio
import logging
import time
from .sepal import Sepal
__version__ = "v0.4-dev"
CACTUS_ART = r"""CactusBot initialized!
--`
` /++/- `
o+:. :+osy -/:.`
oo+o/ /osyy -+///`
/shh+ +oo+/ ./ooo`
//+o+ /+osy /soo+`
++//- :oyhy /hyo+`
/+oo/ /+/// -+/++`
... | mit | Python |
d42af86b8a000905febc9032f5a4d3b6b6471301 | fix a function call missed during refactoring | cogumbreiro/scribble-playpen,cogumbreiro/scribble-playpen,lastorset/rust-playpen,drlagos/unify-playpen,tilpner/rust-playpen,cogumbreiro/sepi-playpen,epdtry/cse333-rust-slides,chris-morgan/rust-playpen,Enamex/rust-playpen,Enamex/rust-playpen,Limvot/kraken-playpen,lastorset/rust-playpen,tilpner/rust-playpen,rust-lang/rus... | web.py | web.py | #!/usr/bin/env python3
import functools
import os
import playpen
import sys
from bottle import get, request, response, route, run, static_file
@get("/")
def serve_index():
return static_file("web.html", root="static")
@get("/<path:path>")
def serve_static(path):
return static_file(path, root="static")
@func... | #!/usr/bin/env python3
import functools
import os
import playpen
import sys
from bottle import get, request, response, route, run, static_file
@get("/")
def serve_index():
return static_file("web.html", root="static")
@get("/<path:path>")
def serve_static(path):
return static_file(path, root="static")
@func... | mit | Python |
6ec8e01d8e144b498329d4c0fb928bb63943b6cb | improve branch coverage of caffeine.admin | coffeestats/coffeestats-django,coffeestats/coffeestats-django,coffeestats/coffeestats-django,coffeestats/coffeestats-django | coffeestats/caffeine/tests/test_admin.py | coffeestats/caffeine/tests/test_admin.py | from django.test import TestCase
from django.contrib.auth import get_user_model
from caffeine.admin import (
PASSWORD_MISMATCH_ERROR,
UserChangeForm,
UserCreationForm,
)
User = get_user_model()
class UserCreationFormTest(TestCase):
def setUp(self):
self.testdata = {
'username': ... | from django.test import TestCase
from django.contrib.auth import get_user_model
from caffeine.admin import (
PASSWORD_MISMATCH_ERROR,
UserChangeForm,
UserCreationForm,
)
User = get_user_model()
class UserCreationFormTest(TestCase):
def test_clean_password2_passwords_match(self):
form = User... | mit | Python |
b57df9ebd68d5ccdcafdd2e75fd6e50fb6bd3b8c | Test indent | mattkirby/zpr-api | zpr.py | zpr.py | #!bin/python
import json
import lib_zpr
#import logging
#from logging.handlers import RotatingFileHandler
from flask import Flask, jsonify, make_response
app = Flask(__name__)
# app.logger.setLevel(logging.INFO)
# app.logger.disabled = False
# handler = logging.handlers.RotatingFileHandler(
# '/var/log/zpr_flas... | #!bin/python
import json
import lib_zpr
#import logging
#from logging.handlers import RotatingFileHandler
from flask import Flask, jsonify, make_response
app = Flask(__name__)
# app.logger.setLevel(logging.INFO)
# app.logger.disabled = False
# handler = logging.handlers.RotatingFileHandler(
# '/var/log/zpr_flas... | apache-2.0 | Python |
11316f62b75ce13018b34df88f2e93489224ce78 | Update P3_cellInverter working solution | JoseALermaIII/python-tutorials,JoseALermaIII/python-tutorials | books/AutomateTheBoringStuffWithPython/Chapter12/PracticeProjects/P3_cellInverter.py | books/AutomateTheBoringStuffWithPython/Chapter12/PracticeProjects/P3_cellInverter.py | # Write a program to invert the row and column of the cells in the spreadsheet.
# For example, the value at row 5, column 3 will be at row 3, column 5
# (and vice versa). This should be done for all cells in the spreadsheet.
import sys
import openpyxl
# Get argument from commandline
file = ''.join(sys.argv[1])
# Op... | # Write a program to invert the row and column of the cells in the spreadsheet.
# For example, the value at row 5, column 3 will be at row 3, column 5
# (and vice versa). This should be done for all cells in the spreadsheet.
| mit | Python |
f9da107ed849cc7efcf58707435749a51a12f439 | revert change | schoolie/bokeh,timsnyder/bokeh,htygithub/bokeh,Karel-van-de-Plassche/bokeh,azjps/bokeh,stonebig/bokeh,stonebig/bokeh,aavanian/bokeh,clairetang6/bokeh,jakirkham/bokeh,percyfal/bokeh,draperjames/bokeh,timsnyder/bokeh,aiguofer/bokeh,azjps/bokeh,Karel-van-de-Plassche/bokeh,justacec/bokeh,justacec/bokeh,msarahan/bokeh,denni... | bokeh/__init__.py | bokeh/__init__.py | """ Bokeh is a Python interactive visualization library that targets modern
web browsers for presentation.
Its goal is to provide elegant, concise construction of novel graphics in the
style of d3.js, but also deliver this capability with high-performance
interactivity over very large or streaming datasets. Bokeh can ... | """ Bokeh is a Python interactive visualization library that targets modern
web browsers for presentation.
Its goal is to provide elegant, concise construction of novel graphics in the
style of d3.js, but also deliver this capability with high-performance
interactivity over very large or streaming datasets. Bokeh can ... | bsd-3-clause | Python |
88f0c284b01bf5b4545fe63bdd1fde7cc66ad937 | Add admi to add Applications to the Pages. | us-ignite/us_ignite,us-ignite/us_ignite,us-ignite/us_ignite,us-ignite/us_ignite,us-ignite/us_ignite | us_ignite/apps/admin.py | us_ignite/apps/admin.py | from django.contrib import admin
from us_ignite.apps.models import (Application, ApplicationURL,
ApplicationImage, Domain, Feature,
Page, PageApplication)
class ApplicationURLInline(admin.TabularInline):
model = ApplicationURL
class Applicat... | from django.contrib import admin
from us_ignite.apps.models import (Application, ApplicationURL,
ApplicationImage, Domain, Feature)
class ApplicationURLInline(admin.TabularInline):
model = ApplicationURL
class ApplicationImageInline(admin.TabularInline):
model = Applicati... | bsd-3-clause | Python |
b1faab8bdff18d93c69e5ffc56a9dd9fda82c2f8 | add return of band 7 or 8 or both | rmvanhees/pys5p | pys5p/swir_region.py | pys5p/swir_region.py | """
This file is part of pyS5p
https://github.com/rmvanhees/pys5p.git
There are two definitions of the usable area on the SWIR detector:
- 'illuminated' - detector area illuminated by external sources,
defined as an rectangular area where the signal is at least 50% of the
maximum signal. Coordinates: rows [11:228]... | """
This file is part of pyS5p
https://github.com/rmvanhees/pys5p.git
There are two definitions of the usable area on the SWIR detector:
- 'illuminated' - detector area illuminated by external sources,
defined as an rectangular area where the signal is at least 50% of the
maximum signal. Coordinates: rows [11:228]... | bsd-3-clause | Python |
12fb48ec1a80c578a72f30d686280259d38dc685 | Simplify functional utilities | davidfoerster/schema-matching | utilities/functional.py | utilities/functional.py | import functools
import operator
def apply_memberfn(memberfn, *args):
if callable(memberfn):
return lambda instance: memberfn(instance, *args)
else:
return lambda instance: getattr(instance, memberfn)(*args)
def rapply(arg, function):
return function(arg)
def composefn(*functions):
if not function... | def apply_memberfn(memberfn, *args):
if callable(memberfn):
return lambda instance: memberfn(instance, *args)
else:
return lambda instance: getattr(instance, memberfn)(*args)
def composefn(*functions):
def rapply(x, fn): return fn(x)
return lambda x: reduce(rapply, functions, x)
| mit | Python |
a9bb32b91e2b742705b6292bd52fc869a8130766 | Add check for supported Python versions | ErwinJanssen/dymport.py | dymport/import_file.py | dymport/import_file.py | """
Various functions to dynamically import (abitrary names from) arbitrary files.
To import a file like it is a module, use `import_file`.
"""
from sys import version_info
def import_file(name, file):
"""
Import `file` as a module with _name_.
Raises an ImportError if it could not be imported.
"""... | """
Various functions to dynamically import (abitrary names from) arbitrary files.
To import a file like it is a module, use `import_file`.
"""
from importlib.util import module_from_spec, spec_from_file_location
def import_file(name, file):
"""
Import `file` as a module with _name_.
Raises an ImportEr... | mit | Python |
a62f638b3e5ae9eb51de58b3eb392b77efe3bac6 | test fix | FRBs/FRB | frb/figures/utils.py | frb/figures/utils.py | """ Simple utilities for figures"""
import numpy as np
import matplotlib as mpl
def log_me(val, err):
"""
Generate log and error from linear input
Args:
val (float):
err (float):
Returns:
float, (float/None):
Returns none if the err is negative
"""
... | """ Simple utilities for figures"""
import numpy as np
import matplotlib as mpl
def log_me(val, err):
"""
Generate log and error from linear input
Args:
val (float):
err (float):
Returns:
float, (float/None):
Returns none if the err is negative
"""
... | bsd-3-clause | Python |
32de2adf8fe6d5917ce11c415ca5af48bca7a255 | Remove old code | DemokratieInBewegung/abstimmungstool,DemokratieInBewegung/abstimmungstool,DemokratieInBewegung/abstimmungstool,DemokratieInBewegung/abstimmungstool | voty/initadmin/notify_backend.py | voty/initadmin/notify_backend.py | from django.utils.translation import ugettext
from django.contrib.contenttypes.models import ContentType
from django.db.models import Q
from pinax.notifications.backends.base import BaseBackend
from notifications.signals import notify
class SiteBackend(BaseBackend):
spam_sensitivity = 0
def deliver(self... | from django.utils.translation import ugettext
from django.contrib.contenttypes.models import ContentType
from django.db.models import Q
from pinax.notifications.backends.base import BaseBackend
from notifications.signals import notify
class SiteBackend(BaseBackend):
spam_sensitivity = 0
def deliver(sel... | agpl-3.0 | Python |
e64a42db6b72fa5308d697d5ce6c2d4f543268f2 | bump version | trbs/bucky,dimrozakis/bucky,ewdurbin/bucky,Hero1378/bucky,JoseKilo/bucky,CollabNet/puppet-bucky,JoseKilo/bucky,trbs/bucky,Hero1378/bucky,CollabNet/puppet-bucky,CollabNet/puppet-bucky,ewdurbin/bucky,dimrozakis/bucky,jsiembida/bucky3,CollabNet/puppet-bucky | bucky/__init__.py | bucky/__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
... | # -*- 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
... | apache-2.0 | Python |
14287ba5041c85f142c82fd3fc2e23d150521ae5 | Remove python < 3.4 support from utils.inspection.accepts_kwarg | rkhleics/wagtailmenus,ababic/wagtailmenus,ababic/wagtailmenus,rkhleics/wagtailmenus,ababic/wagtailmenus,rkhleics/wagtailmenus | wagtailmenus/utils/inspection.py | wagtailmenus/utils/inspection.py | import inspect
"""
This method below was copied from wagtail.wagtailcore.utils (v1.11) and allows
us to handle deprecation of method arguments in a way that doesn't swallow
`TypeError` exceptions raised further down the chain. Thank you @gasman!
"""
def accepts_kwarg(func, kwarg):
"""
Determine whether the c... | import inspect
import sys
"""
This method below was copied from wagtail.wagtailcore.utils (v1.11) and allows
us to handle deprecation of method arguments in a way that doesn't swallow
`TypeError` exceptions raised further down the chain. Thank you @gasman!
"""
def accepts_kwarg(func, kwarg):
"""
Determine wh... | mit | Python |
bf5532f405df8869b4869c2d839e6093ebf963bc | Fix errors cause by key error in sys.modules and wrong type error by uFid. | hoonkim/rune,hoonkim/rune,hoonkim/rune | wisp/utils.py | wisp/utils.py | import importlib
import importlib.machinery
import sys
from module import Module
import json
def message_to_function(raw_message):
"""
converting json formatted string to a executable module.
Args:
raw_message (str): json formatted.
Returns:
None if raw_message is in wrong format, ... | import importlib
import importlib.machinery
import sys
from module import Module
import json
def message_to_function(raw_message):
"""
converting json formatted string to a executable module.
Args:
raw_message (str): json formatted.
Returns:
None if raw_message is in wrong format, ... | apache-2.0 | Python |
90cc2dee523106aa68ad1b4a882089d4d73a6bbf | make saver protected | ufal/neuralmonkey,bastings/neuralmonkey,juliakreutzer/bandit-neuralmonkey,bastings/neuralmonkey,bastings/neuralmonkey,bastings/neuralmonkey,ufal/neuralmonkey,ufal/neuralmonkey,juliakreutzer/bandit-neuralmonkey,juliakreutzer/bandit-neuralmonkey,ufal/neuralmonkey,bastings/neuralmonkey,juliakreutzer/bandit-neuralmonkey,uf... | neuralmonkey/model/model_part.py | neuralmonkey/model/model_part.py | """Basic functionality of all model parts."""
from abc import ABCMeta
from typing import Any, Dict, Optional
import tensorflow as tf
from neuralmonkey.dataset import Dataset
from neuralmonkey.logging import log
# pylint: disable=invalid-name
FeedDict = Dict[tf.Tensor, Any]
# pylint: disable=invalid-name
class Mod... | """Basic functionality of all model parts."""
from abc import ABCMeta
from typing import Any, Dict, Optional
import tensorflow as tf
from neuralmonkey.dataset import Dataset
from neuralmonkey.logging import log
# pylint: disable=invalid-name
FeedDict = Dict[tf.Tensor, Any]
# pylint: disable=invalid-name
class Mod... | bsd-3-clause | Python |
4a5e798fe23d720315a7cab60824b70ce0983f8e | Simplify formulation and change from print() to assert() | jcrist/pydy,Shekharrajak/pydy,oliverlee/pydy,jcrist/pydy,jcrist/pydy,oliverlee/pydy,jcrist/pydy,Shekharrajak/pydy,oliverlee/pydy,jcrist/pydy,Shekharrajak/pydy,jcrist/pydy,skidzo/pydy,Shekharrajak/pydy,skidzo/pydy,skidzo/pydy,jcrist/pydy,skidzo/pydy | Kane1985/Chapter2/Ex4.1.py | Kane1985/Chapter2/Ex4.1.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Exercise 4.1 from Kane 1985"""
from sympy.physics.mechanics import dot, dynamicsymbols, MechanicsStrPrinter
from sympy.physics.mechanics import ReferenceFrame, Point
from sympy import solve, symbols, pi, sin, cos
from sympy.simplify.simplify import trigsimp
def msprint... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Exercise 4.1 from Kane 1985"""
from sympy.physics.mechanics import dot, dynamicsymbols, MechanicsStrPrinter
from sympy.physics.mechanics import ReferenceFrame, Point
from sympy import solve, symbols, pi
from sympy.simplify.simplify import trigsimp
def msprint(expr):
... | bsd-3-clause | Python |
ed6cbec7ef582ba369939aca08a82c7cbcefa7b8 | add status PAUSED to Event | saydulk/newfies-dialer,newfies-dialer/newfies-dialer,romonzaman/newfies-dialer,saydulk/newfies-dialer,Star2Billing/newfies-dialer,newfies-dialer/newfies-dialer,romonzaman/newfies-dialer,newfies-dialer/newfies-dialer,Star2Billing/newfies-dialer,romonzaman/newfies-dialer,Star2Billing/newfies-dialer,saydulk/newfies-dialer... | newfies/appointment/constants.py | newfies/appointment/constants.py | #
# Newfies-Dialer License
# http://www.newfies-dialer.org
#
# 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/.
#
# Copyright (C) 2011-2013 Star2Billing S.L.
#
# The Initia... | #
# Newfies-Dialer License
# http://www.newfies-dialer.org
#
# 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/.
#
# Copyright (C) 2011-2013 Star2Billing S.L.
#
# The Initia... | mpl-2.0 | Python |
49366bd45c401ed20bb8f50757f0a055249fd4df | Add index displaying. | elleryq/oh-my-home,elleryq/oh-my-home,elleryq/oh-my-home | bin/stock_dashboard.py | bin/stock_dashboard.py | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
from __future__ import print_function
import os
from grs import RealtimeTWSE, RealtimeOTC, Stock
from grs import RealtimeWeight
def getStocksFromConfig():
from ConfigParser import SafeConfigParser
configFile = os.path.join(
os.path.expanduser("~/.config... | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
from __future__ import print_function
import os
from grs import RealtimeTWSE, RealtimeOTC, Stock
def getStocksFromConfig():
from ConfigParser import SafeConfigParser
configFile = os.path.join(
os.path.expanduser("~/.config"),
"stock_dashboard.in... | apache-2.0 | Python |
69e34b3b71e6c0e4f24f0a1aa1206c349cd0777b | Remove redundant permission logic | opennode/nodeconductor,opennode/nodeconductor,opennode/nodeconductor | nodeconductor/structure/perms.py | nodeconductor/structure/perms.py | from django.contrib.auth import get_user_model
from nodeconductor.core.permissions import StaffPermissionLogic, FilteredCollaboratorsPermissionLogic
from nodeconductor.structure.models import CustomerRole, ProjectRole, ProjectGroupRole
User = get_user_model()
PERMISSION_LOGICS = (
('structure.Customer', StaffPe... | from django.contrib.auth import get_user_model
from nodeconductor.core.permissions import StaffPermissionLogic, FilteredCollaboratorsPermissionLogic
from nodeconductor.structure.models import CustomerRole, ProjectRole, ProjectGroupRole
User = get_user_model()
PERMISSION_LOGICS = (
('structure.Customer', StaffPe... | mit | Python |
4856eabe8f71352e4a5884bf7fec64a533b8f6dd | use files for js engine output, because large output can deadlock when using pipes without communicate() | nth10sd/lithium,MozillaSecurity/lithium,nth10sd/lithium,MozillaSecurity/lithium | lithium/jitdiff.py | lithium/jitdiff.py | #!/usr/bin/env python
import os, sys, ntr
def interesting(args, tempPrefix):
program = args[0]
testcase = args[1]
timeout = 10
runinfo1 = ntr.timed_run([program, testcase], timeout, tempPrefix + "-r1")
runinfo2 = ntr.timed_run([program, "-j", testcase], timeout, tempPrefix + "-r2")
if ru... | #!/usr/bin/env python
import os, sys, ntr
def interesting(args, tempPrefix):
program = args[0]
testcase = args[1]
timeout = 2
runinfo1 = ntr.timed_run([program, testcase], timeout, None, input="")
runinfo2 = ntr.timed_run([program, "-j", testcase], timeout, None, input="")
if runinfo1.st... | mpl-2.0 | Python |
e22e79daa1dcd7d1430e16e8f0714705cb0753ff | Bump to 0.4.5rc3 | arsenovic/galgebra,arsenovic/galgebra | galgebra/_version.py | galgebra/_version.py | # Package versioning solution originally found here:
# http://stackoverflow.com/q/458550
# Store the version here so:
# 1) we don't load dependencies by storing it in __init__.py
# 2) we can import it in setup.py for the same reason
# 3) we can import it into your module
__version__ = '0.4.5rc3'
| # Package versioning solution originally found here:
# http://stackoverflow.com/q/458550
# Store the version here so:
# 1) we don't load dependencies by storing it in __init__.py
# 2) we can import it in setup.py for the same reason
# 3) we can import it into your module
__version__ = '0.4.5rc2'
| bsd-3-clause | Python |
fbfb1678b53ab60d12af126b183248cc039e5fcd | Fix 'View Site' link, closes #127 | troeger/opensubmit,troeger/opensubmit,troeger/opensubmit,troeger/opensubmit,troeger/opensubmit | web/opensubmit/admin/__init__.py | web/opensubmit/admin/__init__.py | from django.contrib.auth.models import User, Permission, Group
from opensubmit.models import Course, Grading, GradingScheme, Assignment, SubmissionFile, Submission, TestMachine
from opensubmit import settings
from django.contrib.admin.sites import AdminSite
from user import UserAdmin
from course import CourseAdmin
fro... | from django.contrib.auth.models import User, Permission, Group
from opensubmit.models import Course, Grading, GradingScheme, Assignment, SubmissionFile, Submission, TestMachine
from django.contrib.admin.sites import AdminSite
from user import UserAdmin
from course import CourseAdmin
from grading import GradingAdmin
fr... | agpl-3.0 | Python |
e57378220920ac85df16083e5ce685f0b86ea658 | bump version | GOVCERT-LU/eml_parser,sim0nx/eml_parser | eml_parser/__init__.py | eml_parser/__init__.py | # -*- coding: utf-8 -*-
# pylint: disable=line-too-long
"""eml_parser serves as a python module for parsing eml files and returning various
information found in the e-mail as well as computed information.
"""
from . import eml_parser
__version__ = '1.5'
| # -*- coding: utf-8 -*-
# pylint: disable=line-too-long
"""eml_parser serves as a python module for parsing eml files and returning various
information found in the e-mail as well as computed information.
"""
from . import eml_parser
__version__ = '1.4'
| agpl-3.0 | Python |
82954c638aa013a037125e0c9f167045f38da504 | Migrate docker to new debian semantics | hatchery/genepool,hatchery/Genepool2 | genes/docker/main.py | genes/docker/main.py | from genes.apt import commands as apt
from genes.brew import commands as brew
from genes.debian.traits import is_debian, get_distro, get_codename
from genes.ubuntu.traits import is_ubuntu
from genes.mac.traits import is_osx
def main():
if is_debian() or is_ubuntu():
repo = get_distro().lower() + '-' + \
... | from genes.apt import commands as apt
from genes.brew import commands as brew
from genes import debian
from genes.debian.traits import is_debian
from genes.ubuntu.traits import is_ubuntu
from genes.mac.traits import is_osx
def main():
if is_debian() or is_ubuntu():
repo = debian.traits.distribution.lower(... | mit | Python |
f21cdef28bf58a8f6dd33dbec0c7c38fbedb823c | Add namespace to __init__ | percyfal/ratatosk,percyfal/ratatosk | ratatosk/__init__.py | ratatosk/__init__.py | # Copyright (c) 2013 Per Unneberg
#
# 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,... | # Copyright (c) 2013 Per Unneberg
#
# 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,... | apache-2.0 | Python |
4130c082ae3008365c854ad65c4510cb04dfbf27 | Add support for generic pages | alamasfu10/webcrawler | webcrawler.py | webcrawler.py | import re
import requests
from bs4 import BeautifulSoup
def parse_html(html, **kwargs):
is_wikipedia_page = kwargs.get('is_wikipedia_page')
parsed_html = BeautifulSoup(html, 'html.parser')
headline = parsed_html.body.find('h1')
paragraph = None
if is_wikipedia_page:
# Parse Paragraph
... | import requests
from bs4 import BeautifulSoup
def parse_html(html, **kwargs):
parsed_html = BeautifulSoup(html, 'lxml')
headline = parsed_html.body.find('h1')
paragraph = None
# Parse Paragraph
content_container = parsed_html.body.find(
'div',
attrs={'id': 'bodyContent'}
)
... | mit | Python |
b82f7ab4694d02cd3357e4b051f68f7d6b133b6e | check root.log for missing build dependencies | hrw/fedora-koji-scripts,hrw/fedora-koji-scripts | get-failed-builds.py | get-failed-builds.py | #!/bin/python
"""
Simple script to list FTFBS packages in Koji
Author: Marcin Juszkiewicz <mjuszkiewicz@redhat.com>
License: GPLv2+
"""
import argparse
import koji
import re
import rpm
def parse_args():
parser = argparse.ArgumentParser(description="Query Koji for FTBFS list")
parser.add_argument("-a", "--arch", d... | #!/bin/python
"""
Simple script to list FTFBS packages in Koji
Author: Marcin Juszkiewicz <mjuszkiewicz@redhat.com>
License: GPLv2+
"""
import argparse
import koji
import rpm
def parse_args():
parser = argparse.ArgumentParser(description="Query Koji for FTBFS list")
parser.add_argument("-a", "--arch", dest="arch"... | mit | Python |
5df56bf8c422243b6aa6ad599a57fc1d04123902 | Replace line breaks with a space | scraperwiki/difference-tool,scraperwiki/difference-tool,scraperwiki/difference-tool,scraperwiki/difference-tool | get_text_from_url.py | get_text_from_url.py | #!/usr/bin/env python
# encoding: utf-8
from __future__ import (unicode_literals, print_function,
absolute_import, division)
import codecs
import re
import requests
import sys
from os.path import join, dirname, abspath
import lxml.html
import lxml.html.clean
def read_file(input_filename):
... | #!/usr/bin/env python
# encoding: utf-8
from __future__ import (unicode_literals, print_function,
absolute_import, division)
import codecs
import re
import requests
import sys
from os.path import join, dirname, abspath
import lxml.html
import lxml.html.clean
def read_file(input_filename):
... | agpl-3.0 | Python |
dab3e8a78ace2189dbf04348bf5f2cdaed0c7f5c | Handle undefined | totem/cluster-orchestrator,totem/cluster-orchestrator,totem/cluster-orchestrator | orchestrator/jinja/conditions.py | orchestrator/jinja/conditions.py | from future.builtins import ( # noqa
bytes, dict, int, list, object, range, str,
ascii, chr, hex, input, next, oct, open,
pow, round, filter, map, zip)
import re
__author__ = 'sukrit'
"""
Defines all the filters used for jinja templates (config)
"""
USE_TESTS = ('starting_with', 'matching', )
def appl... | from future.builtins import ( # noqa
bytes, dict, int, list, object, range, str,
ascii, chr, hex, input, next, oct, open,
pow, round, filter, map, zip)
import re
__author__ = 'sukrit'
"""
Defines all the filters used for jinja templates (config)
"""
USE_TESTS = ('starting_with', 'matching', )
def appl... | mit | Python |
53c2d5a724982dbc587d918dcafa2c3df1b5ab6f | Fix /vimtips debug | JokerQyou/bot | botcommands/vimtips.py | botcommands/vimtips.py | # coding: utf-8
from random import randint
import requests
from redis_wrap import get_hash, SYSTEMS
from rq.decorators import job
def vimtips(msg=None, debug=False):
try:
existing_tips = get_hash('vimtips')
_len = len(existing_tips)
if _len > 0:
_index = randint(0, _len - 1)
... | # coding: utf-8
from random import randint
import requests
from redis_wrap import get_hash, SYSTEMS
from rq.decorators import job
def vimtips(msg=None, debug=False):
try:
existing_tips = get_hash('vimtips')
_len = len(existing_tips)
if _len > 0:
_index = randint(0, _len - 1)
... | bsd-2-clause | Python |
9b3d48473fcd1288082d7b1c4c76173ddb2432f3 | Add --with-xvfb-options to accept options for XvfbWrapper | grupotaric/nose-xvfb | nosexvfb/xvfb.py | nosexvfb/xvfb.py | #-*- coding: utf-8 -*-
import logging
from nose.plugins import Plugin
from xvfbwrapper import Xvfb as XvfbWrapper
logger = logging.getLogger('nose.plugins.xvfb')
class Xvfb(Plugin):
def options(self, parser, env):
super(Xvfb, self).options(parser, env)
parser.add_option("--with-xvfb-options", a... | #-*- coding: utf-8 -*-
import logging
from nose.plugins import Plugin
from xvfbwrapper import Xvfb as XvfbWrapper
logger = logging.getLogger('nose.plugins.xvfb')
class Xvfb(Plugin):
def begin(self):
logger.info('Starting xvfb virtual display 1024x768')
self.vdisplay = XvfbWrapper(width=1024, he... | mit | Python |
76ae290a8ab39a72c76635723754acd7de9aba02 | Remove get_file() HMM API handler | igboyes/virtool,virtool/virtool,igboyes/virtool,virtool/virtool | virtool/handlers/hmm.py | virtool/handlers/hmm.py | import asyncio
import os
import pymongo
import virtool.utils
import virtool.virus_hmm
from virtool.handlers.utils import compose_regex_query, json_response, not_found, paginate, protected
async def find(req):
"""
Find HMM annotation documents.
"""
db = req.app["db"]
term = req.query.get("find"... | import asyncio
import os
import pymongo
import virtool.utils
import virtool.virus_hmm
from virtool.handlers.utils import compose_regex_query, json_response, not_found, paginate, protected
async def find(req):
"""
Find HMM annotation documents.
"""
db = req.app["db"]
term = req.query.get("find"... | mit | Python |
2f2f6890650c3ad60da42fa24eba4e4469cddf1e | fix adding GELF handler for graylog | sh0ked/vmmaster,2gis/vmmaster,2gis/vmmaster,sh0ked/vmmaster,2gis/vmmaster | vmmaster/core/logger.py | vmmaster/core/logger.py | import logging
import logging.handlers
import graypy
import os
import sys
from .config import config
class StreamToLogger(object):
"""
Fake file-like stream object that redirects writes to a logger instance.
"""
def __init__(self, logger, log_level=logging.INFO):
self.logger = logger
... | import logging
import logging.handlers
import graypy
import os
import sys
from .config import config
class StreamToLogger(object):
"""
Fake file-like stream object that redirects writes to a logger instance.
"""
def __init__(self, logger, log_level=logging.INFO):
self.logger = logger
... | mit | Python |
0fdf9b5621c7d066228a9dc99af0340be5977460 | Bump version | TomBaxter/waterbutler,icereval/waterbutler,chrisseto/waterbutler,RCOSDP/waterbutler,Johnetordoff/waterbutler,CenterForOpenScience/waterbutler,kwierman/waterbutler,rafaeldelucena/waterbutler,Ghalko/waterbutler,cosenal/waterbutler,rdhyee/waterbutler,hmoco/waterbutler,felliott/waterbutler | waterbutler/__init__.py | waterbutler/__init__.py | __version__ = '0.3.0'
__import__("pkg_resources").declare_namespace(__name__)
| __version__ = '0.2.5'
__import__("pkg_resources").declare_namespace(__name__)
| apache-2.0 | Python |
abddd4a80ef63799cddae3374db471c837f4a3eb | print vendor | ryppl/sat-solver,ryppl/sat-solver,ryppl/sat-solver,ryppl/sat-solver,ryppl/sat-solver | bindings/python/tests/rpmdb.py | bindings/python/tests/rpmdb.py | #
# Load repository from rpm database
#
# repo = pool.add_rpmdb( "/root/dir/of/system" )
# will create an unnamed repository by reading the rpm database
# and create a solvable for each installed package.
# Use
# repo.name = "..."
# to name the repository
#
#
import unittest
import sys
sys.path.insert(0, '../../.... | #
# Load repository from rpm database
#
# repo = pool.add_rpmdb( "/root/dir/of/system" )
# will create an unnamed repository by reading the rpm database
# and create a solvable for each installed package.
# Use
# repo.name = "..."
# to name the repository
#
#
import unittest
import sys
sys.path.insert(0, '../../.... | bsd-3-clause | Python |
609591f7b83c7010fd9ed3b2b4502c138457bda7 | set __name__ attribute in foreign_fields | marwano/django-glaze,marwano/django-glaze,marwano/django-glaze | glaze/admin/utils.py | glaze/admin/utils.py |
from django.utils import six
from glaze.utils.text import deslugify
def foreign_fields(*args):
items = []
for i in args:
if isinstance(i, six.string_types) and '__' in i:
names = i.split('__')
accessor = lambda obj: reduce(getattr, names, obj)
accessor.__name__ = n... |
from django.utils import six
from glaze.utils.text import deslugify
def foreign_fields(*args):
items = []
for i in args:
if isinstance(i, six.string_types) and '__' in i:
names = i.split('__')
accessor = lambda obj: reduce(getattr, names, obj)
accessor.short_descri... | bsd-3-clause | Python |
b3af35b74324a9fdf863a6aa554a3dd1c72223f7 | add checks for deployment options | OpenNebula/addon-drbdmanage,OpenNebula/addon-drbdmanage | validate_config.py | validate_config.py | #!/usr/bin/env python
import sys
config_file = sys.argv[1]
# Convert configuration file into dict.
config = {}
with open(config_file) as file:
for line in file:
key, value = line.split("=")
config[key.strip()] = value.strip()
valid_config = True
print(config)
# Check that only one deployment o... | #!/usr/bin/env python
import sys
config_file = sys.argv[1]
# Convert configuration file into dict.
config = {}
with open(config_file) as file:
for line in file:
key, value = line.split("=")
config[key.strip()] = value.strip()
valid_config = True
print(config)
# Check that only one deployment o... | apache-2.0 | Python |
d73e71e413eae0a89006e05e2f78bf5fcfc6b8a7 | Make trunk 1.0b4.dev release | groutr/numpy,grlee77/numpy,ChanderG/numpy,brandon-rhodes/numpy,ahaldane/numpy,skwbc/numpy,MichaelAquilina/numpy,leifdenby/numpy,rmcgibbo/numpy,rajathkumarmp/numpy,charris/numpy,ssanderson/numpy,charris/numpy,matthew-brett/numpy,trankmichael/numpy,ChristopherHogan/numpy,andsor/numpy,njase/numpy,ewmoore/numpy,tynn/numpy,... | numpy/version.py | numpy/version.py | version='1.0b4444'
release=False
if not release:
import os
svn_version_file = os.path.join(os.path.dirname(__file__),
'core','__svn_version__.py')
if os.path.isfile(svn_version_file):
import imp
svn = imp.load_module('numpy.core.__svn_version__',
... | version='1.0b3'
release=False
if not release:
import os
svn_version_file = os.path.join(os.path.dirname(__file__),
'core','__svn_version__.py')
if os.path.isfile(svn_version_file):
import imp
svn = imp.load_module('numpy.core.__svn_version__',
... | bsd-3-clause | Python |
0ffa053a22ab01cd4554fc3e48964bd6814d6c07 | update descripton on pypi | mgx2/python-nvd3,liang42hao/python-nvd3,mgx2/python-nvd3,yelster/python-nvd3,liang42hao/python-nvd3,vdloo/python-nvd3,oz123/python-nvd3,BibMartin/python-nvd3,Coxious/python-nvd3,pignacio/python-nvd3,pignacio/python-nvd3,liang42hao/python-nvd3,mgx2/python-nvd3,yelster/python-nvd3,pignacio/python-nvd3,Coxious/python-nvd3... | nvd3/__init__.py | nvd3/__init__.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Python-nvd3 is a Python wrapper for NVD3 graph library.
NVD3 is an attempt to build re-usable charts and chart components
for d3.js without taking away the power that d3.js gives you.
Project location : https://github.com/areski/python-nvd3
Part of this code is inspired ... | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Python-nvd3 is a Python wrapper for NVD3 graph library.
NVD3 is an attempt to build re-usable charts and chart components
for d3.js without taking away the power that d3.js gives you.
Project location : https://github.com/areski/python-nvd3
Part of this code is inspired ... | mit | Python |
92c4bb530d44bb1517070d6f380fda45b061f53b | fix building | DeadSix27/python_cross_compile_script | packages/dependencies/shaderc.py | packages/dependencies/shaderc.py | {
'repo_type' : 'git',
'url' : 'https://github.com/google/shaderc.git',
'configure_options' :
'cmake .. {cmake_prefix_options} '
'-DCMAKE_BUILD_TYPE=Release '
'-DCMAKE_TOOLCHAIN_FILE=cmake/linux-mingw-toolchain.cmake '
'-DCMAKE_INSTALL_PREFIX={target_prefix} '
'-DSHADERC_SKIP_INSTALL=ON '
'-DSHADERC_SKIP... | {
'repo_type' : 'git',
'url' : 'https://github.com/google/shaderc.git',
'configure_options' :
'cmake .. {cmake_prefix_options} '
'-DCMAKE_BUILD_TYPE=Release '
'-DCMAKE_TOOLCHAIN_FILE=cmake/linux-mingw-toolchain.cmake '
'-DCMAKE_INSTALL_PREFIX={target_prefix} '
'-DSHADERC_SKIP_INSTALL=ON '
'-DSHADERC_SKIP... | mpl-2.0 | Python |
b64a6da3a3744557052b8ea1ae416b96c5485ae1 | Add version requirement | naveentata/coala-bears,damngamerz/coala-bears,ankit01ojha/coala-bears,arjunsinghy96/coala-bears,Asnelchristian/coala-bears,yash-nisar/coala-bears,yash-nisar/coala-bears,refeed/coala-bears,coala/coala-bears,horczech/coala-bears,refeed/coala-bears,Asnelchristian/coala-bears,refeed/coala-bears,meetmangukiya/coala-bears,da... | bears/r/RLintBear.py | bears/r/RLintBear.py | from coala_utils.string_processing import escape
from coalib.bearlib.abstractions.Linter import linter
from dependency_management.requirements.RscriptRequirement import (
RscriptRequirement)
from dependency_management.requirements.DistributionRequirement import (
DistributionRequirement)
from coalib.results.RE... | from coala_utils.string_processing import escape
from coalib.bearlib.abstractions.Linter import linter
from dependency_management.requirements.RscriptRequirement import (
RscriptRequirement)
from coalib.results.RESULT_SEVERITY import RESULT_SEVERITY
@linter(executable='Rscript',
output_format='regex',
... | agpl-3.0 | Python |
fdda32801a8071ae79bbd50780bfe6de759075e9 | Use logging. | sseguku/simplecensusug,danilito19/censusreporter,Ladaniels/censusreporter,Ladaniels/censusreporter,censusreporter/censusreporter,qshng522/censusreporter,Code4SA/censusreporter,4bic/censusreporter,danilito19/censusreporter,qshng522/censusreporter,danilito19/censusreporter,4bic/censusreporter,qshng522/censusreporter,usce... | censusreporter/apps/census/management/commands/cache_to_s3.py | censusreporter/apps/census/management/commands/cache_to_s3.py | from django.core.management.base import BaseCommand
from multiprocessing import Pool
from traceback import format_exc
from boto.s3.connection import S3Connection
from boto.s3.key import Key
import json
import cStringIO
import gzip
from ...profile import geo_profile, enhance_api_data
import logging
logging.basicConfi... | from django.core.management.base import BaseCommand
from multiprocessing import Pool
from traceback import format_exc
from boto.s3.connection import S3Connection
from boto.s3.key import Key
import json
import cStringIO
import gzip
from ...profile import geo_profile, enhance_api_data
s3 = S3Connection()
def s3_keyna... | mit | Python |
9a2ee03aeebe0e632ff881c01202acdbbe89aca7 | fix version of deprecation in docstring | graphql-python/graphql-core | src/graphql/subscription/__init__.py | src/graphql/subscription/__init__.py | """GraphQL Subscription
The :mod:`graphql.subscription` package is responsible for subscribing to updates
on specific data.
.. deprecated:: 3.2
This package has been deprecated with its exported functions integrated into the
:mod:`graphql.execution` package, to better conform with the terminology of the
Grap... | """GraphQL Subscription
The :mod:`graphql.subscription` package is responsible for subscribing to updates
on specific data.
.. deprecated:: 3.3
This package has been deprecated with its exported functions integrated into the
:mod:`graphql.execution` package, to better conform with the terminology of the
Grap... | mit | Python |
d4e3609cf6f749d6ac95bc8332844f63b61b41b1 | Remove extraneous vim editor configuration comments | varunarya10/oslo.serialization,openstack/oslo.serialization | oslo/__init__.py | oslo/__init__.py | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# 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... | apache-2.0 | Python |
fdeacd343246a1f78b5720af725c2f8c64c14f3a | Remove unused variable | lord63/zimuzu | zimuzu/cli.py | zimuzu/cli.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import json
import os
from os import path
import sys
import click
import requests
from zimuzu import __version__
def get_config():
conf_path = path.join(sys.path[0], 'zimuzu_config.json')
if not os.path.exists(conf_path):... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import json
import os
from os import path
import sys
import click
import requests
from zimuzu import __version__
def get_config():
conf_path = path.join(sys.path[0], 'zimuzu_config.json')
if not os.path.exists(conf_path):... | mit | Python |
7b5c666a87a8a85a7a435ebb872fd2ffdacd5c50 | add tinymce to news body | wheelcms/wheelcms_spokes,wheelcms/wheelcms_spokes | wheelcms_spokes/news.py | wheelcms_spokes/news.py | from django.db import models
from django import forms
from tinymce.widgets import TinyMCE
from wheelcms_axle.content import type_registry, Content
from wheelcms_axle.templates import template_registry
from wheelcms_axle.spoke import Spoke
from wheelcms_axle.forms import formfactory
class News(Content):
""" A ne... | from django.db import models
from wheelcms_axle.content import type_registry, Content
from wheelcms_axle.templates import template_registry
from wheelcms_axle.spoke import Spoke
class News(Content):
""" A news object """
intro = models.TextField(blank=False)
body = models.TextField(blank=False)
class New... | bsd-2-clause | Python |
84a19462cc1f960cd59d6da6adaa5472ee897ca5 | update to release 1.3.5 | edx/edx-proctoring,edx/edx-proctoring,edx/edx-proctoring | edx_proctoring/__init__.py | edx_proctoring/__init__.py | """
The exam proctoring subsystem for the Open edX platform.
"""
from __future__ import absolute_import
__version__ = '1.3.5'
default_app_config = 'edx_proctoring.apps.EdxProctoringConfig' # pylint: disable=invalid-name
| """
The exam proctoring subsystem for the Open edX platform.
"""
from __future__ import absolute_import
__version__ = '1.3.4'
default_app_config = 'edx_proctoring.apps.EdxProctoringConfig' # pylint: disable=invalid-name
| agpl-3.0 | Python |
b38566da39a584caeb2560c3b77b5ec98267263b | bump version | benoitc/dj-revproxy | revproxy/__init__.py | revproxy/__init__.py | # -*- coding: utf-8 -
#
# This file is part of dj-revproxy released under the MIT license.
# See the NOTICE for more information.
version_info = (0, 3, 0)
__version__ = ".".join(map(str, version_info))
try:
from revproxy.proxy import proxy_request, RevProxy, site_proxy
except ImportError:
import traceback
... | # -*- coding: utf-8 -
#
# This file is part of dj-revproxy released under the MIT license.
# See the NOTICE for more information.
version_info = (0, 2, 2)
__version__ = ".".join(map(str, version_info))
try:
from revproxy.proxy import proxy_request, RevProxy, site_proxy
except ImportError:
import traceback
... | mit | Python |
0bddf0ee65da8897afd96bd98eea581052733ad4 | add missing auth.py contents | sassoftware/rmake,sassoftware/rmake,sassoftware/rmake3,sassoftware/rmake3,sassoftware/rmake,sassoftware/rmake3 | rmake/server/auth.py | rmake/server/auth.py | import urllib2
import urllib
from conary.repository.netrepos import netauth
from rmake import errors
class AuthenticationManager(object):
def __init__(self, url, db):
self.pwCheckUrl = url
self.db = db
def authCheck(self, user, challenge):
isValid = False
if self.pwCheckUrl:
... | apache-2.0 | Python | |
5141b1b8f7e7bcb746a0110f6a6076b43d389f44 | Update settings.py | reellz/django-statify,reellz/django-statify | statify/settings.py | statify/settings.py | # -*- coding: utf-8 -*-
#
# Core imports
import os
# 3rd party imports
from django.conf import settings
STATIFY_BUILD_SETTINGS = getattr(settings, 'STATIFY_BUILD_SETTINGS', '')
STATIFY_USE_CMS = getattr(settings, 'STATIFY_USE_CMS', False)
STATIFY_IGNORE_MEDIA = getattr(settings, 'STATIFY_IGNORE_MEDIA', False)
STATI... | # -*- coding: utf-8 -*-
#
# Core imports
import os
# 3rd party imports
from django.conf import settings
STATIFY_BUILD_SETTINGS = getattr(settings, 'STATIFY_BUILD_SETTINGS', '')
STATIFY_USE_CMS = getattr(settings, 'STATIFY_USE_CMS', False)
STATIFY_IGNORE_MEDIA = getattr(settings, 'STATIFY_IGNORE_MEDIA', False)
STATI... | bsd-3-clause | Python |
47b97ea7860e7b50a490df6297a2107f3f79107a | Bring over sheer update. | kave/cfgov-refresh,kave/cfgov-refresh,kave/cfgov-refresh,kave/cfgov-refresh | _lib/wordpress_post_processor.py | _lib/wordpress_post_processor.py | import sys
import json
import requests
from string import Template
import dateutil.parser
def posts_at_url(url):
current_page = 1
max_page = sys.maxint
while current_page <= max_page:
resp = requests.get(url, params={'json':1,'page':current_page})
results = json.loads(resp.content) ... | import sys
import json
import requests
from string import Template
import dateutil.parser
def posts_at_url(url):
current_page = 1
max_page = sys.maxint
while current_page <= max_page:
resp = requests.get(url, params={'json':1,'page':current_page})
results = json.loads(resp.content) ... | cc0-1.0 | Python |
f3cd77896f15877a5f9ef822abebe6f46e88bd9b | Update __init__.py | eamigo86/graphene-django-extras | graphene_django_extras/__init__.py | graphene_django_extras/__init__.py | # -*- coding: utf-8 -*-
from graphene import get_version
from .fields import DjangoObjectField, DjangoListField, DjangoFilterListField, DjangoFilterPaginateListField, \
DjangoListObjectField
from .mutation import DjangoSerializerMutation
from .pagination import LimitOffsetGraphqlPagination, PageGraphqlPagina... | # -*- coding: utf-8 -*-
from graphene import get_version
from .fields import DjangoObjectField, DjangoListField, DjangoFilterListField, DjangoFilterPaginateListField, \
DjangoListObjectField
from .mutation import DjangoSerializerMutation
from .pagination import LimitOffsetGraphqlPagination, PageGraphqlPagina... | mit | Python |
937895b4193f9286ce4a1fc9c968376056ff76d1 | change author to origin, so we can see where replies are from | richteer/halconsole | halconsole.py | halconsole.py | from halibot import HalAgent, Message
from .console import Console
from threading import Thread
# Implements overrides the .send() for wiring to Halibot core
class NewConsole(Console):
def send(self, msg):
super().send(msg)
msg0 = Message(body=msg, author=self.agent.author)
self.agent.dispatch(msg0)
class Hal... | from halibot import HalAgent, Message
from .console import Console
from threading import Thread
# Implements overrides the .send() for wiring to Halibot core
class NewConsole(Console):
def send(self, msg):
super().send(msg)
msg0 = Message(body=msg, author=self.agent.author)
self.agent.dispatch(msg0)
class Hal... | bsd-3-clause | Python |
d961c644f74d83150e3f5a3ea9599af0d2b839ae | Build out init function of hash table class | jwarren116/data-structures-deux | hash_table.py | hash_table.py | #!/usr/bin/env python
'''Implementation of a simple hash table.
The table has `hash`, `get` and `set` methods.
The hash function uses a very basic hash algorithm to insert the value
into the table.
'''
class HashItem(object):
def __init__(self):
pass
class Hash(object):
def __init__(self, size=1024... | #!/usr/bin/env python
'''Implementation of a simple hash table.
The table has `hash`, `get` and `set` methods.
The hash function uses a very basic hash algorithm to insert the value
into the table.
'''
class HashItem(object):
def __init__(self):
pass
class Hash(object):
def __init__(self):
... | mit | Python |
1612a1f878c70591ae709a372d05e2ca7dfe46c9 | Use `pass_eval_context` instead of `evalcontextfilter` (deprecated as of Jinja 3.x) | homeworkprod/byceps,homeworkprod/byceps,homeworkprod/byceps | byceps/util/templatefilters.py | byceps/util/templatefilters.py | """
byceps.util.templatefilters
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Provide and register custom template filters.
:Copyright: 2006-2021 Jochen Kupperschmidt
:License: Revised BSD (see `LICENSE` file for details)
"""
from datetime import datetime
from flask import current_app
from flask_babel import format_decimal, gettext
... | """
byceps.util.templatefilters
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Provide and register custom template filters.
:Copyright: 2006-2021 Jochen Kupperschmidt
:License: Revised BSD (see `LICENSE` file for details)
"""
from datetime import datetime
from flask import current_app
from flask_babel import format_decimal, gettext
... | bsd-3-clause | Python |
03be4f9e1b34db33695e5a00f6ce87aa46b8fdca | Change the load beacon slightly to normalize the data | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | salt/beacons/load.py | salt/beacons/load.py | # -*- coding: utf-8 -*-
'''
Beacon to emit system load averages
'''
# Import Python libs
from __future__ import absolute_import
import logging
import os
# Import Salt libs
import salt.utils
log = logging.getLogger(__name__)
__virtualname__ = 'load'
def __virtual__():
if salt.utils.is_windows():
return... | # -*- coding: utf-8 -*-
'''
Beacon to emit system load averages
'''
# Import Python libs
from __future__ import absolute_import
import logging
import os
# Import Salt libs
import salt.utils
log = logging.getLogger(__name__)
__virtualname__ = 'load'
def __virtual__():
if salt.utils.is_windows():
return... | apache-2.0 | Python |
deac1f12f9d21f3c2564232eb739ecfc80fdce2a | Stop reading if you reach the tests in the file also | ClashTheBunny/ankiCards,ClashTheBunny/ankiCards,ClashTheBunny/ankiCards | parseBGoffice.py | parseBGoffice.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import re
def parse(dat):
endingsRE = re.compile("^Окончания:$")
formiRE = re.compile("^Форми:$")
testRE = re.compile("^Тест:$")
blankRE = re.compile("^$")
desc = ( os.path.split(dat)[0], u'description.dat')
datfh = open(dat, 'rb')
de... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import re
def parse(dat):
endingsRE = re.compile("^Окончания:$")
formiRE = re.compile("^Форми:$")
blankRE = re.compile("^$")
desc = ( os.path.split(dat)[0], u'description.dat')
datfh = open(dat, 'rb')
descfh = open(os.path.join(*desc), 'r... | apache-2.0 | Python |
b8b5606c0e1c05d0635dad5d80b34862a09655cc | remove dead code | nandub/pkgbuild-introspection,falconindy/pkgbuild-introspection,mikkeloscar/pkgbuild-introspection,nandub/pkgbuild-introspection,mikkeloscar/pkgbuild-introspection,falconindy/pkgbuild-introspection | parse_aurinfo.py | parse_aurinfo.py | #!/usr/bin/env python
from copy import deepcopy
import pprint
class AurInfo(object):
def __init__(self):
self._pkgbase = {}
self._packages = {}
def GetPackageNames(self):
return self._packages.keys()
def GetMergedPackage(self, pkgname):
package = deepcopy(self._pkgbase)
... | #!/usr/bin/env python
from copy import deepcopy
import pprint
class AurInfo(object):
def __init__(self):
self._pkgbase = {}
self._packages = {}
def GetPackageNames(self):
return self._packages.keys()
def GetMergedPackage(self, pkgname):
package = deepcopy(self._pkgbase)
... | mit | Python |
e7c7956370b0c38b16b49b49cdd3bab2582573cc | Add docstrings to rate.py | enricobacis/playscraper | virustotal/rate.py | virustotal/rate.py | from contextlib import contextmanager
from threading import Timer, Semaphore
from functools import wraps
def ratelimit(limit, every):
"""Decorator to limit invocations. *limit* calls per *every* seconds."""
def limitdecorator(fn):
semaphore = Semaphore(limit)
@wraps(fn)
def wrapper(*arg... | from contextlib import contextmanager
from threading import Timer, Semaphore
from functools import wraps
def ratelimit(limit, every):
def limitdecorator(fn):
semaphore = Semaphore(limit)
@wraps(fn)
def wrapper(*args, **kwargs):
semaphore.acquire()
result = fn(*args, ... | mit | Python |
5934a12bd2b481b4d78931824fae3d8e85d29a43 | refactor get_device | aradford123/cisco-prime-infrastructure-examples | auto_templates/get_devices.py | auto_templates/get_devices.py | #!/usr/bin/env python
import requests
import json
from argparse import ArgumentParser
requests.packages.urllib3.disable_warnings()
from pi_config import PI, USER, PASSWORD
BASE="https://%s:%s@%s/webacs/api/v1/" %(USER,PASSWORD,PI)
def all_devices():
print "Getting all devices"
print "{0:6s} {1:10s}".format(... | #!/usr/bin/env python
import requests
import json
requests.packages.urllib3.disable_warnings()
from pi_config import PI, USER, PASSWORD
BASE="https://%s:%s@%s/webacs/api/v1/" %(USER,PASSWORD,PI)
result = requests.get(BASE + "data/Devices.json", verify=False)
result.raise_for_status()
print json.dumps(result.json(),... | apache-2.0 | Python |
a60bfe605b7c463e55aacae9b2eaf2a310fdf28a | Modify http runner for event output | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | salt/runners/http.py | salt/runners/http.py | # -*- coding: utf-8 -*-
'''
Module for making various web calls. Primarily designed for webhooks and the
like, but also useful for basic http testing.
'''
# Import salt libs
import salt.output
import salt.utils.http
def query(url, output=True, **kwargs):
'''
Query a resource, and decode the return data
... | # -*- coding: utf-8 -*-
'''
Module for making various web calls. Primarily designed for webhooks and the
like, but also useful for basic http testing.
'''
# Import salt libs
import salt.output
import salt.utils.http
def query(url, output=True, **kwargs):
'''
Query a resource, and decode the return data
... | apache-2.0 | Python |
e1674fa0a88506381a47b4f4c4cda19cc23502ca | fix version | undertherain/vsmlib | vsmlib/_version.py | vsmlib/_version.py | """Version of vsmlib package."""
VERSION = "0.1.5"
| """Version of system_query package."""
VERSION = "0.1.5"
| apache-2.0 | Python |
6829eff4321a113515d3c3b5ab3afdb22bf1a545 | Fix backward compatibility | thombashi/subprocrunner,thombashi/subprocrunner | subprocrunner/__init__.py | subprocrunner/__init__.py | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <gogogo.vm@gmail.com>
"""
from __future__ import absolute_import
from ._error import (
InvalidCommandError,
CommandNotFoundError,
)
from ._logger import (
logger,
set_logger,
set_log_level,
)
from ._which import Which
from ._subprocess_runne... | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <gogogo.vm@gmail.com>
"""
from __future__ import absolute_import
from ._error import (
InvalidCommandError,
CommandNotFoundError,
)
from ._logger import (
set_logger,
set_log_level,
)
from ._which import Which
from ._subprocess_runner import Sub... | mit | Python |
d5a99319b0c9f4baf8f318ef5c8beaceefa134a0 | remove unused logger import | ygol/odoo,ygol/odoo,ygol/odoo,ygol/odoo,ygol/odoo,ygol/odoo,ygol/odoo | addons/stock/controllers/main.py | addons/stock/controllers/main.py | # -*- coding: utf-8 -*-
from odoo import http
from odoo.http import request
class BarcodeController(http.Controller):
@http.route(['/stock/barcode/'], type='http', auth='user')
def a(self, debug=False, **k):
if not request.session.uid:
return http.local_redirect('/web/login?redirect=/stoc... | # -*- coding: utf-8 -*-
import logging
from odoo import http
from odoo.http import request
_logger = logging.getLogger(__name__)
class BarcodeController(http.Controller):
@http.route(['/stock/barcode/'], type='http', auth='user')
def a(self, debug=False, **k):
if not request.session.uid:
... | agpl-3.0 | Python |
0b41bdf6897bb070fc3d90aa5d90228e744dee60 | Remove manager repr (user should not need to view contents) | mjm159/sunpy,dpshelio/sunpy,dpshelio/sunpy,Alex-Ian-Hamilton/sunpy,dpshelio/sunpy,Alex-Ian-Hamilton/sunpy,Alex-Ian-Hamilton/sunpy,mjm159/sunpy | sunpy/util/map_manager.py | sunpy/util/map_manager.py | import weakref
import sunpy
class MapManager(weakref.WeakSet):
"""Weak referenced set of maps created using functions decorated by manage_maps."""
pass
def manage_maps(fn):
"""Maps returned by functions decorated with manage_maps (eg. sunpy.make_map)
will be registered in the sunpy.map_manager list.""... | import weakref
import sunpy
class MapManager(weakref.WeakSet):
"""Weak referenced set of maps created using functions decorated by manage_maps."""
def __repr__(self):
return str(self.data)
def manage_maps(fn):
"""Maps returned by functions decorated with manage_maps (eg. sunpy.make_map)
will ... | bsd-2-clause | Python |
c31fcd8ac5a2c59dd88879288676016ffeea9a4f | Fix POST response code API handling (#32) | toidi/hadoop-yarn-api-python-client | yarn_api_client/base.py | yarn_api_client/base.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import logging
import requests
from .errors import APIError, ConfigurationError
class Response(object):
def __init__(self, response):
self.data = response.json()
class BaseYarnAPI(object):
__logger = None
response_class = Response... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import logging
import requests
from .errors import APIError, ConfigurationError
class Response(object):
def __init__(self, response):
self.data = response.json()
class BaseYarnAPI(object):
__logger = None
response_class = Response... | bsd-3-clause | Python |
6c01ceb8d0aefd68d3e9bc63a0f0b84edfd4e808 | Bump version | howethomas/synapse,rzr/synapse,howethomas/synapse,illicitonion/synapse,matrix-org/synapse,rzr/synapse,iot-factory/synapse,rzr/synapse,illicitonion/synapse,iot-factory/synapse,illicitonion/synapse,iot-factory/synapse,TribeMedia/synapse,howethomas/synapse,matrix-org/synapse,rzr/synapse,matrix-org/synapse,matrix-org/synap... | synapse/__init__.py | synapse/__init__.py | # -*- coding: utf-8 -*-
# Copyright 2014, 2015 OpenMarket Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | # -*- coding: utf-8 -*-
# Copyright 2014, 2015 OpenMarket Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 | Python |
6cfd5e604c557b9953a27c60e66aaeb44094ff18 | Bump version to 2.7.0 | dmulholland/syntex,dmulholland/syntex | syntext/__init__.py | syntext/__init__.py | # ---------------------------------------------------------
# Syntext: a lightweight, markdownish markup language.
# ---------------------------------------------------------
# Package version number.
__version__ = "2.7.0"
from .interface import render
from .interface import main
from .utils import SyntextError
from... | # ---------------------------------------------------------
# Syntext: a lightweight, markdownish markup language.
# ---------------------------------------------------------
# Package version number.
__version__ = "2.6.2"
from .interface import render
from .interface import main
from .utils import SyntextError
from... | unlicense | Python |
5cb5b2311405afe02ba0c2cb732039ca344d8f3c | stop it, pycharm | PeteAndersen/swarfarm,porksmash/swarfarm,porksmash/swarfarm,porksmash/swarfarm,PeteAndersen/swarfarm,PeteAndersen/swarfarm,PeteAndersen/swarfarm,porksmash/swarfarm | swarfarm/settings_test.py | swarfarm/settings_test.py | from .settings import *
CELERY_TASK_ALWAYS_EAGER = True
| CELERY_TASK_ALWAYS_EAGER = True
| apache-2.0 | Python |
96a4e5d81f889047199a3721e107b5e954933752 | Fix infinite redirect loop when hitting /v1/ | Plexxi/st2,emedvedev/st2,Plexxi/st2,Plexxi/st2,pinterb/st2,Plexxi/st2,alfasin/st2,lakshmi-kannan/st2,dennybaa/st2,nzlosh/st2,dennybaa/st2,armab/st2,nzlosh/st2,nzlosh/st2,pixelrebel/st2,alfasin/st2,StackStorm/st2,jtopjian/st2,tonybaloney/st2,peak6/st2,pixelrebel/st2,emedvedev/st2,dennybaa/st2,grengojbo/st2,Itxaka/st2,St... | st2api/st2api/controllers/v1/root.py | st2api/st2api/controllers/v1/root.py | # Licensed to the StackStorm, Inc ('StackStorm') 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 "License"); you may not use th... | # Licensed to the StackStorm, Inc ('StackStorm') 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 "License"); you may not use th... | apache-2.0 | Python |
c26a88630a039a99c5afc2316b6276345f22812b | refactor test_sampling.py | hvy/chainer,chainer/chainer,chainer/chainer,chainer/chainer,chainer/chainer,hvy/chainer,hvy/chainer,niboshi/chainer,niboshi/chainer,niboshi/chainer,niboshi/chainer,hvy/chainer,pfnet/chainer | tests/chainer_tests/initializer_tests/test_sampling.py | tests/chainer_tests/initializer_tests/test_sampling.py | import unittest
from chainer.backends import cuda
from chainer import initializers
from chainer import testing
from chainer.testing import attr
import numpy
@testing.parameterize(*testing.product({
'target': [
initializers.UpsamplingDeconvFilter,
initializers.DownsamplingConvFilter,
],
'i... | import unittest
from chainer.backends import cuda
from chainer import initializers
from chainer import testing
from chainer.testing import attr
import numpy
@testing.parameterize(*testing.product({
'target': [
initializers.UpsamplingDeconvFilter,
initializers.DownsamplingConvFilter,
],
'i... | mit | Python |
d9e24881c78c7c26ad853c9e0bf88eaf4f8ab6b9 | update settings.py | daschwa/daschwa.github.io,daschwa/daschwa.github.io,daschwa/daschwa.github.io | webapp/settings.py | webapp/settings.py | # -*- coding: utf-8 -*-
# Configure flask settings to be hosted by github if desired.
# If you do not want this capability, simply comment out the repective lines.
# python 3 import support
from __future__ import absolute_import
import os
REPO_NAME = "adamschwartz.io" # Used for FREEZER_BASE_URL
DEBUG = True
# As... | # -*- coding: utf-8 -*-
# Configure flask settings to be hosted by github if desired.
# If you do not want this capability, simply comment out the repective lines.
# python 3 import support
from __future__ import absolute_import
import os
REPO_NAME = "adamschwartz.io" # Used for FREEZER_BASE_URL
DEBUG = True
# As... | mit | Python |
1a75cfa41744369a8aecd396b9c7aa6a638a4448 | Add __all__ to init.py | aws-quickstart/taskcat,aws-quickstart/taskcat,aws-quickstart/taskcat | taskcat/__init__.py | taskcat/__init__.py | """
taskcat python module
"""
from ._cfn.stack import Stack # noqa: F401
from ._cfn.template import Template # noqa: F401
from ._cli import main # noqa: F401
from ._config import Config # noqa: F401
__all__ = ["Stack", "Template", "Config", "main"]
| """
taskcat python module
"""
from ._cfn.stack import Stack # noqa: F401
from ._cfn.template import Template # noqa: F401
from ._cli import main # noqa: F401
from ._config import Config # noqa: F401
| apache-2.0 | Python |
3b39d5375ebe5b1524cb67b879b2f785624e8cdb | Bump to 0.8.1 (new version scheme.) | andrelucas/hsync | hsync/_version.py | hsync/_version.py |
__version__ = '0.8.1'
|
__version__ = '0.8'
| bsd-3-clause | Python |
75e86f349bbf3c0bad7d84dea05ab3b2519423d8 | Add tests to exercise lookup and country suffix | mapzen/vector-datasource,mapzen/vector-datasource,mapzen/vector-datasource | test/418-wof-l10n_name.py | test/418-wof-l10n_name.py | # Hollywood (wof neighbourhood)
# https://whosonfirst.mapzen.com/data/858/260/37/85826037.geojson
assert_has_feature(
16, 11227, 26157, 'places',
{ 'id': 85826037, 'kind': 'neighbourhood',
'source': "whosonfirst.mapzen.com",
'name': 'Hollywood',
'name:kor': '\xed\x97\x90\xeb\xa6\xac\xec\x9a\xb... | # Hollywood (wof neighbourhood)
# https://whosonfirst.mapzen.com/data/858/260/37/85826037.geojson
assert_has_feature(
16, 11227, 26157, 'places',
{ 'id': 85826037, 'kind': 'neighbourhood',
'source': "whosonfirst.mapzen.com",
'name': 'Hollywood',
'name:kor': '\xed\x97\x90\xeb\xa6\xac\xec\x9a\xb... | mit | Python |
6d382b071de00502ed6cba07f8751a1fc87798ad | Upgrade cli_piv/test_misc | Yubico/yubikey-manager,Yubico/yubikey-manager | test/on_yubikey/cli_piv/test_misc.py | test/on_yubikey/cli_piv/test_misc.py | import unittest
from ..util import cli_test_suite
from .util import DEFAULT_MANAGEMENT_KEY
@cli_test_suite
def additional_tests(ykman_cli):
class Misc(unittest.TestCase):
def test_info(self):
output = ykman_cli('piv', 'info')
self.assertIn('PIV version:', output)
def tes... | from ..util import ykman_cli
from .util import PivTestCase, DEFAULT_MANAGEMENT_KEY
class Misc(PivTestCase):
def test_info(self):
output = ykman_cli('piv', 'info')
self.assertIn('PIV version:', output)
def test_reset(self):
output = ykman_cli('piv', 'reset', '-f')
self.assertI... | bsd-2-clause | Python |
f4207560f29ef2041597dabd1de2a5876d7439ba | Update libchromiumcontent: fix linking error on Linux | tonyganch/electron,shiftkey/electron,Gerhut/electron,tonyganch/electron,Gerhut/electron,brave/electron,twolfson/electron,aliib/electron,biblerule/UMCTelnetHub,bpasero/electron,aichingm/electron,noikiy/electron,kokdemo/electron,gerhardberger/electron,MaxWhere/electron,minggo/electron,thomsonreuters/electron,Floato/elect... | script/lib/config.py | script/lib/config.py | #!/usr/bin/env python
import errno
import os
import platform
import sys
BASE_URL = os.getenv('LIBCHROMIUMCONTENT_MIRROR') or \
'https://s3.amazonaws.com/github-janky-artifacts/libchromiumcontent'
LIBCHROMIUMCONTENT_COMMIT = 'f5ff2ac24616e5e059502b98b64f99922c383f53'
PLATFORM = {
'cygwin': 'win32',
'darwin':... | #!/usr/bin/env python
import errno
import os
import platform
import sys
BASE_URL = os.getenv('LIBCHROMIUMCONTENT_MIRROR') or \
'https://s3.amazonaws.com/github-janky-artifacts/libchromiumcontent'
LIBCHROMIUMCONTENT_COMMIT = '0b5aa7b6ca450681c58087e14f72238aab5ab823'
PLATFORM = {
'cygwin': 'win32',
'darwin':... | mit | Python |
7edb54ba51b556c515ef57b0a986b67a6d60d16e | update home.py: add content | manducku/blogram,manducku/blogram,manducku/blogram | blogram/blogram/views/home.py | blogram/blogram/views/home.py | from django.views.generic import TemplateView
class HomeView(TemplateView):
template_name = "home.html"
| from django.views.generic import TemplateView
class HomeView(TemplateView):
template_name="home.html"
| mit | Python |
ee6d71a129766c7018c462396999d6ee9b1439ff | Fix broken import | akatrevorjay/slask | plugins/sensu.py | plugins/sensu.py | '''!stash [client-name] [reason]'''
import urllib2
import json
import os
import time
import re
DEFAULT_EXPIRE = int(os.getenv('SENSU_STASH_EXPIRE', 3600*24)) # 24 hr, unit: seconds
SENSU_API_BASE_URL = os.getenv('SENSU_API_BASE_URL', 'http://sensu.vkportal.com:4567')
STASHES_URL = '{}/stashes'.format(SENSU_API_BASE... | '''!stash [client-name] [reason]'''
import urllib, urllib2
import json
import os
import time
DEFAULT_EXPIRE = int(os.getenv('SENSU_STASH_EXPIRE', 3600*24)) # 24 hr, unit: seconds
SENSU_API_BASE_URL = os.getenv('SENSU_API_BASE_URL', 'http://sensu.vkportal.com:4567')
STASHES_URL = '{}/stashes'.format(SENSU_API_BASE_U... | mit | Python |
94764486ef6484a430b1a62026fef28ad5d2c1c7 | Simplify code - used util.uuid(). | wilfriedE/gae-init,NeftaliYagua/gae-init,vanessa-bell/hd-kiosk-v2,gae-init/gae-init,lovesoft/gae-init,mdxs/gae-init,terradigital/gae-init,jakedotio/gae-init,mdxs/gae-init,JoeyCodinja/INFO3180LAB3,lipis/gae-init,michals/hurry-app,gae-init/gae-init-upload,gae-init/phonebook,michals/hurry-app,gae-init/gae-init-debug,gmist... | main/model.py | main/model.py | # -*- coding: utf-8 -*-
from google.appengine.ext import ndb
from util import uuid
import os
import modelx
# The timestamp of the currently deployed version
TIMESTAMP = long(os.environ.get('CURRENT_VERSION_ID').split('.')[1]) >> 28
class Base(ndb.Model, modelx.BaseX):
created = ndb.DateTimeProperty(auto_now_add=... | # -*- coding: utf-8 -*-
from google.appengine.ext import ndb
from uuid import uuid4
import os
import modelx
# The timestamp of the currently deployed version
TIMESTAMP = long(os.environ.get('CURRENT_VERSION_ID').split('.')[1]) >> 28
class Base(ndb.Model, modelx.BaseX):
created = ndb.DateTimeProperty(auto_now_add... | mit | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.