code stringlengths 2 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int32 2 1.05M |
|---|---|---|---|---|---|
#
import os
import unittest
class TestBase(unittest.TestCase):
@classmethod
def datafilename(cls, name):
fname = os.path.join(
os.path.dirname(__file__),
"data",
name,
)
assert os.path.exists(fname)
return fname
| deets/pyCamBam | tests/base.py | Python | gpl-2.0 | 295 |
#
# Advene: Annotate Digital Videos, Exchange on the NEt
# Copyright (C) 2008-2017 Olivier Aubert <contact@olivieraubert.net>
#
# Advene 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 ... | oaubert/advene | lib/advene/gui/popup.py | Python | gpl-2.0 | 36,607 |
#!/usr/bin/python
# brick_status_event_handler.py Event handler for Brick status
# Service. Reschedules the check for volume status service whenever a
# brick status changes.
# Copyright (C) 2014 Red Hat Inc
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General... | dealnews/nagios-server-addons | plugins/brick_status_event_handler.py | Python | gpl-2.0 | 2,494 |
#coding=utf-8
#-*- encoding: utf-8 -*-
import tornado.ioloop
import tornado.iostream
import socket
import struct
import NotifyTCPServer
def readPacketHeader():
stream.read_bytes(NotifyTCPServer.PACKET_HEADER_LEN, parsePacketHeader)
def parsePacketHeader(data):
sign,cmd,bodySize = struct.unpack('>2sHH', data)
p... | xaccc/videoapiserver | testNotifyTCPServer.py | Python | gpl-2.0 | 1,234 |
import cPickle as pkl
import networkx as nx
import numpy as np
import os
import scipy.spatial
from ..handler.basics import chunkify
from ..processing.general import single_conn_comp_img
from syconnmp.shared_mem import start_multiprocess_obj, start_multiprocess
from ..handler.compression import VoxelDict, AttributeDict... | StructuralNeurobiologyLab/SyConnFS | syconnfs/representations/segmentation_helper.py | Python | gpl-2.0 | 9,628 |
# -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 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 option) a... | robk5uj/invenio | modules/bibformat/lib/elements/bfe_sciencewise.py | Python | gpl-2.0 | 3,743 |
import os
import shutil
from mutagen._compat import cBytesIO
from mutagen.ogg import OggPage
from mutagen.oggspeex import OggSpeex, OggSpeexInfo, delete
from tests import add
from tests.test_ogg import TOggFileType
from tempfile import mkstemp
class TOggSpeex(TOggFileType):
Kind = OggSpeex
def setUp(self):
... | LordSputnik/mutagen | tests/test_oggspeex.py | Python | gpl-2.0 | 2,072 |
from ChannelSelection import ChannelSelection, BouquetSelector, SilentBouquetSelector
from Components.ActionMap import ActionMap, HelpableActionMap
from Components.ActionMap import NumberActionMap
from Components.Harddisk import harddiskmanager
from Components.Input import Input
from Components.Label import Label
from... | ssh1/stbgui | lib/python/Screens/InfoBarGenerics.py | Python | gpl-2.0 | 119,400 |
from django.contrib import admin
from .models import EssNutr, FoodCategory
# Register your models here.
admin.site.register(EssNutr)
admin.site.register(FoodCategory) | GalinaDimitrova/Essential-nutrients-in-Bulgarian-foods | ess_nutr_site/essential_nutritions/admin.py | Python | gpl-2.0 | 166 |
import models
def borradoPlan(sender, **kwargs):
borrada = kwargs['instance']
if borrada.tipo == "pr":
aBorrar = models.PlanPrepago.objects.filter(codplan=borrada)
else:
aBorrar = models.PlanPostpago.objects.filter(codplan=borrada)
aBorrar.delete()
def insertadoServicio(sender, **kwargs):
... | gres147679/IngSoftwareRectaFinal | Tarea5/ServiSoft/ServiSoft/WebAccess/signalActions.py | Python | gpl-2.0 | 948 |
# ===========================================================================
# eXe
# Copyright 2004-2005, University of Auckland
# Copyright 2004-2007 eXe Project, New Zealand Tertiary Education Commission
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General... | kohnle-lernmodule/palama | exe/export/websitepage.py | Python | gpl-2.0 | 10,861 |
from flask_wtf import Form
from flask_babel import gettext
from wtforms import StringField, validators
class ApplicationForm(Form):
name = StringField(gettext('Application name'), [
validators.DataRequired(message=gettext("Application name field is empty.")),
validators.Length(min=3, message=gette... | dufferzafar/critiquebrainz | critiquebrainz/frontend/profile/applications/forms.py | Python | gpl-2.0 | 1,318 |
from __future__ import print_function
import sys
sys.path.append('..')
from src.sim import Sim
from src.packet import Packet
from networks.network import Network
class BroadcastApp(object):
def __init__(self, node):
self.node = node
def receive_packet(self, packet):
print(Sim.scheduler.cu... | zappala/bene | examples/broadcast.py | Python | gpl-2.0 | 2,081 |
from .trace_decorator import getLog
from .exception import StateError
class State(object):
def __init__(self):
self._state = []
# can be "unknown", "success" or "fail"
self.result = "unknown"
self.state_log = getLog("mockbuild.Root.state")
def state(self):
if not len(s... | nbartos/mock | py/mockbuild/state.py | Python | gpl-2.0 | 1,124 |
# coding: utf-8
from django.conf.urls import patterns, include, url
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()
urlpatterns = patterns('',
url(r'^$', 'LAK_2014.views.index', name... | aitoralmeida/geo-lak | LAK_2014/LAK_2014/urls.py | Python | gpl-2.0 | 657 |
import threading
import time
class Status:
lock = None
statusno =0
def __init__(self):
self.lock = threading.Lock()
def update(self, add):
self.lock.acquire()
self.statusno = self.statusno + add
self.lock.release()
def get(self):
self.loc... | RedFoxPi/Playground | threadtest.py | Python | gpl-2.0 | 929 |
from django.views.generic import DetailView
from entries.models import Entry
class EntryView(DetailView):
model = Entry
template_name = "entry.html"
context_object_name = 'entry'
slug_field = 'sname'
slug_url_kwarg = 'entry_sname' | IlyaGusev/PersonalPage | PersonalPage/apps/entries/views.py | Python | gpl-2.0 | 252 |
from django.shortcuts import render_to_response, get_object_or_404
from django.http import HttpResponseRedirect
from django.template import RequestContext
from django.utils.translation import ugettext as _
from apps.mainapp.models import Report, ReportSubscriber
from apps.mainapp.forms import ReportSubscriberForm
de... | tigeorgia/fixmystreet | apps/mainapp/views/reports/subscribers.py | Python | gpl-2.0 | 2,154 |
import os
import sys
import drivecasa
import logging
import shlex
import shutil
import subprocess
import yaml
import glob
casa = drivecasa.Casapy(log2term=True, echo_to_stdout=True, timeout=24*3600*10)
CONFIG = os.environ["CONFIG"]
INPUT = os.environ["INPUT"]
OUTPUT = os.environ["OUTPUT"]
MSDIR = os.environ["MSDIR"]
... | SpheMakh/Stimela | stimela/cargo/cab/casa47_setjy/src/run.py | Python | gpl-2.0 | 1,403 |
import operator
import math
class Machine():
"""Simple stack based machine designed for genetic programming (GP) experiments.
Easy to use and forgiving with nonfatal errors.
See README and tests for examples.
"""
def __init__(self, debug=False):
self.stack = []
self.debug = ... | sangelone/gstack | stackmachine.py | Python | gpl-2.0 | 5,419 |
__author__ = 'dani882'
# lecture 3.2, slide 6
# Find the cube root of a perfect cube
x = int(raw_input('Enter an integer: '))
ans = 0
while ans**3 < abs(x):
ans = ans + 1
if ans**3 != abs(x):
print(str(x) + ' is not a perfect cube')
else:
if x < 0:
ans = -ans
print('Cube root of ' + str(x) + ' ... | dani882/edX---Computer-Science | python/lecture 3.2.py | Python | gpl-2.0 | 336 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# mdfjr - admin.py
#
# Created by PyCharm.
# User: fajar
# Date: 5/13/17
# Time: 3:50 PM
#
#
from django.contrib import admin
from . import models
@admin.register(models.OAuthUser)
class OAuthUserAdmin(admin.ModelAdmin):
list_display = ['__str__', 'provider',... | heyost/django-skeleton | oauth/admin.py | Python | gpl-2.0 | 345 |
#
# BitBake Graphical GTK based Dependency Explorer
#
# Copyright (C) 2007 Ross Burton
# Copyright (C) 2007 - 2008 Richard Purdie
#
# 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 Foundatio... | schleichdi2/OPENNFR-6.1-CORE | bitbake/lib/bb/ui/taskexp.py | Python | gpl-2.0 | 12,394 |
__author__= "barun"
__date__ = "$20 May, 2011 12:19:25 PM$"
## Defines a collection of metrics that can be used to analyze the performance
# of a network.
class Metrics(object):
## Calculate average throughput as: total_bytes_rcvd / duration.
#
# @param pkts_list An iterator object in the... | barun-saha/ns2web | ns2trace/metrics.py | Python | gpl-2.0 | 8,308 |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2013, 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... | jirikuncar/invenio-utils | invenio_utils/datacite.py | Python | gpl-2.0 | 4,248 |
# -*- coding: utf-8 -*-
from distutils.core import setup
setup(
name='popy',
description='Parser for GNU Po files',
long_description=open('README.rst').read(),
version='0.3.0',
packages=['popy'],
author='Murat Aydos',
author_email='murataydos@yandex.com',
url='https://github.com/muratay... | murataydos/popy | setup.py | Python | gpl-2.0 | 402 |
# -*- coding:utf-8 -*-
from django.shortcuts import render
import models
# Create your views here.
class Pager(object):
def __init__(self,current_page):
self.current_page = current_page
@property
def start(self):
return (self.current_page-1)*10
@property
def end(self):
r... | willre/homework | day21-22/source/app01/views.py | Python | gpl-2.0 | 2,803 |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2.
# smallcommitmetadata.py - stores a small amount of metadata associated with a commit
from . import json
from .node import bin, hex
from .util import ... | facebookexperimental/eden | eden/hg-server/edenscm/mercurial/smallcommitmetadata.py | Python | gpl-2.0 | 3,324 |
# flatspice.py
#-----------------------------------------------------------
# Python script which writes a SPICE-format netlist.
# Replaces the code formerly in "netlist.c" (deprecated).
# Python scripting is now the preferred method for handling
# netlist output formats.
#----------------------------------------------... | snmishra/xcircuit-3.8 | lib/python/flatspice.py | Python | gpl-2.0 | 3,186 |
# -*- coding: utf-8 -*-
# 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.
from tests import TestCase, mkstemp
import os
... | elbeardmorez/quodlibet | quodlibet/tests/test_qltk_cbes.py | Python | gpl-2.0 | 4,802 |
#!/usr/bin/env python
"""This does HTTP GET requests given a host:port and path and returns
a subset of the headers plus the body of the result."""
from __future__ import absolute_import, print_function
import json
import os
import sys
from edenscm.mercurial import util
httplib = util.httplib
try:
import msv... | facebookexperimental/eden | eden/hg-server/tests/get-with-headers.py | Python | gpl-2.0 | 2,434 |
DEBUG = 0
# cardinal diretions
directions = ("left","up","right","down")
# logic
maxExamined = 75000 # maximum number of tries when solving
maxMoves = 19 # maximum number of moves
cullFrequency = 75000 # number of tries per cull update
cullCutoff = 1.2 # fraction of average to cull
# grid size
gridRows = 5
gridColum... | discomethod/pad-helper | constants.py | Python | gpl-2.0 | 1,240 |
from ..dataset.arff import ArffFile
from scipy.spatial import kdtree, distance
from ..representations.intervalsProbability import IntervalsProbability
import numpy as np
from math import exp
class IPKNN(object):
"""IPKNN implements a K-nearest neighbour method using lower previsions.
If data are all preci... | sdestercke/classifip | classifip/models/knn.py | Python | gpl-2.0 | 5,129 |
from spyparty.ReplayOffsets import ReplayOffsets
class ReplayVersion3Offsets(ReplayOffsets):
def extract_number_offset(self):
return 0x00
def get_file_version_offset(self):
return 0x04
def get_protocol_version_offset(self):
return 0x08
def get_spy_party_version_offset(self):... | LtHummus/SpyPartyParse | spyparty/ReplayVersion3Offsets.py | Python | gpl-2.0 | 1,504 |
# -*- coding: utf-8 -*-
from django.db import models, migrations
import autoslug.fields
import django.core.files.storage
import marking.models
class Migration(migrations.Migration):
dependencies = [
('grades', '0001_initial'),
('groups', '0001_initial'),
]
operations = [
migrat... | sfu-fas/coursys | marking/migrations/0001_initial.py | Python | gpl-3.0 | 10,263 |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
'''Pychemqt, Chemical Engineering Process simulator
Copyright (C) 2009-2017, Juan José Gómez Romera <jjgomera@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... | jjgomera/pychemqt | lib/elemental.py | Python | gpl-3.0 | 7,567 |
import psycopg2
from db.enums import *
base = psycopg2.connect("dbname='cardkeepersample' user='andrew' host='localhost' password='1234'")
cursor = base.cursor()
# Wrapped queries in alphabetic order
def active_packs(user_id, start=0, count=10):
query = """SELECT packs.pack_id, packs.name FROM user_packs, packs... | andrewgolman/Learning_Cards | bot/db/queries.py | Python | gpl-3.0 | 7,726 |
import shesha.config as conf
simul_name = "bench_scao_sh_16x16_8pix"
# loop
p_loop = conf.Param_loop()
p_loop.set_niter(100)
p_loop.set_ittime(0.002) # =1/500
# geom
p_geom = conf.Param_geom()
p_geom.set_zenithangle(0.)
# tel
p_tel = conf.Param_tel()
p_tel.set_diam(4.0)
p_tel.set_cobs(0.12)
# atmos
p_atmos = c... | ANR-COMPASS/shesha | data/par/par4tests/test_sh_base.py | Python | gpl-3.0 | 2,260 |
# -*- coding: utf-8 -*-
"""
Setup script for the WDmodel package
"""
import sys
import os
import re
import glob
from setuptools import find_packages, setup
dep_file = 'dependencies_py36.txt'
with open(dep_file,'r') as f:
required = f.read().splitlines()
dir_path = os.path.dirname(os.path.realpath(__file__))
i... | gnarayan/WDmodel | setup.py | Python | gpl-3.0 | 1,976 |
#!/usr/bin/python
# (c) 2019, NetApp Inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
"""AWS Cloud Volumes Services - Manage fileSystem"""
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '... | hyperized/ansible | lib/ansible/modules/cloud/amazon/aws_netapp_cvs_FileSystems.py | Python | gpl-3.0 | 12,011 |
# service.py is part of Panopticon.
# Panopticon 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.
# Panopticon is distributed in the h... | llou/panopticon | panopticon/core/actions/service.py | Python | gpl-3.0 | 3,447 |
#############################################################################
##
## Copyright (c) 2011 Riverbank Computing Limited <info@riverbankcomputing.com>
##
## This file is part of PyQt.
##
## This file may be used under the terms of the GNU General Public
## License versions 2.0 or 3.0 as published by the Fre... | pyqt/maya2012-qt4 | PyQt4/uic/widget-plugins/qscintilla.py | Python | gpl-3.0 | 2,135 |
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that ... | wkeeling/ansible | lib/ansible/utils/module_docs_fragments/dnos9.py | Python | gpl-3.0 | 3,305 |
template = """# Generated on {{dt}}
*filter
:INPUT DROP
:FORWARD ACCEPT
:OUTPUT ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p tcp -m tcp --dport 22 -j ACCEPT
-A INPUT -i eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -i eth1 -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
{{#rule}}... | domino14/Webolith | scripts/gen_firewall.py | Python | gpl-3.0 | 2,398 |
import os
import sys
import time
import numpy
import logging
from stoqs import models as m
from django.conf import settings
from django.db.models import Avg
from django.http import HttpResponse, HttpResponseBadRequest
import pprint
logger = logging.getLogger(__name__)
class InvalidLimits(Exception):
pass
def r... | josephmfaulkner/stoqs | stoqs/utils/Viz/KML.py | Python | gpl-3.0 | 15,397 |
# vDial-up client
# Copyright (C) 2015 - 2017 Nathaniel Olsen
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This pr... | vDial-up/client | libs/vDialing.py | Python | gpl-3.0 | 5,879 |
#!/usr/bin/env python
# coding=utf-8
import argparse
import urllib2 # python 2.7
import re
import sqlite3
import traceback
import datetime
import csv
headers = { 'User-Agent' : 'Mozilla/5.0 (compatible; Googlebot/2.1;'
+' +http://www.google.com/bot.html)' }
... | ofaurax/LeechCoin | leechcoin.py | Python | gpl-3.0 | 12,394 |
idade = 12
if idade < 4:
preco = 0
elif idade < 18:
preco = 5
elif idade < 65:
preco = 10
else:
preco = 5
print('Seu custo de admissão e R$' + str(preco) + '.')
'''
Foi adicionado mais bloco de instrução elif
para idades abaixo de 65. Se caso a idade for maior
que 18 e menor que 65 o bloco e executado,... | zirou30/python_student | 82.py | Python | gpl-3.0 | 387 |
from skypebot import *
class Skype_Bot:
"""
This class handles communication with Skype via SkypeBot
"""
def __init__(self, plugins):
self.skype = Skypebot.Skype(Events=self)
self.skype.FriendlyName = "Skype Bot Levitan"
self.skype.Attach()
self.plugins = plugins
de... | zemuvier/Python-courses | skype_bot2.py | Python | gpl-3.0 | 1,129 |
from pylab import *
data = loadtxt('Data/dummy_data.dat')
posterior_sample = atleast_2d(loadtxt('posterior_sample.txt'))
ion()
for i in xrange(0, posterior_sample.shape[0]):
hold(False)
plot(data[:,0], data[:,1], 'bo')
hold(True)
plot(data[:,0], posterior_sample[i, -data.shape[0]:], 'r-')
ylim([0, 1.1*data[... | jchiang87/TimeBombs | display.py | Python | gpl-3.0 | 548 |
"""Minimal Python 3 shim around PyQt5 and Pyside2 Qt bindings for QML applications.
Forked from https://github.com/mottosso/Qt.py under MIT License.
Copyright (c) 2016 Marcus Ottosson
Changes
* Dropped Python2 and Qt4 support
* Focus on last Python 3 release
* Focus on last Qt API : QML
Requirements
* make use of ... | FabriceSalvaire/PyValentina | QtShim/__init__.py | Python | gpl-3.0 | 13,118 |
import os
if not 'DJANGO_SETTINGS_MODULE' in os.environ:
os.environ['DJANGO_SETTINGS_MODULE'] = 'flooding.windows'
from django.core import management
if __name__ == '__main__':
management.execute_from_command_line()
| lizardsystem/flooding | flooding/manage.py | Python | gpl-3.0 | 228 |
from django.conf.urls import include, url
from sapl.sessao.views import (AdicionarVariasMateriasExpediente,
AdicionarVariasMateriasOrdemDia, BancadaCrud,
CargoBancadaCrud, ExpedienteMateriaCrud,
ExpedienteView, JustificativaAu... | interlegis/sapl | sapl/sessao/urls.py | Python | gpl-3.0 | 11,025 |
import os
import time
import traceback
from lib.FileManager.FM import REQUEST_DELAY
from lib.FileManager.workers.baseWorkerCustomer import BaseWorkerCustomer
class CreateCopy(BaseWorkerCustomer):
def __init__(self, paths, session, *args, **kwargs):
super(CreateCopy, self).__init__(*args, **kwargs)
... | LTD-Beget/sprutio-rpc | lib/FileManager/workers/ftp/createCopy.py | Python | gpl-3.0 | 6,690 |
import src
class PoisonBush(src.items.Item):
"""
a hard to remove poison plant
"""
type = "PoisonBush"
name = "poison brush"
description = ""
usageInfo = """
You can use it to loose 100 satiation.
"""
walkable = False
charges = 0
def __init__(self):
"""
set up... | MarxMustermann/OfMiceAndMechs | src/itemFolder/plants/poisonBush.py | Python | gpl-3.0 | 4,198 |
# -*- coding: utf-8 -*-
#
# formatter.py - format html from cplusplus.com to groff syntax
#
# Copyright (C) 2010 - 2015 Wei-Ning Huang (AZ) <aitjcize@gmail.com>
# All Rights reserved.
#
# This file is part of cppman.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the G... | aitjcize/cppman | cppman/formatter/cppreference.py | Python | gpl-3.0 | 12,272 |
from django.apps import AppConfig
class OntakAppConfig(AppConfig):
name = "oioioi.ontak"
| sio2project/oioioi | oioioi/ontak/apps.py | Python | gpl-3.0 | 95 |
"""
Set the configuration variables for fabric recipes.
"""
from fabric.api import env
from fabric.colors import yellow
import os
env.warn_only = True
try:
import ConfigParser as cp
except ImportError:
import configparser as cp # Python 3.0
config = {}
_config = cp.SafeConfigParser()
if not os.path.isfil... | surekap/fabric-recipes | fabfile/config.py | Python | gpl-3.0 | 725 |
from functools import partial
import threading
from PIL import Image
from PyQt4.Qt import Qt
from PyQt4.Qt import QGridLayout, QInputDialog, QPushButton
from PyQt4.Qt import QVBoxLayout, QLabel, SIGNAL
from electrum_gui.qt.main_window import StatusBarButton
from electrum_gui.qt.password_dialog import PasswordDialog
fr... | joelstanner/electrum | plugins/trezor/qt_generic.py | Python | gpl-3.0 | 24,003 |
"""
PySAR
Polarimetric SAR decomposition
Contents
--------
decomp_fd(hhhh,vvvv,hvhv,hhvv,numthrd=None) : Freeman-Durden 3-component decomposition
"""
from __future__ import print_function, division
import sys,os
import numpy as np
###===============================================================================... | bminchew/PySAR | pysar/polsar/decomp.py | Python | gpl-3.0 | 6,649 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'D:\github repos\Python\A05_SimplyGame\Binaries\MyView.ui'
#
# Created: Tue Oct 25 22:22:12 2016
# by: pyside-uic 0.2.15 running on PySide 1.2.2
#
# WARNING! All changes made in this file will be lost!
from PySide import QtCore... | lzuba-tgm/A05_SimplyGame | Ui_MainWindow.py | Python | gpl-3.0 | 13,842 |
#!/usr/bin/env python2
import sys, getopt
import re
import time
def get_option():
opts, args = getopt.getopt(sys.argv[1:], "hi:o:")
input_file = ""
output_file = ""
h = ""
for op, value in opts:
if op == "-i":
input_file = value
elif op == "-o":
output_file = value
elif op == "-h":
h = "E-value di... | sdws1983/bioinfo-relate | Blast-relate/E-value-distribution.py | Python | gpl-3.0 | 1,085 |
#!/usr/bin/env python
"""
=====================================
dummySensor.py - Dummy Sensor Handler
=====================================
Displays a silly little window for faking sensor values by clicking on buttons.
"""
import threading, subprocess, os, time, socket
import numpy, math
import sys
class sensorHand... | jadecastro/LTLMoP | src/lib/handlers/share/dummySensor.py | Python | gpl-3.0 | 6,284 |
from http.server import BaseHTTPRequestHandler, HTTPServer
import requests
import urllib.parse
import json
# Define server address and port, use localhost if you are running this on your Mattermost server.
HOSTNAME = ''
PORT = 7800
# guarantee unicode string
_u = lambda t: t.decode('UTF-8', 'replace') if isinstance(t... | mlongo4290/mattermost-wunderground-slash-command | wunderground-slash-command.py | Python | gpl-3.0 | 4,117 |
# cspSLS.py - Stochastic Local Search for Solving CSPs
# AIFCA Python3 code Version 0.7.1 Documentation at http://aipython.org
# Artificial Intelligence: Foundations of Computational Agents
# http://artint.info
# Copyright David L Poole and Alan K Mackworth 2017.
# This work is licensed under a Creative Commons
# Attr... | AISpace2/AISpace2 | aipython/cspSLSPlot.py | Python | gpl-3.0 | 12,720 |
# GUI for pyfdtd using PySide
# Copyright (C) 2012 Patrik Gebhardt
# Contact: grosser.knuff@googlemail.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
... | schansge/pyfdtd-gui | src/dialogs/__init__.py | Python | gpl-3.0 | 797 |
import os
from optparse import OptionParser
import io
import time
import random
import thread
import sys
from smtp_stuff import sendMail
from imap_stuff import checkMessages
import datetime
import string
import array
from time import gmtime, strftime
from socket import *
user = ''
recipient = ''
incoming_server = ... | astronewts/Flight1 | misc/allaloft/groundstation/python/ground_station_base.py | Python | gpl-3.0 | 9,305 |
#! /usr/bin/env python
#
# IM - Infrastructure Manager
# Copyright (C) 2011 - GRyCAP - Universitat Politecnica de Valencia
#
# 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 t... | indigo-dc/im | test/unit/connectors/OpenNebula.py | Python | gpl-3.0 | 17,429 |
"""Unit tests for the ``organizations`` paths.
Each ``APITestCase`` subclass tests a single URL. A full list of URLs to be
tested can be found here:
http://theforeman.org/api/apidoc/v2/organizations.html
:Requirement: Organization
:CaseAutomation: Automated
:CaseLevel: Acceptance
:CaseComponent: API
:TestType: F... | elyezer/robottelo | tests/foreman/api/test_organization.py | Python | gpl-3.0 | 17,745 |
"""
Panel displaying the torrc or armrc with the validation done against it.
"""
import math
import curses
import threading
from util import conf, panel, torConfig, uiTools
DEFAULT_CONFIG = {"features.config.file.showScrollbars": True,
"features.config.file.maxLinesPerEntry": 8}
# TODO: The armrc ... | katmagic/arm | src/interface/torrcPanel.py | Python | gpl-3.0 | 9,156 |
# Copyright 2015 Facundo Batista, Nicolás Demarchi
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 3, as published
# by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ... | arielrossanigo/fades | tests/test_pipmanager.py | Python | gpl-3.0 | 4,315 |
#!/usr/bin/python
# coding=utf-8
# Simple Steam profile checker Telegram bot
# Copyright (c) 2017 EasyCoding Team
#
# 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 Licen... | xvitaly/stmbot | stmbot/checker.py | Python | gpl-3.0 | 5,895 |
import gensim
import numpy as np
from gensim.models import word2vec
import jieba
from TextSta_v2 import TextSta
from gensim.corpora.dictionary import Dictionary
path = u"C:\\Users\\xiangrufan\\Desktop\\NLP\\Astro_NLP\\resource\\复旦分类语料\\answer\\C3-Art\\C3-Art0002.txt"
text = TextSta(path,encoding="GBK")
sentense_file =... | xiangrufan/astro-NLP | hobby2vec/gensim_test.py | Python | gpl-3.0 | 558 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2009-2021 Satpy developers
#
# This file is part of satpy.
#
# satpy 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 Licens... | pytroll/satpy | satpy/tests/reader_tests/test_avhrr_l0_hrpt.py | Python | gpl-3.0 | 8,951 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
vivopump -- module of helper functions for the pump
"""
import sys
import csv
import string
import random
import logging
__author__ = "Michael Conlon"
__copyright__ = "Copyright (c) 2016 Michael Conlon"
__license__ = "New BSD license"
__version__ = "0.8.7"
logger = l... | dofeldsc/vivo_uos | my_pump/pump/vivopump.py | Python | gpl-3.0 | 47,667 |
"""
optimisation.py: Optimisations for worldview solving
Copyright (C) 2014 Michael Kelly
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
... | galactose/wviews | optimisation.py | Python | gpl-3.0 | 5,702 |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
'''
Copyright 2016,暗夜幽灵 <darknightghost.cn@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 y... | darknightghost/AntiPkgLoss | ui/screen.py | Python | gpl-3.0 | 2,542 |
####################################################################################################
# Copyright 2013 John Crawford
#
# This file is part of PatchCorral.
#
# PatchCorral is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the ... | defcello/Children-of-Eden-Synth-Server | src/engine/mididevice.py | Python | gpl-3.0 | 10,822 |
#!/usr/bin/env python
"""
conference.py -- Udacity conference server-side Python App Engine API;
uses Google Cloud Endpoints
$Id: conference.py,v 1.25 2014/05/24 23:42:19 wesc Exp wesc $
created by wesc on 2014 apr 21
"""
__author__ = 'wesc+api@google.com (Wesley Chun)'
from datetime import datetime
import ... | SteveWooding/fullstack-nanodegee-conference | Lesson_3/00_Conference_Central/conference.py | Python | gpl-3.0 | 4,120 |
from django.utils.translation import ugettext_lazy as _
from oioioi.base.menu import MenuRegistry
navbar_links_registry = MenuRegistry(_("Navigation Bar Menu"))
| sio2project/oioioi | oioioi/problems/menu.py | Python | gpl-3.0 | 162 |
# -*- coding: utf-8 -*-
from flask import Flask,render_template,send_file,Response,flash,request,redirect,session
from werkzeug.utils import secure_filename
import json
import os.path
import os
import gzip
import urllib
from db import DbGetListOfDates,DbGet,DbGetComments,DbGetMulitple,DbGetNearbyPoints,DbPut,DbPutWith... | fparrel/regepe | vps/regepe_flask_server.py | Python | gpl-3.0 | 30,280 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-06-02 20:34
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migratio... | gabriellmb05/trabalho-les | src/project_manager/migrations/0001_initial.py | Python | gpl-3.0 | 2,659 |
# encoding: utf8
from sympy import Add
from uncertainties import __version_info__ as uncert_version
from uncertainties import ufloat, ufloat_fromstr
from uncertainties.core import Variable, AffineScalarFunc
if uncert_version < (3, 0):
raise Warning("Your version of uncertanties is not supported. Try\n"
... | kirienko/unseries | unseries.py | Python | gpl-3.0 | 9,529 |
from __future__ import with_statement
from sympy import Symbol, exp, Integer, Float, sin, cos, log, Poly, Lambda, \
Function, I, S, sqrt, srepr, Rational, Tuple, Matrix, Interval
from sympy.abc import x, y
from sympy.core.sympify import sympify, _sympify, SympifyError, kernS
from sympy.core.decorators import _sympi... | lidavidm/mathics-heroku | venv/lib/python2.7/site-packages/sympy/core/tests/test_sympify.py | Python | gpl-3.0 | 14,157 |
import collections
import os
import unittest
from ansible.modules.identity.keycloak.keycloak_group import *
class KeycloakGroupTestCase(unittest.TestCase):
def test_create_group(self):
toCreate = {
"username":"admin",
"password":"admin",
"realm":"master",
... | Inspq/ansible | test/units/modules/identity/keycloak/test_keycloak_group.py | Python | gpl-3.0 | 7,158 |
# -*- coding: utf-8 -*-
#
# GromacsWrapper documentation build configuration file, created by
# sphinx-quickstart on Tue Jun 23 19:38:56 2009.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# The contents of this file are pickled, so don't put values in the namespace
# that aren't ... | PicoCentauri/GromacsWrapper | doc/sphinx/source/conf.py | Python | gpl-3.0 | 6,547 |
import time
from menu.ncolor import *
from menu.showMainMenu import *
from command.shell import *
from write.dnsmasq_write import *
class Sub_Menu():
dns_message = """ you can add a redirect entry in this menu or edit the dnsmasq configuration
file located in""" + color.BLEU + """ '/etc/redirect/dnsmasq.hos... | blackice5514/QuickAp | menu/showSubMenu.py | Python | gpl-3.0 | 20,613 |
# Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of SickGear.
#
# SickGear 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,... | ressu/SickGear | sickbeard/search.py | Python | gpl-3.0 | 30,487 |
# !/usr/bin/env python3
"""
Custom Bi Directional Binary Data Parser
ModParser
"""
# ====================== GPL License and Copyright Notice ======================
# This file is part of ModParser
# Copyright (C) 2017 Diana Land
#
# This program is free software: you can redistribute it and/or modify
# it under the te... | iaz3/ModParser | modparser/__init__.py | Python | gpl-3.0 | 983 |
import unittest
import os
import sys
import copy
import nose
from numpy.testing import *
from numpy import array, alltrue, ndarray, asarray, can_cast,zeros, dtype
from numpy.core.multiarray import typeinfo
import util
wrap = None
def setup():
"""
Build the required testing extension module
... | beiko-lab/gengis | bin/Lib/site-packages/numpy/f2py/tests/test_array_from_pyobj.py | Python | gpl-3.0 | 21,255 |
from greencouriers.tests import *
class TestCourierController(TestController):
def test_index(self):
response = self.app.get(url(controller='courier', action='index'))
# Test response...
| guyromm/greencouriers | greencouriers/tests/functional/test_courier.py | Python | gpl-3.0 | 209 |
import os
from typing import Dict, List, Union
OptionalJSON = Union[List, Dict, float, int, str, bool, None]
def ensure_dir_exists(directory):
if not os.path.exists(directory):
os.mkdir(directory)
def get_dir(directory: str) -> str:
"""
Return a string which contains the complete path to the in... | physicalattraction/PATinderBot | src/common.py | Python | gpl-3.0 | 821 |
# Copyright (C) 2006-2007 Red Hat, Inc.
# Copyright (C) 2008 One Laptop Per Child
# Copyright (C) 2008-2013 Sugar Labs
# Copyright (C) 2013 Daniel Francis
# Copyright (C) 2013 Walter Bender
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as... | icarito/sugar | src/jarabe/desktop/favoritesview.py | Python | gpl-3.0 | 27,457 |
__problem_title__ = "Number Rotations"
__problem_url___ = "https://projecteuler.net/problem=168"
__problem_description__ = "Consider the number 142857. We can right-rotate this number by moving " \
"the last digit (7) to the front of it, giving us 714285. It can be " \
... | jrichte43/ProjectEuler | Problem-0168/solutions.py | Python | gpl-3.0 | 996 |
__author__ = "davide"
import struct
import socket
import argparse
import sys
from datetime import datetime
import time
from collections import defaultdict
from signal import signal, SIGINT, SIG_IGN
ICMP_ECHO_REQUEST = 8, 0
ICMP_ECHO_RESPONSE = 0, 0
__all__ = ["ICMPPacket", "Pinger",
"ICMP_ECHO_REQUEST", "... | DavideCanton/Python3 | ping/pyng.py | Python | gpl-3.0 | 6,649 |
#!/usr/bin/env python
# vim:fileencoding=utf-8
from __future__ import (unicode_literals, division, absolute_import,
print_function)
__license__ = 'GPL v3'
__copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
from calibre.gui2.complete2 import LineEdit
from calibre.gui2.widgets import ... | insomnia-lab/calibre | src/calibre/gui2/widgets2.py | Python | gpl-3.0 | 1,547 |
from quanthistling.tests import *
class TestBookController(TestController):
def test_index(self):
response = self.app.get(url(controller='book', action='index'))
# Test response...
| FrankNagel/qlc | src/webapp/quanthistling/quanthistling/tests/functional/test_book.py | Python | gpl-3.0 | 203 |
# https://www.codewars.com/kata/sudoku-solver/train/python
def sudoku(puzzle):
import collections
print('=== in sudoku ===')
# Print arguments
print_board(puzzle)
# Count the numbers that are currently populated on the sudoku board
number_count = collections.Counter(number for row in puzzle for number in row)... | pcampese/codewars | sudoku_solver_level_3_1.py | Python | gpl-3.0 | 6,456 |
from multiprocessing import Process, JoinableQueue, Manager, Lock, Value, Event
import wiringpi as wp
import RPi.GPIO as rpio
from slaveprocess import SlaveProcess
import time
rpio.setmode(rpio.BCM)
class PMWProcess(Process):
def __init__(self,**kwargs):
super(PWMProcess, self).__init__(**kwargs)
... | bcare/roverpi | roverserver/enginectrl.py | Python | gpl-3.0 | 14,624 |
from PySide import QtCore, QtGui
from pysql_browser import MainWindow
import sys
def main():
app = QtGui.QApplication(sys.argv)
window = MainWindow()
window.show()
sys.exit(app.exec_())
if __name__ == '__main__':
main()
| plumdog/pysql_browser | main.py | Python | gpl-3.0 | 243 |