repo_name stringlengths 5 104 | path stringlengths 4 248 | content stringlengths 102 99.9k |
|---|---|---|
Weihonghao/ECM | Vpy34/lib/python3.5/site-packages/theano/compat/__init__.py | """Code supporting compatibility across versions of Python.
"""
from __future__ import absolute_import, print_function, division
# Python 3.x compatibility
from six import PY3, b, BytesIO, next
from six.moves import configparser
from six.moves import reload_module as reload
import collections
__all__ = ['PY3', 'b', '... |
isard-vdi/isard | engine/engine/engine/services/balancers/balancer_factory.py | # Copyright 2018 the Isard-vdi project authors:
# Alberto Larraz Dalmases
# Josep Maria Viñolas Auquer
# Daniel Criado Casas
# License: AGPLv3
import inspect
from traceback import format_exc
from engine.services.balancers.central_manager import CentralManager
from engine.services.balancers.round_robin ... |
CLVsol/odoo_addons | clv_medicament_dispensation_ext/wkf/__init__.py | # -*- encoding: utf-8 -*-
################################################################################
# #
# Copyright (C) 2013-Today Carlos Eduardo Vercelino - CLVsol #
# ... |
fredriklindberg/python-libartnet | artnet/_version.py |
# This file helps to compute a version number in source trees obtained from
# git-archive tarball (such as those provided by githubs download-from-tag
# feature). Distribution tarballs (built by setup.py sdist) and build
# directories (produced by setup.py build) will contain a much shorter file
# that just contains t... |
stoq/kiwi | examples/list/searchbar.py | from gi.repository import Gtk
from kiwi.currency import currency
from kiwi.ui.objectlist import Column, ObjectList
class Product:
def __init__(self, name, price):
self.name = name
self.price = price
def __repr__(self):
return '<Product %s>' % self.name
columns = [
Column('name',... |
rspavel/spack | var/spack/repos/builtin/packages/py-pywavelets/package.py | # 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)
from spack import *
class PyPywavelets(PythonPackage):
"""PyWavelets is a free Open Source library for wavelet tran... |
Acreo/DoubleDecker-py | doubledecker/generateKeys.py | # coding=utf-8
from __future__ import absolute_import, division, print_function, unicode_literals
from builtins import dict
from builtins import open
from builtins import str
from future import standard_library
standard_library.install_aliases()
__license__ = """
Copyright (c) 2015 Pontus Sköldström, Bertrand Pecheno... |
paulthulstrup/moose | libmesh/doc/statistics/libmesh_mailinglists.py | #!/usr/bin/env python
import matplotlib.pyplot as plt
import numpy as np
from operator import add
# Import stuff for working with dates
from datetime import datetime
from matplotlib.dates import date2num, num2date
# Number of messages to libmesh-devel and libmesh-users over the life
# of the project. I cut and paste... |
xiangke/pycopia | mibs/pycopia/mibs/IANA_LANGUAGE_MIB.py | # python
# This file is generated by a program (mib2py). Any edits will be lost.
from pycopia.aid import Enum
import pycopia.SMI.Basetypes
Range = pycopia.SMI.Basetypes.Range
Ranges = pycopia.SMI.Basetypes.Ranges
from pycopia.SMI.Objects import ColumnObject, MacroObject, NotificationObject, RowObject, ScalarObject, N... |
skosukhin/spack | var/spack/repos/builtin/packages/r-irlba/package.py | ##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... |
mathLab/RBniCS | tests/performance/backends/online/numpy/test_numpy_error_estimation_af_evaluation.py | # Copyright (C) 2015-2022 by the RBniCS authors
#
# This file is part of RBniCS.
#
# SPDX-License-Identifier: LGPL-3.0-or-later
import pytest
from numpy import einsum, isclose, zeros as legacy_tensor
from rbnics.backends import product as factory_product, sum as factory_sum, transpose as factory_transpose
from rbnics.... |
FreeOpcUa/python-opcua | examples/client_to_prosys.py | import sys
sys.path.insert(0, "..")
import time
import logging
from opcua import Client
from opcua import ua
class SubHandler(object):
"""
Client to subscription. It will receive events from server
"""
def datachange_notification(self, node, val, data):
print("Python: New data change event"... |
ivknv/yadisk | yadisk/objects/auth.py | # -*- coding: utf-8 -*-
from .yadisk_object import YaDiskObject
__all__ = ["TokenObject", "TokenRevokeStatusObject"]
class TokenObject(YaDiskObject):
"""
Token object.
:param token: `dict` or `None`
:ivar access_token: `str`, token string
:ivar refresh_token: `str`, the refresh-... |
sirk390/coinpy | coinpy-lib/src/coinpy/model/blockchain/blockchain_database.py | class TransactionNotFound(Exception):
pass
class BlockNotFound(Exception):
pass
class OutputNotSpend(Exception):
pass
#ValueError ? e.g. ValueError: empty range for randrange() (1,1, 0)
class BlockChainDatabase():
def contains_block(self, block_hash):
"""Return (bool) if the blockchain contains... |
savoirfairelinux/project-addons | resource_calendar/models/resource_calendar_attendance.py | # Copyright 2018 Savoir-faire Linux
# Copyright 2017 Laslabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import _, api, models
from odoo.exceptions import ValidationError
class ResourceCalendarAttendance(models.Model):
_inherit = 'resource.calendar.attendance'
@api.m... |
Jozhogg/iris | lib/iris/analysis/stats.py | # (C) British Crown Copyright 2013 - 2014, Met Office
#
# This file is part of Iris.
#
# Iris 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 3 of the License, or
# (at your option) any l... |
luckydonald/shairport-decoder | examples/simple_print.py | # -*- coding: utf-8 -*-
import shairportdecoder.decoder
__author__ = 'luckydonald'
from luckydonaldUtils.logger import logging # pip install luckydonald-utils
logger = logging.getLogger(__name__)
from shairportdecoder.decoder import Processor
from shairportdecoder.metadata import Infos
from shairportdecoder import ... |
mikrosimage/rez | src/rezplugins/release_vcs/stub.py | """
Stub version control system, for testing purposes
"""
from rez.release_vcs import ReleaseVCS
from rez.utils.logging_ import print_warning
from rez.utils.yaml import dump_yaml
from rez.vendor import yaml
import os.path
import time
class StubReleaseVCS(ReleaseVCS):
"""A release VCS that doesn't really do anythi... |
YorkJong/pyLangConvert | langconv/myutil.py | # -*- coding: utf-8 -*-
"""
This module put my utility functions
"""
__author__ = "Jiang Yu-Kuan <yukuan.jiang@gmail.com>"
__date__ = "2016/01/27 (initial version) ~ 2016/04/27 (last revision)"
import re
import os
import sys
#------------------------------------------------------------------------------
... |
mcocdawc/chemopt | src/chemopt/interface/molpro.py | import inspect
import os
import subprocess
from io import StringIO
from os.path import splitext
from subprocess import run
from datasize import DataSize
import chemcoord as cc
import numpy as np
import re
from chemopt.configuration import (conf_defaults, fixed_defaults,
substitute_d... |
WZQ1397/automatic-repo | python/modules/shelveDemo.py | #database.py
import sys, shelve
def store_person(db):
"""
Query user for data and store it in the shelf object
"""
pid = raw_input('Enter unique ID number: ')
person = {}
person['name'] = raw_input('Enter name: ')
person['age'] = raw_input('Enter age: ')
person['phon... |
Byron/bcore | src/python/butility/compat.py | #-*-coding:utf-8-*-
"""
@package butility.compat
@brief A module to encapsulate differences between python versions
@author Sebastian Thiel
@copyright [GNU Lesser General Public License](https://www.gnu.org/licenses/lgpl.html)
"""
from __future__ import unicode_literals
from butility.future import str
__all__ = ['pick... |
insilichem/pychimera | pychimera/platforms/osx.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
from .linux import (_patch_envvars as _patch_envvars_linux,
launch_ipython)
CHIMERA_BINARY = 'chimera'
CHIMERA_PREFIX = 'Chimera*/Contents/Resources'
CHIMERA_LOCATIONS = ('/Applications',
os.path.expanduser('~... |
jadient/pycmd | completion.py | #
# Functions useful for completing:
# 1) names of files and directories
# 2) names of environment variables
#
import sys, os, re
from common import parse_line, expand_env_vars, has_exec_extension, strip_extension
from common import contains_special_char, starts_with_special_char
from common import sep_chars, se... |
squillero/sgx | sgx/algorithms/simple.py | # -*- coding: utf-8 -*-
#############################################################################
# _________ ____________ ___ #
# / _____// _____/\ \/ / ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #
# \_____ \/ \ ___ \ / THE E(X)TENDED (S)ELFISH (G)E... |
zhaowei19920524/McMasterGradStuManual | docs/conf.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# McMasterGradStuManual documentation build configuration file, created by
# sphinx-quickstart on Tue Dec 27 15:37:30 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are presen... |
feuloren/Printy | src/backend.py | # -*- coding: utf-8 -*-
import os, os.path
import mimetypes
from shutil import copy2
from collections import OrderedDict
from .constants import *
from .errors import *
class State(object):
"""Load the state of a directory and the images it contains
Then saves it when needed
"""
def __del__(self):
... |
thopiekar/Uranium | UM/Mesh/MeshWriter.py | # Copyright (c) 2016 Ultimaker B.V.
# Uranium is released under the terms of the LGPLv3 or higher.
from UM.FileHandler.FileWriter import FileWriter
from UM.Scene.Iterator.BreadthFirstIterator import BreadthFirstIterator
from UM.Scene.SceneNode import SceneNode
## Base class for mesh writer objects
class MeshWriter(... |
VanceKingSaxbeA/GoldSaxGetHighLow | goldsaxgethighlow.py | /*Owner & Copyrights: Vance King Saxbe. A.*/""" Copyright (c) <2014> Author Vance King Saxbe. A, and contributors Power Dominion Enterprise, Precieux Consulting and other contributors. Modelled, Architected and designed by Vance King Saxbe. A. with the geeks from GoldSax Consulting and GoldSax Technologies email @vsaxb... |
eoinof/stem | stem/util/connection.py | """
Connection and networking based utility functions. This will likely be expanded
later to have all of `arm's functions
<https://gitweb.torproject.org/arm.git/blob/HEAD:/src/util/connections.py>`_,
but for now just moving the parts we need.
::
is_valid_ip_address - checks if a string is a valid IPv4 address
is_... |
a-tsioh/TRS.cin | create_ibus_table.py | import pandas as P
#import psycopg2 as pg2
import re
#db = pg2.connect(dbname="lils")
dataframe = P.read_json("trs_data.json")
for i, row in dataframe.iterrows():
hj = row['forme']
tl = row['text']
tl = tl.replace(u'i\u030d', u'\u0131\u030d') # remove the dot on the i when 8th tone
norm = row['normal... |
puruckertom/poptox | poptox/foxsurplus/foxsurplus_output.py | # -*- coding: utf-8 -*-
import os
os.environ['DJANGO_SETTINGS_MODULE']='settings'
from logistic import logisticdb
import webapp2 as webapp
from google.appengine.ext.webapp.util import run_wsgi_app
from google.appengine.ext.webapp import template
import numpy as np
import cgi
import cgitb
cgitb.enable()
def foxs... |
vandys/chore | utils.py | #
# utils.py
# Various utilities
#
import threading, string, time, os
# A "with" serialization mechanism
class Exclusion(object):
def __init__(self):
self.mutex = threading.Lock()
def __enter__(self):
self.mutex.acquire()
def __exit__(self, typ, val, traceback):
self.mutex.release()
# Filter out to jus... |
toomastahves/math-pg | pkmkt1_code/task11.py | from task6 import get_green_dt, get_cauchy_dt
from sympy import Matrix
import numpy as np
def get_green_invariants(eq1, eq2, eq3):
CKL = get_green_dt(eq1, eq2, eq3)
a = Matrix(CKL)
P, D = a.diagonalize()
D = np.array(D)
Ic = D[0][0] + D[1][1] + D[2][2]
IIc = D[0][0]*D[1][1] + D[1][1]*D[2][2] + ... |
thruflo/pyramid_basemodel | tests/test_slug.py | import pytest
from mock import MagicMock
from sqlalchemy import Column, Integer
from pyramid_basemodel import Base
from pyramid_basemodel.slug import BaseSlugNameMixin
@pytest.fixture
def sample_model():
class Model(Base, BaseSlugNameMixin):
__tablename__ = "models"
id = Column(Integer, primary_k... |
OzBonus/LPTHW | ex20.py | #!/usr/bin/env
# -*- coding: utf-8 -*-
"""
Learn Python the Hard Way - Exercise 20
Functions and Files
"""
from sys import argv
SCRIPT, INPUT_FILE = argv
def print_all(f):
print f.read()
def rewind(f):
f.seek(0)
def print_a_line(line_count, f):
print line_count, f.readline()
CURRENT_FILE = open(INPUT... |
bebox/lhp | source/lhp.py | #!/usr/bin/env python3
import argparse
import subprocess
parser = argparse.ArgumentParser()
parser.add_argument("-m", "--midiout", help="enable midi output", action="store_true")
parser.add_argument("-c", "--midiport", type=int, help="connect to midi port")
parser.add_argument("-l", "--listmidiports", help="list mid... |
floort/buienbadge | testbuienradar.py | import urequests
import ugfx
import network
import badge
import time
sta_if = network.WLAN(network.STA_IF); sta_if.active(True) # Activate standalone interface
sta_if.scan() # Scan for available access points
sta_if.connect("SHA2017-insecure") ... |
6high/learningML | KNN/MovieKNN.py | # -*- coding: utf-8 -*-
import numpy as np
from sklearn import neighbors
# kkn算法库
knn = neighbors.KNeighborsClassifier()
# 电影分类
data = np.array([[3,104],[2,100],[1,81],[101,10],[99,5],[98,2]])
labels = np.array([1,1,1,2,2,2])
# 训练
knn.fit(data,labels)
# 预测
predictedLabel = knn.predict([18,90])
print predictedLab... |
mrunge/openstack_horizon | openstack_horizon/dashboards/admin/routers/tests.py | # Copyright 2012, Nachi Ueno, NTT MCL, 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 applic... |
basho/spark-riak-connector | connector/python/pyspark_riak/riak_rdd.py | """
Copyright 2016 Basho Technologies, Inc.
This file is provided to you under the Apache License,
Version 2.0 (the "License"); you may not use this file
except in compliance with the License. You may obtain
a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agre... |
btovar/autopyfactory | autopyfactory/plugins/queue/sched/Null.py | #! /usr/bin/env python
#
from autopyfactory.interfaces import SchedInterface
import logging
class Null(SchedInterface):
"""
Null plugin, returning always 0.
The purpose is to have a plugin doing nothing when
other features of APF have to be tested, but there is no
interest on submitting ... |
jpoullet2000/genomicAPI | apps/genomicAPI/src/genomicAPI/models.py | from django.db import models
class QueryModel(models.Model):
"""
Represents a query from a raw user input to a formatted query string.
For now, the formatted query string is temporary as I think this is
not the best representation for our needs.
"""
GENOMIC_API = "GAPI"
GOOGLE_GENOMICS = "GGEN"
HBASE = "HBA... |
zycdragonball/tensorflow | tensorflow/contrib/timeseries/python/timeseries/math_utils.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... |
persandstrom/home-assistant | homeassistant/components/sonos/__init__.py | """Component to embed Sonos."""
from homeassistant import config_entries
from homeassistant.helpers import config_entry_flow
DOMAIN = 'sonos'
REQUIREMENTS = ['pysonos==0.0.2']
async def async_setup(hass, config):
"""Set up the Sonos component."""
conf = config.get(DOMAIN)
hass.data[DOMAIN] = conf or {}... |
kijiproject/kiji-rest | clients/python/kiji/rest/tsdb_client.py | #!/usr/bin/env python3
# -*- mode: python -*-
# -*- coding: utf-8 -*-
import collections
import http.client
import logging
import socket
import time
import traceback
import urllib.request
from base import base
from base import cli
LogLevel = base.LogLevel
class Error(Exception):
"""Errors raised in this module.... |
girder/video | server/rest/__init__.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
##############################################################################
# Copyright Kitware 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 t... |
vjpai/grpc | tools/interop_matrix/client_matrix.py | #!/usr/bin/env python2.7
# Copyright 2017 gRPC 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 la... |
rgayon/plaso | plaso/parsers/sqlite_plugins/chrome_history.py | # -*- coding: utf-8 -*-
"""SQLite parser plugin for Google Chrome history database files."""
from __future__ import unicode_literals
from dfdatetime import posix_time as dfdatetime_posix_time
from dfdatetime import webkit_time as dfdatetime_webkit_time
from plaso.containers import events
from plaso.containers import... |
darren-wang/ks3 | keystone/cli.py | # Copyright 2012 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... |
citrix-openstack/os-ext-testing | nodepool/scripts/prepare_tempest_testrepository.py | #!/usr/bin/env python2
#
# Copyright 2014 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unl... |
jucimarjr/IPC_2017-1 | lista08/lista08_lista02_questao12.py | #----------------------------------------------------------------------------------------------------------------------
# Introdução a Programação de Computadores - IPC
# Universidade do Estado do Amazonas - UEA
# Prof. Jucimar Jr
# Gabriel de Queiroz Sousa 1715310044
# Lucas Gabriel Silveira Duarte ... |
slipstream/SlipStreamConnectors | cloudstack/python/tar/test/TestCloudStackClientCloud.py | #!/usr/bin/env python
"""
SlipStream Client
=====
Copyright (C) 2015 SixSq Sarl (sixsq.com)
=====
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-... |
NifTK/NiftyNet | demos/PyTorchNiftyNet/libs/loss.py | import torch
import torch.nn as nn
class SoftDiceLoss(nn.Module):
def __init__(self):
super(SoftDiceLoss, self).__init__()
def forward(self, output, label):
probs = output.view(-1)
mask = label.view(-1)
smooth = 1
intersection = torch.sum(probs * mask)
den1 = ... |
xbezdick/tempest | tempest/scenario/manager.py | # Copyright 2012 OpenStack Foundation
# Copyright 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/LIC... |
Kungbib/CIPAC | webapp/kortkatalogen/skillingtryck/management/commands/import_skillingtryck.py | # -*- coding: utf-8 -*-
from django.core.management.base import BaseCommand, CommandError
from skillingtryck.models import *
import os
from os import listdir
from os.path import isfile, join
import glob
class Command(BaseCommand):
help = 'Import folders of catalog cards.'
args = '<path>'
def add_argumen... |
grahamhayes/designate | designate/api/v1/limits.py | # Copyright 2012 Managed I.T.
#
# Author: Kiall Mac Innes <kiall@managedit.ie>
#
# 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... |
googleapis/python-oslogin | samples/generated_samples/oslogin_v1_generated_os_login_service_get_login_profile_sync.py | # -*- coding: utf-8 -*-
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... |
PanDAWMS/panda-bigmon-core | core/reports/sendMail.py | """
Created on 04.06.2018
:author Tatiana Korchuganova
A lib to send report by email
"""
import logging
from django.utils.html import strip_tags
from smtplib import SMTPException
from datetime import datetime
from django.core.mail import send_mail
from django.template import loader
from django.core import mail
_logger... |
uname/PySockDebuger | net/SockClientManager.py | #-*- coding: utf-8 -*-
from log import logger
from UdpClient import UdpClient
from TcpClient import TcpClient
from net import socktypes
class SockClientManager(object):
def __init__(self):
self.clientDict = {}
self.sockClientClsDict = { socktypes.UDP_CLIENT_LOCAL: UdpClient,
... |
kedz/cuttsum | wp-scripts/mark-rare.py | import os
import gzip
from collections import defaultdict
def main(input_path, output_path, norm, stop, threshold):
input_path = "{}.norm-{}{}.spl.gz".format(
input_path, norm, ".stop" if stop else "")
dirname, fname = os.path.split(output_path)
if dirname != "" and not os.path.exists(dirname):
... |
RedHatInsights/insights-core | insights/parsers/proc_environ.py | """
ProcEnviron - File ``/proc/<PID>/environ``
==========================================
Parser for parsing the ``environ`` file under ``/proc/<PID>``
directory.
"""
from insights import Parser, parser, LegacyItemAccess
from insights.parsers import SkipException, ParseException
from insights.specs import Specs
cl... |
kubeflow/kfserving-lts | python/kfserving/test/test_v1alpha2_onnx_spec.py | # Copyright 2020 kubeflow.org.
#
# 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,... |
TakesxiSximada/TIL | django/rest-framework-authentication/service_main/settings.py | """
Django settings for service_main project.
Generated by 'django-admin startproject' using Django 1.11.3.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""
impo... |
dudulianangang/vps | ptsp.py | import sdf
import matplotlib.pyplot as plt
import numpy as np
import matplotlib as mpl
plt.style.use('seaborn-white')
# plt.rcParams['font.family'] = 'sans-serif'
# plt.rcParams['font.sans-serif'] = 'Tahoma'
# # plt.rcParams['font.monospace'] = 'Ubuntu Mono'
# plt.rcParams['font.size'] = 10
# plt.rcParams['axes.labels... |
SU-ECE-17-7/ibeis | ibeis/web/job_engine.py | # -*- coding: utf-8 -*-
"""
Accepts and handles requests for tasks.
Each of the following runs in its own Thread/Process.
BASICALLY DO A CLIENT/SERVER TO SPAWN PROCESSES
AND THEN A PUBLISH SUBSCRIBE TO RETURN DATA
Accepter:
Receives tasks and requests
Delegates tasks and responds to requests
Tasks are de... |
mesosphere/dcos-kafka-service | frameworks/kafka/tests/client.py | """
A collection of client utilites for Kafka.
"""
import logging
import uuid
import typing
import sdk_auth
import sdk_cmd
import sdk_utils
import sdk_marathon
import sdk_networks
from tests import auth
from tests import test_utils
from tests import topics
log = logging.getLogger(__name__)
class KafkaService:
... |
tudorvio/tempest | tempest/api/compute/servers/test_server_rescue_negative.py | # Copyright 2013 Hewlett-Packard Development Company, L.P.
# Copyright 2014 NEC Corporation. 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://... |
googleads/google-ads-python | google/ads/googleads/v8/services/services/feed_item_set_service/transports/base.py | # -*- coding: utf-8 -*-
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... |
IBM-Security/ibmsecurity | ibmsecurity/isam/web/reverse_proxy/junctions.py | import logging
from ibmsecurity.utilities import tools
try:
basestring
except NameError:
basestring = (str, bytes)
logger = logging.getLogger(__name__)
# URI for this module
uri = "/wga/reverseproxy"
requires_modules = ["wga"]
requires_version = None
def get_all(isamAppliance, reverseproxy_id, check_mode=F... |
gorakhargosh/mom | mom/_types/__init__.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2011 Yesudeep Mangalapilly <yesudeep@gmail.com>
# Copyright 2012 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 ... |
mahabs/nitro | nssrc/com/citrix/netscaler/nitro/resource/config/network/fis_interface_binding.py | #
# Copyright (c) 2008-2015 Citrix 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.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... |
cvandeplas/plaso | plaso/parsers/winreg_plugins/appcompatcache_test.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2014 The Plaso Project Authors.
# Please see the AUTHORS file for details on individual 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 L... |
erykoff/redmapper | tests/test_runcat.py | import unittest
import numpy.testing as testing
import numpy as np
import fitsio
from numpy import random
import healpy as hp
from redmapper import Cluster
from redmapper import ClusterCatalog
from redmapper import Configuration
from redmapper import GalaxyCatalog
from redmapper import DataObject
from redmapper import... |
googleads/google-ads-python | google/ads/googleads/v9/services/types/feed_mapping_service.py | # -*- coding: utf-8 -*-
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... |
citrix-openstack-build/cinder | cinder/api/v1/volumes.py | # Copyright 2011 Justin Santa Barbara
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... |
openstack/barbican | barbican/tests/plugin/util/test_translations.py | # Copyright (c) 2014 Rackspace, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... |
victorywang80/Maintenance | saltstack/src/salt/modules/grains.py | # -*- coding: utf-8 -*-
'''
Return/control aspects of the grains data
'''
# Import python libs
import collections
import math
import operator
import os
import random
import yaml
# Import salt libs
import salt.utils
import salt.utils.dictupdate
# Seed the grains dict so cython will build
__grains__ = {}
# Change the... |
victorywang80/Maintenance | saltstack/src/tests/integration/client/syndic.py | # Import Salt Testing libs
from salttesting.helpers import ensure_in_syspath
ensure_in_syspath('../../')
# Import salt libs
import integration
class TestSyndic(integration.SyndicCase):
'''
Validate the syndic interface by testing the test module
'''
def test_ping(self):
'''
test.ping
... |
riquito/crusca | tests/decorators.py | # builtins
from functools import wraps
import inspect
from os.path import dirname, join
def provider(dataProvider):
"""Search for a method named `dataProvider` and run the decorated method
once per each item returned by the provider. Each item is a tuple whose
values will be used as the test method *args.... |
morganpatz/CMPUT404-assignment-web-client | freetests.py | #!/usr/bin/env python
# coding: utf-8
# Copyright 2013 Abram Hindle
#
# 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 b... |
cloudera/Impala | tests/shell/util.py | #!/usr/bin/env impala-python
# encoding=utf-8
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache Licen... |
violasox/tellurium | examples/tellurium-files/parameterScan/steadystatescan.py | import matplotlib.pyplot as plt
import tellurium as te
import numpy as np
cell = '''
$Xo -> S1; vo;
S1 -> S2; k1*S1 - k2*S2;
S2 -> $X1; k3*S2;
vo = 1
k1 = 2; k2 = 0; k3 = 3;
'''
rr = te.loadAntimonyModel(cell)
p = te.ParameterScan.SteadyStateScan(rr)
p.value = 'k3'
p.startValue = 2
p.en... |
deepmind/open_spiel | open_spiel/python/algorithms/adidas_utils/games/gamut.py | # Copyright 2019 DeepMind Technologies 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 or agr... |
log2timeline/dftimewolf | tests/test_modules/modules.py | # -*- coding: utf-8 -*-
"""Contains dummy modules used in tests."""
from dftimewolf.lib import module
from dftimewolf.lib.containers import containers
class DummyModule1(module.BaseModule):
"""This is a dummy module."""
def __init__(self, state, name=None):
self.runtime_value = None
super(DummyModule1, ... |
rhshah/iAnnotateSV | iAnnotateSV/test/test_iAnnotateSVs.py | '''
Created on 20/02/2015
@author: Ronak H Shah
'''
import filecmp
import os
import sys
from subprocess import Popen
import shlex
import nose
import logging
def setup_module():
this_dir, this_filename = os.path.split(__file__)
new_dir = os.path.dirname(this_dir)
inputFile = os.path.join(new_dir, "data", ... |
chaudum/crate-top | cstat/window.py | # vi: set encoding=utf-8
# Licensed to CRATE Technology GmbH ("Crate") under one or more contributor
# license agreements. See the NOTICE file distributed with this work for
# additional information regarding copyright ownership. Crate licenses
# this file to you under the Apache License, Version 2.0 (the "License");... |
apache/incubator-superset | tests/integration_tests/charts/data/api_tests.py | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
111pontes/ydk-py | cisco-ios-xe/ydk/models/cisco_ios_xe/_meta/_BGP4_MIB.py |
import re
import collections
from enum import Enum
from ydk._core._dm_meta_info import _MetaInfoClassMember, _MetaInfoClass, _MetaInfoEnum
from ydk.types import Empty, YList, YLeafList, DELETE, Decimal64, FixedBitsDict
from ydk._core._dm_meta_info import ATTRIBUTE, REFERENCE_CLASS, REFERENCE_LIST, REFERENCE_LEAFLI... |
postlund/home-assistant | tests/helpers/test_entity_component.py | """The tests for the Entity component helper."""
# pylint: disable=protected-access
from collections import OrderedDict
from datetime import timedelta
import logging
from unittest.mock import Mock, patch
import asynctest
import pytest
import voluptuous as vol
from homeassistant.const import ENTITY_MATCH_ALL, ENTITY_M... |
locationlabs/jsonschema-types | jsonschematypes/tests/fixtures.py | """
Common test fixtures.
"""
from os.path import dirname, join
ADDRESS = dict(
street="1600 Pennsylvania Ave",
city="Washington",
state="DC",
)
NAME = dict(
first="George",
last="Washington",
)
RECORD = dict(
name=NAME,
address=ADDRESS,
)
ADDRESS_ID = "http://x.y.z/bar/address"
NAME_I... |
orchardup/python-orchard | orchard/packages/docker/auth.py | # Copyright 2013 dotCloud 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 t... |
uw-it-aca/canvas-analytics | data_aggregator/tests/test_rad_view.py | # Copyright 2021 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0
import unittest
from django.test import TestCase
from data_aggregator.utilities import get_view_name
from data_aggregator.tests.db_utils import get_row_count
from data_aggregator.dao import TaskDAO
class TestRadView(TestCase):
... |
openstack/heat | heat/engine/api.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
# ... |
mileslee1987/TomTomPOIReader | resources_rc.py | # -*- coding: utf-8 -*-
# Resource object code
#
# Created: Fri 3. Jun 10:24:22 2016
# by: The Resource Compiler for PyQt (Qt v4.8.6)
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore
qt_resource_data = "\
\x00\x00\x0c\xc0\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x... |
mnunberg/couchbase-python-client | couchbase/tests/cases/delete_t.py | #
# Copyright 2013, Couchbase, 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 l... |
SRabbelier/Melange | app/soc/views/base.py | #!/usr/bin/env python2.5
#
# Copyright 2011 the Melange 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 applic... |
iwm911/plaso | plaso/parsers/plist_plugins/bluetooth_test.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2013 The Plaso Project Authors.
# Please see the AUTHORS file for details on individual 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 L... |
duskat/python_training | fixture/contact.py | __author__ = 'Dzmitry'
from model.contact import Contact
import re
class ContactHelper:
def __init__(self, app):
self.app = app
def create(self, contact):
wd = self.app.wd
self.app.open_home_page()
# init new contact creation
wd.find_element_by_link_text("add new").cli... |
daboross/dabo.guru | content/minecraft_api.py | import json
from builtins import list
from flask.globals import request
import requests
from werkzeug.contrib.cache import RedisCache
from content import app
uuid_to_username_url = "https://sessionserver.mojang.com/session/minecraft/profile/"
username_to_uuid_url = "https://api.mojang.com/profiles/minecraft"
data_c... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.