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 |
|---|---|---|---|---|---|
# encoding: utf-8
# Thomas Nagy, 2006-2010 (ita)
"""
Add a pre-build hook to remove all build files
which do not have a corresponding target
This can be used for example to remove the targets
that have changed name without performing
a full 'waf clean'
Of course, it will only work if there are no dynamically generat... | kernevil/samba | buildtools/wafsamba/stale_files.py | Python | gpl-3.0 | 4,047 |
import network
import numpy as np
import theano.tensor as T
import theano
import logging
import h5py as h5
import cPickle
import gzip
#theano.config.optimizer='None'
logging.basicConfig(level='INFO')
np.random.seed(893)
# generate data
print '-> loading data'
dset = h5.File('chars_dataset.h5', 'r')
trainX = dset['... | gagnonlg/IFT6266-project | tests/test_lstm_chars.py | Python | gpl-3.0 | 2,889 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2016-12-31 16:18
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('uth_db', '0007_auto_20161231_1609'),
]
operations ... | GeoCSBI/UTH_DB | mysite/uth_db/migrations/0008_auto_20161231_1618.py | Python | gpl-3.0 | 1,203 |
# -*- encoding: UTF-8 -*-
# 2013 Alexandre Vicenzi (vicenzi.alexandre at gmail com)
import os
import sys
import zipfile
def unpack_oxt(file_name, dir_output, root_folder=True):
if not zipfile.is_zipfile(file_name):
return False
with zipfile.ZipFile(file_name, "r") as z:
if not os.path.exists(dir_output):
... | alexandrevicenzi/LightproofExtensions | lightproof_checker_old/extensions.py | Python | gpl-3.0 | 863 |
from distutils.core import setup
setup(
name='Verilog_VCD',
version='1.11',
author='Sameer Gauria',
author_email='sgauria+python@gmail.com',
packages=['Verilog_VCD'],
url='https://pypi.python.org/pypi/Verilog_VCD/',
description='Module to Parse VCD (Value-Change-Dump) files',
long_descr... | pbrenna/vcd2svg | Verilog_VCD/setup.py | Python | gpl-3.0 | 356 |
import pixie.vm.object as object
from pixie.vm.object import affirm
from pixie.vm.primitives import true, false
from rpython.rlib.rarithmetic import r_uint
from rpython.rlib.rbigint import rbigint
import rpython.rlib.jit as jit
from pixie.vm.code import DoublePolymorphicFn, extend, Protocol, as_var, wrap_fn
from pixie.... | justinj/pixie | pixie/vm/numbers.py | Python | gpl-3.0 | 12,461 |
try:
import daltonproject as dp
except ModuleNotFoundError:
print("daltonproject is not installed!")
from pysisyphus.calculators.Calculator import Calculator
from pysisyphus.constants import BOHR2ANG
class Dalton(Calculator):
conf_key = "dalton"
def __init__(self, basis, method="hf", **kwargs):
... | eljost/pysisyphus | pysisyphus/calculators/Dalton.py | Python | gpl-3.0 | 1,727 |
# -*- coding: utf-8 -*-
# ------------------------------------------------------------
# tvalacarta 4
# Copyright 2015 tvalacarta@gmail.com
# http://blog.tvalacarta.info/plugin-xbmc/tvalacarta/
#
# Distributed under the terms of GNU General Public License v3 (GPLv3)
# http://www.gnu.org/licenses/gpl-3.0.html
#... | tvalacarta/tvalacarta | python/main-classic/channels/oncetvmex.py | Python | gpl-3.0 | 6,349 |
# -*- coding: utf-8 -*-
#
# Linux Desktops documentation build configuration file, created by
# sphinx-quickstart on Tue Feb 21 18:34:13 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file... | southampton/linuxdesktopdocs | docs/conf.py | Python | gpl-3.0 | 4,872 |
#!/usr/bin/python
import sys
import re
color_map = [ "silver", "aquamarine", "tan", "skyblue", "plum", "yellowgreen", "moccasin" ]
def get_color_level(n):
return color_map[n % len(color_map)]
def enstyle_parameters(s):
result = ""
if s == "" or s == "void":
return "<b>void</b>"
nexti = s.find("=")
while... | shw700/latrace-plus | frontend/la2html.py | Python | gpl-3.0 | 15,468 |
import M2Crypto
from M2Crypto import m2
import socket
CERTFILE='test/certs/www.example.com-cert.pem'
KEYFILE='test/certs/www.example.com-key.pem'
def main():
print 'initializing ctx ...'
ctx = M2Crypto.SSL.Context(protocol='sslv2')
ctx.load_cert_chain(certchainfile=CERTFILE, keyfile=KEYFILE)
ctx.set_o... | grwl/sslcaudit | test/old/ssl-server-v2.py | Python | gpl-3.0 | 968 |
# -*- coding: utf-8 -*-
# Part of the psychopy.iohub library.
# Copyright (C) 2012-2016 iSolver Software Solutions
# Distributed under the terms of the GNU General Public License (GPL).
from __future__ import division, print_function, absolute_import
from copy import copy
import Quartz as Qz
from AppKit import NSEvent... | psychopy/versions | psychopy/iohub/devices/mouse/darwin.py | Python | gpl-3.0 | 16,790 |
#
# Copyright © 2012–2022 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <https://weblate.org/>
#
# 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 Licens... | nijel/weblate | weblate/accounts/management/commands/dumpuserdata.py | Python | gpl-3.0 | 1,645 |
# -*- coding: utf-8 -*-
import re
import urllib
from module.plugins.internal.MultiHoster import MultiHoster, create_getInfo
from module.plugins.internal.utils import json, parse_size
class AlldebridCom(MultiHoster):
__name__ = "AlldebridCom"
__type__ = "hoster"
__version__ = "0.49"
__status__ ... | fzimmermann89/pyload | module/plugins/hoster/AlldebridCom.py | Python | gpl-3.0 | 1,656 |
#!/usr/bin/env python
###############################################################################
# #
# map.py #
# ... | timbalam/GroopM | groopm/map.py | Python | gpl-3.0 | 10,463 |
#!/usr/bin/env python
# Copyright (C) 2013 Jason Piper - j.piper@warwick.ac.uk
#
# 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... | simonvh/pyDNase | pyDNase/scripts/dnase_to_javatreeview.py | Python | gpl-3.0 | 3,585 |
#!/usr/bin/python3
#
# GCompris - datasetToPo.py
#
# Copyright (C) 2015 Bruno Coudoin <bruno.coudoin@gcompris.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 Foundation; either version 3 of the... | bdoin/GCompris-qt | src/activities/lang/resource/datasetToPo.py | Python | gpl-3.0 | 3,490 |
"""
Django settings for donationProjects project.
Generated by 'django-admin startproject' using Django 1.11.4.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""
... | eellak/gsoc17-donationbox | Donation-Box/DjangoApp/donationProjects/donationProjects/settings.py | Python | gpl-3.0 | 3,148 |
from tkinter import *
from random import choice, randint as rnd
import time
from math import sin, cos, pi
class Gun:
def __init__(self,canvas,v0,tetta,width=30):
global x_vyl,y_vyl
# сразу задаёмся радианами
rad=180/pi
tetta_r=tetta/rad # вместо градусов получили количество ... | alexcigun/KPK2016teachers | A-gun/A gun initial steps 17_06_2016 02 15.py | Python | gpl-3.0 | 4,893 |
"""Complexity collector collects running times of C/C++ functions along with
the sizes of the structures they were executed on. The collected data are
suitable for further postprocessing using the regression analysis and
visualization by scatter plots.
"""
COLLECTOR_TYPE = "mixed"
COLLECTOR_DEFAULT_UNITS = {
'mixe... | tfiedor/perun | perun/collect/complexity/__init__.py | Python | gpl-3.0 | 371 |
from routes.chat import chat_route
from routes.feedback import feedback_route
from flask import Flask
# App Setup
app = Flask(__name__)
app.secret_key = 'whats the good word'
# Route Registration
app.register_blueprint(chat_route)
app.register_blueprint(feedback_route)
## Error Handling
@app.errorhandler(400)
def ... | nab911/rubber-debugy | python/chatbot.py | Python | gpl-3.0 | 593 |
"""
vs_agent.py
An agent that use vector space Prehensions to understand its environment.
"""
import indra.grid_agent as ga
import indra.vector_space as vs
import indra.prehension_agent as pa
class VSAgent(pa.PrehensionAgent):
"""
An agent that use Prehensions to understand its environment.
"""
def __i... | gcallah/Indra | indraV1/indra/vs_agent.py | Python | gpl-3.0 | 1,253 |
# -*- coding: utf-8 -*-
import pygame
from defines import *
from entities import Entity
"""
Generic class for all projectiles in the game.
"""
class BlockEntity(Entity):
#def __init__(self, (x,y), vel, rot, filename, size, parent):
def __init__(self, (x,y), vel, rot, (r,g,b), size, parent):
Entity.__... | spektral/havencore | client/blockentity.py | Python | gpl-3.0 | 2,521 |
import pkg_resources
import pytest
from libres_utils import ResTest
from res.test import ErtTestContext
class ErtTestContextTest(ResTest):
def setUp(self):
self.config = self.createTestPath("local/snake_oil/snake_oil.ert")
def test_raises(self):
with self.assertRaises(IOError):
t... | joakim-hove/ert | tests/libres_tests/res/enkf/test_ert_context.py | Python | gpl-3.0 | 5,152 |
from functools import reduce
def deep_get(dictionary, *keys):
return reduce(
lambda d, key: d.get(key, None) if isinstance(d, dict) else None,
keys,
dictionary,
)
class Hasher(dict):
def __missing__(self, key):
value = self[key] = type(self)()
return value
de... | shahzebsiddiqui/BuildTest | buildtest/utils/tools.py | Python | gpl-3.0 | 837 |
import unittest
from pyrser import grammar
from pyrser import meta
from pyrser import parsing
from pyrser import error
from pyrser.directives import *
class IgnoreNull(grammar.Grammar):
grammar = """
root =[ @ignore("null") [ item : i #add_to(_, i) ]+ eof ]
item = [ ' ' | 'a'..'z' | 'A'..'Z' | '\... | payet-s/pyrser | tests/grammar_directive.py | Python | gpl-3.0 | 6,003 |
# pylint: disable=E1101,E1103,W0232
from datetime import datetime, timedelta
from pandas.compat import range, lrange, lzip, u, zip
import operator
import pickle
import re
import nose
import warnings
import os
import numpy as np
from numpy.testing import assert_array_equal
from pandas.core.index import (Index, Float6... | alephu5/Soundbyte | environment/lib/python3.3/site-packages/pandas/tests/test_index.py | Python | gpl-3.0 | 91,955 |
class Info(object):
def __init__(self, handler):
print handler.command,'from',handler.client_address[0],':',handler.client_address[1]
print handler.request_version
print handler.headers
| tombasche/HiThere | bin/Info.py | Python | gpl-3.0 | 215 |
# [bookhist.py]
# ------------------------------------------------------------------------
# (c) Luu Quang Hung [luuquanghung@gmail.com]
# ...
# calculate histogram of words from a book, adapted from Learn Python, p149
# my extension is to handle book in unicode (UTF-8) format,
# and allow to search the frequency of a... | luuquanghung1982/python | datascience/bookhist.py | Python | gpl-3.0 | 2,593 |
import re, sys, os, json
cwd = os.getcwd()
path = os.path.join(cwd,'WD')
content = {}
for dir, subdirs, files in os.walk(path):
for theFile in files:
evenOdd = int(theFile[:-4]) % 2
wd = str(theFile[:-4])
if evenOdd != 0:
inPath = os.path.join(path,theFile)
f = ... | EthanPlail/GJN | Programs/Walker2.py | Python | gpl-3.0 | 2,835 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Test Suite for Queue code for SnakeByte FServe"""
__author__ = "Stephan Sokolow (deitarion/SSokolow)"
__license__ = "GNU GPL 3.0 or later"
__docformat__ = "restructuredtext en"
import heapq, logging, string, sys
log = logging.getLogger(__name__)
if sys.version_info[0... | ssokolow/snakebyte | test/test_queue.py | Python | gpl-3.0 | 19,415 |
import numpy as np
import random as rand
import sys, os
import copy
import pickle
if __name__ == "__main__":
energy_lst = pickle.load(open("energy_reps.pickle", "rb"))
reps = pickle.load(open("latgas_reps.pickle", "rb"))
energy_lst = energy_lst - np.sum(energy_lst)/len(energy_lst) #energy_lst[0]
kb = ... | skasamatsu/py_mc | examples/HAp-bulk/Elist_to_expect.py | Python | gpl-3.0 | 2,619 |
#!/usr/bin/env python
#
# This file is protected by Copyright. Please refer to the COPYRIGHT file
# distributed with this source distribution.
#
# This file is part of GNUHAWK.
#
# GNUHAWK is free software: you can redistribute it and/or modify is under the
# terms of the GNU General Public License as published by ... | RedhawkSDR/integration-gnuhawk | components/cvsd_encode_sb/tests/test_cvsd_encode_sb.py | Python | gpl-3.0 | 4,071 |
# ----------------------------------------------------------------------
# SSLCAUDIT - a tool for automating security audit of SSL clients
# Released under terms of GPLv3, see COPYING.TXT
# Copyright (C) 2012 Alexandre Bezroutchko abb@gremwell.com
# ----------------------------------------------------------------------... | grwl/sslcaudit | sslcaudit/ui/ClientServerTestResultTreeTableModel.py | Python | gpl-3.0 | 4,855 |
#!/usr/bin/env python3
#
# Copyright (c) Leipzig, Madrid 1999-2015 Gert Wollny
#
# 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... | gerddie/mia | doc/miaxml2sgml.py | Python | gpl-3.0 | 5,295 |
#!/usr/bin/python
#
# Copyright (C) 2014 Che-Hsun Liu <chehsunliu@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 3 of the License, or
# (at your option) any later... | bincker/research | tools/feature/parse_apicall.py | Python | gpl-3.0 | 1,914 |
from .client import EruditCacheClient
def cache_set(cache, key, value, timeout, pids=[]):
# Pass `pids` to our cache client only if we are using EruditCacheClient.
if hasattr(cache, 'client') and isinstance(cache.client, EruditCacheClient):
cache.client.set(key, value, timeout, pids=pids)
else:
... | erudit/zenon | eruditorg/erudit/cache/__init__.py | Python | gpl-3.0 | 357 |
"""Compiles the cffirmware C extension."""
import distutils.command.build
from distutils.core import setup, Extension
import os
fw_dir = "."
include = [
os.path.join(fw_dir, "src/modules/interface"),
os.path.join(fw_dir, "src/hal/interface"),
os.path.join(fw_dir, "src/utils/interface/lighthouse"),
]
modu... | bitcraze/crazyflie-firmware | bindings/setup.py | Python | gpl-3.0 | 1,180 |
# -*- coding: UTF-8 -*-
# Efficient Clipping of Arbitrary Polygons
#
# Copyright (c) 2011, 2012 Helder Correia <helder.mc@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 vers... | karimbahgat/Pure-Python-Greiner-Hormann-Polygon-Clipping | GreinerHorman_Algo/Forster-Overfelt/puremidpoints_v4(maybedone).py | Python | gpl-3.0 | 35,589 |
import taggit
import re
from django import forms
from django.utils.translation import ugettext_lazy as _
from django.contrib.contenttypes.models import ContentType
from geonode.people.models import Profile
from geonode.documents.models import Document
from geonode.maps.models import Map
from geonode.layers.models imp... | AnnalisaS/migration_geonode | geonode/documents/forms.py | Python | gpl-3.0 | 3,649 |
"""
Entry into the program.
"""
import argparse
import logging
import sys
from argparse import ArgumentParser
from pathlib import Path
from unidown import static_data, tools
from unidown.core import manager
from unidown.core.settings import Settings
from unidown.plugin.a_plugin import APlugin
class PluginListAction(... | IceflowRE/MR-eBook-Downloader | unidown/main.py | Python | gpl-3.0 | 3,243 |
# -*- coding: utf-8 -*-
import glob
import os
import sys
import warnings
import matplotlib
matplotlib.use('WXAgg')
from gooey import Gooey, GooeyParser
import peakdet
TARGET = 'pythonw' if sys.platform == 'darwin' else 'python'
TARGET += ' -u ' + os.path.abspath(__file__)
LOADERS = dict(
rtpeaks=peakdet.load_rtpe... | rmarkello/peakdet | peakdet/cli/run.py | Python | gpl-3.0 | 9,927 |
from __future__ import absolute_import, division, print_function, unicode_literals
import dynamics.dumbbell as dumbbell
import dynamics.asteroid as asteroid
import kinematics.attitude as attitude
import pdb
import numpy as np
angle = (2*np.pi- 0) * np.random.rand(1) + 0
# generate a random initial state that is outsi... | skulumani/asteroid_dumbbell | tests/test_dumbell.py | Python | gpl-3.0 | 4,878 |
#!/usr/bin/env python3
'''
Write a function that displays an nbyn matrix
using the following header:
defprintMatrix(n):
Each element is 0 or 1, which is generated randomly.
Write a test program that prompts the user
to enter n and displays an nbyn matrix.
Here is a sample run:
Entern:3
010
000
111
'''
from random... | dennyb87/pycity | week5/matrix.py | Python | gpl-3.0 | 748 |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2005-2010, TUBITAK/UEKAE
#
# 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.
#
#... | hknyldz/pisitools | pisilinux/pisilinux/configfile.py | Python | gpl-3.0 | 11,948 |
#!/usr/bin/env python
# This file is part of nexdatas - Tango Server for NeXus data writer
#
# Copyright (C) 2012-2018 DESY, Jan Kotanski <jkotan@mail.desy.de>
#
# nexdatas is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the ... | jkotan/nexdatas.sardanascanrecorders | setup.py | Python | gpl-3.0 | 2,092 |
from flask.ext import restful
from flask import request
from blindr.common.authenticate import authenticate
import facebook
from blindr.models.event import Event
from blindr.models.user import User
from blindr import db
class Interests(restful.Resource):
method_decorators=[authenticate]
def post(self):
... | theblindr/blindr-backend | blindr/api/interests.py | Python | gpl-3.0 | 467 |
#!/usr/bin/env python
################################################################################
#
# Copyright (C) 2017 Robert Erickson (metaMMAproject@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 F... | metaMMA/metaMMA | mover.py | Python | gpl-3.0 | 13,556 |
#!/usr/bin/env python
#-*- coding: utf-8 -*-
###########################################################################
## ##
## Copyrights Frédéric Rodrigo 2014-2016 ##
## ... | tyndare/osmose-backend | analysers/analyser_merge_recycling_FR_bm.py | Python | gpl-3.0 | 3,207 |
#!/usr/bin/python
# 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 the ... | wavicles/pycode-browser | pycode-browser.py | Python | gpl-3.0 | 14,234 |
import unittest
from gnucashreport.gcreportcli import build_cli_report, parse_args
from test.testinfo import TestInfo
class CliProg_Test(unittest.TestCase):
def test_parse_args(self):
gnucash_file = 'my.gnucash'
xlsx_file = 'my.xlsx'
args = [gnucash_file, xlsx_file]
p_args = pars... | partizand/gnucashreport | src/test/test_cli.py | Python | gpl-3.0 | 798 |
#!/usr/bin/python\<nl>\
# -*- coding: utf-8 -*-
"""
@author nik |
"""
import sys
from collections import namedtuple
# globals
MTLFILE = ''
DUMMY_MAPCALC_STRING_RADIANCE = 'Radiance'
DUMMY_MAPCALC_STRING_DN = 'DigitalNumber'
# helper functions
def set_mtlfile():
"""
Set user defined MTL file, if any
""... | NikosAlexandris/landsat8_metadata | landsat8_metadata.py | Python | gpl-3.0 | 8,942 |
#!/usr/bin/env python3
#--------[ Imports ]-----------------------------------------------------------
import sys
import os
import configparser
import getpass
import libtodo as lib
import utilities as util
import colors as c
from libtodo import Task, Project
#--------[ GLOBALS ]--------------------------------------... | sfelton/todo | todo.py | Python | gpl-3.0 | 13,091 |
# -*- coding: UTF-8 -*-
#
# Copyright (c) 2009 Ars Aperta, Itaapy, Pierlis, Talend.
#
# Authors: David Versmisse <david.versmisse@itaapy.com>
# Hervé Cauwelier <herve@itaapy.com>
#
# This file is part of Lpod (see: http://lpod-project.org).
# Lpod is free software; you can redistribute it and/or modify it unde... | kiniou/blender-smooth-slides | tools/lpod/xmlpart.py | Python | gpl-3.0 | 3,294 |
from dao.rule import Rule
from dao import term
from dao.term import nil, Cons, conslist as L, cons2tuple
from dao.command import Command
from dao.term import vars, DummyVar, CommandCall
from dao.solve import make_solver, set_run_mode, noninteractive
from dao import builtin
from dao.special import *
from dao... | chaosim/dao | samples/sexpression.py | Python | gpl-3.0 | 5,977 |
# Copyright (C) 2013 Statoil ASA, Norway.
#
# The file '__init__.py' is part of ERT - Ensemble based Reservoir Tool.
#
# ERT 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 Licens... | iLoop2/ResInsight | ThirdParty/Ert/devel/python/python/ert/config/__init__.py | Python | gpl-3.0 | 989 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2017-09-03 18:11
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('app', '0006_auto_20170903_1730'),
]
operations = [
migrations.AlterField(
... | Gimpneek/exclusive-raid-gym-tracker | app/migrations/0007_auto_20170903_1811.py | Python | gpl-3.0 | 601 |
import math
# Determine "representative" fetch and wave direction
# INPUT
# ang1: angle of first radial fetch
# dang: angle increment between radials
# wdir: wind direction approach
# x: radial fetch length at given angles
# OUTPUT
# F: representative fetch length
# phi: angle between wind and wave d... | allthroughthenight/aces | python/functions/WGFET.py | Python | gpl-3.0 | 1,840 |
import discord
from discord.ext import commands
class Jeweler (commands.Cog):
"""Plugin for managing pins and reactions. !pin command requires Manage Roles permission in Discord."""
def __init__ (self, bot):
self.bot = bot
@commands.command()
async def pin (self, ctx):
"""Pins a message if Ur... | archie-m-vist/urist-dicehammer | plugins/jeweler.py | Python | gpl-3.0 | 526 |
# Generated by Django 3.1.2 on 2021-02-04 14:46
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('organization', '0016_auto_20210117_2330'),
]
operations = [
migrations.AddField(
model_name='internalgroup',
name='g... | KSG-IT/ksg-nett | organization/migrations/0017_internalgroup_group_image.py | Python | gpl-3.0 | 438 |
"""
Handler for the collision avoidance part of the module.
A specific drone_network.Networking object needs to be running
Custom algorithms can be specified
Spawns a thread by instantiation
Author: Leonidas Antoniou
mail: leonidas.antoniou@gmail.com
"""
from multiprocessing import Process
import threading, time, ite... | LeonNie52/dk-plus | collision_avoidance.py | Python | gpl-3.0 | 22,933 |
from south.db import db
from django.db import models
from feeddb.feed.models import *
class Migration:
def forwards(self, orm):
# Deleting field 'Trial.name'
db.delete_column('feed_trial', 'name')
# Deleting field 'Experiment.name'
db.delete_column('feed_expe... | Squishymedia/feedingdb | src/feeddb/feed/migrations/0005_name2title_drop_name.py | Python | gpl-3.0 | 36,453 |
# coding=utf-8
import re
import urlparse
from feedparser.api import parse
from sickbeard import logger
from sickrage.helper.exceptions import ex
def getFeed(url, request_headers=None, handlers=None):
parsed = list(urlparse.urlparse(url))
parsed[2] = re.sub("/{2,}", "/", parsed[2]) # replace two or more / wit... | pedro2d10/SickRage-FR | sickbeard/rssfeeds.py | Python | gpl-3.0 | 937 |
import importlib.machinery
import importlib.util
import sys
class Finder(importlib.machinery.PathFinder):
"""
Finder
Responsible for locating source files
and loading them with the appropriate loader
"""
_loaders = []
_suffixes = []
@classmethod
def find_module(cls, fullname, pat... | lincheney/import_anything | import_anything/finder.py | Python | gpl-3.0 | 1,139 |
import mr_gpi.convert
class Opts():
"""This class contains the gradient limits of the MR system."""
def __init__(self, kwargs=dict()):
valid_grad_units = ['Hz/m', 'mT/m', 'rad/ms/mm']
valid_slew_units = ['Hz/m/s', 'mT/m/ms', 'T/m/s', 'rad/ms/mm/ms']
self.max_grad = kwargs.get("max_gra... | sravan953/pulseq-gpi | mr_gpi/opts.py | Python | gpl-3.0 | 2,045 |
# @file MInfo.py
# @brief Media Info fetching.
# @author weaves
#
# @details
# This class uses the MediaInfo library for Python.
#
# @note
#
# The library has a limitation that it cannot handle UTF-8 names very
# well. To side-step that, I make a temporary symlink using the 'os'
# module and then use MediaInfo on that.... | eepgwde/pyeg0 | minfo/minfo/MInfo1.py | Python | gpl-3.0 | 3,737 |
####
# 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 the hope that it will be useful,... | SUNY-Oswego-IEEE-Myo-Car/myo-car-driver | myocardriver/car.py | Python | gpl-3.0 | 1,582 |
#!/usr/bin/env python3
# Copyright (C) 2013-2017 Christian Thomas Jacobs.
# This file is part of PyQSO.
# PyQSO 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... | ctjacobs/pyqso | pyqso/dx_cluster.py | Python | gpl-3.0 | 13,367 |
# generated from catkin/cmake/template/pkg.context.pc.in
CATKIN_PACKAGE_PREFIX = ""
PROJECT_PKG_CONFIG_INCLUDE_DIRS = "".split(';') if "" != "" else []
PROJECT_CATKIN_DEPENDS = "".replace(';', ' ')
PKG_CONFIG_LIBRARIES_WITH_PREFIX = "".split(';') if "" != "" else []
PROJECT_NAME = "capra_lidar"
PROJECT_SPACE_DIR = "/ho... | clubcapra/Ibex | src/capra_lidar/catkin_generated/pkg.develspace.context.pc.py | Python | gpl-3.0 | 371 |
# Unfortunately, OpenMaya 2 doesn't support creating deformers
# Therefore we must use the old OpenMaya instead
from maya import OpenMaya as om
from maya import OpenMayaMPx as ompx
import maya.cmds as cmds
# Unfortunately the API has changed somewhat between Maya 2015 and 2016 so we need to get the right attributes i... | dgovil/AdvancedPythonForMaya | Nodes/pushDeformer.py | Python | gpl-3.0 | 5,473 |
#!/usr/bin/python
import os
import sys
import argparse
dirSelf = os.path.dirname(os.path.realpath(__file__))
libDir = dirSelf.rstrip(os.sep).rstrip("toolsDevice").rstrip(os.sep).rstrip("bin").rstrip(os.sep) + os.sep + "lib"
sys.path.append(libDir)
# print("lib : "+ libDir)
import dbOuiDevices
parser ... | shrinidhi666/wtfBox | bin/toolsDevice/country_add.py | Python | gpl-3.0 | 1,238 |
import numpy as np
import scipy.io.wavfile
in_data = scipy.io.wavfile.read('guitar.wav')
#print(in_data[1])
with open('wav_out.txt', 'r') as f:
iterator = 0
for line in f:
in_data[1][iterator] = int(line.strip('\n'))
iterator += 1
scipy.io.wavfile.write('ex edit.wav', in_data[0], in_d... | BigBird42/The-White-Box | Software/Python DSP/wav write.py | Python | gpl-3.0 | 327 |
import smtplib
import subprocess
import datetime
import jinja2
import base64
from email.mime.text import MIMEText
def get_host_name():
try:
command = "uname -n"
process = subprocess.Popen(command.split(), stdout=subprocess.PIPE)
output = process.communicate()[0]
return output
except:
return None
def ge... | modmypi/PiModules | code/python/package/pimodules/alerts.py | Python | gpl-3.0 | 1,809 |
'''
This module grabs various threat/intel feeds on the internet and will store
if the IP is in any of the feeds.
List of feeds came from the isthisipbad project - go check it out!
https://github.com/jgamblin/isthisipbad
'''
import urllib2
class IntelGather:
def __init__(self):
self.cli_name = "FeedLis... | drptbl/Just-Metadata | modules/intelgathering/feed_urls.py | Python | gpl-3.0 | 12,012 |
from resources.routes import Route
import bottle
import oauth2
def simple_oauth(consumer_secret=None):
"""
Verify 2-legged oauth (per request).
base on http://philipsoutham.com/post/2172924723/two-legged-oauth-in-python
Parameters accepted as values in "Authorization" header, or as a GET request
o... | barjuegocreador93/pycab | resources/oauth2/settings.py | Python | gpl-3.0 | 4,029 |
# -*- coding: utf-8 -*-
"""
print_media
===========
A Pelican plugin that transforms generated HTML to be more suitable
for printing. Based on pelican-cite.
"""
import logging
import os
import re
import sys
from typing import Dict, List, Match, Union
from jinja2 import Environment, FileSystemLoader
from pelican impor... | dciabrin/blog-dump | plugins/print_media/__init__.py | Python | gpl-3.0 | 2,684 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import re
code = open('0vercl0k_writeup/wbaes128_solve.cpp', 'r').read().split('\n')
#print code
rounds=[]
inblock=False
blockcount=-1 # no bug here
block=[]
for line in code:
begin_round_pattern = '^ for'
match = re.search(begin_round_pattern, line)
if ma... | SideChannelMarvels/Deadpool | wbs_aes_nsc2013/RE/ssa_algorithm_step1.py | Python | gpl-3.0 | 800 |
import math
n = int(input())
media = 0
desvio = 0
vec =[]
for i in range(n):
vec.append(float(input()))
media += vec[i]/n
desvio = sum([(vec[i]-media)**2/n for i in range(n)])
print(media, "", math.sqrt(desvio))
| LTKills/languages | python/37.py | Python | gpl-3.0 | 224 |
# Unwrapt - cross-platform package system emulator
# Copyright (C) 2010 Chris Oliver <chris@excid3.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 3 of the L... | excid3/keryx | keryx/unwrapt/__init__.py | Python | gpl-3.0 | 1,083 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# vim: set expandtab tabstop=4 shiftwidth=4 :
# message_queue.py - A module of the Exocortex XMPP Bridge that implements the
# message queue as a global so the other classes can all see it.
#
# This is part of the Exocortex Halo project
# (https://github.com/virtadp... | virtadpt/exocortex-halo | exocortex_xmpp_bridge/message_queue.py | Python | gpl-3.0 | 2,956 |
# -*- 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):
# Changing field 'Relation.service'
db.alter_column('alibrary_relation', 'service', self.gf('django.db.mode... | hzlf/openbroadcast | website/apps/alibrary/migrations/0112_auto__chg_field_relation_service.py | Python | gpl-3.0 | 57,860 |
from collections import namedtuple
#: namedtuple for NetCDF variable information
NcVar = namedtuple("NcVar", ["name", "verbose_name", "unit"])
WATERLEVEL = NcVar("s1", "waterlevel", "m MSL")
DISCHARGE = NcVar("q", "discharge", "m3/s")
VELOCITY = NcVar("u1", "velocity", "m/s")
VOLUME = NcVar("vol", "volume", "m3")
DI... | nens/threedi-qgis-plugin | datasource/result_constants.py | Python | gpl-3.0 | 4,233 |
# NOTE: these are all Main mode selection movements - there are similar paradigms, so you may want to make these more extensible. just start here.
class UIMovement:
@classmethod
def left(ui):
node = ui.selected
if node.parent != ui.root:
ui.selected = node.parent
# TODO: move cursor position
... | MrAwesome/pnb | pnb/bak/ui_movement.py | Python | gpl-3.0 | 1,520 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This is a port of the original in testprogs/ejs/ldap.js
import optparse
import sys
import os
sys.path.insert(0, "bin/python")
import samba
samba.ensure_external_module("testtools", "testtools")
samba.ensure_external_module("subunit", "subunit/python")
import samba.geto... | gwr/samba | source4/dsdb/tests/python/sam.py | Python | gpl-3.0 | 108,681 |
## -*- coding: utf-8 -*-
import pytest
from . import admin_rights
@pytest.mark.parametrize(('track_id', 'expected_response', 'text_list',), [
('t1', 200, ['Test Track 1' , 'series X', 'anime', 'ここ', 'test/image1.jpg' ]),
('t2', 200, ['Test Track 2' , 'series X', 'anime', 'äöü', 'test/preview2.flv']),
... | richlanc/KaraKara | website/karakara/tests/integration/test_tracks.py | Python | gpl-3.0 | 2,637 |
# Natural Language Toolkit: Interface to TADM Classifier
#
# Copyright (C) 2001-2010 NLTK Project
# Author: Joseph Frazee <jfrazee@mail.utexas.edu>
# URL: <http://www.nltk.org/>
# For license information, see LICENSE.TXT
import sys
import subprocess
from nltk.internals import find_binary
try:
import numpy
except... | markgw/jazzparser | lib/nltk/classify/tadm.py | Python | gpl-3.0 | 3,439 |
from urllib import urlencode
from cdxobject import CDXException
#=================================================================
class CDXQuery(object):
def __init__(self, **kwargs):
self.params = kwargs
if not self.params.get('matchType'):
url = self.params.get('url', '')
... | machawk1/pywb | pywb/cdx/query.py | Python | gpl-3.0 | 3,056 |
import os
from adoddler import configuration
from adoddler.action import HTMLTemplateAction
class DeleteAction( HTMLTemplateAction ) :
def do_POST( self, handler ) :
if 'file' in handler.parameters :
file = handler.parameters['file'][0]
if file.find("..") >= 0 :
... | nickthecoder/adoddler | adoddler/action/deleteAction.py | Python | gpl-3.0 | 570 |
from channels import route_class, route
from webterminal.consumers import Webterminal, CommandExecute, SshTerminalMonitor, BatchCommandExecute
from guacamole.consumers import GuacamoleWebsocket, GuacamoleMonitor
# The channel routing defines what channels get handled by what consumers,
# including optional matching on... | jimmy201602/webterminal | webterminal/routing.py | Python | gpl-3.0 | 927 |
"""
* action wrapping a core action to give it an icon, mnemonic name, role(?), etc.
* confirmation wrappers with mnemonics on options
* manager (sits on an ActionManager with navigation)
* columns can show arbitrary metadata, with custom formatters
* address bar (tied to a manager (core manager? navigation hi... | ikn/fsmanage | fsmanage/qt.py | Python | gpl-3.0 | 381 |
# Copyright (C) 2011, 2012 Abhijit Mahabal
#
# 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 distribu... | amahabal/PySeqsee | farg/apps/seqsee/workspace.py | Python | gpl-3.0 | 14,012 |
""" Plugin entry point for helga """
import re
import requests
from amazon.api import AmazonAPI
from bs4 import BeautifulSoup
from helga import settings
from helga.plugins import match
PRODUCT_REGEX = r'amazon\.com/(?:[\w|-]+/)?dp/(\w+)'
PRUDUCT_URL = 'https://www.amazon.com/dp/'
RESPONSE_TEMPLATE = 'Title: {} Pric... | narfman0/helga-amazon-metadata | helga_amazon_meta/plugin.py | Python | gpl-3.0 | 1,952 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# filename: connection.py
import socket
import os
import sys
import time
import random
from itertools import chain
from fdfs_client.exceptions import (
FDFSError,
ConnectionError,
ResponseError,
InvaildResponse,
DataError
)
# start class Connection
cla... | kimiscircle/fdfs_client-py | fdfs_client/connection.py | Python | gpl-3.0 | 6,745 |
import os
import datetime
from pupa.scrape import Scraper, Bill, VoteEvent
from pupa.scrape.base import ScrapeError
import xlrd
import scrapelib
import lxml.html
import pytz
class OHBillScraper(Scraper):
_tz = pytz.timezone('US/Eastern')
def scrape(self, session=None, chambers=None):
# Bills endpoi... | votervoice/openstates | openstates/oh/bills.py | Python | gpl-3.0 | 28,013 |
#example file using as a python package
import os
import sys
#add two dirs up to path
sys.path.insert(0,os.path.dirname(os.path.dirname(os.path.dirname(os.path.realpath(__file__)))))
import imgtrkr as it
it.AddTrkr('/home/nfs/z3457920/hdrive/repos/imgtrkr/examples/test.png',{'Created with':os.path.realpath(__file__)})... | chrisb13/imgtrkr | examples/pyeg.py | Python | gpl-3.0 | 392 |
# -*- coding: utf-8 -*-
class TypeRegistry(object):
def __init__(self):
self.type_map = {}
def __contains__(self, v):
return v in self.type_map
def convert(self, type_str):
raise NotImplementedError
def register(self, pytype, cpptype):
self.type_map[pytype] = cpptype... | mugwort-rc/py2cpp | py2cpp/types.py | Python | gpl-3.0 | 321 |
# gizela
#
# Copyright (C) 2010 Michal Seidl, Tomas Kubin
# Author: Tomas Kubin <tomas.kubin@fsv.cvut.cz>
# URL: <http://slon.fsv.cvut.cz/gizela>
#
# $Id$
from gizela.util.Ellipsoid import Ellipsoid
from gizela.data.PointGeodetic import PointGeodetic
from gizela.data.PointCart import PointCart
from gizela.data.A... | gizela/gizela | gizela/data/CoordSystemLocal.py | Python | gpl-3.0 | 6,331 |
"""This script computes the frequency of professions in the FHS.
The script considers only the jobseekers that are unemployed to date (well to
the date of the FHS) and get the # of jobseekers in each job.
It outputs a simple JSON file with a mapping from the OGR codes to the # of
jobseekers in the corresponding job.
... | bayesimpact/bob-emploi | data_analysis/importer/fhs_job_frequency.py | Python | gpl-3.0 | 2,946 |
#!/usr/bin/env python3
# Version 1.1
# Author Alexis Blanchet-Cohen
# Date: 09/06/2014
import argparse
from collections import OrderedDict
import glob
import os
import subprocess
import util
# Read the command line arguments.
parser = argparse.ArgumentParser(description="Generates Cufflinks scripts, in the old forma... | blancha/abcngspipelines | rnaseq/cufflinks.py | Python | gpl-3.0 | 3,086 |
# -*- 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 'Developer'
db.create_table('frontend_developer', (
('id', self.gf('django.db.mod... | hadronproject/HadronWeb | apps/frontend/migrations/0003_auto__add_developer__add_frontendimage__add_field_page_published__add_.py | Python | gpl-3.0 | 8,978 |