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 |
|---|---|---|---|---|---|
#
# pluginbase.py
#
# Copyright (C) 2007-2010 Andrew Resch <andrewresch@gmail.com>
#
# Deluge is free software.
#
# You may 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 lat... | vguerci/Deluge.app | deluge/plugins/pluginbase.py | Python | gpl-3.0 | 2,833 |
"""
=========
Visualize
=========
Widgets for data visualization.
"""
# Category description for the widget registry
NAME = "Visualize"
DESCRIPTION = "Widgets for data visualization."
BACKGROUND = "#FFB7B1"
ICON = "icons/Category-Visualize.svg"
PRIORITY = 2
| yzl0083/orange | Orange/OrangeWidgets/Visualize/__init__.py | Python | gpl-3.0 | 266 |
# (c) 2012-2014, Michael DeHaan <michael.dehaan@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 of the License, or
# (at your option) an... | mcltn/ansible | lib/ansible/inventory/__init__.py | Python | gpl-3.0 | 28,850 |
"""
MixedModuleStore allows for aggregation between multiple modulestores.
In this way, courses can be served up both - say - XMLModuleStore or MongoModuleStore
"""
import logging
from contextlib import contextmanager
import itertools
import functools
from contracts import contract, new_contract
from opaque_keys im... | wwj718/ANALYSE | common/lib/xmodule/xmodule/modulestore/mixed.py | Python | agpl-3.0 | 34,661 |
#!/usr/bin/env python
# -*- noplot -*-
"""
This example shows how to use the agg backend directly to create
images, which may be of use to web application developers who want
full control over their code without using the pyplot interface to
manage figures, figure closing etc.
.. note::
It is not necessary to avo... | cactusbin/nyt | matplotlib/examples/pylab_examples/webapp_demo.py | Python | unlicense | 1,713 |
#----------------------------------------------------------------------
# Purpose: This tests k-means on a large dataset.
#----------------------------------------------------------------------
import sys
sys.path.insert(1, "../../")
import h2o, tests
def hdfs_kmeans():
# Check if we are running inside the... | brightchen/h2o-3 | h2o-py/tests/testdir_hdfs/pyunit_HDFS_kmeans.py | Python | apache-2.0 | 1,795 |
# Copyright 2020 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... | tensorflow/tensorflow | tensorflow/compiler/mlir/tfr/define_op_template.py | Python | apache-2.0 | 1,903 |
'''
'''
# 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");... | duke8253/trafficserver | tests/gold_tests/pluginTest/cookie_remap/substitute.test.py | Python | apache-2.0 | 4,520 |
# -*- coding: utf-8 -*-
# Copyright © 2012 Zulip, 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 limitation the rights
# to use, copy, modify, ... | cosmicAsymmetry/zulip | api/integrations/trac/zulip_trac.py | Python | apache-2.0 | 5,443 |
import os
import unittest
from robot.utils.asserts import assert_equal, assert_true
from robot.utils.etreewrapper import ETSource, ET
from robot.utils import IRONPYTHON, PY3
PATH = os.path.join(os.path.dirname(__file__), 'test_etreesource.py')
if PY3:
unicode = str
class TestETSource(unittest.TestCase):
d... | alexandrul-ci/robotframework | utest/utils/test_etreesource.py | Python | apache-2.0 | 1,816 |
# Copyright (c) 2016 Hewlett Packard Enterprise Development Company, L.P.
# 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/lic... | huntxu/neutron | neutron/db/l3_dvr_ha_scheduler_db.py | Python | apache-2.0 | 1,967 |
from tastytools.test.resources import ResourceTestData
class Test_1_1_TestData(ResourceTestData):
resource = "test_1_1"
class Test_1_2_TestData(ResourceTestData):
resource = "test_1_2" | mozilla/inventory | vendor-local/src/django-tastytools/tastytools/example/testdata1.py | Python | bsd-3-clause | 198 |
#! /usr/bin/python
from model import *
# Utils ----------------------------------------------------------------------
def load_file(path):
return scipy.sparse.csr_matrix(cPickle.load(open(path)),
dtype=theano.config.floatX)
def compute_prauc(pred, lab):
pred = np.asarray(pred)
lab = np.asar... | while519/SME | Tensor_exp.py | Python | bsd-3-clause | 11,310 |
__author__ = 'mwerlen'
| SogeMood/sogemood-backend | sogemood/model/__init__.py | Python | mit | 23 |
#============================================================================
# This library is free software; you can redistribute it and/or
# modify it under the terms of version 2.1 of the GNU Lesser General Public
# License as published by the Free Software Foundation.
#
# This library is distributed in the hope th... | rubenk/cobbler | cobbler/server/xmlrpclib2.py | Python | gpl-2.0 | 9,102 |
""" This module implements features specific for POP Processing """
# Michael Cohen <scudette@users.sourceforge.net>
# Gavin Jackson <Gavz@users.sourceforge.net>
#
# ******************************************************
# Version: FLAG $Version: 0.87-pre1 Date: Thu Jun 12 00:48:38 EST 2008$
# ************************... | backupManager/pyflag | src/plugins_old/NetworkForensics/ProtocolHandlers/POP.py | Python | gpl-2.0 | 9,518 |
#!/usr/bin/python
#
# Copyright (c) 2011 The Chromium OS Authors.
#
# See file CREDITS for list of people who contributed to this
# project.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; eit... | renesas-rz/u-boot-2013.04 | tools/patman/patman.py | Python | gpl-2.0 | 6,763 |
#!/usr/bin/env python
""" =================================================
execute.py - Top-level hybrid controller executor
=================================================
This module executes a hybrid controller for a robot in a simulated or real environment.
:Usage: ``execute.py [-hn] [-p liste... | VerifiableRobotics/LTLMoP | src/lib/execute.py | Python | gpl-3.0 | 17,245 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) David Arnold (devCO).
# Author David Arnold (devCO), dar@devco.co
# Co-Authors Juan Pablo Aries (devCO), jpa@devco.co
# Hector Ivan ... | odoousers2014/odoo | addons/l10n_co/__openerp__.py | Python | agpl-3.0 | 1,792 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models, _
from odoo.addons.http_routing.models.ir_http import url_for
class Website(models.Model):
_inherit = "website"
def get_suggested_controllers(self):
suggested_controllers = sup... | ddico/odoo | addons/website_event/models/website.py | Python | agpl-3.0 | 491 |
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1.inset_locator import inset_axes
fig, (ax1, ax2) = plt.subplots(1, 2, figsize=[6, 3])
axins1 = inset_axes(ax1,
width="50%", # width = 10% of parent_bbox width
height="5%", # height : 50%
loc=1)
im... | cactusbin/nyt | matplotlib/examples/axes_grid/demo_colorbar_with_inset_locator.py | Python | unlicense | 1,052 |
# Generated by Django 1.11.18 on 2019-02-02 06:02
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('zilencer', '0015_delete_billing'),
]
operations = [
migrations.CreateModel(
name='RemoteInsta... | showell/zulip | zilencer/migrations/0016_remote_counts.py | Python | apache-2.0 | 2,165 |
from envi.archs.msp430.regs import *
checks = [
# SWPB
(
'DEC r15',
{ 'regs': [(REG_R15, 0xaabb)], 'flags': [(SR_N, 0), (SR_Z, 0), (SR_C, 0), (SR_V, 0)], 'code': "8f10", 'data': "" },
{ 'regs': [(REG_R15, 0xbbaa)], 'flags': [(SR_N, 0), (SR_Z, 0), (SR_C, 0), (SR_V, 0)], 'code': "8f10", '... | joshuahoman/vivisect | envi/tests/msp430/iswpb.py | Python | apache-2.0 | 341 |
# Copyright 2013 Nebula, 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 ... | tylertian/Openstack | openstack F/python-novaclient/novaclient/crypto.py | Python | apache-2.0 | 1,286 |
# -*- coding: utf-8 -*-
#
# 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
... | KL-WLCR/incubator-airflow | airflow/default_login.py | Python | apache-2.0 | 2,371 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2012 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.a... | jessicalucci/NovaOrc | nova/tests/api/openstack/compute/contrib/test_admin_actions_with_cells.py | Python | apache-2.0 | 3,528 |
#################################################################
# collisionWindow.py
# Written by Yi-Hong Lin, yihhongl@andrew.cmu.edu, 2004
#################################################################
# Import Tkinter, Pmw, and the floater code from this directory tree.
from direct.tkwidgets.AppShell import *
f... | chandler14362/panda3d | contrib/src/sceneeditor/seBlendAnimPanel.py | Python | bsd-3-clause | 28,869 |
# Copyright 2013, Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can
# be found in the LICENSE file.
# This is the shard name for when the keyrange covers the entire space
# for unsharded database.
SHARD_ZERO = '0'
# Keyrange that spans the entire space, used
# for ... | ptomasroos/vitess | py/vtdb/keyrange_constants.py | Python | bsd-3-clause | 450 |
"""Test case implementation"""
import collections
import sys
import functools
import difflib
import pprint
import re
import warnings
from . import result
from .util import (
strclass, safe_repr, unorderable_list_difference,
_count_diff_all_purpose, _count_diff_hashable
)
__unittest = True
... | ktan2020/legacy-automation | win/Lib/unittest/case.py | Python | mit | 43,508 |
from __future__ import absolute_import
import errno
import warnings
import hmac
import re
from binascii import hexlify, unhexlify
from hashlib import md5, sha1, sha256
from ..exceptions import SSLError, InsecurePlatformWarning, SNIMissingWarning
from ..packages import six
from ..packages.rfc3986 import abnf_regexp
... | ctrlaltdel/neutrinator | vendor/urllib3/util/ssl_.py | Python | gpl-3.0 | 13,786 |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2017 F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import json
import sys
from nose.plugins.skip import SkipTest
i... | alexlo03/ansible | test/units/modules/network/f5/test_bigip_gtm_pool.py | Python | gpl-3.0 | 11,200 |
"""
Database API
(part of web.py)
"""
__all__ = [
"UnknownParamstyle", "UnknownDB", "TransactionError",
"sqllist", "sqlors", "reparam", "sqlquote",
"SQLQuery", "SQLParam", "sqlparam",
"SQLLiteral", "sqlliteral",
"database", 'DB',
]
import time
try:
import datetime
except ImportError:
datetime = Non... | pankajn17/intern | web/db.py | Python | gpl-3.0 | 40,670 |
#!/usr/bin/env python
# coding: utf-8
from __future__ import print_function
import os.path
import warnings
import sys
try:
from setuptools import setup, Command
setuptools_available = True
except ImportError:
from distutils.core import setup, Command
setuptools_available = False
from distutils.spawn ... | israeltobias/DownMedia | youtube-dl/setup.py | Python | gpl-3.0 | 4,022 |
# -*- 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 Foun... | gavioto/fiware-orion | test/acceptance/lettuce/integration/steps_lib/ngsi_request.py | Python | agpl-3.0 | 5,069 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import picklefield.fields
class Migration(migrations.Migration):
dependencies = [
('userstories', '0010_remove_userstory_watchers'),
]
operations = [
migrations.AddField(
... | xdevelsistemas/taiga-back-community | taiga/projects/userstories/migrations/0011_userstory_tribe_gig.py | Python | agpl-3.0 | 534 |
"""
Project
FPGA-Imaging-Library
Design
MeanFilter
Function
Local filter - Mean filter, it always used for smoothing images.
Module
Software simulation.
Version
1.0
Modified
2015-05-19
Copyright (C) 2015 Tianyu Dai (dtysky) <dtysky@outlook.com>
This library is free software; you can redistribute it and/or
modif... | hj3938/FPGA-Imaging-Library | LocalFilter/ThresholdLocal/SoftwareSim/MeanFilter.py | Python | lgpl-2.1 | 2,206 |
"""Support for Xiaomi Cameras (HiSilicon Hi3518e V200)."""
import asyncio
import logging
from aioftp import Client, StatusCodeError
from haffmpeg.camera import CameraMjpeg
from haffmpeg.tools import IMAGE_JPEG, ImageFrame
import voluptuous as vol
from homeassistant.components.camera import PLATFORM_SCHEMA, Camera
fro... | kennedyshead/home-assistant | homeassistant/components/yi/camera.py | Python | apache-2.0 | 5,013 |
#
# 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... | practice-vishnoi/dev-spark-1 | examples/src/main/python/ml/simple_text_classification_pipeline.py | Python | apache-2.0 | 2,809 |
from rdkit import RDConfig
import os.path
import pickle
from rdkit import Chem
from rdkit.Chem import Descriptors
descrs = ['SMR_VSA1', 'SMR_VSA10', 'SMR_VSA2', 'SMR_VSA3', 'SMR_VSA4', 'SMR_VSA5', 'SMR_VSA6',
'SMR_VSA7', 'SMR_VSA8', 'SMR_VSA9', 'SlogP_VSA1', 'SlogP_VSA10', 'SlogP_VSA11',
'SlogP_VS... | bp-kelley/rdkit | rdkit/Chem/test_data/BuildDescrsTestSet.Crippen.py | Python | bsd-3-clause | 1,551 |
#!/usr/bin/env python
""" Examples of using qhull via scipy to generate 3D plots in visvis.
Requires numpy ver 1.5, scipy ver 0.9 and qhull from
http://www.qhull.org/ (on Windows this comes with Scipy).
plot3D meshes and plots random convex transformable data in both cartesian
and spherical coordinates
Play around wi... | pbfy0/visvis | examples/surfaceFromRandomPoints.py | Python | bsd-3-clause | 6,186 |
from __future__ import absolute_import
from django.conf import settings
from django.template import Library
from sentry import options
from sentry.utils.assets import get_asset_url
from sentry.utils.http import absolute_uri
register = Library()
register.simple_tag(get_asset_url, name='asset_url')
@register.simpl... | JackDanger/sentry | src/sentry/templatetags/sentry_assets.py | Python | bsd-3-clause | 1,943 |
#!/usr/bin/env python
#
# Copyright 2007 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... | ychen820/microblog | y/google-cloud-sdk/platform/google_appengine/google/appengine/ext/mapreduce/operation/counters.py | Python | bsd-3-clause | 1,239 |
"""log model admin."""
from django.contrib import admin
from django.db import models
from django.forms.widgets import TextInput
from apps.managers.challenge_mgr import challenge_mgr
from apps.managers.log_mgr.models import MakahikiLog
from apps.admin.admin import challenge_designer_site, challenge_manager_site, develop... | yongwen/makahiki | makahiki/apps/managers/log_mgr/admin.py | Python | mit | 1,266 |
# 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... | gunan/tensorflow | tensorflow/python/kernel_tests/pool_test.py | Python | apache-2.0 | 14,854 |
"""
Copyright (C) 2004-2015 Pivotal Software, Inc. All rights reserved.
This program and the accompanying materials are made available under
the terms of the 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
... | rvs/gpdb | src/test/tinc/tincrepo/mpp/gpdb/tests/storage/walrepl/basebackup/test_filespace.py | Python | apache-2.0 | 3,304 |
from libcloud.loadbalancer.types import Provider
from libcloud.loadbalancer.providers import get_driver
ACCESS_ID = 'your access id'
SECRET_KEY = 'your secret key'
cls = get_driver(Provider.ELB)
driver = cls(key=ACCESS_ID, secret=SECRET_KEY)
print(driver.ex_list_balancer_policy_types())
| mistio/libcloud | docs/examples/loadbalancer/elb/ex_list_balancer_policy_types.py | Python | apache-2.0 | 291 |
#-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2015, Continuum Analytics, Inc. All rights reserved.
#
# Powered by the Bokeh Development Team.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#----------------------------------------... | ChinaQuants/bokeh | bokeh/server/tests/test_auth.py | Python | bsd-3-clause | 1,085 |
# 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.
from optparse import OptionParser
import unittest
import six
from telemetry.page import shared_page_state
from contrib.cluster_telemetry import rasterize_... | scheib/chromium | tools/perf/contrib/cluster_telemetry/ct_benchmarks_unittest.py | Python | bsd-3-clause | 4,992 |
from lixian_plugins.api import command
from lixian_cli_parser import command_line_parser, command_line_option
from lixian_cli_parser import with_parser
from lixian_cli import parse_login
from lixian_commands.util import create_client
@command(name='get-torrent', usage='get .torrent by task id or info hash')
@command... | GeassDB/xunlei-lixian | lixian_plugins/commands/get_torrent.py | Python | mit | 1,302 |
from __future__ import unicode_literals
import warnings
from operator import attrgetter
from django import forms
from django.apps import apps
from django.core import checks, exceptions
from django.core.exceptions import FieldDoesNotExist
from django.db import connection, connections, router, transaction
from django.d... | willzhang05/postgrestesting1 | postgrestesting1/lib/python3.5/site-packages/django/db/models/fields/related.py | Python | mit | 114,783 |
#!/usr/bin/python
#
# PubNub Real-time Cloud-Hosted Push API and Push Notification Client
# Frameworks
# Copyright (C) 2016 PubNub Inc.
# http://www.pubnub.com/
# http://www.pubnub.com/terms
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_i... | sgerhart/ansible | lib/ansible/modules/cloud/pubnub/pubnub_blocks.py | Python | mit | 23,797 |
# coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import logging
impor... | megaserg/pants | src/python/pants/util/osutil.py | Python | apache-2.0 | 1,325 |
# Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Martin Luessi <mluessi@nmr.mgh.harvard.edu>
# Eric Larson <larson.eric.d@gmail.com>
# License: BSD Style.
from ...utils import verbose
from ..utils import _data_path, _data_path_doc
@verbose
def data_path(path=None, force_upd... | adykstra/mne-python | mne/datasets/misc/_misc.py | Python | bsd-3-clause | 697 |
# -*- coding: utf-8 -*-
"""
=======================================
Brainstorm CTF phantom tutorial dataset
=======================================
Here we compute the evoked from raw for the Brainstorm CTF phantom
tutorial dataset. For comparison, see [1]_ and:
http://neuroimage.usc.edu/brainstorm/Tutorials/Phan... | jaeilepp/mne-python | tutorials/plot_brainstorm_phantom_ctf.py | Python | bsd-3-clause | 4,215 |
# coding: utf8
# Author: Rodrigo Bistolfi
# Date: 03/2013
""" Test cases for Nikola ReST extensions.
A base class ReSTExtensionTestCase provides the tests basic behaivor.
Subclasses must override the "sample" class attribute with the ReST markup.
The sample will be rendered as HTML using publish_parts() by setUp().
O... | agustinhenze/nikola.debian | tests/test_rst_compiler.py | Python | mit | 10,799 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models
from odoo.tools.safe_eval import safe_eval
class Team(models.Model):
_name = 'crm.team'
_inherit = ['mail.alias.mixin', 'crm.team']
resource_calendar_id = fields.Many2o... | hip-odoo/odoo | addons/crm/models/crm_team.py | Python | agpl-3.0 | 3,700 |
import json
import os
import time
import uuid
from google.appengine.api import urlfetch
from models import Profile
def getUserId(user, id_type="email"):
if id_type == "email":
return user.email()
if id_type == "oauth":
"""A workaround implementation for getting userid."""
auth = os.g... | AndrBecker/conference-central | utils.py | Python | apache-2.0 | 1,577 |
# Copyright (c) 2011 OpenStack, LLC.
# 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 requi... | tylertian/Openstack | openstack F/nova/nova/scheduler/filters/extra_specs_ops.py | Python | apache-2.0 | 2,088 |
"""
Copyright (c) 2016-2017 Dell Inc. or its subsidiaries. All Rights Reserved.
"""
import logging
import os
from nose.plugins import Plugin
from stream_sources import LoggingMarker, SelfTestStreamMonitor, AMQPStreamMonitor, SSHHelper
import sys
from nose.pyversion import format_exception
from nose.plugins.xunit import... | RackHD/RackHD | test/stream-monitor/sm_plugin/stream_monitor.py | Python | apache-2.0 | 8,487 |
from .base import *
from .pca import *
from .cur import *
from .manifold import *
| marinkaz/orange3 | Orange/projection/__init__.py | Python | bsd-2-clause | 82 |
"""Univariate features selection."""
# Authors: V. Michel, B. Thirion, G. Varoquaux, A. Gramfort, E. Duchesnay.
# L. Buitinck, A. Joly
# License: BSD 3 clause
import numpy as np
import warnings
from scipy import special, stats
from scipy.sparse import issparse
from ..base import BaseEstimator
from ..prepr... | chrsrds/scikit-learn | sklearn/feature_selection/univariate_selection.py | Python | bsd-3-clause | 28,149 |
#!/usr/bin/env python
#
# Copyright (c) 2016 Intel Corporation.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of works must retain the original copyright notice, this
# list of conditions and t... | crosswalk-project/crosswalk-test-suite | apptools/apptools-android-tests/apptools/manifest_xwalk_target_platforms.py | Python | bsd-3-clause | 6,310 |
"""Implementation of JSONEncoder
"""
from __future__ import absolute_import
import re
from operator import itemgetter
# Do not import Decimal directly to avoid reload issues
import decimal
from .compat import u, unichr, binary_type, string_types, integer_types, PY3
def _import_speedups():
try:
from . import... | samvarankashyap/googlecloudutility2 | lib/simplejson/simplejson/encoder.py | Python | apache-2.0 | 25,806 |
from __future__ import unicode_literals
# Ensure 'assert_raises' context manager support for Python 2.6
import tests.backport_assert_raises
from nose.tools import assert_raises
import boto
import six
import sure # noqa
from boto.exception import EC2ResponseError
from moto import mock_ec2
@mock_ec2
def test_key_pai... | pior/moto | tests/test_ec2/test_key_pairs.py | Python | apache-2.0 | 2,532 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('partner', '0001_initial'),
('catalogue', '0001_initial'),
('basket', '0001_initial'),
... | vicky2135/lucious | src/oscar/apps/basket/migrations/0002_auto_20140827_1705.py | Python | bsd-3-clause | 1,879 |
#!/usr/bin/env python3
# Copyright (c) 2022 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 logic for setting nMaxTipAge on command line.
Nodes don't consider themselves out of "initial block do... | particl/particl-core | test/functional/feature_maxtipage.py | Python | mit | 1,997 |
# -*- 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... | ovnicraft/openerp-restaurant | sale/report/__init__.py | Python | agpl-3.0 | 1,065 |
# Copyright (C) 2013 Nippon Telegraph and Telephone Corporation.
#
# 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... | mikhaelharswanto/ryu | ryu/lib/xflow/sflow.py | Python | apache-2.0 | 15,509 |
import decimal
import unittest
from btceapi.public import *
class TestPublic(unittest.TestCase):
def test_constructTrade(self):
d = {"pair": "btc_usd",
"trade_type": "bid",
"price": decimal.Decimal("1.234"),
"tid": 1,
"amount": decimal.Decimal("3.2"),
... | dunphyben/btce-api | test/test_public.py | Python | mit | 2,447 |
#!/usr/bin/python
#
# 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 of the License, or
# (at your option) any later version.
#
# Ansible is distribut... | bregman-arie/ansible | lib/ansible/modules/network/eos/eos_banner.py | Python | gpl-3.0 | 6,270 |
from __future__ import division
import numpy as np
from .._shared.utils import assert_nD
from . import _hoghistogram
def hog(image, orientations=9, pixels_per_cell=(8, 8),
cells_per_block=(3, 3), visualise=False, normalise=False):
"""Extract Histogram of Oriented Gradients (HOG) for a given image.
Co... | michaelpacer/scikit-image | skimage/feature/_hog.py | Python | bsd-3-clause | 7,022 |
#!/usr/bin/env python
#
# Wrapper script for Java Conda packages that ensures that the java runtime
# is invoked with the right options. Adapted from the bash script (http://stackoverflow.com/questions/59895/can-a-bash-script-tell-what-directory-its-stored-in/246128#246128).
#
# Program Parameters
#
import os
import s... | ostrokach/bioconda-recipes | recipes/pgdspider/PGDSpider2-cli.py | Python | mit | 3,267 |
# 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... | Mega-DatA-Lab/mxnet | tests/python/unittest/test_multi_device_exec.py | Python | apache-2.0 | 3,000 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('taggit', '0001_initial'),
]
operations = [
migrations.AlterIndexTogether(
name='taggeditem',
index_t... | nealtodd/django-taggit | taggit/migrations/0002_auto_20150616_2121.py | Python | bsd-3-clause | 383 |
__author__ = 'nir0s'
| cloudify-cosmo/yo-ci | yoci/tests/__init__.py | Python | apache-2.0 | 21 |
# Copyright (c) 2014 Red Hat, 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 require... | thomasem/nova | nova/scheduler/client/__init__.py | Python | apache-2.0 | 2,731 |
# -*- coding: utf-8 -*-
# Open Source Initiative OSI - The MIT License (MIT):Licensing
#
# The MIT License (MIT)
# Copyright (c) 2015 François-Xavier Bourlet (bombela+zerorpc@gmail.com)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files... | tempbottle/zerorpc-python | tests/test_heartbeat.py | Python | mit | 12,536 |
#!/usr/bin/env python
# -*- coding: UTF8 -*-
# ---------------------------------------------------------------
# Copyright (c) 2015, Nicolas VERDIER (contact@n1nj4.eu)
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following c... | 54Pany/pupy | pupy/genpayload.py | Python | bsd-3-clause | 3,991 |
from itertools import product
import numpy as np
from numpy.testing import (assert_almost_equal, assert_array_almost_equal,
assert_equal)
from sklearn import datasets
from sklearn import manifold
from sklearn import neighbors
from sklearn import pipeline
from sklearn import preprocessing
fro... | vortex-ape/scikit-learn | sklearn/manifold/tests/test_isomap.py | Python | bsd-3-clause | 4,726 |
#!/usr/bin/env python
# parse and construct FlightGear NET FDM packets
# Andrew Tridgell, November 2011
# released under GNU GPL version 2 or later
import struct, math
class fgFDMError(Exception):
'''fgFDM error class'''
def __init__(self, msg):
Exception.__init__(self, msg)
self.message = 'fg... | kanjie128/test | pymavlink/fgFDM.py | Python | lgpl-3.0 | 9,572 |
"""
Copyright 2011 Software Freedom Conservancy.
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 w... | superchilli/webapp | venv/lib/python2.7/site-packages/selenium/selenium.py | Python | mit | 77,927 |
#!/usr/bin/env python
"""This example demonstrates creating an image with numpy
python, and displaying that through SDL. You can look at the
method of importing numpy and pygame.surfarray. This method
will fail 'gracefully' if it is not available.
I've tried mixing in a lot of comments where the code might
not be self... | mark-me/Pi-Jukebox | venv/Lib/site-packages/pygame/examples/vgrade.py | Python | agpl-3.0 | 3,320 |
"""
The splitter layout classes provide a mechanism to horizontally
or vertically stack child widgets, where the available space can be
manually specified by the user.
Example:
.. UIExample:: 200
from flexx import ui
class Example(ui.Widget):
def init(self):
with ui.HSplitter():
... | synmnstr/flexx | flexx/ui/_splitter.py | Python | bsd-2-clause | 16,430 |
#!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019 Fortinet, Inc.
#
# 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 Lic... | alxgu/ansible | lib/ansible/modules/network/fortios/fortios_system_dns.py | Python | gpl-3.0 | 9,145 |
'''
Check the performance counters from SQL Server
See http://blogs.msdn.com/b/psssql/archive/2013/09/23/interpreting-the-counter-values-from-sys-dm-os-performance-counters.aspx
for information on how to report the metrics available in the sys.dm_os_performance_counters table
'''
# stdlib
import traceback
# 3rd party... | oneandoneis2/dd-agent | checks.d/sqlserver.py | Python | bsd-3-clause | 17,085 |
"""
Functions which are common and require SciPy Base and Level 1 SciPy
(special, linalg)
"""
from numpy import arange, newaxis, hstack, prod, array, frombuffer, load
__all__ = ['central_diff_weights', 'derivative', 'ascent', 'face',
'electrocardiogram']
def central_diff_weights(Np, ndiv=1):
"""
... | pizzathief/scipy | scipy/misc/common.py | Python | bsd-3-clause | 9,678 |
import re
import uuid
import six
from django.test import TestCase
from django_extensions.db.fields import PostgreSQLUUIDField
from .testapp.models import (
UUIDTestAgregateModel, UUIDTestManyToManyModel, UUIDTestModel_field,
UUIDTestModel_pk,
)
class UUIDFieldTest(TestCase):
def test_UUID_field_create(... | rodo/django-extensions | tests/test_uuid_field.py | Python | mit | 2,355 |
# 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 contextlib
import json
import logging
import re
import urllib2
from telemetry.core import exceptions
from telemetry.core import util
from telemetry.i... | Chilledheart/chromium | tools/telemetry/telemetry/internal/backends/chrome/ios_browser_backend.py | Python | bsd-3-clause | 4,612 |
self.description = "Upgrade a package that provides one of two imaginary packages"
lp1 = pmpkg("pkg1")
lp1.depends = ["imaginary", "imaginary2"]
self.addpkg2db("local", lp1)
lp2 = pmpkg("pkg2")
lp2.provides = ["imaginary"]
self.addpkg2db("local", lp2)
lp3 = pmpkg("pkg3")
lp3.provides = ["imaginary2"]
self.addpkg2db(... | kylon/pacman-fakeroot | test/pacman/tests/upgrade055.py | Python | gpl-2.0 | 618 |
#!/usr/bin/env python
#
# Copyright 2013 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.
"""Convert Android xml resources to API 14 compatible.
There are two reasons that we cannot just use API 17 attributes,
so we are ge... | mdakin/engine | build/android/gyp/generate_v14_compatible_resources.py | Python | bsd-3-clause | 11,922 |
#!/usr/bin/env python
""" This module tries to retrieve as much platform-identifying data as
possible. It makes this information available via function APIs.
If called from the command line, it prints the platform
information concatenated as single string to stdout. The output
format is useable as par... | pniedzielski/fb-hackathon-2013-11-21 | src/repl.it/jsrepl/extern/python/unclosured/lib/python2.7/platform.py | Python | agpl-3.0 | 52,280 |
#
# Copyright (c) 2011 Thomas Graf <tgraf@suug.ch>
#
"""Module providing access to network addresses
"""
from __future__ import absolute_import
__version__ = '1.0'
__all__ = [
'AddressCache',
'Address']
import datetime
from .. import core as netlink
from . import capi as capi
from . import link as Link
f... | jckuester/droidtracer-module | src/main/jni/libnl-3.2.22/python/netlink/route/address.py | Python | gpl-2.0 | 11,028 |
# $Id$
#
import inc_const as const
PJSUA = ["--null-audio --max-calls=1 $SIPP_URI"]
PJSUA_EXPECTS = [[0, const.STATE_CONFIRMED, "v"]]
| nigusgirma/https-svn.pjsip.org-repos-pjproject-trunk- | tests/pjsua/scripts-sipp/uas-answer-200-reinvite-without-sdp.py | Python | gpl-2.0 | 136 |
"""
Shopify OAuth2 backend, docs at:
http://psa.matiasaguirre.net/docs/backends/shopify.html
"""
import imp
import six
from social.utils import handle_http_errors
from social.backends.oauth import BaseOAuth2
from social.exceptions import AuthFailed, AuthCanceled
class ShopifyOAuth2(BaseOAuth2):
"""Shopify OA... | GbalsaC/bitnamiP | venv/lib/python2.7/site-packages/social/backends/shopify.py | Python | agpl-3.0 | 3,362 |
# -*- encoding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in root directory
##############################################################################
from . import controllers
| acsone/website | website_sale_collapse_categories/__init__.py | Python | agpl-3.0 | 289 |
# Copyright 2011, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | CyanogenMod/android_external_chromium-trace | trace-viewer/third_party/pywebsocket/src/mod_pywebsocket/util.py | Python | bsd-3-clause | 16,267 |
# Copyright 2011 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 requ... | scripnichenko/nova | nova/api/openstack/compute/legacy_v2/versions.py | Python | apache-2.0 | 1,026 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2012 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.... | samsu/neutron | openstack/common/policy.py | Python | apache-2.0 | 21,618 |
# 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... | ghchinoy/tensorflow | tensorflow/contrib/learn/python/learn/datasets/base.py | Python | apache-2.0 | 8,304 |
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.internet._pollingfile}.
"""
from twisted.python.runtime import platform
from twisted.trial.unittest import TestCase
if platform.isWindows():
from twisted.internet import _pollingfile
else:
_pollingfile = None
c... | skycucumber/Messaging-Gateway | webapp/venv/lib/python2.7/site-packages/twisted/internet/test/test_pollingfile.py | Python | gpl-2.0 | 1,276 |