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 |
|---|---|---|---|---|---|
from fabric.api import run
from fabric.decorators import with_settings
from fabric.colors import green, yellow
from deployer.tasks.requirements import install_requirements
@with_settings(warn_only=True)
def setup_virtualenv(python_version='', app_name='', app_dir='', repo_url=''):
print(green("Setting up virtuale... | streema/deployer | deployer/tasks/virtualenv.py | Python | mit | 576 |
from prompt_toolkit import Application
from prompt_toolkit.interface import CommandLineInterface
from prompt_toolkit.shortcuts import create_eventloop
from prompt_toolkit.key_binding.manager import KeyBindingManager
from prompt_toolkit.keys import Keys
from prompt_toolkit.buffer import Buffer, AcceptAction
from prompt_... | anhlt/twitter_cli | twitter_cli/main.py | Python | mit | 3,569 |
import distribute_setup
distribute_setup.use_setuptools()
from setuptools import setup
tests_require = ['pytest']
setup(
name = "pacha",
version = "0.3.0",
packages = ['pacha'],
install_requires = [
'supay==0.0.7',
'guachi==0.0.6',
'coima==0.0.2'],
entry_points = {
... | alfredodeza/pacha | setup.py | Python | mit | 3,200 |
'''
Created on Mar 29, 2015
@author: rnc4
'''
import json
class SimpleFactoryConfiguration:
def __init__(self, path="factory_config.json"):
self.client_addrs = []
with open(path) as data_file:
self.data = json.load(data_file)
self.parse()
def parse(self):... | usnistgov/SimpleFactory | SimpleFactoryConfiguration.py | Python | mit | 1,342 |
"""DailyIP.py
Program written to do the backend calculations for a daily IP calculator
Brendan Jones
3/8/2017 -started ground work and function layout
"""
import RiotAPI as RA
import time
current_time = time.time()
def getTimePlayed(json_index):
"""Function that returns the time played of a given game
input:... | Btjones711/RiotApplications | DailyIP.py | Python | mit | 1,899 |
### -*- coding: utf-8 -*-
###
### © 2012, 2014 Krux Digital, Inc.
### Author: Charlie Schluting <charlie@krux.com>
###
from setuptools import setup, find_packages
setup(
name='monitorlib',
version="0.2.16",
description='Library for creating monitoring scripts/plugins',
author='Charlie Schluting',
... | krux/monitorlib | setup.py | Python | mit | 473 |
def get_data():
import pickle
with open('data.p', 'rb') as f:
return pickle.load(f)
if __name__ == '__main__':
import praw
import os, os.path
from datetime import datetime, timedelta
# Change the working directory to the script directory
os.chdir(os.path.dirname(os.pat... | chaosking121/best-of-nosleep | script.py | Python | mit | 1,416 |
from sys import stdout
import argparse
import json
import logging
from .phuey import Bridge, Light
logger = logging.getLogger()
def command_interpreter(command):
python_dict = {}
commands = command.split(',')
for c in commands:
k, v = c.split('=')
if v.lower() == "true":... | pancho-villa/Phuey | phuey/light_cli.py | Python | mit | 1,447 |
# -*- coding: utf-8 -*-
OAuthException = type('OAuthException', (Exception, ), {})
ValidationError = type('ValidationError', (OAuthException, ), {})
| GehirnInc/py3oauth2 | py3oauth2/exceptions.py | Python | mit | 150 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('customers', '0009_recipient_type'),
]
operations = [
migrations.AlterModelOptions(
name='recipient',
... | davogler/POSTv3 | customers/migrations/0010_auto_20170124_2322.py | Python | mit | 412 |
__author__ = 'austin'
import dataset
import os
import time
import sys
def make_new_database(new_database_name, media_folder):
file_ext = (".mp4", ".avi", ".flv", ".wmv", ".mpg", ".mov", ".mkv", ".mpeg")
start_time = time.time() # FOR TESTING ... start time
db = dataset.connect('sqlite:///{}.vdb'.forma... | redeuxx/vidDB | make_new_database.py | Python | mit | 1,373 |
import sys
from utils.log import Logger
if __name__ == '__main__':
input_argv = sys.argv
try:
server_name = input_argv[1]
if server_name == 'http_server':
from admin_server import http_server
Logger.info('Admin Http Server Begin to run')
http_server()
... | soybean217/lora-python | UServer/admin_run.py | Python | mit | 632 |
import threading
from logger import BPLog, Level
class AsyncTask(threading.Thread):
def __init__(self, target, args=(), kwargs={}):
threading.Thread.__init__(self)
self.target = target
self.args = args
self.kwargs = kwargs
self.setDaemon(True)
self.returned = None
... | BoxeePlay/svtplay3 | tv.boxeeplay.svtplay3/async_task.py | Python | mit | 995 |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
import psycopg2
from psycopg2.extras import Json
def con():
psycopg2.extensions.register_adapter(dict, Json)
psycopg2.extensions.register_adapter(list, Json)
conn = psycopg2.connect(dbname='cy', host='localhost', user='postgres', password='postgres')
... | g0v/sunshine.cy | parser/property/db_settings.py | Python | cc0-1.0 | 337 |
__author__ = 'roscoe'
import os
from datetime import datetime
import qgis.utils
import qgis.utils
from src.geogigpy import Repository
from src.geogigpy import geogig
from src.geogigpy.geogigexception import GeoGigException
from qgis.core import QgsVectorLayer, QgsMapLayerRegistry
class GeoRepo(object):
def __in... | roscoeZA/GeoGigSync | geo_repo.py | Python | cc0-1.0 | 4,025 |
# attempting the classify the charts, after armor/tests/imageToDataTest3.py
# Plan: 1. compute features and store them
# 2. classify
# 3. display
#
#sleepTime= 140000
sleepTime =0
import time
print time.asctime()
print 'sleeping now for ', sleepTime, 'seconds'
time.sleep(sleepTime)
import os... | yaukwankiu/armor | tests/imageToDataTest4.py | Python | cc0-1.0 | 5,132 |
# -*- coding: utf-8 -*-
'''
filename:rtcp.py
@desc:
利用python的socket端口转发,用于远程维护
如果连接不到远程,会sleep 36s,最多尝试200(即两小时)
@usage:
./rtcp.py stream1 stream2
stream为:l:port或c:host:port
l:port表示监听指定的本地端口
c:host:port表示监听远程指定的端口
@author: watercloud, zd, hysia
@date: 2009-7
使用场景:
一:
A服务器在内网,公网无法直接访问这台服务器,但是A服务器可以联网访问公网的B服务器(假设IP为... | hysia/awsome-collections | python/rtcp.py | Python | cc0-1.0 | 4,783 |
# File name: generaloptions.py
import kivy
kivy.require('1.7.0')
from kivy.uix.boxlayout import BoxLayout
from kivy.properties import NumericProperty, ListProperty
class GeneralOptions(BoxLayout):
group_mode = False
translation = ListProperty(None)
def clear(self, instance):
self.drawing_space.cle... | ForAP/Advanc3d-Pr0graming | Kivy-Resources/kivy-book-examples-master/Chapter_03_code/generaloptions.py | Python | gpl-2.0 | 1,046 |
import re
import fnmatch
import urllib2
from kodipopcorntime import plugin
from kodipopcorntime.caching import shelf
PAC_URL = "http://clientconfig.immunicity.org/pacs/all.pac"
CACHE = 1 * 3600 # 1 hour caching
_config = {}
def config():
global _config
if not _config:
with shelf("kodipopcorntime.imm... | marnnie/Cable-buenaventura | plugin.video.kodipopcorntime/resources/site-packages/kodipopcorntime/immunicity.py | Python | gpl-2.0 | 915 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
[tests/stdlib/test_cd.py]
Test the cd command.
"""
import unittest
import os
import tempfile
from ergonomica import ergo
class TestCd(unittest.TestCase):
"""Tests the cd command."""
def test_cd(self):
"""
Tests the cd command.
"""
... | ergonomica/ergonomica | tests/stdlib/test_cd.py | Python | gpl-2.0 | 557 |
# -*- coding: utf-8 -*-
#
# RERO ILS
# Copyright (C) 2019 RERO
#
# 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, version 3 of the License.
#
# This program is distributed in the hope that... | rero/reroils-app | tests/ui/locations/test_locations_mapping.py | Python | gpl-2.0 | 1,616 |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
from setuptools import setup
setup(name="tekmate",
version="0.0.1",
description="Tekmate - Stargate-Based Point'n'Click",
author="Max",
packages=['tekmate'],
license="GPLv3",
url="https://github.com/mkli90/tekmate",
package_data... | mkli90/tekmate | setup.py | Python | gpl-2.0 | 765 |
from unittest import TestCase
from instructions.pop import Pop
from context import Context
from registers import AX, SP
__author__ = "Sébastien Guimmara"
class TestPop(TestCase):
def test_execute(self):
p = Pop.parse(['ax'])
ctx = Context(None)
ctx.registers.set(SP, 0xFFFE)
self.a... | Groutcho/exii | tests/instructions/test_pop.py | Python | gpl-2.0 | 762 |
# _ _ _
# | | | | | |
# | | _ _ | |_ | |__ ___ _ __
# | || | | || __|| '_ \ / _ \| '__|
# | || |_| || |_ | | | || __/| |
# |_| \__,_| \__||_| |_| \___||_|
#
"""
.. module:: luther
:synopsis: lightweight DDNS service with REST API and JS frontend.
.. moduleauthor:: Roland Shoemaker <rol... | rolandshoemaker/luther | luther/__init__.py | Python | gpl-2.0 | 1,181 |
from operator import itemgetter
from heapq import nlargest
from itertools import repeat, ifilter
class Counter(dict):
'''Dict subclass for counting hashable objects. Sometimes called a bag
or multiset. Elements are stored as dictionary keys and their counts
are stored as dictionary values.
>>> Coun... | andfoy/margffoy-tuay-server | env/lib/python2.7/site-packages/tornadoredis/backports.py | Python | gpl-2.0 | 6,201 |
"""
Copyright 2007-2009, Red Hat, Inc and Others
Michael DeHaan <michael.dehaan AT gmail>
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 late... | jmaas/cobbler | cobbler/remote.py | Python | gpl-2.0 | 89,579 |
from H3DInterface import *
class SFVec3fToColor( TypedField( MFColor, ( SFVec3f, SFMatrix4f, MFVec3f ) ) ):
def update( self, event ):
inputs = self.getRoutesIn()
light_pos_global = inputs[0].getValue()
acc_inverse_matrix = inputs[1].getValue()
points = inputs[2].getValue()
light_pos = acc_invers... | JakeFountain/H3DAPIwithOculusSupport | examples/bumpmap/bumpmap.py | Python | gpl-2.0 | 571 |
# -*- Mode: Python -*-
# vi:si:et:sw=4:sts=4:ts=4
#
# Copyright (C) 2009-2010 Fluendo, S.L. (www.fluendo.com).
# Copyright (C) 2009-2010 Marc-Andre Lureau <marcandre.lureau@gmail.com>
# This file may be distributed and/or modified under the terms of
# the GNU General Public License version 2 as published by
# the Free... | suykerbuyk/hls_toolkit | HLS/fetcher.py | Python | gpl-2.0 | 8,189 |
# encoding: utf-8
# module PyKDE4.kdecore
# from /usr/lib/python3/dist-packages/PyKDE4/kdecore.cpython-34m-x86_64-linux-gnu.so
# by generator 1.135
# no doc
# imports
import PyQt4.QtCore as __PyQt4_QtCore
import PyQt4.QtNetwork as __PyQt4_QtNetwork
class KGlobal(): # skipped bases: <class 'sip.wrapper'>
# no doc... | ProfessorX/Config | .PyCharm30/system/python_stubs/-1247971765/PyKDE4/kdecore/KGlobal.py | Python | gpl-2.0 | 2,143 |
#
# gPrime - A web-based genealogy program
#
# Copyright (C) 2008 Brian G. Matherly
# Copyright (C) 2012 Paul Franklin
#
# 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 versio... | sam-m888/gprime | gprime/plug/_docgenplugin.py | Python | gpl-2.0 | 4,499 |
#!/usr/bin/env python
import os
import subprocess
import os.path as p
import sys
DIR_OF_THIS_SCRIPT = p.dirname( p.abspath( __file__ ) )
DIR_OF_THIRD_PARTY = p.join( DIR_OF_THIS_SCRIPT, 'third_party' )
DIR_OF_YCMD_THIRD_PARTY = p.join( DIR_OF_THIRD_PARTY, 'ycmd', 'third_party' )
python_path = []
for folder in os.lis... | NorfairKing/sus-depot | shared/shared/vim/dotvim/bundle/YouCompleteMe/run_tests.py | Python | gpl-2.0 | 1,761 |
import tushare as ts
from m_load_update_data import load
import m_draw
import matplotlib.pyplot as plt
import string
import m_smtp
import datetime
price = ''
class cw_dsp():
def __init__(self):
self.bishu=0.0
self.buyamt=0.0
self.buyprice=0.0
class CW():
def __init__(self):
se... | liuguoyaolgy/Stock | m_wangge.py | Python | gpl-2.0 | 13,472 |
#!/usr/bin/python
# vi:tabstop=4:expandtab:sw=4
import os
from setuptools import setup
def get_long_description():
with open(os.path.join(os.path.dirname(__file__), "README.rst"), encoding='utf-8') as fp:
return fp.read()
setup(
name='Unidecode',
version='1.3.3',
description='ASCII translite... | avian2/unidecode | setup.py | Python | gpl-2.0 | 1,387 |
# -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding:utf-8 -*-
# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4
#
# 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)
#
# Released under t... | MDAnalysis/mdanalysis | package/MDAnalysis/converters/OpenMM.py | Python | gpl-2.0 | 7,397 |
#!/usr/bin/env python
###############################################################################
# $Id: paux.py 32163 2015-12-13 17:44:50Z goatbar $
#
# Project: GDAL/OGR Test Suite
# Purpose: Test read/write functionality for PAux driver.
# Author: Frank Warmerdam <warmerdam@pobox.com>
#
#####################... | nextgis-extra/tests | lib_gdal/gdrivers/paux.py | Python | gpl-2.0 | 2,669 |
from django.apps import apps as django_apps
edc_pharma_app_config = django_apps.get_app_config('edc_pharma')
edc_protocol_app_config = django_apps.get_app_config('edc_protocol')
class DispenseLabelContext:
"""Format dispense record into printable ZPL label context."""
def __init__(self, prescriptions=None, ... | botswana-harvard/edc-pharma | edc_pharmacy/old/dispense/labels/dispense_label_context.py | Python | gpl-2.0 | 1,755 |
from sandbox.dalz.data import ArticleCommentCountFileData, ArticlePublicationDateFileData, ArticleAuthorFileData, \
ArticleWordCountFileData, CommentAuthorCommentCountFilesDatas, AuthorArticleCountFilesData, \
AuthorArticlesCommentsCountAverageFilesData, AuthorArticlesWordsCountAverageFilesData, \
ArticlePu... | buxx/TextDataExtractor | sandbox/dalz/implode.py | Python | gpl-2.0 | 1,003 |
#!/usr/bin/env python
# -*- coding: utf-8
from __future__ import print_function
import argparse
import codecs
import cPickle as pickle
import numpy as np
import os
from load_tweets import load_tweets
NAME='ef_list_punctuation'
prefix='list_punctuation'
if __name__ == "__main__":
# Las opciones de línea de coman... | alonsopg/AuthorProfiling | src/ef_list_punctuation.py | Python | gpl-2.0 | 3,045 |
# -*- coding: utf-8 -*-
#
# Picard, the next-generation MusicBrainz tagger
#
# Copyright (C) 2006-2009, 2012 Lukáš Lalinský
# Copyright (C) 2007 Javier Kohen
# Copyright (C) 2008-2011, 2014-2015, 2018-2020 Philipp Wolfer
# Copyright (C) 2009 Carlin Mangar
# Copyright (C) 2009 Nikolai Prokoschenko
# Copyright (C) 2011-2... | Sophist-UK/Sophist_picard | picard/script.py | Python | gpl-2.0 | 42,343 |
# -*- coding: UTF-8 -*-
import os, sys, re, xbmc, xbmcgui, string, time, urllib, urllib2
import mechanize
from utilities import log
_ = sys.modules[ "__main__" ].__language__
movie_url = "http://www.small-industry.com"
tvshow_url = "http://www.subs4series.com"
debug_pretext = "subs4free"
def get_url(url,referer=None)... | SMALLplayer/smallplayer-image-creator | storage/.xbmc/addons/script.xbmc.subtitles/resources/lib/services/Subs4Free/service.py | Python | gpl-2.0 | 13,139 |
import subprocess
from distutils import spawn
brctlexe = spawn.find_executable("brctl")
ipexe = spawn.find_executable("ip")
class BridgeException(Exception):
pass
class Bridge(object):
def __init__(self, name):
""" Initialize a bridge object. """
self.name = name
def __str__(self):
... | udragon/pybrctl | pybrctl/pybrctl.py | Python | gpl-2.0 | 5,254 |
# Copyright (c) Corporation for National Research Initiatives
from org.python.parser import Visitor, SimpleNode
from org.python.parser.PythonGrammarTreeConstants import *
from org.python.parser import SimpleNode
from org.python.compiler import Future
comp_ops = {JJTLESS_CMP : 'lt',
JJ... | carvalhomb/tsmells | guess/Tools/jythonc/PythonVisitor.py | Python | gpl-2.0 | 17,603 |
# -*- coding: utf-8 -*-
import unittest
from unittest.mock import MagicMock, patch
from blivetgui.blivet_utils import BlivetUtils, FreeSpaceDevice
from blivetgui.i18n import _
from blivet.size import Size
class FreeSpaceDeviceTest(unittest.TestCase):
def test_free_basic(self):
free = FreeSpaceDevice(f... | rhinstaller/blivet-gui | tests/blivetgui_tests/utils_test.py | Python | gpl-2.0 | 5,595 |
#!/usr/bin/python
import time
import datetime
import logging
import os
import syslog
#from os import path, access, R_OK
from time import sleep
import os
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
# 22 = Relay 1, 27 = Relay 2, 17 = Relay 3
GPIO.setup(27, GPIO.OUT)
GPIO.setup(27, False)
sleep(2)
GPIO.setup(27, Tru... | tommybobbins/pipoegusca | test2.py | Python | gpl-2.0 | 347 |
# Keys for connection type
GABA = 0
Glu = 1
ACh = 2
NA_ex = 3
NA_in = 4
DA_ex = 3
DA_in = 4
# Keys for synapse models
model = 0
basic_weight = 1
# Keys for parts dictionary
k_outer = 'Outer ID'
k_outer_ids = 'Outer children IDs'
k_inner = 'Inner ID'
k_inner_ids = 'Inner children IDs'
k_name = 'Name'
k_NN = 'N... | research-team/NEUCOGAR | NEST/cube/noradrenaline/scripts-2/keys.py | Python | gpl-2.0 | 700 |
import unittest
from factorial import fact
class TestFactorial(unittest.TestCase):
"""
Our basic test class
"""
def test_fact(self):
"""
The actual test.
Any method which starts with ``test_`` will considered as a test case.
"""
res = fact(5)
self.assert... | rtnpro/test-your-code | test_your_code/examples/factorial/test_factorial.py | Python | gpl-2.0 | 386 |
from cStringIO import StringIO
import os
import tarfile
import unittest
import tempfile
import shutil
import errno
import mock
from pulp.devel.unit.util import touch
from pulp.plugins.conduits.repo_publish import RepoPublishConduit
from pulp.plugins.config import PluginCallConfiguration
from pulp.plugins.model import ... | ipanova/pulp_puppet | pulp_puppet_plugins/test/unit/test_install_distributor.py | Python | gpl-2.0 | 24,167 |
# Natural Language Toolkit: Paradigm Visualisation
#
# Copyright (C) 2005 University of Melbourne
# Author: Will Hardy
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
# Front end to a Python implementation of David
# Penton's paradigm visualisation model.
# Author:
#
# Run: To run, first load a... | RensaProject/nodebox_linguistics_extended | nodebox_linguistics_extended/parser/nltk_lite/contrib/paradigm.py | Python | gpl-2.0 | 24,313 |
from django.test import TestCase
class PublicTest(TestCase):
fixtures = ['main/fixtures/arches.json', 'main/fixtures/repos.json',
'main/fixtures/package.json', 'main/fixtures/groups.json',
'devel/fixtures/staff_groups.json']
def test_index(self):
response = self.client... | archlinux/archweb | public/tests.py | Python | gpl-2.0 | 1,786 |
from Tools.Profile import profile
# workaround for required config entry dependencies.
from Screens.MovieSelection import MovieSelection
from Screen import Screen
profile("LOAD:enigma")
from enigma import iPlayableService
profile("LOAD:InfoBarGenerics")
from Screens.InfoBarGenerics import InfoBarShowHide, \
InfoBa... | kakunbsc/enigma2 | lib/python/Screens/InfoBar.py | Python | gpl-2.0 | 9,340 |
# --coding: utf8--
from setuptools import setup, find_packages
setup(
name='django-geoaddress',
version='0.1.14',
description=('Address field with GEO coordinates'),
long_description=open('README.md').read(),
author='Pavel ALekin',
maintainer='Pavel Alekin',
maintainer_email='pavel.alekin@... | minidron/django-geoaddress | setup.py | Python | gpl-2.0 | 1,074 |
# coding: utf-8
from __future__ import unicode_literals
from django.conf import settings
from django.core.mail import send_mass_mail
from django.db import IntegrityError
from django.forms import (Form, CharField, TextInput, Textarea, Select,
ChoiceField)
from django.views.generic import Temp... | SonicFrog/jdrpoly | svz/views.py | Python | gpl-2.0 | 6,684 |
import collections
class fSeq:
def __init__(self, fNumbers):
self.fNumbers = fNumbers
self.seq = self.fSequence()
self.fDecom = self.fDecomposition()
def fSequence(self):
if self.fNumbers == 1:
fSeq = [1]
else:
fSeq = [1, 1]
if self.... | dvoets/fibClock | fSequence.py | Python | gpl-2.0 | 980 |
#-*- coding: utf-8 -*-
from openerp.osv import fields, osv
class finance_contract_rachat(osv.osv_memory):
_name = "finance.contract.rachat"
_columns = {
'date': fields.date('Date de rachat'),
'date_dem': fields.date('Date de la demande'),
'motif': fields.text('Motif'),
'mem... | ATSTI/administra | open_corretora/brokerage/wizard/end_contract.py | Python | gpl-2.0 | 1,064 |
# -*- coding: UTF-8 -*
'''
Created on 2015年1月18日
@author: RobinTang
'''
try:
import Image, ImageDraw, ImageFont, ImageFilter
except:
pass
try:
from PIL import Image, ImageDraw, ImageFont, ImageFilter
except:
pass
import StringIO
filters = {
('blur', ImageFilter.BLUR, '模糊滤镜'),
('contour', Imag... | sintrb/urlimg | img/funs.py | Python | gpl-2.0 | 2,541 |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'PersonTranslation.description'
db.alter_column(u'aldry... | Venturi/cms | env/lib/python2.7/site-packages/aldryn_people/south_migrations/0018_auto__chg_field_persontranslation_description.py | Python | gpl-2.0 | 15,148 |
def make_routes(config):
from lbapp.config.routes.base import make_base_routes
from lbapp.config.routes.user import make_user_routes
# ** STATIC **
config.add_static_view('static', 'static', cache_max_age=3600)
config.add_static_view('templates', 'templates', cache_max_age=3600)
# ** HOME **
... | lightbase/LBApp | lbapp/config/routing.py | Python | gpl-2.0 | 743 |
"""
Regression tests for rescinding outstanding subscription requests.
"""
from twisted.words.protocols.jabber.client import IQ
from servicetest import (EventPattern, wrap_channel, assertLength,
assertEquals, call_async, sync_dbus)
from hazetest import exec_test
import constants as cs
import ns
jid = 'marco@... | fcrozat/telepathy-haze | tests/twisted/roster/removed-from-rp-subscribe.py | Python | gpl-2.0 | 6,175 |
# Copyright (c) 2006-2010 LOGILAB S.A. (Paris, FRANCE).
# http://www.logilab.fr/ -- mailto:contact@logilab.fr
#
# 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, o... | mattjmorrison/Pylint | checkers/typecheck.py | Python | gpl-2.0 | 15,613 |
import os
import shutil
import filecmp
from dotgit.plugin import Plugin
class PlainPlugin(Plugin):
def __init__(self, *args, **kwargs):
self.hard = kwargs.pop('hard', False)
super().__init__(*args, **kwargs)
def setup_data(self):
pass
# copies file from outside the repo to the r... | Cube777/dotgit | dotgit/plugins/plain.py | Python | gpl-2.0 | 1,536 |
#
# Copyright 2016-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 ... | EdDev/vdsm | lib/vdsm/storage/check.py | Python | gpl-2.0 | 12,176 |
#
# Loxodo -- Password Safe V3 compatible Password Vault
# Copyright (C) 2008 Christoph Sommer <mail@christoph-sommer.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 ... | hupf/passwordchest | src/loxodo/twofish/twofish_ecb.py | Python | gpl-2.0 | 2,538 |
from django import forms
from japos.goods.models import Product, Group
class ProductForm(forms.ModelForm):
sku = forms.CharField(widget = forms.TextInput(attrs={'class': 'text-input small-input'}))
barcode = forms.CharField(widget = forms.TextInput(attrs={'class': 'text-input small-input'}))
name = forms.... | jyr/japos | goods/forms.py | Python | gpl-2.0 | 1,027 |
# Wrapper module for _ssl, providing some additional facilities
# implemented in Python. Written by Bill Janssen.
"""This module provides some more Pythonic support for SSL.
Object types:
SSLSocket -- subtype of socket.socket which does SSL over the socket
Exceptions:
SSLError -- exception raised for I/O erro... | bvcms/bvcms | CmsWeb/Lib/ssl.py | Python | gpl-2.0 | 37,843 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
import uuid
import base64
import string
import random
from django.conf import settings
from django.contrib.auth.hashers import make_password
from django.contrib.auth.models import AbstractUser
from django.core.cache import cache
from django.db import models
from django.... | zsjohny/jumpserver | apps/users/models/user.py | Python | gpl-2.0 | 18,955 |
#!/usr/bin/env python
#
# Copyright (c) 2010 Matteo Boscolo
#
# This file is part of PythonCAD.
#
# PythonCAD 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 opti... | Csega/PythonCAD3 | Interface/Preview/polygon.py | Python | gpl-2.0 | 3,133 |
# encoding: utf-8
# module gio._gio
# from /usr/lib/python2.7/dist-packages/gtk-2.0/gio/_gio.so
# by generator 1.135
# no doc
# imports
import gio as __gio
import glib as __glib
import gobject as __gobject
import gobject._gobject as __gobject__gobject
class FileMonitorFlags(__gobject.GFlags):
# no doc
def __... | ProfessorX/Config | .PyCharm30/system/python_stubs/-1247972723/gio/_gio/FileMonitorFlags.py | Python | gpl-2.0 | 731 |
from django import forms
from bands.models.billing_info import BillingInfo
class BillingForm(forms.ModelForm):
class Meta:
model = BillingInfo
exclude=[]
widgets = {
'billing_total': forms.NumberInput(attrs={'placeholder': '0,00'}),
} | InsulaCoworking/MusicCity | bands/forms/billing_info.py | Python | gpl-2.0 | 286 |
"""
MobileRobots Advanced Robotics Interface for Applications (ARIA)
Copyright (C) 2004, 2005 ActivMedia Robotics LLC
Copyright (C) 2006, 2007, 2008, 2009 MobileRobots 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 b... | charismaticchiu/Robotics | ArNetworking/pythonExamples/drawingsExample.py | Python | gpl-2.0 | 6,718 |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2014, 2015 CERN.
#
# Invenio is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any... | egabancho/invenio-oauth2server | invenio_oauth2server/forms.py | Python | gpl-2.0 | 5,319 |
# -*- coding: utf-8 -*-
#
# Picard, the next-generation MusicBrainz tagger
# Copyright (C) 2011 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... | mwiencek/picard | picard/ui/options/fingerprinting.py | Python | gpl-2.0 | 3,809 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim: ai ts=4 sts=4 et sw=4
import json, string, random
from django.contrib.auth import login, authenticate
from httpauth import HttpBasicAuthentication
from django.http import HttpResponse
from models import Permission
from datetime import date
def random_string(length=... | aviars/flangio | apps/accounts/utils.py | Python | gpl-2.0 | 9,371 |
#! /usr/bin/env python
# This file is part of Codeface. Codeface 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.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY... | bockthom/codeface | codeface/dbmanager.py | Python | gpl-2.0 | 21,118 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
def generateCode():
with open('./cityCode.log', mode='r') as fin:
for line in fin:
if len(line) > 0:
# print('processing {}'.format(line))
pass
try:
codeObjs = json.loads(line... | Alexoner/web-crawlers | scripts/b-europe/processLog.py | Python | gpl-2.0 | 814 |
## @file
# process FV generation
#
# Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be ... | miguelinux/vbox | src/VBox/Devices/EFI/Firmware/BaseTools/Source/Python/GenFds/Fv.py | Python | gpl-2.0 | 16,415 |
# 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,
# bu... | AdamWill/bodhi | bodhi/tests/server/test_metadata.py | Python | gpl-2.0 | 16,797 |
import json
with open('medalofhonor-old.json') as input:
data = json.load(input)
months = {
'January': 1,
'February': 2,
'March': 3,
'April': 4,
'May': 5,
'June': 6,
'July': 7,
'August': 8,
'September': 9,
'October': 10,
'November': 11,
'December': 12,
}
d... | RealTimeWeb/datasets | preprocess/medal_of_honor/fix.py | Python | gpl-2.0 | 3,268 |
from collections import defaultdict
from itertools import chain
from operator import itemgetter
import re
from django.core.serializers.json import DjangoJSONEncoder
from django.db import connection
from django.db.models import Count, Max, F
from django.db.models.query import QuerySet
from django.contrib.auth.models im... | archlinux/archweb | packages/utils.py | Python | gpl-2.0 | 16,261 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import creditpiggy.core.models
class Migration(migrations.Migration):
dependencies = [
('core', '0014_auto_20150616_1247'),
('api', '0001_initial'),
]
operations = [
migratio... | wavesoft/creditpiggy | creditpiggy-server/creditpiggy/api/migrations/0002_projectcredentials_websitecredentials.py | Python | gpl-2.0 | 1,466 |
#!/bin/python
# ID3_classifier.py
# -------------------------
# Winter 2013; Alex Safatli
# -------------------------
# A program that carries out
# the ID3 algorithm on a
# given data file; extended
# in order to act as a classifier
# a la NB_classifier.
#
# Usage: python ID3_classifier.py
# Imports
import os, sys
... | AlexSafatli/DataMiningImplementations | naive-bayes/ID3_classifier.py | Python | gpl-2.0 | 13,649 |
# Copyright (C) 2008-2011 Dejan Muhamedagic <dmuhamedagic@suse.de>
# Copyright (C) 2013 Kristoffer Gronlund <kgronlund@suse.com>
# See COPYING for license information.
from . import command
from . import completers as compl
from . import utils
from . import ra
from . import constants
from . import options
def comple... | aspiers/crmsh | modules/ui_ra.py | Python | gpl-2.0 | 3,190 |
#!/usr/bin/python
#############################
# Function "calculateRisk"
# Given "data", calls the required function to compute the risk state of the
# system, and returns it.
#############################
def calculateRisk(data):
risk = computeRiskState(data[0], data[1], data[2], data[3], data[4], data[5], data[... | Genesis30/GeDRA | ds.py | Python | gpl-2.0 | 6,580 |
#!/usr/bin/env python2
# Import system libraries and define helper functions
import time
import sys
import os
import os.path
from pprint import pformat
# First import the API class from the SDK
from facepp import API
from facepp import File
def print_result(hint, result):
def encode(obj):
if type(obj) is ... | YaoQ/faceplusplus-demo | recognition.py | Python | gpl-2.0 | 1,492 |
from sklearn import datasets
import numpy as np
iris = datasets.load_iris()
from sklearn.naive_bayes import GaussianNB
from sklearn.naive_bayes import MultinomialNB
import scipy.io
epsilon=0.001
data=scipy.io.loadmat('arr.mat')
test=scipy.io.loadmat('test.mat')
labels=scipy.io.loadmat('labels.mat')
gnb = GaussianNB()
... | aksvarun007/Winter-School-Audio-processing | test/NB.py | Python | gpl-2.0 | 1,397 |
import os
from record import Record
from timeutils import isodatetime
import applib
import sqlite3
class E:
""" sqlite3 storage engine for the record
"""
recordTbl = 'record'
orderBy = 'mtime'
orderHow = 'desc'
@staticmethod
def setup(dataDir):
engineDir = os.path.join(dataDir, ... | iesugrace/log-with-git | sqlitestorage.py | Python | gpl-2.0 | 9,962 |
from django.shortcuts import redirect, render
from lists.models import Item, List
from django.core.exceptions import ValidationError
from lists.forms import ItemForm,ExistingListItemForm
from lists.models import Item,List
def home_page(request):
return render(request, 'home.html',{'form':ItemForm()})
def new_list(... | AllahVII/tddp | lists/views.py | Python | gpl-2.0 | 940 |
from registrator.models.registration_entry import RegistrationEntry
from uni_info.models import Section
class RegistrationProxy(RegistrationEntry):
"""
Proxy class which handles actually doing the registration in a system
of a :model:`registrator.RegistrationEntry`
"""
# I guess functions for reg... | squarebracket/star | registrator/models/registration_proxy.py | Python | gpl-2.0 | 1,141 |
# coding:utf-8
from django.db.models import Q
from jasset.asset_api import *
from jumpserver.api import *
from jumpserver.models import Setting
from jasset.forms import AssetForm, IdcForm
from jasset.models import Asset, IDC, AssetGroup, ASSET_TYPE, ASSET_STATUS
from jperm.perm_api import get_group_asset_perm, get_gro... | ganxueliang88/idracserver | jasset/views.py | Python | gpl-2.0 | 23,160 |
# -*- coding: utf-8 -*-
# Created on: 03.06.2015
"""
SimplePlugin micro-framework for Kodi content plugins
**Author**: Roman Miroshnychenko aka Roman V.M.
**License**: `GPL v.3 <https://www.gnu.org/copyleft/gpl.html>`_
"""
import os
import sys
import re
import inspect
import time
import pickle
im... | seppius-xbmc-repo/ru | plugin.video.ndr/simpleplugin.py | Python | gpl-2.0 | 59,566 |
class Caesar(str):
"""An implementation of the Caesar cipher."""
def encipher(self, shift):
"""Encipher input (plaintext) using the Caesar cipher and return it
(ciphertext)."""
ciphertext = []
for p in self:
if p.isalpha():
ciphertext.append(chr((... | MiiRaGe/cryptanalysis-tools | vigenere/PyGenere.py | Python | gpl-2.0 | 13,863 |
from Components.Renderer.Renderer import Renderer
from enigma import eDVBCI_UI, eLabel, iPlayableService
from skin import parameters
from Components.SystemInfo import SystemInfo
from Components.VariableText import VariableText
from Tools.Hex2strColor import Hex2strColor
from os import popen
class CiModuleControl(Rende... | TwolDE2/enigma2 | lib/python/Components/Renderer/CiModuleControl.py | Python | gpl-2.0 | 2,404 |
#!/usr/bin/python
"""
Script to verify errors on autotest code contributions (patches).
The workflow is as follows:
* Patch will be applied and eventual problems will be notified.
* If there are new files created, remember user to add them to VCS.
* If any added file looks like a executable file, remember user to m... | spcui/autotest | utils/check_patch.py | Python | gpl-2.0 | 26,401 |
from etc import simple_items
class item:
def __init__(self,id):
self.id=id
self.taxable=1
self.price=simple_items[id][2]
self.name=simple_items[id][0]
self.label=simple_items[id][1]
self.taxable=True
try:
self.taxable=simple_items[id][3]["taxa... | johm/infoshopkeeper | components/item.py | Python | gpl-2.0 | 964 |
"""
Basic utility constants used for this application
"""
import math
e = math.e
pi = math.pi
| Kapilkoundinya/Simple-Calculator | calculator/Constants.py | Python | gpl-2.0 | 97 |
"""Export Module"""
import csv
import io
import logging
import zipfile
import bpy
import bpy_extras
from .. import model
from .. import pam
logger = logging.getLogger(__package__)
def getUVs(object, particle_system):
""" returns a numpy-array of uv - coordinates for a given particle-system
on a given obj... | MartinPyka/Parametric-Anatomical-Modeling | pam/export/to_csv.py | Python | gpl-2.0 | 4,220 |
#@+leo-ver=5-thin
#@+node:2014spring.20140628104046.1746: * @file openshiftlibs.py
#@@language python
#@@tabwidth -4
#@+others
#@+node:2014spring.20140628104046.1747: ** openshiftlibs declarations
#!/usr/bin/env python
import hashlib, inspect, os, random, sys
#@+node:2014spring.20140628104046.1748: ** get_openshift_s... | coursemdetw/2015wcms | wsgi/openshift/openshiftlibs.py | Python | gpl-2.0 | 3,730 |
# -*- coding: utf-8 -*-
#
# phpMyAdmin documentation build configuration file, created by
# sphinx-quickstart on Wed Sep 26 14:04:48 2012.
#
# 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.
#
# ... | jechiy/phpMyAdmin | doc/conf.py | Python | gpl-2.0 | 9,675 |
# -*- coding: utf-8 -*-
"""
***************************************************************************
BatchInputSelectionPanel.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
**************... | GeoCat/QGIS | python/plugins/processing/gui/BatchInputSelectionPanel.py | Python | gpl-2.0 | 7,904 |
#!/usr/bin/python
# Rekall
# Copyright (C) 2012 Michael Cohen <scudette@gmail.com>
# Copyright 2013 Google Inc. All Rights Reserved.
#
# 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 ver... | palaniyappanBala/rekall | rekall-core/rekall/config.py | Python | gpl-2.0 | 8,986 |
# This file is part of Buildbot. Buildbot 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.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | anish/buildbot | master/docs/bbdocs/ext.py | Python | gpl-2.0 | 17,319 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.