code stringlengths 2 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int32 2 1.05M |
|---|---|---|---|---|---|
# -*- coding: utf-8 -*-
#
# This file is part of EventGhost.
# Copyright (C) 2005-2009 Lars-Peter Voss <bitmonster@eventghost.org>
#
# EventGhost is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License version 2 as published by the
# Free Software Foundation... | garbear/EventGhost | tools/builder/Config.py | Python | gpl-2.0 | 2,405 |
from daversy.utils import *
from daversy.db.object import TableColumn, Table, DbObject
from column import TableColumnBuilder
from primary_key import PrimaryKeyBuilder
from unique_key import UniqueKeyBuilder
from constraint import CheckConstraintBuilder
YESNO_MAPPING = {'Y':'true', 'N': 'false'}
clas... | kalyptorisk/daversy | src/daversy/db/oracle/table.py | Python | gpl-2.0 | 3,444 |
import sys
VERSION = (1, 6, 5)
def get_version():
return '.'.join(map(str, VERSION))
PY2 = sys.version_info[0] == 2
PY3 = sys.version_info[0] == 3
def python_2_unicode_compatible(klass):
"""
A decorator that defines __unicode__ and __str__ methods under Python 2.
Under Python 3 it does nothing.
... | LPgenerator/django-mmc | mmc/__init__.py | Python | gpl-2.0 | 853 |
#!/usr/bin/env python
from runtest import TestBase
import subprocess as sp
TDIR='xxx'
TIME=0
UNIT=''
class TestCase(TestBase):
def __init__(self):
TestBase.__init__(self, 'sleep', """
# DURATION TID FUNCTION
[27437] | main() {
[27437] | foo() {
2.241 us [27437] | m... | thepaul/uftrace | tests/t135_trigger_time2.py | Python | gpl-2.0 | 1,522 |
#!/bin/python
# -*- coding: utf-8 -*-
#
###########################################################################
#
# Copyright 2014-18 Bryan Selner
#
# 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 th... | selner/job_scooper_v4 | python/pyJobNormalizer/task_tokenize_jobtitles.py | Python | gpl-2.0 | 5,426 |
# https://leetcode.com/explore/featured/card/february-leetcoding-challenge-2021/584/week-1-february-1st-february-7th/3628/
# Longest Harmonious Subsequence
# We define a harmonious array as an array where the difference between its maximum value and its minimum value is exactly 1.
# Given an integer array nums, retur... | floringrigoriu/Algorthitms | Leetcode2021/Monthly/February/feb4.py | Python | gpl-2.0 | 1,721 |
#! /usr/bin/env python
# check2.py - check the scanner used in Wisent
#
# Copyright (C) 2010 Jochen Voss <voss@seehuhn.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 ... | seehuhn/wisent | check2.py | Python | gpl-2.0 | 1,558 |
from Components.Harddisk import harddiskmanager
from config import ConfigSubsection, ConfigYesNo, config, ConfigSelection, ConfigText, ConfigNumber, ConfigSet, ConfigLocations, ConfigSelectionNumber, ConfigClock, ConfigSlider, ConfigEnableDisable, ConfigSubDict, ConfigNothing
from Tools.Directories import resolveFilena... | kingvuplus/Test-OBH | lib/python/Components/UsageConfig.py | Python | gpl-2.0 | 31,665 |
import pandas as pd
import csv
LOC = "Location"
def run(excel_file):
excel_sheet = pd.ExcelFile(excel_file)
sheet_name = excel_sheet.sheet_names[0]
pref_data = excel_sheet.parse(sheet_name)
headings = [_ for _ in pref_data.head()]
writers = {}
files = []
count = len(pref_data.index)
for i in range... | Unit4TechProjects/ChoiceOptimization | pref_parser.py | Python | gpl-2.0 | 906 |
# -*- coding: utf-8 -*-
#
# msmbuilder documentation build configuration file, created by
# sphinx-quickstart on Mon Nov 5 15:08:06 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.
#
# ... | mpharrigan/msmbuilder | docs/sphinx/conf.py | Python | gpl-2.0 | 9,931 |
# -*- coding: utf-8 -*-
"""
brickv (Brick Viewer)
Copyright (C) 2012, 2014 Matthias Bolte <matthias@tinkerforge.com>
config_macosx.py: Config Handling for Mac OSX
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... | D4wN/brickv | src/brickv/config_macosx.py | Python | gpl-2.0 | 3,932 |
#!/usr/bin/python
from base import Persistence
class FileError(Persistence):
def __getattr__(self, attribute):
if attribute=='sourcefile':
return self.dms.sourcefile.get_by_id(self.filename)
elif attribute=='error':
return self.dms.error.get_by_id(self.err_id)
else... | tLDP/lampadas | pylib/persistence/file_error.py | Python | gpl-2.0 | 391 |
#!/usr/bin/env python
# Copyright (C) 2015 University of Southern California and
# Nan Hua
#
# Authors: Nan Hua
#
# 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, eith... | ursinedeity/alab | alab/files.py | Python | gpl-2.0 | 15,092 |
# Copyright 2013 Simonas Kazlauskas
# 2014-2020 Nick Boultbee
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
fr... | Meriipu/quodlibet | quodlibet/util/cover/manager.py | Python | gpl-2.0 | 11,412 |
"""
Provides a number of dataproviders which are associated with
removable devices such as USB keys.
It also includes classes specific to the ipod.
This file is not dynamically loaded at runtime in the same
way as the other dataproviders as it needs to be loaded all the time in
order to listen to HAL events
Copyright... | GNOME/conduit | conduit/modules/iPodModule/iPodModule.py | Python | gpl-2.0 | 37,264 |
from suds import WebFault
class AccountFault(RuntimeError):
pass
class ConnectError(RuntimeError):
pass
class ApiLimitError(RuntimeError):
pass
class ListFault(RuntimeError):
pass
class TableFault(RuntimeError):
pass
class ServiceError(WebFault):
pass
| jslang/responsys | responsys/exceptions.py | Python | gpl-2.0 | 288 |
#!/usr/bin/env python
# This Python file uses the following encoding: utf-8
# vim: set autoindent:
# Copyright (C) 2013 Viljo Viitanen
#
# 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 ... | viljoviitanen/tvkaista-touch-public | test.py | Python | gpl-2.0 | 5,838 |
# version of psyplot
__version__ = "1.3.0"
| Chilipp/psyplot | psyplot/version.py | Python | gpl-2.0 | 44 |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
#
# Interpreter version: python 2.7
#
# Imports =====================================================================
import time
import os.path
from string import Template
from tempfile import NamedTemporaryFile
import pyqrcode
from translator import gen_pdf
# Variabl... | edeposit/edeposit.amqp.pdfgen | src/edeposit/amqp/pdfgen/specialization.py | Python | gpl-2.0 | 3,119 |
"""
Implement the basic small loop antenna equations developed by Ted Hart
Using the parameters in first test in loop_test.py and setting the shape
to a circle, the formulas below duplicate the Excel spreadsheet created by
Steve Yates, which is available at: http://www.aa5tb.com/loop.html
-Jonathan Cameron, KF6RTA
2... | jmcameron/antennas | loop.py | Python | gpl-2.0 | 5,266 |
#!/usr/bin/env python
import logging
import bs4
from .Node import Node
log = logging.getLogger("Thug")
class DocumentFragment(Node):
def __init__(self, doc):
self.tag = bs4.Tag(parser = doc, name = 'documentfragment')
Node.__init__(self, doc)
self.__init_documentfragment_personality()
... | buffer/thug | thug/DOM/W3C/Core/DocumentFragment.py | Python | gpl-2.0 | 2,466 |
from src import router
from src.li.Li import Li
#from src.tools.addonSettings import string as st
class CollectionSettingsLi(Li):
def __init__(self, collection=None):
if collection:
title, icon, thumb = collection.feedSettings.TS.settingsVisuals()
url = router.editCollectionUrl(coll... | SportySpice/Collections | src/li/types/CollectionSettingsLi.py | Python | gpl-2.0 | 1,084 |
from django.contrib.auth.decorators import login_required, permission_required
from django.views.generic.edit import CreateView, UpdateView, DeleteView
from django.contrib.admin.views.decorators import staff_member_required
from django.http import HttpResponseRedirect, HttpResponse, HttpRequest
from formtools.wizard.vi... | inverse-inc/packetfence-pki | pki/views.py | Python | gpl-2.0 | 33,294 |
from impacket import ntlm
import struct
# Hexdump packets
import string
def pretty_print(x):
if x in '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~ ':
return x
else:
return '.'
def hexdump(data):
x=str(data)
strLen = len(x)
i = 0
... | prasadtalasila/INET-Vagrant-Demos | Nonce_Demo/impacket-0.9.12/impacket/testcases/SMB_RPC/test_ntlm.py | Python | gpl-2.0 | 10,690 |
from typing import Dict, List, Optional
import fsui
# from fsgamesys.input2.dataclasses import InputDevice
from fsgamesys.input.inputdevice import InputDevice
from fsgamesys.input.inputservice import useInputService
from fsgamesys.platforms.platform import Platform
from fswidgets.widget import Widget
from launcher.co... | FrodeSolheim/fs-uae-launcher | launcher/gui/components/inputportdeviceselector.py | Python | gpl-2.0 | 10,038 |
from django.contrib.auth.models import User
from rest_framework import serializers
from home.models import Home, Member
class UserSerializer(serializers.ModelSerializer):
class Meta:
model = User
fields = ('id', 'url', 'username', 'email', 'is_staff')
class HomeSerializer(serializers.ModelSerial... | birkholz/homeboard | home/serializers.py | Python | gpl-2.0 | 767 |
# -*- coding: iso-8859-1 -*-
# -----------------------------------------------------------------------
# headlines.py - a simple plugin to listen to headlines
# -----------------------------------------------------------------------
# $Id$
#
# Notes:
# Todo:
# activate:
# plugin.activate('headlines', level=45)
# HEADLI... | freevo/freevo1 | src/plugins/headlines.py | Python | gpl-2.0 | 8,448 |
#!/usr/bin/env python3
__author__ = "Jannik Hauptvogel"
__maintainer__ = "Jannik Hauptvogel"
__email__ = "JannikHv@gmail.com"
__twitter__ = "https://twitter.com/JannikHv"
__git__ = "https://github.com/JannikHv/gydl"
__aur__ = "https://aur.archlinux.org/packages/gydl-git/"
__credits__ = "rg... | JannikHv/gydl | src/gydl.py | Python | gpl-2.0 | 10,720 |
# In[5]:
from docx import Document
import os
import pandas as pd
# In[11]:
docs = os.listdir("./Desktop/projectText/")
docs.remove("110704__Sulman_Award_list.docx") #this doc has a left column full of dates
docs.remove("131021__PlantBank_building_info.docx")#this doc is an article
#docs# = docs[:10]
# In[12]:
... | notionparallax/ShadowWolf | Helper scripts/wordScraping/word-helper.py | Python | gpl-2.0 | 10,153 |
########################################################################
# Copyright (C) 2002 Jacob Smullyan <smulloni@smullyan.org>
#
# You may distribute under the terms of either the GNU General
# Public License or the SkunkWeb License, as specified in the
# README file.
##########################... | drewcsillag/skunkweb | pylibs/containers/fieldcontainer.py | Python | gpl-2.0 | 5,479 |
from resources.lib.externals.hachoir.hachoir_parser.audio.aiff import AiffFile
from resources.lib.externals.hachoir.hachoir_parser.audio.au import AuFile
from resources.lib.externals.hachoir.hachoir_parser.audio.itunesdb import ITunesDBFile
from resources.lib.externals.hachoir.hachoir_parser.audio.midi import MidiFile
... | azumimuo/family-xbmc-addon | plugin.video.bubbles/resources/lib/externals/hachoir/hachoir_parser/audio/__init__.py | Python | gpl-2.0 | 898 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import csv
publ = 0
xud = 0
uchn = 0
with open("./tables/source_post1950_wordcount_by_words.csv", encoding="utf-8") as csv_file:
reader = csv.DictReader(csv_file)
with open("./tables/source_post1950_wordcount_by_genres.csv", "w", encoding="utf-8") as out_file:
writer = ... | mkurg/study | exam/balance_genres.py | Python | gpl-2.0 | 939 |
from django.contrib import admin
from main.models import Contact
admin.site.register(Contact)
| Nimmard/james-olson.com | main/admin.py | Python | gpl-2.0 | 96 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# ############################################################################
# cli.py
# Authors:
# * -kc- <kevin.cousot at gmail.com>
# * Rider Carrion <rider.carrion at gmail.com>
# Description:
# This file is a modified version of python 2.7 cmd module which can be fo... | imclab/yatot | src/yatot/cli.py | Python | gpl-2.0 | 12,800 |
import climatelearn.preprocess.generating_targets | Ambrosys/climatelearn | climatelearn/preprocess/__init__.py | Python | gpl-2.0 | 49 |
import logging, re, uuid
from autotest.client.shared import error
from virttest import utils_test
@error.context_aware
def run_usb_storage(test, params, env):
"""
Test usb storage devices in the guest.
1) Create a image file by qemu-img
2) Boot up a guest add this image as a usb device
3) Check u... | rbbratta/virt-test | qemu/tests/usb_storage.py | Python | gpl-2.0 | 8,307 |
import pytest
from cfme import test_requirements
from cfme.infrastructure import pxe
from cfme.infrastructure.provider import InfraProvider
pytestmark = [
pytest.mark.usefixtures('uses_infra_providers'),
pytest.mark.tier(2),
pytest.mark.provider([InfraProvider], required_fields=[('iso_datastore', True)])... | izapolsk/integration_tests | cfme/tests/infrastructure/test_iso_datastore.py | Python | gpl-2.0 | 1,007 |
# -*- coding: utf-8 -*-
"""
Created on Thu Oct 02 08:41:08 2014
@author: Acer
"""
import sys
import pycd3
#class NodeFactoryDistributor(pycd3.INodeFactory):
# def __init__(self, node):
# pycd3.INodeFactory.__init__(self)
# self.node = node
# print "NodeFactory.__init__"
#
# def get... | iut-ibk/DynaMind-ToolBox | DynaMind-Performance-Assessment/3rdparty/CD3Waterbalance/Module/Distributor.py | Python | gpl-2.0 | 1,814 |
# -*- coding: utf-8 -*-
'''
Python wrapper for the the python requests package
It is a convienience lib of common code used by
several gentoo utilities.
Copyright:
(c) 2013 Brian Dolbec
Distributed under the terms of the GPL-2 license
Author(s):
Brian Dolbec <dolsen@gentoo.org>
'''
__vers... | dol-sen/ssl-fetch | sslfetch/__init__.py | Python | gpl-2.0 | 334 |
from numpy import dtype, array
import random
import colorama
import itertools
import pygame
import os, sys
class spritesheet(object):
def __init__(self, filename):
try:
self.sheet = pygame.image.load(filename).convert()
except pygame.error, message:
print 'Unable to load sp... | milkey-mouse/h4x0r | haxrender/haxrender.py | Python | gpl-2.0 | 11,079 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.11 on 2018-04-16 23:42
from django.db import migrations
def rename_sources(apps, schema_editor):
Source = apps.get_model("common", "Source")
Instrument = apps.get_model("common", "Instrument")
Source.objects.filter(instrument_language = 'Mandarin').upda... | langcog/wordbank | instruments/migrations/0040_rename_mandarin_to_mandarin_beijing.py | Python | gpl-2.0 | 1,429 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('silo', '0002_silo_shared'),
]
operations = [
migrations.CreateModel(
name='DocumentationApp',
fields... | mercycorps/tola | htdocs/silo/migrations/0003_documentationapp_faq_feedback.py | Python | gpl-2.0 | 1,933 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
__doc__ = """
Simple LinuxCNC WebSocket Position Logger
"""
import time
import math
import sys
import linuxcnc
from ws4py.client.threadedclient import WebSocketClient
class PosLogger(object):
def __init__(self, host):
self.lcncstat = linuxcnc.stat() # create a connection t... | tinkercnc/LinuxCNC2Websocket | ws-pos-logger.py | Python | gpl-2.0 | 1,514 |
#!/usr/bin/env python
#
# Copyright (C) 2012 UNINETT AS
#
# This file is part of Network Administration Visualized (NAV).
#
# NAV is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License version 2 as published by
# the Free Software Foundation.
#
# This program is d... | alexanderfefelov/nav | tools/eventgenerators/servicestate.py | Python | gpl-2.0 | 2,990 |
from unittest import TestCase
from mock import patch
from brainiak.server import Application
class ServerTestCase(TestCase):
@patch("brainiak.server.log.initialize", side_effect=RuntimeError())
@patch("brainiak.server.event_bus.initialize")
@patch("brainiak.server.sys.exit")
def test_init_raises_exce... | bmentges/brainiak_api | tests/integration/test_server.py | Python | gpl-2.0 | 462 |
import json
import sys
import os
import requests
sys.path.append(
os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir)))
from helpers.geo_helpers import calculate_centroid, geo_distance
class OverpassApi(object):
def __init__(self):
"""OverpassAPI connector, tot retrieve building... | geoio/osmhunter-backend | app/classes/OverpassApi.py | Python | gpl-2.0 | 5,848 |
import random
def generate_flashvideo(url, options):
id = str(random.randint(0, 1000000))
return \
"""
<div id="%s"><a href="http://www.macromedia.com/go/getflashplayer">Get the Flash Player</a> to see this player.</div>
<script type="text/javascript">
var s1 = new SWFObject("++resource++player.swf","player",... | uwosh/uwosh.flashpage | uwosh/flashpage/generators.py | Python | gpl-2.0 | 592 |
from rest_framework import serializers
from principal.models import Tarea
class TareaSerializer(serializers.ModelSerializer):
class Meta:
model = Tarea
fields = ('id', 'resumen', 'descripcion','esfuerzo','estado','realizador','historia','proyecto','creador') | david11988/Scrumco | principal/serializers.py | Python | gpl-2.0 | 280 |
"""Plugin to include songs to the songbook."""
import glob
import logging
import os
import textwrap
import jinja2
from patacrep.content import process_content, validate_parser_argument
from patacrep.content import ContentError, ContentItem, ContentList
from patacrep import files, errors
LOGGER = logging.getLogger(_... | patacrep/patacrep | patacrep/content/song.py | Python | gpl-2.0 | 6,539 |
'''
Created on 2013-10-24
@author: zhangzhi
@contact: z2care@gmail.com
'''
from abc import ABCMeta, abstractmethod
class Target():
__metaclass__ = ABCMeta
@abstractmethod
def request(self): pass
class Client(Target):
def request(self):
print('Client')
class Adaptee:
def specificRequest(... | z2care/DP4Py | Structural/Adapter/Object.py | Python | gpl-2.0 | 584 |
import datetime
import time
import sys
import MySQLdb
from MySQLdb.constants import *
import argparse
import random
import threading
import traceback
NUM_WORKERS = 10
def parse_args():
parser = argparse.ArgumentParser(
'sql_stats_snapshot_stress',
description='Generate load populating sql stats an... | facebook/mysql-5.6 | mysql-test/t/sql_stats_snapshot_stress.py | Python | gpl-2.0 | 3,800 |
from fabric.api import local, run, cd, sudo, env
from fabric.contrib.console import confirm
env.hosts = ['almarinho.com.br']
env.user = 'almarinho'
def prepare_deploy():
local("git add --all && git commit")
local("git push")
def deploy():
code_dir = '/home/almarinho/almarinho'
with cd(code_dir):
... | lyralemos/almarinho | fabfile.py | Python | gpl-2.0 | 387 |
#
# Manage registers in a hardware design
#
# Copyright (C) 2008 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... | dallingham/regenerate | regenerate/importers/ipxact.py | Python | gpl-2.0 | 7,845 |
# -*- 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/patron_types/test_patron_types_api.py | Python | gpl-2.0 | 2,114 |
class hashdict(dict):
"""
hashable dict implementation, suitable for use as a key into
other dicts.
based on answers from
http://stackoverflow.com/questions/1151658/python-hashable-dicts
"""
def __key(self):
return tuple(sorted(self.items()))
def __repr__(self):
re... | Godley/Music-Library | implementation/primaries/ExtractMetadata/classes/hashdict.py | Python | gpl-2.0 | 1,914 |
#!/usr/bin/python
import sys;
from structs import structs;
# command line arguments
arch = sys.argv[1];
outfile = sys.argv[2];
archs = sys.argv[3:];
f = open(outfile, "w");
f.write('''
/*
* sanity checks for generated foreign headers:
* - verify struct sizes
*
* generated by %s -- DO NOT EDIT
*/
#include ... | UVP-Tools/UVP-Tools | uvp-xenpv/others/RHEL4/include/xen/interface/foreign/mkchecker.py | Python | gpl-2.0 | 1,265 |
# -*- coding: UTF-8 -*-
#######################################################################
# ----------------------------------------------------------------------------
# "THE BEER-WARE LICENSE" (Revision 42):
# @tantrumdev wrote this file. As long as you retain this notice you
# can do whatever you want wit... | repotvsupertuga/tvsupertuga.repository | script.module.streamtvsupertuga/lib/resources/lib/sources/en/cinemamega.py | Python | gpl-2.0 | 6,030 |
"""
:mod:`Interaction` -- interaction module
==========================================================================
In this module, you will find the funcionality for the :term:`Interactive mode`.
When you enter in the Interactive Mode, Pyevolve will automatic import this module
and exposes to you in the name spa... | HyperloopTeam/FullOpenMDAO | lib/python2.7/site-packages/Pyevolve-0.6-py2.7.egg/pyevolve/Interaction.py | Python | gpl-2.0 | 2,797 |
import os
import ConfigParser
import yaml
# you may need to tweak this
dir = '/srv/chains/lib/chains/config/service-classes'
for f in os.listdir(dir):
if f[0] == '.':
continue
ext = f.split('.').pop()
if ext != 'conf':
continue
oldPath = dir + '/' + f
newPath = dir + '/%s.yml' % ... | ChainsAutomation/chains | misc/migrations/02-service-config-classes-conf-to-yml.py | Python | gpl-2.0 | 807 |
# osutil.py - pure Python version of osutil.c
#
# Copyright 2009 Matt Mackall <mpm@selenic.com> and others
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2, incorporated herein by reference.
import os
import stat as _stat
posixfile = file
def _mode_t... | dkrisman/Traipse | mercurial/osutil.py | Python | gpl-2.0 | 1,476 |
from WMS.models import db
class Place(db.Model):
id = db.Column(db.Integer, primary_key=True)
place = db.Column(db.String(255), unique=True)
person = db.relationship("Account", backref="place", lazy='dynamic')
storage = db.relationship("Storage", backref="place", lazy='dynamic')
order = db.relation... | SR1s/WMS | WMS/models/Place.py | Python | gpl-2.0 | 669 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import datetime
from django.utils.timezone import utc
class Migration(migrations.Migration):
dependencies = [
('mainAcad', '0001_initial'),
]
operations = [
migrations.RemoveField(
... | MCRSoftwares/AcadSocial | mainAcad/migrations/0002_auto_20150122_1200.py | Python | gpl-2.0 | 1,409 |
import os
import re
import subprocess
import pytest
TEST_ROOTS = os.path.join(os.path.dirname(__file__), 'test_roots')
BYTECOMPILE_SCRIPT = 'brp-python-bytecompile.py'
BRP_PYTHON_BYTECOMPILE = os.path.join(os.path.dirname(__file__), '..', BYTECOMPILE_SCRIPT)
LOG_MSG_PREFIX = 'pptools.bytecompile'
def run_bytecompil... | fedora-python/pypackages-tools | tests/test_bytecompile_dry_runs.py | Python | gpl-2.0 | 7,848 |
import logging
import os
import time
from autotest.client.shared import error
from autotest.client import utils
from virttest import utils_test, remote, virt_vm, utils_misc, qemu_monitor
from provider_lib import cpuflags
@error.context_aware
def run(test, params, env):
"""
KVM multi-host migration test:
... | spcui/tp-qemu | qemu/tests/migration_multi_host_firewall_block.py | Python | gpl-2.0 | 10,912 |
"""
/***************************************************************************
DelimitationToolbox
delimitation.py A QGIS plugin
Various tools for electoral delimitation
-------------------
begin : 2014-07-06
git sha : ... | seanlinmt/DelimitationToolbox | graph.py | Python | gpl-2.0 | 2,378 |
#
# Copyright (C) 2015 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This program is distributed in the hope that it will be... | fedora-copr/dnf-plugins-core | plugins/migrate.py | Python | gpl-2.0 | 1,960 |
from AlgsSedgewickWayne.ST import ST
class SparseVector(object):
def __init__(self, d):
self._d = d # dimension
self.st = new ST<Integer, Double>() # the vector, represented by index-value pairs
def put(self, i, value):
"""Sets the ith coordinate of self vector to the specified value."""
if i < 0... | dvklopfenstein/PrincetonAlgorithms | py/AlgsSedgewickWayne/SparseVector.py | Python | gpl-2.0 | 2,112 |
# Copyright © 2018-2019 Red Hat, Inc.
#
# This file is part of Bodhi.
#
# 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.
... | fedora-infra/bodhi | devel/ci/integration/tests/fixtures/backend.py | Python | gpl-2.0 | 2,309 |
# -*- coding: utf-8 -*-
# **********************************************************************
#
# Copyright (c) 2003-2017 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.
#
# ***********************************... | ljx0305/ice | cpp/test/IceGrid/distribution/test.py | Python | gpl-2.0 | 1,657 |
#!/usr/bin/env python
# -*- coding: utf8 -*-
"""
Rolls auto-search, Listen, and Spot for players
Written by Christopher Durien Ward
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... | bagelbits/dnd-3.5-tools | dm-tools/perception_checks.py | Python | gpl-2.0 | 2,139 |
# 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
# need to add the utilities class. Want 'home' to be platform independent
from os.path import expanduser
home ... | prheenan/prhUtil | igor/scripts/SqlAutoGen/main.py | Python | gpl-2.0 | 1,473 |
import pytest
from cfme.middleware import get_random_list
from cfme.middleware.domain import MiddlewareDomain
from cfme.middleware.server_group import MiddlewareServerGroup
from utils import testgen
from utils.version import current_version
pytestmark = [
pytest.mark.usefixtures('setup_provider'),
pytest.mark.... | kzvyahin/cfme_tests | cfme/tests/middleware/test_middleware_server_group.py | Python | gpl-2.0 | 3,766 |
from unittest import TestCase
from pcs.cli.constraint_ticket import parse_args
from pcs.cli.common.errors import CmdLineInputError
class ParseAddTest(TestCase):
def test_parse_add_args(self):
self.assertEqual(
parse_args.parse_add(
["T", "resource1", "ticket=T", "loss-policy=f... | feist/pcs | pcs_test/tier0/cli/constraint_ticket/test_parse_args.py | Python | gpl-2.0 | 2,347 |
# Copyright (c) David Wilson 2015
# Icarus 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.
# Icarus is distributed in the hope that it... | jeroanan/GameCollection | UI/Tests/Handlers/TestAllGamesHandler.py | Python | gpl-3.0 | 2,636 |
# Copyright 2013 (C) Adam Greig
#
# This file is part of habitat.
#
# habitat 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.
#
# habit... | ukhas/habitat | habitat/tests/test_parser_modules/test_simple_binary_parser.py | Python | gpl-3.0 | 4,466 |
# Copyright (C) 2012 Aldo Cortesi
#
# 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.
#
# This program is distributed in ... | bacemtayeb/Tierra | src/lib/libmproxy/console/flowdetailview.py | Python | gpl-3.0 | 3,560 |
# Copyright (C) 2012,2013
# Max Planck Institute for Polymer Research
# Copyright (C) 2008,2009,2010,2011
# Max-Planck-Institute for Polymer Research & Fraunhofer SCAI
#
# This file is part of ESPResSo++.
#
# ESPResSo++ is free software: you can redistribute it and/or modify
# it under the terms of t... | BackupTheBerlios/espressopp | src/analysis/PressureTensorLayer.py | Python | gpl-3.0 | 3,419 |
import math
from copy import deepcopy
import numpy as np
from sklearn.cross_validation import ShuffleSplit
from sklearn.preprocessing import LabelBinarizer
def flexible_int(size, in_val=None):
""" allows for flexible input as a size
"""
if in_val is None:
return size
elif isinstance(in_val, (f... | diogo149/BooMLet | boomlet/utils/estimators.py | Python | gpl-3.0 | 3,085 |
"""
The absolutely necessary class to interface your drone with the outer world.
-Responsible for opening/closing sockets according to a chosen protocol (currently only broadcast messaging through UDP).
-Invokes the send/receive/task threads.
-Contains the vehicle's drone list and message queue.
-Invokes the necessary... | LeonidasAntoniou/dk-plus | drone_network.py | Python | gpl-3.0 | 9,072 |
# -*- coding: utf-8 -*-
#+---------------------------------------------------------------------------+
#| 01001110 01100101 01110100 01111010 01101111 01100010 |
#| |
#| Netzob : Inferring communication protocol... | nagyistoce/netzob | src/netzob/Common/MMSTD/Dictionary/Values/Aggregate.py | Python | gpl-3.0 | 4,804 |
from gi.repository import GObject
from collections import defaultdict
import bogo
class AutoCorrector(GObject.Object):
def __init__(self, config, spellchecker, english_spellchecker):
self.config = config
self.spellchecker = spellchecker
self.english_spellchecker = english_spellchecker
... | BoGoEngine/ibus-bogo | ibus_engine/auto_corrector.py | Python | gpl-3.0 | 2,927 |
from scipy.spatial.distance import cosine
class ItemBasedRecommender:
def sim_func(self):
"""
cosine similirity function: sum(A.B)/(sqrt(sum(A^2))*sqrt(sum(A^2)))
"""
pass
def calculateSimilarItems(self):
pass
def predictRating(self):
pass
def getRe... | Kyziridis/recommender_system | ComingSoonFeatures/ItemBasedRecommender.py | Python | gpl-3.0 | 355 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright IBENS/Dyogen : Joseph LUCAS, Matthieu MUFFATO and Hugues ROEST CROLLIUS
# mail : jlucas@ens.fr or hrc@ens.fr
# Licences GLP v3 and CeCILL v2
import collections
__doc__ = """
Wrapper for the PhylDiag Library in LibsDyogen that uses myTools.checkArgs
"""
import sy... | DyogenIBENS/PhylDiag | src/phylDiagCA.py | Python | gpl-3.0 | 2,142 |
# -*- coding: utf-8 -*-
import logging
logger = logging.getLogger(__name__)
try: # pragma: no cover
from amavisvt.db.sqlitedb import AmavisVTDatabase
Database = AmavisVTDatabase
except ImportError: # pragma: no cover
logger.info("Database is NOT supported (could not import module sqlite3)")
from ama... | ercpe/amavisvt | amavisvt/db/__init__.py | Python | gpl-3.0 | 382 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'rbhusPipeReviewMod.ui'
#
# Created by: PyQt4 UI code generator 4.12.dev1606101416
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
... | shrinidhi666/rbhus | rbhusUI/lib/rbhusPipeReviewMod.py | Python | gpl-3.0 | 15,165 |
#!/usr/bin/env python
"""
Reformat JSON metadata
Copyright 2015, Outernet Inc.
Some rights reserved.
This software is free software licensed under the terms of GPLv3. See COPYING
file that comes with the source code, or http://www.gnu.org/licenses/gpl.txt.
"""
import conz
import outernet_metadata.values as values
... | Outernet-Project/outernet-broadman | broadman/cleanmeta.py | Python | gpl-3.0 | 2,970 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import setting
import sys
import os
import socket
import subprocess
def checkenvir():
if sys.version_info[0] == 3:
is_pypy = '__pypy__' in sys.builtin_module_names
if is_pypy is True:
try:
import flask
return ... | 0mu-Project/litefb | envri.py | Python | gpl-3.0 | 2,468 |
import threading
from ..lib.drush import DrushAPI
from ..lib.thread_progress import ThreadProgress
import sublime
import sublime_plugin
class DrushCronCommand(sublime_plugin.WindowCommand):
"""
A command to invoke cron.
"""
def run(self):
self.drush_api = DrushAPI(self.window.active_view())
... | kostajh/subDrush | commands/drush_cron_command.py | Python | gpl-3.0 | 1,155 |
# -*- coding: utf-8 -*-
#------------------------------------------------------------
# tvalacarta - XBMC Plugin
# Canal para IB3
# http://blog.tvalacarta.info/plugin-xbmc/tvalacarta/
#------------------------------------------------------------
import urlparse,re
from core import logger
from core import scrapertools
... | tvalacarta/tvalacarta | python/main-classic/channels/ib3.py | Python | gpl-3.0 | 9,079 |
#!/afs/bx.psu.edu/project/pythons/py2.7-linux-x86_64-ucs4/bin/python2.7
"""
From a set of regions and two sets of intervals inside those regions
compute (for each region separately) the overlap between the two sets
of intervals and the overlap in `nsamples` random coverings of the
regions with intervals having the sa... | mikel-egana-aranguren/SADI-Galaxy-Docker | galaxy-dist/eggs/bx_python-0.7.2-py2.7-linux-x86_64-ucs4.egg/EGG-INFO/scripts/bed_rand_intersect.py | Python | gpl-3.0 | 5,927 |
#!/usr/bin/env python
# author: Iraj Jelodari
import datetime
import codecs
import re
RED = '#FF003B'
BLUE = '#00ADFF'
GREEN = '#B4FF00'
WHITE = '#FFFFFF'
YELLOW = '#FFEB00'
TIME_PATTERN = r'\d{1,2}:\d{1,2}:\d{1,2},\d{1,5} --> \d{1,2}:\d{1,2}:\d{1,2},\d{1,5}\r\n'
class Merger():
"""
SRT Merger allows you t... | iraj-jelo/srtmerger | main.py | Python | gpl-3.0 | 6,571 |
from rambutan3.check_args.other.RRangeSizeStr import RRangeSizeStr
NON_EMPTY_STR = RRangeSizeStr(min_size=1)
| kevinarpe/kevinarpe-rambutan3 | rambutan3/check_args/annotation/NON_EMPTY_STR.py | Python | gpl-3.0 | 111 |
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2014-2018 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser 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 S... | airodactyl/qutebrowser | qutebrowser/browser/webengine/webenginedownloads.py | Python | gpl-3.0 | 9,638 |
#! /usr/bin/env python
# This application works with either argparse (python 2.7) or optparse
# (python 2.6)
from __future__ import print_function
argparse = None
try:
import argparse
except ImportError:
from optparse import OptionParser
from optparse import Option, OptionValueError
import difflib
if ... | shanot/imp | modules/pmi/pyext/src/process_output.py | Python | gpl-3.0 | 11,326 |
def max_number(x, y):
if x > y:
print "%d is greater than %d" % (x, y)
elif x < y:
print "%d is greater than %d" % (y, x)
else:
print "%d is equal to %d" % (x, y)
max_number(30, 50)
| ramachandrajr/46-simple-python-exercises-solutions | ex1.py | Python | gpl-3.0 | 221 |
import os
from django.conf import settings
from django.core.files import File
from django.test import TestCase
from django.test.utils import override_settings
from pyrope.exceptions import PropertyParsingError
from ..models import Replay
class TestReplayParser(TestCase):
# ['', pyrope.exceptions.PropertyPars... | rocket-league-replays/rocket-league-replays | rocket_league/apps/replays/tests/test_parser.py | Python | gpl-3.0 | 4,768 |
# PiTimer - Python Hardware Programming Education Project For Raspberry Pi
# Copyright (C) 2015 Jason Birch
#
# 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
... | BirchJD/RPiTimer | PiTimer_Step-6/Schedule.py | Python | gpl-3.0 | 6,095 |
import PortInterface.IPortInterface
import PortInterface.Operation
import Infrastructure.PackageableElement
class ClientServerInterface(PortInterface.IPortInterface.IPortInterface, Infrastructure.PackageableElement.PackageableElement):
"""Represents 'SenderReceiverInterface' from the meta-model"""
def getItsO... | dmanev/ArchExtractor | ArchExtractor/umlgen/Base/SwComponent/PortInterface/ClientServerInterface.py | Python | gpl-3.0 | 521 |
# -*- coding: utf-8 -*-
"""
This file contains the Qudi hardware interface for pulsing devices.
Qudi 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... | drogenlied/qudi | interface/pulser_interface.py | Python | gpl-3.0 | 24,335 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-11-15 10:01
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('system', '0001_initial'),
]
operations = [
migrations.CreateModel(
... | mcuTeam/mcuWeb | mcuWeb/system/migrations/0002_meetingtemplate.py | Python | gpl-3.0 | 614 |