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 |
|---|---|---|---|---|---|
# -*- coding: utf-8 -*-
import classes.level_controller as lc
import classes.game_driver as gd
import classes.extras as ex
import classes.board
import random
import math
import pygame
class Board(gd.BoardGame):
def __init__(self, mainloop, speaker, config, screen_w, screen_h):
self.level = lc.Level(self... | OriHoch/pysiogame | game_boards/game054.py | Python | gpl-3.0 | 7,891 |
#!/usr/bin/python
"""This is a blind proxy that we use to get around browser
restrictions that prevent the Javascript from loading pages not on the
same server as the Javascript. This has several problems: it's less
efficient, it might break some sites, and it's a security risk because
people can use this proxy to b... | getsmap/smap-responsive | ws/cherrypy/libs/proxy.py | Python | gpl-3.0 | 2,703 |
from vulture import Vulture
| MikrosAnim/vulture | vulture/__init__.py | Python | gpl-3.0 | 28 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'icenine/ui/newaccountdialog.ui'
#
# Created by: PyQt5 UI code generator 5.9
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_newAccountDialog(object):
def setupUi(self, newAcc... | mikeshultz/icenine | icenine/ui/newaccountgui.py | Python | gpl-3.0 | 6,215 |
# vim: set fileencoding=utf-8 :
#
# PeerDrive
# Copyright (C) 2011 Jan Klötzke <jan DOT kloetzke AT freenet DOT de>
#
# 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... | peerdrive/peerdrive | client/peerdrive/struct.py | Python | gpl-3.0 | 10,142 |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
from setuptools import setup, find_packages
import shup
setup(name='shup',
version=shup.__version__,
author='Nahim El Atmani',
author_email='nahim+dev@naam.me',
license="GPL3",
url='https://github.com/Naam/shup',
description='File sha... | Naam/shup | setup.py | Python | gpl-3.0 | 1,672 |
import time
import sys
import array
# show start
def py_add(A,B,size):
i = 0
while i < size:
A[i] = A[i] + B[i]
i += 1
# show stop
if __name__ == '__main__':
s = int(sys.argv[1])
j = int(sys.argv[2])
a = array.array('d', [0.0]*s)
b = array.array('d', [1.0]*s)
for i in rang... | planrich/pypy-simd-benchmark | user/add.py | Python | gpl-3.0 | 458 |
from collections import Counter
def unalk_coeff(l):
'''Source: https://ww2.amstat.org/publications/jse/v15n2/kader.html'''
n = len(l)
freq = Counter(l)
freqsum = 0
for key, freq in freq.items():
p = freq / n
freqsum += p**2
unalk_coeff = 1 - freqsum
return unalk_coeff
def... | j4n7/record-q | qualitative_variation.py | Python | gpl-3.0 | 1,382 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 Smile. All Rights Reserved
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Gener... | emimorad/smile_openerp_matrix_widget | smile_matrix_widget/widgets/__init__.py | Python | gpl-3.0 | 966 |
# -*- coding: utf-8 -*-
#
# This file is part of the jabber.at homepage (https://github.com/jabber-at/hp).
#
# This project 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 (... | debalance/hp | hp/blog/querysets.py | Python | gpl-3.0 | 1,576 |
# Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source
# & Institut Laue - Langevin
# SPDX - License - Identifier: GPL - 3.0 +
from __future__ import (absolute_import, divi... | mganeva/mantid | Testing/SystemTests/tests/analysis/DirectInelasticDiagnostic2.py | Python | gpl-3.0 | 3,610 |
from Interface import Interface
import sqlite3
import time
import types
import json
import os
class Implementation(Interface):
def __init__(self, connstr, *args, **kwargs):
dbfile = connstr
# automatically create parent directory
pdir = os.path.dirname(dbfile)
if not ... | GutiDeng/bcpy | KvDB/ImplSQLite.py | Python | gpl-3.0 | 9,116 |
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
"""
EVMLab command line utility: #> python3 -m evmlab <subcommand> <args>
"""
import sys
import logging
from .tools import opviewer, reproducer, statetests
def usage(msg=""):
description = """
EVMLab command line utility
Usage:
#> python3 -m evmlab <subcommand>... | holiman/evmlab | evmlab/__main__.py | Python | gpl-3.0 | 1,235 |
# STAB: subglacial till advection and bedforms
# Thomas E. Barchyn - University of Calgary, Calgary, AB, Canada
# Copyright 2014-2016 Thomas E. Barchyn
# Contact: Thomas E. Barchyn [tbarchyn@gmail.com]
# This project was developed with input from Thomas P.F. Dowling,
# Chris R. Stokes, and Chris H. Hugenholtz. We wou... | tbarchyn/STAB_1.0 | operations/execute_.py | Python | gpl-3.0 | 4,077 |
"""
:mod: ReqClient
.. module: ReqClient
:synopsis: implementation of client for RequestDB using DISET framework
"""
import os
import time
import random
import json
import datetime
# # from DIRAC
from DIRAC import gLogger, S_OK, S_ERROR
from DIRAC.Core.Utilities.List import randomize, fromChar
from DIRAC.Core.Ut... | DIRACGrid/DIRAC | src/DIRAC/RequestManagementSystem/Client/ReqClient.py | Python | gpl-3.0 | 28,083 |
from django.core.management.base import BaseCommand
# https://github.com/jedie/PyHardLinkBackup
from pyhardlinkbackup.phlb.add import add_all_backups
class Command(BaseCommand):
help = 'Scan all existing backup and add missing ones to database.'
def handle(self, *args, **options):
self.stdout.write(... | jedie/PyHardlinkBackup | pyhardlinkbackup/backup_app/management/commands/add.py | Python | gpl-3.0 | 422 |
# This file is part of Indico.
# Copyright (C) 2002 - 2016 European Organization for Nuclear Research (CERN).
#
# Indico 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 (a... | DavidAndreev/indico | indico/modules/events/surveys/controllers/display.py | Python | gpl-3.0 | 5,780 |
#This file is part of Tryton. The COPYRIGHT file at the top level of
#this repository contains the full copyright notices and license terms.
import os
import time
import urllib
import urlparse
import socket
import encodings
import uuid
import datetime
from dateutil.relativedelta import relativedelta
from trytond.model... | mediafactory/tryton_core_daemon | trytond/webdav/webdav.py | Python | gpl-3.0 | 33,594 |
# Copyright 2015 Matt Hawkins
#
# Update : July 2016
# added CPU and disk monitoring to script
# johnty.wang@mail.mcgill.ca
#
# additional requirement: psutil
#
#--------------------------------------
from subprocess import PIPE, Popen
import smbus
import psutil
import os
import time
# Define some device param... | V8Wookiee/Python_Learning | Resources/sysmon.py | Python | gpl-3.0 | 3,922 |
from pyelt.datalayers.database import Column, Columns
from pyelt.datalayers.dv import Sat, DvEntity, Link, Hub, HybridSat, LinkReference
class Role:
pass
class Act:
pass
class Participation:
pass
class Zorgverlener(DvEntity, Role):
class Default(Sat):
zorgverlenernummer = Columns.TextCo... | NLHEALTHCARE/PYELT | tests/old/unit_tests_rob/_domain_rob_unittest.py | Python | gpl-3.0 | 2,194 |
from rambutan3 import RArgs
from rambutan3.check_args.base.RInstanceMatcher import RInstanceMatcher
from rambutan3.check_args.set.RSetEnum import RSetEnum
class RSetMatcher(RInstanceMatcher):
def __init__(self, set_enum: RSetEnum):
RArgs.check_is_instance(set_enum, RSetEnum, "set_enum")
super()._... | kevinarpe/kevinarpe-rambutan3 | rambutan3/check_args/set/RSetMatcher.py | Python | gpl-3.0 | 347 |
from django.conf.urls import url
from django.core import urlresolvers
from django.contrib import admin
from . import views
from django.conf import settings
from django.conf.urls.static import static
app_name = 'resumedrop'
urlpatterns = [
url(r'^$', views.index, name='index'),
url(r'^create_success/$', views.cre... | himanshusahay/resume-drop | mysite/resumedrop/urls.py | Python | gpl-3.0 | 715 |
# -*- coding: utf-8 -*-
# Copyright (c) 2020, earthians and Contributors
# See license.txt
from __future__ import unicode_literals
# import frappe
import unittest
class TestHealthcareServiceOrderPriority(unittest.TestCase):
pass
| ESS-LLP/erpnext | erpnext/healthcare/doctype/healthcare_service_order_priority/test_healthcare_service_order_priority.py | Python | gpl-3.0 | 232 |
from sender import *
if __name__ == '__main__':
connection = Connection().initialize()
connection.send('Default exchange message!')
connection.destroy()
| harunyasar/rabbitmq_playground | default_exchange_sender.py | Python | gpl-3.0 | 166 |
import warnings
from importlib.util import spec_from_file_location, module_from_spec
from os.path import expanduser, dirname, join
from ._hdf5_io import hdf5_get
# SimFiles is a dict with added features, notably __getattr__ and __setattr__,
# and automatic loading of data from simulation files as defined using a confi... | kyleaoman/simfiles | simfiles/_simfiles.py | Python | gpl-3.0 | 10,409 |
import unittest
import string_to_lineitem
class TestUtilStringToLineItemTransform(unittest.TestCase):
def test_string_to_lineitem(self):
transformer = string_to_lineitem.UtilStringToLineItemTransform()
self.assertEqual(['a', 'b', 'c', 'd'], transformer.transform('a,b,c,d'))
self.assertEqua... | zapier/transformer | transformer/transforms/util/string_to_lineitem_test.py | Python | gpl-3.0 | 1,652 |
from django import template
register = template.Library()
@register.filter
def multiplyby(value, arg):
return int(value * arg)
@register.filter
def subtractfrom(value, arg):
return arg - value
@register.filter
def plus(value, arg):
return value + arg
@register.filter
def appears_in(value, arg):
for name in... | rtts/qqq | qqq/templatetags/customfilters.py | Python | gpl-3.0 | 807 |
"""
In this test we want to check if Tornado generate the same credentials dictionnary as DIRAC.
It also test if the correct certificates are sended by client.
To run this test you must have the handlers who returns credentials dictionnary.
Handlers are diracCredDictHandler and tornadoCredDictHandler j... | ic-hep/DIRAC | tests/DISET_HTTPS_migration/TestClientReturnedValuesAndCredentialsExtraction.py | Python | gpl-3.0 | 3,802 |
####################################################
# The model of disk and envelope (Keto&Zhang 2010) #
####################################################
# Model Type : Function / Constant / TABLE / ZEUS
ModelType = 'Function'
# Molecule
molec = 'hco+'
# CMB temperature (Kelvin, outer B.C.)
T_cmb = 2.73
# inn... | itahsieh/sparx-alpha | preprocessor/presparx/Disk_cyl2d/model.py | Python | gpl-3.0 | 5,481 |
# -*- coding: utf-8 -*-
###########################################################################
# OCRFeeder - The complete OCR suite
# Copyright (C) 2009-2013 Joaquim Rocha
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as... | thuydang/ocrfeeder | src/ocrfeeder/studio/widgetModeler.py | Python | gpl-3.0 | 46,946 |
# Copyright nycz 2011-2020
# This file is part of Kalpana.
# Kalpana 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.
# Kalpana is di... | kalpana-org/kalpana | kalpana/chapters.py | Python | gpl-3.0 | 19,512 |
#!/usr/bin/env python
# vim: sw=4:ts=4:sts=4:fdm=indent:fdl=0:
# -*- coding: UTF8 -*-
#
# Test the vorbis encoder.
# Copyright (C) 2013 Josiah Gordon <josiahg@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 ... | zepto/musio | examples/musioencode.py | Python | gpl-3.0 | 11,944 |
# -*- coding: utf-8 -*-
#
# lewis documentation build configuration file, created by
# sphinx-quickstart on Wed Nov 9 16:42:53 2016.
import os
import sys
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.realpath(__file__))))
# -- General configuration ------------------------------------------------
needs... | DMSC-Instrument-Data/plankton | docs/conf.py | Python | gpl-3.0 | 1,551 |
from django.conf.urls import patterns, url
from .views import PlanCreate, PlanList, PlanUpdate, PlanDelete
urlpatterns = patterns('',
url(r'^ajax/estado_civil/alta/$', 'apps.complementos.views.estado_civil_create_ajax',
name='EstadoCivil-Alta-Ajax'),
... | montenegroariel/sigos | apps/complementos/urls.py | Python | gpl-3.0 | 819 |
from flask.ext.restplus import Namespace
from app.models.track import Track as TrackModel
from .helpers import custom_fields as fields
from .helpers.helpers import (
can_create,
can_update,
can_delete,
requires_auth
)
from .helpers.utils import PAGINATED_MODEL, PaginatedResourceBase, ServiceDAO, \
... | gaeun/open-event-orga-server | app/api/tracks.py | Python | gpl-3.0 | 3,167 |
import logging, os, marshal, json, cPickle, time, copy, time, datetime, re, urllib, httplib
from base64 import b64encode, b64decode
from lib.crypt import encrypt, decrypt
from uuid import uuid4
from node import Node, InvalidIdentity
class FriendNode(Node):
def __init__(self, *args, **kwargs):
... | pdxwebdev/yadapy | yadapy/friendnode.py | Python | gpl-3.0 | 3,507 |
class InvalidDeviceType(Exception):
pass
| ohaut/ohaut-core | ohaut/exceptions.py | Python | gpl-3.0 | 46 |
# ! /usr/bin/env python
# _*_ coding:utf-8 _*_
"""
@author = lucas.wang
@create_time = 2018-01-12
"""
from xml.etree import ElementTree as ET
import fnmatch
class change_xml(object):
"""
xml main function
"""
names = ['iConn.CreateXmlTools.vshost.exe', 'AutoUpdater.dll', 'NewTonsoft.Json.dll',
... | Lucas-Wong/ToolsProject | CodeReview/Change_Xml.py | Python | gpl-3.0 | 1,695 |
import sys
import logging
import collections
import math
import sys
sys.path += ['..']
import clusteringlib as cl
import numpy as np
from deap import algorithms
from deap import base
from deap import creator
from deap import tools
from copy import deepcopy
from cluster_utils import fix_weights
class CentroidIndiv... | exepulveda/swfc | python/clustering_ga.py | Python | gpl-3.0 | 15,844 |
# coding=utf-8
# Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of SickRage.
#
# SickRage is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 ... | Thraxis/pymedusa | sickbeard/name_parser/regexes.py | Python | gpl-3.0 | 23,532 |
#!/usr/bin/env python3
from setuptools import setup, find_packages
def get_readme():
with open("README.md") as f:
return f.read()
setup(name="Flask-API",
version="0.1",
description=("A library for Flask that provides a basic barebones web "
"API to be used and extended.")... | adamcunnington/Flask-API | setup.py | Python | gpl-3.0 | 1,574 |
__author__ = "Christo Robison"
import numpy as np
from scipy import signal
from scipy import misc
import h5py
from PIL import Image
import os
import collections
import matplotlib.pyplot as plt
import convertBsqMulti as bsq
import png
'''This program reads in BSQ datacubes into an HDF file'''
def loadBSQ(path = '/ho... | Crobisaur/HyperSpec | Python/loadData2Hdf.py | Python | gpl-3.0 | 5,400 |
# This file is part of Indico.
# Copyright (C) 2002 - 2016 European Organization for Nuclear Research (CERN).
#
# Indico 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 (a... | DavidAndreev/indico | indico_zodbimport/modules/event_types.py | Python | gpl-3.0 | 3,367 |
# gamefactory.py - GameFactory class implementation
#
# Copyright (C) 2009 CptPicard
# Copyright (C) 2008 David Futcher
# Copyright (C) 2008, 2009, 2010, 2011 Eugenio M. Vigo
#
# This file is part of PycTacToe
#
# PycTacToe is free software: you can redistribute it and/or modify it under
# the terms of the GNU General... | emvigo/pyctactoe | pttengine/gamefactory.py | Python | gpl-3.0 | 1,238 |
import argparse
import sys
import dockbot
from dockbot.Error import Error
from dockbot.Dockbot import Dockbot
from dockbot.Config import Config
from dockbot.Image import Image
from dockbot.Container import Container
from dockbot.Slave import Slave
from dockbot.Master import Master
from dockbot.RemoteImage import Remo... | CauldronDevelopmentLLC/dockbot | dockbot/__init__.py | Python | gpl-3.0 | 5,070 |
# Copyright (c) 2015 Aaron Kehrer
# Licensed under the terms of the MIT License
# (see fiddle/__init__.py for details)
# Import standard library modules
import os
# Import additional modules
import chardet
from PyQt4 import QtCore, QtGui
from fiddle.controllers.Editors import *
from fiddle.config import FILE_TYPES,... | akehrer/fiddle | fiddle/controllers/FiddleTabWidget.py | Python | gpl-3.0 | 9,860 |
# -*- coding: utf-8 -*-
# Copyright 2007-2020 The HyperSpy developers
#
# This file is part of HyperSpy.
#
# HyperSpy 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... | dnjohnstone/hyperspy | hyperspy/tests/learn/test_mlpca.py | Python | gpl-3.0 | 2,332 |
# -*- coding: utf-8 -*-
###########################################################################
## Python code generated with wxFormBuilder (version Sep 8 2010)
## http://www.wxformbuilder.org/
##
## PLEASE DO "NOT" EDIT THIS FILE!
##########################################################################... | beiko-lab/gengis | plugins/MultiTreeOptimalCrossingTest/MultiTreeOptimalCrossingTestLayout.py | Python | gpl-3.0 | 9,286 |
# -*- coding: utf-8 -*-
'''
Created on 15 Φεβ 2013
@author: tedlaz
'''
from PyQt4 import QtCore, QtGui,Qt
from collections import OrderedDict
import utils_db as dbutils
import widgets
from utils_qt import fFindFromList
import osyk
#import classwizard_rc
sqlInsertFpr = u'''
INSERT INTO m12_fpr (epon... | tedlaz/pyted | misthodosia/m13a/f_newEmployeeWizard.py | Python | gpl-3.0 | 13,202 |
# Copyright (C) 2015 Tobias Brink
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in ... | t-brink/pscic | psciclib/units.py | Python | gpl-3.0 | 1,401 |
##
## This file is part of the libsigrokdecode project.
##
## Copyright (C) 2014 Torsten Duwe <duwe@suse.de>
## Copyright (C) 2014 Sebastien Bourdelin <sebastien.bourdelin@savoirfairelinux.com>
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public Lic... | zeldin/libsigrokdecode | decoders/timing/pd.py | Python | gpl-3.0 | 4,356 |
class TestCase(object):
pass
class TestStep(object):
pass
class TestSteps(object):
pass
class Requirement(object):
pass
| elyezer/fake_pylarion | pylarion/work_item.py | Python | gpl-3.0 | 142 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
This file is part of XBMC Mega Pack Addon.
Copyright (C) 2014 Wolverine (xbmcmegapack@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 Softwar... | xbmcmegapack/plugin.video.megapack.dev | resources/lib/menus/home_countries_saint_pierre_and_miquelon.py | Python | gpl-3.0 | 1,147 |
from dictutils import find_installed_dictionaries_paths
from app import StarDict, DictionarySettings
import time
DICTS_DIRPATH = './dicts'
SETTINGS_DIRPATH = './settings'
def test():
settings = DictionarySettings(DICTS_DIRPATH, SETTINGS_DIRPATH)
stardict = StarDict(settings)
word_str_list = ['hello', 'h... | solominh/python-stardict | test.py | Python | gpl-3.0 | 1,187 |
#!/usr/bin/env python
from setuptools import setup
if __name__ == "__main__":
setup()
| centaurialpha/pireal | setup.py | Python | gpl-3.0 | 91 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Oct 18 15:53:27 2016
@author: Michael Wu
Benchmark test:
Giving classification performances of:
Random forest(rf), MultitaskDNN(tf),
RobustMultitaskDNN(tf_robust),
Logistic regression(logreg),
Graph convolution(graphconv) ... | bowenliu16/deepchem | examples/benchmark.py | Python | gpl-3.0 | 23,002 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# gingerprawn / api.update / update list manager
#
# Copyright (C) 2011 Wang Xuerui <idontknw.wang@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 ... | xen0n/gingerprawn | gingerprawn/api/update/updlist.py | Python | gpl-3.0 | 840 |
import paho.mqtt.client as mqtt
import time
import json
import sys
import usbtmc
#should be unique for each Ioc
clientId = "itsPowerMeter01Ioc"
subscribeTopic = "itsPowerMeter01/set/#"
publishtopic = "itsPowerMeter01/get"
periodicPollPeriodSecs = 1
# Power meter initialization
usbInst = usbtmc.Instrument(2733, 27)
u... | se-esss-litterbox/ess-its | IceCubeIocPython/OldItsPowerMeterIoc.py | Python | gpl-3.0 | 3,050 |
#!/usr/bin/env python
'''
Pymodbus Asynchronous Client Examples
--------------------------------------------------------------------------
The following is an example of how to use the asynchronous modbus
client implementation from pymodbus.
'''
#------------------------------------------------------------------------... | mjfarmer/scada_py | pymodbus/examples/common/asynchronous-client.py | Python | gpl-3.0 | 5,916 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
""" High-level objects for fields. """
from collections import OrderedDict, defaultdict
from datetime import date, datetime
from functools import partial
from operator import attrgetter
from types import NoneType
import... | kosgroup/odoo | odoo/fields.py | Python | gpl-3.0 | 100,758 |
from ui_main import Ui_reco_mainwin
from ui_dialogs import DebugCommand, Postfix
from ui_slider import RangeSlider
from io_img import Image
from io_config import ConfigFile
from arguments import ParameterWrap
from connector import Connector
from datasets import DatasetFolder
from prj2sin import Prj2sinWrap
from PyQt4.Q... | gnudo/grecoman | src/main.py | Python | gpl-3.0 | 29,750 |
"""
Copyright (C) 2018 Quinn D Granfor <spootdev@gmail.com>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
version 2, as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but
... | MediaKraken/MediaKraken_Deployment | source/common/common_network_steam.py | Python | gpl-3.0 | 1,746 |
#!/usr/bin/env python
##############################################################################
#
# diffpy.pyfullprof by DANSE Diffraction group
# Simon J. L. Billinge
# (c) 2010 Trustees of the Columbia University
# in the City of New York. All rights reserve... | xpclove/autofp | diffpy/pyfullprof/runfullprof.py | Python | gpl-3.0 | 15,164 |
import unittest
import email_handler
class EmailHandlerTest(unittest.TestCase):
def test_tx_email(self):
message = "Subject: License plates scan results\n\n"
ms = email_handler.Emailer()
result = ms.tx_email(message)
self.assertTrue(result) | JBmiog/IOT | server_script/tests/email_handler_tests.py | Python | gpl-3.0 | 279 |
class AbstractPhysicalGPIO():
setup_pins = [] # store pins that are already setup
def setup(self, pin_id, gpio_value_init):
if pin_id not in self.setup_pins:
self.setup_pins.append(pin_id)
self._setup(pin_id, gpio_value_init)
def output(self, pin_id, gpio_value):
... | jdupl/iot | relays/server/gpio.py | Python | gpl-3.0 | 2,640 |
#!/usr/bin/env python3
import argparse
import os
import sys
from ucca.ioutil import get_passages_with_progress_bar, write_passage
desc = """Rename passages by a given mapping of IDs"""
def main(filename, input_filenames, outdir):
os.makedirs(outdir, exist_ok=True)
with open(filename, encoding="utf-8") as f:... | danielhers/ucca | scripts/set_external_id_offline.py | Python | gpl-3.0 | 1,091 |
from django.contrib import admin
from product.models import Category, Product
class CategoryAdmin(admin.ModelAdmin):
fields = ('name', 'description', 'image',)
class ProductAdmin(admin.ModelAdmin):
fields = ('name', 'description', 'price', 'category', 'image',)
# Reqister models for admin part
admin.site.... | Stanislav-Rybonka/spaceshop | product/admin.py | Python | gpl-3.0 | 397 |
#!/usr/bin/env python3
import os
import sys
parentdir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.insert(0, parentdir)
import time
import unittest
import microstacknode.hardware.display.ssd1306
from microstacknode.hardware.display.font import (FourByFiveFont,
... | RobbieClarken/python3-microstacknode | tests/test_display.py | Python | gpl-3.0 | 2,175 |
#!/usr/bin/env python
# Disect the wav data and plot it using pylab.
import pylab
import wave # Contains reference to struct. No point in importing it twice
FORMAT = { "11" : "1b", # Mono, 8-bit sound
"12" : "1h", # Mono, 16-bit sound
"21" : "2b", # Stereo, 8-bit sound
"22" : "2h",... | jakbob/guitarlegend | slask/readwav.py | Python | gpl-3.0 | 1,131 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_jetstream
----------------------------------
Tests for `jetstream` module.
"""
import unittest
from jetstream import jetstream
class TestJetstream(unittest.TestCase):
def setUp(self):
pass
def test_something(self):
pass
def tear... | koodaamo/jetstream | tests/test_jetstream.py | Python | gpl-3.0 | 392 |
# Copyright (C) 2016-2019 Dmitry Marakasov <amdmi3@amdmi3.ru>
#
# This file is part of repology
#
# repology 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 optio... | repology/repology | repology/parsers/parsers/freebsd.py | Python | gpl-3.0 | 2,078 |
# -*- coding: iso-8859-15 -*-
#
# Testing Suite for >> Get_Channels.py [QGIS Version]
#
# Copyright (C) 2017 J. Vicente Perez, Universidad de Granada
#
# 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 ... | geolovic/TProfiler | Tools/debug/Chi_Map_QGIS_testing_suite.py | Python | gpl-3.0 | 6,907 |
from django.db import models
from django.core.exceptions import ValidationError
# Create your models here.
class Etudiant(models.Model):
"""
Représente un étudiant qui peut "sous-titrer". Les champs "uidNumber" et
"uid" identifient l'étudiant dans l'annuaire LDAP de
l'établissement.
"""
uidNu... | georgesk/webvtt-editor | video/models.py | Python | gpl-3.0 | 2,689 |
import math
import os
import re
import signal
import sys
import matplotlib
from matplotlib import verbose
from matplotlib.cbook import is_string_like, onetrue
from matplotlib.backend_bases import RendererBase, GraphicsContextBase, \
FigureManagerBase, FigureCanvasBase, NavigationToolbar2, IdleEvent, \
curso... | alephu5/Soundbyte | environment/lib/python3.3/site-packages/matplotlib/backends/backend_qt4.py | Python | gpl-3.0 | 31,660 |
#!/usr/bin/env python
import os.path
import sys
import glob
import numpy
import pylab
import expected_frequencies
import defs
import stft
import partials
try:
dirname = sys.argv[1]
except:
print "Need dirname, and optional maximum frequency"
try:
min_freq = float(sys.argv[2])
max_freq = float(sys.a... | gperciva/artifastring | research/mode-detect/plot-harmonics.py | Python | gpl-3.0 | 3,185 |
################################################################################
## ##
## This file is a part of TADEK. ##
## ... | tadek-project/tadek-common | tests/engine/channels/helpers.py | Python | gpl-3.0 | 5,647 |
#!/usr/local/bin/python3
def one(alist):
for passnum in range(len(alist)-1,0,-1):
for i in range(passnum):
if alist[i]>alist[i+1]:
temp = alist[i]
alist[i] = alist[i+1]
alist[i+1] = temp
alist = [54,26,93,17,77,31,44,55,20]
print(alist)
one(alist... | ShaftesburySchoolDorset/PythonChallenges | algorithm_identification/1.py | Python | gpl-3.0 | 334 |
import IMP
import IMP.test
import IMP.core
import IMP.atom
class Tests(IMP.test.TestCase):
def test_bonded(self):
"""Check close and destroy Hierarchy """
m = IMP.Model()
mh = IMP.atom.read_pdb(self.get_input_file_name("mini.pdb"), m)
nump = len(m.get_particle_indexes())
m... | shanot/imp | modules/atom/test/test_clone.py | Python | gpl-3.0 | 1,208 |
# -*- coding: utf-8 -*-
#############################
# Light IMDb Ratings Update #
# by axlt2002 #
#############################
# changes by dziobak #
#############################
import xbmc, xbmcgui
import sys
if sys.version_info >= (2, 7): import json as jSon
else: import simplejson as jSon... | axlt2002/script.light.imdb.ratings.update | resources/core/update_main.py | Python | gpl-3.0 | 10,373 |
from tkinter import *
root = Tk()
some = Label(root, text="Tk's job!!", width="30", height="5")
some.pack()
root.mainloop()
| flake123p/ProjectH | Python/_Basics2_/UI_Tk/tkui.py | Python | gpl-3.0 | 126 |
"""
Copyright (C) 2014 Delft University of Technology, The Netherlands
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 lat... | jkokorian/ODMAnalysis | odmanalysis/scripts/ViewCyclesInteractive.py | Python | gpl-3.0 | 3,813 |
from django.conf.urls import patterns, include, url
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
from django.conf.urls.i18n import i18n_patterns
admin.autodiscover()
urlpatterns = patterns('',
# Examples:
# url(r'^$', 'votainteligente.views.home', name='home'),
... | lfalvarez/nouabook | votainteligente/urls.py | Python | gpl-3.0 | 1,050 |
# -*- coding: utf-8 -*-
"""
Traces: Activity Tracker
Copyright (C) 2015 Adam Rule
with Aurélien Tabard, Jonas Keper, Azeem Ghumman, and Maxime Guyaux
Inspired by Selfspy and Burrito
https://github.com/gurgeh/selfspy
https://github.com/pgbovine/burrito/
You should have received a copy of the GNU General Public License... | activityhistory/traces | traces/recorders/scroll_recorder.py | Python | gpl-3.0 | 1,355 |
# coding=UTF-8
# Author: Dennis Lutter <lad1337@gmail.com>
#
# This file is part of Medusa.
#
# Medusa 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... | fernandog/Medusa | tests/legacy/db_tests.py | Python | gpl-3.0 | 1,788 |
"""Pylons middleware initialization"""
from beaker.middleware import SessionMiddleware
from paste.cascade import Cascade
from paste.registry import RegistryManager
from paste.urlparser import StaticURLParser
from paste.deploy.converters import asbool
from pylons.middleware import ErrorHandler, StatusCodeRedirect
from p... | mtholder/phyloplumber | phyloplumber/config/middleware.py | Python | gpl-3.0 | 3,125 |
from PyQt4.Qt import QApplication, QMessageBox, QDialog, QInputDialog, QLineEdit, QVBoxLayout, QLabel, QThread, SIGNAL
import PyQt4.QtCore as QtCore
from binascii import unhexlify
from binascii import hexlify
from struct import pack,unpack
from sys import stderr
from time import sleep
import electrum
from electrum_gui... | gamecredits-project/electrum-client | plugins/btchipwallet.py | Python | gpl-3.0 | 23,308 |
"""spaCy
Run spaCy tools and pipelines on your datasets.
Currently only includes tokenization, but this could be expanded to include
many more of spaCy's tools.
Or, if you want a different tool/pipeline, you could create your own
module type following the same approach.
""" | markgw/pimlico | src/python/pimlico/modules/spacy/__init__.py | Python | gpl-3.0 | 278 |
from django.contrib import admin
from . import models
from django_markdown.admin import MarkdownModelAdmin
from django_markdown.widgets import AdminMarkdownWidget
from django.db.models import TextField
# Register your models here.
class SnippetTagAdmin(admin.ModelAdmin):
list_display = ('slug',)
class SnippetAdm... | craigderington/django-code-library | snippets/admin.py | Python | gpl-3.0 | 978 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
"""
get_image_size.py
====================
:Name: get_image_size
:Purpose: extract image dimensions given a file path
:Author: Paulo Scardine (based on code from Emmanuel VAÏSSE)
:Created: 26/09/2... | evilhero/mylar | lib/get_image_size.py | Python | gpl-3.0 | 12,859 |
#
# Copyright (C) 2003-2022 Sébastien Helleu <flashcode@flashtux.org>
#
# This file is part of WeeChat.org.
#
# WeeChat.org 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
#... | weechat/weechat.org | weechat/doc/models.py | Python | gpl-3.0 | 9,804 |
'''
Created on 12.03.2016
@author: michael
'''
import unittest
from unittest.mock import MagicMock
from alexandriabase.daos import CreatorDao
from alexandriabase.domain import Creator
from alexandriabase.services import CreatorService
class CreatorServiceTest(unittest.TestCase):
def testFindVisible(self):
... | archivsozialebewegungen/AlexandriaBase | tests/servicestests/test_creator_service.py | Python | gpl-3.0 | 732 |
#!/usr/bin/env python3
# This file is part of OpenSoccerManager.
#
# OpenSoccerManager 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 ver... | OpenSoccerManager/opensoccermanager | structures/filters.py | Python | gpl-3.0 | 2,796 |
#!/usr/bin/env python3
# This file is part of OpenSoccerManager.
#
# OpenSoccerManager 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 ver... | OpenSoccerManager/opensoccermanager | uigtk/mainscreen.py | Python | gpl-3.0 | 1,395 |
import glob
import os
import matplotlib.pyplot as plt
import pytest
from mtpy.imaging.plotnresponses import PlotMultipleResponses
from tests.imaging import ImageTestCase, ImageCompare
def _expected_compare_fail():
pytest.xfail("expected to be different, check the result image manually")
test_params = [
(
... | MTgeophysics/mtpy | tests/imaging/test_plotMultipleResponses.py | Python | gpl-3.0 | 3,740 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Lucterios mailing documentation build configuration file, created by
# sphinx-quickstart on Tue Dec 22 17:11:37 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in... | Lucterios2/contacts | lucterios/mailing/docs/fr/conf.py | Python | gpl-3.0 | 9,330 |
from ..core import mi, nmi
from .base import (AlphaAngleBaseMetric, ContactBaseMetric, DihedralBaseMetric,
BaseMetric)
import numpy as np
from itertools import combinations_with_replacement as combinations
from multiprocessing import Pool
from contextlib import closing
__all__ = ['AlphaAngleMutual... | cxhernandez/mdentropy | mdentropy/metrics/mutinf.py | Python | gpl-3.0 | 2,347 |
"""
A module to compute cosmological distances, including:
comoving_distance (Dc)
angular_diameter_distance (Da)
luminosity_distance (Dl)
comoving_volume (volume)
"""
c = 299792458.
G = 4.3e-6
from math import pi
import warnings
warnings.warn("Default cosmology is Om=0.3,Ol=0.7,h=0.7,w=-1 and distance ... | eggplantbren/Lensing2 | src/distances.py | Python | gpl-3.0 | 4,646 |
import git
def download_repos(dst, repos):
"""
handles downloading paginated gists
Arguments
---------
dst : string
folder to write repositories to
repos : array-like of git.repo.base.Repo
repositories to download
"""
for repo in repos:
try:
# we c... | cameres/github-dl | download/download_repos.py | Python | mpl-2.0 | 779 |
# -*- coding: utf-8 -*-
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import
import base64
import os
import cli_common.taskcluster
im... | srfraser/services | src/releng_notification_identity/settings.py | Python | mpl-2.0 | 1,192 |
done: List[bool] = [False, False, False]
x: int = 3 if done[0] else -3
# FINAL: done -> 0@[0, 0], 1@[0, 0], 2@[0, 0], _@⊥; len(done) -> [3, 3]; x -> [-3, -3]
| caterinaurban/Lyra | src/lyra/unittests/numerical/interval/forward/indexing3/subscriptions3.py | Python | mpl-2.0 | 161 |