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 python
"""Main entry point with default configuration."""
from __future__ import with_statement
__author__ = 'Manuel Holtgrewe <manuel.holtgrewe@fu-berlin.de>'
import logging
import optparse
import sys
import main as lm
def createDefaultConfig():
return [], []
def main(ast_checks, file_checks)... | holtgrewe/linty | linty/app.py | Python | gpl-3.0 | 2,179 |
__all__ = ["ComboMenuDelegate", "CheckComboBox"]
from firefly.qt import (
Qt,
QAbstractItemDelegate,
QApplication,
QStyle,
QStyleOptionMenuItem,
QBrush,
QColor,
QPixmap,
QPalette,
QIcon,
QFontMetrics,
QComboBox,
QTimer,
QStyleOptionComboBox,
QStylePainter,
... | immstudios/firefly | firefly/widgets/comboutils.py | Python | gpl-3.0 | 10,175 |
#!/usr/bin/python
from xml.dom.minidom import Element
from lib.ifaced import Ifaced
from persistence.state import State
from srv.registry import registry
class Game(Ifaced,State):
"""
The game defines how the phases can follow each other.
The init of agame should define the state machine
"""
def __init__(self):... | magwas/gamsrv | srv/game.py | Python | gpl-3.0 | 914 |
import math
"""
Helper class to convert
string <--> numbers,
raw sensor readings --> temperature
*C <--> *F
"""
class Converter():
"""
Helper function to convert an ASCII string into a float
"""
def asciiToFloat(self, ascnumber):
res = float(ascnumber)
return res
"""
Helper function to convert a floa... | anawas/wasserblog | Converter.py | Python | gpl-3.0 | 880 |
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
import sys
extra = {}
if sys.version_info >= (3,):
extra['use_2to3'] = True
setup(name='topcoder-dl',
version='0.0.2',
install_requires=[
r for r in open('requirements.txt', 'r').read().split('\n')... | tushar-rishav/topcoder-dl | setup.py | Python | gpl-3.0 | 1,081 |
"""
WSGI config for osmdemo project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`` ... | openshift-mobile/openshift-mobile-app-demo | wsgi/osmdemo/osmdemo/wsgi.py | Python | gpl-3.0 | 1,422 |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2012-2015 bendikro bro.devel+yarss2@gmail.com
#
# This file is part of YaRSS2 and is licensed under GNU General Public License 3.0, or later, with
# the additional special exception to link portions of this program with the OpenSSL library.
# See LICENSE for more details.
#
fr... | bendikro/deluge-yarss-plugin | yarss2/tests/test_core.py | Python | gpl-3.0 | 4,825 |
# pylint: disable=redundant-returns-doc,missing-return-type-doc
import oaipmh.error
import oaipmh.interfaces
class BaseProvider(oaipmh.interfaces.IOAI, object):
"""
A base provider which roughly implements the PyOAI interface for OAI-PMH
servers.
Extend this if you're writing your own provider for a ... | wettenhj/mytardis | tardis/apps/oaipmh/provider/base.py | Python | gpl-3.0 | 4,794 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
########################################################################
#
# Copyright 2015 Gerhard Klostermeier
#
# 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 Sof... | ikarus23/MifareClassicTool | tools/dump-file-converter/mfd2eml.py | Python | gpl-3.0 | 1,516 |
# Copyright (C) 2012 Johnny Vestergaard <jkv@unixcluster.dk>
#
# 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 ... | johnnykv/mnemosyne | normalizer/modules/dionaea_capture.py | Python | gpl-3.0 | 2,447 |
import logging
from custom_exceptions import exceptions
from robustsecretsharing import rss
def share(secret, player_ids, threshold):
"""
Construct shares of the given secret such that shares below the threshold
yield no information, but shares above the threshold recreate the secret.
Args:
s... | sudssm/daruma | tools/shamir_secret_sharing.py | Python | gpl-3.0 | 3,124 |
from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^([a-zA-Z0-9_\-]+)/$', views.invite, name='invitations'),
url(r'^([a-zA-Z0-9_\-]+)/send/$', views.invitation_send, name='invitations_send'),
] | fsinfuhh/Bitpoll | bitpoll/invitations/urls.py | Python | gpl-3.0 | 227 |
""" Accounting Cache
"""
import os.path
import time
import threading
from DIRAC import S_OK, S_ERROR, gLogger, rootPath, gConfig
from DIRAC.Core.Utilities.DictCache import DictCache
class DataCache(object):
def __init__(self, dirName="accountingPlots"):
self.graphsLocation = os.path.join(gConfig.getValue... | DIRACGrid/DIRAC | src/DIRAC/Core/Utilities/Plotting/DataCache.py | Python | gpl-3.0 | 3,456 |
#!/usr/bin/env python
# vim: set encoding=utf-8 tabstop=4 softtabstop=4 shiftwidth=4 expandtab
#########################################################################
# Copyright 2012-2013 Marcus Popp
#########################################################################
# This file is part of SmartHome.py. htt... | mptei/smarthome | plugins/cli/__init__.py | Python | gpl-3.0 | 7,382 |
# Copyright (C) 2010-2018 The ESPResSo project
#
# This file is part of ESPResSo.
#
# ESPResSo 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 v... | mkuron/espresso | testsuite/python/lb_get_u_at_pos.py | Python | gpl-3.0 | 3,270 |
from .base import FileType
from . import tools
from six import string_types
import numpy
import os
from glob import glob
import inspect
class FileStack(FileType):
"""
A file object that offers a continuous view of a stack of subclasses of
:class:`~nbodykit.io.base.FileType` instances.
This allows data... | bccp/nbodykit | nbodykit/io/stack.py | Python | gpl-3.0 | 3,525 |
from ideFoam.inputFiles import ReadWriteFile, getFilePath
from PyFoam.Basics.DataStructures import Dimension, Vector
from os.path import join
"""
Convenience class to simply write DecomposeParDict
"""
class DecomposeParDict(ReadWriteFile) :
"""
DecomposeParDict dictionnary
"""
@classmetho... | BV-DR/foamBazar | ideFoam/inputFiles/decomposeParDict.py | Python | gpl-3.0 | 1,205 |
#!/usr/bin/env python
import sys
import json
import pygame
import os.path
import platform
import modes
pygame.font.init()
FONT = pygame.font.Font(None, 36)
CONFIG_FILE = 'config.json'
class UnsupportedPlatfform(Exception):
def __str__(self):
return 'Unsupported platform: %s' % platform.system()
clas... | int-0/aftris | resources.py | Python | gpl-3.0 | 2,709 |
#!/usr/bin/python
import pickle
import sys
sys.path.append("../tools/")
from feature_format import featureFormat, targetFeatureSplit
from sklearn import cross_validation
from sklearn.tree import DecisionTreeClassifier
from sklearn.metrics import precision_score
from sklearn.metrics import recall_score
data_dict = pic... | mdegis/machine-learning | 014 - Evaluation/evaluate_poi_identifier.py | Python | gpl-3.0 | 1,546 |
import os
from chillfunc import clear
clear()
print (' ')
print (' ')
print (' ')
print (' ')
print (' ')
print (' ')
print (' ')
print (' ')
print (' ')
print (' ')
print ('********************************************************************************')
print ('* ... | chillxjr/chillrpg | chill-rpg/rpg/use.py | Python | gpl-3.0 | 1,368 |
import os
from django.test import TestCase
from ..backend import utils
from . import factories
from . import config
from . import mixins
class TestUtils(mixins.ScriptFactoryMixin, TestCase):
def test_sanitize_name(self):
assert(utils.sanitize_name('abc')) == 'abc'
assert(utils.sanitize_name('ab ... | Chris7/django-djangui | djangui/tests/test_utils.py | Python | gpl-3.0 | 2,594 |
import os
import warnings
import ConfigParser
import click
import tagutils
def create_config(tag):
config = ConfigParser.RawConfigParser()
config.add_section('tags')
config.set('tags', 'tags', tag)
return config
def append_tags(config, tag):
if not config.has_section('tags'):
config.a... | lowks/pymr | pymr/register.py | Python | gpl-3.0 | 1,653 |
#!/usr/bin/env python
#
# Test 1D FFT and IFFT calculations.
#
# Hazen 07/19
#
import numpy
import pyopencl as cl
import pyOpenCLNCS
import pyOpenCLNCS.py_ref as pyRef
kernel_code = """
__kernel void fft4_test(__global float4 *x_r, __global float4 *x_c, __global float4 *y_r, __global float4 *y_c)
{
float4 r;
... | HuanglabPurdue/NCS | opencl/pyOpenCLNCS/test/test_fft.py | Python | gpl-3.0 | 8,780 |
import numpy as np
import fileManipulation as jfm
import nBiggest
import nSmallest
def bufferedColumnMax(bufferedFile,columnInds):
"""Using buffered file reading, finds the maximum value in each specified column
"""
data,eof = bufferedFile.readLines()
data = np.atleast_2d(data)
maxs = np.amax(data[:,columnI... | jimbarrett27/jimsUtils | jimsUtils/bigDataFunctions.py | Python | gpl-3.0 | 1,871 |
import math
import typing
import pygame
import pygame.gfxdraw
import random
from pygame.math import Vector2
from toddler.colors import random_color
from toddler.drawable import DrawableList
from toddler.shapes.shape import Shape
from toddler.utils import random_pos_within
class Polygon(Shape):
def __init__(sel... | kageurufu/pygame-toddler | toddler/shapes/polygon.py | Python | gpl-3.0 | 1,250 |
''' Test the output of the population model
Author: Christopher Strickland
Email: wcstrick@live.unc.edu'''
import pytest
import numpy as np
from scipy import sparse
from Run import Params
from conftest import data_avail
@data_avail
def test_result(params,modelsol):
# params was loaded with modelsol, so they shou... | mountaindust/Parasitoids | tests/test_Result.py | Python | gpl-3.0 | 767 |
import numpy as np
import matplotlib.pyplot as plt
theta=(np.arange(0,2*np.pi,0.01))
r = 1*(pow(np.sin(theta),2))
r2 = 1.5*(pow(np.sin(theta),2))
r3 = 2*(pow(np.sin(theta),2))
r4= 2.5*(pow(np.sin(theta),2))
r5= 3*(pow(np.sin(theta),2))
r6 = 3.5*(pow(np.sin(theta),2))
a1 = plt.subplot(111, polar=True)
a1.plot(theta,r... | ingelectronicadj/FisicaConPython | camposElectromagneticos/Dipolo Electrico/Dipolo Electrico 2D.py | Python | gpl-3.0 | 927 |
from setuptools import setup
setup(
name = 'pdftablr',
packages = ['pdftablr'],
scripts = ['pdftable'],
version = '0.1.0',
description = "Python3 implementation of Kyle Cronan's pdftable module, with unit tests",
long_description = """
This is a Python 3 module and command line utility that analyzes XML ... | philgooch/pdftable | setup.py | Python | gpl-3.0 | 2,518 |
# -*- coding: utf-8 -*-
__params__ = {'la': 32, 'lb': 32, 'da': 10}
def protocol(client, server, params):
la = params["la"]
lb = params["lb"]
da = params["da"]
client.a = SignedVec(bitlen=la, dim=da).input(src=driver, desc="a")
client.b = Signed(bitlen=lb).input(src=driver, desc="b")
client.c... | tastyproject/tasty | tasty/tests/functional/protocols/mul/signedvec_client_client_client/protocol.py | Python | gpl-3.0 | 386 |
#!/usr/bin/env python
# encoding: utf-8
#
# Copyright (c) 2008 Doug Hellmann All rights reserved.
#
"""Simple example with urllib2.urlopen().
"""
#end_pymotw_header
import urllib2
request = urllib2.Request('http://localhost:8080/')
request.add_header('User-agent', 'PyMOTW (http://www.doughellmann.com/PyMOTW/)')
resp... | qilicun/python | python2/PyMOTW-1.132/PyMOTW/urllib2/urllib2_request_header.py | Python | gpl-3.0 | 386 |
import pkg_a.pkg_b.suma
pkg_a.pkg_b.suma.sumar(3, 4)
from pkg_a.pkg_b import fibo
fibo.print_fibo(20)
from pkg_a.pkg_c.algo import hacer_algo
hacer_algo()
| UNAH-SISTEMAS/2017-2PAC-POO | 210_paquetes/test_pkg.py | Python | gpl-3.0 | 159 |
# -*- coding: utf-8 -*-
# Dioptas - GUI program for fast processing of 2D X-ray diffraction data
# Principal author: Clemens Prescher (clemens.prescher@gmail.com)
# Copyright (C) 2014-2019 GSECARS, University of Chicago, USA
# Copyright (C) 2015-2018 Institute for Geology and Mineralogy, University of Cologne, Germany
... | Dioptas/Dioptas | dioptas/controller/MainController.py | Python | gpl-3.0 | 14,383 |
#!/usr/bin/env python
# This file is part of ppnc.
# ppnc Copyright (C) 2015 University of Cambridge
# Ppnc 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 y... | rcurr/ppnc | ppnc_cella.py | Python | gpl-3.0 | 12,925 |
""" This module defines classes regarding sssd tools,
AD Operations and LDAP Operations"""
from __future__ import print_function
import os
import tempfile
import subprocess
import array
import random
import socket
import shlex
try:
import ConfigParser
except ImportError:
import configparser as ConfigParser
fro... | fidencio/sssd | src/tests/python/sssd/testlib/common/utils.py | Python | gpl-3.0 | 40,995 |
ar_left = 0
ar_right = 0
x = 0
sand_color = "[[[206 186 138]]]"
deep_water_color = "[[[96 129 183]]]"
| Metal079/GraalOnline-Olwest-Panning-Bot | config.py | Python | gpl-3.0 | 102 |
#! /usr/bin/python3
import fileinput
import sys
import freeling
## Modify this line to be your FreeLing installation directory
FREELINGDIR = "/usr/local";
DATA = FREELINGDIR+"/share/freeling/";
LANG="es";
freeling.util_init_locale("default");
# create options set for maco analyzer. Default values are Ok, except for... | alexrudnick/chipa | squoiawsd/preprocess.py | Python | gpl-3.0 | 1,553 |
# -*- coding: utf-8 -*-
"""
This is the main script that will orchestrate the analysis of
Euclid-VIS FM Ground Calibration Campaign.
The functions of this module are:
- Take inputs as to what data is to be analyzed, and what analysis scripts
are to be run on it.
- Set the variables necessary to process... | ruymanengithub/vison | vison/pipe/master.py | Python | gpl-3.0 | 19,393 |
import numpy as np
import pandas as pd
from joblib import Parallel, delayed
from .utils._sequence import *
from .utils._mf import *
from ._classification import defClf, defCv
from ..statistics import bino_da2p
__all__ = ['mf', 'sequence']
class mf(object):
"""Compute multi-features (mf) with the possibility o... | EtienneCmb/brainpipe | brainpipe/classification/_multifeatures.py | Python | gpl-3.0 | 11,706 |
def tokenize(tweet):
tokens = {}
return tokens # FIXME
text = tweet["processed_text"]
for i in range(len(text) - 2):
tokens[text[i:i + 2]] = tokens.get(text[i:i + 2], 0) + 1
return tokens
| Xero-Hige/Magus | src/to_check/tokenizers/tokenizer_caps_bigrams.py | Python | gpl-3.0 | 219 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2014-2015 Bitergia
#
# 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 la... | pombredanne/sortinghat | tests/test_matcher_email_name.py | Python | gpl-3.0 | 15,749 |
#
# Copyright (C) 2013,2014,2015,2016 The ESPResSo project
#
# This file is part of ESPResSo.
#
# ESPResSo 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)... | tbereau/espresso | samples/python/p3m.py | Python | gpl-3.0 | 6,612 |
"""
model_a.py
by Ted Morin
contains a function to predict 4-year risk of incident Intermittent Claudication using logistic model from
10.1161/01.CIR.96.1.44
1997 Intermittent Claudication: A Risk Profile From The Framingham Heart Study
function expects parameters of
'Sex' 'Age' 'Systolic BP' 'Diastolic BP' 'Cigarett... | doirisks/dori | models/10.1161:01.CIR.96.1.44/model_a.py | Python | gpl-3.0 | 1,967 |
#!/usr/bin/env python
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
from optparse import OptionParser
import json
import os
import re
import subprocess
import shlex
playbook_whitelist = {
'-v': False,
'-i': True,
'-M': True,
'-e': True,
'-f': True,
'-k': False,
'-K': False,... | cleanerbot/ansible-security | webserver/server.py | Python | gpl-3.0 | 3,620 |
####################################################################################################
import numpy as np
import matplotlib.pyplot as plt
####################################################################################################
import PySpice.Logging.Logging as Logging
logger = Logging.setup... | thomaslima/PySpice | examples/filter/low-pass-rlc-filter.py | Python | gpl-3.0 | 2,094 |
#!/usr/bin/env python
# -*- Mode: Python; coding: utf-8; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*-
#Active-Eye
#Author Prudence-Suspect
import os
import string
from colorama import *
init()
class banners:
def banner(self):
print ""
print Fore.YELLOW + ' _ . - = - .... | Prudence-Suspect/Active_Eye | modules/banners.py | Python | gpl-3.0 | 2,549 |
#!/usr/bin/python
## "isReset48V.py"
## RESET 48V powersupply on IS (international station)
## can only be used on IS (international) LCU
##
## usage: ./isReset48V.py
##
## Author: Pieter Donker (ASTRON)
## Last change: november 2011
from isEcLib import *
import sys
import time
VERSION = '1.1.0' # version of this s... | jjdmol/LOFAR | MAC/Tools/Power/isReset48V.py | Python | gpl-3.0 | 1,233 |
"""
Copyright 2018 Oliver Smith
This file is part of pmbootstrap.
pmbootstrap 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.
pmbootstrap ... | postmarketOS/pmbootstrap | pmb/build/qemu_workaround_aarch64.py | Python | gpl-3.0 | 1,253 |
#!/usr/bin/env python
import base
import readers
try:
import numpy as np
except:
import mynumpy as np
import os.path
import sys
if len(sys.argv) < 3:
base.Logger.log("Usage is %s configuration topology [output] [fixcm]" % sys.argv[0], base.Logger.CRITICAL)
sys.exit()
if len(sys.argv) > 3:
output ... | rgatkinson/oxdna | UTILS/traj2xyz.py | Python | gpl-3.0 | 1,409 |
import unittest
class Test(unittest.TestCase):
"""Unit tests for googlemaps."""
def test_something(self):
"""Test stub"""
self.assertEqual(1, 1)
if __name__ == "__main__":
unittest.main()
| bneijt/boxchannel | tests/test_index.py | Python | gpl-3.0 | 220 |
#####################################################
# #
# CompuSoft - The Compushow 2017 Software #
# #
#####################################################
# #
# - entry-point for WSGI-compatible web #
# servers to serve CompuSoft. #
# #
##########... | JoseLuisAcv2/compusoft | compusoft/wsgi.py | Python | gpl-3.0 | 535 |
from PIL import ImageGrab
import win32gui
import msvcrt
import time
import pygame
import ctypes
from random import randint
pygame.init()
window = pygame.display.set_mode((300,200))
pygame.display.set_caption('Color Picker V1 - Python')
clock = pygame.time.Clock()
title = pygame.font.SysFont("comicsansms", 18,True,Fa... | GuillaumeBeBoop/ColorPicker-Python | ColorPicker.py | Python | gpl-3.0 | 4,726 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2019 by YOUR NAME HERE
#
# This file is part of RoboComp
#
# RoboComp 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... | robocomp/robocomp-robolab | components/interaction/speechComp/src/speechComp.py | Python | gpl-3.0 | 3,228 |
# -*- coding: utf8 -*-
# Copyright 2013-2014 Facundo Batista
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 3, as published
# by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful, but... | Nicogue/Encuentro | server/get_conect_episodes.py | Python | gpl-3.0 | 6,675 |
# Copyright (C) 2021 Bernd Hahnebach <bernd@bimstatik.org>
#
# This program 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 version.
#
# ... | berndhahnebach/BOLTS | bolttools/pythonpackage.py | Python | gpl-3.0 | 1,116 |
from __future__ import print_function
from scapy.all import *
import random
# Define end host and TCP port range
host = '192.168.1.111'
portRange = [22, 23, 80, 443, 3389]
# Send SYN with random Src Port for each Dst port
for dstPort in portRange:
srcPort = random.randint(1025,65534)
resp = sr1(IP(dst=host)/T... | gnomex/analysis | src/nmap_fun.py | Python | gpl-3.0 | 1,128 |
class Solution:
def bagOfTokensScore(self, tokens, P):
"""
:type tokens: List[int]
:type P: int
:rtype: int
"""
if not tokens: return 0
tokens.sort()
ans = 0
points = 0
if tokens[0] > P: return 0
... | YiqunPeng/Leetcode-pyq | solutions/948BagOfTokens.py | Python | gpl-3.0 | 877 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# django-lint -- Static analysis tool for Django projects and applications
# Copyright (C) 2008-2009 Chris Lamb <chris@chris-lamb.co.uk>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publi... | lamby/django-lint | DjangoLint/script.py | Python | gpl-3.0 | 4,311 |
#!/usr/bin/env python
import os, sys, time, getopt
LIST_CMDS='''dundi query 08:00:27:D1:84:75@priv
dundi query 08:00:27:F9:44:3B@priv
dundi query FF:FF:FF:FF:FF:FF@priv
dundi query 00:00:00:00:00:00@priv
dundi precache 6000@priv
dundi precache 6020@priv
dundi precache 6001@priv
dundi precache 6019@priv
dundi precach... | hoanglehuu/testRepo | setup/batch.py | Python | gpl-3.0 | 1,325 |
"""
ะะพะดัะปั ะธััะปะตะดะพะฒะฐะฝะธั ัะฐะทะปะฐะดะบะธ
"""
import pyqtgraph as pg
import numpy as np
from razlad.functions import FormSurge, f_probability_dyach, f_probability
from pyqtgraph.Qt import QtCore, QtGui
from pyqtgraph.dockarea import *
app = QtGui.QApplication([])
# ะะฐัััะพะนะบะฐ ะณัะฐัะธะบะฐ
pg.setConfigOption('backgroun... | sharag/py_analis | razlad/research_razlad.py | Python | gpl-3.0 | 4,320 |
# Copyright (C) 2015-2022, Craig Warren
#
# This module is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License.
# To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/4.0/.
#
# Please use the attribution at http://dx.doi.org/10.1190/1.3548506
import os
import... | gprMax/gprMax | user_libs/optimisation_taguchi/fitness_functions.py | Python | gpl-3.0 | 12,722 |
#!/usr/bin/env python
import unittest
import hypermesh
class TestHypermesh(unittest.TestCase):
def test_enabled(self):
self.assertIsNotNone(hypermesh.bl_info)
if __name__ == "__main__":
suite = unittest.defaultTestLoader.loadTestsFromTestCase(TestHypermesh)
success = unittest.TextTestRunner(ver... | daanmichiels/hypermesh | tests/general.py | Python | gpl-3.0 | 416 |
#!/usr/bin/env python
# Paperwork - Using OCR to grep dead trees the easy way
# Copyright (C) 2012-2014 Jerome Flesch
#
# Paperwork 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... | mjourdan/paperwork | src/launcher.py | Python | gpl-3.0 | 936 |
import os
import re
import csv
import zipfile
import subprocess
from datetime import datetime
import lxml.html
import lxml.etree
from openstates.scrape import Scraper, Bill
def session_slug(session):
session_type = "Special" if "s" in session.lower() else "Regular"
check_for_special_session_number = re.sear... | sunlightlabs/openstates | scrapers/nm/bills.py | Python | gpl-3.0 | 22,131 |
import re
import scrapelib
import os
from collections import defaultdict
from pytz import timezone
from datetime import datetime
from openstates.scrape import Scraper, Bill, VoteEvent
from utils import LXMLMixin
from openstates.utils import convert_pdf
import pytz
import math
central = pytz.timezone("US/Central")
de... | hiteshgarg14/openstates | scrapers/ky/bills.py | Python | gpl-3.0 | 15,328 |
"""
A simple API for HTTP Requests (GET and POST)
"""
import json, traceback
from urllib import parse, request
def get(url, params=None, post=False, key=None):
if params:
data = parse.urlencode(params).encode('utf-8')
if post:
req = request.Request(url, data)
else:
... | athena-voice/athena-voice-client | athena/api_library/requests_api.py | Python | gpl-3.0 | 739 |
#!/usr/bin/python
"""
Copyright 2011, Joseph Wen
Copyright 2016, C Fraire <cfraire@me.com>.
"""
#TODO: MailBox
import imaplib
import traceback
import email.message, email.utils
import re, sys, hashlib, os, shutil, time, optparse, mailbox, copy
import locale
from datetime import datetime, date
import ConfigParser
fro... | idodeclare/backup-gmail | backup_gmail.py | Python | gpl-3.0 | 28,174 |
#! /usr/bin/env python
import vcsn
from test import *
# check EXPECTED RAT1 RAT2
# ------------------------
#
# Check that are-equivalent(RAT1, RAT2) == EXPECTED. Because
# is-equivalent on expressions uses is-equivalent on automata under
# the hood, this also checks the case of automata equivalence tests.
def check... | pombredanne/https-gitlab.lrde.epita.fr-vcsn-vcsn | tests/python/is-equivalent.py | Python | gpl-3.0 | 1,104 |
"Runs the game logic for pyTetris."
try:
import sys
import random
from traceback import print_exception
import pygame as pg
import engine.environment as env
import engine.filehandler as fh
import engine.menu as menu
from engine.shapes import (Shape, Grid)
from engine.sortedcollections import SortedCo... | virtuNat/pyTetris | engine/game.py | Python | gpl-3.0 | 25,877 |
#! /usr/bin/python -O
# -*- coding: utf-8 -*-
#
# CANTA - A free entertaining educational software for singing
# Copyright (C) 2007 S. Huchler, A. Kattner, F. Lopez
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published b... | spiderbit/canta-ng | menus/input_field.py | Python | gpl-3.0 | 4,849 |
'''
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,
but WITHOUT... | Incrementing/Importable-PyCompressor | PyCompressor.py | Python | gpl-3.0 | 4,333 |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
'''
This module runs all unit tests for openmolar2
'''
###############################################################################
## ##
## Copyright 2011-2012, Neil Wallace <neil@openmolar.c... | rowinggolfer/openmolar2 | src/tests.py | Python | gpl-3.0 | 2,917 |
# -*- coding: utf-8 -*-
#
# Arachne: Search engine for files shared via FTP and similar protocols.
# Copyright (C) 2008-2010 Yasser Gonzรกlez Fernรกndez <ygonzalezfernandez@gmail.com>
# Copyright (C) 2008-2010 Ariel Hernรกndez Amador <gnuaha7@gmail.com>
#
# This program is free software: you can redistribute it and/or mod... | yasserglez/arachne | arachne/handler.py | Python | gpl-3.0 | 14,433 |
import os
import subprocess
import time
import hashlib
from flask import Blueprint
from flask import request
from flask import render_template
from flask import session
from flask import redirect
from flask import abort
from flask import current_app
from flask import make_response
from loaders import IMAGES_EXTENSION... | itsMichael/uair-pro | app/mainviews.py | Python | gpl-3.0 | 4,649 |
from django.conf.urls import patterns, include, url
from ddah_web.models import DDAHInstanceWeb
from django.views.generic import ListView
from django.contrib import admin
from backend import urls as backend_urls
admin.autodiscover()
urlpatterns = patterns('',
(r'^$', ListView.as_view(
queryset=DDAHInstanc... | ciudadanointeligente/deldichoalhecho | project_site/non_subdomain_urls.py | Python | gpl-3.0 | 752 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file '/Users/chernomirdinmacuvele/Documents/workspace/PscArt2.0.X/UserInt/ui_saidas_Prop.ui'
#
# Created by: PyQt5 UI code generator 5.8.2
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class ... | InUrSys/PescArt2.0 | GeneratedFiles/ui_saidas_Prop.py | Python | gpl-3.0 | 22,847 |
# ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# Copyright (c) 2008-2021 pyglet contributors
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the follo... | calexil/FightstickDisplay | pyglet/media/codecs/ffmpeg_lib/libswresample.py | Python | gpl-3.0 | 3,406 |
"""Test for the DoubleStepClassifier and ClassifierFactory classes.
Recommended run as
$ script -c '~/anaconda2/envs/env35/bin/nosetests -s wikipedianer/classification/test_double_step_classifier.py' | grep -v 'Level 1'
to delete tensorflow logs.
"""
import numpy
import os
import shutil
import tensorflow as tf
imp... | MIREL-UNC/wikipedia-ner | wikipedianer/classification/test_double_step_classifier.py | Python | gpl-3.0 | 19,401 |
# vi: ts=4 expandtab
#
# Copyright (C) 2014 Canonical Ltd.
#
# Author: Ben Howard <ben.howard@canonical.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3, as
# published by the Free Software Foundation.
#
# Th... | clovertrail/cloudinit-bis | cloudinit/config/cc_scripts_vendor.py | Python | gpl-3.0 | 1,940 |
# Copyright 2019-2020 by Christopher C. Little.
# This file is part of Abydos.
#
# Abydos 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 versio... | chrislit/abydos | tests/distance/test_distance_unknown_k.py | Python | gpl-3.0 | 6,825 |
import re
import clang.cindex as ci
from cppstyle import utils
from cppstyle.model import *
def parse(file):
index = ci.Index.create()
source = index.parse(file)
return to_node(source.cursor)
def to_node(clang_node):
file = str(clang_node.location.file)
position = get_location(clang_node)
... | gfelbing/cppstyle | cppstyle/model/parser.py | Python | gpl-3.0 | 3,495 |
# Copyright (C) 2015-2020 Florian Pigorsch <mail@florian-pigorsch.de>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
... | flopp/RandomWallpapers | wallpapergen/rgb.py | Python | gpl-3.0 | 763 |
#!
# -*- coding: utf-8 -*-
"""
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ
โ Copyright (c) 2020 https://prrvchr.github.io โ
โ ... | prrvchr/GContactOOo | CloudContactOOo/python/cloudcontact/configuration.py | Python | gpl-3.0 | 2,547 |
#!/usr/bin/env python
### Static3.py
#---------------------------- class X ---------------------------------
class X: #(A)
m = 1 #(B)
p = lambda self, arg1, arg2 = 10: arg1 + arg2 ... | acabey/acabey.github.io | projects/demos/engineering.purdue.edu/scriptingwithobjects/swocode/chap7/Static3.py | Python | gpl-3.0 | 2,996 |
"""
Python Markdown
A Python implementation of John Gruber's Markdown.
Documentation: https://python-markdown.github.io/
GitHub: https://github.com/Python-Markdown/markdown/
PyPI: https://pypi.org/project/Markdown/
Started by Manfred Stienstra (http://www.dwerg.net/).
Maintained for a few years by Yuri Takhteyev (ht... | DHI-GRAS/processing_workflow | markdown/blockprocessors.py | Python | gpl-3.0 | 23,736 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import json
import urllib2
import urllib
from bs4 import BeautifulSoup
def get(text):
# text = url
### Create opener with Google-friendly user agent
bitlyopener = urllib2.build_opener()
bitlyopener.addheaders = [('User-agent', 'Mozilla/5.0')]
token = open("getimg/bi... | birdy42/ircbot | lib/bitly.py | Python | gpl-3.0 | 615 |
# Abraxas Password Generator
DATE = "2016-08-14"
VERSION = "1.8"
| KenKundert/abraxas | abraxas/version.py | Python | gpl-3.0 | 66 |
def finish_game(game_result):
if game_result:
print('You win')
elif game_result is False:
print('You lose')
def is_int(el):
try:
int(el)
return True
except:
return False
def move(client_position, players, player_num):
commands = ["put", "discard", "support"]... | gurovic/game2007 | hanabi_client.py | Python | gpl-3.0 | 3,306 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('app', '0031_add_field_url_to_servers'),
]
operations = [
migrations.AddField(
model_name='applicationform',
... | efornal/pulmo | app/migrations/0032_add_field_received_application.py | Python | gpl-3.0 | 678 |
import argparse
import importlib
import os
import pkgutil
import pprint
import shutil
import signal
import sys
import yaml
from . import __version__, builders, importer, packagers, util, vcs
def signal_handler(signal, frame):
sys.exit(0)
signal.signal(signal.SIGINT, signal_handler)
packagelist = importer.get... | lamestation/packthing | packthing/main.py | Python | gpl-3.0 | 17,385 |
"""
issafe.py
Check the Google Safe Browsing list to see a website's safety rating.
Created By:
- Foxlet <http://furcode.tk/>
License:
GNU General Public License (Version 3)
"""
from ralybot import hook
import ralybot
import requests
from urllib.parse import urlparse
API_SB = "https://sb-ssl.google.com/saf... | Jakeable/Ralybot | plugins/issafe.py | Python | gpl-3.0 | 1,053 |
# coding = utf-8
"""
1.10 ๅ ๅญๅๆ (ๅ่งฃ) ้็ปด
http://git.oschina.net/wizardforcel/sklearn-cb/blob/master/1.md
"""
# ๅๅคๆฐๆฎ
from sklearn import datasets
iris = datasets.load_iris()
x = iris.data
print(x)
# ๅชไฝฟ็จๅ 2 ไธชๅ ๅญ็จไบๆพ็คบ
from sklearn import decomposition
fa = decomposition.FactorAnalysis(n_components=2)
xf = fa.fit_transform... | Ginkgo-Biloba/Misc-Python | sklearn/SKLearn1FA.py | Python | gpl-3.0 | 631 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015-2020 Bitergia
#
# 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 l... | grimoirelab/perceval | tests/test_googlehits.py | Python | gpl-3.0 | 13,078 |
import ArduinoSerial
from Tkinter import *
import time
class Application(Frame):
def __init__(self, master=None):
Frame.__init__(self, master)
self.pack()
self.createWidgets()
root.title("Arduino Interface")
self.entryNum = 0
self.scaleNum = 0
self.sinusNum ... | Trishun/Ardu-I-O | main.py | Python | gpl-3.0 | 12,704 |
# -*- coding: utf-8 -*-
"""
Created on Tue May 10 12:32:06 2016
@author: alumno
"""
from mrjob.job import MRJob
from mrjob.step import MRStep
from mrjob.compat import jobconf_from_env
import string
class MRTF_IDF_Vals(MRJob):
#SORT_VALUES = True
def mapper(self, _, line):
line_stripped = line.transl... | tayebzaidi/PPLL_Spr_16 | MapReduce/tf-idf.py | Python | gpl-3.0 | 2,011 |
__problem_title__ = "Multiples with small digits"
__problem_url___ = "https://projecteuler.net/problem=303"
__problem_description__ = "For a positive integer , define ( ) as the least positive multiple of " \
"that, written in base 10, uses only digits โค 2. Thus (2)=2, (3)=12, " \
... | jrichte43/ProjectEuler | Problem-0303/solutions.py | Python | gpl-3.0 | 755 |
""" fibonacci-benchmark.py | Fri, Jan 27, 2017 | Roman S. Collins
Comparing calculation times of different fibonacci functions.
"""
import time, sys
import numpy as np
# Import the functions
from waysoffib import *
def main():
n = 34
tmany = 10
wof = WAYSOFFIB()
mof = Memoize(n)
fibs = [wo... | RomanSC/algorithms | chapter-1/fibonacci-benchmark.py | Python | gpl-3.0 | 1,787 |
#encoding: utf8
import numpy as np
from scipy.misc import comb
from scipy.stats import norm
import matplotlib.pyplot as plt
import pdb
'''
test hypothetical: ็จๆฝๆ ท็ๆนๆณ๏ผๆฅๆฃๆฅๅ
ณไบๆปไฝ็H0ๅ่ฎพ(null hypothetical)่ฝๅฆ่ขซๆจ็ฟป๏ผH1(ๅคๅ่ฎพ)่ฝๅฆ่ขซๆฅๅ
'''
'''
HO: total <= c
P(X > c) = P(X in [c,n])
'''
def power_function_for_binomial(theta, n, c):
... | dhwang99/statistics_introduction | hypothetical_test/power_function_example.py | Python | gpl-3.0 | 4,168 |
#!/usr/bin/env python
"""
Obsolete stimuli
Calls are merely defined to give user appropriate error feedback
"""
__author__ = 'Florian Krause <florian@expyriment.org>, \
Oliver Lindemann <oliver@expyriment.org>'
__version__ = ''
__revision__ = ''
__date__ = ''
class Dot(object):
"""OBSOLETE CLASS: Please use Ci... | expyriment/expyriment | expyriment/stimuli/_obsolete.py | Python | gpl-3.0 | 939 |
#!/usr/bin/python
import logging
logging.basicConfig(level=logging.INFO, format="%(asctime)s - %(name)s - %(levelname)s - %(message)s")
import procgame.game, sys, os
import procgame.config
import random
import procgame.sound
sys.path.insert(0,os.path.pardir)
import bingo_emulator.common.units as units
import bingo_em... | bingopodcast/bingos | bingo_emulator/golden_gate/game.py | Python | gpl-3.0 | 150,886 |
# This file is part of Static Sauce <http://github.com/jdufresne/staticsauce>.
#
# 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 ... | jdufresne/staticsauce | staticsauce/modules/gallery/routes.py | Python | gpl-3.0 | 2,163 |