content stringlengths 4 20k |
|---|
from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin
class Cups(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin):
"""CUPS IPP print service
"""
plugin_name = 'cups'
profiles = ('hardware',)
packages = ('cups',)
def setup(self):
if not self.get_option("all_logs")... |
# -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Rupesh Tare <<EMAIL>>`
'''
# Import Python libs
from __future__ import absolute_import
# Import Salt Testing Libs
from salttesting import TestCase, skipIf
from salttesting.mock import (
MagicMock,
patch,
NO_MOCK,
NO_MOCK_REASON
)
# Import Salt Libs... |
#!/usr/bin/env python
import argparse
import json
import init_command
import cluster_command
import configure_command
import machines_command
import service_command
import deploy_command
import logs_command
import job_command
from pkg_resources import resource_string
from os import listdir, walk, getcwd
from os.path... |
# coding: utf-8
import serial
import serial.tools.list_ports
import sys
from enum import Enum
class TweLiteError(Exception):
pass
class InvalidMessageFormatError(TweLiteError):
def __init__(self, message):
self.message = message
class NotSupportedCommandError(TweLiteError):
def __... |
import re
from time import time
def set_admin(msg, handler):
"""Handle admin verification responses from NickServ.
| If NickServ tells us that the nick is authed, mark it as verified.
"""
match = re.match("(.*) ACC ([0-3])", msg)
if not match:
return
if int(match.group(2)) == 3:
... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
########################################################
import datetime
import os
import platform
import random
import shutil
import socket
import sys
import time
from ansible.errors import AnsibleOptionsError
from ansible.cli im... |
import numpy as np
import gdal
from gdalconst import *
from pymars import pdstools
def open_S_mola(filename, lat=90, lon=0, x_points=0, y_points=0):
label_f = filename[:-3]+'lbl'
label = pdstools.get_labels(label_f)
RES = pdstools.get_angle(label, 'IMAGE_MAP_PROJECTION', 'MAP_RESOLUTION')
mola_sca... |
"""Testing facility for conkit.io.a2m"""
__author__ = "Felix Simkovic"
__date__ = "30 Jul 2018"
import unittest
from conkit.io.a2m import A2mParser
from conkit.io.tests.helpers import ParserTestCase
class TestA2mParser(ParserTestCase):
def test_read_1(self):
msa = """GSMFTPKPPQDSAVI--GYCVKQGAVMKNWKRRY... |
import sys
from fx.httpfx import success, failure, mandatory_parameters, init_routing, authenticated
from gpxfx.gpxparser import parse_gpx_xml_to_domain_model
from server.models import Gpx
# exception formatting
import traceback
@mandatory_parameters(['id'])
def get(request, params):
'''
get gpx by id
'''
id = p... |
import json
import traceback
from Products.ZenUtils.Utils import unused
from Products.ZenUtils.GlobalConfig import getGlobalConfiguration
from kafka.client import KafkaClient
from kafka.producer import SimpleProducer
from kafka.protocol import CODEC_GZIP, CODEC_SNAPPY
import Globals
import logging
logging.basicConfig... |
import netrc, os, unittest, sys
from test import support
TEST_NETRC = """
machine foo login log1 password pass1 account acct1
macdef macro1
line1
line2
macdef macro2
line3
line4
default login log2 password pass2
"""
temp_filename = support.TESTFN
class NetrcTestCase(unittest.TestCase):
def setUp(self):
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import requests
# import re
import xmltodict
# import subprocess
import time
import sys
if sys.version_info[0] == 2:
from itertools import izip as zip
try:
from lxml import etree
except ImportError:
from xml.etree import cElementTree as etree
from .config import... |
"""Download data relevant to train the KittiSeg model."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import logging
import sys
import os
import subprocess
import zipfile
from six.moves import urllib
from shutil import copy2
import argparse
logging.... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Provides a service to store ROS message objects in a mongodb database in JSON.
"""
import rospy
import mongodb_store_msgs.srv as dc_srv
import mongodb_store.util as dc_util
import pymongo
import json
from bson import json_util
from mongodb_store_msgs.msg import Strin... |
class Solution:
def myAtoi(self, str: str) -> int:
max_int, min_int = 2147483647, -2147483648
for i in range(len(str)):
if str[i] != ' ':
h = i
break
else:
return 0
if str[h] not in '+-0123456789':
return 0
... |
"""
A clone of 'ifconfig' on UNIX.
$ python examples/ifconfig.py
lo (speed=0MB, duplex=?, mtu=65536, up=yes):
IPv4 address : 127.0.0.1
broadcast : 127.0.0.1
netmask : 255.0.0.0
IPv6 address : ::1
netmask : ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff
MAC ... |
from linkedtv.api.storage.load.ltv.LinkedTVDataLoader import LinkedTVDataLoader
from linkedtv.api.storage.load.beng.BengDataLoader import BengDataLoader
from linkedtv.api.storage.load.europeanaspace.EuropeanaSpaceDataLoader import EuropeanaSpaceDataLoader
from linkedtv.api.storage.load.openbeelden.OpenBeeldenDataLoader... |
from ctypes import *
from ctypes.wintypes import *
from comtypes import *
S_OK=0
###comtypes class definitions
SVFN_LEN = 262
LANG_LEN = 64
TTSDATAFLAG_TAGGED = 1
TTSI_NAMELEN = SVFN_LEN
TTSI_STYLELEN = SVFN_LEN
TTSATTR_MINPITCH = 0
TTSATTR_MAXPITCH = 0xffff
TTSATTR_MINSPEED = 0
TTSATTR_MAXSPEED = 0x... |
class Buffer:
def __init__(self):
# конструктор без аргументов
self.bufer = []
def add(self, *a):
# добавить следующую часть последовательности
fix = 5
for val in a:
self.bufer.append(val)
lun = len(self.bufer) // fix
self.bufer.reverse()
if lun > 0:
for j in range(lun):
... |
import re
import textwrap
import warnings
from datetime import datetime
from urllib.request import urlopen, Request
# Third-party
from astropy import time as atime
from astropy.utils.console import color_print, _color_text
from . import get_sun
__all__ = []
class HumanError(ValueError):
pass
class CelestialEr... |
STATS_MYSQL_GLOBAL = {
'name': 'stats_mysql_global',
'query': 'SELECT * FROM stats_mysql_global',
'columns': [
{
'name': 'Variable_Name',
'type': 'match',
'source': 'Variable_Value',
'items': {
# the total uptime of ProxySQL in seconds
... |
import os
import socket
import struct
from OpenSSL import SSL
from mitmproxy import exceptions
from mitmproxy import flow
from mitmproxy.proxy.protocol import base
from mitmproxy.net import tcp
from mitmproxy.net import websockets
from mitmproxy.websocket import WebSocketFlow, WebSocketMessage
class WebSocketLayer(b... |
import socket
import sys
import select
import ctypes
import random
import win32gui
import subprocess
from threading import Thread
from time import sleep
import os
import pickle
import Crypto.Hash.MD5 as MD5
import Crypto.PublicKey.RSA as RSA
import Crypto.Util.number as CUN
port = 15345
maxBuffSize = 100000
ID = ""... |
import discord
import json
import psycopg2
import random
from discord.ext import commands
from urllib.parse import urlparse
import requests
from command import Command
class hello(Command):
def call(ctx,args):
"""[name] - Says hello to you or another!"""
if len(args) < 1:
return ["Hi {0.author.name}!".format(c... |
import json
from lxml import etree
from django.conf import settings
from django.test import TestCase, Client
from .utils import getGazetteerEntry
class GazetteerTest(TestCase):
fixtures = ['gazetteer_data.json'] if settings.USE_WORLDMAP else []
def test_get_gazetteer_entry(self):
if settings.USE_WOR... |
# -*- coding: utf-8 -*-
"""
Implements pure server side signin flow:
https://developers.google.com/+/web/signin/redirect-uri-flow
https://developers.google.com/+/domains/authentication/scopes
https://developers.google.com/api-client-library/python/guide/aaa_oauth#OAuth2WebServerFlow
Django project for this:
https://gi... |
"""
Policy Engine For Senlin
"""
# from oslo_concurrency import lockutils
from oslo_config import cfg
from oslo_policy import policy
from senlin.common import exception
POLICY_ENFORCER = None
CONF = cfg.CONF
# @lockutils.synchronized('policy_enforcer', 'senlin-')
def _get_enforcer(policy_file=None, rules=None, def... |
import numpy as np
import sklearn.cross_validation
import autosklearn.util.logging_
logger = autosklearn.util.logging_.get_logger(__name__)
def split_data(X, Y, classification=None):
num_data_points = X.shape[0]
num_labels = Y.shape[1] if len(Y.shape) > 1 else 1
X_train, X_valid, Y_train, Y_valid = None... |
import logging
import sys
import socket
from django.utils.translation import ugettext_lazy as _t, ugettext as _
from desktop.conf import default_ssl_cacerts, default_ssl_validate
from desktop.lib.conf import ConfigSection, Config, coerce_bool
from impala.settings import NICE_NAME
LOG = logging.getLogger(__name__)
... |
"""
The I{schema} module provides a intelligent representation of
an XSD schema. The I{raw} model is the XML tree and the I{model}
is the denormalized, objectified and intelligent view of the schema.
Most of the I{value-add} provided by the model is centered around
tranparent referenced type resolution and targeted de... |
import os
import socket
import json
from time import sleep
class DataSwarm:
def __init__(self):
self.socket = socket.socket()
self.id = 1
self.wq = None
def send_recv(self, request):
request = json.dumps(request)
self.send(request)
response = self.recv()
... |
# Colan Biemer
import math
import random
import MatrixString
count = 0
wallNum = 1
groundNum = 0
notBuildNum = -1
steps = 22
seedPower = 8
seedType = 2
## Procedurally create maps
procMap = []
def printMapRegular(newMap):
for row in newMap:
string = ""
for cell in row:
string += str(c... |
from spack import *
from spack.util.environment import *
import shutil
class R(AutotoolsPackage):
"""R is 'GNU S', a freely available language and environment for
statistical computing and graphics which provides a wide variety of
statistical and graphical techniques: linear and nonlinear modelling,
s... |
"""Classes and methods related to model_fn."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import six
from tensorflow.python.estimator.export.export_output import ExportOutput
from tensorflow.python.framework import ops
from tensorf... |
from lib.cuckoo.common.abstracts import Signature
class SandboxieDetectLibs(Signature):
name = "antisandbox_sboxie_libs"
description = "Detects Sandboxie through the presence of a library"
severity = 3
categories = ["anti-sandbox"]
authors = ["Accuvant"]
minimum = "1.2"
evented = True
... |
'''
The Pitt API, to access workable data of the University of Pittsburgh
Copyright (C) 2015 Ritwik Gupta
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 ... |
from couchpotato import get_session
from couchpotato.core.event import addEvent, fireEventAsync, fireEvent
from couchpotato.core.plugins.base import Plugin
from couchpotato.core.settings.model import Media
class MediaBase(Plugin):
_type = None
default_dict = {
'profile': {'types': {'quality': {}}},
... |
from nose.plugins.attrib import attr
from marvin.cloudstackAPI import (
stopRouter,
replaceNetworkACLList
)
from marvin.cloudstackTestCase import cloudstackTestCase
from marvin.lib.base import (
NetworkACL,
NetworkACLList,
NATRule,
PublicIPAddress,
VirtualMachine,
Network,
VPC,
... |
from unittest import TestCase
from ripl.bases import Scope, Symbol, get_global_scope
from ripl.utils import _ripl_add, curry, pyimport
class RiplAddTest(TestCase):
# NOTE: all procedures will be given *args at the moment
def test_add_floats(self):
'''Just adding floats works'''
args = [2, 1.1... |
import numpy as np
import tensorflow as tf
import random
import gym
from Replay_Memory import Replay_Memory
import time
import cv2
import re,sys
MEMORY_LENGTH = 4
ACTIONS = 4
LEARNING_RATE = 0.00025
FINAL_EXPLORATION_FRAME = 500000
TRAINING_STEPS = 10000000
DISCOUNT_RATE = 0.99
RMSPROP_MOMENTUM = 0.95
RMSPROP_EPSILO... |
"""
This file describes the Description API interface of the Online Prediction
Framework (OPF).
The Description API interface encapsulates the following two important sets of
configuration parameters in OPF
1) model creation paramters (via getDescription)
2) task control parameters (via getExperimentTasks)
The desc... |
# coding: utf8
{
'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"update" é uma expressão opcional como "campo1=\'novo_valor\'". Não é permitido atualizar ou apagar resultados de um JOIN',
'%Y-%m-%d': '%d/%m/%Y',
'%Y-%m-%d %H:%M:%S': '%d/%m/%Y %H:%M:%... |
import sys
import os
if sys.version_info >= (2, 7):
import unittest
else:
import unittest2 as unittest
from storlever.mngr.block.blockmgr import block_mgr
from storlever.tests.mngr.block.utils import get_block_dev
class TestBlockMgr(unittest.TestCase):
def test_block_mgr(self):
mgr = block_mgr(... |
"""
Abstract Query expressions.
Queries are not tied to a search engine. They can be built independently, persisted and
then executed by any search engine.
Each search engine is responsible for interpreting queries at search time
by calling them with a mapper.
Search engines don't support joins, so you can query only ... |
"""Entry point for the App Engine environment."""
# In the normal App Engine environment, this is always implicitly imported
# before the rest of the App. In the Managed VMs environment, it's not imported
# at all. So import it here. In normal App Engine this will be a no-op.
import appengine_config
import logging
i... |
"""
django-critic: utils
"""
from django.contrib.contenttypes.models import ContentType
from django.template.loader import get_template, render_to_string
from critic.modules import method_for_instance
def render(obj, **extra_context):
t = None
try:
ct = ContentType.objects.get_for_model(obj)
... |
""" Cross-object data auditing
Schema validation allows for checking values within a single object.
We also need to perform higher order checking between linked objects.
"""
import logging
import venusian
from past.builtins import basestring
from pyramid.view import view_config
from .calculated import calculated_prop... |
from ._base import BaseHandler
from synapse.streams.config import PaginationConfig
from synapse.api.constants import Membership, EventTypes
from twisted.internet import defer
import collections
import logging
logger = logging.getLogger(__name__)
SyncConfig = collections.namedtuple("SyncConfig", [
"user",
... |
from ..language.ast import Node
from ..language.parser import Loc
def ast_to_code(ast, indent=0):
"""
Converts an ast into a python code representation of the AST.
"""
code = []
def append(line):
code.append((' ' * indent) + line)
if isinstance(ast, Node):
append('ast.{}('... |
#!/usr/bin/env python3
"""
Converts text from stdin into 1's and 0's and writes them to a file.
With -d, or -f followed by a filename, the message is decoded and written to
stdout.
Ex.:
> Hello, World!
01001000 01100101 01101100 01101100 01101111
00101100 00100000 01010111 01101111 01110010
01101100 01100100 00100001... |
# -*- coding: UTF-8 -*-
import logging
from .mock_handler import MockHandler
from .SearchList import SearchList, User
import os
import sqlite3
import tempfile
from nose.tools import eq_
import limbo
# test plugin hooks
#
# TODO: test init_plugins with unicode plugins
# TODO: test init_plugins with invalid plugins
# T... |
import unittest
from graphene.storage.base.string_store import *
class TestStringStoreMethods(unittest.TestCase):
TEST_FILENAME = "graphenestore.namestore.db"
def setUp(self):
GrapheneStore.TESTING = True
def tearDown(self):
"""
Clean the database so that the tests are independe... |
#!/usr/bin/env python
"""
Copyright (c) 2006-2013 sqlmap developers (http://sqlmap.org/)
See the file 'doc/COPYING' for copying permission
"""
class SqlmapBaseException(Exception):
pass
class SqlmapCompressionException(SqlmapBaseException):
pass
class SqlmapConnectionException(SqlmapBaseException):
pass... |
"""Implements raw HID device communication on Windows."""
import ctypes
from ctypes import wintypes
import platform
from pyu2f import errors
from pyu2f.hid import base
# Load relevant DLLs
hid = ctypes.windll.Hid
setupapi = ctypes.windll.SetupAPI
kernel32 = ctypes.windll.Kernel32
# Various structs that are used ... |
import re
import traceback
import datetime
import urlparse
import sickbeard
import generic
import urllib
from sickbeard.common import Quality
from sickbeard import logger
from sickbeard import tvcache
from sickbeard import db
from sickbeard import classes
from sickbeard import helpers
from sickbeard import show_name_he... |
# -*- 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 'Search.float'
db.add_column('testapp_search', 'float',
self.gf('django... |
import re
import unicodecsv as csv
import classes.wunderpy_wrapper
# contains and deals with the layout of the grocery store. Critical for the groceryList ordering.
# it also manages the categories of ingredients (eg: where, by group, where you would find an ingredient)
class groceryStore:
#set up categories and... |
from collections import deque
import theano
import numpy as np
from .. import utils
__all__ = [
"get_all_layers",
"get_output",
"get_output_shape",
"get_all_params",
"count_params",
"get_all_param_values",
"set_all_param_values",
]
def get_all_layers(layer, treat_as_input=None):
""... |
from __future__ import absolute_import
from enum import Enum
import numpy as np
from scipy.ndimage import label
from scipy.stats import linregress
from scanomatic.data_processing import growth_phenotypes
from scanomatic.data_processing.phases.segmentation import (
DEFAULT_THRESHOLDS, CurvePhases, get_data_needed... |
from gnuradio import gr, gr_unittest
import digital_swig as digital
import filter_swig as filter
import random, cmath, time
class test_mpsk_receiver(gr_unittest.TestCase):
def setUp(self):
self.tb = gr.top_block()
def tearDown(self):
self.tb = None
def test01(self):
# Test BPSK s... |
import datetime
import mock
from oslo_config import cfg
from oslo_utils import fixture as utils_fixture
from oslo_utils.fixture import uuidsentinel
from oslo_vmware.objects import datastore as ds_obj
from oslo_vmware import vim_util as vutil
from nova import objects
from nova import test
from nova.tests.unit import f... |
from optparse import OptionParser
import numpy as np
from ase.lattice.surface import fcc111, hcp0001, bcc110, bcc100, diamond111, \
add_adsorbate
from ase.structure import estimate_lattice_constant
from ase.data import reference_states, atomic_numbers, covalent_radii
from ase.io import write
from ase.visualize im... |
"""
Routines to detect number plates.
Use `detect` to detect all bounding boxes, and use `post_process` on the output
of `detect` to filter using non-maximum suppression.
"""
__all__ = (
'detect',
'post_process',
)
import collections
import itertools
import math
import sys
import cv2
import numpy
import ... |
from fabric.context_managers import hide
import re
from calyptos.plugins.debugger.debuggerplugin import DebuggerPlugin
class CheckComputeRequirements(DebuggerPlugin):
def debug(self):
# Supported CentOS/RHEL OS version for each component
self.os_version = 6
# Default clock skew allowed for ... |
from __future__ import absolute_import, division, print_function
from collections import defaultdict
import pandas as pd
from toolz import partition_all
from ..base import tokenize, compute_as_if_collection
from .accessor import Accessor
from .utils import (has_known_categories, clear_known_categories, is_scalar,
... |
'''Complete the current word before the cursor with words in the editor.
Each menu selection or shortcut key selection replaces the word with a
different word with the same prefix. The search for matches begins
before the target and moves toward the top of the editor. It then starts
after the cursor and moves down. It... |
import os
import pybullet
from pybullet_envs import robot_bases
class MJCFBasedRobot(robot_bases.XmlBasedRobot):
"""
Base class for mujoco .xml based agents.
"""
def __init__(self, model_xml, robot_name, action_dim, obs_dim, self_collision=True):
robot_bases.XmlBasedRobot.__init__(self, robot_name, action_d... |
# encoding: UTF-8
# KenHuang: 使配置文件夹符合XDG标准
import os
class Constant(object):
if "XDG_CONFIG_HOME" in os.environ:
conf_dir = os.path.join(os.environ["XDG_CONFIG_HOME"], "netease-musicbox")
else:
conf_dir = os.path.join(os.path.expanduser("~"), ".netease-musicbox")
config_path = os.path.joi... |
"""LibSVMDataset"""
import tensorflow as tf
from tensorflow_io.python.experimental.text_ops import decode_libsvm
class LibSVMIODataset(tf.data.Dataset):
"""LibSVMIODataset"""
def __init__(
self,
filename,
num_features,
dtype=None,
label_dtype=None,
compression... |
import sys
from importlib import import_module
from django.test.utils import override_settings
from django.core.urlresolvers import clear_url_caches, reverse
from django.conf import settings
from django.utils.http import urlquote
from django.utils.six.moves import http_client
import mock
from oscar.core.compat import... |
import os
import numpy as np
from pydl.model_selection import r2_score, rmse
from pydl.models.layers import LSTM, Dense, Dropout
from pydl.models import RNN, load_model, model_from_json
from dataset import create_multivariate_dataset
# Example of valid configurations of layers
models = [
RNN(
name='lstm1'... |
"""
A script to dump documents for records created by
indivo-connector
"""
##
## DJANGO SETUP
##
from django.core.management import setup_environ
import settings, string
setup_environ(settings)
##
## constants
##
INFO = """<patient>
<last_name>%s</last_name>
<first_names>%s</first_names>
<mrn>%s</mrn>
<conf... |
# -*- coding: utf-8 -*-
from keras.layers import Input, Dense, Lambda, Flatten, Reshape
from keras.layers import Conv2D, Conv2DTranspose
from keras.models import Model
from keras import backend as K
from keras import metrics
import os
import pickle
class VAE_config:
''' variational autoencoder config'''
img_... |
from PyQt5.QtWidgets import QWidget, QHBoxLayout
from PyQt5.QtGui import QPalette, QColor
from PyQt5.QtCore import Qt, pyqtSignal
from ScaledLabel import ScaledLabel
class MenuItem(QWidget):
"""Base class for items that can be inserted into a MenuWidget"""
selected = pyqtSignal()
def __init__(self):
QWi... |
import re
import socket
import sys
import time
import xmlrpclib
try:
from xml.parsers.expat import ExpatError
except ImportError: # No expat in IronPython 2.7
class ExpatError(Exception):
pass
from robot.errors import RemoteError
from robot.utils import is_list_like, is_dict_like, unic
IRONPYTHON =... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'gotolinewidget.ui'
#
# by: PyQt4 UI code generator 4.7
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
class Ui_Form(object):
def setupUi(self, Form):
Form.setObjectName("Form")
... |
#! /usr/bin/env python
# import packages from modules directory
import sys, os
pathname = os.path.dirname(sys.argv[0])
sys.path.append(os.path.join(os.path.abspath(pathname), 'modules'))
from Tkinter import *
import tkFileDialog
import tkSimpleDialog
import tkMessageBox
import Pmw
import os
import os.path
from doug... |
from stestr.commands.failing import failing as failing_command
from stestr.commands.history import history_list as history_list_command
from stestr.commands.history import history_remove as history_remove_command
from stestr.commands.history import history_show as history_show_command
from stestr.commands.init import i... |
import unittest
import ossie.utils.testing
import os
from omniORB import any
class ComponentTests(ossie.utils.testing.ScaComponentTestCase):
"""Test for all component implementations in scrambler_bb"""
def testScaBasicBehavior(self):
####################################################################... |
"""
Gradient Descent Parameter Tuning
Provide a function to find the best input parameters. "Best" is quantified
through a function provided by the user to quantify the results of the test.
Example:
An experiment creates data based on the underlying equation of
(x-5)^2 + (y+2)^2 + (z-1)^2
Gradient ... |
from nova.network import model as network_model
from nova import test
from nova.virt.vmwareapi import network_util
from nova.virt.vmwareapi import vif
class VMwareVifTestCase(test.TestCase):
def setUp(self):
super(VMwareVifTestCase, self).setUp()
self.flags(vmwareapi_vlan_interface='vmnet0')
... |
# -*- coding: utf-8 -*-
{
'name': "cowin_hr",
'summary': """
Short (1 phrase/line) summary of the module's purpose, used as
subtitle on modules listing or apps.openerp.com""",
'description': """
Long description of module's purpose
""",
'author': "My Company",
'website... |
# -*- coding: utf-8 -*-
"""Tests for the tools.MediaWikiVersion class."""
#
# (C) Pywikibot team, 2008-2014
#
# Distributed under the terms of the MIT license.
#
from __future__ import unicode_literals
__version__ = '$Id$'
from pywikibot.tools import MediaWikiVersion as V
from tests.aspects import unittest, TestCa... |
"""Tools for deserializing PolymorphicFunctions."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import re
from tensorflow.core.framework import function_pb2
from tensorflow.python.eager import def_function
from tensorflow.python.eage... |
# Benchmarks for the solid solution class
import os.path, sys
sys.path.insert(1,os.path.abspath('../..'))
import burnman
from burnman.minerals import SLB_2011
from burnman.minerals import HP_2011_ds62
from burnman.minerals import Sundman_1991
from burnman import constants
import numpy as np
def p(v1, v2):
return... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from .reply import TextReply
from .config import AUTO_REPLY_CONTENT
ALLOWED_MSG_TYPES = set(
[
"text",
"image",
"voice",
"video",
"miniprogrampage",
"shortvideo",
"location",
"link",
... |
"""XInput2MouseTracker tests."""
import subprocess
from volcorner.rect import Rect
from volcorner import signals
from volcorner.x11.xinput2tracker import XInput2MouseTracker
from .util import SignalReceiver, with_ui, with_xte, with_xvfb
TEST_AREA = Rect.make(64, 64, 1, 1)
@with_xvfb
@with_xte
@with_ui
def test_mou... |
import zstackwoodpecker.test_state as ts_header
TestAction = ts_header.TestAction
def path():
return dict(initial_formation="template2",
path_list=[[TestAction.create_volume, "volume1","=scsi"], \
[TestAction.delete_volume, "volume1"], \
[TestAction.create_volume, "volume2","=s... |
class Positionier:
""" TODO:description """
def getAllPositions(self):
return self.getPosition(self.getAvailableLines())
def getProviderName(self):
return self.provider
def getProviderId(self):
return self.provider_id |
# Django settings for fle_site project.
import os
try:
from local_settings import *
import local_settings
except ImportError:
local_settings = {}
def localor(setting_name, default_val):
"""Returns local_settings version if it exists (and is non-empty), otherwise us... |
class Person:
def __init__(self, name): # クラスが呼び出されたときに発動(initialize)。
# __init__はPythonで最初から定義されている。
self.name = name # 自分の名前
def behave(self): # 1ステップで行う,一連の行動。
# 自分の名前をprintする %sのところにself.nameを代入している。
print('My name is %s' % self.name)
def simulation():
# シミュレーション準備... |
#!/usr/bin/python
#
# From diag_example.c - sybase example program
#
# Description:
# This program accepts a SQL statement from the user and uses
# ct_diag to report error messages. The routine 'call_diag' is
# called every time you make a call that could generate a error.
#
# Tests to try:
# (1) To test ser... |
import serial
import string
import time
from math import ceil
from datetime import datetime
import obd_sensors
from obd_sensors import hex_to_int
GET_DTC_COMMAND = "03"
CLEAR_DTC_COMMAND = "04"
GET_FREEZE_DTC_COMMAND = "07"
from debugEvent import debug_display
#___________________________________________________... |
from __future__ import print_function, division
from sympy.core.sympify import _sympify
from sympy.core import S, Basic
from sympy.matrices.expressions.matexpr import ShapeError
from sympy.matrices.expressions.matpow import MatPow
class Inverse(MatPow):
"""
The multiplicative inverse of a matrix expression
... |
#!/usr/bin/python
##
# Massimiliano Patacchiola, Plymouth University (2016)
#
# Implementation of a Self-Organizing Map class
#
import numpy as np
class Som:
"""Som Class
This is an implementation of the Self-Organizing Map (SOM).
It provides low level funcion and utilities for assembling
diffeent ... |
from datetime import datetime
from celery.exceptions import MaxRetriesExceededError
from celery.schedules import crontab
from celery.task import task
from celery.task.base import periodic_task
from celery.utils.log import get_task_logger
from django.utils.translation import ugettext as _
from couchdbkit import Resource... |
import configparser #To parse the files we need to upgrade and write the new files.
import io #To serialise configparser output to a string.
from UM.VersionUpgrade import VersionUpgrade
from cura.CuraApplication import CuraApplication
# a dict of renamed quality profiles: <old_id> : <new_id>
_renamed_quality_profile... |
#!/usr/bin/python
#coding:utf8
#Author = <EMAIL>
#Create = 20120517
import cookielib, urllib2, urllib
import os,sys,socket,re
import datetime,time
import HTMLParser
blog = "http://hi.baidu.com/new/*****" #你自己的百度博客链接,需要修改
baidu_user = '' #你的百度登录名,暂未考虑中文ID,比如abc
baidu_psw = '' ... |
import copy
from neutron.agent.linux import utils as linux_utils
from neutron.common import utils
IPSET_ADD_BULK_THRESHOLD = 5
NET_PREFIX = 'N'
SWAP_SUFFIX = '-n'
IPSET_NAME_MAX_LENGTH = 31 - len(SWAP_SUFFIX)
class IpsetManager(object):
"""Smart wrapper for ipset.
Keeps track of ip addresses per set, us... |
from globalthings import *
class Step:
"""
A Step is a componnent of a Receipe. It can be a TRANSITION, LEVEL or STOP to pause the receipe until user confirmation
"""
def __init__(self, a_name, a_type, a_duration, a_temperature=0.0, an_inertia=0.0):
"""
Constructor
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.