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 |
|---|---|---|---|---|---|
'''
This case test 2nic qos together with nic qos
@author: quarkonics
'''
import os
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_lib as test_lib
import zstackwoodpecker.test_state as test_state
import zstackwoodpecker.operations.host_operations as host_ops
import zstackwoodpecker... | zstackio/zstack-woodpecker | integrationtest/vm/virt_plus/qos/test_set_outbound_qos2.py | Python | apache-2.0 | 3,480 |
from __future__ import unicode_literals
from django import forms
from django.forms.util import flatatt
from django.template import loader
from django.utils.datastructures import SortedDict
from django.utils.html import format_html, format_html_join
from django.utils.http import urlsafe_base64_encode
from django.utils.... | luxnovalabs/enjigo_door | web_interface/django/contrib/auth/forms.py | Python | unlicense | 14,426 |
# Copyright 2011 Eldar Nugaev
# 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 ... | jeffrey4l/nova | nova/tests/unit/api/openstack/compute/contrib/test_keypairs.py | Python | apache-2.0 | 15,773 |
# Copyright (C) 2007, Eduardo Silva <edsiper@gmail.com>
# Copyright (C) 2008, One Laptop Per Child
# Copyright (C) 2009, Tomeu Vizoso
# Copyright (C) 2011, Benjamin Berg <benjamin@sipsolutions.net>
# Copyright (C) 2011, Marco Pesenti Gritti <marco@marcopg.org>
#
# This library is free software; you can redistribute it ... | quozl/sugar-toolkit-gtk3 | src/sugar3/graphics/palette.py | Python | lgpl-2.1 | 16,404 |
# -*- coding: utf-8 -*-
# Copyright(C) 2012 Florent Fourcot
#
# This file is part of weboob.
#
# weboob is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your op... | franek/weboob | modules/freemobile/backend.py | Python | agpl-3.0 | 3,516 |
# Copyright 2020 Makani Technologies 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... | google/makani | avionics/bootloader/system_config_test.py | Python | apache-2.0 | 1,727 |
# -*- coding: utf-8 -*-
# $Id$
# pylint: disable=C0302
"""
VirtualBox Wrapper Classes
"""
__copyright__ = \
"""
Copyright (C) 2010-2014 Oracle Corporation
This file is part of VirtualBox Open Source Edition (OSE), as
available from http://www.virtualbox.org. This file is free software;
you can redistribute it and/or... | Chilledheart/vbox | src/VBox/ValidationKit/testdriver/vboxwrappers.py | Python | gpl-2.0 | 104,856 |
#!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | yongshengwang/builthue | apps/hbase/src/hbase/management/commands/hbase_setup.py | Python | apache-2.0 | 3,274 |
# -*- coding: utf-8 -*-
import os
import json
import re
try:
from xmlrpclib import Fault, ProtocolError
except ImportError: # Python 3
from xmlrpc.client import Fault, ProtocolError
from channelarchiver import codes, utils
tests_dir = os.path.dirname(os.path.realpath(__file__))
data_dir = os.path.join(tests... | tacaswell/channelarchiver | tests/mock_archiver.py | Python | mit | 5,534 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.6 on 2017-03-10 19:38
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('goals', '0001_initial'),
... | triump0870/mysana | src/goals/migrations/0002_auto_20170310_1938.py | Python | mit | 560 |
from twisted.trial import unittest
from twisted.words.xish import domish
from cserialize import serialize
def error(expected, got):
if type(expected) == list:
expected = u",".join(expected)
return u"Got wrong serialization: %s (expected: %s)" % (got, expected)
class SerializeTestCase(unittest.TestCa... | metajack/cserialize | test_serialize.py | Python | mit | 7,679 |
#####################################################################
# errocde.py
#
# (c) Copyright 2021, Benjamin Parzella. All rights reserved.
#
# This library 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 Fo... | bparzella/secsgem | secsgem/secs/data_items/errcode.py | Python | lgpl-2.1 | 4,961 |
import scipy.io
from sklearn.metrics import accuracy_score
from sklearn import cross_validation
from sklearn import svm
from skfeature.function.information_theoretical_based import CMIM
def main():
# load data
mat = scipy.io.loadmat('../data/colon.mat')
X = mat['X'] # data
X = X.astype(float)
y... | jundongl/scikit-feast | skfeature/example/test_CMIM.py | Python | gpl-2.0 | 1,485 |
import os
import sys
import argparse
import ConfigParser
import testcase_service
from bantorra.util import define
from bantorra.util.log import LOG as L
class TestCase_Base(testcase_service.TestCaseUnit):
config = {}
"""
TestCase_Base.
- Parse Command Line Argument.
- Create Se... | TE-ToshiakiTanaka/bantorra.old | script/testcase_base.py | Python | mit | 1,751 |
# encoding: 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 field 'ConditionalOffer.max_user_applications'
db.add_column('offer_conditionaloffer', 'max_user_... | jinnykoo/wuyisj | src/oscar/apps/offer/south_migrations/0010_auto__add_field_conditionaloffer_max_user_applications.py | Python | bsd-3-clause | 15,481 |
# Copyright 2016 The TensorFlow Authors. 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 applica... | allenlavoie/tensorflow | tensorflow/python/keras/_impl/keras/testing_utils.py | Python | apache-2.0 | 7,131 |
# Copyright 2014 Alcatel-Lucent Enterprise.
#
# 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 a... | openstack/networking-ale-omniswitch | networking_ale_omniswitch/omniswitch_mechanism_driver.py | Python | apache-2.0 | 5,419 |
import time
start = time.time()
numOfWays = [1]+[0]*100
for i in range(1,100):
for j in range(i, 101):
numOfWays[j] += numOfWays[j-i]
print numOfWays[100]
print "Run Time = " + str(time.time() - start)
| HCDevelopers/ProjectEuler-Solutions | python-Solutions/CountingSummations.py | Python | lgpl-3.0 | 208 |
#!/usr/bin/env python
# deals with uploading grbl to arduino
# placed in a separate script to secondboot.py because I couldn't figure out how to CD into
# the right directory within python, so instead I'll do the "cd'ing" in rc.local, and call standalone script***
#*** EDIT: apparently passing cwd="directory" as an ar... | mn1del/rpi_cnc_img | secondboot_arduino.py | Python | gpl-3.0 | 1,627 |
from datetime import date, timedelta
from random import randint
from django.utils import timezone
from rest_framework.test import APITestCase
from example.factories import CommentFactory, EntryFactory
from example.models import Author, Blog, Comment, Entry, LabResults, ResearchProject
class PerformanceTestCase(APIT... | django-json-api/rest_framework_ember | example/tests/test_performance.py | Python | bsd-2-clause | 4,273 |
#!/usr/bin/env python
# coding:utf-8
"""
Copyright (c) 2017 BugScan (http://www.bugscan.net)
See the file 'LICENCE' for copying permission
"""
import copy
import types
class AttribDict(dict):
"""
>>> foo = AttribDict()
>>> foo.bar = 1
>>> foo.bar
1
"""
def __init__(self, indict=None, a... | BugScanTeam/GitHack | lib/attrdict.py | Python | gpl-3.0 | 1,960 |
#! /usr/bin/env python
# -*- coding: UTF8 -*-
# Este arquivo é parte do programa Activlets
# Copyright 2013-2015 Carlo Oliveira <carlo@nce.ufrj.br>,
# `Labase <http://labase.selfip.org/>`__; `GPL <http://is.gd/3Udt>`__.
#
# Activlets é um software livre; você pode redistribuí-lo e/ou
# modificá-lo dentro dos termos da ... | labase/activlets | src/aktask/__init__.py | Python | gpl-2.0 | 956 |
#!/usr/bin/python2.7
# -*- coding: utf-8 -*-
from django.conf import settings
from django.core.cache import cache
from django.shortcuts import render_to_response, redirect
from django.template import RequestContext
from django.views.decorators.csrf import csrf_exempt
from hits.models import ResourceView
import strip... | dhcrain/pokeapi | config/views.py | Python | bsd-3-clause | 2,083 |
from django.contrib import admin
import profiles.models as models
admin.site.register(models.Employee)
| jantoniomartin/django-machinery | profiles/admin.py | Python | agpl-3.0 | 105 |
#!/usr/bin/env python3
# SPDX-License-Identifier: LGPL-2.1-or-later
import pexpect
import re
import sys
def run() -> None:
p = pexpect.spawnu(" ".join(sys.argv[1:]), logfile=sys.stdout, timeout=300)
# distro-independent root prompt
p.expect(re.compile("~[^#]{0,3}#"))
p.sendline("systemctl poweroff")... | mxre/systemd | .github/workflows/test_mkosi_boot.py | Python | gpl-2.0 | 492 |
# Copyright (c) 2003-2012 CORE Security Technologies
#
# This software is provided under under a slightly modified version
# of the Apache Software License. See the accompanying LICENSE file
# for more information.
#
# $Id: ICMP6.py 1142 2014-02-17 17:56:43Z bethus@gmail.com $
#
from ImpactPacket import Header, Data... | prasadtalasila/INET-Vagrant-Demos | Nonce_Demo/impacket-0.9.12/impacket/ICMP6.py | Python | gpl-2.0 | 19,595 |
# 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/purchase_plan.py | Python | mit | 1,301 |
# Copyright (C) 2010-2014 CEA/DEN, EDF R&D
#
# This library 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 2.1 of the License, or (at your option) any later version.
#
# This library ... | FedoraScientific/salome-paravis | test/VisuPrs/ImportMedField/A3.py | Python | lgpl-2.1 | 1,357 |
from unittest import TestCase, main
import tempfile
import os
from ccytsk.core.validation.file_data_validation import FilesDataValidationTaskConfig, FilesDataValidationTask
from ccytsk.core.validation.set_validator import SetValidator
from ccytsk.core.validation.validators import Validators
class TestFileDataValidat... | Cocuyo-Labs-Team/ccytsk | test/test_data_file_validation.py | Python | bsd-3-clause | 1,361 |
# -*- coding: utf-8 -*-
#
# Graphs.jl documentation build configuration file, created by
# sphinx-quickstart on Sat Apr 20 11:20:03 2013.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# A... | tkonolige/Graphs.jl | doc/source/conf.py | Python | mit | 7,815 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file '/home/marcello/Documenti/sacks/sacksSvnUser/interface/mainwindow.ui'
#
# Created: Sat Mar 6 13:06:39 2010
# by: PyQt5 UI code generator 4.4.4
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, Qt... | M0Rf30/sacks | interface/Ui_mainwindow.py | Python | gpl-3.0 | 19,192 |
# -*- coding: utf-8 -*-
#
# This file is part of EUDAT B2Share.
# Copyright (C) 2017 CERN.
#
# B2Share 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... | emanueldima/b2share | tests/b2share_unit_tests/deposit/test_deposit_versions_api.py | Python | gpl-2.0 | 10,235 |
from .abstract_adaptation_set import AbstractAdaptationSet
class AudioAdaptationSet(AbstractAdaptationSet):
def __init__(self, lang, id_=None, custom_data=None):
super().__init__(id_=id_, custom_data=custom_data)
self.lang = lang
@classmethod
def parse_from_json_object(cls, json_object):... | bitmovin/bitmovin-python | bitmovin/resources/models/manifests/dash/audio_adaptation_set.py | Python | unlicense | 663 |
from django.conf import settings
from django.core.mail.backends.base import BaseEmailBackend
import threading
import os
import time
NULLMAILER_SPOOLDIR = getattr(settings, 'NULLMAILER_SPOOLDIR', '/var/spool/nullmailer')
__nullmailer_threads_dict__ = {}
def to_utf8(addr):
# RFC 6531 says that unicode email addres... | 20tab/django-nullmailer | nullmailer/backend.py | Python | mit | 2,866 |
class CumulusCIException(Exception):
pass
class NotInProject(CumulusCIException):
""" Raised when no project can be found in the current context """
pass
class ProjectConfigNotFound(CumulusCIException):
""" Raised when a project is found in the current context but no configuration was found for the pr... | Joble/CumulusCI | cumulusci/core/exceptions.py | Python | bsd-3-clause | 3,650 |
#!/usr/bin/env python
import os, os.path
from distutils.core import setup, Extension
from numpy.distutils.misc_util import get_numpy_include_dirs
from os.path import getctime
import distutils.sysconfig
config = distutils.sysconfig.get_config_vars()
# OPT=-DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes
# CFLAGS
for ... | tmbdev/clstm | setup.py | Python | apache-2.0 | 2,076 |
# (Place your name here in a comment)
# Assignment 5: NDVI
# Note: NDVI = (IR - R)/(IR + R)
# Geodatabase available on Dropbox at https://www.dropbox.com/s/lo91vpjlh7c0a5i/Assignment5.gdb.zip
import arcpy
def getBands():
"""Returns a tuple of two single band rasters, a red band and an infrared band."""
bands ... | WUSTL-GIS-Programming-spring-2014/classinfo | Assignments/Assignment5.py | Python | unlicense | 2,174 |
from __future__ import print_function
import sys
sys.path.insert(1,"../../../")
import h2o
from tests import pyunit_utils
from h2o.utils.typechecks import assert_is_type
from h2o.frame import H2OFrame
def h2o_H2OFrame_na_omit():
"""
Python API test: h2o.frame.H2OFrame.na_omit()
Copied from runit_lstrip.R
... | spennihana/h2o-3 | h2o-py/tests/testdir_apis/Data_Manipulation/pyunit_h2oH2OFrame_na_omit.py | Python | apache-2.0 | 718 |
from flask import Flask
import models
app = Flask(__name__)
app.config['DEBUG'] = True
#use error payloads
#http://blog.mwaysolutions.com/2014/06/05/10-best-practices-for-better-restful-api/
@app.route('/v1/tasks',methods=['POST','GET','PUT'])
def tasks():
pass #returns all tasks for the current permissions or crea... | Diddit/diddit | backend/api.py | Python | gpl-2.0 | 789 |
"""
This module provides an abstraction for working with XModuleDescriptors
that are stored in a database an accessible using their Location as an identifier
"""
import logging
import re
from collections import namedtuple
from .exceptions import InvalidLocationError, InsufficientSpecificationError
from xmodule.error... | wwj718/edx-video | common/lib/xmodule/xmodule/modulestore/__init__.py | Python | agpl-3.0 | 16,673 |
# Plotting routines in Python
# requires data from Assemble_Data.py
# Copyright (C) 2017 Kevin Maher
# 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... | Vettejeep/Boulder_County_Home_Prices | plots.py | Python | gpl-3.0 | 5,261 |
# 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-compute/azure/mgmt/compute/v2016_03_30/operations/virtual_machine_scale_set_vms_operations.py | Python | mit | 43,251 |
#!python
# Copyright 2012 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... | wangming28/syzygy | syzygy/scripts/test_bot/PRESUBMIT.py | Python | apache-2.0 | 1,582 |
def slidingMaximum(A, B):
from collections import deque
window = deque()
result = list()
if not A or B <= 1:
return A
for i in xrange(B):
while window and A[window[-1]] <= A[i]:
window.pop()
window.append(i)
for j in xrange(i+1, len(A)):
print window, ... | purushothamc/myibitsolutions | stacks_queus/sliding_window_maximum.py | Python | gpl-3.0 | 670 |
# -*- coding: utf-8 -*-
import os
os_env = os.environ
class Config(object):
SECRET_KEY = os_env.get('TRANSLATORSDESK_SECRET', 'secret-key') # TODO: Change me
APP_DIR = os.path.abspath(os.path.dirname(__file__)) # This directory
PROJECT_ROOT = os.path.abspath(os.path.join(APP_DIR, os.pardir))
BCRYPT_... | mrinaldhar/TranslatorsDesk | translatorsdesk/settings.py | Python | bsd-3-clause | 1,498 |
#!/usr/bin/env python
#
# $Id: _psposix.py 1409 2012-07-04 08:21:06Z g.rodola $
#
# Copyright (c) 2009, Jay Loden, Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Routines common to all posix systems."""
import os
import ... | ktan2020/legacy-automation | win/Lib/site-packages/psutil/_psposix.py | Python | mit | 3,816 |
# 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... | apache/nuvem | nuvem-parallel/nuvem/min_.py | Python | apache-2.0 | 847 |
#!/usr/bin/env python
# encoding: utf-8
#
# Copyright (c) 2009 Doug Hellmann All rights reserved.
#
"""
"""
#end_pymotw_header
import sys
print 'Smallest difference (epsilon):', sys.float_info.epsilon
print
print 'Digits (dig) :', sys.float_info.dig
print 'Mantissa digits (mant_dig):', sys.float_info.man... | qilicun/python | python2/PyMOTW-1.132/PyMOTW/sys/sys_float_info.py | Python | gpl-3.0 | 867 |
# This file is part of ArcJail.
#
# ArcJail 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.
#
# ArcJail is distributed in the hope that... | KirillMysnik/ArcJail | srcds/addons/source-python/plugins/arcjail/modules/shop/online_rewards.py | Python | gpl-3.0 | 1,967 |
#!/usr/bin/env python
# Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/
#
# 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 limitation the ri... | sorenh/cc | vendor/boto/boto/tests/test_sdbconnection.py | Python | apache-2.0 | 3,683 |
"""
Python utility package for Zernike polynomials
This utility package supplies Zernike terms and derivatives.
"""
# Python utility package for Zernike polynomials
from __future__ import absolute_import
import Obit
from six.moves import range
# $Id$
#------------------------------------------------------------------... | kernsuite-debian/obit | python/ZernikeUtil.py | Python | gpl-2.0 | 4,098 |
#! /usr/bin/env python
import fd.grounding
import sys
import os
from libatlapkt import AT_LAPKT_Planner
# MRJ: Profiler imports
#from prof import profiler_start, profiler_stop
def main( domain_file, problem_file, plan_file ) :
task = AT_LAPKT_Planner( )
fd.grounding.default( domain_file, problem_file, task )
# M... | miquelramirez/LAPKT-public | planners/anytime_lapkt/anytime_lapkt.py | Python | gpl-3.0 | 1,930 |
# Copyright 2014 NeuroData (http://neurodata.io)
#
# 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... | openconnectome/open-connectome | scripts/ingest/raju/raju_timeseries.py | Python | apache-2.0 | 3,901 |
# -*- coding: utf-8 -*-
class AutoApiMissingAdminConfig(Exception):
pass
class Message(Exception):
def __init__(self, message):
super(Message, self).__init__()
self.message = message
| fvalverd/AutoApi | auto_api/exceptions.py | Python | mit | 212 |
# Name: WL_MonteCarlo.py
#
# TFG Program Estimation of DM Halos II
#
# Description: Script requires to deal with the noise of convergence maps
#
# Returns: FITS image corresponding to the final signal-to-noise mass-density map
__author__ = "Guadalupe Canas Herrera"
__copyright__ = "Copyright (C) 2015 G. Canas Herrera"... | gcanasherrera/Weak-Lensing | WL_MonteCarloAnalizer.py | Python | gpl-3.0 | 3,277 |
# -*- coding: utf-8 -*-
# *****************************************************************************
# Marche - A server control daemon
# Copyright (c) 2015-2016 by the authors, see LICENSE
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public Licens... | dev-platypus/marche | marche/utils.py | Python | gpl-2.0 | 8,514 |
#!/usr/bin/env python
#
# test_zebra_seg6local_route.py
#
# Copyright (c) 2020 by
# LINE Corporation, Hiroki Shirokura <slank.dev@gmail.com>
#
# Permission to use, copy, modify, and/or distribute this software
# for any purpose with or without fee is hereby granted, provided
# that the above copyright notice and this ... | freerangerouting/frr | tests/topotests/zebra_seg6local_route/test_zebra_seg6local_route.py | Python | gpl-2.0 | 3,408 |
# 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.
import unittest
import random
import math
from telemetry.util import statistics
def Relax(samples, iterations=10):
"""Lloyd relaxation in 1D.
Keeps t... | patrickm/chromium.src | tools/telemetry/telemetry/util/statistics_unittest.py | Python | bsd-3-clause | 7,911 |
# coding=utf-8
# Copyright 2022 The Google Research Authors.
#
# 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 applicab... | google-research/google-research | learning_parameter_allocation/omniglot/omniglot_train.py | Python | apache-2.0 | 7,548 |
import time
import os, fnmatch
import sys
#########################################################
# 1. read all wrap-func
# 2. read all fixed-wrap-func
# 3. fake-wrap-func = wrap-func - fixed-wrap-func
#
if __name__ == '__main__':
argc = len(sys.argv)
if argc != 3:
print " Usage: ... | bamos/parsec-benchmark | pkgs/libs/uptcpip/src/scripts/analyze-freebsd-linux-types.py | Python | bsd-3-clause | 2,224 |
# -*- coding: utf-8 -*-
"""
viscount.file.models
File models
"""
from ..core import db
from ..utils import JSONSerializer
class FileType(JSONSerializer, db.Model):
__tablename__ = 'file_types'
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(255), index=True, unique=True)
description = d... | dacb/viscount | viscount/files/models.py | Python | bsd-2-clause | 1,360 |
# (C) British Crown Copyright 2010 - 2013, Met Office
#
# This file is part of Iris.
#
# Iris 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 l... | kwilliams-mo/iris | lib/iris/tests/test_pp_to_cube.py | Python | gpl-3.0 | 10,648 |
import challonge
import asyncio
from challonge import Account
from pprint import pprint as pp
import logging
import dateutil.parser
import datetime
import pytz
utc=pytz.UTC
import asyncio
from time import sleep
import random
l = logging.getLogger('abg')
l.setLevel("DEBUG")
class ABG_Challonge:
def __init__(self,... | jacobSingh/allbackgammongroup | ripper/abg/challonge.py | Python | bsd-3-clause | 7,909 |
# Copyright (c) 2006-2013 Regents of the University of Minnesota.
# For licensing terms, see the file LICENSE.
import conf
import g
import os
import sys
from item.jobsq import merge_job
from item.jobsq import merge_import_job
from item.jobsq import merge_export_job
from item.jobsq import work_item_download
from item... | lbouma/Cyclopath | pyserver/item/jobsq/merge_job_download.py | Python | apache-2.0 | 3,085 |
# -*- coding: UTF-8 -*-
#
# Copyright © 2016 Alex Forster. All rights reserved.
# This software is licensed under the 3-Clause ("New") BSD license.
# See the LICENSE file for details.
#
import sys
from setuptools import setup
requires = ''
if (4, 0) > sys.version_info >= (3, 4):
requires = '''
six<1.1... | alexforster/inparallel | setup.py | Python | bsd-3-clause | 1,918 |
#!/usr/bin/env python2
#
# $Id: //projects/empy/em.py#146 $ $Date: 2003/10/27 $
# 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 ... | tchx84/sugar | data/em.py | Python | gpl-2.0 | 116,185 |
# -*- coding: utf-8 -*-
# IDD3 - Propositional Idea Density from Dependency Trees
# Copyright (C) 2014 Andre Luiz Verucci da Cunha
#
# 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... | dmhowcroft/idd3 | idd3/rules/__init__.py | Python | gpl-3.0 | 2,969 |
#!/usr/bin/env python
# Copyright (c) 2012 Lucas Kreutz, http://lucaskreutz.com.br/
# See the file license.txt for copying permission.
"""
Encodes a file and decodes if a magic world is given
"""
import sys
import blowfish
import hashlib
class Encode:
def __init__(self, filename, key):
# The name of ... | lucaskalves/encode | encode.py | Python | mit | 2,950 |
from __future__ import division
import scene
from time import localtime
class DigitalClock(scene.LabelNode):
def __init__(self, text, *args, **kwargs):
super(DigitalClock, self).__init__(text, *args, **kwargs)
def update(self):
t = localtime()
self.text = "{:02}:{:02}:{:02}".format(
... | balachandrana/pythonista_pyglet_simulation | digital_clock.py | Python | mit | 572 |
# Copyright 2015 Altova GmbH
#
# 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 writi... | altova/sec-edgar-tools | sec_filing_to_xlsx.py | Python | apache-2.0 | 11,948 |
import json
from django.test import TestCase, Client
from authentication.models import Account
from authentication.views import LoginView
# Test Authentication models
class TestAccountModel(TestCase):
"""Testing of the Account model"""
def setUp(self):
self.user = Account.objects.create(username='foot',pas... | moonboy13/brew-journal | brew_journal/authentication/tests.py | Python | apache-2.0 | 5,506 |
# coding=utf-8
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from future import standard_library
standard_library.install_aliases()
from past.builtins import basestring
from builtins import *
from builtins import obje... | genestack/python-client | genestack_client/share_util.py | Python | mit | 10,482 |
from bs4 import BeautifulSoup
# Utility functions
from django.conf import settings
from django.http import HttpResponse, HttpResponseForbidden
from django import forms
import requests
import json
import logging
log = logging.getLogger(__name__)
from django.utils import formats
import pytz
###################... | edac-epscor/nmepscor-data-collection-form | application/builder/util/__init__.py | Python | mit | 5,532 |
import collections
import os
import unittest
from ansible.modules.identity.keycloak.keycloak_group import *
class KeycloakGroupTestCase(unittest.TestCase):
def test_create_group(self):
toCreate = {
"username":"admin",
"password":"admin",
"realm":"master",
... | Inspq/ansible | test/units/modules/identity/keycloak/test_keycloak_group.py | Python | gpl-3.0 | 7,158 |
# Generated by Django 2.2.6 on 2019-10-29 12:08
from django.conf import settings
from django.db import migrations, models
def run_data_migration(apps, schema_editor):
for element in apps.get_model('conditions', 'Condition').objects.all():
element.uri_prefix = element.uri_prefix or settings.DEFAULT_URI_PR... | rdmorganiser/rdmo | rdmo/conditions/migrations/0020_require_uri_prefix.py | Python | apache-2.0 | 775 |
# Third-party imports
import pytest
# Local imports
from uplink import returns
from uplink.decorators import json
from uplink.models import loads, dumps
@pytest.mark.parametrize(
"cls, method",
[
(loads, "create_response_body_converter"),
(dumps, "create_request_body_converter"),
],
)
def... | prkumar/uplink | tests/unit/test_models.py | Python | mit | 1,798 |
# Copyright (c) 2016, 2017, 2018 Forschungszentrum Juelich GmbH
# Author: Yann Leprince <y.leprince@fz-juelich.de>
#
# This software is made available under the MIT licence, see LICENCE.txt.
"""Access to a Neuroglancer pre-computed dataset on the local filesystem.
See the :mod:`~neuroglancer_scripts.accessor` module ... | HumanBrainProject/neuroglancer-scripts | src/neuroglancer_scripts/file_accessor.py | Python | mit | 6,613 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-02-09 07:22
from __future__ import unicode_literals
import ckeditor_uploader.fields
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('page', '0011_auto_20170202_1409'),
]
operations = [
... | Zex0n/django-simple-cms | page/migrations/0012_auto_20170209_1022.py | Python | mit | 727 |
# Copyright 2015 The TensorFlow Authors. 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 applica... | benoitsteiner/tensorflow-opencl | tensorflow/contrib/legacy_seq2seq/python/ops/seq2seq.py | Python | apache-2.0 | 56,938 |
# -*- coding: utf-8 -*-
# MIT License
#
# Copyright (c) 2017-2018 Roxanne Gibson
#
# 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 limitation the right... | RainbowDinoaur/roxbot | roxbot/core.py | Python | mit | 23,817 |
def main(request, response):
try:
return "id:%s;value:%s;" % (
request.POST.first("id"), request.POST.first("value"))
except Exception as ex:
return "error"
| kaixinjxq/web-testing-service | wts/tests/xmlhttprequest/w3c/resources/form.py | Python | bsd-3-clause | 193 |
"""
Interact with your school website with telegram!
Copyright (c) 2016-2018 Paolo Barbolini <paolo@paolo565.org>
Released under the MIT license
"""
from sqlalchemy import create_engine
import click
import json
from . import bot
from . import models
@click.group()
def cli():
pass
@cli.command()
def init():
... | paolobarbolini/TelegramSchoolBot | telegramschoolbot/__main__.py | Python | mit | 1,122 |
#!python3
import os, shutil, json, pprint, sys, string, json, argparse
from collections import OrderedDict
from shutil import copyfile, copytree
def rename_sdk_old_dirs(path, dry_run = False):
# I make assumption that all old sdk dirs have "sdk" names.
sdk_dir_name = "sdk"
path = "."
for root, dir... | cvtsi2sd/mbed-os | targets/TARGET_NORDIC/TARGET_NRF5_SDK13/porting_tools/sdk_update.py | Python | apache-2.0 | 10,384 |
# Copyright 2020 Google 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, soft... | googleads/googleads-admob-api-samples | python/v1/get_account.py | Python | apache-2.0 | 1,519 |
# encoding: utf-8
# module PyKDE4.kdeui
# from /usr/lib/python3/dist-packages/PyKDE4/kdeui.cpython-34m-x86_64-linux-gnu.so
# by generator 1.135
# no doc
# imports
import PyKDE4.kdecore as __PyKDE4_kdecore
import PyQt4.QtCore as __PyQt4_QtCore
import PyQt4.QtGui as __PyQt4_QtGui
import PyQt4.QtSvg as __PyQt4_QtSvg
cl... | ProfessorX/Config | .PyCharm30/system/python_stubs/-1247971765/PyKDE4/kdeui/KSelectionOwner.py | Python | gpl-2.0 | 1,110 |
import os
import re
import json
import urllib.parse
import urllib.request
import contextlib
import hashlib
from lxml import etree
from django.conf import settings
from django.http import HttpResponse, JsonResponse, Http404
from django.views.decorators.csrf import csrf_exempt
from django.views.decorators.vary import va... | gislab-npo/gislab-web | server/webgis/map/views.py | Python | gpl-2.0 | 9,021 |
# Copyright 2017 The TensorFlow Authors. 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 applica... | zbigniewwojna/text-rcnn | core/preprocessor.py | Python | apache-2.0 | 77,352 |
import unittest
from conans.test.utils.tools import TestServer, TestClient
from conans.paths import CONANFILE
from conans.test.utils.cpp_test_files import cpp_hello_conan_files
from collections import OrderedDict
from time import sleep
class MultiRemotesTest(unittest.TestCase):
def setUp(self):
default_s... | lasote/conan | conans/test/integration/multi_remotes_test.py | Python | mit | 4,461 |
import math
L=[] #contains about 100 intervals in which a*a must be
for i in range(0,10):
a = int('1'+str(i)+'2') * 10 ** 14
b= int('1'+str(i)+'3') * 10 ** 14
ta,tb=int(math.sqrt(a)), int(math.sqrt(b))
L.append([ta,ta*ta,tb,tb*tb])
# print L
s=0
for (a,sa,b,sb) in L:
s+= (b-a)/5
print s
def isOK(n):
'''test i... | nguyenkims/projecteuler-python | src/p206.py | Python | mit | 736 |
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
import pybindgen.settings
import warnings
class ErrorHandler(pybindgen.settings.ErrorHandler):
def handle_error(self, wrapper, exception, traceback_):
warnings.warn("exception %r in wrapper %s" % (exception, wrapper))
... | letiangit/802.11ah-ns3 | src/wimax/bindings/modulegen__gcc_ILP32.py | Python | gpl-2.0 | 773,553 |
from __future__ import division, print_function, absolute_import
from decimal import Decimal
from itertools import product
from numpy.testing import (
TestCase, run_module_suite, assert_equal,
assert_almost_equal, assert_array_equal, assert_array_almost_equal,
assert_raises, assert_allclose, assert_, dec)... | dch312/scipy | scipy/signal/tests/test_signaltools.py | Python | bsd-3-clause | 53,190 |
#!/usr/bin/python3
import sys
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
import Business
from Data.Document import Document
from GUIGTK.MainWindow import MainWindow
import os
from pathlib import Path
__author__ = 'mamj'
# This is a test
def except_hook(cls, exception, traceback):
s... | pracedru/PracedruDesign | maingtk.py | Python | bsd-3-clause | 1,149 |
"""
viscount.api
provides the framework for the REST api
"""
from functools import wraps
from flask import jsonify
from flask.ext.security.decorators import login_required, roles_required
from ..core import ViscountException, ViscountFormException
from .datatables import DataTablesException, handle_DataTablesExcept... | dacb/viscount | viscount/api/__init__.py | Python | bsd-2-clause | 1,855 |
from model.contact import Contact
from random import randrange
def test_edit_contact(app, db, check_ui):
if len(db.get_contact_list()) == 0:
app.contact.create(Contact(first_name ="Sabina", last_name="test", company="Pewex",
address="osiedle", phone_home="123456789", e_m... | sabinaczopik/python_training | test/test_edit_contact.py | Python | apache-2.0 | 949 |
DEBUG = True
SQLALCHEMY_DATABASE_URI = "sqlite:///shortner.db"
| scottydelta/url-shortner | shortner/settings.py | Python | apache-2.0 | 65 |
# This file is part of DQXServer - (C) Copyright 2014, Paul Vauterin, Ben Jeffery, Alistair Miles <info@cggh.org>
# This program is free software licensed under the GNU Affero General Public License.
# You can find a copy of this license in LICENSE in the top directory of the source code or at <http://opensource.org/li... | cggh/DQXServer | DQXEncoder.py | Python | agpl-3.0 | 6,324 |
HOST = "mongos-3sh-ex4q:27017,mongos-3sh-lenv:27017,mongos-3sh-ql7j:27017"
PORT = ""
USER = ""
PASSWORD = ""
DATABASE = "google"
READ_PREFERENCE = "primary"
COLLECTION_INPUT = "median_cpu"
COLLECTION_OUTPUT = "ratio"
PREFIX_COLUMN = "g_"
ATTRIBUTES = ['median cpu']
SORT = ["_id.filepath", "_id.numline"]
OPERATION_TYPE... | elainenaomi/sciwonc-dataflow-examples | sbbd2016/experiments/4-mongodb-rp-3sh/11_workflow_full_10files_primary_3sh_annot_with_proj_3s_rg/calculateratio_8/ConfigDB_Calc_MedianCPU_8.py | Python | gpl-3.0 | 367 |
# -*- coding: utf-8 -*-
"""Unit tests for the ``permissions`` paths.
Each ``APITestCase`` subclass tests a single URL. A full list of URLs to be
tested can be found here: http://theforeman.org/api/apidoc/v2/permissions.html
"""
import json
import re
from fauxfactory import gen_alphanumeric
from itertools import chai... | anarang/robottelo | tests/foreman/api/test_permission.py | Python | gpl-3.0 | 11,531 |
#!/usr/bin/env python3
# Copyright (c) 2015-2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test BIP65 (CHECKLOCKTIMEVERIFY).
Test that the CHECKLOCKTIMEVERIFY soft-fork activates at (regtest) b... | gjhiggins/vcoincore | test/functional/feature_cltv.py | Python | mit | 6,547 |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
# Copyright (c) 2014, Alexandre Vicenzi
# 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 ... | alexandrevicenzi/gcw_battery | battery.py | Python | bsd-3-clause | 7,903 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.