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 |
|---|---|---|---|---|---|
# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-08-11 12:47
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='GeneDet... | 444thLiao/VarappX | varapp/migrations/0001_initial.py | Python | gpl-3.0 | 10,400 |
import re
import time
import readline
import os
# CONVERT shell colors to the same curses palette
SHELL_COLORS = {
"wr": '\033[1;37;41m', # white on red
"wo": '\033[1;37;43m', # white on orange
"wm": '\033[1;37;45m', # white on magenta
"wb": '\033[1;37;46m', # white on blue
"bw": '\033[1;37;40m', #... | khughitt/ete | ete_dev/tools/utils.py | Python | gpl-3.0 | 6,239 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Installation (Python 3)
-----------------------
virtualenv -p python3 ~/virtenvs/devconfcz/
source ~/virtenvs/devconfcz/bin/activate
pip install hyde requests click pandas df2gspread
Example Config
--------------
cat <<EOT >> ~/.config/typeform/confi... | kejbaly2/devconfcz | bin/typeform.py | Python | gpl-3.0 | 31,579 |
# coding: utf-8
#
# Copyright © 2010—2014 Andrey Mikhaylenko and contributors
#
# This file is part of Argh.
#
# Argh is free software under terms of the GNU Lesser
# General Public License version 3 (LGPLv3) as published by the Free
# Software Foundation. See the file README.rst for copying conditions.
#
"""
Comm... | CiuffysHub/MITMf | mitmflib-0.18.4/mitmflib/argh/decorators.py | Python | gpl-3.0 | 5,296 |
"""
This is a plugin that should do everything wrong, for debugging Purposes
"""
__kupfer_name__ = u"Evil Plugin"
__kupfer_sources__ = (
"EvilSource",
"EvilInstantiationSource",
)
__description__ = u"Evil for debugging purposes (necessary evil)"
__version__ = ""
__author__ = "Ulrik Sverdrup <ulrik.sverdrup@gmai... | engla/kupfer | contrib/evilplugin.py | Python | gpl-3.0 | 798 |
import sys
from settings import *
from map import *
from copy import deepcopy
import numpy as np
class World(object):
def __init__(self, agents, waypoints, boxes, persons):
self.agents = agents
self.waypoints = waypoints
self.boxes = boxes
self.persons = persons
def add_ma... | MaralAfris/wasp-challenge-lth-team2 | planning/src/world.py | Python | gpl-3.0 | 12,092 |
import autograd.numpy as np
from autograd import grad as gradient
from autograd import elementwise_grad, jacobian, hessian
from fitr import utils
from fitr import gradients as grad
from fitr import hessians as hess
from fitr.environments import TwoArmedBandit
from fitr.environments import DawTwoStep
from fitr.agents im... | ComputationalPsychiatry/fitr | tests/test_gradients.py | Python | gpl-3.0 | 21,659 |
# ***** BEGIN GPL LICENSE BLOCK *****
#
# 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 program is distri... | dairin0d/transform-utils | space_view3d_transform_utils/common.py | Python | gpl-3.0 | 3,487 |
#This file is part of Tryton. The COPYRIGHT file at the top level of
#this repository contains the full copyright notices and license terms.
import gobject
from cellrenderertext import CellRendererText
import locale
class CellRendererInteger(CellRendererText):
def on_start_editing(self, event, widget, path, bac... | sunny414/tryton-client | tryton/common/cellrendererinteger.py | Python | gpl-3.0 | 1,058 |
from mock import Mock
from golem.testutils import TempDirFixture
from golem.tools.assertlogs import LogTestCase
from apps.core.task.verificator import CoreVerificator, SubtaskVerificationState, logger
class TestCoreVerificator(TempDirFixture, LogTestCase):
def _fill_with_states(self, cv):
cv.ver_states... | Radagast-red/golem | tests/apps/core/task/test_core_verificator.py | Python | gpl-3.0 | 3,320 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2017-2021 Python-geotiepoints developers
#
# 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... | pytroll/python-geotiepoints | geotiepoints/tests/test_modisinterpolator.py | Python | gpl-3.0 | 4,321 |
"""
Utilities module whose functions are designed to do the basic processing of
the data using obspy modules (which also rely on scipy and numpy).
:copyright:
EQcorrscan developers.
:license:
GNU Lesser General Public License, Version 3
(https://www.gnu.org/copyleft/lesser.html)
"""
import numpy as np
imp... | calum-chamberlain/EQcorrscan | eqcorrscan/utils/pre_processing.py | Python | gpl-3.0 | 39,205 |
def gcd(a, b):
while b != 0:
a, b = b, a % b
return a
def modinv(a, b):
"""Returns a tuple (r, i, j) such that r = gcd(a, b) = ia + jb"""
x = 0
y = 1
lx = 1
ly = 0
oa = a
ob = b
while b != 0:
q = a // b
(a, b) = (b, a % b)
(x, lx) = ((lx - (q * x))... | zoxuyu/rsplus | src/maths.py | Python | gpl-3.0 | 441 |
# -*- coding: cp1252 -*-
import urllib,urllib2,re,cookielib,string,os
import xbmc, xbmcgui, xbmcaddon, xbmcplugin
from t0mm0.common.net import Net as net
addon_id = 'plugin.video.movie25'
selfAddon = xbmcaddon.Addon(id=addon_id)
datapath = xbmc.translatePath(selfAddon.getAddonInfo('profile'))
elogo = xbmc.translatePat... | marduk191/plugin.video.movie25 | resources/libs/resolvers.py | Python | gpl-3.0 | 60,306 |
"""Tests for mdn app."""
| mdn/browsercompat | mdn/tests/__init__.py | Python | mpl-2.0 | 25 |
# 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 __future__ import absolute_import, print_function, unicode_literals
from StringIO import StringIO
import os
import... | escapewindow/signingscript | src/signingscript/vendored/mozbuild/mozbuild/test/configure/test_configure.py | Python | mpl-2.0 | 54,289 |
"""
Factories for schedules tests
"""
from __future__ import absolute_import
import factory
import pytz
from openedx.core.djangoapps.schedules import models
from openedx.core.djangoapps.site_configuration.tests.factories import SiteFactory
from student.tests.factories import CourseEnrollmentFactory
class ScheduleEx... | ESOedX/edx-platform | openedx/core/djangoapps/schedules/tests/factories.py | Python | agpl-3.0 | 1,310 |
"""
Dictionary with lazy evaluation on access, via a supplied update function
"""
import itertools
class LazyDict(dict):
"""
A dictionary type that lazily updates values when they are accessed.
All the usual dictionary methods work as expected, with automatic lazy
updates occuring behind the scen... | vikramsunkara/PyME | pyme/lazy_dict.py | Python | agpl-3.0 | 3,974 |
import pytest
import re
from django.contrib.auth import get_user_model
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from shuup.core.models import SavedAddress
from shuup.core.models import get_person_contact
from shuup.core.models._contacts import get_company_contact
from shu... | suutari/shoop | shuup_tests/front/test_addressbook.py | Python | agpl-3.0 | 6,230 |
import lxml.html
from html import escape
import chevron
import math
import prairielearn as pl
import numpy as np
import random
WEIGHT_DEFAULT = 1
CORRECT_ANSWER_DEFAULT = None
LABEL_DEFAULT = None
SUFFIX_DEFAULT = None
DISPLAY_DEFAULT = 'inline'
def prepare(element_html, data):
element = lxml.html.fragment_from... | mwest1066/PrairieLearn | elements/pl-integer-input/pl-integer-input.py | Python | agpl-3.0 | 8,803 |
# -*- coding: UTF-8 -*-
# COPYRIGHT (c) 2016 Cristóbal Ganter
#
# GNU AFFERO GENERAL PUBLIC LICENSE
# Version 3, 19 November 2007
#
# 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, eit... | TelematicaUSM/EduRT | src/wsclass.py | Python | agpl-3.0 | 8,134 |
# -*- 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 super... | superdesk/superdesk-core | content_api/packages/__init__.py | Python | agpl-3.0 | 721 |
import base64
from twisted.words.xish import xpath
import constants as cs
from servicetest import (EventPattern, call_async, sync_dbus, assertEquals,
assertLength)
from gabbletest import (
acknowledge_iq, exec_test, expect_and_handle_get_vcard, make_result_iq,
sync_stream, disconnect_conn)
import ns
... | Ziemin/telepathy-gabble | tests/twisted/vcard/overlapping-sets.py | Python | lgpl-2.1 | 5,604 |
# Copyright (C) 2013-2016 Pelagicore AB <joakim.gross@pelagicore.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any late... | Pelagicore/dbus-proxy | component-test/conftest.py | Python | lgpl-2.1 | 5,485 |
# 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__cerbero | cerbero/utils/__init__.py | Python | lgpl-2.1 | 10,438 |
import unittest
from shadowcraft.objects import race
class TestRace(unittest.TestCase):
def setUp(self):
self.race = race.Race('human')
def test__init__(self):
self.assertEqual(self.race.race_name, 'human')
self.assertEqual(self.race.character_class, 'rogue')
def test_set_racials(... | Fierydemise/ShadowCraft-Engine | tests/objects_tests/race_tests.py | Python | lgpl-3.0 | 2,806 |
#!/usr/bin/env python
#
# Copyright 2010 Andrei <vish@gravitysoft.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; either version 2 of the License, or... | barmalei/scalpel | lib/gravity/common/db.py | Python | lgpl-3.0 | 10,270 |
from django.contrib.auth.decorators import login_required
from django.contrib.auth.mixins import PermissionRequiredMixin
from django.db.models import Count
from django.urls import reverse_lazy
from django.utils.translation import ugettext as _
from django.shortcuts import render, get_object_or_404, redirect
from django... | nerosketch/djing | tariff_app/views.py | Python | unlicense | 5,574 |
# Generated by Django 2.1.1 on 2019-03-05 12:47
from django.db import migrations, models
import ip_pool.fields
class Migration(migrations.Migration):
replaces = [('ip_pool', '0001_initial'), ('ip_pool', '0002_change_unique'), ('ip_pool', '0003_auto_20181019_1230'), ('ip_pool', '0004_auto_20190305_1243')]
i... | nerosketch/djing | ip_pool/migrations/0001_squashed_0004_auto_20190305_1243.py | Python | unlicense | 1,674 |
# Copyright 2015 Metaswitch Networks
#
# 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... | L-MA/calico-docker | calico_containers/tests/st/test_duplicate_ips.py | Python | apache-2.0 | 3,182 |
'''
@author: Quarkonics
'''
import os
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_lib as test_lib
import zstackwoodpecker.test_state as test_state
import zstackwoodpecker.operations.host_operations as host_ops
import zstackwoodpecker.operations.resource_operations as res_ops
imp... | zstackorg/zstack-woodpecker | integrationtest/vm/virtualrouter/vlan/test_chg_instance_offering_online2.py | Python | apache-2.0 | 2,179 |
# 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 use ... | apache/libcloud | libcloud/common/providers.py | Python | apache-2.0 | 4,027 |
"""Config flow for Roku."""
import logging
from typing import Any, Dict, Optional
from urllib.parse import urlparse
from rokuecp import Roku, RokuError
import voluptuous as vol
from homeassistant.components.ssdp import (
ATTR_SSDP_LOCATION,
ATTR_UPNP_FRIENDLY_NAME,
ATTR_UPNP_SERIAL,
)
from homeassistant.c... | tchellomello/home-assistant | homeassistant/components/roku/config_flow.py | Python | apache-2.0 | 4,682 |
# Copyright (c) 2011 Rackspace
# 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... | rackerlabs/python-proboscis | proboscis/compatability/exceptions_2_5.py | Python | apache-2.0 | 1,186 |
#!/usr/bin/env python3
"""Class interacts with devices supporting BRIDGE-MIB."""
from collections import defaultdict
from switchmap.snmp.base_query import Query
from switchmap.snmp import mib_if
from switchmap.utils import general
def get_query():
"""Return this module's Query class."""
return BridgeQuery
... | palisadoes/switchmap-ng | switchmap/snmp/mib_bridge.py | Python | apache-2.0 | 13,577 |
# Copyright 2016 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 a... | aljim/deploymentmanager-samples | examples/v2/saltstack/python/minion.py | Python | apache-2.0 | 3,271 |
#Задача №4 , Вариант 13
#Напишите программу, которая выводит имя, под которым скрывается Жан Батист Поклен. Дополнительно необходимо вывести область интересов указанной личности, место рождения, годы рождения и смерти (если человек умер), вычислить возраст на данный момент (или момент смерти).
#Костарев А. И.
#14.... | Mariaanisimova/pythonintask | BITs/2014/KOSTAREV_A_I/task_4_13.py | Python | apache-2.0 | 1,201 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from collections import defaultdict
import inspect
from textwrap import dedent
from typing import Dict, Text, List, Tuple, Type, Sequence, Any
import numpy as np # type... | mlperf/training_results_v0.6 | Fujitsu/benchmarks/resnet/implementations/mxnet/3rdparty/onnx-tensorrt/third_party/onnx/onnx/backend/test/case/base.py | Python | apache-2.0 | 1,687 |
#
# Copyright 2014 Quantopian, 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 wr... | euri10/zipline | zipline/finance/trading.py | Python | apache-2.0 | 19,394 |
#!/usr/bin/env python
# -*- 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,... | thammegowda/incubator-joshua | scripts/training/run_tuner.py | Python | apache-2.0 | 18,921 |
# Copyright 2015 Internap.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, so... | internap/netman | netman/api/objects/vlan.py | Python | apache-2.0 | 2,413 |
# Copyright 2015 PerfKitBenchmarker 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... | syed/PerfKitBenchmarker | tests/aws_disk_integration_test.py | Python | apache-2.0 | 2,943 |
'''
Test change cpu and memory configuration when VM is running
@author: quarkonics
'''
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_lib as test_lib
import zstackwoodpecker.test_state as test_state
#import zstackwoodpecker.operations.host_operations as host_ops
import zstackwoodpe... | zstackio/zstack-woodpecker | integrationtest/vm/virtualrouter/test_update_vm_cpu_memory.py | Python | apache-2.0 | 2,076 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'res/designer/simulations/biomeng321lab1.ui'
#
# Created: Fri Mar 4 13:11:44 2016
# by: pyside-uic 0.2.15 running on PySide 1.2.1
#
# WARNING! All changes made in this file will be lost!
from PySide import QtCore, QtGui
class Ui_Biome... | OpenCMISS/neon | src/opencmiss/neon/ui/simulations/ui_biomeng321lab1.py | Python | apache-2.0 | 18,237 |
#!/usr/bin/env python
"""
Start script for the standalone Wiki server.
@copyright: 2007 MoinMoin:ForrestVoight
@license: GNU GPL, see COPYING for details.
"""
import sys, os
# a) Configuration of Python's code search path
# If you already have set up the PYTHONPATH environment variable for the
# st... | zepheira/zenpub | test/testwiki/wikiserver.py | Python | apache-2.0 | 1,250 |
# Copyright 2012 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 agre... | varunarya10/ironic | ironic/openstack/common/rpc/dispatcher.py | Python | apache-2.0 | 7,008 |
# 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... | apporc/nova | nova/tests/unit/image/test_glance.py | Python | apache-2.0 | 53,589 |
# Copyright 2015 Mirantis, 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 ... | magic0704/oslo.messaging | oslo_messaging/_drivers/zmq_driver/server/zmq_incoming_message.py | Python | apache-2.0 | 2,020 |
# Copyright 2016 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 a... | waprin/gcloud-python | gcloud/logging/test_logger.py | Python | apache-2.0 | 25,904 |
from django.conf.urls import url
from django.conf import settings
from django_stormpath import views
urlpatterns = [
url(r'^login/$', views.stormpath_id_site_login, name='stormpath_id_site_login'),
url(r'^logout/$', views.stormpath_id_site_logout, name='stormpath_id_site_logout'),
url(r'^register/$', vie... | patpatpatpatpat/stormpath-django | django_stormpath/urls.py | Python | apache-2.0 | 2,179 |
# 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... | PaddlePaddle/Paddle | python/paddle/fluid/tests/custom_op/custom_relu_setup.py | Python | apache-2.0 | 1,325 |
#!/usr/bin/python
# coding: utf-8
#
# Copyright 2014 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
#
# U... | googleads/googleads-adxseller-examples | python/v2.0/generate_report.py | Python | apache-2.0 | 2,740 |
# Copyright (c) 2012 Rackspace Hosting
# 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 req... | fajoy/nova | nova/cells/manager.py | Python | apache-2.0 | 9,098 |
# 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.apache.org/licenses/LICENSE-2.0
#
# Unless ... | citrix-openstack/build-python-troveclient | troveclient/flavors.py | Python | apache-2.0 | 1,700 |
# 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... | ArchiFleKs/magnum | magnum/common/policies/magnum_service.py | Python | apache-2.0 | 1,054 |
# Copyright 2008-2015 Nokia Solutions and Networks
#
# 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 l... | fingeronthebutton/RIDE | src/robotide/controller/stepcontrollers.py | Python | apache-2.0 | 22,048 |
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | frreiss/tensorflow-fred | tensorflow/python/tpu/tpu.py | Python | apache-2.0 | 97,112 |
# coding: utf-8
"""
Kubeflow Pipelines API
This file contains REST API specification for Kubeflow Pipelines. The file is autogenerated from the swagger definition.
Contact: kubeflow-pipelines@google.com
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import s... | kubeflow/pipelines | backend/api/python_http_client/kfp_server_api/models/api_resource_type.py | Python | apache-2.0 | 3,054 |
# 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/npu/test_argsort_op_npu.py | Python | apache-2.0 | 7,907 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 Nicira Networks, 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.apach... | ntt-sic/neutron | neutron/agent/linux/ovs_lib.py | Python | apache-2.0 | 17,481 |
# coding: utf-8
"""
OpenAPI spec version:
Generated by: https://github.com/swagger-api/swagger-codegen.git
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
... | detiber/lib_openshift | test/test_v1_project.py | Python | apache-2.0 | 1,236 |
# Copyright 2016 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 a... | waprin/gcloud-python | gcloud/logging/handlers/handlers.py | Python | apache-2.0 | 4,411 |
# Copyright 2014-2015 Insight Software Consortium.
# Copyright 2004-2008 Roman Yakovenko.
# Distributed under the Boost Software License, Version 1.0.
# See http://www.boost.org/LICENSE_1_0.txt
from . import scanner
# keep py2exe happy
import xml.etree.ElementTree
import xml.etree.cElementTree as ElementTree
class... | zachary-williamson/ITK | Modules/ThirdParty/pygccxml/src/pygccxml/parser/etree_scanner.py | Python | apache-2.0 | 1,759 |
# Copyright The Cloud Custodian Authors.
# SPDX-License-Identifier: Apache-2.0
from .core import Filter
from c7n.exceptions import PolicyValidationError
from c7n.loader import PolicyLoader
from c7n.utils import type_schema
class Missing(Filter):
"""Assert the absence of a particular resource.
Intended for ... | alfredgamulo/cloud-custodian | c7n/filters/missing.py | Python | apache-2.0 | 2,027 |
# 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... | apache/incubator-superset | superset/db_engine_specs/hana.py | Python | apache-2.0 | 2,364 |
from gevent import monkey
monkey.patch_all(subprocess=True)
import os
import sys
cwd = os.path.dirname(os.path.abspath(__file__))
scalrpy_dir = os.path.normpath(os.path.join(cwd, '../../..'))
sys.path.insert(0, scalrpy_dir)
scalrpytests_dir = os.path.join(cwd, '../..')
sys.path.insert(0, scalrpytests_dir)
import tim... | kikov79/scalr | app/python/tests/scalrpytests/load_statistics_cleaner/steps.py | Python | apache-2.0 | 3,146 |
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from ndreg import *
import ndio.remote.neurodata as neurodata
import nibabel as nb
refToken = "ara_ccf2"
refImg = imgDownload(refToken)
imgShow(refImg)
plt.savefig("refImg_initial.png", bbox_inches='tight')
imgShow(refImg, vmax=500)
plt.savefig("... | NeuroDataDesign/seelviz | seelviz/brainalign.py | Python | apache-2.0 | 3,476 |
# BEGIN_COPYRIGHT
#
# Copyright 2009-2021 CRS4.
#
# 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... | crs4/pydoop | test/common/test_test_support.py | Python | apache-2.0 | 1,753 |
import os
from os.path import join
from enot.utils.file_utils import read_file
# read application config file. Return application name, version, applications and if it contains jinja2 templates
def parse_app_config(path: str, suffix='.app.src') -> (str, str or None, list or None, bool):
file = find_app_file(path... | comtihon/coon | enot/utils/erl_file_utils.py | Python | apache-2.0 | 3,028 |
#
# 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... | charlesccychen/beam | sdks/python/apache_beam/transforms/window.py | Python | apache-2.0 | 18,027 |
import pytest
import ibis
from ibis.backends.base.sql.compiler import Compiler
from .conftest import get_query
def test_nameless_table():
# Generate a unique table name when we haven't passed on
nameless = ibis.table([('key', 'string')])
assert Compiler.to_sql(nameless) == 'SELECT *\nFROM {}'.format(
... | cpcloud/ibis | ibis/tests/sql/test_select_sql.py | Python | apache-2.0 | 33,419 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
'''
Custom filters for use in openshift_aws
'''
from ansible import errors
class FilterModule(object):
''' Custom ansible filters for use by openshift_aws role'''
@staticmethod
def scale_groups_serial(scale_group_info, upgrade=False):
''' This function w... | zhiwliu/openshift-ansible | roles/openshift_aws/filter_plugins/openshift_aws_filters.py | Python | apache-2.0 | 2,484 |
"""General functional tests for the server app."""
from django.http.response import Http404, HttpResponseServerError
from django.contrib.auth.models import User
from django.core.exceptions import PermissionDenied
from django.test import TestCase, RequestFactory
from django.urls import reverse
from sal.decorators imp... | salopensource/sal | sal/tests/test_decorators.py | Python | apache-2.0 | 6,760 |
# This file is part of Moksha.
# Copyright (C) 2008-2010 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 ... | lmacken/moksha | moksha/config/environment.py | Python | apache-2.0 | 779 |
# Copyright 2017 The Forseti Security 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 ap... | forseti-security/forseti-security | tests/common/util/__init__.py | Python | apache-2.0 | 658 |
# Copyright 2019 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... | alexgorban/models | official/nlp/xlnet/xlnet_config.py | Python | apache-2.0 | 6,110 |
#############################################################################################
###
## Copyright (C) 2018 Nicola Peditto
###
## 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
###... | MDSLab/s4t-lighthing-rod | modules/plugins-manager/python/sync-wrapper.py | Python | apache-2.0 | 3,393 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from services.user import UserService
import tornado.web
import tornado.gen
import tornado.escape
import json
import settings
from util.stmp import send_email
from views import BaseHandler
class LoginHandler(tornado.web.RequestHandler):
def get(self):
self.rend... | liuhong1happy/DockerConsoleApp | views/login.py | Python | apache-2.0 | 2,538 |
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | tseaver/google-cloud-python | texttospeech/tests/system/v1beta1/test_system_tts_v1beta1.py | Python | apache-2.0 | 1,499 |
from __future__ import print_function
import re
from streamlink.plugin import Plugin
from streamlink.plugin.api import http
from streamlink.plugin.api import validate
from streamlink.stream import HLSStream
class Kanal7(Plugin):
url_re = re.compile(r"https?://(?:www.)?kanal7.com/canli-izle")
iframe_re = re.c... | ethanhlc/streamlink | src/streamlink/plugins/kanal7.py | Python | bsd-2-clause | 1,209 |
"""
To understand why this file is here, please read:
http://cookiecutter-django.readthedocs.io/en/latest/faq.html#why-is-there-a-django-contrib-sites-directory-in-cookiecutter-django
"""
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations... | gustavofonseca/inbox | penne_core/contrib/sites/migrations/0002_set_site_domain_and_name.py | Python | bsd-2-clause | 1,132 |
# -*- coding: utf-8 -*-
"""Module with SecureCRT parser."""
from os.path import expanduser
class SecureCRTConfigParser(object):
"""SecureCRT xml parser."""
meta_sessions = ['Default']
def __init__(self, xml):
"""Construct parser instance."""
self.xml = xml
self.tree = {}
def... | Crystalnix/serverauditor-sshconfig | termius/porting/providers/securecrt/parser.py | Python | bsd-3-clause | 3,259 |
from django.conf.urls import patterns, url
from . import views
urlpatterns = patterns('',
url(r'^$', views.IndexView.as_view(), name='index'),
url(r'^(?P<pk>\d+)/$', views.DetailView.as_view(), name='detail'),
url(r'^(?P<pk>\d+)/results/$', views.ResultsView.as_view(), name='results'),
url(r'^(?P<pol... | alirazabhayani/django_workshop_poll_app | polls/urls.py | Python | bsd-3-clause | 424 |
from elasticsearch import TransportError
import olympia.core.logger
from olympia.amo.utils import render
log = olympia.core.logger.getLogger('z.es')
class ElasticsearchExceptionMiddleware(object):
def process_exception(self, request, exception):
if issubclass(exception.__class__, TransportError):
... | lavish205/olympia | src/olympia/search/middleware.py | Python | bsd-3-clause | 434 |
# -*- coding: utf-8 -*-
import collections
class InvalidOperatorError(ValueError):
pass
class DuplicateFieldError(ValueError):
pass
class FieldDict(dict):
def __setitem__(self, k, v):
if k in self:
raise DuplicateFieldError('Field "{0}" already set.'.format(k))
super(Field... | voxelbrain/dibble | dibble/update.py | Python | bsd-3-clause | 2,635 |
# -*- coding: utf-8 -*-
"""
tarbell.configure
~~~~~~~~~~~~~~~~~
This module provides the Tarbell configure command.
"""
import os
import sys
import yaml
import shutil
from subprocess import call
from datetime import datetime
from clint.textui import colored, puts
from six.moves import input as raw_input
from tarbel... | tarbell-project/tarbell | tarbell/configure.py | Python | bsd-3-clause | 12,932 |
#!/usr/bin/env python
import os
import shutil
import socket
from datetime import datetime
import subprocess as sp
import json
from pymongo import MongoClient
_ctest = '''
set(CTEST_SOURCE_DIRECTORY "{source}")
set(CTEST_BINARY_DIRECTORY "{build}")
include(${{CTEST_SOURCE_DIRECTORY}}/CTestConfig.cmake)
set(CTEST_SI... | dcjohnston/geojs | dashboard/github_service/dashboard.py | Python | bsd-3-clause | 5,762 |
# [h] apply actions
import hTools2.dialogs.folder.actions
reload(hTools2.dialogs.folder.actions)
hTools2.dialogs.folder.actions.actionsFolderDialog()
| gferreira/hTools2_extension | hTools2.roboFontExt/lib/Scripts/batch folder/actions.py | Python | bsd-3-clause | 152 |
#!/usr/bin/env python
"""
An example using networkx.Graph().
miles_graph() returns an undirected graph over the 128 US cities from
the datafile miles_dat.txt. The cities each have location and population
data. The edges are labeled with the distance betwen the two cities.
This example is described in Section 1.1 in ... | SanketDG/networkx | examples/graph/knuth_miles.py | Python | bsd-3-clause | 2,993 |
from __future__ import division, absolute_import, print_function
import copy
import pickle
import sys
import platform
import gc
import copy
import warnings
import tempfile
from os import path
from io import BytesIO
from itertools import chain
import numpy as np
from numpy.testing import (
run_module_suite, Te... | Linkid/numpy | numpy/core/tests/test_regression.py | Python | bsd-3-clause | 78,626 |
import sys, os
import visit_rcParams as vrc
import visit_colormaps as vc
import visit_time as vt
import visit as v
rcParams = dict( surface_linewidth=3,
snow_linewidth=4
)
class Operator:
def __init__(self, oname, otype, oatts):
self.oname = oname
self.otype = o... | amanzi/ats-dev | tools/visit_ats/visit_ats/visit_ats.py | Python | bsd-3-clause | 21,342 |
import json
import re
from copy import deepcopy
from typing import Dict
from federation.utils.network import fetch_document, send_document
WEEKLY_USERS_HALFYEAR_MULTIPLIER = 10.34
WEEKLY_USERS_MONTHLY_MULTIPLIER = 3.17
MONTHLY_USERS_WEEKLY_MULTIPLIER = 0.316
HALFYEAR_USERS_WEEKLY_MULTIPLIER = 0.097
defaults = {
... | jaywink/federation | federation/hostmeta/parsers.py | Python | bsd-3-clause | 11,938 |
from __future__ import absolute_import
import pytest
import logging
from datetime import datetime
from django.conf import settings
from sentry.constants import MAX_CULPRIT_LENGTH, DEFAULT_LOGGER_NAME
from sentry.event_manager import EventManager
def make_event(**kwargs):
result = {
"event_id": "a" * 32... | beeftornado/sentry | tests/sentry/event_manager/test_normalization.py | Python | bsd-3-clause | 6,199 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from datetime import datetime
import gzip
try:
from unittest import mock
except ImportError: # Python 3.2 and below
import mock
from django.test import TestCase
from django.conf import settings
from django.core.files.base import ContentFile
from... | faxioman/django-storages | tests/test_s3boto3.py | Python | bsd-3-clause | 13,892 |
# Authors: Olivier Grisel <olivier.grisel@ensta.org>
# Mathieu Blondel <mathieu@mblondel.org>
# Denis Engemann <denis-alexander.engemann@inria.fr>
#
# License: BSD 3 clause
import numpy as np
from scipy import sparse
from scipy import linalg
from scipy import stats
from scipy.special import expit
im... | bnaul/scikit-learn | sklearn/utils/tests/test_extmath.py | Python | bsd-3-clause | 26,768 |
"""Fast Gradient Boosting decision trees for classification and regression."""
# Author: Nicolas Hug
from abc import ABC, abstractmethod
from functools import partial
import warnings
import numpy as np
from timeit import default_timer as time
from ...base import BaseEstimator, RegressorMixin, ClassifierMixin, is_clas... | huzq/scikit-learn | sklearn/ensemble/_hist_gradient_boosting/gradient_boosting.py | Python | bsd-3-clause | 68,566 |
"""
sentry.runner
~~~~~~~~~~~~~
:copyright: (c) 2015 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import, print_function
import os
import click
import sys
import sentry
import datetime
from sentry.utils.imports import import_string
... | looker/sentry | src/sentry/runner/__init__.py | Python | bsd-3-clause | 5,028 |
#-------------------------------------------------------------------------------
# Name: demo_python_3
#
# This file shows how to create and populate the ChParticleClones object.
# Also, shows how to use POV ray for postprocessing, thanks to the
# utility functions in the unit_POSTPROCESS of Chrono::Engine.
#
#-... | amelmquist/chrono | src/demos/python/demo_particleclones.py | Python | bsd-3-clause | 5,706 |
import xmlrpclib
def listEngineTypes(address):
client = xmlrpclib.ServerProxy(address + '/admin/')
engine_types = client.listEngineTypes()
return engine_types
def allocateEngine(address, engine_type):
client = xmlrpclib.ServerProxy(str(address) + '/admin/')
access_id = client.allocateEngine(str(e... | ccordoba12/codenode | codenode/frontend/backend/rpc.py | Python | bsd-3-clause | 499 |
#!/usr/bin/env python
from fs.errors import ResourceNotFoundError
from fs.opener import opener
from fs.commands.runner import Command
import sys
class FSrm(Command):
usage = """fsrm [OPTION]... [PATH]
Remove a file or directory at PATH"""
def get_optparse(self):
optparse = super(FSrm, self).get_optp... | PyFilesystem/pyfilesystem | fs/commands/fsrm.py | Python | bsd-3-clause | 1,775 |