repo_name stringlengths 5 104 | path stringlengths 4 248 | content stringlengths 102 99.9k |
|---|---|---|
amberheilman/mousetrap | src/mousetrap/app/ui/settings_gui.py | # -*- coding: utf-8 -*-
# MouseTrap
#
# Copyright 2009 Flavio Percoco Premoli
#
# This file is part of mouseTrap.
#
# MouseTrap is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License v2 as published
# by the Free Software Foundation.
#
# mouseTrap is distributed ... |
kcroker/Gadget-2.0.7-ngravs | utilities/rdep.py | #!/usr/bin/python
# Investigate the computed force law as a function of radial separation
import sys
import math
import os
import random
import numpy as np
# So that the bumper code can set things up
proggyName = "rdep"
# Make datum more useful for parsing forcetest
class Datum:
# and a constructor to take the ... |
CospanDesign/nysa-gui | NysaGui/host/view/nysa_bus_view/fpga_bus_view.py | import sys
import os
import time
from PyQt4.Qt import *
from PyQt4.QtCore import *
from PyQt4.QtGui import *
os.path.join(os.path.dirname(__file__), os.pardir, os.pardir)
from graphics_scene import GraphicsScene
from graphics_view import GraphicsView
p = os.path.abspath(os.path.join(os.path.dirname(__file__),
... |
koditraquinas/koditraquinas.repository | script.module.urlresolver/lib/urlresolver/plugins/playedto.py | '''
urlresolver XBMC Addon
Copyright (C) 2011 t0mm0
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
... |
maxwelld90/searcher_simulations | scripts/old/get_simulation_list.py | import os
import sys
import fnmatch
# matches = []
# for root, dirnames, filenames in os.walk('src'):
# for filename in fnmatch.filter(filenames, '*.c'):
# matches.append(os.path.join(root, filename))
def get_simulation_configs(base_dir):
"""
Prints all the simulation configuration files found from th... |
buffer/anacapa | anacapa/settings.py | # -*- coding: utf-8 -*-
# Scrapy settings for anacapa project
#
# For simplicity, this file contains only settings considered important or
# commonly used. You can find more settings consulting the documentation:
#
# http://doc.scrapy.org/en/latest/topics/settings.html
# http://scrapy.readthedocs.org/en/latest... |
rafamanzo/colab | tests/run.py | #!/usr/bin/env python
import os
import sys
os.environ['DJANGO_SETTINGS_MODULE'] = 'tests.settings'
os.environ['COLAB_PLUGINS'] = 'tests/plugins.d'
os.environ['COVERAGE_PROCESS_START'] = '.coveragerc'
import django
import coverage
from django.test.utils import get_runner
from django.conf import settings
def runte... |
dallingham/regenerate | regenerate/ui/error_dialogs.py | #
# Manage registers in a hardware design
#
# Copyright (C) 2008 Donald N. Allingham
#
# 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... |
cmusatyalab/GigaSight | src/indexer/Indexer/pstf/compare_accuracy.py | SCORE_THRESHOLD = 0.7
TAG_FILE_PATH = "tagfiles/"
CLASS_NUM = 22
CLASSES = [
"total",
"blding",
"grass",
"tree",
"cow",
"sheep",
"sky",
"plane",
"water",
"face",
"car",
"bicycle",
"flower",
"sign",
"b... |
gabriel-stan/gestion-tfg | apps/comisiones_evaluacion/tests/test_upload_file_tfgs/cases.py | # -*- coding: utf-8 -*-
TFG1 = {'tipo': 'T2', 'titulo': 'Análisis Exploratorio de Datos Mediante Técnicas de Visualización Avanzada',
'n_alumnos': '1',
'descripcion': 'Vivimos en la era de la información y la transparencia. Nos rodea una inmensidad de datos que '
'dificilmente po... |
iocoop/beancount | src/python/beancount/core/number_test.py | __author__ = "Martin Blais <blais@furius.ca>"
import unittest
from beancount.core import number
from beancount.core.number import D
from beancount.core.number import Decimal
from beancount.core.number import ZERO
class TestDecimalPrecision(unittest.TestCase):
def test_formatting(self):
# Verifying if w... |
centrumholdings/buildbot | buildbot/broken_test/unit/test_package_rpm.py | # test step.package.rpm.*
from twisted.trial import unittest
from buildbot.steps.package.rpm import RpmBuild, RpmLint, RpmSpec
class TestRpmBuild(unittest.TestCase):
"""
Tests the package.rpm.RpmBuild class.
"""
def test_creation(self):
"""
Test that instances are created with prope... |
jeremi360/jythonfx | jythonfx/fxml.py | # -*- coding: utf-8 *-*
import fix
fix.getJavaFX()
from javafx.fxml import FXMLLoader as FxmlL
from java.io import File
class FXMLLoader(object):
def __init__(self, fxmlfile, prefix = ""):
print fxmlfile
fxml = FxmlL(File(fxmlfile).toURL())
fxml.setController(self)
self.body = fxm... |
mbuesch/partmgr | partmgr/gui/entitycombobox.py | # -*- coding: utf-8 -*-
#
# PartMgr GUI - Entity combo box
#
# Copyright 2014 Michael Buesch <m@bues.ch>
#
# 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
# (... |
m1trix/Tetris-Wars | tetris_wars/tests/test_statistics.py | import unittest
from ..engine.statistics import *
from ..engine.tetrimino import *
class TestStatisticsCore(unittest.TestCase):
def setUp(self):
self.statistics = StatisticsCore()
def test_note_tetrimino_spawn(self):
tetrimino = create_tetrimino(Tetrimino.Type.L, 0, 0)
self.statistic... |
Snegovikufa/HPGL-GUI | hpgl_run/sis_thread.py | from geo_bsd import set_output_handler
from geo_bsd import set_progress_handler
from geo_bsd import sis_simulation
from geo_bsd import calc_cdf
from PySide import QtCore, QtGui
class SISThread(QtCore.QThread):
propSignal = QtCore.Signal(object)
logMessage = QtCore.Signal(str)
progressMessage = QtCore.Signa... |
dol-sen/catalyst | arch/powerpc.py |
import os,builder
from catalyst_support import *
class generic_ppc(builder.generic):
"abstract base class for all 32-bit powerpc builders"
def __init__(self,myspec):
builder.generic.__init__(self,myspec)
self.settings["CHOST"]="powerpc-unknown-linux-gnu"
if self.settings["buildarch"]=="ppc64":
if not os.pa... |
elsonrodriguez/madhatter | koan/redhat/configure_packages.py | """
Package resource configuration class.
Copyright 2010 Kelsey Hightower
Kelsey Hightower <kelsey.hightower@gmail.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the Licens... |
JonasWallin/BayesFlow | tests/test_hier_GMM.py | '''
Created on Jul 10, 2014
@author: jonaswallin
'''
import unittest
import BayesFlow as bm
import numpy.random as npr
import numpy as np
import scipy.linalg as spl
from BayesFlow.PurePython.distribution.wishart import invwishartrand
from BayesFlow.PurePython.GMM import mixture
class Test(unittest.TestCase):
def... |
djaodjin/envconnect | envconnect/helpers.py | # Copyright (c) 2020, DjaoDjin inc.
# see LICENSE.
import logging
from django.db.models import Max, Q
from pages.models import build_content_tree, PageElement
from survey.models import Choice, Unit
from survey.utils import get_account_model
from .compat import six
from .models import Consumption
LOGGER = logging.g... |
linkcheck/linkchecker | tests/test_po.py | # Copyright (C) 2005 Joe Wreschnig
# Copyright (C) 2005-2010 Bastian Kleineidam
#
# 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... |
rafaelmartins/pidsim | pidsim/core/discretization.py | # -*- coding: utf-8 -*-
"""
pidsim.core.discretization
~~~~~~~~~~~~~~~~~~~~~~~~~~
Transfer Function discretization methods.
This module implements some numerical methods to discretize the
Transfer Functions on the time domain.
:copyright: 2009-2010 by Rafael Goncalves Martins
:lic... |
Dutchj/pbtweeter | pbtweeter/config.py | import os
import yaml
if not os.path.exists('../config/'):
os.mkdir('../config/')
if not os.path.isfile('../config/config.yml'):
default = {
'Game': 'The Legend of Zelda: Ocarina of Time',
'Interval': 60,
'Data': '/data/',
'Debug': False,
'Categories': {'Any%': '20:... |
seewindcn/tortoisehg | src/hgext/convert/monotone.py | # monotone.py - monotone support for the convert extension
#
# Copyright 2008, 2009 Mikkel Fahnoe Jorgensen <mikkel@dvide.com> and
# others
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
import os, re
from mercurial import util... |
paulross/cpip | tests/unit/test_util/test_ListGen.py | #!/usr/bin/env python
# CPIP is a C/C++ Preprocessor implemented in Python.
# Copyright (C) 2008-2017 Paul Ross
#
# 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... |
cmazuc/scarfage | scarf/core/messages.py | import datetime
from flask import render_template
from keyvalue import SiteKey, check_key_exists, new_key
from sql import upsert, doupsert, doquery, Tree
from mail import send_mail
from memoize import memoize_with_expiry, cache_persist, long_cache_persist
from utility import obfuscate, deobfuscate
import users
import... |
ubyssey/dispatch | dispatch/tests/test_widget_render.py | from django.template import loader
from django.utils.html import mark_safe
from dispatch.theme import register
from dispatch.theme.widgets import Zone, Widget
from dispatch.theme.fields import CharField, TextField, ArticleField, ImageField, InvalidField
from dispatch.models import Article, Image
from dispatch.tests.c... |
lathertonj/RemixNoveltyRanker | Code/helper scripts/input_keys.py | import os.path
def releases():
f = open('releases.txt')
releases = []
line = f.readline()
while line != "" and line != "\n":
releases += [line.strip()]
line = f.readline()
f.close()
return releases
releases = releases()
f = open('keys.txt', 'a')
def keys():
f = open('keys.... |
gzamboni/sdnResilience | loxi/of14/const.py | # Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University
# Copyright (c) 2011, 2012 Open Networking Foundation
# Copyright (c) 2012, 2013 Big Switch Networks, Inc.
# See the file LICENSE.pyloxi which should have been included in the source distribution
# Automatically generated by LOXI from ... |
AnumSheraz/IP-Controlled-Robotic-Car | Manual-IP-Controlled-Robotic-Car/Code.py |
import sys
from PyQt4 import QtGui, QtCore
import time, socket, json
from main import Ui_MainWindow
s=socket.socket(socket.AF_INET,socket.SOCK_DGRAM)
IP = "localhost"
PORT = 8001
class main_menu(QtGui.QMainWindow):
def __init__(self):
super(main_menu, self).__init__()
self.ui=Ui_MainWindow()
... |
joshmoore/openmicroscopy | components/tools/OmeroPy/test/clitest/prefs.py | #!/usr/bin/env python
"""
Test of the scripts plugin
Copyright 2010 Glencoe Software, Inc. All rights reserved.
Use is subject to license terms supplied in LICENSE.txt
"""
import unittest, os
from omero.cli import Context, BaseControl, CLI, NonZeroReturnCode
from omero.config import ConfigXml
from omero.pl... |
Scarro/X-Serv-18.1-Practica1 | practica1.py | #!/usr/bin/python3
# -*- coding: utf-8 -*-
# ---------------------------------
# Sergio Carro Albarrán
# SAT GITT
# ---------------------------------
import webapp
import csv
import os
from pathlib import Path
from urllib.request import urlopen
from urllib.parse import unquote
class acortadoraUrls(webapp.webApp):
... |
UstadMobile/exelearning-ustadmobile-work | exe/engine/quiztestidevice.py | # ===========================================================================
# eXe
# Copyright 2004-2006, University of Auckland
# Copyright 2004-2008 eXe Project, http://eXeLearning.org/
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as... |
jongyeob/swpy | swpy/solarpack/image.py | '''
Created on 2017. 3. 25.
@author: jongyeob
'''
from swpy.base import DataUnit
from swpy import solarpack as swsp
import numpy as np
class SolarImage(DataUnit): pass
class SurfaceNorm():
def __init__(self,solar_image):
self.image = solar_image
def get(self):
header = s... |
geimer/easybuild-framework | test/framework/utilities.py | ##
# Copyright 2012-2014 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en),
# the Hercules foundation (htt... |
pgmillon/ansible | lib/ansible/plugins/cliconf/iosxr.py | #
# (c) 2017 Red Hat Inc.
#
# This file is part of Ansible
#
# Ansible 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.
#
# Ansible is d... |
wettenhj/mytardis | tardis/tardis_portal/models/facility.py | from django.db import models
from django.utils import timezone
from django.contrib.auth.models import Group
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Facility(models.Model):
"""
Represents a facility that produces data.
Each :class:`~tardis.tardis_po... |
acesonl/remotecare | remotecare/apps/healthperson/secretariat/forms.py | # -*- coding: utf-8 -*-
"""
This module contains the forms for profile editing by a secretary and
als for the manager to search for a secretary.
:subtitle:`Class definitions:`
"""
from django import forms
from django.utils.translation import ugettext_lazy as _
from apps.account.forms import BaseProfileEditForm, BaseP... |
bablokb/mtv_cli | files/usr/local/bin/mtv_filmdb.py | #!/usr/bin/python3
# -*- coding: utf-8 -*-
# --------------------------------------------------------------------------
# Mediathekview auf der Kommandozeile
#
# Class FilmDB, MtvDB: Alles rund um Datenbanken
#
# Author: Bernhard Bablok
# License: GPL3
#
# Website: https://github.com/bablokb/mtv_cli
#
# ---------------... |
Trilarion/imperialism-remake | source/imperialism_remake/lib/qt.py | # Imperialism remake
# Copyright (C) 2014-16 Trilarion
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This progra... |
twoodford/mdb | mdb/discretestats.py | # discretestats.py
# Copyright (C) 2015 Tim Woodford.
# Deal with statistics in continuous distributions & discretization of variables.
from __future__ import division
from math import log, exp
def discretize(values, minimum, bucket_size):
"""
Put each continuous value in values into discrete buckets.
>>... |
kejbaly2/comdev | comdev/twitter_api.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import ipdb # ipdb.set_trace() # NOQA
import logging
import twitter
log = logging.getLogger(__name__)
def get_api(consumer_key, consumer_secret,
access_token_key, access_token_secret):
log.info('Authenticating Twitter API credentials')
api = twi... |
FinalFrontierPrototyping/AxialFluxGeneratorDesigner | AxialFluxGeneratorDesigner/Python/3DGenerator.py | import sys
sys.path.append("C:\Program Files\FreeCAD\\bin")
import os
import math
import FreeCAD
import Sketcher
import Part
import Draft
def translate(context, text):
return text
#This file is used to generate an obj file using FreeCAD. The generated file if imported into C# using the helix toolkit. Also a *.F... |
SilverLuke/Projects | src/project.py | import os
class Command():
def __init__(self, name, command, type):
self.icon = None # TODO mabye some day
self.name = name
self.command = command
self.type = type
def get_command(self):
return bytes(" " + self.command + "\n", 'utf-8')
"""
Single project class
"""
class Project():
def __init__(self, na... |
rocky/python3-trepan | test/unit/test-except.py | #!/usr/bin/env python3
'Unit test for trepan.exception'
import unittest
from trepan import exception as Mexcept
class TestDeguggerExcept(unittest.TestCase):
def test_debugger_restart(self):
try:
raise Mexcept.DebuggerRestart(['a', 'b'])
except Mexcept.DebuggerRestart:
imp... |
albz/Architect | utils/python_utils/general_plot_utilities/Histograms/Architect_Plot_Spectrum2D.py | #!/usr/bin/python
######################################################################
# Name: Architect_Plot_Spectrum2D.py
# Author: F Massimo
# Date: 2016-02-08
# Purpose: plots 2D spectrum of Architect Particles data
# Source: Python
##########################################... |
clintron/familyjools | parse.py | from html.parser import HTMLParser
import requests
import re
session = requests.session()
def setSession(newSession):
session = newSession
class GemParser(HTMLParser):
pageSize = 2000
def parseLinks(self, html):
'''
Parse HTML for product types
Returns a list of dictionaries of the form: {"url": "http://w... |
aschampion/CATMAID | django/applications/catmaid/migrations/0052_add_tile_linear_interpolation_userprofile_setting.py | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'UserProfile.tile_linear_interpolation'
db.add_column(u'ca... |
Derrior/petris | tes.py | import curses
import sys
import os
from time import sleep
curses.initscr()
'''
for i in range(22):
a = (sys.stdin.read(1))
curses.flushinp()
sys.stdout.write(str((ord(a))) + '\n' + '\b\b\b\b\b\b')
sys.stdout.write('\n\n\n\n\n\n\n')
sys.stdout.flush()
'''
while True:
curses.beep()
sleep(0.... |
robertostling/bnas | bnas/optimize.py | """Optimization algorithms.
This module provides different algorithms for optimization through (typically)
stochastic mini-batch gradient descent.
"""
import random
from collections import OrderedDict
import pickle
import numpy as np
import theano
from theano import tensor as T
from .fun import function
def itera... |
bright-sparks/wpull | wpull/database/sqltable_test.py | # encoding=utf-8
import time
import unittest
from wpull.database.sqltable import SQLiteURLTable
from wpull.item import Status
from wpull.database.base import NotFound
class TestDatabase(unittest.TestCase):
def test_sqlite_url_table(self):
url_table = SQLiteURLTable(':memory:')
self._generic_url... |
Arcanemagus/SickRage | tests/search_tests.py | #!/usr/bin/env python2.7
# coding=UTF-8
# Author: Dennis Lutter <lad1337@gmail.com>
# URL: https://sick-rage.github.io
#
# This file is part of SickRage.
#
# SickRage 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 Founda... |
fkie-cad/FACT_core | src/update_statistic.py | #! /usr/bin/env python3
'''
Firmware Analysis and Comparison Tool (FACT)
Copyright (C) 2015-2021 Fraunhofer FKIE
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 ... |
dwagon/hostinfo_client | bin/hostinfo_addhost.py | #!/usr/bin/env python
#
# Written by Dougal Scott <dougal.scott@gmail.com>
#
# Copyright (C) 2017 Dougal Scott
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of t... |
RashmiKare/firstpy | ft81x_api.py | #!/usr/bin/env python
import ctypes
import sys
import time
import ft81x_def
HW_444=1
#HW_444=0
###################### common APIs ####################
def ft81x_write(ch_instance,addr,buf):
'''
Writes contents of "buf" which is string type to FT81x address "addr"
Args:
ch_instance - SPI... |
mikel-egana-aranguren/MSc_Bioinformatics_UM_13-14_LSSW | doc/Programming-the-Semantic-Web/chapter7/message_board_LOD_server.py | import os
from wsgiref import simple_server
import rdflib
from rdflib import Namespace
import message_board_to_sioc
from message_board_to_sioc import SIOC, DC, DCTERMS, FOAF, RDFS, MB
"""
A very simple Linked Open Data server
It does not implement content negotiation (among other things)
...and only serves rdf+xml
"... |
ESSolutions/ESSArch_Core | ESSArch_Core/storage/migrations/0010_auto_20170411_1801.py | # -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2017-04-11 16:01
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('storage', '0009_auto_20170410_1141'),
]
operations = [
migrations.AddField(
... |
volak/tulpenmanie | tulpenmanie/network/socket_io.py | # Tulpenmanie, a markets client.
# Copyright (C) 2012 Emery Hemingway
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.... |
hofschroeer/shinysdr | shinysdr/plugins/mode_s/__init__.py | # Copyright 2013, 2014, 2015 Kevin Reid <kpreid@switchb.org>
#
# This file is part of ShinySDR.
#
# ShinySDR 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 opti... |
mPowering/django-orb | orb/toolkits/models.py | from django.db import models
from django.utils.translation import ugettext_lazy as _
from tinymce.models import HTMLField
class Toolkit(models.Model):
"""
Provides an external link functionality
"""
order_by = models.IntegerField(default=0)
title = models.CharField(max_length=200)
url = models... |
upibhalla/moose-core | python/moose/SBML/readSBML.py | '''
*******************************************************************
* File: readSBML.py
* Description:
* Author: HarshaRani
* E-mail: hrani@ncbs.res.in
********************************************************************/
/**********************************************************... |
jkthompson/nupic | py/nupic/encoders/logenc.py | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... |
ju1ius/clisnips | tests/database/offset_pager_test.py | import sqlite3
import pytest
from clisnips.database.offset_pager import OffsetPager
TEST_SCHEMA = '''
CREATE TABLE paging_test(
value TEXT,
ranking INTEGER
);
CREATE VIRTUAL TABLE paging_test_idx USING fts4(
content="paging_test",
value
);
CREATE TRIGGER IF NOT EXISTS test_bu BEFORE UPDATE
ON pagin... |
rukku/upcat2015-data-experiments | upcatresults_dl.py | from bs4 import BeautifulSoup
import csvkit #because Unicode
import os
import wget
"""
This script downloads all the results pages for UPCAT 2015 and then extracts the results to a csv file.
"""
def downloadResults():
"""Download all the html files of the results"""
baseurl = 'http://u... |
balajeerc/lexiconator | lexiconator-client/src/pywn/pywnserver.py | #! /usr/bin/env python
from socket import *
from stdwn import impl
from StringIO import *
import thread
import cPickle
stayalive = 1
port = 3334
def acceptConnections(arg):
s = socket(AF_INET, SOCK_STREAM)
s.bind(('', port))
s.listen(1)
print "pwynserver listening on port", port
print "<return> to stop"
while ... |
adrianschroeter/kiwi | test/unit/tasks_image_info_test.py | import sys
import mock
from mock import patch, call
import kiwi
from .test_helper import argv_kiwi_tests
from kiwi.tasks.image_info import ImageInfoTask
from collections import namedtuple
class TestImageInfoTask(object):
def setup(self):
sys.argv = [
sys.argv[0], '--profile', 'vmxFlavour'... |
wettenhj/mytardis | tardis/apps/openid_migration/migrations/0001_initial.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.14 on 2018-08-01 03:44
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('tardi... |
qualitio/qualitio | qualitio/payments/models.py | from django.db import models
class Strategy(models.Model):
name = models.CharField(max_length=64)
users = models.IntegerField()
price = models.FloatField(default=0)
def endpayment(self):
pass
def __unicode__(self):
return self.name
@classmethod
def get_default(cls):
... |
hemidactylus/flaskbiblio | app/database/models.py | '''
Sqlite ORM models
'''
import hashlib
from orm import Model
from app.utils.ascii_checks import ascifiiString
from app.utils.stringlists import unrollStringList
class AutoModel(Model):
def __init__(self, **kwargs):
for k,v in kwargs.items():
setattr(self,k,v)
# a method to ascifii s... |
jxmorris12/PokemonGo-Finder | main.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
import flask
import notifier
from flask import Flask, render_template
from flask_googlemaps import GoogleMaps
from flask_googlemaps import Map
from flask_googlemaps import icons
import os
import re
import sys
import struct
import json
import requests
import argparse
import get... |
GNS3/gns3-server | gns3server/handlers/api/compute/network_handler.py | # -*- coding: utf-8 -*-
#
# Copyright (C) 2015 GNS3 Technologies 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 3 of the License, or
# (at your option) any later version.
... |
madformuse/server | server/games/ladder_service.py | import random
import asyncio
import trueskill
import config
from .ladder_game import LadderGame
from server.players import Player, PlayerState
import server.db as db
class LadderService:
"""
Service responsible for managing the 1v1 ladder. Does matchmaking, updates statistics, and
launches the games.
... |
igel-kun/pyload | module/plugins/accounts/FileboomMe.py | # -*- coding: utf-8 -*-
from ..accounts.Keep2ShareCc import Keep2ShareCc
class FileboomMe(Keep2ShareCc):
__name__ = "FileboomMe"
__type__ = "account"
__version__ = "0.02"
__status__ = "testing"
__description__ = """Fileboom.me hoster plugin"""
__license__ = "GPLv3"
__authors__ = [("igel"... |
RockyRoad29/Flask-know_users | know_users/auth.py | from flask.ext.login import LoginManager
# In order to avoid circular imports we setup the login extension
# in its own top-level module named auth:
from .users.models import User
login_manager = LoginManager()
login_manager.login_view = "users.login"
@login_manager.user_loader
def load_user(user_id):
"""
W... |
c22n/ion-channel-ABC | docs/examples/human-atrial/experiments/ito_nygren.py | """
Experiments from [Nygren1998]
Charles Houston 2019-10-18
"""
from ionchannelABC.experiment import Experiment
from ionchannelABC.protocol import recovery
import data.ito.Nygren1998.data_Nygren1998 as data
import numpy as np
import myokit
import warnings
from scipy.optimize import OptimizeWarning
import scipy.optimi... |
semkiv/heppy_fcc | analyzers/GenAnalyzer.py | from heppy.framework.analyzer import Analyzer
from heppy_fcc.tools.genbrowser import GenBrowser
class UserWarning(Exception):
pass
class GenAnalyzer(Analyzer):
def process(self, event):
genptcs = event.gen_particles
event.electrons = [ptc for ptc in genptcs if abs(ptc.pdgid())==11
... |
sshkm/django-sshkm | sshkm/migrations/0002_host_superuser.py | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-02-27 14:28
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('sshkm', '0001_initial'),
]
operations = [
migrations.AddField(
... |
fayf/pyload | module/plugins/accounts/RapidgatorNet.py | # -*- coding: utf-8 -*-
import urlparse
from module.plugins.internal.Account import Account
from module.common.json_layer import json_loads
class RapidgatorNet(Account):
__name__ = "RapidgatorNet"
__type__ = "account"
__version__ = "0.12"
__status__ = "testing"
__description__ = """Rapid... |
henla464/WiRoc-Python-2 | transforms/sitesttesttoloratransform.py | from datamodel.datamodel import SIMessage
from battery import Battery
from loraradio.LoraRadioMessageCreator import LoraRadioMessageCreator
from settings.settings import SettingsClass
import logging
class SITestTestToLoraTransform(object):
DeleteAfterSent = False
WiRocLogger = logging.getLogger('WiRoc.Output'... |
yasskate/createUserOL | POO-createUser.py | #!/usr/bin/env python
#-*-coding:utf8-*-
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
import unittest
import time,random
#se crea la clase principal LoginTest
class LoginTest(unittest.TestCase):
# Se crea la funcion setUp
def setUp(self):
# Se crea la instancia de webdriv... |
tobykurien/MakerDroid | assetsrc/public.mp3/fabmetheus_utilities/intercircle.py | """
Intercircle is a collection of utilities for intersecting circles, used to get smooth loops around a collection of points and inset & outset loops.
"""
from __future__ import absolute_import
try:
import psyco
psyco.full()
except:
pass
#Init has to be imported first because it has code to workaround the python ... |
kakarukeys/rc_crawler | tests/test_persist.py | from urllib.parse import urlsplit
import pytest
import rc_crawler.browser.persist as ps
def test_build_concise_url():
for url, expected in [
("https://www.google.com/search#abc",
"/search"),
("https://www.google.com/search/foo=bar#abc",
"/search/foo=bar"),
... |
auto-mat/klub | local_migrations/migrations_admin/0008_auto_20190909_1816.py | # Generated by Django 2.2.4 on 2019-09-09 16:16
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
from aklub.migrations.data_migration.old_user_profile_model_hack import Settings as settings
class Migration(migrations.Migration):
dependencies = [
... |
leapcode/soledad | tests/server/test_incoming_flow_integration.py | # -*- coding: utf-8 -*-
# test_incoming_flow_integration.py
# Copyright (C) 2017 LEAP
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any... |
Barmaley13/BA-Software | gate/web/__init__.py | """
HTTP Web Server Engine with Custom Tornado Adapter that includes websocket support
"""
### INCLUDES ###
import logging
from tornado import web, wsgi, httpserver, ioloop
import bottle
from .application import WebApplication
from .socket import WebsocketHandler
### CONSTANTS ###
## Logger ##
LOGGER = logging.get... |
sebdelsol/pyload | module/plugins/crypter/MegaRapidCzFolder.py | # -*- coding: utf-8 -*-
from module.plugins.internal.SimpleCrypter import SimpleCrypter
class MegaRapidCzFolder(SimpleCrypter):
__name__ = "MegaRapidCzFolder"
__type__ = "crypter"
__version__ = "0.02"
__pattern__ = r'http://(?:www\.)?(share|mega)rapid\.cz/slozka/\d+/\w+'
__config__ = [("u... |
berycoin-project/berycoin | test/functional/berycoin-gas-limit-overflow.py | #!/usr/bin/env python3
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
from test_framework.script import *
from test_framework.mininode import *
from test_framework.address import *
from test_framework.berycoin import *
import sys
import random
import time
import io
cl... |
siimeon/Kipa | web/tupa/admin.py | # encoding: utf-8
# KiPa(KisaPalvelu), tuloslaskentajärjestelmä partiotaitokilpailuihin
# Copyright (C) 2010 Espoon Partiotuki ry. ept@partio.fi
from models import *
from django.contrib import admin
from formit import *
class SarjaInline(admin.TabularInline):
model = Sarja
extra = 1
class ParametriInlin... |
flavoso/gerencex | gerencex/core/tests/test_userdetail.py | from django.contrib.auth.models import User
from django.test import TestCase
from gerencex.core.models import Office
class UserDetailTest(TestCase):
def setUp(self):
Office.objects.create(name='Nenhuma lotação',
initials='NL')
User.objects.create_user('testuser', 'te... |
auto-mat/klub | apps/aklub/migrations/0018_auto_20160131_1341.py | # -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-01-31 13:41
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('aklub', '0017_auto_20160127_1358'),
]
operations = [
migrations.AlterField(
... |
pmikus/sys-info-suite | sysinfosuite/outputs/cimc_mgmt_controller.py | # Modules
import lxml.etree
from sysinfosuite.SysInfoOutputsBase import SysInfoOutputsBase
class cimc_mgmt_controller(SysInfoOutputsBase):
def __init__(self, pc):
self.pce = pc
self.description = "Gets the UCS management information"
self.author = "Peter Mikus"
self.cmd = "mgmtCont... |
ownport/ansiblite | src/ansiblite/modules/system/setup.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible 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... |
pikachuchu/id | land.py | from cell import neutral
class Land:
def __init__(self, percent):
self.percent = percent
def isLiving(self):
return self.percent >= .05
def canSupport(self, neighbors):
if self.percent < .05:
return False
if self.percent < .25:
return neighbors == 2
... |
dparks1134/STAMP | stamp/metagenomics/simulations/pValueTest.py | import math
import random
from stamp.metagenomics.plugins.statisticalTests.Fishers import Fishers
from stamp.metagenomics.plugins.statisticalTests.ChiSquare import ChiSquare
from stamp.metagenomics.plugins.statisticalTests.ChiSquareYates import ChiSquareYates
from stamp.metagenomics.plugins.statisticalTests.GTest impo... |
Philomelos/xml2ly | score_partwise/header.py | class HeaderMixin(object):
opening = '\\header {\n'
closing = '\n } \n'
def typed_credit(self, type_, default=''):
type_matches = lambda x: x.lily_credit_type == type_
credit = filter(type_matches, self.credit[:])
if credit:
return credit[0]
else:
re... |
nocarryr/AV-Asset-Manager | avam/assettypes/admin.py | from django.contrib import admin
from assettypes.models import (
Manufacturer,
GenericModel,
GenericAccessoryModel,
ProjectorLampModel,
ProjectorFilterModel,
ProjectorLensModel,
ProjectorModel,
MovingLightLampModel,
MovingLightModel,
LEDLightModel,
CameraLensModel,
Video... |
tomstokes/redeem | software/USB.py | #!/usr/bin/env python
"""
USB communication file for Replicape.
Author: Elias Bakken
email: elias(dot)bakken(at)gmail(dot)com
Website: http://www.thing-printer.com
License: GNU GPL v3: http://www.gnu.org/copyleft/gpl.html
Redeem is free software: you can redistribute it and/or modify
it under the terms of the GNU G... |
arkabytes/abc | ABC/migrations/0030_auto_20180122_1102.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2018-01-22 11:02
from __future__ import unicode_literals
import datetime
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('ABC', '0029_auto_20180122_1032'),
]
... |
Terhands/saskdance | app/routes.py | from webapp2 import Route
from app.web import index
from app.web.admin import login, dashboard, dances, events
from app.web.users import dances as user_dances, events as user_events
__all__ = ['get_routes',
'add_routes']
_routes = [
Route('/admin', handler=login.LoginHandler, name='login'),
Route(... |
asimurzin/foam2vtk | foam2vtk/__init__.py | ## Copyright (C) 2010- Alexey Petrov
## Copyright (C) 2009-2010 Pebble Bed Modular Reactor (Pty) Limited (PBMR)
##
## This program is free software: you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation, either version 3 of the Lic... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.