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
from distutils.core import setup import os PKG_VERSION = os.environ.get('PACKAGE_VERSION') or '1.11.1' TEST_DEPS = [ 'pytest<3.7', 'pytest-asyncio', 'base58' ] setup( name='python3-indy', version=PKG_VERSION, packages=['indy'], url='https://github.com/hyperledger/indy-sdk', license='MIT/Apach...
peacekeeper/indy-sdk
wrappers/python/setup.py
Python
apache-2.0
794
#!/usr/bin/env python """Tests for the linalg.isolve.gcrotmk module """ from __future__ import division, print_function, absolute_import from numpy.testing import assert_, assert_allclose, assert_equal from scipy._lib._numpy_compat import suppress_warnings import numpy as np from numpy import zeros, array, allclose ...
gertingold/scipy
scipy/sparse/linalg/isolve/tests/test_gcrotmk.py
Python
bsd-3-clause
5,488
#!/usr/bin/env python # -*- coding: utf-8 -*- import numpy as np import theano.tensor as T from recurrent import RecurrentLayer from deepy.core import neural_computation, env class PeepholeLSTM(RecurrentLayer): """ Long short-term memory layer with peepholes. """ def __init__(self, hidden_size, init_...
zomux/deepy
deepy/layers/plstm.py
Python
mit
3,426
# Cycle Monitor, Copyright (C) 2016 M.B.Grieve # This file is part of the Cycle Monitor example application. # Cycle Monitor 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, o...
moraygrieve/cycle-monitor
test/utils/scripts/printer.py
Python
gpl-3.0
1,129
from my_extension.carray_ext import CarrayOnSteroids from my_extension.ctable import ctable
FrancescElies/bcolz_extension_test
my_extension/__init__.py
Python
gpl-2.0
92
"""Test ModelRunScheduler and JobScheduler """ from unittest.mock import Mock, patch import networkx from pytest import fixture, raises from smif.controller.scheduler import JobScheduler, ModelRunScheduler from smif.model import ModelOperation, ScenarioModel, SectorModel class EmptySectorModel(SectorModel): def ...
willu47/smif
tests/controller/test_scheduler.py
Python
mit
6,693
""" Utilites for working with tarfiles """ import os from cStringIO import StringIO import tarfile def create_inmemory_tarfile(compression='bz2'): """ Creates a tar archive stored in a StringIO object. """ tar_bytestr = StringIO() tar = tarfile.open(fileobj=tar_bytestr, mode='w:'+compression) r...
suprzer0/python_utils
python_utils/tar.py
Python
mit
989
# Copyright 2015 Google Inc. All rights reserved. # # 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 agr...
askdaddy/PerfKitBenchmarker
perfkitbenchmarker/packages/ycsb.py
Python
apache-2.0
27,030
from nose.tools import eq_, ok_ from whoosh.index import open_dir, exists_in from whoosh.query import Every import unittest import sys import os import shutil import uuid sys.path.append(os.path.dirname(__file__) + '/../') from config import Config from helper import separate_files from index_manager import IndexMan...
mknz/mirusan
search/tests/test_search.py
Python
gpl-3.0
2,362
""" This plugin gives the power of Selenium to nosetests by providing a WebDriver object for the tests to use. """ from nose.plugins import Plugin from pyvirtualdisplay import Display from seleniumbase.core import proxy_helper from seleniumbase.fixtures import constants class SeleniumBrowser(Plugin): """ The...
mdmintz/seleniumspot
seleniumbase/plugins/selenium_plugin.py
Python
mit
7,978
# Step 04 - generate Java literals. # # Java byte-code has severe restrictions. There is no such thing as # "array literal" - those are implemented as series of data[x] = y; # as a consequence N-byte array will use 7N bytes in class, plus N bytes # in instantiated variable. Also no literal could be longer than 64KiB. #...
google/brotli
scripts/dictionary/step-04-generate-java-literals.py
Python
mit
2,214
class CreateMapping(object): def __init__(self): self.request_id = '' self.mapping = ''
M4gn4tor/mastercard-api-python
Services/moneysend/domain/card_mapping/createmapping.py
Python
bsd-3-clause
108
# THIS FILE IS PART OF THE CYLC WORKFLOW ENGINE. # Copyright (C) NIWA & British Crown (Met Office) & 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 3 of the Licen...
cylc/cylc
tests/unit/plugins/test_pre_configure.py
Python
gpl-3.0
3,607
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from base import GAETestCase from badge_app.badge_model import Badge from routes.badges.home import index, delete from gaebusiness.business import CommandExecutionException from gaegraph.model import Node from mommygae import mommy from te...
raphaelrpl/portal
backend/test/badge_tests/badge_home_tests.py
Python
mit
1,024
# Copyright 2015 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # A singleton map from platform backends to maps of uniquely-identifying # remote port (which may be the same as local port) to DevToolsClientBackend. # Ther...
catapult-project/catapult-csm
telemetry/telemetry/internal/platform/tracing_agent/chrome_tracing_devtools_manager.py
Python
bsd-3-clause
2,272
# -*- coding: utf-8 -*- # # codimension - graphics python two-way code editor and analyzer # Copyright (C) 2010-2017 Sergey Satskiy <sergey.satskiy@gmail.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Softw...
SergeySatskiy/codimension
codimension/utils/config.py
Python
gpl-3.0
1,187
# Copyright 2014 Cloudera 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, so...
cpcloud/ibis
ibis/tests/expr/test_pipe.py
Python
apache-2.0
1,564
"""This file is intentionally left blank."""
voicecom/pgtool
tests/__init__.py
Python
apache-2.0
45
""" Blackboard Analysis Tools Copyright 2013, Jeroen Doggen, jeroendoggen@gmail.com """ import sys from blackboard_analysis_tools.blackboard import BlackboardAnalysisTools def run(): """Run the main program""" assignment_analyser = BlackboardAnalysisTools() #assignment_analyser.init() assign...
jeroendoggen/blackboard-analysis-tools
blackboard_analysis_tools/main.py
Python
mit
434
''' Author: leovt (Leonhard Vogt) License: GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 Example code for using glsl and vertex buffer objects with pyglet ''' import sys import warnings import pyglet from pyglet import gl import ctypes render_program = None copy_program = None framebuffer = None window = None...
leovt/leovt
glhelper.py
Python
gpl-3.0
9,545
#!/usr/bin/env python ''' This file is part of the ASNN eMail Suite. ASNN-MDA is free software: you can redistribute it and/or modify it under the terms of the version 2 GNU General Public License as published by the Free Software Foundation. ASNN-MDA is distributed in the hope that it will be us...
marvinglenn/asnn-mda
asnn_lib_dkim.py
Python
gpl-2.0
6,823
#!/usr/bin/env python # # Copyright 2008 Jose Fonseca # # 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. # # This ...
jonnyhtw/cylc
lib/xdot.py
Python
gpl-3.0
97,799
""" Code taken directly from http://preshing.com/20110822/penrose-tiling-in-obfuscated-python/ """ _ =\ """if! 1:"e,V=100 0,(0j-1)**-.2; v,S=.5/ V.real, ...
ccsplit/misc
penrose.py
Python
mit
1,785
import numpy as np import os DEFAULT_FILE_PATH = os.path.join(os.path.dirname(os.path.realpath(__file__)), "datasets", "glove.6B.50d.txt") def loadWordVectors(tokens, filepath=DEFAULT_FILE_PATH, dimensions=50): """Read pretrained GloVe vectors""" wordVectors = np.zeros((len(tokens), dimensions)) with ope...
IAAAIAAIA/studyGroup
steffen/assignment1/utils/glove.py
Python
mit
799
__author__ = 'teemupitkanen1' import numpy as np data=open("../data/paleo.csv","r").read().split("\n") del data[0] data.pop() # Create array "accuracy". accuracy[i,j] = places after decimal points for data record i, field 10+j accuracy = [] for i in range(len(data)): row=[0,0,0] record = data[i].split(";") ...
assamite/itm_project
teemu/stuff/accuracy.py
Python
gpl-2.0
1,468
import os import logging import logging.handlers import multiprocessing class CentralLogger(multiprocessing.Process): """Logging process. Works with python subprocesses and multiprocessing. """ def __init__(self, queue): """Reads messages from a queue and logs them to a file. ...
Dissonant-Tech/pydzen
log/centrallogger.py
Python
gpl-3.0
2,034
import os import re import sys import copy import pickle from urllib.request import urlopen from urllib.error import HTTPError from urllib.parse import urlencode try: import pylast has_pylast = True except ImportError: has_pylast = False import pafy from . import g, c, paths, util mswin = os.name == "n...
np1/mps-youtube
mps_youtube/config.py
Python
gpl-3.0
13,150
import csv from datetime import datetime from matplotlib import pyplot as plt # Get dates, high, and low temperatures from file. filename = 'sitka_weather_2017.csv' with open(filename) as f: reader = csv.reader(f) header_row = next(reader) dates, highs, lows = [], [], [] for row in reader: cu...
helanan/Panda_Prospecting
panda_prospecting/prospecting/insights/high_lows.py
Python
mit
966
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from metrics import memory from metrics import Metric from telemetry.value import scalar class SystemMemoryMetric(Metric): """SystemMemoryMetric gathers ...
7kbird/chrome
tools/perf/metrics/system_memory.py
Python
bsd-3-clause
4,705
# Import smorgasbord import os import sys sys.path.insert(0, '../') import gc import pdb import time import csv import shutil import multiprocessing as mp import numpy as np import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import astropy astropy.log.setLevel('ERROR') import astrop...
Stargrazer82301/CAAPR
CAAPR/CAAPR_IO/CAAPR_IO.py
Python
mit
42,977
""" Django settings for my_ap project. For more information on this file, see https://docs.djangoproject.com/en/dev/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/dev/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) impo...
912/M-new
my_ap/my_ap/settings.py
Python
gpl-2.0
2,221
# coding: utf-8 # # Copyright © 2017 weirdgiraffe <giraffe@cyberzoo.xyz> # # Distributed under terms of the MIT license. #
weirdgiraffe/plugin.video.giraffe.seasonvar
resources/site-packages/mock_kodi/__init__.py
Python
mit
125
import json with open('data/78mm.json', 'r') as _78mm: polygons78 = json.load(_78mm)["features"][0]["geometry"]["geometries"] with open('data/100mm.json', 'r') as _100mm: polygons100 = json.load(_100mm)["features"][0]["geometry"]["geometries"] with open('data/130mm.json', 'r') as _130mm: polygons130 = json...
HackCigriculture/cigriculture-ml
src/polygon.py
Python
gpl-3.0
2,316
import json from PIL import Image import collections with open('../config/nodes.json') as data_file: nodes = json.load(data_file) # empty fucker ordered_nodes = [None] * len(nodes) # populate fucker for i, pos in nodes.items(): ordered_nodes[int(i)] = [pos['x'], pos['y']] filename = "04_rgb_vertical_lines" i...
Ibuprofen/gizehmoviepy
gif_parsers/read_rgb.py
Python
mit
1,281
""" weasyprint.tests.layout.block ----------------------------- Tests for blocks layout. """ import pytest from weasyprint.formatting_structure import boxes from ..testing_utils import assert_no_logs, render_pages @assert_no_logs def test_block_widths(): page, = render_pages(''' <style> ...
Kozea/WeasyPrint
tests/layout/test_block.py
Python
bsd-3-clause
27,099
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('vkontakte_users', '0001_initial'), ] operations = [ migrations.AddField( model_name='user', name='in...
Andertaker/django-vkontakte-users
vkontakte_users/migrations/0002_auto_20160213_0238.py
Python
bsd-3-clause
4,586
# Copyright 2007-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 import time from portage import os from portage.versions import best, catsplit, vercmp from portage.dep import Atom from portage.localization import _ from portage._sets.base import PackageSet from portage._sets...
devurandom/portage
pym/portage/_sets/dbapi.py
Python
gpl-2.0
14,306
#!/usr/bin/python # Copyright (C) 2008. Jurko Gospodnetic # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) # Tests for the Boost Jam builtin SORT rule. import BoostBuild #############################...
flingone/frameworks_base_cmds_remoted
libs/boost/tools/build/test/sort_rule.py
Python
apache-2.0
2,589
#!/usr/bin/env python # -*- coding: utf-8 -*- from base import PostgreSQL PostgreSQL.dump_sql = True PostgreSQL.perform( 'INSERT INTO person VALUES (%s, %s)', params = [ ('dara', 'Dara Torres'), ('eden', 'Eden Tseng'), ] ) PostgreSQL.perform("DELETE FROM person WHERE person_id = 'dara'")...
uranusjr/mosql
archived/examples/postgresql/perform.py
Python
mit
459
# -*- coding: utf-8 -*- # Author: Florian Mayer <florian.mayer@bitsrc.org> #pylint: disable=W0613 from __future__ import absolute_import import pytest from sunpy.net import vso from sunpy.net.vso import attrs as va from sunpy.net import attr from sunpy.util.unit_conversion import energy, frequency def pytest_func...
mjm159/sunpy
sunpy/tests/net/test_vso.py
Python
bsd-2-clause
3,984
#!/usr/bin/env python from __future__ import unicode_literals import os import sys scripts_dir = os.path.abspath(os.path.dirname(__file__)) # Source root directory sys.path.insert(0, os.path.abspath(os.path.join(scripts_dir, '..', '..'))) # Script config directory sys.path.insert(0, os.path.join(scripts_dir, 'conf...
1tush/reviewboard
contrib/internal/build-media.py
Python
mit
728
#!/usr/bin/env python from urllib.parse import urlsplit, urlunsplit from urllib.parse import urlencode from wsgiref.util import request_uri from .query import Query class URI(object): def __init__(self, uri='', scheme='', host='', path=None, query=None, anchor=''): self.scheme, self.hos...
orbnauticus/silk
silk/webreq/uri.py
Python
bsd-3-clause
1,341
from django.db import models class Episode(models.Model): name = models.CharField(max_length=255) number = models.IntegerField() def __str__(self): return '{}: {}'.format(self.number, self.name) class Meta(object): ordering = ['number'] class Starship(models.Model): name = mode...
melinath/django-graph-api
test_app/models.py
Python
mit
965
"""This module provides instrumentation for Celery. Has been tested on Celery versions 2.2.X through 2.5.X. Note that Celery has a habit of moving things around in code base or of completely rewriting stuff across minor versions. See additional notes about this below. """ import functools from newrelic.api.applicat...
galaxy-team/website
newrelic/hooks/application_celery.py
Python
agpl-3.0
3,425
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsField. .. note:: This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. """ __author...
carolinux/QGIS
tests/src/python/test_qgsfield.py
Python
gpl-2.0
2,527
# # This file is part of CasADi. # # CasADi -- A symbolic framework for dynamic optimization. # Copyright (C) 2010-2014 Joel Andersson, Joris Gillis, Moritz Diehl, # K.U. Leuven. All rights reserved. # Copyright (C) 2011-2014 Greg Horn # # CasADi is free software; you can...
ghorn/debian-casadi
docs/api/examples/algebra/LinearSolver.py
Python
lgpl-3.0
2,711
import argparse from datetime import datetime def Parser(): the_parser = argparse.ArgumentParser() the_parser.add_argument( '--input', action="store", type=str, help="input miRBase GFF3 file") the_parser.add_argument( '--output', action="store", type=str, help="output GFF3 file wit...
drosofff/tools-artbio
tools/mircounts/mature_mir_gff_translation.py
Python
mit
5,174
from django.db import migrations from django.db.backends.postgresql.schema import DatabaseSchemaEditor from django.db.migrations.state import StateApps def backfill_user_deleted_logs(apps: StateApps, schema_editor: DatabaseSchemaEditor) -> None: RealmAuditLog = apps.get_model("zerver", "RealmAuditLog") RealmA...
zulip/zulip
zerver/migrations/0374_backfill_user_delete_realmauditlog.py
Python
apache-2.0
1,626
#!/usr/bin/env python # -*- coding: utf-8 -*- import click from PIL import Image, ImageChops from utils.misc import get_file_list, validate_color @click.command() @click.argument('path', type=click.Path(exists=True)) @click.argument('color', callback=validate_color) def tint(path, color): for f in get_file_list(...
vladimirgamalian/pictools
tint.py
Python
mit
490
# ----------------------------------------------------------------------------- # Copyright (c) 2014--, The Qiita Development Team. # # Distributed under the terms of the BSD 3-clause License. # # The full license is in the file LICENSE, distributed with this software. # ------------------------------------------------...
josenavas/QiiTa
qiita_db/metadata_template/util.py
Python
bsd-3-clause
14,704
# =============================================================================== # Copyright 2014 Jake Ross # # 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...
NMGRL/ararpy
setup.py
Python
apache-2.0
1,397
# coding=utf-8 # Copyright (c) Facebook, Inc. and its affiliates. # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. from __future__ import absolute_import from testutil.dott import feature, sh, testtmp # noqa: F401 ( sh % "...
facebookexperimental/eden
eden/hg-server/tests/test-fb-hgext-tweakdefaults-update-t.py
Python
gpl-2.0
2,375
# Servo Control import time delay_period = 0.01 def set(property, value): try: f = open("/sys/class/rpi-pwm/pwm0/" + property, 'w') f.write(value) f.close() except: print("Error writing to: " + property + " value: " + value) def set_servo(angle): set("servo...
erikulven/flapmagick
servo.py
Python
bsd-2-clause
632
from django.contrib import messages from django.contrib.auth.decorators import login_required from django.contrib.contenttypes.models import ContentType from django.http import HttpResponseRedirect, Http404, HttpResponse from django.shortcuts import render, get_object_or_404 from .forms import CommentForm from .model...
rohitkyadav/blog-api
src/comments/views.py
Python
mit
2,962
from tinymce.widgets import TinyMCE from Nahuatilli import settings class CustomTinyMCEWidget(TinyMCE): def __init__(self, content_language=None, attrs=None, mce_attrs={}): # here we add some configuration on the fly # as you can see our button is called mybutton #buttons_str = 'daybu...
acuriel/nahuatilli
contracts/widgets.py
Python
gpl-3.0
1,321
''' Created by auto_sdk on 2015.06.23 ''' from aliyun.api.base import RestApi class Rkvstore20150101FlushInstanceRequest(RestApi): def __init__(self,domain='r-kvstore.aliyuncs.com',port=80): RestApi.__init__(self,domain, port) self.InstanceId = None def getapiname(self): return 'r-kvstore.aliyuncs.com.FlushIns...
francisar/rds_manager
aliyun/api/rest/Rkvstore20150101FlushInstanceRequest.py
Python
mit
338
from ethereum import tester from datetime import datetime, date import math import pytest slow = pytest.mark.slow from utilRelay import dblSha256Flip, disablePyethLogging disablePyethLogging() class TestBtcSpecialTx(object): CONTRACT = 'example-btc-eth/btcSpecialTx.se' CONTRACT_GAS = 55000 ETHER = 10...
ethereum/btcrelay
example-btc-eth/test/test_btcSpecialTx.py
Python
mit
2,850
# Copyright 2015 Hewlett-Packard Development Company, L.P.dsvsv # Copyright 2015 OpenStack Foundation # All Rights Reserved. # # 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 # # ...
pnavarro/neutron
neutron/tests/api/admin/test_shared_network_extension.py
Python
apache-2.0
4,322
# # 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 us...
rangadi/incubator-beam
sdks/python/apache_beam/runners/dataflow/dataflow_metrics_test.py
Python
apache-2.0
10,106
# encoding: utf-8 from __future__ import absolute_import, division, print_function, unicode_literals from types import GeneratorType, ModuleType from django.core.urlresolvers import reverse from django.test import TestCase from haystack.utils import app_loading class AppLoadingTests(TestCase): def test_load_ap...
fisle/django-haystack
test_haystack/test_app_loading.py
Python
bsd-3-clause
2,358
#!/usr/bin/env python3 import sys import os import functools from xml.sax.saxutils import escape import xml.etree.ElementTree as ET # on msys, use crlf output nl = None if sys.platform == 'msys': nl = "\r\n" if len(sys.argv) <= 1: print('Usage: python3 {} filename.ui [filename2.ui ...]'.format(sys.argv[0])) ...
Zorro666/renderdoc
qrenderdoc/sort_qt_ui.py
Python
mit
2,505
# Required imports to run this file import matplotlib.pyplot as plt import numpy as np # weighted matrix def weighted_matrix(point: np.mat, training_data_x: np.mat, bandwidth: float) -> np.mat: """ Calculate the weight for every point in the data set. It takes training_point , query_point, and tau Her...
TheAlgorithms/Python
machine_learning/local_weighted_learning/local_weighted_learning.py
Python
mit
4,446
"""add max_nb_crowfly_by_mode, this parameter is used by distributed scenario Revision ID: 483639f1f00 Revises: 4cd2ff722a7c Create Date: 2018-08-21 11:48:08.941764 """ # revision identifiers, used by Alembic. revision = '483639f1f00' down_revision = '4cd2ff722a7c' from alembic import op import sqlalchemy as sa de...
kinnou02/navitia
source/tyr/migrations/versions/483639f1f00_add_max_nb_crowfly_by_mode.py
Python
agpl-3.0
537
"""Configuration for imitation.scripts.train_adversarial.""" import os import sacred from imitation.policies import base from imitation.scripts.config.common import DEFAULT_INIT_RL_KWARGS from imitation.util import util train_adversarial_ex = sacred.Experiment("train_adversarial", interactive=True) @train_adversa...
humancompatibleai/imitation
src/imitation/scripts/config/train_adversarial.py
Python
mit
7,627
import numpy as np import reaclib ihe4 = 0 ic12 = 1 nnuc = 2 A = np.zeros((nnuc), dtype=np.int32) A[ihe4] = 4 A[ic12] = 12 def c12_gaa_he4(tf): # c12 --> he4 + he4 + he4 rate = 0.0 # fy05rv rate += np.exp( 34.9561 + -85.4472*tf.T9i + -23.57*tf.T913i + 20.4886*tf.T913 + -12.98...
zingale/pyreaclib
test/standard/triple-alpha/triple-alpha_rhs.py
Python
bsd-3-clause
1,755
__version__ = "2.4.2"
explosion/srsly
srsly/about.py
Python
mit
22
# Time: O(n) # Space: O(10) = O(1) # You are playing the following Bulls and Cows game with your friend: # You write a 4-digit secret number and ask your friend to guess it, # each time your friend guesses a number, you give a hint, the hint # tells your friend how many digits are in the correct positions # (called "...
kamyu104/LeetCode
Python/bulls-and-cows.py
Python
mit
2,461
from serverdensity.wrapper.jsonobject import JsonObject class ServiceStatus(JsonObject): PATHS = { 'overall': '/service-monitor/meta/{}', 'location': '/service-monitor/last/{}' } def _validation(self, data): """Service Status has no post endpoints and need no validation""" ...
serverdensity/sd-python-wrapper
serverdensity/wrapper/service_status.py
Python
mit
636
# Copyright 2008 Divmod, Inc. See LICENSE file for details """ Tests for L{xmantissa.people}. """ from __future__ import division import warnings from string import lowercase from twisted.python.reflect import qual from twisted.python.filepath import FilePath from twisted.trial import unittest from formless impor...
twisted/mantissa
xmantissa/test/test_people.py
Python
mit
124,903
#!/usr/bin/env python # This file is part of VoltDB. # Copyright (C) 2008-2017 VoltDB Inc. # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitati...
deerwalk/voltdb
tests/sqlcoverage/SQLCoverageReport.py
Python
agpl-3.0
22,887
# Copyright 2013 NEC Corporation # All Rights Reserved. # # 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 ...
cloudbase/lis-tempest
tempest/api/compute/admin/test_simple_tenant_usage_negative.py
Python
apache-2.0
2,648
# # 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...
mistercrunch/airflow
tests/www/views/test_views_decorators.py
Python
apache-2.0
6,746
""" All function in this module take and return :class:`bytes` """ import sys from os import urandom as random_bytes from struct import pack from base64 import b64decode from Cryptodome.Hash import MD5, SHA1, HMAC from Cryptodome.PublicKey.RSA import import_key as rsa_import_key, construct as rsa_construct from Crypto...
ValvePython/steam
steam/core/crypto.py
Python
mit
3,356
#!/usr/bin/env python # # Test cases for tournament.py from tournament import * def testCount(): """ Test for initial player count, player count after 1 and 2 players registered, player count after players deleted. """ deleteMatches() deletePlayers() c = countPlayers...
ClareMorganRiddell/tournament
Vagrant/tournament_test.py
Python
mit
6,297
# xmlpage.py # Author: Richard Gibson # # Renders a page generated from an xml file. Currently renders /faq and /blog # import handler import urllib2 import xml.etree.cElementTree as et class XmlPage( handler.Handler ): def get( self ): user = self.get_user( ) if user == self.OVER_QUOTA_ERROR: ...
rggibson/pb-tracker
xmlpage.py
Python
mit
1,387
# -*- encoding: utf-8 -*- """Test class for UI functions against an isolated capsule""" from robottelo.decorators import stubbed, tier3 from robottelo.test import UITestCase class CapsuleTestCase(UITestCase): """Implements capsule tests in UI""" @stubbed() @tier3 def test_positive_errata_push(self):...
tkolhar/robottelo
tests/foreman/ui/test_capsule.py
Python
gpl-3.0
2,464
# Copyright (C) 2016 Fan Long, Martin Rianrd and MIT CSAIL # Prophet # # This file is part of Prophet. # # Prophet 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 y...
jyi/ITSP
prophet-gpl/tools/wireshark-rev-test.py
Python
mit
3,381
import datetime import json import random import string class RedisApiException(Exception): def __init__(self, message, status_code, *args, **kwargs): super(RedisApiException, self).__init__(message) self.status_code = status_code class DateTimeJSONEncoder(json.JSONEncoder): def default(sel...
voidfiles/lark
lark/ext/utils.py
Python
mit
800
#!/usr/bin/python from __future__ import print_function #------------------------------------------------------------# # This is the RCache class, used to cache the results of the # # get_contents() method from the Entry class. # #------------------------------------------------------------# class RC...
djordje-kasagic/LHS-algorithm
cache.py
Python
mit
864
#!/usr/bin/env python2.6 import lxml.html, re, HTMLParser class InvalidArguments(Exception): pass class MetaHeaders: def __init__(self, url=None, page=None,name='name',content='content', unescape_entities=False): if page: self.root = lxml.html.document_fromstring(page) elif url: self.root = lxml.html.pa...
OAButton/tricorder
plugins/python/metaheaders.py
Python
bsd-3-clause
2,791
import os from subprocess import check_call from kernel.cli import main user_config = "examples/user.config" dist_config = "examples/dist.config" trim_config = "examples/trim.config" comb_config = "examples/comb.config" diff_dir = "examples/diff" out_trim_config = "tmp/trim.config" out_comb_config = "tmp/comb.config...
crossdistro/kernel-tools
tests/testuserconfig.py
Python
bsd-2-clause
912
from eventlet import patcher from eventlet.green import asyncore from eventlet.green import select from eventlet.green import socket from eventlet.green import threading from eventlet.green import time patcher.inject("test.test_asyncore", globals()) def new_closeall_check(self, usedefault): # Check that close_all...
simplegeo/eventlet
tests/stdlib/test_asyncore.py
Python
mit
1,543
#! /usr/bin/env python3 # -*- coding: utf-8 -*- def addroot(): import sys import os.path print("__file__=", __file__) rootdir = os.path.abspath(os.path.join( os.path.split(__file__)[0], '..', '..', '..')) sys.path.append(rootdir) print('%s added to PATH' % rootdir) if __name__ == "__...
rboman/progs
apps/fractal/olc/build.py
Python
apache-2.0
400
# vim:set et ts=4 sw=4 ai ft=python: # pylint: disable=superfluous-parens """ One Time JWT Simple mechanism for cross service authorization. Usage: Client side: import onetimejwt jwt = onetimejwt.generate('shared secret', 60) # shared secret, 60 second age headers = { "Authorization": "Bearer...
srevenant/onetimejwt
onetimejwt/__init__.py
Python
agpl-3.0
4,972
import sys import time import logging from scripts import utils as script_utils from website.app import setup_django from website.identifiers.utils import request_identifiers_from_ezid, parse_identifiers setup_django() logger = logging.getLogger(__name__) def main(dry=True): from osf.models import PreprintServi...
chrisseto/osf.io
scripts/add_identifiers_to_existing_preprints.py
Python
apache-2.0
2,141
#!/usr/bin/env python3.2 """ ======== OVERVIEW ======== The script compares two gff3 file at base, exon/CDS and gene level and outputs the positive predictive value(PPV) and sensitivity(SN). The first input will be treated as a known gff3 file and second as the predicted gff3 file. The PPV/SN in the output will be f...
zctea/biocode
sandbox/priti.aries88/structural_comparison_gff3.py
Python
gpl-3.0
24,536
from __future__ import absolute_import from dbm import * from ..version_info import PY2 if PY2: from . import dumb, gnu, ndbm from whichdb import * from anydbm import *
EnTeQuAk/dotfiles
sublime-text-3/Packages/isort/pies/dbm/__init__.py
Python
unlicense
184
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import unicode_literals """This file is part of the django ERP project. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ...
mobb-io/django-erp
djangoerp/core/tests/__init__.py
Python
mit
2,133
#!/usr/bin/env python # -*- encoding: UTF8 -*- # author: Philipp Klaus, philipp.klaus →AT→ gmail.com # author: InterNetworX, info →AT→ inwx.de # This file is part of python-inwx-xmlrpc. # # python-inwx-xmlrpc is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public Licens...
pklaus/python-inwx-xmlrpc
inwx.py
Python
gpl-3.0
7,335
from ..metrics import mse, logloss, mae, hinge, binary_crossentropy categorical_crossentropy = logloss def get_loss(name): """Returns loss function by the name.""" try: return globals()[name] except: raise ValueError('Invalid metric function.')
zhuhuifeng/PyML
mla/neuralnet/loss.py
Python
apache-2.0
277
#!/usr/bin/env python import sys usage = """ indent.py <filename> Indent the given JS file to show the structure of context save/restore instances. """ if __name__ == "__main__": args = sys.argv[1:] if len(args) < 1: print usage sys.exit(1) filename = args[0] level = 0 def print_line(line): print ("...
shaunlebron/PterodactylAttack
project/swf/pteros/baby/indent.py
Python
gpl-3.0
604
# 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, software # d...
noironetworks/group-based-policy
gbpservice/neutron/extensions/apic_reuse_bd.py
Python
apache-2.0
1,646
from __future__ import absolute_import from agms.response.response import Response from agms.exception.response_exception import ResponseException class HPPResponse(Response): """ A class representing AGMS HPP Response objects. """ def __init__(self, response, op): self._response = {} ...
agmscode/agms_python
agms/response/hpp_response.py
Python
mit
1,194
# Run this in Python 3.3 for the unicode to work correctly codec = 'utf-8' fp = open('HebrewReference.csv','wb') fp.write(codec.encode(codec)+b'\n') #fp.write(csv([codec], 'codec')) def csv(values=[], prefix=''): if prefix: prefix += ',' prefix += ','.join(values)+'\n' return prefix.e...
jimaples/Moreh
hebrew_quiz/code/GenerateUnicode.py
Python
mit
2,916
import subprocess, shutil, glob # uninstall and clean whls = glob.glob('dist/no_you_talk_to_the_hand-*-py2-none-any.whl') for whl in whls: subprocess.call('pip uninstall {}'.format(whl), shell=True) shutil.rmtree('dist') # build and install subprocess.call('python setup.py build', shell=True) subprocess.call('pyt...
flashashen/no-YOU-talk-to-the-hand
rebuild_and_install.py
Python
mit
488
# Value interface from abc import ABCMeta, abstractmethod class Value(object): """A value represents an item in either a denotation (gold or predicted)""" __metaclass__ = ABCMeta @abstractmethod def match(self, other): """Return True if the value matches the other value based on the o...
kelvinguu/lang2program
strongsup/value.py
Python
apache-2.0
1,474
#!/usr/bin/env python # -*- coding: utf-8 -*- # The MIT License # # Copyright 2012 Sony Mobile Communications. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without ...
benjiii/pygerrit
unittests.py
Python
mit
22,115
#!/usr/bin/env python # # Copyright 2010 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 o...
ltilve/ChromiumGStreamerBackend
tools/telemetry/third_party/gsutilz/third_party/protorpc/demos/quotas/backend/quotas/services.py
Python
bsd-3-clause
14,871
""" Graphical user interface functionalities for the SampleResource Aggregate Manager. @date: Jun 12, 2013 @author: CarolinaFernandez """ from django.core.exceptions import ValidationError from django.core.urlresolvers import reverse from django.http import HttpResponseRedirect, HttpResponse from django.shortcuts imp...
dana-i2cat/felix
expedient/doc/plugins/samples/plugin/sample_resource/controller/GUIdispatcher.py
Python
apache-2.0
7,485
############################################################################## # Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
skosukhin/spack
var/spack/repos/builtin/packages/osu-micro-benchmarks/package.py
Python
lgpl-2.1
2,532