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 |
|---|---|---|---|---|---|---|---|---|
beb3f341a118a4de3ba8dd6fb0e8c3b88962147d | rename var on init_app | mapproxy/mapproxy-webconf,mapproxy/mapproxy-webconf,mapproxy/mapproxy-webconf | app/mapproxy_webconf/script/util.py | app/mapproxy_webconf/script/util.py | from __future__ import print_function
import optparse
import sys
from mapproxy.script.util import NonStrictOptionParser, parse_bind_address, print_items
from mapproxy_webconf.version import version
def serve_develop_command(args):
parser = optparse.OptionParser("usage: %prog serve-develop [options] mapproxy.yaml... | from __future__ import print_function
import optparse
import sys
from mapproxy.script.util import NonStrictOptionParser, parse_bind_address, print_items
from mapproxy_webconf.version import version
def serve_develop_command(args):
parser = optparse.OptionParser("usage: %prog serve-develop [options] mapproxy.yaml... | apache-2.0 | Python |
6ff5cd972de886a58b7a32ceb32d7325f47086f8 | add prod SERVER_NAME, MONGO_DBNAME | tschaume/global_gitfeed_api,tschaume/global_gitfeed_api | api/__init__.py | api/__init__.py | import os, bcrypt
from eve import Eve
from flask.ext.bootstrap import Bootstrap
from eve_docs import eve_docs
from eve.auth import BasicAuth
class BCryptAuth(BasicAuth):
def check_auth(self, username, password, allowed_roles, resource, method):
accounts = app.data.driver.db['accounts']
account = accounts.fin... | import os, bcrypt
from eve import Eve
from flask.ext.bootstrap import Bootstrap
from eve_docs import eve_docs
from eve.auth import BasicAuth
class BCryptAuth(BasicAuth):
def check_auth(self, username, password, allowed_roles, resource, method):
accounts = app.data.driver.db['accounts']
account = accounts.fin... | mit | Python |
b2f51260f633ae51713cafb8f1ba07d3808a2dc3 | Bump version to 2.0.0 to make submodule package setup as a release | mwickert/scikit-dsp-comm,mwickert/scikit-dsp-comm | sk_dsp_comm/__version__.py | sk_dsp_comm/__version__.py | __version__ = '2.0.0'
| __version__ = '1.3.0'
| bsd-2-clause | Python |
936211bbcb33af609438b543dfc4bc3a5965feac | move import to avoid infinte recursion (filter import peak that import feature that import filter) | juliusbierk/scikit-image,rjeli/scikit-image,vighneshbirodkar/scikit-image,juliusbierk/scikit-image,bsipocz/scikit-image,youprofit/scikit-image,Britefury/scikit-image,keflavich/scikit-image,emon10005/scikit-image,ofgulban/scikit-image,michaelpacer/scikit-image,Midafi/scikit-image,pratapvardhan/scikit-image,bennlich/scik... | skimage/filter/__init__.py | skimage/filter/__init__.py | from .lpi_filter import inverse, wiener, LPIFilter2D
from ._gaussian import gaussian_filter
# Backward compatibility v<0.11
from .edges import (sobel, hsobel, vsobel, scharr, hscharr, vscharr, prewitt,
hprewitt, vprewitt, roberts, roberts_positive_diagonal,
roberts_negative_diago... | from .lpi_filter import inverse, wiener, LPIFilter2D
from ._gaussian import gaussian_filter
# Backward compatibility v<0.11
from ..feature import canny
from .edges import (sobel, hsobel, vsobel, scharr, hscharr, vscharr, prewitt,
hprewitt, vprewitt, roberts, roberts_positive_diagonal,
... | bsd-3-clause | Python |
8daeb6540b2a5a54a1dba8b9ad8baacd21d702f3 | Fix novice doctests | pratapvardhan/scikit-image,rjeli/scikit-image,ofgulban/scikit-image,dpshelio/scikit-image,robintw/scikit-image,paalge/scikit-image,almarklein/scikit-image,chriscrosscutler/scikit-image,SamHames/scikit-image,chintak/scikit-image,SamHames/scikit-image,chintak/scikit-image,almarklein/scikit-image,michaelpacer/scikit-image... | skimage/novice/__init__.py | skimage/novice/__init__.py | """
skimage.novice
==============
A special Python image submodule for beginners.
Description
-----------
``skimage.novice`` provides a simple image manipulation interface for
beginners. It allows for easy loading, manipulating, and saving of image
files.
This module is primarily intended for teaching and differs si... | """
skimage.novice
==============
A special Python image submodule for beginners.
Description
-----------
``skimage.novice`` provides a simple image manipulation interface for
beginners. It allows for easy loading, manipulating, and saving of image
files.
This module is primarily intended for teaching and differs si... | bsd-3-clause | Python |
53a53491b3be591a26f9db1a67c63aff30c1b2bf | Use #!/usr/bin/env python instead of #!/usr/local/bin/python. | sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator | Doc/tools/keywords.py | Doc/tools/keywords.py | #! /usr/bin/env python
# This Python program sorts and reformats the table of keywords in ref2.tex
import string
l = []
try:
while 1:
l = l + string.split(raw_input())
except EOFError:
pass
l.sort()
for x in l[:]:
while l.count(x) > 1: l.remove(x)
ncols = 5
nrows = (len(l)+ncols-1)/ncols
for i in range(nrows):
... | #! /usr/local/bin/python
# This Python program sorts and reformats the table of keywords in ref2.tex
import string
l = []
try:
while 1:
l = l + string.split(raw_input())
except EOFError:
pass
l.sort()
for x in l[:]:
while l.count(x) > 1: l.remove(x)
ncols = 5
nrows = (len(l)+ncols-1)/ncols
for i in range(nrows):... | mit | Python |
52e1751dae7bd894a9f32d9c2dcc7f851804efca | Stop sleeping before checking for aliveness. | lundjordan/slaveapi | slaveapi/actions/reboot.py | slaveapi/actions/reboot.py | import time
from ..slave import Slave
import logging
log = logging.getLogger(__name__)
def reboot(name):
bug_comment = ""
slave = Slave(name)
slave.load_inventory_info()
slave.load_ipmi_info()
slave.load_bug_info(createIfMissing=True)
bug_comment += "Attempting SSH reboot..."
alive = Fal... | import time
from ..slave import Slave
import logging
log = logging.getLogger(__name__)
def reboot(name):
bug_comment = ""
slave = Slave(name)
slave.load_inventory_info()
slave.load_ipmi_info()
slave.load_bug_info(createIfMissing=True)
bug_comment += "Attempting SSH reboot..."
alive = Fal... | mpl-2.0 | Python |
cca4c42e07ad7fc0c3e96284a6bfbf67d59860cb | Remove default email sender from CozyLAN config | homeworkprod/byceps,homeworkprod/byceps,homeworkprod/byceps | sites/cozylan/config_dev.py | sites/cozylan/config_dev.py | # Examplary development configuration for the "CozyLAN" demo site
DEBUG = True
SECRET_KEY = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
SESSION_COOKIE_SECURE = False
SQLALCHEMY_DATABASE_URI = 'postgresql+psycopg2://byceps:boioioing@127.0.0.1/byceps'
REDIS_URL =... | # Examplary development configuration for the "CozyLAN" demo site
DEBUG = True
SECRET_KEY = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
SESSION_COOKIE_SECURE = False
SQLALCHEMY_DATABASE_URI = 'postgresql+psycopg2://byceps:boioioing@127.0.0.1/byceps'
REDIS_URL =... | bsd-3-clause | Python |
4a2329b990dfaeef133adb03886956a9acfe9c17 | Edit credit-reverse | trenton42/txbalanced,balanced/balanced-python | snippets/credit-reverse.py | snippets/credit-reverse.py | credit = balanced.Credit.fetch(credit_href)
reversal = credit.reverse() | credit = order.credits[0]
reversal = credit.reverse() | mit | Python |
00ce79a29c08762307cf50ceb4c79a58d3aba6a3 | Break up some too-long lines. | mradway/hycohanz,Dr-Drive/hycohanz | examples/enter_vol.py | examples/enter_vol.py | """
Demonstrate usage of the enter_vol() function.
"""
import hycohanz as hfss
import os.path
raw_input('Press "Enter" to connect to HFSS.>')
[oAnsoftApp, oDesktop] = hfss.setup_interface()
raw_input('Press "Enter" to open an example project.>')
filepath = os.path.join(os.path.abspath(os.path.curdir), 'WR284.hfss')... | """
Demonstrate usage of the enter_vol() function.
"""
import hycohanz as hfss
import os.path
raw_input('Press "Enter" to connect to HFSS.>')
[oAnsoftApp, oDesktop] = hfss.setup_interface()
raw_input('Press "Enter" to open an example project.>')
filepath = os.path.join(os.path.abspath(os.path.curdir), 'WR284.hfss')... | bsd-2-clause | Python |
ba7877cd5fe81f543ed3cfce6fbbe67ae7d24b35 | Update ex3_1.py | North-Guard/BigToolsComplicatedData,North-Guard/BigToolsComplicatedData | Week3/ex3_1.py | Week3/ex3_1.py | import numpy as np
# import data from matrix-file (Use your individual file location)
with open('matrix-file', 'r') as file:
# split file into lines, split the lines into numbers at the comma delimiter,
#convert string number into int numbers
num_list = [[int(num) for num in line.split()[0].split(',')] \
... | import numpy as np
# import data from file
with open('nparr', 'r') as file:
# split file into lines, split the lines into numbers at the comma delimiter, convert string number into int numbers
num_list = [[int(num) for num in line.split()[0].split(',')] for line in file.readlines()]
# convert list of list of ... | mit | Python |
0704f6e77378489318153b11eaf31a1d1fdd027f | raise NotImplemented for PG | david-abel/simple_rl | simple_rl/agents/PolicyGradientAgentClass.py | simple_rl/agents/PolicyGradientAgentClass.py | ''' PolicyGradientAgentClass.py: Class for a policy gradient agent.
Note: At present, this agent is not implemented.'''
# Python imports.
import random
# Other imports
from simple_rl.agents.AgentClass import Agent
class PolicyGradientAgent(Agent):
''' Class for a random decision maker. '''
def __init__(sel... | ''' PolicyGradientAgentClass.py: Class for a policy gradient agent.
Note: At present, this agent is not implemented.'''
# Python imports.
import random
# Other imports
from simple_rl.agents.AgentClass import Agent
class PolicyGradientAgent(Agent):
''' Class for a random decision maker. '''
def __init__(sel... | apache-2.0 | Python |
3c6d19418c1465eb7abb82d1b1ee809208e0ed77 | clean up import | ColumbiaCMB/kid_readout,ColumbiaCMB/kid_readout | kid_readout/__init__.py | kid_readout/__init__.py | from kid_readout.roach import heterodyne,baseband,r2heterodyne,r2baseband
from kid_readout.roach.heterodyne import RoachHeterodyne
from kid_readout.roach.baseband import RoachBaseband
from kid_readout.roach.r2baseband import RoachBaseband
from kid_readout.roach.r2heterodyne import Roach2Heterodyne
from kid_readout.ana... | from kid_readout.roach import heterodyne,baseband,r2heterodyne,r2baseband
from kid_readout.roach.heterodyne import RoachHeterodyne
from kid_readout.roach.baseband import RoachBaseband
from kid_readout.roach.r2baseband import RoachBaseband
from kid_readout.roach.r2heterodyne import Roach2Heterodyne
from kid_readout.ana... | bsd-2-clause | Python |
57fba48de8e21103e52d9b359032f1508ec69b38 | add astroML.__bibtex__ attribute | nhuntwalker/astroML,kcavagnolo/astroML,bsipocz/astroML,astroML/astroML,eramirem/astroML | astroML/__init__.py | astroML/__init__.py | __version__ = '0.3-git'
__bibtex__ = """@INPROCEEDINGS{astroML,
author={{Vanderplas}, J.T. and {Connolly}, A.J.
and {Ivezi{\'c}}, {\v Z}. and {Gray}, A.},
booktitle={Conference on Intelligent Data Understanding (CIDU)},
title={Introduction to astroML: Machine learning for astrophysics},
month={Oct.},
page... | __version__ = '0.3-git'
| bsd-2-clause | Python |
0c30bcbf3e0dd17ee5984d6151b7be4ada4a02ce | Fix "pool tuple" bug in restified example | skynet/letsencrypt,rutsky/letsencrypt,BKreisel/letsencrypt,dietsche/letsencrypt,lbeltrame/letsencrypt,hlieberman/letsencrypt,deserted/letsencrypt,BKreisel/letsencrypt,vcavallo/letsencrypt,lmcro/letsencrypt,stewnorriss/letsencrypt,xgin/letsencrypt,Hasimir/letsencrypt,TheBoegl/letsencrypt,sapics/letsencrypt,kevinlondon/l... | examples/restified.py | examples/restified.py | import logging
import os
import pkg_resources
import M2Crypto
from letsencrypt.acme import messages2
from letsencrypt.acme import jose
from letsencrypt.client import network2
logger = logging.getLogger()
logger.setLevel(logging.DEBUG)
NEW_REG_URL = 'https://www.letsencrypt-demo.org/acme/new-reg'
key = jose.JWKRS... | import logging
import os
import pkg_resources
import M2Crypto
from letsencrypt.acme import messages2
from letsencrypt.acme import jose
from letsencrypt.client import network2
logger = logging.getLogger()
logger.setLevel(logging.DEBUG)
NEW_REG_URL = 'https://www.letsencrypt-demo.org/acme/new-reg'
key = jose.JWKRS... | apache-2.0 | Python |
c5ba1987c13c6ff7909e5e0ce2b567f8c5fcb9d3 | Add character support to discrete environments | bzier/gym-mupen64plus,bzier/gym-mupen64plus | gym_mupen64plus/envs/MarioKart64/discrete_envs.py | gym_mupen64plus/envs/MarioKart64/discrete_envs.py | import abc
from gym_mupen64plus.envs.MarioKart64.mario_kart_env import MarioKartEnv
from gym import spaces
class DiscreteActions:
ACTION_MAP = [
("NO_OP", [ 0, 0, 0, 0, 0]),
("STRAIGHT", [ 0, 0, 1, 0, 0]),
("BRAKE", [ 0, 0, 0, 1, 0]),
("BACK_UP", ... | import abc
from gym_mupen64plus.envs.MarioKart64.mario_kart_env import MarioKartEnv
from gym import spaces
class DiscreteActions:
ACTION_MAP = [
("NO_OP", [ 0, 0, 0, 0, 0]),
("STRAIGHT", [ 0, 0, 1, 0, 0]),
("BRAKE", [ 0, 0, 0, 1, 0]),
("BACK_UP", ... | mit | Python |
c76c05010fc05ab6e01389041703343a5115151b | Update urls.py | vagdevik/SE2017,sriamazingram/SE2017,SriHarshaGajavalli/SE2017,vagdevik/SE2017,sriamazingram/SE2017,SriHarshaGajavalli/SE2017,sriamazingram/SE2017,SriHarshaGajavalli/SE2017,vagdevik/SE2017,sriamazingram/SE2017,vagdevik/SE2017,vagdevik/SE2017,SriHarshaGajavalli/SE2017 | SE2017/urls.py | SE2017/urls.py | """SE2017 URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-bas... | """SE2017 URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-bas... | mit | Python |
b253c7abaf134fe67ab55da92b8e01f5eb3e8513 | bump version | realms-team/sol,realms-team/sol | solobjectlib/SolVersion.py | solobjectlib/SolVersion.py | VERSION = (1, 1, 0, 0)
| VERSION = (1, 0, 0, 0)
| bsd-3-clause | Python |
c9d971fa5deb278f63eb8ac64e7c87b9127884a5 | Make syncreshooks loop through all reservableproducts | jaywink/cartridge-reservable,jaywink/cartridge-reservable,jaywink/cartridge-reservable | cartridge/shop/management/commands/syncreshooks.py | cartridge/shop/management/commands/syncreshooks.py | from django.core.management.base import BaseCommand
from django.core.management.base import CommandError
from mezzanine.conf import settings
from cartridge.shop.models import *
class Command(BaseCommand):
help = 'Sync reservations from external hook'
def handle(self, *args, **options):
for p in Reser... | from django.core.management.base import BaseCommand
from django.core.management.base import CommandError
from mezzanine.conf import settings
from cartridge.shop.models import *
class Command(BaseCommand):
help = 'Sync reservations from external hook'
def handle(self, *args, **options):
p = Reservable... | bsd-2-clause | Python |
cf9167710aa0acc58aefa9b543781f4e4088fe5d | Remove -flto flag | lovell/farmhash,lovell/farmhash,jhermsmeier/farmhash,jhermsmeier/farmhash,lovell/farmhash,jhermsmeier/farmhash | binding.gyp | binding.gyp | {
'targets': [{
'target_name': 'farmhash',
'sources': [
'src/upstream/farmhash.cc',
'src/farmhash.cc'
],
'include_dirs': [
'<!(node -e "require(\'nan\')")'
],
'cflags_cc': [
'-fexceptions',
'-Wall',
'-march=native',
'-Ofast',
'-funrol... | {
'targets': [{
'target_name': 'farmhash',
'sources': [
'src/upstream/farmhash.cc',
'src/farmhash.cc'
],
'include_dirs': [
'<!(node -e "require(\'nan\')")'
],
'cflags_cc': [
'-fexceptions',
'-Wall',
'-march=native',
'-Ofast',
'-flto',... | apache-2.0 | Python |
08dc0ce7c44d0149b443261ff6d3708e28a928e7 | Add decode to version read from pkg_resources. | ABI-Software/MeshParser | src/meshparser/__init__.py | src/meshparser/__init__.py | from pkg_resources import resource_string
version = resource_string(__name__, 'version.txt').strip()
__version__ = version.decode('utf-8')
| from pkg_resources import resource_string
version = resource_string(__name__, 'version.txt').strip()
__version__ = version
| apache-2.0 | Python |
949a7bff0ffd35f7d873d8c9ddd269fca7f063fa | delete newline | radomd92/botjagwar,radomd92/botjagwar | api/__init__.py | api/__init__.py | VERSION = None
def get_version():
global VERSION
if VERSION is not None:
return VERSION
else:
with open('data/version', 'r') as f:
VERSION = f.read().strip('\n')
return VERSION
__all__ = ['get_version'] | VERSION = None
def get_version():
global VERSION
if VERSION is not None:
return VERSION
else:
with open('data/version', 'r') as f:
VERSION = f.read()
return VERSION
__all__ = ['get_version'] | mit | Python |
9c7597d4d9ca295def133b98214abde60ff47422 | Fix a typo in exception. Luke, I owe you a beer. | tweksteen/burst,cfcs/burst,securusglobal/abrupt,tweksteen/burst,cfcs/burst | abrupt/exception.py | abrupt/exception.py | from abrupt.color import *
class AbruptException(Exception):
def __repr__(self):
return "<{}: {}>".format(error(self.__class__.__name__), str(self))
class UnableToConnect(AbruptException):
def __init__(self, message="Unable to connect to the server"):
AbruptException.__init__(self, message)
class NotConn... | from abrupt.color import *
class AbruptException(Exception):
def __repr__(self):
return "<{}: {}>".format(error(self.__class__.__name__), str(self))
class UnableToConnect(AbruptException):
def __init__(self, message="Unable to connect to the server"):
AbruptException.__init__(self, message)
class NotConn... | bsd-3-clause | Python |
b1944d4cbfa0f1496c028416d81b1342837fb612 | add charliecloud 0.9.6 (#10176) | LLNL/spack,iulian787/spack,iulian787/spack,iulian787/spack,iulian787/spack,LLNL/spack,LLNL/spack,LLNL/spack,LLNL/spack,iulian787/spack | var/spack/repos/builtin/packages/charliecloud/package.py | var/spack/repos/builtin/packages/charliecloud/package.py | # Copyright 2013-2018 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Charliecloud(MakefilePackage):
"""Lightweight user-defined software stacks for HPC."""
... | # Copyright 2013-2018 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Charliecloud(MakefilePackage):
"""Lightweight user-defined software stacks for HPC."""
... | lgpl-2.1 | Python |
9e8163a40875e0be22604839b4e4e59f46df4839 | revert debug leftovers | CityOfNewYork/NYCOpenRecords,CityOfNewYork/NYCOpenRecords,CityOfNewYork/NYCOpenRecords,CityOfNewYork/NYCOpenRecords,CityOfNewYork/NYCOpenRecords | app/__init__.py | app/__init__.py | import redis
from business_calendar import Calendar, MO, TU, WE, TH, FR
from celery import Celery
from flask import Flask
from flask_bootstrap import Bootstrap
from flask_kvsession import KVSessionExtension
from flask_login import LoginManager
from flask_mail import Mail
from flask_recaptcha import ReCaptcha
from flask... | import redis
from business_calendar import Calendar, MO, TU, WE, TH, FR
from celery import Celery
from flask import Flask
from flask_bootstrap import Bootstrap
from flask_kvsession import KVSessionExtension
from flask_login import LoginManager
from flask_mail import Mail
from flask_recaptcha import ReCaptcha
from flask... | apache-2.0 | Python |
432c6d26bf95c042cad08993dbbbb2a427eff498 | Update main.py | luoquan19/OMOOC2py | _src/om2py0w/0wex0/main.py | _src/om2py0w/0wex0/main.py | # -*- coding: utf-8 -*-
# Quick Python Script Explanation for Programmers
import os
def main():
print 'hello world!'
print "This is Alice's greeting."
print 'This is Bob\'s greeting.'
foo(5,10)
print '='*10
print 'Current working directory is ' + os.getcwd()
c... | mit | Python | |
2b50e68b49b0f1085ad21422266da986c7f131d6 | refactor letter timings to demystify the process a bit | alphagov/notifications-utils | notifications_utils/letter_timings.py | notifications_utils/letter_timings.py | import pytz
from datetime import datetime, timedelta
from collections import namedtuple
from notifications_utils.timezones import utc_string_to_aware_gmt_datetime
def set_gmt_hour(day, hour):
return day.astimezone(pytz.timezone('Europe/London')).replace(hour=hour, minute=0).astimezone(pytz.utc)
def get_letter... | import pytz
from datetime import datetime, timedelta
from collections import namedtuple
from notifications_utils.timezones import utc_string_to_aware_gmt_datetime
def set_gmt_hour(day, hour):
return day.astimezone(pytz.timezone('Europe/London')).replace(hour=hour, minute=0).astimezone(pytz.utc)
def get_letter... | mit | Python |
08408e62779c06ac90b202e154ffce2a1b93ddb3 | change admin group | dogsaur/SMS,dogsaur/SMS,dogsaur/SMS,dogsaur/SMS | app/__init__.py | app/__init__.py | from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
from flask.ext.login import LoginManager
from flask.ext.uploads import UploadSet, IMAGES, configure_uploads
from flask_wtf.csrf import CsrfProtect
from flask.ext.principal import Principal, Permission, RoleNeed
app = Flask(__name__)
app.config.from_o... | from flask import Flask
from flask.ext.sqlalchemy import SQLAlchemy
from flask.ext.login import LoginManager
from flask.ext.uploads import UploadSet, IMAGES, configure_uploads
from flask_wtf.csrf import CsrfProtect
from flask.ext.principal import Principal, Permission, RoleNeed
app = Flask(__name__)
app.config.from_o... | mit | Python |
3bee2bc27db2be40c4bbcfede1eed63b17b32bcb | clean up | ACME-OUI/acme-web-fe,ACME-OUI/acme-web-fe,ACME-OUI/acme-web-fe,sterlingbaldwin/acme-web-fe,sterlingbaldwin/acme-web-fe,chaosphere2112/acme-web-fe,sterlingbaldwin/acme-web-fe,sterlingbaldwin/acme-web-fe,chaosphere2112/acme-web-fe,ACME-OUI/acme-web-fe,chaosphere2112/acme-web-fe | acme_site/models.py | acme_site/models.py | from django.db import models
class Organizations(models.Model):
name = models.CharField(max_length=512, unique=True, blank=False)
def __str__(self):
return self.name
class Repos(models.Model):
name = models.CharField(max_length=512, unique=True, blank=False)
organization = models.ManyToManyFie... | from django.db import models
class Organizations(models.Model):
name = models.CharField(max_length=512, unique=True, blank=False)
def __str__(self):
return self.name
class Repos(models.Model):
name = models.CharField(max_length=512, unique=True, blank=False)
organization = models.ManyToManyFi... | apache-2.0 | Python |
2f2533530b82c10efb6a548a802e188f1b68a834 | Add producers to admin product change list | armicron/plata,stefanklug/plata,armicron/plata,allink/plata,armicron/plata | plata/product/producer/admin.py | plata/product/producer/admin.py | from django import forms
from django.contrib import admin
from django.utils.translation import ugettext_lazy as _
from . import models
admin.site.register(models.Producer,
list_display=('is_active', 'name', 'ordering'),
list_display_links=('name',),
prepopulated_fields={'slug': ('name',)},
search_fie... | from django import forms
from django.contrib import admin
from django.utils.translation import ugettext_lazy as _
from . import models
admin.site.register(models.Producer,
list_display=('is_active', 'name', 'ordering'),
list_display_links=('name',),
prepopulated_fields={'slug': ('name',)},
search_fie... | bsd-3-clause | Python |
c4b11b2225f797e8e845520685dc2dfa92a4c4c8 | Update __init__.py | voron434/styleru_py_week4,voron434/styleru_py_week4 | app/__init__.py | app/__init__.py | from flask import Flask
import os
app = Flask(__name__)
app.config.from_object('config')
app.config.update(CSRF_ENABLED = os.environ['CSRF_ENABLED'])
app.config.update(SECRET_KEY = os.environ['SECRET_KEY'])
app.config.update(CLIENT_ID = os.environ['CLIENT_ID'])
app.config.update(CLIENT_SECRET = os.environ['CLI... | from flask import Flask
app = Flask(__name__)
app.config.from_object('config')
from app import views | unlicense | Python |
7c50c76018d27acf87e30bd694860efa8b8a590d | Handle py26, py27 | fbergroth/autosort | autosort/sorting.py | autosort/sorting.py | import os
from collections import defaultdict
from .parsing import parse_imports
from .formatting import format_group
from .utils import interpose
from .config import get_config
def sort_imports(source, path):
config = get_config(path)
lines = source.splitlines(True)
diff = []
for block in parse_impo... | import os
from collections import defaultdict, OrderedDict
from .parsing import parse_imports
from .formatting import format_group
from .utils import interpose
from .config import get_config
def sort_imports(source, path):
config = get_config(path)
lines = source.splitlines(keepends=True)
diff = []
f... | mit | Python |
bbc179eb766a2401d0c7770b5588c48db2586634 | Update create_pi_labels.py | MaxNoe/python-plotting | source/create_pi_labels.py | source/create_pi_labels.py | # -*- coding: utf-8 -*-
import matplotlib.pyplot as plt
import numpy as np
from fractions import Fraction
def create_pi_labels(a=0, b=2, step=0.5):
values = np.arange(a, b+0.1*step, step)
fracs = [Fraction(x) for x in values]
ticks = values*np.pi
labels = []
for frac in fracs:
if frac.num... | # -*- coding: utf-8 -*-
import matplotlib.pyplot as plt
import numpy as np
from fractions import Fraction
def create_pi_labels(a, b, step):
values = np.arange(a, b+0.1*step, step)
fracs = [Fraction(x) for x in values]
ticks = values*np.pi
labels = []
for frac in fracs:
if frac.numerator==... | mit | Python |
396079f6c0f1eb99df02def89ea43876b0e08615 | Tweak graph. | lmjohns3/cube-experiment,lmjohns3/cube-experiment,lmjohns3/cube-experiment | plots/plot-timing-histograms.py | plots/plot-timing-histograms.py | #!/usr/bin/env python
import climate
import joblib
import lmj.cubes
import lmj.plot
import numpy as np
def diffs(t):
t.load()
return 1000 * np.diff(t.index.values)
def main(root, pattern='*'):
trials = lmj.cubes.Experiment(root).trials_matching(pattern)
values = joblib.Parallel(-1)(joblib.delayed(d... | #!/usr/bin/env python
import climate
import joblib
import lmj.cubes
import lmj.plot
import numpy as np
def diffs(t):
t.load()
return 1000 * np.diff(t.index.values)
def main(root, pattern='*'):
trials = lmj.cubes.Experiment(root).trials_matching(pattern)
values = joblib.Parallel(-1)(joblib.delayed(d... | mit | Python |
a701859cd8d1d1fc89b691ef9660e047bc8d58b0 | Include Washington County | vprnet/school-closings,vprnet/school-closings | app/closings.py | app/closings.py | #!/usr/bin/python
import requests
import xml.etree.ElementTree as ET
def closings():
"""Takes all school closings and returns a JSON-like dictionary:
{'Vermont':
[{'county': 'Bennington',
'closings': [{
'school': school_name,
'condition': condition},
... | #!/usr/bin/python
import requests
import xml.etree.ElementTree as ET
def closings():
"""Takes all school closings and returns a JSON-like dictionary:
{'Vermont':
[{'county': 'Bennington',
'closings': [{
'school': school_name,
'condition': condition},
... | apache-2.0 | Python |
03697ed92bd5b218e4083d8c5b9f20d221a046c5 | add domain coloring script | neozhaoliang/pywonderland,neozhaoliang/pywonderland | src/misc/domaincoloring.py | src/misc/domaincoloring.py | # -*- coding: utf-8 -*-
"""
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Domain Coloring of Complex Functions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Coloring scheme adapted from
"https://mathematica.stackexchange.com/questions/7275/how-can-i-generate-this-domain-coloring-plot"
"""
import numpy as np
import matplotlib.pypl... | # -*- coding: utf-8 -*-
"""
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Domain Coloring of Complex Functions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Coloring scheme adapted from
"https://mathematica.stackexchange.com/questions/7275/how-can-i-generate-this-domain-coloring-plot"
"""
import numpy as np
import matplotlib.pypl... | mit | Python |
cfd318c737f6c4580036c13d2acf32bca96654bf | Bump version | 5monkeys/django-bananas,5monkeys/django-bananas,5monkeys/django-bananas | bananas/__init__.py | bananas/__init__.py | VERSION = (1, 4, 4, "final", 0)
def get_version(version=None):
"""Derives a PEP386-compliant version number from VERSION."""
if version is None:
version = VERSION
assert len(version) == 5
assert version[3] in ("alpha", "beta", "rc", "final")
# Now build the two parts of the version number... | VERSION = (1, 4, 3, "final", 0)
def get_version(version=None):
"""Derives a PEP386-compliant version number from VERSION."""
if version is None:
version = VERSION
assert len(version) == 5
assert version[3] in ("alpha", "beta", "rc", "final")
# Now build the two parts of the version number... | mit | Python |
91e9b0a2e7610458677d804d208f8a5fc8ae5491 | Fix archive regression | bbqsrc/bandar | bandar/archivers.py | bandar/archivers.py | # Copyright (c) 2015 Brendan Molloy <brendan+freebsd@bbqsrc.net>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice,... | # Copyright (c) 2015 Brendan Molloy <brendan+freebsd@bbqsrc.net>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice,... | bsd-2-clause | Python |
178a1dccd87c84a39e4910393447f5189d1af2e1 | Handle new topic creation / LeaderNotAvailableError in initial SimpleProducer.send_messages call | wikimedia/operations-debs-python-kafka,Yelp/kafka-python,dpkp/kafka-python,Aloomaio/kafka-python,mumrah/kafka-python,gamechanger/kafka-python,scrapinghub/kafka-python,zackdever/kafka-python,scrapinghub/kafka-python,ohmu/kafka-python,ohmu/kafka-python,gamechanger/kafka-python,zackdever/kafka-python,DataDog/kafka-python,... | kafka/producer/simple.py | kafka/producer/simple.py | from __future__ import absolute_import
from itertools import cycle
import logging
import random
import six
from six.moves import xrange
from .base import Producer
log = logging.getLogger(__name__)
class SimpleProducer(Producer):
"""A simple, round-robin producer.
See Producer class for Base Arguments
... | from __future__ import absolute_import
from itertools import cycle
import logging
import random
import six
from six.moves import xrange
from .base import Producer
log = logging.getLogger(__name__)
class SimpleProducer(Producer):
"""A simple, round-robin producer.
See Producer class for Base Arguments
... | apache-2.0 | Python |
3ccc053c4cc8f84d5b5ab4662de861f62957d0f8 | update urls.py | aligot-project/aligot,aligot-project/aligot,aligot-project/aligot,skitoo/aligot | aligot/urls.py | aligot/urls.py | from django.conf import settings
from django.conf.urls import include, patterns, url
from django.conf.urls.static import static
from django.contrib import admin
from rest_framework.authtoken import views
from .views import api
urlpatterns = patterns(
'',
url(r'^$', 'aligot.views.html.index', name='index'),
... | from django.conf import settings
from django.conf.urls import include, patterns, url
from django.conf.urls.static import static
from django.contrib import admin
from rest_framework.authtoken import views
from .views import api
urlpatterns = patterns(
'',
url(r'^$', 'aligot.views.html.index', name='index'),
... | mit | Python |
37fa4d652c517206b632ea9e86906103887f5df1 | check for existing out_files | shnizzedy/SM_openSMILE,shnizzedy/SM_openSMILE,shnizzedy/SM_openSMILE,shnizzedy/SM_openSMILE,shnizzedy/SM_openSMILE | openSMILE_preprocessing/mxf_to_wav.py | openSMILE_preprocessing/mxf_to_wav.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
mxf_to_wav.py
Script to quickly convert an mp3 file to a waveform file.
Author:
โ Jon Clucas, 2016 (jon.clucas@childmind.org)
ยฉ 2016, Child Mind Institute, Apache v2.0 License
Created on Fri Dec 23 12:43:40 2016
@author: jon.clucas
"""
import argparse, sub... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
mxf_to_wav.py
Script to quickly convert an mp3 file to a waveform file.
Author:
โ Jon Clucas, 2016 (jon.clucas@childmind.org)
ยฉ 2016, Child Mind Institute, Apache v2.0 License
Created on Fri Dec 23 12:43:40 2016
@author: jon.clucas
"""
import argparse, sub... | apache-2.0 | Python |
7e73a57dccf1bcd0d28b50c8045e809dcbc6af65 | Refactor to use new custom serializers | pwalsh/openbudgets,pwalsh/openbudgets,openbudgets/openbudgets,openbudgets/openbudgets,pwalsh/openbudgets,openbudgets/openbudgets | openbudgets/apps/tools/serializers.py | openbudgets/apps/tools/serializers.py | from rest_framework import serializers
from openbudgets.apps.tools import models
from openbudgets.apps.accounts.serializers import AccountMin
from openbudgets.commons.serializers import UUIDRelatedField, UUIDPrimaryKeyRelatedField
class Tool(serializers.HyperlinkedModelSerializer):
"""Base Project serializer, exp... | from rest_framework import serializers
from openbudgets.apps.tools import models
from openbudgets.apps.accounts.serializers import AccountMin
from openbudgets.commons.serializers import UUIDRelatedField, UUIDPKRelatedField
class Tool(serializers.HyperlinkedModelSerializer):
"""Base Project serializer, exposing ou... | bsd-3-clause | Python |
69210dece07b0ca9ac71e67b0ad37256cb775762 | remove port definition | joedanz/flask-weather,joedanz/flask-weather | app/__init__.py | app/__init__.py | import os
import datetime
from sqlite3 import dbapi2 as sqlite3
from flask import Flask, render_template, redirect, g, flash, _app_ctx_stack
basedir = os.path.abspath(os.path.dirname(__file__))
# configuration
DATABASE = '../db/weather.db'
SECRET_KEY = 'hackerati'
DEBUG = True
# create application
app = Flask(__name_... | import os
import datetime
from sqlite3 import dbapi2 as sqlite3
from flask import Flask, render_template, redirect, g, flash, _app_ctx_stack
basedir = os.path.abspath(os.path.dirname(__file__))
# configuration
DATABASE = '../db/weather.db'
SECRET_KEY = 'hackerati'
DEBUG = True
# create application
app = Flask(__name_... | apache-2.0 | Python |
c67ea7029a8c8b9748c401dc4852f98f8bfc96a1 | Use contrail_vrouter_api instead of nova_contrail_vif. | tonyliu0592/opencontrail-netns,DreamLab/opencontrail-netns,pedro-r-marques/opencontrail-netns | opencontrail_netns/vrouter_control.py | opencontrail_netns/vrouter_control.py | import sys
import getopt
import logging
import socket
from contrail_lib import rpc_client_instance, uuid_from_string
import contrail_vrouter_api.gen_py.instance_service
def add_interface(interface_name, vmi, vm, mac):
from contrail_vrouter_api.gen_py.instance_service import ttypes
data = ttypes.Port(
... | import sys
import getopt
import logging
import socket
from contrail_lib import rpc_client_instance, uuid_from_string
import nova_contrail_vif.gen_py.instance_service
def add_interface(interface_name, vmi, vm, mac):
from nova_contrail_vif.gen_py.instance_service import ttypes
data = ttypes.Port(
uuid... | apache-2.0 | Python |
ac23df45dfdc4514d2487d6387909fdfecf23d05 | Clean up imports | bryanyang0528/ubike_api,pmrowla/goonbcs,QueryControl/querycontrol,Leonnash21/flask_heroku,bryanyang0528/ubike_api,bryanyang0528/ubike_api,Leonnash21/flask_heroku,QueryControl/querycontrol,pmrowla/goonbcs,Leonnash21/flask_heroku,QueryControl/querycontrol,Leonnash21/flask_heroku,Leonnash21/flask_heroku | app/__init__.py | app/__init__.py | """
Flask Documentation: http://flask.pocoo.org/docs/
Jinja2 Documentation: http://jinja.pocoo.org/2/documentation/
Werkzeug Documentation: http://werkzeug.pocoo.org/documentation/
This file creates your application.
"""
from flask import Flask
from . import settings
from .views import views
def creat... | """
Flask Documentation: http://flask.pocoo.org/docs/
Jinja2 Documentation: http://jinja.pocoo.org/2/documentation/
Werkzeug Documentation: http://werkzeug.pocoo.org/documentation/
This file creates your application.
"""
from flask import Flask
from views import views
import settings
def create_app():... | apache-2.0 | Python |
18c4444b2e8ab945017fbb23b98c1cbc4293850d | Revise class name | bowen0701/algorithms_data_structures | lc0394_decode_string.py | lc0394_decode_string.py | """Leetcode 394. Decode String
Medium
URL: https://leetcode.com/problems/decode-string/
Given an encoded string, return its decoded string.
The encoding rule is: k[encoded_string], where the encoded_string inside the
square brackets is being repeated exactly k times.
Note that k is guaranteed to be a positive inte... | """Leetcode 394. Decode String
Medium
URL: https://leetcode.com/problems/decode-string/
Given an encoded string, return its decoded string.
The encoding rule is: k[encoded_string], where the encoded_string inside the
square brackets is being repeated exactly k times.
Note that k is guaranteed to be a positive inte... | bsd-2-clause | Python |
f0c4bb32fe4afbca667f1c259916ea80d38f0d07 | fix incorrect database password | jgayfer/spirit | database.py | database.py | import MySQLdb
class DBase:
dsn = ("localhost","root","0perator","Spirit")
def __init__(self):
self.conn = MySQLdb.connect(*self.dsn)
self.cur = self.conn.cursor()
def __enter__(self):
return DBase()
def __exit__(self, exc_type, exc_val, exc_tb):
if self.conn:
... | import MySQLdb
class DBase:
dsn = ("localhost","root","Blue7Bone","Spirit")
def __init__(self):
self.conn = MySQLdb.connect(*self.dsn)
self.cur = self.conn.cursor()
def __enter__(self):
return DBase()
def __exit__(self, exc_type, exc_val, exc_tb):
if self.conn:
... | mit | Python |
0473ed1cc099a1fa4c6eb93deb51ed01ccc71bcf | put more long tests to level 3 | ZeitOnline/zeit.connector | src/zeit/connector/test.py | src/zeit/connector/test.py | # Copyright (c) 2007-2008 gocept gmbh & co. kg
# See also LICENSE.txt
"""Connector test setup."""
import os
import unittest
import zope.file.testing
from zope.testing import doctest
import zope.app.testing.functional
import zope.app.appsetup.product
import zeit.connector.cache
real_connector_layer = zope.app.test... | # Copyright (c) 2007-2008 gocept gmbh & co. kg
# See also LICENSE.txt
"""Connector test setup."""
import os
import unittest
import zope.file.testing
from zope.testing import doctest
import zope.app.testing.functional
import zope.app.appsetup.product
import zeit.connector.cache
real_connector_layer = zope.app.test... | bsd-3-clause | Python |
dbd5ed71f7ebd767b19391c0b8966c23f93c332b | Remove old route I forgot to delete. | Starbow/StarbowWebSite,Starbow/StarbowWebSite,Starbow/StarbowWebSite | starbowmodweb/user/urls.py | starbowmodweb/user/urls.py | from django.conf.urls import patterns, include, url
from django.views.generic import TemplateView
# Wrap our patterns in /site/ to match our deployment environment
urlpatterns = patterns('starbowmodweb.user.views',
url(r'^home', 'user_home', name='user_home'),
# Registration and authorization paths
url(r'... | from django.conf.urls import patterns, include, url
from django.views.generic import TemplateView
# Wrap our patterns in /site/ to match our deployment environment
urlpatterns = patterns('starbowmodweb.user.views',
url(r'^home', 'user_home', name='user_home'),
url(r'^activate', 'user_activate', name='user_acti... | mit | Python |
0d07ba6abcf3ba45dce0ffa198ca618b940d8d7a | Bump version | plugaai/aioinflux | aioinflux/__init__.py | aioinflux/__init__.py | # flake8: noqa
import warnings
no_pandas_warning = "Pandas/Numpy is not available. Support for 'dataframe' mode is disabled."
try:
import pandas as pd
import numpy as np
except ModuleNotFoundError:
pd = None
np = None
warnings.warn(no_pandas_warning)
from .client import InfluxDBClient, InfluxDBEr... | # flake8: noqa
import warnings
no_pandas_warning = "Pandas/Numpy is not available. Support for 'dataframe' mode is disabled."
try:
import pandas as pd
import numpy as np
except ModuleNotFoundError:
pd = None
np = None
warnings.warn(no_pandas_warning)
from .client import InfluxDBClient, InfluxDBEr... | mit | Python |
681f14de8b12e2edd1dcfda153e73fa4a578900f | make asyncsave thread based | Answeror/aip,Answeror/aip | aip/imfs/asyncsave.py | aip/imfs/asyncsave.py | from ..work import nonblock_call
class AsyncSave(object):
def __init__(self, base):
self.base = base
def save(self, name, data):
return nonblock_call(
self.base.save,
args=[name, data],
bound='io'
)
def __getattr__(self, name):
return ... | from ..work import nonblock
class AsyncSave(object):
def __init__(self, base):
self.base = base
def save(self, name, data):
return nonblock(self.base.save, name, data)
def __getattr__(self, name):
return getattr(self.base, name)
def asyncsave(base):
return AsyncSave(base)
| mit | Python |
da2e458efab4fd4198878c85a2d5af551859a1aa | change category | papouso/odoo,storm-computers/odoo,eino-makitalo/odoo,hoatle/odoo,ShineFan/odoo,sadleader/odoo,Endika/odoo,ramadhane/odoo,tarzan0820/odoo,matrixise/odoo,nitinitprof/odoo,mkieszek/odoo,virgree/odoo,BT-astauder/odoo,FlorianLudwig/odoo,tvibliani/odoo,sadleader/odoo,JGarcia-Panach/odoo,hassoon3/odoo,Bachaco-ve/odoo,shaufi/o... | addons/auction/__terp__.py | addons/auction/__terp__.py | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# ... | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# ... | agpl-3.0 | Python |
f06bf5e586fba690886a25d179272bbdae737fe0 | Update __init__.py | MahjongRepository/mahjong | mahjong/hand_calculating/yaku_list/__init__.py | mahjong/hand_calculating/yaku_list/__init__.py | from mahjong.hand_calculating.yaku_list.aka_dora import AkaDora
from mahjong.hand_calculating.yaku_list.chankan import Chankan
from mahjong.hand_calculating.yaku_list.chantai import Chantai
from mahjong.hand_calculating.yaku_list.chiitoitsu import Chiitoitsu
from mahjong.hand_calculating.yaku_list.chinitsu import Chini... | # -*- coding: utf-8 -*-
from mahjong.hand_calculating.yaku_list.aka_dora import AkaDora
from mahjong.hand_calculating.yaku_list.chankan import Chankan
from mahjong.hand_calculating.yaku_list.chantai import Chantai
from mahjong.hand_calculating.yaku_list.chiitoitsu import Chiitoitsu
from mahjong.hand_calculating.yaku_li... | mit | Python |
c217fafe6f406d258ceb1467f0af67c5d0fc5ea0 | add random file generation for partC | luozhaoyu/big-data-system,luozhaoyu/big-data-system,luozhaoyu/big-data-system | assignment3/partC/generate_files.py | assignment3/partC/generate_files.py | #!/usr/env/python
# -*- coding: utf-8 -*-
import os
import argparse
import random
import string
def get_random_word():
return get_random_string(random.randint(4, 12))
def get_random_string(length):
return ''.join(random.choice(string.ascii_lowercase) for _ in range(length))
def write_random_data(filepath):... | #!/usr/env/python
# -*- coding: utf-8 -*-
import argparse
import random
import string
def get_random_word():
return get_random_string(random.randint(4, 12))
def get_random_string(length):
return ''.join(random.choice(string.ascii_lowercase + string.digits) for _ in range(length))
def main():
parser = ... | mit | Python |
670bbf8758e63cfeafc1de6f9330403dec2517c2 | Revert "Fix plate-solving on local development mode" | astrobin/astrobin,astrobin/astrobin,astrobin/astrobin,astrobin/astrobin | astrobin_apps_platesolving/utils.py | astrobin_apps_platesolving/utils.py | # Python
import urllib2
# Django
from django.conf import settings
from django.core.files import File
from django.core.files.temp import NamedTemporaryFile
def getFromStorage(image, alias):
url = image.thumbnail(alias)
if "://" in url:
url = url.split('://')[1]
else:
url = settings.BASE_UR... | # Python
import urllib2
# Django
from django.conf import settings
from django.core.files import File
from django.core.files.temp import NamedTemporaryFile
def getFromStorage(image, alias):
def encoded(path):
return urllib2.quote(path.encode('utf-8'))
url = image.thumbnail(alias)
if "://" in url... | agpl-3.0 | Python |
14a29ffb43b15d673488312a2a25dda634a5bca5 | Remove unused function | Brok-Bucholtz/Ultrasound-Nerve-Segmentation | feature_extraction.py | feature_extraction.py | from PIL import Image
import glob
def _get_masks():
TRAIN_MASKS = './data/train/*_mask.tif'
return [Image.open(file_name) for file_name in glob.glob(TRAIN_MASKS)]
def _get_mask_labels():
mask_labels = []
for image in _get_masks():
mask_labels.append((image.filename, 255 in image.getdata(... | from PIL import Image
import glob
def _get_masks():
TRAIN_MASKS = './data/train/*_mask.tif'
return [Image.open(file_name) for file_name in glob.glob(TRAIN_MASKS)]
def _get_rectangle_masks():
rectangle_masks = []
for image in _get_masks():
rectangle_mask = ((0,0), (0,0))
mask_coord = ... | mit | Python |
8b0082118b6dfe2b84f1987f8531e16e5526872f | Update numc.py | konemshad/ML,mahesh-9/ML | ml/numc.py | ml/numc.py | import numpy as np
class nx:
"""a class for custom methods in numpy"""
def __init__(self,ob):
if not isinstance(ob,np.ndarray):
raise("expected np.array object")
else:
self.ob=ob
def add_col(self,col_no,val=np.inf):
"""this method returns an numpy.ndarray
which consists of an extra column (with a same ... | import numpy as np
class nx:
"""a class for custom methods in numpy"""
def __init__(self,ob):
if not isinstance(ob,np.ndarray):
raise("expected np.array object")
else:
self.ob=ob
def add_col(self,col_no,val=np.inf):
"""this method returns an numpy.ndarray
which consists of an extra column (with a same ... | mit | Python |
097cdfddc3fae2a2da61b038c5d4013f689b24dd | change alpha | minggli/fisheries-convnet,minggli/fisheries-convnet | app/settings.py | app/settings.py | # -*- coding: utf-8 -*-
MODEL_PATH = './trained_models/'
IMAGE_PATH = './data/'
IMAGE_SHAPE = (72, 128, 3)
BATCH_SIZE = 200
MAX_STEPS = 500
ALPHA = 1e-2
| # -*- coding: utf-8 -*-
MODEL_PATH = './trained_models/'
IMAGE_PATH = './data/'
IMAGE_SHAPE = (72, 128, 3)
BATCH_SIZE = 200
MAX_STEPS = 500
ALPHA = 1e-5
| mit | Python |
c5598abbc2643705375930d78b0c6d21df454cc4 | fix nested list in sorted_urls | minggli/chatbot,minggli/chatbot | app/map_urls.py | app/map_urls.py | """
map_urls
provide a mapping of useful urls that can be used as training data.
"""
import os
import sys
import re
import string
import pickle
import requests
from bs4 import BeautifulSoup
from .settings import DATA_LOC
sys.setrecursionlimit(30000)
def extract_index_pages(base_url):
"""obtain BodyMa... | """
map_urls
provide a mapping of useful urls that can be used as training data.
"""
import os
import sys
import re
import string
import pickle
import requests
from bs4 import BeautifulSoup
from .settings import DATA_LOC
sys.setrecursionlimit(30000)
def extract_index_pages(base_url):
"""obtain BodyMa... | mit | Python |
66b8e379f4c889fd2457e58102b2c25b9719b25e | Complete count_subsets_total_memo() | bowen0701/algorithms_data_structures | alg_count_subsets_total.py | alg_count_subsets_total.py | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
def count_subsets_total_recur(arr, total, n):
"""Count subsets given total by recusrion.
Time complexity: O(2^n), where n is length of array.
Space complexity: O(1).
"""
if total < 0:
... | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
def count_subsets_total_recur(arr, total, n):
if total < 0:
return 0
if total == 0:
return 1
if n < 0:
return 0
if total < arr[n]:
return count_subsets_total_r... | bsd-2-clause | Python |
ca6d0e94a288b4fa607ddca382657754a9893534 | Fix admin media | mlhamel/agendadulibre,mlhamel/agendadulibre,vcorreze/agendaEteAccoord,vcorreze/agendaEteAccoord,mlhamel/agendadulibre,vcorreze/agendaEteAccoord | agenda/urls.py | agenda/urls.py | #
# Copyright (C) 2009 Novopia Solutions Inc.
#
# Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@novopia.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
#... | #
# Copyright (C) 2009 Novopia Solutions Inc.
#
# Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@novopia.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
#... | agpl-3.0 | Python |
72e8f639455761f6e3701cb8c51ae59cd53c0650 | set to dev4 | CCI-Tools/cate-core,CCI-Tools/cate-core | cate/version.py | cate/version.py | # The MIT License (MIT)
# Copyright (c) 2016, 2017, 2018 by the ESA CCI Toolbox development team and
# contributors
#
# 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, incl... | # The MIT License (MIT)
# Copyright (c) 2016, 2017, 2018 by the ESA CCI Toolbox development team and
# contributors
#
# 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, incl... | mit | Python |
59d5ab8ed3f8a013d85d68f039f60e434fe54262 | Change notebook upload syntax | Anaconda-Platform/anaconda-client,Anaconda-Platform/anaconda-client,Anaconda-Platform/anaconda-client | binstar_client/commands/notebook.py | binstar_client/commands/notebook.py | """
Usage:
binstar notebook upload notebook.ipynb
binstar notebook upload project:PATH/TO/notebook.ipynb
binstar notebook download project
binstar notebook download project:notebook
"""
from __future__ import unicode_literals
import argparse
import logging
from binstar_client import errors
log = loggi... | """
Usage:
binstar notebook upload notebook
binstar notebook upload project/notebook
binstar notebook upload project/notebook-file.ipynb
binstar notebook download project
binstar notebook download project/notebook-file[.ipynb]
"""
from __future__ import unicode_literals
import argparse
import loggi... | bsd-3-clause | Python |
8746fdd2c26e95dbef84659f768683657dc5f28f | Update default.py | biothings/biothings.api,biothings/biothings.api,SuLab/biothings.api | biothings/tests/settings/default.py | biothings/tests/settings/default.py | ###################################################################################
# Nosetest settings
###################################################################################
# This is the name of the environment variable to load for testing
HOST_ENVAR_NAME = ''
# This is the URL of the production server,... | ###################################################################################
# Nosetest settings
###################################################################################
# This is the name of the environment variable to load for testing
HOST_ENVAR_NAME = ''
# This is the URL of the production server,... | apache-2.0 | Python |
03724b7770612e7826318836dcf8617e232b7379 | put commas in the business csv file | MMMAPSHACKS/BAM,MMMAPSHACKS/BAM,MMMAPSHACKS/BAM,MMMAPSHACKS/BAM,MMMAPSHACKS/BAM | source/get_businesses.py | source/get_businesses.py | # compute business duration records
import csv
businesses = {}
header = {}
rownum = 0
with open('sa.txt', 'rb') as f:
rdr = csv.reader(f, delimiter='\t')
for row in rdr:
rownum += 1
if rownum == 1:
colnum = 0
while colnum < len(row):
header[ row[colnum] ] = colnum
colnum += 1
else:
abn = row[... | # compute business duration records
import csv
businesses = {}
header = {}
rownum = 0
with open('sa.txt', 'rb') as f:
rdr = csv.reader(f, delimiter='\t')
for row in rdr:
rownum += 1
if rownum == 1:
colnum = 0
while colnum < len(row):
header[ row[colnum] ] = colnum
colnum += 1
else:
abn = row[... | bsd-2-clause | Python |
d1d60284c3f5742210d36282a6ef35cdf1994afc | Update to recognize new "no reports available" status message. | davidfstr/iTunes-Connect-Autodownload | autodownload.py | autodownload.py | import os
import re
import datetime
import subprocess
vendorid = 85838187 # David Foster
# Find all reports in the current directory
reports = [] # list of (vendorid, YYYYMMDD), both strings
for filename in os.listdir('.'):
# NOTE: Download filename format changed on... | import os
import re
import datetime
import subprocess
vendorid = 85838187 # David Foster
# Find all reports in the current directory
reports = [] # list of (vendorid, YYYYMMDD), both strings
for filename in os.listdir('.'):
# NOTE: Download filename format changed on... | mit | Python |
6a974c517aaea5a70b3987de4ec39802e86c1124 | Update admin.py | allenling/django-avatar,allenling/django-avatar | avatar/admin.py | avatar/admin.py | from django.contrib import admin
from django.utils.translation import ugettext_lazy as _
from django.utils import six
from django.template.loader import render_to_string
from avatar.models import Avatar
from avatar.signals import avatar_updated
from avatar.util import get_user_model
class AvatarAdmin(admin.ModelAdmi... | from django.contrib import admin
from django.utils.translation import ugettext_lazy as _
from django.utils import six
from django.template.loader import render_to_string
from avatar.models import Avatar
from avatar.signals import avatar_updated
from avatar.util import get_user_model
class AvatarAdmin(admin.ModelAdmi... | bsd-3-clause | Python |
5e53ba390b36925cfd158cb728e7e64b7a70b367 | fix config file loading | StoDevX/cs251-toolkit,StoDevX/cs251-toolkit,StoDevX/cs251-toolkit,StoDevX/cs251-toolkit | lib/check_for_updates.py | lib/check_for_updates.py | '''Check for program updates'''
import datetime
from . import yaml
from .run import run
from .helpers import warn
def check_for_updates():
'''Check for updates from git, at most once an hour'''
has_config = False
with open('.cs251toolkitrc.yaml', 'a+', encoding='utf-8') as config_file:
config_file... | '''Check for program updates'''
import datetime
from . import yaml
from .run import run
from .helpers import warn
def check_for_updates():
'''Check for updates from git, at most once an hour'''
has_config = False
with open('.cs251toolkitrc.yaml', 'a+', encoding='utf-8') as config_file:
config_fil... | mit | Python |
8e86338f6f638be462ec6c597d389650ac07e944 | Bump version. | concordusapps/alchemist | alchemist/_version.py | alchemist/_version.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals, absolute_import, division
__version_info__ = (0, 3, 3)
__version__ = '.'.join(map(str, __version_info__))
| # -*- coding: utf-8 -*-
from __future__ import unicode_literals, absolute_import, division
__version_info__ = (0, 3, 2)
__version__ = '.'.join(map(str, __version_info__))
| mit | Python |
e49e1f5d13ebe782cc72e2719c09904d2384fd22 | select top half of population (not bottom half) | desio05/HyperHeuristicKnapsack | algorithms/genetic.py | algorithms/genetic.py | import operator
import time
import numpy as np
from pathos.multiprocessing import ProcessPool as Pool
def crossover_selection(population, crossover_reproduction_func, mutation_func,
fitness_func, **kwargs):
population = list(sorted(population, key=operator.itemgetter("fitness"), reverse=T... | import operator
import time
import numpy as np
from pathos.multiprocessing import ProcessPool as Pool
def crossover_selection(population, part_of_best_to_stay_alive, crossover_reproduction_func, mutation_func,
fitness_func, **kwargs):
population = list(sorted(population, key=operator.item... | mit | Python |
1b9d34e3167078c029158498e24d067face50e39 | remove the shebang line | alphatwirl/alphatwirl,TaiSakuma/AlphaTwirl,alphatwirl/alphatwirl,alphatwirl/alphatwirl,alphatwirl/alphatwirl,TaiSakuma/AlphaTwirl | alphatwirl/Binning.py | alphatwirl/Binning.py | # Tai Sakuma <sakuma@fnal.gov>
##____________________________________________________________________________||
class Binning(object):
def __init__(self, boundaries = None, lows = None, ups = None, bins = None,
underflow_bin = None, overflow_bin = None):
if boundaries is None:
... | #!/usr/bin/env python
# Tai Sakuma <sakuma@fnal.gov>
##____________________________________________________________________________||
class Binning(object):
def __init__(self, boundaries = None, lows = None, ups = None, bins = None,
underflow_bin = None, overflow_bin = None):
if boundarie... | bsd-3-clause | Python |
de7b03072192ea59699aa72353dda96058ac486b | Add reboot to __all__ | bfirsh/loom,nithinphilips/loom,bfirsh/loom,nithinphilips/loom | loom/tasks.py | loom/tasks.py | from fabric.api import *
import subprocess
__all__ = ['ssh', 'all', 'uptime', 'upgrade', 'restart', 'reboot']
@task
def all():
"""
Select all hosts
"""
env.hosts = []
for hosts in env.roledefs.values():
env.hosts.extend(hosts)
# remove dupes
env.hosts = list(set(env.hosts))
@task
... | from fabric.api import *
import subprocess
__all__ = ['ssh', 'all', 'uptime', 'upgrade', 'restart']
@task
def all():
"""
Select all hosts
"""
env.hosts = []
for hosts in env.roledefs.values():
env.hosts.extend(hosts)
# remove dupes
env.hosts = list(set(env.hosts))
@task
def uptime... | bsd-3-clause | Python |
c15e9541d9bc198c457bdbe75b26d6569611c8ed | update all | bichocj/slack-deploy-github,bichocj/slack-deploy-github | lu/plugins.py | lu/plugins.py | import re
import subprocess
import subprocess
from slackbot.bot import listen_to
from slackbot.bot import respond_to
from lu.config import BASE_DIR, ENV_DIR
@respond_to('hi', re.IGNORECASE)
def hi(message):
message.react('+1')
message.reply('hi!')
@respond_to('help', re.IGNORECASE)
def help(message):
... | import re
import subprocess
import subprocess
from slackbot.bot import listen_to
from slackbot.bot import respond_to
from lu.config import BASE_DIR, ENV_DIR
@respond_to('hi', re.IGNORECASE)
def hi(message):
message.react('+1')
message.reply('hi!')
@respond_to('help', re.IGNORECASE)
def help(message):
... | apache-2.0 | Python |
1abb9f7e4ca622c8f18d898fbbcb8cacd0955451 | update mail tests | Connexions/openstax-cms,openstax/openstax-cms,Connexions/openstax-cms,openstax/openstax-cms,openstax/openstax-cms,openstax/openstax-cms | mail/tests.py | mail/tests.py | import json
from django.middleware import csrf
from django.test import Client, TestCase
class MailTest(TestCase):
def setUp(self):
self.client = Client(HTTP_USER_AGENT='Mozilla/5.0')
def test_get_csrf_token(self):
# testing that csrf token is returned on GET request to mail api
resp... | import json
from django.middleware import csrf
from django.test import Client, TestCase
class MailTest(TestCase):
def setUp(self):
self.client = Client(HTTP_USER_AGENT='Mozilla/5.0')
def test_get_csrf_token(self):
# testing that csrf token is returned on GET request to mail api
resp... | agpl-3.0 | Python |
316b42f550ea218faa7dd3af5d4daca58c4158e0 | Fix initial fill color of square ., | sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator | Demo/tkinter/guido/tst.py | Demo/tkinter/guido/tst.py | # tst.py
from Tkinter import *
import sys
def do_hello():
print 'Hello world!'
class Quit(Button):
def action(self):
self.quit()
def __init__(self, master=None, cnf={}):
Button.__init__(self, master,
{'text': 'Quit',
'command': self.action})
Button.config(self, cnf)
class Stuff(Canvas):
def ente... | # tst.py
from Tkinter import *
import sys
def do_hello():
print 'Hello world!'
class Quit(Button):
def action(self):
self.quit()
def __init__(self, master=None, cnf={}):
Button.__init__(self, master,
{'text': 'Quit',
'command': self.action})
Button.config(self, cnf)
class Stuff(Canvas):
def ente... | mit | Python |
6b74c09ac4b29e1064785a34d6fe55a5adab3ac0 | update version | UniversityOfNicosia/blockchain-certificates,UniversityOfNicosia/blockchain-certificates | blockchain_certificates/__init__.py | blockchain_certificates/__init__.py | __version__ = '1.1.1'
| __version__ = '1.1.0'
| mit | Python |
be6da0713bb5a6338f583525dec8f1baeec8e15d | add news view methods | OKThess/website,OKThess/website,OKThess/website | main/views.py | main/views.py | from django.shortcuts import render
from .models import Team, Job, Mentor, Meetup, Coworking, Post
def get_index(request):
return render(request, 'main/index.html')
def get_about(request):
return render(request, 'main/about.html', {
'page_title': 'ฮฃฯฮตฯฮนฮบฮฌ',
})
def get_teams(request):
teams ... | from django.shortcuts import render
from .models import Team, Job, Mentor, Meetup, Coworking
def get_index(request):
return render(request, 'main/index.html')
def get_about(request):
return render(request, 'main/about.html', {
'page_title': 'ฮฃฯฮตฯฮนฮบฮฌ',
})
def get_teams(request):
teams = Team... | mit | Python |
877bb419130a6d6ba4d66b4a19ee5d23b71f0c4c | Put a "onchange" to calculate fields # Operators, and Operator average hour cost, of model mrp.workcenter. | factorlibre/odoomrp-wip,odoomrp/odoomrp-wip,Eficent/odoomrp-wip,factorlibre/odoomrp-wip,sergiocorato/odoomrp-wip,odoocn/odoomrp-wip,Endika/odoomrp-wip,diagramsoftware/odoomrp-wip,alfredoavanzosc/odoomrp-wip-1,odoomrp/odoomrp-wip,windedge/odoomrp-wip,agaldona/odoomrp-wip-1,sergiocorato/odoomrp-wip,michaeljohn32/odoomrp-... | mrp_operations_extension/models/mrp_workcenter.py | mrp_operations_extension/models/mrp_workcenter.py | # -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in root directory
##############################################################################
from openerp import models, fields, api
from openerp.addons... | # -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in root directory
##############################################################################
from openerp import models, fields, api
from openerp.addons... | agpl-3.0 | Python |
b32da719ef1d82202bc5b13eab1206e0cd311bff | remove uneeded code for prepending http in urls | Ilias95/guitarchords,Ilias95/guitarchords,Ilias95/guitarchords,Ilias95/guitarchords | chords/forms.py | chords/forms.py | from django.forms import ModelForm, CharField, Textarea
from .models import Song
from .utils import strip_whitespace_lines
class AddSongForm(ModelForm):
artist_txt = CharField(
max_length=100,
label='Artist',
help_text='Surname Name format, required'
)
class Meta:
... | from django.forms import ModelForm, CharField, Textarea
from .models import Song
from .utils import strip_whitespace_lines
class AddSongForm(ModelForm):
artist_txt = CharField(
max_length=100,
label='Artist',
help_text='Surname Name format, required'
)
class Meta:
... | mit | Python |
821c110d3ba99cc3b9bd242bcb90e19355701499 | merge conflict | superphy/backend | app/factory.py | app/factory.py | '''
this is the app factory
'''
from flask import Flask
from flask_bootstrap import Bootstrap
import config
from routes.views import bp as spfy
from routes.ra_views import bp_ra_views
from routes.ra_posts import bp_ra_posts
from routes.ra_statuses import bp_ra_statuses
from routes.ra_module_database import bp_ra_db
fr... | '''
this is the app factory
'''
from flask import Flask
from flask_bootstrap import Bootstrap
import config
from routes.views import bp as spfy
from routes.ra_views import bp_ra_views
from routes.ra_posts import bp_ra_posts
from routes.ra_statuses import bp_ra_statuses
from routes.ra_module_database import bp_ra_db
fr... | apache-2.0 | Python |
8e93c46f3507c7cb33447f913e89c5cdcdccc28f | tweak db init scripts | nathanbjenx/cairis,failys/CAIRIS,nathanbjenx/cairis,failys/CAIRIS,nathanbjenx/cairis,failys/CAIRIS,nathanbjenx/cairis | cairis/test/CairisDaemonTestCase.py | cairis/test/CairisDaemonTestCase.py | # 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
# "License"); you may... | # 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
# "License"); you may... | apache-2.0 | Python |
ac90ccad7ccc679335749bf25e9c8b6d1a55a47a | Add missing colons | deepmind/open_spiel,deepmind/open_spiel,deepmind/open_spiel,deepmind/open_spiel,deepmind/open_spiel,deepmind/open_spiel | noxfile.py | noxfile.py | # Copyright 2019 DeepMind Technologies Ltd. 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 appl... | # Copyright 2019 DeepMind Technologies Ltd. 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 appl... | apache-2.0 | Python |
14e923fe32a20bb1c109c8976ed4c38a510bdf75 | Use instance content type validator. | joyxu/kernelci-backend,kernelci/kernelci-backend,joyxu/kernelci-backend,kernelci/kernelci-backend,joyxu/kernelci-backend | app/handlers/job.py | app/handlers/job.py | # Copyright (C) 2014 Linaro Ltd.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distribute... | # Copyright (C) 2014 Linaro Ltd.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distribute... | agpl-3.0 | Python |
7df7ba2d95cd27bba56e3435d34ff012a2238b20 | Modify construction | lewangbtcc/anti-XSS,lewangbtcc/anti-XSS | lib/generator/report.py | lib/generator/report.py | #!/usr/bin/env python
"""
Copyright (c) 2016 anti-XSS developers (http://laiw3n.com/)
"""
import sys
import os
def gnrReport(xssScripts):
fileName = 'result/report.md'
if not os.path.exists('result/'):
os.mkdir(r'result/')
f = open(fileName, 'w')
f.write('# anti-XSS Cross Site Script Sca... | #!/usr/bin/env python
"""
Copyright (c) 2016 anti-XSS developers (http://laiw3n.com/)
"""
import sys
import os
def gnrReport(xssScripts):
fileName = 'result/report.md'
if not os.path.exists('result/'):
os.mkdir(r'result/')
f = open(fileName, 'w')
f.write('# anti-XSS Cross Site Script Sca... | mit | Python |
d5589b00bb1cb0c18c7eee6fa8f1207e0711c342 | make StandOff tests run, again: Mserver needs to be started with --dbinit="module(pathfinder);" | zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb | pathfinder/tests/StandOff/StandOff.py | pathfinder/tests/StandOff/StandOff.py | import os
import string
TST = os.environ['TST']
TSTDB = os.environ['TSTDB']
MSERVER = os.environ['MSERVER'].replace('--trace','')
TSTSRCDIR = os.environ['TSTSRCDIR']
CALL = 'pf --enable-standoff %s.xq | %s --set standoff=enabled --dbname=%s --dbinit="module(pathfinder);"' % (os.path.join(TSTSRCDIR,TST),MSERVER,TSTDB)... | import os
import string
TST = os.environ['TST']
TSTDB = os.environ['TSTDB']
MSERVER = os.environ['MSERVER'].replace('--trace','')
TSTSRCDIR = os.environ['TSTSRCDIR']
CALL = "pf --enable-standoff %s.xq | %s --set standoff=enabled --dbname=%s" % (os.path.join(TSTSRCDIR,TST),MSERVER,TSTDB)
if os.name == "nt":
os.sy... | mpl-2.0 | Python |
5c8424f92ffaa745d3daebca3f38de2569500d6d | bump the version | SheffieldML/GPyOpt | GPyOpt/__version__.py | GPyOpt/__version__.py | __version__ = "1.2.1"
| __version__ = "1.2.0"
| bsd-3-clause | Python |
b8c8b003d39840df9473200747d50fdab673d30e | Bump version | thombashi/sqliteschema | sqliteschema/__version__.py | sqliteschema/__version__.py | # encoding: utf-8
from datetime import datetime
__author__ = "Tsuyoshi Hombashi"
__copyright__ = "Copyright 2016-{}, {}".format(datetime.now().year, __author__)
__license__ = "MIT License"
__version__ = "0.16.2"
__maintainer__ = __author__
__email__ = "tsuyoshi.hombashi@gmail.com"
| # encoding: utf-8
from datetime import datetime
__author__ = "Tsuyoshi Hombashi"
__copyright__ = "Copyright 2016-{}, {}".format(datetime.now().year, __author__)
__license__ = "MIT License"
__version__ = "0.16.1"
__maintainer__ = __author__
__email__ = "tsuyoshi.hombashi@gmail.com"
| mit | Python |
670d725a218105cfa5438fe66001c502073334eb | Make handler symbol private | data-exp-lab/girder,kotfic/girder,kotfic/girder,jbeezley/girder,Kitware/girder,RafaelPalomar/girder,kotfic/girder,Kitware/girder,manthey/girder,girder/girder,girder/girder,RafaelPalomar/girder,Kitware/girder,data-exp-lab/girder,girder/girder,data-exp-lab/girder,RafaelPalomar/girder,data-exp-lab/girder,jbeezley/girder,k... | plugins/audit_logs/server/__init__.py | plugins/audit_logs/server/__init__.py | import cherrypy
import datetime
import logging
from girder import auditLogger
from girder.models.model_base import Model
from girder.api.rest import getCurrentUser
class Record(Model):
def initialize(self):
self.name = 'audit_log_record'
def validate(self, doc):
return doc
class _AuditLogDa... | import cherrypy
import datetime
import logging
from girder import auditLogger
from girder.models.model_base import Model
from girder.api.rest import getCurrentUser
class Record(Model):
def initialize(self):
self.name = 'audit_log_record'
def validate(self, doc):
return doc
class AuditLogHan... | apache-2.0 | Python |
fa91b3b426867f47d6873fd09ac0cc02b29cc76f | fix handling of notifications' timeout on Linux | kived/plyer,KeyWeeUsr/plyer,kived/plyer,kivy/plyer,KeyWeeUsr/plyer,kivy/plyer,KeyWeeUsr/plyer,kivy/plyer | plyer/platforms/linux/notification.py | plyer/platforms/linux/notification.py | import subprocess
from plyer.facades import Notification
from plyer.utils import whereis_exe
class NotifySendNotification(Notification):
''' Pops up a notification using notify-send
'''
def _notify(self, **kwargs):
subprocess.call(["notify-send",
kwargs.get('title'),
... | import subprocess
from plyer.facades import Notification
from plyer.utils import whereis_exe
class NotifySendNotification(Notification):
''' Pops up a notification using notify-send
'''
def _notify(self, **kwargs):
subprocess.call(["notify-send",
kwargs.get('title'),
... | mit | Python |
619f448ad0470a5e774594a10beb2b2dabb6172f | Test for visibility | Ecotrust/forestplanner,Ecotrust/forestplanner,Ecotrust/forestplanner,Ecotrust/forestplanner,Ecotrust/forestplanner,Ecotrust/forestplanner,Ecotrust/forestplanner,Ecotrust/forestplanner | lot/landmapper/tests/test_bypassaddressinput.py | lot/landmapper/tests/test_bypassaddressinput.py | from django.test import TestCase
from django.conf import settings
from django.contrib.staticfiles.testing import StaticLiveServerTestCase
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
# from selenium.webdriver.fir... | from django.test import TestCase
from django.conf import settings
from django.contrib.staticfiles.testing import StaticLiveServerTestCase
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
# from selenium.webdriver.fir... | bsd-3-clause | Python |
79d09715112e9ce931c2e3874b8e761b2c2ac47e | Add logging configuration | aapris/IoT-Web-Experiments | iotendpoints/local_settings-example.py | iotendpoints/local_settings-example.py |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '1_y=*j=_7oc2gasdasdasd&-qzz+hon#m+og$_@wyw7o9a$98)'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
ALLOWED_HOSTS = []
# A... |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = '1_y=*j=_7oc2gasdasdasd&-qzz+hon#m+og$_@wyw7o9a$98)'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
ALLOWED_HOSTS = []
# A... | mit | Python |
567fd4a6ef6e4ac12d0f7463a7d150549eaff399 | Fix data loading order | xcgd/account_streamline | __openerp__.py | __openerp__.py | # -*- coding: utf-8 -*-
##############################################################################
#
##############################################################################
{
"name": "Account Streamline",
"version": "1.1",
"author": "XCG Consulting",
"category": 'Accounting',
"description... | # -*- coding: utf-8 -*-
##############################################################################
#
##############################################################################
{
"name": "Account Streamline",
"version": "1.1",
"author": "XCG Consulting",
"category": 'Accounting',
"description... | agpl-3.0 | Python |
f5114ffaede2ea4410ee30a22e53fad2e9590a00 | Use mapValues | zhwa/thunder,oliverhuangchao/thunder,pearsonlab/thunder,j-friedrich/thunder,kcompher/thunder,broxtronix/thunder,thunder-project/thunder,oliverhuangchao/thunder,mikarubi/thunder,zhwa/thunder,pearsonlab/thunder,j-friedrich/thunder,jwittenbach/thunder,kunallillaney/thunder,poolio/thunder,kcompher/thunder,kunallillaney/thu... | trigger.py | trigger.py | import sys
import os
from numpy import *
from scipy.linalg import *
from scipy.io import *
from pyspark import SparkContext
import logging
if len(sys.argv) < 5:
print >> sys.stderr, \
"(trigger) usage: trigger <master> <inputFile_X> <inputFile_t> <outputFile>"
exit(-1)
def parseVector(line):
vec = [float(x) f... | import sys
import os
from numpy import *
from scipy.linalg import *
from scipy.io import *
from pyspark import SparkContext
import logging
if len(sys.argv) < 5:
print >> sys.stderr, \
"(trigger) usage: trigger <master> <inputFile_X> <inputFile_t> <outputFile>"
exit(-1)
def parseVector(line):
vec = [float(x) f... | apache-2.0 | Python |
1f3d64b87ee69e54adf1ad18b982f9970e021f9a | remove deprecated attribute | it-projects-llc/misc-addons,it-projects-llc/misc-addons,it-projects-llc/misc-addons | attachment_large_object/tests/__init__.py | attachment_large_object/tests/__init__.py | from . import test_attachment
| from . import test_attachment
fast_suite = [test_attachment,
]
| mit | Python |
aaa6b6683e4ce46ec672899802c035c592d50b0e | Add slug field to file upload meta table, rename table | sprin/heroku-tut | app/initial_tables.py | app/initial_tables.py | from tables import engine
def create_tables():
"""
Create tables the lazy way... with raw SQL.
"""
conn = engine.raw_connection()
cur = conn.cursor()
cur.execute(
"""
CREATE TABLE file_upload_meta(
document_name TEXT NOT NULL
, document_slug TEXT NOT NULL
, time_uploaded TEXT NOT NU... | from tables import engine
def create_tables():
"""
Create tables the lazy way... with raw SQL.
"""
conn = engine.raw_connection()
cur = conn.cursor()
cur.execute(
"""
CREATE TABLE file_upload(
document_name TEXT
, time_uploaded TEXT DEFAULT now()
, filename TEXT NOT NULL
, word_... | mit | Python |
a0431b083aa4c0aed972d5d06b0e8cee23b6d75b | add git-status | dgu-dna/DNA-Bot,MinJunKweon/DNA-Bot | apps/system.py | apps/system.py | #-*- coding: utf-8 -*-
from __future__ import unicode_literals
from decorators import on_command
import subprocess
from subprocess import check_output
@on_command(['SYSTEM'])
def run(robot, channel, tokens, user):
''' '''
rootuser=set(['U0SPF91EE','U0SPXF0Q7'])
if str(user) not in rootuser:
return c... | #-*- coding: utf-8 -*-
from __future__ import unicode_literals
from decorators import on_command
import subprocess
from subprocess import check_output
@on_command(['SYSTEM'])
def run(robot, channel, tokens, user):
''' ์ผ๋ฐ ์ฌ์ฉ์๋ ์ด์ฉํ ์ ์์ต๋๋ค'''
rootuser=set(['U0SPF91EE','U0SPXF0Q7'])
if str(user) not in rootuser... | mit | Python |
5b49de75b6b0d2bbce93f910b76af9d7a325c14f | Add some fields to models | DavidJFelix/hatchit,DavidJFelix/hatchit,DavidJFelix/hatchit | src/event_manager/models.py | src/event_manager/models.py | from django.db import models
class Suggestion(models.Model):
YES = 'Y'
NO = 'N'
MAYBE = 'M'
NONE = 'O'
RESPONSE_CHOICES = (
(YES, 'Yes'),
(NO, 'No'),
(MAYBE, 'Maybe'),
(NONE, 'No vote'),
)
#user=
response = models.CharField(
max_length=1,
choices=RESPONSE_CHOICES,
default=NONE)
#suggestion_ty... | from django.db import models
# Create your models here.
class User(models.Model):
pass
class Suggestion(models.Model):
pass
class Event(models.Model):
pass
| agpl-3.0 | Python |
2222d6b50a4a58177381d73bac2bbeaea2679f8c | Update autopackage | dmcooke/tradecd | package.py | package.py | #!/usr/bin/env python
import sys
import os
import glob
import zipfile
def read_toc(toc):
fo = open(toc, 'r')
d = {}
files = []
for line in fo:
line = line.strip()
if line.startswith('##'):
k, v = line.lstrip('#').strip().split(':', 1)
d[k.lower()] = v.strip()
... | #!/usr/bin/env python
import sys
import os
import zipfile
def read_toc(toc):
fo = open(toc, 'r')
d = {}
files = []
for line in fo:
line = line.strip()
if line.startswith('##'):
k, v = line.lstrip('#').strip().split(':', 1)
d[k.lower()] = v.strip()
elif li... | mit | Python |
e1ff6ef100c780ceb8b4a3d5c5aaf0c63d52bb86 | update regression example | maxim5/hyper-engine | hyperengine/examples/1_6_optimizing_regression.py | hyperengine/examples/1_6_optimizing_regression.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'maxim'
import tensorflow as tf
import hyperengine as hype
from common import get_wine_data
def dnn_model(params):
x = tf.placeholder(shape=[None, 11], dtype=tf.float32, name='input')
y = tf.placeholder(shape=[None], dtype=tf.float32, name='label')
mo... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'maxim'
import tensorflow as tf
import hyperengine as hype
from common import get_wine_data
def dnn_model(params):
x = tf.placeholder(shape=[None, 11], dtype=tf.float32, name='input')
y = tf.placeholder(shape=[None], dtype=tf.float32, name='label')
mo... | apache-2.0 | Python |
0bc8e006a6cbea7e2fc9497d68b0a55833aafacb | Bump version to dev (#982) | sphinx-gallery/sphinx-gallery,sphinx-gallery/sphinx-gallery | sphinx_gallery/__init__.py | sphinx_gallery/__init__.py | """
Sphinx Gallery
==============
"""
import os
# dev versions should have "dev" in them, stable should not.
# doc/conf.py makes use of this to set the version drop-down.
__version__ = '0.12.0.dev0'
def glr_path_static():
"""Returns path to packaged static files"""
return os.path.abspath(os.path.join(os.path... | """
Sphinx Gallery
==============
"""
import os
# dev versions should have "dev" in them, stable should not.
# doc/conf.py makes use of this to set the version drop-down.
__version__ = '0.11.0'
def glr_path_static():
"""Returns path to packaged static files"""
return os.path.abspath(os.path.join(os.path.dirn... | bsd-3-clause | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.