code stringlengths 6 947k | repo_name stringlengths 5 100 | path stringlengths 4 226 | language stringclasses 1
value | license stringclasses 15
values | size int64 6 947k |
|---|---|---|---|---|---|
from calendar import monthrange as monrange
from datetime import datetime, date
__all__ = ['tocsv', 'fromcsv', 'date_to_float']
def tocsv(data, header, fname):
"""Converts a table into a CSV file."""
with open(fname, 'w') as f:
print(','.join(header), file = f)
for row in data:
print(row, file = f)
def fr... | Undeterminant/math-modeling | mathmodeling/misc.py | Python | cc0-1.0 | 983 |
from django.db import models
from django.utils import timezone
from videolibrary.models import SourceVideo
# Create your models here.
# TODO consider whether this is needed anymore
class RequestedSign(models.Model):
short_description = models.CharField(max_length=100)
description = models.TextField()
dat... | nasfarley88/thebslparlour | bslparloursite/tgbot/models.py | Python | cc0-1.0 | 651 |
# MySQL Connector/Python - MySQL driver written in Python.
# Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved.
# MySQL Connector/Python is licensed under the terms of the GPLv2
# <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most
# MySQL Connectors. There are special exceptio... | gdub/mysql-connector-python | lib/mysql/connector/connection.py | Python | gpl-2.0 | 62,655 |
# -*- coding: utf8 -*-
import logging
from logging.handlers import RotatingFileHandler
from babel.dates import format_datetime, datetime
from time import sleep
from traceback import print_exception, format_exception
class LogFile(logging.Logger):
'''rotatively logs erverything
'''
def initself(self):
... | littleDad/mesLucioles | logger_04.py | Python | gpl-2.0 | 2,415 |
import numpy as np
def wzorProst3d(p1,p2):
wsp = np.array([p1[0],(p2[0]-p1[0]),p1[1],(p2[1]-p1[1]),p1[2],(p2[2]-p1[2])])
return wsp
def plaszczyznaRownolegla(p1,p2,p3):
p12 = np.array([p2[0]-p1[0],p2[1]-p1[1],p2[2]-p1[2]])
p13 = np.array([p3[0]-p1[0],p3[1]-p1[1],p3[2]-p1[2]])
wek = np.cross(p12,p1... | Venris/crazyflie-multilink | KM/kamera_testy/3d_position.py | Python | gpl-2.0 | 2,600 |
import re, time, os, shutil, string
from subprocess import Popen, PIPE, STDOUT
from random import randint, seed
__all__ = ['find', 'removedirs', 'source', 'tempfile', 'copy', 'rm', 'template, template_dir']
def find(path='.', regex='*', ctime=0):
r = []
regex = str(regex).strip()
if regex == '*': regex = ... | raphaelvalentin/Utils | functions/system.py | Python | gpl-2.0 | 3,297 |
# -*- coding: utf-8 -*-
from apconf import Options
opts = Options()
def get(value, default):
return opts.get(value, default, section='Database')
class DatabasesMixin(object):
def DATABASES(self):
engine = get('DATABASE_ENGINE', 'sqlite3')
if 'django.db.backends' in engine:
ENG... | eduherraiz/naniano | src/apconf/mixins/database.py | Python | gpl-2.0 | 800 |
#!/usr/bin/python -t
# This program 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) any later version.
#
# This program is distributed in the hope that it... | akozumpl/yum | yumcommands.py | Python | gpl-2.0 | 110,814 |
"""
WSGI config for latincheck 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
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SE... | gep/latincheck | latincheck/wsgi.py | Python | gpl-2.0 | 397 |
import unittest
import sys
import os
from implementation.primaries.GUI import helpers
class testStylesheet(unittest.TestCase):
def setUp(self):
self.theme_folder = os.path.join(helpers.get_base_dir(True), 'themes')
def testCleanPath(self):
path = 'themes/item.png'
if sys.platform == ... | Godley/Music-Library | implementation/primaries/GUI/tests/testHelpers.py | Python | gpl-2.0 | 3,217 |
#!/usr/bin/env python
#:::::::::::::::::::::::::::::::::::::::::::::::::::::
#Author: Damiano Barboni <damianobarboni@gmail.com>
#Version: 0.1
#Description: Script used to test bandsharing.py
#Changelog: Wed Jun 11 12:07:33 CEST 2014
# First test version
#
#::::::::... | beardbig/bandsharing | tests/bandsharing_tests.py | Python | gpl-2.0 | 1,065 |
import string
def fillChars(chars):
for i in string.ascii_lowercase:
chars.append(i)
def getColumnNumber():
columnNumber=int(raw_input("Please input cell number: "))
return columnNumber
def printColumns(chars):
printBlank=True
counter=1
for c0 in chars... | arielisidro/myprograms | python/practice/ExcelColumns.py | Python | gpl-2.0 | 2,439 |
# Django settings for django_http_api project.
import os
import dj_database_url
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': dj_database_url.config(
defaul... | shailr/vms | django_http_api/settings.py | Python | gpl-2.0 | 6,509 |
from icalendar import Calendar, vCalAddress, vText
import icalendar
from datetime import timedelta
from django.template import RequestContext
from django.http import HttpResponseRedirect
from django.shortcuts import render_to_response
from django.core.urlresolvers import reverse
from django.core.exceptions import Objec... | JoeJasinski/evesch | evesch/core/feed/views.py | Python | gpl-2.0 | 8,264 |
#!/usr/bin/env python
#******************************************
#collection of handy tools when dealing with fits and search pahse
#******************************************
#import stuff
import sys, os, math, ROOT
#******************************************
def simpleFit(fileName, histDir, histName, hmin=1100., ... | guescio/toolbox | searchPhaseTools.py | Python | gpl-2.0 | 2,268 |
"""
Functionality for running arbitrary shell scripts.
@var ALL_USERS: A token indicating all users should be allowed.
"""
import os
import sys
import os.path
import tempfile
import shutil
from twisted.internet.protocol import ProcessProtocol
from twisted.internet.defer import (
Deferred, fail, inlineCallbacks, r... | CanonicalLtd/landscape-client | landscape/client/manager/scriptexecution.py | Python | gpl-2.0 | 14,754 |
from django.conf import settings
from django.db import models
class Group(models.Model):
slug = models.SlugField(max_length=30, unique=True)
about = models.TextField()
def __str__(self):
return self.slug
class Profile(models.Model):
user = models.OneToOneField(settings.AUTH_USER_MODEL)
... | evonaut/bolzplatz | bolzplatz/users/models.py | Python | gpl-2.0 | 581 |
# Parallel Biclustering Algorithm - Fast Algorithm for finding all biclusters in a GEM
# Copyright (C) 2006 Luke Imhoff
#
# This program 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 t... | KronicDeth/biclustering | src/python/Biclustering/Combinatorics.py | Python | gpl-2.0 | 5,914 |
import sys, os, time, atexit
from signal import SIGTERM, SIGKILL
class Daemon:
"""
A generic daemon class.
Usage: subclass the Daemon class and override the run() method
"""
def __init__(self, pidfile, stdin='/dev/null', stdout='/dev/null', stderr='/dev/null'):
self.stdin = stdin
self.stdout = stdout
self... | marshallflax/NVDARemoteServer | daemon.py | Python | gpl-2.0 | 3,540 |
"""Core functionality for starting, restarting, and stopping a selenium browser."""
import atexit
import json
import threading
import time
import urllib2
from collections import namedtuple
from shutil import rmtree
from string import Template
from tempfile import mkdtemp
import os
import requests
import warnings
from ... | mfalesni/cfme_tests | cfme/utils/browser.py | Python | gpl-2.0 | 14,319 |
# -*- coding: utf-8 -*-
"""
***************************************************************************
OTBTester.py
---------------------
Copyright : (C) 2013 by CS Systemes d'information (CS SI)
Email : otb at c-s dot fr (CS SI)
Contributors : Julien Malik (CS SI... | drnextgis/QGIS | python/plugins/processing/algs/otb/maintenance/OTBTester.py | Python | gpl-2.0 | 17,027 |
#!/usr/bin/python
#
# Copyright (C) 2006-2018 Wyplay, All Rights Reserved.
# This file is part of xbuilder.
#
# xbuilder 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
# (a... | frogbywyplay/genbox_xbuilder | xbuilder/consts.py | Python | gpl-2.0 | 1,713 |
from drivers.servo_driver import Servo
import submodules.stepper_axis as stepper_axis
from math import atan, degrees
import time
class RoboticArm:
# Dimensions of the Arm
vertical_offset_mm = 50
vertical_arm_mm = 100
horizontal_arm_mm = 100
level_arm_len= 20
claw_offset_to_center = 10
small_cup_positio... | srikary/sous-chef | modules/robotic_arm.py | Python | gpl-2.0 | 7,751 |
# Exercise 1
#
# Improve the Critter caretaker program by allowing the user to specify how much food he or she feeds the critter and
# how long he or she plays with the critter. Have these values affect how quickly the critter's hunger and boredom
# levels drop.
#
class Critter(object):
"""A virtual pet"""
def... | dmartinezgarcia/Python-Programming | Chapter 8 - Software Objects/exercise_1.py | Python | gpl-2.0 | 2,396 |
#!/usr/bin/env python3
# Copyright (C) 2013-2018 Samuel Damashek, Peter Foley, James Forcier, Srijay Kasturi, Reed Koser, Christopher Reffett, and Tris Wilson
#
# This program 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 Softwa... | tjcsl/cslbot | bot.py | Python | gpl-2.0 | 1,125 |
s, t = raw_input(), raw_input()
u, v = sorted(s), sorted(t)
def subset(a, b):
i = 0
for c in a:
if i < len(b) and c == b[i]: i += 1
return i == len(b)
if u == v: print "array"
elif subset(s, t): print "automaton"
elif subset(u, v): print "both"
else: print "need tree"
| Sarthak30/Codeforces | suffix_structures.py | Python | gpl-2.0 | 289 |
"""
Django settings for BenHoboCo project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
... | tpolasek/cmput410-project | BenHoboCo/BenHoboCo/settings.py | Python | gpl-2.0 | 2,810 |
# -*- coding: utf-8 -*-
from django.shortcuts import render
from django.http import HttpResponsePermanentRedirect, Http404, HttpResponseRedirect
from django.views.decorators.http import require_GET
from django.contrib.auth import login, authenticate
from django.core.urlresolvers import reverse_lazy
from django.contrib... | ricardodani/django-simple-url-shortner | simple_url_shortner/urlshortener/views.py | Python | gpl-2.0 | 3,074 |
#!/usr/bin/python3
def vogal(v):
lista = ['a','e','i','o','u','A','E','I','O','U']
if v in lista:
return True
else:
return False
| david81brs/seaport | l4_vogais.py | Python | gpl-2.0 | 159 |
import string
import sys
class GeneticCode:
"""A container for NCBI translation tables.
See the ncbi translation tables, which this week are at
http://www.ncbi.nlm.nih.gov/Taxonomy/Utils/wprintgc.cgi?mode=c
(If they move, poke around the 'taxonomy browser' area.)
This week we have
- **1**... | pgfoster/p4-phylogenetics | p4/geneticcode.py | Python | gpl-2.0 | 18,804 |
from setuptools import find_packages, setup
setup(
name="tcg - terminal card games",
version="1.0",
description="Collection of card games for the command line.",
install_requires=[
"colored==1.4.2",
],
entry_points={
"console_scripts": [
"tcg-blackjack = tcg.blackjac... | ProfOak/terminal-card-games | setup.py | Python | gpl-2.0 | 349 |
import os
import sys
import fnmatch
serp_directory = '/Users/david/Dropbox/Shares/Vu-David/data/iiix_serp_results/'
serp_directory_files = [z for z in os.listdir(serp_directory) if os.path.isfile(os.path.join(serp_directory, z))]
def get_user_topic_queries(queries):
"""
Taking the queries data structure (gene... | maxwelld90/searcher_simulations | configs/publications/cikm2015/scripts/user_summary_generator_cg.py | Python | gpl-2.0 | 13,051 |
# -*- coding: utf-8 -*-
from __future__ import print_function
# daemon/daemon.py
# Part of python-daemon, an implementation of PEP 3143.
#
# Copyright © 2008–2010 Ben Finney <ben+python@benfinney.id.au>
# Copyright © 2007–2008 Robert Niederreiter, Jens Klein
# Copyright © 2004–2005 Chad J. Schroeder
# Copyright © 2003... | candlepin/virt-who | virtwho/daemon/daemon.py | Python | gpl-2.0 | 25,080 |
tion for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution(object):
def maxDepth(self, root):
"""
:type root: TreeNode
:rtype: int
"""
if root:
s... | Jacy-Wang/MyLeetCode | MaxDepthBinTree104Recursion.py | Python | gpl-2.0 | 678 |
# console_textview.py
#
# Copyright 2015 Hugo Teso <hugo.teso@gmail.com>
#
# This program 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 Lic... | inguma/bokken | ui/console_textview.py | Python | gpl-2.0 | 4,916 |
import numpy as np
import sys
sys.path.append("../Pipeline/Audio/Pipeline/")
from AudioPipe.features import mfcc # Feature Extraction Module, part of the shared preprocessing
import AudioPipe.speaker.recognition as SR # Speaker Recognition Module
import scipy.io.wavfile as wav
import commands, os
import json
import ar... | RedHenLab/Audio | CNN/detect_outlier.py | Python | gpl-2.0 | 3,781 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# RedisPress.alpha
# ---
# Database: Redis
# Framework: Tornado
import sys
import raven.contrib.tornado
import tornado.httpserver
import tornado.ioloop
import project.app.application
if __name__ == '__main__':
if len(sys.argv) == 2:
port = sys.argv[1]
else:
... | Evlos/rwbypress | app.py | Python | gpl-2.0 | 726 |
# -*- coding: utf-8 -*-
#
# Copyright © 2012 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public
# License as published by the Free Software Foundation; either version
# 2 of the License (GPLv2) or (at your option) any later version.
# There is NO WARRANTY for this software, express or impli... | splice/splice-server | src/splice/common/rhic_serve_client.py | Python | gpl-2.0 | 3,508 |
from controller import Controller
import time
import json
from unichess import UniChess
from unicode import *
import locale
from color import color
locale.setlocale(locale.LC_ALL,"")
with open("story.json") as story_file:
story = json.load(story_file)
glb = Controller()
Board = UniChess()
Board.setup_board()
for l... | Nixonite/Chess-RPG | main.py | Python | gpl-2.0 | 513 |
#!/usr/bin/python
## Lecture 6
## Fasting using a cache as empty dict
##: AKA - Mediation and DUplication
##:
##: Inouts -> two numbers
#Output - > the solution to those two numbers
# multiplied together using the Russian Peason
# 192 x 13 = 2496
import time
CACHE = {}
def russian(a,b):
key = (a,b) # define tuple... | hiteshagrawal/python | udemy/russian-peasant-by-author-testing-fasting.py | Python | gpl-2.0 | 1,509 |
import json
from zoom.common.types import UpdateType
class TimeEstimateMessage(object):
def __init__(self):
self._message_type = UpdateType.TIMING_UPDATE
self._contents = dict()
@property
def message_type(self):
return self._message_type
@property
def contents(self):
... | spottradingllc/zoom | server/zoom/www/messages/timing_estimate.py | Python | gpl-2.0 | 855 |
from Tkinter import *
import cv2
from PIL import Image, ImageTk
import pyautogui
width, height = 302, 270
screenwidth, screenheight = pyautogui.size()
cap = cv2.VideoCapture(0)
cap.set(cv2.cv.CV_CAP_PROP_FRAME_WIDTH, width)
cap.set(cv2.cv.CV_CAP_PROP_FRAME_HEIGHT, height)
root = Tk()
root.title("Testing Mode")
root.b... | Qwertycal/19520-Eye-Tracker | GUI and Mouse/myVidInGUI.py | Python | gpl-2.0 | 2,428 |
#
# Parse tree nodes
#
from __future__ import absolute_import
import cython
cython.declare(sys=object, os=object, copy=object,
Builtin=object, error=object, warning=object, Naming=object, PyrexTypes=object,
py_object_type=object, ModuleScope=object, LocalScope=object, ClosureScope=obje... | jos4uke/getSeqFlankBlatHit | lib/python2.7/site-packages/Cython/Compiler/Nodes.py | Python | gpl-2.0 | 349,102 |
#
# Copyright 2009-2011 Red Hat, Inc.
#
# This program 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) any later version.
#
# This program is distributed ... | borisroman/vdsm | vdsm/storage/sd.py | Python | gpl-2.0 | 29,084 |
import os, time
import subprocess
from autotest_lib.client.bin import test
from autotest_lib.client.common_lib import utils, error
class cpuset_tasks(test.test):
version = 1
preserve_srcdir = True
def initialize(self):
self.job.require_gcc()
def setup(self):
os.chdir(self.srcdir)
... | yochow/autotest | client/tests/cpuset_tasks/cpuset_tasks.py | Python | gpl-2.0 | 939 |
# Copyright 2008-2013 Jaap Karssenberg <jaap.karssenberg@gmail.com>
import tests
from tests import os_native_path
import os
from zim.config import *
from zim.fs import adapt_from_oldfs
from zim.newfs import File, Folder, LocalFolder
from zim.notebook import Path
import zim.config
# Check result of lookup funct... | jaap-karssenberg/zim-desktop-wiki | tests/config.py | Python | gpl-2.0 | 22,669 |
# -*- coding: utf-8 -*-
"""
Created on 11 Apr 2014
@author: Kimon Tsitsikas
Copyright © 2013-2016 Kimon Tsitsikas and Éric Piel, Delmic
This file is part of Odemis.
Odemis is free software: you can redistribute it and/or modify it under the
terms of the GNU General Public License version 2 as published by the Free... | ktsitsikas/odemis | src/odemis/acq/align/autofocus.py | Python | gpl-2.0 | 23,236 |
#!/usr/bin/python2
# This is an Adaboost classifier
import sys
from util import get_split_training_dataset
from metrics import suite
import feature_selection_trees as fclassify
from sklearn.grid_search import GridSearchCV
from sklearn.ensemble import AdaBoostClassifier
from sklearn.tree import DecisionTreeClassifi... | bravelittlescientist/kdd-particle-physics-ml-fall13 | src/adaboost.py | Python | gpl-2.0 | 1,625 |
from __future__ import absolute_import
from qgis.PyQt.QtCore import *
from .variablesview import custom_class_handlers, make_item
def handle_QModelIndex(value, parent):
make_item('valid', value.isValid(), parent)
if value.isValid():
make_item('row', value.row(), parent)
make_item('column', v... | wonder-sk/qgis-first-aid-plugin | handlers_qt.py | Python | gpl-2.0 | 453 |
# encoding: utf-8
# module pango
# from /usr/lib/python2.7/dist-packages/gtk-2.0/pango.so
# by generator 1.135
# no doc
# imports
import gobject as __gobject
import gobject._gobject as __gobject__gobject
class WrapMode(__gobject.GEnum):
# no doc
def __init__(self, *args, **kwargs): # real signature unknown
... | ProfessorX/Config | .PyCharm30/system/python_stubs/-1247972723/pango/WrapMode.py | Python | gpl-2.0 | 659 |
#!/usr/bin/python
###
#
# checkout-yubikey.py
#
# Troy Axthelm
# Advanced Research Computing Center
# University of Wyoming
# troy.axthelm@uwyo.edu
#
# Created: 13 June 2016
#
#
# Modified: <initials> <day> <month> <year> <change notes>
#
###
import sys
sys.path.insert(0, './lib/')
import logging
import subprocess
im... | WyoARCC/idm-management-tools | checkout-yubikey.py | Python | gpl-2.0 | 959 |
# -*- coding: utf-8 -*-
###############################################################################
#
# ShowServer
# Display a comrephensive set of information about the querried server such as: state information, server templates used, SSH key href, etc.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Tembo... | willprice/arduino-sphere-project | scripts/example_direction_finder/temboo/Library/RightScale/ShowServer.py | Python | gpl-2.0 | 4,124 |
from __future__ import absolute_import
# This file is part of BurnMan - a thermoelastic and thermodynamic toolkit for the Earth and Planetary Sciences
# Copyright (C) 2012 - 2017 by the BurnMan team, released under the GNU
# GPL v2 or later.
import numpy as np
import scipy.optimize as opt
from . import equation_of_sta... | tjhei/burnman | burnman/eos/birch_murnaghan_4th.py | Python | gpl-2.0 | 7,300 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file '/home/barpadue/.qgis/python/plugins/wps/qgswpsdescribeprocessgui.ui'
#
# Created: Thu Mar 15 14:27:35 2012
# by: PyQt4 UI code generator 4.8.5
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
tr... | GeoLabs/QgsWPSClient | Ui_qgswpsdescribeprocessgui.py | Python | gpl-2.0 | 1,346 |
#!/usr/bin/python
import sys
if __name__ == "__main__":
i = 0
while True:
i += 20
if (i % 19 == 0) and (i % 18 == 0) and (i % 17 == 0) and (i % 16 == 0) and (i % 15 == 0) \
and (i % 14 == 0) and (i % 13 == 0) and (i % 12 == 0) and (i % 11 == 0):
print i
sys... | generica/euler | 5.py | Python | gpl-2.0 | 329 |
# -*- coding: utf-8 -*-
#################################################################################################
# ReadEmbyDB
#################################################################################################
from DownloadUtils import DownloadUtils
class ReadEmbyDB():
doUtils = Download... | goofwear/Emby.Kodi | resources/lib/ReadEmbyDB.py | Python | gpl-2.0 | 15,756 |
##this script applies component models to the data of the selected month
#component predictions are summed to obtain global prediction
##where the component model does not exist (because data is too little), averages are used in the spitrit of the EAM
import csv
import gzip
import datetime
import numpy as np
import ma... | alinasirbu/eurora_job_power_prediction | Python_scripts_regression/one_user_apply.py | Python | gpl-2.0 | 6,590 |
# -*- coding: utf-8 -*-
import unittest
import logging
from os.path import isfile
from os import popen
from os import remove
from t2db_objects import objects
from t2db_objects.utilities import formatHash
from t2db_objects.parameters import generate_config_yaml
from clean_text.cleaner import sentenceCleaner
from cle... | ptorrestr/clean_text | clean_text/tests/test_cleaner.py | Python | gpl-2.0 | 7,295 |
"""Tests for the directory module"""
import os
from translate.storage import directory
class TestDirectory:
"""a test class to run tests on a test Pootle Server"""
def setup_method(self, method):
"""sets up a test directory"""
print("setup_method called on", self.__class__.__name__)
... | unho/translate | translate/storage/test_directory.py | Python | gpl-2.0 | 2,774 |
from setuptools import setup
setup(name='beatbox',
version='20.1', # be sure to update the version in _beatbox.py too
package_dir={'': 'src'},
packages=['beatbox'],
author = "Simon Fell et al",
author_email = 'plonesf@googlegroups.com',
description = "A Python library for querying/updating Sal... | smcmahon/beatbox | setup.py | Python | gpl-2.0 | 672 |
#!/usr/bin/env python
"""
A simple coin flipping example. The model is written in TensorFlow.
Inspired by Stan's toy example.
Probability model
Prior: Beta
Likelihood: Bernoulli
Inference: Maximum a posteriori
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_f... | ruohoruotsi/Wavelet-Tree-Synth | edward-examples/beta_bernoulli_map.py | Python | gpl-2.0 | 1,013 |
from __future__ import absolute_import
from Screens.Screen import Screen
from Screens.MessageBox import MessageBox
from Components.config import config
import Screens.Standby
from boxbranding import getMachineBrand, getMachineName
class PowerLost(Screen):
def __init__(self, session):
Screen.__init__(self, session)
... | atvcaptain/enigma2 | lib/python/Screens/PowerLost.py | Python | gpl-2.0 | 1,103 |
"""
Test usage of docker 'start' command
initialize:
1) prepare docker container, but don't start it
run_once:
2) execute docker start using the nonexisting name
3) execute the new container using `docker run`
4) execute docker start using the running docker name
5) stop the container
6) execute docker start using the... | afomm/autotest-docker | subtests/docker_cli/start/simple.py | Python | gpl-2.0 | 3,603 |
from Components.ActionMap import ActionMap
from Components.Sensors import sensors
from Components.Sources.Sensor import SensorSource
from Components.Sources.StaticText import StaticText
from Components.ConfigList import ConfigListScreen
from Components.config import getConfigListEntry
from Screens.Screen import Screen... | bally12345/enigma2 | lib/python/Plugins/SystemPlugins/TempFanControl/plugin.py | Python | gpl-2.0 | 10,581 |
from django.views.generic import TemplateView, ListView, DetailView, DeleteView, UpdateView, CreateView
from django.db.models.loading import get_models
from ..models import *
class DashView(TemplateView):
template_name = 'anansi/dash.html'
def get_context_data(self, **kwargs):
context = super(DashView,... | hazelmollusk/anansi | web/views.py | Python | gpl-2.0 | 2,285 |
#!/usr/bin/env python
# coding=utf-8
#
# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4
#
import httplib
import sys
def test(name,A,B):
if A != B:
print "Error :" + name
print "-----Actual--"
print A,"---Expected--"
print B,"-------------"
sys.exit(1)
else:
... | invicnaper/MWF | Utils/t/form_test.py | Python | gpl-2.0 | 10,150 |
# -*- coding: utf-8 -*-
###############################################################################
#
# GetTimestamp
# Returns the current date and time, expressed as seconds or milliseconds since January 1, 1970 (epoch time).
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the... | willprice/arduino-sphere-project | scripts/example_direction_finder/temboo/Library/Utilities/Dates/GetTimestamp.py | Python | gpl-2.0 | 6,772 |
import logging
import requests
from collections import OrderedDict
import operator as op
from ..lib import text
from ..controllers.request_maker import RequestMaker, RequestException
class AutocompleteApi(object):
base_url = 'http://suggestqueries.google.com/complete/search'
base_params = {'client': 'firef... | tbelhalfaoui/giddle | giddle/controllers/autocomplete_api.py | Python | gpl-2.0 | 2,924 |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
Author: Norin (copied it)
This program 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 3 of the License, or
(at your option) any later versio... | Norin-Radd/plugin.video.boilerroom | resources/lib/youtubewrapper.py | Python | gpl-2.0 | 9,753 |
'''
Created on Nov 7, 2013
@author: johannes
'''
from Bonjour import Bonjour
from Osc import Osc
import time
import OSC
def main():
name="oscTestServer"
regtype='_osc._udp'
b=Bonjour(name,regtype)
b.runBrowser()
try:
c=None
while(c==None):
c=b.getFirstClient() ... | sloev/data-pie | data-pie/network/OscClientTest.py | Python | gpl-2.0 | 636 |
# -*- coding: utf-8 -*-
"""
:copyright: 2005-2008 by The PIDA Project
:license: GPL 2 or later (see README/COPYING/LICENSE)
"""
# stdlib
import os.path
# gtk
import gtk, gobject
# PIDA Imports
# core
from kiwi.ui.objectlist import Column
from pida.core.service import Service
from pida.core.features impor... | fermat618/pida | pida-plugins/quickopen/quickopen.py | Python | gpl-2.0 | 7,589 |
class RcModel:
RcModels = {}
def rcIsDefault(self):
return True
def getRcFile(self, ext=''):
return ext
def getRcFolder(self, GetDefault=True):
return 'enigma2/data/'
def getRcImg(self):
return self.getRcFile('enigma2/data/rc.png')
def getRcPositions(self):
return self.getRcFile('enigma2/data/rcpos... | Taapat/enigma2-plugin-youtube | test/RcModel.py | Python | gpl-2.0 | 424 |
from ctypes import Structure, POINTER, c_void_p, cast, create_string_buffer, \
c_char_p, byref, memmove
from ctypes import windll, WinDLL, WINFUNCTYPE
try:
from ctypes import wintypes
except ValueError:
# see http://bugs.python.org/issue16396
raise ImportError("wintypes")
from keyring.util.escape impo... | b-jesch/service.fritzbox.callmonitor | resources/lib/PhoneBooks/pyicloud/vendorlibs/keyrings/alt/_win_crypto.py | Python | gpl-2.0 | 3,477 |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Promise'
db.create_table(u'party_promise', (
... | Maronato/aosalunos | party/migrations/0001_initial.py | Python | gpl-2.0 | 16,705 |
# -*- coding: utf-8 -*-
from api.connectors import *
from seafood.models import *
from api.imports import *
import time
import datetime
from django.utils.timezone import get_current_timezone, make_aware
def convert_date(dt):
return time.strptime(dt, "%d.%m.%Y")
def convert_date_time(dt, default=datetime.datet... | hdzierz/Kaka | scripts/load_length_frequency_data.py | Python | gpl-2.0 | 2,940 |
# -*- coding: utf-8 -*-
"""
Copyright (C) 2008-2012 Wolfgang Rohdewald <wolfgang@rohdewald.de>
partially based on C++ code from:
Copyright (C) 2006 Mauricio Piacentini <mauricio@tabuleiro.com>
kajongg is free software you can redistribute it and/or modify
it under the terms of the GNU General Public License as p... | jsj2008/kdegames | kajongg/src/config.py | Python | gpl-2.0 | 5,516 |
# -*- coding: utf-8 -*-
import os
from setuptools import setup
# Utility function to read the README file.
# Used for the long_description. It's nice, because now 1) we have a top level
# README file and 2) it's easier to type in the README file than to put a raw
# string in below ...
def read(fname):
return open... | rosscdh/django-crocodoc | setup.py | Python | gpl-2.0 | 911 |
# -*- coding: utf-8 -*-
from Tools.Profile import profile
from Screen import Screen
import Screens.InfoBar
import Components.ParentalControl
from Components.Button import Button
from Components.ServiceList import ServiceList
from Components.ActionMap import NumberActionMap, ActionMap, HelpableActionMap
from Components... | oe-alliance/oe-alliance-enigma2 | lib/python/Screens/ChannelSelection.py | Python | gpl-2.0 | 87,895 |
#!/usr/bin/python2 -O
# vim: fileencoding=utf-8
#
# The Qubes OS Project, https://www.qubes-os.org/
#
# Copyright (C) 2014-2015
# Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
# Copyright (C) 2015 Wojtek Porczyk <woju@invisiblethingslab.com>
#
# This program is free software; you can ... | v6ak/qubes-core-admin | tests/__init__.py | Python | gpl-2.0 | 26,014 |
#!/usr/bin/env python
from datetime import timedelta
import numpy as np
from opendrift.readers import reader_basemap_landmask
from opendrift.readers import reader_netCDF_CF_generic
from opendrift.models.oceandrift import OceanDrift
o = OceanDrift(loglevel=0) # Set loglevel to 0 for debug information
reader_norkys... | knutfrode/opendrift | examples/example_grid_time.py | Python | gpl-2.0 | 1,294 |
"""
Application-class that implements pyFoamAddCaseDataToDatabase.py
"""
from optparse import OptionGroup
from .PyFoamApplication import PyFoamApplication
from PyFoam.Basics.RunDatabase import RunDatabase
from os import path
from PyFoam.ThirdParty.six.moves import cPickle as pickle
from PyFoam.ThirdParty.six import ... | takaakiaoki/PyFoam | PyFoam/Applications/AddCaseDataToDatabase.py | Python | gpl-2.0 | 2,898 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# --- BEGIN_HEADER ---
#
# cleanexe - [insert a few words of module description on this line]
# Copyright (C) 2003-2009 The MiG Project lead by Brian Vinter
#
# This file is part of MiG.
#
# MiG is free software: you can redistribute it and/or modify
# it under the terms of ... | heromod/migrid | mig/cgi-bin/cleanexe.py | Python | gpl-2.0 | 1,104 |
#!/usr/bin/python
# -*- coding: UTF-8 -*-
#Copyright (C) 2007 Adam Spencer - Free Veterinary Management Suite
#This program 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 ... | cyncyncyn/evette | lookupmethods.py | Python | gpl-2.0 | 6,071 |
# -*- coding: utf-8 -*-
"""
/***************************************************************************
Name : DB Manager
Description : Database manager plugin for QuantumGIS
Date : May 23, 2011
copyright : (C) 2011 by Giuseppe Sucameli
email : brush.... | imincik/pkg-qgis-1.8 | python/plugins/db_manager/db_plugins/plugin.py | Python | gpl-2.0 | 32,055 |
"""
Virtualization installation functions for image based deployment
Copyright 2008 Red Hat, Inc.
Bryan Kearney <bkearney@redhat.com>
Original version based on virt-image
David Lutterkort <dlutter@redhat.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General P... | remotesyssupport/koan | koan/imagecreate.py | Python | gpl-2.0 | 5,995 |
################################################################
# LiveQ - An interactive volunteering computing batch system
# Copyright (C) 2013 Ioannis Charalampidis
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the ... | wavesoft/LiveQ | liveq-common/liveq/reporting/postmortem.py | Python | gpl-2.0 | 11,208 |
#!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'edc_sms.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise Import... | botswana-harvard/edc-sms | manage.py | Python | gpl-2.0 | 627 |
# coding=utf-8
import base64
import zlib
import json
from sqlalchemy import Column, ForeignKey, Integer, String
import sqlalchemy
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relationship
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
Base = declarat... | Voldemort93/python | detect_remotes.py | Python | gpl-2.0 | 13,069 |
### Copyright (C) 2010 Peter Williams <peter_ono@users.sourceforge.net>
###
### This program 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; version 2 of the License only.
###
### This program is distribut... | pwil3058/darning | darning/cli/subcmd_select.py | Python | gpl-2.0 | 1,953 |
# Copyright 2012 OpenStack Foundation
# All Rights Reserved
# Copyright (c) 2012 NEC Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/lic... | Snergster/virl-salt | openstack/nova/files/mitaka/nova+network+neutronv2+api.py | Python | gpl-2.0 | 90,885 |
# -*- coding: utf-8 -*-
from django.conf.urls import patterns, url
# from django.conf import settings
urlpatterns = patterns('www.sight.views',
url(r'^$', 'sight_map'),
url(r'^(?P<sight_id>\d+)$', 'sight_detail'),
)
| lantianlz/qiexing | www/sight/urls.py | Python | gpl-2.0 | 287 |
# This file is part of PRAW.
#
# PRAW 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 3 of the License, or (at your option) any later
# version.
#
# PRAW is distributed in the hope that i... | patrickstocklin/chattR | lib/python2.7/site-packages/praw/__init__.py | Python | gpl-2.0 | 109,628 |
###############################################################################
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
... | Ecogenomics/GtdbTk | gtdbtk/external/hmm_aligner.py | Python | gpl-3.0 | 13,858 |
# -*- coding: utf-8 -*-
"""
WSGI config for oper 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
from django.core.wsgi import get_wsgi_application
os.environ.se... | rty65tt/oper-reader | oper/wsgi.py | Python | gpl-3.0 | 410 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.13 on 2018-09-18 16:38
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0010_auto_20180918_1317'),
]
operations = ... | interlegis/saap | saap/core/migrations/0011_municipio_estado.py | Python | gpl-3.0 | 577 |
# -*- coding: utf-8 -*-
# vi:si:et:sw=4:sts=4:ts=4
import unicodedata
from django.db.models import Q, Manager
from ox.django.query import QuerySet
from item.utils import decode_id
def parseCondition(condition, user):
'''
condition: {
value: "war"
}
or
condition: {
key: "y... | maysara/pandora_image | pandora/place/managers.py | Python | gpl-3.0 | 3,668 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import time
import obci_log_model
class DummyLogModel(obci_log_model.LogModel):
def __init__(self):
super(DummyLogModel, self).__init__()
self._ind = 0
self._peers_log = {'amplifier':
{'peer_id': 'amplifier', 'logs'... | BrainTech/openbci | obci/control/gui/obci_log_model_dummy.py | Python | gpl-3.0 | 732 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
""" Convenience functions for generating distinct colors.
Usage:
>>> generate_colors(4)
[(1.0, 0.0, 0.0), (0.5, 1.0, 0.0), (0.0, 1.0, 1.0), (0.5, 0.0, 1.0)]
"""
from __future__ import division
__author__ = 'Maarten Versteegh'
import math
def _hsv_to_rgb(h,f):
"""Conver... | mwv/babycircle | visualization/colors.py | Python | gpl-3.0 | 1,039 |
#!/usr/bin/env python
import subprocess, shutil, shlex, os
from sys import exit, argv
from netCDF4 import Dataset as NC
import numpy as np
def process_arguments():
from argparse import ArgumentParser
parser = ArgumentParser()
parser.add_argument("PISM_PATH")
parser.add_argument("MPIEXEC")
parser.a... | talbrecht/pism_pik06 | test/regression/test_29.py | Python | gpl-3.0 | 4,068 |
#!/usr/bin/env python
import math
import rospy
import tf
import std_msgs.msg
from rqt_gui_py.plugin import Plugin
from python_qt_binding.QtCore import Qt, Slot, QAbstractListModel
from python_qt_binding.QtWidgets import QWidget, QHBoxLayout, QVBoxLayout, QCheckBox, QLabel, QListWidget, QPushButton, QDoubleSpinBox, Q... | team-vigir/vigir_footstep_planning_basics | vigir_footstep_planning_widgets/src/vigir_footstep_planning_widgets/pattern_generator_widget.py | Python | gpl-3.0 | 7,255 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.