repo_name
stringlengths
5
104
path
stringlengths
4
248
content
stringlengths
102
99.9k
iceman1989/Check_mk
modules/inventory.py
#!/usr/bin/python # -*- encoding: utf-8; py-indent-offset: 4 -*- # +------------------------------------------------------------------+ # | ____ _ _ __ __ _ __ | # | / ___| |__ ___ ___| | __ | \/ | |/ / | # | | | | '_ \ / _ \/ __| |/ /...
Eibriel/Calabaza
server/calabaza/__init__.py
from flask import Flask from flask.ext.pymongo import PyMongo from flask.ext.restful import Api from calabaza.calabaza_auth import CalabazaAuth from calabaza.modules.calabaza_game import calabaza_game from calabaza.modules.mongoKit import * app = Flask(__name__) api = Api(app) mongo = PyMongo(app) game = calabaza_ga...
stanleyz/pfsense-2.x-tools
pfsense_logger.py
import logging import logging.handlers import platform class PfSenseLogger( object ): level = logging.INFO @staticmethod def setupLogger ( logger_type = None, logger_name = "", level = logging.INFO ): logger = PfSenseLogger() logger['level'] = level if logger_type is not None and l...
sigmunau/nav
python/nav/web/radius/radiuslib.py
# -*- coding: utf-8 -*- # # Copyright (C) 2008-2010, 2012 University of Tromsø # # This file is part of Network Administration Visualized (NAV) # # NAV 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 ve...
Trigition/Mimir
Networks.py
#!/usr/bin/env python """ Author: William Fong Version: Alpha 0.05 Networks.py holds classes for managing networks on a layer basis. """ #Import PyBrain's Neural Network Structures from pybrain import structure from pybrain.tools.shortcuts import buildNetwork from pybrain.tools.xml.networkwriter import NetworkWriter fr...
jgyates/genmon
static/closure-compiler.py
#!/usr/bin/python import os, os.path, shutil import urllib, zipfile, re, requests from time import sleep def compress(compiler, in_files, out_file, in_type='js'): if in_type == 'js': print ('java -jar %s --js "%s" --js_output_file "%s"' % (compiler, '" --js "'.join(in_files), out_file)) os.system...
Onirik79/aaritmud
src/commands/command_rcreate.py
# -*- coding: utf-8 -*- """ Comando che permette di creare un'istanza di una stanza. """ #= IMPORT ====================================================================== from src.config import config from src.log import log if config.reload_commands: reload(__import__("src.commands.command_create", globals(...
woodem/woo
py/qt/Inspector.py
# encoding: utf-8 import woo.config if 'qt4' in woo.config.features: from PyQt4.QtCore import * from PyQt4.QtGui import * else: from PyQt5.QtCore import * from PyQt5.QtGui import * from PyQt5.QtWidgets import * from woo.qt.ObjectEditor import * import woo import woo.qt from woo.dem import * #from ...
gvilardo/parser
parser_v2.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ parser.py - Copyright (C) 2015 - Giorgio Vilardo parser.py 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 ...
prrvchr/USBTerminal
USB/Gui/UsbPoolPanel.py
# -*- coding: utf-8 -*- #*************************************************************************** #* * #* Copyright (c) 2015 Pierre Vacher <prrvchr@gmail.com> * #* ...
sibosop/ardproj
sketches/ESPTest/EspClientTest.py
#!/usr/bin/env python import socket import sys TCP_IP = sys.argv[1] TCP_PORT = int(sys.argv[2]) print "addr:",TCP_IP,"port:",TCP_PORT BUFFER_SIZE = 1024 MESSAGE = "Hello, World!" s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect((TCP_IP, TCP_PORT)) s.send(MESSAGE) data = s.recv(BUFFER_SIZE) s.close() ...
heclive/scripts
linphone/linphone-web-plugin/Common/regex.py
import re, sys def str2bool(v): return v.lower() in ("yes", "true", "t", "on", "1") def replace(src, dest, variable = '', value = ''): infile = open(src, "r") intext = infile.read() infile.close() if variable == '': match = r"\${IF .*?}(.*?)\${ENDIF}" else: match = r"\${IF " + variable + r"}(.*?)\...
pkathail/magic
python/magic/utils.py
import numbers import numpy as np import pandas as pd import scprep from scipy import sparse try: import anndata except (ImportError, SyntaxError): # anndata not installed pass def check_positive(**params): """Check that parameters are positive as expected Raises ------ ValueError : unac...
GjjvdBurg/DoelenCalendar
dedoelen/utils/progress.py
from progressbar import ProgressBar, Percentage, Bar, Timer class AdaptiveETA(Timer): """ """ TIME_SENSITIVE = True NUM_SAMPLES = 20 def _update_samples(self, currval, elapsed): sample = (currval, elapsed) if not hasattr(self, 'samples'): self.samples = [sample] * (sel...
nocarryr/rtlsdr-wwb-scanner
wwb_scanner/utils/dbmath.py
import numpy as np REF_DB = 1.#1e-4 def amplitude_to_dB(a, ref=REF_DB): return 20 * np.log10(a / ref) def dB_to_amplitude(dB, ref=REF_DB): return 10 ** (dB/20.) * ref def power_to_dB(p, ref=REF_DB): return 10 * np.log10(p / ref) def dB_to_power(dB, ref=REF_DB): return 10 ** (dB/10.) * ref def to_d...
EUDAT-B2SHARE/invenio-old
modules/bibrank/lib/bibrank_tag_based_indexer_unit_tests.py
# -*- coding: utf-8 -*- ## This file is part of Invenio. ## Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010, 2011, 2013 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 ...
LordSputnik/mutagen
mutagen/oggvorbis.py
# -*- coding: utf-8 -*- # Copyright 2006 Joe Wreschnig # # This program 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 Software Foundation. """Read and write Ogg Vorbis comments. This module handles Vorbis files wrap...
iksaif/euscan
pym/euscan/handlers/google_code.py
import re import portage from euscan import output from euscan.helpers import regex_from_template from euscan.handlers.url import process_scan as url_scan HANDLER_NAME = "google-code" CONFIDENCE = 90 PRIORITY = 90 package_name_regex = r"http://(.+).googlecode.com/files/.+" def can_handle(pkg, url=None): if no...
jkonecny12/pykickstart
tests/baseclass.py
import os import sys import unittest import shlex import glob import warnings import re import six try: from imputil import imp except ImportError: # Python 3 import imp from pykickstart.errors import KickstartParseError from pykickstart.parser import KickstartParser from pykickstart.version import DEVEL, mak...
AusTac/parma
b3/parsers/smg11.py
# Smoking' Guns 1.1 parser for BigBrotherBot(B3) (www.bigbrotherbot.net) # Copyright (C) 2010 Courgette # # 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 # (...
HomeRad/TorCleaner
config/bl2wc.py
#!/usr/bin/python2.4 # -*- coding: iso-8859-1 -*- # this script has to be executed in the config parent dir """ Generate blacklist_XYZ folders with blocking and rewriting filters for the given blacklist files. The XYZ folder name is the blacklist folder. Required are the "tarfile" module and Python 2.2 """ import dat...
wasade/qiime
scripts/compare_taxa_summaries.py
#!/usr/bin/env python from __future__ import division __author__ = "Jai Ram Rideout" __copyright__ = "Copyright 2012, The QIIME project" __credits__ = ["Jai Ram Rideout", "Greg Caporaso"] __license__ = "GPL" __version__ = "1.8.0-dev" __maintainer__ = "Jai Ram Rideout" __email__ = "jai.rideout@gmail.com" from os.path ...
HoverHell/mcomix-0
mcomix/edit_image_area.py
"""edit_image_area.py - The area of the editing archive window that displays images.""" import os import gtk from mcomix import i18n from mcomix import image_tools from mcomix import thumbnail_tools from mcomix import thumbnail_view from mcomix.preferences import prefs class _ImageArea(gtk.ScrolledWindow): """T...
okolisny/integration_tests
cfme/tests/infrastructure/test_rest_templates.py
# -*- coding: utf-8 -*- import pytest from cfme import test_requirements from cfme.rest.gen_data import a_provider as _a_provider from cfme.rest.gen_data import mark_vm_as_template from cfme.rest.gen_data import vm as _vm from cfme.utils import error from cfme.utils.version import current_version pytestmark = [test_r...
dpinney/omf
omf/solvers/REopt/__init__.py
import json import requests from omf.solvers.REopt import logger from omf.solvers.REopt import results_poller def run(inJSONPath, outputPath): API_KEY = 'WhEzm6QQQrks1hcsdN0Vrd56ZJmUyXJxTJFg6pn9' # REPLACE WITH YOUR API KEY # API_KEY = 'Y8GMAFsqcPtxhjIa1qfNj5ILxN5DH5cjV3i6BeNE' root_url = 'https://developer.nrel.g...
PascalSteger/gravimage
programs/gi_file.py
#!/usr/bin/env ipython3 ## # @file # all file related functions # (c) GPL v3 2015 Pascal Steger, pascal@steger.aero import pdb import numpy as np import gi_helper as gh import gi_units as gu def get_pos_and_COM(gp): if gp.investigate == 'hern': import grh_com grh_com.run(gp) elif gp.investi...
ehabkost/virt-test
virttest/cartesian_config.py
#!/usr/bin/python """ Cartesian configuration format file parser. Filter syntax: , means OR .. means AND . means IMMEDIATELY-FOLLOWED-BY Example: qcow2..Fedora.14, RHEL.6..raw..boot, smp2..qcow2..migrate..ide means match all dicts whose names have: (qcow2 AND (Fedora IMMEDIATELY-FOLLOWED-BY 14)) OR ((RHEL IM...
Semanticle/Semanticle
sm-mt-devel/src/metabulate/tests/test23tr-30c_demo02.py
''' Copyright 2009, 2010 Anthony John Machin. All rights reserved. Supplied subject to The GNU General Public License v3.0 Created on 04 Feb 2010 Last Updated on 13 Jul 2010 Serves as demo02 Related: test18 - initial Rendering transformations and sequences tests test23tr01/02 - as with test1...
gipit/gips
gips/algorithm.py
#!/usr/bin/env python ################################################################################ # GIPS: Geospatial Image Processing System # # AUTHOR: Matthew Hanson # EMAIL: matt.a.hanson@gmail.com # # Copyright (C) 2014 Applied Geosolutions # # This program is free software; you can redistribut...
beagles/sosreport-neutron
sos/plugins/ppp.py
## Copyright (C) 2007 Sadique Puthen <sputhenp@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 ## (at your option) any later version. ## Thi...
KanoComputing/kano-toolset
kano/gtk3/labelled_entries.py
# # labelled_entries.py # # Copyright (C) 2014-2019 Kano Computing Ltd. # License: http://www.gnu.org/licenses/gpl-2.0.txt GNU GPLv2 # # Template for creating a list of labelled entries # from gi import require_version require_version('Gtk', '3.0') from gi.repository import Gtk class LabelledEntries(Gtk.Alignment):...
lightbase/LBSociam
lbsociam/__init__.py
#!/usr/env python # -*- coding: utf-8 -*- import os from config import load_config class LBSociam(object): """ Classe global com as configurações """ def __init__(self): """ Parâmetro construtor """ config = load_config() self.twitter_sources = config.get('twitt...
mykytamorachov/outpost
app/models.py
from app import db class Object(db.Model): obj_seq = db.Column(db.Integer, primary_key=True) obj_name = db.Column(db.String(120), unique=True) obj_phone = db.Column(db.String(120)) obj_schema = db.Column(db.String(120)) obj_path = db.Column(db.String(120)) obj_photo_url = db.Column(db.String(12...
RadicalDev/CellBot
udp_command_server.py
__author__ = 'jfindley' import socket, time, math from numpy import interp from sh import cam_control PKT_SIZE=87 s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) s.bind(("0.0.0.0", 2560)) class CameraController(object): def __init__(self): self.az = 0 self.af = 0 self.ae = 0 s...
hackultura/procult
procult/authentication/managers.py
# -*- coding: utf-8 -*- import operator from functools import reduce from django.db import models from django.db.models import Q from django.contrib.auth.models import BaseUserManager class UserManager(BaseUserManager): def create_user(self, email, password=None, **kwargs): if not email: rai...
jessevdk/cldoc
cldoc/documentmerger.py
import os, subprocess from . import comment from . import nodes import sys, re from . import fs from . import utf8 class DocumentMerger: reinclude = re.compile('#<cldoc:include[(]([^)]*)[)]>') def merge(self, mfilter, files): for f in files: if os.path.basename(f).startswith('.'): ...
robmcmullen/peppy
peppy/editra/profiler.py
# Wrapper around Editra configuration get/set utilities to return the peppy # equivalent import os, sys import wx def Profile_Get(index, fmt=None, default=None): app = wx.GetApp() try: if index == 'FONT1': font = app.fonts.classprefs.primary_editing_font return font elif...
MDAnalysis/mdanalysis
package/MDAnalysis/analysis/base.py
# -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding:utf-8 -*- # vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 # # MDAnalysis --- https://www.mdanalysis.org # Copyright (c) 2006-2017 The MDAnalysis Development Team and contributors # (see the file AUTHORS for the full list of names) # # Released under t...
gratefulfrog/ArduGuitar
Ardu2/design/POC-3_MAX395/pyboard/V1_WithHMI/pyboard/Test_or_Old/FrozenStringBug/bug.py
# bug.py """ Usage: 1. Select all the .py files from the root directory! 2. Byte compile them to the frozen part of the firmware and load the firmware to the pyboard. 3. Mound the sd card STAND-ALONE, on the pc 4. Put the Data directory on the sd-card 5. Put the file config_.py from the SD directory on the sd-card 6. E...
dhenrygithub/QGIS
python/plugins/db_manager/db_model.py
# -*- coding: utf-8 -*- """ /*************************************************************************** Name : DB Manager Description : Database manager plugin for QGIS Date : May 23, 2011 copyright : (C) 2011 by Giuseppe Sucameli email : brush.tyler@...
Manexware/medical
oemedical/oemedical_lifestyle/oemedical_lifestyle.py
from openerp import models,fields class DrugsRecreational(models.Model): _name = 'oemedical.drugs_recreational' _description = 'Recreational Drug' name = fields.Char('Name', translate=True, help="Name of the drug") street_name = fields.Char('Street names', help="Common name of the drug i...
rpmfusion-infra/rfpkg
test/test_retire.py
# -*- coding: utf-8 -*- import os import shutil import unittest import mock from six.moves import configparser import tempfile import subprocess import rfpkgdb2client from rfpkg.cli import rfpkgClient TEST_CONFIG = os.path.join(os.path.dirname(__file__), 'rfpkg-test.conf') class RetireTestCase(unittest.TestCase): ...
mennanov/django-blueprint
fabfile.py
import os from fabric.api import * from fabric.contrib.console import confirm # import wsgi file because it defines DJANGO_SETTINGS_MODULE from {{ project_name }} import wsgi # do not remove this line from django.conf import settings as django_settings # env independent settings env.local_media_path = django_setti...
ProfessorX/Config
.PyCharm30/system/python_stubs/-1247972723/samba/dcerpc/nbt/NETLOGON_SAM_LOGON_RESPONSE_NT40.py
# encoding: utf-8 # module samba.dcerpc.nbt # from /usr/lib/python2.7/dist-packages/samba/dcerpc/nbt.so # by generator 1.135 """ nbt DCE/RPC """ # imports import dcerpc as __dcerpc import talloc as __talloc class NETLOGON_SAM_LOGON_RESPONSE_NT40(__talloc.Object): # no doc def __init__(self, *args, **kwargs):...
ryancoleman/traveldistance
src/orstHelper.py
#Ryan G. Coleman, Kim A. Sharp crystal.med.upenn.edu, ryan.g.coleman ATSYMBOL gmail.com #bunch of helper methods for orthogonal range searching in the context of depth import rangesearch import geometry import operator import sys def getIntersectingPts( startPt, endPt, longEdge, shortAxis1, shortAxis2, orst, maxI...
BonifaceMaina/bucket-list-OOP
tests.py
"""importing unittest""" import unittest from app import app class FlaskTestCase(unittest.TestCase): """testing class""" def test_index_page_loads(self): """making sure we set up Flask the correct way""" sampletest = app.test_client(self) response = sampletest.get('/', content_type='htm...
jasonleaster/Algorithm
Graph/Depth_first_search/Python/DFS.py
#******************Algorithm Part About DFS********************* def DFS(matrix, visited, start, end): visited.append(start) # add @start into the visited list if start == end: return True size = len(matrix) for i in xrange(size): if matrix[start][i] != INF and i not in vi...
hygull/servirall-django18-site
HyGoApp/admin.py
from django.contrib import admin from .models import SignUp, Post,Video, Markdown, VideoVirtualReality, Product, Click, FishImage from .forms import SignUpForm #Register your models here. class SignUpAdmin(admin.ModelAdmin): list_display=["__unicode__","email","created_at","updated_at"] class Meta: model=SignUp f...
chrta/simulavr
regress/test_opcodes/test_ELPM_Z_incr.py
#! /usr/bin/env python ############################################################################### # # simulavr - A simulator for the Atmel AVR family of microcontrollers. # Copyright (C) 2001, 2002 Theodore A. Roth # Copyright (C) 2015 Christian Taedcke # # This program is free software; you can redistribu...
lago-project/lago
lago/paths.py
# # Copyright 2014 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 th...
smainand/scapy
scapy/layers/rtp.py
# This file is part of Scapy # See http://www.secdev.org/projects/scapy for more information # Copyright (C) Philippe Biondi <phil@secdev.org> # This program is published under a GPLv2 license """ RTP (Real-time Transport Protocol). """ from scapy.packet import * from scapy.fields import * _rtp_payload_types = { ...
Mafarricos/Mafarricos-modded-xbmc-addons
plugin.video.streamajoker/resources/site-packages/streamajoker/scrapers/tpb.py
from streamajoker import plugin from streamajoker.scrapers import scraper from streamajoker.ga import tracked from streamajoker.caching import cached_route from streamajoker.utils import ensure_fanart from streamajoker.library import library_context # Temporary, will be fixed later by them IMMUNICITY_TPB_URL = "http:...
videntity/django-fhir
fhir/migrations/0004_auto_20160109_2017.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('fhir', '0003_auto_20160109_1919'), ] operations = [ migrations.AlterField( model_name='supportedresourcetype', ...
pacoqueen/ginn
extra/scripts/resumen_partes_a_excel.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Crea un CSV con información relativa a los partes de producción para un estudio de productividades que necesita Jesús Madrid. Funciona buscando los partes entre dos fechas prefijadas en el script y volcando una serie de campos a un formato de fichero separado por punt...
vagnercsouza/nginx-admin
run.py
#!/usr/bin/env python from flask import Flask from flask import render_template from flask import request from flask import redirect from flask import url_for from os import listdir from os.path import isfile, join import subprocess app = Flask(__name__) config_file = '/etc/nginx/nginx.conf' sample_site = 'sample.c...
redshodan/cairn
src/python/cairn/sysdefs/linux/unknown/system/verify/Arch.py
"""templates.unix.system.verify.Arch Module""" import cairn def getClass(): return Arch() class Arch(object): def run(self, sysdef): if ((sysdef.info.get("arch/name") != "i386") and (sysdef.info.get("arch/name") != "ppc")): raise cairn.Exception("Invalid architecture %s detected. Currently only i386...
gzzo/arachne
arachne/scripts/scrape_headers.py
from arachne.base import Chooser from arachne.utils import celery_output from arachne.browser import Browser from arachne.celery import celery from urlparse import urlparse from json import dumps name = 'header-scraper' def base_scrape_headers(link, browser_args, match): b = Browser(name, **browser_args) ...
wisperwinter/pttbbs
common/sys/big5_gen.py
#!/usr/bin/env python # b2u b2u = open('uao250-b2u.big5.txt', 'r').readlines() b2u = [line.strip().split(' ') for line in b2u if line.strip().startswith('0x')] b2u = dict((int(b, 0), int(u, 0)) for (b, u) in b2u) print """#include <stdint.h> extern const uint16_t b2u_table[]; extern const uint16_t u2b_t...
MontpellierRessourcesImagerie/openmicroscopy
components/tools/OmeroPy/test/unit/tablestest/test_servants.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Test of the Tables facility independent of Ice. Copyright 2009-2014 Glencoe Software, Inc. All rights reserved. Use is subject to license terms supplied in LICENSE.txt """ import pytest import Ice import omero import omero.tables import uuid import logging ...
ppizarror/Hero-of-Antair
bin/pympler/tracker.py
# coding=utf-8 """ The tracker module allows you to track changes in the memory usage over time. Using the SummaryTracker, you can create summaries and compare them with each other. Stored summaries can be ignored during comparision, avoiding the observer effect. The ObjectTracker allows to monitor object creation. Y...
egabancho/invenio-sse
invenio_sse/version.py
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 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 later...
glevand/buildroot--buildroot
support/testing/tests/package/test_glxinfo.py
import os import infra.basetest GLXINFO_TIMEOUT = 120 class TestGlxinfo(infra.basetest.BRTest): config = \ """ BR2_x86_core2=y BR2_TOOLCHAIN_EXTERNAL=y BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y BR2_TOOLCHAIN_EXTERNAL_URL="http://toolchains....
izapolsk/integration_tests
cfme/generic_objects/definition/button_groups.py
import attr from navmazing import NavigateToAttribute from navmazing import NavigateToSibling from cfme.exceptions import OptionNotAvailable from cfme.generic_objects.definition.definition_views import GenericObjectActionsDetailsView from cfme.generic_objects.definition.definition_views import GenericObjectAddButtonVi...
lechner/wolfssl
wrapper/python/wolfssl/examples/client.py
#!/usr/bin/env python # # -*- coding: utf-8 -*- # # client.py # # Copyright (C) 2006-2020 wolfSSL Inc. # # This file is part of wolfSSL. # # wolfSSL 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 versi...
spirali/aislinn
src/aislinn/vgtool/socketwrapper.py
# # Copyright (C) 2014 Stanislav Bohm # # This file is part of Aislinn. # # Aislinn 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, or # (at your option) any later v...
emacsmirror/stgit
stgit/lib/git/branch.py
from stgit.config import config from stgit.exception import StgException from stgit.run import RunException class BranchException(StgException): """Exception raised by failed :class:`Branch` operations.""" class Branch: """Represents a Git branch.""" def __init__(self, repository, name): self.r...
tiagocardosos/stoq
stoq/gui/financial.py
# -*- Mode: Python; coding: utf-8 -*- # vi:si:et:sw=4:sts=4:ts=4 ## ## Copyright (C) 2011-2013 Async Open Source <http://www.async.com.br> ## All rights reserved ## ## 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 Fre...
arky/pootle-dev
pootle/apps/pootle_language/api.py
# -*- coding: utf-8 -*- # # Copyright 2013 Zuza Software Foundation # # This file is part of Pootle. # # 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 you...
liuzheng712/jumpserver
apps/terminal/urls/api_urls_v2.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # from django.urls import path from rest_framework_bulk.routes import BulkRouter from ..api import v2 as api app_name = 'terminal' router = BulkRouter() router.register(r'terminal', api.TerminalViewSet, 'terminal') urlpatterns = [ path('terminal-registrations/', a...
ppizarror/Hero-of-Antair
bin/simplejson/tests/test_tuple.py
import unittest import simplejson as json from simplejson.compat import StringIO class TestTuples(unittest.TestCase): def test_tuple_array_dumps(self): t = (1, 2, 3) expect = json.dumps(list(t)) # Default is True self.assertEqual(expect, json.dumps(t)) self.assertEqual(exp...
bverhagen/openCV-sconsbuilder
opencvBuilder/opencv_config.py
import os import opencvBuilderUtils class configParameters: FALSE = 0; TRUE = 1; INHERIT = 2; # Default configuration ccmake = { # 3rd party builds 'BUILD_JASPER' : False, 'BUILD_JPEG' : False, # Supported 'BUILD_OPENEXR' : False, 'BUILD_PNG' : False, 'BUI...
ratschlab/ASP
examples/undocumented/python_modular/classifier_libsvmoneclass_modular.py
from tools.load import LoadMatrix lm=LoadMatrix() traindat = lm.load_numbers('../data/fm_train_real.dat') testdat = lm.load_numbers('../data/fm_test_real.dat') parameter_list = [[traindat,testdat,2.2,1,1e-7],[traindat,testdat,2.1,1,1e-5]] def classifier_libsvmoneclass_modular (fm_train_real=traindat,fm_test_real=tes...
ivyxjc/Introduction_to_PyQt
pyqt/simpleMainWindow/mainWindowMix.py
# -*-coding:utf-8-*- import sys from PyQt4 import QtGui,QtCore class MainWindow(QtGui.QMainWindow): def __init__(self,paren=None): QtGui.QMainWindow.__init__(self) self.resize(350,250) self.setWindowTitle('mainWindow') textEdit=QtGui.QTextEdit()...
shrimpboyho/git.js
emscript/emscripten/1.5.6/tests/test_browser.py
import BaseHTTPServer, multiprocessing, os, shutil, subprocess, unittest from runner import BrowserCore, path_from_root from tools.shared import * ''' Enable this code to run in another browser than webbrowser detects as default def run_in_other_browser(url): execute(['yourbrowser', url]) webbrowser.open_new = run_i...
Daeinar/anf2cnf-sage
anf2cnf_sage.py
""" Algebraic Normal Form (ANF) to Conjunctive Normal Form (CNF) converter with support for different conversion strategies. AUTHORS: - Philipp Jovanovic (2012): Initial version. """ ############################################################################## # Copyright (C) 2012 Philipp Jovanovic # Distribute...
inspirehep/inspire-dojson
tests/test_hep_bd7xx.py
# -*- coding: utf-8 -*- # # This file is part of INSPIRE. # Copyright (C) 2014-2017 CERN. # # INSPIRE 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 ...
pajowu/nostradamIQ
nostradamIQ-webapp/services/twitter/twitter_docker.py
#!/usr/bin/python # -*- coding: utf-8 -*- # http://tweepy.readthedocs.org/en/v3.2.0/streaming_how_to.html?highlight=stream from tweepy.streaming import StreamListener from tweepy import OAuthHandler from tweepy import Stream import json import re import time import datetime import sys import os import redis from twe...
ramondiez/machine-learning
ex1/computeCostMulti.py
''' Created on 15 feb. 2017 @author: fara ''' from show import show def computeCostMulti(X, y, theta): '''%COMPUTECOSTMULTI Compute cost for linear regression with multiple variables % J = COMPUTECOSTMULTI(X, y, theta) computes the cost of using theta as the % parameter for linear regression to fit th...
avian2/spectrumwars
controller/spectrumwars/game.py
# Copyright (C) 2015 SensorLab, Jozef Stefan Institute http://sensorlab.ijs.si # # Written by Tomaz Solc, tomaz.solc@ijs.si # # This work has been partially funded by the European Community through the # 7th Framework Programme project CREW (FP7-ICT-2009-258301). # # This program is free software: you can redistribute ...
mastino/Internet_of_Thrones
butler/fork.py
import sys import mraa from mqtt_client import MQTTClient class Fork(MQTTClient): def __init__(self, name, led): super(Fork, self).__init__() self.name = name self.inUse = False self.led = led self.subscribe('#') @staticmethod def on_message(client, userdata, msg, ...
madebr/subdownloader
scripts/gui/handler_qrc.py
# -*- coding: utf-8 -*- # Copyright (c) 2019 SubDownloader Developers - See COPYING - GPLv3 import logging from pathlib import Path import re from subprocess import check_output from xml.etree.ElementTree import parse as parse_xml log = logging.getLogger('generate.qrc') PYRCC = 'pyrcc5' self_mtime = Path(__file__)...
OvanGarderen/HeadlessPi
videoserver.py
from flask import render_template, jsonify, abort from subprocess import call, check_output, Popen, PIPE from pathlib import Path from utils import DirectoryCrawl, realpath from plugin import Server import cec try: from backends.mpv import MPVBackend except Exception as e: print("Could not load MPV backend: ...
CA-Lab/moral-exchange
simulations/pd_trust/different_memories_tit_for_tat.py
from gt_trust_two_players import * C = True D = False state0 = {'f_a': 10, 's_a': D, 'f_b': 10, 's_b': C, 'trust': 10,} state1 = {'f_a': 12, 's_a': C, 'f_b': 8, 's_b': D, 'trust': 9,} runs = [] for i in range(0, 1000): T = [ stat...
gilestrolab/ethoscope
node_src/ethoscope_node/utils/backups_helpers.py
from ethoscope_node.utils.device_scanner import EthoscopeScanner from ethoscope_node.utils.mysql_backup import MySQLdbToSQlite, DBNotReadyError import os import logging import time import multiprocessing import traceback import urllib.request import json def receive_devices(server = "localhost"): ''' Interro...
mhbu50/erpnext
erpnext/maintenance/doctype/maintenance_schedule/test_maintenance_schedule.py
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt import unittest import frappe from frappe.utils.data import add_days, formatdate, today from erpnext.maintenance.doctype.maintenance_schedule.maintenance_schedule import ( make_maintenance_visit, ) # test_records = frappe.get_te...
ostrokach/biskit
Biskit/Mod/Analyse.py
## Automatically adapted for numpy.oldnumeric Mar 26, 2007 by alter_code1.py ## ## Biskit, a toolkit for the manipulation of macromolecular structures ## Copyright (C) 2004-2012 Raik Gruenberg & Johan Leckner ## ## This program is free software; you can redistribute it and/or ## modify it under the terms of the GNU Ge...
arkadoel/AprendiendoPython
Cherrypy/prueba7/__init__.py
from mako.runtime import Context import io __author__ = 'arkadoel' import os import os.path from mako.template import Template from mako.lookup import TemplateLookup import cherrypy PATH = os.path.abspath(os.getcwd()) class webapp(object): @cherrypy.expose def index(self): direccion = PATH + "/inde...
gustavi/teamnewheaven_fr
teamnewheaven/contact/tests.py
# This file is part of Team NewHeaven website. # # Team NewHeaven website 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. # # Team NewH...
elmamyra/kbremap
kbremap_app/keyTools/keyGroups.py
groups = ( ('miscellany' ,( 0xff08, 0xff09, 0xff0a, 0xff0b, 0xff0d, 0xff13, 0xff14, 0xff15, 0xff1b, 0xffff, 0xff20, 0xff37, 0xff3c, 0xff3d, 0xff3e, 0xff21, 0xff22, 0xff23,...
kejbaly2/metrique
metrique/cubes/osinfo/rpm.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 # Author: "Chris Ward" <cward@redhat.com> ''' metrique.cubes.osinfo.rpm ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This module contains the generic metrique cube used for extracting installed RPM details on a RPM based system. .. n...
ruleant/weblate
weblate/trans/models/advertisement.py
# -*- coding: utf-8 -*- # # Copyright © 2012 - 2014 Michal Čihař <michal@cihar.com> # # This file is part of Weblate <http://weblate.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, eithe...
fsimkovic/cptbx
conkit/command_line/__init__.py
# BSD 3-Clause License # # Copyright (c) 2016-19, University of Liverpool # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notic...
liamw9534/bt-manager
bt_manager/vendors.py
from __future__ import unicode_literals VENDORS = { 0x0000: 'Ericsson Technology Licensing', 0x0001: 'Nokia Mobile Phones', 0x0002: 'Intel Corp.', 0x0003: 'IBM Corp.', 0x0004: 'Toshiba Corp.', 0x0005: '3Com', 0x0006: 'Microsoft', 0x0007: 'Lucent', 0x0008: 'Motorola', 0x0009: 'In...
timgrossmann/InstaPy
instapy/unfollow_util.py
""" Module which handles the follow features like unfollowing and following """ # import built-in & third-party modules import os import random import json import csv import sqlite3 from datetime import datetime from datetime import timedelta from math import ceil # import InstaPy modules from .time_util import sleep...
ciudadanointeligente/votainteligente-portal-electoral
popular_proposal/tests/subscription_tests.py
# coding=utf-8 from popular_proposal.tests import ProposingCycleTestCaseBase as TestCase from popular_proposal.models import (ProposalLike, Commitment, PopularProposal, ) from popular_proposal.subscriptions im...
winnerineast/Origae-6
origae/pretrained_model/tasks/torch_upload.py
# Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved. from __future__ import absolute_import import os from origae.utils import subclass, override from origae.status import Status from origae.pretrained_model.tasks import UploadPretrainedModelTask @subclass class TorchUploadTask(UploadPretrainedModelTa...
benjello/liam2
liam2/exprrandom.py
# encoding: utf-8 from __future__ import division, print_function import numpy as np import config from expr import firstarg_dtype, ComparisonOp, Variable, expr_eval from exprbases import NumpyRandom, make_np_class, make_np_classes from exprmisc import Where from utils import argspec def make_random(docstring, dtyp...
vdrhtc/Measurement-automation
scripts/photon_wave_mixing/helpers.py
from scipy.ndimage import gaussian_filter1d from scipy.optimize import curve_fit import scipy.fft as fp import numpy as np import pickle import matplotlib.pyplot as plt import lib.plotting as plt2 def parse_probe_qubit_sts(freqs, S21): amps = np.abs(S21) frequencies = freqs[gaussian_filter1d(amps, sigma=1).ar...
ubuntu-touch-apps/music-app
tests/autopilot/music_app/__init__.py
# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- # Copyright 2013, 2014, 2015 Canonical # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License version 3, as published # by the Free Software Foundation. """music-app tests...
tuomasjjrasanen/evdaemon
src/lib/utils.py
import sys MAX_HEXLEN = len(hex(sys.maxint)[2:]) def hexstrs_to_int(hexstrs, max_hexlen=MAX_HEXLEN): hexsumstr = '' hexvals = [int(v, 16) for v in hexstrs] for hexval in hexvals: padded_hexval = format(hexval, "0%dx" % max_hexlen) hexsumstr += padded_hexval return int(hexsumstr, 16) d...