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 |
|---|---|---|---|---|---|
#
# Various functions
#
# Copyright (c) 2015 Red Hat, Inc.
# Author: Nikolai Kondrashov <Nikolai.Kondrashov@redhat.com>
#
# This is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 only
#
# This program ... | celestian/sssd | src/tests/intg/util.py | Python | gpl-3.0 | 1,939 |
# -*- coding: utf-8 -*-
#------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Canal para seriespapaya
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
#------------------------------------------------------------
from core import config
from core import logger
from core ... | Hernanarce/pelisalacarta | python/main-classic/channels/seriespapaya.py | Python | gpl-3.0 | 8,536 |
#!/usr/bin/env python
"""format a libsvm dataset, change label 0 to -1,"""
import sys
import os
import time
def Usage():
print 'Usage: libsvm_format.py filename output_filename'
if len(sys.argv) != 3:
Usage()
sys.exit()
filename = sys.argv[1]
output_filename = sys.argv[2]
start = time.time()
print 'cha... | yuewu001/sol | tools/libsvm_format.py | Python | gpl-3.0 | 507 |
import notification.models as notification
def subscribe_user(user, feedback):
"""
Subscribe a user to any change of a given feedback
"""
feedback.followers.add(user)
def unsubscribe_user(user, feedback):
"""
Unsubscribe a user to any change of a given feedback
"""
feedback.followers.r... | SpreadBand/django-backcap | backcap/utils.py | Python | gpl-3.0 | 342 |
from ..verifier import verifier_types as vtypes
from ..error import ClassLoaderError
#types are represented by classname, dimension
#primative types are .int, etc since these cannot be valid classnames since periods are forbidden
def TypeTT(baset, dim):
assert(dim >= 0)
return baset, dim
# Not real types
Void... | victorbriz/Krakatau | Krakatau/ssa/objtypes.py | Python | gpl-3.0 | 4,510 |
from response import Response
class SendGyroStabilizedEulerAnglesResponse(Response):
RESPONSE_SIZE = 11
def __init__(self, values, time):
super(SendGyroStabilizedEulerAnglesResponse, self).__init__(time, values)
def get_roll(self):
return self.values[1]
def get_pitch(self):
... | clubcapra/Ibex | src/microstrain_3dmgx1_imu/scripts/includes/responses/send_gyro_stabilized_euler_angles_response.py | Python | gpl-3.0 | 397 |
from django.db import models
from django.utils.timesince import timesince
from account.models import User
class CommentKind:
PAGE = 0
USER = 1
DECK = 2
class Comment(models.Model):
"""
Kind can be Page (home page), User (user's wall) or a deck
Target is the id/key that the comment is made f... | amirm3hdi/donate-clan | comment/models.py | Python | gpl-3.0 | 990 |
# Created By: Virgil Dupras
# Created On: 2008-07-05
# Copyright 2015 Hardcoded Software (http://www.hardcoded.net)
#
# This software is licensed under the "GPLv3" License as described in the "LICENSE" file,
# which should be included with this package. The terms are also available at
# http://www.gnu.org/licenses/gpl-... | fokusov/moneyguru | core/tests/gui/split_table_test.py | Python | gpl-3.0 | 6,822 |
import os
import re
import sys
import subprocess
import getpass
import logging
import itertools
import requests
import json
import platform
import select
import multiprocessing
from distutils.spawn import find_executable
import pwd, grp
class PatchError(Exception):
pass
class CommandFailedError(Exception):
pass
... | hatwar/buyback-bench4 | bench/utils.py | Python | gpl-3.0 | 19,797 |
# -*- encoding: utf-8 -*-
import pytest
from abjad import *
def test_pitchtools_NamedPitch___cmp___01():
r'''Referentially equal pitches compare equally.
'''
pitch_1 = NamedPitch('fs', 4)
assert pitch_1 == pitch_1
assert not pitch_1 != pitch_1
assert not pitch_1 > pitch_1
assert ... | mscuthbert/abjad | abjad/tools/pitchtools/test/test_pitchtools_NamedPitch___cmp__.py | Python | gpl-3.0 | 2,261 |
# !/usr/bin/python
# -*- coding: utf-8 -*-
"""
< Arquivo que inicia a interface. >
author: Cassiano Kunsch das Neves
last edited: <12/04/2016>
"""
from PyQt4.QtGui import QApplication
import sys
from View.MainWindow import MainWindow
from Controle.Controle import Control
from Model.Model import Model
class App(QAp... | LEDS/Lifebox | Codigo/main_app.py | Python | gpl-3.0 | 646 |
# Copyright (C) 2015 ABRT Team
# Copyright (C) 2015 Red Hat, Inc.
#
# This file is part of faf.
#
# faf 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) ... | patriczek/faf | src/pyfaf/storage/migrations/versions/4ff13674a015_add_semver_to_build.py | Python | gpl-3.0 | 2,254 |
__all__ = ['lib']
| Veil-Framework/Veil | __init__.py | Python | gpl-3.0 | 18 |
from datetime import datetime
import logging
from typing import Dict, List, Optional, Any, Callable
from blueman.Functions import adapter_path_to_name
from blueman.gui.GenericList import GenericList, ListDataDict
from blueman.Constants import ICON_PATH
from blueman.bluez.Manager import Manager
from blueman.bluez.Devic... | blueman-project/blueman | blueman/gui/DeviceList.py | Python | gpl-3.0 | 13,707 |
#!/usr/bin/env python
import netCDF4
import numpy
import m6plot
try: import argparse
except: raise Exception('This version of python is not new enough. python 2.7 or newer is required.')
parser = argparse.ArgumentParser(description='''Script for plotting annual-average SSS bias.''')
parser.add_argument('annual_file'... | StevePny/NOAA-GFDL-MOM6-examples | tools/analysis/SSS_bias_WOA05.py | Python | gpl-3.0 | 2,668 |
"""
Provides arm's version and release date.
"""
VERSION = '1.4.6_dev'
LAST_MODIFIED = "April 28, 2011"
| refnode/arm | src/version.py | Python | gpl-3.0 | 106 |
# -*- coding: utf-8 -*-
# Copyright (C) 2014 Canonical
#
# Authors:
# Didier Roche
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation; version 3.
#
# This program is distributed in the hope that ... | sschuberth/ubuntu-make | umake/frameworks/go.py | Python | gpl-3.0 | 2,880 |
#!/usr/bin/env python
# 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/.
"""
List mozbase package dependencies or generate changelogs
from commit messages.
"""
from coll... | kostaspl/SpiderMonkey38 | testing/mozbase/versioninfo.py | Python | mpl-2.0 | 4,194 |
import pytest
from treeherder.model.models import FailureLine, Job, Repository
from treeherder.push_health.tests import get_test_failures, get_test_failure_jobs, has_job, has_line
@pytest.mark.parametrize(('find_it',), [(True,), (False,)])
def test_has_job(find_it):
job = Job(id=123, repository=Repository(), gui... | jmaher/treeherder | tests/push_health/test_tests.py | Python | mpl-2.0 | 1,409 |
# -*- Mode: python; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
#
# 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 django.db.models.signals impo... | Liongold/crash | django/crashreport/symbols/signals.py | Python | mpl-2.0 | 3,671 |
import json
import os
import socket
import threading
import time
import traceback
import urlparse
import uuid
from .base import (CallbackHandler,
RefTestExecutor,
RefTestImplementation,
TestharnessExecutor,
extra_timeout,
st... | peterjoel/servo | tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/executors/executorwebdriver.py | Python | mpl-2.0 | 17,191 |
# -*- 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... | aricchen/openHR | openerp/addons/stock/stock.py | Python | agpl-3.0 | 157,636 |
# coding=utf-8
# Copyright (c) 2001-2014, Canal TP and/or its affiliates. All rights reserved.
#
# This file is part of Navitia,
# the software to build cool stuff with public transport.
#
# Hope you'll enjoy and contribute to this project,
# powered by Canal TP (www.canaltp.fr).
# Help us simplify mobility an... | pbougue/navitia | source/jormungandr/jormungandr/interfaces/v1/Uri.py | Python | agpl-3.0 | 17,747 |
"""
Helper functions for test tasks
"""
import os
import re
import subprocess
from paver.easy import cmdopts, sh, task
from pavelib.utils.envs import Env
from pavelib.utils.timer import timed
from pavelib.utils.db_utils import get_file_from_s3, upload_to_s3
try:
from bok_choy.browser import browser
except Impo... | stvstnfrd/edx-platform | pavelib/utils/test/utils.py | Python | agpl-3.0 | 5,811 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import time
from django.db import migrations
from temba.utils import chunk_list
FETCH_BATCH_SIZE = 1000000
UPDATE_BATCH_SIZE = 1000
def populate_responded_migration(apps, schema_editor):
"""
For running migration logic inside a database sync
... | reyrodrigues/EU-SMS | temba/flows/migrations/0045_populate_responded.py | Python | agpl-3.0 | 3,325 |
##############################################################################
#
# Copyright (C) 2020 Compassion CH (http://www.compassion.ch)
# @author: Emanuel Cino <ecino@compassion.ch>
#
# The licence is in the file __manifest__.py
#
#########################################################################... | CompassionCH/compassion-switzerland | mass_mailing_switzerland/wizards/__init__.py | Python | agpl-3.0 | 515 |
from django.conf.urls import patterns, url
from . import views as v
urlpatterns = patterns(
'',
url(r'^lineas/$', v.LineaList.as_view(), name="lineas"),
url(r'^lineas/usuario/(?P<username>[\w_-]+)$', v.LineasUsuario.as_view(), name="lineas_usuario"),
url(r'^cuentas/$', v.CuentasList.as_view(), name="cu... | andensinlimite/metaespacio | metaespacio/contabilidad/urls.py | Python | agpl-3.0 | 679 |
# hack to return special attributes
from _sys import *
from javascript import JSObject
has_local_storage=__BRYTHON__.has_local_storage
has_json=__BRYTHON__.has_json
argv = ['__main__']
base_exec_prefix = __BRYTHON__.brython_path
base_prefix = __BRYTHON__.brython_path
builtin_module_names=__BRYTHON__.builtin_module... | andresmrm/brython-experiment | static/brython/Lib/sys.py | Python | agpl-3.0 | 3,779 |
# coding: utf-8
from django.contrib.postgres.fields import JSONField as JSONBField
from django.db import models
from django.utils import timezone
class AssetUserPartialPermission(models.Model):
"""
Many-to-Many table which provides users' permissions
on other users' submissions
For example,
-... | onaio/kpi | kpi/models/asset_user_partial_permission.py | Python | agpl-3.0 | 1,507 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from random import choice
from string import digits
from odoo import models, fields, api, exceptions, _, SUPERUSER_ID
class HrEmployee(models.Model):
_inherit = "hr.employee"
_description = "Employee"
def... | dfang/odoo | addons/hr_attendance/models/hr_employee.py | Python | agpl-3.0 | 7,572 |
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import itertools
import textwrap
import llnl.util.lang
import six
import spack.config
from spack.util.path import canonic... | iulian787/spack | lib/spack/spack/tengine.py | Python | lgpl-2.1 | 3,454 |
from __future__ import print_function, division
import numpy as np
from msmbuilder.hmm import VonMisesHMM
from msmbuilder.example_datasets import AlanineDipeptide
from msmbuilder.featurizer import DihedralFeaturizer
from scipy.stats.distributions import vonmises
from itertools import permutations
import random
def t... | rmcgibbo/msmbuilder | msmbuilder/tests/test_vmhmm.py | Python | lgpl-2.1 | 3,951 |
# Copyright (C) 2011-2016 Red Hat, Inc.
# 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 any later version.
#
# This library is distributed in the h... | libstorage/libstoragemgmt | plugin/sim_plugin/simarray.py | Python | lgpl-2.1 | 99,070 |
#!/usr/bin/env python
#----------------------------------------------------------------------------
# Name: gen_iface.py
# Purpose: Generate stc.h and stc.cpp from the info in Scintilla.iface
#
# Author: Robin Dunn
#
# Created: 5-Sept-2000
# RCS-ID: $Id$
# Copyright: (c) 2000 by Total C... | enachb/freetel-code | src/wxWidgets-2.9.4/src/stc/gen_iface.py | Python | lgpl-2.1 | 31,956 |
mock_installdata = {
"oauthId": "f3100c47-9936-40e8-a8aa-12314e8da8f0",
"capabilitiesUrl": "https://api.hipchat.com/v2/capabilities",
"roomId": 2589171,
"groupId": 46617,
"oauthSecret": "Jgtf1Baj5KrSpXHZ7d7OkH3Krwr6cotspI7kJm9C"}
mock_capabilitiesData = {
'description': 'Group chat and IM built... | wardweistra/glassfrog-hipchat-bot | tests/test_values.py | Python | lgpl-3.0 | 20,932 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 OpenStack Foundation
# Copyright 2013 IBM Corp.
#
# 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/li... | ntt-sic/keystone | keystone/tests/test_v3_protection.py | Python | apache-2.0 | 28,504 |
import io
import os
from mock import patch
from tests.base import mock
from tests.cmd.test_cmd import CmdTestsBase
from jenkins_jobs.cli import entry
from jenkins_jobs import builder
@mock.patch('jenkins_jobs.builder.JenkinsManager.get_plugins_info',
mock.MagicMock)
class TestConfigs(CmdTestsBase):
... | OSSystems/jenkins-job-builder | tests/cmd/test_config.py | Python | apache-2.0 | 7,457 |
# Copyright (c) 2013 VMware, 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... | alex8866/cinder | cinder/volume/drivers/vmware/vmdk.py | Python | apache-2.0 | 94,807 |
# Copyright 2012 IBM Corp.
# Copyright 2013 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 r... | JianyuWang/nova | nova/tests/unit/conductor/test_conductor.py | Python | apache-2.0 | 97,620 |
'''
Test redirection
'''
# 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 (t... | bryancall/trafficserver | tests/gold_tests/redirect/redirect.test.py | Python | apache-2.0 | 7,502 |
import importlib
from flask import Flask, jsonify
from flask import request
app = Flask(__name__)
import json
import pprint
app.config.from_object('server_config')
_recs_mod = importlib.import_module(app.config['PREDICTION_ALG'])
def extract_input():
client = request.args.get('client')
j = json.loads(request.... | tmylk/seldon-server | external/predictor/python/docker/vw_runtime/scripts/server.py | Python | apache-2.0 | 1,223 |
# -*- coding: utf-8 -*-
# Copyright 2016 OpenMarket Ltd
#
# 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 la... | TribeMedia/synapse | synapse/storage/devices.py | Python | apache-2.0 | 20,883 |
#!/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... | kawamon/hue | desktop/libs/libsolr/src/libsolr/tests.py | Python | apache-2.0 | 2,690 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2019-01-29 16:22
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('questions', '0037_rename_en_to_lang1'),
]
operations = [
migrations.RenameField(
... | rdmorganiser/rdmo | rdmo/questions/migrations/0038_rename_de_to_lang2.py | Python | apache-2.0 | 1,851 |
#!/usr/bin/env python
"""
Copyright (c) 2006-2016 sqlmap developers (http://sqlmap.org/)
See the file 'doc/COPYING' for copying permission
"""
import string
from lib.core.enums import PRIORITY
__priority__ = PRIORITY.LOWEST
def dependencies():
pass
def tamper(payload, **kwargs):
"""
Url-encodes all ch... | glaudsonml/kurgan-ai | tools/sqlmap/tamper/charencode.py | Python | apache-2.0 | 1,379 |
# Webhooks for external integrations.
from typing import Any, Dict
from django.http import HttpRequest, HttpResponse
from zerver.decorator import api_key_only_webhook_view
from zerver.lib.request import REQ, has_request_variables
from zerver.lib.response import json_success
from zerver.lib.webhooks.common import chec... | rishig/zulip | zerver/webhooks/splunk/view.py | Python | apache-2.0 | 1,706 |
#!/usr/bin/python2.5
# Copyright 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | istevens/personfinder-search-api | app/gadget.py | Python | apache-2.0 | 828 |
# 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, ... | googleapis/python-bigquery | samples/tests/test_client_query_relax_column.py | Python | apache-2.0 | 1,180 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Tests for the MountPoints2 Windows Registry plugin."""
import unittest
from plaso.parsers.winreg_plugins import mountpoints
from tests.parsers.winreg_plugins import test_lib
class MountPoints2PluginTest(test_lib.RegistryPluginTestCase):
"""Tests for the MountPoin... | log2timeline/plaso | tests/parsers/winreg_plugins/mountpoints.py | Python | apache-2.0 | 2,338 |
# Copyright 2010-2011 OpenStack Foundation
# Copyright 2012-2013 IBM Corp.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICEN... | sergmelikyan/murano | murano/tests/unit/db/migration/test_migrations_base.py | Python | apache-2.0 | 23,913 |
# ----------------------------------------------------------------------------
# Copyright 2015-2016 Nervana Systems Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apa... | Jokeren/neon | tests/test_linear_layer.py | Python | apache-2.0 | 6,741 |
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | peterbraden/tensorflow | tensorflow/python/kernel_tests/xent_op_test.py | Python | apache-2.0 | 6,102 |
# -*- coding: utf-8 -*-
# Copyright (c) 2015-2022, Exa Analytics Development Team
# Distributed under the terms of the Apache License 2.0
#"""
#PW Header Subsection Parser
##############################
#"""
#from exatomic.exa.typed import TypedProperty
#from exatomic.exa.core.parser import Sections, Parser
#
#
#class ... | exa-analytics/exatomic | exatomic/qe/pw/header.py | Python | apache-2.0 | 391 |
# ===============================================================================
# Copyright 2013 Jake Ross
#
# 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/licens... | USGSDenverPychron/pychron | pychron/hardware/transducer.py | Python | apache-2.0 | 3,379 |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the... | openstack/keystone | api-ref/source/conf.py | Python | apache-2.0 | 6,364 |
#
# 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... | nathanielvarona/airflow | airflow/providers/amazon/aws/transfers/s3_to_ftp.py | Python | apache-2.0 | 2,508 |
# This migration port `scripts/parse_citation_styles` to automatically parse citation styles.
# Additionally, this set the corresponding `has_bibliography` field to `False` for all citation formats whose CSL files do not
# include a bibliography section. As a result, all such citation formats would not show up in OSF
#... | TomBaxter/osf.io | osf/migrations/0074_parse_citation_styles.py | Python | apache-2.0 | 2,934 |
# 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... | DCSaunders/tensorflow | tensorflow/contrib/learn/python/learn/monitors.py | Python | apache-2.0 | 45,465 |
# yellowbrick.colors
# Colors and color helpers brought in from a different library.
#
# Author: Benjamin Bengfort <bbengfort@districtdatalabs.com>
# Created: Fri Jun 24 17:02:53 2016 -0400
#
# Copyright (C) 2016 District Data Labs
# For license information, see LICENSE.txt
#
# ID: colors.py [] benjamin@bengfort.com... | balavenkatesan/yellowbrick | yellowbrick/style/colors.py | Python | apache-2.0 | 4,561 |
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | QiJune/Paddle | python/paddle/fluid/tests/test_gradient_clip.py | Python | apache-2.0 | 2,742 |
'''
@author: FangSun
'''
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_lib as test_lib
import zstackwoodpecker.test_state as test_state
import zstackwoodpecker.operations.vm_operations as vm_ops
import time
from multiprocessing.dummy import Pool as ThreadPool
_config_ = {
'timeout... | zstackio/zstack-woodpecker | integrationtest/vm/vm_offering/test_hotplugin_cpu_mem_5vm_parallel.py | Python | apache-2.0 | 3,926 |
"""
WSGI config for music project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTIN... | tiholic/Musci | music/music/wsgi.py | Python | apache-2.0 | 388 |
#
# Copyright (c) SAS Institute 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 w... | fedora-conary/rmake-2 | rmake_test/resources.py | Python | apache-2.0 | 1,144 |
"""
Support for Tile® Bluetooth trackers.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/device_tracker.tile/
"""
import logging
from datetime import timedelta
import voluptuous as vol
from homeassistant.components.device_tracker import PLATFORM_SCHEMA... | PetePriority/home-assistant | homeassistant/components/device_tracker/tile.py | Python | apache-2.0 | 4,919 |
# Copyright The Cloud Custodian Authors.
# SPDX-License-Identifier: Apache-2.0
from azure.mgmt.eventgrid.models import \
StorageQueueEventSubscriptionDestination
from c7n_azure.azure_events import AzureEventSubscription
from c7n_azure.storage_utils import StorageUtilities
from ..azure_common import BaseTest, arm_t... | alfredgamulo/cloud-custodian | tools/c7n_azure/tests_azure/tests_resources/test_event_subscriptions.py | Python | apache-2.0 | 3,003 |
from setuptools import setup
setup(
name='PyBeacon',
version='0.2.4.3',
packages=['PyBeacon'],
entry_points = {
"console_scripts": ['PyBeacon = PyBeacon.PyBeacon:main']
},
description ='Python script for scanning and advertising urls over Eddystone-URL.',
url='https://github.com/n... | nirmankarta/eddystone | eddystone-url/implementations/PyBeacon/setup.py | Python | apache-2.0 | 957 |
# Copyright 2019 The Magenta Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | adarob/magenta | magenta/pipelines/dag_pipeline_test.py | Python | apache-2.0 | 29,741 |
__author__ = 'Eugene'
class SessionHelper:
def __init__(self, app):
self.app = app
def login(self, username, password):
wd = self.app.wd
self.app.open_home_page()
wd.find_element_by_name("user").click()
wd.find_element_by_name("user").clear()
wd.find_element_b... | eugene1smith/homeworks | fixture/session.py | Python | apache-2.0 | 1,342 |
#
# 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... | jeckersb/Proton | tests/python/proton_tests/messenger.py | Python | apache-2.0 | 29,926 |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | mahak/neutron | neutron/extensions/security_groups_remote_address_group.py | Python | apache-2.0 | 920 |
# 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... | taknevski/tensorflow-xsmm | tensorflow/python/debug/cli/stepper_cli.py | Python | apache-2.0 | 21,179 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2013 vArmour 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.apa... | oeeagle/quantum | neutron/tests/unit/services/firewall/agents/varmour/test_varmour_router.py | Python | apache-2.0 | 11,866 |
#!/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... | Peddle/hue | apps/beeswax/src/beeswax/server/hive_server2_lib.py | Python | apache-2.0 | 43,366 |
#!/usr/bin/env python3
# Uncomment the apply(use_aws_secret()) below if you are not using OIDC
# more info : https://github.com/kubeflow/pipelines/tree/master/samples/contrib/aws-samples/README.md
import kfp
import json
import os
import copy
from kfp import components
from kfp import dsl
from kfp.aws import use_aws_s... | kubeflow/pipelines | samples/contrib/aws-samples/simple_train_pipeline/training-pipeline.py | Python | apache-2.0 | 2,682 |
# coding: utf-8
# In[ ]:
import os
import sys
import re # for regex
import math
import json
import pickle
import importlib
from PIL import Image
import numpy as np
from sklearn.datasets import fetch_mldata
import matplotlib.pyplot as plt
get_ipython().magic('matplotlib inline')
# import pycuda.autoinit
from chai... | TakuTsuzuki/Hackathon2015 | Hiroshiba/NeuralNetwork/history/test_TheanoSAE.py | Python | apache-2.0 | 923 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2017-09-02 23:29
from __future__ import unicode_literals
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('projects', '0002_project_v... | srtab/alexandriadocs | alexandriadocs/projects/migrations/0003_auto_20170902_2329.py | Python | apache-2.0 | 938 |
from ..validator import RdfValidator
from ..schemadef import RdfSchemaDef
class RNewsValidator(RdfValidator):
def __init__(self, graph, doc_lines, url=""):
super(RNewsValidator, self).__init__(graph, doc_lines, url=url)
self.schema_def = RNewsSchemaDef()
self.allowed_namespaces = ["http://... | emmett9001/schema.to | schemato/schemas/rnews.py | Python | apache-2.0 | 617 |
from django.db.models import Count
from tastypie.resources import ModelResource, ALL_WITH_RELATIONS
from tastypie import http, fields
from tastypie.exceptions import ImmediateHttpResponse
from tastypie.bundle import Bundle
import json
from django.core.exceptions import ValidationError, ObjectDoesNotExist
from django.... | bobsilverberg/moztrap | moztrap/model/execution/api.py | Python | bsd-2-clause | 12,265 |
# encoding: utf-8
# module array
# from (built-in)
# by generator 1.130
"""
This module defines an object type which can efficiently represent
an array of basic values: characters, integers, floating point
numbers. Arrays are sequence types and behave very much like lists,
except that the type of objects stored in the... | akiokio/centralfitestoque | src/.pycharm_helpers/python_stubs/-1807332816/array.py | Python | bsd-2-clause | 12,080 |
""" Quality assurance and data cleaning.
"""
from __future__ import (absolute_import, division,
print_function, unicode_literals)
import numpy as np
def find_duplicate_rows(x, as_string=False):
r""" Find rows which are duplicated in x
Notes
-----
If you load a file, for exam... | qqqube/permute | permute/qa.py | Python | bsd-2-clause | 1,427 |
from .. import Foo, DB_NAME
from rethinkengine.connection import connect, disconnect, ConnectionError
import unittest2 as unittest
import rethinkdb as r
class DeleteTestCase(unittest.TestCase):
def setUp(self):
connect(DB_NAME)
Foo.objects.all().delete()
Foo(name='foo1').save()
F... | OpenSystemsLab/rethinkengine | tests/query_set/test_delete.py | Python | bsd-2-clause | 1,104 |
import os
from flask import Flask, render_template_string, request
from flask.ext.mail import Mail
from flask.ext.sqlalchemy import SQLAlchemy
from flask.ext.user import login_required, SQLAlchemyAdapter, UserManager, UserMixin
from flask.ext.user import roles_required
# Use a Class-based config to avoid needing a 2n... | brandonium21/snowflake | snowflakeEnv/lib/python2.7/site-packages/flask_user/tests/tst_app.py | Python | bsd-2-clause | 6,460 |
from indra.databases import go_client
def test_invalid_id():
go_name = go_client.get_go_label('34jkgfh')
assert go_name is None
def test_go_id_lookup():
go_id = 'GO:0001768'
go_name = go_client.get_go_label(go_id)
assert go_name == 'establishment of T cell polarity'
def test_go_label_to_id():
... | sorgerlab/indra | indra/tests/test_go_client.py | Python | bsd-2-clause | 1,683 |
#!/usr/bin/env python
import sys
import os
import glob
try:
from setuptools import setup
except ImportError as ex:
from distutils.core import setup
kwargs = {}
try:
# only necessary for the windows build
import py2exe
kwargs.update({'console': ['odml-gui']})
except ImportError:
py2exe = None... | carloscanova/python-odml | setup.py | Python | bsd-3-clause | 1,203 |
import django
import os
import warnings
warnings.simplefilter('always')
PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__))
DATABASES = {
'default': {
'NAME': os.path.join(PROJECT_ROOT, 'db.sqlite'),
'ENGINE': 'django.db.backends.sqlite3',
}
}
SITE_ID = 1
# Set in order to catch time... | gregmuellegger/django-autofixture | autofixture_tests/settings.py | Python | bsd-3-clause | 1,610 |
from django.core.cache import cache
from django.http import HttpResponseRedirect
from django.core.urlresolvers import reverse
from omblog import settings as o_settings
from omblog.cache import get_key
def login_required(fn):
"""will redirect to the admin login page if a user
is not authed"""
def _login_re... | dubu/python_temp | omblog/decorators.py | Python | bsd-3-clause | 1,460 |
from logging.config import fileConfig
from alembic import context
from sqlalchemy import engine_from_config, pool
from qcfractal.storage_sockets.models import Base
# this is the Alembic Config object, which provides
# access to the values within the .ini file in use.
config = context.config
# Interpret the config f... | psi4/mongo_qcdb | qcfractal/alembic/env.py | Python | bsd-3-clause | 2,211 |
# Authors: Daniel Strohmeier <daniel.strohmeier@tu-ilmenau.de>
# Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
#
# License: BSD (3-clause)
from math import sqrt
import numpy as np
from scipy import linalg
from ..utils import check_random_state, logger, verbose
def power_iteration_kron(A, C, ... | adykstra/mne-python | mne/inverse_sparse/mxne_debiasing.py | Python | bsd-3-clause | 3,610 |
import os
import string
import archivebuilder
import carchive
import tocfilter
import bindepend
import finder
_cache = {}
def makeresource(name, xtrapath=None):
"""Factory function that returns a resource subclass.
NAME is the logical or physical name of a resource.
XTRAPTH is a path or list of pat... | toontownfunserver/Panda3D-1.9.0 | direct/pyinst/resource.py | Python | bsd-3-clause | 11,633 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read()
with open('requirements.txt') as requirements_file:
requirements = requirements_file.... | tiagolbiotech/BioCompass | setup.py | Python | bsd-3-clause | 1,360 |
"""
Generic data algorithms. This module is experimental at the moment and not
intended for public consumption
"""
from __future__ import division
from warnings import warn, catch_warnings, simplefilter
from textwrap import dedent
import numpy as np
from pandas.core.dtypes.cast import (
maybe_promote, construct_1... | harisbal/pandas | pandas/core/algorithms.py | Python | bsd-3-clause | 60,557 |
# Generated by Django 3.1.2 on 2020-10-15 00:52
from django.db import migrations
def add_choose_permission_to_admin_groups(apps, _schema_editor):
ContentType = apps.get_model("contenttypes.ContentType")
Permission = apps.get_model("auth.Permission")
Group = apps.get_model("auth.Group")
# Get documen... | wagtail/wagtail | wagtail/documents/migrations/0011_add_choose_permissions.py | Python | bsd-3-clause | 3,644 |
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from ....testing import assert_equal
from ..brainsuite import SVReg
def test_SVReg_inputs():
input_map = dict(args=dict(argstr='%s',
),
atlasFilePrefix=dict(argstr="'%s'",
position=1,
),
curveMatchingInstructions=dict(argstr="'-cur %s'",
... | carolFrohlich/nipype | nipype/interfaces/brainsuite/tests/test_auto_SVReg.py | Python | bsd-3-clause | 1,830 |
from __future__ import absolute_import
from django.apps import AppConfig
class Config(AppConfig):
name = "sentry.auth.providers.saml2.generic"
def ready(self):
from sentry.auth import register
from .provider import GenericSAML2Provider
register("saml2", GenericSAML2Provider)
| beeftornado/sentry | src/sentry/auth/providers/saml2/generic/apps.py | Python | bsd-3-clause | 314 |
# This file is part of the Astrometry.net suite.
# Licensed under a 3-clause BSD style license - see LICENSE
from distutils.command.build_ext import build_ext # as _build_py
#from distutils.command import build_ext as _build_ext
from distutils.dep_util import newer_group, newer
from distutils import log
import os
clas... | olebole/astrometry.net | util/an_build_ext.py | Python | bsd-3-clause | 2,336 |
# Generated by Django 3.2.2 on 2021-05-24 07:38
from django.db import migrations
def fill_reports_field(apps, schema_editor):
Profile = apps.get_model("accounts", "Profile")
Profile.objects.filter(reports_allowed=False).update(reports="off")
Profile.objects.filter(reports_allowed=True).update(reports="mo... | healthchecks/healthchecks | hc/accounts/migrations/0036_fill_profile_reports.py | Python | bsd-3-clause | 531 |
# -*- coding: utf-8 -*-
import pytest
from .utils import get, versioned_reverse as reverse, assert_fields_exist
# === util methods ===
def get_list(api_client, version='v1'):
list_url = reverse('user-list', version=version)
return get(api_client, list_url)
def get_detail(api_client, detail_pk, version='v1')... | aapris/linkedevents | events/tests/test_user_get.py | Python | bsd-3-clause | 1,174 |
#!/usr/bin/env python
import time
import legume
import shared
import random
class ServerBall(shared.Ball):
BALL_ID = 0
def __init__(self, env):
shared.Ball.__init__(self, env)
self.x = random.randint(0, shared.ZONE_WIDTH)
self.y = random.randint(0, shared.ZONE_HEIGHT)
self.vx =... | reidyd/legume | examples/bounceball/server.py | Python | bsd-3-clause | 4,144 |
# This file is part of the Astrometry.net suite.
# Licensed under a 3-clause BSD style license - see LICENSE
from __future__ import print_function
from index_c import *
from _index_util import *
def index_get_codes(I):
addr = codekd_addr(I)
return codekd_get_codes_numpy(addr)
def index_get_stars(I):
addr ... | olebole/astrometry.net | util/index.py | Python | bsd-3-clause | 1,590 |
import pytest
import rasterio
from rasterio.enums import ColorInterp
def test_cmyk_interp(tmpdir):
"""A CMYK TIFF has cyan, magenta, yellow, black bands."""
with rasterio.open('tests/data/RGB.byte.tif') as src:
meta = src.meta
meta['photometric'] = 'CMYK'
meta['count'] = 4
tiffname = str(... | kapadia/rasterio | tests/test_colorinterp.py | Python | bsd-3-clause | 1,249 |