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 -*- """ Contains functions to plot the results of the dustydiffusion test. @author: ibackus """ import matplotlib.pyplot as plt import numpy as np import pynbody import diskpy #sim, epsEstimator, ts, runpars = analyze.loadSim(simdir) def crossSection(sim, ts, crossSectionTimes=[0, 1, 10]): ""...
ibackus/testdust
testdust/diffusion/plot.py
Python
mit
4,000
# coding: utf-8 from django.test import TestCase from django.db import IntegrityError from datetime import datetime from eventex.subscriptions.models import Subscription class SubscriptionTest(TestCase): def setUp(self): self.obj = Subscription( name='Henrique Bastos', cpf='1234567...
klebercode/lionsclub
eventi/subscriptions/tests/test_models.py
Python
mit
1,854
import unittest import numpy as np from pgmpy.factors.continuous import JointGaussianDistribution as JGD from pgmpy.sampling import (HamiltonianMC as HMC, HamiltonianMCDA as HMCda, GradLogPDFGaussian, NoUTurnSampler as NUTS, NoUTurnSamplerDA as NUTSda) class TestHMCInference(unittest.Tes...
sandeepkrjha/pgmpy
pgmpy/tests/test_sampling/test_continuous_sampling.py
Python
mit
8,100
import io import unittest from unittest.mock import patch from kattis import k_hnumbers ############################################################################### class SampleInput(unittest.TestCase): '''Problem statement sample inputs and outputs''' def test_sample_input(self): '''Run and asser...
ivanlyon/exercises
test/test_k_hnumbers.py
Python
mit
1,101
#!/usr/bin/env python # -*- coding: utf-8 -*- """ package documentation """ from Automation.instancelist import main if __name__ == '__main__': main()
appcito/automation-tool
instancelist-cli.py
Python
mit
163
# -*- coding: utf-8 -*- """ Useful classes and methods to aid RESTful webservice development in Pyramid. PythonPro Limited 2012-01-14 """ import json import httplib import logging import traceback #from decorator import decorator from pyramid.request import Response def get_log(e=None): return logging.getLogge...
oisinmulvihill/stats-service
stats_service/service/restfulhelpers.py
Python
mit
7,229
from django import forms from django.forms.models import inlineformset_factory from cruditor.forms import ( CruditorFormsetFormMixin, CruditorFormsetMixin, CruditorTapeformMixin) from examples.store.models import Person, RelatedPerson class PersonForm(CruditorTapeformMixin, forms.ModelForm): reminder = form...
moccu/django-cruditor
examples/formset/forms.py
Python
mit
700
from hubcheck.pageobjects.basepageobject import BasePageObject from hubcheck.pageobjects.basepageelement import Link from selenium.common.exceptions import NoSuchElementException class GenericPage(BasePageObject): """Generic Page with just a header and footer""" def __init__(self,browser,catalog): sup...
codedsk/hubcheck
hubcheck/pageobjects/po_generic_page.py
Python
mit
3,505
from datetime import datetime from argparse import ArgumentParser import pprint import time import warnings import os, sys, io import signal import beretta import importlib __author__ = 'holly' class Parser(object): def __init__(self): self.parser = ArgumentParser(description=beretta.__doc__) ...
holly/beretta
lib/beretta/parser.py
Python
mit
1,231
import alsaaudio from math import pi, sin, pow import getch SAMPLE_RATE = 44100 FORMAT = alsaaudio.PCM_FORMAT_U8 PERIOD_SIZE = 512 N_SAMPLES = 1024 notes = "abcdefg" frequencies = {} for i, note in enumerate(notes): frequencies[note] = 440 * pow(pow(2, 1/2), i) # Generate the sine wave, centered at y=128 with 10...
zmarvel/playground
sound/testplay.py
Python
mit
3,152
#!/usr/bin/env python # coding: utf-8 import logging import config def get_common_logger(name='common', logfile=None): ''' args: name (str): logger name logfile (str): log file, use stream handler (stdout) as default. return: logger obj ''' my_logger = logging.getLogger(name) ...
WisZhou/websocket_messager
utils.py
Python
mit
904
import numpy import six from chainer import cuda from chainer import function from chainer.utils import type_check class NegativeSamplingFunction(function.Function): def __init__(self, sampler, sample_size): self.sampler = sampler self.sample_size = sample_size def _make_samples(self, t): ...
AlpacaDB/chainer
chainer/functions/loss/negative_sampling.py
Python
mit
6,667
# ncd-dcb.py # # Use Cilibrasi and Vitanyi's Normalized Compression Distance # to cluster a randomly chosen sample of entries from the # Dictionary of Canadian Biography volume 1 # # wjt # http://digitalhistoryhacks.blogspot.com # # 26 jun 2007 import bz2 import random pathstring = 'C:\Documents and Set...
williamjturkel/Digital-History-Hacks--2005-08-
ncd-dcb.py
Python
mit
1,364
from __future__ import unicode_literals from pre_commit.languages import helpers from pre_commit.xargs import xargs ENVIRONMENT_DIR = None get_default_version = helpers.basic_get_default_version healthy = helpers.basic_healthy install_environment = helpers.no_install def run_hook(repo_cmd_runner, hook, file_args):...
Lucas-C/pre-commit
pre_commit/languages/script.py
Python
mit
444
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
rjschwei/azure-sdk-for-python
azure-mgmt-compute/azure/mgmt/compute/models/availability_set.py
Python
mit
3,239
from pydub import * class AudioMerger: voice_tags = ["one", "two", "three", "four", "five", "ten", "RUN", "relax", "completed"] def __init__(self, music): self.music = music self.additionalGain = 8 self.voices={} for voice in self.voice_tags: sound = AudioSegment.from_file('voices/' + voice + '.wav') ...
gyimothilaszlo/interval-music-maker
AudioMerger.py
Python
mit
1,005
import factory from ...models import Dashboard, Link, ModuleType, Module from ....organisation.tests.factories import NodeFactory, NodeTypeFactory class DashboardFactory(factory.DjangoModelFactory): class Meta: model = Dashboard status = 'published' title = "title" slug = factory.Sequence(l...
alphagov/stagecraft
stagecraft/apps/dashboards/tests/factories/factories.py
Python
mit
1,931
#!/usr/bin/env python3 '''A simple implementation of a sorting algorithm, meant to allow people to manually rank a list of items using whatever subjective or objective criteria they want. This program can be called as a script and used interactively. You can provide the list of things to sort as command line argument...
sagittarian/personal-sort
sort.py
Python
mit
4,539
import click from twentyfourhourvideo import video @click.command(help='Plays a video.') @click.argument('input', type=click.Path()) def main(input): video.play(input)
xsteadfastx/24hourvideo
twentyfourhourvideo/cli.py
Python
mit
175
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals, division import os import shlex import struct import platform import subprocess def get_terminal_size(): """ get_terminal_size() - get width and height of console - works on linux,os x,windows,cygwin(windows) original...
concordusapps/pytest-bench
pytest_bench/terminal.py
Python
mit
2,626
"""Imports for Python API. This file is MACHINE GENERATED! Do not edit. Generated by: tensorflow/tools/api/generator/create_python_api.py script. """ from tensorflow.python.platform.resource_loader import get_data_files_path from tensorflow.python.platform.resource_loader import get_path_to_datafile from tensorflow.py...
ryfeus/lambda-packs
Keras_tensorflow_nightly/source2.7/tensorflow/tools/api/generator/api/resource_loader/__init__.py
Python
mit
532
words = [ 'abandon', 'ability', 'able', 'about', 'above', 'absent', 'absorb', 'abstract', 'absurd', 'abuse', 'access', 'accident', 'account', 'accuse', 'achieve', 'acid', 'acoustic', 'acquire', 'across', 'act', 'action', 'actor', 'actress', 'actual', 'adapt', 'add', 'addict', 'address', 'adjust', 'admit', 'adult', 'adv...
lbryio/lbry
torba/torba/client/words/english.py
Python
mit
19,271
# -*- coding: utf-8 -*- from south.utils import datetime_utils as 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 'OrderSet' db.create_table(u'costs_orderset', ( ...
shapiromatron/comp523-medcosts
costs/migrations/0003_auto__add_orderset.py
Python
mit
6,803
# -*- coding: utf-8 -*- # # Copyright © 2009-2010 Pierre Raybaut # Licensed under the terms of the MIT License # (see spyderlib/__init__.py for details) """Customized combobox widgets""" # pylint: disable=C0103 # pylint: disable=R0903 # pylint: disable=R0911 # pylint: disable=R0201 from PyQt4.QtGui impo...
koll00/Gui_SM
SMlib/widgets/comboboxes.py
Python
mit
8,133
# -*- coding: utf-8 -*- """ Created on 05 Apr 2014 3:30 AM @author: <'Ronny Eichler'> ronny.eichler@gmail.com UI """
wonkoderverstaendige/PyFL593FL
PyFL593FL/ui/__init__.py
Python
mit
117
# -*- coding: utf-8 -*- from openerp import tools from openerp import models,fields,api from openerp.tools.translate import _ class is_pricelist_item(models.Model): _name='is.pricelist.item' _order='pricelist_name,price_version_id,sequence,product_id' _auto = False pricelist_name = f...
tonygalmiche/is_plastigray
report/is_pricelist_item.py
Python
mit
5,365
import os path = os.path.dirname(os.path.realpath(__file__)) sbmlFilePath = os.path.join(path, 'MODEL0912503622.xml') with open(sbmlFilePath,'r') as f: sbmlString = f.read() def module_exists(module_name): try: __import__(module_name) except ImportError: return False else: ret...
biomodels/MODEL0912503622
MODEL0912503622/model.py
Python
cc0-1.0
427
# -*- coding:utf-8 -*- import xml.etree.ElementTree as etree import re import datetime #set the output file name for the 'good' data #needs to be to a structured format - but dump to text for now #clean_output = 'clean_out.csv' clean_output = 'clean.txt' #set the dirty output file where we'll dump the awkward lines...
watty62/jazz_birthdays
old versions/extraction4.py
Python
cc0-1.0
7,375
# # Copyright (c) 2010,2011,2012,2013 Big Switch Networks, Inc. # # Licensed under the Eclipse Public License, Version 1.0 (the # "License"); you may not use this file except in compliance with the # License. You may obtain a copy of the License at # # http://www.eclipse.org/legal/epl-v10.html # # Unless required ...
opennetworkinglab/spring-open-cli
cli/storeclient.py
Python
epl-1.0
15,736
#!/usr/bin/python #coding:utf-8 print 'start to load...' import sys name = 42 def func(): pass class kclass : pass print 'done loading.'
gensmusic/test
l/python/book/learning-python/c22/module3.py
Python
gpl-2.0
137
# Copyright (c) 2008 The Board of Trustees of The Leland Stanford Junior University # Copyright (c) 2011, 2012 Open Networking Foundation # Copyright (c) 2012, 2013 Big Switch Networks, Inc. # See the file LICENSE.pyloxi which should have been included in the source distribution # Automatically generated by LOXI from ...
gzamboni/sdnResilience
loxi/of10/message.py
Python
gpl-2.0
248,179
#************************************************************************* #* Dionaea #* - catches bugs - #* #* #* # Copyright (c) 2009 Markus Koetter # Copyright (c) 2001-2007 Twisted Matrix Laboratories. # Copyright (c) 2001-2009 # # Allen Short # Andrew Bennett...
GovCERT-CZ/dionaea
modules/python/scripts/ftp.py
Python
gpl-2.0
32,082
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # vim:set sw=4 ts=4 et: import sys import pexpect import threading import os import shutil import logging import time import configparser import ast import subprocess def backup(switch, server): if switch['type'].lower() == '3com': return backup_3com(switch, server) ...
brabemi/sw_config_backup
sw_config_backup.py
Python
gpl-2.0
5,888
from chimera.core.chimeraobject import ChimeraObject from chimera.core.manager import Manager from chimera.core.exceptions import ChimeraException from nose.tools import assert_raises import chimera.core.log import logging log = logging.getLogger("chimera.test_log") class TestLog (object): def test_l...
wschoenell/chimera_imported_googlecode
src/chimera/core/tests/test_log.py
Python
gpl-2.0
1,086
from .__meta__ import * from tracer.resources.processes import Processes, Process from tracer.resources.collections import ProcessesCollection import os import subprocess @unittest.skipIf(True, "@TODO Create Mock for Processes class") class TestProcesses(unittest.TestCase): def test_children(self): process = Proce...
sean797/tracer
tests/test_processes.py
Python
gpl-2.0
1,199
"""Django models for MK8 Kart Comparison Tool.""" from django.core.exceptions import ObjectDoesNotExist from django.db import models from django.templatetags.static import static import re import uuid import logging from ipware.ip import get_ip, get_real_ip logger = logging.getLogger(__name__) class KartComponent...
dougwt/kartographer
kartographer/comparison/models.py
Python
gpl-2.0
8,723
from math import exp import matplotlib import matplotlib.pyplot as plt from PIL import Image import pickle matplotlib.rcParams['ps.useafm'] = True matplotlib.rcParams['pdf.use14corefonts'] = True matplotlib.rcParams['text.usetex'] = True def draw_map(img_dir): im = Image.open(img_dir) pix = im.load() ...
MengGuo/mix_initiative
utilities/map/vis_sim.py
Python
gpl-2.0
12,697
from django.contrib.auth.forms import AuthenticationForm from django.core.urlresolvers import reverse from actstream.models import user_stream from dnstorm.app import DNSTORM_URL from dnstorm.app.utils import get_option from dnstorm.app.models import Problem, Idea from dnstorm.app.utils import get_option def base(re...
vmassuchetto/dnstorm
dnstorm/app/context_processors.py
Python
gpl-2.0
1,367
# Copyright (C) 2009 Yan Gao <ygao@novell.com> # See COPYING for license information. import os import tempfile import copy from lxml import etree class PacemakerError(Exception): '''PacemakerError exceptions''' def get_validate_name(cib_elem): if cib_elem is not None: return cib_elem.get("validate...
aspiers/crmsh
modules/pacemaker.py
Python
gpl-2.0
13,248
import sys import click import os import subprocess from packageinfo import BUILD, VERSION, NAME if "WM_PROJECT" not in os.environ: print("To run this command you must source edmenv.sh first") sys.exit(1) # The version of the buildcommon to checkout. BUILDCOMMONS_VERSION="v0.1" def bootstrap_devenv(): ...
simphony/simphony-openfoam
edmsetup.py
Python
gpl-2.0
1,743
def hello_again(): print("hello again")
pdorrell/emacs-site-lisp
test/test-project/src/subdir_with_files/spaced dir name/hello.py
Python
gpl-2.0
45
""" accounts FILE: forms.py Created: 6/21/15 8:31 PM """ __author__ = 'Mark Scrimshire:@ekivemark' from django.conf import settings from django import forms from django.utils.safestring import mark_safe from registration.forms import (RegistrationFormUniqueEmail, RegistrationFormTerms...
ekivemark/bofhirdev
accounts/forms/other.py
Python
gpl-2.0
2,816
# -*- coding: utf-8 -*- # # AWL simulator - Dummy hardware interface # # Copyright 2013-2014 Michael Buesch <m@bues.ch> # # 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 ...
gion86/awlsim
awlsimhw_dummy/main.py
Python
gpl-2.0
1,933
#!/usr/bin/env python # -*- coding: utf-8 -*- # # # ------------------------------------------------------------------------------ # Copyright (C) 2006-2016 University of Dundee. All rights reserved. # # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General P...
dpwrussell/openmicroscopy
components/tools/OmeroPy/src/omero/util/ROI_utils.py
Python
gpl-2.0
22,495
# -*- coding: utf-8 -*- #Ege Öz from PyQt4 import QtCore, QtGui import sys,os try: _fromUtf8 = QtCore.QString.fromUtf8 except AttributeError: def _fromUtf8(s): return s try: _encoding = QtGui.QApplication.UnicodeUTF8 def _translate(context, text, disambig): return QtGui.QApplication.translate(context, text, ...
egeoz/TextPad
textpad.py
Python
gpl-2.0
4,788
#!/usr/bin/env python2 ## ## We define Instrution as two types "Computing instruction" and "Control Transfer instruction" ## for computing instruction ## "NAME" : [ Operand_Number , [ Formula_that_modify_reg ], [ FLAG_reg_modified]] ## for control transfter instruciton ## "NAME" : [ Operand_Number , [ Formula_tha...
XiaofanZhang/ROPgadget
ropgadget/ropparse/arch/parserx86.py
Python
gpl-2.0
17,183
# coding: utf-8 # Module: actions # Created on: 27.07.2015 # Author: Roman Miroshnychenko aka Roman V.M. (romanvm@yandex.ua) # Licence: GPL v.3: http://www.gnu.org/copyleft/gpl.html import os import xbmcgui import xbmcplugin from simpleplugin import Plugin import json_requests as jsonrq from buffering import buffer_to...
kreatorkodi/repository.torrentbr
plugin.video.yatp/libs/client/actions.py
Python
gpl-2.0
8,310
#-*- coding: utf-8 -*- """URL映射""" from django.views.generic.base import View from django.http import HttpResponse from django.shortcuts import render from jiaxiao.config import site_name, channels, theme class URLDispatchView(View): """URL映射""" def get(self, request, page_name=''): """URL GET""" ...
chinakr/jiaxiao
jiaxiao/home/url_dispatch.py
Python
gpl-2.0
613
#!/usr/bin/env python ### cut a fasta query (arg1) in "nbPart" (arg3) ### subFasta files and launches a blast programm (arg4) ### vs the bank (arg2) for each subfasta and then ### concatenates the tab delimited blast results in ### one file. You can add any additional blastall option in the ### arg5 with quotes like th...
alunem/bioman
blast/bmn-paraBlastKepler.py
Python
gpl-2.0
2,591
import os # toolchains options ARCH='arm' CPU='cortex-m4' CROSS_TOOL='keil' if os.getenv('RTT_CC'): CROSS_TOOL = os.getenv('RTT_CC') # cross_tool provides the cross compiler # EXEC_PATH is the compiler execute path, for example, CodeSourcery, Keil MDK, IAR if CROSS_TOOL == 'gcc': PLATFORM = 'gcc' EX...
blueskycoco/rt-thread
bsp/nrf5x/nrf52840/rtconfig.py
Python
gpl-2.0
2,265
class int(int): def isPrime(self): for q in range(2, int(self**(1/2))): if self%q: print(self,q,self%q) else: return 0 return 1
cabanm/project-euler
primes.py
Python
gpl-2.0
212
#!/usr/bin/env python #Name: Ian Wong #Date: 1/3/16 #Assignment: Counting Vowels string = input("What is your string?") string = string.lower() count1= string.count('a') count2 = string.count('e') count3 = string.count('i') count4 = string.count('o') count5 = string.count('u') print ("There are %i a in the text." % ...
barrowkwan/Python_Class_2014
Ian/hw2.py
Python
gpl-2.0
527
# coding:utf-8 ''' Created on 19/1/2015 @author: PC30 ''' from flaskext.mysql import MySQL#importar mysql from flask import Flask#importar flask class DBcon(): ''' classdocs ''' pass def __init__(self): ''' Constructor ''' pass def conexion(self): ...
git-pedro-77/proyecto_final_p_f
proyectoITSAE/ec/edu/itsae/conn/DBcon.py
Python
gpl-2.0
772
import xbmcaddon import xbmcgui import subprocess,os def EstoEsUnaFun( str ): xbmcgui.Dialog().ok("ESO ES","AHHHH",str) return addon = xbmcaddon.Addon() addonname = addon.getAddonInfo('name') line1 = "Hello World!" line2 = "We can write anything we want here" line3 = "Using Python" my_setting = a...
rafa400/telepi
script.telepi-master/addon.py
Python
gpl-2.0
669
import re import traceback import os import codecs from urlparse import parse_qs from PyQt4.QtCore import QCoreApplication from qgis.core import (QgsRenderContext, QgsSingleSymbolRendererV2, QgsCategorizedSymbolRendererV2, QgsGraduatedSymbolRendererV...
lucacasagrande/qgis2web
olLayerScripts.py
Python
gpl-2.0
21,275
""" NeuroTools.analysis ================== A collection of analysis functions that may be used by NeuroTools.signals or other packages. .. currentmodule:: NeuroTools.analysis Classes ------- .. autosummary:: TuningCurve Functions --------- .. autosummary:: :nosignatures: ccf crosscorrelate make_ker...
meduz/NeuroTools
src/analysis.py
Python
gpl-2.0
17,761
import sys import logging import profile import pstats try: import cStringIO as StringIO StringIO # pyflakes except ImportError: import StringIO from instrumenting import utils class BaseProfilingHandler(utils.InstrumentingHandler): """ Python logging handler which profiles code. It can al...
rpatterson/instrumenting
src/instrumenting/profilehandler.py
Python
gpl-2.0
4,513
""" 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...
JamesLinEngineer/RKMC
addons/plugin.video.salts/scrapers/rlseries_scraper.py
Python
gpl-2.0
4,255
# -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding:utf-8 -*- # vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 fileencoding=utf-8 # # MDAnalysis --- https://www.mdanalysis.org # Copyright (c) 2006-2017 The MDAnalysis Development Team and contributors # (see the file AUTHORS for the full list of names) #...
MDAnalysis/mdanalysis
testsuite/MDAnalysisTests/core/test_fragments.py
Python
gpl-2.0
7,995
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2015 CERN. # # Invenio 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...
hachreak/invenio-oaiharvester
invenio_oaiharvester/upgrades/oaiharvester_2015_07_14_innodb.py
Python
gpl-2.0
1,535
from oracleplsqlsource import OraclePLSQLSource class OracleJavaSource(OraclePLSQLSource): def __init__(self, name, source): self.name = name #debug_message("debug: generating java source ") OraclePLSQLSource.__init__(self,source)
sawdog/OraclePyDoc
oraclepydoc/oracleobjects/oraclejavasource.py
Python
gpl-2.0
261
# -*-python-*- # GemRB - Infinity Engine Emulator # Copyright (C) 2003-2004 The GemRB Project # # 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 opt...
bradallred/gemrb
gemrb/GUIScripts/iwd2/GUIINV.py
Python
gpl-2.0
8,644
# -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding:utf-8 -*- # vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 # # MDAnalysis --- https://www.mdanalysis.org # Copyright (c) 2006-2017 The MDAnalysis Development Team and contributors # (see the file AUTHORS for the full list of names) # # Released under t...
MDAnalysis/mdanalysis
package/MDAnalysis/__init__.py
Python
gpl-2.0
7,425
import redis from hashlib import sha1 class RedisHashLayer(object): """ A more memory-efficient way to store many small values in redis using hashes. See http://antirez.com/post/redis-weekly-update-7.html Note: add these config value to redis: hash-max-zipmap-entries 512 hash-max-zipmap-value ...
dfdeshom/reds
reds/redis_hash_layer.py
Python
gpl-2.0
1,323
#!/usr/bin/env python # Note: this file is part of some nnet3 config-creation tools that are now deprecated. from __future__ import print_function import os import argparse import sys import warnings import copy from operator import itemgetter def GetSumDescriptor(inputs): sum_descriptors = inputs while len(s...
michellemorales/OpenMM
kaldi/egs/wsj/s5/steps/nnet3/components.py
Python
gpl-2.0
29,765
# -*- coding: utf-8 -*- """Copyright (C) 2009,2010 Wolfgang Rohdewald <wolfgang@rohdewald.de> kajongg is free software you can redistribute it and/or modifys 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...
jsj2008/kdegames
kajongg/src/predefined.py
Python
gpl-2.0
21,844
#!/usr/bin/env python """ Poll sensor data log file Poll the sensor data log file periodically and use parse_log to submit new values via http. """ import time from subprocess import call LOG_FILE = 'aginovadb.log' PARSER = 'parse_log.py' POLL_INTERVAL = 120 # in seconds def main(): """Periodically run the l...
smart-cities/reading_aginova_sensors
scripts/poll.py
Python
gpl-2.0
580
''' blind_sqli_time_delay.py Copyright 2008 Andres Riancho This file is part of w3af, w3af.sourceforge.net . w3af 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 of the License. w3af is distributed in...
adamdoupe/enemy-of-the-state
audit/blind_sqli_time_delay.py
Python
gpl-2.0
6,458
# -*- encoding: utf-8 -*- import sys import os import os.path import glob import logging from utils import * def splice_mapping( T, configs, audit ): logging.debug( "Splice mapping..." ) # create the destination for splice alignments if not exists try: os.mkdir( configs['SPLICED_ALIGNER_PATH'] ) except OSError...
polarise/breeze
breeze/splice_mapping.py
Python
gpl-2.0
3,421
def find_number(x): str_x = str(x) if len(str_x) == 1: raise Exception() left_most = str_x[0] try: small_from_rest = find_number(int(str_x[1:])) return int(left_most + str(small_from_rest)) except: # min() will throw exception if parameter is empty list, meaning no d...
danithaca/berrypicking
python/excercise/march31.py
Python
gpl-2.0
644
""" Computes and stores a lookup table for a given environment and reward function. A list of reward functions will be added here and refered to by the keyword "rType". """ class Reward: def __init__(self,environment,rType): def exampleReward(self,environment): return
ProjectALTAIR/Simulation
mdp/reward.py
Python
gpl-2.0
288
import numpy as np # Set the random seed for reproducibility seed = np.random.randint(2**16) print "Seed: ", seed np.random.seed(seed) import matplotlib.pyplot as plt from matplotlib.patches import Polygon from optofit.cneuron.compartment import Compartment, SquidCompartment from optofit.cneuron.channels import LeakC...
HIPS/optofit
examples/cython_demo.py
Python
gpl-2.0
4,626
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2016, 2017 CERN. # # Invenio 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...
CERNDocumentServer/cds-videos
cds/modules/records/bundles.py
Python
gpl-2.0
2,122
# encoding: utf-8 ''' Tests for various attachment thingies Created on Oct 21, 2013 @author: pupssman ''' import pytest from hamcrest import has_entries, assert_that, is_, contains, has_property from allure.constants import AttachmentType from allure.utils import all_of @pytest.mark.parametrize('package', ['pytes...
pvarenik/PyCourses
allure-python-master/tests/test_attach.py
Python
gpl-2.0
2,550
# -*- coding: utf-8 -*- # Generated by Django 1.10.4 on 2017-09-21 00:22 from __future__ import unicode_literals from django.db import migrations, models import themes.models class Migration(migrations.Migration): dependencies = [ ('themes', '0006_auto_20170610_1512'), ] operations = [ ...
amadeusproject/amadeuslms
themes/migrations/0007_themes_high_contrats_logo.py
Python
gpl-2.0
597
#!/usr/bin/env python # vim:set et ts=4 sw=4: """Utility functions @contact: Debian FTP Master <ftpmaster@debian.org> @copyright: 2000, 2001, 2002, 2003, 2004, 2005, 2006 James Troup <james@nocrew.org> @license: GNU General Public License version 2 or later """ # This program is free software; you can redistribute ...
luther07/dak
daklib/utils.py
Python
gpl-2.0
54,903
# need to pass it a file, where data starts, path to write # things to import import sys import pandas import scipy import numpy from scipy import stats from scipy.stats import t # arguments being passed path_of_file=sys.argv[1] last_metadata_column=int(sys.argv[2]) path_to_write=sys.argv[3] # spearman p calc based...
ryanjw/co-occurrence_python
first_attempt.py
Python
gpl-2.0
1,125
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import datetime class Migration(migrations.Migration): dependencies = [ ('flyerapp', '0007_auto_20150629_1135'), ] operations = [ migrations.AddField( model_name='schedul...
luzeduardo/antonov225
flyer/flyerapp/migrations/0008_auto_20150630_1859.py
Python
gpl-2.0
924
from keras.models import Sequential from keras.layers.core import Dense, Activation, Dropout from keras.layers.recurrent import LSTM from keras.preprocessing.sequence import pad_sequences import numpy as np import random, sys ''' Example script to generate haiku Text. It is recommended to run this script on G...
napsternxg/haiku_rnn
haiku_gen.py
Python
gpl-2.0
3,766
# -*- coding: UTF-8 -*- # Gedit External Tools plugin # Copyright (C) 2005-2006 Steve Frécinaux <steve@istique.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 versi...
halfline/gedit
plugins/externaltools/tools/windowactivatable.py
Python
gpl-2.0
7,385
# -*- coding: utf-8 -*- # <nbformat>3.0</nbformat> # <headingcell level=1> # Intercity Python API Development # <codecell> from bs4 import BeautifulSoup import requests import pickle loadSite = requests.get('http://www.intercity.co.nz/') siteData = loadSite.content blehData = siteData.split() blehData[0:20] siteD...
wcmckee/wcmckee-notebook
webData.py
Python
gpl-2.0
3,474
am = imp.load_source( 'am', 'artifact-manager' )
paulovn/artifact-manager
test/__init__.py
Python
gpl-2.0
50
#!/usr/bin/python y = '''75 95 64 17 47 82 18 35 87 10 20 04 82 47 65 19 01 23 75 03 34 88 02 77 73 07 63 67 99 65 04 28 06 16 70 92 41 41 26 56 83 40 80 70 33 41 48 72 33 47 32 37 16 94 29 53 71 44 65 25 43 91 52 97 51 14 70 11 33 28 77 73 17 78 39 68 17 57 91 71 52 38 17 14 91 43 58 50 27 29 48 63 66 04 68 89 53 67 ...
generica/euler
18.py
Python
gpl-2.0
782
#aqui se creara el servidor para comenzar la conexion import SocketServer class MiTcpHandler(SocketServer.BaseRequestHandler): #esto se llamara en cada conexion def handle(self): #se usa para recibir desde el cliente self.oracion=self.request.recv(1024).strip() #esto leera la cantidad...
hdrtronic/Socket_python
Servidor.py
Python
gpl-2.0
770
from routersploit.modules.creds.cameras.acti.telnet_default_creds import Exploit def test_check_success(generic_target): """ Test scenario - testing against Telnet server """ exploit = Exploit() assert exploit.target == "" assert exploit.port == 23 assert exploit.threads == 1 assert exploit....
dasseclab/dasseclab
clones/routersploit/tests/creds/cameras/acti/test_telnet_default_creds.py
Python
gpl-2.0
672
# HRGRN WebServices # Copyright (C) 2016 Xinbin Dai, Irina Belyaeva # This file is part of HRGRN WebServices API. # # HRGRN API 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...
Arabidopsis-Information-Portal/hrgrn_webservices
services/hrgrn_list_network/main.py
Python
gpl-2.0
2,479
# ------------------------------------------------------------ # Developping with MicroPython in an async way # # ------------------------------------------------------------ # === asyncio tests === # ------------------------------------------------------------ print("==== /test/asyncio/tes...
smeenka/esp32
lolin32/test/asyncio/test_createkilldye.py
Python
gpl-2.0
2,215
# -*- mode: python -*- # -*- coding: iso8859-15 -*- ############################################################################## # # Gestion scolarite IUT # # Copyright (c) 2001 - 2013 Emmanuel Viennet. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the term...
denys-duchier/Scolar
sco_bulletins_json.py
Python
gpl-2.0
13,221
# Copyright (C) 2012-2015 Codethink Limited # # 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; version 2 of the License. # # This program is distributed in the hope that it will be useful, # but ...
nuxeh/morph
morphlib/localrepocache_tests.py
Python
gpl-2.0
6,502
# This file is part of Parti. # Copyright (C) 2008 Nathaniel Smith <njs@pobox.com> # Parti is released under the terms of the GNU GPL v2, or, at your option, any # later version. See the file COPYING for details. import gobject import sys import os import socket import time from optparse import OptionParser import log...
njsmith/partiwm
xpra/scripts/main.py
Python
gpl-2.0
12,235
# -*- coding: utf-8 -*- # # This file is part of Zenodo. # Copyright (C) 2015, 2016 CERN. # # Zenodo 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 l...
lnielsen/zenodo
zenodo/modules/fixtures/cli.py
Python
gpl-2.0
4,703
# force floating point division. Can still use integer with // from __future__ import division # This file is used for importing the common utilities classes. import numpy as np import matplotlib.pyplot as plt import sys sys.path.append("../../../../../../") from Util import Test from Util.Test import _f_assert,Hummer...
prheenan/BioModel
EnergyLandscapes/InverseWeierstrass/Python/TestExamples/Testing/MainTestingWeightedHistograms.py
Python
gpl-2.0
747
import os.path import itertools import pkg_resources from turbogears.widgets import Widget, TextField from turbogears.widgets import CSSSource, JSSource, register_static_directory from turbogears import config from turbojson import jsonify from util import CSSLink, JSLink __all__ = ['YUIBaseCSS', 'YUIResetCSS', 'YUIFo...
viswimmer1/PythonGenerator
data/python_files/30004740/widgets.py
Python
gpl-2.0
9,892
#!/usr/bin/python from pisi.actionsapi import shelltools, get, cmaketools, pisitools def setup(): cmaketools.configure() def build(): cmaketools.make() def install(): cmaketools.install() pisitools.dodoc ("AUTHORS", "ChangeLog", "COPYING")
richard-fisher/repository
desktop/util/tint2/actions.py
Python
gpl-2.0
263
# -*- coding: utf-8 -*- import unittest import os, sys import PrimaPlay import urllib2 os.chdir(os.path.dirname(sys.argv[0])) user = 'text@example.com'; password = 'password'; class mockTime: def time(self): return 1450875766 class mockUserAgent: def __init__(self, url_map = {}): self.ua = ...
alladdin/plugin.video.primaplay
libPrimaPlay/PrimaPlay_unittest.py
Python
gpl-2.0
12,829
# -*- coding: utf-8 -*- """ Created on Tue Nov 17 19:41:46 2015 @author: deep """ from graph import weightedGraph import heapq def djikstra(a,S): N = len(a.adjLst) Visited = [False for i in xrange(N)] Distance = [float('inf') for i in xrange(N)] Distance[S] = 0 heap = [] heapq.heappush(heap,(0,...
ddeepak6992/Algorithms
Graph/Dijkstra.py
Python
gpl-2.0
935
# Shared utility functions across monitors scripts. import fcntl, os, re, select, signal, subprocess, sys, time TERM_MSG = 'Console connection unexpectedly lost. Terminating monitor.' class Error(Exception): pass class InvalidTimestampFormat(Error): pass def prepend_timestamp(msg, format): """Prepen...
yochow/autotest
server/hosts/monitors/monitors_util.py
Python
gpl-2.0
10,543
#!/usr/bin/python from __future__ import absolute_import, division, print_function import sys import os import codecs import collections import io import re # Define an isstr() and isint() that work on both Python2 and Python3. # See http://stackoverflow.com/questions/11301138 try: basestring # attempt to evalu...
uDeviceX/uDeviceX
pre/uconf/src/uconf.py
Python
gpl-2.0
20,089
# -*- coding: utf-8 -*- """ (c) 2014 - Copyright Red Hat Inc Authors: Pierre-Yves Chibon <pingou@pingoured.fr> """ from anitya.lib.backends import ( BaseBackend, get_versions_by_regex_for_text, REGEX) from anitya.lib.exceptions import AnityaPluginException import six DEFAULT_REGEX = 'href="([0-9][0-9.]*)/...
pombredanne/anitya
anitya/lib/backends/folder.py
Python
gpl-2.0
2,702
#!/usr/bin/env python from thug.DOM.W3C.Core.DOMException import DOMException from .HTMLEvent import HTMLEvent from .MouseEvent import MouseEvent from .MutationEvent import MutationEvent from .StorageEvent import StorageEvent from .UIEvent import UIEvent EventMap = { "HTMLEvent" : HTMLEvent, "HTMLEvents...
pdelsante/thug
thug/DOM/W3C/Events/DocumentEvent.py
Python
gpl-2.0
876