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 |
|---|---|---|---|---|---|
"""
Utility classes and functions to handle Virtual Machine creation using qemu.
:copyright: 2008-2009, 2014 Red Hat Inc.
"""
import time
import os
import logging
import fcntl
import re
import commands
import aexpect
from avocado.core import exceptions
from avocado.utils import process
from avocado.utils import cryp... | will-Do/avocado-vt | virttest/qemu_vm.py | Python | gpl-2.0 | 189,844 |
"""
Model Abstraction of e-economic.com API
"""
import copy
import re
import os
import base64
from collections import defaultdict
from suds.client import Client
class ObjectDoesNotExist(BaseException):
pass
class MultipleObjectsReturned(BaseException):
pass
class EConomicsService(object):
"""
In... | mikkeljans/pyconomic | pyconomic/base.py | Python | gpl-2.0 | 19,899 |
'''
Plugin for URLResolver
Copyright (C) 2016 Gujal
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.
... | dknlght/dkodi | src/script.module.urlresolver/lib/urlresolver/plugins/putload.py | Python | gpl-2.0 | 979 |
from bs4 import BeautifulSoup
html_doc = open('../Dataset/CVPR 2011/5995308_full_text.xml', 'rb')
soup = BeautifulSoup(html_doc, 'html.parser')
# print(soup.prettify())
# print soup.title
# print soup.title.string
## extract article
article = soup.find(id = 'article')
## extract all sections
sections_list = []
for ... | lidalei/IR-Project | src/CrawlDataset/Xml_Parse.py | Python | gpl-2.0 | 3,258 |
#! /usr/local/bin/python3
# -*- utf-8 -*-
"""
Total: 45
0: number of 3-hour defined sessions in the enrollment
1~4: average, standard deviation, maximal, minimal numbers of events in
3-hour defined sessions in the enrollment
5~8: statistics of 3-hour defined sessions: mean, std, max, min of duration
9: number of ... | Divergent914/yakddcup2015 | sessions.py | Python | gpl-2.0 | 4,628 |
#!/usr/bin/env python
#-*- encoding: utf-8 -*-
import random
list_names = ["ivan","foo","bar","mary","peter"]
random.shuffle(list_names)
print 'You are winner: < %s >' % (random.choice(list_names))
| iv4nelson/apps_tigd | sorted_random.py | Python | gpl-2.0 | 203 |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2014, 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... | zenodo/invenio | invenio/modules/accounts/views/settings.py | Python | gpl-2.0 | 4,581 |
#!/usr/bin/python
#
# Copyright(c) 2009, Gentoo Foundation
#
# Licensed under the GNU General Public License, v2
#
# $Header$
import unittest
from gentoolkit.cpv import CPV, compare_strs
from gentoolkit.test import cmp
class TestGentoolkitCPV(unittest.TestCase):
def assertEqual2(self, o1, o2):
# logic bugs hidde... | zmedico/gentoolkit | pym/gentoolkit/test/test_cpv.py | Python | gpl-2.0 | 4,141 |
"""
NCL User Guide Python Example: PyNGL_unstructured_contour_cellfill.py
- unstructured data (ICON)
- contour plot
- CellFill
05.06.15 kmf
"""
import numpy as np
import math, time
import sys,os
import Ngl,Nio
#----------------------
#-- MAIN
#----------------------
t1 = time.time() ... | likev/ncl | ncl_ncarg_src/ni/src/examples/nug/NUG_unstructured_contour_cellfill_PyNGL.py | Python | gpl-2.0 | 5,242 |
#! /usr/bin/env python3
from publicAPI import auth_account, register_account, change_admin_password
from publicAPI import modify_admin_account_info, add_admin_account, delete_account, change_admin_permission
from config.settings import user_info
from publicAPI import register_account, for_super_admin_change_password, ... | zengchunyun/s12 | day5/ATM_mall/ATM/__init__.py | Python | gpl-2.0 | 14,978 |
from unittest import TestCase
from brainiak.handlers import ClassHandler, VersionHandler, \
HealthcheckHandler, VirtuosoStatusHandler, InstanceHandler, SuggestHandler, \
StoredQueryCollectionHandler, StoredQueryCRUDHandler, StoredQueryCRUDHandler, \
StoredQueryExecutionHandler
from brainiak.routes import R... | bmentges/brainiak_api | tests/unit/test_routes.py | Python | gpl-2.0 | 5,018 |
import asteroid
import math
import pygame
from pygame.locals import *
import random
import ship
import sys
'''Pygame constants'''
SCR_WIDTH, SCR_HEIGHT = 640, 480
FPS = 30
'''Misc stff'''
starfield = []
NUM_STARS = 45
asteroids = []
NUM_ASTEROIDS = 3
'''Pygame init'''
pygame.init()
fps_timer = pygame.time.Clock()
sc... | vitriolik/Asteroids2 | asteroids.py | Python | gpl-2.0 | 3,039 |
# Copyright 2008, Red Hat, Inc
# Steve Salevan <ssalevan@redhat.com>
#
# 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., ... | pombredanne/func | func/minion/modules/overlord.py | Python | gpl-2.0 | 1,452 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Setup Script for Speak
You can install Speak with
python setup.py install
"""
import os
import re
import sys
from setuptools import find_packages, setup
if sys.argv[-1] == 'setup.py':
print("To install, run 'python setup.py install'")
print()
if sys.versi... | jamalsenouci/speak | setup.py | Python | gpl-2.0 | 2,219 |
#! /usr/bin/env python
# rpm_solver.py
# Given a pile of RPMs will check dependency closure, will attempt to figure out
# their installation order.
#
# Copyright 2005 Progeny Linux Systems, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public Lic... | blipvert/rpmstrap | tools/rpm_solver.py | Python | gpl-2.0 | 14,705 |
import logging
import os
from pathlib import Path
from pydoc import locate
import re
import threading
from jsonschema import validate
import yaml
from Legobot.Lego import Lego
DIR = Path(__file__).resolve().parent
HELP_PATH = 'Legobot.Legos.Help.Help'
def build_logger(log_file=None, level=None):
if (
... | bbriggs/Legobot | Legobot/Chatbot.py | Python | gpl-2.0 | 4,280 |
def fib():
a, b = 0, 1
while True:
yield a
a, b = b, a+b
f = fib()
for i in range(10): # print the first ten Fibonacci numbers
print f.next(), # 0 1 1 2 3 5 8 13 21 34
####################
# loop through a generator
for item in function_that_returns_a_generator(param1, param2):
... | jabbalaci/PrimCom | data/python/my_generator.py | Python | gpl-2.0 | 332 |
from twisted.trial import unittest
from twisted.python import usage, runtime
from twisted.internet import threads
import os.path, re, sys, subprocess
from cStringIO import StringIO
from allmydata.util import fileutil, pollmixin
from allmydata.util.encodingutil import unicode_to_argv, unicode_to_output, get_filesyste... | drewp/tahoe-lafs | src/allmydata/test/test_runner.py | Python | gpl-2.0 | 31,464 |
import datetime, time
print time.mktime(datetime.datetime.now().timetuple()) * 1000
| spicyramen/sipLocator | tools/testTimeEpoch.py | Python | gpl-2.0 | 85 |
from math import sin, cos, pi, atan2, atan, asin, tan
def sun_pos(dd):
'''This routine is a truncated version of Newcomb's Sun and
is designed to give apparent angular coordinates (T.E.D) to a
precision of one second of time.
Translated from SSW (IDL) routine of the same name
'''
... | dgary50/eovsa | sun_pos.py | Python | gpl-2.0 | 6,047 |
# Copyright (c) 1999-2002 Gary Strangman; All Rights Reserved.
#
# This software is distributable under the terms of the GNU
# General Public License (GPL) v2, the text of which can be found at
# http://www.gnu.org/copyleft/gpl.html. Installing, importing or otherwise
# using this module constitutes acceptance of the t... | dschwilk/traithull | stats/stats.py | Python | gpl-2.0 | 152,205 |
"""
Program name: MPS-Proba
Program purpose: The Alpha version of the APC 524 project.
File name: mpssolver.py
File purpose: the solver class based on the matrix product states
Responsible persons:
Peiqi Wang and Jun Xiong for Contraction and Compression
Bin Xu for Interpreter
"""
from solver import So... | binarybin/MPS_Proba | src/mpssolver.py | Python | gpl-2.0 | 21,994 |
from builtins import range
from future.utils import viewitems, viewvalues
from miasm.expression.expression import *
from miasm.ir.ir import IntermediateRepresentation, IRBlock, AssignBlock
from miasm.arch.arm.arch import mn_arm, mn_armt
from miasm.arch.arm.regs import *
from miasm.jitter.csts import EXCEPT_DIV_BY_ZER... | commial/miasm | miasm/arch/arm/sem.py | Python | gpl-2.0 | 49,320 |
#!/usr/bin/python
#
import socket
from device_cisco_hp import Device_cisco_hp
#from device_f5 import Device_f5
#from device_wlc import Device_wlc
import time
import sys
import re
import os
def recv_timeout(the_socket,timeout=2):
#make socket non blocking
the_socket.setblocking(0)
#total data partwise in ... | christianbur/check_mk | network_management_with_cmk/backup_switche.py | Python | gpl-2.0 | 12,734 |
"""This file contains different Solving Agents for CSP Problems """
def minConflict(problem, numIter=100000):
"""Min Conflict : Solves Constraint Satisfaction Problems.
Given a possible assignment of all variables in CSP, it re-assigns all variables iteratively untill all contraints are satisfied
INPUTS:
... | kushjain/Min-Conflicts | solveAgent.py | Python | gpl-2.0 | 1,214 |
"""Helper code for running QuickTile functional tests"""
__author__ = "Stephan Sokolow (deitarion/SSokolow)"
__license__ = "GNU GPL 2.0 or later"
| ssokolow/quicktile | functional_harness/__init__.py | Python | gpl-2.0 | 147 |
# Some utilities for dealing with specifying edge depths:
import getopt
import sys,os
sys.path.append(os.path.join(os.environ['HOME'], 'python'))
from numpy import *
import sunreader
#reload(sunreader)
import pdb
class EdgeDepthWriter(object):
""" For a grid that has been partitioned, write out new edge-based ... | rustychris/stomel | src/edge_depths.py | Python | gpl-2.0 | 10,647 |
# Copyright (c) 2013 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. You should have received a copy of G... | candlepin/subscription-manager | src/subscription_manager/plugins.py | Python | gpl-2.0 | 37,132 |
# -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsDatumTransforms.
.. note:: 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.
"... | telwertowski/QGIS | tests/src/python/test_qgsdatumtransforms.py | Python | gpl-2.0 | 18,982 |
#! /usr/bin/python
'''
Created on Sep 20, 2014
@author: Grzegorz Pasieka (grz.pasieka@gmail.com)
Copyright (C) 2014 Grzegorz Pasieka
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... | GregObake/git-p4-hybrid | test/test_p4_wrapper.py | Python | gpl-2.0 | 4,622 |
# Distributed under the MIT licesnse.
# Copyright (c) 2013 Dave McCoy (dave.mccoy@cospandesign.com)
#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 limita... | CospanDesign/nysa-gui | NysaGui/ibuilder/view/builder/build_box.py | Python | gpl-2.0 | 3,979 |
from fcntl import flock, LOCK_EX, LOCK_UN
from tempfile import TemporaryFile
class TempfileLock:
def __init__(self):
self.handle = TemporaryFile()
def lock(self):
flock(self.handle, LOCK_EX)
def unlock(self):
flock(self.handle, LOCK_UN)
def __del__(self):
self.hand... | andbof/plantdb | plant/tempfilelock.py | Python | gpl-2.0 | 331 |
#!/usr/bin/python
import math
import time
import ephem
import os
from datetime import datetime
from process import makestuff
def get_them(name,cnt):
count = 0
for gps in visiblesats:
if name in gps.name:
plist.append(gps)
count += 1
if count==cnt:
break
satelit = []
visiblesats = []
plist = []
min... | luisfcorreia/pas | showlist.py | Python | gpl-2.0 | 1,070 |
#! /usr/bin/env python3.3
#Search interface that gives Flickr and Youtube Results
#make the root window
from tkinter import *
from tkinter import ttk
from tkinter import filedialog
from ast import literal_eval
from subprocess import check_output
from os import chdir, getcwd
home = getcwd()
root = Tk()
#finds a dir... | jpcurrea/FIU-Developmental-Psychobiology-Lab | search.py | Python | gpl-2.0 | 11,013 |
# -*- coding: utf-8 -*-
"""
***************************************************************************
Union.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
*********************************... | SebDieBln/QGIS | python/plugins/processing/algs/qgis/Union.py | Python | gpl-2.0 | 11,981 |
#
# Baruwa - Web 2.0 MailScanner front-end.
# Copyright (C) 2010-2012 Andrew Colin Kissa <andrew@topdog.za.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... | liveaverage/baruwa | src/baruwa/lists/templatetags/lists_sorter.py | Python | gpl-2.0 | 1,742 |
from numpy import *
import alg6 as godfish
import alg5_workstypes as alg
import string
import os
import time
if __name__=='__main__':
import cPickle as pickle
fptr=open('yago_relationss_full.pkl', 'rb')
relationss= pickle.load(fptr)
fptr.close()
print 'yago loaded'
da... | lioritan/Thesis | problems/techTCrun_old.py | Python | gpl-2.0 | 3,484 |
#-*- coding: utf8 -*-
import TaodianApi
import json
import time
import os
import string
print "start"
def file_exist():
filelist = os.listdir("../webrobot/")
exist = False
mx = "0001"
for f in filelist:
temp = f.split(".", 1)
if mx < temp[0]:
mx = temp[0]
#if temp[1] == "running" or temp[1] == "waiting" :... | emop/webrobot | sina_empower/libs/myserver.py | Python | gpl-2.0 | 1,789 |
# Sketch - A Python-based interactive drawing program
# Copyright (C) 1998, 1999 by Bernhard Herzog
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, o... | shumik/skencil-c | Sketch/Scripting/script.py | Python | gpl-2.0 | 2,386 |
__author__ = 'tmy'
from rdflib import Graph, Literal, Namespace, RDFS, URIRef
import urllib.parse as urllib
import logging
import pandas as pd
from ext2rdf.src.Utilities.Constants import LOG_LEVEL, NAMESPACE
from ext2rdf.src.RDFConverter.AbstractConverter import AbstractConverter
log = logging.getLogger()
log.setLeve... | Weissger/ext2rdf | src/RDFConverter/TripleStructureConverter.py | Python | gpl-2.0 | 1,676 |
import pisock
import datetime
def dlp_ReadDBList(sd, cardno=0, flags=None):
ret = []
i = 0
if flags is None:
flags = pisock.dlpDBListRAM
while True:
try:
lst = pisock.dlp_ReadDBList_(sd, cardno, pisock.dlpDBListMultiple | flags, i)
if (lst is None) or (len(lst) =... | unwiredben/pilot-link | bindings/Python/src/pisockextras.py | Python | gpl-2.0 | 701 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2012 Domsense s.r.l. (<http://www.domsense.com>).
# Copyright (C) 2012 Agile Business Group sagl (<http://www.agilebg.com>)
#
# This program is ... | syci/domsense-agilebg-addons | account_vat_period_end_statement/wizard/__init__.py | Python | gpl-2.0 | 1,104 |
import Track, TManager, os, pygame
_sounds = {}
_images = {}
def _get_sound_and_image(soundpath, imagepath):
# sound
if _sounds.has_key(soundpath):
print "Reuse '" + soundpath + "'"
sound = _sounds.get(soundpath)
else:
if os.path.exists(soundpath):
print "Load '" + sou... | danbraik/sample-studio | src/Loader.py | Python | gpl-2.0 | 2,048 |
# -*- coding: utf-8 -*-
import logging
logger = logging.getLogger(__name__)
class SingletonMixin(object):
def __new__(cls, *args, **kw):
if not hasattr(cls, '_instance'):
orig = super(SingletonMixin, cls)
cls._instance = orig.__new__(cls, *args, **kw)
return cls._instance... | streethacker/soya | soya/utils/__init__.py | Python | gpl-2.0 | 321 |
#!/usr/bin/python
__author__ = 'Jannes Hoeke'
import led
import sys
from Colors import *
from led.PixelEventHandler import *
import random
""" https://github.com/HackerspaceBremen/pixels_basegame
depends on https://github.com/HackerspaceBremen/pygame-ledpixels
"""
class Basegame:
def __init__(self):
... | jh0ker/pixels_fire | game.py | Python | gpl-2.0 | 4,792 |
# -*- coding: utf-8 -*-
import os
from os import mkdir, rmdir, system, walk, stat as os_stat, listdir, readlink, makedirs, error as os_error, symlink, access, F_OK, R_OK, W_OK, rename as os_rename
from stat import S_IMODE
from re import compile
from enigma import eEnv
try:
from os import chmod
have_chmod = True
exce... | MOA-2011/enigma2 | lib/python/Tools/Directories.py | Python | gpl-2.0 | 10,585 |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2012, 2013, 2014, 2015, 2016 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 (a... | jalavik/invenio-workflows-ui | invenio_workflows_ui/utils.py | Python | gpl-2.0 | 7,380 |
from gnue.forms.input.GFKeyMapper import KeyMapper
from src.gnue.forms.uidrivers.java.widgets._base import UIWidget
from src.gnue.forms.uidrivers.java.widgets._remote import List
_all__ = ["UIList"]
# =============================================================================
# Interface implementation for a gr... | HarmonyEnterpriseSolutions/harmony-platform | src/gnue/forms/uidrivers/java/widgets/list_.py | Python | gpl-2.0 | 1,699 |
#!/usr/bin/env python
# This script uploads a plugin package on the server
#
# Author: A. Pasotti, V. Picavet
import getpass
from optparse import OptionParser
import sys
import xmlrpclib
# Configuration
PROTOCOL = 'http'
SERVER = 'plugins.qgis.org'
PORT = '80'
ENDPOINT = '/plugins/RPC2/'
VERBOSE = False
def main(o... | blazek/lrs | lrs/plugin_upload.py | Python | gpl-2.0 | 2,882 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
from opinel.utils.aws import connect_service
from opinel.utils.cli_parser import OpinelArgumentParser
from opinel.utils.console import configPrintException, printError
from opinel.utils.credentials import read_creds
from opinel.utils.globals import ch... | iSECPartners/AWS-recipes | Python/awsrecipes_delete_iam_user.py | Python | gpl-2.0 | 1,451 |
#!/usr/bin/env python3
# Repeater Callsign for CWID
REPEATER_CALLSIGN="ON4SEB"
# CWID delay in minutes
BEACON_DELAY=10
# Repeater Startup message
REPEATER_STARTUP_MSG="QRV"
| reec/pyRepeater | src/repeater_config.py | Python | gpl-2.0 | 177 |
# Copyright (C) 2008 Dejan Muhamedagic <dmuhamedagic@suse.de>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# ... | ClusterLabs/pacemaker-1.0 | shell/modules/levels.py | Python | gpl-2.0 | 3,125 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'ui/directoryselectorbase.ui'
#
# Created: Mon Jul 29 20:12:07 2013
# by: PyQt4 UI code generator 4.9.1
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUt... | NaturalGIS/geotag_and_import_photos | ui/ui_directoryselectorbase.py | Python | gpl-2.0 | 1,577 |
#! /usr/bin/env python
# MMapArea.py
# This file is part of Labyrinth
#
# Copyright (C) 2006 - Don Scorgie <Don@Scorgie.org>
#
# Labyrinth 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 th... | Boquete/activity-labyrinth | src/MMapArea.py | Python | gpl-2.0 | 43,202 |
from distutils.core import setup
setup(
name='CoPing',
version='0.1.4',
packages=['CoPing'],
url='https://github.com/joedborg/PyPing',
scripts=['CoPing/coping'],
license='GPLv2',
author='Joe Borg',
author_email='mail@jdborg.com',
description='A Cisco style ping tool'
)
| joedborg/CoPing | setup.py | Python | gpl-2.0 | 307 |
import binascii
import os
from pwn import *
def crc32(val):
return binascii.crc32(val) & 0xffffffff
PNG_HEADER = '\x89\x50\x4e\x47\x0d\x0a\x1a\x0a'
payload = ''
# state 11
payload += PNG_HEADER
'''
IHDR Chunk
'''
# state 12
HEADER = 'IHDR'
data_len = 13
payload += p32(data_len)[::-1] + HEADER
# state 13
dat... | Qwaz/solved-hacking-problem | Codegate/2017 Quals/pngparser (unsolved)/generator.py | Python | gpl-2.0 | 1,654 |
import socket
import convox_led_pb2 as ledbuf
from time import sleep
from random import randint
UDP_IP = "192.168.1.124"
UDP_PORT = 666
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
class LightFrame:
def __init__(self, colors=((255, 255, 255)), period=200000, transition_steps=200000, circle_compression... | cmcneil/convox-led | proto/client.py | Python | gpl-2.0 | 1,664 |
"""
Program to reverse a string and print it out
"""
def reverseString(string):
revString = []
i= len(string)-1
while i>=0:
revString.append(string[i])
i-=1
newString = ""
for i in range(len(revString)):
newString = newString + str(r... | nbhavana/python-practice-programs | reverseString.py | Python | gpl-2.0 | 543 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# when fed a properly formatted csv file of sap inventory, spits out divided by page
import csv, sys
from pprint import *
arguments = sys.argv[1:]
if arguments == []:
print("This script must be passed arguments in order to function.")
sys.exit(1)
for x in arguments:
... | chrishewlings/Projects | Python/Inventory Parser/sap_csv_parse.py | Python | gpl-2.0 | 2,378 |
# tests.utils_tests.timez_tests
# Tests for the timez utility package
#
# Author: Benjamin Bengfort <benjamin@bengfort.com>
# Created: Mon Nov 11 12:48:23 2013 -0500
#
# Copyright (C) 2013 Bengfort.com
# For license information, see LICENSE.txt
#
# ID: timez_tests.py [] benjamin@bengfort.com $
"""
Tests for the tim... | tipsybear/zerocycle | tests/utils_tests/timez_tests.py | Python | gpl-2.0 | 4,919 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Licensed under the GNU General Public License, version 3.
# See the file http://www.gnu.org/copyleft/gpl.txt
from pisi.actionsapi import pythonmodules
#from pisi.actionsapi import pisitools
# if pisi can't find source directory, see /var/pisi/python-elib.intl/work/ and:
# W... | pisiganesh/my_pisi_files | python-elib.intl/actions.py | Python | gpl-2.0 | 1,053 |
import sys
def addAll(aList, elements):
# assert type(elements) is list
# assert type(aList) is list
for e in elements:
aList.append(e)
def removeAll(aDict, elements):
# assert type(elements) is list
# assert type(aDict) is dict
for e in elements:
if e in aDict:
... | CSNoyes/BitAV | ScanningEngine/Python/BloomierFilter/core/util.py | Python | gpl-2.0 | 1,484 |
from grazyna.db import get_engine, create_database
from grazyna.test_mocks.sender import IrcSender
from grazyna.test_mocks.importer import Importer
from grazyna.request import RequestBot
from grazyna.irc.models import User
import pytest
@pytest.fixture()
def protocol():
return IrcSender()
@pytest.fixture()
def... | firemark/grazyna | conftest.py | Python | gpl-2.0 | 1,477 |
#!/usr/bin/env python
import sys
sys.path.insert(0,"../..")
#Impact test version
try:
from impacket import IP6_Address, IP6, ImpactDecoder, IP6_Extension_Headers
except:
pass
#Standalone test version
try:
import sys
sys.path.insert(0,"../..")
import IP6_Address, IP6, ImpactDecoder, IP6_Extension_... | prasadtalasila/INET-Vagrant-Demos | Nonce_Demo/impacket-0.9.12/impacket/testcases/ImpactPacket/test_IP6_Extension_Headers.py | Python | gpl-2.0 | 28,928 |
# coding = utf-8
import sys
import os
import datetime
import logging
sys.path.append(os.path.abspath('..'))
# import pre processing / impact analysis
from main_dalla_auto import main_impact_analysis
from main_dalla_auto import main_impact_analysis_update
from header_config_variable import std_time_format
from jaksafe... | frzdian/jaksafe-engine | jaksafe/jaksafe/jakservice/tests/test_auto_new_filename.py | Python | gpl-2.0 | 3,433 |
# This file is part of Merlin.
# Merlin is the Copyright (C)2008,2009,2010 of Robin K. Hansen, Elliot Rosemarine, Andreas Jacobsen.
# Individual portions may be copyright by individual contributors, and
# are included in this collective work with permission of the copyright
# owners.
# This program is free software; ... | ellonweb/merlin | Hooks/mydef/__init__.py | Python | gpl-2.0 | 1,146 |
"""
GravMag: Use the polynomial equivalent layer to upward continue gravity data
"""
from fatiando.gravmag import prism, sphere
from fatiando.gravmag.eqlayer import PELGravity, PELSmoothness
from fatiando import gridder, utils, mesher
from fatiando.vis import mpl
# Make synthetic data
props = {'density':1000}
model = ... | seancug/python-example | fatiando-0.2/cookbook/gravmag_eqlayer_pel_upcontinue.py | Python | gpl-2.0 | 1,927 |
from copy import deepcopy
import mock
from pulp.common.compat import unittest
from pulp.server.async import celery_instance
from pulp.server.db.model import TaskStatus, ReservedResource, Worker
from pulp.server.managers import factory as manager_factory
from pulp.server.managers.auth.cert.cert_generator import Serial... | rbarlow/pulp | server/test/unit/base.py | Python | gpl-2.0 | 4,543 |
# -*- coding: utf-8 -*-
#
# Percona XtraBackup documentation build configuration file, created by
# sphinx-quickstart on Mon Jun 27 22:27:15 2011.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated fi... | janlindstrom/percona-xtrabackup | storage/innobase/xtrabackup/doc/source/conf.py | Python | gpl-2.0 | 9,044 |
# Beah - Test harness. Part of Beaker project.
#
# Copyright (C) 2009 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 l... | beaker-project/beah | beah/wires/internals/twbackend.py | Python | gpl-2.0 | 6,906 |
"""
DDTSS-Django - A Django implementation of the DDTP/DDTSS website.
Copyright (C) 2011-2014 Martijn van Oosterhout <kleptog@svana.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... | kleptog/DDTSS-Django | src/ddtp/urls.py | Python | gpl-2.0 | 2,176 |
# -*- coding: utf-8 -*-
#
## This file is part of Invenio.
## Copyright (C) 2014 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) an... | jirikuncar/invenio-demosite | invenio_demosite/base/fixtures/indexer.py | Python | gpl-2.0 | 1,354 |
# -*- coding: utf-8 -*-
"""
Copyright (C) 2008-2012 Wolfgang Rohdewald <wolfgang@rohdewald.de>
kajongg 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... | jsj2008/kdegames | kajongg/src/player.py | Python | gpl-2.0 | 30,828 |
#!/usr/bin/env python3
import os
base_dir = os.getenv('BASE_DIR')
pxc_version = os.getenv('PXC_VERSION')
pxc_revision = os.getenv('PXC_REVISION')
pxc57_pkg_version = os.getenv('PXC57_PKG_VERSION')
wsrep_version = os.getenv('WSREP_VERSION')
glibc_version = os.getenv('GLIBC_VERSION')
pxc_version_percona = pxc_version.s... | Percona-QA/package-testing | binary-tarball-tests/pxc/settings.py | Python | gpl-2.0 | 9,953 |
import unittest
#from zope.testing import doctestunit
#from zope.component import testing
from Testing import ZopeTestCase as ztc
from Products.Five import fiveconfigure
from Products.PloneTestCase import PloneTestCase as ptc
from Products.PloneTestCase.layer import PloneSite
ptc.setupPloneSite()
import uwosh.itdocs... | uwosh/uwosh.itpeoplesoftdocs | uwosh/itdocs/tests.py | Python | gpl-2.0 | 1,377 |
from flux.wrapper import Wrapper
from flux._jsc import ffi, lib
# Constants taken from jstatctl.h
JSC_STATE_PAIR = "state-pair"
JSC_STATE_PAIR_OSTATE = "ostate"
JSC_STATE_PAIR_NSTATE = "nstate"
JSC_RDESC = "rdesc"
JSC_RDESC_NNODES = "nnodes"
JSC_RDESC_NTASKS = "ntasks"
JSC_RDESC_WALLTIME = "walltime"
JSC_RDL = "rdl"
J... | lipari/flux-core | src/bindings/python/flux/jsc.py | Python | gpl-2.0 | 2,126 |
# -*- coding: utf-8 -*-
#
# ASE documentation build configuration file, created by
# sphinx-quickstart on Fri Jun 20 09:39:26 2008.
#
# 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 pickleable ... | PHOTOX/fuase | ase/doc/conf.py | Python | gpl-2.0 | 6,646 |
import csv
from check import Check, CheckFail, MetricType, Metric
from lib.cache import Cache
from lib.utils import run_command, transpose_dict
class Dhcpd(Check):
name = "dhcpd"
first_ip = None
tmpfile = None
def _init_metrics(self):
self.metrics = {
"netname": Metric(MetricType.... | marijngiesen/zabbix-ems | zems/dhcpd.py | Python | gpl-2.0 | 3,353 |
# Copyright 2012,2014 Christoph Reiter
# 2014,2017 Nick Boultbee
#
# 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 vers... | ptitjes/quodlibet | quodlibet/qltk/window.py | Python | gpl-2.0 | 15,094 |
import os
import sys
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# ETC_DIR = os.path.join(BASE_DIR.ancestor(1), 'etc')
APP_NAME = 'edc_base'
# Quick-start development settings - unsuitable for production
# See https://do... | botswana-harvard/edc-base | edc_base/settings.py | Python | gpl-2.0 | 3,643 |
"""
The :mod:`mappers` module is data access objects for database.
"""
| hzxie/Sharp-V | mappers/__init__.py | Python | gpl-2.0 | 71 |
from django import template
from django.core.urlresolvers import reverse
register = template.Library()
@register.inclusion_tag('euscan/_favourite.html', takes_context=True)
def favourite_buttons(context, subj, *args):
context["favourite_url"] = reverse("favourite_%s" % subj, args=args)
context["unfavourite_u... | iksaif/euscan | euscanwww/euscan_accounts/templatetags/euscan_accounts_helpers.py | Python | gpl-2.0 | 390 |
"""Main LLAP classes: Packet, Transceiver, Device."""
import time
import serial
import threading
LLAP_PACKET_LENGTH = 12
LLAP_PACKET_HEADER = 'a'
LLAP_PACKET_PADDING = '-'
LLAP_ACK_DELAY = 0.5
class Packet(object):
"""LLAP packet."""
def __init__(self, addr=None, data=None):
"""Create LLAP packet ... | piit79/python-llap | llap/__init__.py | Python | gpl-2.0 | 9,687 |
# -*- coding: utf-8 -*-
# Utilidades varias (toolbox)
def synchronized(lock):
""" Synchronization decorator.
Usage:
import threading
lock = threading.Lock()
@synchronized(lock)
def function():
something synchronous
"""
def wrap(f):
def newFuncti... | srlobo/slutils | slutils/utils.py | Python | gpl-2.0 | 441 |
import httplib2, urllib, json, re, os, csv, codecs
expert_results = []
sourcedir = "/Users/oliver/PycharmProjects/parse_comments/output_rev1_sub_windows"
outputdir = "/Users/oliver/PycharmProjects/fetch_expert_status"
outputdir_single = "/Users/oliver/PycharmProjects/fetch_expert_status/expert_single"
outputfile_expert... | olivergoetze/demoscene-sentiment-classifier | fetch_experts_status/fetch_from_ontology.py | Python | gpl-2.0 | 10,972 |
# -*- coding: utf-8 -*-
import pyxbmct
import xbmcaddon
import xbmc
import xbmcgui
from random import choice
from sport365 import getUrl as mod
ADDON = xbmcaddon.Addon()
FANART = ADDON.getAddonInfo('fanart')
ICON = ADDON.getAddonInfo('icon')
NAME = ADDON.getAddonInfo('name')
dialog = xbmcgui.Dialog()
class Prompt(... | repotvsupertuga/tvsupertuga.repository | plugin.video.sport365.live/newsbox.py | Python | gpl-2.0 | 5,581 |
import logging
import time
import turbogears.config
import hubspace.config
from turbogears.identity.soprovider import SqlObjectIdentityProvider
import thread
import threading
import base64
import sendmail
try:
SYNC_ENABLED = turbogears.config.config.configs['syncer']['sync']
except Exception, err:
print err
... | thehub/hubspace | hubspace/sync/core.py | Python | gpl-2.0 | 15,261 |
#!/usr/bin/env python
#=========================================================================
# This is OPEN SOURCE SOFTWARE governed by the Gnu General Public
# License (GPL) version 3, as described at www.opensource.org.
# Copyright (C)2016 William H. Majoros (martiandna@gmail.com).
#==============================... | ReddyLab/1000Genomes | compare-hex-scores-LR.py | Python | gpl-2.0 | 2,341 |
#!/usr/bin/env python
import unittest
from pykeg.core import keg_sizes
class KegSizesTest(unittest.TestCase):
def test_match(self):
match = keg_sizes.find_closest_keg_size
self.assertEqual("other", match(100.0))
self.assertEqual("other", match(100000000.0))
self.assertEqual("sixth... | Kegbot/kegbot-server | pykeg/core/keg_sizes_test.py | Python | gpl-2.0 | 488 |
#! /usr/bin/python2
import os
import MySQLdb
class MySQL_conn:
def __init__(self, hostname, database, username, password):
self.connect = MySQLdb.connect(host = hostname,
db = database,
user = username,
... | avoorhis/mbl_sequencing_pipeline | pipeline/mysql_conn.py | Python | gpl-2.0 | 462 |
"""API docs tests."""
from django.test import TestCase
from rest_framework import status
class APIDocsTest(TestCase):
"""Test the access to the API docs."""
def test_docs_url(self):
response = self.client.get('/api/docs/')
self.assertEqual(response.status_code, status.HTTP_200_OK)
| oser-cs/oser-website | tests/test_docs.py | Python | gpl-3.0 | 309 |
from ovito import *
import sys
sys.exit(2) | srinath-chakravarthy/ovito | tests/scripts/test_suite/system_exit.py | Python | gpl-3.0 | 43 |
#!/usr/bin/env python
# _*_ coding:utf-8 _*-_
############################
# File Name: webFrame.py
# Author: lza
# Created Time: 2016-10-24 15:42:40
############################
from wsgiref.simple_server import make_server
from Controller import Admin, Account
"""
def index():
html = "return index page"
retur... | zhengjue/mytornado | mydjiango/django_study/webframe/index.py | Python | gpl-3.0 | 832 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.6 on 2017-10-17 09:06
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('polls', '0001_initial'),
]
operations = [
migrations.RenameField(
model... | wanglzh/django-study | polls/migrations/0002_auto_20171017_1706.py | Python | gpl-3.0 | 574 |
from .client import TelegramClient
| Kurpilyansky/street-agitation-telegram-bot | telegram_client/__init__.py | Python | gpl-3.0 | 35 |
#!/usr/bin/env python
# coding: UTF-8
import json
import hashlib
import re
import random
import json
import requests
import logging
DEBUG_LEVEL = logging.DEBUG
try:
import colorizing_stream_handler
root = logging.getLogger()
root.setLevel(DEBUG_LEVEL)
root.addHandler(colorizing_stream_hand... | PyJulie/Some_Python_Scripts | get_users.py | Python | gpl-3.0 | 5,096 |
# -*- coding: utf-8 -*-
# This file is part of the hdnet package
# Copyright 2014 the authors, see file AUTHORS.
# Licensed under the GPLv3, see file LICENSE for details
# pybuilder script
from pybuilder.core import init, task, description, depends, use_plugin
# set pythonpath (for unittests)
import sys
import os
sy... | team-hdnet/hdnet | build.py | Python | gpl-3.0 | 2,625 |
# This file is part of django-ca (https://github.com/mathiasertl/django-ca).
#
# django-ca 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... | mathiasertl/django-ca | ca/django_ca/tests/tests_admin_acme.py | Python | gpl-3.0 | 8,514 |
from PyQt5.QtWidgets import (QWidget, QHBoxLayout, QVBoxLayout, QTreeWidget,
QStackedWidget)
from AlphaHooks.widgets.collections import Populate
from AlphaHooks.windows.settings.root import ConsoleSettings
class SettingsDialog(QWidget):
"""
Settings dialog opened from File -> Sett... | AlphaHooks/AlphaHooks | AlphaHooks/windows/settings/config.py | Python | gpl-3.0 | 1,856 |
from __future__ import absolute_import, division, print_function, unicode_literals
import gevent.monkey
gevent.monkey.patch_socket()
from datetime import datetime
import isodate
import requests
from xml.etree.cElementTree import XMLParser
from .base import *
from frontend.presentation import *
class DShieldDataProvide... | slupers/ThreatIntel | ThreatIntel/backend/dshield.py | Python | gpl-3.0 | 2,738 |