repo_name stringlengths 5 104 | path stringlengths 4 248 | content stringlengths 102 99.9k |
|---|---|---|
vienin/python-ufo | ufo/user.py | import os
from new import instancemethod
from ufo.database import DocumentHelper
from ufo.constants import Notification, FriendshipStatus
from ufo.sharing import FriendDocument
from ufo.debugger import Debugger
from ufo.errors import *
class FriendFilter:
def __init__(self, key="login", **kw):
self.kw = kw... |
drtuxwang/system-config | bin/tinyproxy.py | #!/usr/bin/env python3
"""
Wrapper for "tinyproxy" command
"""
import getpass
import glob
import os
import signal
import sys
from typing import List
import command_mod
import subtask_mod
class Options:
"""
Options class
"""
def __init__(self) -> None:
self.parse(sys.argv)
def get_tinyp... |
jesopo/bitbot | src/core_modules/print_activity.py | #--depends-on config
#--depends-on format_activity
import datetime
from src import EventManager, ModuleManager, utils
@utils.export("botset",
utils.BoolSetting("print-motd", "Set whether I print /motd"))
@utils.export("botset", utils.BoolSetting("pretty-activity",
"Whether or not to pretty print activity"))
@... |
andybalaam/diffident | src/lib/misc/filemanager.py |
from lib.misc.constants import directions
from lib.misc.constants import save_status
class FileManager( object ):
def __init__( self, filename_left, filename_right ):
self.filenames = {
directions.LEFT : filename_left,
directions.RIGHT : filename_right,
}
def save( self, editablediffmodel, side ):
if... |
scotartt/commentarius | decommentariis/decommentariis/xml_file_metadata_test.py | import unittest, json, os
from xml_file import TEIDataSource
sallust_cataline = "urn:cts:latinLit:phi0631.phi001.perseus-lat2"
homer_iliad = "urn:cts:greekLit:tlg0012.tlg001.perseus-grc1"
caesar_gallic = "urn:cts:latinLit:phi0448.phi001.perseus-lat1"
cicero_derepublica ="urn:cts:latinLit:phi0474.phi043.perseus-lat1"
c... |
postla/e2-gui | timer.py | from bisect import insort
from time import strftime, time, localtime, mktime
from enigma import eTimer
import datetime
class TimerEntry:
StateWaiting = 0
StatePrepared = 1
StateRunning = 2
StateEnded = 3
StateFailed = 4
def __init__(self, begin, end):
self.begin = begin
self.prepare_time = 20
self.... |
PLyczkowski/Sticky-Keymap | 2.74/scripts/addons_contrib/io_import_BrushSet.py | # ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program ... |
shailr/vms | applicant_messages/views.py | from rest_framework import permissions, viewsets
from rest_framework.response import Response
from applicant_messages.models import Message
from applicant_messages.serializers import MessageSerializer
class MessagesViewSet(viewsets.ModelViewSet):
queryset = Message.objects.order_by('-created_at')
serializer_... |
andri-ch/sugarsync-linux | main.py | #!/usr/bin/python2.7
#<--encoding: UTF-8-->
import kivy
kivy.require('1.4.1') # replace with your current kivy version !
from kivy.app import App # your main entry point into the Kivy run loop.
#from kivy.uix.floatlayout import FloatLayout
from kivy.properties import ObjectProperty
#from kivy.uix.button imp... |
sunfounder/SunFounder_Dragit | Dragit/Dragit/picar_v/image_process.py | from time import sleep
import cv2
import cv2.cv as cv
import numpy as np
kernel = np.ones((5,5),np.uint8)
SCREEN_WIDTH = 160
SCREEN_HIGHT = 120
CENTER_X = SCREEN_WIDTH/2
CENTER_Y = SCREEN_HIGHT/2
BALL_SIZE_MIN = SCREEN_HIGHT/10
BALL_SIZE_MAX = SCREEN_HIGHT/3
# Filter setting, DONOT CHANGE
hmn = 12
hm... |
toladata/TolaTables | tola/models.py | from django.db import models
from django.contrib.auth.signals import user_logged_in, user_logged_out
from urllib2 import urlopen
import json
class LoggedUser(models.Model):
username = models.CharField(max_length=30, primary_key=True)
country = models.CharField(max_length=100, blank=False)
email = models.... |
planetarymike/IDL-Colorbars | IDL_py_test/007_RED-PURPLE.py | from matplotlib.colors import LinearSegmentedColormap
from numpy import nan, inf
cm_data = [[0., 0., 0.],
[0., 0., 0.],
[0.0117647, 0., 0.],
[0.0235294, 0., 0.],
[0.0392157, 0., 0.],
[0.0509804, 0., 0.],
[0.0666667, 0., 0.],
[0.0784314, 0., 0.],
[0.0941176, 0., 0.00392157],
[0.105882, 0., 0.00392157],
[0.117647, 0., 0.... |
nicolasgallardo/TECHLAV_T1-6 | bebop_ws/build/navigation_stage/catkin_generated/generate_cached_setup.py | # -*- coding: utf-8 -*-
from __future__ import print_function
import argparse
import os
import stat
import sys
# find the import for catkin's python package - either from source space or from an installed underlay
if os.path.exists(os.path.join('/opt/ros/indigo/share/catkin/cmake', 'catkinConfig.cmake.in')):
sys.p... |
dNG-git/pas_upnp | src/dNG/plugins/upnp/pas_upnp.py | # -*- coding: utf-8 -*-
"""
direct PAS
Python Application Services
----------------------------------------------------------------------------
(C) direct Netware Group - All rights reserved
https://www.direct-netware.de/redirect?pas;upnp
The following license agreement remains valid unless any additions or
changes a... |
TOCyna/tabelinha | flask/lib/python2.7/site-packages/flask_storage/__init__.py | # coding: utf-8
"""
flask_storage
~~~~~~~~~~~~~
Collection of storage backends.
:copyright: (c) 2013 Hsiaoming Yang.
"""
# flake8: noqa
from . import _info
__version__ = _info.VERSION
__author__ = _info.AUTHOR
from ._base import *
from .local import LocalStorage
from .upyun import UpyunStorage
cl... |
birkelbach/python-canfix | tests/node_alarm.py | # Copyright (c) 2016 Phil Birkelbach
#
# 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 distrib... |
gratefulfrog/lib | python/chempy/champ/formal_charges.py | formal_charge_dict = {
'NHE': [
(
'N<0>',
{
0: 0,
},
),
],
'NME': [
(
'C<0>N<1>',
{
0: 0,
1: 0,
},
),
],
'ACE': [
(
'C<0>(=O<1>)C<2>',
{
0: 0,
1: 0,
2: 0,
},
),
],
'ALA': [
(
'N<0>C<1>(... |
craws/OpenAtlas-Python | openatlas/api/v02/endpoints/node/type_tree.py | from typing import Any, Dict, List, Tuple, Union
from flask import Response, jsonify
from flask_restful import Resource, marshal
from openatlas.api.v02.resources.enpoints_util import download
from openatlas.api.v02.resources.parser import entity_
from openatlas.api.v02.templates.type_tree import TypeTreeTemplate
from... |
jehomez/pymeadmin | monedas.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# monedas.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; e... |
bd-j/magellanic | magellanic/sfhs/prediction_scripts/predicted_sed.py | import os, sys
import numpy as np
import matplotlib.pyplot as pl
pl.rcParams['image.origin'] = 'lower'
pl.rcParams['image.interpolation'] = 'nearest'
pl.rcParams['image.aspect'] = 'equal'
import fsps
from magellanic import mcutils
from predicted_cmd import load_data, rebin_partial_cmds
background = {'lmc':{'irac_1':1... |
pescobar/easybuild-framework | easybuild/tools/toolchain/options.py | # #
# Copyright 2012-2020 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be),
# Flemish Research Foundation (... |
wavelets/hebel | hebel/layers/logistic_layer.py | # Copyright (C) 2013 Hannes Bretschneider
# 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 distribut... |
marijngiesen/zabbix-ems | zems/lib/socketconnector.py | from socket import *
class SocketConnector:
family = None
type = None
socket_file = None
host = None
port = None
command = None
socket = None
def __init__(self, socket_file=None, host=None, port=None,
command=None):
if socket_file is not None:
... |
gstiebler/odemis | scripts/timelapse-secom.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Created on 10 Feb 2016
@author: Éric Piel
This is a script to acquire a set of EM/FM overlays over a long period.
run as:
./scripts/timelapse-secom.py -n 12 --period 60 --output filename-.tiff
-n defines the number of images to acquire.
Don't set it to make it in... |
tsh/card-game-server | tests/testGame.py | import unittest
from game.gameObject import Game
from game.card import CreatureCard
from game.constants import GameConstants
class TestGame(unittest.TestCase):
def setUp(self):
self.game = Game()
def test_field_size_according_to_setting(self):
self.assertEqual(len(self.game.player1_game_field... |
RandomHappenstance/country-scrape | countries/countries/settings.py | # -*- coding: utf-8 -*-
# Scrapy settings for waliquor project
#
# For simplicity, this file contains only settings considered important or
# commonly used. You can find more settings consulting the documentation:
#
# http://doc.scrapy.org/en/latest/topics/settings.html
# http://scrapy.readthedocs.org/en/lates... |
etkirsch/pyna-colada | uilaunch.py | import socket, sys
from pyna import *
try:
# Get the local ip address
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.connect(('8.8.8.8', 0)) # connecting to a UDP address doesn't send packets
address = s.getsockname()[0]
s.close()
except:
address = "localhost"
# Grab cmdline args and ... |
wl-net/dataview | automation/sign_widgets/media/__init__.py | from sign.sign_widgets import AbstractWidget
from automation.models import Automator
class MediaPlayerWidget(AbstractWidget):
WIDGET_NAME = "Media Player"
def __init__(self, configuration):
super().__init__(configuration)
pass
def get_contents(self):
try:
res = Automator.objects.get(id=self... |
svetasmirnova/mysql-scripts | bugs/lp_active_vs_verified.py | #!/usr/bin/python3
from launchpadlib.launchpad import Launchpad
import datetime as dt
import argparse
from pathlib import Path
from prettytable import PrettyTable
import plotly.plotly as py
import plotly.graph_objs as go
def print_table(bugs):
total_active = 0
total_not_ver = 0
t = PrettyTable(['Product', 'Active... |
vilemnovak/blendercam | scripts/addons/cam/chunk.py | # blender CAM chunk.py (c) 2012 Vilem Novak
#
# ***** BEGIN GPL LICENSE BLOCK *****
#
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any... |
pscn/yampdqmgr | test/test_sortedset.py | # -*- coding: utf-8 -*-
# This file is part of yampdqmgr.
# Copyright © 2013 Peter Schnebel <pschnebel@gmx.de>
#
# yampdqmgr 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... |
prescott66/mypaint | gui/style.py | # This file is part of MyPaint.
# Copyright (C) 2014 by Andrew Chadwick <a.t.chadwick@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 License, or
# (at your ... |
Onirik79/aaritmud | src/database.py | # -*- coding: utf-8 -*-
"""
Modulo per la gestione del database e della persistenza tramite semplici file
testuali.
Tutti i file gestiti con il database si trovano nelle cartelle data/ oppure
persistence/, questi vengono caricati dal metodo db.load(), ogni singolo file
è caricato con la funzione fread() e salvato con ... |
Eridu-Coders/ScriptureEngineIII | se3_root.py | # -*- coding: utf-8 -*-
from se3_word import *
__author__ = 'fi11222'
class Se3_Root(Se3_Word):
def __init__(self, p_app, p_requestHandler, p_context):
super().__init__(p_app, p_requestHandler, p_context)
self.m_logger.info('+++ Se3_Root created')
# -------------------------- Root Response -... |
geoio/osmhunter-backend | app/app.py | from datetime import datetime
import json
import logging
import settings
import uuid
from bottle import route, run, template, Bottle, request, static_file
import sqlalchemy
import sqlalchemy.orm
from sqlalchemy.sql import func
from classes.FormGenerator import FormGenerator
from helpers.geo_helpers import reverse_geo... |
hgdeoro/py-arduino | py_arduino/tests/test_emulator.py | #!/usr/bin/env python
##-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
## py-arduino - Access your Arduino from Python
## Copyright (C) 2011-2013 - Horacio Guillermo de Oro <hgdeoro@gmail.com>
##
## This file is part of py-arduino.
##
## py-arduino is free software; you can redi... |
jcmarsh/Stage | experiments/algs/artificial_potential.py | import math
from playerc import *
g_r = .1 # radius of goal, in meters
g_e = 2 # extent of field (greater than this, move at maximum speed)
g_s = .5 # scale factor
o_r = .0 # radius of obstacles
o_e = 1.5
o_s = .2
class Point:
def __init__(self, x, y):
self.x = x
self.y = y
def potential(pos, ran... |
quamis/scripts-sh | audio/py-audio-analyser/py-audio-analyser.py | import subprocess as sp
import sys
import numpy as np
# tried to use librosa in this version, failed
#import argparse
#import librosa
FFMPEG_BIN = "ffmpeg"
# @see https://aubio.org/manual/latest/cli.html#aubiotrack
# @see https://stackoverflow.com/a/57126101/11301
# python ./py-audio-analyser.py /media/ext1Tb/nex... |
croneter/PlexKodiConnect | resources/lib/exceptions.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, unicode_literals
class PlaylistError(Exception):
"""
Exception for our playlist constructs
"""
pass
class LockedDatabase(Exception):
"""
Dedicated class to make sure we're not silently catching lo... |
dhavalmanjaria/dma-student-information-system | attendance/tests.py | from django.test import TestCase
from timetable.models import TimeTable
from django.contrib.auth.models import User, Group
from user_management.models.group_info import StudentInfo, FacultyInfo
from user_management.management.commands import initgroups
from curriculum.management.commands import initcurriculum
from atte... |
etamponi/taxonomy-generator | deltaphi/metrics.py | import itertools
import numpy
from deltaphi import shapes
from deltaphi import category_info
__author__ = 'Emanuele Tamponi'
class PairwiseMetric(object):
def pairwise_evaluate(self, ci1, ci2):
pass
class Discriminant(PairwiseMetric):
def pairwise_evaluate(self, ci1, ci2):
return ci1.fr... |
amarin/oupyc | oupyc/queues/__init__.py | # -*- coding: utf-8 -*-
import logging
from threading import RLock, Condition
from oupyc.internals.variable import NamedObject
_l = logging.getLogger(__name__)
_l.setLevel(logging.INFO)
debug, info, warning, error, critical = _l.debug, _l.info, _l.warning, _l.error, _l.critical
class QueueItemNotFoundException(Exce... |
taniaka/lingwars-games | games/sum/__init__.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from engine.utils.game import GameBase
from random import randint
class SumGame(GameBase):
title = 'Maths: Sum'
author = 'Lingwars'
description = """
In this game you have to
"""
def make_question(self, *arg... |
msimacek/koschei | alembic/env.py | from alembic import context
from logging.config import fileConfig
from koschei.db import Base, grant_db_access, get_engine
# this is the Alembic Config object, which provides
# access to the values within the .ini file in use.
config = context.config
# Interpret the config file for Python logging.
# This line sets u... |
duyunchen/bogglequizbowl | bin/LoginService.py | #!/usr/bin/env python
# This file is part of Boggle Quiz Bowl.
#
# Boggle Quiz Bowl 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 opti... |
NETWAYS/ElasticArmor | lib/elasticarmor/auth/ldap_backend.py | # ElasticArmor | (c) 2016 NETWAYS GmbH | GPLv2+
import time
import threading
import ldap
from elasticarmor.util.rwlock import ReadWriteLock, Protector
__all__ = ['LdapBackend', 'LdapUserBackend', 'LdapUsergroupBackend']
CACHE_INVALIDATION_INTERVAL = 900 # Seconds
class LdapBackend(object):
"""Base class for... |
ProfessorX/CIS507 | Project/Homework-1/Codes/Utils.py | import math
import random
from heapq import merge
def merge_sort(A):
if len(A) == 1:
return A
B1 = merge_sort(A[: int(math.floor(len(A)/2))])
B2 = merge_sort(A[int(math.floor(len(A)/2)):])
B = list(merge(B1, B2))
return B
def read_file():
''' () -> list of numbers
Open test.in f... |
Polarcraft/KbveBot | commands/jargon.py | # Copyright (C) 2013-2015 Samuel Damashek, Peter Foley, James Forcier, Srijay Kasturi, Reed Koser, Christopher Reffett, and Fox Wilson
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either ve... |
kajgan/stbgui | lib/python/Screens/InputDeviceSetup.py | from Screen import Screen
from Screens.HelpMenu import HelpableScreen
from Screens.MessageBox import MessageBox
from Components.InputDevice import iInputDevices, iRcTypeControl
from Components.Sources.StaticText import StaticText
from Components.Sources.List import List
from Components.config import config, ConfigYesNo... |
metabrainz/listenbrainz-server | listenbrainz/webserver/test/test_routes.py | import flask
from listenbrainz.db.testing import DatabaseTestCase
from listenbrainz.webserver import API_PREFIX
from listenbrainz.webserver.testing import ServerTestCase
class RoutesTestCase(DatabaseTestCase, ServerTestCase):
def setUp(self):
ServerTestCase.setUp(self)
DatabaseTestCase.setUp(sel... |
vhavlena/appreal | reduce/wfa/core_wfa_export.py | #!/usr/bin/python
"""
Tool for approximate reductions of finite automata used in network traffic
monitoring.
Copyright (C) 2017 Vojtech Havlena, <xhavle03@stud.fit.vutbr.cz>
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 ... |
IntelBUAP/Python3 | Evaluaciones/icazas/calc.py | #yolanda alvarez
#pedro ambrosio
#ignacio acevedo
#raul arias
#monica canizo
import os
import math
def suma():
try:
print ('{:^30}'.format('SUMA'))
num1 = int(input("Valor a: "))
num2 = int(input("Valor b: "))
print ('{} + {} = {}'.format(num1, num2, num1 + num2))
input(" ... |
PyCQA/pylint | tests/functional/ext/docparams/return/missing_return_doc_Sphinx.py | """Tests for missing-return-doc and missing-return-type-doc for Sphinx style docstrings"""
# pylint: disable=function-redefined, invalid-name, undefined-variable, missing-function-docstring
# pylint: disable=unused-argument, disallowed-name, too-few-public-methods, missing-class-docstring
# pylint: disable=unnecessary-... |
bacher09/gentoo-packages | gpackages/apps/packages/management/commands/listrepos.py | from django.core.management.base import BaseCommand, CommandError
from optparse import make_option
from package_info.porttree import porttree as portage
class Command(BaseCommand):
option_list = BaseCommand.option_list + (
make_option('-s', '--simple',
action='store_true',
dest='si... |
JamesLinEngineer/RKMC | addons/plugin.video.exodus/resources/lib/modules/playcount.py | # -*- coding: utf-8 -*-
'''
Exodus Add-on
Copyright (C) 2016 Exodus
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 opti... |
malkoto1/just_cook | backend/sources/utils/db_utils.py | __author__ = 'Vojda'
from pymongo import MongoClient
from sources.utils.skeleton import User, Recipe
from sources.utils import utils
class Databaser(object):
@classmethod
def get_db(cls, db='just_cook', host='localhost', port=27017):
client = MongoClient(host, port)
return Databaser(client[db... |
petersilva/metpx-sarracenia | sarra/plugins/msg_from_cluster.py | #!/usr/bin/python3
"""
This is used inter-pump report routing.
Select messages whose cluster is the same as the 'msg_by_cluster' setting.
msg_from_cluster DDI
msg_from_cluster DD
on_message msg_from_cluster
will select messages originating from the DD or DDI clusters.
"""
import os,stat,time
class Tr... |
sam-m888/gprime | gprime/utils/test/keyword_test.py | #
# gPrime - A web-based genealogy program
#
# Copyright (C) 2007 Donald N. Allingham
#
# 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... |
apurushottam/Github-Spider | experimental.py | """
Store here experimental short codes
"""
import requests
import json
import time
# enter user name and password for making API request with permission
username = raw_input("Enter username: ")
password = raw_input("Enter password: ")
# Extract commits for a repository and for each commit extract commiter, date
com... |
Atoku/siku | python/siku/interpolate.py | '''interpol - module for interpolation of wind data for input coordinates list
uses NMCWind as a datasource
'''
import math
from siku import geocoords
try:
from geocoords import norm_lat,norm_lon,norm_delta,norm_delta_rad
except:
norm_lat = geocoords.norm_lat
norm_lon = geocoords.norm_lon
norm_delta =... |
pminervini/recurrency | examples/utils.py | # -*- coding: utf-8 -*-
import recurrency.layers.activation as activation
def get_activation(name, shape=None):
act = None
if name == 'Linear':
act = activation.Linear()
if name == 'Sigmoid':
act = activation.Sigmoid()
if name == 'Tanh':
act = activation.Tanh()
if name == '... |
osmc/osmc | package/mediacenter-addon-osmc/src/script.module.osmcsetting.updates/resources/lib/osmcupdates/service_entry.py | # -*- coding: utf-8 -*-
"""
Copyright (C) 2014-2020 OSMC (KodeKarnage)
This file is part of script.module.osmcsetting.updates
SPDX-License-Identifier: GPL-2.0-or-later
See LICENSES/GPL-2.0-or-later for more information.
"""
import decimal
import json
import os
import random
import socket
import subpr... |
masami256/Anaconda-for-ore-ore-kernel | pyanaconda/booty/ppc.py | import string
import os
from pyanaconda.booty import BootyNoKernelWarning
from bootloaderInfo import *
from pyanaconda import iutil
class ppcBootloaderInfo(bootloaderInfo):
def getBootDevs(self, bl):
import parted
retval = []
machine = iutil.getPPCMachine()
if machine == 'pSeries... |
cative0/TheHarvester | xHarvester.py | # -*- coding: utf-8 -*-
# @CreateTime: 2017/8/4 14:25
# @CreateBy: Alvin
# @File: xHarvester.py
# @UpdateTime:
# @UpdateBy:
import os
import sys
import getopt
from theHarvester import usage
from theHarvester import start
def x_start(arg):
if len(sys.argv) < 4:
usage()
... |
heromod/migrid | mig/cgi-bin/redb.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# --- BEGIN_HEADER ---
#
# redb - [insert a few words of module description on this line]
# Copyright (C) 2003-2009 The MiG Project lead by Brian Vinter
#
# This file is part of MiG.
#
# MiG is free software: you can redistribute it and/or modify
# it under the terms of the ... |
landscapeio/prospector | prospector2/tools/base.py | # -*- coding: utf-8 -*-
class ToolBase(object):
# This is an 'abstract' base class, used to provide an indication of
# how to create a new tool class. Therefore, the arguments will be unused,
# so that is suppressed here.
# pylint: disable=unused-argument
def configure(self, prospector_config, fo... |
xiongchiamiov/mumbles | src/plugins/eggs/libnotify/setup.py | #
# THIS FILE IS PART OF THE MUMBLES PROJECT AND IS LICENSED UNDER THE GPL.
# SEE THE 'COPYING' FILE FOR DETAILS
#
# libnotify Mumbles Plugin
#
#------------------------------------------------------------------------
from setuptools import setup
import sys, os
from shutil import copy
__author__ = 'dot_j <dot_j@mumb... |
tommybobbins/ChristmasUnicornHat | ukfast.py | #!/usr/bin/env python
import unicornhat as unicorn
import time, colorsys
from matrix import ukfast
def christmas_tree():
unicorn.brightness(0.4)
r = int(0)
g = int(255)
b = int(0)
rt = int(102)
gt = int(51)
bt = int(0)
unicorn.set_pixel(0,5,255,0,0)
unicorn.set_pixel(1,5,r,... |
onoga/wm | bin/wmserv.py | #!/usr/bin/env python
import os
import sys
HOST = None
PORT = 8000
def main(host=None, port=None):
if port is None:
try:
port = int(host)
host = None
except:
pass
if host is None:
host = HOST
if host is None:
import socket
host = socket.gethostbyname(socket.gethostname())
os.chdir(os.path.ab... |
jvlomax/Beaker-bot | disabled plugins/NSFW.py | __author__ = 'george'
import httplib
from baseclass import Plugin
from apscheduler.scheduler import Scheduler
class NSFW(Plugin):
def __init__(self, skype):
super(NSFW, self).__init__(skype)
self.daily_channels = ["#stigrk85/$jvlomax;b43a0c90a2592b9b"]
self.sched = Scheduler()
se... |
voldedore/ShippingManager-IncomeCalculator | SM/incomeCalc/models.py | from django.db import models
# Create your models here.
class BoatType(models.Model):
Name = models.CharField(max_length=30)
def __str__(self):
return self.Name
class Boat(models.Model):
Name = models.CharField(max_length=50)
Cost = models.IntegerField(default=0)
Size = models.IntegerFiel... |
seankelly/buildbot | master/buildbot/worker/protocols/null.py | # 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... |
labordus/cornice | tray.py | # tray.py: system tray support
# arch-tag: system tray support
# author: Alberto Griggio <agriggio@users.sourceforge.net>
# license: GPL
import wx
import common
__all__ = ['show_tray_icon']
_supported = getattr(wx, 'TaskBarIcon', None) is not None
if _supported:
def show_tray_icon(app):
tbicon = wx.Task... |
cni/widgets | python/saveTriggers.py | #!/usr/bin/env python
import serial
import sys, signal, time
from datetime import datetime
# Be sure to set this to the correct device! Under linux, it is something
# like /dev/ttyACM0. On OSX, it will be /dev/ttyUSBNNNN, where NNNN is
# some cryptic number. On windows, it will be a COM port (e.g., COM4).
device = '/... |
stephengroat/miasm | miasm2/jitter/codegen.py | """
Module to generate C code for a given native @block
"""
import miasm2.expression.expression as m2_expr
from miasm2.ir.ir import IRBlock, AssignBlock
from miasm2.ir.translators import Translator
from miasm2.core.asmblock import expr_is_label, AsmBlockBad, AsmLabel
# Miasm to C translator
TRANSLATOR = Translator.to... |
openstates/openstates | openstates/pa/people.py | import re
import lxml.html
from pupa.scrape import Scraper, Person
from . import utils
class PALegislatorScraper(Scraper):
def scrape(self, chamber=None):
chambers = [chamber] if chamber is not None else ["upper", "lower"]
for chamber in chambers:
yield from self.scrape_chamber(chamb... |
fkie-cad/FACT_core | src/test/integration/storage/test_db_interface_view_sync.py | import gc
from storage.db_interface_view_sync import ViewReader, ViewUpdater
from storage.MongoMgr import MongoMgr
from test.common_helper import get_config_for_testing
CONFIG = get_config_for_testing()
TEST_DATA = b'test data'
def test_view_sync_interface():
mongo_server = MongoMgr(config=CONFIG)
view_upd... |
MichaelMauderer/GeneaCrystal | geneacrystal/helpSystem.py | # GeneaCrystal Copyright (C) 2012-2013
# Christian Jaeckel, <christian.doe@gmail.com>
# Frederic Kerber, <fkerber@gmail.com>
# Pascal Lessel, <maverickthe6@gmail.com>
# Michael Mauderer, <mail@michaelmauderer.de>
#
# GeneaCrystal is free software: you can redistribute it and/or modify
# it under the ... |
jmastr/aesfs | cryptr.py | #!/usr/bin/env python
# This file is part of AesFS: an encryption filesystem for FUSE based on AES.
# Copyright 2016 (c) by jmastr
#
# AesFS 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... |
CertainlyUncertain/Kinetic-Gunner-Gunner-of-Angst | sndMgr.py | # ========================== Start Copyright Notice ========================== #
# #
# Copyright 2014 F.D.I.S. #
# This file is part of Kinetic Gunner: Gunner of Angst ... |
tuffery/Frog2 | frowns/test/.happydoc.test_parsers.py | (S'46a804d990b21c29578a8cc95cdf6157'
p1
(ihappydoclib.parseinfo.moduleinfo
ModuleInfo
p2
(dp3
S'_namespaces'
p4
((dp5
(dp6
S'test'
p7
(ihappydoclib.parseinfo.functioninfo
FunctionInfo
p8
(dp9
g4
((dp10
(dp11
tp12
sS'_exception_info'
p13
(dp14
sS'_parameter_names'
p15
(tsS'_parameter_info'
p16
(dp17
sS'_filename'
p18
S'... |
adaptive-learning/robomission | backend/learn/tests/test_export.py | import pytest
from learn.export import ProgramSnapshotSerializer
from learn.export import ProgramSnapshotsViewSet
from learn.models import Student, Task, TaskSession, ProgramSnapshot
@pytest.mark.slow
@pytest.mark.django_db
def test_export_is_fast_enough():
# Create a lot of ProgramSnapshots
n_snapshots = 10... |
shlomif/patool | patoolib/__init__.py | # -*- coding: utf-8 -*-
# Copyright (C) 2010-2012 Bastian Kleineidam
#
# 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.
#... |
leiyangleon/FSH | scripts_Py3/create_mosaic.py | # This is the Python script for the generation of the final mosaic map of FSH
# Yang Lei, Jet Propulsion Labortary, California Institute of Technology
# May 18, 2017
import xml.etree.ElementTree as ET
from numpy import *
import scipy.io as sio
import subprocess
import os
import time
import argparse
import pdb
from osg... |
jrabenoit/skellify | iterator.py | #!/usr/bin/env python
from collections import defaultdict
import pprint
import itertools
import numpy as np
import copy
import featsel, decomp, mltools, results
import re
def ParameterSets(iX_train, iX_test, iy_train, iy_test, iter_n):
# param_set_list = list(itertools.product(featsel.feat_sel_dict.keys(),decomp.... |
FedeMPouzols/Savu | savu/plugins/loaders/mm_loader.py | # Copyright 2014 Diamond Light Source Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... |
rafamelo12/cuidando2 | projeto/projeto/forms.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from deform import widget
from pyramid_deform import CSRFSchema
from colander import (
MappingSchema,
SchemaNode,
String,
Integer,
Length,
Regex,
Function,
Email,
Mapping,
All,
Invalid,
)
from .models import Cidadao
def record_... |
PhilippeGeek/CodINSALyon | expansion_management.py | import sys
from base_ai import BaseAI
import random
from command import MoveCommand
from command import LandCommand
from command import ExchangeResourcesCommand
from command import DropMilitarsCommand
from command import ExchangeResourcesCommand
from model import Base
from model import Coord
from model import Plane
fr... |
ThQ/qd | translaters/dirt/__init__.py | import re
import sop
class Translater (sop.Translater):
re_line = None
re_int = None
re_float = None
re_string = None
re_argument = None
re_bool = None
def initialize(self):
res_positive_int = "\d+"
res_int = "-?" + res_positive_int
res_positive_float = res_positive_int + "\.(?:... |
boxbillinggit/RPI_bmw-infotainment | plugin/plugin.service.bmw-infotainment/resources/lib/signaldb.py | """
Interface for handling signals in a convenient way. By using a human-readable reference-
names when working with signals, instead of handling 'hard-to-read' raw bytearrays.
All signals is now defined in one XML-database instead of spread-out everywhere in the
code. Module returns a signal represented in a hex-strin... |
bigswitch/snac-nox | src/nox/apps/directory/cidr_group_cache.py | # Copyright 2008 (C) Nicira, Inc.
#
# This file is part of NOX.
#
# NOX 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.
#
# NOX is d... |
bhanu-mnit/EvoML | evoml/subsampling/mutators.py | # -*- coding: utf-8 -*-
"""
Copyright 2016 Bhanu Pratap and Harsh Nisar.
This file is part of the Evoml library.
The Evoml library is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License v3 or later.
Check the licesne file recieved along with the softwar... |
outboxafrica/pimaa | PiMaa/outputs/xively.py | import output
import requests
import json
class Xively(output.Output):
requiredData = ["APIKey","FeedID"]
optionalData = []
def __init__(self,data):
self.APIKey=data["APIKey"]
self.FeedID=data["FeedID"]
def outputData(self,dataPoints):
arr = []
for i in dataPoints:
arr.append({"id":i["name"],"current_va... |
Oksisane/RSS-Bot | Trolly-master/trolly/checklist.py | """
Created on 13 Nov 2012
@author: plish
"""
from trolly.trelloobject import TrelloObject
class Checklist(TrelloObject):
"""
Class representing a Trello Checklist
"""
def __init__(self, trello_client, checklist_id, name=''):
super(Checklist, self).__init__(trello_client)
self.id =... |
gitberg-temp/gitberg-archive | gitenberg/tests/test_fetch.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import unittest
from gitenberg.book import Book
from gitenberg.fetch import BookFetcher
class TestBookFetcher(unittest.TestCase):
def setUp(self):
self.book = Book(1283, library_path='./test/library')
self.fetcher = BookFetcher(self.book)
... |
jmsandy/ufsj | paa/sort_test.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for sorting algorithms.
Responsible for triggering sorting algorithms: SelectionSort, HeapSort, QuickSort, ShellSort,
MergeSort and CooktailSort, measuring the amount of exchanges, number of comparisons and
time spent for collections with 25, 500, 10000, 200000, ... |
Priyansh2/test | web2py/cookbook/controllers/default.py | def index():
if auth.is_logged_in():
response.flash = T("WELCOME")
if len(request.args):
page=int(request.args[0])
else:
page=0
items_per_page=4
limitby=(page*items_per_page,(page+1)*items_per_page+1)
rows=db(db.image.id>0).sele... |
jcdoll/PiezoD | python/archive/performance.py | from cantilever_divingboard import *
def optimize_cantilever(x0):
c = cantilever_divingboard(*x0)
return c.force_resolution()
# def cantilever_constraints(foo):
# c = cantilever_divingboard(*foo)
#
# min_thickness = 1e-6
# min_length = 20e-6
# min_width = 5e-6
#
# enforce... |
markgw/jazzparser | src/jazzparser/parsers/cky/parser.py | """CKY parser implementation.
This is the basic parser component of the jazz chord interpretation system.
This does all of the basic CKY parsing routine, but is unaware of the
formalism, rule set, etc.
"""
"""
============================== License ========================================
Copyright (C) 2008, 2010-1... |
alfa-jor/addon | plugin.video.alfa/channels/legalmentegratis.py | # -*- coding: utf-8 -*-
# -*- Channel Legalmente Gratis -*-
# -*- Created for Alfa-addon -*-
# -*- By the Alfa Develop Group -*-
import re
import urllib
from channelselector import get_thumb
from core import httptools
from core import scrapertools
from core import servertools
from core import tmdb
from cor... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.