code stringlengths 2 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int32 2 1.05M |
|---|---|---|---|---|---|
# training.py
# This is the training script which will be presented to the participant before they sleep
# or remain awake
#
# TODO
# Libraries - these seem fine and should not need altering.
from psychopy import visual, event, core, misc, data, gui, sound
# Participant needs to press y to continue.
def rea... | vivithemage/constraints | training/fas-sif/training-fas-sif-5.py | Python | gpl-2.0 | 4,969 |
# -*- coding: utf-8 -*-
#
# Copyright 2004-2020 University of Oslo, Norway
#
# This file is part of Cerebrum.
#
# Cerebrum 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
# ... | unioslo/cerebrum | Cerebrum/modules/no/hia/OrgLDIF.py | Python | gpl-2.0 | 4,715 |
#!/usr/bin/python
import sys
sys.path.append('/usr/share/mandriva/')
from mcc2.backends.services.service import Services
if __name__ == '__main__':
Services.main() | wiliamsouza/mandriva-control-center | bin/services-mechanism.py | Python | gpl-2.0 | 169 |
# -*- python -*-
# Copyright (C) 2009-2013 Free Software Foundation, 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 versio... | bryanperris/winN64dev | mips64-elf/mips64-elf/lib/el/libstdc++.a-gdb.py | Python | gpl-2.0 | 2,328 |
################################################################################
# This file is part of IMTAphy
# _____________________________________________________________________________
#
# Copyright (C) 2011
# Institute of Communication Networks (LKN)
# Department of Electrical Engineering and Information Techno... | creasyw/IMTAphy | modules/phy/imtaphy/testConfigs/config.py | Python | gpl-2.0 | 29,929 |
#!/usr/bin/env python
## Copyright (C) 2008 Red Hat, Inc.
## Copyright (C) 2008 Tim Waugh <twaugh@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... | KDE/printer-applet | debug.py | Python | gpl-2.0 | 1,703 |
#If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.
#Find the sum of all the multiples of 3 or 5 below 1000.
print sum([x for x in xrange(1,1000) if (x % 3 == 0) or (x % 5 == 0)])
| ecolitan/projecteuler-answers | Multiples_of_3_and_5.py | Python | gpl-2.0 | 260 |
import logging
import re
import socket
import binascii
import sys
import os
import time
import gevent
import subprocess
import atexit
from Config import config
from Crypt import CryptRsa
from Site import SiteManager
from lib.PySocks import socks
from gevent.coros import RLock
from util import helper
from Debug import... | bashrc/zeronet-debian | src/src/Tor/TorManager.py | Python | gpl-2.0 | 10,295 |
from flask.ext.wtf import Form
from wtforms import StringField, BooleanField, PasswordField, SelectField, DateTimeField, TextAreaField
| MansoorMajeed/encrypted-notes | app/forms.py | Python | gpl-2.0 | 138 |
import cgi
import hashlib
import http.server
import io
import os
import posixpath
import ssl
import threading
import time
import urllib.parse
import pyftpdlib.authorizers
import pyftpdlib.handlers
import pyftpdlib.servers
class FTPServer:
def __init__(self, port, root, report_size):
class FTPHandlerNoSI... | rebase-helper/rebase-helper | containers/integration.py | Python | gpl-2.0 | 5,136 |
'''
Created on Sep 15, 2010
@author: duncantait
'''
from SimPy.Simulation import *
import numpy as np
import random
import math
class G():
#Settings for HF Stations
num_channels = 18
num_stations = 10
class Network():
stations = []
class Medium():
def __init__(self):
self.channel... | IncidentNormal/TestApps | ALE/HF_Sim_Book.py | Python | gpl-2.0 | 17,239 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright © 2011 Thomas Schreiber
#
# 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 l... | ubiquill/Potluck | src/view/Changes.py | Python | gpl-2.0 | 2,296 |
#
# kickstart.py: kickstart install support
#
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
# Red Hat, Inc. 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 Free Software Fou... | kparal/anaconda | pyanaconda/kickstart.py | Python | gpl-2.0 | 89,420 |
import warnings
from . import pedrpc
from .base_monitor import BaseMonitor
# Important: BaseMonitor needs to come *before* pedrpc.Client in the
# Inheritance list for the method resolution order to produce
# correct results.
class ProcessMonitor(BaseMonitor, pedrpc.Client):
"""
Proxy class for the process ... | jtpereyda/boofuzz | boofuzz/monitors/process_monitor.py | Python | gpl-2.0 | 5,053 |
# Copyright (C) 2004 Jeremy S. Sanders
# Email: Jeremy Sanders <jeremy@jeremysanders.net>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# ... | veusz/veusz | veusz/widgets/page.py | Python | gpl-2.0 | 13,301 |
import time
import numpy
from rga_telnet import *
# Connecting to RGA - RGA(HOST,PORT)
class RGA:
scan = True # This is used for stop of peak scan - if set to False
status = [0 for col in range(4)] # Status of the device, look in rga_status method
showReadout = True # This one is responsible for the text outpu... | mjjank/mks_rga | RGA.py | Python | gpl-2.0 | 4,840 |
# -*- coding: utf-8 -*-
#
# Copyright 2013 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. You should hav... | Katello/katello-cli | src/katello/client/api/package.py | Python | gpl-2.0 | 1,296 |
# -*- coding: utf-8 -*-
import fauxfactory
import pytest
from cfme.services.catalogs.catalog_item import CatalogItem
from cfme.automate.service_dialogs import ServiceDialog
from cfme.services.catalogs.catalog import Catalog
from cfme.services.catalogs.service_catalogs import ServiceCatalogs
from cfme.services.catalogs... | thom-at-redhat/cfme_tests | cfme/tests/services/test_generic_service_catalogs.py | Python | gpl-2.0 | 6,331 |
#!/usr/bin/env python
##################################################
## DEPENDENCIES
import sys
import os
import os.path
try:
import builtins as builtin
except ImportError:
import __builtin__ as builtin
from os.path import getmtime, exists
import time
import types
from Cheetah.Version import MinCompatib... | pli3/e2-openwbif | plugin/controllers/views/mobile/channels.py | Python | gpl-2.0 | 7,404 |
from django.contrib.auth import get_user_model
from django.db import transaction
from django.db.models.signals import pre_delete
from django.dispatch import Signal, receiver
from misago.categories.models import Category
from misago.categories.signals import delete_category_content, move_category_content
from misago.co... | 1905410/Misago | misago/threads/signals.py | Python | gpl-2.0 | 4,750 |
from model import Model
from helpers.candidate import Candidate
from helpers.decision import Decision
class Osyczka2(Model):
def __init__(self):
Model.__init__(self)
self.initialize_decs()
def initialize_decs(self):
dec = Decision('x1', 0, 10)
self.decs.append(dec)
de... | rchakra3/x9115rc3 | hw/code/6/model/osyczka2.py | Python | gpl-2.0 | 2,597 |
# gazetteer.fields
# Copyright 2016, James Humphry
# 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 progr... | jhumphry/gazetteer_etl | gazetteer/fields.py | Python | gpl-2.0 | 3,587 |
import time
from PyQt4 import QtGui, QtCore, QtOpenGL
from PyQt4.QtOpenGL import QGLWidget
import OpenGL.GL as gl
import OpenGL.arrays.vbo as glvbo
import numpy as np
import raster
import slider
import draw_texture
import qt_helpers
raster_width = 1024
raster_height = 64
raster_n_neurons = 64
spikes_per_frame = 5
c... | tcstewar/opengl_texture_rendering | sparkle/main_raster.py | Python | gpl-2.0 | 3,315 |
#
# gPrime - A web-based genealogy program
#
# Copyright (C) 2002-2006 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 optio... | sam-m888/gprime | gprime/filters/rules/media/_hasnotematchingsubstringof.py | Python | gpl-2.0 | 1,769 |
from flask.ext.wtf import Form
from wtforms import StringField, BooleanField, TextAreaField, SelectField, FileField, IntegerField
from wtforms.validators import DataRequired, regexp, NumberRange
from wtforms.ext.sqlalchemy.fields import QuerySelectField
from picture_hunt.models import Team, Task
class TeamForm(Form):... | jkelley05/picture-scavenger-hunt | picture_hunt/forms.py | Python | gpl-2.0 | 1,679 |
'''
from https://docs.djangoproject.com/en/1.7/topics/auth/customizing/#specifying-a-custom-user-model
'''
from django import forms
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from django.contrib.auth.forms import ReadOnlyPasswordHashField
from django.utils.translation import gette... | JustinWingChungHui/okKindred | custom_user/admin.py | Python | gpl-2.0 | 3,150 |
from PyQRNative import *
from PIL.Image import BILINEAR, BICUBIC, ANTIALIAS, NEAREST
from reportlab.pdfgen import canvas
from reportlab.lib.pagesizes import portrait, A4
from reportlab.lib.units import cm, mm
from StringIO import StringIO
from plant.tag import create_tag
import time
from datetime import datetime
QR_TY... | andbof/plantdb | qr/functions.py | Python | gpl-2.0 | 4,614 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2003-2018 University of Oslo, Norway
#
# This file is part of Cerebrum.
#
# Cerebrum 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... | unioslo/cerebrum | testsuite/docker/test-config/cereconf_local.py | Python | gpl-2.0 | 1,350 |
#! /usr/bin/env python
#
# @refer
# http://svn.python.org/projects/python/trunk/Tools/scripts/ftpmirror.py
# @note
#
"""
Mirror a remote ftp subtree into a local directory tree.
usage: ftpmirror [-v] [-q] [-i] [-m] [-n] [-r] [-s pat]
[-l username [-p passwd [-a account]]]
hostname[:... | zhengfish/examples | python3/ftp/ftpmirror.py | Python | gpl-2.0 | 13,096 |
# -*- coding: utf-8 -*-
"""
***************************************************************************
ogr2ogrtabletopostgislist.py
---------------------
Date : November 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
***********... | AsgerPetersen/QGIS | python/plugins/processing/algs/gdal/ogr2ogrtabletopostgislist.py | Python | gpl-2.0 | 8,963 |
#!/usr/bin/python
import socket
def server_test():
s = socket.socket()
host = socket.gethostname()
port = 12345
s.bind((host, port))
s.listen(5)
while True:
c, addr = s.accept()
print c
print 'connect addr: ', addr
c.send('Welcome to CaiNiao!')
if cmp(c... | jianwei1216/my-scripts | mytest/python/MyInternet/myserver.py | Python | gpl-2.0 | 400 |
from common import Constant
from common import utils
from main.logger_helper import L
__author__ = 'Dan Cristian <dan.cristian@gmail.com>'
# saves record to cloud database
def save_to_history_cloud(obj):
try:
L.l.debug('Trying to save historical record to cloud {}'.format(obj))
if Constant.JSON_P... | dan-cristian/haiot | main/persistence/__init__.py | Python | gpl-2.0 | 5,411 |
#!/usr/bin/python3
# vim: ai ts=4 sts=4 et sw=4
# Copyright (c) 2009 Intel Corporation
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
# Software Foundation; version 2 of the License
#
# This program... | mer-tools/spectacle | tests/alltest.py | Python | gpl-2.0 | 1,003 |
import networkx as nx
class BaseTestAttributeMixing(object):
def setUp(self):
G=nx.Graph()
G.add_nodes_from([0,1],fish='one')
G.add_nodes_from([2,3],fish='two')
G.add_nodes_from([4],fish='red')
G.add_nodes_from([5],fish='blue')
G.add_edges_from([(0,1)... | azlanismail/prismgames | examples/games/car/networkx/algorithms/assortativity/tests/base_test.py | Python | gpl-2.0 | 1,539 |
""" SQLAlchemy support. """
from __future__ import absolute_import
import datetime
from types import GeneratorType
import decimal
from sqlalchemy import func
# from sqlalchemy.orm.interfaces import MANYTOONE
from sqlalchemy.orm.collections import InstrumentedList
from sqlalchemy.sql.type_api import TypeDecorator
try:... | Nebucatnetzer/tamagotchi | pygame/lib/python3.4/site-packages/mixer/backend/sqlalchemy.py | Python | gpl-2.0 | 8,887 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import csv
import codecs
import re
import argparse
import os
from prettytable import PrettyTable
report08_schools = {}
report08_employees = {}
report08_school_employees = {}
report16_employee = None
# The following (combined with report16_absence_reasons) is used when an ... | dideher/ekloges_dieuthinton | ekloges.py | Python | gpl-2.0 | 18,757 |
# ##### BEGIN GPL LICENSE BLOCK #####
#
# 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 distrib... | oscurart/BlenderAddons | oscurart_tools/oscurart_animation.py | Python | gpl-2.0 | 2,647 |
from __future__ import division, print_function
import unittest
import inspect
import sympy
from sympy import symbols
import numpy as np
from symfit.api import Variable, Parameter, Fit, FitResults, Maximize, Minimize, exp, Likelihood, ln, log, variables, parameters
from symfit.functions import Gaussian, Exp
import scip... | Eljee/symfit | symfit/tests/tests.py | Python | gpl-2.0 | 23,874 |
# Copyright (C) 2008-2010 Adam Olsen
#
# 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, or (at your option)
# any later version.
#
# This program is distributed in the hope that... | genodeftest/exaile | xlgui/preferences/plugin.py | Python | gpl-2.0 | 11,178 |
######################################################################
#
# FSP3000R7NCU object class
#
# Copyright (C) 2011 Russell Dwarshuis, Merit Network, Inc.
#
# This program can be used under the GNU General Public License version 2
# You can find full information here: http://www.zenoss.com/oss
#
###############... | kb8u/ZenPacks.Merit.AdvaFSP3000R7 | ZenPacks/Merit/AdvaFSP3000R7/FSP3000R7NCU.py | Python | gpl-2.0 | 933 |
# Copyright (C) 2013-2014 Fox Wilson, Peter Foley, Srijay Kasturi, Samuel Damashek, James Forcier and Reed Koser
#
# 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 Licen... | sckasturi/saltlake | commands/score.py | Python | gpl-2.0 | 3,127 |
import logging
import time
import types
from autotest.client.shared import error
from virttest import utils_misc, utils_test, aexpect
def run(test, params, env):
"""
KVM migration test:
1) Get a live VM and clone it.
2) Verify that the source VM supports migration. If it does, proceed with
... | spcui/tp-qemu | qemu/tests/migration.py | Python | gpl-2.0 | 9,706 |
import os
from setuptools import setup
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name="blake-archive",
version="0.1",
description="Blake archive web app",
license="Closed source",
packages=['blake', 'test'],
long_description=read('README')... | blakearchive/archive | setup.py | Python | gpl-2.0 | 480 |
# -*- encoding: utf-8 -*-
###########################################################################
# Module Writen to OpenERP, Open Source Management Solution
#
# Copyright (c) 2013 Vauxoo - http://www.vauxoo.com/
# All Rights Reserved.
# info Vauxoo (info@vauxoo.com)
####################################... | 3dfxsoftware/cbss-addons | res_partner_btree/model/res_partner_btree.py | Python | gpl-2.0 | 1,459 |
# -*- coding: utf-8 -*-
from py.test import mark
from translate.filters import checks
from translate.lang import data
from translate.storage import po, xliff
def strprep(str1, str2, message=None):
return data.normalized_unicode(str1), data.normalized_unicode(str2), data.normalized_unicode(message)
def passes(... | rdio/translate-toolkit | filters/test_checks.py | Python | gpl-2.0 | 65,604 |
"""
This page is in the table of contents.
Skeinlayer is an analyze viewer to display each layer of a gcode file.
The skeinlayer manual page is at:
http://fabmetheus.crsndoo.com/wiki/index.php/Skeinforge_Skeinlayer
Skeinlayer is derived from Nophead's preview script. The extruded lines are in the resistor colors red... | jetty840/ReplicatorG | skein_engines/skeinforge-50/skeinforge_application/skeinforge_plugins/analyze_plugins/skeinlayer.py | Python | gpl-2.0 | 29,441 |
# -*- 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... | drjova/cds-demosite | cds/modules/records/minters.py | Python | gpl-2.0 | 1,381 |
#
# My first attempt at python
# calibrate accelerometer
#
import re
import scipy
from scipy import optimize
from scipy import linalg
from pylab import *
#
# parse the log
#
def read_log(ac_id, filename, sensor):
f = open(filename, 'r')
pattern = re.compile("(\S+) "+ac_id+" IMU_"+sensor+"_RAW (\S+) (\S+) (\S+... | pchickey/paparazzi-linux-release | sw/tools/calibration/calib.py | Python | gpl-2.0 | 3,989 |
#! /usr/bin/env python
import os
from setuptools import setup
readme = os.path.join(os.path.dirname(__file__), 'README.md')
setup(name = 'bottleneck',
version = '0.1.0',
description = 'performance report generator for OpenMP programs in GNU/Linux',
long_description = open(readme).read(),
auth... | moreandres/bottleneck | setup.py | Python | gpl-2.0 | 1,379 |
import os
from PyQt4.QtCore import pyqtSignal
from PyQt4.QtGui import QComboBox, QDoubleValidator
from configmanager.editorwidgets.core import ConfigWidget
from configmanager.editorwidgets.uifiles.ui_numberwidget_config import Ui_Form
class NumberWidgetConfig(Ui_Form, ConfigWidget):
description = 'Number entry w... | HeatherHillers/RoamMac | src/configmanager/editorwidgets/numberwidget.py | Python | gpl-2.0 | 1,472 |
# -*- coding: utf-8 -*-
# This file is part of the xc2424scan package
# Copyright (C) 2005 Mathieu Bouchard <mbouchar@bioinfo.ulaval.ca>
#
# 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 Fou... | mbouchar/xc2424scan | src/xc2424scan/ui/widgets/scanwidget.py | Python | gpl-2.0 | 27,979 |
# synthrepo.py - repo synthesis
#
# Copyright 2012 Facebook
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
'''synthesize structurally interesting change history
This extension is useful for creating a repository with properties
... | dscho/hg | contrib/synthrepo.py | Python | gpl-2.0 | 18,180 |
from Xml.Xslt import test_harness
sheet_str = """<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="/">
<root>
<xsl:apply-templates/>
</root>
</xsl:template>
<xsl:template name="do-the-rest">
<xsl:param name="start"/>
<xsl:param name="count... | Pikecillo/genna | external/4Suite-XML-1.0.2/test/Xml/Xslt/Core/test_call_template.py | Python | gpl-2.0 | 1,488 |
#!/usr/bin/python -tt
# by skvidal@fedoraproject.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 later version.
#
# This program is... | alanfranz/mock | py/mockchain.py | Python | gpl-2.0 | 12,065 |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2005-2010 TUBITAK/UEKAE
#
# 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.
#
# ... | forYali/yali | yali/gui/ScrKeyboard.py | Python | gpl-2.0 | 2,959 |
"""
urlresolver Kodi plugin
Copyright (C) 2011 t0mm0
Updated by Gujal (C) 2016
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... | koditraquinas/koditraquinas.repository | script.module.urlresolver/lib/urlresolver/plugins/nowvideo.py | Python | gpl-2.0 | 2,602 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys, os
my_site = os.path.join(os.environ["HOME"], ".local/lib/python2.7/site-packages")
sys.path.insert(0, my_site)
import h5py
import networkx as nx
import numpy as np
import pycuda.driver as cuda
import scipy.stats as st
import sys
import aux
from consts import... | unicamp-lbic/small_world_ca | analysis.py | Python | gpl-2.0 | 19,617 |
# coding=utf-8
from __future__ import print_function, unicode_literals
__author__ = "Sally Wilsak"
import codecs
import os
import sys
import textwrap
import unittest
import import_resolver
# This isn't strictly correct; it will only work properly if your terminal is set to UTF-8.
# However, Linux is ... | starcruiseromega/insolent-meow | import_resolver/test_import_resolver.py | Python | gpl-2.0 | 6,124 |
from twitter_rec import Api
import time
USERNAME = "liaoyisheng89@sina.com"
PASSWD = "bigdata"
s = Api.Session(USERNAME, PASSWD, debug=False)
s.connect()
counter = 0
while True:
_ = s.read("/AllenboChina/followers")
if "eason" in _:
print counter
counter += 1
else:
assert False
| WeakGroup/twitter-rec | test/test_block.py | Python | gpl-2.0 | 304 |
#!/usr/bin/python
import cv
if __name__ == "__main__":
capture = cv.CaptureFromCAM(-1)
cv.NamedWindow("image")
while True:
frame = cv.QueryFrame(capture)
cv.ShowImage("image", frame)
k = cv.WaitKey(10)
if k % 256 == 27:
break
cv.DestroyWindow("image")
| jquacinella/pyIsbnScanner | scan.py | Python | gpl-2.0 | 317 |
#coding: utf-8
#
# Ailurus - a simple application installer and GNOME tweaker
#
# Copyright (C) 2009-2010, Ailurus developers and Ailurus contributors
# Copyright (C) 2007-2010, Trusted Digital Technology Laboratory, Shanghai Jiao Tong University, China.
#
# Ailurus is free software; you can redistribute it and/or modi... | killpanda/Ailurus | ailurus/computer_doctor_pane.py | Python | gpl-2.0 | 6,390 |
import os
import re
import netifaces as ni
from socket import *
from Components.Console import Console
from Components.PluginComponent import plugins
from Plugins.Plugin import PluginDescriptor
from boxbranding import getBoxType
class Network:
def __init__(self):
self.ifaces = {}
self.configuredNetworkAdapters =... | Openeight/enigma2 | lib/python/Components/Network.py | Python | gpl-2.0 | 20,757 |
# return_codes.py
#
# Copyright (C) 2018 Kano Computing Ltd.
# License: http://www.gnu.org/licenses/gpl-2.0.txt GNU GPL v2
#
# Return codes of binaries used throughout this project.
class RC(object):
"""Return codes of binaries used throughout this project. See ``source``
for more details."""
SUCCESS = 0... | KanoComputing/kano-feedback | kano_feedback/return_codes.py | Python | gpl-2.0 | 550 |
# -----------------------------------------------------------
# reads the text from the given file, and outputs its
# character statistics
#o
# (C) 2015 Frank Hofmann, Berlin, Germany
# Released under GNU Public License (GPL)
# email frank.hofmann@efho.de
# -----------------------------------------------------------
... | hofmannedv/training-python | text-analysis/character-statistics.py | Python | gpl-2.0 | 2,207 |
#!/usr/bin/env python
import sys
import optparse
import socket
def main():
p = optparse.OptionParser()
p.add_option("--port", "-p", default=8888)
p.add_option("--input", "-i", default="test.txt")
options, arguments = p.parse_args()
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.... | johnbellone/gtkworkbook | etc/socketTest.py | Python | gpl-2.0 | 626 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2011 S2S Network Consultoria e Tecnologia da Informacao LTDA
#
# Author: Zhongjie Wang <wzj401@gmail.com>
# Tianwei Liu <liutianweidlut@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the term... | umitproject/openmonitor-desktop-agent | umit/icm/agent/Application.py | Python | gpl-2.0 | 19,850 |
import ArtusConfigBase as base
import mc
def config():
conf = mc.config()
l = []
for pipeline in conf['Pipelines']:
if not pipeline.startswith('all'):
l.append(pipeline)
elif 'CHS' not in pipeline:
l.append(pipeline)
for pipeline in l:
del conf['Pipe... | dhaitz/CalibFW | cfg/artus/mc_noc.py | Python | gpl-2.0 | 508 |
import os
import pytest
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
DEB_PACKAGES = ['percona-server-mongodb', 'percona-server-mongodb-server', 'percona-server-mongodb-mongos',
'perco... | Percona-QA/package-testing | molecule/psmdb40-upgrade-from/molecule/default/tests/test_psmdb40_upgrade_from.py | Python | gpl-2.0 | 3,739 |
# -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2014 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) a... | egabancho/invenio | invenio/modules/workflows/testsuite/test_utils.py | Python | gpl-2.0 | 2,691 |
### Copyright (C) 2002-2006 Stephen Kennedy <stevek@gnome.org>
### Copyright (C) 2010-2012 Kai Willadsen <kai.willadsen@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 v... | pedrox/meld | meld/vcview.py | Python | gpl-2.0 | 35,046 |
""" blank screen to stop game being played out-of-hours """
import random
import os
import pygame
import pygame.locals
from ctime_common import go_fullscreen
class BlankScreen():
""" a blank screen with no controls """
def __init__(self, ctime, screen_width, screen_height, log):
log.info('Time for bed ... | magicalbob/ctime | ctime_blank.py | Python | gpl-2.0 | 698 |
# vim: expandtab sw=4 ts=4 sts=4:
#
# Copyright © 2003 - 2018 Michal Čihař <michal@cihar.com>
#
# This file is part of python-gammu <https://wammu.eu/python-gammu/>
#
# 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 ... | gammu/python-gammu | gammu/worker.py | Python | gpl-2.0 | 10,344 |
#!/usr/bin/python3
import os
import sys
from merge_utils import *
xml_out = etree.Element("packages")
funtoo_staging_w = GitTree("funtoo-staging", "master", "repos@localhost:ports/funtoo-staging.git", root="/var/git/dest-trees/funtoo-staging", pull=False, xml_out=xml_out)
#funtoo_staging_w = GitTree("funtoo-staging-u... | apinsard/funtoo-overlay | funtoo/scripts/merge-funtoo-staging.py | Python | gpl-2.0 | 14,296 |
#
# Copyright (c) 2016, Oracle and/or its affiliates. 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 Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope... | mysql/mysql-utilities | mysql-test/suite/replication/t/binlog_purge_ms.py | Python | gpl-2.0 | 4,696 |
from abc import ABCMeta,abstractmethod
from my_hue import *
# Would dynamically choose a trigger based on trigger type
def trigger_factory(trigger_type):
return None
class Trigger(object):
__metaclass__ = ABCMeta
def __init__(self):
self.action()
@abstractmethod
def action(self):
... | Caveat4U/home_automation | trigger.py | Python | gpl-2.0 | 793 |
from __future__ import absolute_import
from unittest import TestCase
from datetime import datetime, timedelta
from voeventdb.server.tests.fixtures import fake, packetgen
class TestBasicRoutines(TestCase):
def setUp(self):
self.start = datetime(2015, 1, 1)
self.interval = timedelta(minutes=15)
... | timstaley/voeventdb | voeventdb/server/tests/test_fixture_creation.py | Python | gpl-2.0 | 916 |
import sqlite3
import os.path
import sys
import random
def makeDatabase(databaseName):
if databaseName[-3:] != ".db":
databaseName = databaseName + ".db"
conn = sqlite3.connect(databaseName)
conn.commit()
conn.close()
def listToString(list):
string = ""
for i in list:
string += str(i)+"\t"
return string[:-... | scott-s-douglas/SWAPR | sqlite1.py | Python | gpl-2.0 | 12,933 |
#to get some base functionality for free, including the methods get_params and set_params
#to set and return the classifier's parameters as well as the score method to calculate the
#prediction accuracy,respectively
from sklearn.base import BaseEstimator
from sklearn.base import ClassifierMixin
from sklearn.preprocess... | PhenixI/machine-learning | 1_supervised_classification/19-Ensemble Learning/majority_voting/majority_voting_test.py | Python | gpl-2.0 | 8,185 |
from Tools.Profile import profile
profile("LOAD:ElementTree")
import xml.etree.cElementTree
import os
profile("LOAD:enigma_skin")
from enigma import eSize, ePoint, eRect, gFont, eWindow, eLabel, ePixmap, eWindowStyleManager, addFont, gRGB, eWindowStyleSkinned, getDesktop
from Components.config import ConfigSubsection,... | isslayne/enigma2 | skin.py | Python | gpl-2.0 | 35,736 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# PROJETO LAVAGEM A SECO
#
# MAIN
#
# Felipe Bandeira da Silva
# 26 jul 15
#
import logging
import tornado.escape
import tornado.ioloop
import tornado.web
import tornado.options
import tornado.websocket
import tornado.httpserver
import os.path
from tornado.concurrent im... | lamotriz/lavagem-a-seco | src/main.py | Python | gpl-2.0 | 8,904 |
# coding: utf-8
# In[1]:
import os
from shutil import copyfile
import subprocess
from save_embedded_graph27 import main_binary as embed_main
from spearmint_ghsom import main as ghsom_main
import numpy as np
import pickle
from time import time
def save_obj(obj, name):
with open(name + '.pkl', 'wb'... | DavidMcDonald1993/ghsom | parameter_tests_edges.py | Python | gpl-2.0 | 7,042 |
# -*- coding: utf-8 -*-
from .base import *
# memcache
CACHES = {
'default' : {
'BACKEND': 'django.core.cache.backends.locmem.LocMemCache'
}
}
| davegri/Sikumia | sikumim/settings/development.py | Python | gpl-2.0 | 162 |
from unittest import TestCase
from pyage.core import inject
from pyage_forams.solutions.foram import Foram
class TestForam(TestCase):
def test_step(self):
inject.config = "pyage_forams.conf.dummy_conf"
foram = Foram(10)
# foram.step() | maciek123/pyage-forams | pyage_forams/solutions/test_foram.py | Python | gpl-2.0 | 263 |
#! /usr/bin/env python
# -*- coding: UTF8 -*-
# Este arquivo é parte do programa Carinhas
# Copyright 2013-2014 Carlo Oliveira <carlo@nce.ufrj.br>,
# `Labase <http://labase.selfip.org/>`__; `GPL <http://is.gd/3Udt>`__.
#
# Carinhas é um software livre; você pode redistribuí-lo e/ou
# modificá-lo dentro dos termos da Li... | labase/eica | tests/testwebfunctionaldb.py | Python | gpl-2.0 | 5,489 |
import codecs
def funct(f_name):
"""Remove leading and trailing whitespace from file."""
f_read = codecs.open(f_name, 'r')
f_lines = f_read.readlines()
out_lines = map(str.strip, f_lines)
f_read.close()
while True:
o_write = raw_input("Create new file (c) or overwrite existing (o): ")... | AmandaMoen/AmandaMoen | students/MichelleRascati/funct.py | Python | gpl-2.0 | 1,535 |
# Copyright (c) Meta Platforms, Inc. and affiliates.
# Copyright (c) Mercurial Contributors.
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
from __future__ import absolute_import
from testutil.dott import feature, sh, testtmp #... | facebookexperimental/eden | eden/scm/tests/test-issue1438-t.py | Python | gpl-2.0 | 789 |
import pytest
from cfme.cloud.provider.azure import AzureProvider
from cfme.markers.env_markers.provider import ONE_PER_CATEGORY
from cfme.networks.views import BalancerView
from cfme.networks.views import CloudNetworkView
from cfme.networks.views import FloatingIpView
from cfme.networks.views import NetworkPortView
f... | RedHatQE/cfme_tests | cfme/tests/networks/test_tag_tagvis.py | Python | gpl-2.0 | 3,856 |
import unittest
from mock import Mock, patch
from expyrimenter import Executor
from expyrimenter.runnable import Runnable
from subprocess import CalledProcessError
from concurrent.futures import ThreadPoolExecutor
import re
class TestExecutor(unittest.TestCase):
output = 'TestExecutor output'
outputs = ['Tes... | cemsbr/expyrimenter | tests/test_executor.py | Python | gpl-3.0 | 4,989 |
from django.contrib import admin
# Register your models here.
from .models import Environment,EnvironmentAdmin,Component,ComponentAdmin,Environment_property,Environment_propertyAdmin,Component_attribute,Component_attributeAdmin
admin.site.register(Environment,EnvironmentAdmin)
admin.site.register(Component,Component... | wdq007/supreme-garbanzo | fkkenv/fukoku/env/admin.py | Python | gpl-3.0 | 461 |
# This file is part of HDL Checker.
#
# Copyright (c) 2015 - 2019 suoto (Andre Souto)
#
# HDL Checker 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 ... | suoto/hdlcc | setup.py | Python | gpl-3.0 | 3,321 |
#
# -*- coding: utf-8 -*-
#
# pyllage
#
# Copyright (C) 2013 barisumog at 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 3 of the License, or
# (at your option) any l... | barisumog/pyllage | pyllage/parser.py | Python | gpl-3.0 | 2,264 |
# Copyright 2012, Tim Bielawa <tbielawa@redhat.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 the License, or
# (at your option) any later... | 2ndQuadrant/ansible | lib/ansible/plugins/action/pause.py | Python | gpl-3.0 | 10,780 |
import os
import unittest
from vsg.rules import package
from vsg import vhdlFile
from vsg.tests import utils
sTestDir = os.path.dirname(__file__)
lFile, eError =vhdlFile.utils.read_vhdlfile(os.path.join(sTestDir,'rule_001_test_input.vhd'))
dIndentMap = utils.read_indent_file()
lExpected = []
lExpected.append('')
... | jeremiah-c-leary/vhdl-style-guide | vsg/tests/package/test_rule_001.py | Python | gpl-3.0 | 1,229 |
import requests
import xml.etree.ElementTree as ET
from time import sleep
class QualysAPI:
"""Class to simplify the making and handling of API calls to the Qualys platform
Class Members
=============
server : String : The FQDN of the API server (with https:// prefix)
user : S... | Qualys/community | scan-blackout/QualysAPI.py | Python | gpl-3.0 | 8,803 |
# -*- coding: utf-8 -*-
__author__ = 'Patrick Michl'
__email__ = 'frootlab@gmail.com'
__license__ = 'GPLv3'
import nemoa
import numpy
class Links:
"""Class to unify common ann link attributes."""
params = {}
def __init__(self): pass
@staticmethod
def energy(dSrc, dTgt, src, tgt, links, calc = ... | fishroot/nemoa | nemoa/system/commons/links.py | Python | gpl-3.0 | 1,111 |
#!/usr/bin/python
import glob
import os.path
import re
import hashlib
from bs4 import BeautifulSoup
from subprocess import call, Popen, PIPE, STDOUT
root = "/home/alex/tidalcycles.github.io/_site/"
dnmatcher = re.compile(r'^\s*d[0-9]\s*(\$\s*)?')
crmatcherpre = re.compile(r'^[\s\n\r]*')
crmatcherpost = re.compile(r'[... | tidalcycles/tidalcycles.github.io | bin/build_examples.py | Python | gpl-3.0 | 1,514 |
# This file is part of Codetrawl
# Copyright (C) 2015 Nathaniel Smith <njs@pobox.com>
# See file LICENSE.txt for license information.
"""Usage:
codetrawl.dump PATTERN FILE [FILE...]
where PATTERN is a Python format string like "{raw_url}", with allowed keys:
- service
- query
- repo
- path
- raw_url
- c... | njsmith/codetrawl | codetrawl/dump.py | Python | gpl-3.0 | 587 |
# -*- coding: utf-8 -*-
# Copyright © 2014-2018 GWHAT Project Contributors
# https://github.com/jnsebgosselin/gwhat
#
# This file is part of GWHAT (Ground-Water Hydrograph Analysis Toolbox).
# Licensed under the terms of the GNU General Public License.
# Standard library imports :
import platform
# Third party impo... | jnsebgosselin/WHAT | gwhat/common/styles.py | Python | gpl-3.0 | 1,792 |
import unittest
import wire
class TestSQLString(unittest.TestCase):
def setUp(self):
'''Sets up the test case'''
self.sql = wire.SQLString
def test_pragma(self):
'''Tests the PRAGMA SQL generation'''
self.assertEqual(self.sql.pragma("INTEGRITY_CHECK(10)"), "PRAGMA INTEGRITY_CHECK(10)")
self.assertEqual(s... | panchr/wire | wire/tests/sqlstring_test.py | Python | gpl-3.0 | 1,665 |
###
# Copyright (c) 2004-2005, Kevin Murphy
# 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 notice,
# this list of condit... | kg-bot/SupyBot | plugins/UrbanDict/plugin.py | Python | gpl-3.0 | 4,100 |