code
stringlengths
3
1.05M
repo_name
stringlengths
5
104
path
stringlengths
4
251
language
stringclasses
1 value
license
stringclasses
15 values
size
int64
3
1.05M
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2007, TUBITAK/UEKAE # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation; either version 2 of the License, or (at your # option) any later...
Pardus-Linux/ptsp
build-client.py
Python
gpl-2.0
9,362
""" sphinx.builders.singlehtml ~~~~~~~~~~~~~~~~~~~~~~~~~~ Single HTML builders. :copyright: Copyright 2007-2019 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ from os import path from docutils import nodes from sphinx.builders.html import StandaloneHTMLBuilder from...
lmregus/Portfolio
python/design_patterns/env/lib/python3.7/site-packages/sphinx/builders/singlehtml.py
Python
mit
7,857
from __future__ import division, print_function from scipy import linalg as la # import numpy as np from .doa import * from .tools_fri_doa_plane import ( pt_src_recon_multiband, extract_off_diag, cov_mtx_est, polar2cart, make_G, make_GtG_and_inv, ) class FRIDA(DOA): """ Implements t...
LCAV/pyroomacoustics
pyroomacoustics/doa/frida.py
Python
mit
9,468
# -*- coding: utf-8 -*- ## # Copyright (C) 2012 by Konstantin Ryabitsev and contributors # # 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) ...
mricon/totp-cgi
totpcgi/backends/__init__.py
Python
gpl-2.0
7,153
import os import subprocess import sys import pandas as pd from minedatabase import utils from minedatabase.databases import MINE from rdkit.Chem import AllChem def load_cdmine_rxns(mine_db, excel_file, pic_dir=""): abrv = {"hn": "[*]"} if pic_dir and not os.path.exists(pic_dir): os.mkdir(pic_dir) ...
JamesJeffryes/MINE-Database
Scripts/add_rxns_from_excel.py
Python
mit
2,201
from django.db import models, transaction from django.urls import reverse from mptt.models import MPTTModel from simplecms import appconfig from fluent_contents.models import ContentItemRelation, PlaceholderRelation class Page(MPTTModel): title = models.CharField("Title", max_length=200) # The basic fields ...
django-fluent/django-fluent-contents
example/simplecms/models.py
Python
apache-2.0
4,054
import os def ifNeededMkdir(path): if not os.path.exists(path): os.mkdir(path)
carlomt/dicom_tools
dicom_tools/ifNeededMkdir.py
Python
mit
92
from __future__ import annotations import io from typing import TYPE_CHECKING, Any, Optional import discord from discord import File, Message from discord.ext import commands if TYPE_CHECKING: from bot import BeattieBot class BContext(commands.Context): """An extension of Context to add a reply method and ...
BeatButton/beattie
context.py
Python
mit
1,509
""" An extremely simple dad joke teller. Jokes are chosen randomly from /r/dadjokes. For additional samples, visit the Alexa Skills Kit Getting Started guide at http://amzn.to/1LGWsLG """ from __future__ import print_function import json import random import urllib import re # --------------- Helpers that build all ...
prempro/alexa-dadjokes
dadjokes-lambda-function.py
Python
mit
3,921
#!/usr/bin/python # -*- coding: utf-8 -*- #-------------------------------------- # # ds18b20.py # Read DS18B20 1-wire temperature sensor # # in /boot/config.txt: #dtoverlay=w1-gpio,gpiopin=4 # # Author : Matt Hawkins # Date : 10/02/2015 # # http://www.raspberrypi-spy.co.uk/ # http://www.raspberrypi-spy...
UbiCastTeam/rpi-temp-logger
temp-logger.py
Python
mit
2,750
import urwid from clisnips.tui.logging import logger from clisnips.tui.models.snippets import SnippetsModel from clisnips.tui.view import View from clisnips.tui.widgets.dialogs.confirm import ConfirmDialog from clisnips.tui.widgets.dialogs.edit_snippet import EditSnippetDialog from clisnips.tui.widgets.dialogs.help im...
ju1ius/clisnips
clisnips/tui/views/snippets_list.py
Python
gpl-3.0
7,424
""" Run the ms speech recognition API detecting speech from notebook microphone (pyaudio) https://people.csail.mit.edu/hubert/pyaudio/ """ import sys import logging from pathlib import Path import wave import pyaudio parent = Path(__file__).resolve().parents[1] path = Path(parent).joinpath('classes') sys.path.append(s...
kymy86/ms-services-app
clients/audioclient.py
Python
mit
2,318
from django.shortcuts import render, redirect from members.models import Member # Create your views here. def index(request): try: member = request.user.member # load app return render(request, 'taggy-index.html') except Member.DoesNotExist: # New user return redirect('...
michel-cf/taggy
taggy/views.py
Python
lgpl-3.0
341
import copy import six.moves.cPickle as pickle import numpy import unittest from theano import config, gof from six import iteritems from theano.compile.io import In, Out from theano.compile import function from theano.compile import UnusedInputError from theano.gof import MissingInputError from theano.compat import ...
valexandersaulys/airbnb_kaggle_contest
venv/lib/python3.4/site-packages/Theano-0.7.0-py3.4.egg/theano/compile/tests/test_function_module.py
Python
gpl-2.0
33,734
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals from six import iteritems, text_type """ bootstrap client session """ import frappe import frappe.defaults import frappe.desk.desk_page from frappe.desk.form.load import get_me...
adityahase/frappe
frappe/boot.py
Python
mit
10,547
"""Utilities for manipulating variant files in standard VCF format. """ from collections import namedtuple, defaultdict import copy import gzip import os import shutil import subprocess from six import iteritems import toolz as tz from six.moves import zip from bcbio import broad, utils from bcbio.bam import ref fr...
brainstorm/bcbio-nextgen
bcbio/variation/vcfutils.py
Python
mit
25,267
# coding: utf-8 """ Kubernetes No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: v1.8.2 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import os import sys im...
mbohlool/client-python
kubernetes/test/test_v1beta2_daemon_set_status.py
Python
apache-2.0
1,011
#!/usr/bin/python ######################################################################## # Solves problem 166 from projectEuler.net. # Determines different 4x4 matrix that all columns, rows and diagonals # sum up the same. # Copyright (C) 2010 Santiago Alessandri # # This program is free software: you can...
sanSS/programming-contests
project-euler/problem166.py
Python
gpl-3.0
2,906
""" Clase Persona Nombre Edad Pareja """ class Persona: def __init__(self, nombre, edad): self.nombre = nombre self.edad = edad self.pareja = None def __str__(self): return "Persona({0}, {1})".format(repr(self.nombre), self.edad) def presentate...
IhToN/DAW1-PRG
Ejercicios/SeguTrim/Objetos/Persona.py
Python
apache-2.0
2,344
#!/usr/bin/env python # # Created by: Pearu Peterson, September 2002 # from __future__ import division, print_function, absolute_import import sys import subprocess import time from numpy.testing import TestCase, run_module_suite, assert_equal, \ assert_array_almost_equal, assert_, assert_raises, assert_allclose...
jlcarmic/producthunt_simulator
venv/lib/python2.7/site-packages/scipy/linalg/tests/test_lapack.py
Python
mit
18,303
#!/usr/bin/env python from .HTMLElement import HTMLElement from .attr_property import attr_property class HTMLDirectoryElement(HTMLElement): def __init__(self, doc, tag): HTMLElement.__init__(self, doc, tag) compact = attr_property("compact", bool)
tweemeterjop/thug
thug/DOM/W3C/HTML/HTMLDirectoryElement.py
Python
gpl-2.0
277
"""Support for Wink water heaters.""" import logging import pywink from homeassistant.components.water_heater import ( ATTR_TEMPERATURE, STATE_ECO, STATE_ELECTRIC, STATE_GAS, STATE_HEAT_PUMP, STATE_HIGH_DEMAND, STATE_PERFORMANCE, SUPPORT_AWAY_MODE, SUPPORT_OPERATION_MODE, SUPPO...
leppa/home-assistant
homeassistant/components/wink/water_heater.py
Python
apache-2.0
4,137
import sys def main(): lines = [] with open(sys.argv[1]) as input_file: for line in input_file: lines.append(line) n = int(lines[0]) number_of_lines = len(lines) - 1 scores = sorted([(len(x), x.strip()) for _, x in enumerate(lines[1:])], reverse=True) for line in ...
leaen/Codeeval-solutions
longest-lines.py
Python
mit
400
import adxl345 import sys import time if __name__ == "__main__": accel = adxl345.ADXL345() while(True): axis = accel.getAxes() sys.stdout.write("\rx:%.3f y:%.3f z:%.3f" % (axis['x'], axis['y'], axis['z'])) sys.stdout.flush() time.sleep(0.02)
locked/4stability
adxl345_test.py
Python
bsd-3-clause
259
# -*- coding: utf-8 -*- # # Author: François Rossigneux <francois.rossigneux@inria.fr> # # Licensed under the Apache License, Version 2.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.apache.org/licenses/LICENSE-2.0 # # Unles...
mosieurlaurin/kwapi
kwapi/plugins/rrd/rrd.py
Python
apache-2.0
12,484
from load import * from sklearn import decomposition import sys import numpy as np from keras.models import Sequential from keras.layers.core import Dense, Dropout, Activation from keras.optimizers import RMSprop from keras.utils import np_utils # pca feature dimension ndim = 100 if len(sys.argv) != 1: ndim = int...
MihawkHu/Gene_Chip
dnn/dnn.py
Python
mit
2,261
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from subscriptions.handlers import blueprint
jasielserra/appengineflask
backend/subscriptions/__init__.py
Python
agpl-3.0
126
r"""streamlinkを使ってTwitchを見る時のHelperスクリプト Usage: twitch_helper.py auth twitch_helper.py live <username> <quality> twitch_helper.py chat <username> twitch_helper.py past <username> <video_id> <quality> twitch_helper.py down <username> <video_id> <quality> twitch_helper.py -h | --help Options: ...
gottadiveintopython/backup
python_scripts/twitch_helper.py
Python
mit
3,599
#!/usr/bin/env python """ ===================================================== deadReckoningPose.py - Pose Handler for dead reckoning ===================================================== """ import sys, time from numpy import * from regions import * import _pyvicon from math import pi, sin, cos import thread from ti...
jadecastro/LTLMoP
src/lib/handlers/pose/deadReckoningPose.py
Python
gpl-3.0
11,708
#!/usr/bin/env python # # Copyright 2006, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list...
wubenqi/zutils
zutils/testing/gtest/test/gtest_xml_output_unittest.py
Python
apache-2.0
13,525
#objective layer class has error: method 'loss' and string 'loss' has conflict import unittest import numpy import theano import theano.tensor as T from yann.layers.output import classifier_layer as cl from yann.layers.output import objective_layer as ol try: from unittest.mock import Mock except ImportError: f...
ragavvenkatesan/Convolutional-Neural-Networks
tests/layers/test_output.py
Python
mit
13,012
# -*- coding: utf-8 -*- class Vehicle: '''demo class for an OO design''' def __init__(self, name): self.name = name self.power = 100 def __del__(self): class_name = self.__class__.__name__ print class_name, ": base destroyed" def display(self): ...
vollov/py-lab
src/vehicle/__init__.py
Python
mit
472
"""Preset manager window.""" from Settings import SettingsDialog from Config import Config as Con # Import Jenkins from jenkinsapi.jenkins import Jenkins # Import interface libraries import gi gi.require_version('Gtk', '3.0') from gi.repository import Gtk, Gdk class JenkinsPresets(Gtk.Window): """Jenkins prese...
Mafioziks/CI-Tool-Widgets
PresetManager.py
Python
mit
6,614
import sys from glob import glob import pytest def test_version(): import nipype print("nipype version: ", nipype.__version__) def reduce_notebook_load(path): """ Changes the number of subjects in examples and hands-on to two, to reduce computation time on CircleCi. """ path_short = path...
miykael/nipype_tutorial
test_notebooks.py
Python
bsd-3-clause
3,393
# coding=utf-8 """OpenVPN plugin configuration backend""" from ajenti.api import ModuleConfig from backend import OpenVPNBackend class OpenVPNConfig(ModuleConfig): """OpenVPN config""" target = OpenVPNBackend platform = ['any'] labels = { 'addr': 'Management address (host:port or pa...
DVSBA/ajenti
plugins/openvpn/config.py
Python
lgpl-3.0
426
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt # Database Module # -------------------- from __future__ import unicode_literals import re import time import frappe import datetime import frappe.defaults import frappe.model.meta from frappe import _ from time impo...
saurabh6790/frappe
frappe/database/database.py
Python
mit
32,777
import subprocess import protoccn from protoccn.Producer import * app = CCNProducer("Producer", "ccnx:/producer") @app.handle("/command") def execute_command(suffix, cmd): out = subprocess.check_output([cmd]) print "Ran %s: %s" % (cmd, out) return out if __name__ == "__main__": app.run()
chris-wood/protoccn
examples/HelloProducer.py
Python
mit
309
from bricklayer.doctor.checks import Checker from bricklayer.doctor.constants import HelpMessages from bricklayer.utils.logger import Logger from unittest import TestCase import os import sys import logging from StringIO import StringIO class ChecksTest(TestCase): def test_executes_program(self): checker =...
cbrentharris/bricklayer
bricklayer/tests/doctor/checks_test.py
Python
mit
1,995
import _plotly_utils.basevalidators class IdssrcValidator(_plotly_utils.basevalidators.SrcValidator): def __init__(self, plotly_name="idssrc", parent_name="splom", **kwargs): super(IdssrcValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, edit_t...
plotly/plotly.py
packages/python/plotly/plotly/validators/splom/_idssrc.py
Python
mit
388
""" Conversion of HTML into template with dynamic parts. We want to allow some dynamic content that gets inserted as the HTML is rendered. This is done by converting certain HTML tags into template tags. There are two mechanisms to do this: plugin handlers and tag handlers. Plugins are meant for inserting bits of dyn...
mivanov/editkit
editkit/pages/plugins.py
Python
gpl-2.0
14,877
# -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the #...
owlabs/incubator-airflow
tests/cli/test_worker_initialisation.py
Python
apache-2.0
2,382
from urllib2 import ( urlopen, HTTPError, URLError, ) BASEURL = 'http://169.254.169.254/' DEFAULT_TIMEOUT = 2 DEFAULT_API_VERSION = 'latest' class MetadataError(Exception): pass def path(path=None, api_version=DEFAULT_API_VERSION, timeout=DEFAULT_TIMEOUT): if not api_version: api_versi...
slank/awsmeta
awsmeta/metadata.py
Python
mit
1,422
# # @BEGIN LICENSE # # Psi4: an open-source quantum chemistry software package # # Copyright (c) 2007-2019 The Psi4 Developers. # # The copyrights for code used from other parties are included in # the corresponding files. # # This file is part of Psi4. # # Psi4 is free software; you can redistribute it and/or modify #...
jgonthier/psi4
psi4/driver/procrouting/response/scf_products.py
Python
lgpl-3.0
21,923
# -*- coding: utf-8 -*- """This module contains the Resilient propagation optimizer.""" from __future__ import absolute_import from . import mathadapt as ma from .base import Minimizer class Rprop(Minimizer): """Rprop optimizer. Resilient propagation is an optimizer that was originally tailored towards ...
BRML/climin
climin/rprop.py
Python
bsd-3-clause
4,715
# Current code status: # # This was originally written by Philip Taylor for use at # http://philip.html5.org/tests/canvas/suite/tests/ # # It has been adapted for use with the Web Platform Test Suite suite at # https://github.com/web-platform-tests/wpt/ # # The original version had a number of now-removed features (mul...
ric2b/Vivaldi-browser
chromium/third_party/blink/web_tests/external/wpt/html/canvas/tools/gentestutils.py
Python
bsd-3-clause
16,131
import serial import time port = serial.Serial("/dev/ttyUSB0", baudrate=115200, timeout=1.0) rainbow = open('rainbow', 'r') bluered = open('blue_red', 'r') greenred = open('green_red', 'r') def show_ledstrip( leddata ): port.write("leddata\r") port.write(leddata) return def show_animation(): show_l...
flitjes/LedClock
TestData/test_serial.py
Python
gpl-3.0
518
#!/usr/bin/env python # -*- coding: utf-8 -*- # # WPSIG - WiFi Protected Setup Information Gathering # Copyright (C) 2013 Core Security Technologies # Copyright (C) 2015, 2016 Oleg Kupreev # # This file is part of WPSIG. # # WPSIG is free software: you can redistribute it and/or modify # it under the te...
0x90/WPSIG
wpsig.py
Python
gpl-3.0
22,469
class PoolEmptyError(Exception): """空池异常. """ def __init__(self): Exception.__init__(self) def __str__(self): return repr('The proxy source is exhausted.') class ResourceDepletionError(Exception): """资源枯竭异常,如果长时间抓取不到可用的 代理,则触发此异常. """ def __init__(self): Excep...
WiseDoge/ProxyPool
proxypool/errors.py
Python
apache-2.0
852
from django.db import models from django.utils.translation import ugettext_lazy as _ from ..utils import first_upper class AgeGroup(models.Model): name = models.CharField(_("name"), max_length=50) min_age = models.PositiveSmallIntegerField(_("minimal age"), blank=True, null=True) max_age = models.Positiv...
leprikon-cz/leprikon
leprikon/models/agegroup.py
Python
bsd-3-clause
794
from guineapig import * import sys import os import subprocess #example of programmatic use of Guinea Pig def wc(corpus=None,prefix=None): """Return a planner instance that can word-count a corpus.""" p = Planner(corpus=corpus,prefix=prefix) #self.param is automatically constructed p.r = ReadLines(p.p...
TeamCohen/GuineaPig
tutorial/multi-wordcount-hadoop.py
Python
lgpl-3.0
1,608
# Copyright (c) 2010-2012 OpenStack, LLC. # # Licensed under the Apache License, Version 2.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.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to ...
parkys1/swift_sandbox
swift/proxy/controllers/obj.py
Python
apache-2.0
42,309
import os import shlex import textwrap from django.conf import settings from django.core.management import call_command from django.core.management.base import LabelCommand, CommandError from django.core.management.utils import popen_wrapper from django.utils.translation import to_locale import polib class Command(La...
ministryofjustice/cla_backend
cla_backend/apps/core/management/commands/translations.py
Python
mit
4,210
# Copyright Reinier de Blois # # Licensed under the Apache License, Version 2.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.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
Panda3D-google-code-repositories/naith
game/plugins/bulletholes/bulletholes.py
Python
apache-2.0
2,548
import random def calculateChange(change_to_return): ones=change_to_return/100 change_after_ones = change_to_return % 100 quarters=change_after_ones/25 change_after_quarters = change_after_ones-(quarters*25) dimes=change_after_quarters/10 change_after_dimes=change_...
nbhavana/python-practice-programs
changesample.py
Python
gpl-2.0
1,912
# -*- coding: utf-8 -*- ## \package globals.ffmpeg # # Retrieves the FFmpeg executable # MIT licensing # See: LICENSE.txt import subprocess from subprocess import PIPE from subprocess import STDOUT from globals.cmds import GetCMD CMD_ffmpeg = GetCMD(u'ffmpeg') # --- Check to see if ffmpeg supports xvid and x2...
AntumDeluge/desktop_recorder
source/globals/ffmpeg.py
Python
mit
4,136
# Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
alb-i986/selenium
py/test/selenium/webdriver/common/clear_tests.py
Python
apache-2.0
3,263
# # Copyright 2014 Red Hat, Inc. # # Author: Nejc Saje <nsaje@redhat.com> # # Licensed under the Apache License, Version 2.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.apache.org/licenses/LICENSE-2.0 # # Unless requir...
m1093782566/openstack_org_ceilometer
ceilometer/tests/test_coordination.py
Python
apache-2.0
8,270
from __future__ import print_function, division, absolute_import import warnings import sys # unittest only added in 3.4 self.subTest() if sys.version_info[0] < 3 or sys.version_info[1] < 4: import unittest2 as unittest else: import unittest # unittest.mock is not available in 2.7 (though unittest2 might conta...
aleju/ImageAugmenter
test/augmentables/test_bbs.py
Python
mit
85,736
import numpy as np from PyQt4.QtGui import QIntValidator, QDoubleValidator, QApplication, QSizePolicy from orangewidget import gui from orangewidget.settings import Setting from oasys.widgets import widget import orangecanvas.resources as resources import sys, os from crystalpy.util.PolarizedPhotonBunch import Polariz...
edocappelli/oasys-crystalpy
orangecontrib/oasyscrystalpy/widgets/elements/IdealLinearPolarizer.py
Python
mit
6,490
"""Config flow for Rainforest Eagle integration.""" from __future__ import annotations import logging from typing import Any import voluptuous as vol from homeassistant import config_entries from homeassistant.const import CONF_HOST, CONF_TYPE from homeassistant.data_entry_flow import FlowResult from . import data ...
Danielhiversen/home-assistant
homeassistant/components/rainforest_eagle/config_flow.py
Python
apache-2.0
2,713
# -*- coding: utf-8 -*- # Generated by Django 1.11.2 on 2017-07-06 10:52 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('mangaki', '0077_add_work_enddate'), ] operations = [ migrations.AlterField(...
mangaki/mangaki
mangaki/mangaki/migrations/0078_auto_20170706_1252.py
Python
agpl-3.0
451
import numpy as np import os import tensorflow as tf import cv2 from threading import Thread from BETA.TestCode.Tensorflow.object_detection.utils import label_map_util from BETA.TestCode.Tensorflow.object_detection.utils import visualization_utils as vis_util class WebcamVideoStream: def __init__(self, src=0, wid...
RyanChinSang/ECNG3020-ORSS4SCVI
BETA/TestCode/Tensorflow/object_detection/APP-objdettf2.py
Python
gpl-3.0
4,332
# 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 may ...
Azure/azure-sdk-for-python
sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_agent_operations.py
Python
mit
10,052
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
mtagle/airflow
tests/providers/apache/hive/operators/test_hive_to_samba.py
Python
apache-2.0
3,094
def parse_rank_score(rank_score_entry, case_id): """Parse the rank score Args: rank_score_entry(str): The raw rank score entry case_id(str) Returns: rank_score(float) """ rank_score = None if rank_score_entry: for family_info in rank_score_entry.split(","): ...
Clinical-Genomics/scout
scout/parse/variant/rank_score.py
Python
bsd-3-clause
486
from Tkinter import * from tkFileDialog import * from subprocess import call class Window(Frame): def __init__(self, parent): Frame.__init__(self, parent) self.parent = parent self.initUI() def initUI(self): self.parent.title("Solenoise") self.pack(fill=BOTH, expand...
spacerafe/Solenoise
GUI5.py
Python
mit
2,063
def sel_sort(aList, start = 0): """ Function to perform recursively a selection sort of a list in place. It takes a list as input and returns the sorted list. """ if len(aList) == start: return find_min_and_swap(aList, start) sel_sort(aList, start+1) return aList def find_min_an...
bluciam/ruby_versus_python
red_book/Kap_8/selection_sort_recur.py
Python
gpl-2.0
625
# -*- coding: utf-8 -*- from __future__ import unicode_literals import django.utils.timezone from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("delft3dworker", "0058_container_task_starttime"), ] operations = [ migrations.AlterField( ...
openearth/delft3d-gt-server
delft3dworker/migrations/0059_auto_20160830_1304.py
Python
gpl-3.0
490
from django.contrib.auth import (authenticate, login as auth_login, logout as auth_logout) from django.contrib.auth.decorators import login_required from django.contrib.auth.models import User from django.contrib.messages import info, error from django.core.urlresolvers i...
guibernardino/mezzanine
mezzanine/accounts/views.py
Python
bsd-2-clause
5,817
#!/usr/bin/python import re import vim def vim_quote(s): """ quote python objects as vim string used in `:echo %s` and `:call foo(%s)` """ table = dict() def add_to_table(t): def result(fun): table[t] = fun return fun return result @add_to_table...
fermat618/pida
pida/editors/vim/vim_escape.py
Python
gpl-2.0
2,025
from __future__ import print_function import sys sys.path.insert(1,"../../") import h2o from tests import pyunit_utils def frame_checker(frame): assert frame.ncol == len(frame.names) == len(frame.types) assert set(frame.names) == set(frame.types) def pyunit_drop(): #Import data and collect number of co...
h2oai/h2o-3
h2o-py/tests/testdir_misc/pyunit_drop.py
Python
apache-2.0
2,917
# -*- coding: utf8 -*- ########################################################################### # This is the package latexparser # # 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, ei...
LaurentClaessens/LaTeXparser
Occurrence.py
Python
gpl-3.0
7,331
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. from twisted.python.compat import set from twisted.trial import unittest from twisted.internet import interfaces, task, reactor, defer, error # Be compatible with any jerks who used our private stuff Clock = task.Clock from twisted.python impo...
waseem18/oh-mainline
vendor/packages/twisted/twisted/test/test_task.py
Python
agpl-3.0
23,313
# Copyright 2019 Google Inc. # # Licensed under the Apache License, Version 2.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.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
google/personfinder
tests/views/test_admin_dashboard.py
Python
apache-2.0
1,500
# -*- coding: utf-8 -*- # Generated by Django 1.9.7 on 2016-07-15 03:44 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): initial = True dependencies = [ ('auth', ...
Adarnof/adarnauth-whsales
whsales/migrations/0001_initial.py
Python
gpl-3.0
3,260
# coding: utf-8 import os from unittest import TestCase from crawling.crawler import Crawler from model.page import Page from service.impl.epoca_cosmeticos import EpocaCosmeticos class CrawlerUnitTest(TestCase): def test_get_product(self): crawler = Crawler() base_path = os.path.abspath('.') + os...
ralphavalon/avaloncrawler
tests/crawler_unit_test.py
Python
mit
742
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Licensed under the Apache License, Version 2.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.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
adkerr/tempest
tempest/api/volume/test_volumes_backups.py
Python
apache-2.0
5,283
''' Created on Oct 14, 2010 @author: Stephen O'Hara This code module provides a set of functions to be applied to 3-mode tensors, such as unfolding along an axis into a matrix, computing canonical angles, chordal distance, and so on. Copyright (C) 2012 Stephen O'Hara This program is free software: you can redistribu...
Sciumo/ProximityForest
proximityforest/common/Tensor.py
Python
gpl-3.0
5,145
#! /usr/bin/env python # altschulEriksonDinuclShuffle.py # P. Clote, Oct 2003 # NOTE: One cannot use function "count(s,word)" to count the number # of occurrences of dinucleotide word in string s, since the built-in # function counts only nonoverlapping words, presumably in a left to # right fashion. import sys,rando...
iyak/RNAelem
script/dishuffle.py
Python
gpl-3.0
4,032
from yowsup.layers.protocol_chatstate.protocolentities.chatstate_outgoing import OutgoingChatstateProtocolEntity from yowsup.layers.protocol_chatstate.protocolentities.test_chatstate import ChatstateProtocolEntityTest class OutgoingChatstateProtocolEntityTest(ChatstateProtocolEntityTest): def setUp(self): ...
felix-dumit/campusbot
yowsup2/yowsup/layers/protocol_chatstate/protocolentities/test_chatstate_outgoing.py
Python
mit
492
# -*- coding: utf-8 -*- """Tests for view serializers under v1 API.""" from webplatformcompat.view_serializers import DjangoResourceClient from webplatformcompat.history import Changeset from ..test_view_serializers import ( TestBaseViewFeatureViewSet, TestBaseViewFeatureUpdates) from .base import TestCase clas...
jwhitlock/web-platform-compat
webplatformcompat/tests/v1/test_view_serializers.py
Python
mpl-2.0
1,338
from .PBXItem import * class PBXStandAloneTarget(PBX_Base_Target): def __init__(self, identifier, dictionary): super(self.__class__, self).__init__(identifier, dictionary) def resolveGraph(self, project): super(self.__class__, self).resolveGraph(project) self.resolveGraphNodesForArray(k...
samdmarshall/pbProj
pbProj/PBXStandAloneTarget.py
Python
bsd-3-clause
351
""" Example Directory .. automodule:: pyatb.examples.get_current_price """
hsonntag/yatb
pyatb/examples/__init__.py
Python
gpl-2.0
77
import os.path import struct import unittest from coinotomy.backend.packbackend import PackStorageBackend from coinotomy.backend.tests.test_backend_common import CommonBackend def trunc(val): return struct.unpack(b"f", struct.pack(b'f', val))[0] class TestPackBackend(unittest.TestCase, CommonBackend): FIL...
sDessens/coinotomy
coinotomy/backend/tests/test_packbackend.py
Python
mit
604
from bottle import request, response, post, get import cgi, json api = { 'routes' : '/user/routes/', 'accounts' : '/user/accounts/', 'account_details': '/user/details/<account_id>/', 'send_text_message': '/user/send/text/<account_id>/<to_ring_id>/<message>/', 'devices' : '/user/video/devices' } cl...
Bl4ckb0ne/ring-api
ring_api/extra/servers/bottle/api/user.py
Python
gpl-3.0
1,059
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2017 Guenter Bartsch # # Licensed under the Apache License, Version 2.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.apache.org/licenses/LICENSE-2.0 # # Unles...
gooofy/nlp
data-tools/rdf/ldfmirror.py
Python
lgpl-3.0
16,116
#!/usr/bin/python import re import sys import math class Clique: name = "" numvars = 0 v = [] meas = 0 if (len(sys.argv) != 3): print "Usage: acemarg2alchemy [src elidan net file] [dest alchemy file]" quit() #endif PARSEVARIABLE=0 PARSECLIQUE=1 PARSEMEASURE=2 PARSECLIQUE2MEASURE=3 parsestate = 0 f =...
Matt3164/sill
tests/parsers/elidannet2alchemy.py
Python
lgpl-2.1
1,990
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'Institucion' db.create_table('proyectos_academicos_institucion', ( ('id', self.g...
pattyreinoso/voluntariadoHOI
hoi_project/apps/proyectos_academicos/migrations/0005_initial.py
Python
mit
9,172
# -*- coding: utf-8 -*- # Copyright (C) 2013-Today Carlos Eduardo Vercelino - CLVsol # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from . import person_aux_mass_edit
CLVsol/clvsol_odoo_addons
clv_person_aux_history/wizard/__init__.py
Python
agpl-3.0
186
from exceptions import (InvalidKeyPair, InvalidAvailabilityZone, NoSubnetReturned, RegionDoesNotExist, InvalidCluster, InvalidAMI, NoSecurityGroupsReturned, MultipleSecurityGroupsReturned) import boto.ec2 import boto.route53 import boto.ec2.network...
hudl/Tyr
tyr/servers/server.py
Python
unlicense
39,170
# 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 ...
AutorestCI/azure-sdk-for-python
azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/gateway_route_list_result.py
Python
mit
934
""" Views related to content libraries. A content library is a structure containing XBlocks which can be re-used in the multiple courses. """ from __future__ import absolute_import import json import logging from contentstore.views.item import create_xblock_info from contentstore.utils import reverse_library_url, add...
sbalde/edx-platform
cms/djangoapps/contentstore/views/library.py
Python
agpl-3.0
9,296
#management command to update the site with any mail import poplib import re import logging from email import message_from_string from django.core.management.base import BaseCommand from django.core.exceptions import MultipleObjectsReturned, ObjectDoesNotExist from django.contrib.auth.models import User from django.co...
sswamy17/econsensus
django/econsensus/publicweb/management/commands/process_email.py
Python
gpl-3.0
12,864
# Copyright (c) 2015. Mount Sinai School of Medicine # # Licensed under the Apache License, Version 2.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.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
timodonnell/sefara
sefara/commands/env.py
Python
apache-2.0
1,310
from __future__ import print_function from argparse import ArgumentParser import logging from nptdms import tdms def main(): parser = ArgumentParser( description="List the contents of a LabView TDMS file.") parser.add_argument( '-p', '--properties', action="store_true", help="Include...
nmgeek/npTDMS
nptdms/tdmsinfo.py
Python
lgpl-3.0
1,875
from setuptools import setup, find_packages import sys, os version = '1' setup( name='ckanext-federgob', version=version, description="Extension to federate the catalog with datos.gob.", long_description=''' ''', classifiers=[], # Get strings from http://pypi.python.org/pypi?%3Aaction=list_cla...
jesusredondo/ckanext-federgob
setup.py
Python
mit
883
""" KingdomRushLevel class for the Kingdom Rush problem for Google Code Jam 2012 Round 1A Link to problem description: http://code.google.com/codejam/contest/1645485/dashboard#s=p1 author: Christos Nitsas (chrisn654) language: Python 3.2.1 date: April, 2012 usage: $ python3.2 runme.py sample.in or $ runme.py samp...
nitsas/codejamsolutions
Kingdom Rush/KingdomRushLevel.py
Python
mit
1,218
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
dmlc/tvm
python/tvm/topi/cuda/conv1d.py
Python
apache-2.0
10,813
from nose import SkipTest import os, sys from t_config import TestConfig, app_from_config from tests.model import User, Group, Town from tg.util import Bunch from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker from tests.model import metadata, DBSession root = os.path.abspath(os.path.join(os...
pedersen/tgtools.tgext-admin
tests/test_controller.py
Python
mit
9,597
import random import re import string import datetime from livestreamer.plugin import Plugin, PluginError, PluginOptions from livestreamer.plugin.api import http, validate from livestreamer.stream import HLSStream API_URL = "https://api.crunchyroll.com/{0}.0.json" API_HEADERS = { "User-Agent": "Mozilla/5.0 (iPhon...
breunigs/livestreamer-debian
src/livestreamer/plugins/crunchyroll.py
Python
bsd-2-clause
9,429