code stringlengths 2 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int32 2 1.05M |
|---|---|---|---|---|---|
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('geonewsapi', '0016_auto_20151201_1517'),
]
operations = [
migrations.AlterField(
model_name='article',
... | DJones81/GTNewsDev | gtnewsdev/geonewsapi/migrations/0017_auto_20151201_1555.py | Python | gpl-2.0 | 420 |
from .contextaware import ContextAware
class BaseContext(ContextAware):
def __init__(self, main_context):
ContextAware.__init__(self, main_context)
@property
def config(self):
return self.context.config
def set_config(self, *args):
return self.context.config.set(*args)
| FrodeSolheim/fs-uae-launcher | fsgamesys/BaseContext.py | Python | gpl-2.0 | 314 |
inf = 1000
def Bridge4x4(width1 = 5.0, width2=10.0, spacing = 3.01/1.1):
angle = -45.0
#
y0 = 0.0
y1 = y0 + 0.5*spacing + 0.5*width1
y2 = y1 + 0.5*(width1+width2) + spacing
y_1 = y0 - 0.5*spacing - 0.5*width2
y_2 = y_1 - 0.5*(width1+width2) - spacing
#
line1 = Line(Poin... | raphaelvalentin/qtlayout | Projects/Bridges/bridge5.py | Python | gpl-2.0 | 11,681 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "pastevim.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| m110/pastevim | manage.py | Python | gpl-2.0 | 251 |
from PukDialog import PukDialog
| tgcmteam/tgcmlinux | src/tgcm/ui/windows/PukDialog/__init__.py | Python | gpl-2.0 | 32 |
import os, importlib, inspect
import api.plugin, util.logger_factory
class Loader():
def __init__(self, scheduler, bot, sql_conn):
filenames = os.listdir(os.path.abspath(__file__+'/../../ext'))
self.ext_names = [x[:-3] for x in filenames if x[-3:] == '.py' and x != '__init__.py']
self.scheduler = scheduler
... | deltaburnt/LameBot | api/loader.py | Python | gpl-2.0 | 1,994 |
#!/usr/bin/env python
# Copyright (C) 2013-2015 Fredrik Lindberg <fli@shapeshifter.se>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; version 2 of the License.
#
# This program is distributed... | fredriklindberg/chromesthesia | chromesthesia_app/chromesthesia.py | Python | gpl-2.0 | 5,919 |
from flask import render_template, redirect, url_for, request
from flask.views import MethodView
from nastradini import mongo, utils
from positionform import PositionForm
class Position(MethodView):
methods = ['GET', 'POST']
def get(self):
form = PositionForm()
return render_template('positio... | assemblio/project-nastradin | nastradini/views/forms/position.py | Python | gpl-2.0 | 700 |
# This file is part of CDS Invenio.
# Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 CERN.
#
# CDS 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... | pombredanne/invenio-old | modules/bibclassify/lib/bibclassify_webinterface.py | Python | gpl-2.0 | 14,432 |
# Copyright (C) 2011 Lars Wirzenius
#
# 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 i... | perryl/morph | cliapp/__init__.py | Python | gpl-2.0 | 1,188 |
"""A Python class hierarchy wrapping the StGit on-disk metadata."""
import re
from stgit.config import config
from stgit.exception import StackException
from stgit.lib import log, stackupgrade
from stgit.lib.git import Repository
from stgit.lib.git.branch import Branch, BranchException
def _stack_state_ref(stack_nam... | emacsmirror/stgit | stgit/lib/stack.py | Python | gpl-2.0 | 14,760 |
import codecs
from uuid import uuid4
from io import BytesIO
import six
from six import b
from .fields import RequestField
writer = codecs.lookup('utf-8')[3]
def choose_boundary():
"""
Our embarassingly-simple replacement for mimetools.choose_boundary.
"""
return uuid4().hex
def iter_field_objects... | Mapotempo/mapotempo-qgis-plugin | urllib3/filepost.py | Python | gpl-2.0 | 2,256 |
# Copyright (C) 2015 Red Hat, Inc.,
# Pablo Iranzo Gomez <Pablo.Iranzo@redhat.com>
# This file is part of the sos project: https://github.com/sosreport/sos
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# version 2 of ... | BryanQuigley/sos | sos/report/plugins/monit.py | Python | gpl-2.0 | 2,464 |
# Copyright (C) 2013-2015 Samuel Damashek, Peter Foley, James Forcier, Srijay Kasturi, Reed Koser, Christopher Reffett, and Fox Wilson
#
# 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 ve... | jwoglom/ionbot | commands/channels.py | Python | gpl-2.0 | 1,217 |
import imp
import pkgutil
import re
import sys
import traceback
from . import plugins, __version__
from .compat import urlparse, is_win32
from .exceptions import NoPluginError, PluginError
from .logger import Logger
from .options import Options
from .plugin import api
def print_small_exception(start_after):
type... | guymakam/Kodi-Israel | plugin.video.israelive/resources/lib/livestreamer/session.py | Python | gpl-2.0 | 12,833 |
#!BPY
#
# $Id: uruprp_import.py 861 2007-11-05 23:03:39Z trylon $
#
# Copyright (C) 2005-2008 Alcugs PyPRP Project Team and 2008 GoW PyPRP Project Team
# See the file AUTHORS for more info about the team
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GN... | GPNMilano/PyPRPImporter | PyPRPImport/uruprp_import.py | Python | gpl-2.0 | 5,276 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "gtdweb.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| lanbing510/GTDWeb | manage.py | Python | gpl-2.0 | 249 |
#!/bin/python3
import sys
import os
import tempfile
import pprint
import logging
from logging import debug, info, warning, error
def process_info(line):
line = line.strip()
arr = line.split(':')
if len(arr) < 2:
return None, None
key = arr[0]
val = None
if key == "freq":
val = "... | lejenome/my_scripts | scan_wifi.py | Python | gpl-2.0 | 2,384 |
from django.conf.urls import include, url, patterns
from django.contrib import admin
urlpatterns = patterns('',
#url(r'^admin/', include(admin.site.urls)),
url(r'^index$', 'app.views.index'),
url(r'^$', 'app.views.index'),
url(r'^login$', 'app.views.login'),
url(r'^logout$', 'app.views.log_out'),
... | Execut3/CTF | IRAN Cert/2016/1- Easy/PPC & Web/project/project/urls.py | Python | gpl-2.0 | 567 |
#
#
# Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 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... | badp/ganeti | lib/client/gnt_node.py | Python | gpl-2.0 | 38,700 |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# world_builder.py
class BuildMap(object):
"""
Base class to actually build a map which is defined
by the 'World' object or Grid (to be decided).
This can mean printing the grid, display as image,
create the map in Minecraft or create in other virtual
... | acutesoftware/worldbuild | worldbuild/world_builder.py | Python | gpl-2.0 | 2,333 |
# -*- coding: utf-8 -*-
'''
Created on May 15, 2015
@author: chenchen9
'''
import json
import lazyxml
import tornado.web
from manager.TestcaseManager import TestcaseManager
class QueueController(tornado.web.RequestHandler):
def get(self):
queue_size = TestcaseManager().get_size()
queue_list = Tes... | five3/wireless-testing-platform | wtp/controller/QueueController.py | Python | gpl-2.0 | 1,894 |
import time
import datetime
import pprint
from .helpers import *
class ALDB(object):
def __init__(self, parent):
self._parent = parent
self._aldb = {}
def edit_record(self, position, record):
self._aldb[position] = record
def delete_record(self, position):
... | krkeegan/lib-py-insteon | insteon/base_objects.py | Python | gpl-2.0 | 19,358 |
# encoding: utf-8
# module samba.dcerpc.epmapper
# from /usr/lib/python2.7/dist-packages/samba/dcerpc/epmapper.so
# by generator 1.135
""" epmapper DCE/RPC """
# imports
import dcerpc as __dcerpc
import talloc as __talloc
class epm_twr_t(__talloc.Object):
# no doc
def __init__(self, *args, **kwargs): # real ... | ProfessorX/Config | .PyCharm30/system/python_stubs/-1247972723/samba/dcerpc/epmapper/epm_twr_t.py | Python | gpl-2.0 | 764 |
# -*- coding: UTF-8 -*-
from django.template.context import RequestContext
from project.tramitacao.models import Tbpecastecnicas, \
Tbprocessorural,Tbchecklistprocessobase, Tbprocessosanexos, Tbprocessobase,Tbprocessourbano, Tbcaixa, AuthUser, Tbmunicipio, Tbprocessoclausula, Tbpendencia, Tbetapa, Tbtransicao
f... | waldenilson/TerraLegal | project/tramitacao/restrito/relatorio.py | Python | gpl-2.0 | 111,754 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib.auth.models import Group
from django.db import migrations
def initial_data(apps, schema_editor):
staff = Group.objects.create(name="Staff")
staff.save()
def delete_staff_group(apps, schema_editor):
staff = Group.objects... | Bartzi/LabShare | labshare/migrations/0013_initial_groups.py | Python | gpl-2.0 | 566 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
sys.path=['../']+sys.path
import dynamixel
ctx=dynamixel.dynamixel_new_rtu('/dev/ttyACM0', 1000000, 'E', 8, 1)
con=dynamixel.dynamixel_connect(ctx)
dynamixel.dynamixel_set_debug(ctx,True)
if con==0:
for i in range(1,19):
ret=dynamixel.dynamixel_read_data(
... | erazor83/libdynamixel | contrib/python-swig/examples/read_model.py | Python | gpl-2.0 | 398 |
#
# -*- coding: utf-8 -*-
#
# Copyright 2011 Voldemar Khramtsov <harestomper@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the L... | itmages/itmages-service | itmagesd/iomod.py | Python | gpl-2.0 | 10,896 |
"""
This module is used for common operations
as well as global variables
:copyright: (c) 2014 by Kourosh Parsa.
"""
import os
import subprocess
import platform
IIS_HOME = "%s\\Windows\\System32\\inetsrv" % os.getenv("SYSTEMDRIVE")
APP_CMD = "%s\\appcmd.exe" % IIS_HOME
DOCROOT = "%s\\inetpub\\wwwroot" % os... | kouroshparsa/iis_bridge | iis_bridge/config.py | Python | gpl-2.0 | 2,094 |
from django.conf.urls import patterns, include, url
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
# Examples:
url(r'^$', 'brbappl.views.index', name='index'),
url(r'^done$', 'brbappl.views.done', name='done'),
url(r... | thijsdezoete/BrBaFinals | poolgame/poolgame/urls.py | Python | gpl-2.0 | 816 |
# -*- coding: utf-8 -*-
"""
direct PAS
Python Application Services
----------------------------------------------------------------------------
(C) direct Netware Group - All rights reserved
https://www.direct-netware.de/redirect?pas;upnp
The following license agreement remains valid unless any additions or
changes a... | dNG-git/pas_upnp | src/dNG/data/upnp/service.py | Python | gpl-2.0 | 19,564 |
import os
import sys
import random
from clint.textui import colored
import subprocess
from conf import DI
from conf import treemake
from conf import py
import emoticons
from logger import Logger
import tree_reader
def run_tree(infile,outfile):
cmd = "FastTree -nt -gtr "+infile+" 2>fasttree.out > "+outfile
os.... | FePhyFoFum/PyPHLAWD | src/cluster_tree_wc.py | Python | gpl-2.0 | 2,115 |
#!flask/bin/python
import os
import unittest
from config import basedir
from app import app, db
from app.models import User
class TestCase(unittest.TestCase):
def setUp(self):
app.config['TESTING'] = True
app.config['WTF_CSRF_ENABLED'] = False
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlit... | mcvmcv/wurstboard | tests.py | Python | gpl-2.0 | 1,285 |
################################################################
# LiveQ - An interactive volunteering computing batch system
# Copyright (C) 2013 Ioannis Charalampidis
#
# 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 ... | wavesoft/LiveQ | liveq-common/liveq/data/histo/interpolate.py | Python | gpl-2.0 | 7,349 |
# -*- coding: utf-8 -*-
import os,math
from qgis.core import NULL
from mole import oeq_global
from mole.project import config
from mole.extensions import OeQExtension
from mole.stat_corr import rb_contemporary_base_uvalue_by_building_age_lookup
def calculation(self=None, parameters={},feature = None):
from math i... | UdK-VPT/Open_eQuarter | mole/extensions/prop_buildings/oeq_HHRS.py | Python | gpl-2.0 | 1,148 |
#
# This file is part of Invenio.
# Copyright (C) 2016, 2017 CERN.
#
# Invenio is free software; you can redistribute it
# and/or modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# Inve... | hachreak/invenio-access | invenio_access/alembic/67ba0de65fbb_create_access_branch.py | Python | gpl-2.0 | 1,279 |
import random
from pdcglobal import *
from effects import *
def PotionOfKillbeePoison(item):
item.full_name += ' of Killerbee-Poison'
item.weaponinfotext = 'Dangerous Poison'
def DrinkPotionOfKillbeePoison(self, actor):
KillerbeePoisonEffect(actor,None)
def PotionOfYumuraPoison(item):
item.full_name ... | cycladesnz/chambersAndCreatures | src/item/suf_potions.py | Python | gpl-2.0 | 1,217 |
#!/usr/bin/python
import computefarm as cf
from computefarm.farm import depth_first, breadth_first
import random
import logging
import numpy as np
HOUR = 60 * 60
default_queue_properties = {
'grid': { 'num': 0, 'mem': 750, 'avg': HOUR, 'std': 0.6 * HOUR},
'prod': { 'num': 0, 'avg': 8 * HOUR, 'std... | fubarwrangler/atlassim | simulation.py | Python | gpl-2.0 | 6,264 |
class YapPlugin(object):
pass
| srwalter/yap | yap/plugin.py | Python | gpl-2.0 | 34 |
### This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the License, or
## (at your option) any later version.
## This program is distributed in the hope that it will be useful,... | beagles/sosreport-neutron | sos/plugins/mysql.py | Python | gpl-2.0 | 1,718 |
# Copyright 2005 Duke University
# Copyright (C) 2012-2015 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later versi... | shaded-enmity/dnf | dnf/base.py | Python | gpl-2.0 | 72,096 |
"""
Copyright (C) 2014 Vahid Rafiei (@vahid_r)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in... | vahidR/test-builder | tests/test_utils.py | Python | gpl-2.0 | 1,040 |
#
# Advene: Annotate Digital Videos, Exchange on the NEt
# Copyright (C) 2008-2017 Olivier Aubert <contact@olivieraubert.net>
#
# Advene is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the ... | oaubert/advene | lib/advene/gui/edit/merge.py | Python | gpl-2.0 | 14,288 |
from . import nc
from . import iso_codes
from . import emc2
class CodesEMC2(iso_codes.Codes):
def SPACE(self): return(' ')
def TAP(self): return('G33.1')
def TAP_DEPTH(self, format, depth): return(self.SPACE() + 'K' + (format % depth))
# This version of COMMENT removes comments from the resultant G... | vilemnovak/blendercam | scripts/addons/cam/nc/emc2tap.py | Python | gpl-2.0 | 2,892 |
# -*- coding: utf-8 -*-
# ..#######.########.#######.##....#..######..######.########....###...########.#######.########..######.
# .##.....#.##.....#.##......###...#.##....#.##....#.##.....#...##.##..##.....#.##......##.....#.##....##
# .##.....#.##.....#.##......####..#.##......##......##.....#..##...##.##.....#.... | repotvsupertuga/tvsupertuga.repository | script.module.openscrapers/lib/openscrapers/sources_openscrapers/en/to_be_fixed/no_sources/downflix.py | Python | gpl-2.0 | 3,106 |
# This file is part of Rubber and thus covered by the GPL
# (c) Sebastian Reichel, 2012
"""
Dependency analysis for package 'ltxtable' in Rubber.
"""
def setup (document, context):
global doc
doc = document
doc.hook_macro('LTXtable', 'aa', hook_ltxtable)
def hook_ltxtable (loc, width, file):
# If the file name lo... | sre/rubber | src/latex_modules/ltxtable.py | Python | gpl-2.0 | 484 |
import re
def readConversion():
string = ''
conversion = []
try:
# obtain conversion pattern
raw = raw_input()
while not raw:
raw = raw_input()
conversion = map(int, raw.split())
# obtain string
string = raw_input()
while not string:
string = raw_input()
finally:
return conversion, string
... | RussianPenguin/dailyprogrammer | easy/140.py | Python | gpl-2.0 | 1,049 |
from skin import parseColor, parseFont, parseSize
from Components.config import config, ConfigClock, ConfigInteger, ConfigSubsection, ConfigYesNo, ConfigSelection, ConfigSelectionNumber
from Components.Pixmap import Pixmap
from Components.Button import Button
from Components.ActionMap import HelpableActionMap
from Comp... | kajgan/stbgui | lib/python/Plugins/Extensions/GraphMultiEPG/GraphMultiEpg.py | Python | gpl-2.0 | 57,664 |
# -*- coding: utf-8 -*-
from qgis.core import NULL
from mole.project import config
from PyQt4.QtCore import QVariant
def load(self=None):
self.load_wfs()
return True
def evaluation(self=None, parameters={},feature=None):
from mole import oeq_global
result = {'FLOORS': {'type': QVariant.Double,
... | UdK-VPT/Open_eQuarter | mole/extensions/acqu_berlin/fbinter_wfs_floors_alkis.py | Python | gpl-2.0 | 1,594 |
# -*- coding: utf-8 -*-
"""
***************************************************************************
DensifyGeometriesInterval.py by Anita Graser, Dec 2012
based on DensifyGeometries.py
---------------------
Date : October 2012
Copyright : (C) 2012 by Victor Olaya
... | nirvn/QGIS | python/plugins/processing/algs/qgis/DensifyGeometriesInterval.py | Python | gpl-2.0 | 2,659 |
from ipmm_core_pkg.primitive import Primitive
from ipmm_core_pkg.addressBlock import AddressBlock
from ipmm_core_pkg.register import Register
from ipmm_core_pkg.field import Field
from ipmm_core_pkg.port import Port
from ipmm_core_pkg.parameter import Parameter
class Component(Primitive):
def __ini... | kactus2/kactus2dev | PythonAPI/ipmm_core_pkg/component.py | Python | gpl-2.0 | 2,871 |
import os
import json
import subprocess
def system_call(command):
p = subprocess.Popen([command], stdout=subprocess.PIPE, shell=True)
p.wait()
return p.stdout.read()
# return str(p.returncode)
cwd = os.getcwd()
# hosted_data = cwd+"/../../data/reactome_template"
hosted_data = "{}/../../data/reactome_t... | OICR/PGMLab | www/pgmbio/reactome_utils.py | Python | gpl-2.0 | 1,229 |
# Copyright 2013 The Distro Tracker Developers
# See the COPYRIGHT file at the top-level directory of this distribution and
# at http://deb.li/DTAuthors
#
# This file is part of Distro Tracker. It is subject to the license terms
# in the LICENSE file found in the top-level directory of this
# distribution and at http:/... | sa2ajj/DistroTracker | pts/vendor/skeleton/rules.py | Python | gpl-2.0 | 11,857 |
# Copyright (C) 2010 Jeremy S. Sanders
# Email: Jeremy Sanders <jeremy@jeremysanders.net>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# ... | mythsmith/veusz | veusz/plugins/toolsplugin.py | Python | gpl-2.0 | 19,823 |
#--------------------------------------------------------------------------
# Software: InVesalius - Software de Reconstrucao 3D de Imagens Medicas
# Copyright: (C) 2001 Centro de Pesquisas Renato Archer
# Homepage: http://www.softwarepublico.gov.br
# Contact: invesalius@cti.gov.br
# License: GNU ... | fabio-otsuka/invesalius3 | invesalius/gui/task_tools.py | Python | gpl-2.0 | 5,584 |
from configuration import *
from models.cwdlogs import *
from models.dataaccess import *
from utils.alarmsender import *
from logging import *
from sqlalchemy.orm.exc import *
def delcurrent(db, name):
db.query(CurrentJobs).filter(CurrentJobs.name == name).delete()
db.commit()
def clearalarm(db,name):
t... | tmkdev/cwd | cwd_helpers.py | Python | gpl-2.0 | 1,076 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
#############################################################################
##
## Copyright (C) 2016 The Qt Company Ltd.
## Contact: https://www.qt.io/licensing/
##
## This file is part of the test suite of PySide2.
##
## $QT_BEGIN_LICENSE:GPL-EXCEPT$
## Commercial Lice... | qtproject/pyside-shiboken | tests/otherbinding/extended_multiply_operator_test.py | Python | gpl-2.0 | 2,230 |
## begin license ##
#
# "Meresco Lucene" is a set of components and tools to integrate Lucene (based on PyLucene) into Meresco
#
# Copyright (C) 2013 Seecr (Seek You Too B.V.) http://seecr.nl
# Copyright (C) 2013 Stichting Bibliotheek.nl (BNL) http://www.bibliotheek.nl
#
# This file is part of "Meresco Lucene"
#
# "Mer... | seecr/meresco-lucene | meresco/__init__.py | Python | gpl-2.0 | 1,123 |
# -*- coding: utf-8 -*-
"""
direct PAS
Python Application Services
----------------------------------------------------------------------------
(C) direct Netware Group - All rights reserved
https://www.direct-netware.de/redirect?pas;media
The following license agreement remains valid unless any additions or
changes ... | dNG-git/pas_media | src/dNG/data/media/abstract_audio.py | Python | gpl-2.0 | 1,708 |
from __future__ import absolute_import
from __future__ import print_function
import os,sys
import shutil
import unittest
parentdir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.insert(0,parentdir)
import utils
from pcs_test_functions import pcs,ac,isMinimumPacemakerVersion
empty_cib = "empty.... | tradej/pcs | pcs/test/test_constraints.py | Python | gpl-2.0 | 103,383 |
#!/usr/bin/env python
#
# $Id: sign1.py 363 2006-01-01 18:03:07Z valos $
#
# PyXMLSec example: Signing a template file.
#
# Signs a template file using a key from PEM file
#
# Usage:
# ./sign1.py <xml-tmpl> <pem-key>
#
# Example:
# ./sign1.py sign1-tmpl.xml rsakey.pem > sign1-res.xml
#
# The result signature could be ... | aricaldeira/pyxmlsec | examples/sign1.py | Python | gpl-2.0 | 3,625 |
from __future__ import absolute_import
from builtins import object
"""Celery beat scheduler backed by Redis.
The schedule will be saved as a pickled data in the key
'celery:beat:<filename>', where filename is the schedule filename
configured in celery
Prerequisite:
You are using Redis as your broker (BROKER_URL =... | Kegbot/kegbot-server | pykeg/util/celery.py | Python | gpl-2.0 | 2,201 |
import json
from collections import namedtuple
import fauxfactory
import pytest
from riggerlib import recursive_update
from widgetastic.utils import partial_match
from cfme.cloud.provider.openstack import OpenStackProvider
from cfme.fixtures.provider import setup_or_skip
from cfme.infrastructure.provider.rhevm import... | RedHatQE/cfme_tests | cfme/fixtures/v2v_fixtures.py | Python | gpl-2.0 | 22,048 |
# -*- coding: utf-8 -*-
# Copyright 2007-2020 The HyperSpy developers
#
# This file is part of HyperSpy.
#
# HyperSpy 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... | dnjohnstone/hyperspy | hyperspy/misc/machine_learning/import_sklearn.py | Python | gpl-3.0 | 1,124 |
__author__ = 'suwelack'
from rdflib.namespace import ClosedNamespace
#MSMLRep= ClosedNamespace(
# uri=URIRef("http://www.msml.org/ontology/msmlRepresentation#"),
# terms=[
# 'isRepresentationOf', 'isDataNodeFor']
#) | CognitionGuidedSurgery/msml | src/msml/exporter/msml_namespace.py | Python | gpl-3.0 | 231 |
__problem_title__ = "Finding numbers for which the sum of the squares of the digits is a square"
__problem_url___ = "https://projecteuler.net/problem=171"
__problem_description__ = "For a positive integer , let f( ) be the sum of the squares of the " \
"digits (in base 10) of , e.g. f(3) = 3 ... | jrichte43/ProjectEuler | Problem-0171/solutions.py | Python | gpl-3.0 | 917 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (C) 2018 David Arroyo Menéndez
# Author: David Arroyo Menéndez <davidam@gnu.org>
# Maintainer: David Arroyo Menéndez <davidam@gnu.org>
# This file is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as p... | davidam/python-examples | basics/verpython.py | Python | gpl-3.0 | 1,075 |
import os, binascii
from dateutil import parser as dateparser
from bottle import run, get, post, delete, install, HTTPError, request
from bottle_sqlite import SQLitePlugin
from dbsetup import init_db
from google_auth import gauth
from app_conf import DBNAME, DEBUG
from app_gcm import send_notification
init_db(DBNAME)
... | vanita5/TwittnukerGCMServer | app.py | Python | gpl-3.0 | 6,900 |
""" Karmapi base web api
"""
from pathlib import Path
from io import BytesIO
import pandas
from karmapi import base
from flask import request, make_response
from flask_restplus import Namespace, Resource, fields
api = Namespace("base", description="Base karmapi api")
txt = """
hello world
hello universe
"""
@api... | openbermuda/karmapi | karmapi/apis/base.py | Python | gpl-3.0 | 1,577 |
from math import cos, sin, pi, ceil
from random import randint, random, expovariate, shuffle
import pygame as pg
from pygame import Rect
from ext import evthandler as eh
from conf import conf
from obj import Player, Star
from util import ir
import ui
random0 = lambda: 2 * random() - 1
def tile (screen, img, rect, ... | ikn/wvoas | game/level.py | Python | gpl-3.0 | 21,546 |
#! /usr/bin/env python
# @brief Script to run apropriate tests.
import os
import distutils.core
from shutil import rmtree, copyfile
"""Avaiable tests dictionary in the format no_of_test : name_of_test"""
tests = {0:"default Generator.dat with lot of comments and explanations",
1:"RHIC pt_pi, eta_pi; tecm = 200... | rkycia/GenEx | test.py | Python | gpl-3.0 | 4,308 |
from cmj.settings import *
| cmjatai/cmj | sapl/settings.py | Python | gpl-3.0 | 27 |
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2015-2017 Canonical Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation.
#
# This program is distributed in ... | 3v1n0/snapcraft | snapcraft/tests/test_meta.py | Python | gpl-3.0 | 27,949 |
#!/usr/bin/env python2.7
from configuration import *
from pylab import *
import copy
# Non-dimensional units where D=sigma=1.
rho = 25 # good model for hard sphere.
def morse_potential(r):
return (1 - exp(-rho*(r-1)))^2
def morse_force(r):
return -2*exp(-rho*(r-1))*(1 - exp(-rho*(r-1)))
# Vector force acting... | tranqui/PyTrajectories | saddle-nucleation.py | Python | gpl-3.0 | 1,177 |
""" pytest for WorkflowTasks
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
# pylint: disable=protected-access,missing-docstring,invalid-name
import json
import six
import sys
from mock import MagicMock
from pytest import mark
parametrize = mark.param... | ic-hep/DIRAC | src/DIRAC/TransformationSystem/Client/test/Test_Client_RequestTasks.py | Python | gpl-3.0 | 11,381 |
# -*- coding: utf-8 -*-
# version.py
# Part of ‘python-daemon’, an implementation of PEP 3143.
#
# Copyright © 2008–2016 Ben Finney <ben+python@benfinney.id.au>
#
# This is free software: you may copy, modify, and/or distribute this work
# under the terms of the GNU General Public License as published by the
# Free So... | nyov/python-daemon | version.py | Python | gpl-3.0 | 18,554 |
#!/usr/bin/env python2
###############################################################################
#
# Set a baseline for all benchmarks using numpy's serial matrix multiplication
#
# Copyright (C) 2015, Jonathan Gillett
# All rights reserved.
#
#
# This program is free software: you can redistribute it and/or modi... | gnu-user/mcsc-6030-project | codes/benchmarks/baseline.py | Python | gpl-3.0 | 1,605 |
class BugReportWindowTestController(object):
def __init__(self, factory, exit):
self.view = factory(self)
self.view.show()
self._exit = exit
def send_report_action(self, email, description):
print('Send report action')
print('Email is: "%s"' % email)
print('Des... | Bajoo/client-pc | tests/gui/bug_report_window.py | Python | gpl-3.0 | 659 |
def __load():
import imp, os, sys
ext = 'pygame/font.so'
for path in sys.path:
if not path.endswith('lib-dynload'):
continue
ext_path = os.path.join(path, ext)
if os.path.exists(ext_path):
mod = imp.load_dynamic(__name__, ext_path)
break
else:... | mokuki082/EggDrop | code/build/bdist.macosx-10.6-intel/python3.4-standalone/app/temp/pygame/font.py | Python | gpl-3.0 | 393 |
import os.path
from PyQt4 import QtCore, QtGui
import vlc.vlc as vlc
class MovieData:
libvlc = vlc.Instance(["--no-audio","--no-xlib"])
def __init__(self, basePath, dict):
self.basePath = basePath
self.data = dict
# load poster pixmap
PngBase64 = "data:image/png;base64... | mmpi/SvgPresenter | qt/movie/MovieData.py | Python | gpl-3.0 | 1,178 |
from ase import Atoms
from gpaw import GPAW
a = 4.5
H = Atoms('H', [(a / 2, a / 2, a / 2)],
pbc=0,
cell=(a, a, a))
calc = GPAW(nbands=1, h=0.2, charge=1)
H.set_calculator(calc)
print H.get_potential_energy() + calc.get_reference_energy()
assert abs(H.get_potential_energy() + calc.get_reference_ener... | robwarm/gpaw-symm | gpaw/test/proton.py | Python | gpl-3.0 | 334 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import _uniout
import sys
import csv
reload(sys)
sys.setdefaultencoding("utf-8")
data_path = '../data/business/business_train_v7'
classes = list()
inputs = dict()
results = dict()
if __name__ == '__main__':
with open(data_path, '... | aquadrop/solr_py | client/find_multi_intention.py | Python | gpl-3.0 | 1,346 |
#coding:utf8
'''
发布订阅模式
'''
import message
#Example
def hello(name):
print "hello, %s."%name
def hi(name):
print "hi, %s."%name
def stop(name):
print 'hello, %s. greet5'%name
print 'discontinued.'
ctx = message.Context()
ctx.discontinued = True
return ctx
#订阅一个话题,并发布
message.sub('greet', ... | duanyifei/python_modules_test | test_message.py | Python | gpl-3.0 | 925 |
##############################################################################
#
# Copyright (c) 2002 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SO... | Donkyhotay/MoonPy | zope/i18n/locales/__init__.py | Python | gpl-3.0 | 22,122 |
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2015-2016 Canonical Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation.
#
# This program is distributed in ... | rbreitenmoser/snapcraft | snapcraft/tests/test_yaml.py | Python | gpl-3.0 | 25,577 |
import logging
import os
import base64
try:
from io import BytesIO
except ImportError:
try:
from cStringIO import StringIO as BytesIO
except ImportError:
from StringIO import StringIO as BytesIO
import tornado.web
import cairocffi as cairo
from lib.config.tomorrow import Config
from lib.too... | TylerTemp/tomorrow | lib/ui/error.py | Python | gpl-3.0 | 4,288 |
import pyglet
from pyglet.window import key
window = pyglet.window.Window()
@window.event
def on_key_press(symbol, modifiers):
print('A key was pressed')
if symbol == key.A:
print('The "A" key was pressed.')
elif symbol == key.LEFT:
print('The left arrow key was pressed.')
elif symbol... | davidam/python-examples | pyglet/keyboard.py | Python | gpl-3.0 | 446 |
#!/usr/bin/env python3
numero = int(input("Digite um número inteiro: "))
resto = numero % 5
if(resto == 0):
print("Buzz")
else:
print(numero)
| ranog/coursera_python | buzz.py | Python | gpl-3.0 | 155 |
import requests
import datetime
def get_most_recent_commits(github_name, hours_to_go_back=8):
url = 'https://api.github.com/users/{}/events'.format(github_name)
r = requests.get(url)
events = r.json()
push_events = []
for event in events:
if event['type'] == u'PushEvent':
push_... | benhoff/reddit_helper | reddit_helper/github.py | Python | gpl-3.0 | 1,071 |
# -*- coding: utf-8 -*-
# This file is part of Gtfslib-python.
#
# Gtfslib-python 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... | afimb/gtfslib-python | gtfslib/orm.py | Python | gpl-3.0 | 22,956 |
# -*- coding: utf-8 -*-
"""Normalization functions for different values."""
from __future__ import absolute_import, unicode_literals
import re
import logging
from email.utils import parseaddr
log = logging.getLogger(__name__)
mastodon_url_regex = '^https:\/\/(.*)\/@(.*)'
mastodon_url_legacy_regex = '^https:\/\/(.*)\/... | CaliOpen/CaliOpen | src/backend/main/py.main/caliopen_main/common/helpers/normalize.py | Python | gpl-3.0 | 1,991 |
ver, hor = dialog("Choose axis of Symmetry",
("vertical", bool, True),
("horizontal", bool, True))
totalweight = sum(i.weight for i in flame.xform)
if hor:
xform = flame.add_xform()
xform.e *= -1
xform.weight = totalweight
xform.color = 1
xform.symmetry = 1
i... | bobbyrward/fr0st | scripts/bilateral_symmetry.py | Python | gpl-3.0 | 464 |
#!/usr/bin/env python
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import absolute_import, division, print_function
#
# Standard imports
#
import glob, os
from distutils.extension import Extension
#
# setuptools' sdist command ignores MANIFEST.in
#
#from distutils.command.sdist import... | specdb/specdb | setup.py | Python | gpl-3.0 | 2,862 |
from cloudinit import helpers
from cloudinit.util import load_file
from cloudinit.sources import DataSourceAzure
from ..helpers import populate_dir
import base64
import crypt
from mocker import MockerTestCase
import os
import stat
import yaml
def construct_valid_ovf_env(data=None, pubkeys=None, userdata=None):
i... | cbuben/cloud-init | tests/unittests/test_datasource/test_azure.py | Python | gpl-3.0 | 17,037 |
#!/usr/bin/env python
# -*- mode: python; coding: utf-8; -*-
# ---------------------------------------------------------------------------##
#
# Copyright (C) 1998-2003 Markus Franz Xaver Johannes Oberhumer
# Copyright (C) 2003 Mt. Hood Playing Card Co.
# Copyright (C) 2005-2009 Skomoroh
#
# This program is free softwa... | shlomif/PySolFC | pysollib/games/klondike.py | Python | gpl-3.0 | 55,884 |
import numpy as np
from pylab import mean, log
from matplotlib import mlab
from kokako.score import Detector
class SimpleKiwi(Detector):
code = 'simple-north-island-brown-kiwi'
description = 'Simple detector for north-island brown kiwi, based on energy between 1600 and 2200 Hz'
version = '0.1.2'
window... | dragonfly-science/kokako | kokako/detectors/kiwi.py | Python | gpl-3.0 | 1,133 |
import socket # Import socket module
s = socket.socket() # Create a socket object
host = socket.gethostname() # Get local machine name
port = 8082 # Reserve a port for your service.
s.connect((host, port))
s.send("send".encode())
check = s.recv(1024).decode()
print(check)
whil... | ukholiday94/Project | 1stStep/client.py | Python | gpl-3.0 | 634 |
# coding=utf-8
from fancywidgets.pyQtBased.FwTabWidget import FwTabWidget
from qtpy import QtWidgets
class DisplayPrefTabs(FwTabWidget):
'''
hide tabs-area if no tabs added
'''
def __init__(self):
FwTabWidget.__init__(self)
self.setMovable(True)
self.setSizePolicy(
... | radjkarl/dataArtist | dataArtist/widgets/DisplayPrefTabs.py | Python | gpl-3.0 | 2,012 |
# Mercurial extension to provide 'hg relink' command
#
# Copyright (C) 2007 Brendan Cully <brendan@kublai.com>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
"""recreates hardlinks between repository clones"""
from mercurial imp... | mikel-egana-aranguren/SADI-Galaxy-Docker | galaxy-dist/eggs/mercurial-2.2.3-py2.7-linux-x86_64-ucs4.egg/hgext/relink.py | Python | gpl-3.0 | 6,076 |
#r# =======================
#r# How to Use SubCircuit
#r# =======================
#r# This example shows how to use subcircuits.
####################################################################################################
import PySpice.Logging.Logging as Logging
logger = Logging.setup_logging()
##########... | FabriceSalvaire/PySpice | examples/basic-usages/subcircuit.py | Python | gpl-3.0 | 1,938 |