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 unittest
import json
import sys
import os.path
import websocket
sys.path.append(os.path.join(os.path.dirname(__file__), ".."))
from app.constants import Message
class TestServer(unittest.TestCase):
"""
This is not a unit test.
Simple client to test basic functionality of the server
"""
def... | tsh/card-game-server | tests/testRoom.py | Python | gpl-2.0 | 3,449 |
## begin license ##
#
# "Meresco Harvester" consists of two subsystems, namely an OAI-harvester and
# a web-control panel.
# "Meresco Harvester" is originally called "Sahara" and was developed for
# SURFnet by:
# Seek You Too B.V. (CQ2) http://www.cq2.nl
#
# Copyright (C) 2006-2007 SURFnet B.V. http://www.surfnet.nl
# ... | seecr/meresco-harvester | test/throughputanalysertest.py | Python | gpl-2.0 | 6,185 |
from cfme.utils.version import get_stream
from collections import namedtuple
from contextlib import contextmanager
from cfme.test_framework.sprout.client import SproutClient
from cfme.utils.conf import cfme_data, credentials
from cfme.utils.log import logger
import pytest
from wait_for import wait_for
from cfme.test_fr... | jkandasa/integration_tests | cfme/fixtures/cli.py | Python | gpl-2.0 | 4,212 |
#!/usr/bin/env python
# encoding:utf-8
"""
@software: PyCharm
@file: video_db.py
@time: 2016/8/4 16:56
"""
import sqlite3
class Create_DB():
def __init__(self):
self.conn = sqlite3.connect('video.db')
self.cn = self.conn.cursor()
def create_table(self, table):
# 创建表格 table == 创建表命令
... | bjweiqm/Sele | school/pachong/video_db.py | Python | gpl-2.0 | 534 |
import collections
def moduleman_plugin(*args):
method_args = []
def inner_decorator(cls):
for method in method_args:
if (not (method in dir(cls))):
raise Exception("Required method %s not implemented" % method)
cls.__PLUGIN_MODULEMAN_MARK = "Plugin mark"
... | 0ps/wfuzz | src/wfuzz/externals/moduleman/plugin.py | Python | gpl-2.0 | 482 |
import time
output = ''
i=1
start_time = time.time()
while len(output)<1000001:
output +=str(i)
i += 1
print(int(output[9]) * int(output[99]) *
int(output[999]) * int(output[9999]) *
int(output[99999]) * int(output[999999]))
print("--- %s seconds ---" % (time.time() - start_time)) | BinDigit1/EulerProjects | Problem 40/Champernownes_constant.py | Python | gpl-2.0 | 304 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import re, os, time
# function: read and parse sensor data file
def read_sensor(path):
value = "U"
try:
f = open(path, "r")
line = f.readline()
if re.match(r"([0-9a-f]{2} ){9}: crc=[0-9a-f]{2} YES", line):
line = f.readline()
m = re.match(r"([0-9a-... | o-unity/lanio | old/lsrv/bin/getTemp.py | Python | gpl-2.0 | 977 |
from allauth.account.signals import email_confirmed, email_changed, email_added, email_removed, user_signed_up, user_logged_in
from django.contrib.auth.models import User, Group, Permission
from django.db.models import Q
from django.dispatch import receiver
"""intercept signals from allauth"""
@receiver(email_confir... | scotartt/commentarius | decommentariis/decommentariis/signals.py | Python | gpl-2.0 | 1,210 |
# -*- coding: utf-8 -*-
import xbmc,urllib
all_modules = [ 'https://github.com/bazingasheldon/tv/blob/master/raspberry/addon.tar.gz?raw=true']
for parser in all_modules:
xbmc.executebuiltin('XBMC.RunPlugin("plugin://plugin.video.p2p-streams/?mode=405&name=p2p&url=' + urllib.quote(parser) + '")')
xbmc.sleep(1... | bazingasheldon/tv | loader.py | Python | gpl-2.0 | 421 |
#!/usr/bin/env python
#
# special_tests.py: testing special and reserved file handling
#
# Subversion is a tool for revision control.
# See http://subversion.tigris.org for more information.
#
# ====================================================================
# Copyright (c) 2000-2007 CollabNet. All rights res... | bdmod/extreme-subversion | BinarySourcce/subversion-1.6.17/subversion/tests/cmdline/special_tests.py | Python | gpl-2.0 | 22,957 |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2011-2012 Red Hat, Inc.
#
# Authors:
# Thomas Woerner <twoerner@redhat.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 2 of the Li... | ignatenkobrain/firewalld | src/firewall/core/fw_zone.py | Python | gpl-2.0 | 62,523 |
'''
Created on 29.07.2013
@author: mhoyer
'''
from mysqldb import MysqlDB
from local_system import LocalSystem
from remote_system import RemoteSystem
from entities import Application
import logging
import util
class Actionmanager():
'''
classdocs
'''
def __init__(self, config):
self.logger = ... | marco-hoyer/replicator | src/main/python/replicator/actionmanager.py | Python | gpl-2.0 | 6,373 |
def LetterCount(str):
words = str.split(" ")
result_word = ""
letter_count = 0
for word in words:
word_map = {}
for ch in word:
if ch in word_map:
word_map[ch] += 1
else:
word_map[ch] = 1
max_key = max(word_map.iterkeys(), ... | DevCouch/coderbyte_python | medium/letter_count.py | Python | gpl-2.0 | 614 |
from PerfectMatchingData import *
from Face import *
from Vertex import *
from Graph import *
from VertexList import *
from Output import *
from KekuleanMethods import *
from Checkers import *
from RequiredEdgeMethods import *
from Tkinter import *
from AppInformation import *
from random import randint
import time
i... | Jc11235/Kekulean_Program | GUI_Version/Ubuntu_Version/DriverMethods.py | Python | gpl-2.0 | 39,406 |
# encoding: utf-8
# module gtk._gtk
# from /usr/lib/python2.7/dist-packages/gtk-2.0/gtk/_gtk.so
# by generator 1.135
# no doc
# imports
import atk as __atk
import gio as __gio
import gobject as __gobject
import gobject._gobject as __gobject__gobject
class IconTheme(__gobject__gobject.GObject):
"""
Object Gtk... | ProfessorX/Config | .PyCharm30/system/python_stubs/-1247972723/gtk/_gtk/IconTheme.py | Python | gpl-2.0 | 2,041 |
"""
Django settings for infoneige project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
... | ideanotion/infoneigeapi | infoneige/settings.py | Python | gpl-2.0 | 2,053 |
#!/usr/bin/python -u
#
# Copyright (c) 2008--2010 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. You sho... | colloquium/spacewalk | spacewalk/certs-tools/client_config_update.py | Python | gpl-2.0 | 6,500 |
import os
import sqlite3
from time import sleep
from threading import get_ident
class FifoMemoryQueue(object):
def __init__(self):
self._db = []
def push(self, item):
if not isinstance(item, bytes):
raise TypeError('Unsupported type: {}'.format(type(item).__name__))
self._... | elaeon/sensors | queuelib.py | Python | gpl-2.0 | 3,810 |
# -*- coding: utf8 -*-
class Mv:
def command(self):
self.config = {
"command": {
"mv": {
"function": self.mvScreams,
"usage": "mv <user>",
"help": "Le clavier y colle!"
}
}}
return self.config
def mvScreams(se... | Morphux/IRC-Bot | modules/mv/mv.py | Python | gpl-2.0 | 1,360 |
from collections import OrderedDict
class SerializableModel(object):
def _asdict(self):
result = OrderedDict()
for key in self.__mapper__.c.keys():
result[key] = getattr(self, key)
return result
| taras1k/finance | server/utils.py | Python | gpl-2.0 | 237 |
# -*- coding: utf-8 -*-
from copy import deepcopy
from cfme.utils import conf
from cfme.utils.pretty import Pretty
from cfme.utils.update import Updateable
class FromConfigMixin(object):
@staticmethod
def rename_properties(creds):
"""
helper function to make properties have same names in crede... | anurag03/integration_tests | cfme/base/credential.py | Python | gpl-2.0 | 7,024 |
#!/usr/bin/env python
##################################################
## DEPENDENCIES
import sys
import os
import os.path
try:
import builtins as builtin
except ImportError:
import __builtin__ as builtin
from os.path import getmtime, exists
import time
import types
from Cheetah.Version import MinCompatib... | pli3/Openwebif | plugin/controllers/views/web/sleeptimer.py | Python | gpl-2.0 | 5,627 |
import httplib
import shlex
from datetime import datetime
#from pytz import timezone
import csv
import sys
import math
from time import time
from multiprocessing import Process
#finland = timezone('Europe/Helsinki')
server_dns = "121.78.237.160" #"keti3.oktree.com"
port = 8080
def run(ids):
conn = htt... | TinyOS-Camp/DDEA-DEV | [Python]Collection/query_and_dump_data.py | Python | gpl-2.0 | 2,400 |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
import sys
## Uncomment to run this script from an in-tree build (or adjust to the
## build directory) without installing the bindings.
#sys.path.append ('.')
#sys.path.append ('.libs')
import Hamlib
def StartUp():
"""Simple script to test the Hamlib.py module with... | airween/hamlib | bindings/pytest.py | Python | gpl-2.0 | 4,198 |
# This software may be freely redistributed under the terms of the GNU
# general public license.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
import os
import sys
import v... | caglar10ur/func | func/minion/modules/nm/vservermanager.py | Python | gpl-2.0 | 3,354 |
# -*- coding: utf-8 -*-
""" ImageViewer.py: PyQt image viewer widget for a QPixmap in a QGraphicsView scene with mouse zooming and panning. """
import os.path
from PyQt5.QtCore import Qt, QRectF, pyqtSignal, QT_VERSION_STR
from PyQt5.QtGui import QImage, QPixmap, QPainterPath, QWheelEvent
from PyQt5.QtWidgets import Q... | gis-support/DIVI-QGIS-Plugin | widgets/ImageViewerQt.py | Python | gpl-2.0 | 9,390 |
## This file is part of conftron.
##
## Copyright (C) 2011 Matt Peddie <peddie@jobyenergy.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 2 of the
## License, or (a... | peddie/conftron | settings.py | Python | gpl-2.0 | 8,250 |
import sys
import os
def convbytes(bstr):
return str(buildint(bstr))
def buildint(bvals):
return int.from_bytes(bvals, byteorder='little')
def buildstr(bvals):
print(str(bvals))
#return str(bvals)
return bvals.decode("utf-8")
def getOutFile(infilename, outfiledir):
lastslashind = infilename.... | blpete16/ProgPoint | parsetwo.py | Python | gpl-2.0 | 2,963 |
def merge(a, b):
"""
inuput: two sorted lists
output: a merged sorted list
for example:
merge([2,3], [1,4])
--> [1,2,3,4]
"""
merged = []
while a or b:
if a and b:
if a[0] < b[0]:
merged.append(a.pop(0))
else:
merged.ap... | humw/algorithms_in_python | merge_sort/merge_sort.py | Python | gpl-2.0 | 667 |
# Author: Martin Oehler <oehler@knopper.net> 2013
# License: GPL V2
from django.forms import ModelForm
from django.forms import Form
from django.forms import ModelChoiceField
from django.forms.widgets import RadioSelect
from django.forms.widgets import CheckboxSelectMultiple
from django.forms.widgets import TextInput... | MartinOehler/LINBO-ServerGUI | linboweb/linboserver/forms.py | Python | gpl-2.0 | 1,587 |
# -*- coding: utf-8 -*-
import fauxfactory
import pytest
from cfme.configure.configuration import Category, Tag
from cfme.rest.gen_data import a_provider as _a_provider
from cfme.rest.gen_data import categories as _categories
from cfme.rest.gen_data import dialog as _dialog
from cfme.rest.gen_data import services as _... | rananda/cfme_tests | cfme/tests/configure/test_tag.py | Python | gpl-2.0 | 7,263 |
# -*- coding: utf-8 -*-
"""
Implement a PGN reader/writer.
See http://www.chessclub.com/help/PGN-spec
"""
__author__ = 'Robert Ancell <bob27@users.sourceforge.net>'
__license__ = 'GNU General Public License Version 2'
__copyright__ = 'Copyright 2005-2006 Robert Ancell'
import re
"""
; Example PGN file
[Event "F/S... | guillaumebel/nibbles-clutter | glchess/src/lib/chess/pgn.py | Python | gpl-2.0 | 18,947 |
"""
Utility classes and functions to handle Virtual Machine creation using qemu.
:copyright: 2008-2009 Red Hat Inc.
"""
import time
import os
import logging
import fcntl
import re
import commands
from autotest.client.shared import error
from autotest.client import utils
import utils_misc
import virt_vm
import test_se... | spcui/virt-test | virttest/qemu_vm.py | Python | gpl-2.0 | 146,685 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#-----------------------------------------------------------------------------
# Copyright (C) 2009-2010 Nicolas P. Rougier
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distributed as part of this software.
#---------------... | Flavsditz/projects | eyeTracking/pupil/pupil_src/shared_modules/atb/__init__.py | Python | gpl-2.0 | 27,057 |
# -*- coding: utf8 -*-
#
# Created by 'myth' on 8/26/15
from tkinter import *
from algorithms import ASTAR_OPTIONS, ASTAR_HEURISTIC, GAC_DEFAULT_K, GAC_DEFAULT_CONSTRAINT
from common import *
def generate_menus(window):
"""
Takes in the window main menu bar and registers the submenus and
their commands
... | myth/trashcan | it3105/project1/gui/widgets.py | Python | gpl-2.0 | 6,474 |
#!/usr/bin/env python
# coding: UTF-8
# TcpdumpWrapper
#
# Copyright(c) 2015-2018 Uptime Technologies, LLC.
from datetime import datetime, timedelta, date, time
import hashlib
import os
import re
import subprocess
import sys
import log
class TcpdumpPacket:
def __init__(self, ts, src, dst, bytes, debug=None):
... | uptimejp/postgres-toolkit | postgres_toolkit/TcpdumpWrapper.py | Python | gpl-2.0 | 13,163 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from Plugins.Plugin import PluginDescriptor
from Components.ActionMap import *
from Components.Label import Label
from Components.Sources.StaticText import StaticText
from Components.MultiContent import MultiContentEntryText, MultiContentEntryPixmap, MultiContentE... | schleichdi2/OpenNfr_E2_Gui-6.0 | lib/python/Components/SearchCovers.py | Python | gpl-2.0 | 32,601 |
from random import randint
overflowstrings = ["A" * 255, "A" * 256, "A" * 257, "A" * 420, "A" * 511, "A" * 512, "A" * 1023, "A" * 1024, "A" * 2047, "A" * 2048, "A" * 4096, "A" * 4097, "A" * 5000, "A" * 10000, "A" * 20000, "A" * 32762, "A" * 32763, "A" * 32764, "A" * 32765, "A" * 32766, "A" * 32767, "A" * 32768, "A" * ... | ausarbluhd/EternalLLC | scripts/mallory/src/fuzz.py | Python | gpl-2.0 | 1,915 |
"""
Source: https://github.com/txt/mase/blob/master/src/ok.md
# Unit tests in Python
Python has some great unit testing tools. The one
shown below is a "less-is-more" approach and is
based on [Kent Beck video on how to write a test engine in just a
few lines of code](https://www.youtube.com/watch?v=nIonZ6-4nuU).
Fo... | rchakra3/x9115rc3 | hw/code/1/ok.py | Python | gpl-2.0 | 1,020 |
__author__ = 'Filushin_DV'
import generators
import tables
import profiler
from faker import Factory
date_start = '01/01/2015'
date_end = '06/06/2015'
citys = []
faker = Factory.create()
for i in range(100):
citys.append(faker.city())
valid_parents = (10, 2, 3)
field_list = []
field_list.append(tables.GenField... | DFilyushin/pydgen | prog.py | Python | gpl-2.0 | 967 |
print((int((str(179**10))*4))**(1/10))
| Wladislao/Python_Problems | 3xxx/34xx/345x/3451.py | Python | gpl-2.0 | 39 |
import sys
from datetime import datetime, timedelta
from array import array
from numpy import hsplit, asarray
class ECG:
'''Checks validity of selected .ecg file. If it is valid .ecg file creates an instance with all the data stored in .ecg file'''
def __init__(self, filename, enc='cp1250'):
'''Defaul... | panrobot/ishneECGviewer | ecgReader.py | Python | gpl-2.0 | 7,145 |
from __future__ import print_function
import os
import sys
from datetime import datetime
import portage
import gentoolkit.pprinter as pp
from gentoolkit.query import Query
from gentoolkit.package import Package
from euscan import CONFIG, BLACKLIST_PACKAGES
from euscan import handlers, output
from euscan.out import ... | iksaif/euscan | pym/euscan/scan.py | Python | gpl-2.0 | 5,444 |
import matplotlib.pyplot as plt
import numpy as np
from image_funcs import *
from scipy.misc import imread, imsave
def grid(image, threshold):
###############################################################################
import scipy.misc
nuclei = imread('3.jpg')
nuclei = scipy.misc.imresize(nuclei, 0.05)
nuclei =... | varnivey/hakoton_images | image_preparation/cells_search.py | Python | gpl-2.0 | 1,484 |
#!/usr/bin/env python3
import os
import sys
import redis
app_path = os.path.realpath('%s/../../..' % os.path.dirname(os.path.abspath(__file__)))
sys.path.insert(0, '%s/lib' % app_path)
import settings
def get_db(conf):
return redis.StrictRedis(host=conf['host'], port=int(conf['port']), db=int(conf['id']))
i... | czcorpus/kontext | lib/plugins/redis_db/cleanup.py | Python | gpl-2.0 | 1,129 |
"""
Loadable.Loadable subclass
"""
# This file is part of Munin.
# Munin 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.
# Munin is ... | munin/munin | deprecated/cajbook.py | Python | gpl-2.0 | 7,158 |
# ##### 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 program is ... | 244xiao/blender-java | blender-java/src/resources/release/scripts/ui/properties_data_metaball.py | Python | gpl-2.0 | 3,814 |
from django.core.validators import RegexValidator
from django.db import models
from event.models import Event
class Job(models.Model):
id = models.AutoField(primary_key=True)
event = models.ForeignKey(Event)
name = models.CharField(
max_length=75,
validators=[
RegexValidator(
... | willingc/vms | vms/job/models.py | Python | gpl-2.0 | 675 |
#!/usr/bin/python3
def soma_hipotenusas(n):
chipotenusa=1
somahipot=[]
while chipotenusa <=n:
cat1 = 1
while cat1 <=n:
cat2=1
cat1+=1
while cat2 <=n:
if (cat1**2 + cat2**2) == chipotenusa**2:
if chipotenusa not in somah... | david81brs/seaport | week6/l5_hipotenusas.py | Python | gpl-2.0 | 632 |
# config.py
# Configuration for tasks application.
# Author: Julien Pecqueur (julien@peclu.net)
# License: GPL
NAME = 'tasks.py'
VERSION = 0.1
# Path to tasks database
DB = './tasks.db'
# Interface to listen
HOST = '0.0.0.0'
PORT = '8081'
# Debug mode
DEBUG = False
# Auto-reload service in case of ... | jpec/tasks.py | config.py | Python | gpl-2.0 | 350 |
'''
Created on Feb 22, 2013
@author: u5682
'''
from datetime import datetime
import os, sys, pickle
import subprocess
from time import sleep
import xml.dom.minidom
from xml.dom.minidom import Node
class DistributedTask(object):
'''
classdocs
'''
def __init__(self, fileName = None):
'''
Constructor
'''... | supermanue/distributedController | clusterController/DistributedTask.py | Python | gpl-2.0 | 3,026 |
'''
Ultimate Whitecream
Copyright (C) 2016 mortael
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.
... | felipenaselva/repo.felipe | plugin.video.uwc/cam4.py | Python | gpl-2.0 | 3,936 |
#!/usr/bin/env python
"""
Use Telemac (selafin) output
==================================
"""
from datetime import timedelta, datetime
from os import sep
from pyproj import Proj
from opendrift.readers import reader_telemac_selafin
from opendrift.models.oceandrift import OceanDrift
o = OceanDrift(loglevel=0)
filename=... | OpenDrift/opendrift | examples/example_long_selafin.py | Python | gpl-2.0 | 1,371 |
"""
script_watcher.py: Reload watched script upon changes.
Copyright (C) 2015 Isaac Weaver
Author: Isaac Weaver <wisaac407@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; eith... | kilbee/blender-script-watcher | script_watcher.py | Python | gpl-2.0 | 12,299 |
# -*- coding: utf-8 -*-
"""Programa baseado no Teste Wisconsin
Autor: Neno Henrique Albernaz
Criado em Junho de 2008"""
########################################################################
class Carta:
# Definição dos itens de uma carta.
_numeros = [(u"Um", u"Uma"),
(u"Dois", u"D... | labase/activnce | main/plugins/wisconsin/wcst.py | Python | gpl-2.0 | 4,743 |
from MAF import MAF
class IngroupSplitter:
def __init__(self, ingroup, splitdist, junkchars='Nn'):
self.ingroup = ingroup
self.splitdist = splitdist
self.junkchars = junkchars
assert "-" not in self.junkchars
#return a list of mafs representing the old mafs that have split... | kaspermunch/CoalhmmPipeline | CoalhmmPipeline/IngroupSplitter.py | Python | gpl-2.0 | 5,732 |
#! /usr/bin/env python
# Copyright (C) 2009 Sebastian Garcia
#
# 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.
#
#... | royharoush/rtools | dnc.py | Python | gpl-2.0 | 13,314 |
from yade import export,polyhedra_utils
mat = PolyhedraMat()
O.bodies.append([
sphere((0,0,0),1),
sphere((0,3,0),1),
sphere((0,2,4),2),
sphere((0,5,2),1.5),
facet([Vector3(0,-3,-1),Vector3(0,-2,5),Vector3(5,4,0)]),
facet([Vector3(0,-3,-1),Vector3(0,-2,5),Vector3(-5,4,0)]),
polyhedra_utils.polyhedra(mat,(1,2,3),... | ThomasSweijen/yadesolute2 | examples/test/vtk-exporter/vtkExporter.py | Python | gpl-2.0 | 976 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.Create... | MrSenko/Nitrate | tcms/core/contrib/auth/migrations/0001_initial.py | Python | gpl-2.0 | 867 |
"""Unit tests for psrfits_to_sdfits.py."""
import unittest
import sys
import scipy as sp
import numpy.random as rand
import psrfits_to_sdfits as p2s
import kiyopy.custom_exceptions as ce
class TestFormatData(unittest.TestCase) :
def setUp(self) :
self.ntime = 5
self.npol = 4
self.nfreq... | kiyo-masui/SDdata | sddata/tests/test_psrfits_to_sdfits.py | Python | gpl-2.0 | 9,556 |
#!/usr/bin/env python
import sys
import numpy as np
from matplotlib import pyplot as plt
def main():
infile = open(sys.argv[1])
data = np.array(map(lambda x:map(float, x.strip('\n').split('\t')), infile.readlines()))
X = data[:, 0:-1]
(N, D) = X.shape
Y = data[:, -1].reshape((N, 1))
pl... | yil8/NNtoolbox | bin/plot.py | Python | gpl-2.0 | 551 |
"""
Copyright 2016, 2017 UFPE - Universidade Federal de Pernambuco
Este arquivo é parte do programa Amadeus Sistema de Gestão de Aprendizagem, ou simplesmente Amadeus LMS
O Amadeus LMS é um software livre; você pode redistribui-lo e/ou modifica-lo dentro dos termos da Licença Pública Geral GNU como publicada pela ... | amadeusproject/amadeuslms | banco_questoes/serializers.py | Python | gpl-2.0 | 5,241 |
import random
import math
import sympy
from sympy import latex, fraction, Symbol, Rational
localid =11181500100000
letter=["a","b","c","d"]
n=[0,0,0,0,0,0]
m=[0,0,0,0,0]
f = open("111815001.tex","w") #opens file with name of "test.txt"
for x in range(0, 1000):
localid = localid +1
writewrong=["\correctchoice{... | johncbolton/amcpy | 111815001.py | Python | gpl-2.0 | 2,105 |
"""
network/bluetooth_server.py
Starts a bluetooth server with max 7 connections.
Receives and sends data from/to paired client.
PS3 controller: receive only
Android App: receive/send
"""
import base64
from threading import Thread
from bluetooth import *
import protocol
import thread
import atexit
PACKET_SIZE = 990
... | CallanIwan/Aranha | core/network/bluetooth_server.py | Python | gpl-2.0 | 3,131 |
"""
Copyright (C) 2018 MuadDib
----------------------------------------------------------------------------
"THE BEER-WARE LICENSE" (Revision 42):
@tantrumdev wrote this file. As long as you retain this notice you
can do whatever you want with this stuff. If we meet some day, and you think
th... | repotvsupertuga/tvsupertuga.repository | plugin.video.TVsupertuga/resources/lib/plugins/tools.py | Python | gpl-2.0 | 12,896 |
#!/usr/bin/python
__version__ = '0.0.1'
import pysimplesoap.client
import pysimplesoap.simplexml
from zimbrasoap.soap import soap,admin,mail
| Secretions/zmdomainexport | zimbrasoap/__init__.py | Python | gpl-2.0 | 144 |
"""
WSGI config for HW3 project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "HW3.settings")
from django.core.wsgi impo... | dperlee/HW3 | HW3/wsgi.py | Python | gpl-2.0 | 492 |
# -*- coding: utf-8 -*-
"""Module handling report menus contents"""
from contextlib import contextmanager
import attr
from navmazing import NavigateToAttribute
from widgetastic.widget import Text
from widgetastic_patternfly import Button
from . import CloudIntelReportsView
from . import ReportsMultiBoxSelect
from cfm... | RedHatQE/cfme_tests | cfme/intelligence/reports/menus.py | Python | gpl-2.0 | 6,600 |
#
# ADIABATIC_FLAME - A freely-propagating, premixed methane/air flat
# flame with multicomponent transport properties
#
from Cantera import *
from Cantera.OneD import *
from Cantera.OneD.FreeFlame import FreeFlame
################################################################
#
# parameter values
#
p ... | HyperloopTeam/FullOpenMDAO | cantera-2.0.2/samples/python/flames/adiabatic_flame/adiabatic_flame.py | Python | gpl-2.0 | 2,623 |
'''
Vidbull urlresolver plugin
Copyright (C) 2013 Vinnydude
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 di... | VioletRed/script.module.urlresolver | lib/urlresolver/plugins/vidbull.py | Python | gpl-2.0 | 2,788 |
# portage.py -- core Portage functionality
# Copyright 1998-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
VERSION="HEAD"
# ===========================================================================
# START OF IMPORTS -- START OF IMPORTS -- START OF IMPORTS -- START OF IMPO... | devurandom/portage | pym/portage/__init__.py | Python | gpl-2.0 | 21,844 |
"""
Test the CONMIN optimizer component
"""
import unittest
import numpy
# pylint: disable=F0401,E0611
from openmdao.main.api import Assembly, Component, VariableTree, set_as_top, Driver
from openmdao.main.datatypes.api import Float, Array, Str, VarTree
from openmdao.lib.casehandlers.api import ListCaseRecorder
from ... | HyperloopTeam/FullOpenMDAO | lib/python2.7/site-packages/openmdao.lib-0.13.0-py2.7.egg/openmdao/lib/drivers/test/test_opt_conmin.py | Python | gpl-2.0 | 27,188 |
import unittest
from pyramid import testing
class ViewTests(unittest.TestCase):
def setUp(self):
self.config = testing.setUp()
def tearDown(self):
testing.tearDown()
def test_my_view(self):
from .views import my_view
request = testing.DummyRequest()
info = my_vie... | kellazo/zodiacbauth | src/zodiacbauth/zodiacbauth/tests.py | Python | gpl-2.0 | 388 |
# -*- coding: utf-8 -*-
#############################################################
# This file was automatically generated on 2022-01-18. #
# #
# Python Bindings Version 2.1.29 #
# ... | Tinkerforge/brickv | src/brickv/bindings/bricklet_linear_poti_v2.py | Python | gpl-2.0 | 14,625 |
import unittest
import numpy
from deltaphi.category_info import RawCategoryInfo, CategoryGroup, CategoryInfoFactory
from deltaphi.fake_entities import FakeCategoryInfo
__author__ = 'Emanuele Tamponi'
class TestCategoryGroup(unittest.TestCase):
def setUp(self):
self.builder = CategoryInfoFactory({"a", ... | etamponi/taxonomy-generator | deltaphi/test_category_group.py | Python | gpl-2.0 | 3,675 |
"""This module tests events that are invoked by Cloud/Infra VMs."""
import fauxfactory
import pytest
from cfme import test_requirements
from cfme.cloud.provider import CloudProvider
from cfme.cloud.provider.gce import GCEProvider
from cfme.control.explorer.policies import VMControlPolicy
from cfme.infrastructure.provi... | izapolsk/integration_tests | cfme/tests/cloud_infra_common/test_events.py | Python | gpl-2.0 | 3,523 |
# Copyright 2007-2010 by Peter Cock. All rights reserved.
# Revisions copyright 2010 by Uri Laserson. All rights reserved.
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package.
#
# This code is NOT intend... | BlogomaticProject/Blogomatic | opt/blog-o-matic/usr/lib/python/Bio/GenBank/Scanner.py | Python | gpl-2.0 | 79,599 |
from django.conf.urls import url
from . import views
urlpatterns = [
# General endpoints
url(r"^status/?$", views.get_status),
url(r"^version/?$", views.get_version),
# API authorization
url(r"^login/?$", views.login),
url(r"^logout/?$", views.logout),
url(r"^get-api-key/?$", views.get_api... | Kegbot/kegbot-server | pykeg/web/api/urls.py | Python | gpl-2.0 | 3,947 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# --- BEGIN_HEADER ---
#
# mv - [insert a few words of module description on this line]
# Copyright (C) 2003-2009 The MiG Project lead by Brian Vinter
#
# This file is part of MiG.
#
# MiG is free software: you can redistribute it and/or modify
# it under the terms of the GN... | heromod/migrid | mig/cgi-bin/mv.py | Python | gpl-2.0 | 1,092 |
# -*- coding: utf-8 -*-
"""
The moo Editor
~~~~~~~~~~~~~~
:copyright: 2005-2008 by The PIDA Project
:license: GPL 2 or later (see README/COPYING/LICENSE)
"""
# Standard Libs
import os
import gtk
import gobject
import re
from gtk import gdk
# UGLY UGLY workarround as suggested by muntyan_
# this will... | fermat618/pida | pida/editors/mooedit/mooedit.py | Python | gpl-2.0 | 60,125 |
#!/usr/bin/python
__author__ = 'Markus Bajones'
__license__ = 'GPL'
__version__ = '1.0.0'
__email__ = 'markus.bajones@gmail.com'
"""
- download ROS key from keyserver and install it
- show settings (mirror/package selection/ROS distro)
- install selected packages
- rosdep update, and init
"""
import ImageTk
import l... | bajo/ros_installer_gui | tkmain.py | Python | gpl-2.0 | 8,340 |
#!/usr/bin/env python
#Copyright 2007,2008,2012 Sebastian Hagen
# This file is part of gonium.
#
# gonium 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) ... | sh01/gonium | src/dns_resolving/stub.py | Python | gpl-2.0 | 23,265 |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015 Red Hat, Inc.
#
# Authors:
# Thomas Woerner <twoerner@redhat.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 2 of the License... | divereigh/firewalld | src/firewall/core/ipset.py | Python | gpl-2.0 | 6,843 |
from minieigen import *
from woo.dem import *
import woo.core, woo.models
from math import *
import numpy
class PourFeliciter(woo.core.Preprocessor,woo.pyderived.PyWooObject):
'''Showcase for custom packing predicates, and importing surfaces from STL.'''
_classTraits=None
_PAT=woo.pyderived.PyAttrTrait # ... | sjl767/woo | py/pre/toys.py | Python | gpl-2.0 | 3,537 |
'''File Tree scanning related functions and classes'''
import os
class DiskObjInfo(object):
'''Hold inforation to identify an object on the disk'''
def __init__(self, rel_path, path_on_disk):
self.__name = os.path.basename(rel_path)
self.__rel_path = rel_path
self.__path_on_disk = path... | shearern/rsync-usb | src/rsync_usb/ftree.py | Python | gpl-2.0 | 4,574 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('core', '0028_auto_20151026_0926'),
]
operations = [
migrations.AlterField(
model_name='partner',
nam... | agripo/website | core/migrations/0029_auto_20151028_1609.py | Python | gpl-2.0 | 595 |
# -*- coding: utf-8 -*-
import 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 'Message'
db.create_table(u'message_message', (
(u'id', self.gf('django.db.models... | ContributeToScience/participant-booking-app | booking/message/migrations/0001_initial.py | Python | gpl-2.0 | 7,560 |
#Boss Ogg - A Music Server
#(c)2003 by Ted Kulp (wishy@comcast.net)
#This project's homepage is: http://bossogg.wishy.org
#
#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 L... | tedkulp/bossogg | boss3/xmlrpc/Util.py | Python | gpl-2.0 | 1,506 |
## begin license ##
#
# "Meresco Lucene" is a set of components and tools to integrate Lucene into Meresco
#
# Copyright (C) 2013-2016, 2019-2021 Seecr (Seek You Too B.V.) https://seecr.nl
# Copyright (C) 2013-2014 Stichting Bibliotheek.nl (BNL) http://www.bibliotheek.nl
# Copyright (C) 2015-2016, 2019 Koninklijke Bibl... | seecr/meresco-lucene | meresco/lucene/composedquery.py | Python | gpl-2.0 | 11,941 |
# Python imports
# Lib imports
from PyInquirer import style_from_dict, Token
# Application imports
class StylesMixin:
"""
The StylesMixin has style methods that get called and
return their respective objects.
"""
def default(self):
return style_from_dict({
Token.Sep... | RaveYoda/Shellmen | src/core/mixins/StylesMixin.py | Python | gpl-2.0 | 2,111 |
# Portions 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.
# highlight.py - highlight extension implementation file
#
# Copyright 2007-2009 Adam Hupp <adam@hupp.org> and others
#
# This software may be... | facebookexperimental/eden | eden/hg-server/edenscm/hgext/highlight/highlight.py | Python | gpl-2.0 | 3,008 |
"""Code for constructing CTMCs and computing transition probabilities
in them."""
from numpy import zeros
from scipy import matrix
from scipy.linalg import expm
class CTMC(object):
"""Class representing the CTMC for the back-in-time coalescent."""
def __init__(self, state_space, rates_table):
"""Cre... | mailund/IMCoalHMM | src/IMCoalHMM/CTMC.py | Python | gpl-2.0 | 2,581 |
# import data_structures.binary_search_trees.rope as rope
import data_structures.binary_search_trees.set_range_sum as set_range_sum
import data_structures.binary_search_trees.tree_orders as tree_orders
import pytest
import os
import sys
import resource
CI = os.environ.get('CI') == 'true'
# Helpers
class BinarySearc... | chaicko/AlgorithmicToolbox | test/data_structures/test_binary_search_trees.py | Python | gpl-3.0 | 7,486 |
# ============================================================================
# FILE: size.py
# AUTHOR: Shougo Matsushita <Shougo.Matsu at gmail.com>
# License: MIT license
# ============================================================================
from defx.base.column import Base, Highlights
from defx.context im... | SpaceVim/SpaceVim | bundle/defx.nvim/rplugin/python3/defx/column/size.py | Python | gpl-3.0 | 1,686 |
from collections import OrderedDict
import pytest
from ucca import textutil
from ucca.constructions import CATEGORIES_NAME, DEFAULT, CONSTRUCTIONS, extract_candidates
from .conftest import PASSAGES, loaded, loaded_valid, multi_sent, crossing, discontiguous, l1_passage, empty
"""Tests the constructions module functio... | danielhers/ucca | ucca/tests/test_constructions.py | Python | gpl-3.0 | 2,357 |
#!/usr/bin/python
import feedparser
import wget
import sqlite3
import time
RssUrlList = ['http://postitforward.tumblr.com/rss','http://for-war3-blog-blog.tumblr.com/rss']
sleep=3600/len(RssUrlList)
def mkdir(path):
import os
path=path.strip()
path=path.rstrip("\\")
isExists=os.path.exists(path)
... | yanyuechuixue/tumblr2onedriver | Main.py | Python | gpl-3.0 | 2,513 |
#!/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/phase.py | Python | gpl-3.0 | 27,563 |
import logging
from sqlalchemy import engine_from_config
from courier.scripts import settings
from courier.models import DeclarativeBase, DBSession, db_views, populate_lookups
LOG = False
def main(DBSession, engine):
# set up logging
if LOG:
logging.basicConfig()
logging.getLogger('sqlalchemy... | alienlike/courier | courier/scripts/create_tables.py | Python | gpl-3.0 | 816 |
#! /usr/bin/env python
import sys, cv, cv2, os
import numpy as np
import subprocess, signal
import math
import atexit
import cPickle as pickle
from sklearn.cluster import DBSCAN
from sklearn import metrics, preprocessing
import pymeanshift as pms
from optparse import OptionParser
import time
parser = OptionParser()
... | AutonomyLab/husky | opencv-utilities/video-creator.py | Python | gpl-3.0 | 1,535 |
import types
from flask import jsonify
from werkzeug.exceptions import default_exceptions
from werkzeug.exceptions import HTTPException
from twiml_server import app
def make_json_app():
def make_json_error(ex):
response = jsonify(message=str(ex))
response.status_code = (ex.code
... | vfulco/twilio_server | twiml_server/common/util.py | Python | gpl-3.0 | 541 |