code stringlengths 6 947k | repo_name stringlengths 5 100 | path stringlengths 4 226 | language stringclasses 1
value | license stringclasses 15
values | size int64 6 947k |
|---|---|---|---|---|---|
# -*- coding: utf-8 -*-
#
# This file is part of CERN Analysis Preservation Framework.
# Copyright (C) 2016 CERN.
#
# CERN Analysis Preservation Framework 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... | tiborsimko/analysis-preservation.cern.ch | cap/modules/deposit/api.py | Python | gpl-2.0 | 22,465 |
# Copyright 2015 Christoph Reiter
# 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 version.
impo... | ptitjes/quodlibet | quodlibet/ext/events/headphonemon.py | Python | gpl-2.0 | 5,689 |
# @StatusService status
# @DatasetService data
# @CommandService command
# @DisplayService display
# @IOService io
# this script deconvolves an image.
#
# It is assumed the images have allready been extended. See ExtendChallengeImages_reflection
rootImageDir="/home/bnorthan/Brian2014/Images/General/Deconvolution/Gra... | bnorthan/projects | Scripts/Jython/Grand_Challenge/DeconvolveChallengeImages_reflection.py | Python | gpl-2.0 | 1,894 |
#!/usr/bin/env python
# Module: generator2.py
# Purpose: sample generator classes #2
# Date: N/A
# Notes:
# 1) Test python code
# 2) Ref: https://docs.python.org/2/reference/expressions.html
import numpy as np
print "generator2.py: python generator test code #2"
# echo from the generator examples
# - ... | wadester/wh_test_py | generator2.py | Python | gpl-2.0 | 2,181 |
# -*- coding: utf-8 -*-
import cereconf
__version__ = "1.5"
IP_NUMBER = 'IPNumber'
IPv6_NUMBER = 'IPv6Number'
DNS_OWNER='DnsOwner'
REV_IP_NUMBER = 'IPNumber_rev'
A_RECORD = 'ARecord'
AAAA_RECORD = 'AAAARecord'
HOST_INFO = 'HostInfo'
MX_SET = 'MXSet'
SRV_TARGET = "SRV_target"
SRV_OWNER = "SRV_owner"
GENERAL_DNS_RECOR... | unioslo/cerebrum | Cerebrum/modules/dns/__init__.py | Python | gpl-2.0 | 561 |
#! /usr/bin/env python
current = u'b'
print ord(current)
print ord('a')
print ord('1')
print ord('\n')
ip 1 2 3
./first.py
| jencce/stuff | py/first.py | Python | gpl-2.0 | 123 |
"""
Django settings for ghost_project project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, .... | cowenberg/snap | snap_website/default/settings.py | Python | gpl-2.0 | 2,266 |
# ReadSensorsOwfs.py
###########################################################
# Class handles loading of thermometer sensor information #
# from the interface exposed by the owfs fuse #
# module. #
##########################################################... | tuanchien/tascc | modules/ReadSensorsOwfs.py | Python | gpl-2.0 | 796 |
# listenbrainz-server - Server for the ListenBrainz project.
#
# Copyright (C) 2021 Param Singh <me@param.codes>
#
# 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... | Freso/listenbrainz-server | listenbrainz/db/user_timeline_event.py | Python | gpl-2.0 | 5,585 |
from django.db import models
class MaternalArvPostModManager(models.Manager):
def get_by_natural_key(
self, arv_code, report_datetime, visit_instance, appt_status,
visit_definition_code, subject_identifier_as_pk):
MaternalVisit = models.get_model('mb_maternal', 'MaternalVisit')
... | botswana-harvard/microbiome | microbiome/apps/mb_maternal/managers/maternal_arv_post_mod_manager.py | Python | gpl-2.0 | 736 |
import numpy as np
import re
import sys
import operator
import matplotlib.pyplot as plt
def parse_transposes(fn):
size = re.compile('(\d+) x (\d+)')
tp = re.compile('Throughput: ([\d\.]+) GB')
sizes = []
tps = []
with open(fn, 'r') as f:
for l in f:
s = size.search(l)
... | denizyuret/inplace | extras/python/summarize.py | Python | gpl-2.0 | 1,163 |
import bagit
from .loggers import create_logger
logger_bagit = create_logger('bag')
def create_bag(dir_bag):
"""
Create a Bag out of given files.
:param str dir_bag: Directory that contains csv, jsonld, and changelog files.
:return obj: Bag
"""
logger_bagit.info("enter create_bag")
# if ... | nickmckay/LiPD-utilities | Python/lipd/bag.py | Python | gpl-2.0 | 2,447 |
# -*- coding: utf-8 -*-
# Django
from django.views.generic import View, TemplateView
from django.shortcuts import redirect
from django.core.urlresolvers import reverse
from django.shortcuts import get_object_or_404
# CRMA
from .models import Subscription, EmailScheduler
from .models import cancel_subscription
from .u... | emencia/emencia-crma | crma/views.py | Python | gpl-2.0 | 1,158 |
#!/usr/bin/env python
import sys
def run_277853s():
N = 1
while N<16384:
run_277853(N)
N = N*2
def run_277853(N):
cnt = 0
#for (int i = 1; i*i <= N; i = i*2)
i = 1
while i*i <= N:
cnt += 1
print(N, i, cnt)
i = i*4
#print "{:>5}=N {:>5}=cnt".format(N, cnt)
def run_605062s():
N = 1... | dvklopfenstein/PrincetonAlgorithms | py/AlgsSedgewickWayne/testcode/order.py | Python | gpl-2.0 | 768 |
'''Module for the messages pageset'''
from murmeli.pages.base import PageSet
from murmeli.pagetemplate import PageTemplate
from murmeli import dbutils
from murmeli.contactmgr import ContactManager
from murmeli.messageutils import MessageTree
from murmeli import inbox
class MessagesPageSet(PageSet):
'''Messages p... | activityworkshop/Murmeli | murmeli/pages/messages.py | Python | gpl-2.0 | 4,728 |
#!/usr/bin/env python
#
import csv, sys, os.path
def error(message):
sys.stderr.write(message + '\n')
sys.exit(1)
def cygpath_from_winpath(winabspath):
return("/cygdrive/"+winabspath[0].lower()+winabspath[2:].replace('\\','/'))
def main(argv):
if len(argv)!=(3+1) and len(argv)!=(4+1):
error('usage: %s root_W... | bquistorff/wingendep | bin/output_dependencies.py | Python | gpl-2.0 | 2,518 |
# _*_ coding:utf-8 _*_
__author__ = 'Y-ling'
__date__ = '2017/9/15 11:11'
from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException
import unittest
import os
import time
import copy
import utils
from elements_path import LOGIN_FORM, TOP_BAR, CENTER, CENTER_PERSONAL, CENTER_RESET_PA... | cyllyq/nutsbp-test | test_case/demo.py | Python | gpl-2.0 | 407 |
import xbmc, xbmcaddon, xbmcgui, xbmcplugin,os,sys
import shutil
import urllib2,urllib
import re
import extract
import time
import downloader
import plugintools
import zipfile
import ntpath
##CREDIT TO LEE @ COMMUNITY BUILDS FOR WRITING THE FORCE CLOSE FUNCTION AND ANY OTHER DEVS WHO CREATED ANY MODULES USED##
USER_A... | RuiNascimento/krepo | plugin.video.kbuildwin/default.py | Python | gpl-2.0 | 8,923 |
# This file is part of the Frescobaldi project, http://www.frescobaldi.org/
#
# Copyright (c) 2008 - 2014 by Wilbert Berendsen
#
# 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
... | anthonyfok/frescobaldi | frescobaldi_app/fileinfo.py | Python | gpl-2.0 | 6,388 |
from fprops import *
from pylab import *
import sys
#P = fluid('water','helmholtz');
#P = fluid('ammonia','pengrob');
P = fluid('carbondioxide','pengrob');
print "SOLVING TRIPLE POINT..."
print "Fluid: %s\nData source: %s" %(P.name, P.source)
try:
p_t, rhof_t, rhog_t = P.triple_point()
except RuntimeError,e:
prin... | georgyberdyshev/ascend | models/johnpye/fprops/python/solve_ph_array.py | Python | gpl-2.0 | 2,054 |
#
# results.py - Result widget for Yabsc
#
# Copyright (C) 2008 James Oakley <jfunk@opensuse.org>
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your... | openSUSE/yabsc | yabsclib/results.py | Python | gpl-2.0 | 36,764 |
"""SCons.Variables.PathVariable
This file defines an option type for SCons implementing path settings.
To be used whenever a a user-specified path override should be allowed.
Arguments to PathVariable are:
option-name = name of this option on the command line (e.g. "prefix")
option-help = help string for optio... | IljaGrebel/OpenWrt-SDK-imx6_HummingBoard | staging_dir/host/lib/scons-2.3.5/SCons/Variables/PathVariable.py | Python | gpl-2.0 | 5,646 |
# -*- coding: utf-8 -*-
from cStringIO import StringIO
from amoco.logger import Log
logger = Log(__name__)
import re
try:
from pygments.token import Token
from pygments.style import Style
from pygments.lexer import RegexLexer
from pygments.formatters import *
except ImportError:
logger.info("pyg... | chubbymaggie/amoco | amoco/ui/render.py | Python | gpl-2.0 | 9,193 |
#------------------------------------------------------------------------------
# pycparser: c_parser.py
#
# CParser class: Parser and AST builder for the C language
#
# Copyright (C) 2008-2013, Eli Bendersky
# License: BSD
#------------------------------------------------------------------------------
import re
from ... | BartoszCichecki/onlinepython | onlinepython/pypy-2.4.0-win32/lib_pypy/cffi/_pycparser/c_parser.py | Python | gpl-2.0 | 59,384 |
# -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding:utf-8 -*-
# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 fileencoding=utf-8
#
# MDAnalysis --- https://www.mdanalysis.org
# Copyright (c) 2006-2017 The MDAnalysis Development Team and contributors
# (see the file AUTHORS for the full list of names)
#... | MDAnalysis/mdanalysis | testsuite/MDAnalysisTests/coordinates/test_dms.py | Python | gpl-2.0 | 3,032 |
#!/usr/bin/env python
import sys
from django.conf import settings
from django.core.management import execute_from_command_line
from tests import mongoutils
settings.configure(
DATABASES={
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
},
},
... | qwiglydee/drf-mongo-filters | runtests.py | Python | gpl-2.0 | 751 |
'''
Created on 17 Dec 2013
@author: tore
'''
class ObjectList(object):
def __init__(self):
self.objectlist = []
self.windowlist = []
def addObject(self, listobject):
self.objectlist.append(listobject)
def removeObject(self, listobject):
self.objectlist.remove(listobje... | Ernti/GG | gg/GGobjectlist.py | Python | gpl-2.0 | 491 |
#
#
# Copyright (C) 2007, 2011 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 distri... | ekohl/ganeti | qa/qa_config.py | Python | gpl-2.0 | 3,219 |
# This file is part of Fail2Ban.
#
# Fail2Ban 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.
#
# Fail2Ban is distributed in the hope t... | yarikoptic/Fail2Ban-Old-SVNGIT | testcases/datedetectortestcase.py | Python | gpl-2.0 | 2,300 |
# -*- coding: utf-8 -*-
#
# Copyright 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 hav... | Katello/katello-cli | src/katello/client/api/content_view.py | Python | gpl-2.0 | 2,845 |
'''
Copyright (C) 2012 mentalsmash.org <contact@mentalsmash.org>
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, or (at your option) any later version.
Thi... | mentalsmash/geek-map | mentalsmash/__init__.py | Python | gpl-2.0 | 775 |
""" tests can be run from the root dir with:
clean-pyc && \
APP_ID= APP_KEY= coverage run --source=. --branch `which nosetests` tests/* &&\
coverage html
"""
import os
from unittest import TestCase
from mock import patch
from dandelion import Datagem, DandelionException, DataTXT, default_config
from dandelion.base im... | SpazioDati/python-dandelion-eu | tests/base.py | Python | gpl-2.0 | 4,228 |
from django.contrib import admin
from django_revision.modeladmin_mixin import ModelAdminRevisionMixin
from edc_base.modeladmin_mixins import (
ModelAdminNextUrlRedirectMixin, ModelAdminFormInstructionsMixin,
ModelAdminFormAutoNumberMixin,
ModelAdminReadOnlyMixin, ModelAdminAuditFieldsMixin)
from .admin_si... | botswana-harvard/edc-map | edc_map/admin.py | Python | gpl-2.0 | 1,678 |
# GemRB - Infinity Engine Emulator
# Copyright (C) 2003 The GemRB Project
#
# 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... | Tomsod/gemrb | gemrb/GUIScripts/bg2/GUICG2.py | Python | gpl-2.0 | 5,947 |
# -*- coding: utf-8 -*-
from Plugins.Extensions.MediaPortal.plugin import _
from Plugins.Extensions.MediaPortal.resources.imports import *
from Plugins.Extensions.MediaPortal.resources.keyboardext import VirtualKeyBoardExt
CONFIG = "/usr/lib/enigma2/python/Plugins/Extensions/MediaPortal/additions/additions.xml"
clas... | n3wb13/OpenNfrGui-5.0-1 | lib/python/Plugins/Extensions/MediaPortal/additions/porn/x2search4porn.py | Python | gpl-2.0 | 7,051 |
#!/usr/bin/env python
# RadioInput.py
#
# Copyright (C) 2015 Kano Computing Ltd.
# License: http://www.gnu.org/licenses/gpl-2.0.txt GNU GPL v2
#
from gi.repository import Gtk, GObject
class RadioInput(Gtk.Box):
__gsignals__ = {
'radio-changed': (GObject.SIGNAL_RUN_FIRST, None, ())
}
def __init_... | KanoComputing/kano-feedback | kano_feedback/RadioInput.py | Python | gpl-2.0 | 1,658 |
# Canto rsync Plugin
# by Jack Miller
# v1.1
# This implements a lightweight remote sync based around rsync to a remote
# server, or copying to mounted filesystem, etc.
ENABLED = False
#ENABLED = True
# SSH
# For ssh based rsync (remote hosts) you should have key authentication setup
# so it runs without prompting f... | themoken/canto-next | plugins/sync-rsync.py | Python | gpl-2.0 | 11,388 |
# Copyright 2009 by Tiago Antao <tiagoantao@gmail.com>. All rights reserved.
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package.
"""
This module allows to control GenePop through an easier interface.
... | BlogomaticProject/Blogomatic | opt/blog-o-matic/usr/lib/python/Bio/PopGen/GenePop/EasyController.py | Python | gpl-2.0 | 6,648 |
#!/usr/bin/env python
#
# ThugOpts.py
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; ... | fedelemantuano/thug | thug/ThugAPI/ThugOpts.py | Python | gpl-2.0 | 8,781 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import errno
import os
from nacl.exceptions import CryptoError
from cabinet.person import Person
def mkdir_p(path):
"""
Creates the path and all the intermediate directories that don't
exist
Might raise OSError
:param path: path to create
:type... | ivanalejandro0/cabinet | cabinet/auth.py | Python | gpl-2.0 | 2,708 |
#!/usr/bin/env python
import unittest
from werkzeug.exceptions import Forbidden, NotFound
from tests.logic_t.layer.LogicLayer.util import generate_ll
class AuthorizeUserForTaskByEmailTest(unittest.TestCase):
def setUp(self):
self.ll = generate_ll()
self.pl = self.ll.pl
def test_authorizes_... | izrik/tudor | tests/logic_t/layer/LogicLayer/test_do_authorize_user_for_task_by_email.py | Python | gpl-2.0 | 7,024 |
# -*- coding: utf-8 -*-
__author__ = 'linzhonghong'
__version__ = '2013.11.001'
import sys
reload(sys)
sys.setdefaultencoding('UTF-8')
import os
from signal import SIGTERM
import wx
import wx.lib.buttons as buttons
from gui import MyStatusBar,MyListCtrl,WarnDialog,LogoutDialog,LoginDialog,WarnDialog2
... | linzhonghong/dnspod_desktop | dnspod_desktop.py | Python | gpl-2.0 | 20,963 |
#
# Created by DraX on 2005.08.08
#
# Updated by ElgarL on 28.09.2005
#
print "importing village master data: Talking Island Village ...done"
import sys
from net.sf.l2j.gameserver.model.quest import State
from net.sf.l2j.gameserver.model.quest import QuestState
from net.sf.l2j.gameserver.model.quest.jy... | Barrog/C4-Datapack | data/jscript/village_master/7026_bitz_occupation_change/__init__.py | Python | gpl-2.0 | 2,377 |
from nct.utils.alch import Session, LSession
from nct.domain.instrument import Instrument
import random
import functools
import time
from nct.deploy.deploy import Deployer
import cProfile
INSTRUMENTS = ['GOOGL.O', 'TWTR.N', 'GS.N', 'BAC.N', 'IBM.N']
def profile_method(file_name = None):
def gen_wrapper(func):
... | kozyarchuk/NCT-workers | tests/perf/pscrap.py | Python | gpl-2.0 | 1,216 |
from setuptools import setup
import py2exe
import os
import glob
__import__('gtk')
__import__('jinja2')
__import__('docutils')
setup_dict = dict(
name='regenerate',
version='1.0.0',
license='License.txt',
author='Donald N. Allingham',
author_email='dallingham@gmail.com',
description='Re... | dallingham/regenerate | setup-win.py | Python | gpl-2.0 | 3,108 |
# Copyright 2005 Joe Wreschnig, Michael Urman
#
# 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.
"""
Things that are mor... | ptitjes/quodlibet | quodlibet/qltk/x.py | Python | gpl-2.0 | 16,944 |
#!/usr/bin/env python
#PYTHON 3 only
# Sample Windows Startup check -- Mail alert
# SurvivalAlert v1.0
# By thxer.com
# N-pn.fr Community and Hexpresso CTF team
import os
import socket
import ctypes
import smtplib
#Global Variables
HOSTNAME = str(socket.gethostname())
IPLAN = str(socket.gethostbyname(socket.gethos... | Thx3r/survivalAlertWin | SurvivalAlertWin.py | Python | gpl-2.0 | 2,493 |
"""Node metadata operations"""
import json
import logging
import http.client
from collections import namedtuple
from .common import *
logger = logging.getLogger(__name__)
ChangeSet = namedtuple('Changes', ['nodes', 'purged_nodes', 'checkpoint', 'reset'])
class MetadataMixin(object):
def get_node_list(self, **... | nferch/acd_cli | acdcli/api/metadata.py | Python | gpl-2.0 | 10,176 |
# Generated by h2py from /usr/include/netinet/in.h
_NETINET_IN_H = 1
# Included from features.h
_FEATURES_H = 1
_ISOC95_SOURCE = 1
_ISOC99_SOURCE = 1
_ISOC11_SOURCE = 1
_POSIX_SOURCE = 1
_POSIX_C_SOURCE = 200809L
_XOPEN_SOURCE = 700
_XOPEN_SOURCE_EXTENDED = 1
_LARGEFILE64_SOURCE = 1
_DEFAULT_SOURCE = 1
_BSD_SOURCE = 1... | gautamMalu/rootfs_xen_arndale | usr/lib/python2.7/plat-arm-linux-gnueabihf/IN.py | Python | gpl-2.0 | 15,532 |
from .main import HnsccVisitAdmin, HnsccOffStudyAdmin
from .enrollment_admin import EnrollmentAdmin
from .contemporary_admin import ContemporaryAdmin
# from .historical_admin import HistoricalAdmin
from .hnscc_off_study_model_admin import HnsccOffStudyModelAdmin
| botswana-harvard/bhp065_project | bhp065/apps/hnscc_subject/admin/__init__.py | Python | gpl-2.0 | 263 |
#
# Hello World server in Python
# Binds REP socket to tcp://*:5555
# Expects b"Hello" from client, replies with b"World"
#
import time
import zmq
context = zmq.Context()
socket = context.socket(zmq.REP)
socket.bind("tcp://*:5555")
while True:
# Wait for next request from client
message = socket.recv(... | nasa-nccs-cds/CDAS2 | python/test/helloServer.py | Python | gpl-2.0 | 466 |
# This file is part of MyPaint.
# Imports:
from __future__ import print_function
import subprocess
import glob
import os
import os.path
import sys
import textwrap
from distutils.command.build import build
from distutils.command.clean import clean
from setuptools import setup
from setuptools import Extension
from se... | ShadowKyogre/mypaint | setup.py | Python | gpl-2.0 | 12,625 |
# for localized messages
from . import _
from Screens.Screen import Screen
from Screens.MessageBox import MessageBox
from Screens.ChoiceBox import ChoiceBox
from Components.config import config, configfile, ConfigYesNo, ConfigSubsection
from Components.ActionMap import ActionMap
from Components.Label import Label
from... | Ophiuchus1312/enigma2-master | lib/python/Plugins/Extensions/Infopanel/SwapManager.py | Python | gpl-2.0 | 12,563 |
import pickle
from base64 import b64encode
from pulsar.utils.html import UnicodeMixin
class FieldError(RuntimeError):
pass
def get_field_type(field):
return getattr(field, 'repr_type', 'text')
class Field(UnicodeMixin):
'''Base class of all :mod:`.odm` Fields.
Each field is specified as a :class... | Ghost-script/dyno-chat | kickchat/apps/pulsar/apps/data/odm/fields.py | Python | gpl-2.0 | 12,075 |
import atexit, datetime, os, tempfile, unittest
import common
from autotest_lib.frontend import setup_test_environment
from autotest_lib.frontend import thread_local
from autotest_lib.frontend.afe import models, model_attributes
from autotest_lib.client.common_lib import global_config
from autotest_lib.client.common_li... | ceph/autotest | frontend/afe/frontend_test_utils.py | Python | gpl-2.0 | 7,043 |
#!/usr/bin/python
# Author: Francois-Jose Serra
# Creation Date: 2010/08/17 16:46:02
# easy_install fisher/ if not also in extra stats package
try:
from extra_stats.fisher import pvalue
except ImportError:
from fisher import pvalue
# in my extra_stats package
import sys
sys.path.append('/home/francisco... | marco-mariotti/selenoprofiles | libraries/annotations/fatiscan/gene_set.py | Python | gpl-2.0 | 11,377 |
from Screen import Screen
from ServiceScan import ServiceScan
from Components.config import config, ConfigSubsection, ConfigSelection, \
ConfigYesNo, ConfigInteger, getConfigListEntry, ConfigSlider, ConfigEnableDisable
from Components.ActionMap import NumberActionMap, ActionMap
from Components.Sources.StaticText impor... | idrogeno/IdroMips | lib/python/Screens/ScanSetup.py | Python | gpl-2.0 | 71,927 |
# -*- coding: utf-8 -*-
# message_dialogs.py
# misc Gtk.MessageDialogs
#
# Copyright (C) 2014 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 l... | vojtechtrefny/blivet-gui | blivetgui/dialogs/message_dialogs.py | Python | gpl-2.0 | 8,149 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
'''
@date: 2014-07-02
@author: shell.xu
'''
import os, sys, json, logging
import bottle
from bottle import request, template, redirect
from db import *
logger = logging.getLogger('utils')
app = bottle.default_app()
sess = app.config.get('db.session')
LOGFMT = '%(asctime)s.%(m... | shell909090/sshproxy | web/utils.py | Python | gpl-2.0 | 2,304 |
#!/usr/bin/env python
"""Trigrams assignment"""
import re
import random
test_fragment = """
One night--it was on the twentieth of March, 1888--I was
returning from a journey to a patient (for I had now returned to
civil practice), when my way led me through Baker Street. As I
passed the well-remembered door, which mu... | AmandaMoen/AmandaMoen | students/JasonTyler/trigrams/trigrams.py | Python | gpl-2.0 | 4,256 |
"""init2
Revision ID: 69b85d86968f
Revises: 9f83e778144c
Create Date: 2017-09-25 17:36:03.015859
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '69b85d86968f'
down_revision = '9f83e778144c'
branch_labels = None
depends_on = None
def upgrade():
# ### comm... | ouyangshi/ahpucourses | migrations/versions/69b85d86968f_init2.py | Python | gpl-3.0 | 1,260 |
#!/usr/bin/env python
#
# Copyright 2004,2007,2010 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your ... | RedhawkSDR/integration-gnuhawk | qa/tests/qa_sig_source.py | Python | gpl-3.0 | 6,406 |
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2016-2018 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 ... | elopio/snapcraft | tests/integration/general/test_clean_prime_step.py | Python | gpl-3.0 | 3,431 |
import re
import mimetypes
def validate_markdown_flavour(value):
return value in ('markdown', 'markdown_strict', 'markdown_phpextra',
'markdown_github', 'markdown_mmd', 'commonmark')
def validate_mimetype_image(value):
# Empty string is also valid
if not value:
return True
... | pri22296/yaydoc | modules/scripts/config/validation.py | Python | gpl-3.0 | 626 |
# Case Conductor is a Test Case Management system.
# Copyright (C) 2011 uTest Inc.
#
# This file is part of Case Conductor.
#
# Case Conductor 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... | mozilla/caseconductor-ui | ccui/static/models.py | Python | gpl-3.0 | 2,951 |
from django.http import HttpResponse
from django.template.loader import get_template
from rapp.article.models import Article
from django.views.generic.detail import DetailView
from django.views.generic.list import ListView
def _get_greeting(request):
return request.user.username if request.user.is_authenticated()... | rasmadeus/rasmadeus.ru | rapp/article/views.py | Python | gpl-3.0 | 1,716 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "platy.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| efornal/platy | manage.py | Python | gpl-3.0 | 248 |
"""
Due is a learning, modular, action-oriented dialogue agent. `Agents` are the
entities that can take part in Episodes (:mod:`due.episode`), receiving and
issuing Events (:mod:`due.event`).
"""
import uuid
from abc import ABCMeta, abstractmethod
from datetime import datetime
from due.event import Event
from due impo... | dario-chiappetta/Due | due/agent.py | Python | gpl-3.0 | 7,123 |
# Created By: Virgil Dupras
# Created On: 2009-04-23
# Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
#
# This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
# which should be included with this package. The terms are also available at
# http://www.gnu.org/licenses/gpl-... | hsoft/dupeguru | qt/results_model.py | Python | gpl-3.0 | 3,932 |
#! /usr/bin/python
# -*- coding: utf-8 -*-
#
# This file is part of hopr: https://github.com/hopr/hopr.
#
# Hopr 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 o... | hopr/hopr | script/evlogger.py | Python | gpl-3.0 | 8,419 |
#!/usr/bin/env python3
# This file is part of OpenSoccerManager-Editor.
#
# OpenSoccerManager 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 la... | OpenSoccerManager/opensoccermanager-editor | uigtk/widgets.py | Python | gpl-3.0 | 3,782 |
# -*- coding: utf-8 -*-
#
# Copyright 2015, Foxugly. All rights reserved.
#
# 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 (at
# your option) any late... | Foxugly/medagenda | patient/views.py | Python | gpl-3.0 | 1,514 |
#!/usr/bin/env python3
# ScatterBackup - A chaotic backup solution
# Copyright (C) 2015 Ingo Ruhnke <grumbel@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the... | Grumbel/scatterbackup | tests/test_fileinfo.py | Python | gpl-3.0 | 1,443 |
def verificaPalindrome(frase):
removeWhiteSpaces = [] ### Array util para remover os espaços em brancos
removeHypen = [] ### Array util para remover os hifen
palindromo = str(frase).lower().strip() ### Remove os espaços em brancos no inicio e final e coloca toda a palavra em letra minuscula
if (len(pa... | ysrodrigues/Fund-Prog | AD1-Exerc2.py | Python | gpl-3.0 | 1,948 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Ansible by Red Hat, inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | fxfitz/ansible | lib/ansible/modules/network/junos/junos_config.py | Python | gpl-3.0 | 13,712 |
# Copyright 2016 Casey Jaymes
# This file is part of PySCAP.
#
# PySCAP 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.
#
# PySCAP is ... | cjaymes/pyscap | src/scap/model/xs/ExtensionType.py | Python | gpl-3.0 | 2,037 |
#!/usr/bin/env python
import rospy
import actionlib
from play_motion_msgs.msg import PlayMotionAction, PlayMotionGoal
from sensor_msgs.msg import JointState
if __name__ == "__main__":
rospy.init_node("grasp_demo")
rospy.loginfo("Waiting for play_motion...")
client = actionlib.SimpleActionClient("/play_motion", ... | robosafe/mc-vs-bdi | tiago_simulator/scripts/grasp_demo.py | Python | gpl-3.0 | 1,252 |
#| This file is part of pyCAF. |
#| |
#| pyCAF is free software: you can redistribute it and/or modify |
#| it under the terms of the GNU General Public License as published by |
#| t... | maximeolivier/pyCAF | pycaf/architecture/devices/lists/serverList.py | Python | gpl-3.0 | 2,525 |
"""
This module implements an Ansible plugin that is triggered at the start of a playbook.
The plugin dynamically generates a tag for each role. Each tag has the same name as its role.
The advantage of this is that it saves you some boilerplate, because you don't have to wrap
all tasks of a role in an additional block... | yavdr/yavdr-ansible | plugins/callbacks/auto_tags.py | Python | gpl-3.0 | 1,950 |
#utils
from struct import pack
from struct import unpack
def timestamp_compare(x, y):
if x[1]>y[1]:
return 1
elif x[1]==y[1]:
return 0
else: # x[1]<y[1]
return -1
def reverse_timestamp(x, y):
return y[1]-x[1]
class Note(object):
def note_on(self, note_num, velocity, recom... | avsaj/rtpmidi | rtpmidi/engines/midi/recovery_journal_chapters.py | Python | gpl-3.0 | 27,204 |
import re
from gi.repository import GObject
from pychess.Utils.const import DRAW_OFFER, ABORT_OFFER, ADJOURN_OFFER, TAKEBACK_OFFER, \
PAUSE_OFFER, RESUME_OFFER, SWITCH_OFFER, RESIGNATION, FLAG_CALL, MATCH_OFFER, \
WHITE, ACTION_ERROR_SWITCH_UNDERWAY, ACTION_ERROR_CLOCK_NOT_STARTED, \
ACTION_ERROR_CLOCK_NO... | cajone/pychess | lib/pychess/ic/managers/OfferManager.py | Python | gpl-3.0 | 11,531 |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2018-2019 Matthias Klumpp <matthias@tenstral.net>
#
# Licensed under the GNU Lesser General Public License Version 3
#
# This program 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... | tanglu-org/laniakea | src/lighthouse/lighthouse/events_receiver.py | Python | gpl-3.0 | 3,808 |
#!/usr/bin/python
import numpy as np
import sys
from numpy import *
import matplotlib.pyplot as pyplot
import matplotlib.animation as anim
import h5py
from matplotlib.colors import LogNorm
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import gridspec
import string
# --------------------------------------... | maminian/skewtools | scripts/animate_pipe_flow_byframe_experiment_intensityonly.py | Python | gpl-3.0 | 4,528 |
""" ProxyManager is the implementation of the ProxyManagement service in the DISET framework
.. literalinclude:: ../ConfigTemplate.cfg
:start-after: ##BEGIN ProxyManager:
:end-before: ##END
:dedent: 2
:caption: ProxyManager options
"""
from DIRAC import gLogger, S_OK, S_ERROR
from DIRAC.Cor... | ic-hep/DIRAC | src/DIRAC/FrameworkSystem/Service/ProxyManagerHandler.py | Python | gpl-3.0 | 18,027 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup
setup(
name='mtg-deck-editor',
version='1.0.3',
url='https://github.com/buckket/mtg-deck-editor',
author='buckket',
author_email='buckket@cock.li',
packages=['mtgdeckeditor'],
package_dir={'mtgdeckeditor': 'mtgdec... | buckket/mtg-deck-editor | setup.py | Python | gpl-3.0 | 1,349 |
'''
Created on Feb. 23, 2019
Utility functions to extract data from xarray Dataset or DataArray classes.
@author: Andre R. Erler, GPL v3
'''
from warnings import warn
from datetime import datetime
import os
import numpy as np
import xarray as xr
import netCDF4 as nc
from dask.diagnostics import ProgressBar
# intern... | aerler/HGS-Tools | Python/geospatial/xarray_tools.py | Python | gpl-3.0 | 40,502 |
#!/usr/bin/env python2.7
"""
@package: pyHerkulex
@name: herkulex.py
@author: Achu Wilson (achuwilson@gmail.com), Akhil Chandran (akhilchandran.t.r@gmail.com)
@version: 0.1
This is a python library for interfacing the Herkulex range of smart
servo motors manufactured by Dongbu Robotics.
The library was created by ... | seiji56/rmaze-2016 | logic_code/last_ver/sim/herkulex.py | Python | gpl-3.0 | 23,289 |
#!/usr/bin/env python3
""" Generates a plot and JSON file describing a food web.
Files are stored in a directory named based on the species in the food web.
If --parent-dir is not specified, the parent directory is determined
automatically based on DATA_HOME.
"""
import os
import sys
import argparse
from atntools ... | brsaylor/atn-tools | bin/atn-generate-food-web.py | Python | gpl-3.0 | 3,582 |
from .util import bucket as tokenbucket
from . import wrappers
class Limit(object):
def __init__(self, command_limiting_initial_tokens, command_limiting_message_cost, command_limiting_restore_rate, override, permissions):
"""limit(20, 4, 0.13, ["admin"], {"admin": "user!*@*"})
Limits the use of c... | IndigoTiger/ezzybot | ezzybot/limit.py | Python | gpl-3.0 | 1,649 |
import pytest
import unittest
from unittest import mock
from django.conf import settings
from django.core.management import call_command
from oppia.test import OppiaTestCase
from io import StringIO
from oppia.models import Tracker
class RemoveDuplicateTrackersTest(OppiaTestCase):
fixtures = ['tests/test_user.js... | DigitalCampus/django-oppia | tests/oppia/management/test_remove_duplicate_trackers.py | Python | gpl-3.0 | 2,204 |
#!/usr/bin/env python
# Copyright (C) 2011-2014 Swift Navigation Inc.
# Contact: Fergus Noble <fergus@swift-nav.com>
#
# This source is subject to the license found in the file 'LICENSE' which must
# be be distributed together with this source. All other rights reserved.
#
# THIS CODE AND INFORMATION IS PROVIDED "AS IS... | cbeighley/piksi_firmware | scripts/serial_link.py | Python | gpl-3.0 | 12,191 |
# -*- coding: utf-8 -*-
import os
import re
from django.conf import settings
from django.core import validators
from django.core.exceptions import ValidationError
from django.forms.util import ErrorList
from django.forms.fields import MultiValueField, FilePathField, \
FileField, CharField
from django.utils.transl... | danieljb/django-hybrid-filefield | hybrid_filefield/forms.py | Python | gpl-3.0 | 3,393 |
def xo(s):
s = s.lower()
return s.count('x') == s.count('o')
| VladKha/CodeWars | 7 kyu/Exes and Ohs/solve.py | Python | gpl-3.0 | 69 |
################################################################################
# #
# Copyright (C) 2010,2011,2012,2013,2014, 2015,2016 The ESPResSo project #
# ... | KonradBreitsprecher/espresso | doc/tutorials/06-active_matter/SOLUTIONS/rectification_geometry.py | Python | gpl-3.0 | 5,253 |
'''
Created on 5/03/2014
@author: Alex Montes Barrios
'''
import sys
import os
import Tkinter as tk
import tkMessageBox
import tkFileDialog
import tkSimpleDialog
import ttk
import tkFont
import keyword
import pickle
import re
NORM_PROMPT = '>>> '
CELL_PROMPT = '... '
class PythonEditor(tk.Frame):
def __init__(se... | pybquillast/xkAddonIDE | toRecycle/baseUI.py | Python | gpl-3.0 | 32,423 |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting field 'Profile.mobile_provider'
db.delete_column('user_profiles', 'mobile_provider_id')
... | hzlf/openbroadcast | website/apps/profiles/migrations/0002_auto__del_field_profile_mobile_provider__add_field_profile_description.py | Python | gpl-3.0 | 8,152 |
'''
qobuz.extension.kooli.script.kooli-xbmc-service
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:part_of: kodi-qobuz
:copyright: (c) 2012-2018 by Joachim Basmaison, Cyril Leclerc
:license: GPLv3, see LICENSE for more details.
'''
from os import path as P
import SocketServer
import socket
import... | tidalf/plugin.audio.qobuz | resources/lib/qobuz/extension/kooli/kooli/script/kooli-xbmc-service.py | Python | gpl-3.0 | 4,243 |
"""
Header Unit Class
"""
### INCLUDES ###
import logging
from gate.conversions import round_int
from variable import HeaderVariable
from common import MIN_ALARM, MAX_ALARM
### CONSTANTS ###
## Logger ##
LOGGER = logging.getLogger(__name__)
# LOGGER.setLevel(logging.DEBUG)
### CLASSES ###
class HeaderUnit(Header... | Barmaley13/BA-Software | gate/sleepy_mesh/node/headers/header/unit.py | Python | gpl-3.0 | 5,361 |
# simple binary tree
# in this implementation, a node is inserted between an existing node and the root
class BinaryTree():
def __init__(self,rootid):
self.left = None
self.right = None
self.rootid = rootid
def getLeftChild(self):
return self.left
def getRightChild(self):... | roshantha9/AbstractManycoreSim | src/libApplicationModel/SimpleBinaryTree.py | Python | gpl-3.0 | 2,226 |
import base64
import os
import pytest
import six
from pytest_bdd import parsers, scenarios, then, when
from spud import media, models
scenarios('photos.feature')
@when('we create a photo called <name> using <filename>')
def step_create_photo(session, name, filename, data_files):
url = "/api/photos/"
path ... | brianmay/spud | spud/tests/b_integration/test_photos.py | Python | gpl-3.0 | 3,320 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.