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 |
|---|---|---|---|---|---|
# flake8: noqa
from .store import Store
from .errors import StoreError, CredentialsNotFound
from .constants import * | jarv/cmdchallenge-site | lambda_src/runcmd/dockerpycreds/__init__.py | Python | mit | 116 |
#!/usr/bin/env python
import cPickle
from pygraph.classes.graph import graph
from pygraph.classes.exceptions import AdditionError
"""
This script converts a binary protein-protein interaction
file from HPRD (http://http://www.hprd.org/) into a cPickled
graph generated by the python-graph library. The resulting
file ... | heuermh/gemini | gemini/annotation_provenance/HPRD/hprd_graph.py | Python | mit | 1,338 |
#
# XendBootloader.py - Framework to run a boot loader for picking the kernel
#
# Copyright 2005-2006 Red Hat, Inc.
# Jeremy Katz <katzj@redhat.com>
#
# This software may be freely redistributed under the terms of the GNU
# general public license.
#
# You should have received a copy of the GNU General Public License
# ... | sudkannan/xen-hv | tools/python/xen/xend/XendBootloader.py | Python | gpl-2.0 | 7,323 |
#
# Copyright (c) 2004 Conectiva, Inc.
#
# Written by Gustavo Niemeyer <niemeyer@conectiva.com>
#
# This file is part of Smart Package Manager.
#
# Smart Package Manager 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 Fou... | colloquium/spacewalk | client/solaris/smartpm/smart/backends/rpm/base.py | Python | gpl-2.0 | 6,998 |
# -*- coding: utf-8 -*-
#
# one_neuron.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST 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
... | alberto-antonietti/nest-simulator | pynest/examples/one_neuron.py | Python | gpl-2.0 | 3,758 |
# -*- coding: utf-8 -*-
##
## This file is part of CDS Invenio.
## Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 CERN.
##
## CDS Invenio 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... | ppiotr/Bibedit-some-refactoring | modules/webjournal/lib/widgets/bfe_webjournal_widget_latestPhoto.py | Python | gpl-2.0 | 3,928 |
#!/usr/bin/env python3
# Copyright © 2012-13 Qtrac Ltd. All rights reserved.
# This program or module 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 ... | lovexiaov/python-in-practice | texteditor2/Display.py | Python | gpl-3.0 | 4,435 |
"""Dialogs and tools that in general can be used standalone in QGIS."""
| drayanaindra/inasafe | safe_qgis/tools/__init__.py | Python | gpl-3.0 | 72 |
#
# The Python Imaging Library.
# $Id$
#
# transform wrappers
#
# History:
# 2002-04-08 fl Created
#
# Copyright (c) 2002 by Secret Labs AB
# Copyright (c) 2002 by Fredrik Lundh
#
# See the README file for information on usage and redistribution.
#
from PIL import Image
class Transform(Image.ImageTransformHandler)... | DanteOnline/free-art | venv/lib/python3.4/site-packages/PIL/ImageTransform.py | Python | gpl-3.0 | 2,878 |
# SPDX-License-Identifier: MIT
# Scanner produces tokens of the following types:
# STREAM-START
# STREAM-END
# DIRECTIVE(name, value)
# DOCUMENT-START
# DOCUMENT-END
# BLOCK-SEQUENCE-START
# BLOCK-MAPPING-START
# BLOCK-END
# FLOW-SEQUENCE-START
# FLOW-MAPPING-START
# FLOW-SEQUENCE-END
# FLOW-MAPPING-END
# BLOCK-ENTRY
... | ktsaou/netdata | collectors/python.d.plugin/python_modules/pyyaml2/scanner.py | Python | gpl-3.0 | 52,661 |
# file: runme.py
import example
# Call our gcd() function
x = 42
y = 105
g = example.gcd(x, y)
print "The gcd of %d and %d is %d" % (x, y, g)
# Call the gcdmain() function
example.gcdmain(["gcdmain", "42", "105"])
# Call the count function
print example.count("Hello World", "l")
# Call the capitalize function
pr... | DGA-MI-SSI/YaCo | deps/swig-3.0.7/Examples/python/multimap/runme.py | Python | gpl-3.0 | 358 |
# test_tournament.py - unit tests for the tournament module
#
# Copyright 2015 NetworkX developers.
#
# This file is part of NetworkX.
#
# NetworkX is distributed under a BSD license; see LICENSE.txt for more
# information.
"""Unit tests for the :mod:`networkx.algorithms.tournament` module."""
from itertools import com... | kenshay/ImageScript | ProgramData/SystemFiles/Python/Lib/site-packages/networkx/algorithms/tests/test_tournament.py | Python | gpl-3.0 | 4,558 |
########################################################################
#
# File Name: HTMLOListElement
#
#
### This file is automatically generated by GenerateHtml.py.
### DO NOT EDIT!
"""
WWW: http://4suite.com/4DOM e-mail: support@4suite.com
Copyright (c) 2000 Fourthought Inc, USA. All Right... | selfcommit/gaedav | pyxml/dom/html/HTMLOListElement.py | Python | lgpl-2.1 | 1,873 |
# Copyright (c) 2010-2012 OpenStack Foundation
#
# 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... | hbhdytf/mac | swift/common/utils.py | Python | apache-2.0 | 130,602 |
from __future__ import absolute_import, unicode_literals
from mopidy import listener
class CoreListener(listener.Listener):
"""
Marker interface for recipients of events sent by the core actor.
Any Pykka actor that mixes in this class will receive calls to the methods
defined here when the correspo... | mokieyue/mopidy | mopidy/core/listener.py | Python | apache-2.0 | 5,283 |
# 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... | alex8866/cinder | cinder/tests/api/v1/test_snapshot_metadata.py | Python | apache-2.0 | 21,261 |
from django.db import models
from django.core.exceptions import MultipleObjectsReturned
from expedient.clearinghouse.aggregate.models import Aggregate
from expedient.common.permissions.shortcuts import must_have_permission
from vt_plugin.models.VM import VM
# Virtualization Plugin class
class VtPlugin(Aggregate):
... | dana-i2cat/felix | expedient/src/python/plugins/vt_plugin/models/VtPlugin.py | Python | apache-2.0 | 3,112 |
"""Base classes for channels."""
import asyncio
from enum import Enum
from functools import wraps
import logging
from typing import Any, Union
import zigpy.exceptions
from homeassistant.core import callback
from .. import typing as zha_typing
from ..const import (
ATTR_ARGS,
ATTR_ATTRIBUTE_ID,
ATTR_ATTR... | tboyce021/home-assistant | homeassistant/components/zha/core/channels/base.py | Python | apache-2.0 | 12,609 |
# -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... | adamhaney/airflow | tests/contrib/operators/test_gcp_bigtable_operator.py | Python | apache-2.0 | 29,272 |
# coding: utf-8
from __future__ import absolute_import
from datetime import date, datetime # noqa: F401
from typing import List, Dict # noqa: F401
from tapi_server.models.base_model_ import Model
from tapi_server.models.tapi_photonic_media_application_identifier_type import TapiPhotonicMediaApplicationIdentifierTy... | OpenNetworkingFoundation/ONFOpenTransport | RI/flask_server/tapi_server/models/tapi_photonic_media_application_identifier.py | Python | apache-2.0 | 3,599 |
# 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... | Thingee/cinder | cinder/tests/api/v2/test_snapshot_metadata.py | Python | apache-2.0 | 21,148 |
# Copyright 2011 OpenStack Foundation
# Copyright 2012 Justin Santa Barbara
#
# 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
#
#... | mmnelemane/nova | nova/tests/unit/api/openstack/compute/test_security_groups.py | Python | apache-2.0 | 67,497 |
from __future__ import absolute_import
from __future__ import print_function
from typing import Any
from argparse import ArgumentParser
from django.core.management.base import BaseCommand
from zerver.models import Realm, RealmAlias, get_realm, can_add_alias
from zerver.lib.actions import do_get_realm_aliases
import s... | amyliu345/zulip | zerver/management/commands/realm_alias.py | Python | apache-2.0 | 2,022 |
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2011 Justin Santa Barbara
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance wi... | Metaswitch/calico-nova | nova/openstack/common/service.py | Python | apache-2.0 | 15,254 |
# 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... | szha/mxnet | tests/python/gpu/test_kvstore_gpu.py | Python | apache-2.0 | 6,074 |
# Copyright 2009-2010 10gen, 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,... | mher/pymongo | pymongo/son.py | Python | apache-2.0 | 600 |
"""Checks import position rule"""
# pylint: disable=unused-import,relative-import,ungrouped-imports,import-error,no-name-in-module
import y
try:
import x
except ImportError:
pass
else:
pass
| axbaretto/beam | sdks/python/.tox/lint/lib/python2.7/site-packages/pylint/test/functional/wrong_import_position9.py | Python | apache-2.0 | 202 |
# Copyright (C) 2013 eNovance SAS <licensing@enovance.com>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | sebrandon1/neutron | neutron/services/metering/agents/metering_agent.py | Python | apache-2.0 | 11,182 |
# -*- 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 | tests/operators/sensors.py | Python | apache-2.0 | 11,787 |
"""
The `~certbot_dns_dnsmadeeasy.dns_dnsmadeeasy` plugin automates the process of
completing a ``dns-01`` challenge (`~acme.challenges.DNS01`) by creating, and
subsequently removing, TXT records using the DNS Made Easy API.
.. note::
The plugin is not installed by default. It can be installed by heading to
`cer... | letsencrypt/letsencrypt | certbot-dns-dnsmadeeasy/certbot_dns_dnsmadeeasy/__init__.py | Python | apache-2.0 | 3,576 |
from __future__ import division
from nose.tools import assert_equal
from nose.tools import assert_false
from nose.tools import assert_raises
from nose.tools import raises
import networkx as nx
from networkx.utils import pairwise
def validate_path(G, s, t, soln_len, path):
assert_equal(path[0], s)
assert_equ... | cmtm/networkx | networkx/algorithms/shortest_paths/tests/test_weighted.py | Python | bsd-3-clause | 25,025 |
from distutils.version import LooseVersion
import django
# These means "less than or equal to DJANGO_FOO_BAR"
DJANGO_1_8 = LooseVersion(django.get_version()) < LooseVersion('1.9')
DJANGO_1_9 = LooseVersion(django.get_version()) < LooseVersion('1.10')
DJANGO_1_10 = LooseVersion(django.get_version()) < LooseVersion('1.... | nimbis/django-cms | cms/utils/compat/__init__.py | Python | bsd-3-clause | 325 |
"""This is a simple example that shows how to create a reader factory
and register that reader with mayavi.
To use this:
- put this in ~/.mayavi2/
- then import this module in your ~/.mayavi2/user_mayavi.py.
that's it.
What you should get:
- Options to open .zzz files from the file->open menu.
- Op... | liulion/mayavi | examples/mayavi/zzz_reader.py | Python | bsd-3-clause | 1,778 |
from .rcmod import *
from .utils import *
from .palettes import *
from .linearmodels import *
from .categorical import *
from .distributions import *
from .timeseries import *
from .matrix import *
from .miscplot import *
from .axisgrid import *
from .xkcd_rgb import xkcd_rgb
from .crayons import crayons
set()
__versi... | jakevdp/seaborn | seaborn/__init__.py | Python | bsd-3-clause | 337 |
#!/usr/bin/env python
#
# Copyright (c) 2011, Willow Garage, 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
# n... | stonier/ecto | test/benchmark/metrics.py | Python | bsd-3-clause | 4,501 |
from django.db import connections
import commonware.log
import multidb
from celery.task.sets import TaskSet
import cronjobs
from olympia.amo import VALID_STATUSES
from olympia.amo.utils import chunked
from .models import UserProfile
from .tasks import update_user_ratings_task
task_log = commonware.log.getLogger('z.... | andymckay/addons-server | src/olympia/users/cron.py | Python | bsd-3-clause | 1,853 |
# 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
from telemetry import decorators
from telemetry.core import util
util.AddDirToPythonPath(util.GetTelemetryDir(), 'third_party', 'mock')
imp... | Just-D/chromium-1 | tools/telemetry/telemetry/decorators_unittest.py | Python | bsd-3-clause | 5,452 |
#!/usr/bin/env python
from circuits import Component
Component().run()
| treemo/circuits | docs/source/tutorials/woof/001.py | Python | mit | 73 |
"""
Support for Vera cover - curtains, rollershutters etc.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/cover.vera/
"""
import logging
from homeassistant.components.cover import CoverDevice
from homeassistant.components.vera import (
VeraDevice, V... | Smart-Torvy/torvy-home-assistant | homeassistant/components/cover/vera.py | Python | mit | 1,970 |
# coding: utf-8
# pylint: disable=too-few-public-methods, no-self-use, missing-docstring, unused-argument
from flask_restful import reqparse, Resource
from flask import abort
from main import API
import task
import config
from api.helpers import ArgumentValidator, make_empty_ok_response
from api.decorators import verif... | madvas/gae-angular-material-starter | main/api/v1/feedback_api.py | Python | mit | 1,108 |
#!/usr/bin/env python
#
# __COPYRIGHT__
#
# 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, merge, publish,
... | timj/scons | test/packaging/strip-install-dir.py | Python | mit | 2,169 |
# Copyright 2014 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompa... | AccelAI/accel.ai | flask-aws/lib/python2.7/site-packages/ebcli/operations/scaleops.py | Python | mit | 2,296 |
# Partname: ATmega644PA
# generated automatically, do not edit
MCUREGS = {
'ADCSRB': '&123',
'ADCSRB_ACME': '$40',
'ACSR': '&80',
'ACSR_ACD': '$80',
'ACSR_ACBG': '$40',
'ACSR_ACO': '$20',
'ACSR_ACI': '$10',
'ACSR_ACIE': '$08',
'ACSR_ACIC': '$04',
'ACSR_ACIS': '$03',
'DIDR1': '&127',
'DIDR... | hickey/amforth | core/devices/atmega644pa/device.py | Python | gpl-2.0 | 7,376 |
# User creation text spoke
#
# Copyright (C) 2013-2014 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This program is distrib... | jkonecny12/anaconda | pyanaconda/ui/tui/spokes/user.py | Python | gpl-2.0 | 11,266 |
"""
This file is part of ALTcointip.
ALTcointip 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.
ALTcointip is distr... | Healdb/altcointip | src/ctb/ctb_coin.py | Python | gpl-2.0 | 8,785 |
#!/usr/bin/env python2
#
# Copyright (C) 2013-2017(H)
# Max Planck Institute for Polymer Research
#
# This file is part of ESPResSo++.
#
# ESPResSo++ 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,... | niktre/espressopp | testsuite/pi_water/water.py | Python | gpl-3.0 | 8,192 |
def test_waveform(**args):
import numpy
from pycbc.types import TimeSeries
flow = args['f_lower'] # Required parameter
dt = args['delta_t'] # Required parameter
fpeak = args['fpeak'] # A new parameter for my model
t = numpy.arange(0, 10, dt)
f = t/t.max() * (fpeak - flow) + flow
a =... | ligo-cbc/pycbc | examples/waveform/add_waveform.py | Python | gpl-3.0 | 1,513 |
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
import os
import sys
from wptrunner import wptcommandline
here = os.path.split(__file__)[0]
def wpt_path(*args):
... | peterjoel/servo | tests/wpt/update.py | Python | mpl-2.0 | 1,083 |
# coding=utf-8
"""
Layer that support point clustering
===================================
"""
from os.path import dirname, join
from math import sin, log, pi, atan, exp, floor, sqrt
from mapview.view import MapLayer, MapMarker
from kivy.lang import Builder
from kivy.metrics import dp
from kivy.properties import (Obje... | shivan1b/pydelhi_mobile | pydelhiconf/libs/garden/garden.mapview/mapview/clustered_marker_layer.py | Python | agpl-3.0 | 13,896 |
import os
import socket
import fedmsg.config
from nose.tools.nontrivial import make_decorator
try:
import unittest2 as unittest
except ImportError:
import unittest
def load_config(name='fedmsg-test-config.py'):
here = os.path.sep.join(__file__.split(os.path.sep)[:-1])
test_config = os.path.sep.join(... | vivekanand1101/fedmsg | fedmsg/tests/common.py | Python | lgpl-2.1 | 1,482 |
__author__ = 'Daan Wierstra and Tom Schaul'
from scipy import tanh
from neuronlayer import NeuronLayer
from module import Module
from pybrain.structure.parametercontainer import ParameterContainer
from pybrain.tools.functions import sigmoid, sigmoidPrime, tanhPrime
class LSTMLayer(NeuronLayer, ParameterContainer):
... | hassaanm/stock-trading | src/pybrain/structure/modules/lstm.py | Python | apache-2.0 | 5,940 |
# coding: utf-8
"""
Copyright 2015 SmartBear Software
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... | dimtruck/magnum | magnum/common/pythonk8sclient/swagger_client/models/v1_service_status.py | Python | apache-2.0 | 2,814 |
"""Copyright 2008 Orbitz WorldWide
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... | criteo-forks/graphite-web | webapp/graphite/user_util.py | Python | apache-2.0 | 1,975 |
"""Support for Mailgun."""
import hashlib
import hmac
import json
import logging
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant.const import CONF_API_KEY, CONF_DOMAIN, CONF_WEBHOOK_ID
from homeassistant.helpers import config_entry_flow
_LOGGER = logging.getLogger(__n... | MartinHjelmare/home-assistant | homeassistant/components/mailgun/__init__.py | Python | apache-2.0 | 2,900 |
# Copyright 2015 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | googleapis/python-dns | tests/unit/test_changes.py | Python | apache-2.0 | 12,894 |
"""
Make sure the frame variable -g, -a, and -l flags work.
"""
from __future__ import print_function
import lldb
import lldbsuite.test.lldbutil as lldbutil
from lldbsuite.test.lldbtest import *
class TestFrameVar(TestBase):
mydir = TestBase.compute_mydir(__file__)
# If your test case doesn't stress debu... | apple/swift-lldb | packages/Python/lldbsuite/test/commands/frame/var/TestFrameVar.py | Python | apache-2.0 | 3,699 |
"""
This is only meant to add docs to objects defined in C-extension modules.
The purpose is to allow easier editing of the docstrings without
requiring a re-compile.
NOTE: Many of the methods of ndarray have corresponding functions.
If you update these docstrings, please keep also the ones in
core/fromnum... | rmcgibbo/numpy | numpy/add_newdocs.py | Python | bsd-3-clause | 218,413 |
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from nipype.testing import assert_equal
from nipype.interfaces.slicer.filtering.denoising import GaussianBlurImageFilter
def test_GaussianBlurImageFilter_inputs():
input_map = dict(args=dict(argstr='%s',
),
environ=dict(nohash=True,
usedefault=True,... | mick-d/nipype_source | nipype/interfaces/slicer/filtering/tests/test_auto_GaussianBlurImageFilter.py | Python | bsd-3-clause | 1,206 |
# -*- coding: utf-8 -*-
"""
=========
Constants
=========
.. currentmodule:: numpy
NumPy includes several constants:
%(constant_list)s
"""
#
# Note: the docstring is autogenerated.
#
from __future__ import division, absolute_import, print_function
import textwrap, re
# Maintain same format as in numpy.add_newdocs
... | jorisvandenbossche/numpy | numpy/doc/constants.py | Python | bsd-3-clause | 9,291 |
from .kern import Kern
from ...core.parameterization import Param
from paramz.transformations import Logexp
import numpy as np
from .independent_outputs import index_to_slices
class ODE_t(Kern):
def __init__(self, input_dim, a=1., c=1.,variance_Yt=3., lengthscale_Yt=1.5,ubias =1., active_dims=None, name='ode... | avehtari/GPy | GPy/kern/src/ODE_t.py | Python | bsd-3-clause | 7,626 |
import os
import ycm_core
flags = [
'-Wall',
'-Wextra',
'-Werror',
'-pedantic',
'-std=c++1y',
#'-stdlib=libc++',
'-x',
'c++',
'-Iinclude',
'-Itest/include',
'-Ilib/jest/include',
'-isystem',
'../BoostParts',
'-isystem',
'/System/Library/Frameworks/Python.framework/Headers',
'-isystem',
'../llvm/include',
'-isystem',
... | jeaye/jeayeson | .ycm_extra_conf.py | Python | bsd-3-clause | 3,051 |
###############################################################################
#
# The MIT License (MIT)
#
# Copyright (c) Tavendo GmbH
#
# 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 with... | nucular/AutobahnPython | examples/twisted/websocket/echo_variants/client_reconnecting.py | Python | mit | 3,140 |
#!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Run regression test suite.
This module calls down into individual test cases via subprocess. It will
f... | Friedbaumer/litecoin | test/functional/test_runner.py | Python | mit | 20,245 |
#!/usr/bin/python -u
import sys
import os
import subprocess
import time
from datetime import datetime
import shutil
import tempfile
import hashlib
import re
import logging
import argparse
################
#### Telegraf Variables
################
# Packaging variables
PACKAGE_NAME = "telegraf"
INSTALL_ROOT_DIR = "/us... | yankcrime/telegraf | scripts/build.py | Python | mit | 38,977 |
# -*- coding: utf-8 -*-
{
"A location that specifies the geographic area for this region. This can be a location from the location hierarchy, or a 'group location', or a location that has a boundary for the area.": "ទីតាំងដែលបញ្ជាក់ផ្ទៃភូមិសាស្ត្រសម្រាប់តំបន់នេះ ។ វាអាចជាទីតាំងមកពីឋានានុក្រមទីតាំង ឬ 'ក្រុមទ... | ahaym/eden | languages/km.py | Python | mit | 359,695 |
#!/usr/bin/python
#
# Urwid graphics example program
# Copyright (C) 2004-2011 Ian Ward
#
# 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 Licen... | uccgit/the-game | test/graph.py | Python | gpl-2.0 | 11,828 |
# -*- coding: utf-8 -*-
# MySQL Connector/Python - MySQL driver written in Python.
# Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
# MySQL Connector/Python is licensed under the terms of the GPLv2
# <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most
# MySQL Connectors. There ar... | gelab/mainr | tests/issues/test_bug21449207.py | Python | gpl-2.0 | 3,079 |
# -*- coding: utf-8 -*-
#
# Copyright (C) Pootle contributors.
#
# This file is a part of the Pootle project. It is distributed under the GPL3
# or later license. See the LICENSE file for a copy of the license and the
# AUTHORS file for copyright and authorship information.
default_app_config = 'accounts.apps.Accounts... | ta2-1/pootle | pootle/apps/accounts/__init__.py | Python | gpl-3.0 | 328 |
if __name__ == '__main__':
import sys
import os
pkg_dir = (os.path.split(
os.path.split(
os.path.split(
os.path.abspath(__file__))[0])[0])[0])
parent_dir, pkg_name = os.path.split(pkg_dir)
is_pygame_pkg = (pkg_name == 'tests' and
... | bhansa/fireball | pyvenv/Lib/site-packages/pygame/tests/run_tests__tests/infinite_loop/fake_1_test.py | Python | gpl-3.0 | 977 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Corwin Brown <blakfeld@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 Lic... | Inspq/ansible | lib/ansible/modules/windows/win_robocopy.py | Python | gpl-3.0 | 4,912 |
from xblock.fragment import Fragment
from xmodule.x_module import XModule
from xmodule.seq_module import SequenceDescriptor
from xmodule.progress import Progress
from pkg_resources import resource_string
# HACK: This shouldn't be hard-coded to two types
# OBSOLETE: This obsoletes 'type'
class_priority = ['video', 'pro... | XiaodunServerGroup/ddyedx | common/lib/xmodule/xmodule/vertical_module.py | Python | agpl-3.0 | 2,477 |
# -*- coding: utf-8 -*-
# This file is part of pygal
#
# A python svg graph plotting library
# Copyright © 2012-2015 Kozea
#
# 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... | supracd/pygal | pygal/test/test_stacked.py | Python | lgpl-3.0 | 2,083 |
from ... import Something
from . import data
try:
from ... import Lala
except ImportError:
pass | arju88nair/projectCulminate | venv/lib/python3.5/site-packages/pylint/test/regrtest_data/beyond_top/__init__.py | Python | apache-2.0 | 108 |
"""
Adds a field to any layer matching the name in all feature services without
republishing
"""
import arcrest
if __name__ == "__main__":
url = "https://<url to spatial data store>/ArcGIS/rest/admin"
username = "<user name>"
password = "<password> "
featureLayerNames = ["layerName1","layerName2"... | pLeBlanc93/ArcREST | samples/HostedFeatureServiceAdmin/addFieldToHostedFeatureService.py | Python | apache-2.0 | 1,256 |
# Enter your code here. Read input from STDIN. Print output to STDOUT | MithileshCParab/HackerRank-10DaysOfStatistics | Problem Solving/Data Structure/Trees/square-ten_three.py | Python | apache-2.0 | 69 |
#!/usr/bin/env python
# pylint: disable=missing-docstring
# flake8: noqa: T001
# ___ ___ _ _ ___ ___ _ _____ ___ ___
# / __| __| \| | __| _ \ /_\_ _| __| \
# | (_ | _|| .` | _|| / / _ \| | | _|| |) |
# \___|___|_|\_|___|_|_\/_/_\_\_|_|___|___/_ _____
# | \ / _ \ | \| |/ _ \_ _| | __| \_ ... | mmahut/openshift-ansible | roles/lib_openshift/library/oc_route.py | Python | apache-2.0 | 63,067 |
# -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... | adamhaney/airflow | airflow/contrib/operators/jenkins_job_trigger_operator.py | Python | apache-2.0 | 11,480 |
# Copyright 2015 Intel 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 applicable law ... | CloudServer/cinder | cinder/objects/backup.py | Python | apache-2.0 | 5,187 |
from __future__ import print_function
import sys
sys.path.insert(1,"../../")
import h2o
from tests import pyunit_utils
#----------------------------------------------------------------------
# Purpose: This tests k-means on a large dataset.
#----------------------------------------------------------------------
d... | YzPaul3/h2o-3 | h2o-py/tests/testdir_hdfs/pyunit_INTERNAL_HDFS_kmeans.py | Python | apache-2.0 | 1,878 |
# coding: utf-8
#
# Copyright 2014 The Oppia 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 requi... | Cgruppo/oppia | core/domain/exp_domain_test.py | Python | apache-2.0 | 19,626 |
from lib import actions
__all__ = [
'CreateVlanAction',
]
class CreateVlanAction(actions.BaseAction):
def run(self, **kwargs):
action = kwargs['action']
del kwargs['action']
region = kwargs['region']
del kwargs['region']
network_domain_id = kwargs['network_domain_id']... | armab/st2contrib | packs/dimensiondata/actions/create_vlan.py | Python | apache-2.0 | 826 |
# Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""GGRC notification SQLAlchemy layer data model extensions."""
from sqlalchemy.orm import backref
from ggrc import db
from ggrc.models.mixins import Base
from ggrc.models import utils
class Notification... | plamut/ggrc-core | src/ggrc/models/notification.py | Python | apache-2.0 | 1,986 |
# Copyright 2013 Huawei Technologies Co., Ltd
# 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
#
# Unl... | Hybrid-Cloud/cinder | cinder/tests/unit/api/contrib/test_quotas_classes.py | Python | apache-2.0 | 6,020 |
r"""Fixer for unicode.
* Changes unicode to str and unichr to chr.
* If "...\u..." is not unicode literal change it into "...\\u...".
* Change u"..." into "...".
"""
from ..pgen2 import token
from .. import fixer_base
_mapping = {u"unichr" : u"chr", u"unicode" : u"str"}
class FixUnicode(fixer_base... | nmercier/linux-cross-gcc | win32/bin/Lib/lib2to3/fixes/fix_unicode.py | Python | bsd-3-clause | 1,311 |
# Copyright (c) 2006-2007 The Regents of The University of Michigan
# Copyright (c) 2009 Advanced Micro Devices, 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 co... | koparasy/gemfi | configs/example/ruby_mem_test.py | Python | bsd-3-clause | 6,922 |
import functools
from django.db.models.sql import EmptyResultSet
import commonware.log
from rest_framework.decorators import api_view
from rest_framework.exceptions import ParseError
from rest_framework.mixins import ListModelMixin
from rest_framework.routers import Route, SimpleRouter
from rest_framework.response im... | ingenioustechie/zamboni | mkt/api/base.py | Python | bsd-3-clause | 8,836 |
# -*- coding: utf-8 -*-
def get_validation_digit(number):
"""Calculates the validation digit for the given number."""
weighted_sum = 0
dvs = [4, 3, 6, 7, 8, 9, 2]
number = str(number)
for i in range(0, len(number)):
weighted_sum = (int(number[-1 - i]) * dvs[i] + weighted_sum) % 10
re... | thor/django-localflavor | localflavor/uy/util.py | Python | bsd-3-clause | 350 |
# (C) Datadog, Inc. 2010-2016
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
# 3p
import requests
# project
from checks import AgentCheck
from util import headers
class PHPFPMCheck(AgentCheck):
"""
Tracks basic php-fpm metrics via the status module
Requires php-fpm pools to ... | manolama/dd-agent | checks.d/php_fpm.py | Python | bsd-3-clause | 4,587 |
import sys
import os.path
import re
import time
from docutils import io, nodes, statemachine, utils
try:
from docutils.utils.error_reporting import ErrorString # the new way
except ImportError:
from docutils.error_reporting import ErrorString # the old way
from docutils.parsers.rst import Directive, con... | wbinventor/openmc | docs/sphinxext/notebook_sphinxext.py | Python | mit | 3,717 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyrigt: (c) 2017, Yanis Guenane <yanis+ansible@guenane.org>
# 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
ANSIBLE_METADATA = {'metadata_ve... | azaghal/ansible | test/support/integration/plugins/modules/openssl_csr.py | Python | gpl-3.0 | 53,940 |
#!/usr/bin/env python
"""
Copyright (c) 2006-2014 sqlmap developers (http://sqlmap.org/)
See the file 'doc/COPYING' for copying permission
"""
import imp
import logging
import os
import re
import sys
import warnings
_sqlalchemy = None
try:
f, pathname, desc = imp.find_module("sqlalchemy", sys.path[1:])
_ = i... | pwnieexpress/raspberry_pwn | src/pentest/sqlmap/lib/utils/sqlalchemy.py | Python | gpl-3.0 | 2,985 |
import sys
import os
import unittest
try:
from _pydev_bundle import pydev_monkey
except:
sys.path.append(os.path.dirname(os.path.dirname(__file__)))
from _pydev_bundle import pydev_monkey
from pydevd import SetupHolder
from _pydev_bundle.pydev_monkey import pydev_src_dir
class TestCase(unittest.TestCase)... | Soya93/Extract-Refactoring | python/helpers/pydev/tests_pydevd_python/test_pydev_monkey.py | Python | apache-2.0 | 5,544 |
# Copyright 2012 Google Inc. All Rights Reserved.
"""Tests for common.py."""
import math
import sys
import time
import unittest
import mock
try:
from cloudstorage import common
except ImportError:
from google.appengine.ext.cloudstorage import common
from google.appengine.tools import remote_api_shell
class... | aozarov/appengine-gcs-client | python/test/common_test.py | Python | apache-2.0 | 4,896 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2004-2006 Zuza Software Foundation
#
# This file is part of translate.
#
# translate 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... | dbbhattacharya/kitsune | vendor/packages/translate-toolkit/translate/filters/helpers.py | Python | bsd-3-clause | 2,818 |
#!/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/api/mail_service_pb.py | Python | bsd-3-clause | 25,492 |
import affine
import numpy
import rasterio
def test_pad():
arr = numpy.ones((10, 10))
trans = affine.Affine(1.0, 0.0, 0.0, 0.0, -1.0, 10.0)
arr2, trans2 = rasterio.pad(arr, trans, 2, 'edge')
assert arr2.shape == (14, 14)
assert trans2.xoff == -2.0
assert trans2.yoff == 12.0
| sgillies/rasterio | tests/test_pad.py | Python | bsd-3-clause | 306 |
import re
from markdown.blockprocessors import HRProcessor
class BBCodeHRProcessor(HRProcessor):
RE = r'^\[hr\]*'
# Detect hr on any line of a block.
SEARCH_RE = re.compile(RE, re.MULTILINE | re.IGNORECASE)
| 390910131/Misago | misago/markup/bbcode/blocks.py | Python | gpl-2.0 | 223 |
# coding: utf-8
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from operator import itemgetter
import re
from datetime import datetime
from random import randrange
f... | SujaySKumar/bedrock | bedrock/mozorg/forms.py | Python | mpl-2.0 | 30,635 |
# Copyright 2013 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | zouyapeng/horizon-newtouch | openstack_dashboard/dashboards/identity/groups/tables.py | Python | apache-2.0 | 7,450 |
#!/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... | jayceyxc/hue | apps/filebrowser/src/filebrowser/lib/archives.py | Python | apache-2.0 | 7,361 |