code stringlengths 2 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int32 2 1.05M |
|---|---|---|---|---|---|
#
# GemUO
#
# (c) 2005-2010 Max Kellermann <max@duempel.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope tha... | cculianu/gemuo | src/uo/stats.py | Python | gpl-2.0 | 721 |
from datetime import timedelta
from gettext import gettext as _
from pprint import pformat
import httplib
from pulp.common import error_codes, auth_utils
class PulpException(Exception):
"""
Base exception class for Pulp.
Provides base class __str__ and data_dict implementations
"""
http_status_c... | beav/pulp | server/pulp/server/exceptions.py | Python | gpl-2.0 | 15,227 |
# -*- coding: utf-8 -*-
# vi:si:et:sw=4:sts=4:ts=4
##
## Copyright (C) 2009-2013 Async Open Source <http://www.async.com.br>
## All rights reserved
##
## 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 Softw... | andrebellafronte/stoq | stoqlib/domain/test/test_production.py | Python | gpl-2.0 | 29,131 |
# This file is part of the PySide project.
#
# Copyright (C) 2009-2011 Nokia Corporation and/or its subsidiary(-ies).
# Copyright (C) 2010 Riverbank Computing Limited.
# Copyright (C) 2009 Torsten Marek
#
# Contact: PySide team <pyside@openbossa.org>
#
# This program is free software; you can redistribute it and/or
# m... | PySide/pyside-tools2 | pyside2uic/properties.py | Python | gpl-2.0 | 16,295 |
# -*- coding: utf-8 -*-
#
# Atizo - The Open Innovation Platform
# http://www.atizo.com/
#
# Copyright (c) 2008-2010 Atizo AG. All rights reserved.
#
# 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 Foundati... | atizo/djangojames | djangojames/management/commands/fooemails.py | Python | gpl-2.0 | 1,545 |
# This file is part of Buildbot. Buildbot is free software: you can
# redistribute it and/or modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | pmisik/buildbot | master/buildbot/test/unit/schedulers/test_dependent.py | Python | gpl-2.0 | 8,637 |
import pytest
class TestVmstat:
@pytest.mark.complete("vmstat -", require_cmd=True)
def test_1(self, completion):
assert completion
| algorythmic/bash-completion | test/t/test_vmstat.py | Python | gpl-2.0 | 150 |
from setuptools import setup
# you may need setuptools instead of distutils
setup(
# basic stuff here
scripts = [
'bin/fetchSeq.py',
'bin/PTRMatrix.py'
]
) | zertan/Menace | menace/extra/setup.py | Python | gpl-2.0 | 184 |
'''
Copyright 2009 Rob Jansen
Released under GPLv3. See LICENSE.txt for details.
Strips the history section out of the datafiles. The history is unused as of
this point, and takes up a lot of space. Datafile input must be in .gz format.
'''
def run():
import sys, gzip
if(len(sys.argv) < 2):
print "w... | tinda/tps-one-simulator | parse_scripts/strip_history.py | Python | gpl-3.0 | 853 |
#!/usr/bin/env python
##################################################
# Gnuradio Python Flow Graph
# Title: MIMO TOP FLOW
# Author: Kristian Maier, Johannes Demel
# Description: LTE decoding up to 2 tx antennas
# Generated: Wed Nov 12 13:26:55 2014
##################################################
execfile("/home/... | sdrkjt/gr-lte | examples/MIMO_TOP_FLOW.py | Python | gpl-3.0 | 7,272 |
#!/usr/bin/env python
# Copyright 2007, Michael J. Harms
# This program is distributed under General Public License v. 3. See the file
# COPYING for a copy of the license.
__description__ = \
"""
pdb_splitnmr.py
Takes an nmr pdb file and splits each model into its own pdb file.
"""
__author__ = "Michael J. Harms"... | AndreaEdwards/pdbtools | pdb_splitnmr.py | Python | gpl-3.0 | 1,650 |
#!/usr/bin/env python3
# encoding: utf-8
# === This file is part of Calamares - <http://github.com/calamares> ===
#
# Copyright 2014, Aurélien Gâteau <agateau@kde.org>
#
# Calamares is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# t... | maui-packages/calamares | src/modules/umount/main.py | Python | gpl-3.0 | 2,029 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Mu documentation build configuration file, created by
# sphinx-quickstart on Wed Oct 18 16:36:40 2017.
#
# 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
# autogen... | ntoll/mu | docs/conf.py | Python | gpl-3.0 | 5,830 |
import tensorflow as tf
import numpy as np
import sklearn.metrics as metrics
#from databatcher import DataBatcher
import nucconvmodel
#import dubiotools as dbt
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import pprint
from itertools import cycle
import os
import sys
#Logging imports
fro... | LarsDu/DeepNucDecomp | deepnuc/nucbinaryclassifier.py | Python | gpl-3.0 | 15,464 |
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2015-2017 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
# This file is part of qutebrowser.
#
# qutebrowser is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Sof... | lahwaacz/qutebrowser | tests/unit/config/test_configdata.py | Python | gpl-3.0 | 1,555 |
# This file is part of Indico.
# Copyright (C) 2002 - 2017 European Organization for Nuclear Research (CERN).
#
# Indico 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 (a... | nop33/indico | indico/modules/events/notes/__init__.py | Python | gpl-3.0 | 1,298 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Olivier Boukili <boukili.olivier@gmail.com>
#
# This file is part of Ansible.
#
# Ansible 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... | kbrebanov/ansible-modules-extras | web_infrastructure/apache2_mod_proxy.py | Python | gpl-3.0 | 17,377 |
# -*- coding: utf-8 -*-
# Copyright (c) 2009 - 2015 Detlev Offenbach <detlev@die-offenbachs.de>
#
"""
Module implementing the base class for specific scheme access handlers.
"""
from __future__ import unicode_literals
from PyQt5.QtCore import QObject
class SchemeAccessHandler(QObject):
"""
Clase implement... | testmana2/test | Helpviewer/Network/SchemeAccessHandler.py | Python | gpl-3.0 | 1,235 |
########################################################################
# $HeadURL$
# File : BatchComputingElement.py
# Author : Ricardo Graciani, A.T.
########################################################################
""" BatchComputingElement is a class to handle non-grid computing clusters
"""
from DIRAC.... | Sbalbp/DIRAC | Resources/Computing/LocalComputingElement.py | Python | gpl-3.0 | 10,572 |
# encoding: utf-8
import ckan.plugins as plugins
def group_create(context, data_dict=None):
return {'success': False, 'msg': 'No one is allowed to create groups'}
class ExampleIAuthFunctionsPlugin(plugins.SingletonPlugin):
plugins.implements(plugins.IAuthFunctions)
def get_auth_functions(self):
... | NicoVarg99/daf-recipes | ckan/ckan/ckan/ckanext/example_iauthfunctions/plugin_v2.py | Python | gpl-3.0 | 360 |
"""
Lint tasks.
"""
from invoke import task
@task
def tasks(ctx):
"""Lint the Invoke tasks' code."""
return ctx.run('flake8 tasks').return_code
@task(default=True, pre=[tasks])
def all(ctx):
"""Run all the lint tasks."""
| Xion/ap | tasks/lint.py | Python | gpl-3.0 | 237 |
../../../../../../share/pyshared/Crypto/SelfTest/Protocol/test_rfc1751.py | Alberto-Beralix/Beralix | i386-squashfs-root/usr/lib/python2.7/dist-packages/Crypto/SelfTest/Protocol/test_rfc1751.py | Python | gpl-3.0 | 73 |
from django.core.files.base import ContentFile
from django.db.models.fields.files import ImageFieldFile
from django.test import TestCase
from django.utils.six import StringIO
from .models import MCQuestion, Answer
class TestMCQuestionModel(TestCase):
def setUp(self):
self.q = MCQuestion.objects.create(id... | g-string/G-String_Project | multichoice/tests.py | Python | gpl-3.0 | 2,263 |
# This file is part of Indico.
# Copyright (C) 2002 - 2016 European Organization for Nuclear Research (CERN).
#
# Indico 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 (a... | belokop/indico_bare | indico/web/http_api/metadata/jsonp.py | Python | gpl-3.0 | 1,113 |
# -*- 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 'NavigationLink'
db.create_table('about_navigationlink', (
('id', self.gf('django... | Nivl/www.melvin.re | nivls_website/about/migrations/0001_initial.py | Python | gpl-3.0 | 24,577 |
# encoding: utf-8
"""
System command aliases.
Authors:
* Fernando Perez
* Brian Granger
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2008-2011 The IPython Development Team
#
# Distributed under the terms of the BSD License.
#
# The full license is in the file... | alephu5/Soundbyte | environment/lib/python3.3/site-packages/IPython/core/alias.py | Python | gpl-3.0 | 8,959 |
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Getting Things GNOME! - a personal organizer for the GNOME desktop
# Copyright (c) 2008-2013 - Lionel Dricot & Bertrand Rousseau
#
# This program is free software: you can redistribute it and/or modify it under
# t... | shtrom/gtg | GTG/gtk/backends_dialog/parameters_ui/importtagsui.py | Python | gpl-3.0 | 5,561 |
# Copyright (C) 2012,2013
# Max Planck Institute for Polymer Research
# Copyright (C) 2008,2009,2010,2011
# Max-Planck-Institute for Polymer Research & Fraunhofer SCAI
#
# This file is part of ESPResSo++.
#
# ESPResSo++ is free software: you can redistribute it and/or modify
# it under the terms of t... | capoe/espressopp.soap | src/analysis/MaxPID.py | Python | gpl-3.0 | 1,638 |
"""Test that types defined in shared libraries with stripped symbols work correctly."""
import os, time
import unittest2
import lldb
from lldbtest import *
import lldbutil
class SharedLibTestCase(TestBase):
mydir = os.path.join("lang", "c", "shared_lib")
@dsym_test
def test_expr_with_dsym(self):
... | s20121035/rk3288_android5.1_repo | external/lldb/test/lang/c/shared_lib_stripped_symbols/TestSharedLibStrippedSymbols.py | Python | gpl-3.0 | 3,702 |
# -*- coding: utf-8 -*-
# Copyright (C) 2010-2014 GRNET S.A.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This ... | apyrgio/synnefo | snf-astakos-app/astakos/im/tests/user_utils.py | Python | gpl-3.0 | 3,594 |
## -*- coding: utf-8 -*-
# Copyright (C) 2010 by RoboLab - University of Extremadura
#
# This file is part of RoboComp
#
# RoboComp is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either versio... | robocomp/robocomp | tools/rcmonitor/examples/jointMotorGrab.py | Python | gpl-3.0 | 5,290 |
../../../../../share/pyshared/twisted/test/iosim.py | Alberto-Beralix/Beralix | i386-squashfs-root/usr/lib/python2.7/dist-packages/twisted/test/iosim.py | Python | gpl-3.0 | 51 |
from django.contrib.auth.models import User
from django.db import models
class Lookup(models.Model):
""" Provides a lookup table for populating drop-down lists
"""
container = models.ForeignKey(
'self',
limit_choices_to={'active':True, 'container':None},
blank=True, n... | sokolic/miniSASS | minisass_registration/models.py | Python | gpl-3.0 | 1,341 |
''' Plugin for CudaText editor
Authors:
Andrey Kvichansky (kvichans on github.com)
Alexey Torgashin (CudaText)
Version:
'0.8.8 2018-03-05'
ToDo: (see end of file)
'''
import os
import cudatext as app
from cudatext import ed
import cudatext_cmd as cmds
import cudax_lib ... | vhanla/CudaText | app/py/cuda_comments/cd_comments.py | Python | mpl-2.0 | 17,426 |
# -*- coding: utf-8 -*-
"""
Copyright 2015 Telefonica Investigacion y Desarrollo, S.A.U
This file is part of Orion Context Broker.
Orion Context Broker 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,... | guerrerocarlos/fiware-orion | test/acceptance/behave/components/common_steps/requests.py | Python | agpl-3.0 | 13,122 |
import os
import json
import logging
import ckan.plugins as p
log = logging.getLogger('ckanext_apihelper')
def get_doc(action):
return p.toolkit.get_action(action).__doc__
def check_function(action):
check_list = [
private_check,
rest_check,
internal_function_check,
]
for fn... | dancastellani/ckanext-apihelper | ckanext/apihelper/extract.py | Python | agpl-3.0 | 1,664 |
# -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/superdesk/license
import loggi... | petrjasek/superdesk-core | apps/system_message/__init__.py | Python | agpl-3.0 | 903 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | john-wang-metro/metro-openerp | metro_hr/wizard/hr_clock_emp_sync.py | Python | agpl-3.0 | 24,056 |
# ############################################################################
# OSIS stands for Open Student Information System. It's an application
# designed to manage the core business of higher education institutions,
# such as universities, faculties, institutes and professional schools.
# The core business i... | uclouvain/OSIS-Louvain | program_management/tests/ddd/domain/test_program_tree_version.py | Python | agpl-3.0 | 3,609 |
from zope.interface import Interface
class IIndexing(Interface):
""" interface for indexing operations, used both for the queue and
the processors, which perform the actual indexing; the queue gets
registered as a utility while the processors (portal catalog, solr)
are registered as named... | zerodb/zerodb | zerodb/collective/indexing/interfaces.py | Python | agpl-3.0 | 1,770 |
# -*- coding: utf-8 -*-
# Copyright(C) 2010-2011 Romain Bignon
#
# 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 you... | franek/weboob | modules/phpbb/browser.py | Python | agpl-3.0 | 6,682 |
# The Hazard Library
# Copyright (C) 2013-2016 GEM Foundation
#
# This program 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 option) any later version.
#... | rcgee/oq-hazardlib | openquake/hazardlib/tests/mfd/youngs_coppersmith_1985_test.py | Python | agpl-3.0 | 8,575 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('bp_cupid', '0003_landkreisdaten'),
]
operations = [
migrations.CreateModel(
name='Verwaltungszeitraum',
... | nerdoc/bp_mgmt | bp_cupid/migrations/0004_verwaltungszeitraum.py | Python | agpl-3.0 | 802 |
"""Defines ``Group`` and ``UserPartition`` models for partitioning"""
from collections import namedtuple
from stevedore.extension import ExtensionManager
# We use ``id`` in this file as the IDs of our Groups and UserPartitions,
# which Pylint disapproves of.
# pylint: disable=invalid-name, redefined-builtin
class U... | UQ-UQx/edx-platform_lti | common/lib/xmodule/xmodule/partitions/partitions.py | Python | agpl-3.0 | 6,198 |
"""
Toggles for export_course_metadata app
"""
from edx_toggles.toggles import WaffleFlag
# .. toggle_name: export_course_metadata
# .. toggle_implementation: WaffleFlag
# .. toggle_default: False
# .. toggle_description: Export of course metadata (initially to s3 for use by braze)
# .. toggle_use_cases: temporary
# ... | eduNEXT/edunext-platform | cms/djangoapps/export_course_metadata/toggles.py | Python | agpl-3.0 | 503 |
# cerbero - a multi-platform build system for Open Source software
# Copyright (C) 2012 Andoni Morales Alastruey <ylatuya@gmail.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; eit... | freedesktop-unofficial-mirror/gstreamer-sdk__cerbero | cerbero/hacks.py | Python | lgpl-2.1 | 3,855 |
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class PyCython(PythonPackage):
"""The Cython compiler for writing C extensions for the Python la... | LLNL/spack | var/spack/repos/builtin/packages/py-cython/package.py | Python | lgpl-2.1 | 3,189 |
"""Launch Nuxeo Drive functional tests against a running Nuxeo instance
Steps executed by the ``test`` command:
- setup test environment variables
Under Windows:
- download http://code.google.com/p/lessmsi if not already there
- extract the MSI archive in a local, non system folder with lessmsi
- la... | arameshkumar/nuxeo-drive | tools/integration_tests_setup.py | Python | lgpl-2.1 | 11,904 |
from __future__ import absolute_import, print_function
from ..pyautoupdate.launcher import Launcher
from .pytest_skipif import needinternet
from logging import DEBUG
import os
import shutil
import pytest
@pytest.fixture(scope='function')
def fixture_update_setup(request):
"""Sets up and tears down version docs ... | rlee287/pyautoupdate | test/test_update.py | Python | lgpl-2.1 | 3,133 |
from python import stats
#CAPM
asset_beta = stats.covar(asset_return,market_return) / stats.var(market_return)
market_risk_premium = market_return - risk_free_rate
cost_of_equity = risk_free_rate + asset_beta * market_risk_premium
#WACC
after_tax_cost_of_debt = cost_of_debt * (1 - tax_rate)
equity_weight = total_equi... | secondfoundation/Second-Foundation-Src | src/haruspex/python/omaha/portfolio.py | Python | lgpl-2.1 | 836 |
# urlgrabber distutils setup
import re as _re
import urlgrabber as _urlgrabber
name = "urlgrabber"
description = "A high-level cross-protocol url-grabber"
long_description = _urlgrabber.__doc__
license = "LGPL"
version = _urlgrabber.__version__
_authors = _re.split(r',\s+', _urlgrabber.__author__)
author = ', '.... | tradej/urlgrabber | setup.py | Python | lgpl-2.1 | 1,658 |
# Copyright Iris contributors
#
# This file is part of Iris and is released under the LGPL license.
# See COPYING and COPYING.LESSER in the root of the repository for full
# licensing details.
"""
This system test module is useful to identify if some of the key components required for Iris are available.
The system ... | pp-mo/iris | lib/iris/tests/system_test.py | Python | lgpl-3.0 | 2,534 |
#
# This file is part of Dragonfly.
# (c) Copyright 2007, 2008 by Christo Butcher
# Licensed under the LGPL.
#
# Dragonfly 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 L... | wolfmanstout/dragonfly | dragonfly/test/infrastructure.py | Python | lgpl-3.0 | 1,678 |
#!/usr/bin/env python
from datetime import datetime
import gtts
import warnings
from os import system
from os import _exit
GREEN = '\033[92m'
ENDC = '\033[0m'
YELLOW = '\033[93m'
RED = '\033[91m'
BOLD = '\033[1m'
def get_t_str():
return datetime.now().strftime('%H:%M:%S')
def info(msg, overlay=False, prnt=Tr... | veloxid/eudaq-drs4 | shifterBot/utils.py | Python | lgpl-3.0 | 1,806 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 Cisco Systems, 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... | tpaszkowski/quantum | quantum/plugins/cisco/common/config.py | Python | apache-2.0 | 3,752 |
# coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.7.4
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import os
import sys
im... | djkonro/client-python | kubernetes/test/test_v1_secret_list.py | Python | apache-2.0 | 835 |
"""Unit test for treadmill.runtime.linux._finish.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import datetime
import io
import os
import shutil
import tempfile
import unittest
import mock
# Disable W0611: Un... | Morgan-Stanley/treadmill | lib/python/treadmill/tests/runtime/linux/finish_test.py | Python | apache-2.0 | 29,598 |
# -*- coding: utf-8 -*-
"""The HFS attribute implementation."""
import os
from dfvfs.lib import errors
from dfvfs.vfs import attribute
class HFSExtendedAttribute(attribute.Attribute):
"""HFS extended attribute that uses pyfshfs."""
def __init__(self, fshfs_extended_attribute):
"""Initializes an attribute.
... | joachimmetz/dfvfs | dfvfs/vfs/hfs_attribute.py | Python | apache-2.0 | 2,856 |
# 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... | Huyuwei/tvm | topi/tests/python/test_topi_depthwise_conv2d.py | Python | apache-2.0 | 18,858 |
import kfp.dsl as dsl
import json
import kfp.components as comp
from collections import OrderedDict
from kubernetes import client as k8s_client
def setup(MINIO_ACCESS_KEY: str, MINIO_HOST: str, MINIO_MODEL_BUCKET: str, MINIO_SECRET_KEY: str):
pipeline_parameters_block = '''
MINIO_ACCESS_KEY = "{}"
MINIO_H... | kubeflow/pipelines | samples/contrib/e2e-outlier-drift-explainer/kfserving/kfserving_e2e_adult.kale.default.py | Python | apache-2.0 | 51,853 |
# 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... | Huyuwei/tvm | topi/python/topi/vision/rcnn/roi_align.py | Python | apache-2.0 | 3,929 |
# Copyright 2018 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, ... | CloudVLab/professional-services | examples/cloudml-fraud-detection/trainer/task.py | Python | apache-2.0 | 4,369 |
# Copyright 2014 Hewlett-Packard Development Company, L.P.
#
# Author: Endre Karlson <endre.karlson@hp.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/lice... | redhat-openstack/rally | rally/plugins/openstack/scenarios/designate/utils.py | Python | apache-2.0 | 4,317 |
"""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 agreed to in ... | dq922/PerfKitExplorer | server/perfkit/explorer/util/explorer_config_util.py | Python | apache-2.0 | 1,731 |
# Copyright (c) 2013 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | mahak/neutron | neutron/plugins/ml2/drivers/type_gre.py | Python | apache-2.0 | 2,280 |
import pytest
import sdk_install as install
import sdk_plan as plan
from tests.config import (
PACKAGE_NAME
)
def setup_module(module):
install.uninstall(PACKAGE_NAME)
options = {
"service": {
"spec_file": "examples/web-url.yml"
}
}
# this config produces 1 hello's +... | comptelfwd/dcos-commons | frameworks/helloworld/tests/test_web_url.py | Python | apache-2.0 | 797 |
# Copyright (c) 2018 PaddlePaddle 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 app... | luotao1/Paddle | python/paddle/fluid/tests/unittests/test_pad2d_op.py | Python | apache-2.0 | 4,541 |
from django.db import models, migrations
import markupfield.fields
import django.utils.timezone
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('companies', '0001_initial'),
]
operations ... | manhhomienbienthuy/pythondotorg | jobs/migrations/0001_initial.py | Python | apache-2.0 | 6,375 |
# 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... | hthompson6/a10-neutron-lbaas | a10_neutron_lbaas/constants.py | Python | apache-2.0 | 838 |
# 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... | zhreshold/mxnet | python/mxnet/gluon/contrib/nn/basic_layers.py | Python | apache-2.0 | 17,216 |
"""Binary Sensor platform for FireServiceRota integration."""
from homeassistant.components.binary_sensor import BinarySensorEntity
from homeassistant.config_entries import ConfigEntry
from homeassistant.helpers.typing import HomeAssistantType
from homeassistant.helpers.update_coordinator import (
CoordinatorEntity... | w1ll1am23/home-assistant | homeassistant/components/fireservicerota/binary_sensor.py | Python | apache-2.0 | 2,498 |
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import dataclasses
import os
from dataclasses import dataclass
from typing import Optional, Sequence, Tuple
from urllib import parse
from pants.base.build_environment import get_buildroot... | tdyas/pants | src/python/pants/java/jar/jar_dependency.py | Python | apache-2.0 | 8,187 |
#----------------------------------------------------------------------------------
# Copyright 2013 Esri
# 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/LI... | Esri/military-feature-toolbox | toolboxes/scripts/DictionaryConstants.py | Python | apache-2.0 | 5,350 |
# 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... | MJJoyce/climate | examples/statistical_downscaling/run_statistical_downscaling.py | Python | apache-2.0 | 10,280 |
#!/usr/bin/env python
# Copyright 2014 Andrea Micheli and Marco Gario
#
# 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 b... | agriggio/pysmt | install.py | Python | apache-2.0 | 668 |
# Copyright (c) 2021 PaddlePaddle 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 appli... | luotao1/Paddle | python/paddle/fluid/tests/unittests/test_auto_parallel_completion.py | Python | apache-2.0 | 30,604 |
#!/usr/bin/env python
import unittest
from latex2mathml import tokenizer
__author__ = "Ronie Martinez"
__copyright__ = "Copyright 2016-2017, Ronie Martinez"
__credits__ = ["Ronie Martinez"]
__license__ = "MIT"
__maintainer__ = "Ronie Martinez"
__email__ = "ronmarti18@gmail.com"
__status__ = "Development"
class Token... | TU-Berlin/mathosphere | pomlp/lib/latex2mathml/tests/tokenizer_test.py | Python | apache-2.0 | 2,901 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (C) 2013 PolyBeacon, 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... | gorocacher/payload | payload/api/controllers/root.py | Python | apache-2.0 | 743 |
"""
Namespaces used in the context of the FES standard.
"""
NAMESPACES = {
"xsi": "http://www.w3.org/2001/XMLSchema-instance",
"fes": "http://www.opengis.net/fes/2.0",
"gml": "http://www.opengis.net/gml/3.2",
}
| ricardogsilva/pyfes | src/pyfes/fes20/namespaces.py | Python | apache-2.0 | 224 |
# 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
# distributed under t... | ArchiFleKs/magnum | magnum/drivers/common/k8s_scale_manager.py | Python | apache-2.0 | 1,096 |
from rqalpha.api import *
from rqalpha import subscribe_event
def on_trade_handler(event):
trade = event.trade
order = event.order
account = event.account
logger.info("*" * 10 + "Trade Handler" + "*" * 10)
logger.info(trade)
logger.info(order)
logger.info(account)
def on_order_handler(ev... | xclxxl414/rqalpha | rqalpha/examples/subscribe_event.py | Python | apache-2.0 | 1,658 |
from __future__ import absolute_import, unicode_literals
from django.core.urlresolvers import reverse, reverse_lazy
from password_reset.views import Recover
from password_reset.forms import PasswordRecoveryForm
from django.http import Http404
from django.shortcuts import redirect
from django.utils.decorators import me... | mluo613/osf.io | admin/common_auth/views.py | Python | apache-2.0 | 3,641 |
# Copyright 2016, 2017 IBM Corp.
#
# 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 require... | stackforge/nova-powervm | nova_powervm/conf/powervm.py | Python | apache-2.0 | 12,402 |
import unittest, time, sys
sys.path.extend(['.','..','py'])
import h2o, h2o_cmd, h2o_hosts, h2o_glm
import h2o_browse as h2b
import h2o_import as h2i
import time, random
class Basic(unittest.TestCase):
def tearDown(self):
h2o.check_sandbox_for_errors()
@classmethod
def setUpClass(cls):
glo... | janezhango/BigDataMachineLearning | py/testdir_single_jvm/test_billion_rows_fvec.py | Python | apache-2.0 | 2,508 |
# Copyright 2011 OpenStack Foundation
# Copyright (c) 2015 Rushil Chugh
# 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/licen... | NetApp/manila | manila/tests/share/test_share_utils.py | Python | apache-2.0 | 5,942 |
#!/usr/bin/env python
"""API handlers for stats."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from grr_response_core.lib import rdfvalue
from grr_response_core.lib.rdfvalues import structs as rdf_structs
from grr_response_proto.api import stats_pb2
f... | dunkhong/grr | grr/server/grr_response_server/gui/api_plugins/stats.py | Python | apache-2.0 | 2,143 |
"""Project for Forwarding."""
from ryu.base import app_manager
from ryu.controller import ofp_event
from ryu.controller.handler import MAIN_DISPATCHER
from ryu.controller.handler import set_ev_cls
from ryu.ofproto import ofproto_v1_3
from ryu.ofproto import ether, inet
from ryu.lib.packet import packet
from ryu.lib.pa... | vcpe-io/vcpe-hub | qos/forwarding.py | Python | apache-2.0 | 17,715 |
# Copyright (c) 2016 Red Hat, 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 ... | mahak/neutron | neutron/tests/functional/services/l3_router/test_l3_dvr_ha_router_plugin.py | Python | apache-2.0 | 19,889 |
#!/usr/bin/python
# Copyright 2015 Sam Yaple
#
# 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 agree... | ealegol/kolla-newton | docker/kolla-toolbox/kolla_keystone_user.py | Python | apache-2.0 | 3,197 |
from pyjamas.ui.AbsolutePanel import AbsolutePanel
from pyjamas.ui.Label import Label
from pyjamas import DOM
from pyjamas import log
import math
class TextWindow(AbsolutePanel):
def __init__(self, cols, rows, width, height):
AbsolutePanel.__init__(self)
self.rows = rows
self.cols = cols
... | lovelysystems/pyjamas | examples/shell/textconsole.py | Python | apache-2.0 | 1,726 |
"""Auto-generated file, do not edit by hand. PR metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_PR = PhoneMetadata(id='PR', country_code=1, international_prefix='011',
general_desc=PhoneNumberDesc(national_number_pattern='[5789]\\d{9}', possible_length=(10,), pos... | gencer/python-phonenumbers | python/phonenumbers/data/region_PR.py | Python | apache-2.0 | 1,201 |
from copy_state_db import CopyStateDB
from faster_ordered_dict import FasterOrderedDict
import gevent
import gevent.monkey
from gevent.pool import Pool
from pymongo.errors import DuplicateKeyError
from pymongo.read_preferences import ReadPreference
import time
import utils
from utils import auto_retry, log_exceptions, ... | gitkewl/hydra | copier.py | Python | bsd-2-clause | 7,694 |
import unittest
from Orange.data import ContinuousVariable, Domain, Table
from Orange.classification import Model, SoftmaxRegressionLearner
from Orange.evaluation import CrossValidation, CA
import numpy as np
class SoftmaxRegressionTest(unittest.TestCase):
def test_SoftmaxRegression(self):
table = Table(... | marinkaz/orange3 | Orange/tests/test_softmax_regression.py | Python | bsd-2-clause | 1,533 |
"""
Test that we can backtrace correctly with 'noreturn' functions on the stack
"""
from __future__ import print_function
import os
import time
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class NoreturnUnwind(TestBase):
mydir = T... | youtube/cobalt | third_party/llvm-project/lldb/packages/Python/lldbsuite/test/functionalities/unwind/noreturn/TestNoreturnUnwind.py | Python | bsd-3-clause | 3,261 |
# Test hashlib module
#
# $Id$
#
# Copyright (C) 2005-2010 Gregory P. Smith (greg@krypto.org)
# Licensed to PSF under a Contributor Agreement.
#
import array
from binascii import unhexlify
import functools
import hashlib
import importlib
import itertools
import os
import sys
import threading
import unittest
import... | kikocorreoso/brython | www/src/Lib/test/test_hashlib.py | Python | bsd-3-clause | 40,375 |
"""
This module defines the mpf, mpc classes, and standard functions for
operating with them.
"""
__docformat__ = 'plaintext'
import re
from .ctx_base import StandardBaseContext
from .libmp.backend import basestring, BACKEND
from . import libmp
from .libmp import (MPZ, MPZ_ZERO, MPZ_ONE, int_types, repr_dps,
r... | bjodah/mpmath | mpmath/ctx_mp.py | Python | bsd-3-clause | 48,836 |
__all__ = ['newaxis', 'ndarray', 'flatiter', 'ufunc',
'arange', 'array', 'zeros', 'empty', 'broadcast', 'dtype',
'fromstring', 'fromfile', 'frombuffer','newbuffer',
'getbuffer', 'int_asbuffer', 'where', 'argwhere',
'concatenate', 'fastCopyAndTranspose', 'lexsort',
... | efiring/numpy-work | numpy/core/numeric.py | Python | bsd-3-clause | 56,285 |
# ----------------------------------------------------------------------------
# Copyright (c) 2013--, scikit-bio development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
# --------------------------------------------... | kdmurray91/scikit-bio | skbio/tree/tests/test_nj.py | Python | bsd-3-clause | 8,925 |
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
__version__ = '0.2.3 beta'
| liuzhaoguo/FreeROI-1 | froi/version.py | Python | bsd-3-clause | 142 |
from netCDF4 import Dataset;
class logData(object):
"""
This class is a wrapper over the netCDF4 library to simplify
writing fields to a nc file
"""
def __init__(self, filename, fieldnames, dimNames, dt=1, currTime=0, \
overwrite=False):
self.name = filename;
self.f... | JoyMonteiro/parSpectral | pspec/logDataJ.py | Python | bsd-3-clause | 1,852 |