repo_name
stringlengths
5
104
path
stringlengths
4
248
content
stringlengths
102
99.9k
kriwil/markdown-newtab
markdown_newtab/__init__.py
""" New Tab Extension for Python-Markdown ===================================== Modify the behavior of Links in Python-Markdown to open a in a new window. This changes the HTML output to add target="_blank" to all generated links. """ from __future__ import absolute_import from __future__ import unicode_literals from...
mverwe/JetRecoValidation
PuThresholdTuning/python/akPu2CaloJetSequence10_cff.py
import FWCore.ParameterSet.Config as cms from HeavyIonsAnalysis.JetAnalysis.jets.akPu2CaloJetSequence_PbPb_mc_cff import * #PU jets with 10 GeV threshold for subtraction akPu2Calomatch10 = akPu2Calomatch.clone(src = cms.InputTag("akPu2CaloJets10")) akPu2Caloparton10 = akPu2Caloparton.clone(src = cms.InputTag("akPu2Ca...
tannn/TriviaTime
__init__.py
### # Copyright (c) 2013, tann <tann@trivialand.org> # All rights reserved. # # ### """ A feature-packed trivia plugin designed exclusively for #trivialand on Freenode. """ import supybot import supybot.world as world # Use this for the version of this plugin. You may wish to put a CVS keyword # in here if you're k...
anthal/snom_smarthome
CeBit2016/main.py
#!/usr/bin/python2 # -*- coding: utf8 -*- # # History: # 05.02.2016 v0.2 - initial release Homeautomatisierung # 14.02.2016 v0.21 - Homeautomatisierung for CeBit # 3 Raeume: # 0 - Wohnzimmer WZ # 1 - Arbeitszimmer AZ # 2 - Schlafzimmer SZ # Pro Raum: # - Steckdose mit Leistungsmessung # - Heizungssteller mit Temp...
strommer/Python_rpi
ex06_.py
import pprint def scan_data(file_): f = open(file_).readlines() dictionary_mesh = {} for line in f: dictionary_mesh[line.partition(';')[0]] = line.partition(';')[2].strip('\n') pprint.pprint(dictionary_mesh) def isa(a,b): dictionary = scan_data('mtr_smp.txt') print (dictionary[b] in dictionary[...
xaime/sneaks
plugins/bait_link.py
# - *- coding: utf- 8 - *- . # SNEAKS - Snooping Early Alert Knowledge Service __author__ = 'Xaime' from ConfigParser import RawConfigParser from datetime import datetime, timedelta import codecs import logging import urlparse import urllib import re import sys import ftplib import apache_log_parser from operator imp...
FrodeSolheim/fs-uae-launcher
fsgamesys/platforms/atari/hatariataridriver.py
# FSGS - Common functionality for FS Game System. # Copyright (C) 2013-2019 Frode Solheim <frode@solheim.dev> # # 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, ...
FABtotum/FAB-UI
fabui/python/gmacro.py
#!/usr/bin/python #gmacro.py controlled 1by1 gcode operations import sys import time, datetime import serial import json import ConfigParser import logging import os import argparse parser = argparse.ArgumentParser() parser.add_argument("preset", help="macro to execute") parser.add_argument("log_trace",...
kyleabeauchamp/T4Binding
code/benzene_box.py
import numpy as np import mdtraj as md from simtk.openmm import app import simtk.openmm as mm from simtk import unit as u from repex import rest code = "benzene" ff_name = "amber99sbildn" water_name = 'tip3p' which_forcefield = "%s.xml" % ff_name which_water = '%s.xml' % water_name ligand_filename = "./benzene2.pdb...
pombredanne/django-rest-framework-fine-permissions
tests/models.py
from django.db import models class Account(models.Model): user = models.OneToOneField('auth.User') expired_date = models.DateTimeField() @property def full_name(self): return '{0.first_name} {0.last_name}'.format(self.user) def is_expired(self): from datetime import datetime ...
ivanamihalek/progesterone
utils/mysqldb.py
# # This file is part of Progesterone pipeline. # # Progesterone pipeline 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. # # Progeste...
pimanac/modlogbot
submissionbot.py
#!/usr/bin/env python import os import sys import collections import praw import json import mysql.connector from prawoauth2 import PrawOAuth2Mini as pmini from database import database from time import sleep import time import yaml from pprint import pprint import inspect class bcolors: HEADER = '\033[95m' OKB...
pglauner/misc
src/cs212/tile_game.py
''' Created on Nov 9, 2013 @author: pglauner ''' from algorithms.routing.shortest_path import shortest_path_search from itertools import chain tile_games = [#Solvable (('E', 6, 5), (1, 3, 2), (7, 4, 0)), ((6, 5, 1), (3, 2, 7), (...
theatrus/cymbeline
cymbeline/Bootstrap.py
# Cymbeline - a python embedded framework # Copyright (C) 2004-2005 Yann Ramin # # 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 ...
pierrejean-coudert/winlibre_pm
package_manager/smart/searcher.py
# # Copyright (c) 2005 Conectiva, Inc. # # Written by Gustavo Niemeyer <niemeyer@conectiva.com> # # This file is part of Smart Package Manager. # # Smart Package Manager 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 Fou...
freesmartphone/framework
framework/subsystems/ousaged/resources.py
#!/usr/bin/env python # -*- coding: UTF-8 -*- """ Open Usage Daemon - Generic reference counted Resource Management (C) 2008 Michael 'Mickey' Lauer <mlauer@vanille-media.de> (C) 2008 Jan 'Shoragan' Lübbe <jluebbe@lasnet.de> (C) 2008 Openmoko, Inc. GPLv2 or later Package: ousaged Module: resources """ MODULE_NAME = "...
hsfzxjy/wisecitymbc
finance/models.py
#encoding=utf8 from decimal import Decimal from django.db import models from .fields import DecimalField from common.utils import getattrex, getattrlazy from django.utils.datastructures import SortedDict from django.core.validators import MaxValueValidator, MinValueValidator import warnings warnings.filterwarnings('i...
lmu/lmu.redmine.scripts
import_contacts.py
#!/usr/bin/env python import sys import socket hostname = socket.gethostname() if hostname == 'Pumukel-GNU-Tablet': sys.path[0:0] = [ '/usr/local/Plone/redmine.buildout/src/python-redmine', '/usr/local/Plone/buildout-cache/eggs/ipython-1.2.1-py2.7.egg', '/usr/local/Plone/buildout-cache/egg...
MickaelBergem/pep8-autochecker
pep8runs/migrations/0001_initial.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import jsonfield.fields import bsct.models class Migration(migrations.Migration): dependencies = [ ('projects', '0001_initial'), ] operations = [ migrations.CreateModel( ...
polarise/RP-python
get_random_lines.py
#!/home/paulk/software/bin/python from __future__ import division from sys import argv,exit,stderr import random import argparse import os parser = argparse.ArgumentParser(description="Script to randomly sample data from a file.") parser.add_argument('infile',help="input file") parser.add_argument('-r','--repeat',defa...
mstarikov/rbdsr
pxssh.py
"""This class extends pexpect.spawn to specialize setting up SSH connections. This adds methods for login, logout, and expecting the shell prompt. $Id: pxssh.py 487 2007-08-29 22:33:29Z noah $ """ from pexpect import * import pexpect import time __all__ = ['ExceptionPxssh', 'pxssh'] # Exception classes used by this...
baryon5/mercury
phsauth/migrations/0006_auto_20140521_1225.py
# encoding: utf8 from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('phsauth', '0005_auto_20140521_1224'), ] operations = [ migrations.RenameField( model_name='student', old_na...
perdisci/amico
amico_scripts/manual_download.py
########################################################################### # Copyright (C) 2011 Phani Vadrevu, Roberto Perdisci # # pvadrevu@uga.edu # # perdisci@cs.uga.edu # # ...
taciogt/wikipedia_parser
src/webmodule/wikiapp/migrations/0001_initial.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='Trigram', fields=[ ('id', models.AutoField(verb...
pvreman/cobbler
cobbler/utils.py
""" Misc heavy lifting functions for cobbler Copyright 2006-2009, Red Hat, Inc Michael DeHaan <mdehaan@redhat.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 License, or...
amadeusproject/amadeuslms
amadeus/templatetags/pagination.py
""" Copyright 2016, 2017 UFPE - Universidade Federal de Pernambuco Este arquivo é parte do programa Amadeus Sistema de Gestão de Aprendizagem, ou simplesmente Amadeus LMS O Amadeus LMS é um software livre; você pode redistribui-lo e/ou modifica-lo dentro dos termos da Licença Pública Geral GNU como publicada pela ...
weegreenblobbie/nsound
applications/wavelab/Wavelab.py
#!/usr/bin/env python ############################################################################### # # $Id: Wavelab.py 658 2011-06-11 22:51:18Z weegreenblobbie $ # # Nsound is a C++ library and Python module for audio synthesis featuring # dynamic digital filters. Nsound lets you easily shape waveforms and write...
arunkgupta/gramps
gramps/guiQML/viewmanager.py
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2010 Benny Malengier # # 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)...
videntity/django-djmongo
djmongo/delete/urls.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # vim: ai ts=4 sts=4 et sw=4 from django.contrib.auth.decorators import login_required from ..decorators import httpauth_login_required from ..decorators import (check_read_httpauth_access, check_public_ok, ipauth_read_ver...
ageekymonk/decodewithme
publishconf.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # from __future__ import unicode_literals # This file is only used if you use `make publish` or # explicitly specify it as your config file. import os import sys sys.path.append(os.curdir) from pelicanconf import * SITEURL = 'http://www.decodewith.me' RELATIVE_URLS = Fal...
atvcaptain/enigma2
lib/python/Components/Renderer/RunningText.py
from __future__ import absolute_import ################################################################################ # RunningText.py - Running Text Renderer for Enigma2 # Version: 1.5 (04.04.2012 23:40) # Copyright (C) 2010-2012 vlamo <vlamodev@gmail.com> # # This program is free software; you can redis...
thousandparsec/schemepy
tests/test_schemepy/test_int.py
"""This file test the conversion between Scheme integer and Python integer.""" import common class TestInt(object): def check_eval(self, value): """ Checks that the eval returns int for small integers. """ print "eval", str(value) m1 = common.VM() a = m1.eval(m1.compile(str(value))) assert m1.type(a)...
sam-m888/gprime
gprime/filters/rules/test/media_rules_test.py
# # gPrime - A web-based genealogy program # # Copyright (C) 2016 Tom Samstag # # 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 v...
spiralray/canusb
script/_CAN.py
"""autogenerated by genpy from canusb/CAN.msg. Do not edit.""" import sys python3 = True if sys.hexversion > 0x03000000 else False import genpy import struct import genpy class CAN(genpy.Message): _md5sum = "538459a17b716b5d40481761364b2a7c" _type = "canusb/CAN" _has_header = False #flag to mark the presence of...
aliceinwire/virt-manager
virtManager/console.py
# -*- coding: utf-8 -*- # # Copyright (C) 2006-2008 Red Hat, Inc. # Copyright (C) 2006 Daniel P. Berrange <berrange@redhat.com> # Copyright (C) 2010 Marc-André Lureau <marcandre.lureau@redhat.com> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public Lic...
sigmunau/nav
tests/unittests/netmap/multidigraph_to_undirect_test.py
from __future__ import print_function import unittest from nav.netmap import topology from nav.netmap.topology import build_netmap_layer2_graph from topology_layer2_testcase import TopologyLayer2TestCase from topology_layer3_testcase import TopologyLayer3TestCase class Layer2MultiGraphToUndirectTests(TopologyLayer2...
adamkovics/atmosphere
atmosphere/__init__.py
""" A model of Titan's atmosphere with radiative transfer solvers. Modules: refdata - obtain reference data for gas and aerosols structure - setup vertical structure and layers composition - set chemical abundances in each layer gas_opacity - calculate gas opacity using k-coefficients aerosol - determine aeros...
sssundar/NetworkSimulator
Code/Python/event_simulator.py
''' File: event_simulator.py Description: our discrete event simulator, basically a priority queue Initialization: Takes a dictionary of network element objects (links, nodes, flows) indexed by unique ids Operation: Keeps an internal heap of items like (completion_time, unique_event_number, Event instance) to...
alvin777/excelsior
glonass.py
#!/usr/bin/python import hashlib import array def generate_hash_array(): hasharray = array.array('B', [0]*1000000) # for i in xrange(0,999999): for i in xrange(0, 999999): # print i string = "3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421...
rero/reroils-app
tests/unit/test_locations_jsonschema.py
# -*- coding: utf-8 -*- # # RERO ILS # Copyright (C) 2019 RERO # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, version 3 of the License. # # This program is distributed in the hope that...
zhao-ji/DNS-through-TCP
dns_proxy.py
#! /usr/bin/env python # -*- coding: utf8 -*- import argparse import socket from SocketServer import ForkingUDPServer, DatagramRequestHandler import struct from dnslib import DNSRecord import logbook class ProxyHandler(DatagramRequestHandler): '''DNS Proxy Server''' def handle(self): data, client =...
vstorm/douban-fm-client
test/test_fm.py
# -*- coding: utf-8 -*- import nose from test import client, get_file_path, write_to_file def test_user_info(): file_path = get_file_path("user_info") user_info = client.fm.user_info() write_to_file(file_path, user_info) def test_channels(): file_path = get_file_path("channels") channels = clien...
darius/hmph
emithtml.py
import cgi def emit(obj, attribute=False): if type(obj) == list: return ''.join([emit(element) for element in obj]) if type(obj) == str: return cgi.escape(obj, attribute) if type(obj) == type(emit): return obj() # XXX what if attribute=True? raise 'Bad type', obj def...
pybursa/homeworks
s_shybkoy/hw4/hw4_tests.py
#!/usr/bin/env python # -*- coding: utf-8 -*- u""" Тесты на ДЗ#4. """ __author__ = "Sergei Shybkoi" __copyright__ = "Copyright 2014, The Homework Project" __email__ = "heap_@mail.ru" __status__ = "Production" __date__ = "2014-11-15" import hw4_task1 import hw4_task2 def tests_for_hw4_task1(): u...
malepo/GIMP-plugins
Franzis_HDR.py
#!/usr/bin/env python ''' Dfine2.py call Nik's Collection's Viveza 2 passing the active layer as a temp file. Author: Rob Antonishen Modified by Partha Bagchi Modified by Martin Pohl Version: 0.8 Made it specific to Nik Collection 0.7 fixed file save bug where all files were png regardless of extension 0.6 modified...
ProfessorX/Config
.PyCharm30/system/python_stubs/-1247971765/PyKDE4/kdeui/KXMessages.py
# encoding: utf-8 # module PyKDE4.kdeui # from /usr/lib/python3/dist-packages/PyKDE4/kdeui.cpython-34m-x86_64-linux-gnu.so # by generator 1.135 # no doc # imports import PyKDE4.kdecore as __PyKDE4_kdecore import PyQt4.QtCore as __PyQt4_QtCore import PyQt4.QtGui as __PyQt4_QtGui import PyQt4.QtSvg as __PyQt4_QtSvg cl...
HarmonyEnterpriseSolutions/harmony-platform
src/harmonyserv/urls.py
try: from django.conf.urls import patterns, include, url except ImportError: # django 1.3 support from django.conf.urls.defaults import patterns, include, url from django.conf import settings from django.conf.urls.static import static # Uncomment the next two lines to enable the admin: # from django.contrib import ...
phl0/b33rn4rycounter
B33rn4ryDatabase.py
import B33rn4ryExceptions class B33rn4ryDatabase(): Database = None def __init__(self, dbtype='MYSQL', **kwargs): if dbtype == 'MYSQL': self.Database = MysqlDatabase(**kwargs) elif dbtype == 'CONSOLE': self.Database = ConsoleDatabase() else: raise(NotImplementedError("unknown dat...
Sturnus-cineraceus/funen
funen.py
#!/bin/python from view import funen_routes from bottle import run,default_app import sys from db import dbmod from beaker.middleware import SessionMiddleware import setting def startSv(): btlapp = default_app() bkapp = SessionMiddleware(btlapp,setting.SESSION_SETTING) run(app=bkapp,host='localhost', port...
a-slide/py_NGS_tools
FastqSeq.py
# -*- coding: utf-8 -*- """ @package Sekator @brief Contain a class to model a fastq sequence and an iterator function to read fastq files @copyright [GNU General Public License v2](http://www.gnu.org/licenses/gpl-2.0.html) @author Adrien Leger - 2014 * <adrien.leger@gmail.com> * <adrien.leger@inserm.fr> ...
0x0mar/conpot
conpot/core/databus.py
# Copyright (C) 2014 Johnny Vestergaard <jkv@unixcluster.dk> # # 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 ...
clickbeetle/portage-cb
pym/portage/cache/sqlite.py
# Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 import re import sys from portage.cache import fs_template from portage.cache import cache_errors from portage import os from portage import _unicode_decode from portage.util import writemsg from portage.localiza...
kyleabeauchamp/DBayes
dbayes/analysis/mcmc_densities_monopoles.py
import seaborn as sns import scipy.interpolate import pymc import sklearn.gaussian_process import os import pandas as pd import glob keys = ["q0", "sigma0", "sigma1", "epsilon0", "epsilon1"] filenames = glob.glob("/home/kyleb/dat/monopoles/*.csv") data = [] for filename in filenames: x = pd.read_csv(filename, ski...
lucian1900/Webified
places.py
# Copyright (C) 2008, 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 in...
1905410/Misago
misago/urls.py
from django.conf import settings from django.conf.urls import include, url from misago.core.views import forum_index # Register Misago Apps urlpatterns = [ url(r'^', include('misago.legal.urls')), url(r'^', include('misago.users.urls')), url(r'^', include('misago.categories.urls')), url(r'^', include...
grawity/htop
scripts/MakeHeader.py
#!/usr/bin/env python import os, sys, string, io try: from StringIO import StringIO except ImportError: from io import StringIO ANY=1 COPY=2 SKIP=3 SKIPONE=4 state = ANY static = 0 file = io.open(sys.argv[1], "r", encoding="utf-8") name = sys.argv[1][:-2] out = StringIO() selfheader = '#include "' + name + '...
IASIG2013-PFO/XL-CG-project-2014
test/our_app.py
from PyQt4.QtGui import QApplication from qgis.core import QgsApplication from test.URI_Builder import URI_Builder from test.ourmainwindow import OurMainWindow # create Qt application app = QApplication([]) # set up QGIS environment variables e = QgsApplication.setPrefixPath('/usr', True) e = QgsApplication.initQgis...
gemrb/gemrb
gemrb/GUIScripts/bg2/CharGen7.py
# GemRB - Infinity Engine Emulator # Copyright (C) 2003-2004 The GemRB Project # # 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 ...
wxgeo/geophar
wxgeometrie/sympy/integrals/tests/test_integrals.py
from sympy import ( Abs, acos, acosh, Add, And, asin, asinh, atan, Ci, cos, sinh, cosh, tanh, Derivative, diff, DiracDelta, E, Ei, Eq, exp, erf, erfi, EulerGamma, Expr, factor, Function, I, im, Integral, integrate, Interval, Lambda, LambertW, log, Matrix, Max, meijerg, Min, nan, Ne, O, oo, pi, Piece...
mrpaws/python-rcon-mc
rcon_mc/rcon.py
#!/usr/bin/env python """ rcon.py - RCON protocol interface module Author: mrpaws Project Repo: https://github.com/mrpaws/python-rcon-mc Protocol: https://developer.valvesoftware.com/wiki/Source_RCON_Protocol -- adapted for use with minecraft, but a great starter """ import struct from types import St...
olivopaolo/boing
boing/core/economy.py
# -*- coding: utf-8 -*- # # boing/core/economy.py - # # Author: Paolo Olivo (paolo.olivo@inria.fr) # # Copyright © INRIA # # See the file LICENSE for information on usage and redistribution of # this file, and for a DISCLAIMER OF ALL WARRANTIES. """The module :mod:`boing.core.economy` provides an implementation of the...
JavaCardOS/pyResMan
pyResMan/BaseDialogs/pyResManDESFireDialogBase_FileOperation.py
# -*- coding: utf-8 -*- ########################################################################### ## Python code generated with wxFormBuilder (version Dec 21 2016) ## http://www.wxformbuilder.org/ ## ## PLEASE DO "NOT" EDIT THIS FILE! ########################################################################### impo...
Schrolli91/BOSWatch
plugins/jsonSocket/jsonSocket.py
#!/usr/bin/python # -*- coding: UTF-8 -*- """ jsonSocket-Plugin to dispatch FMS-, ZVEI- and POCSAG-messages via UDP/TCP @author: Jens Herrmann @requires: jsonSocket-Configuration has to be set in the config.ini """ import logging # Global logger import socket # for connection import json # for data-transfer f...
viswimmer1/PythonGenerator
data/python_files/33680233/submit.py
import urllib import urllib2 import hashlib import random import email import email.message import email.encoders import StringIO import sys import json import subprocess from tempfile import NamedTemporaryFile from time import time class NullDevice: def write(self, s): pass def submit(partId): print '==\n==...
dknlght/dkodi
src/script.module.urlresolver/lib/urlresolver/lib/pyaes/__init__.py
# The MIT License (MIT) # # Copyright (c) 2014 Richard Moore # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, mod...
botswana-harvard/edc-testing
setup.py
# -*- coding: utf-8 -*- import os from setuptools import setup from setuptools import find_packages with open(os.path.join(os.path.dirname(__file__), 'README.md')) as readme: README = readme.read() # allow setup.py to be run from any path os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir...
hachreak/invenio-access
tests/test_invenio_access_cli.py
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2015, 2016 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) any...
cider-team-mercury/mercury
parameterized_convection/mercury_parameters.py
import numpy as np # ------------------------------------------------------ # # - Fixed Parameters from Grott et al 2011 for Mercury - # # ------------------------------------------------------ # Radius = 2440.0 # - km gravity = 3.7 # - m s^-2 rho_crust = 2800.0 # - kg m^-3 rho_mantle = 3400.0 # - kg m^-3 rho_c...
donour/racepi
python/racepi/sensor/handler/socketcan.py
#!/usr/bin/env python3 # Copyright 2016-7 Donour Sizemore # # This file is part of RacePi # # RacePi 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. # # RacePi is distributed in the hope that it wil...
jungla/ICOM-fluidity-toolbox
Detectors/offline_advection/plot_RD_Diff_time_test.py
#!~/python import fluidity_tools import matplotlib as mpl mpl.use('ps') import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec import myfun import numpy as np from scipy import optimize import os import scipy.stats as sp import scipy import lagrangian_stats import advect_functions import csv Q_s = 100...
stalepig/deep-mucosal-imaging
dmi_0.3/Channel_Tiff_to_Rgb.py
import os from ij.io import DirectoryChooser from ij import IJ from ij.plugin import ChannelSplitter from ij.process import LUT from ij.process import StackConverter from java.awt import Color from ij.gui import GenericDialog dc = DirectoryChooser("Select folder to operate on...") dirPath = dc.getDirectory() if dirPat...
stoq/stoq-server
stoqserver/lib/eventstream.py
# -*- coding: utf-8 -*- # vi:si:et:sw=4:sts=4:ts=4 # # Copyright (C) 2020 Stoq Tecnologia <https://www.stoq.com.br> # All rights reserved # # This program 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...
n3wb13/OpenNfrGui-5.0-1
lib/python/Plugins/Extensions/MediaPortal/resources/showAsThumb.py
# -*- coding: utf-8 -*- from Plugins.Extensions.MediaPortal.plugin import _ from imports import * from keyboardext import VirtualKeyBoardExt from Components.Sources.StaticText import StaticText from thread import allocate_lock import mp_globals # teilweise von movie2k geliehen if fileExists('/usr/lib/enigma2/python/P...
felixfx/website
script/ReduceImages.py
# -*- coding: utf-8 -*- import os import json import glob from PIL import Image app_conf = json.loads(open(os.path.join(os.path.dirname(os.path.realpath(__file__)) + '/../config.json')).read()) full_dir = app_conf['full_dir'] imgs_list = glob.glob(os.path.join(full_dir, '*.jpg')) for path in imgs_list: img ...
myth/trashcan
it3105/project1/controller.py
# -*- coding: utf8 -*- # # Created by 'myth' on 9/23/15 import time from tkinter import messagebox from algorithms import * from datastructures import Graph from gui.widgets import * from gui.render import CanvasRenderer, GraphRenderer from module1.navigation import * from module2.vc import * from module3.nonogram i...
sorki/mlp
tests/mlp_test.py
#!/usr/bin/env python import os import sys import unittest sys.path.insert(0, os.path.abspath("..")) from mlp import MLP, Layer class LayerTest(unittest.TestCase): def test_new_layer(self): with self.assertRaises(ValueError): Layer(0) def test_next_layer(self): with self.assertRa...
inincs/pyNCS
test/expSetup.py
import pyNCS.pyST as pyST import time,sys,random import pyNCS import numpy as np import pylab from pyNCS.neurosetup import NeuroSetup import warnings # C O N F I G # # # # # # # # # # # # # # # # # # # # # # et=pyNCS.et # set dirnames def set_default_biases(nsetup=None, biases_dir='biases/'): for c in nsetup.chi...
kyleabeauchamp/DBayes
dbayes/analysis/mcmc_densities_simple_dipole.py
import pymbar import seaborn as sns import scipy.interpolate import pymc import sklearn.gaussian_process import os import pandas as pd import glob keys = ["q0", "sigma0"] observables = ["density", "energy", "dielectric"] data = pd.read_hdf("./symmetric-grid.h5", 'data') models = {} for temperature in data.temperatur...
mwidner/WebArchiveTextTools
src/wordfilecounts.py
''' File counts per genre, author, year ''' import os import re import csv import sys import pandas as pd import argparse import subcorpus as sc import wordfreqs as wf def get_settings(): parser = argparse.ArgumentParser() parser.add_argument('-i', dest='inputfile', required=True) parser.add_argument('-o...
geobricks/geobricks_data_scripts
geobricks_data_scripts/demo/ghg/data/publish/publish_3857_maghg.py
# coding=utf-8 import glob import calendar import datetime import json import os from geobricks_data_scripts.utils.filesystem import get_filename from geobricks_common.core.date import get_daterange from geobricks_data_scripts.demo.utils.data_manager_util import get_data_manager # data manager data_manager = get_data...
OpenDrift/opendrift
opendrift/models/leeway.py
# This file is part of OpenDrift. # # OpenDrift 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 # # OpenDrift is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without ev...
Rogentos/legacy-anaconda
storage/__init__.py
# __init__.py # Entry point for anaconda's storage configuration module. # # Copyright (C) 2009 Red Hat, Inc. # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions of # the GNU General Public License v.2, or (at your option) any...
gubatron/blooploader
utils/GenericWorker.py
''' * ***** BEGIN LICENSE BLOCK ***** * Version: GNU GPL 2.0 * * The contents of this file are subject to the * GNU General Public License Version 2.0; you may not use this file except * in compliance with the License. You may obtain a copy of the License at * http://www.gnu.org/licenses/gpl.html * * Software distribut...
ergor/zora-cpu
tools/microasm.py
import sys import string keywords_defs = ["lines", "clocks", "meta", "define", "instructions"] def contains_whitespace(s): return True in [c in s for c in string.whitespace] def splitBlocks(code): for c in code: if (not contains_whitespace(c)): print(c) ## BEGIN PROGRAM ## if len(sys....
patrickstocklin/chattR
lib/python2.7/site-packages/update_checker_test.py
#!/usr/bin/env python import sys import unittest try: from StringIO import StringIO except ImportError: from io import StringIO # NOQA from update_checker import UpdateChecker, update_check class UpdateCheckerTest(unittest.TestCase): def test_bad_package(self): checker = UpdateChecker() s...
praiskup/resalloc
tests/test_cli.py
""" test for resalloc.client """ import pytest from resalloc.client import Connection from tests import mock @mock.patch("resalloc.client.time.sleep") def test_errno_reconnect(p_sleep): """ Test that "request_survives_server_restart" tries to reconnect. """ conn = Connection( "http://localhost:654245...
rom1sqr/miasm
miasm2/arch/x86/regs.py
from miasm2.expression.expression import ExprId from miasm2.core.cpu import reg_info IP = ExprId('IP', 16) EIP = ExprId('EIP', 32) RIP = ExprId('RIP', 64) exception_flags = ExprId('exception_flags', 32) interrupt_num = ExprId('interrupt_num', 8) # GP regs08_str = ["AL", "CL", "DL", "BL", "AH", "CH", "DH", "BH"] + ...
elbeardmorez/quodlibet
quodlibet/tests/test_formats_remote.py
# -*- coding: utf-8 -*- # Copyright 2014 Christoph Reiter # # 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. from senf i...
julenka/programming-puzzles
python-challenge/p11_cave.py
__author__ = 'julenka' import Image im = Image.open("p11_cave.jpg") im_c,im_r = im.size im1 = Image.new("RGB", (im_c/2,im_r/2)) im2 = Image.new("RGB", (im_c/2,im_r/2)) pix,pix1,pix2 = im.load(),im1.load(),im2.load() for r in xrange(im_r): for c in xrange(im_c): p = pix[c,r] i = r * im_r + c ...
erickmoore/purePYTK
hostPerf.py
from purestorage import purestorage import sys import requests #Disable certificate warnings requests.packages.urllib3.disable_warnings() # Set variables arrayName = "" arrayAPI = "" newLine = '\n' tab = '\t' # Prompt to set variables if null if arrayName == "": print(newLine + "Please edit the script to incl...
seecr/meresco-components
meresco/components/xml_generic/__init__.py
## begin license ## # # "Meresco Components" are components to build searchengines, repositories # and archives, based on "Meresco Core". # # Copyright (C) 2007-2009 SURF Foundation. http://www.surf.nl # Copyright (C) 2007 SURFnet. http://www.surfnet.nl # Copyright (C) 2007-2010 Seek You Too (CQ2) http://www.cq2.nl # C...
ryanp424/travelhelperinator
thelperinator/settings.py
""" Django settings for thelperinator project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ....
detu/adjointPerm
release/bin/export.py
#!/usr/bin/env python # $Id: export.py 1944 2009-03-30 13:25:22Z bska $ import os, errno # Fine scale, two-phase incompressible flow support: def finescale(): src = {'.' : ['startup.m', 'info.xml', 'AUTHORS', ...
ic-hep/DIRAC
src/DIRAC/FrameworkSystem/scripts/dirac_stop_component.py
#!/usr/bin/env python """ Stop DIRAC component using runsvctrl utility """ from __future__ import print_function from __future__ import absolute_import from __future__ import division from DIRAC.Core.Utilities.DIRACScript import DIRACScript as Script @Script() def main(): Script.disableCS() # Registering arg...
40223240/2015cdb_g3
gear.py
#@+leo-ver=5-thin #@+node:2015.20150625165524.21: * @file gear.py #@@language python #@@tabwidth -4 #@+<<declarations>> #@+node:2015.20150625165524.22: ** <<declarations>> (application) #@@language python import cherrypy import os import sys # 這個程式要計算正齒輪的齒面寬, 資料庫連結希望使用 pybean 與 SQLite # 導入 pybean 模組與所要使用的 Store 及 SQL...
everestial/g2gtools
g2gtools/gtf_db.py
# -*- coding: utf-8 -*- from collections import OrderedDict import os import sys try: from pysqlite2 import dbapi2 as sqlite3 except: try: import sqlite3 except: print 'sqlite module needs to be installed' sys.exit() import time from . import G2GValueError from .g2g_utils import c...
damoxc/vmail
vmail/tests/testdata.py
# -*- coding: utf-8 -*- from datetime import datetime blacklist = [ 'voldemort@azkaban.com', 'sauron@mordor.net' ] domains = [ ('example.com', 'Package 1', 1, 52428800, 5), ('testing.com', 'Package 2', 2, 104857600, 10) ] forwards = [ (1, 'help@example.com', 'dave@example.com'), (1, 'info@exa...
jmullan/pytravis
setup.py
""" Set up pytravis for your environment pytravis <http://github.com/jmullan/pytravis> """ from setuptools import setup import pytravis.pytravis setup( name="pytravis", version=pytravis.pytravis.__version__, description="Extract stuff from Digital Photo Professional into XMP", license="GPLv3+", au...
dr4ke616/LazyTorrent
twisted/plugins/torrent_plugin.py
from zope.interface import implements from twisted.python import usage from twisted.plugin import IPlugin from twisted.application import internet from twisted.application.service import IServiceMaker from mamba.utils import config from mamba.enterprise import database from mamba.core.session import Session from mamb...
fholiveira/nedpod
src/song.py
from os.path import splitext, basename from mutagen.id3 import ID3 from mutagen.mp4 import MP4 import logging class Music: def __init__(self, filename): self.filename = filename self.title, self.album = self.load_audio_info() def load_audio_info(self): title, album = (splitext...