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 |
|---|---|---|---|---|---|
import os
from enigma import eConsoleAppContainer
from Components.Harddisk import harddiskmanager
from Components.config import config
from shutil import rmtree
from boxbranding import getImageDistro, getImageVersion
opkgDestinations = []
opkgStatusPath = ''
def opkgExtraDestinations():
global opkgDestinations
retu... | kingvuplus/italysat-enigma2 | lib/python/Components/Ipkg.py | Python | gpl-2.0 | 7,385 |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
GTFS manager - (C) 2015 by geOps
A cache will be build in the GTFS directories, containing the valid period of GTFS feeds.
Usage:
gtfsman.py [list | status | show] [--active | -a] [--notactive | -n] [--checkremotedate] [--base-folder=<path>]
gtfsman.py show <fee... | geops/gtfsman | gtfsman.py | Python | gpl-2.0 | 19,633 |
#
# SPDX-License-Identifier: MIT
#
import os
import shutil
import unittest
from oeqa.selftest.case import OESelftestTestCase
from oeqa.selftest.cases.buildhistory import BuildhistoryBase
from oeqa.utils.commands import Command, runCmd, bitbake, get_bb_var, get_test_layer
from oeqa.utils import CommandError
class Buil... | schleichdi2/OPENNFR-6.3-CORE | opennfr-openembedded-core/meta/lib/oeqa/selftest/cases/oescripts.py | Python | gpl-2.0 | 5,409 |
from MaKaC.common.general import *
from MaKaC.webinterface import pages
if DEVELOPEMENT:
pages = reload(pages)
def index(req, **params):
p = pages.WPLinkDataModification( req )
params["postURL"] = "linkDataModification.py/modify"
return p.display(params)
def modify( req, **params ):
p = pages.W... | belokop-an/agenda-tools | code/htdocs/linkDataModification.py | Python | gpl-2.0 | 392 |
from __future__ import unicode_literals
import unittest
from datetime import timedelta, datetime
from nav.django.templatetags.info import (time_since,
is_max_timestamp,
get_attr, find_attr)
class DummyObject(object):
def __init_... | sigmunau/nav | tests/unittests/templatetags/template_tags_test.py | Python | gpl-2.0 | 3,314 |
#!/usr/bin/env python
def swap(list, i, j):
list[i], list[j] = list[j], list[i]
def splitByLastElement(list, left, right, trace = False):
return right
def splitByMiddleElement(list, left, right, trace = False):
return left + (right - left)/2
def splitByMedian(list, left, right, trace = False):
if t... | alvin777/excelsior | sort/quick_sort.py | Python | gpl-2.0 | 3,233 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
class Color(object):
''' Helper object for easily printing colored text to the terminal. '''
# Basic console colors
colors = {
'W' : '\033[0m', # white (normal)
'R' : '\033[31m', # red
'G' : '\033[32m', # green
'O' ... | derv82/wifite2 | wifite/util/color.py | Python | gpl-2.0 | 3,851 |
# -*- coding: utf-8 -*-
"""
uds.data.commit
~~~~~~~~~~~~~~~
:copyright: Copyright (c) 2015, National Institute of Information and Communications Technology.All rights reserved.
:license: GPL2, see LICENSE for more details.
"""
import re
import copy
import json
import hashlib
import dateutil.parser
import datetime
impo... | nict-isp/uds-sdk | uds/data/commit.py | Python | gpl-2.0 | 2,496 |
"""
Copyright (C) 2014, Web Bender Consulting, LLC. - All Rights Reserved
Unauthorized copying of this file, via any medium is strictly prohibited
Proprietary and confidential
Written by Elijah Ethun <elijahe@gmail.com>
"""
from Sven.Module.System.Base import Base
from Sven.Methods import *
class MP3Player(Base) :
... | yarhajile/sven-daemon | Sven/Module/System/MP3Player.py | Python | gpl-2.0 | 2,714 |
# -*- coding: utf-8 -*-
# This file is part of TextVentures - https://github.com/RMed/textventures
#
# Copyright (C) 2013 Rafael Medina García <rafamedgar@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... | rmed/textventures | src/textventures/__init__.py | Python | gpl-2.0 | 930 |
# Borrowed from: https://github.com/glue-viz/glue/blob/master/setup.py
# Copyright (c) 2013, Glue developers
import os
import subprocess
import sys
from glob import glob
from setuptools import Command
class BuildQt(Command):
"""
Defines a command for setup.py that compiles the *.ui and *.qrc files
into ... | ivanalejandro0/spotimute | buildqt.py | Python | gpl-2.0 | 2,559 |
# six_led_blink.py
# Author: Darrell Little
# Version: 0.1
# Date: 02/28/2015
# This simple program sets up GPIO pins 11,13,15, 16, 18 and 22 as OUT 3.3V
# Then inside a loop, turns on GPIO pin 11 (True)
# Waits and turns off GPIO pin 11 (False)
# Repeat for the other five pins
# Since the GPIO requires Admin permissio... | darrell24015/RPi | six_led_blink.py | Python | gpl-2.0 | 1,173 |
#!/usr/bin/env python
# Author: Dan Walsh <dwalsh@redhat.com>
import os
from distutils.core import setup
setup(name = "atomic", scripts=["atomic"], version="1.0", description="Atomic Management Tool", author="Daniel Walsh", author_email="dwalsh@redhat.com")
| cgwalters/atom | setup.py | Python | gpl-2.0 | 260 |
## begin license ##
#
# "Meresco Html" is a template engine based on generators, and a sequel to Slowfoot.
# It is also known as "DynamicHtml" or "Seecr Html".
#
# Copyright (C) 2005-2010 Seek You Too B.V. (CQ2) http://www.cq2.nl
# Copyright (C) 2011-2014, 2020-2021 Seecr (Seek You Too B.V.) https://seecr.nl
# Copyrigh... | seecr/meresco-html | test/login/securezonetest.py | Python | gpl-2.0 | 5,556 |
# -*- coding: utf-8 -*-
import sys
import os
import random
import time
import traceback
import xml.etree.ElementTree as ET
import xbmc
import xbmcaddon
import xbmcgui
import xbmcvfs
if sys.version_info >= (2, 7):
import json
else:
import simplejson as json
__addon__ = xbmcaddon.Addon(id='sc... | gdomenici/screensaver.video | screensaver.py | Python | gpl-2.0 | 29,376 |
import wx
from configtool.data import BSIZESMALL, reFloat, offsetChLabel, offsetTcLabel
class CalcScrew(wx.Dialog):
def __init__(self, parent, font, cbUse):
wx.Dialog.__init__(
self,
parent,
wx.ID_ANY,
"Steps calculator for screw driven axes",
si... | Traumflug/Teacup_Firmware | configtool/calcscrew.py | Python | gpl-2.0 | 9,429 |
from setuptools import setup
setup(
name = 'git-extensions',
author = 'Peter Raboud',
author_email = 'praboud@gmail.com',
version = '0.1',
description = 'Various git extensions implemented in python',
scripts = ['bin/git-recent'],
install_requires = ['pygit2', 'colorama'],
)
| praboud/git-extensions | setup.py | Python | gpl-2.0 | 290 |
import numpy as np
mR = np.array([[-1,-1,-1,-1,0,-1],
[-1,-1,-1,0,-1,100],
[-1,-1,-1,0,-1,-1],
[-1,0,0,-1,0,-1],
[0,-1,-1,0,-1,100],
[-1,0,-1,-1,0,100]])
#rows are states, columns are actions
#row 1, column 1 = taking action 1 at state 1
#initialize matrix Q to zero.
mQ = np.zeros((6,... | Nixonite/Q-Learning-Tutorial-Code | main.py | Python | gpl-2.0 | 2,037 |
#!python3
# -*- coding: utf-8 -*-
'''
Created on Sep 22, 2016
Modified on Oct 04, 2016
Version 0.03.ga
@author: rainier.madruga@gmail.com
A simple Python Program to scrape the ESPN FC website for content.
'''
# Import Libraries needed for Scraping the various web pages
import bs4
import re
import datetime
import time
... | rainier-m/python-soccer | parseStats.py | Python | gpl-2.0 | 4,417 |
# -*- coding: utf-8 -*-
from collective.polls.testing import ROBOT_TESTING
from plone.testing import layered
import os
import robotsuite
import unittest
dirname = os.path.dirname(__file__)
files = os.listdir(dirname)
tests = [f for f in files if f.startswith('test_') and f.endswith('.robot')]
def test_suite():
... | loechel/lmu.contenttypes.polls | src/lmu/contenttypes/polls/tests/test_robot.py | Python | gpl-2.0 | 543 |
from urllib import quote_plus
from sqlalchemy import create_engine
#db_url = 'DRIVER={FreeTDS};Server=192.168.56.1\\sql2008;Database=gaji_pbg;UID=sa;PWD=sa;Port=1433;TDS_Version=8.0'
#print(db_url)
#db_url = 'DSN=SQLServer2008;Database=gaji_pbg;UID=sa;PWD=sa'
db_url = 'DSN=SQLServer2008;UID=sa;PWD=sa'
db_url = quote_... | aagusti/e-gaji | docs/test-conn.py | Python | gpl-2.0 | 450 |
"""
>>> import const
>>> const.MYCONST = 3
"""
class _CONSTANT(object):
"""The CONSTANT class allows for constants in Python"""
class ConstError(TypeError):
"""Genetic CONSTANT exception class"""
pass
def __setattr__(self, name, value):
if self.__dict__.has_key(name):
... | nima/insecurity | pylib/CONST.py | Python | gpl-2.0 | 628 |
# Copyright (C) 2008-2011 Dejan Muhamedagic <dmuhamedagic@suse.de>
# Copyright (C) 2013 Kristoffer Gronlund <kgronlund@suse.com>
# See COPYING for license information.
import os
import re
import shlex
from . import command
from . import completers as compl
from . import utils
from . import config
from . import userdir... | ClusterLabs/crmsh | crmsh/ui_template.py | Python | gpl-2.0 | 12,377 |
from fabric.api import *
from fabric.colors import red, blue, cyan
# televox.com git automation
# we move a bundle from the main repo out to production.
# login to prod, and pull from the bundle
# usage - fab tvx3936 git_bundle linux2543 deploy
BTS_THEME_PATH = "/home/alanw/www/beyondthesite/webvox/wp-content/themes... | AlanWarren/dotfiles | from_work/deploy/beyondthesite/fabfile.py | Python | gpl-2.0 | 1,923 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.common.exceptions import NoSuchElementException
from selenium.common.exceptions import Element... | oburdin/wdays | pages/general_page.py | Python | gpl-2.0 | 2,666 |
#!/Users/Rad/anaconda/bin/python
# (c) 2013 Ryan Boehning
'''A Python implementation of the Smith-Waterman algorithm for local alignment
of nucleotide sequences.
'''
import argparse
import os
import re
import sys
import unittest
# These scores are taken from Wikipedia.
# en.wikipedia.org/wiki/Smith%E2%80%93Waterm... | ruohoruotsi/Wavelet-Tree-Synth | gists/SmithWaterman.py | Python | gpl-2.0 | 8,259 |
#base server -chapter 3- basicserver.py
import socket
host = ''
port = 51423
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
s.bind((host, port))
print('waiting for connection....')
s.listen(1)
while True:
clientsock, clientaddr = s.accept()
print... | jiangfire/python-network-py3code | chapter3/basicserver.py | Python | gpl-2.0 | 392 |
#!/usr/bin/env python
from ctypes import c_int, byref
import pylibftdi
pylibftdi.USB_VID_LIST.append(0x0000)
NEW_VID = 0x0000 # FT2232H: 0x0403
NEW_PID = 0x6010 # FT2232H: 0x6010
VENDOR_ID_FIELD = 0
PRODUCT_ID_FIELD = 1
def main():
"""
Write the NEW_VID and NEW_PID to any detected FTDI device's eeprom.
"""
... | ihartwig/ftditerm | ftdi_usb_program.py | Python | gpl-2.0 | 1,626 |
#!/usr/bin/env python
def strsum(a, b):
return (a + ' ' + b) | devkim77/pythontest | mod2.py | Python | gpl-2.0 | 62 |
### Copyright (C) 2002-2006 Stephen Kennedy <stevek@gnome.org>
### Copyright (C) 2009, 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 ... | kaiw/meld | meld/diffutil.py | Python | gpl-2.0 | 18,646 |
"""
A TestRunner for use with the Python unit testing framework. It
generates a HTML report to show the result at a glance.
The simplest way to use this is to invoke its main method. E.g.
import unittest
import HTMLTestRunner
... define your tests ...
if __name__ == '__main__':
HTMLTestRunne... | skylina/test | public/HTMLTestRunner.py | Python | gpl-2.0 | 25,585 |
#!/usr/bin/env python
''' Optimization objective and constraints for 2x2 MIMO minimal power allocation with DTX. See my papers for details.
File: optimMinPow2x2DTX.py
'''
__author__ = "Hauke Holtkamp"
__credits__ = "Hauke Holtkamp"
__license__ = "unknown"
__version__ = "unknown"
__maintainer__ = "Hauke Holtkamp"
__e... | ryklith/pyltesim | optim/optimMinPow2x2DTX.py | Python | gpl-2.0 | 4,906 |
from unittest import TestCase
from functions.eval import eval_str
from modules.builtins import create_builtins_module
from wtypes.boolean import WBoolean
from wtypes.control import WRaisedException
from wtypes.exception import WException
class WAssertTest(TestCase):
def test_assert_raises_exception_on_false(sel... | izrik/wodehouse | tests/macros/assert_/assert_tests.py | Python | gpl-2.0 | 1,590 |
# 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 the hope that it will be useful,
# bu... | edynox/dnf | dnf/rpm/miscutils.py | Python | gpl-2.0 | 2,281 |
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2007 Donald N. Allingham
# Copyright (C) 2015,2017 Nick Hall
#
# 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... | ennoborg/gramps | gramps/gen/lib/placename.py | Python | gpl-2.0 | 6,000 |
from SimpleTextField import SimpleTextField
class DateField(SimpleTextField):
'''A field value that represents a date'''
def __init__(self, text_name):
super(DateField, self).__init__(text_name)
| shearern/python-text-objects | src/txtobjs/schema/DateField.py | Python | gpl-2.0 | 215 |
#!/usr/bin/env python
# -*- coding: utf8 -*-
"""
7C4A8D09CA3762AF61E59520943DC26494F8941B:20760336 = 123456
F7C3BC1D808E04732ADF679965CCC34CA7AE3441:7016669
B1B3773A05C0ED0176787A4F1574FF0075F7521E:3599486 = qwerty
5BAA61E4C9B93F3F0682250B6CF8331B7EE68FD8:3303003 = password
3D4F2BF07DC1BE38B20CD6E46949A1071F9D0E3D:290... | EC-software/EC_stuff | passw_leak/src/isthisclean.py | Python | gpl-2.0 | 1,601 |
import sys
from PyQt4 import QtGui
from PyQt4 import QtCore
_sf_camera_action_instance = None
#Singleton Magic
def SFCameraActions(*args, **kw):
global _sf_camera_action_instance
if _sf_camera_action_instance is None:
_sf_camera_action_instance = _SFCameraActions(*args, **kw)
return _sf_camera_act... | CospanDesign/nysa-gui | NysaGui/host/sf_camera_controller/sf_camera_actions.py | Python | gpl-2.0 | 685 |
#!/usr/bin/env python
import psycopg2
import config
from ia_parse import ParseArchiveData, clean_string
NUM_ROWS = 1000
try:
conn = psycopg2.connect(config.PG_CONNECT)
conn2 = psycopg2.connect(config.PG_CONNECT)
except psycopg2.OperationalError as err:
print "Cannot connect to database: %s" % err
sys... | mayhem/ia_matcher | misc/update_track_counts.py | Python | gpl-2.0 | 1,057 |
from __future__ import with_statement
import os
import codecs
from django.core.files.base import ContentFile
from django.template import Context
from django.template.loader import render_to_string
from django.utils.encoding import smart_unicode
from compressor.cache import get_hexdigest, get_mtime
from compressor.co... | bop/foundation | lib/python2.7/site-packages/compressor/base.py | Python | gpl-2.0 | 10,354 |
# -*- coding: utf-8 -*-
# Discovery Plugin
#
# Copyright (C) 2020 Lutra Consulting
# info@lutraconsulting.co.uk
#
# 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... | lutraconsulting/qgis-discovery-plugin | Discovery/utils.py | Python | gpl-2.0 | 557 |
"""Implement special border conditions for molecular dynamics."""
#import weakref
# ase.parallel imported in __init__
class Freeze:
"""Class for freezing atoms close to computation cell
in molecular dynamics simulations.
Parameters:
atoms: The atoms.
margin: define freezine region ... | lavakyan/ase-bimetall | borders.py | Python | gpl-2.0 | 2,791 |
from app.models import Music, Vote
import lib.spotify as spotify
class UpdateMusicMiddleware(object):
def process_request(self, request):
query = Music.objects.all()
request.current_music = spotify.music_name()
if not request.current_music:
raise Exception('Unable to get curre... | arthaud/spotify-next | app/middleware.py | Python | gpl-2.0 | 607 |
#!/usr/bin/env python
# Renova Backup
# -------------
# By Fabricio Kury -- fabriciokury@gmail.com -- github.com/fabkury
# Coding start: Somewhere around april/2014.
# -
# Description:
# A very small file move and versioning utility. The intended use case
# for this program is to continuously watch for and move increme... | fabkury/RB | rb.py | Python | gpl-2.0 | 11,781 |
# 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 the hope that it will be useful,
# bu... | avocado-framework/avocado-vt | avocado_vt/utils.py | Python | gpl-2.0 | 8,127 |
from src.server.agents.agents import agents
class digital_agent(agents):
def __init__(self, agent_data):
self.cpt = 0
agents.__init__(self, agent_data)
def value(self):
value_read = self.pin.read()
value_to_return = ""
if value_read is not None and value_read != "":
value_to_return = str(value_read)
... | EPSI-Hestia/Hestia | src/server/agents/digital/digital_agent.py | Python | gpl-2.0 | 344 |
#!/usr/bin/env python
from __future__ import division
import sys, os, re
import numpy as np
import readnew
from glob import glob
import yaml
filename = sys.argv[1]
N = sys.argv[2] # the number of atoms.
savename = 'None';
if len(sys.argv) == 4:
savename = sys.argv[3] # optional name of file when saving
elif len(s... | droundy/deft | papers/histogram/figs/parse-ising-out.py | Python | gpl-2.0 | 1,940 |
from copy import copy
import sys
__submodules__ = [
'finite_difference',
'derivative',
'derivative_tensor',
'displacement_manager',
'forcefield',
'displacement'
]
__all__ = [
]
for name in __submodules__:
__import__(__name__ + "." + name)
m = sys.modules[__name__ + "." + name]
gl... | spring01/libPSI | lib/python/grendel/differentiation/__init__.py | Python | gpl-2.0 | 722 |
# -*- coding: utf-8 -*-
"""
***************************************************************************
hugeFileGroundClassify.py
---------------------
Date : May 2014
Copyright : (C) 2014 by Martin Isenburg
Email : martin near rapidlasso point com
********... | luca76/QGIS | python/plugins/processing/algs/lidar/lastools/hugeFileGroundClassify.py | Python | gpl-2.0 | 5,142 |
# ============================================================================
#
# Copyright (C) 2007-2010 Conceptive Engineering bvba. All rights reserved.
# www.conceptive.be / project-camelot@conceptive.be
#
# This file is part of the Camelot Library.
#
# This file may be used under the terms of the GNU General... | kurtraschke/camelot | camelot/view/controls/delegates/richtextdelegate.py | Python | gpl-2.0 | 2,181 |
# -*- coding: utf-8 -*-
import json
class ComplexJsonEncoder(json.JSONEncoder):
def default(self, obj):
if isinstance(obj, datetime): #格式化日期时间型
return obj.strftime('%Y-%m-%d %H:%M:%S')
elif isinstance(obj, date): #格式化日期型
return obj.strftime('%Y-... | chenss/ChatRoom | 6 自定义Enter或Ctrl+Enter发送/ComplexJsonEncoder.py | Python | gpl-2.0 | 438 |
# encoding: utf-8
# module PyQt4.QtGui
# from /usr/lib/python3/dist-packages/PyQt4/QtGui.cpython-34m-x86_64-linux-gnu.so
# by generator 1.135
# no doc
# imports
import PyQt4.QtCore as __PyQt4_QtCore
from .QStyleOption import QStyleOption
class QStyleOptionComplex(QStyleOption):
"""
QStyleOptionComplex(int v... | ProfessorX/Config | .PyCharm30/system/python_stubs/-1247971765/PyQt4/QtGui/QStyleOptionComplex.py | Python | gpl-2.0 | 799 |
# -*- coding: utf8 -*-
"""
eventlogging unit tests
~~~~~~~~~~~~~~~~~~~~~~~
This module contains tests for :module:`eventlogging.jrm`.
"""
from __future__ import unicode_literals
import datetime
import unittest
import eventlogging
import sqlalchemy
from .fixtures import DatabaseTestMixin, TEST_SCHEMA_SCID
c... | legoktm/wikihow-src | extensions/EventLogging/server/tests/test_jrm.py | Python | gpl-2.0 | 3,231 |
#
# Gramps - a GTK+/GNOME 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 you... | arunkgupta/gramps | gramps/gen/filters/rules/place/_matchesfilter.py | Python | gpl-2.0 | 1,668 |
import cellprofiler.icons
from cellprofiler.gui.help import PROTIP_RECOMEND_ICON
__doc__ = '''
<b>Calculate Image Overlap </b> calculates how much overlap occurs between the white portions of two black and white images
<hr>
This module calculates overlap by determining a set of statistics that measure the closeness of... | sstoma/CellProfiler | cellprofiler/modules/calculateimageoverlap.py | Python | gpl-2.0 | 50,378 |
from pip._vendor.pkg_resources import to_filename
__author__ = 'smithg'
from scrapy.contrib.spiders import CrawlSpider
from scrapy.selector import Selector
from ..items import VbForum
from urlparse import urlparse, parse_qs
class VbForumSpider(CrawlSpider):
name = "s2forum_forum"
def __init__(self, domain="w... | GregUK/vb3_7_scraper | vb3_7_0_reader/spiders/forumlist.py | Python | gpl-2.0 | 1,395 |
# A comment, this is so you can read your program later.
# Anything after the # is ignored by python.
print "I could have code like this." # and the comment after is ignored
# You can also use a comment to "disable" or comment out a piece of code:
# print "This won't run."
print "This # will run." | jimmod/learnpythonthehardway | ex2.py | Python | gpl-2.0 | 301 |
# -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# ------------------------------------------------------... | crossroadchurch/paul | openlp/core/common/__init__.py | Python | gpl-2.0 | 7,560 |
# -*- coding: utf-8 -*-
#
# MDT documentation build configuration file, created by
# sphinx-quickstart on Sun Dec 14 11:15:19 2008.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# The contents of this file are pickled, so don't put values in the namespace
# that aren't pickleable ... | salilab/mdt | doc/conf.py | Python | gpl-2.0 | 6,799 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# This script is not licensed under LICENSE file and is ALL RIGHT RESERVED.
import pywikibot
import MySQLdb
conn = MySQLdb.connect(
read_default_file = "/data/project/revibot-ii/replica.my.cnf",
host = "kowiki.analytics.db.svc.eqiad.wmflabs",
db = "kowiki_p",
)
c... | revi/revibot | unblock.py | Python | gpl-2.0 | 1,542 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import piksemel
from bugspy.error import ParseError, BugzillaError
from bugspy.constants import Constants as constants
class BugStruct(object):
"""A container which can be accessed like class objects
f = BugStruct(foo="bar", baz="heh", bug=BugStruct("id": 1))
f.s... | eren/bugspy | bugspy/bugparser.py | Python | gpl-2.0 | 6,695 |
# process.py: Multiple process module
#
# Copyright (C) 2010-2012 Red Hat, Inc.
#
# libvirt-test-API 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... | libvirt/libvirt-test-API | libvirttestapi/src/process.py | Python | gpl-2.0 | 1,396 |
# -*- coding: utf-8 -*-
"""
/***************************************************************************
DsgTools
A QGIS plugin
Brazilian Army Cartographic Production Tools
-------------------
begin : 2018-05-01
git sha ... | lcoandrade/DsgTools | core/GeometricTools/featureHandler.py | Python | gpl-2.0 | 18,850 |
#!/usr/bin/env python
import readline
import os
class CloseGame(Exception):
pass
def quit(context):
raise CloseGame(context)
def play(context):
context['score'] += 1
if __name__ == '__main__':
context = {'score': 0}
os.system('clear')
try:
while True:
try:
... | satishgoda/programmingusingpython | sandbox/april2014/game/prototype.py | Python | gpl-2.0 | 958 |
# encoding: utf-8
# module PyQt4.QtGui
# from /usr/lib/python3/dist-packages/PyQt4/QtGui.cpython-34m-x86_64-linux-gnu.so
# by generator 1.135
# no doc
# imports
import PyQt4.QtCore as __PyQt4_QtCore
from .QAbstractProxyModel import QAbstractProxyModel
class QSortFilterProxyModel(QAbstractProxyModel):
""" QSortF... | ProfessorX/Config | .PyCharm30/system/python_stubs/-1247971765/PyQt4/QtGui/QSortFilterProxyModel.py | Python | gpl-2.0 | 11,475 |
#! /usr/bin/env python
###############################################################################
#
# simulavr - A simulator for the Atmel AVR family of microcontrollers.
# Copyright (C) 2001, 2002 Theodore A. Roth
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of th... | chrta/simulavr | regress/test_opcodes/test_ST_Y_incr.py | Python | gpl-2.0 | 2,885 |
from earyx.experiments import AFCExperiment
from earyx.order import Sequential
from earyx.utils import gensin, rms
import numpy as np
import earyx
class SineInNoise(AFCExperiment, Sequential):
def init_experiment(self, exp):
exp.add_parameter("noise_level", [-40, -60], 'dB')
exp.set_variable("sine... | TGM-Oldenburg/earyx | earyx/experiments/sine_in_noise.py | Python | gpl-2.0 | 1,262 |
# coding: utf-8
from sqlalchemy import BigInteger, Column, DateTime, Float, ForeignKey, Integer, String
from sqlalchemy.orm import relationship
#from api.ODM2 import modelBase as Base
from ..Core.model import Result, Unit, Taxonomicclassifier, Base
from ..SamplingFeatures.model import Spatialreference
class Pointcov... | Castronova/EMIT | api_old/ODM2/Results/model.py | Python | gpl-2.0 | 20,575 |
from random import randint
from ..libraries import rollDices, randomStats
realms = {
'kingslanding': {
'defense': 5,
'influence': -5,
'lands': -5,
'law': 20,
'population': 5,
'power': -5,
'wealth': -5
},
'dragonstone': {
'defense': 20,
... | ondoheer/GOT-Platform | app/houses/housesGenerator.py | Python | gpl-2.0 | 10,081 |
import optparse
def parse_command_line():
"""
parse command parse command line
"""
parser = optparse.OptionParser()
parser.add_option(
"--list", help="channel list", default=None,
type=str)
params, args = parser.parse_args()
return params
params = parse_command_line()
subs... | pmeyers279/stamp_pem | bin/convert_ascii_channels_to_ini.py | Python | gpl-2.0 | 1,771 |
"""
Compartimented optimization
LC 13/05/2015
"""
import numpy as np
import matplotlib.pyplot as plt
import compmod, abapy, platform
from scipy import optimize, interpolate
#-------------------------------------------------------------------------------
# FUNCTIONS AND CLASSES
def Saint_Venant(X):
sy_mean = X[0]
... | lcharleux/compmod | doc/sandbox/awa/opti_compart_awa.py | Python | gpl-2.0 | 7,585 |
# -*- coding: utf-8 -*-
#
# This file is part of CERN Document Server.
# 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 opti... | drjova/cds-demosite | cds/modules/records/serializers/schemas/json/common.py | Python | gpl-2.0 | 3,942 |
# -*- coding: utf-8 -*-
from openerp.osv import fields, osv
class res_partner(osv.osv):
_inherit = 'res.partner'
_sql_constraints = [
# Empty constraint, complemented by unique index (see below)
# Still useful to keep sql constraints because it provides a proper error message when a violation... | 3dfxsoftware/cbss-addons | company_unique-master/partner.py | Python | gpl-2.0 | 1,015 |
# this function is suitable for "symmetric_hetero_toughening"
# TO flip the affected_up and affected_down element list with symmetric feature
# Test with Test_raw.inp
# effect to 1,2,3,4
# 5,6,7,8
# 9,10,11,12
# Flip to 9,10,11,12
# 5,6,7,8
# 1,2,3,4
# # ----------------- Example--------------------#
# impo... | wangz19/TEST | Abaqus_postProcessing/Modified Inp/flip element/Flip.py | Python | gpl-2.0 | 2,393 |
import pygame
from tile_editor import Tile
from tileset_editor import Tileset
from enemigo_editor import Enemigo
class Mapa(object):
def __init__(self):
# Tilesets (surfaces)
self.tileset1 = Tileset("res/tileset_suelos1.png", 32, 32).cortar_tileset()
self.tileset2 = Tileset("res/tileset_p... | damasko/editor-de-mapas-pygame | src/mapa_editor.py | Python | gpl-2.0 | 20,827 |
import smu
def linspace(initial, final, n = 100):
if n>=2:
increment = (float(final) - float(initial))/(n - 1)
return [float(initial) + i*increment for i in range(n)]
else:
return []
s = smu.smu()
v = linspace(0, 5, 501)
f = open('experiment2temp.csv', 'w')
f.write('"Vgate","Ichannel"\... | dimitdim/ElectronAdventures | lab6/experiment1single.py | Python | gpl-2.0 | 535 |
from django.core.exceptions import FieldError
from django.core.urlresolvers import reverse
from django.http import Http404, HttpResponseRedirect
from django.shortcuts import render, get_object_or_404
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from django.views.decorators.http import requir... | RaghavPro/Runescape-Hiscores | hiscores/views.py | Python | gpl-2.0 | 5,051 |
# Copyright (C) 2016 Arvid Fahlström Myrman
#
# 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 distr... | arvidfm/masters-thesis | src/nn/trainers.py | Python | gpl-2.0 | 8,766 |
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2010 Michiel D. Nauta
#
# 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... | Forage/Gramps | gramps/gui/merge/mergenote.py | Python | gpl-2.0 | 7,231 |
"""This module contains the Zone class.
Zones represent a network.
"""
from pyptables.base import DebugObject
from pyptables.rules.arguments import ArgumentList
from pyptables.rules.matches import Match
class Zone(DebugObject):
"""Represents a network"""
def __init__(self, name, interface, physde... | daggaz/python-pyptables | pyptables/rules/forwarding/zones.py | Python | gpl-2.0 | 1,388 |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2014, 2015 CERN.
#
# Invenio is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any... | tiborsimko/invenio-workflows | tests/test_workflows_others.py | Python | gpl-2.0 | 3,362 |
import unittest
import os
from src.disassembler.SidDisassembler import SidDisassembler
from src.disassembler.SidCommon import AddressModes
class SidDisassemblerTest(unittest.TestCase):
HEADER_SIZE = 124
OFFSET_SIZE = 2
def setUp(self):
self.testFileName = "testfile"
self.createSidFile()
... | tobal/disassembler-6510 | tests/SidDisassemblerTest.py | Python | gpl-2.0 | 2,989 |
__author__ = 'nathan.woodrow'
import logging
import sys
def excepthook(errorhandler, exctype, value, traceback):
errorhandler(exctype, value, traceback)
logger.debug("Uncaught exception", exc_info=(exctype, value, traceback))
LOG_FILENAME = 'roam-roam_tests.log'
log_format = '%(levelname)s - %(asctime)s - %(... | DMS-Aus/Roam | src/roam_tests/__main__.py | Python | gpl-2.0 | 978 |
from tools.load import LoadMatrix
lm = LoadMatrix()
data = lm.load_numbers('../data/fm_train_real.dat')
parameter_list = [[data, 12]]
def converter_stochasticproximityembedding_modular(data, k):
from shogun.Features import RealFeatures
from shogun.Converter import StochasticProximityEmbedding, SPE_GLOBAL, SPE_LOCA... | ratschlab/ASP | examples/undocumented/python_modular/converter_stochasticproximityembedding_modular.py | Python | gpl-2.0 | 814 |
import itertools
import os
import glob
import re
from bs4 import BeautifulSoup
import constants
import utils
# Given the subtitles folder, this fun merges together subtitles of the same film that are divided into multiple CDs
# All the subtitles (.srt format) are filtered in order to keep only the text
def merge_su... | ShadowTemplate/ScriBa | subs_cleaner.py | Python | gpl-2.0 | 1,437 |
__author__ = 'firatlepirate'
import threading
import Queue
alfabe = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
# Gerekli inputlari istiyoruz
alfabe_key = input("Give me a number to make new alphabet: ")
count_thread = input("Give me a number to define n... | FiratGundogdu/dagitik | odev03/caesar_thread.py | Python | gpl-2.0 | 2,677 |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2.
import argparse
import logging
import os
import socket
import time
from libfb.py import log
from scubadata import ScubaData
def computecachesize(cach... | facebookexperimental/eden | eden/hg-server/hgcache_size_logger/hgcache_size_logger.py | Python | gpl-2.0 | 2,363 |
from readData import *
from imageshow import *
from kmeans import *
# MAIN PART
# read data from the multi databases
data3G1 = readData('../Databases/SimpleOCR/DB3/G1',False)
data3G2 = readData('../Databases/SimpleOCR/DB3/G2',False)
data2G1 = readData('../Databases/SimpleOCR/DB2/G1',False)
data2G2 = readData('../Dat... | felipecode/clustering_algo_py | K-Means/main.py | Python | gpl-2.0 | 952 |
# -*- coding: utf-8 -*-
import atexit
import json
import math
import os
import re
from collections import namedtuple
from datetime import date
from datetime import datetime
from datetime import timedelta
from math import ceil
from tempfile import NamedTemporaryFile
import six
from cached_property import cached_propert... | RedHatQE/cfme_tests | widgetastic_manageiq/__init__.py | Python | gpl-2.0 | 187,121 |
def test_filters_department_to_ones_with_active_shifts_for_current_event(factories, models):
old_event = factories.PastEventFactory()
active_event = factories.EventFactory()
department_a = factories.DepartmentFactory(name='dept-a')
department_b = factories.DepartmentFactory(name='dept-b')
role_a =... | Apogaea/voldb | tests/departments/models/test_department_filter_to_current_event.py | Python | gpl-3.0 | 765 |
# -*- coding: utf-8 -*-
"""
Git fixtures helpers
"""
from __future__ import unicode_literals
import os
from git import Repo
def commit(repo, message, author=None, date=None):
'''
create a Commit
'''
cwd = os.getcwd()
os.chdir(repo.working_dir)
# need to do a manual commit to allow empty ... | csanquer/git-app-version | test_helpers/git_utils.py | Python | gpl-3.0 | 2,293 |
# Created By: Virgil Dupras
# Created On: 2008-04-20
# Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
# This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
# which should be included with this package. The terms are also available at
# http://www.gnu.org/licenses/gpl... | stuckj/dupeguru | hscommon/currency.py | Python | gpl-3.0 | 26,502 |
#!/usr/bin/env python3
from . import AmazonS3
class S3KeywordsSummary(AmazonS3):
def store(self, node_args, flow_name, task_name, task_id, result):
object_key = "{ecosystem}/{name}.json".format(**node_args)
return self.store_dict(result, object_key)
| fridex/fabric8-analytics-worker | f8a_worker/storages/s3_keywords_summary.py | Python | gpl-3.0 | 273 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
'''
bandwidth-monitor - Network bandwidth monitor.
Copyright (c) 2006-2010 Kyle L. Huff (awn-bwm@curetheitch.com)
url: <http://www.curetheitch.com/projects/awn-bwm/>
Email: awn-bwm@curetheitch.com
This program is free software: you can redistribute it and/or modify
it ... | gilir/awn-extras-debian | applets/maintained/bandwidth-monitor/awn-bwm.py | Python | gpl-3.0 | 30,465 |
import os
import readline
import string
import sys
import mat
import random
from os import system
import re
## Set the key variables:
path_to_data = "Data/PGV.Bi/3D7.HB3/";
recomb_rate = 0.0001;
geno_rate = 0.001;
## Compile the C++ code:
line = "g++ $(pkg-config --cflags gsl) -c hmm.cpp";
os.system(line);
line = ... | vruano/maltools | resources/cross_report/Code/run.py | Python | gpl-3.0 | 874 |
#!/usr/bin/env python3
# Copyright 2009-2017 BHG http://bw.org/
words = ['one', 'two', 'three', 'four', 'five']
n = 0
while(n < 5):
print(words[n])
n += 1
| shucommon/little-routine | python/ex_files_python_esst/exercise_files/Chap02/while.py | Python | gpl-3.0 | 165 |
import tkinter
from enum import Enum
cells_horizontal_number = 15
cells_vertical_number = 15
cell_width = cell_height = 40
screen_width = cell_width*cells_horizontal_number
screen_height = cell_height*cells_vertical_number
sprite_number = 4
fps = 20 # количество кадров в секунду
sleep_time = round(1000/fps)
map_fil... | tkhirianov/fox_python_2016 | lesson_29/pacman.py | Python | gpl-3.0 | 8,401 |
# -*- encoding: utf-8 -*-
from abjad.tools.scoretools.Leaf import Leaf
class MultimeasureRest(Leaf):
'''A multimeasure rest.
::
>>> rest = scoretools.MultimeasureRest((1, 4))
>>> show(rest) # doctest: +SKIP
'''
### CLASS VARIABLES ###
__documentation_section__ = 'Leaves'
... | mscuthbert/abjad | abjad/tools/scoretools/MultimeasureRest.py | Python | gpl-3.0 | 1,033 |
#!/usr/bin/python3
import os
# custom imports
from PlaylistGenerator.PlaylistGenerator import PlaylistGenerator
class StaticPlaylistGenerator(PlaylistGenerator):
def __init__(self,musicPath,playlistMetrics,outputFile, duration, refreshDB = False):
super().__init__(musicPath,playlistMetrics, refreshDB)
self.outp... | wlemkens/playlist-generator | PlaylistGenerator/StaticPlaylistGenerator.py | Python | gpl-3.0 | 1,271 |
# Bash optparse
# Copyright (C) 2011 Carlo Baldassi (the "Author") <carlobaldassi@gmail.com>.
# 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; either version 3 of the Lic... | carlobaldassi/bash_optparse | src/bop_common.py | Python | gpl-3.0 | 1,033 |