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: iso-8859-1 -*-
# Finding land use at an observing station in ISTI located at (stlat, stlong) using the ESA-CCI land use data set. N/S are +/-; W/E are -/+.
# LAND USE FLAG MEANINGS. VALUES ARE IN BYTE FORMAT, RANGE -128 to +128
#0 no_data
#10 cropland_rainfed
#11 herbaceous_cover
#12 tree_or_shrub_c... | SurfaceTemp/ISTI_Clean_Worlds | station_9pixels_landuse_ISTI3.py | Python | cc0-1.0 | 12,549 |
# -*- coding: utf-8 -*-
"""
Created on Tue Jun 25 09:09:18 2019
@author: CHaithcock
"""
CAR_SYMBOLS = ['Q', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'J', 'K', 'L']
TRUCK_SYMBOLS = ['T', 'R', 'W', 'Z']
CAR_COLORS_RGB = ['7FFF00', '7FFFD4', 'D2691E', '8B008B', 'BDB76B',\
'8B0000', 'FF1493', '1E90FF'... | crhaithcock/RushHour | RHGraph/RHConstants.py | Python | cc0-1.0 | 1,252 |
import numpy as np
print sum(int(k) for k in str(2**1000)) | JesperDramsch/ProjectEuler | A016.py | Python | gpl-2.0 | 61 |
from PIL import Image, ImageEnhance
from celery import shared_task
def reduce_opacity(im, opacity):
"""Returns an image with reduced opacity."""
assert opacity >= 0 and opacity <= 1
if im.mode != 'RGBA':
im = im.convert('RGBA')
else:
im = im.copy()
alpha = im.split()[3]
alpha =... | dogancankilment/dck-blog | utils/util_watermark_images.py | Python | gpl-2.0 | 1,716 |
import copy
import mwparserfromhell
import re
from dateutil.parser import parse as dateparser
from localwiki.utils.urlresolvers import reverse
from django.http import HttpResponse, HttpResponseRedirect, Http404, HttpResponseNotFound
from django.utils.translation import ugettext as _
from django.template.context import... | lowiki-org/localwiki-backend-server | localwiki/tags/views.py | Python | gpl-2.0 | 18,843 |
from __future__ import unicode_literals
from django.contrib import admin
from .models import DiscourseUser
class DiscourseUserAdmin(admin.ModelAdmin):
list_display = ('user',)
search_fields = ('user__username',)
admin.site.register(DiscourseUser, DiscourseUserAdmin)
| iAddz/allianceauth | services/modules/discourse/admin.py | Python | gpl-2.0 | 286 |
# -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 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 your opt... | kaplun/Invenio-OpenAIRE | modules/miscutil/lib/plotextractor_getter.py | Python | gpl-2.0 | 23,320 |
#!/usr/bin/env python
# Based on Morningstar documentation here
# http://www.morningstarcorp.com/wp-content/uploads/2014/02/TSMPPT.APP_.Modbus.EN_.10.2.pdf
# and heavily modified version of the script here
# http://www.fieldlines.com/index.php?topic=147639.0
import time
counter = 0
import sys
if len(sys.argv) <= 1:... | brocktice/tristar-python-modbus | read_registers.py | Python | gpl-2.0 | 2,764 |
# -*- coding: utf-8 -*-
"""
***************************************************************************
ExportGeometryInfo.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
********************... | bstroebl/QGIS | python/plugins/sextante/algs/ftools/ExportGeometryInfo.py | Python | gpl-2.0 | 6,111 |
import os
import threading
import queue
import pygame
from validador import *
from fractions import gcd
from datetime import datetime
from Menu import *
from Variable import *
class Polling:
def __init__(self,accion,**parametros):
self.accion = accion
self.parametro... | pepitogithub/PythonScripts | Aplicacion.py | Python | gpl-2.0 | 16,362 |
'''
Provided so that we can build docs without needing to have any
dependencies installed (such as for RTFD).
Derived from http://read-the-docs.readthedocs.org/en/latest/faq.html
'''
import sys
class Mock(object):
__all__ = []
def __init__(self, *args, **kwargs):
pass
def __ca... | eri-trabiccolo/exaile | doc/mocks.py | Python | gpl-2.0 | 1,467 |
import numpy as np
import tables
import os
from util import ObsFile, FileName, utils
def displayCentroidResult(obsFileIn, time):
'''
To show an image with the location of the centroid
measured by CentroidCalc marked on top. Use for diagnostic purposes.
INPUTS:
obsFileIn - either an ObsFil... | bmazin/ARCONS-pipeline | astrometry/displayCentroidResult.py | Python | gpl-2.0 | 2,125 |
"""Teleport platform bound to a spaceship."""
from lib.obj.stationary import Stationary
class TeleportPlatform(Stationary):
"""Teleport platform bound to a spaceship.
Can transport players between adjacent spaceships.
"""
def __init__(self):
super(TeleportPlatform, self).__init__(
... | ruslanosipov/space | lib/obj/teleportplatform.py | Python | gpl-2.0 | 1,382 |
from PyQt4.QtCore import QSettings
SRC_DIR = "DelimitationToolbox/src_directory"
CSV_FILE = "DelimitationToolbox/csv_file"
KML_OUT = "DelimitationToolbox/kml_out"
Settings = QSettings()
def read(key):
return Settings.value(key, "")
def store(key, value):
Settings.setValue(key, value)
| seanlinmt/DelimitationToolbox | qgis_settings.py | Python | gpl-2.0 | 301 |
from sofia.execution_engines.low_memory_engine import LowMemoryExecutionEngine
from sofia.execution_engines.parallel_engine import ParallelExecutionEngine
from sofia.execution_engines.simple_engine import SimpleExecutionEngine
from sofia.execution_engines.workers.parallel_worker import parallel_worker
| childsish/sofia | sofia/execution_engines/__init__.py | Python | gpl-2.0 | 303 |
from Experiment import Experiment
import Phantoms
class RandomSpheres(Experiment):
directory="/home/bnorthan/Brian2014/Images/General/Deconvolution/Phantoms/RandomSpheres2/"
def __init__(self, measurementSizeX, measurementSizeY, measurementSizeZ, psfSizeX, psfSizeY, psfSizeZ, homeDirectory):
Experiment.__init__(... | bnorthan/projects | Scripts/Jython/Phantoms/Experiments/RandomSpheres.py | Python | gpl-2.0 | 993 |
"""Programa on introdueixes 2 numeros i et diu si el primer numero es igual o no"""
NUMERO1 = int(input("Escriu el primer numero"))
NUMERO2 = int(input("Escriu el segon numero"))
if NUMERO1 == NUMERO2:
print("El numero", NUMERO1, "es igual que el numero", NUMERO2)
else:
if NUMERO1 != NUMERO2:
pri... | Xavi03/M9-UF2-Xavi_Perez | Exercici4.py | Python | gpl-2.0 | 385 |
# -*- 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/plugins/checkers/rpminspect_rpm.py | Python | gpl-2.0 | 2,593 |
#
# 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/gui/autocomp.py | Python | gpl-2.0 | 8,098 |
# vim:ts=4:et
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This prog... | taniwha-qf/cfgnode | mftgen.py | Python | gpl-2.0 | 4,758 |
names_scores = (('Amy', 82, 90), ('John', 33, 64), ('Zoe', 91, 94))
highs = []
for x, y, z in names_scores:
if y >= 90 and z >= 90:
highs += [x, y, z]
print(highs)
| yehnan/python_book_yehnan | ch02/ch02_for_multiple.py | Python | gpl-2.0 | 186 |
# Phases for legacy (module rather than plugin) build process which is still used for:
# wp, ie, web, chrome, safari, firefox
from os import path
_icon_path_for_customer = {
"safari": "development/forge.safariextension/",
"firefox": "development/firefox/",
"wp": "development/wp/dist/"
}
locations = {
'firefox': ... | levexis/number-tennis | forge-tennis/.template/generate_dynamic/legacy_phases.py | Python | gpl-2.0 | 4,334 |
#!/usr/bin/env python3
"""
fritzbox_cpu_temperature - A munin plugin for Linux to monitor AVM Fritzbox
Copyright (C) 2015 Christian Stade-Schuldt
Author: Christian Stade-Schuldt
Like Munin, this plugin is licensed under the GNU GPL v2 license
http://www.opensource.org/licenses/GPL-2.0
Add the following sect... | Tafkas/fritzbox-munin | fritzbox_cpu_temperature.py | Python | gpl-2.0 | 2,009 |
from django.core.management import BaseCommand
from labshare.utils import determine_failed_gpus, publish_gpu_states, check_reservations
class Command(BaseCommand):
help = "Updates reservations and GPU states and sends mails for failed devices based on the latest GPU info"
def handle(self, *args, **options):... | Bartzi/LabShare | labshare/management/commands/update.py | Python | gpl-2.0 | 413 |
#!/usr/bin/env python
# Copyright (c) 2002 Brad Stewart
#
# 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 pro... | yuxans/badgirl | src/seen.py | Python | gpl-2.0 | 9,276 |
import pytest
from cfme.utils.conf import cfme_data
from cfme.configure.configuration.region_settings import RedHatUpdates
from cfme.fixtures.pytest_store import store
from cfme.test_framework.sprout.client import SproutClient, SproutException
from cfme.utils import conf
from cfme.utils.appliance import find_appliance... | anurag03/integration_tests | cfme/tests/cli/test_appliance_update.py | Python | gpl-2.0 | 5,989 |
#!/usr/bin/python
from subprocess import *
from time import sleep, strftime
from datetime import datetime
import urllib
import urllib2
import json
import sys
#################
# BOX constants #
#################
boxId = 1
boxLatitude = 53.3430708
boxLongitude = -6.2747221
questionId = ""
question = ""
if len(sys.ar... | global-urban-datafest/citybuzz | Hardware/getQuestion.py | Python | gpl-2.0 | 1,108 |
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()
# #For a single value of V2, sweep V1 around V2 in fine increments while measuring Vou... | dimitdim/ElectronAdventures | lab8/experiment2.py | Python | gpl-2.0 | 1,460 |
from __future__ import absolute_import
# Copyright (c) 2010-2015 openpyxl
#
# 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 u... | maheshcn/memory-usage-from-ldfile | openpyxl/xml/__init__.py | Python | gpl-2.0 | 1,899 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'kodosBA.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(s):
... | bjmc/kodos | modules/kodosBA.py | Python | gpl-2.0 | 710 |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Category'
db.create_table(u'category_category', (
... | umax/diabetto2 | category/migrations/0001_initial.py | Python | gpl-2.0 | 1,038 |
#Copyright (C) 2005 Free Software Foundation
#Age of Students 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.
#Age of Students is distri... | saulotoledo/AgeOfStudents | modules/gamecontrol.py | Python | gpl-2.0 | 10,431 |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 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 later... | lnielsen/invenio-records | invenio_records/tasks/api.py | Python | gpl-2.0 | 1,546 |
#
# An implementation of the RFC 6238 time based OTP protocol on an AtTiny85 microcontroller
#
# Copyright (C) 2017 Adam Reid
#
# 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 versio... | areid-van/usb-otp | usbmfa.py | Python | gpl-2.0 | 3,009 |
# Rekall Memory Forensics
#
# Based on original code by:
# Copyright (C) 2007-2013 Volatility Foundation
#
# Authors:
# Michael Hale Ligh <michael.ligh@mnin.org>
#
# This code:
# Copyright 2014 Google Inc. All Rights Reserved.
#
# Authors:
# Michael Cohen <scudette@google.com>
#
# This program is free software; you can... | palaniyappanBala/rekall | rekall-core/rekall/plugins/windows/malware/apihooks.py | Python | gpl-2.0 | 21,968 |
# -*- coding: utf-8 -*-
# Copyright (C) 2014 Daniel Carvalho <idnael@pegada.net>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your ... | idnael/ctxsearch | ctxsearch/config.py | Python | gpl-2.0 | 2,814 |
import uinput
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
#red=left, pin 11
LEFT_PIN = 11
#orange=right, pin 8
RIGHT_PIN = 8
#yellow=up, gpio pin 24
UP_PIN = 24
#green=down, pin 23
DOWN_PIN = 23
#black=gnd
FIRE_PIN = 7
GPIO.setup(FIRE_PIN, GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.setup(UP_PIN, GPIO.IN... | novelcoder/Raspberry-Pi-Arcade | JoystickToKeyboard.py | Python | gpl-2.0 | 1,917 |
from distutils.core import setup
from Cython.Build import cythonize
setup(
name = "ODEApp",
ext_modules = cythonize('*.pyx'),
)
| navoj/ecell4 | ecell4/ode/setup.py | Python | gpl-2.0 | 137 |
from django.shortcuts import render_to_response
from django.http import HttpResponseRedirect
from django.template import RequestContext
from django.core.urlresolvers import reverse
from servers.models import Compute
from secrets.forms import AddSecret
from vrtManager.secrets import wvmSecrets
from libvirt import lib... | harry-ops/opencloud | webvirtmgr/secrets/views.py | Python | gpl-2.0 | 2,287 |
#!/usr/bin/env python
#-*- coding: utf-8 -*-
# ===========================================================================
# eXe
# Copyright 2004-2005, University of Auckland
# Copyright 2004-2008 eXe Project, http://eXeLearning.org/
# Copyright 2008-2014 eXeLearning.net, http://exelearning.net/
#
# This program is fre... | pedropena/iteexe | exe/export/imsexport.py | Python | gpl-2.0 | 32,489 |
# -*- coding: utf-8 -*-
# (C) Copyright 2015 Hewlett Packard Enterprise Development LP
# All Rights Reserved.
#
# 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.ap... | open-switch/ops-cli | ops-tests/component/test_vtysh_ct_bgp_ip_prefix_cli.py | Python | gpl-2.0 | 19,612 |
from xl.nls import gettext
def N_(x):
return x
class _TD(object):
__slots__ = [
'name', # descriptive name
'translated_name', # translated name
'tag_name', # raw tag name
'type',
'editable',
'min',
'max',
'use_disk', # set true if should r... | genodeftest/exaile | xl/metadata/tags.py | Python | gpl-2.0 | 4,224 |
#!/usr/bin/python
import requests
import sys
print ("Parametros : " + str(sys.argv))
print ("Parametros : " + str(len(sys.argv)))
file_base_name = './bases/base_user.json'
if len(sys.argv) == 2:
file_base_name = sys.argv[1]
print ("Nome do arquivo : " + file_base_name)
url = 'http://lbgenerator.herokuapp.com'
f... | lightbase/LBApp | versions/1__cria_base_user.py | Python | gpl-2.0 | 561 |
import os
from .data_source import DataSource
TRACI_VERSIONS = {
'2.1' : {
'ds_type': 'Traci21Factors',
'filename': 'traci_2_1_2014_dec_10_0.xlsx'
}
} # would be great for this to be downloadable somewhere
class TraciConfig(DataSource):
_prefix = 'local.lcia.traci'
_ifaces = ('ind... | bkuczenski/lca-tools | antelope_catalog/data_sources/traci.py | Python | gpl-2.0 | 1,532 |
import turtle
bob = turtle.Turtle()
print(bob)
dic1 = {'a': 1, 'b': 2, 'c': 1, 'd': 1}
dic2 = {'a': 1, 'b': 2, 'c': 1, 'd': 2}
dic0 = {'a': 2}
def passando(dic):
new_mod = {}
for i in sorted(dic.keys()):
if dic[i] == 1:
new_mod[i] = dic1
elif dic[i] == 2:
new_mod[i] = d... | zambrinf/python | kochsnowflake.py | Python | gpl-2.0 | 900 |
from __future__ import division
import SW
import sys
import minmax
import numpy as np
import pylab
# Author: Dan Roth
# E-mail: Daniel.Edward.Roth@gmail.com
# Date: Dec 2013
# General scheme:
# 1) Find nparticular at an easy temp (say, 300k) by hand
# ___
# |2) Using that nparticular, find maximum in Phi
# |3) The de... | droundy/deft | papers/thesis-roth/figs/npart_SW.py | Python | gpl-2.0 | 3,756 |
import json
import collections
import errno
from flux._kvs import ffi, lib
from flux.wrapper import Wrapper, WrapperPimpl
class KVSWrapper(Wrapper):
# This empty class accepts new methods, preventing accidental overloading
# across wrappers
pass
RAW = KVSWrapper(ffi, lib, prefixes=['kvs', 'kvs_'])
# over... | lipari/flux-core | src/bindings/python/flux/kvs.py | Python | gpl-2.0 | 9,311 |
# -*- coding: utf-8 -*-
#
#
# (DC)² - DataCenter Deployment Control
# Copyright (C) 2010, 2011, 2012, 2013, 2014 Stephan Adig <sh@sourcecode.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; ... | sadig/DC2 | components/dc2-dhcp-appserver/dc2/dhcp/appserver/dhcp_rpcmethods/__init__.py | Python | gpl-2.0 | 886 |
from builtins import str
from builtins import object
import os, re
import xbmcvfs
import util
from util import Logutil as log
from gamedatabase import Game, GameView, File
class ArtworkUpdater(object):
def __init__(self, progress_dialog, gdb, config_object):
self.progress_dialog = progress_dialog
... | maloep/romcollectionbrowser | resources/lib/artworkupdater.py | Python | gpl-2.0 | 8,257 |
from pg_shards.libs.validators import ValidationError
class NoSQLProperty:
"""
A specialized property descriptor
that directs input/output to a target dictionary.
"""
def __init__(self, fget=None, fset=None, fdel=None, doc=None,
target=None, default=None, onupdate=None, ... | fiacre/FMCSA-scraper | db/nosql_property.py | Python | gpl-2.0 | 4,263 |
# encoding: utf-8
# module PyKDE4.kio
# from /usr/lib/python2.7/dist-packages/PyKDE4/kio.so
# by generator 1.135
# no doc
# imports
import PyKDE4.kdeui as __PyKDE4_kdeui
import PyQt4.QtCore as __PyQt4_QtCore
import PyQt4.QtGui as __PyQt4_QtGui
class KNameAndUrlInputDialog(__PyKDE4_kdeui.KDialog):
# no doc
de... | ProfessorX/Config | .PyCharm30/system/python_stubs/-1247972723/PyKDE4/kio/KNameAndUrlInputDialog.py | Python | gpl-2.0 | 721 |
"""
Palindrome REST Web Service
Copyright (C) 2015 Pierre Jodouin
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 lat... | pjodouin/palindrome | rest/models.py | Python | gpl-2.0 | 1,702 |
import numpy as np
import pylab as pp
class Pump(object):
"""Represents a pump in an EPANET model."""
def __init__(self, pump_name, node_1, node_2, parameter,diameter = 100,Pump_Location = None,wallThickness = None,modulus = None,roughness = 10**-6):
"""Create a new pump.
Instance variables:
pump_name -- na... | richpaulcol/PWG-Transient-Solver | elements/pump.py | Python | gpl-2.0 | 2,053 |
### Auto-Importing all modules.
import kernel
import domain
import interfaces
import macosx
import path
import ps
import pythonversion
import timezone
import uptime
def funcList():
list = ['kernel','domain','interfaces','macosx','path','ps','pythonversion','timezone','uptime']
return list
| waldman/pycter | darwin/__init__.py | Python | gpl-2.0 | 309 |
import gi
gi.require_version('Gtk', '3.0')
#gi.require_version('Granite', '1.0')
from gi.repository import Gtk
class FormatBar(Gtk.Box):
def __init__(self):
Gtk.Box.__init__(self)
Gtk.StyleContext.add_class(self.get_style_context(), "linked")
# bold
self.bold = Gtk.ToggleButton(... | SuburbanFilth/Noted | noted/format_toolbar.py | Python | gpl-2.0 | 4,858 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
__license__ = """
This file is part of RasPy.
RasPy is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your opti... | bibi21000/RasPy | src/raspy/servers/fake.py | Python | gpl-2.0 | 3,528 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'Yan Yan'
'''
Default configurations.
'''
configs = {
'db': {
'host': '127.0.0.1',
'port': 3306,
'user': 'www-data',
'password': 'www-data',
'database': 'awesome'
},
'session': {
'secret': 'AwEsOmE'... | Byronic94/py-blog | www/config_default.py | Python | gpl-2.0 | 329 |
import select
import SocketServer
import threading
import time
import socks
def send_all(sock, data):
bytes_sent = 0
while True:
r = sock.send(data[bytes_sent:])
if r < 0:
return r
bytes_sent += r
if bytes_sent == len(data):
return bytes_sent
class For... | hhaoyan/utilities | forward_gmail.py | Python | gpl-2.0 | 2,831 |
#
# Copyright (C) 2018-2019 Nexedi SA
#
# 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... | Nexedi/neoppod | neo/storage/shared_queue.py | Python | gpl-2.0 | 6,156 |
import unittest
from aprslib.parsing.misc import parse_status, parse_invalid, parse_user_defined
class MiscTC(unittest.TestCase):
def test_status(self):
body = "test status text "
_, result = parse_status('>', body)
self.assertEqual(result['format'], 'status')
self.assertEqual(r... | rossengeorgiev/aprs-python | tests/test_parse_misc.py | Python | gpl-2.0 | 1,171 |
import paho.mqtt.client as mqtt
import unicornhat as UH
import time, colorsys, thread
import simplejson as json
import random
import numpy as np
from time import sleep
import sys
working = False
contWorking = False
# Set the UH to full white
def uh_setFullColour(r, g, b, brightness = 0.2):
UH.off()
UH.brightn... | raruston/nodered-mqtt-unicornhat-demo | python/uhcontrol.py | Python | gpl-2.0 | 3,933 |
def linear_search(lst, value):
""" (list, object) -> int
Return the index of the first occurrence of value in lst, or return
-1 if value is not in lst.
>>> linear_search([2, 5, 1, -3], 5)
1
>>> linear_search([2, 4, 2], 2)
0
>>> linear_search([2, 5, 1, -3], 4)
-1
>>> linear_sear... | simontakite/sysadmin | pythonscripts/practicalprogramming/searchsort/linear_search_1.py | Python | gpl-2.0 | 672 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# This is derived from a cadquery script for generating QFP models in X3D format.
#
# from https://bitbucket.org/hyOzd/freecad-macros
# author hyOzd
#
# Dimensions are from Jedec MS-026D document.
## requirements
## cadquery FreeCAD plugin
## https://github.com/jmwright/ca... | easyw/kicad-3d-models-in-freecad | cadquery/FCAD_script_generator/Capacitor_THT/cq_models/c_rect_tht.py | Python | gpl-2.0 | 6,043 |
# -*- coding: utf-8 -*-
#
# This file is part of breezedb - https://github.com/RMed/breezedb_python
#
# Copyright (C) 2013-2014 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 t... | rmed/breezedb_python | breezedb/_version.py | Python | gpl-2.0 | 942 |
# This Python file uses the following encoding: utf-8
# The RDSI - ALLOCATION REQUEST MANAGEMENT SYSTEM
# Copyright (C) 2015 Queensland Cyber Infrastructure Foundation (http://www.qcif.edu.au/)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public Licen... | qcif/rdsi-arms | src/main/config/portal/default/rdsi/scripts/docxexporter.py | Python | gpl-2.0 | 12,415 |
from nose.tools import *
from nginxgraph.nginxgraph import Nginxgraph
from StringIO import StringIO
import mock #?
class Nginxgraph_tests(object):
def setUp(self):
test_file = StringIO()
test_file.write('93.184.216.119 - - [12/Jul/2013:15:00:11 +0000]\
"CONNECT mattscodecave.com:443 HTTP... | sirMackk/nginxgraph | tests/nginx_tests.py | Python | gpl-2.0 | 2,497 |
#!/usr/bin/python
import sys, traceback
import cv2
import numpy as np
import argparse
import string
import plantcv as pcv
### Parse command-line arguments
def options():
parser = argparse.ArgumentParser(description="Imaging processing with opencv")
parser.add_argument("-i", "--image", help="Input image file.", req... | dlebauer/plantcv | scripts/dev/vis_tv_z3500_L1_young.py | Python | gpl-2.0 | 5,082 |
import os
import sys
import re
from operator import itemgetter
class CToken:
def __init__(self,value,token_id=None,sentence=None,offset=None):
self.token_id = token_id
self.sentence = sentence
self.offset = offset
self.annotation_id = ''
self.value = value
def _... | rubenIzquierdo/converter_mpqa_to_kafnaf | python_libs/mpqa_readers.py | Python | gpl-2.0 | 7,947 |
__all__ = ["OneDim", "TwoDim", "Point"]
| innisfree/superplot | statslib/__init__.py | Python | gpl-2.0 | 40 |
#!/usr/bin/env python
# Copyright (C) 2015 Thomas Huang
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 2 of the License.
#
# This program is distributed in the hope that it will be us... | whiteclover/solo | solo/web/asset.py | Python | gpl-2.0 | 5,584 |
##############################################################################
#
# Zope Public License (ZPL) Version 1.0
# -------------------------------------
#
# Copyright (c) Digital Creations. All rights reserved.
#
# This license has been certified as Open Source(tm).
#
# Redistribution and use in source and bin... | Pikecillo/genna | external/PyXML-0.8.4/test/domapi/Base.py | Python | gpl-2.0 | 9,129 |
from PySide.QtCore import *
from PySide.QtGui import *
class Edit(QDialog):
def __init__(self, string, parent=None):
super(Edit, self).__init__(parent)
eLabel = QLabel('Edit Fruit %s'%string)
self.eEdit = QLineEdit()
eLabel.setBuddy(self.eEdit)
eButtonBox = QDialogButtonBo... | shashi28/pqn | Program 1/stringedit.py | Python | gpl-2.0 | 730 |
import os
class Plugin:
def __init__(self, data_dir, repo_dir=None):
self.data_dir = data_dir
self.repo_dir = '/' if repo_dir is None else repo_dir
if not os.path.isdir(self.data_dir):
os.makedirs(self.data_dir)
self.setup_data()
# does plugin-specific setting up... | Cube777/dotgit | dotgit/plugin.py | Python | gpl-2.0 | 1,465 |
from django.contrib.auth.decorators import login_required
from django.shortcuts import render, redirect
from api import models
from .forms import SingleEventDistributionSiteDetailForm
def index_view(request):
# User is already assigned to an event/distribution site. Get to work!
if hasattr(request.user, 'even... | atogle/assisi | src/web/views.py | Python | gpl-2.0 | 2,877 |
#!/usr/bin/env python3
import os
import sys
import argparse
############################
# Parses Arma 3 output of #
# weapons with compatible #
# items to SQL script #
# #
# Requires every weapon to #
# have at least one item #
############################
######## GLOBALS ########... | Theseus-Aegis/tac-a3-core | tools/parseCompatibleItems.py | Python | gpl-2.0 | 3,993 |
#
#
# A file which generates a frequency vs current curve for various cells
#
# Author: Padraig Gleeson
#
# This file has been developed as part of the neuroConstruct project
# This work has been funded by the Medical Research Council and the
# Wellcome Trust
#
#
from sys import *
from java.io... | pgleeson/TestArea | models/GranCell_Dan_analysis/GenerateF_ICurve.py | Python | gpl-2.0 | 9,286 |
# -*- coding: utf-8 -*-
# slip.dbus.constants -- constant values
#
# Copyright © 2011 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 2 of the License, or
# (at y... | nphilipp/python-slip | slip/dbus/constants.py | Python | gpl-2.0 | 1,472 |
#!/usr/bin/python
#
# word-freq.py - work out the frequency of all words in the
# supplied input
#
# Usage: <STDIN> | word-freq.py or word-freq.py <files>
#
# Copyright (C) 2013 Michael Davies <michael@the-davies.net>
#
# This program is free software; you can redistribute it and/or
# modify it under the... | mrda/junkcode | word-freq.py | Python | gpl-2.0 | 2,160 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
dimensions= 2
#size1d = 20
#size1d = 20 #80
##?? szybsze ??## size1d = 70
size1d = 60
halfSize1 = [size1d,size1d,0.1]
halfSize2 = halfSize1
#GRIDSIZE = 16
#GRIDSIZE = [32,32] #3*64 #2**7
##?? szybsze ??##GRIDSIZE = [70,70] #3*64 #2**7
GRIDSIZE = [128,128] #3*64 #2*... | cosurgi/trunk | examples/qm/2d-coulomb-eigen+free-propagation.py | Python | gpl-2.0 | 8,454 |
# -*- coding: utf-8 -*-
#
#
# TheVirtualBrain-Framework Package. This package holds all Data Management, and
# Web-UI helpful to run brain-simulations. To use it, you also need do download
# TheVirtualBrain-Scientific Package (for simulators). See content of the
# documentation-folder for more details. See also http:/... | rajul/tvb-framework | tvb/__init__.py | Python | gpl-2.0 | 1,724 |
#
# Copyright 2014 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 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in th... | dealnews/nagios-server-addons | tests/test_check_cluster_volusage.py | Python | gpl-2.0 | 3,464 |
#!/usr/bin/env python
from setuptools import setup, find_packages
setup(
# Package name
name = "creditpiggy",
packages = [ 'creditpiggy' ],
version = "0.1a1",
# metadata for upload to PyPI
author = "Ioannis Charalampidis",
author_email = "ioannis.charalampidis@cern.ch",
description = "Cre... | wavesoft/creditpiggy | creditpiggy-api/python/setup.py | Python | gpl-2.0 | 490 |
# -*- coding: utf-8 -*-
from django.contrib.auth.models import Group as DjangoGroup
from django.db import models
from ..eighth.models import EighthActivity
from ..ionldap.models import LDAPCourse
from ..users.models import User
class Board(models.Model):
"""A Board is a collection of BoardPosts for a specific ei... | jacobajit/ion | intranet/apps/board/models.py | Python | gpl-2.0 | 6,891 |
from modeller import *
import os
import mdt
import mdt.features
env = Environ()
mlib = mdt.Library(env)
xray = mdt.features.XRayResolution(mlib, bins=[(0.51, 1.4, "under 1.4"),
(1.4, 1.6, "1.4-1.6"),
(1.6, 1.8, "1.6-1.8"),
... | salilab/mdt | constr2005/chi1/impact-of-resolution/asgl.py | Python | gpl-2.0 | 990 |
#!/usr/bin/env python3
# GStreamer Daemon - gst-launch on steroids
# Python client library abstracting gstd interprocess communication
# Copyright (c) 2015-2020 RidgeRun, LLC (http://www.ridgerun.com)
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the ... | RidgeRun/gstd-1.x | tests/libgstc/python/test_libgstc_python_stop_gstd.py | Python | gpl-2.0 | 1,704 |
#!/usr/bin/env python
"""
Decode.py $Id: Decode.py,v 1.4 2002/05/18 10:28:24 nordstrom Exp $
Simple depacker for pdb files
This module dumps a PDB back into the 'cache' directory.
"""
import sys
import helper.prc
import getopt
import os
import shutil
def dump_pdb(pdbfile,cachedir):
pdb = help... | arpruss/plucker | parser/python/PyPlucker/Decode.py | Python | gpl-2.0 | 1,831 |
# -*- coding: utf-8 -*-
'''
@author: Ben Schneider
A script is used to readout mtx measurement data which also contains
a shotnoise responses.
Then fits them for G and Tn
'''
import numpy as np
from parsers import savemtx, loadmtx, make_header, read_header
# from scipy.optimize import curve_fit # , leastsq
from scipy.... | benschneider/sideprojects1 | Shotnoise-Calibration/SNfit1.py | Python | gpl-2.0 | 19,844 |
#!/usr/bin/python
import runner.fortran_runner as FORTRAN
import runner.cuda_runner as CUDA
import argparse
parser = argparse.ArgumentParser(description='Helper program for running, validating and benchmarking the rigid fibers simulation')
parser.add_argument('--verbose',action='store_true',help='be verbose')
platfo... | ericwolter/rigidfibers | fibers_runner.py | Python | gpl-2.0 | 11,295 |
class Employee:
empCount = 0
def __init__(self, name, salary):
self.name = name
self.salary = salary
Employee.empCount += 1
def displayCount(self):
print "Total Employee %d" % Employee.empCount
def displayEmployee(self):
print "Name : ", self.name, ", S... | jraymondli/JeremyCode | jeremy-python/tutorial/cood.py | Python | gpl-2.0 | 501 |
# -*- coding: utf-8 -*-
# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79:
def get_basic_type(x):
pass
| jeffmahoney/crash-python | doc-source/mock/gdb/types.py | Python | gpl-2.0 | 115 |
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2007 Donald N. Allingham
# Copyright (C) 2009 Brian G. Matherly
# Copyright (C) 2009 Gary Burton
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publis... | pmghalvorsen/gramps_branch | gramps/cli/clidbman.py | Python | gpl-2.0 | 18,048 |
#!/usr/bin/python
# -*- coding: utf-8
#
# Copyright 2017-2019 Mick Phillips (mick.phillips@gmail.com)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at ... | mickp/microscope | microscope/cameras/pvcam.py | Python | gpl-3.0 | 56,353 |
#!/usr/bin/env python3
"""
There are two relevant customizations to the standard distutils installation
process: (1) writing the nfoview.paths module and (2) handling translations.
(1) NFO Viewer finds non-Python files based on the paths written in module
nfoview.paths. In nfoview/paths.py the paths default to th... | otsaloma/nfoview | setup.py | Python | gpl-3.0 | 7,260 |
from .ND280Task import *
from .ND280Transform import *
from .ND280Unit import *
from .ND280Transform_CSVEvtList import *
from .ND280Unit_CSVEvtList import *
| ganga-devs/ganga | ganga/GangaND280/Tasks/__init__.py | Python | gpl-3.0 | 157 |
import datetime
import unittest
from src import engine
from src.models import metadata, AuthorModel, BookModel, TopicModel
class SearchBookModelTests(unittest.TestCase):
@classmethod
def setUpClass(cls):
metadata.create_all(engine)
# authors:
martin_fowler = AuthorModel(first_name='m... | pity7736/books_read | tests/models/test_search_book.py | Python | gpl-3.0 | 3,022 |
#!/usr/bin/env python
#
# Copyright 2011 Igalia S.L. and Guillaume Emont
# Contact: Guilaume Emont <guijemont@igalia.com>
#
# This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the Free
# Software Foundation, either version ... | guijemont/GstStabilizer | python/cv_flow_finder.py | Python | gpl-3.0 | 12,532 |
"""
Django settings for SwimTeamManager project.
Generated by 'django-admin startproject' using Django 1.10.4.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.10/ref/settings/
"""
i... | pacnos/SwimTeamManager | SwimTeamManager/settings/debug.py | Python | gpl-3.0 | 1,119 |
#!/usr/bin/env python3
# Copyright (C) 2013-2019 Florian Festi
#
# 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.... | florianfesti/boxes | boxes/generators/slatwallplaneholder.py | Python | gpl-3.0 | 2,795 |
from app.views.base_view import main_blueprint
from flask import render_template
from app.ClienteAPI.ClienteAPI import ClienteAPI
from flask import request, url_for
from app.DAO.EncuestasDAO import *
@main_blueprint.route('/materias/encuestas/<int:idCurso>', methods=['GET'])
def resultados_encuestas_por_curso_page(id... | jennywoites/MUSSA | MUSSA_Flask/app/views/PaginasPublicasViews/resultados_encuestas_view.py | Python | gpl-3.0 | 12,776 |
import bpy, mathutils
from math import *
from ctypes import *
#Converts Blender's camera to a Gideon representation
def convert(bl_camera_obj, scene):
camera = bl_camera_obj.data
#compute camera axes
camera_tfm = bl_camera_obj.matrix_world.to_3x3()
x_axis = camera_tfm * mathutils.Vector((1.0, 0.0, 0.0... | drwindigo/gideon | blender/camera.py | Python | gpl-3.0 | 5,248 |