repo_name
stringlengths
5
104
path
stringlengths
4
248
content
stringlengths
102
99.9k
idrogeno/FusionOE
lib/python/Screens/UserInterfacePositioner.py
from Screens.Screen import Screen from Components.ActionMap import ActionMap from Components.config import config, configfile, getConfigListEntry from Components.ConfigList import ConfigListScreen from Components.SystemInfo import SystemInfo from Components.Sources.StaticText import StaticText from Components.Pixmap im...
siemens/sparring
setup.py
#!env python # Copyright (c) Siemens AG, 2013 # # This file is part of sparring. sparring 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 versi...
bougui505/SOM
ROCSOM.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ author: Guillaume Bouvier email: guillaume.bouvier@ens-cachan.org creation date: 01 10 2013 license: GNU GPL Please feel free to use and modify this, but keep the above information. Thanks! """ import SOM import numpy import re import matplotlib.pyplot import ...
dhaitz/CalibFW
cfg/cmssw/skim_53x_Summer13_untagged.py
import FWCore.ParameterSet.Config as cms def getBaseConfig(globaltag, testfile="", maxevents=0, datatype='data'): """Default config for Z+jet skims with Kappa This is used in a cmssw config file via: import skim_base process = skim_base.getBaseConfig('START53_V12', "testfile.root") """ ...
rcocetta/kano-toolset
kano/colours.py
""" Terminal colouring functions Copyright 2013 Red Hat, Inc. Licensed under the GNU General Public License, version 2 as published by the Free Software Foundation; see COPYING for details. Taken from the LNST project: https://github.com/jpirko/lnst/ """ __author__ = """ rpazdera@redhat.com (Radek Pazdera) """ impo...
TshepangRas/tshilo-dikotla
td_maternal/tests/test_maternal_ultrasound.py
from django.utils import timezone from dateutil.relativedelta import relativedelta from edc_consent.models import ConsentType from edc_registration.models import RegisteredSubject from edc_constants.constants import (FAILED_ELIGIBILITY, OFF_STUDY, SCHEDULED, POS, YES, NO, NEG, NOT_A...
agx/git-buildpackage
tests/14_test_gbp_import_dscs.py
# vim: set fileencoding=utf-8 : # (C) 2012 Guido Günther <agx@sigxcpu.org> # 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 ...
DomNelson/tracts
utils/pklpops_to_bedfiles.py
import sys, os sys.path.append(os.path.realpath('..')) import cPickle import tracts_ped as ped popdir = os.path.expanduser(sys.argv[1]) outdir = os.path.expanduser(sys.argv[2]) popfiles = [os.path.join(popdir, popfile) for popfile in os.listdir(popdir) if os.path.splitext(popfile)[1] == '.pkl'] for popfile in pop...
mornsun/javascratch
src/topcoder.py/LC_456_132_Pattern.py
#!/usr/bin/env python #coding=utf8 ''' Given a sequence of n integers a1, a2, ..., an, a 132 pattern is a subsequence ai, aj, ak such that i < j < k and ai < ak < aj. Design an algorithm that takes a list of n numbers as input and checks whether there is a 132 pattern in the list. Note: n will be less than 15,000. E...
omelkonian/cds
tests/unit/test_access_records.py
# -*- coding: utf-8 -*- # # This file is part of CDS. # Copyright (C) 2015, 2016 CERN. # # CDS 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...
t00n/ZumoPdS
pylogo/repl.py
from logo import Primitive, Evaluator, Env, UnterminatedExpression, ProgramError, ParseError, TrollException, UnknowIdentifier from sys import argv, stdin from zumoturtle import forward, backward, turnLeft, turnRight, getGroundSensor, playMusic, sensorsAbove, BLACK_THRES import traceback import math import os Autocomp...
lcharleux/abapy
doc/example_code/indentation/Boussinesq.py
from abapy.mesh import Mesh, Nodes, RegularQuadMesh from abapy import CFE from numpy import linspace import matplotlib.pyplot as plt """ Bousinesq model =============== """ Bo = CFE.Boussinesq(F = 10.) """ Mesh model """ N1, N2 = 50, 50 l1, l2 = 1., 1. Ncolor = 200 levels = linspace(0., 10., 20) mesh = RegularQuadMe...
adereis/avocado
selftests/functional/test_export_variables.py
import os import sys import tempfile import shutil if sys.version_info[:2] == (2, 6): import unittest2 as unittest else: import unittest from avocado import VERSION from avocado.core import exit_codes from avocado.utils import process from avocado.utils import script basedir = os.path.join(os.path.dirname(os...
geekspark-rh/dimo-input
input.py
import numpy as np import cv2 import time import json stop_key = ord('q') low_m = 90 high_m = 255 colors = { 'red' : { 'color': (0, 0, 255), 'lower': np.array([0, low_m, low_m], dtype=np.uint8), 'upper': np.array([10, high_m, high_m], dtype=np.uint8) }, 'green' : { 'colo...
tivaliy/empire-of-code
XsAndOsReferee.py
__author__ = 'Vitalii K' def xo_referee(result): array = [] # Add rows array.extend(result) # Add columns for j in range(len(result)): m = '' for i in range(len(result)): m += result[i][j] array.append(m) # Add main diagonals array.append(''.join([str(re...
AWegnerGitHub/SE_Zephyr_VoteRequest_bot
create_config_files.py
import json patterns = [ # Common Patterns across SE { 'regex': "^((?:\[)?cv-pl[sz].*?(?:\])?|\[tag:cv-pl[sz](-.*)?])(?: )?((?:\[tag\:*)?[\w :\-\(\)\*]+(?:\])?)?(?: )?(https?://.*\.(?:com|net)/(?:q(?:uestions)?|a(?:nswer)?)/\d+(?:/)?(?:\d+|(?:\w|-)+)?(?:/\d+)?(?:#\d+)?)", 'translation': "Close ...
tomthorogood/StarboundServerPatcher
starbound_sync.py
#!/usr/bin/env python import os import logging import time import datetime import sys import ftplib from ftplib import FTP from configparser import SafeConfigParser from argparse import ArgumentParser class Connection(object): def __init__(self,config,dry_run=False): self.client = FTP( config.get("FTP", "host")...
skeezix/compo4all
util/pushscore.py
#!/usr/bin/python import sys import os os.chdir ( "/home/skeezix/compo4all" ) sys.path.append ( os.getcwd() ) import modulemap import singlescore_handler if len ( sys.argv ) <= 1: print "./foo prid gamename scorenum" print "run from spagserver.py location" sys.exit ( 0 ) req = dict() req [ 'prid' ] = s...
rharron/ArtinGalois
sage/rings/number_field/artin_representation.py
""" Artin representations for number fields AUTHORS: - Robert Harron (2013): initial version TESTS: Standard test of pickleability:: sage: from sage.rings.number_field.galois_group import GaloisGroup_v3 sage: from sage.rings.number_field.artin_representation import ArtinRepresentation sage: K = NumberF...
weyw/eulerproject
wey/p20.py
#!/usr/bin/python # -*- coding: utf-8 -*- ''' https://projecteuler.net/problem=21 = ''' import timeit import math import sys import datetime from euler import * def run(): # n = 10 n = 100 product = math.factorial(n) # print list(str(product)) print (sum(map(int, list(str(product))))) ...
fredRos/pypmc
pypmc/sampler/importance_sampling_test.py
'''Unit tests for the importance sampler functions. ''' from .importance_sampling import * from .. import density from ..density.mixture_test import DummyComponent from ..tools._probability_densities import unnormalized_log_pdf_gauss, normalized_pdf_gauss from ..tools import History from nose.plugins.attrib import at...
trosa/forca
gluon/fileutils.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ This file is part of the web2py Web Framework Copyrighted by Massimo Di Pierro <mdipierro@cs.depaul.edu> License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html) """ import storage import os import re import tarfile import glob import time from http import HTTP from gz...
rlutz/xorn
src/gaf/xmlformat.py
# Copyright (C) 2013-2021 Roland Lutz # # 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 ...
blab/antibody-response-pulse
bcell-array/code/Virus_Bcell_IgM_IgG_Landscape.py
# coding: utf-8 # # Antibody Response Pulse # https://github.com/blab/antibody-response-pulse # # ### B-cells evolution --- cross-reactive antibody response after influenza virus infection or vaccination # ### Adaptive immune response for repeated infection # In[1]: ''' author: Alvason Zhenhua Li date: 04/09/201...
bdcht/amoco
amoco/db.py
# -*- coding: utf-8 -*- # This code is part of Amoco # Copyright (C) 2016 Axel Tillequin (bdcht3@gmail.com) # published under GPLv2 license """ db.py ===== This module implements all amoco's database facilities using the `sqlalchemy`_ package, allowing to store many analysis results and pickled objects. .. _sqlalch...
taylo589/phproc
phmovie.py
''' phmovie.py - a python module for processing frames of phase images and displaying them with a movie ''' # plotting crap #import matplotlib #matplotlib.use('TkAgg') import os import numpy as np import scipy.ndimage as ndi import matplotlib.pyplot as plt import matplotlib.animation as anim from datetime ...
drunkard/lazycat
tests/get_host_info.py
#!/usr/bin/env python3 import logging import sys sys.path = sys.path + ['..'] from etc import dev from dm import get_host logging.basicConfig(format='%(asctime)s %(message)s', level=logging.DEBUG) if len(sys.argv) != 3: print('Get all predefined host info, but no runtime info') sys.exit('usage: %s <vendor> <h...
cnewcome/sos
sos/plugins/firewalld.py
# Copyright (C) 2014 Red Hat, Inc. Jamie Bainbridge <jbainbri@redhat.com> # Copyright (C) 2014 Red Hat, Inc. Bryn M. Reeves <bmr@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; eithe...
samuelfd/harpia
harpia/bpGUI/show.py
# -*- coding: utf-8 -*- # [HARPIA PROJECT] # # # S2i - Intelligent Industrial Systems # DAS - Automation and Systems Department # UFSC - Federal University of Santa Catarina # Copyright: 2006 - 2007 Luis Carlos Dill Junges (lcdjunges@yahoo.com.br), Clovis Peruchi Scotti (scotti@ieee.org), # Guilh...
nextgis-extra/tests
lib_gdal/utilities/test_ogrlineref.py
#!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### # # Project: GDAL/OGR Test Suite # Purpose: ogrlineref testing # Author: Dmitry Baryshnikov. polimax@mail.ru # ###############################################################################...
juanknebel/tesis-jaks
files/restaurants/run.py
import commands cmdGamma01 = './tesis-jaks --option 1 --algorithm RandomBOBO --strategy RANK_BY_INTRA_INTER_PROPORTIONAL --element FILE --bundles 10 --budget 30.0 --gamma 0.9 --directory ./ --write 1' cmdGamma05 = './tesis-jaks --option 1 --algorithm RandomBOBO --strategy RANK_BY_INTRA_INTER_PROPORTIONAL --element FIL...
jhford/mock_mozilla
py/mock_mozilla/scm.py
# vim:expandtab:autoindent:tabstop=4:shiftwidth=4:filetype=python:textwidth=0: # License: GPL2 or later see COPYING # Written by Marko Myllynen # Copyright (C) 2010 Marko Myllynen <myllynen@redhat.com> # python library imports import subprocess import tempfile import shutil import shlex import sys import pwd import os...
fberst/mapgen
lib/xcsoar/mapgen/waypoints/seeyou_reader.py
from xcsoar.mapgen.waypoints.waypoint import Waypoint from xcsoar.mapgen.waypoints.list import WaypointList class __CSVLine: def __init__(self, line): self.__line = line self.__index = 0 def has_next(self): return self.__index < len(self.__line) def next(self): ...
ralbayaty/KaggleRetina
kNNclassifier.py
import os from sklearn import neighbors from sklearn.decomposition import PCA, IncrementalPCA, KernelPCA import make_dataset if __name__ == '__main__': test_file_names = os.listdir('/media/dick/Storage/test') N_test = len(test_file_names) print(str(N_test) + ' test files.') train_file_names = os.li...
davidfstr/ClassicBox
classicbox/time.py
""" Converts between MacOS time values and native time values. A Mac timestamp is the number of seconds since Jan 1, 1904. """ from __future__ import absolute_import import time _UNIX_EPOCH_TIMESTAMP = int(time.mktime(time.strptime('1970', '%Y'))) _MAC_EPOCH_TIMESTAMP = int(time.mktime(time.strptime('1904', '%Y'))...
thousandparsec/schemepy
schemepy/skime/skime/__init__.py
from .compiler.parser import parse from .compiler.compiler import Compiler from .vm import VM as SkimeVM from .types.symbol import Symbol from .types.pair import Pair from .prim import Primitive, PyCallable, prim_list_p, iter_list from .proc import Procedure import errors from schemepy.exceptions import * from schemep...
akulakov/sicp
code/association_list.py
#!/usr/bin/env python3 class Alist: "Association list." def __init__(self): self.last = self.first = [] def add(self, key, val): node = [key, val, None] if self.last: self.last[2] = node self.last = node else: self.first = self.last = nod...
SylvainCecchetto/plugin.video.catchuptvandmore
plugin.video.catchuptvandmore/resources/lib/channels/fr/lachainenormande.py
# -*- coding: utf-8 -*- """ Catch-up TV & More Copyright (C) 2019 SylvainCecchetto This file is part of Catch-up TV & More. Catch-up TV & More 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 Foundat...
radiocosmology/caput
caput/config.py
""" Configure class attributes using values from a dictionary. This module to defines strictly typed attributes of a class, that can be loaded from an input dictionary. This is particularly useful for loading a class from a YAML document. Examples ======== In this example we set up a class to store information about...
Meriipu/quodlibet
quodlibet/player/xinebe/player.py
# Copyright 2006-2007 Lukas Lalinsky # # 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 gi.repository import GLib ...
nigelb/UtilityCalc
utilitycalc/config.py
#!/usr/bin/env python # # UtilityCalc is a tool to assist in calculating shares when splitting bills # Copyright (C) 2013 NigelB # # 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 ...
jyundt/oval
app/marshal/forms.py
from flask_wtf import FlaskForm from wtforms import StringField, SubmitField from wtforms import ValidationError from wtforms.validators import Required from ..models import Marshal class MarshalForm(FlaskForm): name = StringField('Name', validators=[Required()]) class MarshalEditForm(MarshalForm): submit = S...
diegogran94/Jukebox-telegram-bot
funciones_sqlite.py
# -*- coding: utf-8 -*- import sqlite3 import sys #FUNCIONES PARA MANEJAR LA TABLA CANCIONES def existe_cancion(url): con = sqlite3.connect('data.db') with con: c = con.cursor() c.execute("select 1 from canciones where Name=? limit 1",(url,)) return c.fetchone() is not None def el...
efocht/aggmon
src/qe/queryengine/queryengine.py
# # Dummy class from the original queryengine built into LxDaemon. # The functionality in the hierarchy_adapter client is a subset of this. # # class QueryEngine: """ Class that provides methods to access an object tree like those used in the hierarchy views. The access methods are named slightly similar to...
CallanIwan/Aranha
commandcenter/vision/camera.py
""" vision/camera.py Camera object which you can open and close. """ import SimpleCV import numpy as np #wrapper class for SimpleCV.Camera/cv2.VideoCapture class Camera: isStreaming = False camera = None def __init__(self, ip=None): if ip == None: self.camera = SimpleCV.Camera(0) ...
SamiHiltunen/invenio-workflows
invenio_workflows/manage.py
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2015 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 later...
hbldh/dlxsudoku
dlxsudoku/dancing_links.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ :mod:`dancing_links` ================== .. module:: dancing_links :platform: Unix, Windows :synopsis: An implementation of Donald Knuth's Dancing Links in Python. Created on 2015-10-19, 22:53 """ from __future__ import division from __future__ import print_f...
topic2k/EventGhost
eg/Classes/RawReceiverPlugin.py
# -*- coding: utf-8 -*- # # This file is part of EventGhost. # Copyright © 2005-2019 EventGhost Project <http://www.eventghost.org/> # # EventGhost 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 versio...
SunPowered/python-workshop-2015
code/session2/times_and_dates.py
# -*- coding: utf-8 -*- """ times_and_dates.py - Advanced Topics 5 - Time and Dates in Python """ import time import datetime """ At its core, all times in Python are determined by the number of seconds since what is called the UNIX epoch, which started arbitrarily at Jan 1, 1970. We gotta start somewh...
agil3b3ast/CNITCorrelator
rules/BruteForcePlugin.py
# Copyright (C) 2006 G Ramon Gomez <gene at gomezbrothers dot com> # Copyright (C) 2009-2016 CS-SI <support.prelude@c-s.fr> # # This file is part of the Prelude-Correlator program. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as publishe...
qgiscloud/qgis-cloud-plugin
qgiscloud/plugin_upload.py
#!/usr/bin/env python # This script uploads a plugin package on the server # # Author: A. Pasotti, V. Picavet import xmlrpc.client import sys import os import getpass from optparse import OptionParser # Configuration PROTOCOL='http' SERVER='plugins.qgis.org' PORT='80' ENDPOINT='/plugins/RPC2/' VERBOSE=False def main...
czcorpus/kontext
lib/plugins/abstract/chart_export.py
# Copyright (c) 2017 Charles University in Prague, Faculty of Arts, # Institute of the Czech National Corpus # Copyright (c) 2017 Tomas Machalek <tomas.machalek@gmail.com> # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License #...
h4xxel/the_wave
the_wave.py
#!/usr/bin/env python # -*- coding: UTF-8 -*- #~ The Wave - Small game where the goal is to survive a catastrophy and help others along the way #~ Copyright (C) 2011 h4xxel, niz3, Cygnus4 #~ This program is free software; you can redistribute it and/or #~ modify it under the terms of the GNU General Public License #...
3dfxsoftware/cbss-addons
bahmni_atom_feed/res_partner.py
from openerp.osv import fields,osv class res_partner(osv.osv): _name = 'res.partner' _inherit = 'res.partner' _columns = { 'local_name': fields.char('Local Name', size=128, required=False), 'attributes': fields.one2many('res.partner.attributes', 'partner_id', 'Attributes'), 'addres...
xificurk/pyggs
plugins/milestones.py
# -*- coding: utf-8 -*- """ plugins/milestones.py - Table of accomplished milestones. Copyright (C) 2009 Petr Morávek This file is part of Pyggs. Pyggs 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...
tLDP/lampadas
pylib/datamanager/format.py
from Globals import YES, NO from base import DataManager class Format(DataManager): def __init__(self): DataManager.__init__(self, 'format', {'format_code': {'key_field': YES, 'data_type': 'string', 'nullable': NO, 'i18n': NO, 'foreign_key': '', 'attribute': 'code'}, '...
crustymonkey/py-bgg
libbgg/apiv2.py
from libbgg.apibase import BGGBase from libbgg.errors import InvalidInputError, APICallError from datetime import date class BGG(BGGBase): """ For version 2 of the api, you simply instantiate the object and call the appropriate method. "things" and "family items" are handled dynamically and are not co...
stuart-knock/tvb-library
tvb/datatypes/spectral.py
# -*- coding: utf-8 -*- # # # TheVirtualBrain-Scientific Package. This package holds all simulators, and # analysers necessary to run brain-simulations. You can use it stand alone or # in conjunction with TheVirtualBrain-Framework Package. See content of the # documentation-folder for more details. See also http://ww...
stewartadam/fwbackups
src/fwbackups/engines/rsync.py
# -*- coding: utf-8 -*- # Copyright (C) 2009 Stewart Adam # This file is part of fwbackups. # fwbackups 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 opt...
garibaldu/radioblobs
code/code_2d/score_DirMult_2d.py
import numpy as np import numpy.random as rng import pylab as pl import matplotlib as mpl import matplotlib.pyplot as plt import matplotlib.mlab as mp from matplotlib.patches import Ellipse import copy, sys import math import optparse import scipy.signal import scipy.special.basic as sp import scipy.optimize as sop im...
libo/Enigma2
lib/python/Plugins/Extensions/PicturePlayer/plugin.py
from enigma import ePicLoad, eTimer, getDesktop from Screens.Screen import Screen from Tools.Directories import resolveFilename, pathExists, fileExists, SCOPE_MEDIA from Plugins.Plugin import PluginDescriptor from Components.Pixmap import Pixmap, MovingPixmap from Components.ActionMap import ActionMap, NumberActionMa...
platinhom/ManualHom
Visualization/Chimera/1.10/helpdir/ProgrammersGuide/Examples/ToolbarButtonExtension/ChimeraExtension.py
# "ChimeraExtension.py" derives a class from 'chimera.extension.EMO' # to define how functionality defined in "__init__.py" may be invoked # by the Chimera extension manager. # # .. "ChimeraExtension.py" ToolbarButtonExtension/ChimeraExtension.py # .. "__init__.py" ToolbarButtonExtension/__init__.py imp...
FePhyFoFum/PyPHLAWD
src/find_good_clusters_for_concat_wc.py
import sys import os import shlex import subprocess import check_for_programs from conf import DI from conf import relcut from conf import abscut from conf import abscutint from conf import usecython from conf import smallest_cluster from conf import cluster_prop from conf import py import emoticons from clint.textui i...
dywisor/kernelconfig
kernelconfig/kernel/hwdetection/modalias/__main__.py
# This file is part of kernelconfig. # -*- coding: utf-8 -*- from . import lookup __all__ = [] if __name__ == "__main__": # $ python -m kernelconfig.kernel.hwdetection.modalias <modalias> ... # # or # # $ find /sys -name modalias | \ # xargs python -m kernelconfig.kernel.hwdetection.mod...
alorchhota/bioinformatics-algorithms-1
week2/code/SeqUtil.py
import csv from collections import Counter from heapq import nlargest import operator def dna2rna(dna): Dna2RnaMap = {'A':'A', 'T':'U', 'G':'G','C':'C'} rna = "".join([Dna2RnaMap[nucleotide] for nucleotide in dna]) return rna def reverseComplement(dna): complementMap = {'A':'T', 'T':'A', 'G':'C','C':...
project-rig/rig
tests/place_and_route/route/test_generic_route.py
"""Generic correctness tests applicable to all routing algorithms.""" import pytest from collections import deque from rig.place_and_route.machine import Machine, Cores from rig.links import Links from rig.netlist import Net from rig.place_and_route.routing_tree import RoutingTree from rig.place_and_route.constr...
nsapy/nsapy
test/test04.py
# -*- coding:utf-8 -*- ''' **Python Module for Nonlinear Structural Analysis ''' from nsapy import Domain,Analysis,NodeResult from nsapy.Material import Material1D from nsapy import Section,Element import numpy as np from pylab import * from numba import autojit def main(): truss = Domain(2,2,'test04') trus...
hexdump42/boris-tool
boris/boristool/common/directives/disk.py
__doc__ = """Disk directives""" from boristool.common import directive, log, utils class DISK(directive.Directive): """DISK provides access to data & stats for disk devices. It requires the 'DiskStatistics' class from the 'diskdevice' data-collection module. Example: # /dev/disk0 DISK ...
rpaleari/qtrace
tools/runtime/winsyscall.py
""" Copyright 2014, Roberto Paleari (@rpaleari) """ import ctypes import os WINSYSCALL_FUNC = None LIBRARY_PATH = "c:\\temp\\winsyscall.dll" def execute_syscall(num, *params): global WINSYSCALL_FUNC, LIBRARY_PATH if WINSYSCALL_FUNC is None: assert os.path.isfile(LIBRARY_PATH) WINSYSCALL_FUNC...
NERC-CEH/ecomaps
ecomaps/tests/test_date_util.py
import unittest from ecomaps.lib.date_util import comptime class TestDateUtil(unittest.TestCase): """ Tests for the comptime formatting methods """ # Tests for comptime.__format__ def test_001_comptime___format___year_range(self): t = comptime(2011, 6, 17, 13, 14, 15) f = '{0:Y:-10...
ajweb/tweet-bed
settings.py
""" Django settings for tweetbed 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/ """ import tweepy from django.conf.global_settings import TEMPLATE_CONTEXT_PRO...
ghtmtt/QGIS
tests/src/python/test_provider_python.py
# -*- coding: utf-8 -*- """QGIS Unit tests for the python dataprovider. From build dir, run: ctest -R PyQgsPythonProvider -V .. note:: 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 ...
fablabnbg/inkscape-silhouette
silhouette/Graphtec.py
# (c) 2013,2014 jw@suse.de # (c) 2016 juewei@fabmail.org # (c) 2016 Alexander Wenger # (c) 2017 Johann Gail # # Distribute under GPLv2 or ask. # # Driver for a Graphtec Silhouette Cameo plotter. # modeled after https://github.com/nosliwneb/robocut.git # https://github.com/pmonta/gerber2graphtec/blob/master/file2graphte...
odahoda/noisicaa
noisicaa/ui/svg_symbol_filetest.py
#!/usr/bin/python3 # @begin:license # # Copyright (c) 2015-2019, Benjamin Niemann <pink@odahoda.de> # # 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 y...
ulif/ulif.openoffice
src/ulif/openoffice/processor.py
# # processor.py # # Copyright (C) 2011, 2013, 2015 Uli Fouquet # 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...
jcoenencom/raspVMC
setspeed.py
#!/usr/bin/python import socket import sys import time import binascii import string import re import math import time import json import os import ConfigParser from VMC import VMC config = ConfigParser.RawConfigParser() config.read('/etc/VMC/VMC.ini') # Create a TCP/IP socket sock = socket.socket(socket.AF_INET,...
cheza/ActivityDynamics
data_preparation/s03_generate_weighted_network.py
from __future__ import division import math from util import * from collections import defaultdict # ----------------------------------------------------------------------------------------------- class MyNet: def __init__(self, filename=None, create=False): self.filename = filename if self.filena...
facebookexperimental/eden
eden/hg-server/edenscm/mercurial/verify.py
# Portions Copyright (c) Facebook, Inc. and its affiliates. # # This software may be used and distributed according to the terms of the # GNU General Public License version 2. # verify.py - repository integrity checking for Mercurial # # Copyright 2006, 2007 Matt Mackall <mpm@selenic.com> # # This software may be used...
Vagab0nd/SiCKRAGE
lib3/github/PullRequest.py
# -*- coding: utf-8 -*- ############################ Copyrights and license ############################ # # # Copyright 2012 Michael Stead <michael.stead@gmail.com> # # Copyright 2012 Vincent Jacques <vincent@vincent-ja...
jhjguxin/PyCDC
Karrigell-2.3.5/k_encodings/k_encoding_charsets.py
#!/bin/env python # -*- coding: ascii -*- # file: k_encoding_charsets - automatically generated!!! encoding2python_map = { '037': 'cp037', '1026': 'cp1026', '1140': 'cp1140', '1250': 'cp1250', '1251': 'cp1251', '1252': 'cp1252', '1253': 'cp1253', '1254': 'cp1254', '1255': 'cp1255', ...
maateen/TextSuggestBangla
fonts.py
# coding: utf-8 # Copyright © 2016 Bharadwaj Raju <bharadwaj.raju@keemail.me> # Contributor: Maksudur Rahman Maateen <ugcoderbd@gmail.com> # This file is part of TextSuggest. # TextSuggest is free software. # Licensed under the GNU General Public License 3 # See included LICENSE file or visit https://www.gnu.org/lic...
ctools/ctools
modules/comscripts/compulbin.py
#! /usr/bin/env python # ========================================================================== # Generate pulsar phase bins # # Copyright (C) 2022 Juergen Knoedlseder # # 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 # th...
pcuzner/ceph-iscsi-config
ceph_iscsi_config/lio.py
#!/usr/bin/env python from rtslib_fb import root from rtslib_fb.utils import RTSLibError __author__ = 'Paul Cuzner, Michael Christie' class LIO(object): def __init__(self): self.lio_root = root.RTSRoot() self.error = False self.error_msg = '' self.changed = False def ceph_s...
lavalamp-/ws-backend-community
tests/rest_tests/serializers_tests/base.py
# -*- coding: utf-8 -*- from __future__ import absolute_import from ..base import WsDjangoTestCase class BaseWebSightSerializerTestCase(WsDjangoTestCase): """ This is a base test case class for all test cases that test a serializer class. """ def get_populated_serializer(self, access_is_valid=True, ...
zctyhj/hj
shell/json2del.py
#/usr/bin/python # -*- coding: utf-8 -*- import json import sys ''' 获取文件并将文件的内容读取出来,按照csv的格式输出 一次性读取一天的数据,每天12点半开始读取,生成 eg: {'resultcode': '200', 'reason': 'SUCCESSED!', 'result': [{'1': {'variety': '美元账户黄金', 'midpri': '1328.44', 'buypri': '1327.54', 'sellpri': '1329.34', 'maxpri': '1328.44', 'minpri': '1326.00', 'toda...
magnumripper/net-creds
net-creds.py
#!/usr/bin/env python2 from os import geteuid, devnull import logging # shut up scapy logging.getLogger("scapy.runtime").setLevel(logging.ERROR) from scapy.all import * conf.verb=0 from sys import exit import binascii import struct import argparse import signal import base64 from urllib import unquote from subprocess ...
carlos-gs/MiStuRe
misture_core/MISTURE/analyx/FuentesAnaly.py
#! /usr/bin/python3 # encoding: utf-8 import subprocess import sys import entities.mongops #entities.mongops.borrarindicesevitardups() #entities.mongops.borrardb() import pymodm # from pymongo import MongoClient # MongoClient().drop_database('misture_mbbd') #pymodm.connect('mongodb://localhost:27017/misture_mbbd') f...
neksysinfo/fspanel
fsSocket.py
#!/usr/bin/python3 # -*- coding: utf-8 -*- import time import json, string, math, socket, select from struct import * from PyQt5.QtCore import QThread, QObject, pyqtSignal, pyqtSlot from fsEncoder import * XPVER = "1.0" UDP_PORT = 49003 UDP_SENDTO_PORT = 49000 UDP_SENDTO_IP = "192.168.1.10" ''' class fsWorker(QObje...
JoaquimPatriarca/senpy-for-gis
gasp/postgis/proj.py
""" Tools for process geographic data on PostGIS """ import os import psycopg2 from gasp.pgsql import connection from gasp.pgsql.fields import get_columns_name def re_project(lnk, in_tbl, fld_geom, outEpsg, out_tbl, newgeom_fld=None, new_pk=None, colsSelect=None, whr=None): ...
kernevil/samba
buildtools/wafsamba/stale_files.py
# encoding: utf-8 # Thomas Nagy, 2006-2010 (ita) """ Add a pre-build hook to remove all build files which do not have a corresponding target This can be used for example to remove the targets that have changed name without performing a full 'waf clean' Of course, it will only work if there are no dynamically generat...
gagnonlg/IFT6266-project
tests/test_lstm_chars.py
import network import numpy as np import theano.tensor as T import theano import logging import h5py as h5 import cPickle import gzip #theano.config.optimizer='None' logging.basicConfig(level='INFO') np.random.seed(893) # generate data print '-> loading data' dset = h5.File('chars_dataset.h5', 'r') trainX = dset['...
GeoCSBI/UTH_DB
mysite/uth_db/migrations/0008_auto_20161231_1618.py
# -*- coding: utf-8 -*- # Generated by Django 1.10.4 on 2016-12-31 16:18 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('uth_db', '0007_auto_20161231_1609'), ] operations ...
alexandrevicenzi/LightproofExtensions
lightproof_checker_old/extensions.py
# -*- encoding: UTF-8 -*- # 2013 Alexandre Vicenzi (vicenzi.alexandre at gmail com) import os import sys import zipfile def unpack_oxt(file_name, dir_output, root_folder=True): if not zipfile.is_zipfile(file_name): return False with zipfile.ZipFile(file_name, "r") as z: if not os.path.exists(dir_output): ...
justinj/pixie
pixie/vm/numbers.py
import pixie.vm.object as object from pixie.vm.object import affirm from pixie.vm.primitives import true, false from rpython.rlib.rarithmetic import r_uint from rpython.rlib.rbigint import rbigint import rpython.rlib.jit as jit from pixie.vm.code import DoublePolymorphicFn, extend, Protocol, as_var, wrap_fn from pixie....
eljost/pysisyphus
pysisyphus/calculators/Dalton.py
try: import daltonproject as dp except ModuleNotFoundError: print("daltonproject is not installed!") from pysisyphus.calculators.Calculator import Calculator from pysisyphus.constants import BOHR2ANG class Dalton(Calculator): conf_key = "dalton" def __init__(self, basis, method="hf", **kwargs): ...
tvalacarta/tvalacarta
python/main-classic/channels/oncetvmex.py
# -*- coding: utf-8 -*- # ------------------------------------------------------------ # tvalacarta 4 # Copyright 2015 tvalacarta@gmail.com # http://blog.tvalacarta.info/plugin-xbmc/tvalacarta/ # # Distributed under the terms of GNU General Public License v3 (GPLv3) # http://www.gnu.org/licenses/gpl-3.0.html #...
southampton/linuxdesktopdocs
docs/conf.py
# -*- coding: utf-8 -*- # # Linux Desktops documentation build configuration file, created by # sphinx-quickstart on Tue Feb 21 18:34:13 2017. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file...
shw700/latrace-plus
frontend/la2html.py
#!/usr/bin/python import sys import re color_map = [ "silver", "aquamarine", "tan", "skyblue", "plum", "yellowgreen", "moccasin" ] def get_color_level(n): return color_map[n % len(color_map)] def enstyle_parameters(s): result = "" if s == "" or s == "void": return "<b>void</b>" nexti = s.find("=") while...
grwl/sslcaudit
test/old/ssl-server-v2.py
import M2Crypto from M2Crypto import m2 import socket CERTFILE='test/certs/www.example.com-cert.pem' KEYFILE='test/certs/www.example.com-key.pem' def main(): print 'initializing ctx ...' ctx = M2Crypto.SSL.Context(protocol='sslv2') ctx.load_cert_chain(certchainfile=CERTFILE, keyfile=KEYFILE) ctx.set_o...
psychopy/versions
psychopy/iohub/devices/mouse/darwin.py
# -*- coding: utf-8 -*- # Part of the psychopy.iohub library. # Copyright (C) 2012-2016 iSolver Software Solutions # Distributed under the terms of the GNU General Public License (GPL). from __future__ import division, print_function, absolute_import from copy import copy import Quartz as Qz from AppKit import NSEvent...