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 |
|---|---|---|---|---|---|---|---|---|
ccd6c50e442a437469d989d4c2d174507ef430da | Update newServer.py | mrahman1122/Team4CS3240 | Server/newServer.py | Server/newServer.py | __author__ = 'masudurrahman'
import sys
from twisted.protocols import ftp
from twisted.protocols.ftp import FTPFactory, FTPAnonymousShell, FTPRealm, FTP, FTPShell, IFTPShell
from twisted.cred.portal import Portal
from twisted.cred import checkers
from twisted.cred.checkers import AllowAnonymousAccess, FilePasswordDB
f... | __author__ = 'masudurrahman'
import sys
from twisted.protocols import ftp
from twisted.protocols.ftp import FTPFactory, FTPAnonymousShell, FTPRealm, FTP, FTPShell, IFTPShell
from twisted.cred.portal import Portal
from twisted.cred import checkers
from twisted.cred.checkers import AllowAnonymousAccess, FilePasswordDB
f... | apache-2.0 | Python |
49c759e3b2c1e8fffc036f16b54432d011afe230 | Make demo parser better. | christabor/csscms,christabor/csscms,christabor/csscms | demo/demo.py | demo/demo.py | from csscms.parser import InputBuilder
import os
try:
print('[DEBUG] Running demo')
output = [
'bootstrap3',
'fa',
'test-inputs',
'simple'
]
name = raw_input('Which one (choose a number)?\n{}\n=> '.format('\n'.join(
['{}: {} '.format(k + 1, v) for k, v in enumera... | from csscms.parser import InputBuilder
import os
# try:
print('[DEBUG] Running demo')
name = raw_input('Which one (choose a number)?'
'\n1. Bootstrap3 \n2. Font-awesome \n3. Test\n=> ')
output = {
'1': 'bootstrap3',
'2': 'fa',
'3': 'test-inputs',
'4': 'simple'
}
InputBuilder('{}/{}.c... | mit | Python |
9af81b5f67fa86aae9cc31a050dbb1654db61c08 | acelera a query | anselmobd/fo2,anselmobd/fo2,anselmobd/fo2,anselmobd/fo2 | src/cd/queries/novo_modulo/refs_de_modelo.py | src/cd/queries/novo_modulo/refs_de_modelo.py | from pprint import pprint
from utils.functions.models.dictlist import dictlist_lower
from utils.functions.queries import debug_cursor_execute
from lotes.functions.varias import modelo_de_ref
def to_set(cursor, modelo, com_op=None, com_ped=None):
data = query(cursor, modelo, com_op, com_ped)
return set([
... | from pprint import pprint
from utils.functions.models.dictlist import dictlist_lower
from utils.functions.queries import debug_cursor_execute
from lotes.functions.varias import modelo_de_ref
def to_set(cursor, modelo, com_op=None, com_ped=None):
data = query(cursor, modelo, com_op, com_ped)
return set([
... | mit | Python |
9d513f1be02c40882d865c56728e2538d93d6661 | Update InMoov2.minimal.py | robojukie/myrobotlab,MyRobotLab/myrobotlab,robojukie/myrobotlab,MyRobotLab/myrobotlab,MyRobotLab/myrobotlab,lanchun/myrobotlab,MyRobotLab/myrobotlab,MyRobotLab/myrobotlab,lanchun/myrobotlab,MyRobotLab/myrobotlab,MyRobotLab/myrobotlab,robojukie/myrobotlab,lanchun/myrobotlab | src/resource/Python/examples/InMoov2.minimal.py | src/resource/Python/examples/InMoov2.minimal.py | #file : InMoov2.minimal.py
# this will run with versions of MRL above 1695
# a very minimal script for InMoov
# although this script is very short you can still
# do voice control of a right hand or finger box
# for any command which you say - you will be required to say a confirmation
# e.g. you say -> open hand, InM... | #file : InMoov2.minimal.py
# this will run with versions of MRL above 1695
# a very minimal script for InMoov
# although this script is very short you can still
# do voice control of a right hand or finger box
# for any command which you say - you will be required to say a confirmation
# e.g. you say -> open hand, InM... | apache-2.0 | Python |
5b639b69b359ee0c934a77b2aa8fcccc4952193b | Add not null to DB CREATE statement. | averagesecurityguy/zkm | db.py | db.py | # -*- coding: utf-8 -*-
#
# Copyright 2015 LCI Technology Group, LLC
# All rights reserved
import sqlite3
import logging
MAX_RETURN = 200
MAX_KEEP = 2000
# Create an exception class.
class DatabaseException(Exception):
pass
class ZKMDatabase():
def __init__(self):
self.conn = sqlite3.connect('zkm.s... | # -*- coding: utf-8 -*-
#
# Copyright 2015 LCI Technology Group, LLC
# All rights reserved
import sqlite3
import logging
MAX_RETURN = 200
MAX_KEEP = 2000
# Create an exception class.
class DatabaseException(Exception):
pass
class ZKMDatabase():
def __init__(self):
self.conn = sqlite3.connect('zkm.s... | bsd-3-clause | Python |
19647861f27cf78b49a22455730b53e3d40cd70f | add json format | hpsoar/pplib | ff.py | ff.py | # -*- coding: utf-8 -*-
import os
import errno
def ensure_path(path):
try:
os.makedirs(path)
except OSError as exc: # Python >2.5
if exc.errno == errno.EEXIST and os.path.isdir(path):
pass
else:
raise
def save(filename, content):
import os
path = os.... | # -*- coding: utf-8 -*-
import os
import errno
def ensure_path(path):
try:
os.makedirs(path)
except OSError as exc: # Python >2.5
if exc.errno == errno.EEXIST and os.path.isdir(path):
pass
else:
raise
def save(filename, content):
import os
path = os.... | mit | Python |
0f04c5135ede059bb47bb1d7784793a0c47f1b14 | Add `async` option for `update-erf-areas` command | FireCARES/firecares,FireCARES/firecares,FireCARES/firecares,FireCARES/firecares,FireCARES/firecares | firecares/firestation/management/commands/update-erf-areas.py | firecares/firestation/management/commands/update-erf-areas.py | import os
import argparse
from django.core.management.base import BaseCommand
from firecares.firestation.models import FireDepartment
from firecares.tasks.update import update_parcel_department_effectivefirefighting_rollup
class Command(BaseCommand):
help = """Updates the Effective Response Force (ERF) areas for t... | import os
import argparse
from django.core.management.base import BaseCommand
from firecares.firestation.models import FireDepartment
from firecares.tasks.update import update_parcel_department_effectivefirefighting_rollup
class Command(BaseCommand):
help = """Updates the Effective Response Force (ERF) areas for t... | mit | Python |
527319167486bf3c042899a7f7a1e443e7e67430 | fix for recreation of broken links | inveniosoftware/invenio,inveniosoftware/invenio,tiborsimko/invenio,tiborsimko/invenio | invenio/ext/collect/storage/link.py | invenio/ext/collect/storage/link.py | # -*- coding: utf8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2014 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or (at your option) an... | # -*- coding: utf8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2014 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or (at your option) an... | mit | Python |
26e166a40156423b6eb1b0d5c46ff50700da4d5f | Fix unicode decode error | davande/hackernews-top,rylans/hackernews-top | top.py | top.py | ## top.py
## Get top stories from Hacker News' official API
##
## Rylan Santinon
import urllib2
import json
output_file = "top.out"
def write_stories(stories):
f = open(output_file, "w")
for story in stories:
story_string = story_to_string(story).encode('utf-8')
f.write(story_string)
f.write('\n')
... | ## top.py
## Get top stories from Hacker News' official API
##
## Rylan Santinon
import urllib2
import json
def make_item_endpoint(item_id):
return "https://hacker-news.firebaseio.com/v0/item/" + str(item_id) + ".json"
def story_to_string(story):
score = story["score"]
title = story["title"]
by = story["by"]... | apache-2.0 | Python |
2add829972b43d2fb653f7bfb2795615cb678e95 | Remove semicolon | bechynsky/Micropython | 101.py | 101.py | # functions related to the board - http://docs.micropython.org/en/latest/esp8266/library/machine.html
import machine
import time
# Define pin 2 as output
# There id build-in LED on pin 2, use ESP8266 GPIO pin numbers
# https://www.wemos.cc/product/d1-mini-pro.html
pin = machine.Pin(2, machine.Pin.OUT)
while True:
... | # functions related to the board - http://docs.micropython.org/en/latest/esp8266/library/machine.html
import machine
import time
# Define pin 2 as output
# There id build-in LED on pin 2, use ESP8266 GPIO pin numbers
# https://www.wemos.cc/product/d1-mini-pro.html
pin = machine.Pin(2, machine.Pin.OUT)
while True:
... | mit | Python |
78811282c679f6f14ccd68f7ce5ef7ffdce25940 | fix white space, add version check, app data | kylerbrown/openephys | Kwik.py | Kwik.py | # -*- coding: utf-8 -*-
"""
Created on Wed Oct 8 12:05:54 2014
@author: Josh Siegle
Loads .kwd files
"""
import h5py
import numpy as np
def load(filename, dataset=0):
f = h5py.File(filename, "r")
assert f.attrs["kwik_version"] == 2
data = {}
recording = f["recordings"][str(dataset)]
data["inf... | # -*- coding: utf-8 -*-
"""
Created on Wed Oct 8 12:05:54 2014
@author: Josh Siegle
Loads .kwd files
"""
import h5py
import numpy as np
def load(filename, dataset=0):
f = h5py.File(filename, 'r')
data = {}
data['info'] = f['recordings'][str(dataset)].attrs
data['data'] = f['reco... | mit | Python |
d8dbcaa7cfb4f8cf61ad2151f01247fe7898dde6 | Remove manual setting of secret_key | shenki/strava-fixer | app.py | app.py | #!/usr/bin/python
import flask
import logging
import stravalib
app = flask.Flask(__name__)
app.config.from_envvar('FIXSTRAVA_CONFIG')
logging.basicConfig(level=logging.INFO)
@app.route('/')
def homepage():
if 'access_token' not in flask.session:
return flask.redirect(flask.url_for('login'))
client ... | #!/usr/bin/python
import flask
import logging
import stravalib
app = flask.Flask(__name__)
app.config.from_envvar('FIXSTRAVA_CONFIG')
logging.basicConfig(level=logging.INFO)
app.secret_key = SECRET_KEY
@app.route('/')
def homepage():
if 'access_token' not in flask.session:
return flask.redirect(flask.u... | agpl-3.0 | Python |
f7438559cb38b6b3d758f68c7378347699242c07 | fix datetime typo | joshfinnie/Flask-Job-Board,joshfinnie/Flask-Job-Board | app.py | app.py | import os
from datetime import datetime
from flask import Flask, render_template
import settings
from mongoengine import connect, Document, StringField, EmailField, BooleanField, DateTimeField, URLField
app = Flask(__name__)
app.config.from_object(settings)
connect('app2312735',
host='staff.mongohq.com',
... | import os
import datetime
from flask import Flask, render_template
import settings
from mongoengine import connect, Document, StringField, EmailField, BooleanField, DateTimeField, URLField
app = Flask(__name__)
app.config.from_object(settings)
connect('app2312735',
host='staff.mongohq.com',
port=1009... | mit | Python |
1576d06e53cd5a729d9e742d09f777bfe86a14c1 | Remove unnecessary suffix judgement | torpedoallen/drag-me-here,qingfeng/p,qingfeng/p,qingfeng/p,torpedoallen/drag-me-here,torpedoallen/drag-me-here | app.py | app.py | import os
import uuid
import Image
import cropresize
from flask import Flask, request, redirect, url_for, abort
from dae.api import permdir
UPLOAD_FOLDER = permdir.get_permdir()
ALLOWED_EXTENSIONS = set(['txt', 'pdf', 'png', 'jpg', 'jpeg', 'gif'])
app = Flask(__name__)
app.config['UPLOAD_FOLDER'] = UPLOAD_FOLDER
app... | import os
import uuid
import Image
import cropresize
from flask import Flask, request, redirect, url_for, abort
from dae.api import permdir
UPLOAD_FOLDER = permdir.get_permdir()
ALLOWED_EXTENSIONS = set(['txt', 'pdf', 'png', 'jpg', 'jpeg', 'gif'])
app = Flask(__name__)
app.config['UPLOAD_FOLDER'] = UPLOAD_FOLDER
app... | bsd-3-clause | Python |
58a828266444f080f00180220de654bf1b85c181 | Use conn stack and GMail SMTP | doomspork/seancallan.com,doomspork/seancallan.com,doomspork/seancallan.com | app.py | app.py | """
Basic Application
"""
import json
import os
from envelopes import Envelope, GMailSMTP
import envelopes.connstack
from flask import Flask, jsonify, render_template, request, send_from_directory
from flask.ext.assets import Environment
from webassets.loaders import PythonLoader
app = Flask(__name__, static_folder='... | """
Basic Application
"""
import os
from envelopes import Envelope
from flask import Flask, jsonify, render_template, request, send_from_directory
from flask.ext.assets import Environment
from webassets.loaders import PythonLoader
app = Flask(__name__, static_folder='static')
app.config['DEBUG'] = True
app.config['SE... | mit | Python |
89d3abbe62f22378113ba8950edf6aa75d853814 | add tags argument for records | babsey/sumatra-helpers | aux.py | aux.py | import argparse
import time
import os
from sumatra.parameters import build_parameters, SimpleParameterSet
from sumatra.projects import load_project
parser = argparse.ArgumentParser(description='Run script with Sumatra.')
parser.add_argument('-p', '--param', metavar='FILE', type=str, default='inline',
... | import argparse
import time
import os
from sumatra.parameters import build_parameters, SimpleParameterSet
from sumatra.projects import load_project
parser = argparse.ArgumentParser(description='Run script with Sumatra.')
parser.add_argument('-p', '--param', metavar='FILE', type=str, default='inline',
... | bsd-2-clause | Python |
7a175260fbab76c42a40015d6b231385dac27fb3 | add line at end of file | jrafa/bmi,jrafa/bmi,jrafa/bmi | bmi.py | bmi.py | # -*- coding: utf-8 -*-
from flask import Flask, render_template, jsonify, request
from collections import OrderedDict
import re
app = Flask(__name__)
answer = OrderedDict([
(16, 'starvation'),
(16.99, 'emaciation'),
(18.49, 'underweight'),
(24.99, 'correct value (healthy weight)'),
(29.99, 'overweight'),
(3... | # -*- coding: utf-8 -*-
from flask import Flask, render_template, jsonify, request
from collections import OrderedDict
import re
app = Flask(__name__)
answer = OrderedDict([
(16, 'starvation'),
(16.99, 'emaciation'),
(18.49, 'underweight'),
(24.99, 'correct value (healthy weight)'),
(29.99, 'overweight'),
(3... | mit | Python |
ea372dc748a39148ea398983220aa0de579f3b6f | update cli script to load historical prices data | melvinmt/sharpefolio,indraj/sharpefolio | cli.py | cli.py | import sqlite3
import urllib2
import urllib
import json
import datetime
from sharpefolio import stocks
connection = sqlite3.connect('test.sqlite')
connection.row_factory = sqlite3.Row
# Set up stock mapper
stock_repository = stocks.StockSqliteRepository(connection)
stock_mapper = stocks.StockMapper(stock_repository)
... | import sqlite3
import urllib2
import urllib
import json
import datetime
from sharpefolio import stocks
connection = sqlite3.connect('test.sqlite')
connection.row_factory = sqlite3.Row
# Set up stock mapper
stock_repository = stocks.StockSqliteRepository(connection)
stock_mapper = stocks.StockMapper(stock_repository)
... | bsd-3-clause | Python |
9c428fbfb69c93ef3da935d0d2ab098fbeb1c317 | Revert "Testing NoOpDSH() when database commands are executed without a connection being opened." | mcmontero/tinyAPI,mcmontero/tinyAPI | dsh.py | dsh.py | # ----- Info ------------------------------------------------------------------
__author__ = 'Michael Montero <mcmontero@gmail.com>'
# ----- Imports ---------------------------------------------------------------
from tinyAPI.base.data_store.provider import DataStoreProvider
import tinyAPI
__all__ = [
'dsh'
]
... | # ----- Info ------------------------------------------------------------------
__author__ = 'Michael Montero <mcmontero@gmail.com>'
# ----- Imports ---------------------------------------------------------------
from tinyAPI.base.data_store.provider import DataStoreProvider
import tinyAPI
__all__ = [
'dsh'
]
... | mit | Python |
ad9f8b588b0aba047b6e581248d68858d34b8684 | create a get method as an alias of mk_cache | alces/gitlab-rest-client | crud.py | crud.py | '''
generic CRUD oparations for the gitlab's objects
'''
import http
class Crud():
def __init__(self, path, keyFunc = lambda x: x['name']):
self.path = path
self.cache = {}
self.key_func = keyFunc
'''
get an object by system's name and id
'''
def by_id(self, sysNam, id):
return http.get(sysNam, '%s/%d' ... | '''
generic CRUD oparations for the gitlab's objects
'''
import http
class Crud():
def __init__(self, path, keyFunc = lambda x: x['name']):
self.path = path
self.cache = {}
self.key_func = keyFunc
'''
get an object by system's name and id
'''
def by_id(self, sysNam, id):
return http.get(sysNam, '%s/%d' ... | bsd-2-clause | Python |
db11c03fd90450afc15dbed3007e172806eff674 | Add back some code that disappeared | leonmu/django-push-notifications,hylje/django-push-notifications,Tictrac/django-push-notifications,Dubrzr/django-push-notifications,CustomerSupport/django-push-notifications,rsalmaso/django-push-notifications,leonsas/django-push-notifications,jamaalscarlett/django-push-notifications,omritoptix/django-ltg-skeleton,rmoor... | gcm.py | gcm.py | """
Google Cloud Messaging
Previously known as C2DM
Documentation is available on the Android Developer website:
https://developer.android.com/google/gcm/index.html
"""
import urllib2
from . import NotificationError, PUSH_NOTIFICATIONS_SETTINGS as SETTINGS
SETTINGS.setdefault("GCM_POST_URL", "https://android.googlea... | """
Google Cloud Messaging
Previously known as C2DM
Documentation is available on the Android Developer website:
https://developer.android.com/google/gcm/index.html
"""
import urllib2
from . import NotificationError, PUSH_NOTIFICATIONS_SETTINGS as SETTINGS
SETTINGS.setdefault("GCM_POST_URL", "https://android.googlea... | mit | Python |
584b2f79d0925878aca4ff41fe80e03942d21dee | change name of csv configuration | mgax/agripay,mgax/agripay | data.py | data.py | import csv
import flask
from peewee import Model, CharField, DecimalField, SqliteDatabase
db = SqliteDatabase(None, autocommit=False)
class Record(Model):
name = CharField()
code = CharField()
town = CharField()
total = DecimalField()
class Meta:
database = db
class DatabasePlugin(obj... | import csv
import flask
from peewee import Model, CharField, DecimalField, SqliteDatabase
db = SqliteDatabase(None, autocommit=False)
class Record(Model):
name = CharField()
code = CharField()
town = CharField()
total = DecimalField()
class Meta:
database = db
class DatabasePlugin(obj... | bsd-2-clause | Python |
6b6e06edfcc2404fa17b4761b2d9074dcd0ec476 | Use emails_folder input | dangtrinhnt/gem | gem.py | gem.py | #! /usr/bin/env python
import subprocess
import sys
import socket
if socket.gethostname() in ['trinh-pc', 'SRVR-UMailMigration',]: # add your hostname here
from settings_local import *
else:
from settings import *
from commons import *
import os
def backup_emails(email, service_account_email, email_folder):
c... | #! /usr/bin/env python
import subprocess
import sys
import socket
if socket.gethostname() in ['trinh-pc', 'SRVR-UMailMigration',]: # add your hostname here
from settings_local import *
else:
from settings import *
from commons import *
import os
def backup_emails(email, service_account_email, email_folder):
c... | apache-2.0 | Python |
85305b8b3b02f4ed43757e48dd3018834ce04b73 | Add metadata to demo.py | lgrahl/klausuromat,seecurity/klausuromat,lgrahl/klausuromat,seecurity/klausuromat | demo.py | demo.py | #!/usr/bin/python3
# -*- coding: utf-8 -*-
# Externals
import io
import json
# Internals
import generator
__author__ = 'Lennart Grahl <lennart.grahl@gmail.com>'
__status__ = 'Prototype'
__version__ = '1.0.0'
# Get settings
with io.open('settings.json', mode='r', encoding='utf-8') as fd:
settings = json.load(fd... | #!/usr/bin/python3
# -*- coding: utf-8 -*-
# Externals
import io
import json
# Internals
import generator
# Get settings
with io.open('settings.json', mode='r', encoding='utf-8') as fd:
settings = json.load(fd)
# Create random code generator
gen = generator.RandomCodeGenerator()
# Levels
gen.operator_level = ... | mit | Python |
ef6f858319e3276d330a2ad6f13a87a050867fb8 | Migrate deprecated PyQt 5.5 to new PyQt 5.10 | smoqadam/PyFladesk,smoqadam/PyFladesk | gui.py | gui.py | import sys
from PyQt5 import QtCore, QtWidgets, QtGui, QtWebEngineWidgets
def init_gui(application, port=5000, width=300, height=400,
window_title="PyFladesk", icon="appicon.png"):
ROOT_URL = 'http://localhost:{}'.format(port)
# open links in browser from http://stackoverflow.com/a/3188942/1103... | import sys
import webbrowser
from PyQt5 import QtCore, QtWidgets, QtWebKitWidgets, QtGui
def init_gui(application, port=5000, width=300, height=400,
window_title="PyFladesk", icon="appicon.png"):
ROOT_URL = 'http://localhost:{}'.format(port)
# open links in browser from http://stackoverflow.co... | mit | Python |
06dfc24607fcc1ba9493d8939d30c99a81d9c223 | Add KeyboardInterrupt handling for mfh.py | Zloool/manyfaced-honeypot | mfh.py | mfh.py | import os
import sys
import time
from multiprocessing import Process, Event
import client
import server
import update
from arguments import parse
from settings import HONEYPORT, HIVEPORT
def main():
update_event = Event()
client_proc = create_process("client", client.main, args, update_event)
server_pr... | import os
import sys
import time
from multiprocessing import Process, Event
import client
import server
import update
from arguments import parse
from settings import HONEYPORT, HIVEPORT
def main():
update_event = Event()
client_proc = create_process("client", client.main, args, update_event)
server_pr... | mit | Python |
3edad9d359a218fdaaf0395dd6d8c1a6d684d8b3 | Add Test runs for Python 3.7 and remove 3.4 (#5295) | googleapis/python-videointelligence,googleapis/python-videointelligence | nox.py | nox.py | # Copyright 2017 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | # Copyright 2017 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | apache-2.0 | Python |
8c6124e8f445c7c3bfe65038156f7072510f2bae | Update to script | chrisengelsma/executive_orders | run.py | run.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from bs4 import BeautifulSoup
import requests
from datetime import datetime
date_format = "%A, %B %d, %Y"
documents_total = 0
base_url = "https://en.wikisource.org"
url = "/wiki/Category:United_States_executive_orders"
def main():
pages = get_all_pages(url)
for page ... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from bs4 import BeautifulSoup
import requests
from datetime import datetime
date_format = "%A, %B %d, %Y"
documents_total = 0
base_url = "https://en.wikisource.org"
def main():
crawl("/wiki/Executive_Order_1")
def crawl(url):
global documents_total
r = requests... | mit | Python |
296802034e7a58962886335deb3e07a277132ed4 | update begin and end saldo on date change | baverman/cakeplant,baverman/cakeplant,baverman/cakeplant | run.py | run.py | from datetime import datetime, date, timedelta
import pygtk
import gtk
pygtk.require("2.0")
from taburet.utils import sync_design_documents
import taburet.accounting
import couchdbkit
s = couchdbkit.Server()
db = s.get_or_create_db('demo')
sync_design_documents(db, ('taburet.counter', 'taburet.accounting'))
taburet... | from datetime import datetime, date
import pygtk
import gtk
pygtk.require("2.0")
from taburet.utils import sync_design_documents
import taburet.accounting
import couchdbkit
s = couchdbkit.Server()
db = s.get_or_create_db('demo')
sync_design_documents(db, ('taburet.counter', 'taburet.accounting'))
taburet.accounting... | mit | Python |
f8988132279635e73815d6ac92edb1ca4066afb3 | Fix optimize_pressure demo | tum-pbs/PhiFlow,tum-pbs/PhiFlow | demos/optimize_pressure.py | demos/optimize_pressure.py | # pylint: disable-msg = not-an-iterable
from phi.tf.flow import *
from phi.math.math_util import randn
from phi.viz.plot import PlotlyFigureBuilder
DESCRIPTION = """
This application demonstrates the backpropagation through the pressure solve operation used in simulating incompressible fluids.
The demo Optimizes the... | # pylint: disable-msg = not-an-iterable
from phi.tf.flow import *
from phi.math.math_util import randn
from phi.viz.plot import PlotlyFigureBuilder
DESCRIPTION = """
This application demonstrates the backpropagation through the pressure solve operation used in simulating incompressible fluids.
The demo Optimizes the... | mit | Python |
c3e43780c12ca0285ecbba056f42f0f745f16227 | 版本号:0.0.6 | vex1023/vxUtils | vxUtils/__init__.py | vxUtils/__init__.py | # endcoding = utf-8
'''
author :
email :
'''
__author__ = 'vex1023'
__email__ = 'vex1023@qq.com'
__version__ = '0.0.6'
__homepages__ = 'https://github.com/vex1023/vxUtils'
__logger__ = 'vxQuant.vxUtils'
from .PrettyLogger import *
from .cache import *
from .decorator import *
| # endcoding = utf-8
'''
author :
email :
'''
__author__ = 'vex1023'
__email__ = 'vex1023@qq.com'
__version__ = '0.0.6'
__homepages__ = 'https://github.com/vex1023/vxUtils'
__logger__ = 'vxQuant.vxUtils'
from PrettyLogger import *
| mit | Python |
77ab6ce32aaac77150aec0c2ccbb67fe7189960b | update the indicator only if there is a version mismatch | qedsoftware/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,puttarajubr/commcare-hq,puttarajubr/commcare-hq,qedsoftware/commcare-hq,puttarajubr/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,puttarajubr/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq | dimagi/utils/indicators.py | dimagi/utils/indicators.py | from couchdbkit.ext.django.schema import DocumentSchema, DictProperty, DateTimeProperty
import datetime
class ComputedDocumentMixin(DocumentSchema):
"""
Use this mixin for things like CommCareCase or XFormInstance documents that take advantage
of indicator definitions.
computed_ is namespa... | from couchdbkit.ext.django.schema import DocumentSchema, DictProperty, DateTimeProperty
import datetime
class ComputedDocumentMixin(DocumentSchema):
"""
Use this mixin for things like CommCareCase or XFormInstance documents that take advantage
of indicator definitions.
computed_ is namespa... | bsd-3-clause | Python |
42eafa4a874c43d8e962562c3a9e8c83f82496e7 | Update bids.py | oesteban/fmriprep,oesteban/preprocessing-workflow,poldracklab/fmriprep,oesteban/fmriprep,oesteban/fmriprep,poldracklab/preprocessing-workflow,oesteban/preprocessing-workflow,poldracklab/fmriprep,poldracklab/preprocessing-workflow,poldracklab/fmriprep | fmriprep/utils/bids.py | fmriprep/utils/bids.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""
Utilities to handle BIDS inputs
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
"""
import os
import json
from pathlib import Path
def write_derivative_description(bids_... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""
Utilities to handle BIDS inputs
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Fetch some test data
>>> import os
>>> from niworkflows import data
>>> data_r... | bsd-3-clause | Python |
eced06f6f523fa6fd475987ae688b7ca2b6c3415 | Add win32 to platform information | jraede/dd-agent,tebriel/dd-agent,JohnLZeller/dd-agent,a20012251/dd-agent,remh/dd-agent,tebriel/dd-agent,AntoCard/powerdns-recursor_check,tebriel/dd-agent,AniruddhaSAtre/dd-agent,urosgruber/dd-agent,polynomial/dd-agent,JohnLZeller/dd-agent,Mashape/dd-agent,JohnLZeller/dd-agent,eeroniemi/dd-agent,c960657/dd-agent,mderomp... | checks/system/__init__.py | checks/system/__init__.py | """
Return information about the given platform.
"""
import sys
class Platform(object):
@staticmethod
def is_darwin(name=None):
name = name or sys.platform
return 'darwin' in name
@staticmethod
def is_freebsd(name=None):
name = name or sys.platform
return name.start... | """
Return information about the given platform.
"""
import sys
class Platform(object):
@staticmethod
def is_darwin(name=None):
name = name or sys.platform
return 'darwin' in name
@staticmethod
def is_freebsd(name=None):
name = name or sys.platform
return name.start... | bsd-3-clause | Python |
13848b8e3e2451152db02947ac964239e32cf1ea | Bump version | ministryofjustice/django-zendesk-tickets,ministryofjustice/django-zendesk-tickets | zendesk_tickets/__init__.py | zendesk_tickets/__init__.py | VERSION = (0, 10)
__version__ = '.'.join(map(str, VERSION))
| VERSION = (0, 9)
__version__ = '.'.join(map(str, VERSION))
| mit | Python |
1c5c424ebbd9f01ad9aeb33fa71f0bb6e16673d8 | Allow "0install download APP" | michel-slm/0install,afb/0install,fdopen/0install,bartbes/0install,gasche/0install,pombreda/0install,timdiels/0install,afb/0install,michel-slm/0install,gasche/0install,DarkGreising/0install,bartbes/0install,gasche/0install,0install/0install,afb/0install,jaychoo/0install,afb/0install,0install/0install,pombreda/0install,j... | zeroinstall/cmd/download.py | zeroinstall/cmd/download.py | """
The B{0install download} command-line interface.
"""
# Copyright (C) 2011, Thomas Leonard
# See the README file for details, or visit http://0install.net.
import sys
from zeroinstall import _
from zeroinstall.cmd import UsageError, select
from zeroinstall.injector import model
syntax = "URI"
def add_options(pa... | """
The B{0install download} command-line interface.
"""
# Copyright (C) 2011, Thomas Leonard
# See the README file for details, or visit http://0install.net.
import sys
from zeroinstall import _
from zeroinstall.cmd import UsageError, select
from zeroinstall.injector import model
syntax = "URI"
def add_options(pa... | lgpl-2.1 | Python |
8657b768215781b529ce0810fc97abcd131e71c0 | Bump version to 0.4.1.dev1 | team23/django_backend,team23/django_backend,team23/django_backend,team23/django_backend,team23/django_backend | django_backend/__init__.py | django_backend/__init__.py | from .backend.renderable import Renderable # noqa
from .group import Group # noqa
from .sitebackend import SiteBackend
__version__ = '0.4.1.dev1'
default_app_config = 'django_backend.apps.DjangoBackendConfig'
site = SiteBackend(id='backend')
| from .backend.renderable import Renderable # noqa
from .group import Group # noqa
from .sitebackend import SiteBackend
__version__ = '0.4.0'
default_app_config = 'django_backend.apps.DjangoBackendConfig'
site = SiteBackend(id='backend')
| bsd-3-clause | Python |
a7e051e7270ca92f651c952a7a39332ee2d5b728 | Remove deprecated/dead code | nmoya/fscan | src/util/misc.py | src/util/misc.py | # -*- coding: utf-8 -*-
import requests
import sys
import webbrowser
import os
import time
import datetime
def debug_html(html):
debug_path = os.environ['HOME'] + '/fscan_debug.html'
f = open(debug_path, 'w')
f.write(html.encode('utf8'))
f.close()
webbrowser.open(debug_path)
# os.remove(debug_... | # -*- coding: utf-8 -*-
import requests
import sys
import webbrowser
import os
import time
import datetime
# send_email("nikmoy@gmail.com", "subject", dict_to_string(response))
def send_email(to, subject, body):
url = 'http://nikolasmoya.com/ws/wsSendEmail'
req_form = {
"destination": to,
"sub... | mit | Python |
38594e37c3ff8a7f1a36a798987b3bd9626f6218 | fix syncing jedideft | PanDAWMS/panda-bigmon-atlas,PanDAWMS/panda-bigmon-atlas,PanDAWMS/panda-bigmon-atlas,PanDAWMS/panda-bigmon-atlas | atlas/prodtask/management/commands/syncjedideft.py | atlas/prodtask/management/commands/syncjedideft.py | from django.core.management.base import BaseCommand, CommandError
import time
from atlas.prodtask.task_views import sync_old_tasks
class Command(BaseCommand):
args = '<task_id>'
help = 'Sync tasks < task_id'
def add_arguments(self, parser):
parser.add_argument('start_id', nargs=1, type=int)
... | from django.core.management.base import BaseCommand, CommandError
import time
from atlas.prodtask.task_views import sync_old_tasks
class Command(BaseCommand):
args = '<task_id>'
help = 'Sync tasks < task_id'
def handle(self, *args, **options):
self.stdout.write('Start sync from request to tasks ... | apache-2.0 | Python |
4ef35e9fff653c3cf9c36a0391272f4695423cfd | Add self-hyperlink to serializers | zeeman/the-social-network,zeeman/the-social-network | net/friends/api/v1/api.py | net/friends/api/v1/api.py | from rest_framework import serializers, viewsets
from net.friends import models as net_models
class RelationshipSerializer(serializers.ModelSerializer):
from_user = serializers.HyperlinkedRelatedField(many=False, read_only=True,
view_name="user-detail")
to_u... | from rest_framework import serializers, viewsets
from net.friends import models as net_models
class RelationshipSerializer(serializers.ModelSerializer):
from_user = serializers.HyperlinkedRelatedField(many=False, read_only=True,
view_name="user-detail")
to_u... | bsd-2-clause | Python |
ec1391d7e48e1af79b7eec7636430bba2758b7f4 | Update next-permutation.py | yiwen-luo/LeetCode,jaredkoontz/leetcode,githubutilities/LeetCode,yiwen-luo/LeetCode,kamyu104/LeetCode,yiwen-luo/LeetCode,kamyu104/LeetCode,kamyu104/LeetCode,jaredkoontz/leetcode,githubutilities/LeetCode,tudennis/LeetCode---kamyu104-11-24-2015,jaredkoontz/leetcode,tudennis/LeetCode---kamyu104-11-24-2015,githubutilities/... | Python/next-permutation.py | Python/next-permutation.py | # Time: O(n)
# Space: O(1)
#
# Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.
#
# If such arrangement is not possible, it must rearrange it as the lowest possible order (ie, sorted in ascending order).
#
# The replacement must be in-place, do not ... | # Time: O(n)
# Space: O(1)
#
# Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.
#
# If such arrangement is not possible, it must rearrange it as the lowest possible order (ie, sorted in ascending order).
#
# The replacement must be in-place, do not ... | mit | Python |
82fa179ca1df115f4bda071b135cccbd624c6fe9 | Add args -c, --capture to detect capture engine ( default is phantomjs) | attakei/deck2pdf-python,attakei/deck2pdf,attakei/slide2pdf,attakei/slide2pdf,attakei/deck2pdf-python,attakei/deck2pdf | slide2pdf/__init__.py | slide2pdf/__init__.py | #!/usr/bin/env python
import sys
import os
import logging
import argparse
__version__ = '0.1.3'
Logger = logging.getLogger('slide2pdf')
TEMP_CAPTURE_DIR = '.slide2pdf'
def count_slide_from_dom(body):
# FIXME: Too bad know-how
import re
return len(re.split('<\/slide>', body)) - 1
parser = argparse.A... | #!/usr/bin/env python
import sys
import os
import logging
import argparse
__version__ = '0.1.3'
Logger = logging.getLogger('slide2pdf')
TEMP_CAPTURE_DIR = '.slide2pdf'
def count_slide_from_dom(body):
# FIXME: Too bad know-how
import re
return len(re.split('<\/slide>', body)) - 1
parser = argparse.A... | mit | Python |
62e7ac28bfde820613b2e222082094433edb0c8b | Update version.py | lmazuel/azure-sdk-for-python,AutorestCI/azure-sdk-for-python,Azure/azure-sdk-for-python,Azure/azure-sdk-for-python,Azure/azure-sdk-for-python,Azure/azure-sdk-for-python | azure-mgmt-eventhub/azure/mgmt/eventhub/version.py | azure-mgmt-eventhub/azure/mgmt/eventhub/version.py | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | mit | Python |
1c5f36b0f133ff668f17a1f023c2d52dc2bfbf49 | Fix extension detection in JSON generation | WyohKnott/image-comparison-sources | generate_files_json.py | generate_files_json.py | #!/usr/bin/python3
import os
import json
import glob
data = {}
data['comparisonfiles'] = {}
for subset in next(os.walk("comparisonfiles/"))[1]:
data['comparisonfiles'][subset] = {}
data['comparisonfiles'][subset]["format"] = []
format_list = [
format
for format in next(os.walk("comparison... | #!/usr/bin/python3
import os
import json
import glob
data = {}
data['comparisonfiles'] = {}
for subset in next(os.walk("comparisonfiles/"))[1]:
data['comparisonfiles'][subset] = {}
data['comparisonfiles'][subset]["format"] = []
format_list = [
format
for format in next(os.walk("comparison... | bsd-3-clause | Python |
4b8815fb9ebb8331206da67cde4964c92a168f47 | Change dicom2png to use subprocesses directly without a Pool. | rsmith-nl/scripts,rsmith-nl/scripts | dicom2png.py | dicom2png.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Author: R.F. Smith <rsmith@xs4all.nl>
# $Date$
#
# To the extent possible under law, Roland Smith has waived all copyright and
# related or neighboring rights to dicom2png.py. This work is published from
# the Netherlands. See http://creativecommons.org/publicdomain/zer... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Author: R.F. Smith <rsmith@xs4all.nl>
# $Date$
#
# To the extent possible under law, Roland Smith has waived all copyright and
# related or neighboring rights to dicom2png.py. This work is published from
# the Netherlands. See http://creativecommons.org/publicdomain/zer... | mit | Python |
ec810057165546a1906fff2d074509be02e9749e | add new version (#21926) | LLNL/spack,LLNL/spack,LLNL/spack,LLNL/spack,LLNL/spack | var/spack/repos/builtin/packages/py-azureml-train-automl-client/package.py | var/spack/repos/builtin/packages/py-azureml-train-automl-client/package.py | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
class PyAzuremlTrainAutomlClient(Package):
"""The azureml-train-automl-client package contains functionality for
... | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
class PyAzuremlTrainAutomlClient(Package):
"""The azureml-train-automl-client package contains functionality for
... | lgpl-2.1 | Python |
a3cfa99fee208ee6aa8ab3fdf0c487e2066de375 | Make go_list_opt_outs extend BaseGoAccountCommand | praekelt/vumi-go,praekelt/vumi-go,praekelt/vumi-go,praekelt/vumi-go | go/base/management/commands/go_list_opt_outs.py | go/base/management/commands/go_list_opt_outs.py | from optparse import make_option
from go.base.command_utils import BaseGoAccountCommand
from go.vumitools.opt_out import OptOutStore
class Command(BaseGoCommand):
help = "List opt-outs from a particular account"
def handle_no_command(self, *args, **options):
options = options.copy()
self.han... | from optparse import make_option
from go.base.command_utils import BaseGoCommand, make_email_option
from go.vumitools.opt_out import OptOutStore
class Command(BaseGoCommand):
help = "List opt-outs from a particular account"
LOCAL_OPTIONS = [
make_email_option()
]
option_list = BaseGoCommand... | bsd-3-clause | Python |
dcdc91da744b3a9d0314886d5ba16b40d89e57db | change get users for site query method | appsembler/edx-platform,appsembler/edx-platform,appsembler/edx-platform,appsembler/edx-platform | openedx/core/djangoapps/appsembler/api/sites.py | openedx/core/djangoapps/appsembler/api/sites.py | from django.contrib.auth import get_user_model
from django.contrib.sites.models import Site
from organizations.models import (
Organization,
OrganizationCourse,
UserOrganizationMapping,
)
from openedx.core.djangoapps.content.course_overviews.models import CourseOverview
from student.models import CourseEn... | from django.contrib.auth import get_user_model
from django.contrib.sites.models import Site
from organizations.models import (
Organization,
OrganizationCourse,
UserOrganizationMapping,
)
from openedx.core.djangoapps.content.course_overviews.models import CourseOverview
from student.models import CourseEn... | agpl-3.0 | Python |
00d74913c2a58842a50452fe7d55f8c762775a7e | add unpad method for the python API | farrajota/dbcollection,dbcollection/dbcollection | dbcollection/utils/pad.py | dbcollection/utils/pad.py | """
Padding functions.
"""
def pad_list(listA, val=-1):
"""Pad list of lists with 'val' such that all lists have the same length.
Parameters
----------
listA : list of lists
List of lists of different sizes.
val : number
Value to pad the lists.
Returns
-------
list of ... | """
Padding functions.
"""
def pad_list(listA, val=0):
"""Pad list of lists with 'val' shuch that all lists have the same length.
Parameters
----------
listA : list of lists
List of lists of different sizes.
val : number
Value to pad the lists.
Returns
-------
list of ... | mit | Python |
64fc6434348de2a5dd31423bf8c2f3d609299c27 | Update timer.py | kankiri/pabiana | demos/collection/timer.py | demos/collection/timer.py | #!/usr/bin/env python3
from datetime import datetime
from pabiana import Area, load_interfaces
NAME = 'timer'
EMPTY = {}
@area.register
def place(slot_name, dttime):
"""
Set a timer to be published at the specified minute.
"""
dttime = datetime.strptime(dttime, '%Y-%m-%d %H:%M:%S')
dttime = dttime.replace(sec... | #!/usr/bin/env python3
from datetime import datetime
from pabiana import Area, load_interfaces
NAME = 'timer'
EMPTY = '{}'.encode('utf-8')
@area.register
def place(slot_name, dttime):
"""
Set a timer to be published at the specified minute.
"""
dttime = datetime.strptime(dttime, '%Y-%m-%d %H:%M:%S')
dttime = ... | mit | Python |
d21bf87390af861c0a7407854ed85166e0730632 | Add more tests | nanonyme/SimpleLoop,nanonyme/SimpleLoop | SimpleEvent_tests.py | SimpleEvent_tests.py | import unittest
from SimpleEvent import *
#
def run_test(function, args):
try:
function(args)
except AssertionError:
return False
return True
class EventFactoryTests(unittest.TestCase):
def setUp(self):
self.factory = EventFactory()
def tearDown(self):
self.factor... | import unittest
from SimpleEvent import *
#
def run_test(function, args):
try:
function(args)
except AssertionError:
return False
return True
class EventFactoryTests(unittest.TestCase):
def setUp(self):
self.factory = EventFactory()
def tearDown(self):
self.factor... | apache-2.0 | Python |
9dd6865bd4adf5e87e58b40378081b8c6172e7e5 | add scope to python graph snapshot response | inokappa/documentation,macobo/documentation,macobo/documentation,jhotta/documentation,jhotta/documentation,inokappa/documentation,macobo/documentation,macobo/documentation,jhotta/documentation,jhotta/documentation,inokappa/documentation,inokappa/documentation,jhotta/documentation,jhotta/documentation,inokappa/documenta... | code_snippets/results/result.api-graph-snapshot.py | code_snippets/results/result.api-graph-snapshot.py | {'graph_def': '{"requests": [{"q": "system.load.1{*}"}]}',
'metric_query': 'system.load.1{*}',
'snapshot_url': 'https://s3.amazonaws.com/dd-snapshots-prod/org_1499/2013-07-19/2459d291fc021c84f66aac3a87251b6c92b589da.png'}
| {'graph_def': '{"requests": [{"q": "system.load.1"}]}',
'metric_query': 'system.load.1',
'snapshot_url': 'https://s3.amazonaws.com/dd-snapshots-prod/org_1499/2013-07-19/2459d291fc021c84f66aac3a87251b6c92b589da.png'}
| bsd-3-clause | Python |
bbd5525066e40f7a8c80a56952886e7f4d06025a | Bump up docs version | byashimov/django-controlcenter,byashimov/django-controlcenter,byashimov/django-controlcenter | docs/conf.py | docs/conf.py | # django-controlcenter documentation build configuration file, created by
# sphinx-quickstart on Mon Mar 7 19:08:51 2016.
import datetime
extensions = []
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = 'django-controlcenter'
copyright = ('{}, Django-controlcenter developers and ... | # django-controlcenter documentation build configuration file, created by
# sphinx-quickstart on Mon Mar 7 19:08:51 2016.
import datetime
extensions = []
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = 'django-controlcenter'
copyright = ('{}, Django-controlcenter developers and ... | bsd-3-clause | Python |
79fbfb05661682ef5e54d8e9329ab80852c94554 | Update copyright years | jodal/pykka | docs/conf.py | docs/conf.py | # encoding: utf-8
"""Pykka documentation build configuration file"""
from __future__ import unicode_literals
import configparser
import os
import re
import sys
# -- Workarounds to have autodoc generate API docs ----------------------------
sys.path.insert(0, os.path.abspath('..'))
class Mock(object):
def __... | # encoding: utf-8
"""Pykka documentation build configuration file"""
from __future__ import unicode_literals
import configparser
import os
import re
import sys
# -- Workarounds to have autodoc generate API docs ----------------------------
sys.path.insert(0, os.path.abspath('..'))
class Mock(object):
def __... | apache-2.0 | Python |
11d4543c1391b60c80a3fd7e97c5885401218e6d | Update copyright date | ianunruh/hvac,ianunruh/hvac | docs/conf.py | docs/conf.py | # -*- coding: utf-8 -*-
# Configuration file for the Sphinx documentation builder.
# -- Path setup --------------------------------------------------------------
# Set up import path to allow the autodoc extension to find the local module code.
import os
import sys
sys.path.insert(0, os.path.abspath('..'))
# -- Pro... | # -*- coding: utf-8 -*-
# Configuration file for the Sphinx documentation builder.
# -- Path setup --------------------------------------------------------------
# Set up import path to allow the autodoc extension to find the local module code.
import os
import sys
sys.path.insert(0, os.path.abspath('..'))
# -- Pro... | apache-2.0 | Python |
ba6ef2ac850c91ac8a72401b7bd7b130bc2cc1d6 | Fix version detection for tests | jaraco/jaraco.logging | docs/conf.py | docs/conf.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import setuptools_scm
extensions = [
'sphinx.ext.autodoc',
]
# General information about the project.
project = 'jaraco.logging'
copyright = '2015 Jason R. Coombs'
# The short X.Y version.
version = setuptools_scm.get_version(root='..', relative_to=__... | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import setuptools_scm
extensions = [
'sphinx.ext.autodoc',
]
# General information about the project.
project = 'jaraco.logging'
copyright = '2015 Jason R. Coombs'
# The short X.Y version.
version = setuptools_scm.get_version(root='..')
# The full ve... | mit | Python |
8fb5ac0bc2af48255150f253e46380ea8792e1cf | Fix inter-Sphinx mappings in docs/conf.py | xolox/python-executor | docs/conf.py | docs/conf.py | """
Documentation build configuration file for the `executor` package.
This Python script contains the Sphinx configuration for building the
documentation of the `executor` project. This file is execfile()d with
the current directory set to its containing dir.
"""
import os
import sys
# Add the 'executor' source dis... | """
Documentation build configuration file for the `executor` package.
This Python script contains the Sphinx configuration for building the
documentation of the `executor` project. This file is execfile()d with
the current directory set to its containing dir.
"""
import os
import sys
# Add the 'executor' source dis... | mit | Python |
411d0381331334dd6b739f8d0527b56af741a90a | Fix French NIF format test | arthurdejong/python-stdnum,holvi/python-stdnum,holvi/python-stdnum,arthurdejong/python-stdnum,holvi/python-stdnum,arthurdejong/python-stdnum | stdnum/fr/nif.py | stdnum/fr/nif.py | # nif.py - functions for handling French tax identification numbers
# coding: utf-8
#
# Copyright (C) 2016 Dimitri Papadopoulos
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# ... | # nif.py - functions for handling French tax identification numbers
# coding: utf-8
#
# Copyright (C) 2016 Dimitri Papadopoulos
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# ... | lgpl-2.1 | Python |
cea8c6762dbf2f62f2e7261f40177f39d1709f24 | make logging url optional env var | opentrials/scraper,opentrials/collectors | collectors/base/config.py | collectors/base/config.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import os
import logging
from logging.handlers import SysLogHandler
from dotenv import load_dotenv
load_dotenv('.env')
# Spiders
SPIDER_MODULES... | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import os
import logging
from logging.handlers import SysLogHandler
from dotenv import load_dotenv
load_dotenv('.env')
# Spiders
SPIDER_MODULES... | mit | Python |
117764594febcfdc1f22153ddfe69357566bd134 | Rename variable | stormaaja/csvconverter,stormaaja/csvconverter,stormaaja/csvconverter | stock_updater.py | stock_updater.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from multiple_products_found_error import MultipleProductsFoundError
from product_not_found_error import ProductNotFoundError
class StockUpdater:
def __init__(self, db_connection):
self.db_connection = db_connection
def set_items(self, items):
se... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from multiple_products_found_error import MultipleProductsFoundError
from product_not_found_error import ProductNotFoundError
class StockUpdater:
def __init__(self, db_connection):
self.db_connection = db_connection
def set_items(self, items):
se... | mit | Python |
e4c7d94f91a6ed579ea1a47f5bb25dd98bc52448 | Fix RedirectView.permanent again | littlepea/django-docs,littlepea/django-docs,littlepea/django-docs | docs/urls.py | docs/urls.py | from django.conf.urls import url
from docs.views import DocsRootView, serve_docs
urlpatterns = [
url(r'^$', DocsRootView.as_view(permanent=True), name='docs_root'),
url(r'^(?P<path>.*)$', serve_docs, name='docs_files'),
]
| from django.conf.urls import url
from docs.views import DocsRootView, serve_docs
urlpatterns = [
url(r'^$', DocsRootView.as_view(), name='docs_root'),
url(r'^(?P<path>.*)$', serve_docs, name='docs_files'),
]
| bsd-3-clause | Python |
7e25e3cdc899b7b0f4f97aa03117f723bb748e6c | Clean up DummyOrgConfig | SalesforceFoundation/CumulusCI,SalesforceFoundation/CumulusCI | cumulusci/tests/util.py | cumulusci/tests/util.py | import copy
import random
from cumulusci.core.config import BaseGlobalConfig
from cumulusci.core.config import BaseProjectConfig
from cumulusci.core.keychain import BaseProjectKeychain
from cumulusci.core.config import OrgConfig
def random_sha():
hash = random.getrandbits(128)
return "%032x" % hash
def cre... | import copy
import random
from cumulusci.core.config import BaseGlobalConfig
from cumulusci.core.config import BaseProjectConfig
from cumulusci.core.keychain import BaseProjectKeychain
from cumulusci.core.config import OrgConfig
def random_sha():
hash = random.getrandbits(128)
return "%032x" % hash
def cre... | bsd-3-clause | Python |
5abdd21de37da1827d29c6dc0cbf077f13b5ba5f | Allow tuples | jaybosamiya/fuzzing-numpy,jaybosamiya/fuzzing-numpy,jaybosamiya/fuzzing-numpy | fuzzer/generator.py | fuzzer/generator.py | import random
import numpy as np
import pickle
try:
with open('data.pickle', 'rb') as f:
callables, data_possibilities, data_types = pickle.load(f)
except FileNotFoundError:
exclude = ['lookfor', 'memmap', 'fromregex', 'fromfile', 'chararray',
'show_config', 'save', 'savez', 'savez_compr... | import random
import numpy as np
import pickle
try:
with open('data.pickle', 'rb') as f:
callables, data_possibilities, data_types = pickle.load(f)
except FileNotFoundError:
exclude = ['lookfor', 'memmap', 'fromregex', 'fromfile', 'chararray',
'show_config', 'save', 'savez', 'savez_compr... | apache-2.0 | Python |
89854662d177d019d56476ee23a5e1b17beb5bea | convert CT_Connector to xmlchemy | cchanrhiza/python-pptx,hoopes/python-pptx,biggihs/python-pptx,kevingu1003/python-pptx,AlexMooney/python-pptx,scanny/python-pptx | pptx/oxml/shapes/connector.py | pptx/oxml/shapes/connector.py | # encoding: utf-8
"""
lxml custom element classes for shape-related XML elements.
"""
from __future__ import absolute_import
from .shared import BaseShapeElement
from ..xmlchemy import BaseOxmlElement, OneAndOnlyOne
class CT_Connector(BaseShapeElement):
"""
A line/connector shape ``<p:cxnSp>`` element
... | # encoding: utf-8
"""
lxml custom element classes for shape-related XML elements.
"""
from __future__ import absolute_import
from ..ns import qn
from .shared import BaseShapeElement
from ..xmlchemy import BaseOxmlElement, OneAndOnlyOne
class CT_Connector(BaseShapeElement):
"""
A line/connector shape ``<p:c... | mit | Python |
b974bbcc7e243fca7c3dc63fbbaf530fe9b69e50 | Load DB migrations before testing and use verbose=2 and failfast | pgollakota/django-chartit,pgollakota/django-chartit,pgollakota/django-chartit | runtests.py | runtests.py | import os
import sys
try:
sys.path.append('demoproject')
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "demoproject.settings")
from django.conf import settings
from django.core.management import call_command
settings.DATABASES['default']['NAME'] = ':memory:'
settings.INSTALLED_APPS.append('... | import sys
try:
from django.conf import settings
from django.test.utils import get_runner
settings.configure(
DEBUG=True,
USE_TZ=True,
DATABASES={
"default": {
"ENGINE": "django.db.backends.sqlite3",
"NAME": ":memory:",
}
... | bsd-2-clause | Python |
f888062e1ce84522cf92dee39b833e8fd6b51caa | Update server.py | jancelin/geo-poppy,jancelin/geo-poppy | geolocate/server.py | geolocate/server.py | import SocketServer
import json
import os
import subprocess
import commands
class MyTCPServerHandler(SocketServer.BaseRequestHandler):
def handle(self):
try:
data = json.loads(self.request.recv(1024).strip())
print data
self.r... | import SocketServer
import json
import os
import subprocess
import commands
class MyTCPServerHandler(SocketServer.BaseRequestHandler):
def handle(self):
try:
data = json.loads(self.request.recv(1024).strip())
print data
self.r... | agpl-3.0 | Python |
471bb3847b78f36f79af6cbae288a8876357cb3c | Add missing config that caused test to fail | Frojd/wagtail-geo-widget,Frojd/wagtail-geo-widget,Frojd/wagtail-geo-widget,Frojd/wagtail-geo-widget | runtests.py | runtests.py | #!/usr/bin/env python
import sys
from django.conf import settings
from django.core.management import execute_from_command_line
if not settings.configured:
params = dict(
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'handlers': {
'consol... | #!/usr/bin/env python
import sys
from django.conf import settings
from django.core.management import execute_from_command_line
if not settings.configured:
params = dict(
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'handlers': {
'consol... | mit | Python |
d915d754034b6abaa5b1fdf8c1a5a1aa9ae98590 | add link getting algorithm | lewangbtcc/anti-XSS,lewangbtcc/anti-XSS | getLink.py | getLink.py | #encoding: utf8
def getLink(src):
source = src.lower()
links = []
head = 0
length = len(source)
flag = True
while ((flag) and (head < length)):
flag = False
pos1 = source[head:].find('href="') + head
pos2 = source[head + pos1:].find('</script>') + head + pos1
if ... | mit | Python | |
52c69d148c247e55b9a6c43cb2b2af582a886be5 | improve tests even more | Akuli/porcupine,Akuli/porcupine,Akuli/porcupine,Akuli/editor | tests/test_highlight_plugin.py | tests/test_highlight_plugin.py | from pygments.lexers import PythonLexer
def test_deleting_bug(filetab):
def tag_ranges(tag):
return list(map(str, filetab.textwidget.tag_ranges(tag)))
filetab.settings.set('pygments_lexer', PythonLexer)
filetab.textwidget.insert('1.0', 'return None')
assert tag_ranges('Token.Keyword') == ['1.... | from pygments.lexers import PythonLexer
def test_deleting_bug(filetab):
def tag_ranges(tag):
return list(map(str, filetab.textwidget.tag_ranges(tag)))
filetab.settings.set('pygments_lexer', PythonLexer)
filetab.textwidget.insert('1.0', 'return None')
assert tag_ranges('Token.Keyword') == ['1.... | mit | Python |
d4dd6eee0ed3627edac99dc6021ae8f8613ee793 | add ujson to requirements | choderalab/openpathsampling,openpathsampling/openpathsampling,jhprinz/openpathsampling,dwhswenson/openpathsampling,openpathsampling/openpathsampling,jhprinz/openpathsampling,dwhswenson/openpathsampling,openpathsampling/openpathsampling,choderalab/openpathsampling,dwhswenson/openpathsampling,dwhswenson/openpathsampling,... | openpathsampling/tools.py | openpathsampling/tools.py | import sys
__author__ = 'Jan-Hendrik Prinz'
try:
import IPython
import IPython.display
def in_ipynb():
try:
ipython = get_ipython()
import IPython.terminal.interactiveshell
import ipykernel.zmqshell
if isinstance(ipython, IPython.terminal.interac... | import sys
__author__ = 'Jan-Hendrik Prinz'
try:
import IPython
import IPython.display
def in_ipynb():
try:
ipython = get_ipython()
import IPython.terminal.interactiveshell
import ipykernel.zmqshell
if isinstance(ipython, IPython.terminal.interac... | mit | Python |
05229c3db44be626009a69811207c7bff34b559d | Clean clutter | dials/dials,dials/dials,dials/dials,dials/dials,dials/dials | command_line/batch_analysis.py | command_line/batch_analysis.py | from __future__ import division
import os
from cctbx.array_family import flex
import iotbx.phil
phil_scope = iotbx.phil.parse('''\
nproc = Auto
.type = int(value_min=1)
json = None
.type = path
''')
help_message = '''\
'''
def work(args):
filename = args[0]
cl = args[1]
from dials.command_line import fi... | from __future__ import division
import os
from cctbx.array_family import flex
import iotbx.phil
phil_scope = iotbx.phil.parse('''\
nproc = Auto
.type = int(value_min=1)
json = None
.type = path
''')
help_message = '''\
'''
def work(args):
filename = args[0]
cl = args[1]
from dials.command_line import fi... | bsd-3-clause | Python |
ecc3ae7297d83680510c19bf9adfab062272e9c0 | Bump version to 0.2.0 | erikdejonge/business-rules,adnymics/business-rules,erikdejonge/business-rules,venmo/business-rules | business_rules/__init__.py | business_rules/__init__.py | __version__ = '0.2.0'
from .engine import run_all
from .utils import export_rule_data
# Appease pyflakes by "using" these exports
assert run_all
assert export_rule_data
| __version__ = '0.1.3'
from .engine import run_all
from .utils import export_rule_data
# Appease pyflakes by "using" these exports
assert run_all
assert export_rule_data
| mit | Python |
cec7e01a3a1b96303956f5144d58051472b6ecfa | Declare installation dependencies properly | apiaryio/black-belt | pavement.py | pavement.py | from paver.easy import *
from paver.setuputils import setup
options = environment.options
VERSION = '0.3'
setup(
name='blackbelt',
version=VERSION,
description='Project automation the Apiary way',
long_description="""Internal so far""",
author='Lukas Linhart',
author_email='lukas@apiary.io',
... | from paver.easy import *
from paver.setuputils import setup
options = environment.options
VERSION = '0.3'
setup(
name='blackbelt',
version=VERSION,
description='Project automation the Apiary way',
long_description="""Internal so far""",
author='Lukas Linhart',
author_email='lukas@apiary.io',
... | mit | Python |
190bab081cca468cb17fb241e376101e81f41c45 | Update scandium.py | jarle/scandium | scandium.py | scandium.py | import os
import glob
import gzip
import subprocess
WORKDIR = "temp/"
def app_is_system(filename):
with open(filename) as app_properties:
for line in app_properties:
if "app_is_system=1" == line.rstrip():
return True
return False
def unzip_application(archive):
pri... | import os
import glob
import gzip
import subprocess
WORKDIR = "temp/"
def app_is_system(filename):
with open(filename) as app_properties:
for line in app_properties:
if "app_is_system=1" == line.rstrip():
return True
return False
def unzip_application(archive):
pri... | mit | Python |
004e14585af8e7bf0a5eed88d22d129a9b0997ac | fix duplicate notification urls (#5515) | rackerlabs/django-DefectDojo,rackerlabs/django-DefectDojo,rackerlabs/django-DefectDojo,rackerlabs/django-DefectDojo | dojo/notifications/urls.py | dojo/notifications/urls.py | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^notifications$', views.personal_notifications, name='notifications'),
url(r'^notifications/system$', views.system_notifications, name='system_notifications'),
url(r'^notifications/personal$', views.personal_notifications, name='per... | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^notifications$', views.personal_notifications, name='notifications'),
url(r'^notifications/system$', views.system_notifications, name='notifications'),
url(r'^notifications/personal$', views.personal_notifications, name='notificati... | bsd-3-clause | Python |
69b5c3f0e49c878c2fdab9e9d2c766614665aea7 | Implement UserGroupPermission.delete_by_permission | soasme/flask-perm,soasme/flask-perm,soasme/flask-perm | flask_perm/services/user_group_permission.py | flask_perm/services/user_group_permission.py | # -*- coding: utf-8 -*-
from sqlalchemy.exc import IntegrityError
from ..core import db
from ..models import UserGroupPermission
def create(user_group_id, permission_id):
user_group_permission = UserGroupPermission(
user_group_id=user_group_id,
permission_id=permission_id,
)
db.session.ad... | # -*- coding: utf-8 -*-
from sqlalchemy.exc import IntegrityError
from ..core import db
from ..models import UserGroupPermission
def create(user_group_id, permission_id):
user_permission = UserGroupPermission(
user_group_id=user_group_id,
permission_id=permission_id,
)
db.session.add(user... | mit | Python |
25224af8c002c05397e5c3163f0b77cb82ce325e | Add ability to proportionally assign to different users | sunlightlabs/hanuman,sunlightlabs/hanuman,sunlightlabs/hanuman | data_collection/management/commands/assignfirms.py | data_collection/management/commands/assignfirms.py | from django.core.management.base import BaseCommand, CommandError
from data_collection.models import User, Firm, Assignment
import itertools, random
class Command(BaseCommand):
help = "Assign firms to users"
def add_arguments(self, parser):
parser.add_argument('users', nargs='+', type=str)
par... | from django.core.management.base import BaseCommand, CommandError
from data_collection.models import User, Firm, Assignment
import itertools
class Command(BaseCommand):
help = "Assign firms to users"
def add_arguments(self, parser):
parser.add_argument('users', nargs='+', type=str)
def handle(sel... | bsd-3-clause | Python |
d57410e77dc403a01d07e1257a49b4eb7aa55d3a | 添加运行参数,s为服务器端,c为客户端 | yangshaoshun/OMOOC2py,yangshaoshun/OMOOC2py | _src/om2py3w/3wex0/main.py | _src/om2py3w/3wex0/main.py | #!/usr/bin/python # This is client.py file
# -*- coding: utf-8 -*-
"""
Usage:
main.py (s|c)
main.py (-h|--help)
main.py --version
Options:
-h --help Show this screen
--version Show version
"""
from docopt import docopt
import socket
def server():
address = ('127.0.0.1', 31500)
s... | mit | Python | |
7c214cde46911f6fb0f087af7a2c69b22f335850 | Update wsgi.py settings | seciadev/django_weddingsite,seciadev/django_weddingsite,seciadev/django_weddingsite | weddingsite/wsgi.py | weddingsite/wsgi.py | """
WSGI config for weddingsite project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/
"""
import os
#os.environ['DJANGO_SETTINGS_MODULE'] = 'weddingsite.settings'
from django.core.ws... | """
WSGI config for weddingsite project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/
"""
import os
os.environ['DJANGO_SETTINGS_MODULE'] = 'weddingsite.settings'
from django.core.wsg... | mpl-2.0 | Python |
6aef9f09f9e663779dda3fb502702fccea7e8fd5 | Fix version checking for Django 3.2 (#109) | GetStream/stream-django,GetStream/stream-django | stream_django/__init__.py | stream_django/__init__.py | import django
from stream_django.feed_manager import feed_manager # noqa
version_list = [int(i) for i in django.__version__.split('.')]
major, minor = version_list[0], version_list[1]
if major < 3 or (major == 3 and minor < 2):
# deprecated as of Django 3.2
default_app_config = 'stream_django.apps.StreamDjan... | import django
from stream_django.feed_manager import feed_manager # noqa
major, minor, _ = (int(i) for i in django.__version__.split('.'))
if major < 3 or (major == 3 and minor < 2):
# deprecated as of Django 3.2
default_app_config = 'stream_django.apps.StreamDjangoConfig'
| bsd-3-clause | Python |
879658be4e045d59e3d0154aef87bf250d8c8205 | Update appointments.py | Programmeerclub-WLG/Agenda-App | gui/appointments.py | gui/appointments.py | """
Dit is het bestand voor de afspraken-sectie of apart scherm voor de Agenda-App
Het heeft een aantal functies en dezen staat beschreven in de drive.
<LICENSE>
<COPYRIGHT NOTICE>
<DEVELOPER>
<VERSION and DATE>
"""
| apache-2.0 | Python | |
89b17d257f42bf179bee74c6ed630b480474a640 | Remove unused import | guildai/guild,guildai/guild,guildai/guild,guildai/guild | guild/models_cmd.py | guild/models_cmd.py | import guild.cli
import guild.cmd_support
def main(args, ctx):
if args.installed:
_maybe_ignore_project(args)
_print_installed_models()
else:
_print_project_models(args, ctx)
def _maybe_ignore_project(args):
if args.project_location:
guild.cli.out(
"Ignoring mod... | import guild.cli
import guild.cmd_support
import guild.project
def main(args, ctx):
if args.installed:
_maybe_ignore_project(args)
_print_installed_models()
else:
_print_project_models(args, ctx)
def _maybe_ignore_project(args):
if args.project_location:
guild.cli.out(
... | apache-2.0 | Python |
1c788ebc0482a748b83567161bc3cc6291586b4b | 版本号升级至0.8 | jeffkit/goldencage | goldencage/__init__.py | goldencage/__init__.py | VERSION=0.8
| VERSION=0.7
| bsd-3-clause | Python |
05a108999ff7c30b20cd7e1f4981d8f3b5afa6be | Make runtests.py executable | gasman/Willow,gasman/Willow | runtests.py | runtests.py | #!/usr/bin/env python
import sys
import unittest
from tests.test_registry import *
from tests.test_pillow import *
from tests.test_wand import *
from tests.test_image import *
if __name__ == '__main__':
args = list(sys.argv)
if '--opencv' in args:
from tests.test_opencv import *
args.remove... | import sys
import unittest
from tests.test_registry import *
from tests.test_pillow import *
from tests.test_wand import *
from tests.test_image import *
if __name__ == '__main__':
args = list(sys.argv)
if '--opencv' in args:
from tests.test_opencv import *
args.remove('--opencv')
unitt... | bsd-3-clause | Python |
a703f196a15e3e87ae8490c42c8308ff6660be8f | change start command | gamechanger/dusty,gamechanger/dusty,gamechanger/dusty,gamechanger/dusty,gamechanger/dusty | dusty/commands/__init__.py | dusty/commands/__init__.py | """Entrypoint which the daemon uses for processing incoming commands."""
from . import bundle, repos, manage_config, run
from .. import compiler
COMMAND_TREE = {
'bundle': {
'list': bundle.list_bundles,
'activate': bundle.activate_bundle,
'deactivate': bundle.deactivate_bundle
},
'... | """Entrypoint which the daemon uses for processing incoming commands."""
from . import bundle, repos, manage_config, run
from .. import compiler
COMMAND_TREE = {
'bundle': {
'list': bundle.list_bundles,
'activate': bundle.activate_bundle,
'deactivate': bundle.deactivate_bundle
},
'... | mit | Python |
f235cf10df5262b6138cc6273a398166b98e950c | Remove DFP dependency | praekelt/jmbo-contact,praekelt/jmbo-contact | test_settings.py | test_settings.py | # We're still on Django 1.4 and use django-setuptest. Use this as a starting
# point for your test settings. Typically copy this file as test_settings.py
# and replace myapp with your app name.
from os.path import expanduser
DEBUG = True
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql... | # We're still on Django 1.4 and use django-setuptest. Use this as a starting
# point for your test settings. Typically copy this file as test_settings.py
# and replace myapp with your app name.
from os.path import expanduser
DEBUG = True
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql... | bsd-3-clause | Python |
ea1bafae8cc04df43086087ad61a6ad7ce21556d | Set version number to 0.9.dev. | jaddison/django-assets,Eksmo/django-assets,logston/django-assets,logston/django-assets,ridfrustum/django-assets,mcfletch/django-assets,adamchainz/django-assets | django_assets/__init__.py | django_assets/__init__.py | # Make a couple frequently used things available right here.
from webassets.bundle import Bundle
from django_assets.env import register
__all__ = ('Bundle', 'register')
__version__ = (0, 9, 'dev')
__webassets_version__ = ('dev',)
from django_assets import filter
| # Make a couple frequently used things available right here.
from webassets.bundle import Bundle
from django_assets.env import register
__all__ = ('Bundle', 'register')
__version__ = (0, 8)
__webassets_version__ = (0, 8)
from django_assets import filter
| bsd-2-clause | Python |
7dedb6d1e61cecd5a69ec17bc65a0e9ee153e8eb | Update test runner django to coverage | williamroot/opps,williamroot/opps,YACOWS/opps,jeanmask/opps,YACOWS/opps,opps/opps,jeanmask/opps,williamroot/opps,opps/opps,YACOWS/opps,opps/opps,jeanmask/opps,YACOWS/opps,opps/opps,williamroot/opps,jeanmask/opps | runtests.py | runtests.py | #!/usr/bin/env python
import sys
from django.conf import settings
from django.core.management import execute_from_command_line
if not settings.configured:
settings.configure(
DATABASES={
'default': {
'ENGINE': 'django.db.backends.sqlite3',
}
},
MIDD... | #!/usr/bin/env python
import sys
from django.conf import settings
from django.core.management import execute_from_command_line
if not settings.configured:
settings.configure(
DATABASES={
'default': {
'ENGINE': 'django.db.backends.sqlite3',
}
},
MIDD... | mit | Python |
95cf22fa8e61e5a37cf71a04c84dc8473f12e14f | clean up url wrappers, add support for re_path() and new style url() alias | mgrp/django-distill | django_distill/distill.py | django_distill/distill.py | # -*- coding: utf-8 -*-
from django_distill.errors import (DistillError, DistillWarning)
urls_to_distill = []
def _distill_url(func, *a, **k):
distill_func = k.get('distill_func')
distill_file = k.get('distill_file')
if distill_file:
del k['distill_file']
if distill_func:
del k['... | # -*- coding: utf-8 -*-
from django.conf.urls import url
from django_distill.errors import (DistillError, DistillWarning)
urls_to_distill = []
def distill_url(*a, **k):
distill_func = k.get('distill_func')
distill_file = k.get('distill_file')
if distill_file:
del k['distill_file']
if dis... | mit | Python |
115f069c33d4411d3e08df9029473811eb2bbe11 | remove sharedmem import | rainwoodman/bigfile,rainwoodman/bigfile,rainwoodman/bigfile | runtests.py | runtests.py | import sys
import os
from numpy.testing import Tester
# need an install to run these tests
from sys import argv
tester = Tester()
result = tester.test(extra_argv=['-w', 'tests'] + argv[1:])
if not result:
raise Exception("Test Failed")
| import sharedmem
import sys
import os
from numpy.testing import Tester
# need an install to run these tests
from sys import argv
tester = Tester()
result = tester.test(extra_argv=['-w', 'tests'] + argv[1:])
if not result:
raise Exception("Test Failed")
| bsd-2-clause | Python |
845aa7ad89868cf75cfd2c2c97debc6dd418d952 | fix split_command() for mac | ponty/EasyProcess,ponty/easyprocess,ponty/EasyProcess,ponty/easyprocess | easyprocess/unicodeutil.py | easyprocess/unicodeutil.py | import logging
import shlex
import sys
import unicodedata
log = logging.getLogger(__name__)
PY3 = sys.version_info[0] >= 3
if PY3:
string_types = str,
else:
string_types = basestring,
class EasyProcessUnicodeError(Exception):
pass
def split_command(cmd, posix=None):
'''
- cmd is string list ... | import logging
import shlex
import sys
import unicodedata
log = logging.getLogger(__name__)
PY3 = sys.version_info[0] >= 3
if PY3:
string_types = str,
else:
string_types = basestring,
class EasyProcessUnicodeError(Exception):
pass
def split_command(cmd, posix=None):
'''
- cmd is string list ... | bsd-2-clause | Python |
749ce893fe71ce669014147e906918c9c8b93a31 | Add main loop | dashford/sentinel | sentinel.py | sentinel.py | from bluepy import btle
from time import sleep
import logging
import requests
import datetime
from src.Sensors.SensorTagCC2650 import SensorTagCC2650
logger = logging.getLogger('SentinelClient')
logger.setLevel(logging.DEBUG)
# TODO use device factory or pass device factory into Sensor directly
device = btle.Peripher... | from bluepy import btle
from time import sleep
import logging
import requests
import datetime
from src.Sensors.SensorTagCC2650 import SensorTagCC2650
logger = logging.getLogger('SentinelClient')
logger.setLevel(logging.DEBUG)
# TODO use device factory or pass device factory into Sensor directly
device = btle.Peripher... | mit | Python |
99cbc10841434793d051adad949dad70af7ffd17 | Move to web.py | MrWhoami/WhoamiBangumi,MrWhoami/WhoamiBangumi | index.wsgi | index.wsgi | import os
import sae
import web
urls = (
'/', 'Hello'
)
app_root = os.path.dirname(__file__)
templates_root = os.path.join(app_root, 'templates')
render = web.template.render(templates_root)
class Hello:
def GET(self):
return "Using web.py"
app = web.application(urls, globals()).wsgifunc()
applica... | import os
import sae
import web
urls = (
'/', 'Hello'
)
app_root = os.path.dirname(__file__)
templates_root = os.path.join(app_root, 'templates')
render = web.template.render(templates_root)
class Hello:
def GET(self):
return render.hello()
app = web.application(urls, globals()).wsgifunc()
applica... | mit | Python |
3d0b746cae49f370f82f696ecd8d85c751ba50a1 | Add debug output of single capture | looplab/skal | tests/helpers.py | tests/helpers.py | # Copyright 2012 Loop Lab
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, sof... | # Copyright 2012 Loop Lab
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, sof... | apache-2.0 | Python |
c317bc768eec6f05568290751ae65232dbccccdc | Clean messaging and clean content of created file. | goord/ece2cmor3,goord/ece2cmor3 | ece2cmor3/scripts/mip-experiment-list.py | ece2cmor3/scripts/mip-experiment-list.py | #!/usr/bin/env python
# Thomas Reerink
#
# Run example:
# python mip-experiment-list.py
#
# Looping over all MIPs and within each MIP over all its MIP experiments.
# Printing the MIP experiment list with some additional info.
#
# This script is part of the subpackage genecec (GENerate EC-Eearth Control output files)
#... | #!/usr/bin/env python
# Thomas Reerink
#
# Run example:
# python mip-experiment-list.py
#
# Looping over all MIPs and within each MIP over all its MIP experiments.
# Printing the MIP experiment list with some additional info.
#
# This script is part of the subpackage genecec (GENerate EC-Eearth Control output files)
#... | apache-2.0 | Python |
2878efd6229f51673f662a329ae010b89b8e16c8 | add run-dirty debugging flag to tests | ccbrown/needy,vmrob/needy,bittorrent/needy,bittorrent/needy,ccbrown/needy,vmrob/needy | tests/run-all.py | tests/run-all.py | #!/usr/bin/env python
import argparse
import os
import shutil
import subprocess
import sys
tests_directory = os.path.dirname(os.path.realpath(__file__))
needy_path = os.path.join(tests_directory, '..', 'needy.py')
def test(directory, needy_args, run_dirty=False):
print 'Running test in %s: %s' % (directory, ' '.... | #!/usr/bin/env python
import argparse
import os
import shutil
import subprocess
import sys
tests_directory = os.path.dirname(os.path.realpath(__file__))
needy_path = os.path.join(tests_directory, '..', 'needy.py')
def test(directory, args):
print 'Running test in %s: %s' % (directory, ' '.join(args))
os.chdi... | mit | Python |
e5acd115ad4b4784ed3f447aa83bcfbe45ea194b | remove completed TODOs | lcary/nbd,lcary/nbd | nbd/main.py | nbd/main.py | #!/bin/python
from argparse import (ArgumentParser, ArgumentDefaultsHelpFormatter)
import logging
from os import path as ospath
from .command import (cd_if_necessary, git_repo_root)
from .const import PKG_NAME
from .diff import DiffGenerator
from .fileops import normrelpath
logger = logging.getLogger()
logger.setLev... | #!/bin/python
from argparse import (ArgumentParser, ArgumentDefaultsHelpFormatter)
import logging
from os import path as ospath
from .command import (cd_if_necessary, git_repo_root)
from .const import PKG_NAME
from .diff import DiffGenerator
from .fileops import normrelpath
logger = logging.getLogger()
logger.setLev... | mit | Python |
68b8e706b7a36769de9b1a12c869bbbaec25c110 | Integrate LLVM at llvm/llvm-project@71604f4c4c30 | tensorflow/runtime,tensorflow/runtime,tensorflow/runtime,tensorflow/runtime | third_party/llvm/workspace.bzl | third_party/llvm/workspace.bzl | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tfrt_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "71604f4c4c3059df51d3e4b0561e2cf31461ff7a"
LLVM_SHA256 = "810309a8df3d05f669fff04536bb04b9f24ceef2eacecca112072095ac5b9984"
tfrt_http_archive(
... | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tfrt_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "9e37b1e5a0c15f36c5642406d5aa02a657a0b19c"
LLVM_SHA256 = "e2cca91a76ee6b44a6af91874e429af582b248b96ccd139373fec69ed0b0215f"
tfrt_http_archive(
... | apache-2.0 | Python |
18a8602149411f2df71ca6653e30ecbb2194434e | Integrate LLVM at llvm/llvm-project@6e6c1efe04d4 | tensorflow/runtime,tensorflow/runtime,tensorflow/runtime,tensorflow/runtime | third_party/llvm/workspace.bzl | third_party/llvm/workspace.bzl | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tfrt_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "6e6c1efe04d45b717091e06eec94f0eef64839b1"
LLVM_SHA256 = "7ceeb7d6393a59b95fc9d54ed20cb024a8609a0826baafceacd723d0e2314687"
tfrt_http_archive(
... | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tfrt_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "20d253e3bf69494e670ad529b311948a21caf783"
LLVM_SHA256 = "73f4b6e4f6c792fe40094015d63a48ad763324eb08b0902cf5b8d69143b58152"
tfrt_http_archive(
... | apache-2.0 | Python |
e4e8a05d117cbc878f52392ea97d12e21bd2d490 | Integrate LLVM at llvm/llvm-project@0bbb502daa90 | tensorflow/runtime,tensorflow/runtime,tensorflow/runtime,tensorflow/runtime | third_party/llvm/workspace.bzl | third_party/llvm/workspace.bzl | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tfrt_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "0bbb502daa9017480d5fe595556a4f4e5adfcb3f"
LLVM_SHA256 = "27bb034c19c4c254ea9a09d842a5b610bc88aa4e0df3d0d575ca80a4fdc4ce29"
tfrt_http_archive(
... | """Provides the repository macro to import LLVM."""
load("//third_party:repo.bzl", "tfrt_http_archive")
def repo(name):
"""Imports LLVM."""
LLVM_COMMIT = "f3c577ed38e55dca46692313f5b76688a115861a"
LLVM_SHA256 = "b6f517337b0327637755ed08851cb0a0ff924d08b65983789033a28b661e083f"
tfrt_http_archive(
... | apache-2.0 | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.