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 |
|---|---|---|---|---|---|
"""Common algebra of "quantum" objects
Quantum objects have an associated Hilbert space, and they (at least partially)
summation, products, multiplication with a scalar, and adjoints.
The algebra defined in this module is the superset of the Hilbert space algebra
of states (augmented by the tensor product), and the C... | mabuchilab/QNET | src/qnet/algebra/core/abstract_quantum_algebra.py | Python | mit | 40,354 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Nov 16 18:26:39 2017
@author: prabhu
"""
#from con_re_scipy import congrid
from scipy.io import readsav
from matplotlib import pyplot as plt
import numpy as np
from astropy.io import fits
def rebin(a, shape):
sh = shape[0],a.shape[0]//shape[0],sha... | ameya30/IMaX_pole_data_scripts | my_scripts/bin_data_pulpo.py | Python | mit | 1,645 |
import json
from functools import wraps
from django.conf import settings
from django.http import HttpResponseForbidden
from django.utils.decorators import available_attrs
from betty.authtoken.models import ApiToken
def forbidden():
response_text = json.dumps({'message': 'Not authorized'})
return HttpRespons... | theonion/betty-cropper | betty/cropper/api/decorators.py | Python | mit | 1,588 |
##
# @license
# Copyright Neekware Inc. All Rights Reserved.
#
# Use of this source code is governed by an MIT-style license that can be
# found in the LICENSE file at http://neekware.com/license/MIT.html
###
import logging
from django.conf import settings
from django.contrib.auth import get_user_model
from django.ut... | un33k/djangoware | api/api_v1/generics/serializers.py | Python | mit | 497 |
'''
.. module:: schema
Stores schema configurations, both for unclean and clean schemas
.. moduleauthor:: Christopher Phillippi <c_phillippi@mfe.berkeley.edu>
'''
import filers as filers
import settings as settings
# Filing name constants
SOURCE = "source"
YEAR = "year"
MONTH = "month"
DAY = "day"
P... | ccphillippi/AFP | afp/cleaner/schema.py | Python | mit | 2,317 |
# repeat_keyword test
def draw_square():
repeat 4:
print('move()')
print('turn_left()')
| aroberge/python_experiments | version1/repeat_sample1.py | Python | cc0-1.0 | 110 |
import os
path = os.path.dirname(os.path.realpath(__file__))
sbmlFilePath = os.path.join(path, 'MODEL1012090002.xml')
with open(sbmlFilePath,'r') as f:
sbmlString = f.read()
def module_exists(module_name):
try:
__import__(module_name)
except ImportError:
return False
else:
ret... | biomodels/MODEL1012090002 | MODEL1012090002/model.py | Python | cc0-1.0 | 427 |
#!/usr/bin/python
'''
NPR 2017-12-17
https://www.npr.org/2017/12/17/571421849/sunday-puzzle-capital-letters
Think of a convenience introduced in the 19th century that is still around today.
Its name has two words. Take the first three letters of the first word and the
first letter of its second word, in order, to ge... | boisvert42/npr-puzzle-python | 2017/1217_conveniences.py | Python | cc0-1.0 | 1,769 |
#trapSerial.py
#example to run: python trapSerial.py 0.0 1.0 10000
import numpy
import sys
#takes in command-line arguments [a,b,n]
a = float(sys.argv[1])
b = float(sys.argv[2])
n = int(sys.argv[3])
def f(x):
return x*x
def integrateRange(a, b, n):
'''Numerically integrate with the trapezoid rule on... | resbaz/hpc | trapezoids/trapSerial.py | Python | cc0-1.0 | 746 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# µScript documentation build configuration file, created by
# sphinx-quickstart on Fri Oct 10 07:28:23 2014.
#
# 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
# au... | jdavidls/uScript | docs/source/conf.py | Python | cc0-1.0 | 8,292 |
# tipo lista
pedidos = []
# definindo funcoes
def criarPedido(nome, sabor, observacao='sem observacoes'):
# tipo dicionario
pedido = {}
# adicionando chaves a lista
pedido['nome'] = nome
pedido['sabor'] = sabor
pedido['observacao'] = observacao
return pedido
pedidos.append(criarPedido('ma... | wesjrock/django-pizza | pyexamples/funcoes.py | Python | cc0-1.0 | 604 |
#!/usr/bin/python
'''
NPR 2017-11-12
https://www.npr.org/2017/11/12/563367879/sunday-puzzle-move-around-to-find-new-meaning
Take the name of a U.S. state capital. Immediately to the right of it write the name
of a world capital. If you have the right ones, the name of a U.S. state will be
embedded in consecutive let... | boisvert42/npr-puzzle-python | 2017/1112_capital_capital_state.py | Python | cc0-1.0 | 1,421 |
import hosts
print '''
ulimit -n 4096
java -Dcom.sun.management.jmxremote.port=9990 \\
-Dcom.sun.management.jmxremote.ssl=false \\
-Dcom.sun.management.jmxremote.authenticate=false \\
-Dcom.sun.management.jmxremote.local.only=false \\
-Djava.rmi.server.hostname={feed} \\
-jar /home/{user}/newsf... | gengstrand/clojure-news-feed | server/aws/build/run3.py | Python | epl-1.0 | 465 |
"""Generate Java code from an ASDL description."""
# TO DO
# handle fields that have a type but no name
import os, sys, traceback
import asdl
TABSIZE = 4
MAX_COL = 100
def reflow_lines(s, depth):
"""Reflow the line s indented depth tabs.
Return a sequence of lines where no line extends beyond MAX_COL
... | akurtakov/Pydev | plugins/org.python.pydev.parser/src/org/python/pydev/parser/jython/ast/asdl_java.py | Python | epl-1.0 | 20,001 |
class Solution(object):
def combinationSum4(self, nums, target):
"""
:type nums: List[int]
:type target: int
:rtype: int
"""
dp = [0 for _ in xrange(target + 1)]
dp[0] = 1
for i in xrange(1, target + 1):
for j in nums:
if j ... | Jacy-Wang/MyLeetCode | CombinationSumIV377.py | Python | gpl-2.0 | 391 |
from routersploit.modules.exploits.cameras.honeywell.hicc_1100pt_password_disclosure import Exploit
def test_success(target):
""" Test scenario: successful check """
route_mock = target.get_route_mock("/cgi-bin/readfile.cgi", methods=["GET"])
route_mock.return_value = (
'var Adm_ID="admin";'
... | dasseclab/dasseclab | clones/routersploit/tests/exploits/cameras/honeywell/test_hicc_1100pt_password_disclosure.py | Python | gpl-2.0 | 662 |
from setuptools import setup, find_packages
from os.path import join, dirname
setup(
name='avitopub',
version='1.0.1',
description="Avito auto publish",
author="Denis Epifanov",
author_email="epifanov.denis@gmail.com",
license="MIT",
py_modules=['avitopub'],
script='avitopub.py',
lo... | den-gts/avito-autopub | setup.py | Python | gpl-2.0 | 1,119 |
'''
Created on 11 May 2016
@author: wnm24546
'''
import matplotlib.pyplot as plt
import numpy as np
def makePlot(a=1, b=1.5):
fig = plt.figure()
ax = fig.add_axes([0.12, 0.12, 0.76, 0.76], polar=True)
r = np.arange(0, 8*np.pi, 0.01)
theta = a+b*r
ax.plot(theta, r, color='#00c000', l... | mtwharmby/assorted-scripts | PythonPlayground/Spirals/Archimedean.py | Python | gpl-2.0 | 404 |
# Royal Render Plugin script for Nuke 5+
# Author: Royal Render, Holger Schoenberger, Binary Alchemy
# Last change: v 7.0.24
# Copyright (c) Holger Schoenberger - Binary Alchemy
# rrInstall_Copy: \plugins\
# rrInstall_Change_File_delete: \plugins\menu.py, before "# Help menu", "m = menubar.addMenu(\"RRender\");\nm.add... | michimussato/pypelyne2 | pypelyne2/payload/rr/7.0.29__installer/files/render_apps/_submitplugins/rrSubmit_Nuke_5.py | Python | gpl-2.0 | 24,184 |
# blender CAM polygon_utils_cam.py (c) 2012 Vilem Novak
#
# ***** 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... | vilemnovak/blendercam | scripts/addons/cam/polygon_utils_cam.py | Python | gpl-2.0 | 4,940 |
# Copyright (C) 2013 Adam Stokes <adam.stokes@ubuntu.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
# (at your option) any later version.
#
# This pro... | portante/sosreport | sos/plugins/azure.py | Python | gpl-2.0 | 1,294 |
from checkio_referee import RefereeBase, covercodes, representations, ENV_NAME
import settings_env
from tests import TESTS
cover = """def cover(func, data):
return func(*[str(x) for x in data])
"""
class Referee(RefereeBase):
TESTS = TESTS
ENVIRONMENTS = settings_env.ENVIRONMENTS
DEFAULT_FUNCTION_... | Empire-of-Code-Puzzles/checkio-empire-common-words | verification/src/referee.py | Python | gpl-2.0 | 717 |
# UFO-launcher - A multi-platform virtual machine launcher for the UFO OS
#
# Copyright (c) 2008-2009 Agorabox, Inc.
#
# This 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... | vienin/vlaunch | setup/setup.py | Python | gpl-2.0 | 2,715 |
# -*- coding: utf-8 -*-
"""
blohg.rst_parser.directives
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Module with the custom blohg reStructuredText directives.
:copyright: (c) 2010-2013 by Rafael Goncalves Martins
:license: GPL-2, see LICENSE for more details.
"""
from docutils import nodes, statemachine
from docu... | mknecht/blohg | blohg/rst_parser/directives.py | Python | gpl-2.0 | 16,077 |
# Copyright 2005, 2006 Benoit Boissinot <benoit.boissinot@ens-lyon.org>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
'''commands to sign and verify changesets'''
import os, tempfile, binascii
from mercurial import util, comman... | seewindcn/tortoisehg | src/hgext/gpg.py | Python | gpl-2.0 | 10,197 |
import uuid
from src.common.database import Database
import datetime
__author__ = 'jslvtr'
class Post(object):
def __init__(self, blog_id, title, content, author, created_date=datetime.datetime.utcnow(), _id=None):
self.blog_id = blog_id
self.title = title
self.content = content
... | brunotougeiro/python | udemy-python-web-apps/web_blog-master/src/models/post.py | Python | gpl-2.0 | 1,111 |
#coding:utf-8
import GJDB
import sys
db = GJDB.GJDB()
db.crawl()
db.selectDB('crawler_ds')
db.selectData('set names utf8;')
#sys.exit()
xqxxs = open('C:/users/suchao/desktop/bsgscxq.txt','r').readlines()
tmpFile = open('tmpFilexq.txt','w')
for xqxx in xqxxs:
name, source, url = xqxx.split('\t')
sql... | hfutsuchao/Python2.6 | xiaoquUGC/小区入库SQL生成.py | Python | gpl-2.0 | 761 |
from io import BytesIO
from pytest import mark, raises
from translate.convert import po2php, test_convert
from translate.storage import po
class TestPO2Php:
def po2php(self, posource):
"""helper that converts po source to .php source without requiring files"""
inputfile = BytesIO(posource.encode... | miurahr/translate | translate/convert/test_po2php.py | Python | gpl-2.0 | 11,039 |
# Screen scheduler test classes.
#
# This file is part of Simpleline Text UI library.
#
# Copyright (C) 2020 Red Hat, Inc.
#
# Simpleline is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version ... | rhinstaller/python-simpleline | tests/units/main/scheduler_test.py | Python | gpl-2.0 | 6,810 |
NAME = 'rados'
CFLAGS = []
LDFLAGS = []
LIBS = ['-lrados']
GCC_LIST = ['rados']
import __main__
has_rados_ioctx_pool_requires_alignment2 = __main__.test_snippet("""
#include <rados/librados.h>
int main()
{
rados_ioctx_t ctx = NULL;
rados_ioctx_pool_requires_alignment2(ctx, NULL);
rados_ioctx_pool_required... | chundi/uwsgi | plugins/rados/uwsgiplugin.py | Python | gpl-2.0 | 487 |
def fizz_buzz(n):
fin_list = []
for number in range(1, n + 1):
if number % 3 == 0 and number % 5 == 0:
fin_list.append('fizzbuzz')
elif number % 3 == 0:
fin_list.append('fizz')
elif number % 5 == 0:
fin_list.append('buzz')
else:
fin... | jcode89/Iron_Coder_Solutions | fizzbuzz.py | Python | gpl-2.0 | 361 |
# #
# Copyright 2009-2019 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be),
# Flemish Research Foundation (... | gppezzi/easybuild-framework | easybuild/tools/containers/common.py | Python | gpl-2.0 | 2,113 |
from utility.timestamp import TimestampedValue
from utility.enums import BOOL
from entity import Entity
# Turrets, inhib, nexus, drake, nash, jungle monsters
class Objective(Entity):
def __init__(self):
Entity.__init__(self)
self.isUp = TimestampedValue('i', BOOL.UNKNOWN)
| fl4v/botlane | world_model/objective.py | Python | gpl-2.0 | 295 |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# Cut out and concatenate sections of a file
# access as pycut.py from mythDVBcut.sh
import sys, os
#print sys.argv
######################
## For tests
##
## echo "0123456789A123456789B123456789C123456789D123456789E123456789F123456789" > ~/test.txt
##
## fn1 = './tes... | frederickjh/mythdvbcut | pycut.py | Python | gpl-2.0 | 3,274 |
#!/usr/bin/env python
import sys
from Bio import SeqIO
from Bio.Seq import Seq
from Bio.Alphabet import generic_dna
from optparse import OptionParser
import random
import patterns
def letter2num(c):
if (not cmp(c,'A')):
elem = '0'
elif (not cmp(c,'T')):
elem = '1'
elif (not cmp(c,'G'))... | updownlife/multipleK | bin/random_boxquery/random_fast_boxquery.py | Python | gpl-2.0 | 2,845 |
# -*- coding: utf-8 -*-
"""
/***************************************************************************
stdm
A QGIS plugin
Securing land and property rights for all
-------------------
begin : 2014-03-04
copyright ... | olivierdalang/stdm | data/license_doc.py | Python | gpl-2.0 | 1,999 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010 Albatos s.r.l. (<http://www.albatos.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... | syci/domsense-agilebg-addons | tax_stamp/__terp__.py | Python | gpl-2.0 | 1,444 |
import sys
import inspect
import os.path
class TestCase(object):
'''Base class for test cases'''
def __init__(self):
self.errors = False
def run(tr):
'''tr is TestRunner instance.'''
raise NotImplemented()
def assert_equals(self, a, b):
if a != b:
caller = inspect.stack()[-2]
... | OptoFidelity/TVG | tests/testcases.py | Python | gpl-2.0 | 3,815 |
"""capisuite.core
This module exposes the built-in core of capisuite.
"""
__author__ = "Hartmut Goebel <h.goebel@crazy-compilers.com>"
__copyright__ = "Copyright (c) 2004 by Hartmut Goebel"
__version__ = "$Revision: 0.0 $"
__credits__ = "This file is part of www.capisuite.de; thanks to Gernot Hillier"
__licens... | larsimmisch/capisuite | src/capisuite-py/core.py | Python | gpl-2.0 | 16,528 |
# -*- coding: utf-8 -*-
"""
brickv (Brick Viewer)
Copyright (C) 2011-2015 Olaf Lüke <olaf@tinkerforge.com>
Copyright (C) 2012 Bastian Nordmeyer <bastian@tinkerforge.com>
Copyright (C) 2012-2015 Matthias Bolte <matthias@tinkerforge.com>
flashing.py: GUI for flashing features
This program is free software; you can redi... | D4wN/brickv | src/brickv/flashing.py | Python | gpl-2.0 | 55,747 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
E-I network connected with NEST topology
----------------------------------------
Simulation of a network consisting of an excitatory and an inhibitory
neuron population with distance-dependent connectivity.
The code bases on the script
brunel_alpha_nest.py
which... | HBPVIS/VIOLA | test_data/topo_brunel_alpha_nest.py | Python | gpl-2.0 | 44,592 |
#
#
# Copyright (C) 2007 Google Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed ... | sigmike/ganeti | qa/qa_error.py | Python | gpl-2.0 | 1,036 |
try:
import simplegui
except ImportError:
import SimpleGUICS2Pygame.simpleguics2pygame as simplegui
simplegui.Frame._hide_status = True
simplegui.Frame._keep_timers = False
from state import *
import Main
import math
game_gui = None
piece_color = {
GUARD: '#FF5733',
DRAGON: '#E12E2E',
KIN... | francois-rd/madking | gui.py | Python | gpl-2.0 | 10,840 |
import time
try:
from time import timeout_time
except ImportError:
from time import time as timeout_time
def compute_resolution(func):
resolution = None
points = 0
timeout = timeout_time() + 1.0
previous = func()
while timeout_time() < timeout or points < 3:
for loop in range(10):
... | whichwit/scm-stv | docs/support/pep/pep-0418/clock_resolution.py | Python | gpl-2.0 | 1,995 |
#!/usr/bin/env python
import gtk
import vte
import os
import time
import pango
class Admin_Notebook():
def create_notebook(self):
notebook = gtk.Notebook()
notebook.set_current_page(0)
notebook.set_tab_pos(gtk.POS_LEFT)
notebook.show()
return notebook
def create_frame(... | sergiotocalini/pyaejokuaa | trunk/plugins/hesapea/controller.py | Python | gpl-2.0 | 2,649 |
self.description = "Sysupgrade with ignored package prevent other upgrade"
lp1 = pmpkg("glibc", "1.0-1")
lp2 = pmpkg("gcc-libs", "1.0-1")
lp2.depends = ["glibc>=1.0-1"]
lp3 = pmpkg("pcre", "1.0-1")
lp3.depends = ["gcc-libs"]
for p in lp1, lp2, lp3:
self.addpkg2db("local", p)
sp1 = pmpkg("glibc", "1.0-2")
sp2 = pmpk... | vadmium/pacman-arch | test/pacman/tests/sync140.py | Python | gpl-2.0 | 689 |
import copy
import logging
import os.path
from error import JobBrokenError
from errors import CacheUpstreamError
from infrastructure import infrastructure
from infrastructure_cache import cache
from job import Job, RESTORE_CFG
from job_types import JobTypes
from tasks import NodeStopTask, RsyncBackendTask, MinionCmdTa... | yandex/mastermind | src/cocaine-app/jobs/move.py | Python | gpl-2.0 | 17,327 |
# -*- coding: iso-8859-1 -*-
#############################################################################################
# Name: unittest_Grib.py
# Author: Jun Hu
# Date: 2012-04-30
# Description: test cases for Grib class.
#############################################################################################... | khosrow/metpx | sundew/unittests/unittest_Grib.py | Python | gpl-2.0 | 978 |
# -*- coding: utf-8 -*-
#
# Picard, the next-generation MusicBrainz tagger
# Copyright (C) 2007 Lukáš Lalinský
# Copyright (C) 2009 Carlin Mangar
#
# 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... | lalinsky/picard-debian | picard/webservice.py | Python | gpl-2.0 | 14,573 |
# -*- coding: utf-8 -*-
##############################################################################
# 2011 E2OpenPlugins #
# #
# This file is open source software; you can redistribute... | svox1/e2openplugin-OpenWebif | plugin/controllers/ajax.py | Python | gpl-2.0 | 8,291 |
#!/usr/bin/env python
import paydaemon
from paydaemon.paydaemon import PAYDaemon
from litecoinrpc.connection import LitecoinConnection
from modules.fixedpoint import FixedPoint
DEBUG = 1
class LTCDaemon(PAYDaemon):
def __init__(self,pidfile):
PAYDaemon.__init__(self,pidfile,'LTC','BTC',LitecoinConnection... | CoinEXchange/CoinX | ltc_daemon.py | Python | gpl-2.0 | 1,080 |
# Function to compute Calculate alpha
def SimCalcAlphaBeta(imtemplate="",taylorlist=[],namealpha="",namebeta="",threshold=0.001):
nterms = len(taylorlist);
if(nterms>1):
if(not os.path.exists(namealpha)):
cpcmd = 'cp -r ' + imtemplate + ' ' + namealpha;
os.system(cpcmd);
if(nterms>2):
... | ATNF/askapsdp | Code/Components/Synthesis/testdata/current/simulation/mfstest/mfsrun.py | Python | gpl-2.0 | 3,615 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from buildbot.plugins import *
from buildbot.schedulers.basic import AnyBranchScheduler, SingleBranchScheduler
from buildbot.schedulers.forcesched import ForceScheduler
from buildbot.plugins import reporters, util
from buildbot.process.properties import Interpolate
from co... | aliceinwire/Gentoo_kernelCI | schedulers.py | Python | gpl-2.0 | 4,791 |
from django.contrib import admin
from .models import Booking, Hall
# Register your models here.
class BookingAdmin(admin.ModelAdmin):
list_display = ['hall', 'event_name', 'name', 'date', 'start_time', 'no_of_hours', 'email', 'status' ]
class Meta:
model = Booking
admin.site.register(Booking, BookingAdmin)
clas... | mandeeps708/booking_system | src/home/admin.py | Python | gpl-2.0 | 451 |
from django.contrib import admin
from project.models import *
admin.site.register(Document)
admin.site.register(Club)
admin.site.register(Project)
admin.site.register(Comment)
admin.site.register(Update)
admin.site.register(Task)
| The-WebOps-Club/project-management-portal | project/admin.py | Python | gpl-2.0 | 240 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Post',
fields=[
('id', models.AutoField(primary... | ncongleton/njcongleton.com | blog/migrations/0001_initial.py | Python | gpl-2.0 | 590 |
# encoding: utf-8
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('oluch', '0008_mark'),
]
operations = [
migrations.DeleteModel(
name='Disqual',
),
migrations.AlterField(
model_name='userprofil... | gurovic/oluch2 | oluch/migrations/0009_auto_20140203_1130.py | Python | gpl-2.0 | 1,484 |
'''
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be... | dannyperry571/theapprentice | plugin.video.abracadabra/default.py | Python | gpl-2.0 | 21,244 |
#!/usr/bin/env python
# check_snmp_large_storage.py - Check the used / free disk space of a device via SNMP
# (using the HOST-RESOURCES-MIB hrStorageSize).
# Copyright (C) 2016-2019 rsmuc <rsmuc@sec-dev.de>
# This file is part of "Health Monitoring Plugins".
# "Health Monitoring Plugins" is free software: ... | rsmuc/health_monitoring_plugins | health_monitoring_plugins/check_snmp_large_storage/check_snmp_large_storage.py | Python | gpl-2.0 | 2,573 |
# -*- coding: iso-8859-1 -*-
#
# Copyright (C) 2001 - 2020 Massimo Gerardi all rights reserved.
#
# Author: Massimo Gerardi massimo.gerardi@gmail.com
#
# Copyright (c) 2020 Qsistemi.com. All rights reserved.
#
# Viale Giorgio Ribotta, 11 (Roma)
# 00144 Roma (RM) - Italy
# Phone: (+39) 06.87.163
#
#
# Si veda ... | phasis/phasis | phasis/finc/lstnag.py | Python | gpl-2.0 | 1,877 |
import pygame
pygame.init()
resolution = (width, height) = (600, 400)
screen = pygame.display.set_mode(resolution)
clock = pygame.time.Clock()
pygame.mouse.set_visible(False)
miraimg = pygame.image.load("mira.png")
mirarect = miraimg.get_rect()
while True:
clock.tick(60)
screen.fill(0)
for event in pygam... | codeskyblue/pygame-cookbook | 1-mousechange/changemouse.py | Python | gpl-2.0 | 606 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) Hugo Lindström <hugolm84@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (... | hugolm84/tomahawk-charts | scraper/tomahawk/spiders/metacriticspider.py | Python | gpl-2.0 | 3,234 |
#! /usr/bin/python
import sys
from PyQt4 import QtGui,QtCore
class Button(QtGui.QPushButton):
def __init__(self,title,parent):
super(Button, self).__init__(title,parent)
def mouseMoveEvent(self,e):
if e.buttons()!=QtCore.Qt.RightButton:
return
mimeData=QtCore.QMimeData()
drag=QtGui.QDrag(self)
drag.set... | Urinx/PyQt4.tutorial | examples/33.dragdrop2.py | Python | gpl-2.0 | 1,132 |
# -*- coding: utf-8 -*-
#
# This file is part of Glances.
#
# Copyright (C) 2017 Nicolargo <nicolas@nicolargo.com>
#
# Glances is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the Lic... | fraoustin/ocglances | ocglances/plugins/glances_cpu.py | Python | gpl-2.0 | 14,792 |
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2002-2006 Donald N. Allingham
# Copyright (C) 2011 Tim G L Lyons
#
# 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... | Forage/Gramps | gramps/gen/filters/rules/citation/_matchesfilter.py | Python | gpl-2.0 | 1,765 |
#!/usr/bin/env python
#-*- coding: utf-8 -*-
import string
class EnumMetaClass:
"""Metaclass for enumeration.
To define your own enumeration, do something like
class Color(Enum):
red = 1
green = 2
blue = 3
Now, Color.red, Color.green and Color.blue behave totally
differ... | cria/microSICol | py/modules/enum.py | Python | gpl-2.0 | 3,449 |
"""
Copyright (C) 2009 Oracle Corporation
This file is part of VirtualBox Open Source Edition (OSE), as
available from http://www.virtualbox.org. This file is free software;
you can redistribute it and/or modify it under the terms of the GNU
General Public License (GPL) as published by the Free Software
Foundation, in... | VirtualMonitor/VirtualMonitor | src/VBox/Additions/common/crOpenGL/SunOS_i386_exports.py | Python | gpl-2.0 | 2,893 |
from VMFFile import VMFFile
from VMFNode import getBounds
import copy
import numpy
OUTSIDE_MATERIAL = "DEV/DEV_BLENDMEASURE" # The material marking a portal
DOOR_DISTANCE_TOLERANCE = 16 # see pointNearPlane()
def oppositeDirection(direction):
"""Finds the opposite direction to the given one"""
if direction == "no... | 740619537/L4D2-RMG | GENERATOR/MapTile.py | Python | gpl-2.0 | 14,257 |
# Copyright (C) 2013 Linaro Limited
#
# Author: Antonio Terceiro <antonio.terceiro@linaro.org>
#
# This file is part of LAVA Dispatcher.
#
# LAVA Dispatcher 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... | inwotep/lava-dispatcher | lava_dispatcher/device/dummy.py | Python | gpl-2.0 | 2,023 |
import os
from ConfigParser import SafeConfigParser
from interfaces.singleton import Singleton
class ConfigManager(object):
""" Configuration Manager Singleton class."""
# Singleton with metaclass:
__metaclass__ = Singleton
def __init__(self):
# http://stackoverflow.com/a/4060259
__loc... | zencoders/pyircbot | config.py | Python | gpl-2.0 | 3,417 |
from django.conf.urls import patterns, include, url
from .views import HomeView
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# Examples:
url(r'^$', HomeView.as_view(), name='home'),
url(r'^leagues/', include('leagues.... | LuanP/futebolistica | futebolistica/futebolistica/urls.py | Python | gpl-2.0 | 525 |
#!/usr/bin/env python2
import argparse
import json
import math
import os
parser = argparse.ArgumentParser()
parser.add_argument('out_dir')
parser.add_argument('json_file', nargs='+', type=argparse.FileType('r'))
parser.add_argument('iters_per_job', type=int)
args = parser.parse_args()
cases = []
max_iter = []
for fi... | stanfordhpccenter/soleil-x | testcases/hit_to_openchannel/chain_jobs.py | Python | gpl-2.0 | 2,127 |
# coding: utf-8
import json
from os import listdir
from os.path import isfile, join
class Template(object):
def __init__(self, application):
self.application = application
self.templates = {}
exposed = True
def load(self, template_dir):
for file in listdir(template_dir):
... | DarkLuk42/hn-ias-race | app/resources/template.py | Python | gpl-2.0 | 674 |
import os
import sys
import unittest
import urllib
if sys.version_info[0] < 3:
import urllib2
else:
import urllib.request as urllib2
from ..ext import resources
class SDL2ExtResourcesTest(unittest.TestCase):
__tags__ = ["sdl2ext"]
def test_open_zipfile(self):
fpath = os.path.join(os.path.dirn... | m1trix/Tetris-Wars | tetris_wars/sdl2/test/sdl2ext_resources_test.py | Python | gpl-2.0 | 9,970 |
import paramiko
from paramiko.client import SSHClient
def test_credentials(hostname, username, password, port):
""" Returns True if the credentials work
"""
client = SSHClient()
client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
try:
client.connect(hostname, username=username, password=password,
po... | codedbyjay/django-branches | helpers.py | Python | gpl-2.0 | 1,037 |
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'ladder',
'USER': 'ladder',
'PASSWORD': 'hp4_fkh=a(64x',
'HOST': '',
'PORT': '',
},
}
DATABASE_ROUTERS = [
] | OpenTTD-Ladder/ladder-web | ladder/ladder/settings/databases.py | Python | gpl-2.0 | 280 |
import operator
import numpy as np
import pytest
from pandas.core.dtypes.common import is_bool_dtype
import pandas as pd
import pandas._testing as tm
from pandas.core.sorting import nargsort
from .base import BaseExtensionTests
class BaseMethodsTests(BaseExtensionTests):
"""Various Series and DataFrame method... | iproduct/course-social-robotics | 11-dnn-keras/venv/Lib/site-packages/pandas/tests/extension/base/methods.py | Python | gpl-2.0 | 18,343 |
import urllib2
import subprocess,shlex
import commands
import simplejson as json
import re
import pymongo
from pymongo import ASCENDING, DESCENDING,MongoClient
import base64
### Grabs an apikey and password and b64 encodes them
def xfe_get_token(db):
return base64.b64encode(db.settings.find({'type':'IBM_X-Force_api_... | wfsec/osxstrata | scripts/xforceMod.py | Python | gpl-2.0 | 3,254 |
# check_dns.py -- Returns OK if a hostname resolves to any ip address
# check_dns plugin will need some system libraries for DNS lookup
from __future__ import absolute_import
from _socket import gaierror
import socket
import time
# Import PluginHelper and some utility constants from the Plugins module
from pynag.Plug... | pynag/pynag | examples/Plugins/check_dns.py | Python | gpl-2.0 | 2,435 |
from geopy.compat import text_type
from geopy.exc import GeocoderParseError
try:
import pytz
pytz_available = True
except ImportError:
pytz_available = False
__all__ = (
"Timezone",
)
def ensure_pytz_is_installed():
if not pytz_available:
raise ImportError(
'pytz must be ins... | phborba/dsgtoolsop | auxiliar/geopy/timezone.py | Python | gpl-2.0 | 2,534 |
import copy
import attr
from widgetastic.exceptions import NoSuchElementException
from widgetastic_patternfly import BootstrapSelect
from widgetastic_patternfly import Input
from wrapanapi.systems import RedfishSystem
from cfme.common.provider import DefaultEndpoint
from cfme.common.provider import DefaultEndpointFor... | izapolsk/integration_tests | cfme/physical/provider/redfish.py | Python | gpl-2.0 | 7,197 |
from scipy.stats import johnsonsb
import matplotlib.pyplot as plt
fig, ax = plt.subplots(1, 1)
# Calculate a few first moments:
a, b = 4.32, 3.18
mean, var, skew, kurt = johnsonsb.stats(a, b, moments='mvsk')
# Display the probability density function (``pdf``):
x = np.linspace(johnsonsb.ppf(0.01, a, b),
... | platinhom/ManualHom | Coding/Python/scipy-html-0.16.1/generated/scipy-stats-johnsonsb-1.py | Python | gpl-2.0 | 1,134 |
# -*- coding: iso-8859-1 -*-
#------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Conector para sockshare
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
#------------------------------------------------------------
import urlparse,urllib2,urllib,re
import os
from cor... | titienmiami/mmc.repository | plugin.video.tvalacarta/servers/sockshare.py | Python | gpl-2.0 | 3,311 |
from src import model
from src.model import User, Pin, Category, Velov
from flask import Flask, flash, render_template, request, session, jsonify
from flask.ext.sqlalchemy import SQLAlchemy
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
def connectToDatabase():
"""
Connect to our ... | H4213/WeLyon | server/service.py | Python | gpl-2.0 | 3,368 |
import os
import markup
def relpath_same_drive(p1, p2):
"""
Convert p1 into path relative to p2 if both on the same drive.
"""
dr = os.path.splitdrive(p1)[0]
if len(dr) == 0 or dr == os.path.splitdrive(p2)[0]:
return os.path.relpath(p1, p2)
return p1
def create_report(path, g... | ilyapatrushev/isimage | isimage/select_images/create_report.py | Python | gpl-2.0 | 3,952 |
# https://sam.nrel.gov/images/web_page_files/ssc_guide.pdf#subsection.3.4
import omf.solvers.nrelsam2013 as sam # This import takes a long time (15 seconds)
def inspect_pvwattsv1():
'''
In the GRIP API we only use the pvwattsv1 module
'''
ssc = sam.SSCAPI()
pv = ssc.ssc_module_create("pvwattsv1"... | dpinney/omf | omf/scratch/GRIP/helper/nrel_sam_introspection.py | Python | gpl-2.0 | 1,220 |
import random
class EffortAgent:
def __init__(self, memory_length, epsilon, u_l, u_h, r1, r2, beta, cost, threshold):
self.memory_length = memory_length
self.epsilon = epsilon
self.u_l = u_l
self.u_h = u_h
self.r1 = r1
self.r2 = r2
self.beta = beta
s... | jamesporter/endogenous-polarisation | models/effort_model.py | Python | gpl-2.0 | 4,684 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# --- BEGIN_HEADER ---
#
# benchmark_alternating - benchmark alternating read/write
# Copyright (C) 2003-2011 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 GNU ... | heromod/migrid | mig/grsfs-fuse/benchmarks/code/benchmark_alternating.py | Python | gpl-2.0 | 5,766 |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This program is distributed in ... | wgwoods/anaconda | tests/pyanaconda_tests/iutil_test.py | Python | gpl-2.0 | 30,600 |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | ChinaMassClouds/copenstack-server | openstack/src/horizon-2014.2/openstack_dashboard/dashboards/admin/log/panel.py | Python | gpl-2.0 | 1,050 |
"""This module handles feeding food to worker in the end of a round."""
from game import food_checker
from game import resource
class FeederError(Exception):
pass
class Feeder(object):
def __init__(self):
self._resource_picker = None
self._player = None
self._food_req = None
self._food_checker =... | chiang831/LeHavre | src/game/feeder.py | Python | gpl-2.0 | 2,413 |
from java.util.zip import ZipEntry, ZipOutputStream
from java.io import File, FileInputStream, ByteArrayOutputStream, FileOutputStream, ByteArrayInputStream
import string, os, jarray, sys
class DirectoryOutput:
def __init__(self, dirname):
self.outdir = dirname
def getFile(self, name):
fname = apply(... | carvalhomb/tsmells | guess/Tools/freeze/Output.py | Python | gpl-2.0 | 2,877 |
import datetime
from django.db import models
from modelcluster.fields import ParentalKey
from wagtail.admin.edit_handlers import FieldPanel, InlinePanel, PageChooserPanel, MultiFieldPanel, StreamFieldPanel
from wagtail.core.fields import StreamField
from wagtail.search import index
from opentech.public.utils.models ... | OpenTechFund/WebApp | opentech/public/home/models.py | Python | gpl-2.0 | 5,246 |
import mistune
from django.contrib.auth import get_user_model
from django_bleach.templatetags.bleach_tags import bleach_value
from rest_framework import serializers
from opentech.apply.activity.models import Activity
from opentech.apply.determinations.views import DeterminationCreateOrUpdateView
from opentech.apply.... | OpenTechFund/WebApp | opentech/apply/funds/serializers.py | Python | gpl-2.0 | 7,604 |
# -*- coding: utf-8 -*-
# Placed into the Public Domain by tav <tav@espians.com>
# origin: https://raw.github.com/tav/scripts/master/validate_jsonp.py
"""Validate Javascript Identifiers for use as JSON-P callback parameters."""
from builtins import str
from builtins import chr
import re
from unicodedata import cate... | Kegbot/kegbot-server | pykeg/web/api/validate_jsonp.py | Python | gpl-2.0 | 6,743 |
# -*- coding: utf-8 -*-
'''libnano.padlock
Generation + filtering of padlock probes / MIPs from a target region sequence
Padlock structure reminder, left and right are in terms of the hybridized sequence
LINEAR VERSION:
5' Right Arm Scaffold Seq (aka Loop) Left Arm 3'
+------------------>+-------... | libnano/libnano | libnano/padlock.py | Python | gpl-2.0 | 13,787 |
#!/usr/bin/env python
"""
Seeding from GeoJSON string
===========================
"""
from datetime import datetime, timedelta
from opendrift.models.leeway import Leeway
from opendrift.models.openoil import OpenOil
#%%
# Polygon
#--------
o = OpenOil(loglevel=50)
o.seed_from_geojson("""{
"type": "Feature",
... | OpenDrift/opendrift | examples/example_seed_geojson.py | Python | gpl-2.0 | 2,137 |
import requests
from requests.auth import HTTPDigestAuth, HTTPBasicAuth
import tempfile
from email.utils import formatdate
from artemis.Task import Task, AuthNature, TaskNature
import logging
import pycurl #until requests support sock5, no accreditation handling, http://tech.michaelaltfield.net/2015/02/22/pycurl-throu... | athena-project/Artemis | src/handlers/HTTPDefaultHandler.py | Python | gpl-2.0 | 4,167 |
# vim:set et sts=4 sw=4:
#
# ibus - The Input Bus
#
# Copyright (c) 2007-2008 Huang Peng <shawn.p.huang@gmail.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2 of ... | lotem/rime.py | weasel/ibus/modifier.py | Python | gpl-3.0 | 1,512 |
# -*- coding: utf-8 -*-
"""
ORCA Open Remote Control Application
Copyright (C) 2013-2020 Carsten Thielepape
Please contact me by : http://www.orca-remote.org/
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as publish... | thica/ORCA-Remote | src/ORCA/vars/Helpers.py | Python | gpl-3.0 | 4,527 |