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 -*-
"""Transliteration data."""
from __future__ import absolute_import, division, print_function, unicode_literals
try: unicode
except NameError: unicode = str
import slp1
from transliteration.detect import TRANSLITERATION_SCHEME
from transliteration import devanagari
from transliteration.transli... | shreevatsa/sanskrit | transliteration/transliterate.py | Python | gpl-2.0 | 8,647 |
""" Tests for non-ascii-name checker. """
áéíóú = 4444 # [non-ascii-name]
def úóíéá(): # [non-ascii-name]
"""yo"""
| PyCQA/pylint | tests/functional/n/non/non_ascii_name.py | Python | gpl-2.0 | 133 |
from collections import defaultdict
import numpy as np
def matML_dot(state, taxa, ll_mats):
LL_mat = defaultdict()
root = state["root"]
p_t = state["transitionMat"]
pi = state["pi"]
edges = state["postorder"]
for parent, child in edges[::-1]:
if child in taxa:
if paren... | PhyloStar/PyBayes | ML.py | Python | gpl-2.0 | 3,629 |
from logging import getLogger, Formatter, DEBUG, WARNING, StreamHandler
from pysecure.config import IS_DEVELOPMENT
default_logger = getLogger()
default_logger.setLevel(DEBUG if IS_DEVELOPMENT else WARNING)
log_console = StreamHandler()
log_format = '%(name)-12s %(levelname)-7s %(message)s'
log_console.setFormatter(F... | dsoprea/PySecure | pysecure/log_config.py | Python | gpl-2.0 | 382 |
from datetime import time, date, datetime
from django.contrib.auth.models import User
from django.conf import settings
from django.core.urlresolvers import reverse
from django.db import models
from django.db.models import Max, Sum, Count
from django.templatetags.static import static
from django.utils import timezone
... | kinglyduck/hackerspace | src/badges/models.py | Python | gpl-2.0 | 9,619 |
# Copyright (C) 2017 Red Hat, Inc., Bryn M. Reeves <bmr@redhat.com>
#
# config_tests.py - Boom report API tests.
#
# This file is part of the boom project.
#
# 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 Genera... | bmr-cymru/boom | tests/config_tests.py | Python | gpl-2.0 | 4,151 |
#!/usr/bin/python3
################################
# File Name: unittestExample.py
# Author: Chadd Williams
# Date: 10/20/2014
# Class: CS 360
# Assignment: Lecture Examples
# Purpose: Demonstrate unit tests
################################
# adapted from https://docs.python.org/3/library/unittest.html
# pytho... | NicLew/CS360-Practive-CI-Testing | unittestExample.py | Python | gpl-2.0 | 1,699 |
#!/usr/bin/env python
# vim:set ts=4 sw=4 ai et:
# Kohorte, a peer-to-peer protocol for sharing git repositories
# Copyright (c) 2015, Michael Toren <kohorte@toren.net>
# Released under the terms of the GNU GPL, version 2
import fcntl
import traceback
import os
import signal
from subprocess import Popen, PIPE, STDOU... | mct/kohorte | p2p/child.py | Python | gpl-2.0 | 2,883 |
# Copyright 2001 by Tarjei Mikkelsen. All rights reserved.
# Revisions copyright 2007 by Michiel de Hoon. All rights reserved.
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package.
"""Tests the basic funct... | updownlife/multipleK | dependencies/biopython-1.65/Tests/test_KEGG.py | Python | gpl-2.0 | 2,438 |
"""
SALTS XBMC Addon
Copyright (C) 2014 tknorris
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.
T... | felipenaselva/repo.felipe | plugin.video.salts/scrapers/xmovies8v2_scraper.py | Python | gpl-2.0 | 7,473 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2009-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)
# a... | PisiLinux-PyQt5Port/package-manager | src/settingsdialog.py | Python | gpl-2.0 | 20,739 |
__all__ = ['ttypes', 'constants', 'PlayerStrategy']
| pezia/poker-croupier | player/py/lib/api/player_strategy/__init__.py | Python | gpl-2.0 | 52 |
# -*- coding: utf-8 -*-
"""
***************************************************************************
Intersection.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
**************************... | alexbruy/QGIS | python/plugins/processing/algs/qgis/Intersection.py | Python | gpl-2.0 | 5,707 |
# -*- coding: utf-8 -*-
# pylint: disable=I0011
""" rTorrent Queue Manager.
Copyright (c) 2012 The PyroScope Project <pyroscope.project@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 Fo... | pyroscope/pyrocore | src/pyrocore/torrent/queue.py | Python | gpl-2.0 | 6,987 |
import dataclasses, datetime, enum, gc, glob, importlib, importlib.util, io
import inspect, os, sys, typing, uuid
from src import Config, EventManager, Exports, IRCBot, Logging, Timers, utils
class ModuleException(Exception):
pass
class ModuleWarning(Exception):
pass
class ModuleNotLoadedException(ModuleExcep... | jesopo/bitbot | src/ModuleManager.py | Python | gpl-2.0 | 17,381 |
from datetime import datetime, timedelta
import contextlib
import logging
import re
import sys
import time
import urllib2
from lib import arginfo
from lib import common
from lib import global_config
# Namespace for options.
ns = "tabbed_text."
# Names of lib.subsystem modules that should be set up i... | Vhati/CompileSubs | lib/parsers/tabbed_text.py | Python | gpl-2.0 | 4,034 |
# 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... | seankelly/buildbot | master/buildbot/db/model.py | Python | gpl-2.0 | 38,375 |
# -*- coding: utf-8 -*-
#
# This file is part of EventGhost.
# Copyright © 2005-2019 EventGhost Project <http://www.eventghost.org/>
#
# EventGhost is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free
# Software Foundation, either versio... | topic2k/EventGhost | eg/Init.py | Python | gpl-2.0 | 6,124 |
from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^(?P<lang>[a-z]{2})?$', views.index, name='index'),
url(r'^sign/$', views.sign, name='sign'),
url(r'^confirm/([0-9a-z]{64})/$', views.confirm, name='confirm'),
]
| sandervenema/netzpolitik | petitions/urls.py | Python | gpl-2.0 | 251 |
# -*- coding: utf-8 -*-
"""
/***************************************************************************
LrsPlugin
A QGIS plugin
Linear reference system builder and editor
-------------------
begin : 2013-10-02
copyright ... | blazek/lrs | lrs/ui/lrscombomanagerbase.py | Python | gpl-2.0 | 5,538 |
# -*- coding: utf-8 -*-
#
# RERO ILS
# Copyright (C) 2020 RERO
# Copyright (C) 2020 UCLouvain
#
# 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 ... | rero/reroils-app | tests/api/acq_orders/test_acq_orders_permissions.py | Python | gpl-2.0 | 7,056 |
#
# Preliminary testing of regular expressions.
#
inputs = [ "aaabcccc", "abc", "aaacccc>", "abab", "aAaAbCcCcC" ]
d = [ { "val" : s } for s in inputs ]
regex = "r<a+b?c+\\>?>"
#
# for the last test case, add 0 so that the results gets coerced into
# an int. sneaky, i know!
#
filedata = """
{$ locals { v : %s,
... | maxtaco/okws | test/regtest/cases/44.py | Python | gpl-2.0 | 829 |
# -*- coding: utf-8 -*-
"""
direct PAS
Python Application Services
----------------------------------------------------------------------------
(C) direct Netware Group - All rights reserved
https://www.direct-netware.de/redirect?pas;upnp
The following license agreement remains valid unless any additions or
changes a... | dNG-git/pas_upnp | src/dNG/data/upnp/services/abstract_service.py | Python | gpl-2.0 | 20,705 |
# coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
class JeuxVideoIE(InfoExtractor):
_VALID_URL = r'http://.*?\.jeuxvideo\.com/.*/(.*?)\.htm'
_TESTS = [{
'url': 'http://www.jeuxvideo.com/reportages-videos-jeux/0004/00046170/tearaway-playstation-vita... | AMOboxTV/AMOBox.LegoBuild | script.module.youtube.dl/lib/youtube_dl/extractor/jeuxvideo.py | Python | gpl-2.0 | 2,038 |
#!/usr/bin/env python2
# EZFIO is an automatic generator of I/O libraries
# Copyright (C) 2009 Anthony SCEMAMA, CNRS
#
# 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 ... | scemama/EZFIO | src/test.py | Python | gpl-2.0 | 1,581 |
# encoding: utf-8
# Tree with recursive multi selection
from yast import import_module
import_module('UI')
from yast import *
import copy
class TreeCheckbox4Client:
def main(self):
UI.OpenDialog(
VBox(
Heading("YaST2 Mini Control Center"),
Tree(
Id("mod"),
... | yast/yast-python-bindings | examples/Tree-Checkbox4.py | Python | gpl-2.0 | 2,467 |
# encoding: utf-8
# module samba.dcerpc.drsblobs
# from /usr/lib/python2.7/dist-packages/samba/dcerpc/drsblobs.so
# by generator 1.135
""" drsblobs DCE/RPC """
# imports
import dcerpc as __dcerpc
import talloc as __talloc
class DsCompressedChunk(__talloc.Object):
# no doc
def __init__(self, *args, **kwargs):... | ProfessorX/Config | .PyCharm30/system/python_stubs/-1247972723/samba/dcerpc/drsblobs/DsCompressedChunk.py | Python | gpl-2.0 | 1,282 |
#!/usr/bin/python
__author__ = 'Bryan Chapman'
__email__ = 'bryanwchapman@gmail.com'
__website__= 'http://trac.aircrack-ng.org/browser/trunk/scripts/airgraph-ng/'
__date__ = '07/16/10'
__version__ = '0.2.5.1'
__file__ = 'airgraph-ng'
__data__ = 'This is the main airgraph-ng file'
"""
Welcome to airgraph written by Bry... | chapware/aircrack | scripts/airgraph-ng/airgraph-ng.py | Python | gpl-2.0 | 15,099 |
"""
Programmer : EOF
File : tester3.py
Date : 2016.01.10
E-mail : jasonleaster@163.com
Description :
"""
import numpy
from matplotlib import pyplot
from km import KMeans
Original_Data = numpy.array([
[1, 1.5],
[1, 0.5],
[0.5, 0.5],
[1.5, 1.5],
[5, 5],
[6, 5.5],
... | jasonleaster/Machine_Learning | K_Means/tester4.py | Python | gpl-2.0 | 691 |
import Player
import Move
import MoveValidator
import MoveExecutor
import WorldMap
import copy
import math
import random
class Simulator(object):
ERROR = 0
WARNING = 1
INFO = 2
VERBOSE = 3
DEBUG = 4
def __init__(self, world_map):
self.max_turns = 10
self.max_playe... | 0ge/Risk-It | sim/Simulator.py | Python | gpl-2.0 | 6,822 |
import inspect
class DebugObject(object):
"""Base class for most iptables classes.
Allows objects to determine the source line they were created from,
which is used to insert debugging information into the generated output
"""
def __init__(self, *args, **kwargs):
super(DebugObject, self)._... | daggaz/python-pyptables | pyptables/base.py | Python | gpl-2.0 | 806 |
#!/usr/bin/python
from sys import exit
import sys
from site_imgsrc import imgsrc
from site_imgur import imgur
from site_deviantart import deviantart
from site_photobucket import photobucket
from site_flickr import flickr
from site_twitter import twitter
from site_tumblr import tumblr
from s... | larsbegas/rip-master | sites/_minux_tst.py | Python | gpl-2.0 | 10,576 |
# coding: utf-8
# In[1]:
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
from pandas import Series,DataFrame
import seaborn as sns
# In[2]:
#https://www.kaggle.com/residentmario/bivariate-plotting-with-pandas/data
reviews = pd.read_csv("winemag-data_first150k.csv", index_col=0)
reviews.h... | muxiaobai/CourseExercises | python/kaggle/data-visual/plot%26seaborn.py | Python | gpl-2.0 | 2,005 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import xbmcaddon,xbmcplugin,xbmcgui,sys,urllib,urllib2,re,socket,os
socket.setdefaulttimeout(30)
pluginhandle = int(sys.argv[1])
addonID = 'plugin.video.vidstatsx_com'
xbox = xbmc.getCondVisibility("System.Platform.xbox")
addon = xbmcaddon.Addon(addonID)
channelFavsFile=xbmc.t... | AddonScriptorDE/plugin.video.vidstatsx_com | default.py | Python | gpl-2.0 | 16,692 |
#!/usr/bin/python
from setuptools import setup, find_packages
setup(
name = "testkit-lite",
description = "Test runner for test execution",
url = "https://github.com/testkit/testkit-lite",
author = "Cathy Shen",
author_email = "cathy.shen@intel.com",
version = "2.3.4",
include_package_data... | borqsat/TCT-lite | setup.py | Python | gpl-2.0 | 506 |
import roach as r
import struct
import numpy as np
import matplotlib.pyplot as plt
import threading
from time import sleep,time
from util import Time
import matplotlib.animation as animation
#set up threading
class AGC_Thread (threading.Thread):
def __init__(self, threadID):
threading.Thread.__... | dgary50/eovsa | adc_plot_og.py | Python | gpl-2.0 | 8,417 |
# -*- coding: utf-8 -*-
import pytest
import random
from cfme.utils import conf
from cfme.utils import error
from cfme.infrastructure import host
from cfme.infrastructure.provider.rhevm import RHEVMProvider
from cfme.infrastructure.provider.virtualcenter import VMwareProvider
from cfme.utils.blockers import BZ
from cf... | quarckster/cfme_tests | cfme/tests/infrastructure/test_individual_host_creds.py | Python | gpl-2.0 | 2,699 |
#!/usr/bin/env python
# -*- coding: UTF8 -*-
"""
author: Guillaume Bouvier
email: guillaume.bouvier@ens-cachan.org
creation date: 2014 04 03
license: GNU GPL
Please feel free to use and modify this, but keep the above information.
Thanks!
"""
import numpy
# generate datasets
def dataset_fixed_cov():
'''... | bougui505/SOM | test/generatedatasets.py | Python | gpl-2.0 | 685 |
import re
import urllib
import requests
import urlparse
import json
import xbmc
from BeautifulSoup import BeautifulSoup
from resources.lib.modules.common import random_agent
from resources.lib.modules import control
from resources.lib.modules import cleantitle
from schism_commons import quality_tag, google_tag, parseD... | azumimuo/family-xbmc-addon | plugin.video.genesisreborn/resources/lib/sources/watchepisodes.py | Python | gpl-2.0 | 3,918 |
# Author: Hubert Kario, (c) 2021
# Released under Gnu GPL v2.0, see LICENSE file for details
from __future__ import print_function
import traceback
import sys
import getopt
from itertools import chain
from random import sample
from tlsfuzzer.runner import Runner
from tlsfuzzer.messages import Connect, ClientHelloGene... | tomato42/tlsfuzzer | scripts/test-sig-algs-renegotiation-resumption.py | Python | gpl-2.0 | 43,213 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Pardus Desktop Services
# Copyright (C) 2010, TUBITAK/UEKAE
# 2010 - Gökmen Göksel <gokmen:pardus.org.tr>
# 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 Founda... | PisiLinux-PyQt5Port/pisilinux-desktop-services | pds/quniqueapp.py | Python | gpl-2.0 | 2,838 |
"""Test the LoadImages module
CellProfiler is distributed under the GNU General Public License.
See the accompanying file LICENSE for details.
Copyright (c) 2003-2009 Massachusetts Institute of Technology
Copyright (c) 2009-2015 Broad Institute
All rights reserved.
Please see the AUTHORS file for credits.
Website: ... | sstoma/CellProfiler | cellprofiler/modules/tests/test_loadimages.py | Python | gpl-2.0 | 195,904 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2009-2013 Zuza Software Foundation
#
# This file is part of Pootle.
#
# 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... | ttreeagency/PootleTypo3Org | pootle/apps/pootle_misc/browser.py | Python | gpl-2.0 | 4,675 |
#!/usr/bin/env python
from flask import (Flask, request, render_template)
from flask.ext import restful
from flask.ext.restful import reqparse
import pickle
SETTINGS_P = 'settings.p'
app = Flask(__name__)
api = restful.Api(app)
def get_settings():
settings = {'state':'off'}
try:
settings = pickle.l... | ajportier/raspi-gpio-work | light-toggle/server.py | Python | gpl-2.0 | 1,463 |
# 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.
import xmlrpclib
import requests
from turbogears.database import sessi... | jtoppins/beaker | IntegrationTests/src/bkr/inttest/server/selenium/test_distros.py | Python | gpl-2.0 | 9,272 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015 University of Dundee & Open Microscopy Environment.
# All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation;... | manics/omero-mpcli | examples/tag-image.py | Python | gpl-2.0 | 1,939 |
"""Threads to be used by the SCRP server"""
# Copyright (C) 2015 Zhang NS, Zifan Li, Zichao Li
#
# 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 o... | GCC15/tcp-chatroom | server/python/core/threads.py | Python | gpl-2.0 | 5,338 |
# -*- coding: UTF-8 -*-
# TcosMonitor version __VERSION__
#
# Copyright (c) 2006-2011 Mario Izquierdo <mariodebian@gmail.com>
#
# This package 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 ... | mariodebian/tcosmonitor | tcosmonitor/extensions/sendfiles.py | Python | gpl-2.0 | 12,245 |
exts_list = [
('lattice', '0.20-35', cran_options),
('nlme', '3.1-131.1', cran_options),
('Matrix', '1.2-12', cran_options),
('mgcv', '1.8-26', cran_options),
('plotfunctions', '1.3', cran_options),
('itsadug', '2.3', cran_options),
('abind', '1.4-5', cran_options),
('acepack', '1.4.1', ... | npklein/easybuild-easyconfigs | easybuild/easyconfigs/r/RPlus/find_missing_extensions.py | Python | gpl-2.0 | 27,561 |
# This is the Twisted Get Poetry Now! client, version 2.0
import datetime
import optparse
import os
import traceback
from twisted.internet.protocol import Protocol, ClientFactory
def parse_args():
usage = """usage: %prog [options] [hostname]:port ...
This is the Get Poetry Now! client, Twisted version 2.0.
... | GreenJoey/My-Simple-Programs | python/Twisted/krondo Twisted Introduction/twisted-client-2/get-poetry-stack.py | Python | gpl-2.0 | 3,806 |
import wx
import random
from sim_scope import ScopePanelList
#----------------------------------------------------------------------------------
class TestSim():
def __init__(self):
self.time_stamp = 0
self.pin_logs = {}
self.pins = ['RA0','RA1','RA2','RA3','RA4','RA5','RA6','RA7',
... | athenajc/XideSDCC | ide/sim/sim_test_app.py | Python | gpl-2.0 | 5,140 |
#!/usr/bin/env python3
import gensafeprime
import contextlib
import textwrap
import hashlib
import fuckpy3 #pylint:disable=unused-import
import random
import numpy as np
import ast
import os
import re
banner = r"""
___ ___ ___ _____ _
/ _ \ / _ \ / _ \ | ___|... | Qwaz/solved-hacking-problem | DEFCON/2020 Quals/ooo-flag-sharing/chal.original.py | Python | gpl-2.0 | 8,529 |
# -*- coding: utf-8 -*-
#
# Copyright 2007-2011 Zuza Software Foundation
#
# This file is part of translate.
#
# translate 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
# ... | phlax/translate | translate/lang/data.py | Python | gpl-2.0 | 21,385 |
vals = {}
| iitml/AL | front_end/gui/plot_vals.py | Python | gpl-2.0 | 10 |
import numpy as np
import nengo
import ctn_benchmark
# define the inputs when doing number comparison task
class NumberExperiment:
def __init__(self, p):
self.p = p
self.pairs = []
self.order = []
rng = np.random.RandomState(seed=p.seed)
for i in range(1, 10):
fo... | tcstewar/finger_gnosis | pointer.py | Python | gpl-2.0 | 16,229 |
# -*- coding: utf-8 -*-
#
# JKal-Filter documentation build configuration file, created by
# sphinx-quickstart on Thu Jul 24 16:56:49 2014.
#
# 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.
#
#... | jepio/JKalFilter | docs/conf.py | Python | gpl-2.0 | 8,011 |
#!/usr/bin/env python
import MySQLdb
import string
import logging
import Reference as r
def CalculateWordCount(InputList,MatchList):
'''Counts the instance of MatchList values in the InputList'''
NumberOfMatches = 0
for w in InputList:
NumberOfMatches += MatchList.count(w)
retur... | AdamDynamic/TwitterMetrics | KeywordSearch.py | Python | gpl-2.0 | 7,402 |
# -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsServer WFS.
From build dir, run: ctest -R PyQgsServerWFS -V
.. note:: 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 Licen... | gacarrillor/QGIS | tests/src/python/test_qgsserver_wfs.py | Python | gpl-2.0 | 39,125 |
class BaseAddress():
_str = ''
@property
def str(self):
if None == self.int:
return None
else:
return self.intToAddr(self.int)
def __init__(self, i=None):
if None == i:
self.int = None
elif isinstance(i, int):
self... | douglaskastle/AcraNetwork | AcraNetwork/protocols/network/BaseAddress.py | Python | gpl-2.0 | 1,174 |
# -*- coding: utf-8 -*-
import numpy as np
import pytest
import pyls
@pytest.fixture(scope='session')
def testdir(tmpdir_factory):
data_dir = tmpdir_factory.mktemp('data')
return str(data_dir)
@pytest.fixture(scope='session')
def mpls_results():
Xf = 1000
subj = 100
rs = np.random.RandomState(1... | rmarkello/pyls | pyls/tests/conftest.py | Python | gpl-2.0 | 1,115 |
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2007 Donald N. Allingham
# Copyright (C) 2008 Brian G. Matherly
# Copyright (C) 2010 Jakim Friant
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publi... | Forage/Gramps | gramps/plugins/tool/desbrowser.py | Python | gpl-2.0 | 5,538 |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Mon Nov 20 20:41:02 2017
@author: jacoblashner
"""
import numpy as np
import matplotlib.pyplot as plt
ae = lambda nu : 1.47*10**(-7) * nu**(2.2)
ao = lambda nu : 8.7*10**(-5)*nu+3.1*10**(-7)*nu**2 + 3.0*10**(-10)*nu**3
d = .3 #cm
ee = lambda nu : (1 -... | MillerCMBLabUSC/lab_analysis | apps/4f_model/Memos/A2/plots.py | Python | gpl-2.0 | 658 |
# -*- coding: UTF-8 -*-
#######################################################################
# ----------------------------------------------------------------------------
# "THE BEER-WARE LICENSE" (Revision 42):
# @Daddy_Blamo wrote this file. As long as you retain this notice you
# can do whatever you want wi... | RuiNascimento/krepo | script.module.lambdascrapers/lib/lambdascrapers/sources_placenta/en_placenta-1.7.8/viooz.py | Python | gpl-2.0 | 4,650 |
# Huffman's algorithm for variable-length encoding
# Takes a plaintext and returns a codebook together with the coded text
def huffman(plaintext):
# helper function: construct the frequency table for the plaintext
def frequency_table(plaintext):
table = {}
for char in plaintext:
if... | kevintroy/huffman_encoding | huffman.py | Python | gpl-2.0 | 4,298 |
import fauxfactory
import pytest
from cfme import test_requirements
from cfme.rest import gen_data
from cfme.tests.automate.custom_button import CLASS_MAP
from cfme.tests.automate.custom_button import OBJ_TYPE
from cfme.utils.appliance.implementations.ui import navigate_to
from cfme.utils.rest import assert_response
f... | izapolsk/integration_tests | cfme/tests/automate/custom_button/test_rest_custom_button.py | Python | gpl-2.0 | 7,392 |
#
# Copyright 2008 Huang Ying <huang.ying.caritas@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) any later version.
#
import... | hying-caritas/ibsuite | ibpy/ibpy/image.py | Python | gpl-2.0 | 12,386 |
# -*- coding: utf-8 -*-
"""
brickv (Brick Viewer)
Copyright (C) 2019 Matthias Bolte <matthias@tinkerforge.com>
mac_pasteboard_mime_fixed.py: Don't add UTF BOM when copying text to the clipboard
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as... | Tinkerforge/brickv | src/brickv/mac_pasteboard_mime_fixed.py | Python | gpl-2.0 | 2,660 |
def __init__(self):
self.twitter = twitter()
self.facebook = facebook()
self.core = core()
class twitter():
consumer_key='CONSUMER_KEY'
consumer_secret='CONSUMER_SECRET'
access_token_key='ACCESS_TOKEN_KEY'
access_token_secret='ACCESS_TOKEN_SECRET'
class facebook():
token='TOKEN'
gr... | mauodias/PyFuteBOT | configTemplate.py | Python | gpl-2.0 | 365 |
#!/usr/bin/python
"""
Software package management library.
This is an abstraction layer on top of the existing distributions high level
package managers. It supports package operations useful for testing purposes,
and multiple high level package managers (here called backends). If you want
to make this lib to support ... | libvirt/autotest | client/common_lib/software_manager.py | Python | gpl-2.0 | 23,931 |
parameter_list=[['../data/snps.dat']]
def features_snp_modular(fname):
from shogun.Features import StringByteFeatures, SNPFeatures, SNP
sf=StringByteFeatures(SNP)
sf.load_ascii_file(fname, False, SNP, SNP)
#print(sf.get_features())
snps=SNPFeatures(sf)
#print(snps.get_feature_matrix())
#print(snps.get_minor_ba... | ratschlab/ASP | examples/undocumented/python_modular/features_snp_modular.py | Python | gpl-2.0 | 462 |
#!/usr/bin/env python
from solo.web.server import WebServer
from solo.web.app import App
class HelloRoot(object):
def index(self):
return "Hello World!"
def page(self, page):
return page
class HelloApp(App):
def initialize(self):
ctl = HelloRoot()
route = self.route()
... | whiteclover/solo | samples/web.py | Python | gpl-2.0 | 609 |
#!/usr/bin/python3
# -*- coding: utf-8 -*
import cgi
import base64
import random
import requests, json
def getCurrentPhoto(currentPhotoMD5):
response = requests.get("http://localhost:9200/photodisplayer/photo/"+currentPhotoMD5)
jsonPhoto = json.loads(response.text)
return jsonPhoto
def add_note(currentPhotoMD5,a... | Annubis45/PhotoDisplayer | cgi-bin/index.py | Python | gpl-2.0 | 2,228 |
#!/usr/local/bin/python3
import secrets, string
length = 16
chars = string.ascii_letters + string.digits + '!@#$%^&*()'
print(''.join(secrets.choice(chars) for i in range(length)))
| supermari0/config | utils/pwgen.py | Python | gpl-2.0 | 183 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# --- BEGIN_HEADER ---
#
# pickle_file_sizes - [insert a few words of module description on this line]
# Copyright (C) 2003-2009 The MiG Project lead by Brian Vinter
#
# This file is part of MiG.
#
# MiG is free software: you can redistribute it and/or modify
# it under the ... | heromod/migrid | mig/wwwuser/pickle_file_sizes.py | Python | gpl-2.0 | 1,433 |
# -*- coding: utf-8 -*-
{
"name" : "Automatical email to customer",
"version" : "1.0",
"author" : "DTBS",
"description": """
Sends automatic when customer created
""",
"website" : "http://dtbsindo.web.id",
"category" : "",
# 'depends': ['base','csmart_base','sale_stock'],
'de... | charismab45515t/dtbs-carrent | customer_auto_email/__openerp__.py | Python | gpl-2.0 | 624 |
import pandas as pd
import struct
def read_pos(f):
""" Loads an APT .pos file as a pandas dataframe.
Columns:
x: Reconstructed x position
y: Reconstructed y position
z: Reconstructed z position
Da: mass/charge ratio of ion"""
# read in the data
n = len(file(f).read())/4... | oscarbranson/apt-tools | apt_importers.py | Python | gpl-2.0 | 4,972 |
import shutil
from setuptools import setup
# Load list of requirements from req file
with open('requirements.txt') as f:
REQUIRED_PACKAGES = f.read().splitlines()
# Load description from README file
with open("README.md", "r") as fh:
LONG_DESCRIPTION = fh.read()
# Rename Scripts to sync with original name
sh... | titom73/inetsix-config-builder | setup.py | Python | gpl-2.0 | 1,313 |
import classifier_multiclass_shared
[traindat, label_traindat, testdat, label_testdat] = classifier_multiclass_shared.prepare_data(False)
parameter_list = [[traindat,testdat,label_traindat,2.1,1,1e-5],[traindat,testdat,label_traindat,2.2,1,1e-5]]
def classifier_multiclasslinearmachine_modular (fm_train_real=traindat... | ratschlab/ASP | examples/undocumented/python_modular/classifier_multiclasslinearmachine_modular.py | Python | gpl-2.0 | 1,156 |
"""Do the prerelease, actual release and post release in one fell swoop!
"""
import logging
import os
from zest.releaser import prerelease
from zest.releaser import release
from zest.releaser import postrelease
from zest.releaser import utils
logger = logging.getLogger(__name__)
def main():
logging.basicConfig... | gforcada/zest.releaser | zest/releaser/fullrelease.py | Python | gpl-2.0 | 847 |
# -*- coding: utf-8 -*-
# Copyright 2013 Christoph Reiter
#
# 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.
"""Everythi... | elbeardmorez/quodlibet | quodlibet/quodlibet/qltk/unity.py | Python | gpl-2.0 | 2,257 |
#
# This file is part of HEPData.
# Copyright (C) 2016 CERN.
#
# HEPData 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.
#
# HEPData is... | eamonnmag/hepdata3 | hepdata/modules/submission/views.py | Python | gpl-2.0 | 5,414 |
import functools
from bottle import request
from ..data.notifications import Notification
def notifies(message, **params):
"""Decorator that creates a notification upon the successful return of it's
wrapped function. E.g.:
@notifies("They're together",
category="joined",
use... | Outernet-Project/librarian | librarian/decorators/notifications.py | Python | gpl-3.0 | 890 |
try:
from plugins.TreesAreMemory2.SimpleConstituent import SimpleConstituent
from plugins.TreesAreMemory2.Feature import Feature
from plugins.TreesAreMemory2.route_utils import *
from plugins.TreesAreMemory2.Parser import read_lexicon
except ImportError:
from SimpleConstituent import SimpleConstitue... | jpurma/Kataja | plugins/TreesAreMemory2/_deprecated_func_support/NodeParser.py | Python | gpl-3.0 | 13,113 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2016-12-05 20:53
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependenc... | Informatorio/Sis_LegajosV2 | courses/migrations/0003_course_usuario.py | Python | gpl-3.0 | 692 |
t1 = ("apple", "banana", "cherry", "durian", "orange")
i = 0
while i < len( t1 ):
print( t1[i] )
i += 1 | paulmcquad/Python | 10-Tuples/Tuple_indices.py | Python | gpl-3.0 | 111 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# i18n
MSG_CONNECTION_NAME = {
"en": "Internet Sharing",
"tr": "Internet Paylaşımı",
"sv": "Internetdelning",
"fr": "Partage de connexion Internet",
"es": "Compartir Internet",
"de": "Internet Freigabe",
"nl": "Internetverbinding delen",
}
MSG_ALL... | vdemir/test_packages | other_packages/iptables/comar/firewall.py | Python | gpl-3.0 | 18,705 |
#!/usr/bin/env python
#coding=utf-8
"""
Copyright (c) 2006-2017 sqlmap developers (http://sqlmap.org/)
See the file 'doc/COPYING' for copying permission
"""
import os
import posixpath
import re
import StringIO
import tempfile
import urlparse
from extra.cloak.cloak import decloak
from lib.core.agent import agent
from ... | hackersql/sq1map | lib/takeover/web.py | Python | gpl-3.0 | 16,870 |
from tkinter import *
from noeud import *
from arete import *
from partie import *
from parsers import *
from majObjets import *
#simulation du retour serveur
def state() :# 1
return "STATE20... | Valars/Ragnar | code/main.py | Python | gpl-3.0 | 3,062 |
import os, shutil
if not os.path.isdir('Bin'):
os.mkdir('Bin')
if not os.path.isdir('Temp'):
os.mkdir('Temp')
| cprogrammer1994/Python-ComputeShader | Prepare.py | Python | gpl-3.0 | 121 |
import time
import unittest
from nive.definitions import *
from nive.tools import *
from nive.security import User
from nive.components.tools.example import configuration
import db_app
# -----------------------------------------------------------------
class ToolTest1(unittest.TestCase):
def test_tool(self):... | nive-cms/nive | nive/tests/test_tool.py | Python | gpl-3.0 | 1,714 |
import unittest
from oklo.core.ids import NuclideId, ReactionId
from oklo.core.defs import ReactionType
class TestNuclideId(unittest.TestCase):
def setUp(self):
self.fixture = NuclideId(Z='Yttrium',A=96,M=0)
def tearDown(self):
del self.fixture
def test_nuclide_Z(self):
... | dadwyer/oklo | oklo/tests/test_ids.py | Python | gpl-3.0 | 2,910 |
from Crypto.Random import random
from Crypto.Hash import SHA, SHA256
from Crypto import Random
from Crypto.PublicKey import RSA
class KeyGen:
# generate an RSA key pair
@staticmethod
def generate_rsa_key():
rand_gen = Random.new().read
k = RSA.generate(1024, rand_gen)
return k
... | alienlike/courier | courier/keygen.py | Python | gpl-3.0 | 1,097 |
#! /usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2007-2018 GPLV3
import os, sys, tarfile, io
from xml.sax import make_parser
from xml.sax.handler import ContentHandler
def debug(s):
sys.stderr.write(s)
def protect(t):
lst = t.split('&')
t = "&".join(lst)
lst = t.split('<')
t = "<".join(lst)
lst =... | ita1024/semantik | src/filters/others.py | Python | gpl-3.0 | 3,251 |
#!/home/pi/.virtualenvs/cv2/bin/python
from picamera.array import PiRGBArray
from picamera import PiCamera
import picamera
from time import sleep
import time
import cv2
import numpy as np
import sys
import datetime
import boto3
import subprocess
import os
import pyowm
import commands
import multiprocessing
import thr... | tangowhisky37/RaspiPythonProjects | OpenCV/CaptureVideoStream/CaptureVideoStream_v0.21.py | Python | gpl-3.0 | 10,532 |
# Relational
# Copyright (C) 2008-2020 Salvo "LtWorf" Tomaselli
#
# Relational 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.
#
# Thi... | ltworf/relational | relational_gui/guihandler.py | Python | gpl-3.0 | 16,612 |
# Copyright 2009-2013 Justin Riley
#
# This file is part of StarCluster.
#
# StarCluster is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the Free
# Software Foundation, either version 3 of the License, or (at your option) any
# later ... | Courtagen/StarCluster | starcluster/commands/listimages.py | Python | gpl-3.0 | 1,349 |
from world.entities.components.component import Component
class Position(Component):
def __init__(self, entity, x, y):
super().__init__(entity)
self.x = x
self.y = y
def pos(self):
return (self.x, self.y)
def cpos(self):
return (self.y, self.x)
| AxelMatstoms/rpg | world/entities/components/position.py | Python | gpl-3.0 | 308 |
import tkinter
import string
from ctypes import windll
import os
'''
for d in string.ascii_uppercase:
if os.path.exists("%s:\\" % (d)):
print("Drive letter '%s' is in use." % (d))
'''
'''
def get_drives():
drives = []
bitmask = windll.kernel32.GetLogicalDrives()
for letter in string.ascii_uppe... | deviantenigma/Savegame-backup-Utility | ignore_fortestingpurposesonly.py | Python | gpl-3.0 | 1,345 |
"""
This tutorial introduces the multilayer perceptron using Theano.
A multilayer perceptron is a logistic regressor where
instead of feeding the input to the logistic regression you insert a
intermediate layer, called the hidden layer, that has a nonlinear
activation function (usually tanh or sigmoid) . One can use ... | vmayoral/basic_reinforcement_learning | tutorial5/tests/theano_mnist_mlp.py | Python | gpl-3.0 | 14,310 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Smewt - A smart collection manager
# Copyright (c) 2008 Ricard Marxer <rikrd@smewt.com>
# Copyright (c) 2013 Nicolas Wack <wackou@smewt.com>
#
# Smewt is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publi... | wackou/smewt | smewt/__init__.py | Python | gpl-3.0 | 1,579 |