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 |
|---|---|---|---|---|---|
#!/usr/bin/env python3
import sys
import os
import struct
import getpass
import random
import string
from hashlib import sha256
from random import randint
import argparse
import pyudev
try:
import py_sg
except ImportError as e:
print("You need to install the \"py_sg\" module. Try 'pip3 install --user git+https://git... | 0-duke/wdpassport-utils | wdpassport-utils.py | Python | gpl-2.0 | 14,308 |
from xbmcswift2 import Plugin, xbmcgui
from resources.lib import rbdradio
plugin = Plugin()
@plugin.route('/')
def main_menu():
items = [
{'label': plugin.get_string(30000), 'path': "http://69.175.49.133:9994/listen.pls",
'is_playable': True},
{'label': plugin.get_string(30001), 'path': p... | el-sacha/plugin.audio.rbdradio | addon.py | Python | gpl-2.0 | 2,086 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@author: zengchunyun
"""
from twisted.internet import protocol
from twisted.internet import reactor
class Echo(protocol.Protocol):
def dataReceived(self, data):
self.transport.write(data)
def main():
factory = protocol.ServerFactory()
factory.pr... | zengchunyun/s12 | day10/ext/temp/echo_server.py | Python | gpl-2.0 | 428 |
# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
# This file is part of Guadalinex
#
# This software 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, ... | gecos-team/gecosws-config-assistant | gecosws_config_assistant/util/JSONUtil.py | Python | gpl-2.0 | 1,672 |
from typing import Dict, Union
from flask import session, url_for
from flask_babel import lazy_gettext as _
from flask_wtf import FlaskForm
from wtforms import StringField
from openatlas import app
from openatlas.util.util import get_file_extension
class GlobalSearchForm(FlaskForm): # type: ignore
term = Strin... | craws/OpenAtlas-Python | openatlas/util/processor.py | Python | gpl-2.0 | 1,042 |
#!/usr/bin/env python
#A Puppet External Node Classifier Script for deploying hbase/hadoop clusters
#Copyright (C) 2013 NigelB
#
#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... | nigelb/hbase-cluster-launch | puppet_enc/hbase-cluster-enc.py | Python | gpl-2.0 | 11,800 |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Area'
db.create_table(u'main_area', (
(u'id', self.gf('django.db.models.fields.A... | ansmirnov/losk | losk/main/migrations/0001_initial.py | Python | gpl-2.0 | 16,554 |
#
# Copyright (C) 2009-2016 Nexedi SA
#
# 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... | vpelletier/neoppod | neo/tests/functional/testMaster.py | Python | gpl-2.0 | 5,477 |
from fsui.qt.core import (
QEvent,
QObject,
QPoint,
QRect,
Qt,
QTimer,
QTimerEvent,
)
__all__ = [
"QEvent",
"QObject",
"QPoint",
"QRect",
"Qt",
"QTimer",
"QTimerEvent",
]
| FrodeSolheim/fs-uae-launcher | fswidgets/qt/core.py | Python | gpl-2.0 | 228 |
# Copyright (C) 2008-2009 Open Society Institute
# Thomas Moroz: tmoroz@sorosny.org
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License Version 2 as published
# by the Free Software Foundation. You may not use, modify or distribu... | boothead/karl | karl/content/models/wiki.py | Python | gpl-2.0 | 6,458 |
#!/usr/bin/env python
# Copyright (C) 2015 Rafael Han
# Author: Rafael Han
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later v... | mingqian/rtpspy | h264proc.py | Python | gpl-2.0 | 3,548 |
import process, re
def Now_Thats_What_I_Call_Music():
process.Menu("Now That's What I Call 25 Years(2008)","http://sta.itshappeninghere.ie/ican.mmm/English/Now%20Thats%20What%20I%20Call%20Music/Now%20That's%20What%20I%20Call%2025%20Years(2008)/",1701,"http://sta.itshappeninghere.ie/ican.mmm/English/Now%20Thats%20... | sanctuaryaddon/sanctuary | plugin.video.quantum/lib/Now_thats_what_i_call_music.py | Python | gpl-2.0 | 49,227 |
from Screen import Screen
from Screens.HelpMenu import HelpableScreen
from Components.About import about
from Components.ActionMap import HelpableActionMap, HelpableNumberActionMap
from Components.Button import Button
from Components.config import config, configfile, ConfigClock
from Components.EpgList import EPGList, ... | Ophiuchus1312/enigma2-master | lib/python/Screens/EpgSelection.py | Python | gpl-2.0 | 57,966 |
# Quantum machines qubit library
# started by M. Spiecker, 06.2020
#
# TODO add text
#
#
# HOW TO USE IT:
# Since the quantum machines card is a very versatile machine,
# the setup and the experiments will be very different.
# Thus use this file as template and look up for your experiments.
import inspect
import time... | qkitgroup/qkit | qkit/measure/timedomain/quantum_machine/basic_qubit_experiments_V2.py | Python | gpl-2.0 | 38,192 |
# Orthographic French
public_name='Orthographic French'
default_data='orthographic_french.txt'
default_neighbor_lexicon='orthographic_french.txt'
default_word_lexicon='orthographic_french.txt'
default_lookup_lexicon='orthographic_french.txt'
from subsyllabic_common import *
import orth.fr as language
def transform(inpu... | crr-ugent/wuggy | plugins/orthographic_french.py | Python | gpl-2.0 | 427 |
#!/usr/bin/env python
import unicornhat as unicorn
import time, math, colorsys, random, sys, glib, gudev
sin_off = [[0]*8 for i in range(8)]
for y in range(8):
for x in range(8):
sin_off[x][y] = random.random() * (math.pi * 2)
tick_mask = [[0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,1,0],
[... | mgdevereux/unicorn-hat | python/examples/eve.py | Python | gpl-2.0 | 2,523 |
from magum import Magum
import math
from array import *
def madgwickQuaternionFilter(aCompArray,gCompArray,mCompArray):
ax = aCompArray[0]
ay = aCompArray[1]
az = aCompArray[2]
mx = mCompArray[0]
my = mCompArray[1]
mz = mCompArray[2]
gx = gCompArray[0]
gy = gCompArray[1]
gz = gCompArray[2]
deltat = 0.001... | ubalance-team/magum | test/quaternionFilter.py | Python | gpl-2.0 | 4,500 |
# -*-coding:UTF-8 -*
import getopt
from process.ArrayParsing import ArrayParsing
from process.TextParsing import TextParsing
from process.ListParsing import ListParsing
from equipment.Equipment import Equipment
from equipment.feature.Interface import Interface
from utils.ExcelWorkbookManager import *
def main(excel_... | JoelCapitao/NetScriptGen | src/main/python/__main__.py | Python | gpl-2.0 | 2,872 |
# 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... | PandaWei/avocado | avocado/plugins/replay.py | Python | gpl-2.0 | 8,488 |
from unittest import TestCase
from roblyparser.tokeniser import Tokens
__author__ = 'robbie'
class TestTokeniser(TestCase):
html = """
<html>
<head>
<title>My HTML Page</title>
</head>
<body>
<p style="special">
This paragraph has special style
</p>
<p>... | robbielynch/RoblySearch | roblyparser/tests/test_tokeniser.py | Python | gpl-2.0 | 11,946 |
# -*- coding: utf-8 -*-
"""
Plot netcdf output from CLUBB.
"""
# Import libraries
import matplotlib.pyplot as plt
from scipy.io import netcdf
from numpy import squeeze
import pdb
# Point to directory containing CLUBB output
data_dir = '/home/studi/Larson/clubb/output/'
clubb_nc_file = data_dir + 'rico_lh_zt.nc'
... | vlarson/class-scripts | mc_integration/plot_clubb_output.py | Python | gpl-2.0 | 807 |
# BEGIN_COPYRIGHT
# END_COPYRIGHT
# pylint: disable=E1101
import os, unittest, logging, shutil, time
logger = logging.getLogger()
logger.setLevel(logging.DEBUG)
# create console handler and set level to debug
ch = logging.StreamHandler()
ch.setLevel(logging.DEBUG)
# create formatter
formatter = logging.Formatter("%(... | crs4/omero.biobank | test/serialize/test_serialize.py | Python | gpl-2.0 | 3,065 |
#$ neutron_plugin 01
import re
LOG_CACHE_FILE = 'dynamic/logcache.txt'
initialize_file(LOG_CACHE_FILE, '{}')
LOG_FILENAME_CACHE = eval(read_file(LOG_CACHE_FILE))
def log_write_header(fp, source, (year, month, day, hour, minute, second, weekday, yearday, daylightsavings)):
body="""<!DOCTYPE html PUBLIC "-//W3C//... | mikemintz/neutron | plugins/log_plugin.py | Python | gpl-2.0 | 7,912 |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Book'
db.create_table(u'library_book', (
(u'id', self.gf('django.db.models.field... | loop0/kktua | kktua/library/migrations/0001_initial.py | Python | gpl-2.0 | 5,794 |
"""An extensible library for opening URLs using a variety of protocols
The simplest way to use this module is to call the urlopen function,
which accepts a string containing a URL or a Request object (described
below). It opens the URL and returns the results as file-like
object; the returned object has some extra me... | bruderstein/PythonScript | PythonLib/full/urllib/request.py | Python | gpl-2.0 | 101,390 |
from resources.lib.kodion import runner, debug
from resources.lib import prosiebensat1
__provider__ = prosiebensat1.Provider()
runner.run(__provider__) | noba3/KoTos | addons/plugin.video.7tv/default.py | Python | gpl-2.0 | 152 |
# -*- coding: utf-8 -*-
#
# rebasehelper documentation build configuration file, created by
# sphinx-quickstart on Tue Apr 21 13:42:00 2015.
#
# 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.
... | phracek/rebase-helper | docs/conf.py | Python | gpl-2.0 | 8,973 |
#!/usr/bin/env python
"""
Boom Interface
==============
Classes for handling interface objects and initializing and displaying an
OpenGL window in which the game will be rendered.
This module also manages the internal event queue, which can be added to
using post_event.
License
-------
Copyright (... | jasonkotenko/Boom-Engine | Boom/Interface.py | Python | gpl-2.0 | 7,734 |
layout=['bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb',
'bpggggggggggggggttgggggggggggb',
'bggggggggggggggttggggggggggggb',
'bgggggggggggggttgggggggggggggb',
'bggggggggggggttegggggggggggggb',
'bggggggggggtttgggggggggggggggb',
'bgggggggetttggggggggeggggggggb',
'bggggggggg... | KevinThorne/medievalx-pygame | medievalx-pygame/win32/data/layouts/layout2.py | Python | gpl-2.0 | 559 |
from django.contrib.auth import get_user_model
from django.dispatch import Signal, receiver
from misago.core.signals import secret_key_changed
delete_user_content = Signal()
username_changed = Signal()
"""
Signal handlers
"""
@receiver(username_changed)
def handle_name_change(sender, **kwargs):
sender.user_ren... | 1905410/Misago | misago/users/signals.py | Python | gpl-2.0 | 996 |
from zope.interface import implements
from Products.CMFCore.utils import getToolByName
from plone.memoize import ram
from uwosh.library.ws.db.schemas import schema
from uwosh.library.ws.core.webservice import WebServiceBase
from uwosh.library.ws.core.webresponse import WebResponseObject
from uwosh.library.ws.co... | uwosh/uwosh.library.ws | uwosh/library/ws/services/v1/resourceavailability.py | Python | gpl-2.0 | 5,700 |
import requests
from urlparse import parse_qs, urlparse
def get_url(video_id, maxResolution):
r = requests.get('http://www.youtube.com/get_video_info?&video_id=%s' % video_id).text
urlparts = parse_qs(r)
if not urlparts.has_key('url_encoded_fmt_stream_map') and not urlparts.has_key('adaptive_fmts'):
return None
... | guthypeter/plugin.video.youtube.gdata | resources/lib/stream_selector.py | Python | gpl-2.0 | 1,518 |
# 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... | buildbot/buildbot | master/buildbot/db/dbconfig.py | Python | gpl-2.0 | 2,992 |
from math import pi, sin, cos
from random import randint, random
from scenarios import Scenario, Step
from server.objects import Asteroid, Planet, Sun
from server.ships import *
from server.weapons import *
from server.ais import *
from server.players import Computer, Faction, Territory
from server.stats import Stats
... | xymus/pycaptain | src/campaigns/tutorial/tutorial3.py | Python | gpl-2.0 | 15,953 |
'''
Linear Search
The linear search is used to find an item in a list. The items do not have to be in order. To search for an item, start at the beginning of the list and continue searching until either the end of the list is reached or the item is found.
The algorithm is as follows (given a list called 'List' and loo... | soumyaslab/pythonlab | py3/ExampleSet_01/linearsearch.py | Python | gpl-2.0 | 1,094 |
from scrapy.contrib.spiders import CrawlSpider, Rule
from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor
from scrapy.selector import Selector
from lyricwiki.items import LyricWikiItem
class LyricWikiSpider(CrawlSpider):
name = "drdre" #CHANGE NAME
a... | elainekmao/hiphoptextanalysis | lyricwiki-scraper/lyricwiki/spiders/drdre_spider.py | Python | gpl-2.0 | 1,130 |
#coding:utf-8
import numpy as np
import time
import statsmodels.api as sm
from scipy import stats
'''
linear regression with Stochastic Gradient Decent mothod
'''
def SGD(x, y, a, b):
# -------------------------------------------随机梯度下降算法----------------------------------------------------------
# 两种终止条件
l... | lionelliang/PairTradingSpark | sgd.py | Python | gpl-2.0 | 8,478 |
import signal
import time
import sys
def handler_cleanup(signum, frame):
print "Exit gracefully: ({} {})".format(signum,frame)
print "Close fd, cleanup temfiles, save state,..."
sys.exit(0)
signal.signal(signal.SIGTERM,handler_cleanup)
try:
while True:
print "Some other code"
time.sleep(2)... | andreub/pycones2015 | signal_cleanup.py | Python | gpl-2.0 | 379 |
# -*- coding: utf-8 -*-
#
# Picard, the next-generation MusicBrainz tagger
#
# Copyright (C) 2019-2020 Philipp Wolfer
#
# 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 ... | Sophist-UK/Sophist_picard | picard/ui/widgets/editablelistview.py | Python | gpl-2.0 | 10,290 |
import os
import shutil
from gettext import gettext as _
from logging import getLogger
from urlparse import urlparse, urlunparse
from gnupg import GPG
from mongoengine import NotUniqueError
from pulp.common.plugins import importer_constants
from pulp.plugins.util.publish_step import PluginStep, SaveUnitsStep
from p... | pcreech/pulp_ostree | plugins/pulp_ostree/plugins/importers/steps.py | Python | gpl-2.0 | 14,588 |
# Copyright 2002 Duke University
# Copyright (C) 2012-2013 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 versi... | kudlav/dnf | dnf/yum/config.py | Python | gpl-2.0 | 32,665 |
#!/usr/bin/env python
import os
import sys
import hashlib
import getopt
import fcntl
import icmp
import time
import struct
import socket
import select
class Tunnel():
def create(self):
self.tfd = os.open("/dev/net/tun", os.O_RDWR)
ifs = fcntl.ioctl(
self.tfd,
TUNSETIFF,
... | zhao-ji/pangolin | icmp_vpn/tunnel.py | Python | gpl-2.0 | 6,263 |
# -*- coding: utf-8 -*-
#
# Various utilities that provide support for:
# *) indexing words (adding wordIDs, clauseIDs);
# *) processing/filtering morphologically annotated text tokens;
#
from __future__ import unicode_literals
from estnltk.names import *
import re
# =======================... | estnltk/estnltk | estnltk/mw_verbs/utils.py | Python | gpl-2.0 | 13,094 |
# initializer and core of Pyful
#
# Copyright (C) 2010-2011 anmitsu <anmitsu.s@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 option)... | anmitsu/pyful | pyful/__init__.py | Python | gpl-2.0 | 4,648 |
from menes import *
class RanebEngine(MenesEngine):
"""Adds an adaptive search that explores the game tree for as long as it's allowed.
Alternates between depth-first and breadth-first searching, widening and deepening the tree."""
# Think for at most this many seconds after the opponent finishes his... | teejaydub/khet | engines/raneb.py | Python | gpl-2.0 | 5,681 |
#! /usr/bin/env python
#
# A script to create smart playlists, with a variety of criteria, out of an
# MPD database.
#
# Authors:
# Sebastien Delafond <sdelafond@gmail.com>
# original implementation by Michael Walker <mike@barrucadu.co.uk>
#
# This code is licensed under the GPL v3, or any later version at your cho... | sdelafond/mpd | mpdspl.py | Python | gpl-3.0 | 21,230 |
# -*- coding: utf-8 -*-
# Copyright (c) 2006 - 2014 Detlev Offenbach <detlev@die-offenbachs.de>
#
"""
Module implementing a starter for the system tray.
"""
from __future__ import unicode_literals
import sys
import os
from PyQt5.QtCore import QProcess, QSettings, QFileInfo
from PyQt5.QtGui import QCursor
from PyQt... | davy39/eric | Tools/TrayStarter.py | Python | gpl-3.0 | 16,252 |
from pathlib import Path
import pytest
from objects.file import FileObject
from test.unit.analysis.analysis_plugin_test_class import AnalysisPluginTest # pylint: disable=wrong-import-order
from ..code.checksec import (
AnalysisPlugin, check_canary, check_clang_cfi, check_clang_safestack, check_fortify_source, c... | fkie-cad/FACT_core | src/plugins/analysis/checksec/test/test_plugin_checksec.py | Python | gpl-3.0 | 4,147 |
import datetime
import enum
from email_validator import validate_email
from flask_bcrypt import generate_password_hash
from sqlalchemy import Column, DateTime, Enum, Integer, LargeBinary, String
from sqlalchemy.orm import relationship, validates
from sqlalchemy.orm.exc import NoResultFound
from pbench.server.database... | distributed-system-analysis/pbench | lib/pbench/server/database/models/users.py | Python | gpl-3.0 | 4,868 |
import pytest
from cli_config.script import script
from utility.nix_error import NixError
def test_script_list_no_tag(capsys):
script.script("nixconfig", ["list"])
_out, _err = capsys.readouterr()
assert "script1" in _out, "'script1' should be in output"
assert "script2" in _out, "'script2' should ... | mbiciunas/nix | test/cli_config/script/test_script_list.py | Python | gpl-3.0 | 1,271 |
import argparse
import xml.sax
import codecs
import mongodb
class ABContentHandler(xml.sax.ContentHandler):
def __init__(self, collection=None):
xml.sax.ContentHandler.__init__(self)
self._text = False
self._word = False
self._buffer = []
self._table = collection
def ... | jeroendecroos/pronunciation_master | pronunciation_master/src/wiktionary_to_db.py | Python | gpl-3.0 | 1,608 |
from django.db import models
from django.contrib.auth.models import User
from django.contrib.contenttypes.models import ContentType
from blogs.models import Blog
from django.shortcuts import reverse
from django.utils import timezone
from django.utils.safestring import mark_safe
from markdown_deux import markdown
from t... | NeverWalkAloner/collectiveblogs | posts/models.py | Python | gpl-3.0 | 1,640 |
from app.models import DB
def rows_to_tags(rows):
tags = []
for row in rows:
tag = Tag(row)
tags.append(tag)
return tags
class Tag(DB):
def __init__(self, data=None):
if data:
self.tag_id, self.content = data
def get_all_tags(self):
rows = self.execut... | kuujakke/kolbe | app/tags/models.py | Python | gpl-3.0 | 1,467 |
# -*- coding: utf-8 -*-
import os, sys, time, urllib2, unicodedata, random, string
import xbmc, xbmcgui, xbmcaddon, xbmcvfs
if sys.version_info < (2, 7):
import simplejson as json
else:
import json
ADDON = xbmcaddon.Addon()
ADDONNAME = ADDON.getAddonInfo('name')
ADDONID = ADDON.getAddonInfo('id... | odicraig/kodi2odi | addons/weather.openweathermap.extended/default.py | Python | gpl-3.0 | 49,482 |
"""MNIST 2."""
import tensorflow as tf
from keras.datasets import mnist
from keras.utils import np_utils
# get all images and make the data proper
(X_train, y_train), (X_test, y_test) = mnist.load_data()
X_train = X_train.reshape(X_train.shape[0], 28, 28, 1)
X_test = X_test.reshape(X_test.shape[0], 28, 28, 1)
X_trai... | rednithin/Misc-Mini | DeepLearning/MNIST2.py | Python | gpl-3.0 | 1,416 |
import sys
import itertools
lines = sys.stdin.read().splitlines()
dna = lines[0].strip()
args = lines[1].strip().split(' ')
k = int(args[0])
d = int(args[1])
_bases = ['A', 'C', 'G', 'T']
_base_ids = {'A': 0, 'C': 1, 'G': 2, 'T': 3}
def _find_all_neighbours(pattern, prefix, d, neighbours):
if not pattern: return... | Bioinformanics/ucsd-bioinformatics-1 | Week2/Honor/2_6_frequent_words_with_mismatch_and_rc.py | Python | gpl-3.0 | 2,503 |
import sys
import numpy as np
from sklearn.metrics.pairwise import pairwise_distances
if __name__ == '__main__':
if len(sys.argv) < 4:
print "Error: Not enough parameters given. Parameters needed: "
print "-features_file -distances_file -n_streams"
exit()
else:
FEATURES_FILE = s... | lferrer/iccv2017 | scripts/experiments/calculate_distances.py | Python | gpl-3.0 | 1,256 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function
from flask import request, g
from . import Resource
from .. import schemas
class AppsAppId(Resource):
def get(self, app_id):
print(g.args)
return {}, 200, None | mongolian-navy/arya-admin | arya-admin/admin/v1/api/apps_app_id.py | Python | gpl-3.0 | 264 |
# Copyright (c) 2003, The Regents of the University of California,
# through Lawrence Berkeley National Laboratory (subject to receipt of
# any required approvals from the U.S. Dept. of Energy). All rights
# reserved.
#
# Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved.
#
# This software is ... | ndawe/pyAMI | pyAMI/extern/ZSI/wstools/Utility.py | Python | gpl-3.0 | 50,744 |
# !/usr/bin/python3.5
from datetime import datetime
from orm import Boolean
from orm import Column
from orm import DateTime
from orm import DoesNotExist
from orm import Float
from orm import ForeignKey
from orm import Integer
from orm import String
from orm import Table
from utils import create_uuid
from utils import... | pdyba/aioquiz | aioquiz/models/event.py | Python | gpl-3.0 | 3,231 |
if True and a: # Error on this line
pass
| pyta-uoft/pyta | examples/pylint/r1726_simplifiable_condition.py | Python | gpl-3.0 | 46 |
# -*- coding: utf-8 -*-
#
# papylib - an emesene extension for papyon
#
# Copyright (C) 2009-2010 Riccardo (C10uD) <c10ud.dev@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 ... | tiancj/emesene | emesene/e3/papylib/PapyEvents.py | Python | gpl-3.0 | 12,579 |
#!/usr/bin/python
# Writen by Darian Johnson
# this was build leveraging Mario Cannistra's IoT project - https://www.hackster.io/mariocannistra/radio-astronomy-with-rtl-sdr-raspberrypi-and-amazon-aws-iot-45b617
# This python code runs on the raspberry pi and takes a selfie when a message is recieved from the Alexa ski... | deepakraja90/tcs_magicMirror | Mystic_Mirror/take_selfie.py | Python | gpl-3.0 | 3,673 |
#-*- coding: utf-8 -*-
#
# Krzysztof „krzykwas” Kwaśniewski
# Gdańsk, 12-06-2012
#
# 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 late... | krzykwas/rhqagent | pyagent/agent/SendDataThread.py | Python | gpl-3.0 | 1,453 |
#!/usr/bin/env python
#
# benchmark.py - Internal benchmarking functions for the lobbyists package.
# Copyright (C) 2008 by Drew Hess <dhess@bothan.net>
#
# 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 Fou... | dhess/lobbyists | lobbyists/benchmark.py | Python | gpl-3.0 | 4,966 |
"""
Copyright 2009 Serge Matveenko
This file is part of Picket.
Picket 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.
Picket is distribut... | lig/picket_classic | apps/picket/permissions.py | Python | gpl-3.0 | 2,096 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2017 Felipe Gallego. All rights reserved.
#
# This 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 ... | felgari/k2 | ksimul.py | Python | gpl-3.0 | 7,825 |
# encoding: utf-8
'''
Created on Jul 12, 2017
@author: LCC
'''
import time
localtime = time.asctime(time.localtime(time.time()))
print "Time is :", localtime
| lichaochao503/Python27 | src/Test/20170712.py | Python | gpl-3.0 | 174 |
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
import mbdata.models as models
import pandas as pd
import psycopg2, uuid, csv
# to encode non ascii characters to csv without any decode errors we set "utf8" encoding as default encoding.
import sys;
reload(sys);
sys.setdefaultencoding("utf8")... | danielbalcells/ariadne | old_code/get_all_links_by_recording_alchemy.py | Python | gpl-3.0 | 1,645 |
#!/usr/bin/env python
import ctypes
import mmap
import os
import struct
def main():
# Create new empty file to back memory map on disk
fd = os.open('/tmp/mmaptest', os.O_CREAT | os.O_TRUNC | os.O_RDWR)
# Zero out the file to insure it's the right size
assert os.write(fd, '\x00' * mmap.PAGESIZE) == mm... | xmnlab/minilab | mm/a.py | Python | gpl-3.0 | 1,731 |
# coding=UTF8
"""
Parser for searches.
"""
import hashlib
import datetime
class Parser(object):
"""Returns a where clause based on the search string syntax. Examples:
+eu +eeuu +economía: eu AND eeuu AND economía
(+eu +eeuu) economía: economía OR (eu AND eeuu)
(+eu -eeuu) economía: econom... | GeographicaGS/Elcano-iepg | www-srv/src/common/parser.py | Python | gpl-3.0 | 5,262 |
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible 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 lat... | mattupstate/ansible | lib/ansible/module_common.py | Python | gpl-3.0 | 10,284 |
#!/usr/local/bioinfo/python/3.4.3_build2/bin/python
# -*- coding: utf-8 -*-
# @package ratioPerSampleMissHet.py
# @author Sajid Ali, Sebastien Ravel
"""
The ratioPerSampleMissHet script
===========================
:author: Sebastien Ravel
:contact: sebastien.ravel@cirad.fr
:date: 11/04/2017
:version: 0.1
Scrip... | sravel/scripts | cluster/ratioPerSampleMissHet.py | Python | gpl-3.0 | 5,598 |
########################################################################
# File : Watchdog.py
# Author: Stuart Paterson
########################################################################
""" The Watchdog class is used by the Job Wrapper to resolve and monitor
the system resource consumption. The Watchdog... | arrabito/DIRAC | WorkloadManagementSystem/JobWrapper/Watchdog.py | Python | gpl-3.0 | 38,280 |
# -*- coding: utf-8 -*-
# Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.model.document import Document
class Harvest(Document):
pass
@frappe.whitelist()
def c... | neilLasrado/erpnext | erpnext/agriculture/doctype/harvest/harvest.py | Python | gpl-3.0 | 1,756 |
#!/usr/bin/env python
############################################################################
# Copyright (c) 2015-2019 Saint Petersburg State University
# Copyright (c) 2011-2014 Saint Petersburg Academic University
# All Rights Reserved
# See file LICENSE for details.
###########################################... | B-UMMI/INNUca | src/SPAdes-3.14.0-Linux/share/spades/spades_pipeline/scripts/correction_iteration_script.py | Python | gpl-3.0 | 3,194 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
import email.message
from .htmlparser import BlueHTMLParser
from . import utils
class BaseAdapter(object):
"""Common base class of common implementation for an Adapter"""
_data = None
def __init__(self, datasource):
if not isinstance(dat... | luiorpe1/bluebird | bluebird/adapter.py | Python | gpl-3.0 | 9,633 |
from setuptools import setup
import os
import sys
sys.setrecursionlimit(1500)
def under(parent):
for dirpath, dirnames, files in os.walk(parent):
for f in files:
yield os.path.join(dirpath, f)
APP = ['EggDrop.py']
MODULES = ['header', 'helper', 'sprites']
DIR = ['fonts', 'data', 'img', 'snd']... | mokuki082/EggDrop | code/setup.py | Python | gpl-3.0 | 863 |
# Django settings for monster project.
import os
import datetime
DEBUG = True
TEMPLATE_DEBUG = DEBUG
PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__))
ROOT_DIR = os.path.split(PROJECT_ROOT)[-1]
ROOT_PATH = os.path.dirname(os.path.abspath(__file__))
JS_PATH = os.path.join(ROOT_PATH, "js")
CSS_PATH = os.path.j... | dooferlad/need-input | monster/settings.py | Python | gpl-3.0 | 7,867 |
from setuptools import setup
setup(
name="mobcrush",
version="0.1.0",
description="Python Mobcrush API Wrapper",
author="Jay Nagpaul",
author_email="spieswithin@gmail.com",
url="https://github.com/jaynagpaul/mobcrush",
packages=["mobcrush"],
install_requires=["requests", "requests-cach... | jaynagpaul/mobcrush | setup.py | Python | gpl-3.0 | 413 |
"""
This is a subroutine for FCS that generates an empty FCS object for export to a database
"""
__author__ = "Daniel Herman, MD"
__copyright__ = "Copyright 2014"
__license__ = "GPL v3"
__version__ = "1.0"
__maintainer__ = "David Ng"
__email__ = "hermands@uw.edu"
__status__ = "Subroutine - prototype"
from os.path imp... | davidpng/FCS_Database | FlowAnal/FCS_subroutines/empty_FCS.py | Python | gpl-3.0 | 2,585 |
from __future__ import print_function, division
from sympy.concrete.expr_with_limits import AddWithLimits
from sympy.core.add import Add
from sympy.core.basic import Basic, C
from sympy.core.compatibility import is_sequence, xrange
from sympy.core.containers import Tuple
from sympy.core.expr import Expr
from sympy.cor... | alephu5/Soundbyte | environment/lib/python3.3/site-packages/sympy/integrals/integrals.py | Python | gpl-3.0 | 50,801 |
from django.core.urlresolvers import reverse
from django.http import HttpResponse
from django.utils.translation import ugettext_lazy as _
from django.contrib import messages
from django.shortcuts import redirect
from django.conf import settings
import jsonpickle
def anonymous_required(function):
"""
Check e... | esitamon/django-skeleton | app/core/decorators.py | Python | gpl-3.0 | 1,667 |
# -*- coding: utf-8 -*-
#
# This file is part of INSPIRE.
# Copyright (C) 2014-2017 CERN.
#
# INSPIRE 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 ... | jacquerie/inspire-dojson | tests/test_hep_bdFFT.py | Python | gpl-3.0 | 19,846 |
import numpy as np
import sys
import time
from simsearch import utils
def show_time_taken(func):
def new(*args, **kw):
start = time.time()
res = func(*args, **kw)
timed = time.time() - start
utils.logger.info('%.2f sec.', timed)
setattr(new, 'time_taken', timed)
re... | alexksikes/SimSearch | tests/test_argsort_best.py | Python | gpl-3.0 | 1,335 |
from django.shortcuts import render
from django.contrib.auth import authenticate, login, logout
from django.http import HttpResponseRedirect
from .forms import NameForm
def loginUsuario(request):
if request.user.is_authenticated():
return HttpResponseRedirect('/')
else:
if request.method == 'P... | AliGhahraei/LearnIT | login/views.py | Python | gpl-3.0 | 1,268 |
from random import randint, shuffle
from django.core.management.base import BaseCommand
from lcc.models import TaxonomyClassification, TaxonomyTag
from lcc.factories import LegislationFactory
class Command(BaseCommand):
help = "Generate fake legislation"
def add_arguments(self, parser):
parser.add... | eaudeweb/lcc-toolkit | lcc/management/commands/generate_fake_legislation.py | Python | gpl-3.0 | 947 |
"""
Slutcheck - Uses google "safesearch" to determine how "slutty" a word or
phrase is. (To get an accurate slut rating for a phrase it should be
quoted.)
Uses the ratio of hits doing an unsafe search to the number of hits
doing a safe search to determine the score. If a safe search returns 0
results, and unsafe ret... | cjones/madcow | madcow/modules/slut.py | Python | gpl-3.0 | 2,553 |
"""
Mixins for use in dryscrape drivers.
"""
import time
import lxml.html
class SelectionMixin(object):
""" Mixin that adds different methods of node selection to an object that
provides an ``xpath`` method returning a collection of matches. """
def css(self, css):
""" Returns all nodes matching the given ... | nabilbendafi/plugin.video.rainiertamayo | resources/lib/dryscrape/mixins.py | Python | gpl-3.0 | 3,867 |
import unittest
import time
from cStringIO import StringIO
from logcmd.iomanager import IOManager
from logcmd.tests.fakepopen import FakePopenFactory
from logcmd.tests.orderedsio import fake_select
class ProcManagerTests (unittest.TestCase):
def test_basic_operation(self):
sio = StringIO()
faketi... | nejucomo/logcmd | logcmd/tests/test_iomanager.py | Python | gpl-3.0 | 1,589 |
import os
import glob
import json
import textwrap
def rip():
targets = [
'book/example/*.ipynb',
]
generator_dest = os.path.normpath(os.path.join(
os.path.dirname(__file__), "..", "larch", "examples", "generated",
))
os.makedirs(generator_dest, exist_ok=True)
print(f"{generat... | jpn--/larch | tools/rip_examples.py | Python | gpl-3.0 | 3,589 |
import numpy as np
from music.note import Note
from music.chord import Chord
from music.melody import Melody
def numbers_to_pitches(numbers):
"""
:param numbers:
:return:
"""
if len(numbers) == 0:
raise ValueError("Empty melody")
pitches = {0: 'A',
1: 'A#',
... | nordorei/kiwipy | api/util/music_util.py | Python | gpl-3.0 | 956 |
# -*- coding: cp1252 -*-
'''
The following is an adaptation of the above Greiner-Hormann* algorithm to deal
with degenerate cases. The adaptation was briefly described by Liu et al.**
*Greiner, G. and Hormann K., Efficient Clipping of Arbitrary Polygons, ACM
Trans. on Graphics, 17(2), 1998, pp.71-83
**Liu, ... | karimbahgat/Pure-Python-Greiner-Hormann-Polygon-Clipping | GreinerHorman_Algo/Forster-Overfelt/refactored/stacko_version.py | Python | gpl-3.0 | 18,765 |
#!/usr/bin/env python
#
# Copyright 2009 Claudio Pisa (claudio dot pisa at uniroma2 dot it)
#
# This file is part of SVEF (SVC Streaming Evaluation Framework).
#
# SVEF 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 Softwar... | netgroup/svef | more_tools/bitstreamreconstructor.py | Python | gpl-3.0 | 1,458 |
# Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of Sick Beard.
#
# Sick Beard 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 t... | schumi2004/NOT_UPDATED_Sick-Beard-Dutch | sickbeard/providers/__init__.py | Python | gpl-3.0 | 4,608 |
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2015, 2017 Toshio Kuratomi <tkuratomi@ansible.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = '''
na... | BondAnthony/ansible | lib/ansible/plugins/connection/local.py | Python | gpl-3.0 | 6,852 |
#!/usr/bin/env python
# File created on 1 Feb 2012
from __future__ import division
__author__ = "Morgan Langille"
__copyright__ = "Copyright 2011-2013, The PICRUSt Project"
__credits__ = ["Morgan Langille","Jesse Zaneveld"]
__license__ = "GPL"
__version__ = "1.0.0-dev"
__maintainer__ = "Morgan Langille"
__email__ = "m... | wasade/picrust | scripts/run_genome_evaluations.py | Python | gpl-3.0 | 11,364 |
"""Tests for the coocurrence matrix generator."""
from pandas.util.testing import assert_frame_equal
from analytics_platform.kronos.src import config
from analytics_platform.kronos.softnet.src.cooccurrence_matrix_generator \
import CooccurrenceMatrixGenerator
from analytics_platform.kronos.softnet.src.offline_tra... | sara-02/fabric8-analytics-stack-analysis | tests/unit_tests/test_kronos_softnet_cooccurrence_matrix_generator.py | Python | gpl-3.0 | 4,140 |
#!/usr/bin/env python
# encoding: utf-8
"""
@version: 1.0
@file: celebrities.py
@time: 17/10/20 下午3:02
@desc:
"""
import random
import re
import time
from copy import deepcopy
from os.path import exists
import requests
import scrapy
from scrapy.http import HtmlResponse
from douban.items import CelebrityItem
from ... | pattywgm/funny-spider | douban/douban/spiders/celebrities.py | Python | gpl-3.0 | 10,304 |
#!/usr/bin/env python
#-*- coding: utf-8 -*-
###########################################################################
## ##
## Copyrights Frédéric Rodrigo 2011 ##
## ... | tyndare/osmose-backend | analysers/analyser_osmosis_broken_highway_level_continuity.py | Python | gpl-3.0 | 4,578 |