repo_name stringlengths 5 104 | path stringlengths 4 248 | content stringlengths 102 99.9k |
|---|---|---|
lehinevych/cfme_tests | cfme/tests/infrastructure/test_provider_discovery.py | import pytest
from itertools import combinations
from utils import testgen
from utils.providers import get_crud, clear_infra_providers
from cfme.infrastructure.provider import (discover, RHEVMProvider, SCVMMProvider, VMwareProvider)
def generate_signature(combination):
return '-'.join([p.type for p in combinatio... |
redelinux-ime-usp/supermegazord | client/newcurses/colors.py | # -*- coding: utf-8 -*-
# Super Megazord 2: LDAP Edition
# Com suporte à UTF-8!
# Autor: Henrique Gemignani Passos Lima (henriquelima)
# Escrito em: 2011-08-10
# Modificado em: 2011-08-10 por henriquelima
# Módulo de cores. Define as cores usadas pelo megazord
import curses
BLACK = RED = GREEN = YELLOW = BLUE = MA... |
cmusatyalab/isr-next | vmnetx/controller/local/virtevent.py | #
# vmnetx.controller.local.virtevent - libvirt glib event loop bindings
#
# Copyright (C) 2008 Daniel P. Berrange
# Copyright (C) 2010-2011 Red Hat, Inc.
# Copyright (C) 2013 Carnegie Mellon University
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of version 2 of the GNU... |
virt-manager/virt-manager | virtManager/manager.py | # Copyright (C) 2006-2008, 2013-2014 Red Hat, Inc.
# Copyright (C) 2006 Daniel P. Berrange <berrange@redhat.com>
#
# This work is licensed under the GNU GPLv2 or later.
# See the COPYING file in the top-level directory.
from gi.repository import GObject
from gi.repository import Gtk
from gi.repository import Gdk
from ... |
anyweez/regis | face/msg/msghub.py | import errors
active_errors = []
active_messages = []
def get_error_msg(eid):
return errors.error_msg[eid]
def register_error(eid, target=None):
active_errors.append( (eid, target) )
def get_errors(clear=True):
global active_errors
errors = active_errors
if clear:
active... |
gautamMalu/rootfs_xen_arndale | usr/lib/python3.4/asyncio/events.py | """Event loop and event loop policy."""
__all__ = ['AbstractEventLoopPolicy',
'AbstractEventLoop', 'AbstractServer',
'Handle', 'TimerHandle',
'get_event_loop_policy', 'set_event_loop_policy',
'get_event_loop', 'set_event_loop', 'new_event_loop',
'get_child_watcher... |
dmacvicar/spacewalk | backend/server/handlers/xmlrpc/registration.py | #
# Copyright (c) 2008--2012 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. You should have received a c... |
coreyfarrell/testsuite | lib/python/asterisk/config.py | """Asterisk Configuration File Handling.
This module implements interfaces for dealing with Asterisk configuration
files.
Copyright (C) 2010, Digium, Inc.
Russell Bryant <russell@digium.com>
This program is free software, distributed under the terms of
the GNU General Public License Version 2.
"""
#
# TODO
# - Impl... |
AmritaLonkar/trunk | SU2_PY/change_version_number.py | #!/usr/bin/env python
## \file change_version_number.py
# \brief Python script for doing the continuous adjoint computation using the SU2 suite.
# \author Aniket Aranake
#
# Stanford University Unstructured (SU2) Code
# Copyright (C) 2012 Aerospace Design Laboratory
#
# This program is free software: you can redist... |
sebastic/QGIS | tests/src/python/test_qgsfeatureiterator.py | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsFeatureIterator.
.. 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 Software Foundation; either version 2 of the License, or
(at your option) any later version.
""... |
JeremyAgost/gemrb | gemrb/GUIScripts/bg1/CharGenGui.py | import GemRB
from GUIDefines import *
from ie_stats import *
import CharGenCommon
import GUICommon
import Spellbook
import CommonTables
import LUCommon
import LUProfsSelection
def Imprt():
GemRB.SetToken("NextScript","CharGen")
GemRB.SetNextScript("ImportFile") #import
return
def setPlayer():
MyChar = GemRB.GetVa... |
caxenie/nstbot | setup.py | #!/usr/bin/env python
import imp
import sys
import os
try:
from setuptools import setup
except ImportError:
from ez_setup import use_setuptools
use_setuptools()
from setuptools import find_packages, setup
description = "Controlling and emulating NST-style bots"
root = os.path.dirname(os.path.realpath(__... |
kgblll/libresoft-gymkhana | social/groupifier/functions/__init__.py | #
# Copyright (C) 2009 GSyC/LibreSoft
#
# 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, either version 3 of the License, or
# (at your option) any later version.
#
# This ... |
christianurich/VIBe2UrbanSim | 3rdparty/opus/src/urbansim/gridcell/building_age_masked.py | # Opus/UrbanSim urban simulation software.
# Copyright (C) 2005-2009 University of Washington
# See opus_core/LICENSE
from opus_core.variables.variable import Variable
from variable_functions import my_attribute_label
from opus_core.simulation_state import SimulationState
from numpy import maximum, ma, logical_... |
jnutzmann/skynet | strict_rfc3339.py | # Copyright 2012 (C) Daniel Richman, Adam Greig
#
# This file is part of strict_rfc3339.
#
# strict_rfc3339 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... |
bartoldeman/easybuild-easyblocks | easybuild/easyblocks/v/vmd.py | ##
# Copyright 2009-2018 Ghent University
# Copyright 2015-2016 Stanford University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://vscentrum... |
explicitcall/drmingw | scons/generic.py | """generic
Generic tool that provides a commmon ground for all platforms.
"""
#
# Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
# All Rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software")... |
crobinso/virt-manager | virtinst/devices/rng.py | #
# Copyright 2013 Red Hat, Inc.
#
# This work is licensed under the GNU GPLv2 or later.
# See the COPYING file in the top-level directory.
from .device import Device
from .char import CharSource
from ..xmlbuilder import XMLChildProperty, XMLProperty
class DeviceRng(Device):
XML_NAME = "rng"
TYPE_RANDOM = "... |
booi/aracna | RaspberryPypose/robotPi/RobotConstants.py | #! /usr/bin/env python
MIN_INNER = 150
MAX_INNER = 770
MIN_OUTER = 30
#MAX_OUTER = 940
#MAX_OUTER = 800 # changing because Robot hits antenna
MAX_OUTER = 680 # changing because screws still interfere
#MIN_CENTER = 512 - 180
#MAX_CENTER = 512 + 180
MIN_CENTER = 512 - 120
MAX_CENTER = 512 + 120
NORM_CENTER = 512
POS_F... |
Sixdsn/terra-terminal | terra/VteObjectContainer.py | # -*- coding: utf-8; -*-
"""
Copyright (C) 2013 - Arnaud SOURIOUX <six.dsn@gmail.com>
Copyright (C) 2012 - Ozcan ESEN <ozcanesen~gmail.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 vers... |
coffeemakr/mini-dinstall-ng | minidinstall_ng/sockethandler.py | import threading
from minidinstall_ng.commands import COMMANDS
try:
import socketserver
except:
import SocketServer as socketserver
class IncomingRequestHandler(socketserver.StreamRequestHandler,
socketserver.BaseRequestHandler):
'''
Handler for mini-dinstall soket commands... |
flibbertigibbet/open-transit-indicators | python/django/transit_indicators/settings/defaults.py | """
Django settings for transit_indicators project.
For more information on this file, see
https://docs.djangoproject.com/en/dev/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/dev/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_D... |
bassosimone/neubot-server | neubot/mod_raw_test/raw.py | # neubot/raw.py
#
# Copyright (c) 2012
# Nexa Center for Internet & Society, Politecnico di Torino (DAUIN)
# and Simone Basso <bassosimone@gmail.com>
#
# This file is part of Neubot <http://www.neubot.org/>.
#
# Neubot is free software: you can redistribute it and/or modify
# it under the terms of the GNU Gene... |
maxwward/SCOPEBak | askbot/migrations/0149_auto__add_field_group_is_vip.py | # -*- coding: 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 field 'Group.is_vip'
db.add_column('askbot_group', 'is_vip',
self.gf('django.... |
trezor/trezor-emu | trezor/buttons_hw.py | import RPi.GPIO as GPIO
class HwButtons(object):
def __init__(self):
self.PIN_BTN_YES = 7
self.PIN_BTN_NO = 8
GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)
GPIO.setup(self.PIN_BTN_YES, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
GPIO.setup(self.PIN_BTN_NO, GPIO.IN, pull_u... |
benhoff/vex | vexbot/util/get_certificate_filepath.py | from os import path
from vexbot.util.get_vexdir_filepath import get_vexdir_filepath
def get_certificate_filepath():
vexdir = get_vexdir_filepath()
certs = path.join(vexdir, 'certificates')
return certs
def get_certificate_directories() -> (str, str):
root = get_certificate_filepath()
public_dir ... |
robot-ci/robot-ci | robot/lib/email.py | import smtplib
import traceback
import email.message
import tornado_smtpclient.client
import tornado.gen
class SMTP:
log = tornado.log.gen_log
def __init__(self, application):
self.application = application
@tornado.gen.coroutine
def send(self, reply_to, to_address, subject, payload):
... |
nert-gu/Xposition | tests/core/test_accounts.py | from django.conf import settings as django_settings
from django.contrib import auth
from django.contrib.auth import authenticate
from django.contrib.auth.models import AnonymousUser
from django.shortcuts import resolve_url
from wiki.conf import settings as wiki_settings
from wiki.models import reverse
from ..base impo... |
microcom/clouder | clouder_template_drupal_wikicompare/__init__.py | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Yannick Buron
# Copyright 2015, TODAY Clouder SASU
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License with Attribution
# ... |
DeDop/dedop | tests/util/test_config.py | import os.path
from io import StringIO
from unittest import TestCase
from dedop.util.config import get_config_value, get_config_path, get_config, read_python_config
class PythonConfigTest(TestCase):
def test_get_config_value(self):
with self.assertRaises(ValueError) as e:
get_config_value(Non... |
bioinformatics-ua/catalogue | emif/developer/views.py | # -*- 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... |
Tribler/decentralized-mortgage-market | market/restapi/root_endpoint.py | import os
from twisted.web import resource
from twisted.web.static import File
from twisted.web.util import Redirect
from market.defs import BASE_DIR
from market.restapi.campaigns_endpoint import CampaignsEndpoint
from market.restapi.users_endpoint import UsersEndpoint
from market.restapi.you_endpoint import YouEndpo... |
uliss/quneiform | tests/py/lpod/scripts/lpod-show.py | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
#
# Copyright (c) 2009 Ars Aperta, Itaapy, Pierlis, Talend.
#
# Authors: Hervé Cauwelier <herve@itaapy.com>
# David Versmisse <david.versmisse@itaapy.com>
#
# This file is part of Lpod (see: http://lpod-project.org).
# Lpod is free software; you can redistribute it... |
salessandri/programming-contests | project-euler/problem011.py | #!/usr/bin/env python3
########################################################################
# Solves problem 11 from projectEuler.net.
# Finds 4 adyacent numbers whose product is the greatest.
# Copyright (C) 2010 Santiago Alessandri
#
# This program is free software: you can redistribute it and/or modify... |
ayepezv/GAD_ERP | openerp/tools/config.py | #openerp.loggers.handlers. -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import ConfigParser
import optparse
import os
import sys
import openerp
import openerp.conf
import openerp.loglevels as loglevels
import logging
import openerp.release as release
import appdirs
... |
tdtrask/ansible | lib/ansible/modules/cloud/vmware/vmware_guest_file_operation.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Stéphane Travassac <stravassac () gmail.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {
'meta... |
s20121035/rk3288_android5.1_repo | external/lldb/test/lang/objc/objc-static-method-stripped/TestObjCStaticMethodStripped.py | """Test calling functions in static methods with a stripped binary."""
import os, time
import unittest2
import lldb
import lldbutil
from lldbtest import *
class TestObjCStaticMethodStripped(TestBase):
mydir = os.path.join("lang", "objc", "objc-static-method-stripped")
@unittest2.skipUnless(sys.platform.star... |
chipaca/snapcraft | tests/unit/plugins/v1/test_conda.py | # -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2019-2020 Canonical Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation.
#
# This program is distributed in ... |
monash-merc/karaage | karaage/tests/people/test_models.py | # Copyright 2014-2015 VPAC
# Copyright 2014 The University of Melbourne
#
# This file is part of Karaage.
#
# Karaage 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 y... |
ayepezv/GAD_ERP | addons/project/tests/test_access_rights.py | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.addons.project.tests.test_project_base import TestProjectBase
from odoo.exceptions import AccessError
from odoo.tools import mute_logger
class TestPortalProjectBase(TestProjectBase):
def setUp(self):
... |
gedakc/manuskript | manuskript/importer/folderImporter.py | #!/usr/bin/env python
# --!-- coding: utf8 --!--
import os
from manuskript.importer.abstractImporter import abstractImporter
from manuskript.models import outlineItem
from manuskript.enums import Outline
from PyQt5.QtWidgets import qApp
class folderImporter(abstractImporter):
name = "Folder"
description = "... |
trnewman/VT-USRP-daughterboard-drivers_python | gr-utils/src/python/plot_data.py | #
# Copyright 2007,2008 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your option)
# any later versi... |
pymedusa/Medusa | ext/oauthlib/oauth2/rfc6749/grant_types/implicit.py | # -*- coding: utf-8 -*-
"""
oauthlib.oauth2.rfc6749.grant_types
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"""
from __future__ import absolute_import, unicode_literals
import logging
from oauthlib import common
from .. import errors
from .base import GrantTypeBase
log = logging.getLogger(__name__)
class ImplicitGrant(G... |
p0psicles/SickGear | sickbeard/postProcessor.py | # Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of SickGear.
#
# SickGear 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,... |
fabfurnari/totalopenstation | scripts/totalopenstation-cli-connector.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# filename: totalopenstation-cli-connector.py
# Copyright 2008,2011 Stefano Costa <steko@iosa.it>
# This file is part of Total Open Station.
# Total Open Station is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public Licens... |
chrispy645/weka-pyscript | scripts/standardise.py | from __future__ import print_function
from wekapyscript import ArffToArgs, \
get_header, instance_to_string
import numpy as np
def train(args):
X_train = args["X_train"]
means = []
sds = []
attr_types = args["attr_types"]
attributes = args["attributes"]
for i in range(0, X_train.shape[1]):
... |
jwhitlock/kuma | kuma/search/tests/test_serializers.py | import mock
from django.utils import translation
from rest_framework import serializers
from rest_framework.test import APIRequestFactory
from kuma.wiki.search import WikiDocumentType
from . import ElasticTestCase
from ..fields import SearchQueryField, SiteURLField
from ..models import Filter, FilterGroup
from ..ser... |
a-parhom/edx-platform | openedx/core/djangoapps/course_groups/tests/test_api_views.py | """
Tests for Cohort API
"""
import json
import tempfile
import ddt
from django.urls import reverse
from edx_oauth2_provider.tests.factories import AccessTokenFactory, ClientFactory
from student.tests.factories import UserFactory
from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase
from xmodule... |
markwal/OctoPrint | src/octoprint/plugins/cura/__init__.py | # coding=utf-8
from __future__ import absolute_import
__author__ = "Gina Häußge <osd@foosel.net>"
__license__ = "GNU Affero General Public License http://www.gnu.org/licenses/agpl.html"
__copyright__ = "Copyright (C) 2014 The OctoPrint Project - Released under terms of the AGPLv3 License"
import logging
import loggin... |
diagramsoftware/account-financial-reporting | account_financial_report_webkit/report/aged_partner_balance.py | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Nicolas Bessi
# Copyright 2014 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# publi... |
WillianPaiva/1flow | oneflow/core/admin/subscription.py | # -*- coding: utf-8 -*-
u"""
Copyright 2014 Olivier Cortès <oc@1flow.io>.
This file is part of the 1flow project.
1flow 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, either version 3 of
the License, or ... |
eduNEXT/edunext-platform | lms/djangoapps/course_api/tests/test_serializers.py | """
Test data created by CourseSerializer and CourseDetailSerializer
"""
from datetime import datetime
from unittest import TestCase
import ddt
from opaque_keys.edx.locator import CourseLocator
from rest_framework.request import Request
from rest_framework.test import APIRequestFactory
from xblock.core import XBlock... |
spacewiki/spacewiki | spacewiki/auth/__init__.py | from flask import Blueprint, url_for, redirect, flash
from flask_login import LoginManager, login_required, \
logout_user
from spacewiki import model
from spacewiki.auth import tripcodes
import logging
LOGIN_MANAGER = LoginManager()
@LOGIN_MANAGER.user_loader
def load_user(user_id):
logging.debug("Loading... |
gangadhar-kadam/church-erpnext | accounts/doctype/purchase_invoice/purchase_invoice.py | # ERPNext - web based ERP (http://erpnext.com)
# Copyright (C) 2012 Web Notes Technologies Pvt Ltd
#
# 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 yo... |
LLNL/spack | var/spack/repos/builtin/packages/hdf5-vfd-gds/package.py | # 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 Hdf5VfdGds(CMakePackage, CudaPackage):
"""This package enables GPU Direct Storage Virtual ... |
trabucayre/periphondemand | periphondemand/toolchains/synthesis/ise/ise.py | #! /usr/bin/python3
# -*- coding: utf-8 -*-
# ----------------------------------------------------------------------------
# Name: ise.py
# Purpose:
# Author: Fabien Marteau <fabien.marteau@armadeus.com>
# Created: 21/07/2008
# ----------------------------------------------------------------------------
# Copyr... |
nettorta/yandex-tank | yandextank/plugins/NeUploader/plugin.py | import logging
import pandas
from netort.data_manager import DataSession, thread_safe_property
from yandextank.plugins.Phantom.reader import string_to_df_microsec
from yandextank.common.interfaces import AbstractPlugin,\
MonitoringDataListener
logger = logging.getLogger(__name__) # pylint: disable=C0103
class... |
airsim/airinv | appserver/django/airinvClient.py | #!/usr/bin/env python
#
# AirInv client in Python
# Connects REQ socket to tcp://localhost:5555
# Sends JSON-ified parameters of a flight-date to display to the AirInv
# server, and expects the full JSON-ified details for that given flight-date.
#
import getopt, sys, json, zmq
#------------------------------... |
sqlobject/sqlobject | sqlobject/manager/command.py | #!/usr/bin/env python
from __future__ import print_function
import fnmatch
import optparse
import os
import re
import sys
import textwrap
import time
import warnings
try:
from paste.deploy import appconfig
except ImportError:
appconfig = None
import sqlobject
from sqlobject import col
from sqlobject.classreg... |
manojjsm/yougi | i18n.py | #!/usr/bin/env python
#-*- coding: utf-8 -*-
import os
import sys
import fnmatch
import argparse
import re
try:
import i18n_conf
except:
print 'Error in i18n_conf file'
sys.exit(1)
# Load Constants
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
TEXT_BASE = getattr(i18n_conf, 'TEXT_BASE', '')
TEXT_TR... |
kjyv/FloBaRoID | tools/scaleInertia.py | #!/usr/bin/env python
#-*- coding: utf-8 -*-
import numpy as np
import re
if __name__ == '__main__':
line = '<inertia ixx="0.00232" ixy="0" ixz="0" iyy="0.00296" iyz="0" izz="0.00136"/>'
scaling = 1.95833333333333
nums = np.array(re.findall(r'[-+]?\d*\.\d+|\d+', line)).astype(float)
nums *= scaling
... |
dev-navi/navi-python-main | src/navi/components/other/low_pass_filter.py | from navi.components.component import Component
__author__ = 'paoolo'
class LowPassFilter(Component):
"""
Used to low pass.
"""
def __init__(self):
super(LowPassFilter, self).__init__(enable=True)
self._old_left = 0.0
self._old_right = 0.0
self._alpha = 0.3
def... |
martin-neuhaeusser/benchexec | benchexec/test_result.py | # BenchExec is a framework for reliable benchmarking.
# This file is part of BenchExec.
#
# Copyright (C) 2007-2015 Dirk Beyer
# 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 Lic... |
GabrielFortin/ansible-module-f5bigip | library/f5bigip_ltm_profile_diameter.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2016-2018, Eric Jacob <erjac77@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENS... |
0--key/lib | portfolio/Python/scrapy/firedupgroup/argoscouk.py | import re
from scrapy.spider import BaseSpider
from scrapy.selector import HtmlXPathSelector
from scrapy.http import Request
from scrapy.utils.response import get_base_url
from scrapy.utils.url import urljoin_rfc
from product_spiders.items import Product, ProductLoader
import logging
class FireplaceworldCoUkSpider... |
mahak/neutron | neutron/db/migration/alembic_migrations/versions/victoria/expand/I38991de2b4_source_and_destination_ip_prefix_neutron_metering_rule.py | # Copyright 2020 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... |
spnow/grr | tools/export.py | #!/usr/bin/env python
"""Util for exporting data from GRR."""
# pylint: disable=unused-import,g-bad-import-order
from grr.lib import server_plugins
# pylint: enable=unused-import,g-bad-import-order
from grr.lib import config_lib
from grr.lib import data_store
from grr.lib import flags
from grr.lib import rdfvalue
... |
ApachePointObservatory/Totoro | Totoro/__init__.py | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import warnings
from exceptions import DustMapWarning, TotoroError
# warnings.filterwarnings('ignore', module='astropy.time.core')
warnings.filterwarnings('ignore', 'Module argparse was already imported')
warnings.filterwarnings('ignore', 'Skipped unsuppo... |
Parsl/parsl | parsl/executors/low_latency/interchange.py | #!/usr/bin/env python3
import logging
import zmq
# import time
class Interchange(object):
""" TODO: docstring """
def __init__(self,
client_address="127.0.0.1",
client_ports=(50055, 50056),
worker_port=None,
worker_port_range=(54000, 55000)... |
benoitsteiner/tensorflow-opencl | tensorflow/contrib/boosted_trees/python/training/functions/gbdt_batch.py | # 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... |
mavenlin/tensorflow | tensorflow/python/tools/saved_model_cli.py | # 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... |
sebrandon1/tempest | tempest/lib/services/compute/quota_classes_client.py | # Copyright 2012 NTT Data
# 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 appl... |
joachimmetz/artifacts | tests/writer_test.py | # -*- coding: utf-8 -*-
"""Tests for the artifact definitions readers."""
import os
import unittest
from artifacts import reader
from artifacts import writer
from tests import test_lib
class ArtifactsWriterTest(test_lib.BaseTestCase):
"""Class to test the artifacts writer."""
def _TestArtifactsConversion(
... |
stdweird/aquilon | tests/broker/test_bind_server.py | #!/usr/bin/env python2.6
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2008,2009,2010,2011,2012,2013 Contributor
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License... |
Juanlu001/xlwings | xlwings/conversion/framework.py | # -*- coding: utf-8 -*-
class ConversionContext(object):
__slots__ = ['range', 'value', 'meta']
def __init__(self, rng=None, value=None):
self.range = rng
self.value = value
self.meta = {}
class Options(dict):
def __init__(self, original):
super(Options, self).__init__(... |
leb2dg/osf.io | api_tests/registrations/views/test_registration_linked_nodes.py | import pytest
from api.base.settings.defaults import API_BASE
from framework.auth.core import Auth
from website.util import disconnected_from_listeners
from website.project.signals import contributor_removed
from osf_tests.factories import (
NodeFactory,
AuthUserFactory,
RegistrationFactory
)
@pytest.fix... |
sahilTakiar/spark | dev/create-release/releaseutils.py | #!/usr/bin/env python
#
# 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 "Li... |
weiting-chen/manila | manila/tests/fake_compute.py | # Copyright 2013 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 requi... |
neumerance/deploy | .venv/lib/python2.7/site-packages/ceilometerclient/common/http.py | # Copyright 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 requ... |
yukim/cassandra-dtest | wide_rows_test.py | from dtest import Tester, debug
import datetime
import random
status_messages = (
"I''m going to the Cassandra Summit in June!",
"C* is awesome!",
"All your sstables are belong to us.",
"Just turned on another 50 C* nodes at <insert tech startup here>, scales beautifully.",
"Oh, look! Cats, on redd... |
CMSS-BCRDB/RDS | trove/extensions/routes/mysql.py | # 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... |
zepheira/zenpub | lib/csvhelper.py | #See also: http://www.doughellmann.com/PyMOTW/csv/
import sys
import csv
UNKNOWN_TEXT_IMT = 'text/unknown'
def readcsv(text):
sniffer = csv.Sniffer()
data = []
#Heuristic: is this really a CSV? Sniffer is pretty lax
sanity_check_length = None
try:
dialect = csv.Sniffer().sniff(text[:2048... |
lahosken/pants | contrib/node/src/python/pants/contrib/node/tasks/node_test.py | # coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from pants.base.exce... |
openlawlibrary/pygls | pygls/constants.py | ############################################################################
# Copyright(c) Open Law Library. All rights reserved. #
# See ThirdPartyNotices.txt in the project root for additional notices. #
# #
# Licensed u... |
neumerance/deploy | .venv/lib/python2.7/site-packages/lesscpy/plib/call.py | # -*- coding: utf8 -*-
"""
.. module:: lesscpy.plib.call
:synopsis: Call parse node
Copyright (c)
See LICENSE for details.
.. moduleauthor:: Johann T. Mariusson <jtm@robot.is>
"""
import re
import math
try:
from urllib.parse import quote as urlquote, urlparse
except ImportError:
from urllib import ... |
openstack/nova | nova/compute/instance_list.py | # 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... |
tseaver/google-cloud-python | bigquery/google/cloud/bigquery_v2/types.py | # -*- coding: utf-8 -*-
#
# 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... |
anupsabraham/store_tv_player | django_project/store_cms/cms/views.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from datetime import datetime
import operator
from django.contrib.auth import authenticate, login
from django.http import JsonResponse
from django.db.models import Q
from django.utils import timezone
from django.views.decorators.csrf import csrf_exempt
f... |
indashnet/InDashNet.Open.UN2000 | android/external/chromium_org/third_party/WebKit/Tools/Scripts/webkitpy/test/main_unittest.py | # Copyright (C) 2012 Google, Inc.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer... |
postlund/home-assistant | homeassistant/components/tmb/sensor.py | """Support for TMB (Transports Metropolitans de Barcelona) Barcelona public transport."""
from datetime import timedelta
import logging
from requests import HTTPError
from tmb import IBus
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import ATTR_ATTRIBUT... |
vmware/tosca-vcloud-plugin | server_plugin/volume.py | # Copyright (c) 2015 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 required ... |
peterbe/moztrap | moztrap/view/utils/mtforms.py | """
Core form widgets, mixins, and fields for MozTrap.
"""
from functools import partial
from django import forms
from django.forms.forms import NON_FIELD_ERRORS
from django.forms.models import ModelChoiceIterator
from django.forms.util import ErrorList
from django.utils.datastructures import MultiValueDict
from djan... |
qPCR4vir/orange3 | Orange/preprocess/impute.py | import numpy
import Orange.data
from Orange.statistics import distribution, basic_stats
from .transformation import Transformation, Lookup
__all__ = ["ReplaceUnknowns", "Average", "DoNotImpute", 'DropInstances',
"Model", "AsValue", "Random", "Default"]
class ReplaceUnknowns(Transformation):
"""
A... |
ioam/svn-history | contrib/JLStevens-TCAL/MastersVersion/tools/VSDPlot.py | import numpy as np
import pylab
def makeCircleBand(radius,cx,cy, dim=48, halfThickness=5): # Half of band thickness is 0.5mm
circle = np.zeros((48, 48)).astype('uint8')
y, x = np.ogrid[-radius: radius, -radius: radius]
index = x**2 + y**2 <= radius**2
circle[cy-radius:cy+radius, cx-radius:cx+radius][in... |
looker/sentry | src/sentry/runner/commands/devserver.py | """
sentry.runner.commands.devserver
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2016 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import, print_function
import click
import six
from six.moves.urllib.parse import urlparse
from... |
SamStudio8/scikit-bio | skbio/sequence/_sequence.py | # ----------------------------------------------------------------------------
# Copyright (c) 2013--, scikit-bio development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
# --------------------------------------------... |
joetsoi/django-model-i18n | model_i18n/patches.py | """ Monkey patches module """
from model_i18n.conf import MULTIDB_SUPPORT
###
# Add support for custom_joins rules used by query.QOuterJoins
from django.db.models.sql import Query
# Patch get_from_clause method so custom_joins are processed propperly
# On django pre r11952 (no multi-db support), get_from_clause is de... |
vovojh/gem5 | src/mem/cache/Cache.py | # Copyright (c) 2012-2013, 2015 ARM Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation of the fun... |
brianhelba/pylibtiff | libtiff/tiff.py | """
tiff - implements a numpy.memmap based TIFF file reader and writer
allowing manipulating TIFF files that have sizes larger than
available memory in computer.
Usage:
>>> tiff = TIFFfile('<filename.(tif|lsm)>')
>>> samples, sample_names = tiff.get_samples()
>>> arr = tiff.get_tiff_array(sample_index=0, subfile_type=... |
mathjazz/pontoon | pontoon/teams/utils.py | from pontoon.base.models import PermissionChangelog
def log_user_groups(admin, user, changed_groups):
"""Log all changes of a user's groups.
:arg User admin: a super user who perform changes on groups.
:arg User user: an edited users
:arg tuple changed_groups: Contains two querysets:
* add - ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.