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
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | SUSE/azure-sdk-for-python | azure-mgmt-resource/azure/mgmt/resource/managedapplications/version.py | Python | mit | 506 |
#!/usr/bin/env python
# ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
"""
class for handling .bb files
Reads a .bb file and obtains its metadata
"""
# Copyright (C) 2003, 2004 Chris Larson
# Copyright (C) 2003, 2004 Phil Blundell
#
# This program is free software; ... | schleichdi2/OPENNFR-6.0-CORE | bitbake/lib/bb/parse/parse_py/BBHandler.py | Python | gpl-2.0 | 8,492 |
"""
Gather F5 LTM Virtual Server Information
@author: David Petzel
@contact: david.petzel@disney.com
@date: 05/06/2011
"""
from Products.DataCollector.plugins.CollectorPlugin import SnmpPlugin, GetTableMap, GetMap
from Products.DataCollector.plugins.DataMaps import ObjectMap
import re
import binascii
import string
i... | anksp21/Community-Zenpacks | ZenPacks.community.f5/ZenPacks/community/f5/modeler/plugins/BigipLtmVirtualServerMap.py | Python | gpl-2.0 | 4,833 |
#! /usr/bin/env python
from hermes2d import Mesh, MeshView, H1Shapeset, PrecalcShapeset, H1Space, \
LinSystem, WeakForm, DummySolver, Solution, ScalarView
from hermes2d.examples.c06 import set_bc, set_forms
from hermes2d.examples import get_example_mesh
mesh = Mesh()
mesh.load(get_example_mesh())
#mesh.refin... | solin/hermes2d | python/examples/06.py | Python | gpl-2.0 | 1,022 |
# Opus/UrbanSim urban simulation software.
# Copyright (C) 2005-2009 University of Washington
# See opus_core/LICENSE
from opus_core.tests.utils.package_tester import PackageTester
PackageTester().run_all_tests_for_package('sanfrancisco') | christianurich/VIBe2UrbanSim | 3rdparty/opus/src/sanfrancisco/tests/all_tests.py | Python | gpl-2.0 | 247 |
#!/usr/bin/python
"""
Usage: python manifestParser.py [path to list with manifest paths].
Parses the manifests indicated in the list file and cretes a pl file with the aplication permissions.
"""
import os,sys
import subprocess
import xml.etree.ElementTree as ET
class manifestParser:
"""
Main class that parses m... | afmurillo/FinalHerramientas-2014-2 | ProyectoFinal/Codigo/manifestParser.py | Python | gpl-2.0 | 3,248 |
"""
Contains functionality common across all repository-related managers.
= Working Directories =
Working directories are as staging or temporary file storage by importers
and distributors. Each directory is unique to the repository and plugin
combination.
The directory structure for plugin working directories is as ... | beav/pulp | server/pulp/server/managers/repo/_common.py | Python | gpl-2.0 | 9,312 |
#!/usr/bin/env python
# encoding: utf-8
#
# rbootstrap - Install RPM based Linux into chroot jails
# Copyright (C) 2014 Lars Michelsen <lm@larsmichelsen.com>
#
# 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 Softwar... | LaMi-/rbootstrap | rbootstrap/exceptions.py | Python | gpl-2.0 | 1,001 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('common', '0004_category'),
('seller', '0014_auto_20150607_0943'),
]
operations = [
migrations.AddField(
... | tomcounsell/Cobra | apps/seller/migrations/0015_asset_newcategories.py | Python | gpl-2.0 | 455 |
#
# Copyright 2001 - 2016 Ludek Smid [http://www.ospace.net/]
#
# This file is part of Outer Space.
#
# Outer Space 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
# (... | dahaic/outerspace | client/osci/handler.py | Python | gpl-2.0 | 2,143 |
import fauxfactory
import pytest
from cfme import test_requirements
from cfme.control.explorer.policies import VMControlPolicy
from cfme.infrastructure.provider.virtualcenter import VMwareProvider
from cfme.markers.env_markers.provider import ONE_PER_TYPE
from cfme.utils.appliance.implementations.ui import navigate_to... | nachandr/cfme_tests | cfme/tests/ansible/test_embedded_ansible_actions.py | Python | gpl-2.0 | 6,825 |
""" This module provides access to higher level functions and
constants for ieee special values such as Not a Number (nan) and
infinity (inf).
>>> from numarray import *
The special values are designated using lower case as follows:
>> inf
inf
>> plus_inf
inf
>> minus_inf
-inf
>> nan
nan
>> plus_zero
0.0
>> minus_ze... | fxia22/ASM_xf | PythonD/site_python/numarray/ieeespecial.py | Python | gpl-2.0 | 9,913 |
#
# Copyright 2011-2017 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed ... | nirs/vdsm | lib/vdsm/hook/hooking.py | Python | gpl-2.0 | 2,771 |
import itertools
def split_list_by(l, n):
for i in range(len(l)/n + 1):
p = l[i*n:(i+1)*n]
if p:
yield p
class CountingIterator(object):
def __init__(self, iterator):
self.iterator = iterator
self.count = 0
def __iter__(self):
return self
def next(self):
next = self.iterator.next()
self.coun... | onoga/toolib | toolib/util/split_list.py | Python | gpl-2.0 | 731 |
# -*- coding: utf-8 -*-
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from qgis.core import *
from qgis.gui import *
from dialogBase import GdalToolsBaseDialog as BaseDialog
import GdalTools_utils as Utils
class GdalToolsBasePluginWidget:
def __init__(self, iface, commandName, helpFileBaseName = None, paren... | sourcepole/qgis | qgis/python/plugins/GdalTools/tools/widgetPluginBase.py | Python | gpl-2.0 | 5,083 |
#!/usr/bin/python
"""Joins a number of 3D manual markers into a 4D marker volume."""
# build-in modules
import argparse
import logging
import re
# third-party modules
import scipy
# path changes
# own modules
from medpy.core import Logger
from medpy.io import load, save
from medpy.core.exceptions import ArgumentEr... | kleinfeld/medpy | bin/others/miccai12/join_for_manual_markers.py | Python | gpl-3.0 | 6,830 |
#!/usr/bin/env python
# encoding: utf-8
# andersg at 0x63.nu 2007
# Thomas Nagy 2010 (ita)
"""
Support for Perl extensions. A C/C++ compiler is required::
def options(opt):
opt.load('compiler_c perl')
def configure(conf):
conf.load('compiler_c perl')
conf.check_perl_version((5,6,0))
conf.check_perl_ext_deve... | AltruisticControlSystems/controlnode | waflib/Tools/perl.py | Python | gpl-3.0 | 4,480 |
"""
setup.py: Basic setup wizard steps
Copyright 2014-2015, Outernet Inc.
Some rights reserved.
This software is free software licensed under the terms of GPLv3. See COPYING
file that comes with the source code, or http://www.gnu.org/licenses/gpl.txt.
"""
import pytz
from bottle import request, redirect
from ..for... | karanisverma/feature_langpop | librarian/routes/setup.py | Python | gpl-3.0 | 3,332 |
# -*- coding: utf-8 -*-
# Copyright (C) 2014 Universidade de Aveiro, DETI/IEETA, Bioinformatics Group - http://bioinformatics.ua.pt/
#
# 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 vers... | bioinformatics-ua/catalogue | emif/control_version/admin.py | Python | gpl-3.0 | 834 |
import unittest
from gtrackcore.input.wrappers.GEDependentAttributesHolder import GEDependentAttributesHolder
from gtrackcore.test.common.Asserts import assertBoundingRegions, TestCaseWithImprovedAsserts
from gtrackcore.util.CommonConstants import BINARY_MISSING_VAL
class TestGEDependentAttributesHolder(TestCaseWithI... | sveinugu/gtrackcore | gtrackcore/test/input/wrappers/TestGEDependentAttributesHolder.py | Python | gpl-3.0 | 1,731 |
#Copyright 2013 Paul Barton
#
#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 distributed in the hope tha... | icomfred/mouse | app/python/pymouse/mac.py | Python | gpl-3.0 | 5,514 |
# -*- encoding: utf-8 -*-
def timespan_2_stops_during_timespan_1(
timespan_1=None,
timespan_2=None,
hold=False,
):
r'''Makes time relation indicating that `timespan_2` stops
during `timespan_1`.
::
>>> relation = timespantools.timespan_2_stops_during_timespan_1()
>>> prin... | mscuthbert/abjad | abjad/tools/timespantools/timespan_2_stops_during_timespan_1.py | Python | gpl-3.0 | 1,322 |
# -*- coding: utf-8 -*-
#
# gccjit documentation build configuration file, created by
# sphinx-quickstart on Wed May 7 17:57:19 2014.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All ... | vickenty/pygccjit | doc/conf.py | Python | gpl-3.0 | 7,721 |
# Unix SMB/CIFS implementation.
# Copyright (C) Kai Blin <kai@samba.org> 2011
#
# 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 ... | Zentyal/samba | python/samba/tests/dns.py | Python | gpl-3.0 | 48,654 |
#
# The Python Imaging Library.
# $Id$
#
# base class for image file handlers
#
# history:
# 1995-09-09 fl Created
# 1996-03-11 fl Fixed load mechanism.
# 1996-04-15 fl Added pcx/xbm decoders.
# 1996-04-30 fl Added encoders.
# 1996-12-14 fl Added load helpers
# 1997-01-11 fl Use encode_to_file where possibl... | kenshay/ImageScript | ProgramData/SystemFiles/Python/Lib/site-packages/PIL/ImageFile.py | Python | gpl-3.0 | 20,762 |
# coding=utf-8
"""
InaSAFE Disaster risk assessment tool developed by AusAid -
**QGIS plugin implementation.**
Contact : ole.moller.nielsen@gmail.com
.. note:: 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 S... | MariaSolovyeva/inasafe | safe/gis/qgis_interface.py | Python | gpl-3.0 | 10,359 |
from river.models.proceeding import Proceeding
from river.services.proceeding import ProceedingService
__author__ = 'ahmetdal'
# noinspection PyClassHasNoInit
class ObjectService:
@staticmethod
def register_object(workflow_object, field):
proceedings = Proceeding.objects.filter(workflow_object=workfl... | mstzn36/django-river | river/services/object.py | Python | gpl-3.0 | 1,550 |
"""
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 distributed in the hope that it will be useful,
but WITHOUT... | abhishek-archlinux/AnimeWatch | AnimeWatch-PyQt5/Plugins/Shoutcast.py | Python | gpl-3.0 | 5,280 |
from setuptools import setup
if __name__ == "__main__":
try:
import pypandoc
long_description = pypandoc.convert('README.md', 'rst')
except(IOError, ImportError):
long_description = open('README.md').read()
__version__ = "0.8.1"
base_url = "https://github.com/xialirong/... | PrefPy/prefpy | setup.py | Python | gpl-3.0 | 1,104 |
# "Bubble Math"
# Developed RL Vision (www.rlvision.com)
# Source code licensed under GPLv3 (see LICENSE.txt)
# Dev Env: Portable Python 2.7.5.1 (Python2/Windows/Pygame/PyScripter)
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# Text.py
# This module makes is easier to draw te... | ycaihua/BubbleMath | text.py | Python | gpl-3.0 | 2,074 |
from ..s3c import HTTPError
class B2Error(HTTPError):
'''
Represents an error returned by Backblaze B2 API call
For possible codes, see https://www.backblaze.com/b2/docs/calling.html
'''
def __init__(self, status, code, message, headers=None):
super().__init__(status, message, headers)
... | s3ql/main | src/s3ql/backends/b2/b2_error.py | Python | gpl-3.0 | 584 |
# Copyright 2012 Dan Smith <dsmith@danplanet.com>
#
# 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 ... | mach327/chirp_fork | chirp/drivers/id51.py | Python | gpl-3.0 | 3,283 |
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | ilya-epifanov/ansible | lib/ansible/plugins/action/__init__.py | Python | gpl-3.0 | 24,960 |
import datetime
from django.utils.timezone import now
def current_time():
return now()
def current_date():
return current_time().date()
| danijar/invoicepad | invoicepad/shared/helpers.py | Python | gpl-3.0 | 142 |
#!/usr/bin/python
# -*- encoding: utf-8 -*-
#Importar libreria GPIO
import RPi.GPIO as GPIO
#Definir modo de trabajo para la placa BCM
GPIO.setmode(GPIO.BCM)
#Desactivo Errores
GPIO.setwarnings(False)
#Importamos la libreria time
import time
#Importamos la libreria para comandos de la consola/shell
import os
#De... | fryntiz/Raspberry-PI | Obsoleto/Web VIEJA para controlar GPIO/GPIO/4/activar.py | Python | gpl-3.0 | 465 |
# -*- encoding: utf-8 -*-
from abjad import *
def test_spannertools_Spanner__append_left_01():
r'''Append container to the left.
'''
voice = Voice("{ c'8 d'8 } { e'8 f'8 } { g'8 a'8 }")
beam = Beam()
attach(beam, voice[1])
beam._append_left(voice[0])
assert systemtools.TestManager.compa... | mscuthbert/abjad | abjad/tools/spannertools/test/test_spannertools_Spanner__append_left.py | Python | gpl-3.0 | 1,282 |
from datetime import datetime
from grokcore.component.directive import context
from twisted.internet import defer
from twisted.python import log
from zope.component import provideSubscriptionAdapter
from zope.interface import implements
from opennode.knot.model.compute import ICompute
from opennode.knot.utils.icmp imp... | opennode/opennode-knot | opennode/knot/backend/pingcheck.py | Python | gpl-3.0 | 3,589 |
#
# Paasmaker - Platform as a Service
#
# 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/.
#
import paasmaker
from paasmaker.common.core import constants
from ..base impo... | kaze/paasmaker | paasmaker/common/job/coordinate/instancejobhelper.py | Python | mpl-2.0 | 2,748 |
from openupgradelib import openupgrade
@openupgrade.migrate()
def migrate(env, installed_version):
if not installed_version:
return
churches = env["res.partner"].search([("is_church", "=", True)])
churches.update_number_sponsorships()
| eicher31/compassion-switzerland | partner_compassion/migrations/12.0.1.1.3/post-migration.py | Python | agpl-3.0 | 258 |
# -*- 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
from eve.uti... | mugurrus/superdesk-core | apps/content_filters/content_filter/tests.py | Python | agpl-3.0 | 26,062 |
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'PoliticianInfo'
db.create_table('core_politicianinfo', (
('politician', se... | twhyte/openparliament | parliament/core/migrations/0008_politician_info.py | Python | agpl-3.0 | 6,821 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2018-01-15 08:13
from __future__ import unicode_literals
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('attribution', '0021_attributionnew_substitute'),
]
... | uclouvain/OSIS-Louvain | attribution/migrations/0022_auto_20180115_0913.py | Python | agpl-3.0 | 579 |
# -*- coding: utf-8 -*-
from openerp import models, fields, api, SUPERUSER_ID, exceptions
import uuid
class Volunteer(models.Model):
_inherit = 'res.users'
REASONS = [
('no_time', u'Nie mam czasu.'),
('location_change', u'Zmieniam miejsce zamieszkania.'),
('personal_change', u'Zmieni... | EE/bestja | addons/bestja_account_deletion/models.py | Python | agpl-3.0 | 1,832 |
# -*- 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... | nicobustillos/odoo | addons/product/product.py | Python | agpl-3.0 | 64,968 |
# -*- coding: utf-8 -*-
# This file is part of Shuup.
#
# Copyright (c) 2012-2016, Shoop Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
from django.utils.translation import ugettext_lazy as _
from enumfields impo... | shawnadelic/shuup | shuup/core/suppliers/enums.py | Python | agpl-3.0 | 553 |
Networkx MultiGraph API: (Adjacency dict is the main data structure)
G.adj = G.edge # Adjacency dict with {node1: {node2: {edge_key: {edge attr dict}}}}
G.edge[node1][node2] = G[node1][node2] = {edge_key: {edge attr dict}}
G.node[node1] = {dict with node attr}
G.edges(nbunch, keys=True) => [list with (source, targe... | scholer/nascent | notes/Networkx_notes.py | Python | agpl-3.0 | 538 |
from dependencies.dependency import ClassSecurityInfo
from lims import bikaMessageFactory as _, logger
from lims.idserver import renameAfterCreation
from lims.utils import t, tmpID, changeWorkflowState
from lims.utils import to_utf8 as _c
from lims.browser.fields import HistoryAwareReferenceField
from lims.config impor... | sciCloud/OLiMS | lims/content/worksheet.py | Python | agpl-3.0 | 37,347 |
"""A moving-window filter for smoothing the signals within certain time interval."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import gin
import numpy as np
@gin.configurable
class TimeBasedMovingWindowFilter:
"""A moving-window filter for smooth... | nrz/ylikuutio | external/bullet3/examples/pybullet/gym/pybullet_envs/minitaur/agents/baseline_controller/time_based_moving_window_filter.py | Python | agpl-3.0 | 1,200 |
# -*- coding: utf-8 -*-
# Copyright 2016 LasLabs Inc.
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
from odoo.exceptions import UserError
class ConnectionFailedError(UserError):
pass
class ConnectionSuccessError(UserError):
pass
| thinkopensolutions/server-tools | base_external_dbsource/exceptions.py | Python | agpl-3.0 | 260 |
"""This file implements the gym environment of minitaur.
"""
import math
import time
import os, inspect
currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
parentdir = os.path.dirname(os.path.dirname(currentdir))
os.sys.path.insert(0, parentdir)
import gym
from gym import spaces
fr... | nrz/ylikuutio | external/bullet3/examples/pybullet/gym/pybullet_envs/minitaur/envs/minitaur_gym_env.py | Python | agpl-3.0 | 25,350 |
# encoding: utf-8
from .OpeningHours import ParseException, OpeningHours
| ypid/pyopening_hours | pyopening_hours/__init__.py | Python | agpl-3.0 | 74 |
# cerbero - a multi-platform build system for Open Source software
# Copyright (C) 2012 Andoni Morales Alastruey <ylatuya@gmail.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; eit... | freedesktop-unofficial-mirror/gstreamer-sdk__cerbero | cerbero/build/cookbook.py | Python | lgpl-2.1 | 14,881 |
"""
Implementation of the XDG Menu Specification
http://standards.freedesktop.org/menu-spec/
Example code:
from xdg.Menu import parse, Menu, MenuEntry
def print_menu(menu, tab=0):
for submenu in menu.Entries:
if isinstance(submenu, Menu):
print ("\t" * tab) + unicode(submenu)
print_menu(submenu, ta... | 0312birdzhang/pyxdg | xdg/Menu.py | Python | lgpl-2.1 | 38,726 |
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class RoctracerDev(CMakePackage):
"""ROC-tracer library: Runtimes Generic Callback/Activity API... | LLNL/spack | var/spack/repos/builtin/packages/roctracer-dev/package.py | Python | lgpl-2.1 | 4,005 |
#!/usr/bin/python
import gpod
import sys
if len(sys.argv) > 1:
db = gpod.Database(sys.argv[1])
else:
db = gpod.Database()
print db
for track in db[4:20]:
print track
print track['title']
for pl in db.Playlists:
print pl
for track in pl:
print " ", track
| neuschaefer/libgpod | bindings/python/examples/play_with_ipod_api.py | Python | lgpl-2.1 | 292 |
def itemTemplate():
return ['object/tangible/wearables/armor/padded/shared_armor_padded_s01_helmet.iff']
def customItemName():
return 'Padded Armor Helmet'
def customItemStackCount():
return 1
def customizationAttributes():
return []
def customizationValues():
return []
def itemStats():
stats = ['a... | agry/NGECore2 | scripts/loot/lootItems/armor/padded/padded_armor_helmet.py | Python | lgpl-3.0 | 644 |
# coding:utf-8
from django.conf.urls.defaults import *
# Uncomment the next two lines to enable the admin:
#from django.contrib import admin
# admin.autodiscover()
autourl = ['filemanage',
# (r'^test/$','views.test.test'),
]
urlpatterns = patterns(*tuple(autourl))
| sdgdsffdsfff/yunwei | filemanager/urls.py | Python | lgpl-3.0 | 295 |
class interface(object):
# Copyright 2012 Loris Corazza, Sakis Christakidis
#
# 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
#
# ... | schristakidis/p2ner | p2ner/components/output/nulloutput/nulloutput/interface.py | Python | apache-2.0 | 682 |
# Copyright (c) 2010-2012 OpenStack, 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 ... | citrix-openstack-build/swift | swift/common/direct_client.py | Python | apache-2.0 | 19,446 |
# Copyright 2019 The LUCI Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0
# that can be found in the LICENSE file.
def header(input_api):
"""Returns the expected license header regexp for this project."""
current_year = int(input_api.time.strftime('%Y'))
... | luci/recipes-py | PRESUBMIT.py | Python | apache-2.0 | 2,563 |
# -*- coding: utf-8 -*-
#
# Copyright 2013, Qunar OPSDEV
#
# 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... | shadow4125/qg.core | tests/unit/test_gettextutils.py | Python | apache-2.0 | 1,757 |
# -*- coding: utf-8 -*-
# Copyright 2013 UNED
#
# 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... | OpenMOOC/moocng | moocng/courses/management/commands/csv_awards_by_course.py | Python | apache-2.0 | 3,018 |
# Copyright 2020 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, ... | GoogleCloudPlatform/python-docs-samples | composer/workflows/dataflowtemplateoperator_tutorial_test.py | Python | apache-2.0 | 1,477 |
import datetime
import logging
import multiprocessing
import os
import shutil
from mimetypes import guess_type
from typing import Any, Dict, Iterable, List, Optional, Tuple
import orjson
from bs4 import BeautifulSoup
from django.conf import settings
from django.core.cache import cache
from django.db import connection
... | zulip/zulip | zerver/lib/import_realm.py | Python | apache-2.0 | 62,551 |
# ===============================================================================
# Copyright 2011 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/licenses... | USGSDenverPychron/pychron | pychron/core/xml/xml_parser.py | Python | apache-2.0 | 8,717 |
# -*- coding: utf-8 -*-
import mock
import pytest
from urlparse import urlparse
from api.base.settings.defaults import API_BASE
from framework.auth.core import Auth
from osf.models import NodeLog
from osf.models.licenses import NodeLicense
from osf_tests.factories import (
NodeFactory,
ProjectFactory,
Reg... | leb2dg/osf.io | api_tests/nodes/views/test_node_detail.py | Python | apache-2.0 | 73,296 |
#!/usr/bin/env python2.6
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2013 Contributor
#
# 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... | stdweird/aquilon | tests/broker/test_vlan.py | Python | apache-2.0 | 5,203 |
# -*- coding: utf-8 -*-
#
# QOpenScienceFramework documentation build configuration file, created by
# sphinx-quickstart on Thu May 12 11:05:40 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerat... | dschreij/osf-api-python-toolkit | docs/source/conf.py | Python | apache-2.0 | 10,111 |
"""
mbed CMSIS-DAP debugger
Copyright (c) 2015 ARM Limited
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... | molejar/pyOCD | pyOCD/utility/__init__.py | Python | apache-2.0 | 619 |
from collections import namedtuple
from copy import copy, deepcopy
from datetime import datetime, timedelta
from textwrap import dedent
from distutils.version import LooseVersion
import numpy as np
import pandas as pd
from xray import Variable, Dataset, DataArray
from xray.core import indexing
from xray.core.variable... | clarkfitzg/xray | xray/test/test_variable.py | Python | apache-2.0 | 35,943 |
# 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.core import exceptions
from telemetry.core import util
from telemetry import decorators
from telemetry.internal.actions import... | googlearchive/big-rig | app/src/thirdparty/telemetry/internal/actions/action_runner_unittest.py | Python | apache-2.0 | 12,077 |
import hashlib
from waterbutler import settings
config = settings.child('SERVER_CONFIG')
ADDRESS = config.get('ADDRESS', 'localhost')
PORT = config.get('PORT', 7777)
DOMAIN = config.get('DOMAIN', "http://localhost:7777")
DEBUG = config.get_bool('DEBUG', True)
SSL_CERT_FILE = config.get_nullable('SSL_CERT_FILE', N... | CenterForOpenScience/waterbutler | waterbutler/server/settings.py | Python | apache-2.0 | 1,532 |
def install(job):
from zeroos.orchestrator.sal.Node import Node
from zeroos.orchestrator.configuration import get_jwt_token
service = job.service
job.context['token'] = get_jwt_token(job.service.aysrepo)
node = Node.from_ays(service.parent, job.context['token'])
if node.client.nft.rule_exists(s... | zero-os/0-orchestrator | templates/tcp/actions.py | Python | apache-2.0 | 1,208 |
# 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/.
import base64
import json
import os
import sys
import time
from marionette import MarionetteTestCase
from marionette im... | sergecodd/FireFox-OS | B2G/gaia/tests/python/gaiatest/gaia_test.py | Python | apache-2.0 | 16,942 |
import mock
import unittest
import uuid
from vnc_api import vnc_api
from svc_monitor.vrouter_instance_manager import VRouterInstanceManager
class DBObjMatcher(object):
"""
Object for assert_called_with to check if db object is created properly
"""
def __init__(self, prefix):
self.prefix = pref... | cloudwatt/contrail-controller | src/config/svc-monitor/svc_monitor/tests/test_vrouter_instance_manager.py | Python | apache-2.0 | 3,797 |
"""
This file implements a brew resolver for Galaxy requirements. In order for Galaxy
to pick up on recursively defined and versioned brew dependencies recipes should
be installed using the experimental `brew-vinstall` external command.
More information here:
https://github.com/jmchilton/brew-tests
https://github.com... | ssorgatem/pulsar | galaxy/tools/deps/resolvers/homebrew.py | Python | apache-2.0 | 1,947 |
import networkx as nx
import re
import json
from learning.PageManager import PageManager
class TreeListLearner(object):
def __init__(self):
self.__minEdgeWeight = 2
self.__DEBUG = False
"""
pageRepresentation is the invisible/visible data structure
only_consider_tag lets you f... | usc-isi-i2/landmark-extraction | src/learning/TreeListLearner.py | Python | apache-2.0 | 23,788 |
# 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... | xzturn/tensorflow | tensorflow/python/keras/layers/preprocessing/text_vectorization.py | Python | apache-2.0 | 36,215 |
from django.conf.urls import url,include
from . import views
urlpatterns = [
url(r'^order/address',views.addressPage,name='addressPage1'),
url(r'^order_with_prescription/address',views.addressPage,name='addressPage2'),
url(r'^order_with_prescription/specify',views.choicePage,name='choicePage'),
url(r'... | mpiplani/Online-Pharmacy | online_pharmacy/order/urls.py | Python | apache-2.0 | 547 |
import sys
from setuptools import setup
from setuptools import find_packages
version = '0.5.0.dev0'
install_requires = [
'letsencrypt=={0}'.format(version),
'letsencrypt-apache=={0}'.format(version),
'docker-py',
'requests',
'zope.interface',
]
if sys.version_info < (2, 7):
install_requires... | TheBoegl/letsencrypt | letsencrypt-compatibility-test/setup.py | Python | apache-2.0 | 1,792 |
# -*- coding: utf-8 -*-
'''
Management of iptables
======================
This is an iptables-specific module designed to manage Linux firewalls. It is
expected that this state module, and other system-specific firewall states, may
at some point be deprecated in favor of a more generic ``firewall`` state.
.. code-blo... | stephane-martin/salt-debian-packaging | salt-2016.3.3/salt/states/iptables.py | Python | apache-2.0 | 25,947 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('pages', '0009_auto_20160704_0023'),
]
operations = [
migrations.RemoveField(
model_name='slide',
nam... | thanos/mykonosbiennale.org | pages/migrations/0010_auto_20160704_0030.py | Python | apache-2.0 | 601 |
"""s6 services management.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import abc
import errno
import os
import logging
import six
from treadmill import fs
from .. import _utils
from .. import _service_base... | Morgan-Stanley/treadmill | lib/python/treadmill/supervisor/s6/services.py | Python | apache-2.0 | 17,491 |
"""Implement test server."""
import logging
import socket
from time import sleep
from leicacam.cam import tuples_as_bytes
CAM_REPLY = [
[
(
"relpath",
"subfolder/exp1/CAM1/slide--S00/chamber--U00--V00/field--X01--Y01"
"/image--L0000--S00--U00--V00--J15--E04--O01"
... | CellProfiling/cam_acq | tests/test_server.py | Python | apache-2.0 | 3,254 |
########
# Copyright (c) 2014 GigaSpaces Technologies 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
#
# Unless... | szpotona/cloudify-manager-blueprints | openstack-nova-net/tests/test_openstack_nova_net_blueprint.py | Python | apache-2.0 | 2,514 |
#! /bin/env python
def mainFunc():
xml_file = open('new.xml', 'r')
out_file = open('newnew.xml', 'w')
for i, line in enumerate(xml_file.readlines()):
print 'processing line %d' % i
line = line.replace(';', '')
line = line.replace('>', '')
line = line.replace('<', '')
... | igemsoftware/HFUT-China_2015 | processXML.py | Python | apache-2.0 | 425 |
# 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 ap... | luotao1/Paddle | python/paddle/fluid/tests/unittests/test_backward_infer_var_data_type_shape.py | Python | apache-2.0 | 1,432 |
i = 40 - 3
for j in range(3, 12, 2):
print(j)
i = i + 1
print(i)
| almarklein/wasmfun | simplepy/example1.py | Python | bsd-2-clause | 74 |
# doc-export: Icons2
"""
This example demonstrates the use of icons in Flexx.
When run as a script, Icons1 is used, passing icon and title to the application.
In the examples section of the docs, Icons2 is used, which sets icon and title
in the init(). Click "open in new tab" to see the effect.
"""
import os
imp... | zoofIO/flexx | flexxamples/howtos/icons.py | Python | bsd-2-clause | 1,647 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from apiclient import errors
from base import GDBase
import logging
logger = logging.getLogger()
logger.setLevel(logging.ERROR)
from pprint import pprint
from auth import GDAuth
permission_resource_properties = {
"role": ["owner", "reader", "writer"],
"type": ["... | tienfuc/gdcmdtools | gdcmdtools/perm.py | Python | bsd-2-clause | 3,399 |
from functools import partial
from collections import deque
from llvmlite import ir
from numba.core.datamodel.registry import register_default
from numba.core import types, cgutils
from numba.np import numpy_support
class DataModel(object):
"""
DataModel describe how a FE type is represented in the LLVM IR ... | IntelLabs/numba | numba/core/datamodel/models.py | Python | bsd-2-clause | 44,245 |
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import tempfile
import os
import unittest
from telemetry import benchmark
from telemetry.core import bitmap
from telemetry.core import util
# This is a si... | chromium2014/src | tools/telemetry/telemetry/core/bitmap_unittest.py | Python | bsd-3-clause | 8,155 |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
MAST Utils
==========
Miscellaneous functions used throughout the MAST module.
"""
import numpy as np
import requests
import json
from urllib import parse
import astropy.coordinates as coord
from ..version import version
from ..exceptions import Re... | imbasimba/astroquery | astroquery/mast/utils.py | Python | bsd-3-clause | 5,016 |
# Generated by Django 2.2.5 on 2020-08-03 10:37
import django.core.files.storage
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import uuid
class Migration(migrations.Migration):
dependencies = [
('jobs', '0002_dataprovider_attribute_class'),
... | venicegeo/eventkit-cloud | eventkit_cloud/tasks/migrations/0006_auto_20200803_1037.py | Python | bsd-3-clause | 3,280 |
import numpy as np
from numpy import diag, inf
from numpy import copy, dot
from numpy.linalg import norm
class ExceededMaxIterationsError(Exception):
def __init__(self, msg, matrix=[], iteration=[], ds=[]):
self.msg = msg
self.matrix = matrix
self.iteration = iteration
s... | mikecroucher/nearest_correlation | nearest_correlation.py | Python | bsd-3-clause | 4,572 |
#!/usr/bin/env python
from tools.load import LoadMatrix
lm=LoadMatrix()
traindat = lm.load_numbers('../data/fm_train_real.dat')
testdat = lm.load_numbers('../data/fm_test_real.dat')
parameter_list = [[traindat,testdat,1.1],[traindat,testdat,1.2]]
def kernel_sparse_gaussian (fm_train_real=traindat,fm_test_real=testdat... | shogun-toolbox/shogun | examples/undocumented/python/kernel_sparse_gaussian.py | Python | bsd-3-clause | 824 |
# $Id: __init__.py 5618 2008-07-28 08:37:32Z strank $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
"""
This package contains Docutils Writer modules.
"""
__docformat__ = 'reStructuredText'
import os.path
import docutils
from docutils import languages, C... | spreeker/democracygame | external_apps/docutils-snapshot/docutils/writers/__init__.py | Python | bsd-3-clause | 4,258 |
import numpy as np
import paths
import pyregion
from astropy import coordinates
from astropy import units as u
from astropy import table
from astropy.table import Table,Column
import latex_info
from latex_info import latexdict, exp_to_tex, format_float
tbl = Table.read(paths.tpath('PPV_H2CO_Temperature.ipac'), format=... | adamginsburg/APEX_CMZ_H2CO | analysis/texify_dendro_table.py | Python | bsd-3-clause | 3,226 |
import sys
import pytest
from numpy.testing import (
assert_, assert_array_equal, assert_raises,
)
import numpy as np
from numpy import random
class TestRegression:
def test_VonMises_range(self):
# Make sure generated random variables are in [-pi, pi].
# Regression test for ticket #986... | simongibbons/numpy | numpy/random/tests/test_randomstate_regression.py | Python | bsd-3-clause | 7,541 |
#!/usr/bin/python
# Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
import idlnode
import idlparser
import logging.config
import sys
import unittest
class... | dartino/dart-sdk | tools/dom/scripts/idlnode_test.py | Python | bsd-3-clause | 14,699 |