code stringlengths 2 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int32 2 1.05M |
|---|---|---|---|---|---|
import sys
sys.path.insert(0,'../')
from fast_guided_filter import blur
print("hello")
| justayak/fast_guided_filters | test/sample.py | Python | mit | 88 |
# from test_plus.test import TestCase
#
#
# class TestUser(TestCase):
#
# def setUp(self):
# self.user = self.make_user()
#
# def test__str__(self):
# self.assertEqual(
# self.user.__str__(),
# 'testuser' # This is the default username for self.make_user()
# )
#
... | Alex-Just/gymlog | gymlog/main/tests/test_models.py | Python | mit | 476 |
from rest_framework import serializers
from django.contrib.auth.models import User
from dixit.account.models import UserProfile
class UserProfileSerializer(serializers.ModelSerializer):
class Meta:
model = UserProfile
fields = ('name', )
class UserSerializer(serializers.ModelSerializer):
... | jminuscula/dixit-online | server/src/dixit/api/auth/serializers/user.py | Python | mit | 494 |
# -*- coding: utf-8 -*-
import pack_command
import pack_command_python
import timeit
import cProfile
import pstats
import pycallgraph
def format_time(seconds):
v = seconds
if v * 1000 * 1000 * 1000 < 1000:
scale = u'ns'
v = int(round(v*1000*1000*1000))
elif v * 1000 * 1000 < 1000:
... | simonz05/pack-command | misc/bench.py | Python | mit | 1,564 |
"""
Initialize Flask app
"""
from flask import Flask
import os
from flask_debugtoolbar import DebugToolbarExtension
from werkzeug.debug import DebuggedApplication
app = Flask('application')
if os.getenv('FLASK_CONF') == 'DEV':
# Development settings
app.config.from_object('application.settings.Development')
... | nwinter/bantling | src/application/__init__.py | Python | mit | 1,104 |
#!/usr/bin/env python
import os
import sys
import django
from django.conf import settings
DEFAULT_SETTINGS = dict(
INSTALLED_APPS=[
"django.contrib.auth",
"django.contrib.contenttypes",
"django.contrib.sites",
"pinax.pinax_hello",
"pinax.pinax_hello.tests"
],
MIDD... | bennybauer/pinax-hello | runtests.py | Python | mit | 1,274 |
import random
import numpy as np
import math
from time import perf_counter
import os
import sys
from collections import deque
import gym
import cntk
from cntk.layers import Convolution, MaxPooling, Dense
from cntk.models import Sequential, LayerStack
from cntk.initializer import glorot_normal
env = gym.make("Break... | tuzzer/ai-gym | atari_breakout/atari_breakout_dqn_cntk.py | Python | mit | 11,222 |
the_count = [1, 2, 3, 4, 5]
fruits = ['apple', 'oranges', 'pears', 'apricots',]
change = [1, 'pennies', 2, 'dimes', 3, 'quarters',]
#this first kind of for-loop goes through a list
for number in the_count:
print("This is count %d" % number)
# same as above
for fruit in fruits:
print("A fruit of type: %s" % fr... | sunrin92/LearnPython | 1-lpthw/ex32.py | Python | mit | 812 |
"""adding timestamps to all tables
Revision ID: c0a714ade734
Revises: 1a886e694fca
Create Date: 2016-04-20 14:46:06.407765
"""
# revision identifiers, used by Alembic.
revision = 'c0a714ade734'
down_revision = '1a886e694fca'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
def ... | fedspendingtransparency/data-act-validator | dataactvalidator/migrations/versions/c0a714ade734_adding_timestamps_to_all_tables.py | Python | cc0-1.0 | 3,174 |
from cStringIO import StringIO
from struct import pack, unpack, error as StructError
from .log import log
from .structures import fields
class DBFile(object):
"""
Base class for WDB and DBC files
"""
@classmethod
def open(cls, file, build, structure, environment):
if isinstance(file, basestring):
file = op... | jleclanche/pywow | wdbc/main.py | Python | cc0-1.0 | 10,011 |
# -*- coding: utf-8 -*-
#
# Phaser Editor documentation build configuration file, created by
# sphinx-quickstart on Thu May 25 08:35:14 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.... | boniatillo-com/PhaserEditor | docs/v2/conf.py | Python | epl-1.0 | 4,869 |
# -*- coding: utf-8 -*-
"""
***************************************************************************
SplitRGBBands.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
*************************... | camptocamp/QGIS | python/plugins/processing/saga/SplitRGBBands.py | Python | gpl-2.0 | 3,715 |
#!/usr/bin/python2.3
# This is the short name of the plugin, used as the menu item
# for the plugin.
# If not specified, the name of the file will be used.
shortname = "Moment Curve layout (Cohen et al. 1995)"
# This is the long name of the plugin, used as the menu note
# for the plugin.
# If not specified, the short ... | ulethHCI/GLuskap | plugins/moment_curve.py | Python | gpl-2.0 | 3,644 |
# -*- coding: utf-8 -*-
# ..#######.########.#######.##....#..######..######.########....###...########.#######.########..######.
# .##.....#.##.....#.##......###...#.##....#.##....#.##.....#...##.##..##.....#.##......##.....#.##....##
# .##.....#.##.....#.##......####..#.##......##......##.....#..##...##.##.....#.... | repotvsupertuga/tvsupertuga.repository | script.module.openscrapers/lib/openscrapers/sources_openscrapers/en/coolmoviezone.py | Python | gpl-2.0 | 2,749 |
'''
Ohm's law is a simple equation describing electrical circuits. It
states that the voltage V through a resistor is equal to the current
(I) times the resistance:
V = I * R
The units of these are volts, ampheres (or "amps"), and ohms,
respectively. In real circuits, often R is actually measured in
kiloohms (10**3 o... | ketan-analytics/learnpython | Safaribookonline-Python/courseware-btb/solutions/py3/patterns/properties_extra.py | Python | gpl-2.0 | 2,255 |
# coding=utf-8
# ---------------------------------------------------------------
# Desenvolvedor: Arannã Sousa Santos
# Mês: 12
# Ano: 2015
# Projeto: pagseguro_xml
# e-mail: asousas@live.com
# ---------------------------------------------------------------
import loggin... | arannasousa/pagseguro_xml | exemplos/testes_notificacao.py | Python | gpl-2.0 | 1,090 |
#
#
# (C) Copyright 2001 The Internet (Aust) Pty Ltd
# ACN: 082 081 472 ABN: 83 082 081 472
# All Rights Reserved
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A ... | denys-duchier/Scolar | ZopeProducts/exUserFolder/Plugins.py | Python | gpl-2.0 | 1,784 |
#!/usr/bin/python
"feed fetcher"
from db import MySQLDatabase
from fetcher import FeedFetcher
def main():
db = MySQLDatabase()
fetcher = FeedFetcher()
feeds = db.get_feeds(offset=0, limit=10)
read_count = 10
while len(feeds) > 0:
for feed in feeds:
fid = feed[0]
ur... | hylom/grrreader | backend/feedfetcher.py | Python | gpl-2.0 | 889 |
# จงเขียนโปรแกรมแสดงเลขคู่ในช่วง 0 ถึง 10 (รวม 10 ด้วย)
for i in range(11):
if (i % 2 == 0):
print(i) | supasate/word_prediction | Chapter4/4-7-even-solution.py | Python | gpl-2.0 | 193 |
#!/usr/bin/env python
import math
fin = open('figs/single-rod-in-water.dat', 'r')
fout = open('figs/single-rods-calculated-density.dat', 'w')
kB = 3.16681539628059e-6 # This is Boltzmann's constant in Hartree/Kelvin
first = 1
nm = 18.8972613
for line in fin:
current = str(line)
pieces = current.split('\t')... | droundy/deft | papers/hughes-saft/figs/density_calc.py | Python | gpl-2.0 | 986 |
import win32pipe
import win32console
import win32process
import time
import win32con
import codecs
import ctypes
user32 = ctypes.windll.user32
CONQUE_WINDOWS_VK = {
'3' : win32con.VK_CANCEL,
'8' : win32con.VK_BACK,
'9' : win32con.VK_TAB,
'12' : win32con.VK_CLEAR,
'13' : win32con.V... | viswimmer1/PythonGenerator | data/python_files/34574373/cmss.py | Python | gpl-2.0 | 2,623 |
import urllib2
import appuifw, e32
from key_codes import *
class Drinker(object):
def __init__(self):
self.id = 0
self.name = ""
self.prom = 0.0
self.idle = ""
self.drinks = 0
def get_drinker_list():
data = urllib2.urlopen("http://192.168.11.5:8080/drinkcounter/get_da... | deggis/drinkcounter | clients/s60-python/client.py | Python | gpl-2.0 | 1,757 |
from config import config, ConfigSlider, ConfigSelection, ConfigYesNo, \
ConfigEnableDisable, ConfigSubsection, ConfigBoolean, ConfigSelectionNumber, ConfigNothing, NoSave
from enigma import eAVSwitch, getDesktop
from SystemInfo import SystemInfo
from os import path as os_path
class AVSwitch:
def setInput(self, inpu... | eesatfan/vuplus-enigma2 | lib/python/Components/AVSwitch.py | Python | gpl-2.0 | 7,088 |
import sys
import time
import logging
from socketio import socketio_manage
from socketio.mixins import BroadcastMixin
from socketio.namespace import BaseNamespace
from DataAggregation.webdata_aggregator import getAvailableWorkshops
logger = logging.getLogger(__name__)
std_out_logger = logging.StreamHandler(sys.stdo... | ARL-UTEP-OC/emubox | workshop-manager/bin/RequestHandler/client_updater.py | Python | gpl-2.0 | 2,004 |
def freq_month(obj):
if obj is None or obj == []:
return
months = {1: 'jan',
2: 'feb',
3: 'mar',
4: 'apr',
5: 'may',
6: 'jun',
7: 'jul',
8: 'aug',
9: 'sep',
10: 'oct',
... | bluciam/ruby_versus_python | other/dicco_numbers.py | Python | gpl-2.0 | 857 |
# -*- coding: utf-8 -*-
#
# pynag - Python Nagios plug-in and configuration environment
# Copyright (C) 2010 Drew Stinnet
#
# 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 th... | kaji-project/pynag | pynag/Parsers/__init__.py | Python | gpl-2.0 | 129,457 |
#!/usr/bin/env python
import unittest
from werkzeug.exceptions import NotFound, Forbidden
from tests.logic_t.layer.LogicLayer.util import generate_ll
class TaskPrioritizeBeforeLogicLayerTest(unittest.TestCase):
def setUp(self):
self.ll = generate_ll()
self.pl = self.ll.pl
def test_add_prio... | izrik/tudor | tests/logic_t/layer/LogicLayer/test_task_prioritize.py | Python | gpl-2.0 | 36,403 |
import os
from collections import OrderedDict
from .sqldatabase import SqlDatabase
from .retrieve_core_info import retrieveCoreInfo
# Root class that all SQL table updaters derive from
class SqlTableUpdater():
def __init__(self, tableName, tableColumns=[], coreInfo={}):
self.tableName = tableName
... | team-phoenix/Phoenix | frontend/python/updaters/sqlTableUpdater.py | Python | gpl-2.0 | 50,004 |
# accounts/authentication.py
import requests
import logging
from django.conf import settings
from django.contrib.auth import get_user_model
logger = logging.getLogger(__name__)
User = get_user_model()
PERSONA_VERIFY_URL = 'https://verifier.login.persona.org/verify'
#DOMAIN = 'localhost'
#DOMAIN = 'http://hotzenplot... | thomec/tango | accounts/authentication.py | Python | gpl-2.0 | 1,296 |
import os
import sys
import subprocess
testP = {
"2005": [
{
"date": "2005-10-17",
"videos": [
"http://thecolbertreport.cc.com/videos/61f6xj/intro---10-17-05",
"http://thecolbertreport.cc.com/videos/w9dr6d/first-show",
"http://thecolbertreport.cc.com/videos/63ite2/the-word---t... | traltixx/pycolbert | pycolbert.py | Python | gpl-2.0 | 853,594 |
# -*- coding: utf-8 -*-
import random
from operator import attrgetter
import pytest
from cfme import test_requirements
from cfme.cloud.provider import CloudProvider
from cfme.cloud.provider.azure import AzureProvider
from cfme.cloud.provider.ec2 import EC2Provider
from cfme.cloud.provider.gce import GCEProvider
from... | anurag03/integration_tests | cfme/tests/candu/test_utilization_metrics.py | Python | gpl-2.0 | 8,879 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2016-2017 University of Dundee & Open Microscopy Environment.
# All Rights Reserved.
# Use is subject to license terms supplied in LICENSE.txt
#
import requests
from Parse_OMERO_Properties import USERNAME, PASSWORD, OMERO_WEB_HOST, \
... | jburel/openmicroscopy | examples/Training/python/Json_Api/Login.py | Python | gpl-2.0 | 3,163 |
#python imports
import sys
import os
import time
import datetime
import subprocess
import json
import requests
from termcolor import colored
#third-party imports
#No third-party imports
#programmer generated imports
from logger import logger
from fileio import fileio
'''
***BEGIN DESCRIPTION***
Type: Search - Descri... | slaughterjames/static | modules/malware_bazaar_search.py | Python | gpl-2.0 | 5,588 |
# BurnMan - a lower mantle toolkit
# Copyright (C) 2012-2014, Myhill, R., Heister, T., Unterborn, C., Rose, I. and Cottaar, S.
# Released under GPL v2 or later.
# This is a standalone program that converts a tabulated version of the Stixrude and Lithgow-Bertelloni data format into the standard burnman format (printed ... | QuLogic/burnman | burnman/data/input_raw_endmember_datasets/HHPH2013data_to_burnman.py | Python | gpl-2.0 | 3,130 |
# -*- encoding: utf-8 -*-
try:
from httplib import HTTPSConnection
from urlparse import urlparse
except ImportError:
from http.client import HTTPSConnection
from urllib.parse import urlparse
from json import dumps, loads
from django.conf import settings
class GCMError(Exception):
pass
def send... | LPgenerator/django-db-mailer | dbmail/providers/google/android.py | Python | gpl-2.0 | 1,265 |
#-------------------------------------------------------------------------------
# Name: module1
# Purpose:
#
# Author: Eli
#
# Created: 06/04/2014
# Copyright: (c) Eli 2014
# Licence: <your licence>
#-------------------------------------------------------------------------------
def m... | ejspina/Gene_expression_tools | Python/FilterByID_dict_parse.py | Python | gpl-2.0 | 7,098 |
from __future__ import print_function
"""
Deprecated. Use ``update-tld-names`` command instead.
"""
__title__ = 'tld.update'
__author__ = 'Artur Barseghyan'
__copyright__ = '2013-2015 Artur Barseghyan'
__license__ = 'GPL 2.0/LGPL 2.1'
from tld.utils import update_tld_names
_ = lambda x: x
if __name__ == '__main__'... | underdogio/tld | src/tld/update.py | Python | gpl-2.0 | 414 |
## See "d_bankfull" in update_flow_depth() ######## (2/21/13)
## See "(5/13/10)" for a temporary fix.
#------------------------------------------------------------------------
# Copyright (c) 2001-2014, Scott D. Peckham
#
# Sep 2014. Wrote new update_diversions().
# New standard names and BMI updates ... | mperignon/component_creator | topoflow_creator/topoflow/channels_base.py | Python | gpl-2.0 | 124,876 |
from django.db import models
from django.contrib.auth.models import User
class OrganisationType(models.Model):
type_desc = models.CharField(max_length=200)
def __unicode__(self):
return self.type_desc
class Address(models.Model):
street_address = models.CharField(max_length=100)
city = model... | saloni10/librehatti_new | src/authentication/models.py | Python | gpl-2.0 | 1,479 |
## Copyright (C) 2007-2012 Red Hat, Inc., Bryn M. Reeves <bmr@redhat.com>
### This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the License, or
## (at your option) any later ve... | portante/sosreport | sos/plugins/sysvipc.py | Python | gpl-2.0 | 1,199 |
from buildbot.status.web.auth import IAuth
class Authz(object):
"""Decide who can do what."""
knownActions = [
# If you add a new action here, be sure to also update the documentation
# at docs/cfg-statustargets.texinfo
'gracefulShutdown',
'forceBuild',
'forceAllBui... | centrumholdings/buildbot | buildbot/status/web/authz.py | Python | gpl-2.0 | 2,513 |
#! /usr/bin/env python
# encoding: UTF-8
'''give access permission for files in this folder'''
| anandkp92/waf | gui/__init__.py | Python | gpl-2.0 | 96 |
#!/usr/bin/env python
# **********************************************************************
#
# Copyright (c) 2003-2011 ZeroC, Inc. All rights reserved.
#
# This copy of Ice is licensed to you under the terms described in the
# ICE_LICENSE file included in this distribution.
#
# *************************************... | joshmoore/zeroc-ice | py/test/Ice/faultTolerance/Client.py | Python | gpl-2.0 | 1,608 |
# Copyright 2014-2017 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 version.
#
# This program is distributed in... | EdDev/vdsm | lib/vdsm/v2v.py | Python | gpl-2.0 | 48,122 |
# Endpoints for user to control the home.
from datetime import datetime
from flask import Blueprint, jsonify, request
from services import elements_services, home_services
home_api = Blueprint('/home_api', __name__)
elements_services = elements_services.ElementsServices()
home_services = home_services.HomeServices()... | igrlas/CentralHub | CHPackage/src/centralhub/server/home_endpoints.py | Python | gpl-2.0 | 1,856 |
# -*- coding: utf-8 -*-
import time
import EafIO
import warnings
class Eaf:
"""Read and write Elan's Eaf files.
.. note:: All times are in milliseconds and can't have decimals.
:var dict annotation_document: Annotation document TAG entries.
:var dict licences: Licences included in the file.
:va... | acuriel/Nixtla | nixtla/core/tools/pympi/Elan.py | Python | gpl-2.0 | 33,330 |
import configparser
CONFIG_PATH = 'accounting.conf'
class MyConfigParser():
def __init__(self, config_path=CONFIG_PATH):
self.config = configparser.ConfigParser(allow_no_value=True)
self.config.read(config_path)
def config_section_map(self, section):
""" returns all configuration op... | Stiliyan92/accounting-system | common/config_parser.py | Python | gpl-2.0 | 828 |
#!/usr/bin/env python3
import sys
import numpy as np
from spc import SPC
import matplotlib.pyplot as plt
def plot(files, fac=1.0):
for f in files:
if f.split('.')[-1] == 'xy':
td = np.loadtxt(f)
plt.plot(td[:, 0], np.log(1. / td[:, 1]) * fac, label=f)
elif f.split('.')[-1]... | JHeimdal/HalIR | Test/plotf.py | Python | gpl-2.0 | 564 |
#!/usr/bin/env python
## tumblrserv.py implements a Tumblr (http://www.tumblr.com) markup parsing
## engine and compatible webserver.
##
## Version: 0.2 final
##
## Copyright (C) 2009 Jeremy Herbert
## Contact mailto:jeremy@jeremyherbert.net
##
## This program is free software; you can redistribute i... | jeremyherbert/TumblrServ | tumblrserv.py | Python | gpl-2.0 | 3,373 |
field_dict={'ROME-FIELD-01':[ 267.835895375 , -30.0608178195 , '17:51:20.6149','-30:03:38.9442' ],
'ROME-FIELD-02':[ 269.636745458 , -27.9782661111 , '17:58:32.8189','-27:58:41.758' ],
'ROME-FIELD-03':[ 268.000049542 , -28.8195573333 , '17:52:00.0119','-28:49:10.4064' ],
'ROME-FIE... | ytsapras/robonet_site | scripts/rome_fields_dict.py | Python | gpl-2.0 | 1,964 |
# -*- coding: utf-8 -*-
from scrapy.spider import Spider
from scrapy.selector import Selector
from kgrants.items import KgrantsItem
from scrapy.http import Request
import time
class GrantsSpider(Spider):
name = "grants"
allowed_domains = ["www.knightfoundation.org"]
pages = 1
base_url = 'http://www.k... | poderomedia/kfdata | kgrants/spiders/grants.py | Python | gpl-2.0 | 3,682 |
from sys import argv
script, input_file = argv
def print_all(f):
print f.read()
def rewind(f):
f.seek(0)
def print_a_line(line_count, f):
print line_count, f.readline()
current_file = open(input_file)
print "First let's print the whole file:\n"
print_all(current_file)
print "Now let's rewind, kind o... | maxiee/LearnPythonTheHardWayExercises | ex20.py | Python | gpl-2.0 | 601 |
# -*- coding: UTF-8 -*-
#/*
# * Copyright (C) 2011 Ivo Brhel
# *
# *
# * 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, or (at your option)
# * any later version.
#... | kodi-czsk/plugin.video.hejbejse.tv | resources/lib/hejbejse.py | Python | gpl-2.0 | 2,611 |
import socket
import threading
import time
def tcplink(sock, addr):
print 'Accept new connection from %s:%s...' % addr
sock.send('Welcome!')
while True:
data = sock.recv(1024)
time.sleep(1)
if data == 'exit' or not data:
break
sock.send('Hello, %s!' %... | lovekun/Notebook | python/chatroomServer.py | Python | gpl-2.0 | 654 |
import os
import sys
import shutil
import binascii
import traceback
import subprocess
from win32com.client import Dispatch
LAUNCHER_PATH = "C:\\Program Files\\Augur"
DATA_PATH = os.path.join(os.path.expanduser('~'), 'AppData', 'Roaming', "Augur")
PASSFILE = os.path.join(DATA_PATH, "password.txt")
if getattr(sys, 'fro... | AugurProject/augur-launcher | Augur Installer.py | Python | gpl-2.0 | 2,932 |
import unittest
from libs.funcs import *
class TestFuncs(unittest.TestCase):
def test_buildPaths(self):
recPaths, repPaths, rouPaths, corePaths = buildPaths()
findTxt = lambda x, y: x.find(y) > -1
assert findTxt(recPaths["Task"][0], "base")
assert findTxt(recPaths["Department"][0... | ancho85/pylint-playero-plugin | tests/test_funcs.py | Python | gpl-2.0 | 3,850 |
# -*- coding: utf-8 -*-
def outfit():
collection = []
for _ in range(0, 5):
collection.append("Item{}".format(_))
return {
"data": collection,
}
api = [
('/outfit', 'outfit', outfit),
]
| Drachenfels/Game-yolo-archer | server/api/outfits.py | Python | gpl-2.0 | 228 |
import os
import unittest
import tempfile
from git import Repo
from oeqa.utils.commands import get_bb_var
from oe.buildhistory_analysis import blob_to_dict, compare_dict_blobs
class TestBlobParsing(unittest.TestCase):
def setUp(self):
import time
self.repo_path = tempfile.mkdtemp(prefix='selftest-... | schleichdi2/OPENNFR-6.1-CORE | opennfr-openembedded-core/meta/lib/oeqa/selftest/oelib/buildhistory.py | Python | gpl-2.0 | 3,191 |
# -*- coding: utf-8 -*-
#
# Picard, the next-generation MusicBrainz tagger
# Copyright (C) 2006 Lukáš Lalinský
#
# 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... | samj1912/picard | picard/ui/options/__init__.py | Python | gpl-2.0 | 3,282 |
#!/usr/bin/python
# -*- encoding: utf-8; py-indent-offset: 4 -*-
# +------------------------------------------------------------------+
# | ____ _ _ __ __ _ __ |
# | / ___| |__ ___ ___| | __ | \/ | |/ / |
# | | | | '_ \ / _ \/ __| |/ /... | xorpaul/check_mk | web/htdocs/default_permissions.py | Python | gpl-2.0 | 7,863 |
import tkinter
FRAME_BORDER = 5
class PageView(object):
__root = None
bd = None
def __init__(self, root=None, main_frame=None):
param = self.params()
if root is None:
# standalone
self.__root = tkinter.Tk()
self.__root.title(param['title'])
... | sora7/listparse | src/listparse/ui/common.py | Python | gpl-2.0 | 2,865 |
import os, socket, sys, urllib
from wx.lib.embeddedimage import PyEmbeddedImage
ldc_name = "Live Debian Creator"
ldc_cli_version = "1.4.0"
ldc_gui_version = "1.11.0"
if (sys.platform == "win32"):
slash = "\\"
if os.path.isfile(sys.path[0]): #fix for compiled binaries
homepath = os.path.dirname(sys.pa... | godaigroup/livedebiancreator | prefs.py | Python | gpl-2.0 | 2,733 |
# encoding: utf-8
# module PyKDE4.kdeui
# from /usr/lib/python3/dist-packages/PyKDE4/kdeui.cpython-34m-x86_64-linux-gnu.so
# by generator 1.135
# no doc
# imports
import PyKDE4.kdecore as __PyKDE4_kdecore
import PyQt4.QtCore as __PyQt4_QtCore
import PyQt4.QtGui as __PyQt4_QtGui
import PyQt4.QtSvg as __PyQt4_QtSvg
cl... | ProfessorX/Config | .PyCharm30/system/python_stubs/-1247971765/PyKDE4/kdeui/KPassivePopupMessageHandler.py | Python | gpl-2.0 | 584 |
#!/usr/bin/python
#CHANGE ONLY, IF YOU KNOW, WHAT YOU DO!
#OPKMANAGER WILL CRASH IF YOUR OUTPUT IS INVALID!
import subprocess
import argparse
import time
import calendar
import string
import sys
class RegisterAction(argparse.Action):
def __call__(self, parser, namespace, values, option_string=None):
print "Official... | theZiz/OPKManager | repositories/official.py | Python | gpl-2.0 | 3,617 |
#!/usr/bin/env python
####################################
#
# --- TEXTPATGEN TEMPLATE ---
#
# Users can change the output by editing
# this file directly.
#
####################################
import sys
sys.stdout.write('####################################\n')
sys.stdout.write('#\n')
sys.stdout.write('# -- TEXTP... | kevinleake01/textpatgen | 12-workspace-py/tpl-py-0001.py | Python | gpl-2.0 | 774 |
from .. import config
from .. import fixtures
from ..assertions import eq_
from ..assertions import in_
from ..schema import Column
from ..schema import Table
from ... import bindparam
from ... import case
from ... import Computed
from ... import exists
from ... import false
from ... import func
from ... import Integer... | gltn/stdm | stdm/third_party/sqlalchemy/testing/suite/test_select.py | Python | gpl-2.0 | 24,377 |
# encoding: utf-8
#
# Copyright 2017 University of Oslo, Norway
#
# This file is part of Cerebrum.
#
# Cerebrum 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 op... | unioslo/cerebrum | Cerebrum/modules/event_publisher/event.py | Python | gpl-2.0 | 11,579 |
# -*- coding: utf-8 -*-
from utils import *
commands = [
'^remindme',
'^reminder',
'^remind$',
'^r '
]
parameters = (
('delay', True),
('message', True),
)
description = 'Set a reminder for yourself. First argument is delay until you wish to be reminded.\nExample: `' + config['... | shahabsaf1/Python | plugins/reminders.py | Python | gpl-2.0 | 2,643 |
#
# Walldo - A wallpaper downloader
# Copyright (C) 2012 Fernando Castillo
#
# 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 v... | skibyte/walldo | walldo/parsertestcase.py | Python | gpl-2.0 | 1,409 |
"""
SALTS XBMC Addon
Copyright (C) 2015 tknorris
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.
T... | azumimuo/family-xbmc-addon | plugin.video.salts/salts_lib/kodi.py | Python | gpl-2.0 | 4,540 |
# -*- coding: utf-8 -*-
#
# HnTool rules - php
# Copyright (C) 2009-2010 Candido Vieira <cvieira.br@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 Lic... | hdoria/HnTool | HnTool/modules/php.py | Python | gpl-2.0 | 4,760 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# progreso.py
#
# Copyright 2010 Jesús Hómez <jesus@jesus-laptop>
#
# 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; ... | jehomez/pymeadmin | progreso.py | Python | gpl-2.0 | 3,388 |
import unittest
from pyxt.mda import *
from pyxt.chargen import CharacterGeneratorMock
class MDATests(unittest.TestCase):
def setUp(self):
self.cg = CharacterGeneratorMock(width = 9, height = 14)
self.mda = MonochromeDisplayAdapter(self.cg)
# Hijack reset so it doesn't call into P... | astamp/PyXT | pyxt/tests/test_mda.py | Python | gpl-2.0 | 5,655 |
import urllib2
def sumaDos():
print 10*20
def division(a,b):
result=a/b
print result
def areatriangulo(base,altura):
result2=(base*altura)/2
print result2
def cast():
lista=[1,2,3,"hola"]
tupla=(1,2,3)
diccinario={"key1":"Diego","key2":"Piqui","key3":"Chuy"}
for k,v in diccionar... | DiegoBalandran/prueba | archivo.py | Python | gpl-2.0 | 1,301 |
"""Module computes indentation for block
It contains implementation of indenters, which are supported by katepart xml files
"""
import logging
logger = logging.getLogger('qutepart')
from PyQt4.QtGui import QTextCursor
def _getSmartIndenter(indenterName, qpart, indenter):
"""Get indenter by name.
Available... | amirgeva/coide | qutepart/indenter/__init__.py | Python | gpl-2.0 | 8,924 |
'''Manual check (not a discoverable unit test) for the key import,
to identify problems with gnupg, gpg, gpg1, gpg2 and so on'''
import os
import shutil
from gnupg import GPG
def setup_keyring(keyring_name):
'''Setup the keyring'''
keyring_path = os.path.join("test", "outputdata", keyring_name)
# Delet... | activityworkshop/Murmeli | test/check_key_import.py | Python | gpl-2.0 | 1,429 |
#!/usr/bin/python
"""
Since functions are function instances you can wrap them
Allow you to
- modify arguments
- modify function
- modify results
"""
call_count = 0
def count(func):
def wrapper(*args, **kw):
global call_count
call_count += 1
return func(*args, **kw)
return wrapper
def ... | hiteshagrawal/python | generator-decorator/decorator.py | Python | gpl-2.0 | 4,681 |
my_inf = float('Inf')
print 99999999 > my_inf
# False
my_neg_inf = float('-Inf')
print my_neg_inf < -99999999
# True
| jabbalaci/PrimCom | data/python/infinity.py | Python | gpl-2.0 | 118 |
import xml.etree.ElementTree as ET
import requests
from flask import Flask
import batalha
import pokemon
import ataque
class Cliente:
def __init__(self, execute = False, ip = '127.0.0.1', port = 5000, npc = False):
self.ip = ip
self.port = port
self.npc = npc
if (execute):
self.iniciaBatalha()
def writ... | QuartetoFantastico/projetoPokemon | cliente.py | Python | gpl-2.0 | 6,564 |
# -*- coding: utf-8 -*-
"""
nidaba.plugins.leptonica
~~~~~~~~~~~~~~~~~~~~~~~~
Plugin accessing `leptonica <http://leptonica.com>`_ functions.
This plugin requires a liblept shared object in the current library search
path. On Debian-based systems it can be installed using apt-get
.. code-block:: console
# apt-g... | OpenPhilology/nidaba | nidaba/plugins/leptonica.py | Python | gpl-2.0 | 8,246 |
# -*- coding: utf-8 -*-
#
from rest_framework import viewsets
from rest_framework.decorators import action
from rest_framework.exceptions import MethodNotAllowed
from rest_framework.response import Response
from common.const.http import POST, PUT
from common.mixins.api import CommonApiMixin
from common.permissions im... | skyoo/jumpserver | apps/tickets/api/ticket.py | Python | gpl-2.0 | 2,796 |
import FWCore.ParameterSet.Config as cms
maxEvents = cms.untracked.PSet( input = cms.untracked.int32(-1) )
readFiles = cms.untracked.vstring()
secFiles = cms.untracked.vstring()
source = cms.Source ("PoolSource",fileNames = readFiles, secondaryFileNames = secFiles)
readFiles.extend( [
'/store/mc/Spring14miniao... | pfs/CSA14 | python/csa14/QCD_80_120_MuEnriched_pythia8_cfi.py | Python | gpl-2.0 | 5,943 |
#
# bootloader_advanced.py: gui advanced bootloader configuration dialog
#
# Jeremy Katz <katzj@redhat.com>
#
# Copyright 2001-2002 Red Hat, Inc.
#
# This software may be freely redistributed under the terms of the GNU
# library public license.
#
# You should have received a copy of the GNU Library Public License
# alo... | sergey-senozhatsky/anaconda-11-vlan-support | iw/bootloader_advanced_gui.py | Python | gpl-2.0 | 3,639 |
#!/usr/bin/env python
# **********************************************************************
#
# Copyright (c) 2003-2011 ZeroC, Inc. All rights reserved.
#
# This copy of Ice is licensed to you under the terms described in the
# ICE_LICENSE file included in this distribution.
#
# *************************************... | joshmoore/zeroc-ice | cpp/test/Freeze/dbmap/run.py | Python | gpl-2.0 | 1,137 |
#!/usr/bin/python
import os
import sys
import re
# file name unified by the following rule:
# 1. always save the osm under ../osmFiles directory
# 2. the result automatically generate to ../trajectorySets
# 3.1. change variable "osmName", or
# 3.2. use command argument to specify osm file name
# 4. this script genera... | nesl/mercury | Services/Mapping/fixProgram/script.py | Python | gpl-2.0 | 1,925 |
# OpenSSL is more stable then ssl
# but OpenSSL is different then ssl, so need a wrapper
import sys
import os
import OpenSSL
SSLError = OpenSSL.SSL.WantReadError
import select
import time
import socket
import logging
ssl_version = ''
class SSLConnection(object):
"""OpenSSL Connection Wrapper"""
def __ini... | lichuan261/wuand | XX-Net/goagent/3.1.49/local/openssl_wrap.py | Python | gpl-2.0 | 4,813 |
import json
import bottle
from pyrouted.util import make_spec
def route(method, path):
def decorator(f):
f.http_route = path
f.http_method = method
return f
return decorator
class APIv1(object):
prefix = '/v1'
def __init__(self, ndb, config):
self.ndb = ndb
... | svinota/pyrouted | pyrouted/api.py | Python | gpl-2.0 | 2,803 |
import sys,os
#sys.path.append(os.path.join(os.path.dirname(__file__), '../../..'))
#from ethosgame.ethos.level import Level
from ..level import Level
#from ethosgame.ethos.gameobject import GameObject
from ..gameobject import GameObject
#from ethosgame.ethos.drawnobject import DrawnObject
from ..drawnobject import Dra... | Berulacks/ethosgame | ethos/levels/level0.py | Python | gpl-2.0 | 2,904 |
from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', views.map, name='map'),
url(r'^mapSim', views.mapSim, name='mapSim'),
url(r'^api/getPos', views.getPos, name='getPos'),
url(r'^api/getProjAndPos', views.getProjAndPos, name='getProjAndPos'),
]
| j-herrera/icarus | icarus_site/ISStrace/urls.py | Python | gpl-2.0 | 279 |
# -*- coding: utf-8 -*-
#
from rest_framework import viewsets
from rest_framework.exceptions import ValidationError
from django.db import transaction
from django.utils.translation import ugettext as _
from django.conf import settings
from orgs.mixins.api import RootOrgViewMixin
from common.permissions import IsValidUs... | zsjohny/jumpserver | apps/ops/api/command.py | Python | gpl-2.0 | 2,150 |
# -*- coding: utf-8 -*-
"""
Created on Tue May 28 12:20:59 2013
=== MAYAXES (v1.1) ===
Generates a set of MayaVI axes using the mayavi.mlab.axes() object with a
white background, small black text and a centred title. Designed to better
mimic MATLAB style plots.
Unspecified arguments will be set to default values... | Nate28/mayaxes | mayaxes.py | Python | gpl-2.0 | 6,007 |
#!/usr/bin/env python
#
# Copyright (C) 2007 Sascha Peilicke <sasch.pe@gmx.de>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later ... | saschpe/gnome_picross | gnomepicross/game.py | Python | gpl-2.0 | 5,836 |
# ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistribu... | ajhager/copycat | lib/pyglet/window/__init__.py | Python | gpl-2.0 | 65,226 |
# plugins module for amsn2
"""
Plugins with amsn2 will be a subclass of the aMSNPlugin() class.
When this module is initially imported it should load the plugins from the last session. Done in the init() proc.
Then the GUI should call plugins.loadPlugin(name) or plugins.unLoadPlugin(name) in order to deal with plugins.... | amsn/amsn2 | amsn2/plugins/core.py | Python | gpl-2.0 | 2,184 |
#! /usr/bin/env python
from __future__ import print_function
import StringIO
import os
import os.path
import errno
import sqlite3
from nose.tools import *
import smadata2.db
import smadata2.db.mock
from smadata2 import check
def removef(filename):
try:
os.remove(filename)
except OSError as e:
... | NobodysNightmare/python-smadata2 | smadata2/db/tests.py | Python | gpl-2.0 | 8,741 |
import web
urls = (
'/hello','Index'
)
app = web.application(urls,globals())
render = web.template.render('/usr/local/LPTHW/ex51/gothonweb/templates/',base="layout")
class Index(object):
def GET(self):
return render.hello_form()
def POST(self):
form = web.input(name="No... | tridvaodin/Assignments-Valya-Maskaliova | LPTHW/projects/gothonweb/bin/app.py | Python | gpl-2.0 | 488 |
from splinter import Browser
from time import sleep
from selenium.common.exceptions import ElementNotVisibleException
from settings import settings
from lib import db
from lib import assets_helper
import unittest
from datetime import datetime, timedelta
asset_x = {
'mimetype': u'web',
'asset_id': u'4c8dbce552e... | zhouhan0126/SCREENTEST1 | tests/splinter_test.py | Python | gpl-2.0 | 11,129 |
# encoding: utf8
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = []
operations = [
migrations.CreateModel(
fields = [(u'id', models.AutoField(verbose_name=u'ID', serialize=False, auto_created=True, primary_key=True),), ('name', models.Ch... | Nimmard/james-olson.com | main/migrations/0001_initial.py | Python | gpl-2.0 | 1,003 |
# force floating point division. Can still use integer with //
from __future__ import division
# This file is used for importing the common utilities classes.
import numpy as np
import matplotlib.pyplot as plt
import sys
sys.path.append("../../../../../")
from EnergyLandscapes.Lifetime_Dudko2008.Python.TestExamples.U... | prheenan/BioModel | EnergyLandscapes/Lifetime_Dudko2008/Python/TestExamples/Examples/Example_Dudko_Fit.py | Python | gpl-2.0 | 889 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.shortcuts import render, redirect, HttpResponse
from django.contrib.auth import authenticate, login, logout
from django.contrib.auth.decorators import login_required
from django.views.decorators.csrf import csrf_exempt
from subscriber.models import Consumer, Con... | ShovanSarker/sense_v4_withLocal | template_manager/views.py | Python | gpl-2.0 | 113,348 |