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
ad2992aa82cbf81cd41b311c6462e116e413206c
Replace mentions of msa by cbsa
scities-data/metro-atlas_2014
bin/crosswalks/cbsa_blockgroup.py
bin/crosswalks/cbsa_blockgroup.py
"""cbsa_blockgroup.py Extract the crosswalk between cbsa and blockgroups """ import os import csv import fiona import collections # # Read preliminary data # ## MSA to counties crosswalk county_to_cbsa = {} with open('data/crosswalks/cbsa_county.txt', 'r') as source: reader = csv.reader(source, delimiter='\t'...
"""cbsa_blockgroup.py Extract the crosswalk between cbsa and blockgroups """ import os import csv import fiona import collections # # Read preliminary data # ## MSA to counties crosswalk county_to_msa = {} with open('data/crosswalks/cbsa_county.txt', 'r') as source: reader = csv.reader(source, delimiter='\t')...
bsd-2-clause
Python
c0300fb1f62bfe8ef661c208229456bc4b380f1a
Add generate_if and generate_assign
burz/simcom,burz/simcom
src/intermediate_code_generator.py
src/intermediate_code_generator.py
import symbol_table class Assign(object): def __init__(self, left_value, right_value): self.left_value = left_value self.right_value = right_value class Binary(object): def __init__(self, operation, left_value, right_value): self.operation = operation self.left_value = left_value self.right_va...
import symbol_table class Assign(object): def __init__(self, left_value, right_value): self.left_value = left_value self.right_value = right_value class Binary(object): def __init__(self, operation, left_value, right_value): self.operation = operation self.left_value = left_value self.right_va...
mit
Python
8ddbd0b39687f46637041848ab7190bcefd57b68
Use set_request_property instead of subscriber to improve performance
niallo/pyramid_mongodb
pyramid_mongodb/__init__.py
pyramid_mongodb/__init__.py
""" simplified mongodb integration 1. Add two lines to app/__init__.py ( the import and the call to initialize_mongo_db ) import python_mongodb def main(global_config, **settings): ## ... # Initialize mongodb , which is a subscriber python_mongodb.initialize_mongo_db( config , settin...
""" simplified mongodb integration 1. Add two lines to app/__init__.py ( the import and the call to initialize_mongo_db ) import python_mongodb def main(global_config, **settings): ## ... # Initialize mongodb , which is a subscriber python_mongodb.initialize_mongo_db( config , settin...
mit
Python
4259a593c43a95478c27e74ef94433eda8f6e5f3
Fix typo
orbingol/NURBS-Python,orbingol/NURBS-Python
geomdl/convert.py
geomdl/convert.py
""" .. module:: convert :platform: Unix, Windows :synopsis: Provides BSpline to NURBS conversion functionality .. moduleauthor:: Onur Rauf Bingol <orbingol@gmail.com> """ from . import BSpline from . import NURBS def bspline_to_nurbs(obj): """ Converts B-Spline parametric shapes to NURBS parametric sha...
""" .. module:: convert :platform: Unix, Windows :synopsis: Provides BSpline to NURBS conversion functionality .. moduleauthor:: Onur Rauf Bingol <orbingol@gmail.com> """ from . import BSpline from . import NURBS def bspline_to_nurbs(obj): """ Converts B-Spline parametric shapes to NURBS parametric sha...
mit
Python
ed4ccc9ef1e1fdd883ad7285046c5e0906a0c85f
add Command
spacemeowx2/remote-web,spacemeowx2/remote-web,spacemeowx2/remote-web,spacemeowx2/remote-web
client/xxx.py
client/xxx.py
import websocket import json class Command: def __init__(self): self.commands = [] def add(self,command): self.commands.append(command) def dumps(self): s = [] for i in range(len(self.commands)): s.append({ 'cmdID': i, '...
import websocket import json class SurppotCommand: def __init__(self): self.commands = [] self.nextID = 0 def add(self, typeName, command): return self.commands def dumps(): return 1 s = '{"TypeID":123}' z = json.loads(s) x = json.dumps(z) print z print x
mit
Python
99b6c475a8579b7266e1b24774353f5dcfee25f4
align examples with recent refactoring
Qbicz/multi-secret-sharing,Qbicz/multi-secret-sharing,Qbicz/multi-secret-sharing
python/example-low-level.py
python/example-low-level.py
#!/usr/bin/env python3 import multisecret.MultiSecretRoyAdhikari import multisecret.byteHelper as bytehelper import multisecret.MultiSecretCommon as common def main(): """ This example shows low-level functions for splitting and combining secrets with multi-secret sharing scheme by Roy & Adhikari....
#!/usr/bin/env python3 import multisecret.MultiSecretRoyAdhikari import multisecret.byteHelper as bytehelper import multisecret.MultiSecretCommon as common def main(): """ This example shows low-level functions for splitting and combining secrets with multi-secret sharing scheme by Roy & Adhikari....
mit
Python
d0b481993063dad121866be08d3e4a4433f1352d
Update tests/testUtil.py
oduwsdl/ipwb,oduwsdl/ipwb,oduwsdl/ipwb,oduwsdl/ipwb
tests/testUtil.py
tests/testUtil.py
import os import random import string import re import tempfile from time import sleep from ipwb import replay from ipwb import indexer from ipwb import __file__ as moduleLocation from multiprocessing import Process from pathlib import Path p = Process() def createUniqueWARC(): lines = [] warcInFilename =...
import os import random import string import re import tempfile from time import sleep from ipwb import replay from ipwb import indexer from ipwb import __file__ as moduleLocation from multiprocessing import Process from pathlib import Path p = Process() def createUniqueWARC(): lines = [] warcInFilename =...
mit
Python
9e097a1d1d2a401af5e2a88181ca544d9f60059f
Fix items_count
scrapinghub/exporters
exporters/writers/console_writer.py
exporters/writers/console_writer.py
import json from exporters.writers.base_writer import BaseWriter, ItemsLimitReached class ConsoleWriter(BaseWriter): """ It is just a writer with testing purposes. It prints every item in console. """ def __init__(self, options): super(ConsoleWriter, self).__init__(options) self.logg...
import json from exporters.writers.base_writer import BaseWriter, ItemsLimitReached class ConsoleWriter(BaseWriter): """ It is just a writer with testing purposes. It prints every item in console. """ def __init__(self, options): super(ConsoleWriter, self).__init__(options) self.logg...
bsd-3-clause
Python
e66ca07fb54b131a5cccd833761d26ef42dedbe2
update according PEP 8 rules
rafael-valera/btceconnect
btceconnect/tests/test_account.py
btceconnect/tests/test_account.py
import unittest from btceconnect.account import Account class TestAccount(unittest.TestCase): def setUp(self): self.get_info_response = { "success": 1, "return": { "funds": { "usd": 325, "btc": 23.998, "lt...
import unittest from btceconnect.account import Account class TestAccount(unittest.TestCase): def setUp(self): self.get_info_response = { "success": 1, "return": { "funds": { "usd": 325, "btc": 23.998, "lt...
mit
Python
e9489f0d5a43b5e451b1adaaca949863273b63d4
Fix merge conflict
thecarebot/carebot,thecarebot/carebot,thecarebot/carebot
tests/test_rss.py
tests/test_rss.py
#!/usr/bin/env python try: import unittest2 as unittest except ImportError: import unittest import datetime from util.config import Config from scrapers.rss import RSSScraper class TestRSS(unittest.TestCase): def test_parse(self): fake_source = { 'team': "carebot", 'type'...
#!/usr/bin/env python try: import unittest2 as unittest except ImportError: import unittest import datetime from util.config import Config from scrapers.rss import RSSScraper class TestRSS(unittest.TestCase): def test_parse(self): class FakeSource: team = "carebot" type =...
mit
Python
a74aec075c43f46666a5aa0ba9cf0f529c958b49
Use less verbosity.
synapticarbors/staged-recipes,johannesring/staged-recipes,basnijholt/staged-recipes,gqmelo/staged-recipes,mariusvniekerk/staged-recipes,khallock/staged-recipes,shadowwalkersb/staged-recipes,rvalieris/staged-recipes,richardotis/staged-recipes,barkls/staged-recipes,dschreij/staged-recipes,khallock/staged-recipes,mcernak/...
recipes/nibabel/run_test.py
recipes/nibabel/run_test.py
import nose import sys import re verbosity = 1 splatform = sys.platform if splatform.startswith('win32'): # Installation of data files for script testing a bit rickety on Appveyor: config = nose.config.Config(verbosity=verbosity, exclude=[re.compile("test_scripts"), ...
import nose import sys import re splatform = sys.platform if splatform.startswith('win32'): # Installation of data files for script testing a bit rickety on Appveyor: config = nose.config.Config(verbosity=2, exclude=[re.compile("test_scripts"), ...
bsd-3-clause
Python
f7a748d89cdb8d47ea3be25e867f437c85efdf0f
Bump version
markstory/lint-review,markstory/lint-review,markstory/lint-review
lintreview/__init__.py
lintreview/__init__.py
__version__ = '2.6.1'
__version__ = '2.6.0'
mit
Python
c76d59edf6eafccbdf199667a6793de2b311edee
Update ipc_lista1.1.py
any1m1c/ipc20161
lista1/ipc_lista1.1.py
lista1/ipc_lista1.1.py
#ipc_lista1.1 #Professor: Jucimar Junior #Any Mendes Carvalho - 16153100 # # # # #Faça um Programa que mostre a mensagem "Alo mundo" na tela. print("Hello World")
#ipc_lista1.1 #Professor: Jucimar Junior #Any Mendes Carvalho - 1615310 # # # # #Faça um Programa que mostre a mensagem "Alo mundo" na tela. print("Hello World")
apache-2.0
Python
021b9e233bb596d6dbc51e04cc9b0888c5cfb3fc
Update ipc_lista1.6.py
any1m1c/ipc20161
lista1/ipc_lista1.6.py
lista1/ipc_lista1.6.py
#ipc_lista1.6 #Professor: Jucimar Junior #Any Mendes Carvalho - # # # # #Faça um programa que peça o raio de um círculo, calcule e mostre sua área raio = 0 area = 0 raio = input("Entre com o valor do raio: ") area =
#ipc_lista1.6 #Professor: Jucimar Junior #Any Mendes Carvalho - # # # # #Faça um programa que peça o raio de um círculo, calcule e mostre sua área raio = 0 area = 0 raio = input("Entre com o valor do raio: ") area
apache-2.0
Python
0c0829f72b57b43e8312d84667a9b050923bf3dc
Update ipc_lista1.6.py
any1m1c/ipc20161
lista1/ipc_lista1.6.py
lista1/ipc_lista1.6.py
#ipc_lista1.6 #Professor: Jucimar Junior #Any Mendes Carvalho - # # # # #Faça um programa que peça o raio de um círculo, calcule e mostre sua área
#ipc_lista1.6 #Professor: Jucimar Junior #Any Mendes Carvalho - # # # # #Faça um programa que peça o raio de um círculo, calcule e mostre sua
apache-2.0
Python
f9f41e8e5055dc3d2cbf609e52275cd794cd0f02
Update ipc_lista1.8.py
any1m1c/ipc20161
lista1/ipc_lista1.8.py
lista1/ipc_lista1.8.py
#ipc_lista1.8 #Professor: Jucimar Junior #Any Mendes Carvalho - 1615310044 # # # # #Faça um programa que pergunte quanto você ganha por hora e o número de horas trabalhadas no mês. #Calcule e mostre o total do seu salário no referido mês. QntHora = input("Entre com o valor de seu rendimento por hora: ") hT = input("E...
#ipc_lista1.8 #Professor: Jucimar Junior #Any Mendes Carvalho - 1615310044 # # # # #Faça um programa que pergunte quanto você ganha por hora e o número de horas trabalhadas no mês. #Calcule e mostre o total do seu salário no referido mês. QntHora = input("Entre com o valor de seu rendimento por hora: ") hT = input("E...
apache-2.0
Python
8d54aebfc651f99480c0695edeac76cca9f59bbd
Swap sheets
vprnet/live-from-the-fort,vprnet/live-from-the-fort,vprnet/live-from-the-fort
app/sheet.py
app/sheet.py
import json import gspread from oauth2client.client import SignedJwtAssertionCredentials def get_google_sheet(): json_key = json.load(open('access.json')) scope = ['https://spreadsheets.google.com/feeds'] credentials = SignedJwtAssertionCredentials(json_key["client_email"], json_key['private_key'], scope) ...
import json import gspread from oauth2client.client import SignedJwtAssertionCredentials def get_google_sheet(): json_key = json.load(open('access.json')) scope = ['https://spreadsheets.google.com/feeds'] credentials = SignedJwtAssertionCredentials(json_key["client_email"], json_key['private_key'], scope) ...
apache-2.0
Python
a3769d4ef3b8ba76d07bd6159325b087bc2e943a
fix flake8 errors
simphony/simphony-paraview,simphony/simphony-paraview
simphony_paraview/core/tests/test_set_input.py
simphony_paraview/core/tests/test_set_input.py
import unittest from hypothesis import given from hypothesis.strategies import sampled_from from mock import patch, Mock from simphony_paraview.core.compatibility import set_input class TestSetInput(unittest.TestCase): @given(sampled_from(('5.8.0', '6.1.0'))) def test_set_input_with_valid_vtk(self, version...
import unittest from hypothesis import given from hypothesis.strategies import sampled_from from mock import patch, Mock from simphony_paraview.core.compatibility import set_input class TestSetInput(unittest.TestCase): @given(sampled_from(('5.8.0', '6.1.0'))) def test_set_input_with_valid_vtk(self, version)...
bsd-2-clause
Python
107a51dbd019550d1ae1c3ac32405c90f32d2ef6
Remove last slash in BASE_URL
BamX/dota2-matches-statistic,BamX/dota2-matches-statistic,BamX/dota2-matches-statistic
app/views.py
app/views.py
from flask import jsonify, abort, request, make_response, render_template, redirect from app import app, auth, db, models from sqlalchemy.orm import aliased BASE_URL = "http://www.dotabuff.com" def allTeams(fameous): query = models.Team.query if fameous: query = query.filter(models.Team.imageUrl != No...
from flask import jsonify, abort, request, make_response, render_template, redirect from app import app, auth, db, models from sqlalchemy.orm import aliased BASE_URL = "http://www.dotabuff.com/" def allTeams(fameous): query = models.Team.query if fameous: query = query.filter(models.Team.imageUrl != N...
mit
Python
9250d1c5ff63779aedea0c52535bfa1bde0b7ac3
Make high level interface use close on exec as well
wdv4758h/butter,dasSOZO/python-butter
butter/fanotify.py
butter/fanotify.py
#!/usr/bin/env python """fanotify: wrapper around the fanotify family of syscalls for watching for file modifcation""" from .utils import get_buffered_length as _get_buffered_length from .utils import Eventlike as _Eventlike from .utils import CLOEXEC_DEFAULT as _CLOEXEC_DEFAULT from os import O_RDONLY, O_WRONLY, O_R...
#!/usr/bin/env python """fanotify: wrapper around the fanotify family of syscalls for watching for file modifcation""" from .utils import get_buffered_length as _get_buffered_length from .utils import Eventlike as _Eventlike from os import O_RDONLY, O_WRONLY, O_RDWR from os import read as _read from ._fanotify impor...
bsd-3-clause
Python
56e43f0e4a56a28fb77ae7ca5f052852dc3446fb
split sentences with two newlines
ilius/hazm,sobhe/hazm,sobhe/hazm,hesamd/hazm,sobhe/hazm
hazm/SentenceTokenizer.py
hazm/SentenceTokenizer.py
#coding=utf8 from __future__ import unicode_literals import re from nltk.tokenize.api import TokenizerI class SentenceTokenizer(TokenizerI): def __init__(self): self.pattern = re.compile(r'([!\.\?⸮؟]+)[ \n]+') def tokenize(self, text): """ >>> tokenizer.tokenize('جدا کردن ساده است. تقریبا البته!') ['جدا ک...
#coding=utf8 from __future__ import unicode_literals import re from nltk.tokenize.api import TokenizerI class SentenceTokenizer(TokenizerI): def __init__(self): self.pattern = re.compile(r'([!\.\?⸮؟]+)[ \n]+') def tokenize(self, text): """ >>> tokenizer.tokenize('جدا کردن ساده است. تقریبا البته!') ['جدا ک...
mit
Python
3cacad624dd27401cd0305be0c0806ec120a9750
Update test_ai_agent.py
qsheeeeen/Self-Driving-Car
test/test_ai_agent.py
test/test_ai_agent.py
# coding: utf-8 import gym from agent import AIAgent # TODO: usd Enduro in gym def main(): agent = AIAgent() env = gym.Env() if __name__ == '__main__': main()
# coding: utf-8 import gym from agent import AIAgent def main(): agent = AIAgent() env = gym.Env() if __name__ == '__main__': main()
mit
Python
2f2b22d8c7889174dbf11b92c2d72d8587f9164b
Disable nvfuser fma / opt level overrides per #1244
rwightman/pytorch-image-models,rwightman/pytorch-image-models
timm/utils/jit.py
timm/utils/jit.py
""" JIT scripting/tracing utils Hacked together by / Copyright 2020 Ross Wightman """ import os import torch def set_jit_legacy(): """ Set JIT executor to legacy w/ support for op fusion This is hopefully a temporary need in 1.5/1.5.1/1.6 to restore performance due to changes in the JIT exectutor. These...
""" JIT scripting/tracing utils Hacked together by / Copyright 2020 Ross Wightman """ import os import torch def set_jit_legacy(): """ Set JIT executor to legacy w/ support for op fusion This is hopefully a temporary need in 1.5/1.5.1/1.6 to restore performance due to changes in the JIT exectutor. These...
apache-2.0
Python
9a749aec016ae50cd148d26880d9b8efae606307
Fix tests failing
QuiteQuiet/PokemonShowdownBot
test/test_commands.py
test/test_commands.py
from invoker import CommandInvoker, ReplyObject from commands import URL from room import Room from user import User from app import PSBot from data.pokedex import Pokedex import re psb = PSBot() test_room = Room('test') test_user = User('user') """ Tests the commands that are within the CommandInvoker """ def test...
from invoker import CommandInvoker, ReplyObject from commands import URL from room import Room from user import User from app import PSBot from data.pokedex import Pokedex import re psb = PSBot() test_room = Room('test') test_user = User('user') """ Tests the commands that are within the CommandInvoker """ def test...
mit
Python
db0557008d9fd96771e5bab4a8db8d2ffd614aec
Fix tuple index
C-Stevens/misc-scripts,C-Stevens/misc-scripts
deobfuscate-konsole_logs.py
deobfuscate-konsole_logs.py
##Copyright (c) 2016 Colin Stevens ## ##Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute...
##Copyright (c) 2016 Colin Stevens ## ##Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute...
mit
Python
65ff4d3ad68b3a82628f32b3c78ecf30220f32ca
Fix frozenset not json serializable error
c-w/gutenberg-http,c-w/gutenberg-http
gutenberg_http/logic.py
gutenberg_http/logic.py
from datetime import datetime from datetime import timezone from os.path import getmtime from typing import List from typing import Optional from gutenberg.acquire import load_etext from gutenberg.query import get_etexts from gutenberg.query import get_metadata as _get_metadata from gutenberg_http import config from ...
from datetime import datetime from datetime import timezone from os.path import getmtime from typing import List from typing import Optional from gutenberg.acquire import load_etext from gutenberg.query import get_etexts from gutenberg.query import get_metadata from gutenberg_http import config from gutenberg_http.ca...
apache-2.0
Python
d85c9d6f7de251f9a71385ef564151875012967e
Remove interest from admin interface
p2pu/learning-circles,p2pu/learning-circles,p2pu/learning-circles,p2pu/learning-circles
interest/admin.py
interest/admin.py
from django.contrib import admin # Register your models here.
from django.contrib import admin # Register your models here. from interest.models import Lead class LeadAdmin(admin.ModelAdmin): pass admin.site.register(Lead, LeadAdmin)
mit
Python
a81020da413dc85ee9c91d02d4b8808f608b2cf7
bump version to 0.4.0 (when the "batch" branch is ready we publish)
jepegit/cellpy,jepegit/cellpy
cellpy/_version.py
cellpy/_version.py
version_info = (0, 4, 0) __version__ = ".".join(map(str, version_info))
version_info = (0, 4, 0, "a5") __version__ = ".".join(map(str, version_info))
mit
Python
3ab0812814152d91315840ca0c0cbdf80953761c
Update ezprice_csv.py
jwlin/web-crawler-tutorial
ch5/ezprice_csv.py
ch5/ezprice_csv.py
import requests import urllib.parse import csv import re from bs4 import BeautifulSoup if __name__ == '__main__': query = 'ps4主機' q = urllib.parse.quote(query) # e.g. https://ezprice.com.tw/s/ps4%E4%B8%BB%E6%A9%9F/price/ page = requests.get('https://ezprice.com.tw/s/' + q + '/price/').text soup = ...
import requests import urllib.parse import csv import re from bs4 import BeautifulSoup if __name__ == '__main__': query = 'ps4主機' q = urllib.parse.quote(query) # e.g. https://ezprice.com.tw/s/ps4%E4%B8%BB%E6%A9%9F/price/ page = requests.get('https://ezprice.com.tw/s/' + q + '/price/').text soup = ...
mit
Python
f2df6cef9e0a946351e05328719ead0ab0f534e9
refactor test_pkg_test
bioconda/bioconda-utils,bioconda/bioconda-utils,bioconda/bioconda-utils
test/test_pkg_test.py
test/test_pkg_test.py
import os from textwrap import dedent import subprocess as sp import pytest from helpers import Recipes, ensure_missing, tmp_env_matrix from bioconda_utils import pkg_test from bioconda_utils import utils from bioconda_utils import build def _build_pkg(): r = Recipes(dedent( """ one: m...
import os from textwrap import dedent import subprocess as sp import pytest from helpers import Recipes, ensure_missing, tmp_env_matrix from bioconda_utils import pkg_test from bioconda_utils import utils from bioconda_utils import build def test_pkg_test(): r = Recipes(dedent( """ one: ...
mit
Python
92c024c2112573e4c4b2d1288b1ec3c7a40bc670
Add additional assertion that the file we uploaded is correct
rackerlabs/lambda-uploader,dsouzajude/lambda-uploader
test/test_uploader.py
test/test_uploader.py
import boto3 from os import path from lambda_uploader import uploader, config from moto import mock_s3 EX_CONFIG = path.normpath(path.join(path.dirname(__file__), '../test/configs')) @mock_s3 def test_s3_upload(): mock_bucket = 'mybucket' conn = boto3.resource('s3') conn.create...
import boto3 from os import path from lambda_uploader import uploader, config from moto import mock_s3 EX_CONFIG = path.normpath(path.join(path.dirname(__file__), '../test/configs')) @mock_s3 def test_s3_upload(): mock_bucket = 'mybucket' conn = boto3.resource('s3') conn.create...
apache-2.0
Python
cc4b68c7eccf05ca32802022b2abfd31b51bce32
Use super() for great justice.
Scalr/pychef,Scalr/pychef,cread/pychef,dipakvwarade/pychef,dipakvwarade/pychef,cread/pychef,coderanger/pychef,coderanger/pychef,jarosser06/pychef,jarosser06/pychef
chef/exceptions.py
chef/exceptions.py
# Exception hierarchy for chef # Copyright (c) 2010 Noah Kantrowitz <noah@coderanger.net> class ChefError(Exception): """Top-level Chef error.""" class ChefServerError(ChefError): """An error from a Chef server. May include a HTTP response code.""" def __init__(self, message, code=None): super(Ch...
# Exception hierarchy for chef # Copyright (c) 2010 Noah Kantrowitz <noah@coderanger.net> class ChefError(Exception): """Top-level Chef error.""" class ChefServerError(ChefError): """An error from a Chef server. May include a HTTP response code.""" def __init__(self, message, code=None): ChefError...
apache-2.0
Python
73e434ea71954c0e941e041cf8342ce32ecea9aa
Fix typo in modder.__init__
JokerQyou/Modder2
modder/__init__.py
modder/__init__.py
# coding: utf-8 from .event import EVENTS, Event from .pool import ExecutorPool from .storage import ModStorage, get_storage from .timer import TimerThread MOD_REGISTRY = {} def register(func, event_name): if event_name not in EVENTS: raise UserWarning( '{} cannot be registered because {} is ...
# coding: utf-8 from .event import EVENTS, Event from .pool import ExecutorPool from .storage import ModStorage, get_storage from .timer import TimerThread MOD_REGISTRY = {} def register(func, event_name): if event_name not in EVENTS: raise UserWarning( '{} cannot be registered because {} is ...
mit
Python
40e1cedda2344d71a157348034a028847183845d
Add RndcBaseHandler
kkstu/DNStack,kkstu/DNStack,kkstu/DNStack
handler/rndc_handler.py
handler/rndc_handler.py
#!/usr/bin/python # -*- coding:utf-8 -*- # Powered By KK Studio from BaseHandler import BaseHandler from tornado.web import authenticated as Auth from modules.rndc import rndc class RndcBase(BaseHandler): def rndc(self): ops = self.get_options() r = rndc(ops['rndc_host']['value'], ops['rndc_port...
#!/usr/bin/python # -*- coding:utf-8 -*- # Powered By KK Studio from BaseHandler import BaseHandler from tornado.web import authenticated as Auth from modules.rndc import rndc class StatusHandler(BaseHandler): @Auth def get(self): ops = self.get_options() r = rndc(ops['rndc_host']['value'], ...
mit
Python
a0988d4733f248a3bdb63d4826bffd7858610d28
Remove unused import
vrs01/mopidy,jmarsik/mopidy,kingosticks/mopidy,swak/mopidy,hkariti/mopidy,priestd09/mopidy,jmarsik/mopidy,woutervanwijk/mopidy,pacificIT/mopidy,mopidy/mopidy,hkariti/mopidy,pacificIT/mopidy,glogiotatidis/mopidy,mokieyue/mopidy,dbrgn/mopidy,swak/mopidy,mopidy/mopidy,ali/mopidy,kingosticks/mopidy,rawdlite/mopidy,dbrgn/mo...
mopidy/__main__.py
mopidy/__main__.py
import asyncore import logging import os import sys sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '../'))) from mopidy import config from mopidy.exceptions import ConfigError from mopidy.mpd.server import MpdServer def main(): _setup_logging(2) backend = _get_backend(config.B...
import asyncore import logging import os import sys sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '../'))) from mopidy import config from mopidy.exceptions import ConfigError from mopidy.mpd.server import MpdServer from mopidy.backends.libspotify import LibspotifyBackend def main(): ...
apache-2.0
Python
f11d7232486a92bf5e9dba28432ee2ed97e02da4
Sort by descending date created (new first)
aabmass/print-web,aabmass/print-web,aabmass/print-web
print_web_django/api/views.py
print_web_django/api/views.py
from rest_framework import viewsets from . import serializers, models class PrintJobViewSet(viewsets.ModelViewSet): serializer_class = serializers.PrintJobSerializer def get_queryset(self): return self.request.user.printjobs.all().order_by('-created') def perform_create(self, serializer): ...
from rest_framework import viewsets from . import serializers, models class PrintJobViewSet(viewsets.ModelViewSet): serializer_class = serializers.PrintJobSerializer def get_queryset(self): return self.request.user.printjobs.all() def perform_create(self, serializer): # need to also pass...
mit
Python
cce5fd7820e2bb2119fa3e16a6862c8adec9000c
correct bug using param in dict instead of key (ter)
IntegrCiTy/obnl
obnl/util.py
obnl/util.py
import json from google.protobuf import json_format from message.coside.coside_pb2 import SimulationInit, Schedule def convert_json_to_data(json_text): return json.loads(json_text) def convert_json_file_to_data(json_file_location): with open(json_file_location) as json_file: schedule_data = conver...
import json from google.protobuf import json_format from message.coside.coside_pb2 import SimulationInit, Schedule def convert_json_to_data(json_text): return json.loads(json_text) def convert_json_file_to_data(json_file_location): with open(json_file_location) as json_file: schedule_data = conver...
apache-2.0
Python
5ef72148ff01dc01f76a7942bcb0c65396876f30
Use JSON (not pickle) for celery serialisation
BenMotz/cubetoolkit,BenMotz/cubetoolkit,BenMotz/cubetoolkit,BenMotz/cubetoolkit
toolkit/celery.py
toolkit/celery.py
from __future__ import absolute_import import os from celery import Celery ## set the default Django settings module for the 'celery' program. os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'toolkit.settings') from django.conf import settings app = Celery('toolkit') # Using a string here means the worker will no...
from __future__ import absolute_import import os from celery import Celery ## set the default Django settings module for the 'celery' program. os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'toolkit.settings') from django.conf import settings app = Celery('toolkit') # Using a string here means the worker will no...
agpl-3.0
Python
97d6f5e7b346944ac6757fd4570bfbc7dcf52425
Fix Attempted relative import beyond top-level package
Pierre-Sassoulas/django-survey,Pierre-Sassoulas/django-survey,Pierre-Sassoulas/django-survey
survey/admin.py
survey/admin.py
# -*- coding: utf-8 -*- from django.contrib import admin from survey.actions import make_published from survey.models import Answer, Category, Question, Response, Survey class QuestionInline(admin.TabularInline): model = Question ordering = ("order", "category") extra = 1 class CategoryInline(admin.Ta...
# -*- coding: utf-8 -*- from django.contrib import admin from survey.models import Answer, Category, Question, Response, Survey from .actions import make_published class QuestionInline(admin.TabularInline): model = Question ordering = ("order", "category") extra = 1 class CategoryInline(admin.Tabular...
agpl-3.0
Python
a03eb91088943a4b3ed0ae5fc87b104562a4a645
Drop support for Django 1.6
Mixser/django-location-field,recklessromeo/django-location-field,Mixser/django-location-field,voodmania/django-location-field,recklessromeo/django-location-field,undernewmanagement/django-location-field,voodmania/django-location-field,caioariede/django-location-field,caioariede/django-location-field,undernewmanagement/...
location_field/urls.py
location_field/urls.py
from django.conf.urls import patterns import os app_dir = os.path.dirname(__file__) urlpatterns = patterns( '', (r'^media/(.*)$', 'django.views.static.serve', { 'document_root': '%s/media' % app_dir}), )
try: from django.conf.urls import patterns # Django>=1.6 except ImportError: from django.conf.urls.defaults import patterns # Django<1.6 import os app_dir = os.path.dirname(__file__) urlpatterns = patterns( '', (r'^media/(.*)$', 'django.views.static.serve', { 'document_root': '%s/media' % a...
mit
Python
335c5ce1d77818de6362b2686855ecb7155c2806
fix author URL
Naught0/qtbot
cogs/trump.py
cogs/trump.py
import discord import random from dateutil.parser import parse from urllib.parse import quote_plus from discord.ext import commands from discord.utils import escape_markdown from utils.aiohttp_wrap import aio_get_json class Trump(commands.Cog): """ A cog which nobody ever asked for, that fetches a random Trump t...
import discord import random from dateutil.parser import parse from urllib.parse import quote_plus from discord.ext import commands from discord.utils import escape_markdown from utils.aiohttp_wrap import aio_get_json class Trump(commands.Cog): """ A cog which nobody ever asked for, that fetches a random Trump t...
mit
Python
e6155445017f940d875a0b865f2f0943c5c363c3
remove dead code
xeroc/piston-lib,xeroc/python-steem,xeroc/python-steemlib
steem/blog.py
steem/blog.py
import steem as stm from funcy import rest, first from steem.account import Account from steem.post import Post from steem.utils import is_comment class Blog: def __init__(self, account_name, steem_instance=None): if not steem_instance: steem_instance = stm.Steem() self.steem = steem_i...
import steem as stm from funcy import rest, first from steem.account import Account from steem.post import Post from steem.utils import is_comment class Blog: def __init__(self, account_name, steem_instance=None): if not steem_instance: steem_instance = stm.Steem() self.steem = steem_i...
mit
Python
d606187e240fb60c471459e0e60476641030edb0
Add ROUNDABLE property
opesci/devito,opesci/devito
devito/ir/iet/properties.py
devito/ir/iet/properties.py
from devito.tools import Tag class IterationProperty(Tag): """ An Iteration decorator. """ _KNOWN = [] def __init__(self, name, val=None): super(IterationProperty, self).__init__(name, val) IterationProperty._KNOWN.append(self) SEQUENTIAL = IterationProperty('sequential') """T...
from devito.tools import Tag class IterationProperty(Tag): """ An Iteration decorator. """ _KNOWN = [] def __init__(self, name, val=None): super(IterationProperty, self).__init__(name, val) IterationProperty._KNOWN.append(self) SEQUENTIAL = IterationProperty('sequential') """T...
mit
Python
2aacec9b259510fa0bfee4f6081856e183912fd9
add py-yajl to the shootout; we are still the fastest
rfk/tnetstring,rfk/tnetstring,pombredanne/tnetstring,pombredanne/tnetstring,MetaMemoryT/tnetstring,MetaMemoryT/tnetstring,rfk/tnetstring
tools/shootout.py
tools/shootout.py
import random import cjson import yajl import tnetstring from tnetstring.tests.test_format import FORMAT_EXAMPLES, get_random_object TESTS = [] def add_test(v): # These modules have a few round-tripping problems... try: assert cjson.decode(cjson.encode(v)) == v assert yajl.loads(yajl.dumps(...
import cjson import tnetstring from tnetstring.tests.test_format import FORMAT_EXAMPLES, get_random_object for _ in xrange(20): v = get_random_object(jsonsafe=True) FORMAT_EXAMPLES[tnetstring.dumps(v)] = v JSON_EXAMPLES = {} for k,v in FORMAT_EXAMPLES.items(): JSON_EXAMPLES[cjson.encode(v)] = v def thra...
mit
Python
540360edd1cd1c95459fab36d76a411163713872
Change conf by settings
frhumanes/consulting,frhumanes/consulting,frhumanes/consulting,frhumanes/consulting,frhumanes/consulting
web/src/private_messages/views.py
web/src/private_messages/views.py
# -*- encoding: utf-8 -*- from django.template import RequestContext from django.contrib.auth.decorators import login_required from django.shortcuts import render_to_response, redirect, get_object_or_404 from django.core.urlresolvers import reverse from django.conf import settings from datetime import datetime from m...
# -*- encoding: utf-8 -*- from django.template import RequestContext from django.contrib.auth.decorators import login_required from django.shortcuts import render_to_response, redirect, get_object_or_404 from django.core.urlresolvers import reverse from datetime import datetime from models import Message from forms i...
apache-2.0
Python
f18a162a07836c2b4d092aa12fb38d16f6b2c2c3
Add constraints
stencila/hub,stencila/hub,stencila/hub,stencila/hub,stencila/hub
director/director/models.py
director/director/models.py
from django.db import models from django.conf import settings import jwt import time import uuid class Project(models.Model): address = models.TextField(unique=True) gallery = models.BooleanField(default=False) users = models.ManyToManyField('auth.User', related_name='projects') @classmethod def ...
from django.db import models from django.conf import settings import jwt import time import uuid class Project(models.Model): address = models.TextField(unique=True) gallery = models.BooleanField(default=False) users = models.ManyToManyField('auth.User', related_name='projects') @classmethod def ...
apache-2.0
Python
a40efc35063db5ea5033beebf264f4378bb9dc3b
Update references to SDK
moonrisewarrior/line-memebot
app_with_handler.py
app_with_handler.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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
# -*- 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
apache-2.0
Python
0b32da3201ca37f28605265535bf406ec7acfcf8
update for new sphinx
imageio/imageio
tasks/docs.py
tasks/docs.py
import os import sys import os.path as op import shutil from invoke import task from ._config import DOC_DIR, DOC_BUILD_DIR @task(help=dict(clean='clear the doc output; start fresh', build='build html docs', show='show the docs in the browser.')) def docs(ctx, clean=False, build=False...
import os import sys import os.path as op import shutil from invoke import task from ._config import DOC_DIR, DOC_BUILD_DIR @task(help=dict(clean='clear the doc output; start fresh', build='build html docs', show='show the docs in the browser.')) def docs(ctx, clean=False, build=False...
bsd-2-clause
Python
a404a7755774993b51a1ed7c50574ef22cbf053d
Remove obsolete widget code that was copied over from floppyforms
gregmuellegger/django-superform,gregmuellegger/django-superform
django_superform/widgets.py
django_superform/widgets.py
from django import forms from django.template import loader class TemplateWidget(forms.Widget): """ Template based widget. It renders the ``template_name`` set as attribute which can be overriden by the ``template_name`` argument to the ``__init__`` method. """ field = None template_name ...
from django import forms from django.template import loader class TemplateWidget(forms.Widget): """ Template based widget. It renders the ``template_name`` set as attribute which can be overriden by the ``template_name`` argument to the ``__init__`` method. """ field = None template_name ...
bsd-3-clause
Python
124fcc00ab28240a3ecf3ff24a156c16b8d68b52
Switch to insights landing
fangeugene/the-blue-alliance,verycumbersome/the-blue-alliance,nwalters512/the-blue-alliance,verycumbersome/the-blue-alliance,nwalters512/the-blue-alliance,nwalters512/the-blue-alliance,the-blue-alliance/the-blue-alliance,the-blue-alliance/the-blue-alliance,bdaroz/the-blue-alliance,phil-lopreiato/the-blue-alliance,fange...
tba_config.py
tba_config.py
import os DEBUG = os.environ.get('SERVER_SOFTWARE') is not None and os.getenv('APPLICATION_ID') != 's~tbatv-prod-hrd' MAX_YEAR = 2016 # Fraction of requests to profile RECORD_FRACTION = 0.1 # Fraction of requests to send to Google Analytics GA_RECORD_FRACTION = 1.0 # For choosing what the main landing page displa...
import os DEBUG = os.environ.get('SERVER_SOFTWARE') is not None and os.getenv('APPLICATION_ID') != 's~tbatv-prod-hrd' MAX_YEAR = 2016 # Fraction of requests to profile RECORD_FRACTION = 0.1 # Fraction of requests to send to Google Analytics GA_RECORD_FRACTION = 1.0 # For choosing what the main landing page displa...
mit
Python
a5f3b7c908db134ed5ba4916b4b30cd0638256e8
add a way to grab N pdfs in one batch
crccheck/atx-bandc,crccheck/atx-bandc
bandc/pdf.py
bandc/pdf.py
import os import sys from urllib import urlretrieve from StringIO import StringIO import dataset from pdfminer.pdfdocument import PDFDocument from pdfminer.pdfparser import PDFParser from pdfminer.pdfinterp import PDFResourceManager, PDFPageInterpreter from pdfminer.pdfpage import PDFPage from pdfminer.converter impor...
import os from urllib import urlretrieve from StringIO import StringIO import dataset from pdfminer.pdfdocument import PDFDocument from pdfminer.pdfparser import PDFParser from pdfminer.pdfinterp import PDFResourceManager, PDFPageInterpreter from pdfminer.pdfpage import PDFPage from pdfminer.converter import TextConve...
bsd-3-clause
Python
f292cfa783bcc30c2625b340ad763db2723ce056
Add tests for DatabaseBase abstraction
thiderman/piper
test/test_db.py
test/test_db.py
from piper.db import DbCLI from piper.db import DatabaseBase import mock import pytest class DbCLIBase(object): def setup_method(self, method): self.cli = DbCLI(mock.Mock()) self.ns = mock.Mock() self.config = mock.Mock() class TestDbCLIRun(DbCLIBase): def test_plain_run(self): ...
from piper.db import DbCLI import mock class DbCLIBase(object): def setup_method(self, method): self.cli = DbCLI(mock.Mock()) self.ns = mock.Mock() self.config = mock.Mock() class TestDbCLIRun(DbCLIBase): def test_plain_run(self): self.cli.cls.init = mock.Mock() ret ...
mit
Python
70c87ed56900810c6b500d8598e2259d978e5ef2
reorder default settings
ericvrp/PowerToThePeople,ericvrp/PowerToThePeople
defaults.py
defaults.py
# # Copy this file to config.py and insert to correct values there! # ldr_gpio_pin = 0 mongodb_url = 'mongodb://<user>:<pass>@ds057867.mongolab.com:57867/<database>' webcache_enabled = False pvoutput_interval = 0 #in seconds (or 0 to disable pvoutput) pvoutput_key = '<your api key from pvoutput.org goes ...
# # Copy this file to config.py and insert to correct values there! # ldr_gpio_pin = 0 webcache_enabled = False pvoutput_interval = 0 #in seconds (or 0 to disable pvoutput) pvoutput_key = '<your api key from pvoutput.org goes here>' pvoutput_sid = '<your system id goes here>'
mit
Python
4646e7792a4f04edaffbfbc25148c46dc5afc06f
add helper for header
FederatedAI/FATE,FederatedAI/FATE,FederatedAI/FATE
federatedml/model_selection/step.py
federatedml/model_selection/step.py
# # Copyright 2019 The FATE Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
# # Copyright 2019 The FATE Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
apache-2.0
Python
1fbb79762c7e8342e840f0c1bc95c99fd981b81d
Fix the 'contribution/all' or 'contribution/' URL.
DANS-KNAW/dariah-contribute,DANS-KNAW/dariah-contribute
dariah_contributions/urls.py
dariah_contributions/urls.py
from django.conf.urls import patterns, url from django.views.generic.detail import DetailView from django.views.generic.list import ListView from .models import Contribution from .views import ContributionCreate, ContributionDelete, ContributionUpdate, ContributionRDF urlpatterns = patterns('', url(r'^(all/)?$',...
from django.conf.urls import patterns, url from django.views.generic.detail import DetailView from django.views.generic.list import ListView from .models import Contribution from .views import ContributionCreate, ContributionDelete, ContributionUpdate, ContributionRDF urlpatterns = patterns('', url(r'^(all)?/$',...
apache-2.0
Python
b4b7a94b4efaa73e61adc898ec71c6be1a4a6242
update main.py
IlyaSukhanov/cheezoid,IlyaSukhanov/cheezoid,IlyaSukhanov/cheezoid,IlyaSukhanov/cheezoid,IlyaSukhanov/cheezoid,IlyaSukhanov/cheezoid
http_controller/main.py
http_controller/main.py
from flask import Flask app = Flask(__name__) @app.route("/") def hello(): msg = """ <html><head><title>Cheezoid</title></head> <body><h3>cheezoid httpd controller</h3> RESTful endpoints <ul> <li>/status to view cheezoid status</li> <li>/cmd to send command</li> <ul> <li>m...
from flask import Flask app = Flask(__name__) @app.route("/") def hello(): msg = """ <html><head><title>Cheezoid</title></head> <body><h3>cheezoid httpd controller</h3> <ul> <li>/status to view cheezoid status</li> <li>/cmd to send command</li> <li>/svg to send svg</li> </ul> </bo...
apache-2.0
Python
ad3012416c44b3305440c83dc45a5e596b896ccf
Change AssertUserFailedError
mwclient/mwclient
mwclient/errors.py
mwclient/errors.py
class MwClientError(RuntimeError): pass class MediaWikiVersionError(MwClientError): pass class APIDisabledError(MwClientError): pass class MaximumRetriesExceeded(MwClientError): pass class APIError(MwClientError): def __init__(self, code, info, kwargs): self.code = code self...
class MwClientError(RuntimeError): pass class MediaWikiVersionError(MwClientError): pass class APIDisabledError(MwClientError): pass class MaximumRetriesExceeded(MwClientError): pass class APIError(MwClientError): def __init__(self, code, info, kwargs): self.code = code self...
mit
Python
fe9bbabf85847906fbaf641b3dc87615b3d7e2aa
add surfnoc
nvandervoort/PyRTL,UCSBarchlab/PyRTL,nvandervoort/PyRTL,deekshadangwal/PyRTL,UCSBarchlab/PyRTL,deekshadangwal/PyRTL
research/surfnoc/surfnoc.py
research/surfnoc/surfnoc.py
import pyrtl class surfnoc(object): """This class defines the architecture of SurfNoC 4*4 torus router """
import pyrtl class port(object): """ This is port class, which will be used to create N S E W ports of the router. This contains buffer.""" def __init__(self, name): """This is used to instantiate each port of the router""" self.name=name def buf_fer(): """Buffer""" class sur...
bsd-3-clause
Python
33b1a5b9217512de32bff716560d20d6b92e30c7
convert sum return value to float
SEL-Columbia/bamboo,pld/bamboo,SEL-Columbia/bamboo,pld/bamboo,SEL-Columbia/bamboo,pld/bamboo
lib/tasks/calculator.py
lib/tasks/calculator.py
from collections import defaultdict from celery.task import task from pandas import DataFrame, Series from lib.constants import DATASET_ID, LINKED_DATASETS from models.dataset import Dataset from models.observation import Observation def sum_dframe(column): return float(column.sum()) # TODO: move this somewhe...
from collections import defaultdict from celery.task import task from pandas import DataFrame, Series from lib.constants import DATASET_ID, LINKED_DATASETS from models.dataset import Dataset from models.observation import Observation def sum_dframe(column): return column.sum() # TODO: move this somewhere else...
bsd-3-clause
Python
6b1e1dbb71eb700024ef8c2ffa9eb8015ba3b61c
bump version number
bashu/fluentcms-forms-builder,bashu/fluentcms-forms-builder
fluentcms_forms_builder/__init__.py
fluentcms_forms_builder/__init__.py
__version__ = "1.0.2"
__version__ = "1.0.1"
apache-2.0
Python
63c2cc935d3c97ecb8b297ae387bfdf719cf1350
Remove unused FormLogin in admin app
vuonghv/brs,vuonghv/brs,vuonghv/brs,vuonghv/brs
apps/admin/forms.py
apps/admin/forms.py
from django.contrib.auth.models import User from django import forms from apps.categories.models import * from apps.books.models import * class CategoryForm(forms.ModelForm): """docstring for CategoryForm""" class Meta: model = Category fields = '__all__' class BookForm(forms...
from django.contrib.auth.models import User from django import forms from apps.categories.models import * from apps.books.models import * class LoginForm(forms.ModelForm): """docstring for LoginForm""" class Meta: model = User fields = ['username', 'password'] class CategoryForm(forms.ModelFo...
mit
Python
56e7846d2949fa1c17b089ea459b6b3c2b9e2423
Clarify test objective to avoid reports of unrelated bug.
kmonsoor/pyglet,arifgursel/pyglet,xshotD/pyglet,mpasternak/michaldtz-fix-552,shaileshgoogler/pyglet,gdkar/pyglet,xshotD/pyglet,mpasternak/pyglet-fix-issue-552,arifgursel/pyglet,kmonsoor/pyglet,Austin503/pyglet,mpasternak/pyglet-fix-issue-518-522,Alwnikrotikz/pyglet,google-code-export/pyglet,arifgursel/pyglet,mpasternak...
tests/font/SET_DPI.py
tests/font/SET_DPI.py
#!/usr/bin/env python '''Test that a specific DPI can be set to render the text with. Some text in Action Man font will be displayed. A green box should exactly bound the top and bottom of the text. (The right edge of the box may not line up with the right edge of the text due to a known bug; see issue #88). Press...
#!/usr/bin/env python '''Test that a specific DPI can be set to render the text with. Some text in Action Man font will be displayed. A green box should exactly bound the text. Press ESC to end the test. ''' __docformat__ = 'restructuredtext' __version__ = '$Id: $' import os import unittest from pyglet.gl import...
bsd-3-clause
Python
55726b253dbfcf3bd723c8c8889ec0facaeda1ce
unify foreignkey from rep to representative
yohanboniface/memopol-core,yohanboniface/memopol-core,yohanboniface/memopol-core
apps/reps/models.py
apps/reps/models.py
from django.db import models class RepsContainerManager(models.Manager): """ Manager for models to which the representative model has a foreign key""" def with_counts(self): """ Return the models with a count property, with the count of active Reps """ return self.get_query_set().filter(represe...
from django.db import models class RepsContainerManager(models.Manager): """ Manager for models to which the REP model has a foreign key""" def with_counts(self): """ Return the models with a count property, with the count of active Reps """ return self.get_query_set().filter(rep__active=True)....
agpl-3.0
Python
c09dfdde97d7754c6f08f9e5c5bf33d959489f14
Clarify test objective to avoid reports of unrelated bug.
oktayacikalin/pyglet,oktayacikalin/pyglet,mammadori/pyglet,theblacklion/pyglet,mammadori/pyglet,oktayacikalin/pyglet,oktayacikalin/pyglet,mammadori/pyglet,theblacklion/pyglet,theblacklion/pyglet,theblacklion/pyglet,theblacklion/pyglet,mammadori/pyglet,oktayacikalin/pyglet
tests/font/SET_DPI.py
tests/font/SET_DPI.py
#!/usr/bin/env python '''Test that a specific DPI can be set to render the text with. Some text in Action Man font will be displayed. A green box should exactly bound the top and bottom of the text. (The right edge of the box may not line up with the right edge of the text due to a known bug; see issue #88). Press...
#!/usr/bin/env python '''Test that a specific DPI can be set to render the text with. Some text in Action Man font will be displayed. A green box should exactly bound the text. Press ESC to end the test. ''' __docformat__ = 'restructuredtext' __version__ = '$Id: $' import os import unittest from pyglet.gl import...
bsd-3-clause
Python
f16431f87ddf28619b5957ef79b87b45b1b16a60
handle default site correctly.
Kegbot/kegbot-server,Kegbot/kegbot-server,Kegbot/kegbot-server,Kegbot/kegbot-server,Kegbot/kegbot-server
pykeg/src/pykeg/web/middleware.py
pykeg/src/pykeg/web/middleware.py
# Copyright 2011 Mike Wakerly <opensource@hoho.com> # # This file is part of the Pykeg package of the Kegbot project. # For more information on Pykeg or Kegbot, see http://kegbot.org/ # # Pykeg is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by...
# Copyright 2011 Mike Wakerly <opensource@hoho.com> # # This file is part of the Pykeg package of the Kegbot project. # For more information on Pykeg or Kegbot, see http://kegbot.org/ # # Pykeg is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by...
mit
Python
bd5e5b0bffef968786ac7af3eb78b9a5e9680272
Fix help route test
johanherman/arteria-core,arteria-project/arteria-core,johandahlberg/arteria-core
tests/routes_tests.py
tests/routes_tests.py
from unittest import TestCase import arteria from arteria.web.routes import RouteService import mock class RoutesServiceTest(TestCase): def test_help_doc_generated(self): app_svc = mock.MagicMock() route_svc = RouteService(app_svc, debug=False) routes = [ ("/route0", TestHandler...
from unittest import TestCase import arteria from arteria.web.routes import RouteService import mock class RoutesServiceTest(TestCase): def test_help_doc_generated(self): app_svc = mock.MagicMock() route_svc = RouteService(app_svc, debug=False) routes = [ ("/route0", TestHandler...
mit
Python
321f4fd622cc624f3ad06e03267bf91e1c9c577d
rename channel normalize
intel-analytics/BigDL,intel-analytics/BigDL,yangw1234/BigDL,yangw1234/BigDL,intel-analytics/BigDL,yangw1234/BigDL,yangw1234/BigDL,intel-analytics/BigDL
python/dllib/src/bigdl/dllib/feature/image/imagePreprocessing.py
python/dllib/src/bigdl/dllib/feature/image/imagePreprocessing.py
# # Copyright 2016 The BigDL Authors. # # 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 ...
# # Copyright 2016 The BigDL Authors. # # 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 ...
apache-2.0
Python
b226ffb8ac47f001a072ac9a27aa96bcf8b64f64
add test for well to df
agile-geoscience/welly,agile-geoscience/welly
tests/test_project.py
tests/test_project.py
# -*- coding: utf 8 -*- """ Define a suite a tests for the Project module. """ from welly import Project, Well def test_project(): """ Test basic stuff. """ project = Project.from_las('tests/assets/1.las') assert len(project) == 1 w = Well.from_las('tests/assets/2.las') project += w a...
# -*- coding: utf 8 -*- """ Define a suite a tests for the Project module. """ from welly import Project, Well def test_project(): """ Test basic stuff. """ project = Project.from_las('tests/assets/1.las') assert len(project) == 1 w = Well.from_las('tests/assets/2.las') project += w a...
apache-2.0
Python
5fe76db02ab229415a43f146c6e8dd94f00706a3
add test for Record __dir__ method
kennethreitz/records
tests/test_records.py
tests/test_records.py
from collections import namedtuple import records IdRecord = namedtuple('IdRecord', 'id') def check_id(i, row): assert row.id == i class TestRecordCollection: def test_iter(self): rows = records.RecordCollection(IdRecord(i) for i in range(10)) for i, row in enumerate(rows): ch...
from collections import namedtuple import records IdRecord = namedtuple('IdRecord', 'id') def check_id(i, row): assert row.id == i class TestRecordCollection: def test_iter(self): rows = records.RecordCollection(IdRecord(i) for i in range(10)) for i, row in enumerate(rows): chec...
isc
Python
fb3b3b38cab4bc39487758aaf7694274a144f89e
Add micrograms
renalreg/radar,renalreg/radar,renalreg/radar,renalreg/radar
radar/radar/models/medications.py
radar/radar/models/medications.py
# -*- coding: utf-8 -*- from collections import OrderedDict from sqlalchemy import Column, Date, String, ForeignKey, Numeric, Index from sqlalchemy import Integer from sqlalchemy.orm import relationship from radar.database import db from radar.models.common import MetaModelMixin, uuid_pk_column, patient_id_column, pa...
from collections import OrderedDict from sqlalchemy import Column, Date, String, ForeignKey, Numeric, Index from sqlalchemy import Integer from sqlalchemy.orm import relationship from radar.database import db from radar.models.common import MetaModelMixin, uuid_pk_column, patient_id_column, patient_relationship from r...
agpl-3.0
Python
66e893337e64d8c2683bb80309695f51449a0f6a
Add support for forcing the region.
racker/python-raxcli
raxcli/apps/loadbalancer/utils.py
raxcli/apps/loadbalancer/utils.py
# Copyright 2013 Rackspace # # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the...
# Copyright 2013 Rackspace # # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the...
apache-2.0
Python
ab8cd2e2dc6f9ece73a88baff85ac8ddf46181ed
Test routines for the BLAST wrapper added
gtamazian/Chromosomer
tests/test_wrapper.py
tests/test_wrapper.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) 2015 by Gaik Tamazian # gaik (dot) tamazian (at) gmail (dot) com import glob import os import tempfile import unittest from chromosomer.fasta import RandomSequence from chromosomer.fasta import Writer from chromosomer.wrapper.blast import BlastN from chrom...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) 2015 by Gaik Tamazian # gaik (dot) tamazian (at) gmail (dot) com import glob import os import tempfile import unittest from chromosomer.fasta import RandomSequence from chromosomer.fasta import Writer from chromosomer.wrapper.blast import MakeBlastDb path...
mit
Python
8dc0176aebeef25b794f5076d7c1358423953c67
test fixed
vmprof/vmprof-server,vmprof/vmprof-server,vmprof/vmprof-server,vmprof/vmprof-server
tests/web/test_log.py
tests/web/test_log.py
import pytest from django.contrib import auth from server.models import Log @pytest.mark.django_db def test_log_get_user(client): username = 'username' password = 'thepassword' user = auth.models.User.objects.create_user( username, 'username@vmprof.com', password ) Log....
import pytest from django.contrib import auth from server.models import Log @pytest.mark.django_db def test_log_get_user(client): username = 'username' password = 'thepassword' user = auth.models.User.objects.create_user( username, 'username@vmprof.com', password ) Log....
mit
Python
c6e83948f53bcd5d77b1714b691bbd74d12da613
Change initializers API
explosion/thinc,spacy-io/thinc,explosion/thinc,explosion/thinc,spacy-io/thinc,explosion/thinc,spacy-io/thinc
thinc/initializers.py
thinc/initializers.py
from typing import Callable import numpy.random from .backends import Ops from .config import registry from .types import Array, Shape from .util import partial # TODO: Harmonize naming with Keras, and fill in missing entries # https://keras.io/initializers/ # What we call 'xavier uniform' should be Glorot uniform # ...
from typing import Callable from .config import registry from .types import Array from .util import get_array_module, copy_array, partial def xavier_uniform_init(data: Array, *, inplace: bool = False) -> Array: xp = get_array_module(data) scale = xp.sqrt(6.0 / (data.shape[0] + data.shape[1])) if inplace:...
mit
Python
9866283cfd6b71930467d5919b59ee6f01ef1e6c
Update first_two.py
RCoon/CodingBat,RCoon/CodingBat
Python/String_1/first_two.py
Python/String_1/first_two.py
# Given a string, return the string made of its first two chars, so the String # "Hello" yields "He". If the string is shorter than length 2, return whatever # there is, so "X" yields "X", and the empty string "" yields the empty string # "". # first_two('Hello') --> 'He' # first_two('abcdefg') --> 'ab' # first_two('a...
# Given a string, return the string made of its first two chars, so the String # "Hello" yields "He". If the string is shorter than length 2, return whatever # there is, so "X" yields "X", and the empty string "" yields the empty string # "". # first_two('Hello') -> 'He' # first_two('abcdefg') -> 'ab' # first_two('ab'...
mit
Python
0d33acf31254714b3a9f76d3fe97c77e7270c110
Test Utils: Cleans up the code
manrajgrover/halo,ManrajGrover/halo
tests/_utils.py
tests/_utils.py
"""Utilities for tests. """ import errno import codecs import os import re def strip_ansi(string): """Strip ANSI encoding from given string. Parameters ---------- string : str String from which encoding needs to be removed Returns ------- str Encoding free string ...
"""Utilities for tests. """ import codecs import codecs import os import re def strip_ansi(string): """Strip ANSI encoding from given string. Parameters ---------- string : str String from which encoding needs to be removed Returns ------- str Encoding free string...
mit
Python
12ea015a6ba77c08d6999337ccebfc63f5b43bf4
Update ipc_lista1.11.py
any1m1c/ipc20161
lista1/ipc_lista1.11.py
lista1/ipc_lista1.11.py
ipc_lista1.11
apache-2.0
Python
d36d9fb0ac954883e2923b9955169782c32340d3
Update ipc_lista4.17.py
any1m1c/ipc20161
lista4/ipc_lista4.17.py
lista4/ipc_lista4.17.py
#Grupo: 2 # Lucas Ferreira Soares - 1615310014 # Ana Beatriz Frota - 1615310027 # #Lista: 4 #Questão: 17 vet = [] nome = input("Atleta: ") salto1 = float(input("Primeiro salto:")) vet.append (salto1) salto2= float(input("Segundo salto:")) vet.append (salto2) salto3 = float(input("Terceiro sal...
#Aluno: Lucas Ferreira Soares - 1615310014 #Grupo: 2 #Lista: 4 #Questão: 17 vet = [] nome = input("Atleta: ") salto1 = float(input("Primeiro salto:")) vet.append (salto1) salto2= float(input("Segundo salto:")) vet.append (salto2) salto3 = float(input("Terceiro salto:")) vet.append (salto3) s...
apache-2.0
Python
cf3084b70c382200434fd21bed2311d70eaee740
Fix isort after quickfix
dotKom/onlineweb4,dotKom/onlineweb4,dotKom/onlineweb4,dotKom/onlineweb4
apps/careeropportunity/views.py
apps/careeropportunity/views.py
# -*- coding: utf-8 -*- from django.shortcuts import render from django.utils import timezone # API v1 from rest_framework import mixins, viewsets from rest_framework.pagination import PageNumberPagination from rest_framework.permissions import AllowAny from apps.careeropportunity.models import CareerOpportunity from...
# -*- coding: utf-8 -*- from django.shortcuts import render from django.utils import timezone # API v1 from rest_framework import mixins, viewsets from rest_framework.permissions import AllowAny from rest_framework.pagination import PageNumberPagination from apps.careeropportunity.models import CareerOpportunity from...
mit
Python
ee9d8368685795503b01ddfaa4ed0bd055de2dc3
Rename config command to configure.
chromakode/been
been/been.py
been/been.py
#!/usr/bin/env python import sys import json from core import Been, source_registry from source import * _cmds = {} def command(f): _cmds[f.func_name] = f return f def run_command(cmd, app, args): disambiguate(cmd, _cmds, 'command')(app, *args) def disambiguate(key, dict_, desc='key'): try: i...
#!/usr/bin/env python import sys import json from core import Been, source_registry from source import * _cmds = {} def command(f): _cmds[f.func_name] = f return f def run_command(cmd, app, args): disambiguate(cmd, _cmds, 'command')(app, *args) def disambiguate(key, dict_, desc='key'): try: i...
bsd-3-clause
Python
7be6ee4ae50f717cd76edbc5231b297abfb38531
Update rename_building.py
architecture-building-systems/CEAforArcGIS,architecture-building-systems/CEAforArcGIS
cea/utilities/rename_building.py
cea/utilities/rename_building.py
""" A simple CEA script that renames a building in the input files - NOTE: you'll have to re-run the simulation and analysis scripts to get the changes as only the files defined in ``inputs.yml`` (the files you see in the CEA Dashboard input editor) are changed. This is the script behind ``cea rename-building --old <b...
""" A simple CEA script that renames a building in the input files - NOTE: you'll have to re-run the simulation and analysis scripts to get the changes as only the files defined in ``inputs.yml`` (the files you see in the CEA Dashboard input editor) are changed. This is the script behind ``cea rename-building --old <b...
mit
Python
4e060394f976c92d0f2c968cd3652a313e9d24b3
Remove class PublisherBase
openstack/ceilometer,openstack/ceilometer
ceilometer/publisher/__init__.py
ceilometer/publisher/__init__.py
# # Copyright 2013 Intel Corp. # Copyright 2013-2014 eNovance # # 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 applic...
# # Copyright 2013 Intel Corp. # Copyright 2013-2014 eNovance # # 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 applic...
apache-2.0
Python
26920e6a9edd1a07523e4f45bbb2a738dcffe7e3
fix db name
mdiener21/python-geospatial-analysis-cookbook,mdiener21/python-geospatial-analysis-cookbook,mdiener21/python-geospatial-analysis-cookbook,mdiener21/python-geospatial-analysis-cookbook
ch03/code/ch03-01-shp2pg.py
ch03/code/ch03-01-shp2pg.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import subprocess # database options db_schema = "SCHEMA=geodata" overwrite_option = "OVERWRITE=YES" geom_type = "MULTILINESTRING" output_format = "PostgreSQL" # database connection string db_connection = """PG:host=localhost port=5432 user=pluto dbname=py_geoan_cb pass...
#!/usr/bin/env python # -*- coding: utf-8 -*- import subprocess # database options db_schema = "SCHEMA=geodata" overwrite_option = "OVERWRITE=YES" geom_type = "MULTILINESTRING" output_format = "PostgreSQL" # database connection string db_connection = """PG:host=localhost port=5432 user=pluto dbname=py_test password...
mit
Python
b625018cfedb2ed9a82b8b9f1c73f7ab4ffbe4ce
make exception handling syntax compatible with python2.5
yarda/dslib
certs/pem_decoder.py
certs/pem_decoder.py
''' Decoder for PEM files ''' import sys, string, base64 from pyasn1.codec.der import decoder from pyasn1 import error import pkcs7.asn1_models import pkcs7.asn1_models.X509certificate from pkcs7.asn1_models.X509certificate import * def _get_substrate(lines): ''' Returns substrate from PEM file ''' b...
''' Decoder for PEM files ''' import sys, string, base64 from pyasn1.codec.der import decoder from pyasn1 import error import pkcs7.asn1_models import pkcs7.asn1_models.X509certificate from pkcs7.asn1_models.X509certificate import * def _get_substrate(lines): ''' Returns substrate from PEM file ''' b...
lgpl-2.1
Python
f11839a64851f5f8f28df37ae4a9d0901d42b824
Fix bug where all session ids would be the same
ollien/Timpani,ollien/Timpani,ollien/Timpani
timpani/auth.py
timpani/auth.py
import bcrypt import os import binascii import datetime from . import database from . import configmanager BCRYPT_ROUNDS = 10 FILE_LOCATION = os.path.abspath(os.path.dirname(__file__)) CONFIG_PATH = os.path.abspath(os.path.join(FILE_LOCATION, "../configs/")) configs = configmanager.ConfigManager(configPath = CONFIG_...
import bcrypt import os import binascii import datetime from . import database from . import configmanager BCRYPT_ROUNDS = 10 FILE_LOCATION = os.path.abspath(os.path.dirname(__file__)) CONFIG_PATH = os.path.abspath(os.path.join(FILE_LOCATION, "../configs/")) configs = configmanager.ConfigManager(configPath = CONFIG_...
mit
Python
c31615c6dea8c55eb9e99a158137560235ea7aef
remove last comma and format from bibtex map
Walther/verbose-pancake,Walther/verbose-pancake,Walther/verbose-pancake
bibtexify.py
bibtexify.py
import json import sys if __name__ == '__main__': filenames = sys.argv[1] filenames = filenames.split(",") filenames.pop(0) # to remove static .gitignore from the list TODO reformat output = open('./bibtex-list.txt', 'w') for filename in filenames: inputFile = open('./data/' + filename,'r'...
import json import sys if __name__ == '__main__': filenames = sys.argv[1] filenames = filenames.split(",") filenames.pop(0) # to remove static .gitignore from the list TODO reformat output = open('./bibtex-list.txt', 'w') for filename in filenames: inputFile = open('./data/' + filename,'r'...
mit
Python
bafa0e13631044e45467133f9da1e8eb606ec6c2
Use prompt
kracekumar/UTFT
prompt.py
prompt.py
# -*- coding: utf-8 -*- import os def get_prompt(): if os.environ.get('TESTING'): """ In [41]: x = lambda y: "test" In [42]: x Out[42]: <function __main__.<lambda>> In [43]: x('name') Out[43]: 'test' """ return lambda x: x return raw_input
# -*- coding: utf-8 -*- import os def get_prompt(): if os.environ.get('TESTING'): """ In [41]: x = lambda y: "test" In [42]: x Out[42]: <function __main__.<lambda>> In [43]: x('name') Out[43]: 'test' """ return lambda x: x return input
bsd-2-clause
Python
b54e93b49a4d2856f0bbb7b7855f64c39d3d6cec
Increment version number for new release.
stormsherpa/django-oauth2-provider,stormsherpa/django-oauth2-provider,stormsherpa/django-oauth2-provider
provider/__init__.py
provider/__init__.py
__version__ = "1.2"
__version__ = "1.1"
mit
Python
bf585249430a074dc86db31286d4f44d3516452b
add new versions (#4424)
skosukhin/spack,iulian787/spack,iulian787/spack,EmreAtes/spack,LLNL/spack,tmerrick1/spack,TheTimmy/spack,EmreAtes/spack,mfherbst/spack,mfherbst/spack,iulian787/spack,krafczyk/spack,matthiasdiener/spack,LLNL/spack,skosukhin/spack,lgarren/spack,krafczyk/spack,matthiasdiener/spack,EmreAtes/spack,mfherbst/spack,TheTimmy/sp...
var/spack/repos/builtin/packages/astyle/package.py
var/spack/repos/builtin/packages/astyle/package.py
############################################################################## # Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
############################################################################## # Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
Python
306346356caefcd683b469200527dff7437458b0
fix darwin install name (#13258)
iulian787/spack,iulian787/spack,LLNL/spack,LLNL/spack,iulian787/spack,LLNL/spack,LLNL/spack,LLNL/spack,iulian787/spack,iulian787/spack
var/spack/repos/builtin/packages/brotli/package.py
var/spack/repos/builtin/packages/brotli/package.py
# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class Brotli(CMakePackage): """Brotli is a generic-purpose lossless compression algorithm""" ...
# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class Brotli(CMakePackage): """Brotli is a generic-purpose lossless compression algorithm""" ...
lgpl-2.1
Python
d4c302e1ae154aca6402926747f453b6c38050f9
Remove now seemingly-unnecessary encoding
CenterForOpenScience/modular-file-renderer,rdhyee/modular-file-renderer,Johnetordoff/modular-file-renderer,TomBaxter/modular-file-renderer,CenterForOpenScience/modular-file-renderer,felliott/modular-file-renderer,TomBaxter/modular-file-renderer,felliott/modular-file-renderer,icereval/modular-file-renderer,felliott/modu...
mfr/ext/docx/render.py
mfr/ext/docx/render.py
# -*- coding: utf-8 -*- """Docx renderer module.""" import sys if not sys.version_info >= (3, 0): from pydocx.parsers import Docx2Html from mfr import RenderResult def render_docx(fp, *args, **kwargs): """Generate an html representation of the docx file using PyDocx :param fp: File point...
# -*- coding: utf-8 -*- """Docx renderer module.""" import sys if not sys.version_info >= (3, 0): from pydocx.parsers import Docx2Html from mfr import RenderResult def render_docx(fp, *args, **kwargs): """Generate an html representation of the docx file using PyDocx :param fp: File point...
apache-2.0
Python
df45e424981fc0fe286b1dac437454888a02bfa1
Add a custom InstallCommand that overrides install_lib.
deepmind/reverb,deepmind/reverb,deepmind/reverb,deepmind/reverb
reverb/pip_package/setup.py
reverb/pip_package/setup.py
# python3 # Copyright 2019 DeepMind Technologies Limited. # # 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 ...
# python3 # Copyright 2019 DeepMind Technologies Limited. # # 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
48fc8f0621e8a4004d2c8d276257d7c52300a155
implement routes for individual bogo data
matiaslindgren/not-enough-bogo,matiaslindgren/not-enough-bogo,matiaslindgren/not-enough-bogo
bogo/main.py
bogo/main.py
import asyncio import sys import logging import sanic from bogoapp import util from bogoapp import bogo logging_format = ("%(asctime)s %(process)d-%(levelname)s " "%(module)s::%(funcName)s():l%(lineno)d: " "%(message)s") logging.basicConfig(format=logging_format, level=logging.DE...
import asyncio import sys import logging import sanic from bogoapp import util logging_format = ("%(asctime)s %(process)d-%(levelname)s " "%(module)s::%(funcName)s():l%(lineno)d: " "%(message)s") logging.basicConfig(format=logging_format, level=logging.DEBUG) # Globals logger = ...
mit
Python
cabf947c54f118dc510dc0982dced77b6220b7d5
add comments to aws_creds.py
sso2712/python,smartypants2712/python
aws_creds.py
aws_creds.py
#!/usr/bin/python # Helper to export or unset AWS credentials from ~/.aws/credentials # into environment variables # # Usage: # - Set "myprofile" AWS credentials # eval $(~/aws_creds.py -p myprofile) # - Unset AWS credentials # eval $(~/aws_creds.py -u) # import argparse import sys import ConfigParse...
#!/usr/bin/python # Helper to export or unset AWS credentials from ~/.aws/credentials # into environment variables import argparse import sys import ConfigParser CREDENTIALS_FILE='/Users/simon.so/.aws/credentials' parser = argparse.ArgumentParser(description='Export or unset AWS credentials') parser.add_argument('-...
mit
Python
34abea2b2e4fe696f640d86bb68a1d2191278986
Update bootstrap script to Python 3.
vapoursynth/vapoursynth,vapoursynth/vapoursynth,vapoursynth/vapoursynth,Kamekameha/vapoursynth,Kamekameha/vapoursynth,Kamekameha/vapoursynth,Kamekameha/vapoursynth,vapoursynth/vapoursynth
bootstrap.py
bootstrap.py
#!/usr/bin/env python import os, stat, urllib.request urllib.request.urlretrieve('https://waf.googlecode.com/files/waf-1.7.11', 'waf') os.chmod('waf', os.stat('waf').st_mode | stat.S_IXUSR)
#!/usr/bin/env python import os, stat, urllib2 f = urllib2.urlopen('http://waf.googlecode.com/files/waf-1.7.11') with open('waf', 'wb') as waf: waf.write(f.read()) os.chmod('waf', os.stat('waf').st_mode | stat.S_IXUSR)
lgpl-2.1
Python
0dcb836037e85a343329201d3cde03d4b249f625
Fix `os_platform_type` grains on CentOS 5.5
uvsmtid/common-salt-states,uvsmtid/common-salt-states,uvsmtid/common-salt-states,uvsmtid/common-salt-states
states/_grains/os_platform_type.py
states/_grains/os_platform_type.py
#!/usr/bin/env python import os import re import platform ############################################################################### # def provide_os_platform_type(): if False: pass elif platform.system() == 'Linux': uname_release = platform.uname()[2] # Example string to select ...
#!/usr/bin/env python import os import re import platform ############################################################################### # def provide_os_platform_type(): if False: pass elif platform.system() == 'Linux': uname_release = platform.uname()[2] # Example string to select ...
apache-2.0
Python
6f464e422befe22e56bb759a7ac7ff52a353c6d9
Test is loaded CSS is applied
XeryusTC/18xx-accountant,XeryusTC/18xx-accountant,XeryusTC/18xx-accountant,XeryusTC/18xx-accountant,XeryusTC/18xx-accountant
accountant/functional_tests/test_layout_and_styling.py
accountant/functional_tests/test_layout_and_styling.py
# -*- coding: utf-8 -*- import unittest from .base import FunctionalTestCase from .pages import game class StylesheetTests(FunctionalTestCase): def test_color_css_loaded(self): self.story('Create a game') self.browser.get(self.live_server_url) page = game.Homepage(self.browser) page...
# -*- coding: utf-8 -*- import unittest from .base import FunctionalTestCase from .pages import game class StylesheetTests(FunctionalTestCase): def test_color_css_loaded(self): self.story('Create a game') self.browser.get(self.live_server_url) page = game.Homepage(self.browser) page...
mit
Python
2fbd13f3ad0e5ed9ba0cd49dec8f581fbf4ef23b
Add explicit return to the user tasks
nickjj/build-a-saas-app-with-flask,z123/build-a-saas-app-with-flask,z123/build-a-saas-app-with-flask,z123/build-a-saas-app-with-flask,nickjj/build-a-saas-app-with-flask,nickjj/build-a-saas-app-with-flask,nickjj/build-a-saas-app-with-flask
catwatch/blueprints/user/tasks.py
catwatch/blueprints/user/tasks.py
from flask_babel import lazy_gettext as _ from catwatch.lib.flask_mailplus import send_template_message from catwatch.app import create_celery_app from catwatch.blueprints.user.models import User celery = create_celery_app() @celery.task() def deliver_password_reset_email(user_id, reset_token): """ Send a r...
from flask_babel import lazy_gettext as _ from catwatch.lib.flask_mailplus import send_template_message from catwatch.app import create_celery_app from catwatch.blueprints.user.models import User celery = create_celery_app() @celery.task() def deliver_password_reset_email(user_id, reset_token): """ Send a r...
mit
Python
269e15a6fdb95a577cb01f073173fa032febc446
bump to 0.8.4
tsuru/tsuru-circus
tsuru/__init__.py
tsuru/__init__.py
# Copyright 2014 tsuru-circus authors. All rights reserved. # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. __version__ = "0.8.4"
# Copyright 2014 tsuru-circus authors. All rights reserved. # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. __version__ = "0.8.3"
bsd-3-clause
Python
44cc7a8aacc961415556bed4b18ebad72b766f2d
bump to 0.3.3
tsuru/tsuru-circus
tsuru/__init__.py
tsuru/__init__.py
# Copyright 2013 tsuru-circus authors. All rights reserved. # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. __version__ = "0.3.3"
# Copyright 2013 tsuru-circus authors. All rights reserved. # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. __version__ = "0.3.2"
bsd-3-clause
Python