code
stringlengths
6
947k
repo_name
stringlengths
5
100
path
stringlengths
4
226
language
stringclasses
1 value
license
stringclasses
15 values
size
int64
6
947k
#!/usr/bin/env python import sys from collections import defaultdict import itertools import operator from operator import itemgetter counters = defaultdict(int) trueCounters = defaultdict(int) fr = open('allworks','r') wc = 0 for line in fr: line = line.strip() words = ''.join(c for c in line if c.isalpha(...
fortesit/data-structure
Data Stream Algorithm/Heavy Hitters.py
Python
mit
1,605
from email.mime.text import MIMEText from smtplib import SMTP class Gmail(object): """Send an email with Google Mail Can easily be used with other providers by editing the server and port in send() Args: credentials (tuple): (username, password) """ def __init__(self, credentials): ...
alexanderteves/OpsBox
mail.py
Python
mit
937
""" Module which groups all the aggregated precomputed information in order to save computational power. """ import pandas as pd from FirmsLocations.Preprocess.preprocess_cols import cp2str def read_agg(filepath): "Read file of aggregated info." table = pd.read_csv(filepath, sep=';') table = cp2str(tabl...
tgquintela/Mscthesis
FirmsLocations/IO/io_aggfile.py
Python
mit
557
from ..style import use use("km3pipe-notebook")
tamasgal/km3pipe
km3pipe/style/km3pipe_notebook.py
Python
mit
49
from django.utils.translation import ugettext_lazy as _ugl default_app_config = 'django_sendgrid_parse.apps.DjangoSendgridParseAppConfig'
letops/django-sendgrid-parse
django_sendgrid_parse/__init__.py
Python
mit
139
"""User-friendly exception handler for swood.""" import http.client import traceback import sys import os __file__ = os.path.abspath(__file__) class ComplainToUser(Exception): """When used with ComplaintFormatter, tells the user what error (of theirs) caused the failure and exits.""" pass def can_submit():...
milkey-mouse/swood
swood/complain.py
Python
mit
4,905
#!/usr/bin/env python __author__ = "Andrew Hankinson (andrew.hankinson@mail.mcgill.ca)" __version__ = "1.5" __date__ = "2011" __copyright__ = "Creative Commons Attribution" __license__ = """The MIT License Permission is hereby granted, free of charge, to any person obtaining a copy of ...
ahankinson/pybagit
pybagit/multichecksum.py
Python
mit
4,668
"""Basic TCP Server that will listen to port 6633.""" import logging from socket import error as SocketError from socketserver import BaseRequestHandler, TCPServer, ThreadingMixIn from threading import current_thread from kytos.core.connection import CONNECTION_STATE, Connection from kytos.core.events import KytosEven...
erickvermot/kytos
kytos/core/tcp_server.py
Python
mit
6,260
# -*- coding: utf-8 -*- import smtplib from django.contrib.auth.models import Permission from django.test import TestCase from principal.forms import * from principal.models import * from principal.services import DepartmentService, CertificationService, UserService, ImpartSubjectService, \ AdministratorService fr...
carborgar/gestionalumnostfg
principal/tests.py
Python
mit
52,227
""" Base class for exporters """ # Standard library modules. import os # Third party modules. # Local modules. from pyhmsa.util.monitorable import _Monitorable, _MonitorableThread # Globals and constants variables. class _ExporterThread(_MonitorableThread): def __init__(self, datafile, dirpath, *args, **kwarg...
pyhmsa/pyhmsa
pyhmsa/fileformat/exporter/exporter.py
Python
mit
1,242
from __future__ import absolute_import from .base import * from bundle_config import config DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': config['postgres']['database'], 'USER': config['postgres']['username'], 'PASSWORD': config['postgres']['...
almet/whiskerboard
settings/epio.py
Python
mit
751
from django.apps import AppConfig from django.contrib.auth import get_user_model from django.contrib.auth.models import Permission from django.contrib.contenttypes.models import ContentType class AppConfig(AppConfig): name = '.'.join(__name__.split('.')[:-1]) label = 'icekit_plugins_iiif' verbose_name = "...
ic-labs/django-icekit
icekit/plugins/iiif/apps.py
Python
mit
1,144
# -*- coding: utf-8 -*- # Generated by Django 1.10.2 on 2016-12-08 21:16 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('main', '0021_auto_20161208_1214'), ] operations = [ migrations.AlterField( ...
bomjacob/htxaarhuslan
main/migrations/0022_auto_20161208_2216.py
Python
mit
679
from functools import wraps def retry_task(f): @wraps(f) def decorated_function(*args, **kwargs): retry = kwargs.get('retry', False) if retry == 0: return f(*args, **kwargs) elif retry > 0: for x in range(0, retry): result = f(*args, **kwargs) ...
JR--Chen/flasky
app/spider/decorators.py
Python
mit
641
#------------------------------------------------------------------------------ # Copyright (C) 2009 Richard W. Lincoln # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restrictio...
rwl/puddle
puddle/resource/action/up_action.py
Python
mit
3,878
#!/usr/bin/env python from ez_setup import use_setuptools use_setuptools() from setuptools import setup, find_packages from pkg_resources import parse_version def check_dependencies(): ''' setuptools causes problems for installing packages (especially statsmodels). Use this function to abort installati...
keflavich/TurbuStat
setup.py
Python
mit
3,706
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function import os import shutil import time import subprocess import numpy as np from .phonopy_conf_creator import PhonopyConfCreator from vasp.poscar import Poscar from autotools import symlink_force class PhononCalculator(object): def _...
yuzie007/ph_analysis
ph_analysis/phonon_calculator.py
Python
mit
6,728
from django.conf.urls import patterns, include, url from django.contrib import admin from django.conf import settings admin.autodiscover() urlpatterns = patterns('', # Examples: # url(r'^$', 'CryptoKnocker.views.home', name='home'), # url(r'^blog/', include('blog.urls')), url(r'^admin/', include(admi...
bb111189/CryptoKnocker
CryptoKnocker/CryptoKnocker/urls.py
Python
mit
970
# -*- coding: utf-8 -*- """ annotations_line2d module Created on Thu Sep 10 21:51:23 2015 @author: James Sorenson """ import matplotlib import matplotlib.pyplot as plt # This is to prevent overlapping annotations from being dragged simultaneously # due to the multi-threaded nature of the matplotlib gui. import threadi...
J-Sorenson/annnotations-line2d
annotations_line2d.py
Python
cc0-1.0
20,221
#!/usr/bin/env python3 # Combine SVG Images of Italic Practice Sheets into an OpenDocument Document # Written in 2014 by Jordan Vaughan # # To the extent possible under law, the author(s) have dedicated all copyright # and related and neighboring rights to this software to the public domain # worldwide. This software ...
jtvaughan/calligraphy
fodtitalicsheets.py
Python
cc0-1.0
6,988
import OOMP newPart = OOMP.oompItem(9452) newPart.addTag("oompType", "RESE") newPart.addTag("oompSize", "0805") newPart.addTag("oompColor", "X") newPart.addTag("oompDesc", "O271") newPart.addTag("oompIndex", "67") OOMP.parts.append(newPart)
oomlout/oomlout-OOMP
old/OOMPpart_RESE_0805_X_O271_67.py
Python
cc0-1.0
243
"""Cascade UserAffiliation deletes Revision ID: 5de499ab5b62 Revises: 14f51f27a106 Create Date: 2016-12-13 00:21:39.842218 """ # revision identifiers, used by Alembic. revision = '5de499ab5b62' down_revision = '14f51f27a106' branch_labels = None depends_on = None from alembic import op import sqlalchemy as sa def...
fedspendingtransparency/data-act-broker-backend
dataactcore/migrations/versions/5de499ab5b62_cascade_useraffiliation_deletes.py
Python
cc0-1.0
1,559
# -*- coding: utf-8 -*- from __future__ import unicode_literals # do this when > 1.6!!! # from django.db import migrations, models from gazetteer.models import GazSource,GazSourceConfig,LocationTypeField,CodeFieldConfig,NameFieldConfig from skosxl.models import Concept, Scheme, MapRelation from gazetteer.settings imp...
rob-metalinkage/django-gazetteer
gazetteer/fixtures/mapstory_tm_world_config.py
Python
cc0-1.0
2,139
from flask import * from playhouse.flask_utils import * import string from app import app from model import Major, Minor, Store, Transaction, Item @app.route('/major', methods=['GET', 'POST']) def major_list(): query = Major \ .select(Major, Minor) \ .join(Minor, on=(Major.id == Minor.maj...
ilhamwk/accounting
view_major.py
Python
cc0-1.0
4,006
#!/usr/bin/env python import gi gi.require_version('Gtk', '3.0') from gi.repository import Gtk window = Gtk.Window() window.set_default_size(200, 200) window.connect("destroy", Gtk.main_quit) overlay = Gtk.Overlay() window.add(overlay) textview = Gtk.TextView() textview.set_wrap_mode(Gtk.WrapMode.WORD_CHAR) textbuf...
Programmica/python-gtk3-tutorial
_examples/overlay.py
Python
cc0-1.0
798
"""Tests to ensure that the html5lib tree builder generates good trees.""" import warnings try: from bs4.builder import HTML5TreeBuilder HTML5LIB_PRESENT = True except ImportError, e: HTML5LIB_PRESENT = False from bs4.element import SoupStrainer from bs4.testing import ( HTML5TreeBuilderSmokeTest, ...
listyque/TACTIC-Handler
thlib/side/bs42/tests/test_html5lib.py
Python
epl-1.0
6,494
""" Python environments and packages ================================ This module provides tools for using Python `virtual environments`_ and installing Python packages using the `pip`_ installer. .. _virtual environments: http://www.virtualenv.org/ .. _pip: http://www.pip-installer.org/ """ from __future__ import w...
juanantoniofm/accesible-moodle
fabtools/python.py
Python
gpl-2.0
8,076
from setuptools import setup def readme(): with open('README.rst.example') as f: return f.read() setup(name='manifold_gui', version='0.1', description='GUI for a manifold technique', long_description=readme(), classifiers=[ 'Development Status :: 1 - Alpha', 'Enviro...
hstau/manifold-cryo
setup.py
Python
gpl-2.0
792
#!/usr/bin/python import csv import datetime import os import copy class Trip: dols = [] dists = [] gals = [] octs = [] eths = [] drivers = [] tires = [] miles = 0 gallons = 0 actualGals = 0 days = 0 octane = 0 snowtires = 0 make = 0 model = 0 year = 0 engineIV = 0 enginecyl = 0 engineL = 0...
andybond13/fontina
fontina.py
Python
gpl-2.0
7,414
import itertools import subprocess import sys #http://pastebin.com/zj72xk4N #run when system password box is showing eg. keychain password dialog #apple script for automating dialog box input sys_script = ''' tell application "System Events" to tell process "SecurityAgent" set value of text field 1 of window 1 to $...
Jacobious52/PythonLab
osxpasscrack.py
Python
gpl-2.0
886
''' Created on 17/2/2015 @author: PC06 Primer cambio en el proyecto ''' from include import app if __name__ == '__main__': app.run("127.0.0.1", 9000, debug=True)
javiteri/reposdmpdos
miltonvz/run.py
Python
gpl-2.0
176
# Copyright (c) 2008 Duncan Fordyce # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distri...
FrodeSolheim/fs-uae-launcher
oyoyo/client.py
Python
gpl-2.0
10,090
from crispy_forms.helper import FormHelper from crispy_forms.layout import * from crispy_forms.bootstrap import * from crispy_forms.layout import Layout, Submit, Reset, Div from django import forms from django.contrib.auth.forms import UserChangeForm, UserCreationForm from silo.models import TolaUser from django.contri...
mercycorps/TolaTables
tola/forms.py
Python
gpl-2.0
3,291
import search_duplicated_task
3dfxsoftware/cbss-addons
duplicated_tasks/wizard/__init__.py
Python
gpl-2.0
30
import Globals from Products.ZenModel.ZenPack import ZenPack as ZenPackBase from Products.ZenUtils.Utils import unused, zenPath import os unused(Globals) _plugins = [ 'rig_host_app_transform1.py', 'copy_server_config_file.sh', ] class ZenPack(ZenPackBase): def install(self, app): super(Zen...
jcurry/ZenPacks.Markit.RigHost
ZenPacks/Markit/RigHost/__init__.py
Python
gpl-2.0
1,531
#!/usr/bin/python import piksemel import os def updateGConf (filepath, remove=False): parse = piksemel.parse (filepath) schemaList = list() for xmlfile in parse.tags ("File"): path = xmlfile.getTagData ("Path") # Only interested in /etc/gconf/schemas if "etc/gconf/schemas" in pat...
richard-fisher/repository
desktop/gnome/core/gconf/comar/packageHandler.py
Python
gpl-2.0
816
__author__ = 'Stephanie' from ODMconnection import dbconnection from readSensors import readSensors from updateSensors import updateSensors from createSensors import createSensors from deleteSensors import deleteSensors __all__ = [ 'readSensors', 'updateSensors', 'createSensors', 'deleteSensors', ]
Castronova/EMIT
api_old/ODM2/Sensors/services/__init__.py
Python
gpl-2.0
319
"""In the case that the Setup.py file fails to execute, please manually install the following packages, or execute the requirements.sh script.""" # Installing Requirements: # # pip install git+https://github.com/pwaller/pyfiglet # # pip install colorama ...
xxHACKYHACKYXx/hackathon-dpse
Rule booklet in Python/Setup.py
Python
gpl-2.0
875
# -*- coding: utf-8 -*- # # This tool helps you rebase your package to the latest version # Copyright (C) 2013-2019 Red Hat, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version...
rebase-helper/rebase-helper
rebasehelper/helpers/input_helper.py
Python
gpl-2.0
3,222
#parser_testing.py import os, sys, re, StringIO sys.path.append('/Users/Jason/Dropbox/JournalMap/scripts/GeoParsers') #from jmap_geoparser_re import * from jmap_geoparser import * #def test_parsing(): test = "blah blah blah 45º 23' 12'', 123º 23' 56'' and blah blah blah 32º21'59''N, 115º 23' 14''W blah blah blah" co...
JournalMap/GeoParsers
pyparser_geoparser_testing.py
Python
gpl-2.0
3,064
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Created on Mon Nov 21 15:53:15 2016 @author: agiovann """ from __future__ import division from __future__ import print_function #%% from builtins import zip from builtins import str from builtins import map from builtins import range from past.utils import old_div im...
agiovann/Constrained_NMF
use_cases/motion_correction_paper/demo_motion_correction_nonrigid.py
Python
gpl-2.0
36,419
from turtlelsystem.TurtleSVGMachine import TurtleSVGMachine from nose.tools import assert_almost_equal def test_forward(): turtle = TurtleSVGMachine(width = 20, height = 20) turtle.do_command("FORWARD 10") assert_almost_equal(turtle.x, 20.0) def test_backward(): turtle = TurtleSVGMachine(width = 20, h...
ptrgags/turtle-fractals
turtlelsystem/tests/test_TurtleSVGMachine.py
Python
gpl-2.0
665
# # # Copyright (C) 2006, 2007, 2011, 2012, 2014 Google Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This...
vladimir-ipatov/ganeti
lib/luxi.py
Python
gpl-2.0
17,598
__author__ = 'Marco Maio' import time class Handler(): def __init__(self, stocks_today=None, investments_by_name=None, investments_by_availability=None): # input data assessment if stocks_today is None: raise ValueError('Stocks_today container not specified!') elif inv...
marcomaio/NatixisUnofficialAPI
natixis/handler.py
Python
gpl-2.0
4,027
# Copyright 2004-2010 PyTom <pytom@bishoujo.us> # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation files # (the "Software"), to deal in the Software without restriction, # including without limitation the rights to use, copy, modify, mer...
MSEMJEJME/ReAlistair
renpy/lint.py
Python
gpl-2.0
13,359
# coding=utf-8 from datetime import datetime from euphorie.client import model from euphorie.client.tests.utils import addAccount from euphorie.client.tests.utils import addSurvey from euphorie.content.tests.utils import BASIC_SURVEY from euphorie.testing import EuphorieIntegrationTestCase from lxml import html from pl...
euphorie/Euphorie
src/euphorie/client/tests/test_survey_integration.py
Python
gpl-2.0
5,946
from flask import Response from flask.views import View from bson import json_util from mcp import mongo class Map(View): def dispatch_request(self, komuna, viti): json = mongo.db.procurements.aggregate([ { "$match": { "komuna.slug": komuna, ...
opendatakosovo/municipality-procurement-api
mcp/views/map.py
Python
gpl-2.0
4,266
# -*- coding: utf-8 -*- # # M4Baker # Copyright (C) 2010 Kilian Lackhove # # 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 versio...
crabmanX/m4baker
src/mainWindow.py
Python
gpl-2.0
21,163
from django.conf.urls import patterns, include, url from django.contrib import admin from django.contrib.auth import views admin.autodiscover() urlpatterns = patterns('', url(r'^$', 'lite_note.views.home', name='home'), url(r'^test','lite_note.views.new_home',name='new_ho...
Shiwin/LiteNote
noties/urls.py
Python
gpl-2.0
1,648
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('usermodule', '0002_auto_20151108_2019'), ] operations = [ migrations.CreateModel( name='Period', fie...
Sezzh/tifis_platform
tifis_platform/groupmodule/migrations/0001_initial.py
Python
gpl-2.0
711
# # calculator.py : A calculator module for the deskbar applet. # # Copyright (C) 2008 by Johannes Buchner # Copyright (C) 2007 by Michael Hofmann # Copyright (C) 2006 by Callum McKenzie # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License...
benpicco/mate-deskbar-applet
deskbar/handlers/calculator.py
Python
gpl-2.0
8,080
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'openPathTool.ui' # # Created by: PyQt4 UI code generator 4.11.4 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 except AttributeError: def _fromUtf8(...
david2777/DavidsTools
Standalone/openPathTool/UI_openPathTool.py
Python
gpl-2.0
3,656
# Copyright 2009-2010 by Peter Cock. All rights reserved. # Based on code contributed and copyright 2009 by Jose Blanca (COMAV-UPV). # # This code is part of the Biopython distribution and governed by its # license. Please see the LICENSE file that should have been included # as part of this package. """Bio.SeqIO sup...
BlogomaticProject/Blogomatic
opt/blog-o-matic/usr/lib/python/Bio/SeqIO/SffIO.py
Python
gpl-2.0
53,635
#!/usr/bin/env python import subprocess import os class MakeException(Exception): pass def swapExt(path, current, replacement): path, ext = os.path.splitext(path) if ext == current: path += replacement return path else: raise MakeException( "swapExt: expected file ...
HarryR/ffff-dnsp2p
libbenc/make.py
Python
gpl-2.0
1,298
#!/usr/bin/python ## ## Copyright 2008, Various ## Adrian Likins <alikins@redhat.com> ## ## This software may be freely redistributed under the terms of the GNU ## general public license. ## import os import socket import subprocess import time import unittest import simplejson import func.utils from func import y...
pombredanne/func
test/unittest/test_func_transmit.py
Python
gpl-2.0
8,415
__author__ = 'ryanplyler' def sayhi(config): error = None try: server_output = "Executing action 'sayhi()'" response = "HI THERE!" except: error = 1 return server_output, response, error
grplyler/netcmd
netcmd_actions.py
Python
gpl-2.0
231
## # Copyright 2009-2020 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://www.vscentrum.be), # Flemish Research Foundation (F...
pescobar/easybuild-easyblocks
easybuild/easyblocks/m/mrtrix.py
Python
gpl-2.0
5,093
""" Virtualization test - Virtual disk related utility functions :copyright: Red Hat Inc. """ import os import glob import shutil import stat import tempfile import logging import re try: import configparser as ConfigParser except ImportError: import ConfigParser from avocado.core import exceptions from avoca...
lmr/avocado-vt
virttest/utils_disk.py
Python
gpl-2.0
21,332
# This file is part of the Enkel web programming library. # # Copyright (C) 2007 Espen Angell Kristiansen (espen@wsgi.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...
espenak/enkel
testsuite/wansgli/apprunner.py
Python
gpl-2.0
5,360
#!/usr/bin/env python2 from gimpfu import * import time import re def preview (image, delay, loops, force_delay, ignore_hidden, restore_hide): if not image: raise "No image given." layers = image.layers nlayers = len (layers) visible = [] length = [] i = 0 while i < nlayers: ...
rbong/gimptools
preview.py
Python
gpl-2.0
2,246
from __future__ import print_function from Components.Task import PythonTask, Task, Job, job_manager as JobManager from Tools.Directories import fileExists from enigma import eTimer from os import path from shutil import rmtree, copy2, move class DeleteFolderTask(PythonTask): def openFiles(self, fileList): self.fil...
atvcaptain/enigma2
lib/python/Tools/CopyFiles.py
Python
gpl-2.0
2,263
#! /usr/bin/env python3 import sys from cx_Freeze import setup, Executable # Dependencies are automatically detected, but it might need fine tuning. includefiles = ['windows/libusb-1.0.dll', ('icons/buzzer.png', 'icons/buzzer.png'), 'README.md', 'LICENSE', ...
wichmann/pyPardy
setup.py
Python
gpl-2.0
1,810
#!/usr/bin/env python3 # Copyright (c) 2008-9 Qtrac Ltd. All rights reserved. # This program or module 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 # version 3 of the Lic...
paradiseOffice/Bash_and_Cplus-plus
CPP/full_examples/pyqt/chap08/addeditmoviedlg_ans.py
Python
gpl-2.0
3,155
# -*- coding: UTF-8 -*- """ Copyright (C) 2014 smokdpi 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. ...
igor-rangel7l/igorrangelteste.repository
script.module.urlresolver/lib/urlresolver/plugins/userscloud.py
Python
gpl-2.0
2,595
# -*- coding: utf-8 -*- ''' test_qgsatlascomposition.py -------------------------------------- Date : Oct 2012 Copyright : (C) 2012 by Dr. Hugo Mercier email : hugo dot mercier at oslandia dot com **************...
GeoCat/QGIS
tests/src/python/test_qgsatlascomposition.py
Python
gpl-2.0
14,506
a, b = map(int,raw_input().split()) i=0 while(i<a): j=0 c=[] if(i%2==0): while(j<b): c.append('#') j=j+1 print (''.join(c)) else: k = int(i/2) if (k%2==0): while(j<(b-1)): c.append(".") j=j+1 c.append("#") print (''.join(c)) else: c.append('#') while(j<(b-1)): c.append("."...
Sarthak30/Codeforces
fox_and_snake.py
Python
gpl-2.0
361
# program template for Spaceship import simplegui import math import random # globals for user interface WIDTH = 800 HEIGHT = 600 score = 0 lives = 3 time = 0 game_mode = 0 # 0 = splash screen, 1 = game mode, 2 = game over ANGULAR_ACCEL_SCALAR = math.pi / 800.0 ANGULAR_FRICTION = 0.95 LINEAR_ACCEL_SCALAR = 0.25 LINEA...
mwales/education
InteractivePython/asteroids.py
Python
gpl-2.0
25,069
""" AUTHOR: Peter Collins, 2005. This software is Copyright (C) 2004-2008 Bristol University and is released under the GNU General Public License version 2. MODULE: RunHill PURPOSE: A sample setup and configuration for the normalization algorithms. NOTES: See RunConfig.py for configuration options """ import sy...
Peter-Collins/NormalForm
src/config-run/RunHill.py
Python
gpl-2.0
1,029
from Plugins.Plugin import PluginDescriptor from Screens.PluginBrowser import * from Screens.Ipkg import Ipkg from Screens.HarddiskSetup import HarddiskSetup from Components.ProgressBar import ProgressBar from Components.SelectionList import SelectionList from Screens.NetworkSetup import * from enigma import * from Scr...
trunca/enigma2
lib/python/OPENDROID/OPD_panel.py
Python
gpl-2.0
35,438
import os import sys import tnetstring def read_packets (filename): try: os.stat (filename) except OSError: print "No such file : %s"%filename sys.exit (1) pkts = open (filename).read () pkts = tnetstring.loads (pkts, 'iso-8859-15') for data in pkts: yield data if '...
sipdbg/sipdbg
rtp/read_dump.py
Python
gpl-2.0
552
from polybori import BooleSet, interpolate_smallest_lex class PartialFunction(object): """docstring for PartialFunction""" def __init__(self, zeros, ones): super(PartialFunction, self).__init__() self.zeros = zeros.set() self.ones = ones.set() def interpolate_smallest_lex(self): ...
ohanar/PolyBoRi
pyroot/polybori/partial.py
Python
gpl-2.0
1,509
## This file is part of Invenio. ## Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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...
pamfilos/invenio
modules/websubmit/lib/functions/Create_Modify_Interface.py
Python
gpl-2.0
15,906
#!/usr/bin/env python import glob import os import site from cx_Freeze import setup, Executable import meld.build_helpers import meld.conf site_dir = site.getsitepackages()[1] include_dll_path = os.path.join(site_dir, "gnome") missing_dll = [ 'libgtk-3-0.dll', 'libgdk-3-0.dll', 'libatk-1.0-0.dll', ...
culots/meld
setup_win32.py
Python
gpl-2.0
4,346
# coding: utf-8 from Sensor import Sensor import nxt class ColorSensor(Sensor): name = 'color' def Initialize(self): #self.sensor = nxt.Light(self.robot.GetBrick(), self.port) #self.sensor.set_illuminated(0) self.sensor = nxt.Color20(self.robot.GetBrick(), self.port) def Scan(self...
Lopt/nxt
NXT/ColorSensor.py
Python
gpl-2.0
372
""" Implements compartmental model of a passive cable. See Neuronal Dynamics `Chapter 3 Section 2 <http://neuronaldynamics.epfl.ch/online/Ch3.S2.html>`_ """ # This file is part of the exercise code repository accompanying # the book: Neuronal Dynamics (see http://neuronaldynamics.epfl.ch) # located at http://github.c...
EPFL-LCN/neuronaldynamics-exercises
neurodynex3/cable_equation/passive_cable.py
Python
gpl-2.0
6,153
#/*########################################################################## # Copyright (C) 2004-2012 European Synchrotron Radiation Facility # # This file is part of the PyMca X-ray Fluorescence Toolkit developed at # the ESRF by the Software group. # # This file is free software; you can redistribute it and/or modi...
tonnrueter/pymca_devel
PyMca/ArraySave.py
Python
gpl-2.0
23,377
from Screen import Screen from Screens.ChoiceBox import ChoiceBox class ResolutionSelection(Screen): def __init__(self, session, infobar=None): Screen.__init__(self, session) self.session = session xresString = open("/proc/stb/vmpeg/0/xres", "r").read() yresString = open("/proc/stb/vmpeg/0/yres", "r").read()...
OpenLD/enigma2-wetek
lib/python/Screens/ResolutionSelection.py
Python
gpl-2.0
1,827
#!/usr/bin/env python from time import sleep import os import RPi.GPIO as GPIO import subprocess import datetime GPIO.setmode(GPIO.BCM) GPIO.setup(24, GPIO.IN) count = 0 up = False down = False command = "" filename = "" index = 0 camera_pause = "500" def takepic(imageName): print("picture") command = "sudo ras...
sgonzalez/wsn-parking-project
sensor-pi/testimages.py
Python
gpl-2.0
764
class City(object): def __init__(self, name): self.name = name def Name(self): return self.name class Home(object): def __init__(self, name, city): self.name = name self.city = city def Name(self): return self.name def City(self): return self....
Kolguyev/samples
law_of_demeter/law_of_demeter_bad_example.py
Python
gpl-2.0
738
import P1011 import unittest class test_phylab(unittest.TestCase): def testSteelWire_1(self): m = [10.000,12.000,14.000,16.000,18.000,20.000,22.000,24.000,26.00] C_plus = [3.50, 3.81, 4.10, 4.40, 4.69, 4.98, 5.28, 5.59, 5.89] C_sub = [3.52, 3.80, 4.08, 4.38, 4.7...
buaase/Phylab-Web
PythonExperimentDataHandle/test/P1011_test.py
Python
gpl-2.0
1,628
# -*- coding: utf-8 -*- # Copyright(c) 2016-2020 Jonas Sjöberg <autonameow@jonasjberg.com> # Source repository: https://github.com/jonasjberg/autonameow # # This file is part of autonameow. # # autonameow is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public L...
jonasjberg/autonameow
autonameow/extractors/metadata/__init__.py
Python
gpl-2.0
1,177
#!/usr/bin/python import unittest class FooTest(unittest.TestCase): '''Sample test case -- FooTest()''' def setUp(self): '''Set up for testing...''' print 'FooTest:setUp_:begin' testName = self.shortDescription() if (testName == 'Test routine A'): pri...
jeffwright13/unittest_tutorial
test_foo.py
Python
gpl-2.0
2,412
#!/usr/bin/env python #coding=utf-8 # Copyright 2007 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
ariwaranosai/twitter_bot
twitter_bot/main.py
Python
gpl-2.0
1,342
__author__ = 'bruno' import unittest import algorithms.math.abacus as Abacus class TestAbacus(unittest.TestCase): def setUp(self): pass def test_abacus1(self): abacus = Abacus.generate_abacus(0) self.assertEqual(['|00000***** |', '|00000***** |', ...
bnsantos/python-junk-code
tests/math/abacusTest.py
Python
gpl-2.0
5,476
# -*- coding: utf-8 -*- # =========================================================================== # eXe # Copyright 2004-2006, University of Auckland # Copyright 2006-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 G...
RichDijk/eXe
exe/engine/package.py
Python
gpl-2.0
77,805
# -*- coding: utf-8 -*- #This is generated code - do not edit encoding = 'utf-8' dict = { '&About...': '&\xd8\xb9\xd9\x86...', '&Delete Window': '&\xd8\xa7\xd8\xad\xd8\xb0\xd9\x81 \xd8\xa7\xd9\x84\xd9\x86\xd8\xa7\xd9\x81\xd8\xb0\xd8\xa9', '&Describe Action': '&\xd8\xa3\xd9\x88\xd8\xb5\xd9\x81 \xd8\xa7\xd9\x84\xd8\xb9\x...
robmcmullen/peppy
peppy/i18n/ar.py
Python
gpl-2.0
2,474
import sys from starstoloves.models import User as UserModel from starstoloves import model_repository from starstoloves.lib.track import lastfm_track_repository from .user import User def from_session_key(session_key): user_model, created = UserModel.objects.get_or_create(session_key=session_key) return User...
tdhooper/starstoloves
starstoloves/lib/user/user_repository.py
Python
gpl-2.0
564
# -*- coding: utf-8 -*- """ translate variance and its formated character which have regularities for example: raw input: v={'aa': 12345, 'bbbb': [1, 2, 3, 4, {'flag': 'vvvv||||xxxxx'}, set(['y', 'x', 'z'])]} after `var2str.var2str(v)` v_str=<aa::12345##bbbb::<1||2||3||4||<flag::vvvv|xxxxx>||<y|||x|||z...
mavarick/spider-python
webspider/utils/var2str.py
Python
gpl-2.0
6,752
from triple_draw_poker.model.Pot import Pot class HandDetails: def __init__(self): self.pot = Pot() self.raised = 0 self.street = 0 self.number_of_streets = 4 self.in_draw = False self.hands = [] self.dealt_cards_index = 0 def getDealtCardsIndex(self): ...
zmetcalf/Triple-Draw-Deuce-to-Seven-Lowball-Limit
triple_draw_poker/model/HandDetails.py
Python
gpl-2.0
1,109
from src.tools.enum import enum import pyxbmct.addonwindow as pyxbmct from src.tools.dialog import dialog EnumMode = enum(SELECT=0, ROTATE=1) class EnumButton(object): def __init__(self, label, values, current, default, changeCallback=None, saveCallback=None, customLabels=None, mode=EnumMode.SELECT, returnValue...
SportySpice/Collections
src/gui/EnumButton.py
Python
gpl-2.0
4,537
# -*- coding: utf-8 -*- # @Author: Marco Benzi <marco.benzi@alumnos.usm.cl> # @Date: 2015-06-07 19:44:12 # @Last Modified 2015-06-09 # @Last Modified time: 2015-06-09 16:07:05 # ========================================================================== # This program is free software: you can redistribute it and/or...
Lisergishnu/LTXKit
uStripDesign.py
Python
gpl-2.0
5,581
#!/usr/bin/env python2.7 # -*- coding:utf-8 -*- import sklearn.datasets as skds import numpy as np import random import theano.tensor as T import theano import matplotlib.pyplot as plt import math #I don't know what the jesus 'housing.data' means so I used self-generated dataset x = np.arange(-50., 50., 1) y = np.arr...
AthenaYe/UFLDL_Tutorial
Chap1_Supervised_Learning_and_Optimization/logistic_regression.py
Python
gpl-2.0
1,696
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2012 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...
PXke/invenio
invenio/modules/redirector/redirect_methods/goto_plugin_cern_hr_documents.py
Python
gpl-2.0
7,113
# -*- coding: utf-8 -*- # # Picard, the next-generation MusicBrainz tagger # Copyright (C) 2006 Lukáš Lalinský # # 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...
mineo/picard
picard/util/icontheme.py
Python
gpl-2.0
2,350
# # # Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Google Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # ...
ekohl/ganeti
lib/opcodes.py
Python
gpl-2.0
47,432
#!/usr/bin/env python import re import string import sys import os USAGE = 'USAGE: parse.y <player.h> <playercore_casts.i> <playercore_arraysofclasses.i> <Jplayercore> <playercore> <player.java>' if __name__ == '__main__': if len(sys.argv) != 7: print USAGE sys.exit(-1) infilename = sys.argv[1] outfi...
uml-robotics/player-2.1.3
libplayercore/bindings/java/parse.py
Python
gpl-2.0
9,344
# # Copyright (c) 2008--2010 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 have received a c...
colloquium/spacewalk
backend/server/handlers/xmlrpc/errata.py
Python
gpl-2.0
9,420
from django import forms from django.contrib.auth.models import User from django.forms import ModelForm from django.db import models # Create your models here. #EDICION DE MODELO USER User.add_to_class('usuario_sico', models.CharField(max_length=10, null=False, blank=False)) User.add_to_class('contrasenia_sico', mode...
Titulacion-Sistemas/PracticasDjango
usuarios_logueados/usuarios/models.py
Python
gpl-2.0
791
import sys import time from naoqi import ALProxy IP = "nao.local" PORT = 9559 if (len(sys.argv) < 2): print "Usage: 'python RecordAudio.py nume'" sys.exit(1) fileName = "/home/nao/" + sys.argv[1] + ".wav" aur = ALProxy("ALAudioRecorder", IP, PORT) channels = [0,0,1,0] aur.startMicrophonesRecording(fileName...
ioanaantoche/muhaha
ioana/RecordAudio.py
Python
gpl-2.0
757
#!/usr/bin/env python3 # Copyright (c) 2008-9 Qtrac Ltd. All rights reserved. # This program or module 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 # version 3 of the Lic...
paradiseOffice/Bash_and_Cplus-plus
CPP/full_examples/pyqt/chap07/findandreplacedlg.py
Python
gpl-2.0
4,146