text
stringlengths 28
881k
|
---|
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and otherNEWLINE# Spack Project Developers. See the top-level COPYRIGHT file for details.NEWLINE#NEWLINE# SPDX-License-Identifier: (Apache-2.0 OR MIT)NEWLINENEWLINEfrom spack import *NEWLINENEWLINENEWLINEclass RCdcfluview(RPackage):NEWLINE """The 'U.S.' Centers for Disease Control ('CDC') maintains a portalNEWLINE <http://gis.cdc.gov/grasp/fluview/fluportaldashboard.html> for accessingNEWLINE state, regional and national influenza statistics as well as MortalityNEWLINE Surveillance Data. The web interface makes it difficult and time-consumingNEWLINE to select and retrieve influenza data. Tools are provided to access theNEWLINE data provided by the portal's underlying 'API'."""NEWLINENEWLINE homepage = "https://cloud.r-project.org/package=cdcfluview"NEWLINE url = "https://cloud.r-project.org/src/contrib/cdcfluview_0.7.0.tar.gz"NEWLINE list_url = "https://cloud.r-project.org/src/contrib/Archive/cdcfluview"NEWLINENEWLINE version('0.9.0', sha256='1b2064886858cbb1790ef808d88fbab75d3a9cf55e720638221a3377ff8dd244')NEWLINE version('0.7.0', sha256='8c8978d081f8472a6ed5ec54c4e6dd906f97ee28d0f88eef1514088f041ecc03')NEWLINENEWLINE depends_on('r@3.2.0:', type=('build', 'run'))NEWLINE depends_on('r-httr', type=('build', 'run'))NEWLINE depends_on('r-dplyr', type=('build', 'run'))NEWLINE depends_on('r-jsonlite', type=('build', 'run'))NEWLINE depends_on('r-sf', type=('build', 'run'))NEWLINE depends_on('r-xml2', type=('build', 'run'))NEWLINE depends_on('r-purrr', type=('build', 'run'))NEWLINE depends_on('r-readr', type=('build', 'run'))NEWLINE depends_on('r-mmwrweek', type=('build', 'run'))NEWLINE depends_on('r-units@0.4-6:', type=('build', 'run'))NEWLINE |
import importlibNEWLINEimport pkgutilNEWLINENEWLINEfrom pkg_resources import get_distribution, DistributionNotFoundNEWLINENEWLINENEWLINEdef get_package_version():NEWLINE """Get package versionNEWLINENEWLINE Returns:NEWLINE str: Installed package version, or 0.0.0.dev if not fully installedNEWLINE """NEWLINE try:NEWLINE return get_distribution(__name__.split('.')[0]).versionNEWLINE except DistributionNotFound:NEWLINE return '0.0.0.dev'NEWLINENEWLINENEWLINEdef get_file_extension(filepath):NEWLINE """Return full file extension from filepath"""NEWLINE filename = filepath.split('/')[-1]NEWLINENEWLINE return filename[filename.index('.'):]NEWLINENEWLINENEWLINEdef get_full_qualname(cls):NEWLINE """Return fully qualified class name"""NEWLINE return cls.__module__ + '.' + cls.__name__NEWLINENEWLINENEWLINEdef get_recursive_subclasses(cls):NEWLINE """Return list of all subclasses for a class, including subclasses of direct subclasses"""NEWLINE return cls.__subclasses__() + [g for s in cls.__subclasses__() for g in get_recursive_subclasses(s)]NEWLINENEWLINENEWLINEdef import_submodules(package):NEWLINE """Return list of imported module instances from beneath root_package"""NEWLINENEWLINE if isinstance(package, str):NEWLINE package = importlib.import_module(package)NEWLINENEWLINE results = {}NEWLINENEWLINE if hasattr(package, '__path__'):NEWLINE for _, name, is_pkg in pkgutil.walk_packages(package.__path__):NEWLINE full_name = package.__name__ + '.' + nameNEWLINE try:NEWLINE results[full_name] = importlib.import_module(full_name)NEWLINENEWLINE if is_pkg:NEWLINE results.update(import_submodules(full_name))NEWLINE except ImportError:NEWLINE # Ignore import failures for now; Quickest fix to support contrib serializers as extras with just depsNEWLINE continueNEWLINENEWLINE return resultsNEWLINE |
import osNEWLINEimport clickNEWLINENEWLINEdef register(app):NEWLINE @app.cli.group()NEWLINE def translate():NEWLINE """translation and localization"""NEWLINE passNEWLINENEWLINE @translate.command()NEWLINE def update():NEWLINE """Update all languages."""NEWLINE if os.system('pybabel extract -F babel.cfg -k _l -o messages.pot .'):NEWLINE raise RuntimeError('extract command failed')NEWLINE if os.system('pybabel update -i messages.pot -d app/translations'):NEWLINE raise RuntimeError('update command failed')NEWLINE os.remove('messages.pot')NEWLINENEWLINENEWLINE @translate.command()NEWLINE def compile():NEWLINE """Compile all languages."""NEWLINE if os.system('pybabel compile -d app/translations'):NEWLINE raise RuntimeError('compile command failed')NEWLINENEWLINENEWLINENEWLINE @translate.command()NEWLINE @click.argument('lang')NEWLINE def init(lang):NEWLINE """Initialize a new language."""NEWLINE if os.system('pybabel extract -F babel.cfg -k _l -o messages.pot .'):NEWLINE raise RuntimeError('extract command failed')NEWLINE if os.system(NEWLINE 'pybabel init -i messages.pot -d app/translations -l ' + lang):NEWLINE raise RuntimeError('init command failed')NEWLINE os.remove('messages.pot')NEWLINE |
##############################################################################NEWLINE#NEWLINE# Copyright (c) 2001, 2002, 2009 Zope Foundation and Contributors.NEWLINE# All Rights Reserved.NEWLINE#NEWLINE# This software is subject to the provisions of the Zope Public License,NEWLINE# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.NEWLINE# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIEDNEWLINE# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIEDNEWLINE# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESSNEWLINE# FOR A PARTICULAR PURPOSE.NEWLINE#NEWLINE##############################################################################NEWLINE"""Examples supporting Sphinx doctest snippets.NEWLINE"""NEWLINEimport sysNEWLINENEWLINEfrom zope.interface import InterfaceNEWLINEfrom zope.interface import implementerNEWLINEfrom zope.interface.interfaces import IInterfaceNEWLINENEWLINEfrom zope.component._declaration import adapterNEWLINEfrom zope.component.testfiles.views import ICNEWLINENEWLINEdef write(x):NEWLINE sys.stdout.write('%s\n' % x)NEWLINENEWLINEclass ITestType(IInterface):NEWLINE passNEWLINENEWLINENEWLINEclass I1(Interface):NEWLINE passNEWLINENEWLINEclass I2(Interface):NEWLINE passNEWLINENEWLINEclass I3(Interface):NEWLINE passNEWLINENEWLINEclass I4(Interface):NEWLINE passNEWLINENEWLINEclass IGI(Interface):NEWLINE passNEWLINENEWLINEclass IQI(Interface):NEWLINE passNEWLINENEWLINEclass ISI(Interface):NEWLINE passNEWLINENEWLINEclass ISII(Interface):NEWLINE passNEWLINENEWLINEclass U(object):NEWLINENEWLINE def __init__(self, name):NEWLINE self.__name__ = nameNEWLINENEWLINE def __repr__(self):NEWLINE return "%s(%s)" % (self.__class__.__name__, self.__name__)NEWLINENEWLINE@implementer(I1)NEWLINEclass U1(U):NEWLINE passNEWLINENEWLINE@implementer(I1, I2)NEWLINEclass U12(U):NEWLINE passNEWLINENEWLINE@adapter(I1)NEWLINEdef handle1(x):NEWLINE write('handle1 %s' % x)NEWLINENEWLINEdef handle2(*objects):NEWLINE write( 'handle2 ' + repr(objects))NEWLINENEWLINE@adapter(I1)NEWLINEdef handle3(x):NEWLINE write( 'handle3 %s' % x)NEWLINENEWLINE@adapter(I1)NEWLINEdef handle4(x):NEWLINE write( 'handle4 %s' % x)NEWLINENEWLINEclass GlobalRegistry:NEWLINE passNEWLINENEWLINEfrom zope.component.globalregistry import GlobalAdapterRegistryNEWLINEbase = GlobalAdapterRegistry(GlobalRegistry, 'adapters')NEWLINEGlobalRegistry.adapters = baseNEWLINEdef clear_base():NEWLINE base.__init__(GlobalRegistry, 'adapters')NEWLINENEWLINENEWLINE@implementer(I1)NEWLINEclass Ob(object):NEWLINE def __repr__(self):NEWLINE return '<instance Ob>'NEWLINENEWLINENEWLINEob = Ob()NEWLINENEWLINE@implementer(I2)NEWLINEclass Ob2(object):NEWLINE def __repr__(self):NEWLINE return '<instance Ob2>'NEWLINENEWLINE@implementer(IC)NEWLINEclass Ob3(object):NEWLINE passNEWLINENEWLINE@implementer(I2)NEWLINEclass Comp(object):NEWLINE def __init__(self, context):NEWLINE self.context = contextNEWLINENEWLINEcomp = Comp(1)NEWLINENEWLINENEWLINEclass ConformsToIComponentLookup(object):NEWLINE """Allow a dummy sitemanager to conform/adapt to `IComponentLookup`."""NEWLINENEWLINE def __init__(self, sitemanager):NEWLINE self.sitemanager = sitemanagerNEWLINENEWLINE def __conform__(self, interface):NEWLINE """This method is specified by the adapter PEP to do the adaptation."""NEWLINE from zope.interface.interfaces import IComponentLookupNEWLINE if interface is IComponentLookup:NEWLINE return self.sitemanagerNEWLINENEWLINENEWLINEdef clearZCML(test=None):NEWLINE from zope.configuration.xmlconfig import XMLConfigNEWLINE import zope.componentNEWLINE from zope.component.testing import setUpNEWLINE from zope.component.testing import tearDownNEWLINE tearDown()NEWLINE setUp()NEWLINE XMLConfig('meta.zcml', zope.component)()NEWLINE |
"""NEWLINE OpenVINO DL WorkbenchNEWLINE Dataset annotator moduleNEWLINENEWLINE Copyright (c) 2021 Intel CorporationNEWLINENEWLINE Licensed under the Apache License, Version 2.0 (the "License");NEWLINE you may not use this file except in compliance with the License.NEWLINE You may obtain a copy of the License atNEWLINE http://www.apache.org/licenses/LICENSE-2.0NEWLINE Unless required by applicable law or agreed to in writing, softwareNEWLINE distributed under the License is distributed on an "AS IS" BASIS,NEWLINE WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.NEWLINE See the License for the specific language governing permissions andNEWLINE limitations under the License.NEWLINE"""NEWLINEfrom wb.main.scripts.dataset_annotator.dataset_annotator import DatasetAnnotatorNEWLINEfrom wb.main.scripts.dataset_annotator.task_to_auto_annotated_dataset_type_mapper import \NEWLINE TaskToAutoAnnotatedDatasetTypeMapperNEWLINE |
# Copyright 2020 The TensorFlow Authors. All Rights Reserved.NEWLINE#NEWLINE# Licensed under the Apache License, Version 2.0 (the "License");NEWLINE# you may not use this file except in compliance with the License.NEWLINE# You may obtain a copy of the License atNEWLINE#NEWLINE# http://www.apache.org/licenses/LICENSE-2.0NEWLINE#NEWLINE# Unless required by applicable law or agreed to in writing, softwareNEWLINE# distributed under the License is distributed on an "AS IS" BASIS,NEWLINE# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.NEWLINE# See the License for the specific language governing permissions andNEWLINE# limitations under the License.NEWLINE# ==============================================================================NEWLINE"""Tests for Keras text category_encoding preprocessing layer."""NEWLINENEWLINEfrom __future__ import absolute_importNEWLINEfrom __future__ import divisionNEWLINEfrom __future__ import print_functionNEWLINENEWLINENEWLINEfrom absl.testing import parameterizedNEWLINEimport numpy as npNEWLINENEWLINEfrom tensorflow.python import kerasNEWLINENEWLINEfrom tensorflow.python.data.ops import dataset_opsNEWLINEfrom tensorflow.python.eager import contextNEWLINEfrom tensorflow.python.framework import constant_opNEWLINEfrom tensorflow.python.framework import dtypesNEWLINEfrom tensorflow.python.framework import errorsNEWLINEfrom tensorflow.python.framework import sparse_tensorNEWLINEfrom tensorflow.python.keras import backendNEWLINEfrom tensorflow.python.keras import keras_parameterizedNEWLINEfrom tensorflow.python.keras.layers import coreNEWLINEfrom tensorflow.python.keras.layers.preprocessing import category_encodingNEWLINEfrom tensorflow.python.keras.layers.preprocessing import category_encoding_v1NEWLINEfrom tensorflow.python.keras.layers.preprocessing import preprocessing_test_utilsNEWLINEfrom tensorflow.python.ops import sparse_opsNEWLINEfrom tensorflow.python.ops.ragged import ragged_factory_opsNEWLINEfrom tensorflow.python.platform import testNEWLINENEWLINENEWLINEdef get_layer_class():NEWLINE if context.executing_eagerly():NEWLINE return category_encoding.CategoryEncodingNEWLINE else:NEWLINE return category_encoding_v1.CategoryEncodingNEWLINENEWLINENEWLINE@keras_parameterized.run_all_keras_modes(always_skip_v1=True)NEWLINEclass CategoryEncodingInputTest(keras_parameterized.TestCase,NEWLINE preprocessing_test_utils.PreprocessingLayerTestNEWLINE ):NEWLINENEWLINE def test_dense_input_sparse_output(self):NEWLINE input_array = constant_op.constant([[1, 2, 3], [3, 3, 0]])NEWLINENEWLINE # The expected output should be (X for missing value):NEWLINE # [[X, 1, 1, 1]NEWLINE # [1, X, X, X]NEWLINE # [X, X, X, 2]]NEWLINE expected_indices = [[0, 1], [0, 2], [0, 3], [1, 0], [1, 3]]NEWLINE expected_values = [1, 1, 1, 1, 2]NEWLINE max_tokens = 6NEWLINENEWLINE input_data = keras.Input(shape=(None,), dtype=dtypes.int32)NEWLINE layer = get_layer_class()(NEWLINE max_tokens=max_tokens, output_mode=category_encoding.COUNT, sparse=True)NEWLINE int_data = layer(input_data)NEWLINENEWLINE model = keras.Model(inputs=input_data, outputs=int_data)NEWLINE sp_output_dataset = model.predict(input_array, steps=1)NEWLINE self.assertAllEqual(expected_values, sp_output_dataset.values)NEWLINE self.assertAllEqual(expected_indices, sp_output_dataset.indices)NEWLINENEWLINE # Assert sparse output is same as dense output.NEWLINE layer = get_layer_class()(NEWLINE max_tokens=max_tokens,NEWLINE output_mode=category_encoding.COUNT,NEWLINE sparse=False)NEWLINE int_data = layer(input_data)NEWLINE model = keras.Model(inputs=input_data, outputs=int_data)NEWLINE output_dataset = model.predict(input_array, steps=1)NEWLINE self.assertAllEqual(NEWLINE sparse_ops.sparse_tensor_to_dense(sp_output_dataset, default_value=0),NEWLINE output_dataset)NEWLINENEWLINE def test_sparse_input(self):NEWLINE input_array = np.array([[1, 2, 3, 0], [0, 3, 1, 0]], dtype=np.int64)NEWLINE sparse_tensor_data = sparse_ops.from_dense(input_array)NEWLINENEWLINE # pyformat: disableNEWLINE expected_output = [[0, 1, 1, 1, 0, 0],NEWLINE [0, 1, 0, 1, 0, 0]]NEWLINE # pyformat: enableNEWLINE max_tokens = 6NEWLINE expected_output_shape = [None, max_tokens]NEWLINENEWLINE input_data = keras.Input(shape=(None,), dtype=dtypes.int64, sparse=True)NEWLINENEWLINE layer = get_layer_class()(NEWLINE max_tokens=max_tokens, output_mode=category_encoding.BINARY)NEWLINE int_data = layer(input_data)NEWLINE self.assertAllEqual(expected_output_shape, int_data.shape.as_list())NEWLINENEWLINE model = keras.Model(inputs=input_data, outputs=int_data)NEWLINE output_dataset = model.predict(sparse_tensor_data, steps=1)NEWLINE self.assertAllEqual(expected_output, output_dataset)NEWLINENEWLINE def test_sparse_input_with_weights(self):NEWLINE input_array = np.array([[1, 2, 3, 4], [4, 3, 1, 4]], dtype=np.int64)NEWLINE weights_array = np.array([[.1, .2, .3, .4], [.2, .1, .4, .3]])NEWLINE sparse_tensor_data = sparse_ops.from_dense(input_array)NEWLINE sparse_weight_data = sparse_ops.from_dense(weights_array)NEWLINENEWLINE # pyformat: disableNEWLINE expected_output = [[0, .1, .2, .3, .4, 0],NEWLINE [0, .4, 0, .1, .5, 0]]NEWLINE # pyformat: enableNEWLINE max_tokens = 6NEWLINE expected_output_shape = [None, max_tokens]NEWLINENEWLINE input_data = keras.Input(shape=(None,), dtype=dtypes.int64, sparse=True)NEWLINE weight_data = keras.Input(shape=(None,), dtype=dtypes.float32, sparse=True)NEWLINENEWLINE layer = get_layer_class()(NEWLINE max_tokens=max_tokens, output_mode=category_encoding.COUNT)NEWLINE int_data = layer(input_data, count_weights=weight_data)NEWLINE self.assertAllEqual(expected_output_shape, int_data.shape.as_list())NEWLINENEWLINE model = keras.Model(inputs=[input_data, weight_data], outputs=int_data)NEWLINE output_dataset = model.predict([sparse_tensor_data, sparse_weight_data],NEWLINE steps=1)NEWLINE self.assertAllClose(expected_output, output_dataset)NEWLINENEWLINE def test_sparse_input_sparse_output(self):NEWLINE sp_inp = sparse_tensor.SparseTensor(NEWLINE indices=[[0, 0], [1, 1], [2, 0], [2, 1], [3, 1]],NEWLINE values=[0, 2, 1, 1, 0],NEWLINE dense_shape=[4, 2])NEWLINE input_data = keras.Input(shape=(None,), dtype=dtypes.int64, sparse=True)NEWLINENEWLINE # The expected output should be (X for missing value):NEWLINE # [[1, X, X, X]NEWLINE # [X, X, 1, X]NEWLINE # [X, 2, X, X]NEWLINE # [1, X, X, X]]NEWLINE expected_indices = [[0, 0], [1, 2], [2, 1], [3, 0]]NEWLINE expected_values = [1, 1, 2, 1]NEWLINE max_tokens = 6NEWLINENEWLINE layer = get_layer_class()(NEWLINE max_tokens=max_tokens, output_mode=category_encoding.COUNT, sparse=True)NEWLINE int_data = layer(input_data)NEWLINENEWLINE model = keras.Model(inputs=input_data, outputs=int_data)NEWLINE sp_output_dataset = model.predict(sp_inp, steps=1)NEWLINE self.assertAllEqual(expected_values, sp_output_dataset.values)NEWLINE self.assertAllEqual(expected_indices, sp_output_dataset.indices)NEWLINENEWLINE # Assert sparse output is same as dense output.NEWLINE layer = get_layer_class()(NEWLINE max_tokens=max_tokens,NEWLINE output_mode=category_encoding.COUNT,NEWLINE sparse=False)NEWLINE int_data = layer(input_data)NEWLINE model = keras.Model(inputs=input_data, outputs=int_data)NEWLINE output_dataset = model.predict(sp_inp, steps=1)NEWLINE self.assertAllEqual(NEWLINE sparse_ops.sparse_tensor_to_dense(sp_output_dataset, default_value=0),NEWLINE output_dataset)NEWLINENEWLINE def test_sparse_input_sparse_output_with_weights(self):NEWLINE indices = [[0, 0], [1, 1], [2, 0], [2, 1], [3, 1]]NEWLINE sp_inp = sparse_tensor.SparseTensor(NEWLINE indices=indices, values=[0, 2, 1, 1, 0], dense_shape=[4, 2])NEWLINE input_data = keras.Input(shape=(None,), dtype=dtypes.int64, sparse=True)NEWLINE sp_weight = sparse_tensor.SparseTensor(NEWLINE indices=indices, values=[.1, .2, .4, .3, .2], dense_shape=[4, 2])NEWLINE weight_data = keras.Input(shape=(None,), dtype=dtypes.float32, sparse=True)NEWLINENEWLINE # The expected output should be (X for missing value):NEWLINE # [[1, X, X, X]NEWLINE # [X, X, 1, X]NEWLINE # [X, 2, X, X]NEWLINE # [1, X, X, X]]NEWLINE expected_indices = [[0, 0], [1, 2], [2, 1], [3, 0]]NEWLINE expected_values = [.1, .2, .7, .2]NEWLINE max_tokens = 6NEWLINENEWLINE layer = get_layer_class()(NEWLINE max_tokens=max_tokens, output_mode=category_encoding.COUNT, sparse=True)NEWLINE int_data = layer(input_data, count_weights=weight_data)NEWLINENEWLINE model = keras.Model(inputs=[input_data, weight_data], outputs=int_data)NEWLINE sp_output_dataset = model.predict([sp_inp, sp_weight], steps=1)NEWLINE self.assertAllClose(expected_values, sp_output_dataset.values)NEWLINE self.assertAllEqual(expected_indices, sp_output_dataset.indices)NEWLINENEWLINE def test_ragged_input(self):NEWLINE input_array = ragged_factory_ops.constant([[1, 2, 3], [3, 1]])NEWLINENEWLINE # pyformat: disableNEWLINE expected_output = [[0, 1, 1, 1, 0, 0],NEWLINE [0, 1, 0, 1, 0, 0]]NEWLINE # pyformat: enableNEWLINE max_tokens = 6NEWLINE expected_output_shape = [None, max_tokens]NEWLINENEWLINE input_data = keras.Input(shape=(None,), dtype=dtypes.int32, ragged=True)NEWLINENEWLINE layer = get_layer_class()(NEWLINE max_tokens=max_tokens, output_mode=category_encoding.BINARY)NEWLINE int_data = layer(input_data)NEWLINENEWLINE self.assertAllEqual(expected_output_shape, int_data.shape.as_list())NEWLINENEWLINE model = keras.Model(inputs=input_data, outputs=int_data)NEWLINE output_dataset = model.predict(input_array, steps=1)NEWLINE self.assertAllEqual(expected_output, output_dataset)NEWLINENEWLINE def test_ragged_input_sparse_output(self):NEWLINE input_array = ragged_factory_ops.constant([[1, 2, 3], [3, 3]])NEWLINENEWLINE # The expected output should be (X for missing value):NEWLINE # [[X, 1, 1, 1]NEWLINE # [X, X, X, 2]]NEWLINE expected_indices = [[0, 1], [0, 2], [0, 3], [1, 3]]NEWLINE expected_values = [1, 1, 1, 2]NEWLINE max_tokens = 6NEWLINENEWLINE input_data = keras.Input(shape=(None,), dtype=dtypes.int32, ragged=True)NEWLINE layer = get_layer_class()(NEWLINE max_tokens=max_tokens, output_mode=category_encoding.COUNT, sparse=True)NEWLINE int_data = layer(input_data)NEWLINENEWLINE model = keras.Model(inputs=input_data, outputs=int_data)NEWLINE sp_output_dataset = model.predict(input_array, steps=1)NEWLINE self.assertAllEqual(expected_values, sp_output_dataset.values)NEWLINE self.assertAllEqual(expected_indices, sp_output_dataset.indices)NEWLINENEWLINE # Assert sparse output is same as dense output.NEWLINE layer = get_layer_class()(NEWLINE max_tokens=max_tokens,NEWLINE output_mode=category_encoding.COUNT,NEWLINE sparse=False)NEWLINE int_data = layer(input_data)NEWLINE model = keras.Model(inputs=input_data, outputs=int_data)NEWLINE output_dataset = model.predict(input_array, steps=1)NEWLINE self.assertAllEqual(NEWLINE sparse_ops.sparse_tensor_to_dense(sp_output_dataset, default_value=0),NEWLINE output_dataset)NEWLINENEWLINE def test_sparse_output_and_dense_layer(self):NEWLINE input_array = constant_op.constant([[1, 2, 3], [3, 3, 0]])NEWLINENEWLINE max_tokens = 4NEWLINENEWLINE input_data = keras.Input(shape=(None,), dtype=dtypes.int32)NEWLINE encoding_layer = get_layer_class()(NEWLINE max_tokens=max_tokens, output_mode=category_encoding.COUNT,NEWLINE sparse=True)NEWLINE int_data = encoding_layer(input_data)NEWLINE dense_layer = keras.layers.Dense(units=1)NEWLINE output_data = dense_layer(int_data)NEWLINENEWLINE model = keras.Model(inputs=input_data, outputs=output_data)NEWLINE _ = model.predict(input_array, steps=1)NEWLINENEWLINE def test_dense_oov_input(self):NEWLINE input_array = constant_op.constant([[1, 2, 3], [4, 3, 4]])NEWLINE max_tokens = 3NEWLINE expected_output_shape = [None, max_tokens]NEWLINE encoder_layer = get_layer_class()(max_tokens)NEWLINE input_data = keras.Input(shape=(3,), dtype=dtypes.int32)NEWLINE int_data = encoder_layer(input_data)NEWLINE self.assertAllEqual(expected_output_shape, int_data.shape.as_list())NEWLINE model = keras.Model(inputs=input_data, outputs=int_data)NEWLINE with self.assertRaisesRegex(errors.InvalidArgumentError,NEWLINE ".*must be less than max_token 3"):NEWLINE _ = model.predict(input_array, steps=1)NEWLINENEWLINENEWLINE@keras_parameterized.run_all_keras_modesNEWLINEclass CategoryEncodingAdaptTest(keras_parameterized.TestCase,NEWLINE preprocessing_test_utils.PreprocessingLayerTestNEWLINE ):NEWLINENEWLINE def test_sparse_adapt(self):NEWLINE vocab_data = sparse_ops.from_dense(NEWLINE np.array([[1, 1, 0, 1, 1, 2, 2, 0, 2, 3, 3, 0, 4]], dtype=np.int64))NEWLINE vocab_dataset = dataset_ops.Dataset.from_tensors(vocab_data)NEWLINE input_array = sparse_ops.from_dense(NEWLINE np.array([[1, 2, 3, 0], [0, 3, 1, 0]], dtype=np.int64))NEWLINENEWLINE # pyformat: disableNEWLINE expected_output = [[0, 1, 1, 1, 0],NEWLINE [0, 1, 0, 1, 0]]NEWLINE # pyformat: enableNEWLINE max_tokens = 5NEWLINE expected_output_shape = [None, max_tokens]NEWLINENEWLINE input_data = keras.Input(shape=(None,), dtype=dtypes.int64, sparse=True)NEWLINE layer = get_layer_class()(NEWLINE max_tokens=None, output_mode=category_encoding.BINARY)NEWLINE layer.adapt(vocab_dataset)NEWLINE int_data = layer(input_data)NEWLINE self.assertAllEqual(expected_output_shape, int_data.shape.as_list())NEWLINENEWLINE model = keras.Model(inputs=input_data, outputs=int_data)NEWLINE output_dataset = model.predict(input_array, steps=1)NEWLINE self.assertAllEqual(expected_output, output_dataset)NEWLINENEWLINE def test_ragged_adapt(self):NEWLINE vocab_data = ragged_factory_ops.constant(NEWLINE np.array([[1, 1, 0, 1, 1], [2, 2], [0, 2, 3], [0, 4]]))NEWLINE vocab_dataset = dataset_ops.Dataset.from_tensors(vocab_data)NEWLINE input_array = ragged_factory_ops.constant([[1, 2, 3], [3, 1]])NEWLINENEWLINE # pyformat: disableNEWLINE expected_output = [[0, 1, 1, 1, 0],NEWLINE [0, 1, 0, 1, 0]]NEWLINE # pyformat: enableNEWLINE max_tokens = 5NEWLINE expected_output_shape = [None, max_tokens]NEWLINENEWLINE input_data = keras.Input(shape=(None,), dtype=dtypes.int32, ragged=True)NEWLINENEWLINE layer = get_layer_class()(NEWLINE max_tokens=None, output_mode=category_encoding.BINARY)NEWLINE layer.adapt(vocab_dataset)NEWLINE int_data = layer(input_data)NEWLINENEWLINE self.assertAllEqual(expected_output_shape, int_data.shape.as_list())NEWLINENEWLINE model = keras.Model(inputs=input_data, outputs=int_data)NEWLINE output_dataset = model.predict(input_array, steps=1)NEWLINE self.assertAllEqual(expected_output, output_dataset)NEWLINENEWLINE def test_hard_maximum_set_state_variables_after_build(self):NEWLINE state_variables = {category_encoding._NUM_ELEMENTS_NAME: 5}NEWLINE input_array = np.array([[1, 2, 3, 1], [0, 3, 1, 0]])NEWLINENEWLINE # pyformat: disableNEWLINE expected_output = [[0, 1, 1, 1, 0],NEWLINE [1, 1, 0, 1, 0]]NEWLINE # pyformat: enableNEWLINE max_tokens = 5NEWLINE expected_output_shape = [None, max_tokens]NEWLINENEWLINE input_data = keras.Input(shape=(None,), dtype=dtypes.int32)NEWLINE layer = get_layer_class()(NEWLINE max_tokens=max_tokens, output_mode=category_encoding.BINARY)NEWLINE int_data = layer(input_data)NEWLINE layer._set_state_variables(state_variables)NEWLINE self.assertAllEqual(expected_output_shape, int_data.shape.as_list())NEWLINENEWLINE model = keras.Model(inputs=input_data, outputs=int_data)NEWLINE output_dataset = model.predict(input_array)NEWLINE self.assertAllEqual(expected_output, output_dataset)NEWLINENEWLINE def test_soft_maximum_set_state_after_build(self):NEWLINE input_array = np.array([[1, 2, 3, 1], [0, 3, 1, 0]])NEWLINENEWLINE # pyformat: disableNEWLINE expected_output = [[0, 1, 1, 1, 0],NEWLINE [1, 1, 0, 1, 0]]NEWLINE # pyformat: enableNEWLINE max_tokens = 5NEWLINE expected_output_shape = [None, max_tokens]NEWLINENEWLINE input_data = keras.Input(shape=(None,), dtype=dtypes.int32)NEWLINE layer = get_layer_class()(NEWLINE max_tokens=None, output_mode=category_encoding.BINARY)NEWLINE layer.build(input_data.shape)NEWLINE layer.set_num_elements(max_tokens)NEWLINE int_data = layer(input_data)NEWLINE self.assertAllEqual(expected_output_shape, int_data.shape.as_list())NEWLINENEWLINE model = keras.Model(inputs=input_data, outputs=int_data)NEWLINE output_dataset = model.predict(input_array)NEWLINE self.assertAllEqual(expected_output, output_dataset)NEWLINENEWLINE def test_set_weights_fails_on_wrong_size_weights(self):NEWLINE tfidf_data = [.05, .5, .25, .2, .125]NEWLINE layer = get_layer_class()(max_tokens=6, output_mode=category_encoding.TFIDF)NEWLINENEWLINE with self.assertRaisesRegex(ValueError, ".*Layer weight shape.*"):NEWLINE layer.set_weights([np.array(tfidf_data)])NEWLINENEWLINE def test_set_num_elements_after_call_fails(self):NEWLINE input_data = keras.Input(shape=(None,), dtype=dtypes.int32)NEWLINE layer = get_layer_class()(NEWLINE max_tokens=None, output_mode=category_encoding.BINARY)NEWLINE layer.adapt([1, 2])NEWLINE _ = layer(input_data)NEWLINE with self.assertRaisesRegex(NEWLINE RuntimeError, ".*'max_tokens' arg must be set to None."):NEWLINE layer.set_num_elements(5)NEWLINENEWLINE def test_set_state_variables_after_call_fails(self):NEWLINE state_variables = {category_encoding._NUM_ELEMENTS_NAME: 5}NEWLINENEWLINE input_data = keras.Input(shape=(None,), dtype=dtypes.int32)NEWLINE layer = get_layer_class()(NEWLINE max_tokens=None, output_mode=category_encoding.BINARY)NEWLINE layer.adapt([1, 2])NEWLINE _ = layer(input_data)NEWLINE with self.assertRaisesRegex(RuntimeError, "Cannot update states.*"):NEWLINE layer._set_state_variables(state_variables)NEWLINENEWLINENEWLINE@keras_parameterized.run_all_keras_modesNEWLINE@keras_parameterized.run_all_keras_modesNEWLINEclass CategoryEncodingOutputTest(keras_parameterized.TestCase,NEWLINE preprocessing_test_utils.PreprocessingLayerTestNEWLINE ):NEWLINENEWLINE def test_binary_output_hard_maximum(self):NEWLINE input_array = np.array([[1, 2, 3, 1], [0, 3, 1, 0]])NEWLINENEWLINE # pyformat: disableNEWLINE expected_output = [[0, 1, 1, 1, 0, 0],NEWLINE [1, 1, 0, 1, 0, 0]]NEWLINE # pyformat: enableNEWLINE max_tokens = 6NEWLINE expected_output_shape = [None, max_tokens]NEWLINENEWLINE input_data = keras.Input(shape=(None,), dtype=dtypes.int32)NEWLINE layer = get_layer_class()(NEWLINE max_tokens=max_tokens, output_mode=category_encoding.BINARY)NEWLINE int_data = layer(input_data)NEWLINE self.assertAllEqual(expected_output_shape, int_data.shape.as_list())NEWLINENEWLINE model = keras.Model(inputs=input_data, outputs=int_data)NEWLINE output_dataset = model.predict(input_array)NEWLINE self.assertAllEqual(expected_output, output_dataset)NEWLINENEWLINE def test_binary_output_soft_maximum(self):NEWLINE input_array = np.array([[1, 2, 3, 1], [0, 3, 1, 0]])NEWLINENEWLINE # pyformat: disableNEWLINE expected_output = [[0, 1, 1, 1, 0],NEWLINE [1, 1, 0, 1, 0]]NEWLINE # pyformat: enableNEWLINE max_tokens = 5NEWLINE expected_output_shape = [None, max_tokens]NEWLINENEWLINE input_data = keras.Input(shape=(None,), dtype=dtypes.int32)NEWLINE layer = get_layer_class()(NEWLINE max_tokens=None, output_mode=category_encoding.BINARY)NEWLINE layer.set_num_elements(max_tokens)NEWLINE int_data = layer(input_data)NEWLINE self.assertAllEqual(expected_output_shape, int_data.shape.as_list())NEWLINENEWLINE model = keras.Model(inputs=input_data, outputs=int_data)NEWLINE output_dataset = model.predict(input_array)NEWLINE self.assertAllEqual(expected_output, output_dataset)NEWLINENEWLINE def test_count_output_hard_maximum(self):NEWLINE input_array = np.array([[1, 2, 3, 1], [0, 3, 1, 0]])NEWLINENEWLINE # pyformat: disableNEWLINE expected_output = [[0, 2, 1, 1, 0, 0],NEWLINE [2, 1, 0, 1, 0, 0]]NEWLINE # pyformat: enableNEWLINE max_tokens = 6NEWLINE expected_output_shape = [None, max_tokens]NEWLINENEWLINE input_data = keras.Input(shape=(None,), dtype=dtypes.int32)NEWLINE layer = get_layer_class()(max_tokens=6, output_mode=category_encoding.COUNT)NEWLINE int_data = layer(input_data)NEWLINE self.assertAllEqual(expected_output_shape, int_data.shape.as_list())NEWLINENEWLINE model = keras.Model(inputs=input_data, outputs=int_data)NEWLINE output_dataset = model.predict(input_array)NEWLINE self.assertAllEqual(expected_output, output_dataset)NEWLINENEWLINE def test_count_output_soft_maximum(self):NEWLINE input_array = np.array([[1, 2, 3, 1], [0, 3, 1, 0]])NEWLINENEWLINE # pyformat: disableNEWLINE expected_output = [[0, 2, 1, 1, 0],NEWLINE [2, 1, 0, 1, 0]]NEWLINE # pyformat: enableNEWLINE max_tokens = 5NEWLINE expected_output_shape = [None, max_tokens]NEWLINENEWLINE input_data = keras.Input(shape=(None,), dtype=dtypes.int32)NEWLINE layer = get_layer_class()(NEWLINE max_tokens=None, output_mode=category_encoding.COUNT)NEWLINE layer.set_num_elements(max_tokens)NEWLINE int_data = layer(input_data)NEWLINE self.assertAllEqual(expected_output_shape, int_data.shape.as_list())NEWLINENEWLINE model = keras.Model(inputs=input_data, outputs=int_data)NEWLINE output_dataset = model.predict(input_array)NEWLINE self.assertAllEqual(expected_output, output_dataset)NEWLINENEWLINE def test_tfidf_output_hard_maximum(self):NEWLINE tfidf_data = [.05, .5, .25, .2, .125]NEWLINE input_array = np.array([[1, 2, 3, 1], [0, 4, 1, 0]])NEWLINENEWLINE # pyformat: disableNEWLINE # pylint: disable=bad-whitespaceNEWLINE expected_output = [[ 0, 1, .25, .2, 0, 0],NEWLINE [.1, .5, 0, 0, .125, 0]]NEWLINE # pylint: enable=bad-whitespaceNEWLINE # pyformat: enableNEWLINE max_tokens = 6NEWLINE expected_output_shape = [None, max_tokens]NEWLINENEWLINE input_data = keras.Input(shape=(None,), dtype=dtypes.int32)NEWLINE layer = get_layer_class()(max_tokens=6, output_mode=category_encoding.TFIDF)NEWLINE layer.set_tfidf_data(tfidf_data)NEWLINE int_data = layer(input_data)NEWLINE self.assertAllEqual(expected_output_shape, int_data.shape.as_list())NEWLINENEWLINE model = keras.Model(inputs=input_data, outputs=int_data)NEWLINE output_dataset = model.predict(input_array)NEWLINE self.assertAllClose(expected_output, output_dataset)NEWLINENEWLINE def test_tfidf_output_soft_maximum(self):NEWLINE tfidf_data = [.05, .5, .25, .2, .125]NEWLINE input_array = np.array([[1, 2, 3, 1], [0, 4, 1, 0]])NEWLINENEWLINE # pyformat: disableNEWLINE # pylint: disable=bad-whitespaceNEWLINE expected_output = [[ 0, 1, .25, .2, 0],NEWLINE [.1, .5, 0, 0, .125]]NEWLINE # pylint: enable=bad-whitespaceNEWLINE # pyformat: enableNEWLINE max_tokens = 5NEWLINE expected_output_shape = [None, max_tokens]NEWLINENEWLINE input_data = keras.Input(shape=(None,), dtype=dtypes.int32)NEWLINE layer = get_layer_class()(NEWLINE max_tokens=None, output_mode=category_encoding.TFIDF)NEWLINE layer.set_num_elements(max_tokens)NEWLINE layer.set_tfidf_data(tfidf_data)NEWLINE int_data = layer(input_data)NEWLINE self.assertAllEqual(expected_output_shape, int_data.shape.as_list())NEWLINENEWLINE model = keras.Model(inputs=input_data, outputs=int_data)NEWLINE output_dataset = model.predict(input_array)NEWLINE self.assertAllClose(expected_output, output_dataset)NEWLINENEWLINENEWLINEclass CategoryEncodingModelBuildingTest(NEWLINE keras_parameterized.TestCase,NEWLINE preprocessing_test_utils.PreprocessingLayerTest):NEWLINENEWLINE @parameterized.named_parameters(NEWLINE {NEWLINE "testcase_name": "count_hard_max",NEWLINE "max_tokens": 5,NEWLINE "output_mode": category_encoding.COUNTNEWLINE }, {NEWLINE "testcase_name": "count_soft_max",NEWLINE "max_tokens": None,NEWLINE "output_mode": category_encoding.COUNTNEWLINE }, {NEWLINE "testcase_name": "binary_hard_max",NEWLINE "max_tokens": 5,NEWLINE "output_mode": category_encoding.BINARYNEWLINE }, {NEWLINE "testcase_name": "binary_soft_max",NEWLINE "max_tokens": None,NEWLINE "output_mode": category_encoding.BINARYNEWLINE }, {NEWLINE "testcase_name": "tfidf_hard_max",NEWLINE "max_tokens": 5,NEWLINE "output_mode": category_encoding.TFIDFNEWLINE }, {NEWLINE "testcase_name": "tfidf_soft_max",NEWLINE "max_tokens": None,NEWLINE "output_mode": category_encoding.TFIDFNEWLINE })NEWLINE def test_end_to_end_bagged_modeling(self, output_mode, max_tokens):NEWLINE tfidf_data = np.array([.03, .5, .25, .2, .125])NEWLINE input_array = np.array([[1, 2, 3, 1], [0, 3, 1, 0]])NEWLINENEWLINE input_data = keras.Input(shape=(None,), dtype=dtypes.int32)NEWLINE layer = get_layer_class()(max_tokens=max_tokens, output_mode=output_mode)NEWLINENEWLINE weights = []NEWLINE if max_tokens is None:NEWLINE layer.set_num_elements(5)NEWLINE if output_mode == category_encoding.TFIDF:NEWLINE weights.append(tfidf_data)NEWLINENEWLINE layer.set_weights(weights)NEWLINENEWLINE int_data = layer(input_data)NEWLINE float_data = backend.cast(int_data, dtype="float32")NEWLINE output_data = core.Dense(64)(float_data)NEWLINE model = keras.Model(inputs=input_data, outputs=output_data)NEWLINE _ = model.predict(input_array)NEWLINENEWLINENEWLINE@keras_parameterized.run_all_keras_modesNEWLINEclass CategoryEncodingCombinerTest(NEWLINE keras_parameterized.TestCase,NEWLINE preprocessing_test_utils.PreprocessingLayerTest):NEWLINENEWLINE def compare_idf_accumulators(self, a, b, msg=None):NEWLINE if a is None or b is None:NEWLINE self.assertAllEqual(a, b, msg=msg)NEWLINENEWLINE self.assertAllEqual(a.data, b.data, msg=msg)NEWLINENEWLINE if a.per_doc_count_dict is not None:NEWLINENEWLINE def per_doc_counts(accumulator):NEWLINE count_values = [NEWLINE count_dict["count"]NEWLINE for count_dict in accumulator.per_doc_count_dict.values()NEWLINE ]NEWLINE return dict(zip(accumulator.per_doc_count_dict.keys(), count_values))NEWLINENEWLINE self.assertAllEqual(per_doc_counts(a), per_doc_counts(b), msg=msg)NEWLINENEWLINE compare_accumulators = compare_idf_accumulatorsNEWLINENEWLINE def update_accumulator(self, accumulator, data):NEWLINE accumulator.data[1] = data["num_documents"]NEWLINE accumulator.data[0] = data["max_element"]NEWLINENEWLINE if "document_counts" in data:NEWLINE create_dict = lambda x: {"count": x, "last_doc_id": -1}NEWLINE idf_dict = {}NEWLINE for i, count in enumerate(data["document_counts"]):NEWLINE if count > 0:NEWLINE idf_dict[i] = create_dict(count)NEWLINENEWLINE accumulator.per_doc_count_dict.update(idf_dict)NEWLINENEWLINE return accumulatorNEWLINENEWLINE def test_combiner_api_compatibility_int_mode(self):NEWLINE data = np.array([[1, 2, 3, 4], [1, 2, 3, 0]])NEWLINE combiner = category_encoding._CategoryEncodingCombiner(compute_idf=False)NEWLINE expected_accumulator_output = {NEWLINE "max_element": np.array(4),NEWLINE "num_documents": np.array(2),NEWLINE }NEWLINE expected_extract_output = {NEWLINE "num_elements": np.array(5),NEWLINE }NEWLINE expected_accumulator = combiner._create_accumulator()NEWLINE expected_accumulator = self.update_accumulator(expected_accumulator,NEWLINE expected_accumulator_output)NEWLINE self.validate_accumulator_serialize_and_deserialize(combiner, data,NEWLINE expected_accumulator)NEWLINE self.validate_accumulator_uniqueness(combiner, data)NEWLINE self.validate_accumulator_extract(combiner, data, expected_extract_output)NEWLINENEWLINE def test_combiner_api_compatibility_tfidf_mode(self):NEWLINE data = np.array([[1, 2, 3, 4], [1, 2, 3, 0]])NEWLINE combiner = category_encoding._CategoryEncodingCombiner(compute_idf=True)NEWLINE expected_accumulator_output = {NEWLINE "max_element": np.array(4),NEWLINE "document_counts": np.array([1, 2, 2, 2, 1]),NEWLINE "num_documents": np.array(2),NEWLINE }NEWLINE expected_extract_output = {NEWLINE "num_elements": np.array(5),NEWLINE "idf": np.array([0.693147, 0.510826, 0.510826, 0.510826, 0.693147]),NEWLINE }NEWLINENEWLINE expected_accumulator = combiner._create_accumulator()NEWLINE expected_accumulator = self.update_accumulator(expected_accumulator,NEWLINE expected_accumulator_output)NEWLINE self.validate_accumulator_serialize_and_deserialize(combiner, data,NEWLINE expected_accumulator)NEWLINE self.validate_accumulator_uniqueness(combiner, data)NEWLINE self.validate_accumulator_extract(combiner, data, expected_extract_output)NEWLINENEWLINE # TODO(askerryryan): Add tests confirming equivalence to behavior ofNEWLINE # existing tf.keras.preprocessing.text.Tokenizer.NEWLINE @parameterized.named_parameters(NEWLINE {NEWLINE "testcase_name": "no_top_k",NEWLINE "data": np.array([[1, 2], [4, 2], [3], [4, 2]]),NEWLINE "expected_accumulator_output": {NEWLINE "max_element": np.array(4),NEWLINE "document_counts": np.array([0, 1, 3, 1, 2]),NEWLINE "num_documents": np.array(4),NEWLINE },NEWLINE "expected_extract_output": {NEWLINE "num_elements":NEWLINE np.array(5),NEWLINE "idf":NEWLINE np.array([1.609438, 1.098612, 0.693147, 1.098612, 0.847298]),NEWLINE },NEWLINE }, {NEWLINE "testcase_name": "single_element_per_row",NEWLINE "data": np.array([[1], [2], [4], [2], [3]]),NEWLINE "expected_accumulator_output": {NEWLINE "max_element": np.array(4),NEWLINE "document_counts": np.array([0, 1, 2, 1, 1]),NEWLINE "num_documents": np.array(5),NEWLINE },NEWLINE "expected_extract_output": {NEWLINE "num_elements":NEWLINE np.array(5),NEWLINE "idf":NEWLINE np.array([1.791759, 1.252763, 0.980829, 1.252763, 1.252763]),NEWLINE },NEWLINE })NEWLINE def test_combiner_computation(self,NEWLINE data,NEWLINE expected_accumulator_output,NEWLINE expected_extract_output,NEWLINE compute_idf=True):NEWLINE combiner = category_encoding._CategoryEncodingCombiner(NEWLINE compute_idf=compute_idf)NEWLINE expected_accumulator = combiner._create_accumulator()NEWLINE expected_accumulator = self.update_accumulator(expected_accumulator,NEWLINE expected_accumulator_output)NEWLINE self.validate_accumulator_computation(combiner, data, expected_accumulator)NEWLINE self.validate_accumulator_extract(combiner, data, expected_extract_output)NEWLINENEWLINE def test_1d_data(self):NEWLINE data = [1, 2, 3]NEWLINE cls = get_layer_class()NEWLINE layer = cls()NEWLINE layer.adapt(data)NEWLINE output = layer(data)NEWLINE self.assertListEqual(output.shape.as_list(), [3, 4])NEWLINENEWLINE def test_no_adapt_exception(self):NEWLINE cls = get_layer_class()NEWLINE layer = cls()NEWLINE with self.assertRaisesRegex(NEWLINE RuntimeError, r".*you need to call.*"):NEWLINE _ = layer([1, 2, 3])NEWLINENEWLINE def test_saving_loading(self):NEWLINE encoder = category_encoding.CategoryEncoding()NEWLINE encoder.adapt([1, 2, 3])NEWLINE model = keras.Sequential([encoder])NEWLINE model.save("/tmp/model", save_format="tf")NEWLINE loaded_model = keras.models.load_model("/tmp/model")NEWLINE self.assertAllClose(model.predict([[1]]), loaded_model.predict([[1]]))NEWLINENEWLINE def test_serialize(self):NEWLINE encoder = category_encoding.CategoryEncoding()NEWLINE encoder.adapt([1, 2, 3])NEWLINE model = keras.Sequential([encoder])NEWLINE _ = keras.models.clone_model(model)NEWLINENEWLINENEWLINEif __name__ == "__main__":NEWLINE test.main()NEWLINE |
#!/usr/bin/env pythonNEWLINENEWLINE# Copyright (c) 2013 Intel Corporation. All rights reserved.NEWLINE# Use of this source code is governed by a BSD-style license that can beNEWLINE# found in the LICENSE file.NEWLINE# pylint: disable=F0401NEWLINENEWLINEimport osNEWLINEimport shutilNEWLINEimport sysNEWLINEfrom common_function import RemoveUnusedFilesInReleaseModeNEWLINENEWLINEdef Clean(dir_to_clean):NEWLINE if os.path.isdir(dir_to_clean):NEWLINE shutil.rmtree(dir_to_clean)NEWLINENEWLINENEWLINEdef PrepareFromChromium(target_dir):NEWLINE gyp_dir = os.path.join(target_dir, 'scripts', 'gyp')NEWLINE if not os.path.exists(gyp_dir):NEWLINE os.makedirs(gyp_dir)NEWLINE shutil.copytree('../build/android/gyp/util', os.path.join(gyp_dir, 'util'))NEWLINE shutil.copy('../build/android/gyp/ant.py', gyp_dir)NEWLINENEWLINENEWLINEdef PrepareFromXwalk(src_dir, target_dir):NEWLINE '''Prepare different files for app packaging tools. All resources are used byNEWLINE make_apk.py.NEWLINE '''NEWLINE # Get the dir of source code from src_dir: ../../.NEWLINE source_code_dir = os.path.dirname(os.path.dirname(src_dir))NEWLINENEWLINE # The directories for source and target .jar files.NEWLINE jar_src_dir = os.path.join(src_dir, 'lib.java')NEWLINE jar_target_dir = os.path.join(target_dir, 'libs')NEWLINENEWLINE # The directories for generated resources.NEWLINE gen_res_src_dir = os.path.join(src_dir, 'gen')NEWLINE gen_res_target_dir = os.path.join(target_dir, 'gen')NEWLINENEWLINE # The directory for source packaging tools.NEWLINE tools_src_dir = os.path.join(source_code_dir, 'xwalk/app/tools/android')NEWLINENEWLINE # The directories for source and target gyp.NEWLINE gyp_src_dir = os.path.join(tools_src_dir, 'gyp')NEWLINE gyp_target_dir = os.path.join(target_dir, 'scripts/gyp')NEWLINENEWLINE # The source file/directory list to be copied and the target directory list.NEWLINE source_target_list = [NEWLINE (os.path.join(source_code_dir, 'xwalk/VERSION'), target_dir),NEWLINENEWLINE # This jar is needed for 'javac' compile.NEWLINE (os.path.join(jar_src_dir, 'xwalk_app_runtime_java.jar'), jar_target_dir),NEWLINE (os.path.join(jar_src_dir, 'xwalk_core_embedded.dex.jar'), jar_target_dir),NEWLINENEWLINE # Native library, like libxwalkcore.so.NEWLINE (os.path.join(src_dir, 'xwalk_runtime_lib_apk/libs/x86'),NEWLINE os.path.join(target_dir, 'native_libs/x86/libs/x86')),NEWLINE (os.path.join(src_dir, 'xwalk_runtime_lib_apk/libs/armeabi-v7a'),NEWLINE os.path.join(target_dir, 'native_libs/armeabi-v7a/libs/armeabi-v7a')),NEWLINENEWLINE # Native source package(xwalk.pak) and related js files for extension.NEWLINE (os.path.join(src_dir, 'xwalk_runtime_lib/assets'),NEWLINE os.path.join(target_dir, 'native_libs_res')),NEWLINENEWLINE # Various Java resources.NEWLINE (os.path.join(source_code_dir, 'content/public/android/java/res'),NEWLINE os.path.join(target_dir, 'libs_res/content')),NEWLINE (os.path.join(source_code_dir, 'ui/android/java/res'),NEWLINE os.path.join(target_dir, 'libs_res/ui')),NEWLINE (os.path.join(source_code_dir, 'xwalk/runtime/android/java/res'),NEWLINE os.path.join(target_dir, 'libs_res/runtime')),NEWLINENEWLINE (os.path.join(gen_res_src_dir, 'ui_java/java_R'),NEWLINE os.path.join(gen_res_target_dir, 'ui_java/java_R')),NEWLINE (os.path.join(gen_res_src_dir, 'ui_java/res_crunched'),NEWLINE os.path.join(gen_res_target_dir, 'ui_java/res_crunched')),NEWLINE (os.path.join(gen_res_src_dir, 'ui_java/res_grit'),NEWLINE os.path.join(gen_res_target_dir, 'ui_java/res_grit')),NEWLINE (os.path.join(gen_res_src_dir, 'ui_java/res_v14_compatibility'),NEWLINE os.path.join(gen_res_target_dir, 'ui_java/res_v14_compatibility')),NEWLINENEWLINE (os.path.join(gen_res_src_dir, 'content_java/java_R'),NEWLINE os.path.join(gen_res_target_dir, 'content_java/java_R')),NEWLINE (os.path.join(gen_res_src_dir, 'content_java/res_crunched'),NEWLINE os.path.join(gen_res_target_dir, 'content_java/res_crunched')),NEWLINE (os.path.join(gen_res_src_dir, 'content_java/res_grit'),NEWLINE os.path.join(gen_res_target_dir, 'content_java/res_grit')),NEWLINE (os.path.join(gen_res_src_dir, 'content_java/res_v14_compatibility'),NEWLINE os.path.join(gen_res_target_dir, 'content_java/res_v14_compatibility')),NEWLINENEWLINE (os.path.join(gen_res_src_dir, 'xwalk_core_java/java_R'),NEWLINE os.path.join(gen_res_target_dir, 'xwalk_core_java/java_R')),NEWLINE (os.path.join(gen_res_src_dir, 'xwalk_core_java/res_crunched'),NEWLINE os.path.join(gen_res_target_dir, 'xwalk_core_java/res_crunched')),NEWLINE (os.path.join(gen_res_src_dir, 'xwalk_core_java/res_grit'),NEWLINE os.path.join(gen_res_target_dir, 'xwalk_core_java/res_grit')),NEWLINE (os.path.join(gen_res_src_dir, 'xwalk_core_java/res_v14_compatibility'),NEWLINE os.path.join(gen_res_target_dir, 'xwalk_core_java/res_v14_compatibility')),NEWLINENEWLINE # The app wrapper code. It's the template Java code.NEWLINE (os.path.join(source_code_dir, 'xwalk/app/android/app_template'),NEWLINE os.path.join(target_dir, 'app_src')),NEWLINENEWLINE # Copy below 5 files to overwrite the existing ones from Chromium.NEWLINE (os.path.join(gyp_src_dir, 'util/build_utils.py'),NEWLINE os.path.join(gyp_target_dir, 'util')),NEWLINE (os.path.join(gyp_src_dir, 'dex.py'), gyp_target_dir),NEWLINE (os.path.join(gyp_src_dir, 'finalize_apk.py'), gyp_target_dir),NEWLINE (os.path.join(gyp_src_dir, 'jar.py'), gyp_target_dir),NEWLINE (os.path.join(gyp_src_dir, 'javac.py'), gyp_target_dir),NEWLINENEWLINE # Build and python tools.NEWLINE (os.path.join(tools_src_dir, 'ant'),NEWLINE os.path.join(target_dir, 'scripts/ant')),NEWLINE (os.path.join(tools_src_dir, 'customize.py'), target_dir),NEWLINE (os.path.join(tools_src_dir, 'handle_permissions.py'), target_dir),NEWLINE (os.path.join(tools_src_dir, 'handle_xml.py'), target_dir),NEWLINE (os.path.join(tools_src_dir, 'make_apk.py'), target_dir),NEWLINE (os.path.join(tools_src_dir, 'manifest_json_parser.py'), target_dir),NEWLINE (os.path.join(tools_src_dir, 'parse_xpk.py'), target_dir)NEWLINE ]NEWLINENEWLINE for index in range(len(source_target_list)):NEWLINE source_path, target_path = source_target_list[index]NEWLINENEWLINE # Process source.NEWLINE if not os.path.exists(source_path):NEWLINE print ('The source path "%s" does not exist.' % source_path)NEWLINE continueNEWLINENEWLINE source_is_file = os.path.isfile(source_path)NEWLINENEWLINE # Process target.NEWLINE if source_is_file and not os.path.exists(target_path):NEWLINE os.makedirs(target_path)NEWLINENEWLINE # Do copy.NEWLINE if source_is_file:NEWLINE shutil.copy(source_path, target_path)NEWLINE else:NEWLINE shutil.copytree(source_path, target_path)NEWLINENEWLINE # Remove unused files.NEWLINE mode = os.path.basename(os.path.dirname(target_dir))NEWLINE RemoveUnusedFilesInReleaseMode(mode, os.path.join(target_dir, 'native_libs'))NEWLINENEWLINENEWLINEdef main(args):NEWLINE if len(args) != 1:NEWLINE print 'You must provide only one argument: folder to update'NEWLINE return 1NEWLINE target_dir = args[0]NEWLINE src_dir = os.path.dirname(target_dir)NEWLINE Clean(target_dir)NEWLINE PrepareFromChromium(target_dir)NEWLINE PrepareFromXwalk(src_dir, target_dir)NEWLINENEWLINENEWLINEif __name__ == '__main__':NEWLINE sys.exit(main(sys.argv[1:]))NEWLINE |
import bpyNEWLINEfrom numpy import array, zeros, argmin, infNEWLINEfrom numpy.linalg import normNEWLINEfrom mathutils import *NEWLINENEWLINE####==========================================================================NEWLINE# DTW implementation courtesy of Pierre Rouanet:NEWLINE# http://github.com/pierre-rouanet/dtwNEWLINE# See examples that he postsNEWLINE####==========================================================================NEWLINENEWLINEdef dtw(x, y, dist=lambda x, y: norm(x - y, ord=1)):NEWLINE """ Computes the DTW of two sequences.NEWLINENEWLINE :param array x: N1*M arrayNEWLINE :param array y: N2*M arrayNEWLINE :param func dist: distance used as cost measure (default L1 norm)NEWLINENEWLINE Returns the minimum distance, the accumulated cost matrix and the wrap path.NEWLINENEWLINE """NEWLINE x = array(x)NEWLINE if len(x.shape) == 1:NEWLINE x = x.reshape(-1, 1)NEWLINE y = array(y)NEWLINE if len(y.shape) == 1:NEWLINE y = y.reshape(-1, 1)NEWLINENEWLINE r, c = len(x), len(y)NEWLINENEWLINE D = zeros((r + 1, c + 1))NEWLINE D[0, 1:] = infNEWLINE D[1:, 0] = infNEWLINENEWLINE for i in range(r):NEWLINE for j in range(c):NEWLINE D[i+1, j+1] = dist(x[i], y[j])NEWLINENEWLINE for i in range(r):NEWLINE for j in range(c):NEWLINE D[i+1, j+1] += min(D[i, j], D[i, j+1], D[i+1, j])NEWLINENEWLINE D = D[1:, 1:]NEWLINENEWLINE dist = D[-1, -1] / sum(D.shape)NEWLINENEWLINE return dist, D, _trackeback(D)NEWLINENEWLINENEWLINEdef _trackeback(D):NEWLINE i, j = array(D.shape) - 1NEWLINE p, q = [i], [j]NEWLINE while (i > 0 and j > 0):NEWLINE tb = argmin((D[i-1, j-1], D[i-1, j], D[i, j-1]))NEWLINENEWLINE if (tb == 0):NEWLINE i = i - 1NEWLINE j = j - 1NEWLINE elif (tb == 1):NEWLINE i = i - 1NEWLINE elif (tb == 2):NEWLINE j = j - 1NEWLINENEWLINE p.insert(0, i)NEWLINE q.insert(0, j)NEWLINENEWLINE p.insert(0, 0)NEWLINE q.insert(0, 0)NEWLINE return (array(p), array(q))NEWLINENEWLINE####==========================================================================NEWLINENEWLINE####==========================================================================NEWLINE# Get the rotation given mocap to search in, bonename, and frameNEWLINE# "action" is a blender Action, "bonename" is a string, "frame" is an intNEWLINE# blender Actions can be found in bpy.data.actionsNEWLINE####==========================================================================NEWLINEdef get_rotation(action, bonename, frame=1):NEWLINE rot = Euler([0,0,0])NEWLINE data_path = 'pose.bones["%s"].rotation_euler'%(bonename)NEWLINE for fc in action.fcurves:NEWLINE if fc.data_path == data_path:NEWLINE rot[fc.array_index] = fc.evaluate(frame)NEWLINE return(rot)NEWLINENEWLINE####==========================================================================NEWLINE# Creates a list containing the rotations of a boneNEWLINE# rot[i] equals the i+1th frame of animationNEWLINE# "action" is a blender Action, "bonename" is a stringNEWLINE####==========================================================================NEWLINEdef listRotation(action, bonename):NEWLINE rot = []NEWLINE for i in range(1, int(action.fcurves[0].range()[1]) + 1):NEWLINE rot.append(get_rotation(action, bonename, i))NEWLINE return rotNEWLINENEWLINE####==========================================================================NEWLINE# Replaces the existing rotation FCurves with the new computed rotationsNEWLINE# "action" is a blender Action, "bonename" is a string and NEWLINE# "rot" is a list of vectorsNEWLINE####==========================================================================NEWLINEdef replaceRotation(action, bonename, rot):NEWLINE data_path = 'pose.bones["%s"].rotation_euler'%(bonename)NEWLINE x = []NEWLINE y = []NEWLINE z = [] NEWLINE # Separate x, y, z values NEWLINE for i in range(len(rot)):NEWLINE x.append(rot[i][0])NEWLINE y.append(rot[i][1])NEWLINE z.append(rot[i][2])NEWLINENEWLINE # Obtain curves of interestNEWLINE for curve in action.fcurves:NEWLINE if curve.data_path == data_path:NEWLINE if curve.array_index == 0:NEWLINE c0 = curveNEWLINE elif curve.array_index == 1:NEWLINE c1 = curveNEWLINE elif curve.array_index == 2:NEWLINE c2 = curveNEWLINENEWLINE # Access keyframesNEWLINE c0k = c0.keyframe_pointsNEWLINE c1k = c1.keyframe_pointsNEWLINE c2k = c2.keyframe_pointsNEWLINENEWLINE # Replace existing keyframes with new onesNEWLINE for i in range(1, len(x)+1):NEWLINE c0k.insert(i, x[i-1], {'REPLACE'})NEWLINE c1k.insert(i, y[i-1], {'REPLACE'})NEWLINE c2k.insert(i, z[i-1], {'REPLACE'})NEWLINENEWLINE####==========================================================================NEWLINE# Creates the final curve based on determined pathNEWLINE# Based on current undrestanding of the functionNEWLINE# "curve" is a list of vectors and "path" is a list of intsNEWLINE####==========================================================================NEWLINEdef match(curve, path):NEWLINE t = []NEWLINE for i in path:NEWLINE t.append(curve[i])NEWLINE return tNEWLINENEWLINE####==========================================================================NEWLINE# Run DTW alg to find shortest pathNEWLINE# Primarily interested in Path for the time beingNEWLINE# Uses it to generate the new rotationsNEWLINE# "curveA", "curveB" are a list of vectorsNEWLINE####==========================================================================NEWLINEdef applyDTW(curveA, curveB):NEWLINE dist, cost, path = dtw(curveA, curveB)NEWLINE curveA = match(curveA, path[0])NEWLINE curveB = match(curveB, path[1])NEWLINE return curveA, curveBNEWLINENEWLINE####==========================================================================NEWLINE# Example UsageNEWLINE####==========================================================================NEWLINEif __name__ == "__main__":NEWLINE action1 = bpy.data.actions[0] # Mocap 1NEWLINE action2 = bpy.data.actions[1] # Mocap 2NEWLINE NEWLINE # Comparison jointsNEWLINE bodyBone = 'lHand'NEWLINE handBone = 'Hand'NEWLINENEWLINE # Get the rotation data (vectors)NEWLINE rotA = listRotation(action1, bodyBone)NEWLINE rotB = listRotation(action2, handBone)NEWLINENEWLINE # Process rotA and rotBNEWLINE rotA, rotB = applyDTW(rotA, rotB)NEWLINENEWLINE # Replace originalsNEWLINE replaceRotation(action1, bodyBone, rotA)NEWLINE replaceRotation(action2, handBone, rotB)NEWLINENEWLINENEWLINE |
#!/usr/bin/env pythonNEWLINE# -*- coding: utf-8 -*-NEWLINE# **************************************************************************NEWLINE# Copyright © 2016 jianglinNEWLINE# File Name: __init__.pyNEWLINE# Author: jianglinNEWLINE# Email: xiyang0807@gmail.comNEWLINE# Created: 2016-11-25 17:45:36 (CST)NEWLINE# Last Update:星期五 2016-11-25 17:45:36 (CST)NEWLINE# By:NEWLINE# Description:NEWLINE# **************************************************************************NEWLINE |
#!/usr/bin/env python3NEWLINE# -*- coding: utf-8 -*-NEWLINE# vim: set et sw=4 ts=4:NEWLINENEWLINEfrom PyQt5.QtWidgets import *NEWLINEfrom PyQt5.QtCore import *NEWLINEfrom PyQt5.QtGui import *NEWLINENEWLINEfrom ayat import (suar_names, suar_lengths)NEWLINENEWLINENEWLINEclass SuraAyatDialog(QDialog):NEWLINENEWLINE submit = pyqtSignal(int,int,int,bool,bool)NEWLINENEWLINE def __init__(s):NEWLINE super().__init__()NEWLINE s.setWindowTitle("تسميع آيات القرآن الكريم")NEWLINE #NEWLINE s.setLayoutDirection(Qt.RightToLeft)NEWLINE #NEWLINE s.suraEntry = QComboBox()NEWLINE s.fromEntry = QSpinBox()NEWLINE s.toEntry = QSpinBox()NEWLINE s.darkEntry = QCheckBox("الوضع الليلي")NEWLINE s.darkEntry.setStyleSheet("text-align: right")NEWLINE s.numberEntry = QCheckBox("ترقيم الآيات")NEWLINE s.numberEntry.setStyleSheet("text-align: right")NEWLINE #NEWLINE for (i,n) in enumerate(suar_names):NEWLINE s.suraEntry.addItem("%s - %d" % (n, i+1))NEWLINE #NEWLINE def suraChanged(i):NEWLINE s.fromEntry.setMaximum(suar_lengths[i])NEWLINE s.toEntry.setMaximum(suar_lengths[i])NEWLINE s.toEntry.setValue(suar_lengths[i])NEWLINE #NEWLINE s.fromEntry.setMinimum(1)NEWLINE s.toEntry.setMinimum(1)NEWLINE suraChanged(0)NEWLINE #NEWLINE s.suraEntry.setEditable(True)NEWLINE s.suraEntry.lineEdit().selectAll() # to just type the first characters of a sura's nameNEWLINE s.suraEntry.setInsertPolicy(QComboBox.NoInsert)NEWLINE s.suraEntry.currentIndexChanged.connect(suraChanged)NEWLINE #NEWLINE s.form = QFormLayout()NEWLINE for (name, entry) in (NEWLINE ("السورة:", s.suraEntry),NEWLINE ("من آية:", s.fromEntry),NEWLINE ("إلى آية:", s.toEntry),NEWLINE ):NEWLINE s.form.addRow(name, entry)NEWLINE #NEWLINE s.okbtn = QPushButton("انطلق")NEWLINE s.okbtn.setDefault(True)NEWLINE def ok():NEWLINE s.submit.emit(NEWLINE s.suraEntry.currentIndex(),NEWLINE s.fromEntry.value()-1,NEWLINE s.toEntry.value(),NEWLINE s.darkEntry.isChecked(),NEWLINE s.numberEntry.isChecked(),NEWLINE )NEWLINE s.accept()NEWLINE s.okbtn.clicked.connect(ok)NEWLINE s.box = QVBoxLayout()NEWLINE s.box.addLayout(s.form)NEWLINE s.box.addWidget(s.darkEntry, alignment=Qt.AlignCenter)NEWLINE s.box.addWidget(s.numberEntry, alignment=Qt.AlignCenter)NEWLINE s.box.addWidget(s.okbtn, alignment=Qt.AlignCenter)NEWLINE #NEWLINE s.setLayout(s.box)NEWLINENEWLINE |
# test importing of required modules and sit2standpy packageNEWLINENEWLINENEWLINEdef test_numpy():NEWLINE import numpyNEWLINENEWLINE returnNEWLINENEWLINENEWLINEdef test_scipy():NEWLINE import scipyNEWLINENEWLINE returnNEWLINENEWLINENEWLINEdef test_pywt():NEWLINE import pywtNEWLINENEWLINE returnNEWLINENEWLINENEWLINEdef test_pysit2stand():NEWLINE import sit2standpyNEWLINE from sit2standpy import Sit2Stand, detectors, mov_stats, Transition, TransitionQuantifier, \NEWLINE AccelerationFilter, process_timestamps, __version__NEWLINE from sit2standpy.detectors import Stillness, DisplacementNEWLINENEWLINE returnNEWLINE |
#!/usr/bin/env python2NEWLINE#NEWLINE# Distributed under the MIT/X11 software license, see the accompanyingNEWLINE# file COPYING or http://www.opensource.org/licenses/mit-license.php.NEWLINE#NEWLINENEWLINEfrom test_framework.mininode import *NEWLINEfrom test_framework.test_framework import BitcoinTestFrameworkNEWLINEfrom test_framework.util import *NEWLINEimport loggingNEWLINENEWLINE'''NEWLINEIn this test we connect to one node over p2p, send it numerous inv's, andNEWLINEcompare the resulting number of getdata requests to a max allowed value. WeNEWLINEtest for exceeding 128 blocks in flight, which was the limit an 0.9 client willNEWLINEreach. [0.10 clients shouldn't request more than 16 from a single peer.]NEWLINE'''NEWLINEMAX_REQUESTS = 128NEWLINENEWLINEclass TestManager(NodeConnCB):NEWLINE # set up NodeConnCB callbacks, overriding base classNEWLINE def on_getdata(self, conn, message):NEWLINE self.log.debug("got getdata %s" % repr(message))NEWLINE # Log the requestsNEWLINE for inv in message.inv:NEWLINE if inv.hash not in self.blockReqCounts:NEWLINE self.blockReqCounts[inv.hash] = 0NEWLINE self.blockReqCounts[inv.hash] += 1NEWLINENEWLINE def on_close(self, conn):NEWLINE if not self.disconnectOkay:NEWLINE raise EarlyDisconnectError(0)NEWLINENEWLINE def __init__(self):NEWLINE NodeConnCB.__init__(self)NEWLINE self.log = logging.getLogger("BlockRelayTest")NEWLINE self.create_callback_map()NEWLINENEWLINE def add_new_connection(self, connection):NEWLINE self.connection = connectionNEWLINE self.blockReqCounts = {}NEWLINE self.disconnectOkay = FalseNEWLINENEWLINE def run(self):NEWLINE try:NEWLINE fail = FalseNEWLINE self.connection.rpc.generate(1) # Leave IBDNEWLINENEWLINE numBlocksToGenerate = [ 8, 16, 128, 1024 ]NEWLINE for count in range(len(numBlocksToGenerate)):NEWLINE current_invs = []NEWLINE for i in range(numBlocksToGenerate[count]):NEWLINE current_invs.append(CInv(2, random.randrange(0, 1<<256)))NEWLINE if len(current_invs) >= 50000:NEWLINE self.connection.send_message(msg_inv(current_invs))NEWLINE current_invs = []NEWLINE if len(current_invs) > 0:NEWLINE self.connection.send_message(msg_inv(current_invs))NEWLINE NEWLINE # Wait and see how many blocks were requestedNEWLINE time.sleep(2)NEWLINENEWLINE total_requests = 0NEWLINE with mininode_lock:NEWLINE for key in self.blockReqCounts:NEWLINE total_requests += self.blockReqCounts[key]NEWLINE if self.blockReqCounts[key] > 1:NEWLINE raise AssertionError("Error, test failed: block %064x requested more than once" % key)NEWLINE if total_requests > MAX_REQUESTS:NEWLINE raise AssertionError("Error, too many blocks (%d) requested" % total_requests)NEWLINE print "Round %d: success (total requests: %d)" % (count, total_requests)NEWLINE except AssertionError as e:NEWLINE print "TEST FAILED: ", e.argsNEWLINENEWLINE self.disconnectOkay = TrueNEWLINE self.connection.disconnect_node()NEWLINENEWLINE NEWLINEclass MaxBlocksInFlightTest(BitcoinTestFramework):NEWLINE def add_options(self, parser):NEWLINE parser.add_option("--testbinary", dest="testbinary",NEWLINE default=os.getenv("LEMONCOIND", "lemoncoind"),NEWLINE help="Binary to test max block requests behavior")NEWLINENEWLINE def setup_chain(self):NEWLINE print "Initializing test directory "+self.options.tmpdirNEWLINE initialize_chain_clean(self.options.tmpdir, 1)NEWLINENEWLINE def setup_network(self):NEWLINE self.nodes = start_nodes(1, self.options.tmpdir, NEWLINE extra_args=[['-debug', '-whitelist=127.0.0.1']],NEWLINE binary=[self.options.testbinary])NEWLINENEWLINE def run_test(self):NEWLINE test = TestManager()NEWLINE test.add_new_connection(NodeConn('127.0.0.1', p2p_port(0), self.nodes[0], test))NEWLINE NetworkThread().start() # Start up network handling in another threadNEWLINE test.run()NEWLINENEWLINEif __name__ == '__main__':NEWLINE MaxBlocksInFlightTest().main()NEWLINE |
"""Application-specific settings."""NEWLINEimport osNEWLINEfrom django.conf import settings as _settingsNEWLINEfrom django.core.exceptions import ImproperlyConfiguredNEWLINENEWLINENEWLINE###############################################################################NEWLINE# Single settings.NEWLINE###############################################################################NEWLINEclass Setting(object):NEWLINE """Settings option helper class."""NEWLINE def __init__(self, **kwargs):NEWLINE """Initializer.NEWLINENEWLINE :kwarg default: Override default for getting.NEWLINE :type default: ``object``NEWLINE :kwarg from_env: Allow variable from evironment.NEWLINE :type from_env: ``bool``NEWLINE :kwarg valid_set: Set of valid values for setting.NEWLINE :type valid_set: ``set``NEWLINE """NEWLINE self.from_env = kwargs.get('from_env', False)NEWLINE self.default = kwargs.get('default', None)NEWLINE self.valid_set = kwargs.get('valid_set', None)NEWLINENEWLINE def validate(self, name, value):NEWLINE """Validate and return a value."""NEWLINENEWLINE if self.valid_set and value not in self.valid_set:NEWLINE raise ImproperlyConfigured(NEWLINE "%s: \"%s\" is not a valid setting (choose between %s)." %NEWLINE (name, value, ", ".join("\"%s\"" % x for x in self.valid_set)))NEWLINENEWLINE return valueNEWLINENEWLINE def env_clean(self, value): # pylint: disable=R0201NEWLINE """Clean / convert environment variable to proper type."""NEWLINE return valueNEWLINENEWLINE def get(self, name, default=None):NEWLINE """Get value."""NEWLINE default = default if default is not None else self.defaultNEWLINE try:NEWLINE value = getattr(_settings, name)NEWLINE except AttributeError:NEWLINE value = os.environ.get(name, default) if self.from_env else defaultNEWLINE # Convert env variable.NEWLINE if value != default:NEWLINE value = self.env_clean(value)NEWLINENEWLINE return self.validate(name, value)NEWLINENEWLINENEWLINEclass BoolSetting(Setting):NEWLINE """Boolean setting.."""NEWLINE def env_clean(self, value):NEWLINE """Clean / convert environment variable to proper type."""NEWLINE return self.parse_bool(value)NEWLINENEWLINE @classmethodNEWLINE def parse_bool(cls, value, default=None):NEWLINE """Convert ``string`` or ``bool`` to ``bool``."""NEWLINE if value is None:NEWLINE return defaultNEWLINENEWLINE elif isinstance(value, bool):NEWLINE return valueNEWLINENEWLINE elif isinstance(value, basestring):NEWLINE if value == 'True':NEWLINE return TrueNEWLINE elif value == 'False':NEWLINE return FalseNEWLINENEWLINE raise Exception("Value %s is not boolean." % value)NEWLINENEWLINENEWLINE###############################################################################NEWLINE# Settings wrapper.NEWLINE###############################################################################NEWLINEclass Settings(object):NEWLINE """Cloud Browser application settings.NEWLINENEWLINE This class wraps the "real" Django settings object, so can be used instead.NEWLINE The additional cloud browser settings are as follows:NEWLINENEWLINE .. note::NEWLINE **Environment Variables**: Certain credential settings can come from OSNEWLINE environment variables instead of from a settings file value to open upNEWLINE more options for secrets management. Values that can be set in theNEWLINE environment are designated with an "(*Env*)" notation.NEWLINENEWLINE Setting a value this way could be done, e.g.::NEWLINENEWLINE $ export CLOUD_BROWSER_AWS_ACCOUNT="my_account"NEWLINE $ export CLOUD_BROWSER_AWS_SECRET_KEY="my_secret"NEWLINE $ # ... start django application with environment variables.NEWLINENEWLINE **Datastore Settings**:NEWLINENEWLINE * ``CLOUD_BROWSER_DATASTORE``: Choice of datastore (see values below).NEWLINENEWLINE **Amazon Web Services**: Configure AWS S3 as backing datastore.NEWLINENEWLINE * ``CLOUD_BROWSER_DATASTORE = "AWS"``NEWLINE * ``CLOUD_BROWSER_AWS_ACCOUNT``: Account name. (*Env*)NEWLINE * ``CLOUD_BROWSER_AWS_SECRET_KEY``: Account API secret key. (*Env*)NEWLINENEWLINE **Google Storage for Developers**: Configure Google Storage as backingNEWLINE datastore.NEWLINENEWLINE * ``CLOUD_BROWSER_DATASTORE = "Google"``NEWLINE * ``CLOUD_BROWSER_GS_ACCOUNT``: Account name. (*Env*)NEWLINE * ``CLOUD_BROWSER_GS_SECRET_KEY``: Account API secret key. (*Env*)NEWLINENEWLINE **Rackspace**: Configure Rackspace Cloud Files as backing datastore.NEWLINENEWLINE * ``CLOUD_BROWSER_DATASTORE = "Rackspace"``NEWLINE * ``CLOUD_BROWSER_RACKSPACE_ACCOUNT``: Account name. (*Env*)NEWLINE * ``CLOUD_BROWSER_RACKSPACE_SECRET_KEY``: Account API secret key. (*Env*)NEWLINE * ``CLOUD_BROWSER_RACKSPACE_SERVICENET``: Boolean designating whether orNEWLINE not to use Rackspace's servicenet (i.e., the private interface on aNEWLINE Cloud Server). (*Env*)NEWLINE * ``CLOUD_BROWSER_RACKSPACE_AUTHURL``: Alternative authorization server,NEWLINE for use, e.g., with `OpenStack <http://www.openstack.org/>`_ instead ofNEWLINE Rackspace. (*Env*)NEWLINENEWLINE **Filesystem**: Configure simple filesystem mock datastore.NEWLINENEWLINE * ``CLOUD_BROWSER_DATASTORE = "Filesystem"``NEWLINE * ``CLOUD_BROWSER_FILESYSTEM_ROOT``: Filesystem root to serve from.NEWLINENEWLINE **View Permissions**: A standard Django view decorator object can beNEWLINE specified, which is wrapped for all browsing / viewing view -- for example,NEWLINE to limit views to logged in members, use ``login_required`` and for staffNEWLINE only, use ``staff_member_required``. Note that either a real decoratorNEWLINE function or a fully-qualifid string path are acceptable, so you can use,NEWLINE e.g., "django.contrib.admin.views.decorators.staff_member_required" insteadNEWLINE which might help with certain settings.py import-order-related issues.NEWLINENEWLINE * ``CLOUD_BROWSER_VIEW_DECORATOR``: View decorator or fully-qualifiedNEWLINE string path.NEWLINENEWLINE **Container Permissions**: Cloud browser allows a very rudimentary formNEWLINE of access control at the container level with white and black lists.NEWLINE If the white list is set, only container names in the white list areNEWLINE allowed. If the white list is unset, then any container name *not* inNEWLINE the black list is permitted. All name matching is exact (no regularNEWLINE expressions, etc.).NEWLINENEWLINE * ``CLOUD_BROWSER_CONTAINER_WHITELIST``: White list of names. (Iterable)NEWLINE * ``CLOUD_BROWSER_CONTAINER_BLACKLIST``: Black list of names. (Iterable)NEWLINENEWLINE **General**: Other settings.NEWLINENEWLINE * ``CLOUD_BROWSER_DEFAULT_LIST_LIMIT``: Default number of objects toNEWLINE diplay per browser page.NEWLINE * ``CLOUD_BROWSER_STATIC_MEDIA_DIR``: If this applications static mediaNEWLINE (found in ``app_media``) is served up under the ``settings.MEDIA_ROOT``,NEWLINE then set a relative path from the root, and the static media will be usedNEWLINE instead of a Django-based static view fallback.NEWLINE """NEWLINE #: Valid datastore types.NEWLINE DATASTORES = set((NEWLINE 'AWS',NEWLINE 'Google',NEWLINE 'Rackspace',NEWLINE 'Filesystem',NEWLINE ))NEWLINENEWLINE #: Settings dictionary of accessor callables.NEWLINE SETTINGS = {NEWLINE # Datastore choice.NEWLINE 'CLOUD_BROWSER_DATASTORE': Setting(NEWLINE default='Filesystem',NEWLINE valid_set=DATASTORESNEWLINE ),NEWLINENEWLINE # Amazon Web Services S3 datastore settings.NEWLINE 'CLOUD_BROWSER_AWS_ACCOUNT': Setting(from_env=True),NEWLINE 'CLOUD_BROWSER_AWS_SECRET_KEY': Setting(from_env=True),NEWLINENEWLINE # Google Storage for Developers datastore settings.NEWLINE 'CLOUD_BROWSER_GS_ACCOUNT': Setting(from_env=True),NEWLINE 'CLOUD_BROWSER_GS_SECRET_KEY': Setting(from_env=True),NEWLINENEWLINE # Rackspace datastore settings.NEWLINE 'CLOUD_BROWSER_RACKSPACE_ACCOUNT': Setting(from_env=True),NEWLINE 'CLOUD_BROWSER_RACKSPACE_SECRET_KEY': Setting(from_env=True),NEWLINE 'CLOUD_BROWSER_RACKSPACE_SERVICENET': BoolSetting(from_env=True),NEWLINE 'CLOUD_BROWSER_RACKSPACE_AUTHURL': BoolSetting(from_env=True),NEWLINENEWLINE # Filesystem datastore settings.NEWLINE 'CLOUD_BROWSER_FILESYSTEM_ROOT': Setting(),NEWLINENEWLINE # View permissions.NEWLINE 'CLOUD_BROWSER_VIEW_DECORATOR': Setting(),NEWLINENEWLINE # Permissions lists for containers.NEWLINE 'CLOUD_BROWSER_CONTAINER_WHITELIST': Setting(),NEWLINE 'CLOUD_BROWSER_CONTAINER_BLACKLIST': Setting(),NEWLINENEWLINE # Browser settings.NEWLINE 'CLOUD_BROWSER_DEFAULT_LIST_LIMIT': Setting(default=20),NEWLINENEWLINE # Static media root.NEWLINE 'CLOUD_BROWSER_STATIC_MEDIA_DIR': Setting(),NEWLINE }NEWLINENEWLINE def __init__(self):NEWLINE """Initializer."""NEWLINE self.__container_whitelist = NoneNEWLINE self.__container_blacklist = NoneNEWLINENEWLINE def __getattr__(self, name, default=None):NEWLINE """Get setting."""NEWLINE if name in self.SETTINGS:NEWLINE return self.SETTINGS[name].get(name, default)NEWLINENEWLINE # Use real Django settings.NEWLINE return getattr(_settings, name, default)NEWLINENEWLINE @propertyNEWLINE def _container_whitelist(self):NEWLINE """Container whitelist."""NEWLINE if self.__container_whitelist is None:NEWLINE self.__container_whitelist = \NEWLINE set(self.CLOUD_BROWSER_CONTAINER_WHITELIST or [])NEWLINE return self.__container_whitelistNEWLINENEWLINE @propertyNEWLINE def _container_blacklist(self):NEWLINE """Container blacklist."""NEWLINE if self.__container_blacklist is None:NEWLINE self.__container_blacklist = \NEWLINE set(self.CLOUD_BROWSER_CONTAINER_BLACKLIST or [])NEWLINE return self.__container_blacklistNEWLINENEWLINE def container_permitted(self, name):NEWLINE """Return whether or not a container is permitted.NEWLINENEWLINE :param name: Container name.NEWLINE :return: ``True`` if container is permitted.NEWLINE :rtype: ``bool``NEWLINE """NEWLINE white = self._container_whitelistNEWLINE black = self._container_blacklistNEWLINE return name not in black and (not white or name in white)NEWLINENEWLINE @propertyNEWLINE def app_media_url(self):NEWLINE """Get application media root from real media root URL."""NEWLINE url = NoneNEWLINE media_dir = self.CLOUD_BROWSER_STATIC_MEDIA_DIRNEWLINE if media_dir:NEWLINE url = os.path.join(self.MEDIA_URL, media_dir).rstrip('/') + '/'NEWLINENEWLINE return urlNEWLINENEWLINE @propertyNEWLINE def app_media_doc_root(self): # pylint: disable=R0201NEWLINE """Get application media document (file) root."""NEWLINE app_dir = os.path.abspath(os.path.dirname(__file__))NEWLINE media_root = os.path.join(app_dir, 'media')NEWLINENEWLINE return media_rootNEWLINENEWLINENEWLINEsettings = Settings() # pylint: disable=C0103NEWLINE |
import platformNEWLINEfrom setuptools import setupNEWLINEfrom setuptools import find_packagesNEWLINEfrom setuptools import ExtensionNEWLINENEWLINENEWLINEextra_compile_args = [NEWLINE '-std=c++11',NEWLINE '-O3',NEWLINE '-Wall',NEWLINE '-Wextra',NEWLINE '-Wconversion',NEWLINE '-fno-strict-aliasing',NEWLINE '-fno-rtti',NEWLINE]NEWLINENEWLINEif platform.system() == 'Darwin':NEWLINE extra_compile_args += ['-mmacosx-version-min=10.7', '-stdlib=libc++']NEWLINENEWLINENEWLINEsetup(NEWLINE name="python-rocksdb",NEWLINE version='0.6.8',NEWLINE description="Python bindings for RocksDB",NEWLINE keywords='rocksdb',NEWLINE author='Ming Hsuan Tu',NEWLINE author_email="qrnnis2623891@gmail.com",NEWLINE url="https://github.com/twmht/python-rocksdb",NEWLINE license='BSD License',NEWLINE setup_requires=['setuptools>=25', 'Cython>=0.20'],NEWLINE install_requires=['setuptools>=25'],NEWLINE package_dir={'rocksdb': 'rocksdb'},NEWLINE packages=find_packages('.'),NEWLINE ext_modules=[Extension(NEWLINE 'rocksdb._rocksdb',NEWLINE ['rocksdb/_rocksdb.pyx'],NEWLINE extra_compile_args=extra_compile_args,NEWLINE language='c++',NEWLINE libraries=['rocksdb', 'snappy', 'bz2', 'zstd', 'lz4'],NEWLINE )],NEWLINE extras_require={NEWLINE "doc": ['sphinx_rtd_theme', 'sphinx'],NEWLINE "test": ['pytest'],NEWLINE },NEWLINE include_package_data=TrueNEWLINE)NEWLINE |
#!/usr/bin/env python3NEWLINE# -*- coding: utf-8 -*-NEWLINEimport sysNEWLINENEWLINEif __name__ == '__main__':NEWLINE X1 = int(input('Введите x1 '))NEWLINE Y1 = int(input('Введите y1 '))NEWLINE X2 = int(input('Введите x2 '))NEWLINE Y2 = int(input('Введите y2 '))NEWLINENEWLINE if X1 == -X2 and Y1 == -Y2:NEWLINE print('Точки симметричны относительно начала координат')NEWLINE elif X1 == -X2 and Y1 == Y2:NEWLINE print('Точки симметричны относительно оси Y')NEWLINE elif X1 == X2 and Y1 == -Y2:NEWLINE print('Точки симметричны относительно оси X')NEWLINE else:NEWLINE print('Точки не симметричны', file=sys.stderr)NEWLINE exit(1)NEWLINE |
# -*- coding: utf-8 -*-NEWLINEimport osNEWLINEimport sysNEWLINENEWLINEcmd = 'coverage run `which djangocms-helper` aldryn_boilerplates test --cms --extra-settings=test_settings'NEWLINENEWLINEsys.exit(os.system(cmd))NEWLINE |
# MIT LICENSENEWLINE#NEWLINE# Copyright 1997 - 2020 by IXIA KeysightNEWLINE#NEWLINE# Permission is hereby granted, free of charge, to any person obtaining a copyNEWLINE# of this software and associated documentation files (the "Software"),NEWLINE# to deal in the Software without restriction, including without limitationNEWLINE# the rights to use, copy, modify, merge, publish, distribute, sublicense,NEWLINE# and/or sell copies of the Software, and to permit persons to whom theNEWLINE# Software is furnished to do so, subject to the following conditions:NEWLINE#NEWLINE# The above copyright notice and this permission notice shall be included inNEWLINE# all copies or substantial portions of the Software.NEWLINE#NEWLINE# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORNEWLINE# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,NEWLINE# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THENEWLINE# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERNEWLINE# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,NEWLINE# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS INNEWLINE# THE SOFTWARE. NEWLINEfrom ixnetwork_restpy.base import BaseNEWLINEfrom ixnetwork_restpy.files import FilesNEWLINENEWLINENEWLINEclass SubTlv(Base):NEWLINE """Sub Tlv containerNEWLINE The SubTlv class encapsulates a list of subTlv resources that are managed by the system.NEWLINE A list of resources can be retrieved from the server using the SubTlv.find() method.NEWLINE """NEWLINENEWLINE __slots__ = ()NEWLINE _SDM_NAME = 'subTlv'NEWLINE _SDM_ATT_MAP = {NEWLINE 'Description': 'description',NEWLINE 'EnablePerSession': 'enablePerSession',NEWLINE 'IsEnabled': 'isEnabled',NEWLINE 'Name': 'name',NEWLINE }NEWLINENEWLINE def __init__(self, parent):NEWLINE super(SubTlv, self).__init__(parent)NEWLINENEWLINE @propertyNEWLINE def Value(self):NEWLINE """NEWLINE ReturnsNEWLINE -------NEWLINE - obj(ixnetwork_restpy.testplatform.sessions.ixnetwork.topology.tlvprofile.value_ac1d7b13584a86b9cf1c28dca3390bca.Value): An instance of the Value classNEWLINENEWLINE RaisesNEWLINE ------NEWLINE - ServerError: The server has encountered an uncategorized error conditionNEWLINE """NEWLINE from ixnetwork_restpy.testplatform.sessions.ixnetwork.topology.tlvprofile.value_ac1d7b13584a86b9cf1c28dca3390bca import ValueNEWLINE return Value(self)._select()NEWLINENEWLINE @propertyNEWLINE def Description(self):NEWLINE """NEWLINE ReturnsNEWLINE -------NEWLINE - str: Description of the tlvNEWLINE """NEWLINE return self._get_attribute(self._SDM_ATT_MAP['Description'])NEWLINE @Description.setterNEWLINE def Description(self, value):NEWLINE self._set_attribute(self._SDM_ATT_MAP['Description'], value)NEWLINENEWLINE @propertyNEWLINE def EnablePerSession(self):NEWLINE """NEWLINE ReturnsNEWLINE -------NEWLINE - obj(ixnetwork_restpy.multivalue.Multivalue): Enable TLV per sessionNEWLINE """NEWLINE from ixnetwork_restpy.multivalue import MultivalueNEWLINE return Multivalue(self, self._get_attribute(self._SDM_ATT_MAP['EnablePerSession']))NEWLINENEWLINE @propertyNEWLINE def IsEnabled(self):NEWLINE """NEWLINE ReturnsNEWLINE -------NEWLINE - bool: Enables/disables this tlvNEWLINE """NEWLINE return self._get_attribute(self._SDM_ATT_MAP['IsEnabled'])NEWLINE @IsEnabled.setterNEWLINE def IsEnabled(self, value):NEWLINE self._set_attribute(self._SDM_ATT_MAP['IsEnabled'], value)NEWLINENEWLINE @propertyNEWLINE def Name(self):NEWLINE """NEWLINE ReturnsNEWLINE -------NEWLINE - str: Name of the tlvNEWLINE """NEWLINE return self._get_attribute(self._SDM_ATT_MAP['Name'])NEWLINE @Name.setterNEWLINE def Name(self, value):NEWLINE self._set_attribute(self._SDM_ATT_MAP['Name'], value)NEWLINENEWLINE def update(self, Description=None, IsEnabled=None, Name=None):NEWLINE """Updates subTlv resource on the server.NEWLINENEWLINE This method has some named parameters with a type: obj (Multivalue).NEWLINE The Multivalue class has documentation that details the possible values for those named parameters.NEWLINENEWLINE ArgsNEWLINE ----NEWLINE - Description (str): Description of the tlvNEWLINE - IsEnabled (bool): Enables/disables this tlvNEWLINE - Name (str): Name of the tlvNEWLINENEWLINE RaisesNEWLINE ------NEWLINE - ServerError: The server has encountered an uncategorized error conditionNEWLINE """NEWLINE return self._update(self._map_locals(self._SDM_ATT_MAP, locals()))NEWLINENEWLINE def find(self, Description=None, IsEnabled=None, Name=None):NEWLINE """Finds and retrieves subTlv resources from the server.NEWLINENEWLINE All named parameters are evaluated on the server using regex. The named parameters can be used to selectively retrieve subTlv resources from the server.NEWLINE To retrieve an exact match ensure the parameter value starts with ^ and ends with $NEWLINE By default the find method takes no parameters and will retrieve all subTlv resources from the server.NEWLINENEWLINE ArgsNEWLINE ----NEWLINE - Description (str): Description of the tlvNEWLINE - IsEnabled (bool): Enables/disables this tlvNEWLINE - Name (str): Name of the tlvNEWLINENEWLINE ReturnsNEWLINE -------NEWLINE - self: This instance with matching subTlv resources retrieved from the server available through an iterator or indexNEWLINENEWLINE RaisesNEWLINE ------NEWLINE - ServerError: The server has encountered an uncategorized error conditionNEWLINE """NEWLINE return self._select(self._map_locals(self._SDM_ATT_MAP, locals()))NEWLINENEWLINE def read(self, href):NEWLINE """Retrieves a single instance of subTlv data from the server.NEWLINENEWLINE ArgsNEWLINE ----NEWLINE - href (str): An href to the instance to be retrievedNEWLINENEWLINE ReturnsNEWLINE -------NEWLINE - self: This instance with the subTlv resources from the server available through an iterator or indexNEWLINENEWLINE RaisesNEWLINE ------NEWLINE - NotFoundError: The requested resource does not exist on the serverNEWLINE - ServerError: The server has encountered an uncategorized error conditionNEWLINE """NEWLINE return self._read(href)NEWLINENEWLINE def get_device_ids(self, PortNames=None, EnablePerSession=None):NEWLINE """Base class infrastructure that gets a list of subTlv device ids encapsulated by this object.NEWLINENEWLINE Use the optional regex parameters in the method to refine the list of device ids encapsulated by this object.NEWLINENEWLINE ArgsNEWLINE ----NEWLINE - PortNames (str): optional regex of port namesNEWLINE - EnablePerSession (str): optional regex of enablePerSessionNEWLINENEWLINE ReturnsNEWLINE -------NEWLINE - list(int): A list of device ids that meets the regex criteria provided in the method parametersNEWLINENEWLINE RaisesNEWLINE ------NEWLINE - ServerError: The server has encountered an uncategorized error conditionNEWLINE """NEWLINE return self._get_ngpf_device_ids(locals())NEWLINE |
def to_binary(int_digit, length=4):NEWLINE """Convert a digit into binary string.NEWLINENEWLINE Arguments:NEWLINE int_digit {str} -- the digit needed to be convertNEWLINENEWLINE Keyword Arguments:NEWLINE length {int} -- length of converted string (default: {4})NEWLINENEWLINE Returns:NEWLINE str -- a string with specific length converted from intNEWLINENEWLINE """NEWLINE format_str = '{:0>%ds}' % lengthNEWLINE return format_str.format(bin(int(int_digit))[2:])NEWLINENEWLINENEWLINEdef checkio(data):NEWLINE data = ['{:0>2s}'.format(i) for i in data.split(':')]NEWLINE bin_data = [[to_binary(i[0], 3), to_binary(i[1])] for i in data]NEWLINE bin_data = list(map(lambda x: ' '.join(x), bin_data))NEWLINE bin_data = ' : '.join(bin_data)NEWLINE return bin_data.replace('0', '.').replace('1', '-')[1:]NEWLINENEWLINENEWLINE# These "asserts" using only for self-checkingNEWLINE# and not necessary for auto-testingNEWLINEif __name__ == '__main__':NEWLINE assert checkio("10:37:49") == ".- .... : .-- .--- : -.. -..-", "First Test"NEWLINE assert checkio("21:34:56") == "-. ...- : .-- .-.. : -.- .--.", "Second Test"NEWLINE assert checkio("11:10:12") == ".- ...- : ..- .... : ..- ..-.", "Third Test"NEWLINE assert checkio("23:59:59") == "-. ..-- : -.- -..- : -.- -..-", "Fourth Test"NEWLINE |
# import the generic views you want, and the models NEWLINE# they apply to.NEWLINEfrom django.views.generic import ListViewNEWLINENEWLINE# Import the models you want to use.NEWLINEfrom snippets.models import SnippetNEWLINENEWLINE# Create a class for your model that subclassesNEWLINE# the generic view you want. This serves as anNEWLINE# index view.NEWLINEclass SnippetListView(ListView):NEWLINE # Finally, tell the generic view what modelNEWLINE # it applies to, and which template to use.NEWLINE model = SnippetNEWLINE template_name = 'snippets/index.html'NEWLINENEWLINE# ==============================================NEWLINENEWLINE# In your urls.py, you'll need to update the NEWLINE# corresponding route. It'll look like this.NEWLINEurls(r'^index/$', views.SnippetListView.as_view())NEWLINE |
words =[ "aback","abaft","abandoned","abashed","aberrant","abhorrent","abiding","abject","ablaze","able","abnormal","aboard","aboriginal","abortive","abounding","abrasive","abrupt","absent","absorbed","absorbing","abstracted","absurd","abundant","abusive","accept","acceptable","accessible","accidental","account","accurate","achiever","acid","acidic","acoustic","acoustics","acrid","act","action","activity","actor","actually","ad hoc","adamant","adaptable","add","addicted","addition","adhesive","adjoining","adjustment","admire","admit","adorable","adventurous","advertisement","advice","advise","afford","afraid","aftermath","afternoon","afterthought","aggressive","agonizing","agree","agreeable","agreement","ahead","air","airplane","airport","ajar","alarm","alcoholic","alert","alike","alive","alleged","allow","alluring","aloof","amazing","ambiguous","ambitious","amount","amuck","amuse","amused","amusement","amusing","analyze","ancient","anger","angle","angry","animal","animated","announce","annoy","annoyed","annoying","answer","ants","anxious","apathetic","apologise","apparatus","apparel","appear","applaud","appliance","appreciate","approval","approve","aquatic","arch","argue","argument","arithmetic","arm","army","aromatic","arrange","arrest","arrive","arrogant","art","ashamed","ask","aspiring","assorted","astonishing","attach","attack","attempt","attend","attract","attraction","attractive","aunt","auspicious","authority","automatic","available","average","avoid","awake","aware","awesome","awful","axiomatic","babies","baby","back","bad","badge","bag","bait","bake","balance","ball","ban","bang","barbarous","bare","base","baseball","bashful","basin","basket","basketball","bat","bath","bathe","battle","bawdy","bead","beam","bear","beautiful","bed","bedroom","beds","bee","beef","befitting","beg","beginner","behave","behavior","belief","believe","bell","belligerent","bells","belong","beneficial","bent","berry","berserk","best","better","bewildered","big","bike","bikes","billowy","bird","birds","birth","birthday","bit","bite","bite-sized","bitter","bizarre","black","black-and-white","blade","bleach","bless","blind","blink","blood","bloody","blot","blow","blue","blue-eyed","blush","blushing","board","boast","boat","boil","boiling","bolt","bomb","bone","book","books","boorish","boot","border","bore","bored","boring","borrow","bottle","bounce","bouncy","boundary","boundless","bow","box","boy","brainy","brake","branch","brash","brass","brave","brawny","breakable","breath","breathe","breezy","brick","bridge","brief","bright","broad","broken","brother","brown","bruise","brush","bubble","bucket","building","bulb","bump","bumpy","burly","burn","burst","bury","bushes","business","bustling","busy","butter","button","buzz","cabbage","cable","cactus","cagey","cake","cakes","calculate","calculating","calculator","calendar","call","callous","calm","camera","camp","can","cannon","canvas","cap","capable","capricious","caption","car","card","care","careful","careless","caring","carpenter","carriage","carry","cars","cart","carve","cast","cat","cats","cattle","cause","cautious","cave","ceaseless","celery","cellar","cemetery","cent","certain","chalk","challenge","chance","change","changeable","channel","charge","charming","chase","cheap","cheat","check","cheer","cheerful","cheese","chemical","cherries","cherry","chess","chew","chicken","chickens","chief","childlike","children","chilly","chin","chivalrous","choke","chop","chubby","chunky","church","circle","claim","clam","clammy","clap","class","classy","clean","clear","clever","clip","cloistered","close","closed","cloth","cloudy","clover","club","clumsy","cluttered","coach","coal","coast","coat","cobweb","coherent","coil","cold","collar","collect","color","colorful","colossal","colour","comb","combative","comfortable","command","committee","common","communicate","company","compare","comparison","compete","competition","complain","complete","complex","concentrate","concern","concerned","condemned","condition","confess","confuse","confused","connect","connection","conscious","consider","consist","contain","continue","control","cooing","cook","cool","cooperative","coordinated","copper","copy","corn","correct","cough","count","country","courageous","cover","cow","cowardly","cows","crabby","crack","cracker","crash","crate","craven","crawl","crayon","crazy","cream","creator","creature","credit","creepy","crib","crime","crook","crooked","cross","crow","crowd","crowded","crown","cruel","crush","cry","cub","cuddly","cultured","cumbersome","cup","cure","curious","curl","curly","current","curtain","curve","curved","curvy","cushion","cut","cute","cycle","cynical","dad","daffy","daily","dam","damage","damaged","damaging","damp","dance","dangerous","dapper","dare","dark","dashing","daughter","day","dazzling","dead","deadpan","deafening","dear","death","debonair","debt","decay","deceive","decide","decision","decisive","decorate","decorous","deep","deeply","deer","defeated","defective","defiant","degree","delay","delicate","delicious","delight","delightful","delirious","deliver","demonic","depend","dependent","depressed","deranged","describe","descriptive","desert","deserted","deserve","design","desire","desk","destroy","destruction","detail","detailed","detect","determined","develop","development","devilish","didactic","different","difficult","digestion","diligent","dime","dinner","dinosaurs","direction","direful","dirt","dirty","disagree","disagreeable","disappear","disapprove","disarm","disastrous","discover","discovery","discreet","discussion","disgusted","disgusting","disillusioned","dislike","dispensable","distance","distinct","distribution","disturbed","divergent","divide","division","dizzy","dock","doctor","dog","dogs","doll","dolls","domineering","donkey","door","double","doubt","doubtful","downtown","drab","draconian","drag","drain","dramatic","drawer","dream","dreary","dress","drink","drip","driving","drop","drown","drum","drunk","dry","duck","ducks","dull","dust","dusty","dynamic","dysfunctional","eager","ear","early","earn","earsplitting","earth","earthquake","earthy","easy","eatable","economic","edge","educate","educated","education","effect","efficacious","efficient","egg","eggnog","eggs","eight","elastic","elated","elbow","elderly","electric","elegant","elfin","elite","embarrass","embarrassed","eminent","employ","empty","enchanted","enchanting","encourage","encouraging","end","endurable","energetic","engine","enjoy","enormous","enter","entertain","entertaining","enthusiastic","envious","equable","equal","erect","erratic","error","escape","ethereal","evanescent","evasive","even","event","examine","example","excellent","exchange","excite","excited","exciting","exclusive","excuse","exercise","exist","existence","exotic","expand","expansion","expect","expensive","experience","expert","explain","explode","extend","extra-large","extra-small","exuberant","exultant","eye","eyes","fabulous","face","fact","fade","faded","fail","faint","fair","fairies","faithful","fall","fallacious","false","familiar","famous","fanatical","fancy","fang","fantastic","far","far-flung","farm","fascinated","fast","fasten","fat","faulty","fax","fear","fearful","fearless","feeble","feeling","feigned","female","fence","fertile","festive","fetch","few","field","fierce","file","fill","film","filthy","fine","finger","finicky","fire","fireman","first","fish","fit","five","fix","fixed","flag","flagrant","flaky","flame","flap","flash","flashy","flat","flavor","flawless","flesh","flight","flimsy","flippant","float","flock","flood","floor","flow","flower","flowers","flowery","fluffy","fluttering","fly","foamy","fog","fold","follow","food","fool","foolish","foot","force","foregoing","forgetful","fork","form","fortunate","found","four","fowl","fragile","frail","frame","frantic","free","freezing","frequent","fresh","fretful","friction","friend","friendly","friends","frighten","frightened","frightening","frog","frogs","front","fruit","fry","fuel","full","fumbling","functional","funny","furniture","furry","furtive","future","futuristic","fuzzy","gabby","gainful","gamy","gaping","garrulous","gate","gather","gaudy","gaze","geese","general","gentle","ghost","giant","giants","giddy","gifted","gigantic","giraffe","girl","girls","glamorous","glass","gleaming","glib","glistening","glorious","glossy","glove","glow","glue","godly","gold","good","goofy","gorgeous","government","governor","grab","graceful","grade","grain","grandfather","grandiose","grandmother","grape","grass","grate","grateful","gratis","gray","grease","greasy","great","greedy","green","greet","grey","grieving","grin","grip","groan","groovy","grotesque","grouchy","ground","group","growth","grubby","gruesome","grumpy","guarantee","guard","guarded","guess","guide","guiltless","guitar","gullible","gun","gusty","guttural","habitual","hair","haircut","half","hall","hallowed","halting","hammer","hand","handle","hands","handsome","handsomely","handy","hang","hanging","hapless","happen","happy","harass","harbor","hard","hard-to-find","harm","harmonious","harmony","harsh","hat","hate","hateful","haunt","head","heady","heal","health","healthy","heap","heartbreaking","heat","heavenly","heavy","hellish","help","helpful","helpless","hesitant","hideous","high","high-pitched","highfalutin","hilarious","hill","hissing","historical","history","hobbies","hole","holiday","holistic","hollow","home","homeless","homely","honey","honorable","hook","hop","hope","horn","horrible","horse","horses","hose","hospitable","hospital","hot","hour","house","houses","hover","hug","huge","hulking","hum","humdrum","humor","humorous","hungry","hunt","hurried","hurry","hurt","hushed","husky","hydrant","hypnotic","hysterical","ice","icicle","icky","icy","idea","identify","idiotic","ignorant","ignore","ill","ill-fated","ill-informed","illegal","illustrious","imaginary","imagine","immense","imminent","impartial","imperfect","impolite","important","imported","impossible","impress","improve","impulse","incandescent","include","income","incompetent","inconclusive","increase","incredible","industrious","industry","inexpensive","infamous","influence","inform","inject","injure","ink","innate","innocent","inquisitive","insect","insidious","instinctive","instruct","instrument","insurance","intelligent","intend","interest","interesting","interfere","internal","interrupt","introduce","invent","invention","invincible","invite","irate","iron","irritate","irritating","island","itch","itchy","jaded","jagged","jail","jam","jar","jazzy","jealous","jeans","jelly","jellyfish","jewel","jittery","jobless","jog","join","joke","jolly","joyous","judge","judicious","juggle","juice","juicy","jumbled","jump","jumpy","juvenile","kaput","keen","kettle","key","kick","kill","kind","kindhearted","kindly","kiss","kittens","kitty","knee","kneel","knife","knit","knock","knot","knotty","knowing","knowledge","knowledgeable","known","label","labored","laborer","lace","lackadaisical","lacking","ladybug","lake","lame","lamentable","lamp","land","language","languid","large","last","late","laugh","laughable","launch","lavish","lazy","lean","learn","learned","leather","left","leg","legal","legs","lethal","letter","letters","lettuce","level","lewd","library","license","lick","lie","light","lighten","like","likeable","limit","limping","line","linen","lip","liquid","list","listen","literate","little","live","lively","living","load","loaf","lock","locket","lonely","long","long-term","longing","look","loose","lopsided","loss","loud","loutish","love","lovely","loving","low","lowly","lucky","ludicrous","lumber","lumpy","lunch","lunchroom","lush","luxuriant","lying","lyrical","macabre","machine","macho","maddening","madly","magenta","magic","magical","magnificent","maid","mailbox","majestic","makeshift","male","malicious","mammoth","man","manage","maniacal","many","marble","march","mark","marked","market","married","marry","marvelous","mask","mass","massive","match","mate","material","materialistic","matter","mature","meal","mean","measly","measure","meat","meaty","meddle","medical","meek","meeting","mellow","melodic","melt","melted","memorize","memory","men","mend","merciful","mere","mess up","messy","metal","mice","middle","mighty","military","milk","milky","mind","mindless","mine","miniature","minister","minor","mint","minute","miscreant","miss","mist","misty","mitten","mix","mixed","moan","moaning","modern","moldy","mom","momentous","money","monkey","month","moon","moor","morning","mother","motion","motionless","mountain","mountainous","mourn","mouth","move","muddle","muddled","mug","multiply","mundane","murder","murky","muscle","mushy","mute","mysterious","nail","naive","name","nappy","narrow","nasty","nation","natural","naughty","nauseating","near","neat","nebulous","necessary","neck","need","needle","needless","needy","neighborly","nerve","nervous","nest","new","next","nice","nifty","night","nimble","nine","nippy","nod","noise","noiseless","noisy","nonchalant","nondescript","nonstop","normal","north","nose","nostalgic","nosy","note","notebook","notice","noxious","null","number","numberless","numerous","nut","nutritious","nutty","oafish","oatmeal","obedient","obeisant","obese","obey","object","obnoxious","obscene","obsequious","observant","observation","observe","obsolete","obtain","obtainable","occur","ocean","oceanic","odd","offbeat","offend","offer","office","oil","old","old-fashioned","omniscient","one","onerous","open","opposite","optimal","orange","oranges","order","ordinary","organic","ossified","outgoing","outrageous","outstanding","oval","oven","overconfident","overflow","overjoyed","overrated","overt","overwrought","owe","own","pack","paddle","page","pail","painful","painstaking","paint","pale","paltry","pan","pancake","panicky","panoramic","paper","parallel","parcel","parched","park","parsimonious","part","partner","party","pass","passenger","past","paste","pastoral","pat","pathetic","pause","payment","peace","peaceful","pear","peck","pedal","peel","peep","pen","pencil","penitent","perfect","perform","periodic","permissible","permit","perpetual","person","pest","pet","petite","pets","phobic","phone","physical","picayune","pick","pickle","picture","pie","pies","pig","pigs","pin","pinch","pine","pink","pipe","piquant","pizzas","place","placid","plain","plan","plane","planes","plant","plantation","plants","plastic","plate","plausible","play","playground","pleasant","please","pleasure","plot","plough","plucky","plug","pocket","point","pointless","poised","poison","poke","polish","polite","political","pollution","poor","pop","popcorn","porter","position","possess","possessive","possible","post","pot","potato","pour","powder","power","powerful","practice","pray","preach","precede","precious","prefer","premium","prepare","present","preserve","press","pretend","pretty","prevent","previous","price","pricey","prick","prickly","print","private","probable","produce","productive","profit","profuse","program","promise","property","prose","protect","protective","protest","proud","provide","psychedelic","psychotic","public","puffy","pull","pump","pumped","punch","puncture","punish","punishment","puny","purple","purpose","purring","push","pushy","puzzled","puzzling","quack","quaint","quarrelsome","quarter","quartz","queen","question","questionable","queue","quick","quickest","quicksand","quiet","quill","quilt","quince","quirky","quiver","quixotic","quizzical","rabbit","rabbits","rabid","race","racial","radiate","ragged","rail","railway","rain","rainstorm","rainy","raise","rake","rambunctious","rampant","range","rapid","rare","raspy","rat","rate","ratty","ray","reach","reaction","reading","ready","real","realize","reason","rebel","receipt","receive","receptive","recess","recognise","recondite","record","red","reduce","redundant","reflect","reflective","refuse","regret","regular","reign","reject","rejoice","relation","relax","release","relieved","religion","rely","remain","remarkable","remember","remind","reminiscent","remove","repair","repeat","replace","reply","report","representative","reproduce","repulsive","request","rescue","resolute","resonant","respect","responsible","rest","retire","return","reward","rhetorical","rhyme","rhythm","rice","rich","riddle","rifle","right","righteous","rightful","rigid","ring","rings","rinse","ripe","risk","ritzy","river","road","roasted","rob","robin","robust","rock","rod","roll","romantic","roof","room","roomy","root","rose","rot","rotten","rough","round","route","royal","rub","ruddy","rude","ruin","rule","run","rural","rush","rustic","ruthless","sable","sack","sad","safe","sail","salt","salty","same","sand","sassy","satisfy","satisfying","save","savory","saw","scale","scandalous","scarce","scare","scarecrow","scared","scarf","scary","scatter","scattered","scene","scent","school","science","scientific","scintillating","scissors","scold","scorch","scrape","scratch","scrawny","scream","screeching","screw","scribble","scrub","sea","seal","search","seashore","seat","second","second-hand","secret","secretary","secretive","sedate","seed","seemly","selection","selective","self","selfish","sense","separate","serious","servant","serve","settle","shade","shaggy","shake","shaky","shallow","shame","shape","share","sharp","shave","sheep","sheet","shelf","shelter","shiny","ship","shirt","shiver","shivering","shock","shocking","shoe","shoes","shop","short","show","shrill","shrug","shut","shy","sick","side","sidewalk","sigh","sign","signal","silent","silk","silky","silly","silver","simple","simplistic","sin","sincere","sink","sip","sister","sisters","six","size","skate","ski","skillful","skin","skinny","skip","skirt","sky","slap","slave","sleep","sleepy","sleet","slim","slimy","slip","slippery","slope","sloppy","slow","small","smart","smash","smell","smelly","smile","smiling","smoggy","smoke","smooth","snail","snails","snake","snakes","snatch","sneaky","sneeze","sniff","snobbish","snore","snotty","snow","soak","soap","society","sock","soda","sofa","soft","soggy","solid","somber","son","song","songs","soothe","sophisticated","sordid","sore","sort","sound","soup","sour","space","spade","spare","spark","sparkle","sparkling","special","spectacular","spell","spicy","spiders","spiffy","spiky","spill","spiritual","spiteful","splendid","spoil","sponge","spooky","spoon","spot","spotless","spotted","spotty","spray","spring","sprout","spurious","spy","squalid","square","squash","squeak","squeal","squealing","squeamish","squeeze","squirrel","stage","stain","staking","stale","stamp","standing","star","stare","start","statement","station","statuesque","stay","steadfast","steady","steam","steel","steep","steer","stem","step","stereotyped","stew","stick","sticks","sticky","stiff","stimulating","stingy","stir","stitch","stocking","stomach","stone","stop","store","stormy","story","stove","straight","strange","stranger","strap","straw","stream","street","strengthen","stretch","string","strip","striped","stroke","strong","structure","stuff","stupendous","stupid","sturdy","subdued","subsequent","substance","substantial","subtract","succeed","successful","succinct","suck","sudden","suffer","sugar","suggest","suggestion","suit","sulky","summer","sun","super","superb","superficial","supply","support","suppose","supreme","surprise","surround","suspect","suspend","swanky","sweater","sweet","sweltering","swift","swim","swing","switch","symptomatic","synonymous","system","table","taboo","tacit","tacky","tail","talented","talk","tall","tame","tan","tangible","tangy","tank","tap","tart","taste","tasteful","tasteless","tasty","tawdry","tax","teaching","team","tearful","tease","tedious","teeny","teeny-tiny","teeth","telephone","telling","temper","temporary","tempt","ten","tendency","tender","tense","tent","tenuous","terrible","terrific","terrify","territory","test","tested","testy","texture","thank","thankful","thaw","theory","therapeutic","thick","thin","thing","things","thinkable","third","thirsty","thought","thoughtful","thoughtless","thread","threatening","three","thrill","throat","throne","thumb","thunder","thundering","tick","ticket","tickle","tidy","tie","tiger","tight","tightfisted","time","tin","tiny","tip","tire","tired","tiresome","title","toad","toe","toes","tomatoes","tongue","tooth","toothbrush","toothpaste","toothsome","top","torpid","touch","tough","tour","tow","towering","town","toy","toys","trace","trade","trail","train","trains","tramp","tranquil","transport","trap","trashy","travel","tray","treat","treatment","tree","trees","tremble","tremendous","trick","tricky","trip","trite","trot","trouble","troubled","trousers","truck","trucks","truculent","true","trust","truthful","try","tub","tug","tumble","turkey","turn","twig","twist","two","type","typical","ubiquitous","ugliest","ugly","ultra","umbrella","unable","unaccountable","unadvised","unarmed","unbecoming","unbiased","uncle","uncovered","understood","underwear","undesirable","undress","unequal","unequaled","uneven","unfasten","unhealthy","uninterested","unique","unit","unite","unkempt","unknown","unlock","unnatural","unpack","unruly","unsightly","unsuitable","untidy","unused","unusual","unwieldy","unwritten","upbeat","uppity","upset","uptight","use","used","useful","useless","utopian","utter","uttermost","vacation","vacuous","vagabond","vague","valuable","value","van","vanish","various","vase","vast","vegetable","veil","vein","vengeful","venomous","verdant","verse","versed","vessel","vest","victorious","view","vigorous","violent","violet","visit","visitor","vivacious","voice","voiceless","volatile","volcano","volleyball","voracious","voyage","vulgar","wacky","waggish","wail","wait","waiting","wakeful","walk","wall","wander","wandering","want","wanting","war","warlike","warm","warn","wary","wash","waste","wasteful","watch","water","watery","wave","waves","wax","way","weak","wealth","wealthy","weary","weather","week","weigh","weight","welcome","well-groomed","well-made","well-off","well-to-do","wet","wheel","whimsical","whine","whip","whirl","whisper","whispering","whistle","white","whole","wholesale","wicked","wide","wide-eyed","wiggly","wild","wilderness","willing","wind","window","windy","wine","wing","wink","winter","wipe","wire","wiry","wise","wish","wistful","witty","wobble","woebegone","woman","womanly","women","wonder","wonderful","wood","wooden","wool","woozy","word","work","workable","worm","worried","worry","worthless","wound","wrap","wrathful","wreck","wren","wrench","wrestle","wretched","wriggle","wrist","writer","writing","wrong","wry","x-ray","yak","yam","yard","yarn","yawn","year","yell","yellow","yielding","yoke","young","youthful","yummy","zany","zealous","zebra","zephyr","zesty","zinc","zip","zipper","zippy","zonked","zoo","zoom"]NEWLINE |
import osNEWLINEimport timeNEWLINEimport statNEWLINEimport jsonNEWLINEimport zlibNEWLINEimport typingNEWLINEfrom typing import List, Sequence, MutableSequence, OptionalNEWLINEfrom collections import UserDictNEWLINEfrom hashlib import sha256NEWLINEfrom operator import attrgetterNEWLINEfrom torba.client.hash import better_aes_encrypt, better_aes_decryptNEWLINENEWLINEif typing.TYPE_CHECKING:NEWLINE from torba.client import basemanager, baseaccount, baseledgerNEWLINENEWLINENEWLINEclass TimestampedPreferences(UserDict):NEWLINENEWLINE def __getitem__(self, key):NEWLINE return self.data[key]['value']NEWLINENEWLINE def __setitem__(self, key, value):NEWLINE self.data[key] = {NEWLINE 'value': value,NEWLINE 'ts': time.time()NEWLINE }NEWLINENEWLINE def __repr__(self):NEWLINE return repr(self.to_dict_without_ts())NEWLINENEWLINE def to_dict_without_ts(self):NEWLINE return {NEWLINE key: value['value'] for key, value in self.data.items()NEWLINE }NEWLINENEWLINE @propertyNEWLINE def hash(self):NEWLINE return sha256(json.dumps(self.data).encode()).digest()NEWLINENEWLINE def merge(self, other: dict):NEWLINE for key, value in other.items():NEWLINE if key in self.data and value['ts'] < self.data[key]['ts']:NEWLINE continueNEWLINE self.data[key] = valueNEWLINENEWLINENEWLINEclass Wallet:NEWLINE """ The primary role of Wallet is to encapsulate a collectionNEWLINE of accounts (seed/private keys) and the spending rules / settingsNEWLINE for the coins attached to those accounts. Wallets are representedNEWLINE by physical files on the filesystem.NEWLINE """NEWLINENEWLINE preferences: TimestampedPreferencesNEWLINENEWLINE def __init__(self, name: str = 'Wallet', accounts: MutableSequence['baseaccount.BaseAccount'] = None,NEWLINE storage: 'WalletStorage' = None, preferences: dict = None) -> None:NEWLINE self.name = nameNEWLINE self.accounts = accounts or []NEWLINE self.storage = storage or WalletStorage()NEWLINE self.preferences = TimestampedPreferences(preferences or {})NEWLINENEWLINE @propertyNEWLINE def id(self):NEWLINE if self.storage.path:NEWLINE return os.path.basename(self.storage.path)NEWLINE return self.nameNEWLINENEWLINE def add_account(self, account: 'baseaccount.BaseAccount'):NEWLINE self.accounts.append(account)NEWLINENEWLINE def generate_account(self, ledger: 'baseledger.BaseLedger') -> 'baseaccount.BaseAccount':NEWLINE return ledger.account_class.generate(ledger, self)NEWLINENEWLINE @propertyNEWLINE def default_account(self) -> Optional['baseaccount.BaseAccount']:NEWLINE for account in self.accounts:NEWLINE return accountNEWLINE return NoneNEWLINENEWLINE def get_account_or_default(self, account_id: str) -> Optional['baseaccount.BaseAccount']:NEWLINE if account_id is None:NEWLINE return self.default_accountNEWLINE return self.get_account_or_error(account_id)NEWLINENEWLINE def get_account_or_error(self, account_id: str) -> 'baseaccount.BaseAccount':NEWLINE for account in self.accounts:NEWLINE if account.id == account_id:NEWLINE return accountNEWLINE raise ValueError(f"Couldn't find account: {account_id}.")NEWLINENEWLINE def get_accounts_or_all(self, account_ids: List[str]) -> Sequence['baseaccount.BaseAccount']:NEWLINE return [NEWLINE self.get_account_or_error(account_id)NEWLINE for account_id in account_idsNEWLINE ] if account_ids else self.accountsNEWLINENEWLINE async def get_detailed_accounts(self, **kwargs):NEWLINE ledgers = {}NEWLINE for i, account in enumerate(self.accounts):NEWLINE details = await account.get_details(**kwargs)NEWLINE details['is_default'] = i == 0NEWLINE ledger_id = account.ledger.get_id()NEWLINE ledgers.setdefault(ledger_id, [])NEWLINE ledgers[ledger_id].append(details)NEWLINE return ledgersNEWLINENEWLINE @classmethodNEWLINE def from_storage(cls, storage: 'WalletStorage', manager: 'basemanager.BaseWalletManager') -> 'Wallet':NEWLINE json_dict = storage.read()NEWLINE wallet = cls(NEWLINE name=json_dict.get('name', 'Wallet'),NEWLINE preferences=json_dict.get('preferences', {}),NEWLINE storage=storageNEWLINE )NEWLINE account_dicts: Sequence[dict] = json_dict.get('accounts', [])NEWLINE for account_dict in account_dicts:NEWLINE ledger = manager.get_or_create_ledger(account_dict['ledger'])NEWLINE ledger.account_class.from_dict(ledger, wallet, account_dict)NEWLINE return walletNEWLINENEWLINE def to_dict(self):NEWLINE return {NEWLINE 'version': WalletStorage.LATEST_VERSION,NEWLINE 'name': self.name,NEWLINE 'preferences': self.preferences.data,NEWLINE 'accounts': [a.to_dict() for a in self.accounts]NEWLINE }NEWLINENEWLINE def save(self):NEWLINE self.storage.write(self.to_dict())NEWLINENEWLINE @propertyNEWLINE def hash(self) -> bytes:NEWLINE h = sha256()NEWLINE h.update(self.preferences.hash)NEWLINE for account in sorted(self.accounts, key=attrgetter('id')):NEWLINE h.update(account.hash)NEWLINE return h.digest()NEWLINENEWLINE def pack(self, password):NEWLINE new_data = json.dumps(self.to_dict())NEWLINE new_data_compressed = zlib.compress(new_data.encode())NEWLINE return better_aes_encrypt(password, new_data_compressed)NEWLINENEWLINE @classmethodNEWLINE def unpack(cls, password, encrypted):NEWLINE decrypted = better_aes_decrypt(password, encrypted)NEWLINE decompressed = zlib.decompress(decrypted)NEWLINE return json.loads(decompressed)NEWLINENEWLINE def merge(self, manager: 'basemanager.BaseWalletManager',NEWLINE password: str, data: str) -> List['baseaccount.BaseAccount']:NEWLINE added_accounts = []NEWLINE decrypted_data = self.unpack(password, data)NEWLINE self.preferences.merge(decrypted_data.get('preferences', {}))NEWLINE for account_dict in decrypted_data['accounts']:NEWLINE ledger = manager.get_or_create_ledger(account_dict['ledger'])NEWLINE _, _, pubkey = ledger.account_class.keys_from_dict(ledger, account_dict)NEWLINE account_id = pubkey.addressNEWLINE local_match = NoneNEWLINE for local_account in self.accounts:NEWLINE if account_id == local_account.id:NEWLINE local_match = local_accountNEWLINE breakNEWLINE if local_match is not None:NEWLINE local_match.merge(account_dict)NEWLINE else:NEWLINE new_account = ledger.account_class.from_dict(ledger, self, account_dict)NEWLINE added_accounts.append(new_account)NEWLINE return added_accountsNEWLINENEWLINE @propertyNEWLINE def is_locked(self) -> bool:NEWLINE for account in self.accounts:NEWLINE if account.encrypted:NEWLINE return TrueNEWLINE return FalseNEWLINENEWLINE def unlock(self, password):NEWLINE for account in self.accounts:NEWLINE if account.encrypted:NEWLINE account.decrypt(password)NEWLINE return TrueNEWLINENEWLINE def lock(self):NEWLINE for account in self.accounts:NEWLINE if not account.encrypted:NEWLINE assert account.password is not None, "account was never encrypted"NEWLINE account.encrypt(account.password)NEWLINE return TrueNEWLINENEWLINE @propertyNEWLINE def is_encrypted(self) -> bool:NEWLINE for account in self.accounts:NEWLINE if account.serialize_encrypted:NEWLINE return TrueNEWLINE return FalseNEWLINENEWLINE def decrypt(self):NEWLINE for account in self.accounts:NEWLINE account.serialize_encrypted = FalseNEWLINE self.save()NEWLINE return TrueNEWLINENEWLINE def encrypt(self, password):NEWLINE for account in self.accounts:NEWLINE if not account.encrypted:NEWLINE account.encrypt(password)NEWLINE account.serialize_encrypted = TrueNEWLINE self.save()NEWLINE self.unlock(password)NEWLINE return TrueNEWLINENEWLINENEWLINEclass WalletStorage:NEWLINENEWLINE LATEST_VERSION = 1NEWLINENEWLINE def __init__(self, path=None, default=None):NEWLINE self.path = pathNEWLINE self._default = default or {NEWLINE 'version': self.LATEST_VERSION,NEWLINE 'name': 'My Wallet',NEWLINE 'preferences': {},NEWLINE 'accounts': []NEWLINE }NEWLINENEWLINE def read(self):NEWLINE if self.path and os.path.exists(self.path):NEWLINE with open(self.path, 'r') as f:NEWLINE json_data = f.read()NEWLINE json_dict = json.loads(json_data)NEWLINE if json_dict.get('version') == self.LATEST_VERSION and \NEWLINE set(json_dict) == set(self._default):NEWLINE return json_dictNEWLINE else:NEWLINE return self.upgrade(json_dict)NEWLINE else:NEWLINE return self._default.copy()NEWLINENEWLINE def upgrade(self, json_dict):NEWLINE json_dict = json_dict.copy()NEWLINE version = json_dict.pop('version', -1)NEWLINE if version == -1:NEWLINE passNEWLINE upgraded = self._default.copy()NEWLINE upgraded.update(json_dict)NEWLINE return json_dictNEWLINENEWLINE def write(self, json_dict):NEWLINENEWLINE json_data = json.dumps(json_dict, indent=4, sort_keys=True)NEWLINE if self.path is None:NEWLINE return json_dataNEWLINENEWLINE temp_path = "%s.tmp.%s" % (self.path, os.getpid())NEWLINE with open(temp_path, "w") as f:NEWLINE f.write(json_data)NEWLINE f.flush()NEWLINE os.fsync(f.fileno())NEWLINENEWLINE if os.path.exists(self.path):NEWLINE mode = os.stat(self.path).st_modeNEWLINE else:NEWLINE mode = stat.S_IREAD | stat.S_IWRITENEWLINE try:NEWLINE os.rename(temp_path, self.path)NEWLINE except Exception: # pylint: disable=broad-exceptNEWLINE os.remove(self.path)NEWLINE os.rename(temp_path, self.path)NEWLINE os.chmod(self.path, mode)NEWLINE |
import sysNEWLINEfrom collections import namedtuple, OrderedDictNEWLINEfrom typing import Dict, ListNEWLINENEWLINEimport torchNEWLINEfrom torch import nn as nnNEWLINENEWLINEfrom model.decoder import DecoderNEWLINEfrom model.encoder import EncoderNEWLINEfrom utils import util, nn_utilNEWLINEfrom utils.ast import AbstractSyntaxTreeNEWLINEfrom utils.dataset import ExampleNEWLINEfrom utils.vocab import Vocab, SAME_VARIABLE_TOKEN, END_OF_VARIABLE_TOKENNEWLINENEWLINENEWLINEclass RecurrentSubtokenDecoder(Decoder):NEWLINE def __init__(self, variable_encoding_size: int, hidden_size: int, dropout: float, tie_embed: bool, input_feed: bool, vocab: Vocab):NEWLINE super(Decoder, self).__init__()NEWLINENEWLINE self.vocab = vocabNEWLINENEWLINE lstm_x_dim = variable_encoding_size + hidden_sizeNEWLINE if input_feed:NEWLINE lstm_x_dim += hidden_sizeNEWLINENEWLINE self.lstm_cell = nn.LSTMCell(lstm_x_dim, hidden_size) # v_encoding_t + e(y_tm1)NEWLINE self.state2names = nn.Linear(hidden_size, len(vocab.target), bias=True)NEWLINE if not tie_embed:NEWLINE self.var_name_embed = nn.Embedding(len(vocab.target), hidden_size)NEWLINENEWLINE self.dropout = nn.Dropout(dropout)NEWLINE self.config: Dict = NoneNEWLINENEWLINE self.Hypothesis = namedtuple('Hypothesis', ['variable_list', 'variable_ptr', 'score'])NEWLINENEWLINE @propertyNEWLINE def device(self):NEWLINE return self.state2names.weight.deviceNEWLINENEWLINE @classmethodNEWLINE def default_params(cls):NEWLINE return {NEWLINE 'vocab_file': None,NEWLINE 'variable_encoding_size': 128,NEWLINE 'hidden_size': 128,NEWLINE 'input_feed': False,NEWLINE 'tie_embedding': True,NEWLINE 'dropout': 0.2,NEWLINE 'beam_size': 5,NEWLINE 'max_prediction_time_step': 1200,NEWLINE 'independent_prediction_for_each_variable': FalseNEWLINE }NEWLINENEWLINE @propertyNEWLINE def independent_prediction_for_each_variable(self):NEWLINE return self.config['independent_prediction_for_each_variable']NEWLINENEWLINE @classmethodNEWLINE def build(cls, config):NEWLINE params = util.update(cls.default_params(), config)NEWLINENEWLINE vocab = Vocab.load(params['vocab_file'])NEWLINE model = cls(params['variable_encoding_size'],NEWLINE params['hidden_size'], params['dropout'], params['tie_embedding'], params['input_feed'], vocab)NEWLINE model.config = paramsNEWLINENEWLINE return modelNEWLINENEWLINE def get_init_state(self, src_ast_encoding):NEWLINE return self.encoder.get_decoder_init_state(src_ast_encoding, self.config)NEWLINENEWLINE def rnn_step(self, x, h_tm1, src_ast_encoding):NEWLINE h_t = self.lstm_cell(x, h_tm1)NEWLINE # TODO: implement attention?NEWLINE # att_t = torch.tanh(self.att_vec_linear(torch.cat([h_t], 1)))NEWLINE q_t = self.dropout(h_t[0])NEWLINENEWLINE return h_t, q_t, NoneNEWLINENEWLINE def forward(self, src_ast_encoding, prediction_target):NEWLINE # (batch_size, max_time_step)NEWLINE target_variable_encoding_indices = prediction_target['target_variable_encoding_indices']NEWLINE target_variable_encoding_indices_mask = prediction_target['target_variable_encoding_indices_mask']NEWLINENEWLINE batch_size = target_variable_encoding_indices.size(0)NEWLINE variable_encoding_size = src_ast_encoding['variable_encoding'].size(-1)NEWLINENEWLINE # (batch_size, max_time_step, encoding_size)NEWLINE # scatter variable encoding to sub-token time stepsNEWLINE variable_encoding = torch.gather(src_ast_encoding['variable_encoding'], 1,NEWLINE target_variable_encoding_indices.unsqueeze(-1).expand(-1, -1, variable_encoding_size))NEWLINE # (batch_size, max_time_step, encoding_size)NEWLINE variable_tgt_name_id = prediction_target['variable_tgt_name_id']NEWLINENEWLINE h_0 = self.get_init_state(src_ast_encoding)NEWLINE att_tm1 = variable_encoding.new_zeros(src_ast_encoding['batch_size'], self.lstm_cell.hidden_size)NEWLINE v_tm1_name_embed = torch.zeros(batch_size, self.lstm_cell.hidden_size, device=self.device)NEWLINENEWLINE h_tm1 = h_0NEWLINE query_vecs = []NEWLINE max_time_step = variable_encoding.size(1)NEWLINE for t, variable_encoding_t in enumerate(variable_encoding.split(split_size=1, dim=1)):NEWLINE # variable_encoding_t: (batch_size, encoding_size)NEWLINE variable_encoding_t = variable_encoding_t.squeeze(1)NEWLINENEWLINE if self.config['input_feed']:NEWLINE x = torch.cat([variable_encoding_t, v_tm1_name_embed, att_tm1], dim=-1)NEWLINE else:NEWLINE x = torch.cat([variable_encoding_t, v_tm1_name_embed], dim=-1)NEWLINENEWLINE h_t, q_t, alpha_t = self.rnn_step(x, h_tm1, src_ast_encoding)NEWLINENEWLINE att_tm1 = q_tNEWLINE h_tm1 = h_tNEWLINE query_vecs.append(q_t)NEWLINE v_tm1_name_id = variable_tgt_name_id[:, t]NEWLINE if self.config['tie_embedding']:NEWLINE v_tm1_name_embed = self.state2names.weight[v_tm1_name_id]NEWLINE else:NEWLINE v_tm1_name_embed = self.var_name_embed(v_tm1_name_id)NEWLINENEWLINE if self.independent_prediction_for_each_variable and t < max_time_step - 1:NEWLINE # (batch_size, )NEWLINE variable_ids_tp1 = target_variable_encoding_indices[:, t + 1]NEWLINE variable_ids_t = target_variable_encoding_indices[:, t]NEWLINENEWLINE is_tp1_same_variable = torch.eq(variable_ids_tp1, variable_ids_t).float().unsqueeze(-1) # TODO: check if correct!NEWLINE h_tm1 = (h_tm1[0] * is_tp1_same_variable, h_tm1[1] * is_tp1_same_variable)NEWLINE att_tm1 = att_tm1 * is_tp1_same_variableNEWLINE v_tm1_name_embed = v_tm1_name_embed * is_tp1_same_variableNEWLINENEWLINE # (batch_size, max_prediction_node_num, encoding_size)NEWLINE query_vecs = torch.stack(query_vecs).permute(1, 0, 2)NEWLINENEWLINE # (batch_size, max_prediction_node_num, vocab_size)NEWLINE logits = self.state2names(query_vecs)NEWLINE var_name_log_probs = torch.log_softmax(logits, dim=-1)NEWLINE var_name_log_probs = var_name_log_probs * target_variable_encoding_indices_mask.unsqueeze(-1)NEWLINENEWLINE return var_name_log_probsNEWLINENEWLINE def get_target_log_prob(self, var_name_log_probs, prediction_target, src_ast_encoding):NEWLINE # (batch_size, max_prediction_node_num)NEWLINE variable_tgt_name_id = prediction_target['variable_tgt_name_id']NEWLINE tgt_var_name_log_prob = torch.gather(var_name_log_probs,NEWLINE dim=-1, index=variable_tgt_name_id.unsqueeze(-1)).squeeze(-1)NEWLINENEWLINE tgt_var_name_log_prob = tgt_var_name_log_prob * prediction_target['target_variable_encoding_indices_mask']NEWLINENEWLINE result = dict(tgt_var_name_log_prob=tgt_var_name_log_prob)NEWLINENEWLINE return resultNEWLINENEWLINE def predict(self, examples: List[Example], encoder: Encoder) -> List[Dict]:NEWLINE batch_size = len(examples)NEWLINE beam_size = self.config['beam_size']NEWLINE same_variable_id = self.vocab.target[SAME_VARIABLE_TOKEN]NEWLINE end_of_variable_id = self.vocab.target[END_OF_VARIABLE_TOKEN]NEWLINENEWLINE variable_nums = []NEWLINE for ast_id, example in enumerate(examples):NEWLINE variable_nums.append(len(example.ast.variables))NEWLINENEWLINE beams = OrderedDict((ast_id, [self.Hypothesis([], 0, 0.)]) for ast_id in range(batch_size))NEWLINE hyp_scores_tm1 = torch.zeros(len(beams), device=self.device)NEWLINE completed_hyps = [[] for _ in range(batch_size)]NEWLINE tgt_vocab_size = len(self.vocab.target)NEWLINENEWLINE tensor_dict = self.batcher.to_tensor_dict(examples)NEWLINE nn_util.to(tensor_dict, self.device)NEWLINENEWLINE context_encoding = encoder(tensor_dict)NEWLINE h_tm1 = h_0 = self.get_init_state(context_encoding)NEWLINENEWLINE # Note that we are using the `restoration_indices` from `context_encoding`, which is the word-level restoration indexNEWLINE # (batch_size, variable_master_node_num, encoding_size)NEWLINE variable_encoding = context_encoding['variable_encoding']NEWLINE # (batch_size, encoding_size)NEWLINE variable_name_embed_tm1 = att_tm1 = torch.zeros(batch_size, self.lstm_cell.hidden_size, device=self.device)NEWLINENEWLINE max_prediction_time_step = self.config['max_prediction_time_step']NEWLINE for t in range(0, max_prediction_time_step):NEWLINE # (total_live_hyp_num, encoding_size)NEWLINE if t > 0:NEWLINE variable_encoding_t = variable_encoding[hyp_ast_ids_t, hyp_variable_ptrs_t]NEWLINE else:NEWLINE variable_encoding_t = variable_encoding[:, 0]NEWLINENEWLINE if self.config['input_feed']:NEWLINE x = torch.cat([variable_encoding_t, variable_name_embed_tm1, att_tm1], dim=-1)NEWLINE else:NEWLINE x = torch.cat([variable_encoding_t, variable_name_embed_tm1], dim=-1)NEWLINENEWLINE h_t, q_t, alpha_t = self.rnn_step(x, h_tm1, context_encoding)NEWLINENEWLINE # (total_live_hyp_num, vocab_size)NEWLINE hyp_var_name_scores_t = torch.log_softmax(self.state2names(q_t), dim=-1)NEWLINENEWLINE cont_cand_hyp_scores = hyp_scores_tm1.unsqueeze(-1) + hyp_var_name_scores_tNEWLINENEWLINE new_beams = OrderedDict()NEWLINE live_beam_ids = []NEWLINE new_hyp_scores = []NEWLINE live_prev_hyp_ids = []NEWLINE new_hyp_var_name_ids = []NEWLINE new_hyp_ast_ids = []NEWLINE new_hyp_variable_ptrs = []NEWLINE is_same_variable_mask = []NEWLINE beam_start_hyp_pos = 0NEWLINE for beam_id, (ast_id, beam) in enumerate(beams.items()):NEWLINE beam_end_hyp_pos = beam_start_hyp_pos + len(beam)NEWLINE # (live_beam_size, vocab_size)NEWLINE beam_cont_cand_hyp_scores = cont_cand_hyp_scores[beam_start_hyp_pos: beam_end_hyp_pos]NEWLINE cont_beam_size = beam_size - len(completed_hyps[ast_id])NEWLINE beam_new_hyp_scores, beam_new_hyp_positions = torch.topk(beam_cont_cand_hyp_scores.view(-1),NEWLINE k=cont_beam_size,NEWLINE dim=-1)NEWLINENEWLINE # (cont_beam_size)NEWLINE beam_prev_hyp_ids = beam_new_hyp_positions / tgt_vocab_sizeNEWLINE beam_hyp_var_name_ids = beam_new_hyp_positions % tgt_vocab_sizeNEWLINENEWLINE _prev_hyp_ids = beam_prev_hyp_ids.cpu()NEWLINE _hyp_var_name_ids = beam_hyp_var_name_ids.cpu()NEWLINE _new_hyp_scores = beam_new_hyp_scores.cpu()NEWLINENEWLINE for i in range(cont_beam_size):NEWLINE prev_hyp_id = _prev_hyp_ids[i].item()NEWLINE prev_hyp = beam[prev_hyp_id]NEWLINE hyp_var_name_id = _hyp_var_name_ids[i].item()NEWLINE new_hyp_score = _new_hyp_scores[i].item()NEWLINENEWLINE variable_ptr = prev_hyp.variable_ptrNEWLINE if hyp_var_name_id == end_of_variable_id:NEWLINE variable_ptr += 1NEWLINENEWLINE # remove empty casesNEWLINE if len(prev_hyp.variable_list) == 0 or prev_hyp.variable_list[-1] == end_of_variable_id:NEWLINE continueNEWLINENEWLINE new_hyp = self.Hypothesis(variable_list=list(prev_hyp.variable_list) + [hyp_var_name_id],NEWLINE variable_ptr=variable_ptr,NEWLINE score=new_hyp_score)NEWLINENEWLINE if variable_ptr == variable_nums[ast_id]:NEWLINE completed_hyps[ast_id].append(new_hyp)NEWLINE else:NEWLINE new_beams.setdefault(ast_id, []).append(new_hyp)NEWLINE live_beam_ids.append(beam_id)NEWLINE new_hyp_scores.append(new_hyp_score)NEWLINE live_prev_hyp_ids.append(beam_start_hyp_pos + prev_hyp_id)NEWLINE new_hyp_var_name_ids.append(hyp_var_name_id)NEWLINE new_hyp_ast_ids.append(ast_id)NEWLINE new_hyp_variable_ptrs.append(variable_ptr)NEWLINE is_same_variable_mask.append(1. if prev_hyp.variable_ptr == variable_ptr else 0.)NEWLINENEWLINE beam_start_hyp_pos = beam_end_hyp_posNEWLINENEWLINE if live_beam_ids:NEWLINE hyp_scores_tm1 = torch.tensor(new_hyp_scores, device=self.device)NEWLINE h_tm1 = (h_t[0][live_prev_hyp_ids], h_t[1][live_prev_hyp_ids])NEWLINE att_tm1 = q_t[live_prev_hyp_ids]NEWLINENEWLINE variable_name_embed_tm1 = self.state2names.weight[new_hyp_var_name_ids]NEWLINE hyp_ast_ids_t = new_hyp_ast_idsNEWLINE hyp_variable_ptrs_t = new_hyp_variable_ptrsNEWLINENEWLINE beams = new_beamsNEWLINENEWLINE if self.independent_prediction_for_each_variable:NEWLINE is_same_variable_mask = torch.tensor(is_same_variable_mask, device=self.device, dtype=torch.float).unsqueeze(-1)NEWLINE h_tm1 = (h_tm1[0] * is_same_variable_mask, h_tm1[1] * is_same_variable_mask)NEWLINE att_tm1 = att_tm1 * is_same_variable_maskNEWLINE variable_name_embed_tm1 = variable_name_embed_tm1 * is_same_variable_maskNEWLINE else:NEWLINE breakNEWLINENEWLINE variable_rename_results = []NEWLINE for i, hyps in enumerate(completed_hyps):NEWLINE variable_rename_result = dict()NEWLINE ast = examples[i].astNEWLINE hyps = sorted(hyps, key=lambda hyp: -hyp.score)NEWLINENEWLINE if not hyps:NEWLINE # return identity renamingsNEWLINE print(f'Failed to found a hypothesis for function {ast.compilation_unit}', file=sys.stderr)NEWLINE for old_name in ast.variables:NEWLINE variable_rename_result[old_name] = {'new_name': old_name,NEWLINE 'prob': 0.}NEWLINE else:NEWLINE top_hyp = hyps[0]NEWLINE sub_token_ptr = 0NEWLINE for old_name in ast.variables:NEWLINE sub_token_begin = sub_token_ptrNEWLINE while top_hyp.variable_list[sub_token_ptr] != end_of_variable_id:NEWLINE sub_token_ptr += 1NEWLINE sub_token_ptr += 1 # point to first sub-token of next variableNEWLINE sub_token_end = sub_token_ptrNEWLINENEWLINE var_name_token_ids = top_hyp.variable_list[sub_token_begin: sub_token_end] # include ending </s>NEWLINE if var_name_token_ids == [same_variable_id, end_of_variable_id]:NEWLINE new_var_name = old_nameNEWLINE else:NEWLINE new_var_name = self.vocab.target.subtoken_model.decode_ids(var_name_token_ids)NEWLINENEWLINE variable_rename_result[old_name] = {'new_name': new_var_name,NEWLINE 'prob': top_hyp.score}NEWLINENEWLINE variable_rename_results.append(variable_rename_result)NEWLINENEWLINE return variable_rename_resultsNEWLINE |
from bingads.v13.bulk.entities.audiences.bulk_campaign_audience_association import BulkCampaignAudienceAssociationNEWLINENEWLINEclass BulkCampaignProductAudienceAssociation(BulkCampaignAudienceAssociation):NEWLINE """ Represents an Campaign Product Audience Association that can be read or written in a bulk file.NEWLINENEWLINE For more information, see Campaign Product Audience Association at https://go.microsoft.com/fwlink/?linkid=846127.NEWLINENEWLINE *See also:*NEWLINENEWLINE * :class:`.BulkServiceManager`NEWLINE * :class:`.BulkOperation`NEWLINE * :class:`.BulkFileReader`NEWLINE * :class:`.BulkFileWriter`NEWLINE """NEWLINE |
from pycocotools.coco import COCONEWLINENEWLINEimport matplotlib.pyplot as pltNEWLINEimport cv2NEWLINENEWLINEimport osNEWLINEimport numpy as npNEWLINEimport randomNEWLINEimport torchNEWLINEimport torchvision.transforms as transformsNEWLINEfrom torch.utils.data import DataLoader,DatasetNEWLINEfrom skimage import io,transformNEWLINEimport matplotlib.pyplot as pltNEWLINEimport osNEWLINEimport torchNEWLINEfrom torchvision import transformsNEWLINEimport numpy as npNEWLINEimport PIL.Image as ImageNEWLINEfrom skimage import measureNEWLINEfrom tqdm import tqdmNEWLINEimport torch.nn.functional as FNEWLINEfrom skimage.morphology import convex_hull_imageNEWLINENEWLINEclass SuperPixelGet(Dataset): #继承DatasetNEWLINE def __init__(self, segments_label, segments_tensor, g_theta_m, data_num):NEWLINE self.segments_label = segments_label.cuda()NEWLINE self.segments_tensor = segments_tensor.cuda()NEWLINE self.g_theta_m = g_theta_m.cuda()NEWLINE self.data_num = data_numNEWLINENEWLINENEWLINE self.zero_layer = torch.zeros_like(self.segments_tensor)NEWLINE self.one_layer = torch.ones_like(self.segments_tensor)NEWLINENEWLINE NEWLINE def __len__(self):NEWLINE return self.data_numNEWLINE NEWLINE def __getitem__(self, index):NEWLINENEWLINE attack_region_tmp = self.zero_layer.clone()NEWLINE flag = torch.rand_like( self.segments_label) < self.g_theta_m NEWLINE for i in range(flag.shape[0]):NEWLINE if flag[i]:NEWLINE sp = self.segments_label[i]NEWLINE attack_region_tmp = torch.where(self.segments_tensor==sp, self.one_layer, attack_region_tmp)NEWLINE NEWLINE # # get convex envolopeNEWLINE # attack_region_tmp_np = attack_region_tmp.cpu().numpy()NEWLINE # attack_region_tmp_label_np = measure.label(attack_region_tmp_np)NEWLINE # connect_region_number = int(np.max(attack_region_tmp_label_np))NEWLINE NEWLINE # one_np = np.ones_like(attack_region_tmp_np)NEWLINE # zero_np = np.zeros_like(attack_region_tmp_np)NEWLINE # attack_region_envolope_np = np.zeros_like(attack_region_tmp_np)NEWLINENEWLINE # for i in range(connect_region_number):NEWLINE # binary_map = np.where(attack_region_tmp_label_np==i+1, one_np, zero_np)NEWLINE # convex_env = convex_hull_image(binary_map)NEWLINENEWLINE # attack_region_envolope_np = attack_region_envolope_np + convex_envNEWLINE # passNEWLINENEWLINENEWLINE # attack_region_tmp = torch.from_numpy(attack_region_envolope_np)NEWLINE # attack_region_tmp = torch.clamp(attack_region_tmp, 0, 1).cuda()NEWLINENEWLINE return attack_region_tmp, flagNEWLINENEWLINEif __name__=='__main__':NEWLINE segments_tensor = [NEWLINE [0,0,1,1,1,2,2,2,3,3,4,4,5,5,5,0,0],NEWLINE [0,0,1,1,1,2,2,2,3,3,4,4,4,5,5,0,0],NEWLINE [0,0,1,1,1,2,3,3,3,3,4,4,4,5,5,0,0],NEWLINE [0,0,1,1,1,2,2,2,3,3,4,4,6,6,5,0,0],NEWLINE [0,0,1,1,1,2,2,2,3,3,4,4,6,6,5,0,0],NEWLINE [0,0,1,1,1,2,2,2,3,3,4,4,6,6,5,0,0],NEWLINE [0,0,1,1,1,2,2,2,3,3,4,4,6,6,5,0,0],NEWLINE [0,0,1,1,1,2,2,2,3,3,4,4,6,6,5,0,0],NEWLINE [0,0,1,1,1,2,2,2,3,3,4,4,6,6,5,0,0],NEWLINE [0,0,1,1,1,2,2,2,3,3,4,4,6,6,5,0,0],NEWLINE [0,0,1,1,1,2,2,2,3,3,4,4,6,6,5,0,0],NEWLINE [0,0,1,1,1,2,2,2,3,3,4,4,6,6,5,0,0],NEWLINE ]NEWLINE segments_tensor = torch.Tensor(segments_tensor)NEWLINE g_theta_m = torch.Tensor([0.1,0.2,0.3,0.4,0.5,0.6])NEWLINE data_num = 555NEWLINE data = SuperPixelGet(torch.Tensor([1,2,3,4,5,6]), segments_tensor, g_theta_m, data_num)NEWLINE dataloader = DataLoader(data, batch_size=128,shuffle=False) #使用DataLoader加载数据NEWLINENEWLINE max_len = 0NEWLINE for epoch in range(10):NEWLINE for i_batch, batch_data in enumerate(dataloader):NEWLINENEWLINE sum_tensor = torch.sum(batch_data, dim=0)NEWLINE sum_tensor = sum_tensor/torch.max(sum_tensor)NEWLINE sum_tensor = sum_tensor.unsqueeze(0).unsqueeze(0)NEWLINE sum_tensor = F.interpolate(sum_tensor, (800, 800), mode='nearest').squeeze()NEWLINE sum_pil = transforms.ToPILImage()(sum_tensor)NEWLINE sum_pil.show()NEWLINENEWLINE passNEWLINENEWLINENEWLINE |
# Licensed under the Apache License, Version 2.0 (the "License"); you mayNEWLINE# not use this file except in compliance with the License. You may obtainNEWLINE# a copy of the License atNEWLINE#NEWLINE# http://www.apache.org/licenses/LICENSE-2.0NEWLINE#NEWLINE# Unless required by applicable law or agreed to in writing, softwareNEWLINE# distributed under the License is distributed on an "AS IS" BASIS, WITHOUTNEWLINE# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See theNEWLINE# License for the specific language governing permissions and limitationsNEWLINE# under the License.NEWLINENEWLINEfrom neutron.objects.qos import policy as qos_policyNEWLINEfrom neutron.objects.qos import rule as qos_ruleNEWLINEfrom neutron_lib.api.definitions import portbindingsNEWLINEfrom neutron_lib import constantsNEWLINEfrom neutron_lib import context as n_contextNEWLINEfrom neutron_lib.db import constants as db_constsNEWLINEfrom neutron_lib.plugins import directoryNEWLINEfrom neutron_lib.services.qos import baseNEWLINEfrom neutron_lib.services.qos import constants as qos_constsNEWLINEfrom oslo_config import cfgNEWLINEfrom oslo_log import log as loggingNEWLINENEWLINEfrom networking_ovn.common import utilsNEWLINENEWLINELOG = logging.getLogger(__name__)NEWLINENEWLINEOVN_QOS = 'qos'NEWLINESUPPORTED_RULES = {NEWLINE qos_consts.RULE_TYPE_BANDWIDTH_LIMIT: {NEWLINE qos_consts.MAX_KBPS: {NEWLINE 'type:range': [0, db_consts.DB_INTEGER_MAX_VALUE]},NEWLINE qos_consts.MAX_BURST: {NEWLINE 'type:range': [0, db_consts.DB_INTEGER_MAX_VALUE]},NEWLINE qos_consts.DIRECTION: {NEWLINE 'type:values': [constants.EGRESS_DIRECTION]}NEWLINE },NEWLINE}NEWLINENEWLINEVIF_TYPES = [portbindings.VIF_TYPE_OVS, portbindings.VIF_TYPE_VHOST_USER]NEWLINEVNIC_TYPES = [portbindings.VNIC_NORMAL]NEWLINENEWLINENEWLINEclass OVNQosNotificationDriver(base.DriverBase):NEWLINE """OVN notification driver for QoS."""NEWLINENEWLINE def __init__(self, name='OVNQosDriver',NEWLINE vif_types=VIF_TYPES,NEWLINE vnic_types=VNIC_TYPES,NEWLINE supported_rules=SUPPORTED_RULES,NEWLINE requires_rpc_notifications=False):NEWLINE super(OVNQosNotificationDriver, self).__init__(NEWLINE name, vif_types, vnic_types, supported_rules,NEWLINE requires_rpc_notifications)NEWLINENEWLINE @classmethodNEWLINE def create(cls, plugin_driver):NEWLINE cls._driver = plugin_driverNEWLINE return cls()NEWLINENEWLINE @propertyNEWLINE def is_loaded(self):NEWLINE return OVN_QOS in cfg.CONF.ml2.extension_driversNEWLINENEWLINE def create_policy(self, context, policy):NEWLINE # No need to update OVN on createNEWLINE passNEWLINENEWLINE def update_policy(self, context, policy):NEWLINE # Call into OVN client to update the policyNEWLINE self._driver._ovn_client._qos_driver.update_policy(context, policy)NEWLINENEWLINE def delete_policy(self, context, policy):NEWLINE # No need to update OVN on deleteNEWLINE passNEWLINENEWLINENEWLINEclass OVNQosDriver(object):NEWLINE """Qos driver for OVN"""NEWLINENEWLINE def __init__(self, driver):NEWLINE LOG.info("Starting OVNQosDriver")NEWLINE super(OVNQosDriver, self).__init__()NEWLINE self._driver = driverNEWLINE self._plugin_property = NoneNEWLINENEWLINE @propertyNEWLINE def _plugin(self):NEWLINE if self._plugin_property is None:NEWLINE self._plugin_property = directory.get_plugin()NEWLINE return self._plugin_propertyNEWLINENEWLINE def _generate_port_options(self, context, policy_id):NEWLINE if policy_id is None:NEWLINE return {}NEWLINE options = {}NEWLINE # The policy might not have any rulesNEWLINE all_rules = qos_rule.get_rules(qos_policy.QosPolicy,NEWLINE context, policy_id)NEWLINE for rule in all_rules:NEWLINE if isinstance(rule, qos_rule.QosBandwidthLimitRule):NEWLINE if rule.max_kbps:NEWLINE options['qos_max_rate'] = str(rule.max_kbps * 1000)NEWLINE if rule.max_burst_kbps:NEWLINE options['qos_burst'] = str(rule.max_burst_kbps * 1000)NEWLINE return optionsNEWLINENEWLINE def get_qos_options(self, port):NEWLINE # Is qos service enabledNEWLINE if 'qos_policy_id' not in port:NEWLINE return {}NEWLINE # Don't apply qos rules to network devicesNEWLINE if utils.is_network_device_port(port):NEWLINE return {}NEWLINENEWLINE # Determine if port or network policy should be usedNEWLINE context = n_context.get_admin_context()NEWLINE port_policy_id = port.get('qos_policy_id')NEWLINE network_policy_id = NoneNEWLINE if not port_policy_id:NEWLINE network_policy = qos_policy.QosPolicy.get_network_policy(NEWLINE context, port['network_id'])NEWLINE network_policy_id = network_policy.id if network_policy else NoneNEWLINENEWLINE # Generate qos options for the selected policyNEWLINE policy_id = port_policy_id or network_policy_idNEWLINE return self._generate_port_options(context, policy_id)NEWLINENEWLINE def _update_network_ports(self, context, network_id, options):NEWLINE # Retrieve all ports for this networkNEWLINE ports = self._plugin.get_ports(context,NEWLINE filters={'network_id': [network_id]})NEWLINE for port in ports:NEWLINE # Don't apply qos rules if port has a policyNEWLINE port_policy_id = port.get('qos_policy_id')NEWLINE if port_policy_id:NEWLINE continueNEWLINE # Don't apply qos rules to network devicesNEWLINE if utils.is_network_device_port(port):NEWLINE continueNEWLINE # Call into OVN client to update portNEWLINE self._driver.update_port(port, qos_options=options)NEWLINENEWLINE def update_network(self, network):NEWLINE # Is qos service enabledNEWLINE if 'qos_policy_id' not in network:NEWLINE returnNEWLINENEWLINE # Update the qos options on each network portNEWLINE context = n_context.get_admin_context()NEWLINE options = self._generate_port_options(NEWLINE context, network['qos_policy_id'])NEWLINE self._update_network_ports(context, network.get('id'), options)NEWLINENEWLINE def update_policy(self, context, policy):NEWLINE options = self._generate_port_options(context, policy.id)NEWLINENEWLINE # Update each network bound to this policyNEWLINE network_bindings = policy.get_bound_networks()NEWLINE for network_id in network_bindings:NEWLINE self._update_network_ports(context, network_id, options)NEWLINENEWLINE # Update each port bound to this policyNEWLINE port_bindings = policy.get_bound_ports()NEWLINE for port_id in port_bindings:NEWLINE port = self._plugin.get_port(context, port_id)NEWLINE self._driver.update_port(port, qos_options=options)NEWLINE |
from discord.ext import commandsNEWLINEimport discordNEWLINEimport requestsNEWLINEfrom bs4 import BeautifulSoupNEWLINEimport reNEWLINENEWLINEclass neorg_cmds(commands.Cog):NEWLINENEWLINE def __init__(self, bot):NEWLINE self.bot = botNEWLINENEWLINE @commands.command()NEWLINE async def wiki(self, ctx, *, query):NEWLINE query = query.strip().lower().replace(' ', '-')NEWLINE neorg_wiki = {}NEWLINE wiki_url = "https://github.com/vhyrro/neorg/wiki"NEWLINENEWLINE stuff = BeautifulSoup(requests.get(wiki_url).text, 'lxml')NEWLINE lis = stuff.find_all("div", {"class": "Box-body wiki-custom-sidebar markdown-body"})[0]NEWLINENEWLINE for li in lis.find_all('li'):NEWLINE part = li.a['href']NEWLINE neorg_wiki[part[37:].lower()] = partNEWLINENEWLINE wiki = [neorg_wiki[k] for k in neorg_wiki.keys() if query in k.lower()]NEWLINENEWLINE if len(wiki) == 0:NEWLINE await ctx.send(embed=discord.Embed(description="No Results Found!", colour=0x4878BE))NEWLINE returnNEWLINE NEWLINE for i in wiki:NEWLINE em = discord.Embed(description=i, colour=0x4878BE)NEWLINE await ctx.send(embed=em)NEWLINENEWLINE @commands.command()NEWLINE async def spec(self, ctx, *, query):NEWLINE query = query.strip().lower().replace(' ', '-')NEWLINE url = "https://raw.githubusercontent.com/vhyrro/neorg/main/docs/NFF-0.1-spec.md"NEWLINE og_url = "https://github.com/vhyrro/neorg/blob/main/docs/NFF-0.1-spec.md"NEWLINENEWLINE soup = re.findall( r"\[(.+)\]\((.+)\)", requests.get(url).text[:1500])NEWLINE neorg_specs = {}NEWLINENEWLINE for k,v in soup:NEWLINE neorg_specs[k.lower().replace(' ', '-')] = og_url + vNEWLINENEWLINE spec = [neorg_specs[k] for k in neorg_specs.keys() if query in k.lower()]NEWLINENEWLINE if len(spec) == 0:NEWLINE await ctx.send(embed=discord.Embed(description="No Results Found!", colour=0x4878BE))NEWLINE returnNEWLINENEWLINE for i in spec:NEWLINE em = discord.Embed(description=i, colour=0x4878BE)NEWLINE await ctx.send(embed=em)NEWLINENEWLINE @commands.command(aliases=["norg"])NEWLINE async def neorg(self, ctx):NEWLINE """Fetch the Neorg repository"""NEWLINE await ctx.send("Neorg - https://github.com/vhyrro/neorg")NEWLINENEWLINEdef setup(bot):NEWLINE bot.add_cog(neorg_cmds(bot))NEWLINE |
from django.db import modelsNEWLINEtipo_choices=(NEWLINE ('colegio','Colegio'),NEWLINE ('iglesia','Iglesia'),NEWLINE ('plaza','Plaza'),NEWLINE ('restaurante','Restaurante'),NEWLINE ('alojamiento','Alojamiento'),NEWLINE )NEWLINENEWLINEclass admin_agregar (models.Model):NEWLINE cod_ubicacion= models.AutoField(primary_key = True)NEWLINE latitud = models.CharField(max_length=200, blank=False, null=False)NEWLINE longitud = models.CharField(max_length=200, blank=False, null=False)NEWLINE tipo = models.CharField(max_length=200, blank=False, null=False, choices=tipo_choices)NEWLINE def __STR__(self):NEWLINE return self.tipoNEWLINENEWLINEclass colegio(models.Model):NEWLINE cod_colegio=models.AutoField(primary_key=True)NEWLINE nombre= models.CharField(max_length=200, blank=False, null=False)NEWLINE fecha_fundacion = models.CharField(max_length=200,blank=False, null=False)NEWLINE clasificacion = models.CharField(max_length=200, blank=False)NEWLINE cod_ubicacion=models.ForeignKey(admin_agregar, on_delete=models.CASCADE)NEWLINENEWLINEclass iglesia(models.Model):NEWLINE cod_iglesia=models.AutoField(primary_key=True)NEWLINE nombre= models.CharField(max_length=200, blank=False, null=False)NEWLINE fecha_fundacion = models.CharField(max_length=200,blank=False, null=False)NEWLINE religion= models.CharField(max_length=200, blank=False, null=False)NEWLINE capacidad=models.CharField(max_length=200, blank=False, null=False)NEWLINE cod_ubicacion=models.ForeignKey(admin_agregar, on_delete=models.CASCADE)NEWLINENEWLINEclass alojamiento(models.Model):NEWLINE cod_alojamiento=models.AutoField(primary_key=True)NEWLINE nombre= models.CharField(max_length=200, blank=False, null=False)NEWLINE clasificacion = models.CharField(max_length=200,blank=False, null=False)NEWLINE fecha_fundacion = models.CharField(max_length=200,blank=False, null=False)NEWLINE cod_ubicacion=models.ForeignKey(admin_agregar, on_delete=models.CASCADE)NEWLINENEWLINEclass plaza(models.Model):NEWLINE cod_plaza=models.AutoField(primary_key=True)NEWLINE nombre=models.CharField(max_length=200, blank=False, null=False)NEWLINE fecha_fundacion = models.DateField(blank=False, null=False)NEWLINE cod_ubicacion=models.OneToOneField(admin_agregar, on_delete=models.CASCADE)NEWLINENEWLINENEWLINENEWLINEclass restaurante(models.Model):NEWLINE cod_restaurante=models.AutoField(primary_key=True)NEWLINE nombre=models.CharField(max_length=200, blank=False, null=False)NEWLINE capacidad=models.CharField(max_length=200, blank=False, null=False)NEWLINE clasificacion = models.CharField(max_length=200,blank=False, null=False)NEWLINE cod_ubicacion= models.ForeignKey(admin_agregar, on_delete=models.CASCADE) |
#NEWLINE# PySNMP MIB module DES-1210-28MEbx (http://snmplabs.com/pysmi)NEWLINE# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/DES-1210-28MEbxNEWLINE# Produced by pysmi-0.3.4 at Wed May 1 12:38:52 2019NEWLINE# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4NEWLINE# Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) NEWLINE#NEWLINEInteger, OctetString, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "Integer", "OctetString", "ObjectIdentifier")NEWLINENamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")NEWLINEConstraintsIntersection, ConstraintsUnion, ValueRangeConstraint, SingleValueConstraint, ValueSizeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsIntersection", "ConstraintsUnion", "ValueRangeConstraint", "SingleValueConstraint", "ValueSizeConstraint")NEWLINEdot1dBasePort, dot1dBasePortEntry, dot1dBridge = mibBuilder.importSymbols("BRIDGE-MIB", "dot1dBasePort", "dot1dBasePortEntry", "dot1dBridge")NEWLINEAddressFamilyNumbers, = mibBuilder.importSymbols("IANA-ADDRESS-FAMILY-NUMBERS-MIB", "AddressFamilyNumbers")NEWLINEInterfaceIndex, InterfaceIndexOrZero = mibBuilder.importSymbols("IF-MIB", "InterfaceIndex", "InterfaceIndexOrZero")NEWLINEInetAddress, = mibBuilder.importSymbols("INET-ADDRESS-MIB", "InetAddress")NEWLINEVlanId, = mibBuilder.importSymbols("Q-BRIDGE-MIB", "VlanId")NEWLINESnmpSecurityLevel, SnmpEngineID, SnmpAdminString = mibBuilder.importSymbols("SNMP-FRAMEWORK-MIB", "SnmpSecurityLevel", "SnmpEngineID", "SnmpAdminString")NEWLINEModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup")NEWLINEBits, ObjectIdentity, ModuleIdentity, Unsigned32, NotificationType, MibIdentifier, iso, Gauge32, Integer32, enterprises, MibScalar, MibTable, MibTableRow, MibTableColumn, TimeTicks, Counter32, IpAddress, Counter64 = mibBuilder.importSymbols("SNMPv2-SMI", "Bits", "ObjectIdentity", "ModuleIdentity", "Unsigned32", "NotificationType", "MibIdentifier", "iso", "Gauge32", "Integer32", "enterprises", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "TimeTicks", "Counter32", "IpAddress", "Counter64")NEWLINETruthValue, MacAddress, RowStatus, DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "TruthValue", "MacAddress", "RowStatus", "DisplayString", "TextualConvention")NEWLINEdes_1210_28mebx = ModuleIdentity((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2)).setLabel("des-1210-28mebx")NEWLINEdes_1210_28mebx.setRevisions(('2015-06-03 00:00', '2015-04-16 00:00', '2014-03-06 00:00',))NEWLINENEWLINEif getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):NEWLINE if mibBuilder.loadTexts: des_1210_28mebx.setRevisionsDescriptions((' In order to pass the web www.simpleweb.org to verify severity level 3, which must be change the SYNTAX of mib file.', 'Add trafficCtrlAutoRecoverTime object.', 'Initial version, published as D-Link des-1210 28ME mib.',))NEWLINEif mibBuilder.loadTexts: des_1210_28mebx.setLastUpdated('201506030000Z')NEWLINEif mibBuilder.loadTexts: des_1210_28mebx.setOrganization('DES-1210-28-BX-6-07-017.mib')NEWLINEif mibBuilder.loadTexts: des_1210_28mebx.setContactInfo('')NEWLINEif mibBuilder.loadTexts: des_1210_28mebx.setDescription(' In order to pass the web www.simpleweb.org to verify severity level 3, which must be change the SYNTAX of mib file.')NEWLINEd_link = MibIdentifier((1, 3, 6, 1, 4, 1, 171)).setLabel("d-link")NEWLINEdlink_products = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10)).setLabel("dlink-products")NEWLINEdlink_DES1210SeriesProd = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75)).setLabel("dlink-DES1210SeriesProd")NEWLINEdes_1210_28me = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15)).setLabel("des-1210-28me")NEWLINEclass VlanIndex(TextualConvention, Unsigned32):NEWLINE description = 'A value used to index per-VLAN tables: values of 0 and 4095 are not permitted; if the value is between 1 and 4094 inclusive, it represents an IEEE 802.1Q VLAN-ID with global scope within a given bridged domain (see VlanId textual convention). If the value is greater than 4095 then it represents a VLAN with scope local to the particular agent, i.e. one without a global VLAN-ID assigned to it. Such VLANs are outside the scope of IEEE 802.1Q but it is convenient to be able to manage them in the same way using this MIB.'NEWLINE status = 'current'NEWLINENEWLINEclass PortList(TextualConvention, OctetString):NEWLINE description = "Each octet within this value specifies a set of eight ports, with the first octet specifying ports 1 through 8, the second octet specifying ports 9 through 16, etc. Within each octet, the most significant bit represents the lowest numbered port, and the least significant bit represents the highest numbered port. Thus, each port of the bridge is represented by a single bit within the value of this object. If that bit has a value of '1' then that port is included in the set of ports; the port is not included if its bit has a value of '0'."NEWLINE status = 'current'NEWLINENEWLINEclass BridgeId(TextualConvention, OctetString):NEWLINE description = "The Bridge-Identifier as used in the Spanning Tree Protocol to uniquely identify a bridge. Its first two octets (in network byte order) contain a priority value and its last 6 octets contain the MAC address used to refer to a bridge in a unique fashion (typically, the numerically smallest MAC address of all ports on the bridge). Several objects in this MIB module represent values of timers used by the Spanning Tree Protocol. In this MIB, these timers have values in units of hundreths of a second (i.e. 1/100 secs). These timers, when stored in a Spanning Tree Protocol's BPDU, are in units of 1/256 seconds. Note, however, that 802.1D-1990 specifies a settable granularity of no more than 1 second for these timers. To avoid ambiguity, a data type is defined here as a textual convention and all representation of these timers in this MIB module are defined using this data type. An algorithm is also defined for converting between the different units, to ensure a timer's value is not distorted by multiple conversions."NEWLINE status = 'current'NEWLINE subtypeSpec = OctetString.subtypeSpec + ValueSizeConstraint(8, 8)NEWLINE fixedLength = 8NEWLINENEWLINEclass Timeout(TextualConvention, Integer32):NEWLINE description = 'A STP timer in units of 1/100 seconds To convert a Timeout value into a value in units of 1/256 seconds, the following algorithm should be used: b = floor( (n * 256) / 100) where: floor = quotient [ignore remainder] n is the value in 1/100 second units b is the value in 1/256 second units To convert the value from 1/256 second units back to 1/100 seconds, the following algorithm should be used: n = ceiling( (b * 100) / 256) where: ceiling = quotient [if remainder is 0], or quotient + 1 [if remainder is non-zero] n is the value in 1/100 second units b is the value in 1/256 second units Note: it is important that the arithmetic operations are done in the order specified (i.e., multiply first, divide second).'NEWLINE status = 'current'NEWLINE displayHint = 'd4'NEWLINENEWLINEclass LldpManAddress(TextualConvention, OctetString):NEWLINE description = 'The value of a management address associated with the LLDP agent that may be used to reach higher layer entities to assist discovery by network management. It should be noted that appropriate security credentials, such as SNMP engineId, may be required to access the LLDP agent using a management address. These necessary credentials should be known by the network management and the objects associated with the credentials are not included in the LLDP agent.'NEWLINE status = 'current'NEWLINE subtypeSpec = OctetString.subtypeSpec + ValueSizeConstraint(1, 31)NEWLINENEWLINEclass OwnerString(TextualConvention, OctetString):NEWLINE description = "This data type is used to model an administratively assigned name of the owner of a resource. Implementations must accept values composed of well-formed NVT ASCII sequences. In addition, implementations should accept values composed of well-formed UTF-8 sequences. It is suggested that this name contain one or more of the following: IP address, management station name, network manager's name, location, or phone number. In some cases the agent itself will be the owner of an entry. In these cases, this string shall be set to a string starting with 'monitor'. SNMP access control is articulated entirely in terms of the contents of MIB views; access to a particular SNMP object instance depends only upon its presence or absence in a particular MIB view and never upon its value or the value of related object instances. Thus, objects of this type afford resolution of resource contention only among cooperating managers; they realize no access control function with respect to uncooperative parties."NEWLINE status = 'current'NEWLINE subtypeSpec = OctetString.subtypeSpec + ValueSizeConstraint(0, 127)NEWLINENEWLINEclass RmonStatus(TextualConvention, Integer32):NEWLINE description = 'The status of a table entry. Setting this object to the value invalid(4) has the effect of invalidating the corresponding entry. That is, it effectively disassociates the mapping identified with said entry. It is an implementation-specific matter as to whether the agent removes an invalidated entry from the table. Accordingly, management stations must be prepared to receive tabular information from agents that corresponds to entries currently not in use. Proper interpretation of such entries requires examination of the relevant RmonStatus object. An existing instance of this object cannot be set to createRequest(2). This object may only be set to createRequest(2) when this instance is created. When this object is created, the agent may wish to create supplemental object instances with default values to complete a conceptual row in this table. Because the creation of these default objects is entirely at the option of the agent, the manager must not assume that any will be created, but may make use of any that are created. Immediately after completing the create operation, the agent must set this object to underCreation(3). When in the underCreation(3) state, an entry is allowed to exist in a possibly incomplete, possibly inconsistent state, usually to allow it to be modified in multiple PDUs. When in this state, an entry is not fully active. Entries shall exist in the underCreation(3) state until the management station is finished configuring the entry and sets this object to valid(1) or aborts, setting this object to invalid(4). If the agent determines that an entry has been in the underCreation(3) state for an abnormally long time, it may decide that the management station has crashed. If the agent makes this decision, it may set this object to invalid(4) to reclaim the entry. A prudent agent will understand that the management station may need to wait for human input and will allow for that possibility in its determination of this abnormally long period. An entry in the valid(1) state is fully configured and consistent and fully represents the configuration or operation such a row is intended to represent. For example, it could be a statistical function that is configured and active, or a filter that is available in the list of filters processed by the packet capture process. A manager is restricted to changing the state of an entry in the following ways: To: valid createRequest underCreation invalid From: valid OK NO OK OK createRequest N/A N/A N/A N/A underCreation OK NO OK OK invalid NO NO NO OK nonExistent NO OK NO OK In the table above, it is not applicable to move the state from the createRequest state to any other state because the manager will never find the variable in that state. The nonExistent state is not a value of the enumeration, rather it means that the entryStatus variable does not exist at all. An agent may allow an entryStatus variable to change state in additional ways, so long as the semantics of the states are followed. This allowance is made to ease the implementation of the agent and is made despite the fact that managers should never exercise these additional state transitions.'NEWLINE status = 'current'NEWLINE subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))NEWLINE namedValues = NamedValues(("valid", 1), ("createRequest", 2), ("underCreation", 3), ("invalid", 4))NEWLINENEWLINEclass Ipv6Address(TextualConvention, OctetString):NEWLINE description = 'This data type is used to model IPv6 addresses. This is a binary string of 16 octets in network byte-order.'NEWLINE status = 'current'NEWLINE displayHint = '2x:'NEWLINE subtypeSpec = OctetString.subtypeSpec + ValueSizeConstraint(16, 16)NEWLINE fixedLength = 16NEWLINENEWLINEcompanySystem = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 1))NEWLINEcompanyIpifGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 2))NEWLINEcompanyTftpGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 3))NEWLINEcompanyMiscGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 4))NEWLINEcompanySNMPV3 = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 5))NEWLINEcompanySTP = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 6))NEWLINEcompanyDot1qVlanGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 7))NEWLINEcompanyLA = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 8))NEWLINEcompanyStaticMAC = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 9))NEWLINEcompanyIgsGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 10))NEWLINEcompanyGVRPGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 11))NEWLINEcompanyQoSGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12))NEWLINEcompanyTrafficMgmt = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 13))NEWLINEcompanySecurity = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14))NEWLINEcompanyACLGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15))NEWLINEcompanySyslog = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 16))NEWLINEcompanyLBD = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 17))NEWLINEcompanyMirror = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 18))NEWLINEcompanyStaticMcast = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 19))NEWLINEcompanySNTPSetting = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 20))NEWLINEcompanyRMON = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 22))NEWLINEcompanyAuthGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 23))NEWLINEcompanyGuestVlan = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 24))NEWLINEcompanyMacNotify = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 25))NEWLINEcompanyISMVLAN = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 27))NEWLINEcompanyDHCPRelay = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 28))NEWLINEcompanyDHCPLocalRelay = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 29))NEWLINEcompanyTrapSetting = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 30))NEWLINEsysFirmwareInfomation = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 1, 31))NEWLINEcompanyLLDPSetting = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32))NEWLINEcompanyCPUInterfaceFilterGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33))NEWLINEcompanyStaticARP = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 34))NEWLINEcompanyCableDiagnostic = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 35))NEWLINEcompanyVLANTrunk = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 36))NEWLINEcompanyQinQ = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 37))NEWLINEcompanyTimeRangeMgmt = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 38))NEWLINEcompanySMTP = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 40))NEWLINEcompanyLimitIp = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 45))NEWLINEcompanyGratuitousARP = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 48))NEWLINEcompanyMulticastFilter = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 49))NEWLINEcompanyNeighbor = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 50))NEWLINEcompanyEoam = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 51))NEWLINEcompanyDuld = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 52))NEWLINEcompanyMacBasedVlan = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 70))NEWLINEcompanyBPDUAttack = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 77))NEWLINEcompanyDHCPv6Relay = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 86))NEWLINEcompanyMldsGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 88))NEWLINEcompanyPPPoE = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 98))NEWLINEcompanyDoSCtrl = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 99))NEWLINEcompanyAgentBasicInfo = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 100))NEWLINEcompanyProtocolVlan = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 101))NEWLINEcompanyL2PT = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 102))NEWLINEcompanySfpVendorInfo = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 104))NEWLINEcompanyDDM = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 105))NEWLINEcompanyFTPGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 107))NEWLINEcompanyTraps = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 120))NEWLINEsysSwitchName = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 1, 1), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 20))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sysSwitchName.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysSwitchName.setDescription('System name used for identification of the device. The following characters are allowed to input. 0 ~ 9 / a ~ z / A ~ Z Special character: ( ) V + _ = .')NEWLINEsysHardwareVersion = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 1, 2), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 15))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: sysHardwareVersion.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysHardwareVersion.setDescription('Version number of the Hardware.')NEWLINEsysFirmwareVersion = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 1, 3), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 15))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: sysFirmwareVersion.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysFirmwareVersion.setDescription('Version number of the Firmware.')NEWLINEsysLoginTimeoutInterval = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(3, 30)).clone(5)).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sysLoginTimeoutInterval.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysLoginTimeoutInterval.setDescription('This time interval is used to count the time and logout web interface automatically.')NEWLINEsysLocationName = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 1, 5), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 20))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sysLocationName.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysLocationName.setDescription("The location name of this node (e.g., `telephone closet, 3rd floor'). If the location is unknown, the value is the zero-length string.")NEWLINEsysGroupInterval = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(120, 1225), ))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sysGroupInterval.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysGroupInterval.setDescription('Group Interval is used to send D-link Discover packet to D-link SmartConsole Utility frequency. The timer in units of seconds. Set value 0 to disable group Interval.')NEWLINEsysSafeGuardEnable = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2))).clone('enable')).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sysSafeGuardEnable.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysSafeGuardEnable.setDescription('This object is used to set Safeguard Enable\\Disable.')NEWLINEsysRestart = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 1, 9), TruthValue().clone('false')).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sysRestart.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysRestart.setDescription("This object allows the user to restart the Switch (i.e)the entire switch will operationally go down and start again. Setting a value of 'true' causes the switch to be restarted. When the switch operationally goes down, configuration save operation is initiated based on the configuration save option chosen. When the switch operationally come up, the saved configurations are restored based on the restore option chosen. Once the switch is restarted, the value of this object reverts to 'false'.")NEWLINEsysSave = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 1, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("true", 1), ("false", 2), ("config-1", 3), ("config-2", 4))).clone(1)).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sysSave.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysSave.setDescription('This object is used to save Configuration , value 1 save config_1 , value 2 is not in process , value 3 is save config_1 and value 4 is save config_2.')NEWLINEsysJumboFrameEnable = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 1, 12), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2))).clone('disable')).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sysJumboFrameEnable.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysJumboFrameEnable.setDescription('Gigabit Web Smart Switches support jumbo frames (frames larger than the Ethernet frame size of 1522 bytes) of up to 10,000 bytes (tagged). Default jumbo frame is disabled.')NEWLINEsysPortCtrlTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 1, 13), )NEWLINEif mibBuilder.loadTexts: sysPortCtrlTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysPortCtrlTable.setDescription('A table to control the port specific parameters of the device like speed, duplex mode, etc.')NEWLINEsysPortCtrlEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 1, 13, 1), ).setIndexNames((0, "DES-1210-28MEbx", "sysPortCtrlIndex"), (0, "DES-1210-28MEbx", "sysPortCtrlMediumType"))NEWLINEif mibBuilder.loadTexts: sysPortCtrlEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysPortCtrlEntry.setDescription('An entry appears in this table for each interface in the system. Index to the table is the interface index of the port.')NEWLINEsysPortCtrlIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 1, 13, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: sysPortCtrlIndex.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysPortCtrlIndex.setDescription('Interface index of the port for the configuration in this entry applies.')NEWLINEsysPortCtrlMediumType = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 1, 13, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(100, 101))).clone(namedValues=NamedValues(("copper", 100), ("fiber", 101)))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: sysPortCtrlMediumType.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysPortCtrlMediumType.setDescription('This object indicates the port type: fiber 1G/100M or copper.')NEWLINEsysPortCtrlSpeed = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 1, 13, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7))).clone(namedValues=NamedValues(("rate1000M-Full", 1), ("rate100M-Full", 2), ("rate100M-Half", 3), ("rate10M-Full", 4), ("rate10M-Half", 5), ("auto", 6), ("disable", 7)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sysPortCtrlSpeed.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysPortCtrlSpeed.setDescription('Configures interface speed.')NEWLINEsysPortCtrlOperStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 1, 13, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7))).clone(namedValues=NamedValues(("down", 1), ("rate1000M-Full", 2), ("rate100M-Full", 3), ("rate100M-Half", 4), ("rate10M-Full", 5), ("rate10M-Half", 6), ("rate10G-Full", 7)))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: sysPortCtrlOperStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysPortCtrlOperStatus.setDescription("The port's operating speed state.")NEWLINEsysPortCtrlMDI = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 1, 13, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("auto", 1), ("mdi", 2), ("mdix", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sysPortCtrlMDI.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysPortCtrlMDI.setDescription('Configures interface auto/mdi/mdix mode. The default setting is Auto.')NEWLINEsysPortCtrlFlowControl = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 1, 13, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sysPortCtrlFlowControl.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysPortCtrlFlowControl.setDescription('Enables / disables flow control for the interface.')NEWLINEsysPortCtrlFlowControlOper = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 1, 13, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: sysPortCtrlFlowControlOper.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysPortCtrlFlowControlOper.setDescription("The link parner negotiate port's operating flow control state.")NEWLINEsysPortCtrlType = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 1, 13, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("fastethernet", 1), ("gigabitethernet", 2), ("fiberwith100Base-and-1000BaseSFPModule", 3)))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: sysPortCtrlType.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysPortCtrlType.setDescription("The port's media type.")NEWLINEsysPortCtrlCapability = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 1, 13, 1, 9), Bits().clone(namedValues=NamedValues(("rate10-half", 0), ("rate10-full", 1), ("rate100-half", 2), ("rate100-full", 3), ("reserve", 4), ("rate1000-full", 5)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sysPortCtrlCapability.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysPortCtrlCapability.setDescription("The port's capability advertised.")NEWLINEsysPortDescriptionTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 1, 14), )NEWLINEif mibBuilder.loadTexts: sysPortDescriptionTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysPortDescriptionTable.setDescription('The port description table.')NEWLINEsysPortDescriptionEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 1, 14, 1), ).setIndexNames((0, "DES-1210-28MEbx", "sysPortDescIndex"), (0, "DES-1210-28MEbx", "sysPortDescMediumType"))NEWLINEif mibBuilder.loadTexts: sysPortDescriptionEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysPortDescriptionEntry.setDescription('The port description entry.')NEWLINEsysPortDescIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 1, 14, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 255))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: sysPortDescIndex.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysPortDescIndex.setDescription('This object indicates the port index.')NEWLINEsysPortDescMediumType = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 1, 14, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(100, 101))).clone(namedValues=NamedValues(("copper", 100), ("fiber", 101)))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: sysPortDescMediumType.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysPortDescMediumType.setDescription('This object indicates the port type: fiber 1G/100M or copper.')NEWLINEsysPortDescString = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 1, 14, 1, 3), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 32))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sysPortDescString.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysPortDescString.setDescription('This object indicates the port description.')NEWLINEsysPortUpLinkTime = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 1, 14, 1, 4), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 32))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: sysPortUpLinkTime.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysPortUpLinkTime.setDescription('This object indicates the port link up time.')NEWLINEsysPortErrTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 1, 15), )NEWLINEif mibBuilder.loadTexts: sysPortErrTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysPortErrTable.setDescription('The port error table.')NEWLINEsysPortErrEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 1, 15, 1), ).setIndexNames((0, "DES-1210-28MEbx", "sysPortErrPortIndex"))NEWLINEif mibBuilder.loadTexts: sysPortErrEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysPortErrEntry.setDescription('A list of information for the err port of the device.')NEWLINEsysPortErrPortIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 1, 15, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 255))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: sysPortErrPortIndex.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysPortErrPortIndex.setDescription("This object indicates the module's port number.(1..Max port number in the module)")NEWLINEsysPortErrPortState = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 1, 15, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("disabled", 1), ("enabled", 2)))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: sysPortErrPortState.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysPortErrPortState.setDescription('This object decides whether the port state is enabled or disabled.')NEWLINEsysPortErrPortStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 1, 15, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("other", 1), ("err-disabled", 2)))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: sysPortErrPortStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysPortErrPortStatus.setDescription('This object decides whether the PortStatus is err-disabled.')NEWLINEsysPortErrPortReason = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 1, 15, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1))).clone(namedValues=NamedValues(("lbd", 1)))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: sysPortErrPortReason.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysPortErrPortReason.setDescription('This object decides whether the PortStatus is LBD.')NEWLINEsysDhcpAutoConfiguration = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 1, 16), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2))).clone('disable')).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sysDhcpAutoConfiguration.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysDhcpAutoConfiguration.setDescription('This object indicates auto config is enabled or disabled.')NEWLINEsysWebState = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 1, 17), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sysWebState.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysWebState.setDescription('This object is for Enabled(1) or Disabled(2) Web state in the system.')NEWLINEsysWebPortNumber = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 1, 18), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535)).clone(80)).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sysWebPortNumber.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysWebPortNumber.setDescription('Web Server Port Number.')NEWLINEsysARPAgingTime = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 1, 19), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sysARPAgingTime.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysARPAgingTime.setDescription('This object is for ARP aging time.')NEWLINEsysMACAgingTime = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 1, 20), Integer32().subtype(subtypeSpec=ValueRangeConstraint(10, 1000000))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sysMACAgingTime.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysMACAgingTime.setDescription('This object is for MAC aging time.')NEWLINEbaudRateConfiguration = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 1, 21), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(9600, 19200, 38400, 115200))).clone(namedValues=NamedValues(("baudrate9600", 9600), ("baudrate19200", 19200), ("baudrate38400", 38400), ("baudrate115200", 115200)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: baudRateConfiguration.setStatus('current')NEWLINEif mibBuilder.loadTexts: baudRateConfiguration.setDescription('To set SerialPort baud-rate configuration.')NEWLINEautologoutConfiguration = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 1, 22), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(120, 300, 600, 900, 0))).clone(namedValues=NamedValues(("logouttime2mins", 120), ("logouttime5mins", 300), ("logouttime10mins", 600), ("logouttime15mins", 900), ("logouttimenever", 0)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: autologoutConfiguration.setStatus('current')NEWLINEif mibBuilder.loadTexts: autologoutConfiguration.setDescription('To set SerialPort auto-logout-time configuration.')NEWLINEtelnetsettingManagementOnOff = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 1, 23), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: telnetsettingManagementOnOff.setStatus('current')NEWLINEif mibBuilder.loadTexts: telnetsettingManagementOnOff.setDescription('Enable/Disable management Telnetsetting mechanism.')NEWLINEtelnetUDPPort = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 1, 24), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535)).clone(23)).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: telnetUDPPort.setStatus('current')NEWLINEif mibBuilder.loadTexts: telnetUDPPort.setDescription("The value is for setting telnet's UDP Port.")NEWLINEautoRefreshConfiguration = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 1, 25), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4))).clone(namedValues=NamedValues(("refreshimenever", 0), ("refreshtime10secs", 1), ("refreshtime30secs", 2), ("refreshtime1min", 3), ("refreshtime5mins", 4)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: autoRefreshConfiguration.setStatus('current')NEWLINEif mibBuilder.loadTexts: autoRefreshConfiguration.setDescription('To set the WEB panel auto refresh timer.')NEWLINEfloodfdbOnOff = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 1, 26), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: floodfdbOnOff.setStatus('current')NEWLINEif mibBuilder.loadTexts: floodfdbOnOff.setDescription('To set enable status for flood fdb.')NEWLINEsysContactName = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 1, 27), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 128))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sysContactName.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysContactName.setDescription('To set system contact name.')NEWLINEsysDhcpAutoConfigTimeout = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 1, 28), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sysDhcpAutoConfigTimeout.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysDhcpAutoConfigTimeout.setDescription('To set dhcp auto config timeout.')NEWLINEsysCommandLogging = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 1, 29), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sysCommandLogging.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysCommandLogging.setDescription('To set enable status for CommandLogging.')NEWLINEsysSerialNumber = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 1, 30), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 13))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: sysSerialNumber.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysSerialNumber.setDescription('To get the serial number.')NEWLINEsysVersion = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 1, 31, 1), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 15))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: sysVersion.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysVersion.setDescription('The version of firmware information.')NEWLINEsysSize = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 1, 31, 2), Integer32()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: sysSize.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysSize.setDescription('The size of firmware information.')NEWLINEsysUpdateTime = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 1, 31, 3), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 20))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: sysUpdateTime.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysUpdateTime.setDescription('The Update Time of firmware information.')NEWLINEsysFromIP = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 1, 31, 4), IpAddress()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: sysFromIP.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysFromIP.setDescription('The IP address of firmware information.')NEWLINEsysUser = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 1, 31, 5), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 9))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: sysUser.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysUser.setDescription('The user of firmware infomation.')NEWLINEsysType = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 1, 31, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, -1))).clone(namedValues=NamedValues(("console", 1), ("telnet", 2), ("ssh", 3), ("web", 4), ("unknown", -1)))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: sysType.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysType.setDescription('The type of firmware infomation.')NEWLINEsysBootupConfigID = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 1, 33), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sysBootupConfigID.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysBootupConfigID.setDescription('To get/set bootup config ID.')NEWLINEsysDhcpAutoImage = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 1, 34), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2))).clone('disable')).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sysDhcpAutoImage.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysDhcpAutoImage.setDescription('This object indicates auto image is enabled or disabled.')NEWLINEsysPortMediaTypeTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 1, 36), )NEWLINEif mibBuilder.loadTexts: sysPortMediaTypeTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysPortMediaTypeTable.setDescription('A table to control the port specific parameters of the device like speed, Vendor name, etc.')NEWLINEsysPortMediaTypeEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 1, 36, 1), ).setIndexNames((0, "DES-1210-28MEbx", "sysPortMediaTypeIndex"), (0, "DES-1210-28MEbx", "sysPortMediaType"))NEWLINEif mibBuilder.loadTexts: sysPortMediaTypeEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysPortMediaTypeEntry.setDescription('An entry appears in this table for each interface in the system. Index to the table is the interface index of the port.')NEWLINEsysPortMediaTypeIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 1, 36, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: sysPortMediaTypeIndex.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysPortMediaTypeIndex.setDescription('Interface index of the port for the configuration in this entry applies.')NEWLINEsysPortMediaType = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 1, 36, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(100, 101))).clone(namedValues=NamedValues(("copper", 100), ("fiber", 101)))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: sysPortMediaType.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysPortMediaType.setDescription('This object indicates the port type: fiber 1G/100M or copper.')NEWLINEsysPortType = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 1, 36, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("rate100M", 1), ("rate1000M", 2), ("rate10G", 3)))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: sysPortType.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysPortType.setDescription('Configures interface speed.')NEWLINEsysPortMediaTypeVendorName = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 1, 36, 1, 4), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 20))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: sysPortMediaTypeVendorName.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysPortMediaTypeVendorName.setDescription("The port's VendorName.")NEWLINEsysPortMediaTypeOui = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 1, 36, 1, 5), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 20))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: sysPortMediaTypeOui.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysPortMediaTypeOui.setDescription("The port's Oui.")NEWLINEsysPortMediaTypePn = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 1, 36, 1, 6), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 20))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: sysPortMediaTypePn.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysPortMediaTypePn.setDescription("The port's Pn.")NEWLINEsysPortMediaTypeRev = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 1, 36, 1, 7), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 20))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: sysPortMediaTypeRev.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysPortMediaTypeRev.setDescription("The port's Rev.")NEWLINEsysPortMediaTypeSn = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 1, 36, 1, 8), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 20))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: sysPortMediaTypeSn.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysPortMediaTypeSn.setDescription("The port's Sn.")NEWLINEsysPortMediaTypeDateCode = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 1, 36, 1, 9), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 20))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: sysPortMediaTypeDateCode.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysPortMediaTypeDateCode.setDescription("The port's DateCode.")NEWLINEipv4sysIpAddrCfgMode = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 2, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("manual", 1), ("dynamic", 2))).clone('manual')).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ipv4sysIpAddrCfgMode.setStatus('current')NEWLINEif mibBuilder.loadTexts: ipv4sysIpAddrCfgMode.setDescription("Specifies the means by which the default interface in the device gets the IP address. If 'manual' mode is selected, the default interface takes the 'sysDefaultIpAddr' configured in the system. If 'dynamic' mode is selected, the default interface gets the IP address through dynamic IP address configuration protocols such as RARP client, BootP client, DHCP Client, etc. If the system fails to get the IP address dynamically through all the above protocols, the default interface uses the 'sysDefaultIpAddr' configured in the system.")NEWLINEipv4sysIpAddr = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 2, 2), IpAddress()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ipv4sysIpAddr.setStatus('current')NEWLINEif mibBuilder.loadTexts: ipv4sysIpAddr.setDescription('Default IP Address of the system. This IP address, if modified, will take effect only when the configuration is stored & restored.')NEWLINEipv4sysIpSubnetMask = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 2, 3), IpAddress()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ipv4sysIpSubnetMask.setStatus('current')NEWLINEif mibBuilder.loadTexts: ipv4sysIpSubnetMask.setDescription('IP subnet mask for the default IP address. This subnet mask, if modified, will take effect only when the configuration is stored & restored.')NEWLINEipv4sysGateway = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 2, 4), IpAddress()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ipv4sysGateway.setStatus('current')NEWLINEif mibBuilder.loadTexts: ipv4sysGateway.setDescription('Gateway')NEWLINEipv4dhcpOption12Status = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 2, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ipv4dhcpOption12Status.setStatus('current')NEWLINEif mibBuilder.loadTexts: ipv4dhcpOption12Status.setDescription('Status of DHCP Option12')NEWLINEipv4dhcpOption12HostName = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 2, 6), OctetString()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ipv4dhcpOption12HostName.setStatus('current')NEWLINEif mibBuilder.loadTexts: ipv4dhcpOption12HostName.setDescription('Host name in DHCP option 12')NEWLINEipifSupportV4V6Info = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 2, 7))NEWLINEsysIpAddrCfgMode = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 2, 7, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("manual", 1), ("dynamic", 2))).clone('manual')).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sysIpAddrCfgMode.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysIpAddrCfgMode.setDescription("Specifies the means by which the default interface in the device gets the IP address. If 'manual' mode is selected, the default interface takes the 'sysDefaultIpAddr' configured in the system. If 'dynamic' mode is selected, the default interface gets the IP address through dynamic IP address configuration protocols such as RARP client, BootP client, DHCP Client, etc. If the system fails to get the IP address dynamically through all the above protocols, the default interface uses the 'sysDefaultIpAddr' configured in the system.")NEWLINEsysIpAddr = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 2, 7, 2), IpAddress()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sysIpAddr.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysIpAddr.setDescription('Default IP Address of the system. This IP address, if modified, will take effect only when the configuration is stored & restored.')NEWLINEsysIpSubnetMask = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 2, 7, 3), IpAddress()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sysIpSubnetMask.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysIpSubnetMask.setDescription('IP subnet mask for the default IP address. This subnet mask, if modified, will take effect only when the configuration is stored & restored.')NEWLINEsysGateway = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 2, 7, 4), IpAddress()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sysGateway.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysGateway.setDescription('Gateway')NEWLINEdhcpOption12Status = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 2, 7, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: dhcpOption12Status.setStatus('current')NEWLINEif mibBuilder.loadTexts: dhcpOption12Status.setDescription('Status of DHCP Option12')NEWLINEdhcpOption12HostName = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 2, 7, 6), OctetString()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: dhcpOption12HostName.setStatus('current')NEWLINEif mibBuilder.loadTexts: dhcpOption12HostName.setDescription('Host name in DHCP option 12')NEWLINEipifName = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 2, 7, 7), OctetString()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: ipifName.setStatus('current')NEWLINEif mibBuilder.loadTexts: ipifName.setDescription('The Description for the interface.')NEWLINEipifVLANname = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 2, 7, 8), OctetString()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: ipifVLANname.setStatus('current')NEWLINEif mibBuilder.loadTexts: ipifVLANname.setDescription('The vlan name for the interface.')NEWLINEipifv6GlobalStatus = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 2, 7, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ipifv6GlobalStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: ipifv6GlobalStatus.setDescription('The ID of VLAN that you want this interface to be in. It must be a exist vlan id.')NEWLINEipifv6DHCPStatus = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 2, 7, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ipifv6DHCPStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: ipifv6DHCPStatus.setDescription('The state of DHCPv6 that you want this interface to be in. It must be a exist vlan id.')NEWLINEipifv6AutolinkloStatus = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 2, 7, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ipifv6AutolinkloStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: ipifv6AutolinkloStatus.setDescription('The global state of link local that you want this interface to be in. It must be a exist vlan id.')NEWLINEipifv6NSRetransmitTime = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 2, 7, 12), Integer32()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ipifv6NSRetransmitTime.setStatus('current')NEWLINEif mibBuilder.loadTexts: ipifv6NSRetransmitTime.setDescription("The NS's retransmit time that you want this interface to be in. It must be a exist vlan id (1~3600).")NEWLINEipifv6DefaultGateway = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 2, 7, 13), Ipv6Address()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ipifv6DefaultGateway.setStatus('current')NEWLINEif mibBuilder.loadTexts: ipifv6DefaultGateway.setDescription('The ipv6 default gateway that you want this interface to be in. It must be a exist vlan id.')NEWLINEipifV6AddressTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 2, 7, 14), )NEWLINEif mibBuilder.loadTexts: ipifV6AddressTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: ipifV6AddressTable.setDescription('A list of interface entries.')NEWLINEipifV6AddressEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 2, 7, 14, 1), ).setIndexNames((0, "DES-1210-28MEbx", "ipifV6AddressMainIndex"), (0, "DES-1210-28MEbx", "ipifV6AddressIpAddr"), (0, "DES-1210-28MEbx", "ipifV6AddressIpPrefix"))NEWLINEif mibBuilder.loadTexts: ipifV6AddressEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: ipifV6AddressEntry.setDescription('An entry containing management information applicable to a particular interface.')NEWLINEipifV6AddressMainIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 2, 7, 14, 1, 1), InterfaceIndex()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: ipifV6AddressMainIndex.setStatus('current')NEWLINEif mibBuilder.loadTexts: ipifV6AddressMainIndex.setDescription('The index of this IPv6 entry.')NEWLINEipifV6AddressIpAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 2, 7, 14, 1, 2), Ipv6Address().clone(hexValue="00000000")).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: ipifV6AddressIpAddr.setStatus('current')NEWLINEif mibBuilder.loadTexts: ipifV6AddressIpAddr.setDescription('The ip address of this IPv6 entry.')NEWLINEipifV6AddressIpPrefix = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 2, 7, 14, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 128))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: ipifV6AddressIpPrefix.setStatus('current')NEWLINEif mibBuilder.loadTexts: ipifV6AddressIpPrefix.setDescription('The ip prefix of this IPv6 entry.')NEWLINEipifV6AddressIpType = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 2, 7, 14, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("unicast", 1), ("anycast", 2), ("linklocal", 3)))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: ipifV6AddressIpType.setStatus('current')NEWLINEif mibBuilder.loadTexts: ipifV6AddressIpType.setDescription('The ip type of this IPv6 entry.')NEWLINEipifV6AddressRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 2, 7, 14, 1, 5), RowStatus()).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: ipifV6AddressRowStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: ipifV6AddressRowStatus.setDescription('The status of an entry in the Multi Interface Table. Only a subset of the rowstatus variables (active, createAndWait, destroy) are available.')NEWLINEipv4sysIprouteGateway = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 2, 8), IpAddress()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ipv4sysIprouteGateway.setStatus('current')NEWLINEif mibBuilder.loadTexts: ipv4sysIprouteGateway.setDescription('IProute Gateway of the system.')NEWLINEipv4sysIprouteHops = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 2, 9), Integer32()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ipv4sysIprouteHops.setStatus('current')NEWLINEif mibBuilder.loadTexts: ipv4sysIprouteHops.setDescription('IProute Hops of the system.')NEWLINEtftpFwServerIpAddress = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 3, 1), IpAddress()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: tftpFwServerIpAddress.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: tftpFwServerIpAddress.setDescription("The TFTP server's IP address is used to upload or download firmware.")NEWLINEtftpFwImageFileName = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 3, 2), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 64))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: tftpFwImageFileName.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: tftpFwImageFileName.setDescription('Configure firmware filename to download.')NEWLINEtftpFwTftpOperation = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 3, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("none", 0), ("download", 1), ("upload", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: tftpFwTftpOperation.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: tftpFwTftpOperation.setDescription('The tftp operates to perform downloading the firmware image to the unit. This object is used in conjunction with configBootTftpServerIp and configBootImageFileName.')NEWLINEtftpFwTftpOperationStatus = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 3, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4))).clone(namedValues=NamedValues(("none", 0), ("success", 1), ("fail", 2), ("progressing", 3), ("transmit", 4)))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: tftpFwTftpOperationStatus.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: tftpFwTftpOperationStatus.setDescription('The tftp operation status represent firmware backup or upgrade status.')NEWLINEtftpCfgServerIpAddress = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 3, 5), IpAddress()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: tftpCfgServerIpAddress.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: tftpCfgServerIpAddress.setDescription("The TFTP server's IP address is used to upload or download configuration file.")NEWLINEtftpConfigFileName = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 3, 6), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 64))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: tftpConfigFileName.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: tftpConfigFileName.setDescription('The configuration filename is used to store or retrieve config from the tftp server.')NEWLINEtftpConfigTftpOperation = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 3, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("download", 1), ("upload", 2), ("progressing", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: tftpConfigTftpOperation.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: tftpConfigTftpOperation.setDescription('The tftp operates to perform either downloading the configuration file to the unit or uploading the current configuration file to the tftp server. This object is used in conjunction with configTftpServerIpAddress and configTftpServerFileName.')NEWLINEtftpConfigTftpOperationStatus = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 3, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("none", 0), ("success", 1), ("fail", 2), ("progressing", 3)))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: tftpConfigTftpOperationStatus.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: tftpConfigTftpOperationStatus.setDescription('The tftp operation status represent configuration file backup or restore status.')NEWLINEtftpFwTargetGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 3, 9))NEWLINEtftpFwTargetServerIpAddress = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 3, 9, 1), Ipv6Address()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: tftpFwTargetServerIpAddress.setStatus('current')NEWLINEif mibBuilder.loadTexts: tftpFwTargetServerIpAddress.setDescription("The TFTP server's IP address is used to upload or download firmware.")NEWLINEtftpFwTargetServerIpType = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 3, 9, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("iPv4", 1), ("iPv6", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: tftpFwTargetServerIpType.setStatus('current')NEWLINEif mibBuilder.loadTexts: tftpFwTargetServerIpType.setDescription('Type of IP interface.')NEWLINEtftpFwTargetInterfaceName = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 3, 9, 3), OctetString()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: tftpFwTargetInterfaceName.setStatus('current')NEWLINEif mibBuilder.loadTexts: tftpFwTargetInterfaceName.setDescription('Specifies the interface name when the tftpFwTargetServerIpAddress is linklocal address.')NEWLINEtftpFwTargetImageFileName = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 3, 9, 4), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 64))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: tftpFwTargetImageFileName.setStatus('current')NEWLINEif mibBuilder.loadTexts: tftpFwTargetImageFileName.setDescription('Configure firmware filename to download.')NEWLINEtftpFwTargetTftpOperation = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 3, 9, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("none", 0), ("download", 1), ("upload", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: tftpFwTargetTftpOperation.setStatus('current')NEWLINEif mibBuilder.loadTexts: tftpFwTargetTftpOperation.setDescription('The tftp operates to perform downloading the firmware image to the unit. This object is used in conjunction with configBootTftpServerIp and configBootImageFileName.')NEWLINEtftpFwTargetTftpOperationStatus = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 3, 9, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4))).clone(namedValues=NamedValues(("none", 0), ("success", 1), ("fail", 2), ("progressing", 3), ("transmit", 4)))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: tftpFwTargetTftpOperationStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: tftpFwTargetTftpOperationStatus.setDescription('The tftp operation status represent firmware backup or upgrade status.')NEWLINEtftpCfgTargetGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 3, 10))NEWLINEtftpCfgTargetServerIpAddress = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 3, 10, 1), Ipv6Address()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: tftpCfgTargetServerIpAddress.setStatus('current')NEWLINEif mibBuilder.loadTexts: tftpCfgTargetServerIpAddress.setDescription("The TFTP server's IP address is used to upload or download configuration file.")NEWLINEtftpCfgTargetServerIpType = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 3, 10, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("iPv4", 1), ("iPv6", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: tftpCfgTargetServerIpType.setStatus('current')NEWLINEif mibBuilder.loadTexts: tftpCfgTargetServerIpType.setDescription('Type of IP interface.')NEWLINEtftpCfgTargetInterfaceName = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 3, 10, 3), OctetString()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: tftpCfgTargetInterfaceName.setStatus('current')NEWLINEif mibBuilder.loadTexts: tftpCfgTargetInterfaceName.setDescription('Specifies the interface name when the tftpCfgTargetServerIpAddress is linklocal address.')NEWLINEtftpCfgTargetImageFileName = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 3, 10, 4), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 64))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: tftpCfgTargetImageFileName.setStatus('current')NEWLINEif mibBuilder.loadTexts: tftpCfgTargetImageFileName.setDescription('The configuration filename is used to store or retrieve config from the tftp server.')NEWLINEtftpCfgTargetTftpOperation = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 3, 10, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("download", 1), ("upload", 2), ("progressing", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: tftpCfgTargetTftpOperation.setStatus('current')NEWLINEif mibBuilder.loadTexts: tftpCfgTargetTftpOperation.setDescription('The tftp operates to perform either downloading the configuration file to the unit or uploading the current configuration file to the tftp server. This object is used in conjunction with configTftpServerIpAddress and configTftpServerFileName.')NEWLINEtftpCfgTargetTftpOperationStatus = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 3, 10, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("none", 0), ("success", 1), ("fail", 2), ("progressing", 3)))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: tftpCfgTargetTftpOperationStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: tftpCfgTargetTftpOperationStatus.setDescription('The tftp operation status represent configuration file backup or restore status.')NEWLINEtftpCfgTargetTftpConfigID = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 3, 10, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("configId-1", 1), ("configId-2", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: tftpCfgTargetTftpConfigID.setStatus('current')NEWLINEif mibBuilder.loadTexts: tftpCfgTargetTftpConfigID.setDescription('The tftp config ID determine which config what you need.')NEWLINEtftpCfgTargetTftpIncrement = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 3, 10, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("false", 0), ("true", 1)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: tftpCfgTargetTftpIncrement.setStatus('current')NEWLINEif mibBuilder.loadTexts: tftpCfgTargetTftpIncrement.setDescription('The tftp increment determine download config behavior.')NEWLINEmiscReset = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 4, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("reset", 1), ("noop", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: miscReset.setStatus('current')NEWLINEif mibBuilder.loadTexts: miscReset.setDescription('Physically resets the unit - use with care. A (1) resets the unit, a (2) does nothing.')NEWLINEmiscStatisticsReset = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 4, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("reset", 1), ("noop", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: miscStatisticsReset.setStatus('current')NEWLINEif mibBuilder.loadTexts: miscStatisticsReset.setDescription('Resets the units statistics. A (1) resets the statistics count, a (2) does nothing.')NEWLINEsecurityIpMacPortBinding = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 10))NEWLINEimpbSettingTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 10, 1), )NEWLINEif mibBuilder.loadTexts: impbSettingTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: impbSettingTable.setDescription('A table to control IP-MAC-Port Binding Setting features of the device.')NEWLINEimpbSettingEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 10, 1, 1), ).setIndexNames((0, "DES-1210-28MEbx", "impbPortIndex"))NEWLINEif mibBuilder.loadTexts: impbSettingEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: impbSettingEntry.setDescription('An entry appears in IP-MAC-Port Binding Setting table for each interface in the system.')NEWLINEimpbPortIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 10, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 28))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: impbPortIndex.setStatus('current')NEWLINEif mibBuilder.loadTexts: impbPortIndex.setDescription("Specifies the port numbers through which the authorized manager can access the switch. By default the authorized manager is allowed to access the switch through all the ports. If a set of ports are configured in the 'PortList', the manager can access the switch only through the configured ports.")NEWLINEimpbPortState = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 10, 1, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("disabled", 0), ("enabled", 1)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: impbPortState.setStatus('current')NEWLINEif mibBuilder.loadTexts: impbPortState.setDescription('Disable / enable IP-MAC-Port Binding admin state for the interface.')NEWLINEimpbPortDHCPSnoopingState = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 10, 1, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("disabled", 0), ("enabled", 1)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: impbPortDHCPSnoopingState.setStatus('current')NEWLINEif mibBuilder.loadTexts: impbPortDHCPSnoopingState.setDescription('Disable / enable IP-MAC-Port Binding DHCP snooping state for the interface.')NEWLINEimpbPortArpInspectionState = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 10, 1, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("disabled", 0), ("strict", 1), ("loose", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: impbPortArpInspectionState.setStatus('current')NEWLINEif mibBuilder.loadTexts: impbPortArpInspectionState.setDescription('Set IP-MAC-Port Binding ARP Inspection state for the interface.')NEWLINEimpbPortIpInspectionState = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 10, 1, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("disabled", 0), ("enabled", 1)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: impbPortIpInspectionState.setStatus('current')NEWLINEif mibBuilder.loadTexts: impbPortIpInspectionState.setDescription('Set IP-MAC-Port Binding IP Inspection state for the interface.')NEWLINEimpbPortAllowZeroIPState = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 10, 1, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("disabled", 0), ("enabled", 1)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: impbPortAllowZeroIPState.setStatus('current')NEWLINEif mibBuilder.loadTexts: impbPortAllowZeroIPState.setDescription('Disable / enable IP-MAC-Port Binding Allow-Zero-IP state for the interface.')NEWLINEimpbPortForwardDHCPPktState = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 10, 1, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("disabled", 0), ("enabled", 1)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: impbPortForwardDHCPPktState.setStatus('current')NEWLINEif mibBuilder.loadTexts: impbPortForwardDHCPPktState.setDescription('Disable / enable IP-MAC-Port Binding Forward-DHCP-Packet state for the interface.')NEWLINEimpbPortDHCPMaxEntryIPv4 = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 10, 1, 1, 9), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 10))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: impbPortDHCPMaxEntryIPv4.setStatus('current')NEWLINEif mibBuilder.loadTexts: impbPortDHCPMaxEntryIPv4.setDescription('Set the maximum number of IPv4 entries that can be learned for the interface.')NEWLINEimpbPortDHCPMaxEntryIPv6 = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 10, 1, 1, 10), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 10))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: impbPortDHCPMaxEntryIPv6.setStatus('current')NEWLINEif mibBuilder.loadTexts: impbPortDHCPMaxEntryIPv6.setDescription('Set the maximum number of IPv6 entries that can be learned for the interface.')NEWLINEimpbPortNDInspectionState = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 10, 1, 1, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("disabled", 0), ("enabled", 1)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: impbPortNDInspectionState.setStatus('current')NEWLINEif mibBuilder.loadTexts: impbPortNDInspectionState.setDescription('Set IP-MAC-Port Binding ND Inspection state for the interface.')NEWLINEimpbPortProtocolState = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 10, 1, 1, 12), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("ipv4", 0), ("ipv6", 1), ("all", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: impbPortProtocolState.setStatus('current')NEWLINEif mibBuilder.loadTexts: impbPortProtocolState.setDescription('Set IP-MAC-Port Binding protocol state for the interface.')NEWLINEimpbPortDHCPv4SetVlanList = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 10, 1, 1, 13), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 512))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: impbPortDHCPv4SetVlanList.setStatus('current')NEWLINEif mibBuilder.loadTexts: impbPortDHCPv4SetVlanList.setDescription('A string of octets containing one bit per VLAN. The first octet corresponds to VLANs with VlanIndex values 1 through 8; the second octet to VLANs 9 through 16 etc. The most significant bit of each octet corresponds to the lowest VlanIndex value in that octet. The set of vlans configured by management to map for this Instance. If the VlanId to Instance Mapping has to be known then any one of the VlanMapped object should be used.If a vlan is already mapped to this Instance, it may not be mapped again. This object is used only for SET operation. GET Operation returns null values.')NEWLINEimpbPortDHCPv4VlanList1k = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 10, 1, 1, 14), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 128))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: impbPortDHCPv4VlanList1k.setStatus('current')NEWLINEif mibBuilder.loadTexts: impbPortDHCPv4VlanList1k.setDescription("A string of octets containing one bit per VLAN. The first octet corresponds to VLANs with VlanIndex values 1 through 8; the second octet to VLANs 9 through 16 etc. The most significant bit of each octet corresponds to the lowest VlanIndex value in that octet. For each VLAN that is mapped to this DHCP snooping, the bit corresponding to that VLAN is set to '1'. ")NEWLINEimpbPortDHCPv4VlanList2k = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 10, 1, 1, 15), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 128))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: impbPortDHCPv4VlanList2k.setStatus('current')NEWLINEif mibBuilder.loadTexts: impbPortDHCPv4VlanList2k.setDescription("A string of octets containing one bit per VLAN for VLANS with VlanIndex values 1025 through 2048. The most significant bit of each octet corresponds to the lowest VlanIndex value in that octet. For each VLAN that is mapped to this DHCPv4 snooping, the bit corresponding to that VLAN is set to '1'. This object is only instantiated on devices with support for VlanIndex values up to 4094.")NEWLINEimpbPortDHCPv4VlanList3k = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 10, 1, 1, 16), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 128))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: impbPortDHCPv4VlanList3k.setStatus('current')NEWLINEif mibBuilder.loadTexts: impbPortDHCPv4VlanList3k.setDescription("A string of octets containing one bit per VLAN for VLANS with VlanIndex values 2049 through 3072. The most significant bit of each octet corresponds to the lowest VlanIndex value in that octet. For each VLAN that is mapped to this DHCPv4 snooping the bit corresponding to that VLAN is set to '1'. This object is only instantiated on devices with support for VlanIndex values up to 4094.")NEWLINEimpbPortDHCPv4VlanList4k = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 10, 1, 1, 17), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 128))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: impbPortDHCPv4VlanList4k.setStatus('current')NEWLINEif mibBuilder.loadTexts: impbPortDHCPv4VlanList4k.setDescription("A string of octets containing one bit per VLAN for VLANS with VlanIndex values 3073 through 4094. The most significant bit of each octet corresponds to the lowest VlanIndex value in that octet. For each VLAN that is mapped to this DHCPv4 snooping, the bit corresponding to that VLAN is set to '1'. This object is only instantiated on devices with support for VlanIndex values up to 4094.")NEWLINEimpbPortDHCPv6SetVlanList = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 10, 1, 1, 18), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 512))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: impbPortDHCPv6SetVlanList.setStatus('current')NEWLINEif mibBuilder.loadTexts: impbPortDHCPv6SetVlanList.setDescription('A string of octets containing one bit per VLAN. The first octet corresponds to VLANs with VlanIndex values 1 through 8; the second octet to VLANs 9 through 16 etc. The most significant bit of each octet corresponds to the lowest VlanIndex value in that octet. The set of vlans configured by management to map for this Instance. If the VlanId to Instance Mapping has to be known then any one of the VlanMapped object should be used.If a vlan is already mapped to this Instance, it may not be mapped again. This object is used only for SET operation. GET Operation returns null values.')NEWLINEimpbPortDHCPv6VlanList1k = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 10, 1, 1, 19), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 128))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: impbPortDHCPv6VlanList1k.setStatus('current')NEWLINEif mibBuilder.loadTexts: impbPortDHCPv6VlanList1k.setDescription("A string of octets containing one bit per VLAN. The first octet corresponds to VLANs with VlanIndex values 1 through 8; the second octet to VLANs 9 through 16 etc. The most significant bit of each octet corresponds to the lowest VlanIndex value in that octet. For each VLAN that is mapped to this DHCP snooping, the bit corresponding to that VLAN is set to '1'. ")NEWLINEimpbPortDHCPv6VlanList2k = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 10, 1, 1, 20), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 128))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: impbPortDHCPv6VlanList2k.setStatus('current')NEWLINEif mibBuilder.loadTexts: impbPortDHCPv6VlanList2k.setDescription("A string of octets containing one bit per VLAN for VLANS with VlanIndex values 1025 through 2048. The most significant bit of each octet corresponds to the lowest VlanIndex value in that octet. For each VLAN that is mapped to this DHCPv6 snooping, the bit corresponding to that VLAN is set to '1'. This object is only instantiated on devices with support for VlanIndex values up to 4094.")NEWLINEimpbPortDHCPv6VlanList3k = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 10, 1, 1, 21), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 128))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: impbPortDHCPv6VlanList3k.setStatus('current')NEWLINEif mibBuilder.loadTexts: impbPortDHCPv6VlanList3k.setDescription("A string of octets containing one bit per VLAN for VLANS with VlanIndex values 2049 through 3072. The most significant bit of each octet corresponds to the lowest VlanIndex value in that octet. For each VLAN that is mapped to this DHCPv6 snooping the bit corresponding to that VLAN is set to '1'. This object is only instantiated on devices with support for VlanIndex values up to 4094.")NEWLINEimpbPortDHCPv6VlanList4k = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 10, 1, 1, 22), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 128))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: impbPortDHCPv6VlanList4k.setStatus('current')NEWLINEif mibBuilder.loadTexts: impbPortDHCPv6VlanList4k.setDescription("A string of octets containing one bit per VLAN for VLANS with VlanIndex values 3073 through 4094. The most significant bit of each octet corresponds to the lowest VlanIndex value in that octet. For each VLAN that is mapped to this DHCPv6 snooping, the bit corresponding to that VLAN is set to '1'. This object is only instantiated on devices with support for VlanIndex values up to 4094.")NEWLINEimpbAutoScanTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 10, 2), )NEWLINEif mibBuilder.loadTexts: impbAutoScanTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: impbAutoScanTable.setDescription('A table to control auto scan features of the device.')NEWLINEimpbAutoScanEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 10, 2, 1), ).setIndexNames((0, "DES-1210-28MEbx", "impbAutoScanMacAddress"), (0, "DES-1210-28MEbx", "impbAutoScanPort"), (0, "DES-1210-28MEbx", "impbAutoScanIpAddress"))NEWLINEif mibBuilder.loadTexts: impbAutoScanEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: impbAutoScanEntry.setDescription('An entry appears in auto scan table for each interface in the system.')NEWLINEimpbAutoScanMacAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 10, 2, 1, 1), MacAddress()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: impbAutoScanMacAddress.setStatus('current')NEWLINEif mibBuilder.loadTexts: impbAutoScanMacAddress.setDescription('The MAC address associated of the auto scan entry.')NEWLINEimpbAutoScanPort = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 10, 2, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 28))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: impbAutoScanPort.setStatus('current')NEWLINEif mibBuilder.loadTexts: impbAutoScanPort.setDescription('The port number of the auto scan entry. For all machines give maximum port number.')NEWLINEimpbAutoScanIpAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 10, 2, 1, 3), DisplayString().clone(hexValue="00000000")).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: impbAutoScanIpAddress.setStatus('current')NEWLINEif mibBuilder.loadTexts: impbAutoScanIpAddress.setDescription('The IP address associated of the auto scan entry.')NEWLINEimpbAutoScanVlanId = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 10, 2, 1, 4), Integer32()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: impbAutoScanVlanId.setStatus('current')NEWLINEif mibBuilder.loadTexts: impbAutoScanVlanId.setDescription('The VLAN ID of the auto scan entry.')NEWLINEimpbAutoScanBinding = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 10, 2, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("disabled", 0), ("enabled", 1)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: impbAutoScanBinding.setStatus('current')NEWLINEif mibBuilder.loadTexts: impbAutoScanBinding.setDescription('Disable / enable IP-MAC-Port Binding for the entry.')NEWLINEimpbBindingListTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 10, 3), )NEWLINEif mibBuilder.loadTexts: impbBindingListTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: impbBindingListTable.setDescription('A table to control Manual IP-MAC-Port Binding white list features of the device.')NEWLINEimpbBindingListEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 10, 3, 1), ).setIndexNames((0, "DES-1210-28MEbx", "impbBindingListIpAddress"), (0, "DES-1210-28MEbx", "impbBindingListMacAddress"))NEWLINEif mibBuilder.loadTexts: impbBindingListEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: impbBindingListEntry.setDescription('An entry appears in Manual IP-MAC-Port Binding white list table for each interface in the system.')NEWLINEimpbBindingListIpAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 10, 3, 1, 1), DisplayString().clone(hexValue="00000000")).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: impbBindingListIpAddress.setStatus('current')NEWLINEif mibBuilder.loadTexts: impbBindingListIpAddress.setDescription('The IP address associated of the Manual IP-MAC-PORT Binding white list entry.')NEWLINEimpbBindingListMacAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 10, 3, 1, 2), MacAddress()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: impbBindingListMacAddress.setStatus('current')NEWLINEif mibBuilder.loadTexts: impbBindingListMacAddress.setDescription('The MAC address associated of the Manual IP-MAC-PORT Binding white list entry.')NEWLINEimpbBindingListPort = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 10, 3, 1, 3), Integer32()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: impbBindingListPort.setStatus('current')NEWLINEif mibBuilder.loadTexts: impbBindingListPort.setDescription('The port number of the Manual IP-MAC-PORT Binding white list entry.')NEWLINEimpbBindingListRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 10, 3, 1, 4), RowStatus()).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: impbBindingListRowStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: impbBindingListRowStatus.setDescription('The status of a row in impbBindingListTable. By setting this object, new entries can be created in impbBindingListTable and existing entries can be removed from impbBindingListTable. It can be used as specified in the SNMP v2 standard.')NEWLINEimpbBlockListTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 10, 4), )NEWLINEif mibBuilder.loadTexts: impbBlockListTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: impbBlockListTable.setDescription('A table to control IP-MAC-Port Binding black list of the device.')NEWLINEimpbBlockListEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 10, 4, 1), ).setIndexNames((0, "DES-1210-28MEbx", "impbBlockListMacAddress"), (0, "DES-1210-28MEbx", "impbBlockListVlanId"), (0, "DES-1210-28MEbx", "impbBlockListPort"))NEWLINEif mibBuilder.loadTexts: impbBlockListEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: impbBlockListEntry.setDescription('An entry appears in Manual IP-MAC-Port Binding black list table for each interface in the system.')NEWLINEimpbBlockListMacAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 10, 4, 1, 1), MacAddress()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: impbBlockListMacAddress.setStatus('current')NEWLINEif mibBuilder.loadTexts: impbBlockListMacAddress.setDescription('The MAC address associated of the IP-MAC-PORT Binding black list entry.')NEWLINEimpbBlockListVlanId = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 10, 4, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 4094))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: impbBlockListVlanId.setStatus('current')NEWLINEif mibBuilder.loadTexts: impbBlockListVlanId.setDescription('The VLAN ID of the IP-MAC-PORT Binding black list entry.')NEWLINEimpbBlockListPort = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 10, 4, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 28))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: impbBlockListPort.setStatus('current')NEWLINEif mibBuilder.loadTexts: impbBlockListPort.setDescription('The port number of the IP-MAC-PORT Binding black list entry.')NEWLINEimpbBlockListIpAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 10, 4, 1, 4), DisplayString().clone(hexValue="00000000")).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: impbBlockListIpAddress.setStatus('current')NEWLINEif mibBuilder.loadTexts: impbBlockListIpAddress.setDescription('The IP address associated of the IP-MAC-PORT Binding black list entry.')NEWLINEimpbBlockListStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 10, 4, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("nothing", 0), ("deleted", 1)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: impbBlockListStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: impbBlockListStatus.setDescription('nothing/delete IP-MAC-Port Binding for the interface.')NEWLINEimpbAutoScanIpAddressFrom = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 10, 5), Ipv6Address().clone(hexValue="00000000")).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: impbAutoScanIpAddressFrom.setStatus('current')NEWLINEif mibBuilder.loadTexts: impbAutoScanIpAddressFrom.setDescription('The begin for IP address associated of the IP-MAC-PORT Binding auto scan entry.')NEWLINEimpbAutoScanIpAddressTo = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 10, 6), Ipv6Address().clone(hexValue="00000000")).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: impbAutoScanIpAddressTo.setStatus('current')NEWLINEif mibBuilder.loadTexts: impbAutoScanIpAddressTo.setDescription('The end for IP address associated of the IP-MAC-PORT Binding auto scan entry.')NEWLINEimpbAutoScanStatus = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 10, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("nothing", 0), ("scan", 1)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: impbAutoScanStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: impbAutoScanStatus.setDescription('Nothing / scan IP-MAC-Port Binding auto scan for the interface.')NEWLINEimpbDhcpSnoopingTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 10, 8), )NEWLINEif mibBuilder.loadTexts: impbDhcpSnoopingTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: impbDhcpSnoopingTable.setDescription('A table to display DHCP snooping entries of the device.')NEWLINEimpbDhcpSnoopingEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 10, 8, 1), ).setIndexNames((0, "DES-1210-28MEbx", "impbDhcpSnoopingMacAddress"), (0, "DES-1210-28MEbx", "impbDhcpSnoopingIpAddress"))NEWLINEif mibBuilder.loadTexts: impbDhcpSnoopingEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: impbDhcpSnoopingEntry.setDescription('An entry appears in DHCP snooping table for each interface in the system.')NEWLINEimpbDhcpSnoopingMacAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 10, 8, 1, 1), MacAddress()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: impbDhcpSnoopingMacAddress.setStatus('current')NEWLINEif mibBuilder.loadTexts: impbDhcpSnoopingMacAddress.setDescription('The MAC address associated of the DHCP snooping entry.')NEWLINEimpbDhcpSnoopingIpAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 10, 8, 1, 2), Ipv6Address().clone(hexValue="00000000")).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: impbDhcpSnoopingIpAddress.setStatus('current')NEWLINEif mibBuilder.loadTexts: impbDhcpSnoopingIpAddress.setDescription('The IP address associated of the DHCP snooping entry.')NEWLINEimpbDhcpSnoopingLeaseTime = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 10, 8, 1, 3), Integer32()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: impbDhcpSnoopingLeaseTime.setStatus('current')NEWLINEif mibBuilder.loadTexts: impbDhcpSnoopingLeaseTime.setDescription('The lease time associated of the DHCP snooping entry.')NEWLINEimpbDhcpSnoopingPort = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 10, 8, 1, 4), Integer32()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: impbDhcpSnoopingPort.setStatus('current')NEWLINEif mibBuilder.loadTexts: impbDhcpSnoopingPort.setDescription('The port number associated of the DHCP snooping entry.')NEWLINEimpbRoamingState = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 10, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("disabled", 0), ("enabled", 1)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: impbRoamingState.setStatus('current')NEWLINEif mibBuilder.loadTexts: impbRoamingState.setDescription('Disable / enable IP-MAC-Port Binding roaming state.')NEWLINEimpbVlanModeState = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 10, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("disabled", 0), ("enabled", 1)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: impbVlanModeState.setStatus('current')NEWLINEif mibBuilder.loadTexts: impbVlanModeState.setDescription('Disable / enable IP-MAC-Port Binding vlan mode state.')NEWLINEimpbVlanModeVlanList = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 10, 11), PortList()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: impbVlanModeVlanList.setStatus('current')NEWLINEif mibBuilder.loadTexts: impbVlanModeVlanList.setDescription('IP-MAC-Port Binding vlan mode VID list.')NEWLINEimpbLogState = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 10, 12), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("disabled", 0), ("ipv4", 1), ("ipv6", 2), ("all", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: impbLogState.setStatus('current')NEWLINEif mibBuilder.loadTexts: impbLogState.setDescription('Configure IP-MAC-Port Binding log state.')NEWLINEimpbDHCPv6PrefixDelegationSnoopState = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 10, 13), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("disabled", 0), ("enabled", 1)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: impbDHCPv6PrefixDelegationSnoopState.setStatus('current')NEWLINEif mibBuilder.loadTexts: impbDHCPv6PrefixDelegationSnoopState.setDescription('Configure DHCPv6 PD snooping state.')NEWLINEimpbBindingtraplog = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 10, 14), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(2, 1))).clone(namedValues=NamedValues(("disabled", 2), ("enabled", 1)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: impbBindingtraplog.setStatus('current')NEWLINEif mibBuilder.loadTexts: impbBindingtraplog.setDescription('This object is for enabling or disabling topology change event trap in the system.')NEWLINEimpbBindingtrap = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 10, 15))NEWLINEimpbBindingtrapsign = NotificationType((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 10, 15, 1))NEWLINEif mibBuilder.loadTexts: impbBindingtrapsign.setStatus('current')NEWLINEif mibBuilder.loadTexts: impbBindingtrapsign.setDescription('The object is for IMPB trap sign in the system.')NEWLINEimpbAutoScanCurrentStatus = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 10, 16), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("stop", 0), ("scanning", 1)))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: impbAutoScanCurrentStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: impbAutoScanCurrentStatus.setDescription('Show Auto scan status')NEWLINEstpBridgeGlobal = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 6, 1))NEWLINEstpModuleStatus = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 6, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: stpModuleStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: stpModuleStatus.setDescription('The administrative status requested by management for the MST feature. The value enabled(1) indicates that Mst should be enabled in the device on all ports. The value disabled(2) indicates that Mst should be disabled in the device on all ports. The object can be set to enabled(1) if and only if, fsMIMstSystemControl set to start.')NEWLINEstpProtocolVersion = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 6, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("stp", 1), ("rstp", 2), ("mstp", 3))).clone('mstp')).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: stpProtocolVersion.setStatus('current')NEWLINEif mibBuilder.loadTexts: stpProtocolVersion.setDescription("The version of Spanning Tree Protocol the bridge is currently running. The value 'stpCompatible(0)' indicates the Spanning Tree Protocol specified in IEEE 802.1D and 'rstp(2)' indicates the Rapid Spanning Tree Protocol specified in IEEE 802.1w and 'mstp(3)' indicates the Multiple Spanning Tree Protocol Specified in IEEE 802.1s.")NEWLINEstpBridgePriority = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 6, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 61440)).clone(32768)).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: stpBridgePriority.setStatus('current')NEWLINEif mibBuilder.loadTexts: stpBridgePriority.setDescription('The Value of the writable portion of the Bridge Identifier comprising of the first two octets. The values that are set for Bridge Priority must be in steps of 4096.')NEWLINEstpTxHoldCount = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 6, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 10)).clone(3)).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: stpTxHoldCount.setStatus('current')NEWLINEif mibBuilder.loadTexts: stpTxHoldCount.setDescription('The value used by the Port Transmit state machine to limit the maximum transmission rate.')NEWLINEstpBridgeMaxAge = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 6, 1, 5), Timeout().subtype(subtypeSpec=ValueRangeConstraint(600, 4000)).clone(2000)).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: stpBridgeMaxAge.setStatus('current')NEWLINEif mibBuilder.loadTexts: stpBridgeMaxAge.setDescription('The value that all bridges use for MaxAge when this bridge is acting as the root. The granularity of this timer is specified to be 1 second. An agent may return a badValue error if a set is attempted to a value which is not a whole number of seconds.')NEWLINEstpBridgeHelloTime = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 6, 1, 6), Timeout().subtype(subtypeSpec=ValueRangeConstraint(100, 1000))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: stpBridgeHelloTime.setStatus('current')NEWLINEif mibBuilder.loadTexts: stpBridgeHelloTime.setDescription('The amount of time between the transmission of Configuration bridge PDUs by this node in units of hundredths of a second.')NEWLINEstpBridgeForwardDelay = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 6, 1, 7), Timeout().subtype(subtypeSpec=ValueRangeConstraint(400, 3000)).clone(1500)).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: stpBridgeForwardDelay.setStatus('current')NEWLINEif mibBuilder.loadTexts: stpBridgeForwardDelay.setDescription('The value that all bridges use for ForwardDelay when this bridge is acting as the root. Note that 802.1D specifies that the range for this parameter is related to the value of BridgeMaxAge. The granularity of this timer is specified to be 1 second. An agent may return a badValue error if a set is attempted to a value which is not a whole number of seconds.')NEWLINEstpFowardBPDU = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 6, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: stpFowardBPDU.setStatus('current')NEWLINEif mibBuilder.loadTexts: stpFowardBPDU.setDescription('This object is for enabling or disabling forward BPDU.')NEWLINEstpRootBridge = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 6, 1, 9), BridgeId()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: stpRootBridge.setStatus('current')NEWLINEif mibBuilder.loadTexts: stpRootBridge.setDescription('The bridge identifier of the Root of the common spanning tree as determined by the Spanning Tree Protocol as executed by this node. This value is used as the CIST Root Identifier parameter in all Configuration Bridge PDUs originated by this node.')NEWLINEstpRootCost = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 6, 1, 10), Integer32()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: stpRootCost.setStatus('current')NEWLINEif mibBuilder.loadTexts: stpRootCost.setDescription('The Cost of the path to the CIST Root as seen from this bridge.')NEWLINEstpMaxAge = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 6, 1, 11), Timeout()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: stpMaxAge.setStatus('current')NEWLINEif mibBuilder.loadTexts: stpMaxAge.setDescription('The maximum age of Spanning Tree Protocol information learned from the network on any port before it is discarded, in units of hundredths of a second. This is the actual value that this bridge is currently using.')NEWLINEstpForwardDelay = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 6, 1, 12), Timeout()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: stpForwardDelay.setStatus('current')NEWLINEif mibBuilder.loadTexts: stpForwardDelay.setDescription('This time value, measured in units of hundredths of a second, controls how fast a port changes its spanning state when moving towards the Forwarding state. The value determines how long the port stays in a particular state before moving to the next state.')NEWLINEstpRootPort = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 6, 1, 13), Integer32()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: stpRootPort.setStatus('current')NEWLINEif mibBuilder.loadTexts: stpRootPort.setDescription('The Port Number of the Port which offers the lowest path cost from this bridge to the CIST Root Bridge.')NEWLINEstpTopologyChangeTrapStatus = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 6, 1, 14), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2))).clone('disabled')).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: stpTopologyChangeTrapStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: stpTopologyChangeTrapStatus.setDescription('This object is for enabling or disabling topology change event trap in the system.')NEWLINEstpNewRootTrapStatus = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 6, 1, 15), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2))).clone('disabled')).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: stpNewRootTrapStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: stpNewRootTrapStatus.setDescription('This object is for enabling or disabling new root event trap in the system.')NEWLINEstpNewRootTraps = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 6, 1, 16))NEWLINEbrgAddress = NotificationType((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 6, 1, 16, 1))NEWLINEif mibBuilder.loadTexts: brgAddress.setStatus('current')NEWLINEif mibBuilder.loadTexts: brgAddress.setDescription('The MAC address used by this bridge when it must be referred to in a unique fashion.')NEWLINEoldDesignatedRoot = NotificationType((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 6, 1, 16, 2))NEWLINEif mibBuilder.loadTexts: oldDesignatedRoot.setStatus('current')NEWLINEif mibBuilder.loadTexts: oldDesignatedRoot.setDescription('The bridge identifier of the old root of the spanning tree instance as determined by the Spanning Tree Protocol as executed by this node.')NEWLINEmstiBridgeRegionalRoot = NotificationType((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 6, 1, 16, 3))NEWLINEif mibBuilder.loadTexts: mstiBridgeRegionalRoot.setStatus('current')NEWLINEif mibBuilder.loadTexts: mstiBridgeRegionalRoot.setDescription('MSTI Regional Root Identifier value for the Instance.')NEWLINEstpPortTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 6, 2), )NEWLINEif mibBuilder.loadTexts: stpPortTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: stpPortTable.setDescription('A table that contains port-specific information for the Spanning Tree Protocol.')NEWLINEstpPortEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 6, 2, 1), ).setIndexNames((0, "DES-1210-28MEbx", "stpPort"))NEWLINEif mibBuilder.loadTexts: stpPortEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: stpPortEntry.setDescription('A list of information maintained by every port about the Spanning Tree Protocol state for that port.')NEWLINEstpPort = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 6, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: stpPort.setStatus('current')NEWLINEif mibBuilder.loadTexts: stpPort.setDescription('The Port number of the port for which this entry contains spanning tree information.')NEWLINEstpPortStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 6, 2, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 0))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 0)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: stpPortStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: stpPortStatus.setDescription("Current state of the Port which can be changed to either Disabled or Enabled for ALL spanning tree instances. Setting this object will override the port's status in any of the MSTI contexts")NEWLINEstpPortPriority = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 6, 2, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 240)).clone(128)).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: stpPortPriority.setStatus('current')NEWLINEif mibBuilder.loadTexts: stpPortPriority.setDescription('The four most significant bits of the Port Identifier of the Spanning Tree instance can be modified by setting the CistPortPriority value. The values that are set for Port Priority must be in steps of 16.')NEWLINEstpAdminPortPathCost = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 6, 2, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 200000000))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: stpAdminPortPathCost.setReference('IEEE 802.1D-2004')NEWLINEif mibBuilder.loadTexts: stpAdminPortPathCost.setStatus('current')NEWLINEif mibBuilder.loadTexts: stpAdminPortPathCost.setDescription("The contribution of this port to the path cost of paths towards the spanning tree root which include this port. Writing a value of '0' assigns the automatically calculated default Path Cost value to the ohter object stpPortPathCost. If the default Path Cost is being used,this object returns '0' when read.")NEWLINEstpPortPathCost = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 6, 2, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 200000000))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: stpPortPathCost.setStatus('current')NEWLINEif mibBuilder.loadTexts: stpPortPathCost.setDescription('The contribution of this port to the path cost of paths towards the CIST Root which include this port.')NEWLINEstpPortProtocolMigration = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 6, 2, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("false", 0), ("true", 1)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: stpPortProtocolMigration.setStatus('current')NEWLINEif mibBuilder.loadTexts: stpPortProtocolMigration.setDescription('Indicates the Protocol migration state of this Port. When operating in RSTP/MSTP (version >= 2) mode, writing TRUE(1) to this object forces this port to transmit MSTP BPDUs without instance information. Any other operation on this object has no effect and it always returns FALSE(2) when read.')NEWLINEstpPortEdge = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 6, 2, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 0, 2))).clone(namedValues=NamedValues(("true", 1), ("false", 0), ("auto", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: stpPortEdge.setStatus('current')NEWLINEif mibBuilder.loadTexts: stpPortEdge.setDescription(' This parameter when TRUE(1) indicates that detection of a port as Edge Port happens automatically and FALSE(2) indicates that this feature is disabled.')NEWLINEstpPortAdminP2P = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 6, 2, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("forceTrue", 0), ("forceFalse", 1), ("auto", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: stpPortAdminP2P.setStatus('current')NEWLINEif mibBuilder.loadTexts: stpPortAdminP2P.setDescription('The administrative point-to-point status of the LAN segment attached to this port. A value of forceTrue(0) indicates that this port should always be treated as if it is connected to a point-to-point link. A value of forceFalse(1) indicates that this port should be treated as having a shared media connection. A value of auto(2) indicates that this port is considered to have a point-to-point link if it is an Aggregator and all of its members are aggregatable, or if the MAC entity is configured for full duplex operation, either through auto-negotiation or by management means.')NEWLINEstpPortRestrictedRole = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 6, 2, 1, 9), TruthValue()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: stpPortRestrictedRole.setStatus('current')NEWLINEif mibBuilder.loadTexts: stpPortRestrictedRole.setDescription("A Boolean value set by management. If TRUE causes the Port not to be selected as Root Port for the CIST or any MSTI, even it has the best spanning tree priority vector. Such a Port will be selected as an Alternate Port after the Root Port has been selected. This parameter should be FALSE by default. If set it can cause lack of spanning tree connectivity. It is set by a network administrator to prevent bridges external to a core region of the network influencing the spanning tree active topology, possibly because those bridges are not under the full control of the administrator. This administrator configuration is also known as 'Root Guard'.")NEWLINEstpPortRestrictedTCN = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 6, 2, 1, 10), TruthValue()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: stpPortRestrictedTCN.setStatus('current')NEWLINEif mibBuilder.loadTexts: stpPortRestrictedTCN.setDescription('A Boolean value set by management. If TRUE causes the Port not to propagate received topology change notifications and topology changes to other Ports. This parameter should be FALSE by default. If set it can cause temporary loss of connectivity after changes in a spanning trees active topology as a result of persistent incorrectly learnt station location information. It is set by a network administrator to prevent bridges external to a core region of the network causing address flushing in that region, possibly because those bridges are not under the full control of the administrator or MAC_Operational for the attached LANs transitions frequently.')NEWLINEstpPortHelloTime = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 6, 2, 1, 11), Timeout().subtype(subtypeSpec=ValueRangeConstraint(100, 1000))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: stpPortHelloTime.setStatus('current')NEWLINEif mibBuilder.loadTexts: stpPortHelloTime.setDescription('The amount of time between the transmission of Configuration bridge PDUs by this node in units of hundredths of a second.')NEWLINEstpPortState = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 6, 2, 1, 12), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 4, 5))).clone(namedValues=NamedValues(("disabled", 1), ("discarding", 2), ("learning", 4), ("forwarding", 5)))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: stpPortState.setStatus('current')NEWLINEif mibBuilder.loadTexts: stpPortState.setDescription('Current state of the Port as defined by the Common spanning tree protocol.')NEWLINEstpPortFowardBPDU = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 6, 2, 1, 13), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: stpPortFowardBPDU.setReference('IEEE 802.1D-2004')NEWLINEif mibBuilder.loadTexts: stpPortFowardBPDU.setStatus('current')NEWLINEif mibBuilder.loadTexts: stpPortFowardBPDU.setDescription('This object is for enabling or disabling forward BPDU.')NEWLINEmstConfigurationIdentification = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 6, 3))NEWLINEmstiConfigurationName = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 6, 3, 1), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 32))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: mstiConfigurationName.setStatus('current')NEWLINEif mibBuilder.loadTexts: mstiConfigurationName.setDescription("The Name for the Region's configuration. By Default Region Name will be equal to the Bridge Mac Address.")NEWLINEmstiRevisionLevel = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 6, 3, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: mstiRevisionLevel.setStatus('current')NEWLINEif mibBuilder.loadTexts: mstiRevisionLevel.setDescription('Version of the MST Region.')NEWLINEmstCistVlanMapped = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 6, 3, 3), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 128))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: mstCistVlanMapped.setStatus('current')NEWLINEif mibBuilder.loadTexts: mstCistVlanMapped.setDescription("A string of octets containing one bit per VLAN. The first octet corresponds to VLANs with VlanIndex values 1 through 8; the second octet to VLANs 9 through 16 etc. The most significant bit of each octet corresponds to the lowest VlanIndex value in that octet. For each VLAN that is mapped to this MSTP instance, the bit corresponding to that VLAN is set to '1'.")NEWLINEmstCistVlanMapped2k = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 6, 3, 4), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 128))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: mstCistVlanMapped2k.setStatus('current')NEWLINEif mibBuilder.loadTexts: mstCistVlanMapped2k.setDescription("A string of octets containing one bit per VLAN for VLANS with VlanIndex values 1024 through 2047. The first octet corresponds to VLANs with VlanIndex values 1024 through 1031; the second octet to VLANs 1032 through 1039 etc. The most significant bit of each octet corresponds to the lowest VlanIndex value in that octet. For each VLAN that is mapped to this MSTP instance, the bit corresponding to that VLAN is set to '1'. This object is only instantiated on devices with support for VlanIndex values up to 4095.")NEWLINEmstCistVlanMapped3k = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 6, 3, 5), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 128))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: mstCistVlanMapped3k.setStatus('current')NEWLINEif mibBuilder.loadTexts: mstCistVlanMapped3k.setDescription("A string of octets containing one bit per VLAN for VLANS with VlanIndex values 2048 through 3071. The first octet corresponds to VLANs with VlanIndex values of 2048 through 2055; the second octet to VLANs 2056 through 2063 etc. The most significant bit of each octet corresponds to the lowest VlanIndex value in that octet. For each VLAN that is mapped to this MSTP instance, the bit corresponding to that VLAN is set to '1'. This object is only instantiated on devices with support for VlanIndex values up to 4095.")NEWLINEmstCistVlanMapped4k = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 6, 3, 6), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 128))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: mstCistVlanMapped4k.setStatus('current')NEWLINEif mibBuilder.loadTexts: mstCistVlanMapped4k.setDescription("A string of octets containing one bit per VLAN for VLANS with VlanIndex values 3072 through 4095. The first octet corresponds to VLANs with VlanIndex values 3072 through 3079; the second octet to VLANs 3080 through 3087 etc. The most significant bit of each octet corresponds to the lowest VlanIndex value in that octet. For each VLAN that is mapped to this MSTP instance, the bit corresponding to that VLAN is set to '1'. This object is only instantiated on devices with support for VlanIndex values up to 4095.")NEWLINEmstVlanMstiMappingTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 6, 3, 7), )NEWLINEif mibBuilder.loadTexts: mstVlanMstiMappingTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: mstVlanMstiMappingTable.setDescription('This table contains one entry for each instance of MSTP. This table maintains context ID as one more index to support Multiple Instances.')NEWLINEmstVlanMstiMappingEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 6, 3, 7, 1), ).setIndexNames((0, "DES-1210-28MEbx", "mstInstanceIndex"))NEWLINEif mibBuilder.loadTexts: mstVlanMstiMappingEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: mstVlanMstiMappingEntry.setDescription('A conceptual row containing the status of the MSTP instance.')NEWLINEmstInstanceIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 6, 3, 7, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 15))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: mstInstanceIndex.setStatus('current')NEWLINEif mibBuilder.loadTexts: mstInstanceIndex.setDescription('An arbitrary integer within the range from 1 to the value of Max Instance Number that uniquely identifies an instance.')NEWLINEmstSetVlanList = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 6, 3, 7, 1, 2), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 512))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: mstSetVlanList.setStatus('current')NEWLINEif mibBuilder.loadTexts: mstSetVlanList.setDescription('A string of octets containing one bit per VLAN. The first octet corresponds to VLANs with VlanIndex values 1 through 8; the second octet to VLANs 9 through 16 etc. The most significant bit of each octet corresponds to the lowest VlanIndex value in that octet. The set of vlans configured by management to map for this Instance. If the VlanId to Instance Mapping has to be known then any one of the VlanMapped object should be used.If a vlan is already mapped to this Instance, it may not be mapped again. This object is used only for SET operation. GET Operation returns null values.')NEWLINEmstResetVlanList = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 6, 3, 7, 1, 3), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 512))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: mstResetVlanList.setStatus('current')NEWLINEif mibBuilder.loadTexts: mstResetVlanList.setDescription('A string of octets containing one bit per VLAN. The first octet corresponds to VLANs with VlanIndex values 1 through 8; the second octet to VLANs 9 through 16 etc. The most significant bit of each octet corresponds to the lowest VlanIndex value in that octet. The set of vlans configured by management to unmap from this Instance. A vlan may not be unmapped from this instance if it is not already mapped to this Instance. This object is used only for SET operation.GET Operation returns null values.')NEWLINEmstInstanceVlanMapped = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 6, 3, 7, 1, 4), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 128))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: mstInstanceVlanMapped.setStatus('current')NEWLINEif mibBuilder.loadTexts: mstInstanceVlanMapped.setDescription("A string of octets containing one bit per VLAN. The first octet corresponds to VLANs with VlanIndex values 1 through 8; the second octet to VLANs 9 through 16 etc. The most significant bit of each octet corresponds to the lowest VlanIndex value in that octet. For each VLAN that is mapped to this MSTP instance, the bit corresponding to that VLAN is set to '1'.")NEWLINEmstInstanceVlanMapped2k = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 6, 3, 7, 1, 5), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 128))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: mstInstanceVlanMapped2k.setStatus('current')NEWLINEif mibBuilder.loadTexts: mstInstanceVlanMapped2k.setDescription("A string of octets containing one bit per VLAN for VLANS with VlanIndex values 1024 through 2047. The first octet corresponds to VLANs with VlanIndex values 1024 through 1031; the second octet to VLANs 1032 through 1039 etc. The most significant bit of each octet corresponds to the lowest VlanIndex value in that octet. For each VLAN that is mapped to this MSTP instance, the bit corresponding to that VLAN is set to '1'. This object is only instantiated on devices with support for VlanIndex values up to 4095.")NEWLINEmstInstanceVlanMapped3k = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 6, 3, 7, 1, 6), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 128))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: mstInstanceVlanMapped3k.setStatus('current')NEWLINEif mibBuilder.loadTexts: mstInstanceVlanMapped3k.setDescription("A string of octets containing one bit per VLAN for VLANS with VlanIndex values 2048 through 3071. The first octet corresponds to VLANs with VlanIndex values of 2048 through 2055; the second octet to VLANs 2056 through 2063 etc. The most significant bit of each octet corresponds to the lowest VlanIndex value in that octet. For each VLAN that is mapped to this MSTP instance, the bit corresponding to that VLAN is set to '1'. This object is only instantiated on devices with support for VlanIndex values up to 4095.")NEWLINEmstInstanceVlanMapped4k = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 6, 3, 7, 1, 7), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 128))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: mstInstanceVlanMapped4k.setStatus('current')NEWLINEif mibBuilder.loadTexts: mstInstanceVlanMapped4k.setDescription("A string of octets containing one bit per VLAN for VLANS with VlanIndex values 3072 through 4095. The first octet corresponds to VLANs with VlanIndex values 3072 through 3079; the second octet to VLANs 3080 through 3087 etc. The most significant bit of each octet corresponds to the lowest VlanIndex value in that octet. For each VLAN that is mapped to this MSTP instance, the bit corresponding to that VLAN is set to '1'. This object is only instantiated on devices with support for VlanIndex values up to 4095.")NEWLINEstpInstance = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 6, 4))NEWLINEmstCistBridgePriority = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 6, 4, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 61440)).clone(32768)).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: mstCistBridgePriority.setStatus('current')NEWLINEif mibBuilder.loadTexts: mstCistBridgePriority.setDescription('The writable portion of the MSTI Bridge Identifier. comprising of the first two octets. The values that are set for Bridge Priority must be in steps of 4096.')NEWLINEmstCistStatus = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 6, 4, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: mstCistStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: mstCistStatus.setDescription('The administrative status requested by management for the MST feature. The value enabled(1) indicates that Mst should be enabled in the device on all ports. The value disabled(2) indicates that Mst should be disabled in the device on all ports. The object can be set to enabled(1) if and only if, fsMIMstSystemControl set to start.')NEWLINEmstMstiBridgeTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 6, 4, 3), )NEWLINEif mibBuilder.loadTexts: mstMstiBridgeTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: mstMstiBridgeTable.setDescription('Table containing Bridge Information specific to Spanning Tree Instance. This table maintains context ID as one more index to support Multiple Instances.')NEWLINEmstMstiBridgeEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 6, 4, 3, 1), ).setIndexNames((0, "DES-1210-28MEbx", "mstMstiInstanceIndex"))NEWLINEif mibBuilder.loadTexts: mstMstiBridgeEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: mstMstiBridgeEntry.setDescription('Entry indicating the Bridge Information.')NEWLINEmstMstiInstanceIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 6, 4, 3, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 15))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: mstMstiInstanceIndex.setStatus('current')NEWLINEif mibBuilder.loadTexts: mstMstiInstanceIndex.setDescription('Spanning Tree Instance to which the information belongs.')NEWLINEmstMstiBridgePriority = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 6, 4, 3, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 61440)).clone(32768)).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: mstMstiBridgePriority.setStatus('current')NEWLINEif mibBuilder.loadTexts: mstMstiBridgePriority.setDescription('The writable portion of the MSTI Bridge Identifier. comprising of the first two octets. The values that are set for Bridge Priority must be in steps of 4096.')NEWLINEmstMstiStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 6, 4, 3, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: mstMstiStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: mstMstiStatus.setDescription('The administrative status requested by management for the MST feature. The value enabled(1) indicates that Mst should be enabled in the device on all ports. The value disabled(2) indicates that Mst should be disabled in the device on all ports. The object can be set to enabled(1) if and only if, fsMIMstSystemControl set to start.')NEWLINEstpInstancePortTable = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 6, 5))NEWLINEmstCistPortTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 6, 5, 1), )NEWLINEif mibBuilder.loadTexts: mstCistPortTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: mstCistPortTable.setDescription('This table contains Common Spanning Tree Port Information.')NEWLINEmstCistPortEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 6, 5, 1, 1), ).setIndexNames((0, "DES-1210-28MEbx", "mstCistPort"))NEWLINEif mibBuilder.loadTexts: mstCistPortEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: mstCistPortEntry.setDescription('A list of information maintained by every port for Common Spanning tree.')NEWLINEmstCistPort = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 6, 5, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535)))NEWLINEif mibBuilder.loadTexts: mstCistPort.setStatus('current')NEWLINEif mibBuilder.loadTexts: mstCistPort.setDescription('The Port number of the port for which this entry contains spanning tree information.')NEWLINEmstCistPortDesignatedBridge = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 6, 5, 1, 1, 2), BridgeId()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: mstCistPortDesignatedBridge.setStatus('current')NEWLINEif mibBuilder.loadTexts: mstCistPortDesignatedBridge.setDescription("The unique Bridge Identifier of the bridge which this port considers to be the Designated Bridge for the port's segment.")NEWLINEmstCistPortAdminPathCost = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 6, 5, 1, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 200000000))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: mstCistPortAdminPathCost.setStatus('current')NEWLINEif mibBuilder.loadTexts: mstCistPortAdminPathCost.setDescription('The contribution of this port to the path cost of paths towards the MSTI Root which include this port.')NEWLINEmstCistPortPathCost = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 6, 5, 1, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 200000000))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: mstCistPortPathCost.setStatus('current')NEWLINEif mibBuilder.loadTexts: mstCistPortPathCost.setDescription('The contribution of this port to the path cost of paths towards the MSTI Root which include this port.')NEWLINEmstCistPortPriority = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 6, 5, 1, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 240)).clone(128)).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: mstCistPortPriority.setStatus('current')NEWLINEif mibBuilder.loadTexts: mstCistPortPriority.setDescription('The four most significant bits of the Port Identifier for a given Spanning Tree instance can be modified independently for each Spanning Tree instance supported by the Bridge. The values that are set for Port Priority must be in steps of 16.')NEWLINEmstCistForcePortState = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 6, 5, 1, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("disabled", 0), ("enabled", 1)))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: mstCistForcePortState.setStatus('current')NEWLINEif mibBuilder.loadTexts: mstCistForcePortState.setDescription("Current state of the Port which can be changed to either Disabled or Enabled for the specific spanning tree instance. This object can be set to enabled only if the 'fsMIMstCistForcePortState' is set to 'enabled' for this port")NEWLINEmstCistCurrentPortRole = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 6, 5, 1, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("disabled", 0), ("alternate", 1), ("backup", 2), ("root", 3), ("designated", 4), ("master", 5)))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: mstCistCurrentPortRole.setStatus('current')NEWLINEif mibBuilder.loadTexts: mstCistCurrentPortRole.setDescription('Current Port Role of the port for this spanning tree instance.')NEWLINEmstMstiPortTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 6, 5, 2), )NEWLINEif mibBuilder.loadTexts: mstMstiPortTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: mstMstiPortTable.setDescription('This table contains Spanning Tree Instance Specific Port Information.')NEWLINEmstMstiPortEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 6, 5, 2, 1), ).setIndexNames((0, "DES-1210-28MEbx", "mstMstiPort"), (0, "DES-1210-28MEbx", "mstInstanceIndex"))NEWLINEif mibBuilder.loadTexts: mstMstiPortEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: mstMstiPortEntry.setDescription('A list of information maintained by every port for each and every spanning tree instance.')NEWLINEmstMstiPort = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 6, 5, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535)))NEWLINEif mibBuilder.loadTexts: mstMstiPort.setStatus('current')NEWLINEif mibBuilder.loadTexts: mstMstiPort.setDescription('The Port number of the port for which this entry contains spanning tree information.')NEWLINEmstMstiPortDesignatedBridge = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 6, 5, 2, 1, 2), BridgeId()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: mstMstiPortDesignatedBridge.setStatus('current')NEWLINEif mibBuilder.loadTexts: mstMstiPortDesignatedBridge.setDescription("The unique Bridge Identifier of the bridge which this port considers to be the Designated Bridge for the port's segment.")NEWLINEmstMstiPortAdminPathCost = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 6, 5, 2, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 200000000))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: mstMstiPortAdminPathCost.setStatus('current')NEWLINEif mibBuilder.loadTexts: mstMstiPortAdminPathCost.setDescription('The contribution of this port to the path cost of paths towards the MSTI Root which include this port.')NEWLINEmstMstiPortPathCost = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 6, 5, 2, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 200000000))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: mstMstiPortPathCost.setStatus('current')NEWLINEif mibBuilder.loadTexts: mstMstiPortPathCost.setDescription('The contribution of this port to the path cost of paths towards the MSTI Root which include this port.')NEWLINEmstMstiPortPriority = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 6, 5, 2, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 240)).clone(128)).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: mstMstiPortPriority.setStatus('current')NEWLINEif mibBuilder.loadTexts: mstMstiPortPriority.setDescription('The four most significant bits of the Port Identifier for a given Spanning Tree instance can be modified independently for each Spanning Tree instance supported by the Bridge. The values that are set for Port Priority must be in steps of 16.')NEWLINEmstMstiForcePortState = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 6, 5, 2, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("disabled", 0), ("enabled", 1)))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: mstMstiForcePortState.setStatus('current')NEWLINEif mibBuilder.loadTexts: mstMstiForcePortState.setDescription("Current state of the Port which can be changed to either Disabled or Enabled for the specific spanning tree instance. This object can be set to enabled only if the 'fsMIMstCistForcePortState' is set to 'enabled' for this port")NEWLINEmstMstiCurrentPortRole = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 6, 5, 2, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("disabled", 0), ("alternate", 1), ("backup", 2), ("root", 3), ("designated", 4), ("master", 5)))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: mstMstiCurrentPortRole.setStatus('current')NEWLINEif mibBuilder.loadTexts: mstMstiCurrentPortRole.setDescription('Current Port Role of the port for this spanning tree instance.')NEWLINEstaticMcastTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 19, 1), )NEWLINEif mibBuilder.loadTexts: staticMcastTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: staticMcastTable.setDescription('A list of the Static MACs')NEWLINEstaticMcastEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 19, 1, 1), ).setIndexNames((0, "DES-1210-28MEbx", "staticMcastVlanID"), (0, "DES-1210-28MEbx", "staticMcastMac"), (0, "DES-1210-28MEbx", "staticMcastEgressPorts"), (0, "DES-1210-28MEbx", "staticMcastIpAddr"))NEWLINEif mibBuilder.loadTexts: staticMcastEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: staticMcastEntry.setDescription('A Static MAC entry containing the mac and forwarding port.')NEWLINEstaticMcastVlanID = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 19, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 4094))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: staticMcastVlanID.setStatus('current')NEWLINEif mibBuilder.loadTexts: staticMcastVlanID.setDescription('The VLAN ID of the static MAC entry.')NEWLINEstaticMcastMac = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 19, 1, 1, 2), MacAddress()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: staticMcastMac.setStatus('current')NEWLINEif mibBuilder.loadTexts: staticMcastMac.setDescription('The MAC address associated of the static MAC entry.')NEWLINEstaticMcastEgressPorts = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 19, 1, 1, 3), PortList().subtype(subtypeSpec=ValueSizeConstraint(1, 28))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: staticMcastEgressPorts.setReference('IEEE 802.1Q/D11 Section 12.7.7.3, 11.2.3.2.3')NEWLINEif mibBuilder.loadTexts: staticMcastEgressPorts.setStatus('current')NEWLINEif mibBuilder.loadTexts: staticMcastEgressPorts.setDescription('The set of ports to which frames received from a specific port and destined for a specific Multicast or Broadcast MAC address must be forwarded, regardless of any dynamic information e.g. from GMRP. A port may not be added in this set if it is already a member of the set of ports in dot1qStaticMulticastForbiddenEgressPorts. The default value of this object is a string of ones of appropriate length.')NEWLINEstaticMcastIpAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 19, 1, 1, 4), IpAddress()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: staticMcastIpAddr.setStatus('current')NEWLINEif mibBuilder.loadTexts: staticMcastIpAddr.setDescription('Static Multicast IP Address.')NEWLINEstaticMcastStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 19, 1, 1, 5), RowStatus()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: staticMcastStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: staticMcastStatus.setDescription('The status of an entry in the Static Mcast Table. Only a subset of the rowstatus variables (active, createAndGo, destroy) are available.')NEWLINEdot1qVlanManagementOnOff = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 7, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: dot1qVlanManagementOnOff.setStatus('current')NEWLINEif mibBuilder.loadTexts: dot1qVlanManagementOnOff.setDescription('Enable/Disable management VLAN mechanism.')NEWLINEdot1qVlanManagementid = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 7, 3), Integer32().clone(1)).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: dot1qVlanManagementid.setStatus('current')NEWLINEif mibBuilder.loadTexts: dot1qVlanManagementid.setDescription('The management VLAN ID, which will allow to forward packets of that VLAN to CPU.')NEWLINEdot1qVlanAsyOnOff = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 7, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: dot1qVlanAsyOnOff.setStatus('current')NEWLINEif mibBuilder.loadTexts: dot1qVlanAsyOnOff.setDescription('Enable/Disable IEEE 802.1Q Asymmetric VLAN')NEWLINEdot1qVlanTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 7, 6), )NEWLINEif mibBuilder.loadTexts: dot1qVlanTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: dot1qVlanTable.setDescription('A table containing static configuration information for each VLAN configured into the device by (local or network) management. All entries are permanent and will be restored after the device is reset.')NEWLINEdot1qVlanEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 7, 6, 1), ).setIndexNames((0, "DES-1210-28MEbx", "dot1qVlanName"))NEWLINEif mibBuilder.loadTexts: dot1qVlanEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: dot1qVlanEntry.setDescription('Information for a VLAN configured into the device by (local or network) management.')NEWLINEdot1qVlanName = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 7, 6, 1, 1), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(0, 20))).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: dot1qVlanName.setReference('IEEE 802.1Q/D11 Section 12.10.2.1')NEWLINEif mibBuilder.loadTexts: dot1qVlanName.setStatus('current')NEWLINEif mibBuilder.loadTexts: dot1qVlanName.setDescription('An administratively assigned string, which may be used to identify the VLAN.')NEWLINEdot1qVlanEgressPorts = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 7, 6, 1, 2), PortList()).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: dot1qVlanEgressPorts.setReference('IEEE 802.1Q/D11 Section 12.7.7.3, 11.2.3.2.3')NEWLINEif mibBuilder.loadTexts: dot1qVlanEgressPorts.setStatus('current')NEWLINEif mibBuilder.loadTexts: dot1qVlanEgressPorts.setDescription('The set of ports which are permanently assigned to the egress list for this VLAN by management. Changes to a bit in this object affect the per-port per-VLAN Registrar control for Registration Fixed for the relevant GVRP state machine on each port. A port may not be added in this set if it is already a member of the set of ports in dot1qVlanForbiddenEgressPorts. The default value of this object is a string of zeros of appropriate length, indicating not fixed.')NEWLINEdot1qVlanForbiddenPorts = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 7, 6, 1, 3), PortList()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: dot1qVlanForbiddenPorts.setReference('IEEE 802.1Q/D11 Section 12.7.7.3, 11.2.3.2.3')NEWLINEif mibBuilder.loadTexts: dot1qVlanForbiddenPorts.setStatus('current')NEWLINEif mibBuilder.loadTexts: dot1qVlanForbiddenPorts.setDescription('The set of ports which are prohibited by management from being included in the egress list for this VLAN. Changes to this object that cause a port to be included or excluded affect the per-port per-VLAN Registrar control for Registration Forbidden for the relevant GVRP state machine on each port. A port may not be added in this set if it is already a member of the set of ports in dot1qVlanEgressPorts. The default value of this object is a string of zeros of appropriate length, excluding all ports from the forbidden set.')NEWLINEdot1qVlanUntaggedPorts = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 7, 6, 1, 4), PortList()).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: dot1qVlanUntaggedPorts.setReference('IEEE 802.1Q/D11 Section 12.10.2.1')NEWLINEif mibBuilder.loadTexts: dot1qVlanUntaggedPorts.setStatus('current')NEWLINEif mibBuilder.loadTexts: dot1qVlanUntaggedPorts.setDescription('The set of ports which should transmit egress packets for this VLAN as untagged. The default value of this object for the default VLAN (dot1qVlanIndex = 1) is a string of appropriate length including all ports. There is no specified default for other VLANs. If a device agent cannot support the set of ports being set then it will reject the set operation with an error. An example might be if a manager attempts to set more than one VLAN to be untagged on egress where the device does not support this IEEE 802.1Q option.')NEWLINEdot1qVlanAdvertisementStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 7, 6, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: dot1qVlanAdvertisementStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: dot1qVlanAdvertisementStatus.setDescription('Enable/Disable Advertisement Status of the IEEE 802.1Q VLAN.')NEWLINEdot1qVlanRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 7, 6, 1, 6), RowStatus()).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: dot1qVlanRowStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: dot1qVlanRowStatus.setDescription('The status of a row in dot1qVlanTable. By setting this object, new entries can be created in dot1qVlanTable and existing entries can be removed from dot1qVlanTable. It can be used as specified in the SNMP v2 standard.')NEWLINEdot1qVlanPVIDAutoAssignOnOff = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 7, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: dot1qVlanPVIDAutoAssignOnOff.setStatus('current')NEWLINEif mibBuilder.loadTexts: dot1qVlanPVIDAutoAssignOnOff.setDescription('Enable/Disable VLAN PVID auto assignment')NEWLINEgvrpGVRPGlobalSettingsOnOff = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 11, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: gvrpGVRPGlobalSettingsOnOff.setStatus('current')NEWLINEif mibBuilder.loadTexts: gvrpGVRPGlobalSettingsOnOff.setDescription('Enable/Disable GVRP mechanism.')NEWLINEgvrpSettingsJoinTime = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 11, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(100, 100000))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: gvrpSettingsJoinTime.setStatus('current')NEWLINEif mibBuilder.loadTexts: gvrpSettingsJoinTime.setDescription('The Join Time value assigned to this Join Time field. This 16-bit value is read-write.')NEWLINEgvrpSettingsLeaveTime = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 11, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(100, 100000))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: gvrpSettingsLeaveTime.setStatus('current')NEWLINEif mibBuilder.loadTexts: gvrpSettingsLeaveTime.setDescription('The Leave Time value assigned to this Leave Time field. This 16-bit value is read-write.')NEWLINEgvrpSettingsLeaveAllTime = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 11, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(100, 100000))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: gvrpSettingsLeaveAllTime.setStatus('current')NEWLINEif mibBuilder.loadTexts: gvrpSettingsLeaveAllTime.setDescription('The Leave_All Time value assigned to this Leave_All Time field. This 16-bit value is read-write.')NEWLINEgvrpSettingsTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 11, 5), )NEWLINEif mibBuilder.loadTexts: gvrpSettingsTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: gvrpSettingsTable.setDescription('A table containing static configuration information for each GVRP configured into the device by (local or network) management. All entries are permanent and will be restored after the device is reset.')NEWLINEgvrpSettingsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 11, 5, 1), ).setIndexNames((0, "DES-1210-28MEbx", "gvrpSettingsPortControlIndex"))NEWLINEif mibBuilder.loadTexts: gvrpSettingsEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: gvrpSettingsEntry.setDescription('Information for a GVRP configured into the device by (local or network) management.')NEWLINEgvrpSettingsPortControlIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 11, 5, 1, 1), InterfaceIndex()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: gvrpSettingsPortControlIndex.setStatus('current')NEWLINEif mibBuilder.loadTexts: gvrpSettingsPortControlIndex.setDescription('The index of the port.')NEWLINEgvrpSettingsPVID = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 11, 5, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 4094))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: gvrpSettingsPVID.setStatus('current')NEWLINEif mibBuilder.loadTexts: gvrpSettingsPVID.setDescription('The PVID value assigned to this Aggregation Port. This 16-bit value is read-write.')NEWLINEgvrpSettingsGVRPState = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 11, 5, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: gvrpSettingsGVRPState.setStatus('current')NEWLINEif mibBuilder.loadTexts: gvrpSettingsGVRPState.setDescription('Enable/Disable GVRP State to this Aggregation Port.')NEWLINEgvrpSettingsIngressChecking = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 11, 5, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: gvrpSettingsIngressChecking.setStatus('current')NEWLINEif mibBuilder.loadTexts: gvrpSettingsIngressChecking.setDescription('Enable/Disable Ingress Checking mechanism of GVRP to this Aggregation Port.')NEWLINEgvrpSettingsAcceptableFrameType = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 11, 5, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("allFrames", 1), ("taggedOnly", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: gvrpSettingsAcceptableFrameType.setStatus('current')NEWLINEif mibBuilder.loadTexts: gvrpSettingsAcceptableFrameType.setDescription('Chose types All Frames/Tagged to this Aggregation Port.')NEWLINEdhcpBOOTPRelayControl = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 28, 1))NEWLINEdhcpBOOTPRelayManagement = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 28, 2))NEWLINEdhcpBOOTPRelayManagementOption82 = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 28, 2, 2))NEWLINEdhcpBOOTPRelayState = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 28, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: dhcpBOOTPRelayState.setStatus('current')NEWLINEif mibBuilder.loadTexts: dhcpBOOTPRelayState.setDescription('This object indicates DHCP relay function is enabled or disabled.')NEWLINEdhcpBOOTPRelayHopCount = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 28, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 16))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: dhcpBOOTPRelayHopCount.setStatus('current')NEWLINEif mibBuilder.loadTexts: dhcpBOOTPRelayHopCount.setDescription('This object indicates the maximum number of router hops that the BOOTP packets can cross.')NEWLINEdhcpBOOTPRelayTimeThreshold = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 28, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: dhcpBOOTPRelayTimeThreshold.setStatus('current')NEWLINEif mibBuilder.loadTexts: dhcpBOOTPRelayTimeThreshold.setDescription('This object indicates the minimum time in seconds within which the switch must relay the DHCP request. If this time is exceeded, the switch will drop the DHCP packet.')NEWLINEdhcpBOOTPRelayEnablePortlist = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 28, 1, 4), PortList()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: dhcpBOOTPRelayEnablePortlist.setStatus('current')NEWLINEif mibBuilder.loadTexts: dhcpBOOTPRelayEnablePortlist.setDescription('This object indicates DHCP relay function is enabled or disabled by portlist.')NEWLINEdhcpRelayVlanTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 28, 1, 5), )NEWLINEif mibBuilder.loadTexts: dhcpRelayVlanTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: dhcpRelayVlanTable.setDescription('This table indicates the IP address as a destination to forward (relay) DHCP packets to.')NEWLINEdhcpRelayVlanTableEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 28, 1, 5, 1), ).setIndexNames((0, "DES-1210-28MEbx", "dhcpRelayVlanSettingsVLANID"))NEWLINEif mibBuilder.loadTexts: dhcpRelayVlanTableEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: dhcpRelayVlanTableEntry.setDescription('A list of information indicates the IP address as a destination to forward (relay) DHCP packets to.')NEWLINEdhcpRelayVlanSettingsVLANID = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 28, 1, 5, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 4094))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: dhcpRelayVlanSettingsVLANID.setStatus('current')NEWLINEif mibBuilder.loadTexts: dhcpRelayVlanSettingsVLANID.setDescription('This object displays the current VLAN ID of the device.')NEWLINEdhcpRelayVlanSettingsState = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 28, 1, 5, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: dhcpRelayVlanSettingsState.setStatus('current')NEWLINEif mibBuilder.loadTexts: dhcpRelayVlanSettingsState.setDescription('This object indicates DHCP relay function of VLAN is enabled or disabled.')NEWLINEdhcpBOOTPRelayInterfaceSettingsTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 28, 2, 1), )NEWLINEif mibBuilder.loadTexts: dhcpBOOTPRelayInterfaceSettingsTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: dhcpBOOTPRelayInterfaceSettingsTable.setDescription('This table indicates the IP address as a destination to forward (relay) DHCP packets to.')NEWLINEdhcpBOOTPRelayInterfaceSettingsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 28, 2, 1, 1), ).setIndexNames((0, "DES-1210-28MEbx", "dhcpBOOTPRelayInterface"), (0, "DES-1210-28MEbx", "dhcpBOOTPRelayServerIP"))NEWLINEif mibBuilder.loadTexts: dhcpBOOTPRelayInterfaceSettingsEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: dhcpBOOTPRelayInterfaceSettingsEntry.setDescription('A list of information indicates the IP address as a destination to forward (relay) DHCP packets to.')NEWLINEdhcpBOOTPRelayInterface = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 28, 2, 1, 1, 1), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 12))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: dhcpBOOTPRelayInterface.setStatus('current')NEWLINEif mibBuilder.loadTexts: dhcpBOOTPRelayInterface.setDescription('This object indicates the name of the IP interface.')NEWLINEdhcpBOOTPRelayServerIP = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 28, 2, 1, 1, 2), IpAddress()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: dhcpBOOTPRelayServerIP.setStatus('current')NEWLINEif mibBuilder.loadTexts: dhcpBOOTPRelayServerIP.setDescription('This object indicates the DHCP server IP address.')NEWLINEdhcpBOOTPRelayInterfaceSettingsRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 28, 2, 1, 1, 3), RowStatus()).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: dhcpBOOTPRelayInterfaceSettingsRowStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: dhcpBOOTPRelayInterfaceSettingsRowStatus.setDescription('This object indicates the status of this entry.')NEWLINEdhcpBOOTPRelayOption82State = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 28, 2, 2, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: dhcpBOOTPRelayOption82State.setStatus('current')NEWLINEif mibBuilder.loadTexts: dhcpBOOTPRelayOption82State.setDescription('This object indicates DHCP relay option 82 function is enabled or disabled.')NEWLINEdhcpBOOTPRelayOption82CheckState = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 28, 2, 2, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: dhcpBOOTPRelayOption82CheckState.setStatus('current')NEWLINEif mibBuilder.loadTexts: dhcpBOOTPRelayOption82CheckState.setDescription('This object indicates DHCP relay option 82 Check function is enabled or disabled.')NEWLINEdhcpBOOTPRelayOption82Policy = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 28, 2, 2, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("replace", 1), ("drop", 2), ("keep", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: dhcpBOOTPRelayOption82Policy.setStatus('current')NEWLINEif mibBuilder.loadTexts: dhcpBOOTPRelayOption82Policy.setDescription('This object indicates DHCP relay option 82 policy.')NEWLINEdhcpBOOTPRelayOption82RemoteIDType = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 28, 2, 2, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("default", 1), ("userdefined", 2), ("userdefinedhex", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: dhcpBOOTPRelayOption82RemoteIDType.setStatus('current')NEWLINEif mibBuilder.loadTexts: dhcpBOOTPRelayOption82RemoteIDType.setDescription('This object indicates the type of remote ID. If the type is default, the remote ID will be the MAC address of the device, otherwise, the remote ID can be defined by writing to the swDHCPRelayOption82RemoteID object.')NEWLINEdhcpBOOTPRelayOption82RemoteID = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 28, 2, 2, 5), DisplayString()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: dhcpBOOTPRelayOption82RemoteID.setStatus('current')NEWLINEif mibBuilder.loadTexts: dhcpBOOTPRelayOption82RemoteID.setDescription('This object displays the current remote ID of the device. If swDHCPRelayOption82RemoteIDType is set to default, the value will be the MAC address of the device, and this object cannot be modified. If swDHCPRelayOption82RemoteIDType is set to user-defined or user-defined-hex, a new value can be written to this object.')NEWLINEdhcpBOOTPRelayOption82CircuitIDType = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 28, 2, 2, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("default", 1), ("userdefined", 2), ("userdefinedhex", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: dhcpBOOTPRelayOption82CircuitIDType.setStatus('current')NEWLINEif mibBuilder.loadTexts: dhcpBOOTPRelayOption82CircuitIDType.setDescription('This object indicates the type of remote ID. If the type is default, the circuit ID will be blank, otherwise, the circuit ID can be defined by writing to the dhcpBOOTPRelayOption82CircuitID object.')NEWLINEdhcpBOOTPRelayOption82CircuitID = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 28, 2, 2, 8), DisplayString()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: dhcpBOOTPRelayOption82CircuitID.setStatus('current')NEWLINEif mibBuilder.loadTexts: dhcpBOOTPRelayOption82CircuitID.setDescription('This object displays the current remote ID of the device. If dhcpBOOTPRelayOption82CircuitIDType is set to default, the value will be the MAC address of the device, and this object cannot be modified. If dhcpBOOTPRelayOption82CircuitIDType is set to user-defined or user-defined-hex, a new value can be written to this object.')NEWLINEdhcpLocalRelayGlobalState = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 29, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: dhcpLocalRelayGlobalState.setStatus('current')NEWLINEif mibBuilder.loadTexts: dhcpLocalRelayGlobalState.setDescription('This object indicates DHCP local relay function of VLAN is enabled or disabled.')NEWLINEdhcpLocalRelayTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 29, 2), )NEWLINEif mibBuilder.loadTexts: dhcpLocalRelayTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: dhcpLocalRelayTable.setDescription('This table indicates the IP address as a destination to forward (local relay) DHCP packets to.')NEWLINEdhcpLocalRelayTableEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 29, 2, 1), ).setIndexNames((0, "DES-1210-28MEbx", "dhcpLocalRelaySettingsVLANID"))NEWLINEif mibBuilder.loadTexts: dhcpLocalRelayTableEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: dhcpLocalRelayTableEntry.setDescription('A list of information indicates the IP address as a destination to forward (local relay) DHCP packets to.')NEWLINEdhcpLocalRelaySettingsVLANID = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 29, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 4094))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: dhcpLocalRelaySettingsVLANID.setStatus('current')NEWLINEif mibBuilder.loadTexts: dhcpLocalRelaySettingsVLANID.setDescription('This object displays the current VLAN ID of the device.')NEWLINEdhcpLocalRelaySettingsState = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 29, 2, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: dhcpLocalRelaySettingsState.setStatus('current')NEWLINEif mibBuilder.loadTexts: dhcpLocalRelaySettingsState.setDescription('This object indicates DHCP local relay function of VLAN is enabled or disabled.')NEWLINEdhcpLocalRelayEnablePortlist = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 29, 3), PortList()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: dhcpLocalRelayEnablePortlist.setStatus('current')NEWLINEif mibBuilder.loadTexts: dhcpLocalRelayEnablePortlist.setDescription('This object indicates DHCP local relay function is enabled or disabled by portlist.')NEWLINElaSystem = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 8, 1))NEWLINElaPortControl = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 8, 2))NEWLINEclass PortLaMode(TextualConvention, Integer32):NEWLINE description = 'Defines how a Port Channel does channeling. lacp(1) - place the port into passive negotiation state, in which the port waits for its peer to initiate negotiation. static(2) - force the port to enable channeling. disable(3) - channeling is disabled.'NEWLINE status = 'current'NEWLINE subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3))NEWLINE namedValues = NamedValues(("lacp", 1), ("static", 2), ("disable", 3))NEWLINENEWLINEclass LacpKey(TextualConvention, Integer32):NEWLINE description = 'The Actor or Partner Key value (0..65535).'NEWLINE status = 'current'NEWLINE subtypeSpec = Integer32.subtypeSpec + ValueRangeConstraint(0, 65535)NEWLINENEWLINElaStatus = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 8, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: laStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: laStatus.setDescription('Sets the Link Aggregation Module administrative status as enabled or disabled.')NEWLINElaPortChannelTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 8, 1, 3), )NEWLINEif mibBuilder.loadTexts: laPortChannelTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: laPortChannelTable.setDescription('A Port-channel is created through ifMain table. After the creation of the port-channel, corresponding logical interface will be created in the ifMain table. This Port-channel table is indexed through Key values and allows to configure link selection policy and the Mac address for the port-channel. All other objects in this table displays the details of the port-channel.')NEWLINElaPortChannelEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 8, 1, 3, 1), ).setIndexNames((0, "DES-1210-28MEbx", "laPortChannelIfIndex"))NEWLINEif mibBuilder.loadTexts: laPortChannelEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: laPortChannelEntry.setDescription('There is one entry in this table for each created port-channel port.')NEWLINElaPortChannelIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 8, 1, 3, 1, 1), InterfaceIndex()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: laPortChannelIfIndex.setStatus('current')NEWLINEif mibBuilder.loadTexts: laPortChannelIfIndex.setDescription("The index of the port-channel(Aggregator's interface index). ")NEWLINElaPortChannelMemberList = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 8, 1, 3, 1, 2), PortList()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: laPortChannelMemberList.setStatus('current')NEWLINEif mibBuilder.loadTexts: laPortChannelMemberList.setDescription('Member Port list of the port channel. Add the ports as a aggregation member associated of a port-channel.')NEWLINElaPortChannelMode = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 8, 1, 3, 1, 3), PortLaMode()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: laPortChannelMode.setStatus('current')NEWLINEif mibBuilder.loadTexts: laPortChannelMode.setDescription('Current Operating Channel Mode of the port channel Lacp(1) - forcing the port to negotiate with the partner. manual(2) - force the port to enable channeling (Manual). disable(3) - channeling is disabled.')NEWLINElaPortChannelMasterPort = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 8, 1, 3, 1, 4), InterfaceIndex()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: laPortChannelMasterPort.setStatus('current')NEWLINEif mibBuilder.loadTexts: laPortChannelMasterPort.setDescription('The master port of the port-channel. ')NEWLINElaAlgorithm = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 8, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6))).clone(namedValues=NamedValues(("sourceMAC", 1), ("destMAC", 2), ("sourceAndDestMAC", 3), ("sourceIP", 4), ("destIP", 5), ("sourceAndDestIP", 6)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: laAlgorithm.setStatus('current')NEWLINEif mibBuilder.loadTexts: laAlgorithm.setDescription('Sets the Link Aggregation load balance algorithm.')NEWLINElaPortControlTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 8, 2, 1), )NEWLINEif mibBuilder.loadTexts: laPortControlTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: laPortControlTable.setDescription('A table that contains Link Aggregation Control configuration information about every Aggregation Port associated with this device. A row appears in this table for each physical port.')NEWLINElaPortControlEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 8, 2, 1, 1), ).setIndexNames((0, "DES-1210-28MEbx", "laPortControlIndex"))NEWLINEif mibBuilder.loadTexts: laPortControlEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: laPortControlEntry.setDescription('A list of Link Aggregation Control configuration parameters for each Aggregation Port on this device.')NEWLINElaPortControlIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 8, 2, 1, 1, 1), InterfaceIndex()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: laPortControlIndex.setStatus('current')NEWLINEif mibBuilder.loadTexts: laPortControlIndex.setDescription('The index of the port.')NEWLINElaPortActorPortPriority = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 8, 2, 1, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: laPortActorPortPriority.setStatus('current')NEWLINEif mibBuilder.loadTexts: laPortActorPortPriority.setDescription('The priority value assigned to this Aggregation Port. This 16-bit value is read-write.')NEWLINElaPortActorActivity = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 8, 2, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("active", 1), ("passive", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: laPortActorActivity.setStatus('current')NEWLINEif mibBuilder.loadTexts: laPortActorActivity.setDescription('This object indicates LACP_Activity to this Aggregation Port. LACP can be configured in one of two modes: active or passive. In active mode it will always send frames along the configured links. If the actor and partner are both in passive mode, they do not exchange LACP packets.')NEWLINElaPortActorTimeout = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 8, 2, 1, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("short", 1), ("long", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: laPortActorTimeout.setStatus('current')NEWLINEif mibBuilder.loadTexts: laPortActorTimeout.setDescription('This object indicates LACP_Timeout to this Aggregation Port. short(1) - LACP Timeout 3 seconds. long (2) - LACP Timeout 90 seconds.')NEWLINEstaticVlanBaseTable = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 9, 5))NEWLINEstaticDisableAutoLearn = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 9, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("on", 1), ("off", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: staticDisableAutoLearn.setStatus('current')NEWLINEif mibBuilder.loadTexts: staticDisableAutoLearn.setDescription('Set on to disable Auto Learning Excluding Uplink Port and set off to enable Auto Learning.')NEWLINEstaticAutoLearningList = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 9, 2), PortList()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: staticAutoLearningList.setStatus('current')NEWLINEif mibBuilder.loadTexts: staticAutoLearningList.setDescription("The set of the device's member ports that belong to the Static MAC auto learning enable/disable. For example, when Disable Auto Learning is enable, the octet value set up as '# 0x0F 0xFF 0xFF 0xFF' means from port 1 to port 4 are not in auto learning state, the other ports are in auto learning state. It can be set up when Disable Auto Learning is enable.")NEWLINEstaticTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 9, 3), )NEWLINEif mibBuilder.loadTexts: staticTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: staticTable.setDescription('A list of the Static MACs')NEWLINEstaticEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 9, 3, 1), ).setIndexNames((0, "DES-1210-28MEbx", "staticVlanID"), (0, "DES-1210-28MEbx", "staticMac"), (0, "DES-1210-28MEbx", "staticPort"))NEWLINEif mibBuilder.loadTexts: staticEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: staticEntry.setDescription('A Static MAC entry containing the mac and forwarding port.')NEWLINEstaticVlanID = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 9, 3, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 4094))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: staticVlanID.setStatus('current')NEWLINEif mibBuilder.loadTexts: staticVlanID.setDescription('The VLAN ID of the static MAC entry.')NEWLINEstaticMac = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 9, 3, 1, 2), MacAddress()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: staticMac.setStatus('current')NEWLINEif mibBuilder.loadTexts: staticMac.setDescription('The MAC address associated of the static MAC entry.')NEWLINEstaticPort = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 9, 3, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 28))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: staticPort.setStatus('current')NEWLINEif mibBuilder.loadTexts: staticPort.setDescription('The forwarding port of the static MAC entry. For all machines give maximum port number.')NEWLINEstaticStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 9, 3, 1, 4), RowStatus()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: staticStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: staticStatus.setDescription('The status of an entry in the Static MAC Table. Only a subset of the rowstatus variables (active, createAndGo, destroy) are available. The trunk member port can not set up static MAC.')NEWLINEautoFdbTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 9, 4), )NEWLINEif mibBuilder.loadTexts: autoFdbTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: autoFdbTable.setDescription('A list of the Auto Fdb')NEWLINEautoFdbEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 9, 4, 1), ).setIndexNames((0, "DES-1210-28MEbx", "autoFdbIPAddress"))NEWLINEif mibBuilder.loadTexts: autoFdbEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: autoFdbEntry.setDescription('A auto fdb entry containing the ipaddress')NEWLINEautoFdbIPAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 9, 4, 1, 1), IpAddress()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: autoFdbIPAddress.setStatus('current')NEWLINEif mibBuilder.loadTexts: autoFdbIPAddress.setDescription('The IpAddress of the autoFdbEntry.')NEWLINEautoFdbVlanID = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 9, 4, 1, 2), Integer32()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: autoFdbVlanID.setStatus('current')NEWLINEif mibBuilder.loadTexts: autoFdbVlanID.setDescription('The VlanID of the autoFdbEntry.')NEWLINEautoFdbMacAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 9, 4, 1, 3), MacAddress()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: autoFdbMacAddress.setStatus('current')NEWLINEif mibBuilder.loadTexts: autoFdbMacAddress.setDescription('The Mac Address of the autoFdbEntry.')NEWLINEautoFdbPort = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 9, 4, 1, 4), Integer32()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: autoFdbPort.setStatus('current')NEWLINEif mibBuilder.loadTexts: autoFdbPort.setDescription('The Port of the autoFdbEntry.')NEWLINEautoFdbTimeStamp = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 9, 4, 1, 5), Integer32()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: autoFdbTimeStamp.setStatus('current')NEWLINEif mibBuilder.loadTexts: autoFdbTimeStamp.setDescription('The Time Stamp of the autoFdbEntry.')NEWLINEautoFdbStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 9, 4, 1, 6), RowStatus()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: autoFdbStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: autoFdbStatus.setDescription('The status of an entry in the Auto Fdb Table. Only a subset of the rowstatus variables (createAndGo, createAndWait,destroy) are available.')NEWLINEstaticVlanBaseAutoLearnList1k = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 9, 5, 1), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 128))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: staticVlanBaseAutoLearnList1k.setStatus('current')NEWLINEif mibBuilder.loadTexts: staticVlanBaseAutoLearnList1k.setDescription("A string of octets containing one bit per VLAN. The first octet corresponds to VLANs with VlanIndex values 1 through 8; the second octet to VLANs 9 through 16 etc. The most significant bit of each octet corresponds to the lowest VlanIndex value in that octet. For each VLAN that is mapped to this Auto Learn, the bit corresponding to that VLAN is set to '1'. Write AutoLearnList1k use 256 character, and conform to the foregoing rules.")NEWLINEstaticVlanBaseAutoLearnList2k = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 9, 5, 2), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 128))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: staticVlanBaseAutoLearnList2k.setStatus('current')NEWLINEif mibBuilder.loadTexts: staticVlanBaseAutoLearnList2k.setDescription('A string of octets containing one bit per VLAN for VLANS with VlanIndex values 1025 through 2048. The most significant bit of each octet corresponds to the lowest VlanIndex value in that octet. For each VLAN that is mapped to this Auto Learn. Write AutoLearnList2k use 256 character, and conform to the foregoing rules.')NEWLINEstaticVlanBaseAutoLearnList3k = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 9, 5, 3), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 128))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: staticVlanBaseAutoLearnList3k.setStatus('current')NEWLINEif mibBuilder.loadTexts: staticVlanBaseAutoLearnList3k.setDescription("A string of octets containing one bit per VLAN for VLANS with VlanIndex values 2049 through 3072. The most significant bit of each octet corresponds to the lowest VlanIndex value in that octet. For each VLAN that is mapped to this Auto Learn the bit corresponding to that VLAN is set to '1'. Write AutoLearnList3k use 256 character, and conform to the foregoing rules.")NEWLINEstaticVlanBaseAutoLearnList4k = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 9, 5, 4), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 128))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: staticVlanBaseAutoLearnList4k.setStatus('current')NEWLINEif mibBuilder.loadTexts: staticVlanBaseAutoLearnList4k.setDescription("A string of octets containing one bit per VLAN for VLANS with VlanIndex values 3073 through 4094. The most significant bit of each octet corresponds to the lowest VlanIndex value in that octet. For each VLAN that is mapped to this Auto Learn the bit corresponding to that VLAN is set to '1'. Write AutoLearnList4k use 256 character, and conform to the foregoing rules.")NEWLINEstaticVlanBaseEnableAutoLearn = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 9, 5, 5), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 512))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: staticVlanBaseEnableAutoLearn.setStatus('current')NEWLINEif mibBuilder.loadTexts: staticVlanBaseEnableAutoLearn.setDescription('Set enable vlan list to auto learn, and range 1-4094.')NEWLINEstaticVlanBaseDisableAutoLearn = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 9, 5, 6), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 512))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: staticVlanBaseDisableAutoLearn.setStatus('current')NEWLINEif mibBuilder.loadTexts: staticVlanBaseDisableAutoLearn.setDescription('Set disable vlan list to auto learn, and range 1-4094.')NEWLINEigsSystem = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 10, 1))NEWLINEigsVlan = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 10, 3))NEWLINEigsHost = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 10, 6))NEWLINEigsStatus = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 10, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2))).clone(2)).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: igsStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: igsStatus.setDescription("Enables or disables IGMP snooping in the system. When set to 'enabled', the IGS module starts protocol operations. When set to 'disabled', the IGS module stops performing protocol operations.")NEWLINEigsRouterPortPurgeInterval = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 10, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(60, 600)).clone(260)).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: igsRouterPortPurgeInterval.setStatus('current')NEWLINEif mibBuilder.loadTexts: igsRouterPortPurgeInterval.setDescription("This is the interval (in seconds) after which a learnt router port entry will be purged. For each router port learnt, this timer runs for 'RouterPortPurgeInterval' seconds.When the timer expires, the learnt router port entry is purged. However if control messages are received from the router before the timer expiry, then the timer is restarted.")NEWLINEigsHostPortPurgeInterval = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 10, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(130, 153025)).clone(260)).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: igsHostPortPurgeInterval.setStatus('current')NEWLINEif mibBuilder.loadTexts: igsHostPortPurgeInterval.setDescription("This is the interval (in seconds) after which a learnt port entry will be purged. For each port on which report has been received this timer runs for 'PortPurgeInterval' seconds. This timer will be restarted whenever a report message is received from a host on the specific port. If the timer expires, then , the learnt port entry will be purged from the multicast group.")NEWLINEigsDataDrivenLearningMaxLearnedEntryVlaue = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 10, 1, 8), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 1024)).clone(64)).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: igsDataDrivenLearningMaxLearnedEntryVlaue.setStatus('current')NEWLINEif mibBuilder.loadTexts: igsDataDrivenLearningMaxLearnedEntryVlaue.setDescription('The maximum data driven learning entry value.')NEWLINEigsReportToAllPort = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 10, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2))).clone(2)).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: igsReportToAllPort.setStatus('current')NEWLINEif mibBuilder.loadTexts: igsReportToAllPort.setDescription("Enables or disables IGMP snooping in the system. When set to 'enabled', the IGS module forwards packets to report to all port. When set to 'disabled', the IGS module forwards packets to router port only.")NEWLINEigsVlanRouterTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 10, 3, 3), )NEWLINEif mibBuilder.loadTexts: igsVlanRouterTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: igsVlanRouterTable.setDescription('This table contains the list of ports through which a router, in a particular VLAN is reachable.')NEWLINEigsVlanRouterEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 10, 3, 3, 1), ).setIndexNames((0, "DES-1210-28MEbx", "igsVlanRouterVlanId"))NEWLINEif mibBuilder.loadTexts: igsVlanRouterEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: igsVlanRouterEntry.setDescription('Contains the VLAN ID and list of ports on which routers are present in the VLAN.')NEWLINEigsVlanRouterVlanId = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 10, 3, 3, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 4094))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: igsVlanRouterVlanId.setStatus('current')NEWLINEif mibBuilder.loadTexts: igsVlanRouterVlanId.setDescription('VLAN ID of the ports through which router is reachable.')NEWLINEigsVlanRouterPortList = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 10, 3, 3, 1, 2), PortList()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: igsVlanRouterPortList.setStatus('current')NEWLINEif mibBuilder.loadTexts: igsVlanRouterPortList.setDescription('List of ports on which routers are present. These router ports are learnt through control messages received from routers, and can also be configured statically.')NEWLINEigsVlanFilterTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 10, 3, 4), )NEWLINEif mibBuilder.loadTexts: igsVlanFilterTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: igsVlanFilterTable.setDescription('This table contains configuration of snooping on specific Vlans. This Table is valid only when VLAN is enabled in the system.')NEWLINEigsVlanFilterEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 10, 3, 4, 1), ).setIndexNames((0, "DES-1210-28MEbx", "igsVlanFilterVlanId"))NEWLINEif mibBuilder.loadTexts: igsVlanFilterEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: igsVlanFilterEntry.setDescription('Contains snooping status , version and fast leave configuration for a specific VLAN.')NEWLINEigsVlanFilterVlanId = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 10, 3, 4, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 4094))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: igsVlanFilterVlanId.setStatus('current')NEWLINEif mibBuilder.loadTexts: igsVlanFilterVlanId.setDescription('Index of IgsVlanFilterEntry. This object indicates the VLAN ID for which the snooping configurations in IgsVlanFilterEntry is to be done.')NEWLINEigsVlanSnoopStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 10, 3, 4, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2))).clone(1)).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: igsVlanSnoopStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: igsVlanSnoopStatus.setDescription('This object allows you to enable/disable IGS function on a specific VLAN.')NEWLINEigsVlanQuerier = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 10, 3, 4, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2))).clone(2)).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: igsVlanQuerier.setStatus('current')NEWLINEif mibBuilder.loadTexts: igsVlanQuerier.setDescription('Indicates whether the switch is configured as a querier in the VLAN')NEWLINEigsVlanCfgQuerier = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 10, 3, 4, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2))).clone(2)).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: igsVlanCfgQuerier.setStatus('current')NEWLINEif mibBuilder.loadTexts: igsVlanCfgQuerier.setDescription("The snooping switch can be configured as a querier via this object to send out IGMP general queries when IGMP routers are not present in the VLAN. When set to 'enabled', the switch will generate general queries.")NEWLINEigsVlanQueryInterval = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 10, 3, 4, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(60, 600)).clone(125)).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: igsVlanQueryInterval.setStatus('current')NEWLINEif mibBuilder.loadTexts: igsVlanQueryInterval.setDescription('This is the interval (in seconds) for which the switch sends general queries when it is configured as a querier for the VLAN. A switch should be configured as a querier for a VLAN only when there is no queriers in the network.')NEWLINEigsVlanRtrPortList = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 10, 3, 4, 1, 6), PortList()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: igsVlanRtrPortList.setStatus('current')NEWLINEif mibBuilder.loadTexts: igsVlanRtrPortList.setDescription('List of ports which are configured statically as router ports')NEWLINEigsVlanFbdRtrPortList = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 10, 3, 4, 1, 7), PortList()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: igsVlanFbdRtrPortList.setStatus('current')NEWLINEif mibBuilder.loadTexts: igsVlanFbdRtrPortList.setDescription('List of ports which can be configured statically as forbidden router ports.')NEWLINEigsVlanFastLeave = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 10, 3, 4, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2))).clone(2)).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: igsVlanFastLeave.setStatus('current')NEWLINEif mibBuilder.loadTexts: igsVlanFastLeave.setDescription("Enables or disables fast leave for the VLAN. When it is 'disabled',on reception of a leave message, the switch checks if they are any interested receivers for the group by sending a group specific query before removing the port from the forwarding table. If set to 'enabled', the switch does not send a group specific query and immediately removes the port from the forwarding table.")NEWLINEigsVlanDataDrivenLearningStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 10, 3, 4, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: igsVlanDataDrivenLearningStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: igsVlanDataDrivenLearningStatus.setDescription('This object allows you to enable/disable Data Driven Learning function on a specific VLAN.')NEWLINEigsVlanQuerierVersionStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 10, 3, 4, 1, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(3, 2))).clone(namedValues=NamedValues(("igmp-v3", 3), ("igmp-v2", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: igsVlanQuerierVersionStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: igsVlanQuerierVersionStatus.setDescription('This object allows you to enable/disable Querier Version function on a specific VLAN.')NEWLINEigsVlanDataDrivenLearningAgeOutStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 10, 3, 4, 1, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: igsVlanDataDrivenLearningAgeOutStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: igsVlanDataDrivenLearningAgeOutStatus.setDescription('This object allows you to enable/disable Data Driven Learning Age Out State on a specific VLAN.')NEWLINEigsVlanReportSuppression = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 10, 3, 4, 1, 12), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: igsVlanReportSuppression.setStatus('current')NEWLINEif mibBuilder.loadTexts: igsVlanReportSuppression.setDescription('Enables or disables Report suppression in the system.')NEWLINEigsVlanRobustnessValue = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 10, 3, 4, 1, 13), Integer32().subtype(subtypeSpec=ValueRangeConstraint(2, 255)).clone(2)).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: igsVlanRobustnessValue.setStatus('current')NEWLINEif mibBuilder.loadTexts: igsVlanRobustnessValue.setDescription("When the switch receives leave message on a port, it sends group specific query to check if there are any other interested receivers for the group. This attribute defines the maximum number of queries sent by the switch before deleting the port from the group membership information in the forwarding database. If the maximum retry count exceeds 'igsRobustnessValue', then the port will be deleted from the multicast group membership information in the forwarding database and received leave message will be forwarded onto the router ports if there are no interested receivers for the group.")NEWLINEigsVlanGrpQueryInterval = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 10, 3, 4, 1, 14), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 25)).clone(1)).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: igsVlanGrpQueryInterval.setStatus('current')NEWLINEif mibBuilder.loadTexts: igsVlanGrpQueryInterval.setDescription("The value of this attribute defines the time period with which the switch will send group specific queries on a port to check if there is any intersted receivers. The switch will send 'igsRobustnessValue' queries before removing the port from the group membership information in the forwarding database.")NEWLINEigsVlanQueryMaxResponseTime = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 10, 3, 4, 1, 15), Integer32().subtype(subtypeSpec=ValueRangeConstraint(10, 25)).clone(10)).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: igsVlanQueryMaxResponseTime.setStatus('current')NEWLINEif mibBuilder.loadTexts: igsVlanQueryMaxResponseTime.setDescription('The maximum query response time advertised in IGMPv2 general queries on this interface.')NEWLINEigsVlanMulticastGroupTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 10, 3, 5), )NEWLINEif mibBuilder.loadTexts: igsVlanMulticastGroupTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: igsVlanMulticastGroupTable.setDescription('This table contains MAC based multicast forwarding information.')NEWLINEigsVlanMulticastGroupEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 10, 3, 5, 1), ).setIndexNames((0, "DES-1210-28MEbx", "igsVlanMulticastGroupVlanId"), (0, "DES-1210-28MEbx", "igsVlanMulticastGroupIpAddress"))NEWLINEif mibBuilder.loadTexts: igsVlanMulticastGroupEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: igsVlanMulticastGroupEntry.setDescription('This table contains VLAN ID, multicast group MAC address and the list of ports onto which the multicast data packets for group should be forwarded.')NEWLINEigsVlanMulticastGroupVlanId = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 10, 3, 5, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 4094))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: igsVlanMulticastGroupVlanId.setStatus('current')NEWLINEif mibBuilder.loadTexts: igsVlanMulticastGroupVlanId.setDescription('VLAN ID pertaining to the Multicast forwarding entry')NEWLINEigsVlanMulticastGroupIpAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 10, 3, 5, 1, 2), InetAddress()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: igsVlanMulticastGroupIpAddress.setStatus('current')NEWLINEif mibBuilder.loadTexts: igsVlanMulticastGroupIpAddress.setDescription('Multicast group IP address. This object indicates that a multicast group address was learned in the switch and be represented as IP address format.')NEWLINEigsVlanMulticastGroupMacAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 10, 3, 5, 1, 3), MacAddress()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: igsVlanMulticastGroupMacAddress.setStatus('current')NEWLINEif mibBuilder.loadTexts: igsVlanMulticastGroupMacAddress.setDescription('Multicast group MAC address. This object indicates that a multicast group address was learned in the switch and be represented as MAC address format.')NEWLINEigsVlanMulticastGroupPortList = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 10, 3, 5, 1, 4), PortList()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: igsVlanMulticastGroupPortList.setStatus('current')NEWLINEif mibBuilder.loadTexts: igsVlanMulticastGroupPortList.setDescription('List of ports onto which the multicast data packets destined for this group will be forwarded.')NEWLINEigsHostTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 10, 6, 1), )NEWLINEif mibBuilder.loadTexts: igsHostTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: igsHostTable.setDescription('This table is used to manage the IGMP Host based Fast Leave function of the switch.')NEWLINEigsHostEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 10, 6, 1, 1), ).setIndexNames((0, "DES-1210-28MEbx", "igsHostTableVLANID"), (0, "DES-1210-28MEbx", "igsHostTableGroupAddress"), (0, "DES-1210-28MEbx", "igsHostTablePort"), (0, "DES-1210-28MEbx", "igsHostTableHostIPAddress"))NEWLINEif mibBuilder.loadTexts: igsHostEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: igsHostEntry.setDescription('Contains management entities for IGMP Host based fast leave function.')NEWLINEigsHostTableVLANID = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 10, 6, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 4094))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: igsHostTableVLANID.setStatus('current')NEWLINEif mibBuilder.loadTexts: igsHostTableVLANID.setDescription('VLAN ID of Host table entry.')NEWLINEigsHostTableGroupAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 10, 6, 1, 1, 2), InetAddress()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: igsHostTableGroupAddress.setStatus('current')NEWLINEif mibBuilder.loadTexts: igsHostTableGroupAddress.setDescription('Group address of Host table entry.')NEWLINEigsHostTablePort = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 10, 6, 1, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 28))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: igsHostTablePort.setStatus('current')NEWLINEif mibBuilder.loadTexts: igsHostTablePort.setDescription('Port number of Host table entry. For all machines give maximum port number.')NEWLINEigsHostTableHostIPAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 10, 6, 1, 1, 4), InetAddress()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: igsHostTableHostIPAddress.setStatus('current')NEWLINEif mibBuilder.loadTexts: igsHostTableHostIPAddress.setDescription('Host IP address of Group in Host table entry.')NEWLINEmldsSystem = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 88, 1))NEWLINEmldsVlan = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 88, 3))NEWLINEmldsHost = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 88, 4))NEWLINEmldsStatus = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 88, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2))).clone(2)).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: mldsStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: mldsStatus.setDescription("Enables or disables MLD snooping in the system. When set to 'enabled', the MLDS module starts protocol operations. When set to 'disabled', the MLDS module stops performing protocol operations.")NEWLINEmldsRouterPortPurgeInterval = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 88, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(60, 600)).clone(260)).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: mldsRouterPortPurgeInterval.setStatus('current')NEWLINEif mibBuilder.loadTexts: mldsRouterPortPurgeInterval.setDescription("This is the interval (in seconds) after which a learnt router port entry will be purged. For each router port learnt, this timer runs for 'RouterPortPurgeInterval' seconds.When the timer expires, the learnt router port entry is purged. However if control messages are received from the router before the timer expiry, then the timer is restarted.")NEWLINEmldsHostPortPurgeInterval = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 88, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(130, 153025)).clone(260)).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: mldsHostPortPurgeInterval.setStatus('current')NEWLINEif mibBuilder.loadTexts: mldsHostPortPurgeInterval.setDescription("This is the interval (in seconds) after which a learnt port entry will be purged. For each port on which report has been received this timer runs for 'PortPurgeInterval' seconds. This timer will be restarted whenever a report message is received from a host on the specific port. If the timer expires, then , the learnt port entry will be purged from the multicast group.")NEWLINEmldsDataDrivenLearningMaxLearnedEntryVlaue = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 88, 1, 8), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 1024)).clone(64)).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: mldsDataDrivenLearningMaxLearnedEntryVlaue.setStatus('current')NEWLINEif mibBuilder.loadTexts: mldsDataDrivenLearningMaxLearnedEntryVlaue.setDescription('The maximum data driven learning entry value.')NEWLINEmldsVlanRouterTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 88, 3, 3), )NEWLINEif mibBuilder.loadTexts: mldsVlanRouterTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: mldsVlanRouterTable.setDescription('This table contains the list of ports through which a router, in a particular VLAN is reachable.')NEWLINEmldsVlanRouterEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 88, 3, 3, 1), ).setIndexNames((0, "DES-1210-28MEbx", "mldsVlanRouterVlanId"))NEWLINEif mibBuilder.loadTexts: mldsVlanRouterEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: mldsVlanRouterEntry.setDescription('Contains the VLAN ID and list of ports on which routers are present in the VLAN.')NEWLINEmldsVlanRouterVlanId = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 88, 3, 3, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 4094))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: mldsVlanRouterVlanId.setStatus('current')NEWLINEif mibBuilder.loadTexts: mldsVlanRouterVlanId.setDescription('VLAN ID of the ports through which router is reachable.')NEWLINEmldsVlanRouterPortList = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 88, 3, 3, 1, 2), PortList()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: mldsVlanRouterPortList.setStatus('current')NEWLINEif mibBuilder.loadTexts: mldsVlanRouterPortList.setDescription('List of ports on which routers are present. These router ports are learnt through control messages received from routers, and can also be configured statically.')NEWLINEmldsVlanFilterTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 88, 3, 4), )NEWLINEif mibBuilder.loadTexts: mldsVlanFilterTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: mldsVlanFilterTable.setDescription('This table contains configuration of snooping on specific Vlans. This Table is valid only when VLAN is enabled in the system.')NEWLINEmldsVlanFilterEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 88, 3, 4, 1), ).setIndexNames((0, "DES-1210-28MEbx", "mldsVlanFilterVlanId"))NEWLINEif mibBuilder.loadTexts: mldsVlanFilterEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: mldsVlanFilterEntry.setDescription('Contains snooping status , version and fast leave configuration for a specific VLAN.')NEWLINEmldsVlanFilterVlanId = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 88, 3, 4, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 4094))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: mldsVlanFilterVlanId.setStatus('current')NEWLINEif mibBuilder.loadTexts: mldsVlanFilterVlanId.setDescription('Index of MldsVlanFilterEntry. This object indicates the VLAN ID for which the snooping configurations in MldsVlanFilterEntry is to be done.')NEWLINEmldsVlanSnoopStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 88, 3, 4, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2))).clone(1)).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: mldsVlanSnoopStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: mldsVlanSnoopStatus.setDescription('This object allows you to enable/disable MLDS function on a specific VLAN.')NEWLINEmldsVlanQuerier = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 88, 3, 4, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2))).clone(2)).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: mldsVlanQuerier.setStatus('current')NEWLINEif mibBuilder.loadTexts: mldsVlanQuerier.setDescription('Indicates whether the switch is configured as a querier in the VLAN')NEWLINEmldsVlanCfgQuerier = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 88, 3, 4, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2))).clone(2)).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: mldsVlanCfgQuerier.setStatus('current')NEWLINEif mibBuilder.loadTexts: mldsVlanCfgQuerier.setDescription("The snooping switch can be configured as a querier via this object to send out MLD general queries when IGMP routers are not present in the VLAN. When set to 'enabled', the switch will generate general queries.")NEWLINEmldsVlanQueryInterval = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 88, 3, 4, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(60, 600)).clone(125)).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: mldsVlanQueryInterval.setStatus('current')NEWLINEif mibBuilder.loadTexts: mldsVlanQueryInterval.setDescription('This is the interval (in seconds) for which the switch sends general queries when it is configured as a querier for the VLAN. A switch should be configured as a querier for a VLAN only when there is no queriers in the network.')NEWLINEmldsVlanRtrPortList = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 88, 3, 4, 1, 6), PortList()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: mldsVlanRtrPortList.setStatus('current')NEWLINEif mibBuilder.loadTexts: mldsVlanRtrPortList.setDescription('List of ports which are configured statically as router ports')NEWLINEmldsVlanFbdRtrPortList = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 88, 3, 4, 1, 7), PortList()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: mldsVlanFbdRtrPortList.setStatus('current')NEWLINEif mibBuilder.loadTexts: mldsVlanFbdRtrPortList.setDescription('List of ports which can be configured statically as forbidden router ports.')NEWLINEmldsVlanFastLeave = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 88, 3, 4, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2))).clone(2)).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: mldsVlanFastLeave.setStatus('current')NEWLINEif mibBuilder.loadTexts: mldsVlanFastLeave.setDescription("Enables or disables fast leave for the VLAN. When it is 'disabled',on reception of a leave message, the switch checks if they are any interested receivers for the group by sending a group specific query before removing the port from the forwarding table. If set to 'enabled', the switch does not send a group specific query and immediately removes the port from the forwarding table.")NEWLINEmldsVlanDataDrivenLearningStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 88, 3, 4, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: mldsVlanDataDrivenLearningStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: mldsVlanDataDrivenLearningStatus.setDescription('This object allows you to enable/disable Data Driven Learning function on a specific VLAN.')NEWLINEmldsVlanReportSuppression = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 88, 3, 4, 1, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: mldsVlanReportSuppression.setStatus('current')NEWLINEif mibBuilder.loadTexts: mldsVlanReportSuppression.setDescription('Enables or disables Report suppression in the system.')NEWLINEmldsVlanRobustnessValue = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 88, 3, 4, 1, 11), Integer32().subtype(subtypeSpec=ValueRangeConstraint(2, 255)).clone(2)).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: mldsVlanRobustnessValue.setStatus('current')NEWLINEif mibBuilder.loadTexts: mldsVlanRobustnessValue.setDescription("When the switch receives leave message on a port, it sends group specific query to check if there are any other interested receivers for the group. This attribute defines the maximum number of queries sent by the switch before deleting the port from the group membership information in the forwarding database. If the maximum retry count exceeds 'mldsRobustnessValue', then the port will be deleted from the multicast group membership information in the forwarding database and received leave message will be forwarded onto the router ports if there are no interested receivers for the group.")NEWLINEmldsVlanGrpQueryInterval = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 88, 3, 4, 1, 12), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 25)).clone(1)).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: mldsVlanGrpQueryInterval.setStatus('current')NEWLINEif mibBuilder.loadTexts: mldsVlanGrpQueryInterval.setDescription("The value of this attribute defines the time period with which the switch will send group specific queries on a port to check if there is any intersted receivers. The switch will send 'mldsRobustnessValue' queries before removing the port from the group membership information in the forwarding database.")NEWLINEmldsVlanQueryMaxResponseTime = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 88, 3, 4, 1, 13), Integer32().subtype(subtypeSpec=ValueRangeConstraint(10, 25)).clone(10)).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: mldsVlanQueryMaxResponseTime.setStatus('current')NEWLINEif mibBuilder.loadTexts: mldsVlanQueryMaxResponseTime.setDescription('The maximum query response time advertised in MLDv1 general queries on this interface.')NEWLINEmldsVlanMulticastGroupTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 88, 3, 5), )NEWLINEif mibBuilder.loadTexts: mldsVlanMulticastGroupTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: mldsVlanMulticastGroupTable.setDescription('This table contains MAC based multicast forwarding information.')NEWLINEmldsVlanMulticastGroupEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 88, 3, 5, 1), ).setIndexNames((0, "DES-1210-28MEbx", "mldsVlanMulticastGroupVlanId"), (0, "DES-1210-28MEbx", "mldsVlanMulticastGroupIpAddress"))NEWLINEif mibBuilder.loadTexts: mldsVlanMulticastGroupEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: mldsVlanMulticastGroupEntry.setDescription('This table contains VLAN ID, multicast group MAC address and the list of ports onto which the multicast data packets for group should be forwarded.')NEWLINEmldsVlanMulticastGroupVlanId = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 88, 3, 5, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 4094))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: mldsVlanMulticastGroupVlanId.setStatus('current')NEWLINEif mibBuilder.loadTexts: mldsVlanMulticastGroupVlanId.setDescription('VLAN ID pertaining to the Multicast forwarding entry')NEWLINEmldsVlanMulticastGroupIpAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 88, 3, 5, 1, 2), InetAddress()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: mldsVlanMulticastGroupIpAddress.setStatus('current')NEWLINEif mibBuilder.loadTexts: mldsVlanMulticastGroupIpAddress.setDescription('Multicast group IP address. This object indicates that a multicast group address was learned in the switch and be represented as IP address format.')NEWLINEmldsVlanMulticastGroupMacAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 88, 3, 5, 1, 3), MacAddress()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: mldsVlanMulticastGroupMacAddress.setStatus('current')NEWLINEif mibBuilder.loadTexts: mldsVlanMulticastGroupMacAddress.setDescription('Multicast group MAC address. This object indicates that a multicast group address was learned in the switch and be represented as MAC address format.')NEWLINEmldsVlanMulticastGroupPortList = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 88, 3, 5, 1, 4), PortList()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: mldsVlanMulticastGroupPortList.setStatus('current')NEWLINEif mibBuilder.loadTexts: mldsVlanMulticastGroupPortList.setDescription('List of ports onto which the multicast data packets destined for this group will be forwarded.')NEWLINEmldsHostTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 88, 4, 1), )NEWLINEif mibBuilder.loadTexts: mldsHostTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: mldsHostTable.setDescription('This table is used to manage the IGMP Host based Fast Leave function of the switch.')NEWLINEmldsHostEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 88, 4, 1, 1), ).setIndexNames((0, "DES-1210-28MEbx", "mldsHostTableVLANID"), (0, "DES-1210-28MEbx", "mldsHostTableGroupAddress"), (0, "DES-1210-28MEbx", "mldsHostTablePort"), (0, "DES-1210-28MEbx", "mldsHostTableHostIPAddress"))NEWLINEif mibBuilder.loadTexts: mldsHostEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: mldsHostEntry.setDescription('Contains management entities for IGMP Host based fast leave function.')NEWLINEmldsHostTableVLANID = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 88, 4, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 4094))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: mldsHostTableVLANID.setStatus('current')NEWLINEif mibBuilder.loadTexts: mldsHostTableVLANID.setDescription('VLAN ID of IPv6 Host table entry.')NEWLINEmldsHostTableGroupAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 88, 4, 1, 1, 2), Ipv6Address()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: mldsHostTableGroupAddress.setStatus('current')NEWLINEif mibBuilder.loadTexts: mldsHostTableGroupAddress.setDescription('Group address of IPv6 Host table entry.')NEWLINEmldsHostTablePort = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 88, 4, 1, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 28))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: mldsHostTablePort.setStatus('current')NEWLINEif mibBuilder.loadTexts: mldsHostTablePort.setDescription('Port number of IPv6 Host table entry. For all machines give maximum port number.')NEWLINEmldsHostTableHostIPAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 88, 4, 1, 1, 4), Ipv6Address()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: mldsHostTableHostIPAddress.setStatus('current')NEWLINEif mibBuilder.loadTexts: mldsHostTableHostIPAddress.setDescription('Host IP address of Group in IPv6 Host table entry.')NEWLINEswAuthenCtrl = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 23, 1))NEWLINEswAuthStatus = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 23, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: swAuthStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: swAuthStatus.setDescription('Enable/Disable Static 802.1x.')NEWLINEswAuthMode = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 23, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("portBase", 1), ("macBase", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: swAuthMode.setStatus('current')NEWLINEif mibBuilder.loadTexts: swAuthMode.setDescription('This object indicates the authentication mode of the device.')NEWLINEauthProtocol = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 23, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("authProtocolRadiusEap", 1), ("authProtocolLocal", 2))).clone('authProtocolRadiusEap')).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: authProtocol.setStatus('current')NEWLINEif mibBuilder.loadTexts: authProtocol.setDescription('The authentication method used to authenticate users.')NEWLINEswAuthCtrlPktFwdMode = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 23, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("authForwardEap", 1), ("authDropEap", 2))).clone('authForwardEap')).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: swAuthCtrlPktFwdMode.setStatus('current')NEWLINEif mibBuilder.loadTexts: swAuthCtrlPktFwdMode.setDescription('When 802.1x disable, this item can decided eap packet be forward or drop.')NEWLINEswAuthPortAccessCtrl = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 23, 2))NEWLINEswAuthPortAccessControlTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 23, 2, 1), )NEWLINEif mibBuilder.loadTexts: swAuthPortAccessControlTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: swAuthPortAccessControlTable.setDescription('A table that contains the configuration objects for the Authenticator PAE associated with each port. An entry appears in this table for each port that may authenticate access to itself.')NEWLINEswAuthPortAccessControlEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 23, 2, 1, 1), ).setIndexNames((0, "DES-1210-28MEbx", "swAuthAuthConfigPortNumber"))NEWLINEif mibBuilder.loadTexts: swAuthPortAccessControlEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: swAuthPortAccessControlEntry.setDescription('The configuration information for an Authenticator Port.')NEWLINEswAuthAuthConfigPortNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 23, 2, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 28))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: swAuthAuthConfigPortNumber.setStatus('current')NEWLINEif mibBuilder.loadTexts: swAuthAuthConfigPortNumber.setDescription('A unique value for each port that correlates to port index. Its value ranges between 1 and the value of port number. For all machines give maximum port number.')NEWLINEswAuthAuthQuietPeriod = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 23, 2, 1, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535)).clone(60)).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: swAuthAuthQuietPeriod.setReference('9.4.1, quietPeriod.')NEWLINEif mibBuilder.loadTexts: swAuthAuthQuietPeriod.setStatus('current')NEWLINEif mibBuilder.loadTexts: swAuthAuthQuietPeriod.setDescription('The value, in seconds, of the quietPeriod constant currently in use by the Authenticator PAE state machine.')NEWLINEswAuthAuthSuppTimeout = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 23, 2, 1, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535)).clone(12)).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: swAuthAuthSuppTimeout.setReference('9.4.1, suppTimeout.')NEWLINEif mibBuilder.loadTexts: swAuthAuthSuppTimeout.setStatus('current')NEWLINEif mibBuilder.loadTexts: swAuthAuthSuppTimeout.setDescription('The value, in seconds, of the suppTimeout constant currently in use by the Backend Authentication state machine.')NEWLINEswAuthAuthServerTimeout = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 23, 2, 1, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535)).clone(16)).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: swAuthAuthServerTimeout.setReference('9.4.1, serverTimeout.')NEWLINEif mibBuilder.loadTexts: swAuthAuthServerTimeout.setStatus('current')NEWLINEif mibBuilder.loadTexts: swAuthAuthServerTimeout.setDescription('The value, in seconds, of the serverTimeout constant currently in use by the Backend Authentication state machine.')NEWLINEswAuthAuthMaxReq = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 23, 2, 1, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 10)).clone(2)).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: swAuthAuthMaxReq.setReference('9.4.1, maxReq.')NEWLINEif mibBuilder.loadTexts: swAuthAuthMaxReq.setStatus('current')NEWLINEif mibBuilder.loadTexts: swAuthAuthMaxReq.setDescription('The value of the maxReq constant currently in use by the Backend Authentication state machine.')NEWLINEswAuthAuthTxPeriod = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 23, 2, 1, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535)).clone(24)).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: swAuthAuthTxPeriod.setReference('9.4.1, txPeriod.')NEWLINEif mibBuilder.loadTexts: swAuthAuthTxPeriod.setStatus('current')NEWLINEif mibBuilder.loadTexts: swAuthAuthTxPeriod.setDescription('The value, in seconds, of the txPeriod constant currently in use by the Authenticator PAE state machine.')NEWLINEswAuthAuthReAuthPeriod = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 23, 2, 1, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535)).clone(3600)).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: swAuthAuthReAuthPeriod.setReference('9.4.1, reAuthPerio.')NEWLINEif mibBuilder.loadTexts: swAuthAuthReAuthPeriod.setStatus('current')NEWLINEif mibBuilder.loadTexts: swAuthAuthReAuthPeriod.setDescription('The value, in seconds, of the reAuthPeriod constant currently in use by the Reauthentication Timer state machine.')NEWLINEswAuthAuthReAuthentication = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 23, 2, 1, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: swAuthAuthReAuthentication.setReference('9.4.1, reAuthEnable.')NEWLINEif mibBuilder.loadTexts: swAuthAuthReAuthentication.setStatus('current')NEWLINEif mibBuilder.loadTexts: swAuthAuthReAuthentication.setDescription('The enable/disable control used by the Reauthentication Timer state machine (8.5.5.1).')NEWLINEswAuthAuthConfigPortControl = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 23, 2, 1, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("forceUnauthorized", 1), ("auto", 2), ("forceAuthorized", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: swAuthAuthConfigPortControl.setReference('9.4.1, AuthControlledPortControl.')NEWLINEif mibBuilder.loadTexts: swAuthAuthConfigPortControl.setStatus('current')NEWLINEif mibBuilder.loadTexts: swAuthAuthConfigPortControl.setDescription('The current value of the controlled Port control parameter for the Port.')NEWLINEswAuthAuthCapability = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 23, 2, 1, 1, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("authenticator", 1), ("none", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: swAuthAuthCapability.setReference('AuthCapability.')NEWLINEif mibBuilder.loadTexts: swAuthAuthCapability.setStatus('current')NEWLINEif mibBuilder.loadTexts: swAuthAuthCapability.setDescription('The current value of the controlled Port control parameter for the Port.')NEWLINEswAuthAuthDirection = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 23, 2, 1, 1, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("both", 0), ("in", 1)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: swAuthAuthDirection.setReference('AuthDirection.')NEWLINEif mibBuilder.loadTexts: swAuthAuthDirection.setStatus('current')NEWLINEif mibBuilder.loadTexts: swAuthAuthDirection.setDescription('The current value of the controlled Port control parameter for the Port.')NEWLINEswAuthUser = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 23, 3))NEWLINEswAuthUserTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 23, 3, 1), )NEWLINEif mibBuilder.loadTexts: swAuthUserTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: swAuthUserTable.setDescription('A table that contains the configuration objects for the Authenticator PAE associated with each port. An entry appears in this table for each port that may authenticate access to itself.')NEWLINEswAuthUserEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 23, 3, 1, 1), ).setIndexNames((0, "DES-1210-28MEbx", "swAuthUserName"))NEWLINEif mibBuilder.loadTexts: swAuthUserEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: swAuthUserEntry.setDescription('The configuration information for an Authenticator Port.')NEWLINEswAuthUserName = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 23, 3, 1, 1, 1), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(1, 15))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: swAuthUserName.setStatus('current')NEWLINEif mibBuilder.loadTexts: swAuthUserName.setDescription('The unique index value of a row in this table. This object is used to set 802.1X Local user name, The following characters are allowed to input: semicolon, question mark, space, and double quotation mark.')NEWLINEswAuthUserPassword = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 23, 3, 1, 1, 2), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 15))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: swAuthUserPassword.setStatus('current')NEWLINEif mibBuilder.loadTexts: swAuthUserPassword.setDescription('This object is used to set 802.1X Local user Password, The following characters are allowed to input: semicolon, question mark, space, and double quotation mark.')NEWLINEswAuthUserStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 23, 3, 1, 1, 3), RowStatus()).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: swAuthUserStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: swAuthUserStatus.setDescription('The status of this conceptual row in the swAuthUserTable. An entry in this table is not qualified for activation until instances of all corresponding columns have been initialized, either through default values, or through Set operations. The swAuthUserName objects must be explicitly set.')NEWLINEswAuthRadiusServer = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 23, 4))NEWLINEiPv4swAuthRadiusServerTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 23, 4, 1), )NEWLINEif mibBuilder.loadTexts: iPv4swAuthRadiusServerTable.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: iPv4swAuthRadiusServerTable.setDescription('A table that contains the configuration objects for the Authenticator PAE associated with each port. An entry appears in this table for each port that may authenticate access to itself.')NEWLINEiPv4swAuthRadiusServerEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 23, 4, 1, 1), ).setIndexNames((0, "DES-1210-28MEbx", "iPv4swAuthRadiusServerIndex"))NEWLINEif mibBuilder.loadTexts: iPv4swAuthRadiusServerEntry.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: iPv4swAuthRadiusServerEntry.setDescription('The configuration information for an Authenticator Port.')NEWLINEiPv4swAuthRadiusServerIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 23, 4, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 3))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: iPv4swAuthRadiusServerIndex.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: iPv4swAuthRadiusServerIndex.setDescription('A unique value for Authentication RADIUS Server index. Its value ranges between 1 and 3.')NEWLINEiPv4swAuthRadiusServerAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 23, 4, 1, 1, 2), IpAddress()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: iPv4swAuthRadiusServerAddress.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: iPv4swAuthRadiusServerAddress.setDescription('The IP address of the RADIUS server referred to in this table entry.')NEWLINEiPv4swAuthRadiusServerAuthenticationPort = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 23, 4, 1, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535)).clone(1812)).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: iPv4swAuthRadiusServerAuthenticationPort.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: iPv4swAuthRadiusServerAuthenticationPort.setDescription('The value is for setting UDP Port.')NEWLINEiPv4swAuthRadiusServerAccountingPort = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 23, 4, 1, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535)).clone(1813)).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: iPv4swAuthRadiusServerAccountingPort.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: iPv4swAuthRadiusServerAccountingPort.setDescription('The value is for setting UDP Port.')NEWLINEiPv4swAuthRadiusServerTimeout = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 23, 4, 1, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 255)).clone(5)).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: iPv4swAuthRadiusServerTimeout.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: iPv4swAuthRadiusServerTimeout.setDescription('The value is for setting UDP Port.')NEWLINEiPv4swAuthRadiusServerRetransmit = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 23, 4, 1, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 255)).clone(2)).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: iPv4swAuthRadiusServerRetransmit.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: iPv4swAuthRadiusServerRetransmit.setDescription('The value is for setting UDP Port.')NEWLINEiPv4swAuthRadiusServerKey = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 23, 4, 1, 1, 7), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 15))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: iPv4swAuthRadiusServerKey.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: iPv4swAuthRadiusServerKey.setDescription('This object is used to set 802.1X Radius Server Key, The following characters are allowed to input: semicolon, question mark, space, and double quotation mark.')NEWLINEiPv4swAuthRadiusServerStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 23, 4, 1, 1, 8), RowStatus()).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: iPv4swAuthRadiusServerStatus.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: iPv4swAuthRadiusServerStatus.setDescription('The status of this conceptual row in the swAuthRadiusServerTable. An entry in this table is not qualified for activation until instances of all corresponding columns have been initialized, either through default values, or through Set operations. The swAuthRadiusServerIndex objects must be explicitly set.')NEWLINEswAuthRadiusServerTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 23, 4, 2), )NEWLINEif mibBuilder.loadTexts: swAuthRadiusServerTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: swAuthRadiusServerTable.setDescription('A table that contains the configuration objects for the Authenticator PAE associated with each port. An entry appears in this table for each port that may authenticate access to itself.')NEWLINEswAuthRadiusServerEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 23, 4, 2, 1), ).setIndexNames((0, "DES-1210-28MEbx", "swAuthRadiusServerIndex"))NEWLINEif mibBuilder.loadTexts: swAuthRadiusServerEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: swAuthRadiusServerEntry.setDescription('The configuration information for an Authenticator Port.')NEWLINEswAuthRadiusServerIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 23, 4, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 3))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: swAuthRadiusServerIndex.setStatus('current')NEWLINEif mibBuilder.loadTexts: swAuthRadiusServerIndex.setDescription('A unique value for Authentication RADIUS Server index. Its value ranges between 1 and 3.')NEWLINEswAuthRadiusIPType = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 23, 4, 2, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2)).clone(1)).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: swAuthRadiusIPType.setStatus('current')NEWLINEif mibBuilder.loadTexts: swAuthRadiusIPType.setDescription('The IP address of the RADIUS server IP type referred to in this table entry.')NEWLINEswAuthRadiusServerAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 23, 4, 2, 1, 3), Ipv6Address()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: swAuthRadiusServerAddress.setStatus('current')NEWLINEif mibBuilder.loadTexts: swAuthRadiusServerAddress.setDescription('The IP address of the RADIUS server referred to in this table entry.')NEWLINEswAuthRadiusServerInterfaceName = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 23, 4, 2, 1, 4), OctetString()).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: swAuthRadiusServerInterfaceName.setStatus('current')NEWLINEif mibBuilder.loadTexts: swAuthRadiusServerInterfaceName.setDescription('Specifies the interface name when the swAuthRadiusServerAddress is linklocal address.')NEWLINEswAuthRadiusServerAuthenticationPort = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 23, 4, 2, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535)).clone(1812)).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: swAuthRadiusServerAuthenticationPort.setStatus('current')NEWLINEif mibBuilder.loadTexts: swAuthRadiusServerAuthenticationPort.setDescription('The value is for setting UDP Port.')NEWLINEswAuthRadiusServerAccountingPort = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 23, 4, 2, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535)).clone(1813)).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: swAuthRadiusServerAccountingPort.setStatus('current')NEWLINEif mibBuilder.loadTexts: swAuthRadiusServerAccountingPort.setDescription('The value is for setting UDP Port.')NEWLINEswAuthRadiusServerTimeout = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 23, 4, 2, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 255)).clone(5)).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: swAuthRadiusServerTimeout.setStatus('current')NEWLINEif mibBuilder.loadTexts: swAuthRadiusServerTimeout.setDescription('The value is for setting UDP Port.')NEWLINEswAuthRadiusServerRetransmit = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 23, 4, 2, 1, 8), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 255)).clone(2)).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: swAuthRadiusServerRetransmit.setStatus('current')NEWLINEif mibBuilder.loadTexts: swAuthRadiusServerRetransmit.setDescription('The value is for setting UDP Port.')NEWLINEswAuthRadiusServerKey = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 23, 4, 2, 1, 9), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 15))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: swAuthRadiusServerKey.setStatus('current')NEWLINEif mibBuilder.loadTexts: swAuthRadiusServerKey.setDescription('This object is used to set 802.1X Radius Server Key, The following characters are allowed to input: semicolon, question mark, space, and double quotation mark.')NEWLINEswAuthRadiusServerStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 23, 4, 2, 1, 10), RowStatus()).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: swAuthRadiusServerStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: swAuthRadiusServerStatus.setDescription('The status of this conceptual row in the swAuthRadiusServerTable. An entry in this table is not qualified for activation until instances of all corresponding columns have been initialized, either through default values, or through Set operations. The swAuthRadiusServerIndex objects must be explicitly set.')NEWLINEcosScheduleMechanism = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("strictPriority", 1), ("wrr", 2), ("strict3wrr", 3), ("strict2wrr", 4)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: cosScheduleMechanism.setStatus('current')NEWLINEif mibBuilder.loadTexts: cosScheduleMechanism.setDescription('Queuing mechanism. strictPriority(1) : Strict Priority wrr(2) : Weighted Round Robin Strict-priority scheduling is implemented with a special strict-priority scheduler node that is stacked directly above the port. Queues stacked on top of the strict-priority scheduler node always get bandwidth before other queues. Weighted round-robin scheduling is designed to better handle queues with different processing capacities. Each queue has a weight : Low is 1, Medium is 2, High is 4 and Highest is 8 for WS3 spec. Queues with higher weights get bandwidth before than other queues with less weights. ')NEWLINEcosOutputSchedule = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 2))NEWLINEcosClassTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 2, 1), )NEWLINEif mibBuilder.loadTexts: cosClassTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: cosClassTable.setDescription('A list of cosOutputSchedule.')NEWLINEcosClassEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 2, 1, 1), ).setIndexNames((0, "DES-1210-28MEbx", "cosClassIndex"))NEWLINEif mibBuilder.loadTexts: cosClassEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: cosClassEntry.setDescription('A list of cosOutputClass Weight.')NEWLINEcosClassIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 2, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 3))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: cosClassIndex.setStatus('current')NEWLINEif mibBuilder.loadTexts: cosClassIndex.setDescription('A index of class 0 ~ 3.')NEWLINEcosWeight = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 2, 1, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 55))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: cosWeight.setStatus('current')NEWLINEif mibBuilder.loadTexts: cosWeight.setDescription('cos weight ')NEWLINEcosBandwidthCtrlSettings = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 9))NEWLINEcosBandwidthCtrlTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 9, 1), )NEWLINEif mibBuilder.loadTexts: cosBandwidthCtrlTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: cosBandwidthCtrlTable.setDescription('A list of cosBandwidthCtrlEntry default priority Entries.')NEWLINEcosBandwidthCtrlEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 9, 1, 1), ).setIndexNames((0, "DES-1210-28MEbx", "cosBandwidthCtrlPortIndex"), (0, "DES-1210-28MEbx", "cosBandwidthCtrlClassIndex"))NEWLINEif mibBuilder.loadTexts: cosBandwidthCtrlEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: cosBandwidthCtrlEntry.setDescription('A list of cosBandwidthCtrlEntry default priority priorities.')NEWLINEcosBandwidthCtrlPortIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 9, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 28))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: cosBandwidthCtrlPortIndex.setStatus('current')NEWLINEif mibBuilder.loadTexts: cosBandwidthCtrlPortIndex.setDescription('A port identifier that is in the range of 1 to ifNumber.')NEWLINEcosBandwidthCtrlClassIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 9, 1, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 3))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: cosBandwidthCtrlClassIndex.setStatus('current')NEWLINEif mibBuilder.loadTexts: cosBandwidthCtrlClassIndex.setDescription('A BandwidthCtrlClassIndex identifier that is in the range of 1 to ifNumber.')NEWLINEcosBandwidthValue = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 9, 1, 1, 3), Integer32()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: cosBandwidthValue.setStatus('current')NEWLINEif mibBuilder.loadTexts: cosBandwidthValue.setDescription('The BandwidthValue return value.')NEWLINEcosBandwidthEffectiveRX = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 9, 1, 1, 4), Integer32()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: cosBandwidthEffectiveRX.setStatus('current')NEWLINEif mibBuilder.loadTexts: cosBandwidthEffectiveRX.setDescription('A speed rate of Effective RX.')NEWLINEcosBandwidthEffectiveTX = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 9, 1, 1, 5), Integer32()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: cosBandwidthEffectiveTX.setStatus('current')NEWLINEif mibBuilder.loadTexts: cosBandwidthEffectiveTX.setDescription('A speed value of Effective TX.')NEWLINEqosDefaultUserPri = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 4))NEWLINEqosDefaultUserPriTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 4, 1), )NEWLINEif mibBuilder.loadTexts: qosDefaultUserPriTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: qosDefaultUserPriTable.setDescription('A list of 802.1p port default priority Entries.')NEWLINEqosDefaultUserPriEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 4, 1, 1), ).setIndexNames((0, "DES-1210-28MEbx", "qosDefaultUserPriPortIndex"))NEWLINEif mibBuilder.loadTexts: qosDefaultUserPriEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: qosDefaultUserPriEntry.setDescription('A list of 802.1p port default priority priorities.')NEWLINEqosDefaultUserPriPortIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 4, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 28))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: qosDefaultUserPriPortIndex.setStatus('current')NEWLINEif mibBuilder.loadTexts: qosDefaultUserPriPortIndex.setDescription('A port identifier that is in the range of 1 to ifNumber.')NEWLINEqosDefaultPriority = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 4, 1, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6, 7))).clone(namedValues=NamedValues(("priority0", 0), ("priority1", 1), ("priority2", 2), ("priority3", 3), ("priority4", 4), ("priority5", 5), ("priority6", 6), ("priority7", 7)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: qosDefaultPriority.setStatus('current')NEWLINEif mibBuilder.loadTexts: qosDefaultPriority.setDescription("For ingress untagged packets, the per port 'Default Priority' setting will be applied to packets of each port to provide port-based traffic prioritization when 802.1p is enabled.")NEWLINEqosEffectiveDefaultPriority = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 4, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6, 7))).clone(namedValues=NamedValues(("priority0", 0), ("priority1", 1), ("priority2", 2), ("priority3", 3), ("priority4", 4), ("priority5", 5), ("priority6", 6), ("priority7", 7)))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: qosEffectiveDefaultPriority.setStatus('current')NEWLINEif mibBuilder.loadTexts: qosEffectiveDefaultPriority.setDescription("For ingress untagged packets, the per port 'Effective Default Priority' setting will be applied to packets of each port to provide port-based traffic prioritization when 802.1p is enabled.")NEWLINEqosUserPriority = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 5))NEWLINEqosUserPriorityTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 5, 1), )NEWLINEif mibBuilder.loadTexts: qosUserPriorityTable.setReference('ISO/IEC 15802-3 Table 7-2')NEWLINEif mibBuilder.loadTexts: qosUserPriorityTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: qosUserPriorityTable.setDescription('A table mapping evaluated User Priority to Traffic Class, for forwarding by the bridge. Traffic class is a number in the range (0..3).')NEWLINEqosUserPriEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 5, 1, 1), ).setIndexNames((0, "DES-1210-28MEbx", "qosUserPriIndex"))NEWLINEif mibBuilder.loadTexts: qosUserPriEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: qosUserPriEntry.setDescription('User Priority to Traffic Class mapping.')NEWLINEqosUserPriIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 5, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 7))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: qosUserPriIndex.setStatus('current')NEWLINEif mibBuilder.loadTexts: qosUserPriIndex.setDescription('For ingress tagged packets, D-Link Smart Switches will refer to these information and prioritize them with 4 different priority queues. If 802.1p is enabled.')NEWLINEqosUserPriClass = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 5, 1, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("low", 0), ("medium", 1), ("high", 2), ("highest", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: qosUserPriClass.setStatus('current')NEWLINEif mibBuilder.loadTexts: qosUserPriClass.setDescription('The User Class the received frame is mapped to.')NEWLINEqosPriSettings = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 7))NEWLINEqosPriSettingsTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 7, 1), )NEWLINEif mibBuilder.loadTexts: qosPriSettingsTable.setReference('ISO/IEC 15802-3 Table 7-2')NEWLINEif mibBuilder.loadTexts: qosPriSettingsTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: qosPriSettingsTable.setDescription('A list of port priority settings.')NEWLINEqosPriSettingsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 7, 1, 1), ).setIndexNames((0, "DES-1210-28MEbx", "qosPriSetPortIndex"))NEWLINEif mibBuilder.loadTexts: qosPriSettingsEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: qosPriSettingsEntry.setDescription('A list of port priority settings Entries.')NEWLINEqosPriSetPortIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 7, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 28))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: qosPriSetPortIndex.setStatus('current')NEWLINEif mibBuilder.loadTexts: qosPriSetPortIndex.setDescription('A port identifier that is in the range of 1 to ifNumber.')NEWLINEqosPriSetPortType = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 7, 1, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 2, 4, 6))).clone(namedValues=NamedValues(("none", 0), ("ieee8021P", 2), ("dscp-tos", 4), ("ieee8021P-dscp-tos", 6)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: qosPriSetPortType.setStatus('current')NEWLINEif mibBuilder.loadTexts: qosPriSetPortType.setDescription('The port priority setting type. (ex. none = 0, 802.1p = 2, DSCP = 4. If you want enable 802.1p & DSCP, the value is 2 + 4 = 6. ')NEWLINEqosDiffServTOS = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 6))NEWLINEqosDSCPTOSMode = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 6, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("tos", 1), ("dscp", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: qosDSCPTOSMode.setStatus('current')NEWLINEif mibBuilder.loadTexts: qosDSCPTOSMode.setDescription('Settings of Qos mode: DSCP QoS or TOS Qos. IEEE 802.1p : It specifies a priority(0~7) value to four queues in WS3 : Low(1,2), Medium(0,3), High(4,5) and Highest(6,7), inclusive that can be used by Quality of Service (QoS) disciplines to differentiate traffic. DSCP : Differentiated services enhancements to the Internet protocol are intended to enable scalable service discrimination in the Internet without the need for per-flow state and signaling at every hop. ')NEWLINEqosDiffServTypeGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 6, 2))NEWLINEqosDiffServType00 = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 6, 2, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("low", 0), ("medium", 1), ("high", 2), ("highest", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: qosDiffServType00.setStatus('current')NEWLINEif mibBuilder.loadTexts: qosDiffServType00.setDescription('DiffServ Type 0 : IP ToS value = 0')NEWLINEqosDiffServType01 = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 6, 2, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("low", 0), ("medium", 1), ("high", 2), ("highest", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: qosDiffServType01.setStatus('current')NEWLINEif mibBuilder.loadTexts: qosDiffServType01.setDescription('DiffServ Type 01 : IP ToS value = 4')NEWLINEqosDiffServType02 = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 6, 2, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("low", 0), ("medium", 1), ("high", 2), ("highest", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: qosDiffServType02.setStatus('current')NEWLINEif mibBuilder.loadTexts: qosDiffServType02.setDescription('DiffServ Type 02 : IP ToS value = 8')NEWLINEqosDiffServType03 = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 6, 2, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("low", 0), ("medium", 1), ("high", 2), ("highest", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: qosDiffServType03.setStatus('current')NEWLINEif mibBuilder.loadTexts: qosDiffServType03.setDescription('DiffServ Type 03 : IP ToS value = 12')NEWLINEqosDiffServType04 = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 6, 2, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("low", 0), ("medium", 1), ("high", 2), ("highest", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: qosDiffServType04.setStatus('current')NEWLINEif mibBuilder.loadTexts: qosDiffServType04.setDescription('DiffServ Type 04 : IP ToS value = 16')NEWLINEqosDiffServType05 = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 6, 2, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("low", 0), ("medium", 1), ("high", 2), ("highest", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: qosDiffServType05.setStatus('current')NEWLINEif mibBuilder.loadTexts: qosDiffServType05.setDescription('DiffServ Type 05 : IP ToS value = 20')NEWLINEqosDiffServType06 = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 6, 2, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("low", 0), ("medium", 1), ("high", 2), ("highest", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: qosDiffServType06.setStatus('current')NEWLINEif mibBuilder.loadTexts: qosDiffServType06.setDescription('DiffServ Type 06 : IP ToS value = 24')NEWLINEqosDiffServType07 = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 6, 2, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("low", 0), ("medium", 1), ("high", 2), ("highest", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: qosDiffServType07.setStatus('current')NEWLINEif mibBuilder.loadTexts: qosDiffServType07.setDescription('DiffServ Type 07 : IP ToS value = 28')NEWLINEqosDiffServType08 = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 6, 2, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("low", 0), ("medium", 1), ("high", 2), ("highest", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: qosDiffServType08.setStatus('current')NEWLINEif mibBuilder.loadTexts: qosDiffServType08.setDescription('DiffServ Type 08 : IP ToS value = 32')NEWLINEqosDiffServType09 = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 6, 2, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("low", 0), ("medium", 1), ("high", 2), ("highest", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: qosDiffServType09.setStatus('current')NEWLINEif mibBuilder.loadTexts: qosDiffServType09.setDescription('DiffServ Type 09 : IP ToS value = 36')NEWLINEqosDiffServType10 = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 6, 2, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("low", 0), ("medium", 1), ("high", 2), ("highest", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: qosDiffServType10.setStatus('current')NEWLINEif mibBuilder.loadTexts: qosDiffServType10.setDescription('DiffServ Type 10 : IP ToS value = 40')NEWLINEqosDiffServType11 = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 6, 2, 12), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("low", 0), ("medium", 1), ("high", 2), ("highest", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: qosDiffServType11.setStatus('current')NEWLINEif mibBuilder.loadTexts: qosDiffServType11.setDescription('DiffServ Type 11 : IP ToS value = 44')NEWLINEqosDiffServType12 = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 6, 2, 13), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("low", 0), ("medium", 1), ("high", 2), ("highest", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: qosDiffServType12.setStatus('current')NEWLINEif mibBuilder.loadTexts: qosDiffServType12.setDescription('DiffServ Type 12 : IP ToS value = 48')NEWLINEqosDiffServType13 = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 6, 2, 14), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("low", 0), ("medium", 1), ("high", 2), ("highest", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: qosDiffServType13.setStatus('current')NEWLINEif mibBuilder.loadTexts: qosDiffServType13.setDescription('DiffServ Type 13 : IP ToS value = 52')NEWLINEqosDiffServType14 = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 6, 2, 15), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("low", 0), ("medium", 1), ("high", 2), ("highest", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: qosDiffServType14.setStatus('current')NEWLINEif mibBuilder.loadTexts: qosDiffServType14.setDescription('DiffServ Type 14 : IP ToS value = 56')NEWLINEqosDiffServType15 = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 6, 2, 16), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("low", 0), ("medium", 1), ("high", 2), ("highest", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: qosDiffServType15.setStatus('current')NEWLINEif mibBuilder.loadTexts: qosDiffServType15.setDescription('DiffServ Type 15 : IP ToS value = 60')NEWLINEqosDiffServType16 = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 6, 2, 17), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("low", 0), ("medium", 1), ("high", 2), ("highest", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: qosDiffServType16.setStatus('current')NEWLINEif mibBuilder.loadTexts: qosDiffServType16.setDescription('DiffServ Type 16 : IP ToS value = 64')NEWLINEqosDiffServType17 = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 6, 2, 18), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("low", 0), ("medium", 1), ("high", 2), ("highest", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: qosDiffServType17.setStatus('current')NEWLINEif mibBuilder.loadTexts: qosDiffServType17.setDescription('DiffServ Type 17 : IP ToS value = 68')NEWLINEqosDiffServType18 = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 6, 2, 19), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("low", 0), ("medium", 1), ("high", 2), ("highest", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: qosDiffServType18.setStatus('current')NEWLINEif mibBuilder.loadTexts: qosDiffServType18.setDescription('DiffServ Type 18 : IP ToS value = 72')NEWLINEqosDiffServType19 = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 6, 2, 20), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("low", 0), ("medium", 1), ("high", 2), ("highest", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: qosDiffServType19.setStatus('current')NEWLINEif mibBuilder.loadTexts: qosDiffServType19.setDescription('DiffServ Type 19 : IP ToS value = 76')NEWLINEqosDiffServType20 = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 6, 2, 21), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("low", 0), ("medium", 1), ("high", 2), ("highest", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: qosDiffServType20.setStatus('current')NEWLINEif mibBuilder.loadTexts: qosDiffServType20.setDescription('DiffServ Type 20 : IP ToS value = 80')NEWLINEqosDiffServType21 = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 6, 2, 22), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("low", 0), ("medium", 1), ("high", 2), ("highest", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: qosDiffServType21.setStatus('current')NEWLINEif mibBuilder.loadTexts: qosDiffServType21.setDescription('DiffServ Type 21 : IP ToS value = 84')NEWLINEqosDiffServType22 = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 6, 2, 23), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("low", 0), ("medium", 1), ("high", 2), ("highest", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: qosDiffServType22.setStatus('current')NEWLINEif mibBuilder.loadTexts: qosDiffServType22.setDescription('DiffServ Type 22 : IP ToS value = 88')NEWLINEqosDiffServType23 = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 6, 2, 24), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("low", 0), ("medium", 1), ("high", 2), ("highest", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: qosDiffServType23.setStatus('current')NEWLINEif mibBuilder.loadTexts: qosDiffServType23.setDescription('DiffServ Type 23 : IP ToS value = 92')NEWLINEqosDiffServType24 = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 6, 2, 25), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("low", 0), ("medium", 1), ("high", 2), ("highest", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: qosDiffServType24.setStatus('current')NEWLINEif mibBuilder.loadTexts: qosDiffServType24.setDescription('DiffServ Type 24 : IP ToS value = 96')NEWLINEqosDiffServType25 = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 6, 2, 26), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("low", 0), ("medium", 1), ("high", 2), ("highest", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: qosDiffServType25.setStatus('current')NEWLINEif mibBuilder.loadTexts: qosDiffServType25.setDescription('DiffServ Type 25 : IP ToS value = 100')NEWLINEqosDiffServType26 = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 6, 2, 27), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("low", 0), ("medium", 1), ("high", 2), ("highest", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: qosDiffServType26.setStatus('current')NEWLINEif mibBuilder.loadTexts: qosDiffServType26.setDescription('DiffServ Type 26 : IP ToS value = 104')NEWLINEqosDiffServType27 = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 6, 2, 28), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("low", 0), ("medium", 1), ("high", 2), ("highest", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: qosDiffServType27.setStatus('current')NEWLINEif mibBuilder.loadTexts: qosDiffServType27.setDescription('DiffServ Type 27 : IP ToS value = 108')NEWLINEqosDiffServType28 = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 6, 2, 29), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("low", 0), ("medium", 1), ("high", 2), ("highest", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: qosDiffServType28.setStatus('current')NEWLINEif mibBuilder.loadTexts: qosDiffServType28.setDescription('DiffServ Type 28 : IP ToS value = 112')NEWLINEqosDiffServType29 = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 6, 2, 30), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("low", 0), ("medium", 1), ("high", 2), ("highest", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: qosDiffServType29.setStatus('current')NEWLINEif mibBuilder.loadTexts: qosDiffServType29.setDescription('DiffServ Type 29 : IP ToS value = 116')NEWLINEqosDiffServType30 = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 6, 2, 31), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("low", 0), ("medium", 1), ("high", 2), ("highest", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: qosDiffServType30.setStatus('current')NEWLINEif mibBuilder.loadTexts: qosDiffServType30.setDescription('DiffServ Type 30 : IP ToS value = 120')NEWLINEqosDiffServType31 = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 6, 2, 32), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("low", 0), ("medium", 1), ("high", 2), ("highest", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: qosDiffServType31.setStatus('current')NEWLINEif mibBuilder.loadTexts: qosDiffServType31.setDescription('DiffServ Type 31 : IP ToS value = 124')NEWLINEqosDiffServType32 = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 6, 2, 33), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("low", 0), ("medium", 1), ("high", 2), ("highest", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: qosDiffServType32.setStatus('current')NEWLINEif mibBuilder.loadTexts: qosDiffServType32.setDescription('DiffServ Type 32 : IP ToS value = 128')NEWLINEqosDiffServType33 = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 6, 2, 34), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("low", 0), ("medium", 1), ("high", 2), ("highest", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: qosDiffServType33.setStatus('current')NEWLINEif mibBuilder.loadTexts: qosDiffServType33.setDescription('DiffServ Type 33 : IP ToS value = 132')NEWLINEqosDiffServType34 = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 6, 2, 35), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("low", 0), ("medium", 1), ("high", 2), ("highest", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: qosDiffServType34.setStatus('current')NEWLINEif mibBuilder.loadTexts: qosDiffServType34.setDescription('DiffServ Type 34 : IP ToS value = 136')NEWLINEqosDiffServType35 = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 6, 2, 36), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("low", 0), ("medium", 1), ("high", 2), ("highest", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: qosDiffServType35.setStatus('current')NEWLINEif mibBuilder.loadTexts: qosDiffServType35.setDescription('DiffServ Type 35 : IP ToS value = 140')NEWLINEqosDiffServType36 = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 6, 2, 37), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("low", 0), ("medium", 1), ("high", 2), ("highest", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: qosDiffServType36.setStatus('current')NEWLINEif mibBuilder.loadTexts: qosDiffServType36.setDescription('DiffServ Type 36 : IP ToS value = 144')NEWLINEqosDiffServType37 = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 6, 2, 38), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("low", 0), ("medium", 1), ("high", 2), ("highest", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: qosDiffServType37.setStatus('current')NEWLINEif mibBuilder.loadTexts: qosDiffServType37.setDescription('DiffServ Type 37 : IP ToS value = 148')NEWLINEqosDiffServType38 = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 6, 2, 39), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("low", 0), ("medium", 1), ("high", 2), ("highest", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: qosDiffServType38.setStatus('current')NEWLINEif mibBuilder.loadTexts: qosDiffServType38.setDescription('DiffServ Type 38 : IP ToS value = 152')NEWLINEqosDiffServType39 = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 6, 2, 40), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("low", 0), ("medium", 1), ("high", 2), ("highest", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: qosDiffServType39.setStatus('current')NEWLINEif mibBuilder.loadTexts: qosDiffServType39.setDescription('DiffServ Type 39 : IP ToS value = 156')NEWLINEqosDiffServType40 = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 6, 2, 41), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("low", 0), ("medium", 1), ("high", 2), ("highest", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: qosDiffServType40.setStatus('current')NEWLINEif mibBuilder.loadTexts: qosDiffServType40.setDescription('DiffServ Type 40 : IP ToS value = 160')NEWLINEqosDiffServType41 = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 6, 2, 42), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("low", 0), ("medium", 1), ("high", 2), ("highest", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: qosDiffServType41.setStatus('current')NEWLINEif mibBuilder.loadTexts: qosDiffServType41.setDescription('DiffServ Type 41 : IP ToS value = 164')NEWLINEqosDiffServType42 = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 6, 2, 43), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("low", 0), ("medium", 1), ("high", 2), ("highest", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: qosDiffServType42.setStatus('current')NEWLINEif mibBuilder.loadTexts: qosDiffServType42.setDescription('DiffServ Type 42 : IP ToS value = 168')NEWLINEqosDiffServType43 = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 6, 2, 44), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("low", 0), ("medium", 1), ("high", 2), ("highest", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: qosDiffServType43.setStatus('current')NEWLINEif mibBuilder.loadTexts: qosDiffServType43.setDescription('DiffServ Type 43 : IP ToS value = 172')NEWLINEqosDiffServType44 = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 6, 2, 45), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("low", 0), ("medium", 1), ("high", 2), ("highest", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: qosDiffServType44.setStatus('current')NEWLINEif mibBuilder.loadTexts: qosDiffServType44.setDescription('DiffServ Type 44 : IP ToS value = 176')NEWLINEqosDiffServType45 = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 6, 2, 46), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("low", 0), ("medium", 1), ("high", 2), ("highest", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: qosDiffServType45.setStatus('current')NEWLINEif mibBuilder.loadTexts: qosDiffServType45.setDescription('DiffServ Type 45 : IP ToS value = 180')NEWLINEqosDiffServType46 = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 6, 2, 47), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("low", 0), ("medium", 1), ("high", 2), ("highest", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: qosDiffServType46.setStatus('current')NEWLINEif mibBuilder.loadTexts: qosDiffServType46.setDescription('DiffServ Type 46 : IP ToS value = 184')NEWLINEqosDiffServType47 = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 6, 2, 48), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("low", 0), ("medium", 1), ("high", 2), ("highest", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: qosDiffServType47.setStatus('current')NEWLINEif mibBuilder.loadTexts: qosDiffServType47.setDescription('DiffServ Type 47 : IP ToS value = 188')NEWLINEqosDiffServType48 = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 6, 2, 49), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("low", 0), ("medium", 1), ("high", 2), ("highest", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: qosDiffServType48.setStatus('current')NEWLINEif mibBuilder.loadTexts: qosDiffServType48.setDescription('DiffServ Type 48 : IP ToS value = 192')NEWLINEqosDiffServType49 = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 6, 2, 50), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("low", 0), ("medium", 1), ("high", 2), ("highest", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: qosDiffServType49.setStatus('current')NEWLINEif mibBuilder.loadTexts: qosDiffServType49.setDescription('DiffServ Type 49 : IP ToS value = 196')NEWLINEqosDiffServType50 = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 6, 2, 51), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("low", 0), ("medium", 1), ("high", 2), ("highest", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: qosDiffServType50.setStatus('current')NEWLINEif mibBuilder.loadTexts: qosDiffServType50.setDescription('DiffServ Type 50 : IP ToS value = 200')NEWLINEqosDiffServType51 = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 6, 2, 52), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("low", 0), ("medium", 1), ("high", 2), ("highest", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: qosDiffServType51.setStatus('current')NEWLINEif mibBuilder.loadTexts: qosDiffServType51.setDescription('DiffServ Type 51 : IP ToS value = 204')NEWLINEqosDiffServType52 = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 6, 2, 53), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("low", 0), ("medium", 1), ("high", 2), ("highest", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: qosDiffServType52.setStatus('current')NEWLINEif mibBuilder.loadTexts: qosDiffServType52.setDescription('DiffServ Type 52 : IP ToS value = 208')NEWLINEqosDiffServType53 = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 6, 2, 54), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("low", 0), ("medium", 1), ("high", 2), ("highest", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: qosDiffServType53.setStatus('current')NEWLINEif mibBuilder.loadTexts: qosDiffServType53.setDescription('DiffServ Type 53 : IP ToS value = 212')NEWLINEqosDiffServType54 = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 6, 2, 55), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("low", 0), ("medium", 1), ("high", 2), ("highest", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: qosDiffServType54.setStatus('current')NEWLINEif mibBuilder.loadTexts: qosDiffServType54.setDescription('DiffServ Type 54 : IP ToS value = 216')NEWLINEqosDiffServType55 = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 6, 2, 56), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("low", 0), ("medium", 1), ("high", 2), ("highest", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: qosDiffServType55.setStatus('current')NEWLINEif mibBuilder.loadTexts: qosDiffServType55.setDescription('DiffServ Type 55 : IP ToS value = 220')NEWLINEqosDiffServType56 = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 6, 2, 57), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("low", 0), ("medium", 1), ("high", 2), ("highest", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: qosDiffServType56.setStatus('current')NEWLINEif mibBuilder.loadTexts: qosDiffServType56.setDescription('DiffServ Type 56 : IP ToS value = 224')NEWLINEqosDiffServType57 = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 6, 2, 58), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("low", 0), ("medium", 1), ("high", 2), ("highest", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: qosDiffServType57.setStatus('current')NEWLINEif mibBuilder.loadTexts: qosDiffServType57.setDescription('DiffServ Type 57 : IP ToS value = 228')NEWLINEqosDiffServType58 = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 6, 2, 59), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("low", 0), ("medium", 1), ("high", 2), ("highest", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: qosDiffServType58.setStatus('current')NEWLINEif mibBuilder.loadTexts: qosDiffServType58.setDescription('DiffServ Type 58 : IP ToS value = 232')NEWLINEqosDiffServType59 = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 6, 2, 60), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("low", 0), ("medium", 1), ("high", 2), ("highest", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: qosDiffServType59.setStatus('current')NEWLINEif mibBuilder.loadTexts: qosDiffServType59.setDescription('DiffServ Type 59 : IP ToS value = 236')NEWLINEqosDiffServType60 = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 6, 2, 61), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("low", 0), ("medium", 1), ("high", 2), ("highest", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: qosDiffServType60.setStatus('current')NEWLINEif mibBuilder.loadTexts: qosDiffServType60.setDescription('DiffServ Type 60 : IP ToS value = 240')NEWLINEqosDiffServType61 = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 6, 2, 62), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("low", 0), ("medium", 1), ("high", 2), ("highest", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: qosDiffServType61.setStatus('current')NEWLINEif mibBuilder.loadTexts: qosDiffServType61.setDescription('DiffServ Type 61 : IP ToS value = 244')NEWLINEqosDiffServType62 = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 6, 2, 63), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("low", 0), ("medium", 1), ("high", 2), ("highest", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: qosDiffServType62.setStatus('current')NEWLINEif mibBuilder.loadTexts: qosDiffServType62.setDescription('DiffServ Type 62 : IP ToS value = 248')NEWLINEqosDiffServType63 = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 6, 2, 64), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("low", 0), ("medium", 1), ("high", 2), ("highest", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: qosDiffServType63.setStatus('current')NEWLINEif mibBuilder.loadTexts: qosDiffServType63.setDescription('DiffServ Type 63 : IP ToS value = 252')NEWLINEqosTOSGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 6, 3))NEWLINEqosTOSType00 = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 6, 3, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("low", 0), ("medium", 1), ("high", 2), ("highest", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: qosTOSType00.setStatus('current')NEWLINEif mibBuilder.loadTexts: qosTOSType00.setDescription('TOS 0')NEWLINEqosTOSType01 = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 6, 3, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("low", 0), ("medium", 1), ("high", 2), ("highest", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: qosTOSType01.setStatus('current')NEWLINEif mibBuilder.loadTexts: qosTOSType01.setDescription('TOS 01')NEWLINEqosTOSType02 = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 6, 3, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("low", 0), ("medium", 1), ("high", 2), ("highest", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: qosTOSType02.setStatus('current')NEWLINEif mibBuilder.loadTexts: qosTOSType02.setDescription('TOS 02')NEWLINEqosTOSType03 = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 6, 3, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("low", 0), ("medium", 1), ("high", 2), ("highest", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: qosTOSType03.setStatus('current')NEWLINEif mibBuilder.loadTexts: qosTOSType03.setDescription('TOS 03')NEWLINEqosTOSType04 = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 6, 3, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("low", 0), ("medium", 1), ("high", 2), ("highest", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: qosTOSType04.setStatus('current')NEWLINEif mibBuilder.loadTexts: qosTOSType04.setDescription('TOS 04')NEWLINEqosTOSType05 = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 6, 3, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("low", 0), ("medium", 1), ("high", 2), ("highest", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: qosTOSType05.setStatus('current')NEWLINEif mibBuilder.loadTexts: qosTOSType05.setDescription('TOS 05')NEWLINEqosTOSType06 = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 6, 3, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("low", 0), ("medium", 1), ("high", 2), ("highest", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: qosTOSType06.setStatus('current')NEWLINEif mibBuilder.loadTexts: qosTOSType06.setDescription('TOS 06')NEWLINEqosTOSType07 = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 6, 3, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("low", 0), ("medium", 1), ("high", 2), ("highest", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: qosTOSType07.setStatus('current')NEWLINEif mibBuilder.loadTexts: qosTOSType07.setDescription('TOS 07')NEWLINEqosAclPrioritySettings = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 8))NEWLINEipv4aclQosTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 8, 1), )NEWLINEif mibBuilder.loadTexts: ipv4aclQosTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: ipv4aclQosTable.setDescription('A list of priority by acl setting.')NEWLINEipv4aclQosEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 8, 1, 1), ).setIndexNames((0, "DES-1210-28MEbx", "ipv4aclQosIndex"))NEWLINEif mibBuilder.loadTexts: ipv4aclQosEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: ipv4aclQosEntry.setDescription('A list of priority by acl setting entry.')NEWLINEipv4aclQosIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 8, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: ipv4aclQosIndex.setStatus('current')NEWLINEif mibBuilder.loadTexts: ipv4aclQosIndex.setDescription('Index of priority by acl setting.')NEWLINEipv4aclQosType = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 8, 1, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("mac", 0), ("ip", 1), ("tcp", 2), ("udp", 3), ("vlanid", 4), ("protocol", 5)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ipv4aclQosType.setStatus('current')NEWLINEif mibBuilder.loadTexts: ipv4aclQosType.setDescription('Type of priority by acl setting.')NEWLINEipv4aclQosMACAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 8, 1, 1, 3), MacAddress()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ipv4aclQosMACAddr.setStatus('current')NEWLINEif mibBuilder.loadTexts: ipv4aclQosMACAddr.setDescription('Dst MAC of priority by acl setting.')NEWLINEipv4aclQosIPAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 8, 1, 1, 4), IpAddress()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ipv4aclQosIPAddr.setStatus('current')NEWLINEif mibBuilder.loadTexts: ipv4aclQosIPAddr.setDescription('Dst IP of priority by acl setting')NEWLINEipv4aclQosTCPUDPPort = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 8, 1, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ipv4aclQosTCPUDPPort.setStatus('current')NEWLINEif mibBuilder.loadTexts: ipv4aclQosTCPUDPPort.setDescription('Dst TCP/UDP port of priority by acl setting')NEWLINEipv4aclQosVlanID = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 8, 1, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 4094))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ipv4aclQosVlanID.setStatus('current')NEWLINEif mibBuilder.loadTexts: ipv4aclQosVlanID.setDescription('VLAN ID of priority by acl setting')NEWLINEipv4aclQosProtocol = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 8, 1, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 255))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ipv4aclQosProtocol.setStatus('current')NEWLINEif mibBuilder.loadTexts: ipv4aclQosProtocol.setDescription('Ip protocol number of priority by acl setting')NEWLINEipv4aclQosAssignClass = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 8, 1, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("class0", 0), ("class1", 1), ("class2", 2), ("class3", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ipv4aclQosAssignClass.setStatus('current')NEWLINEif mibBuilder.loadTexts: ipv4aclQosAssignClass.setDescription('Be mapped class of priority by acl setting.')NEWLINEipv4aclQosStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 8, 1, 1, 9), RowStatus()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ipv4aclQosStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: ipv4aclQosStatus.setDescription('Status of priority by acl setting.')NEWLINEaclQosTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 8, 2), )NEWLINEif mibBuilder.loadTexts: aclQosTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclQosTable.setDescription('A list of priority by acl setting.')NEWLINEaclQosEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 8, 2, 1), ).setIndexNames((0, "DES-1210-28MEbx", "aclQosIndex"))NEWLINEif mibBuilder.loadTexts: aclQosEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclQosEntry.setDescription('A list of priority by acl setting entry.')NEWLINEaclQosIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 8, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: aclQosIndex.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclQosIndex.setDescription('Index of priority by acl setting.')NEWLINEaclQosType = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 8, 2, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6, 7))).clone(namedValues=NamedValues(("mac", 0), ("ip", 1), ("tcp", 2), ("udp", 3), ("vlanid", 4), ("protocol", 5), ("ipv6", 6), ("ipv6traffic-class", 7)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aclQosType.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclQosType.setDescription('Type of priority by acl setting.')NEWLINEaclQosMACAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 8, 2, 1, 3), MacAddress()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aclQosMACAddr.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclQosMACAddr.setDescription('Dst MAC of priority by acl setting.')NEWLINEaclQosIPAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 8, 2, 1, 4), IpAddress()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aclQosIPAddr.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclQosIPAddr.setDescription('Dst IP of priority by acl setting')NEWLINEaclQosIPv6Addr = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 8, 2, 1, 5), Ipv6Address()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aclQosIPv6Addr.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclQosIPv6Addr.setDescription('Dst IP of priority by acl setting. ')NEWLINEaclQosTCPUDPPort = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 8, 2, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aclQosTCPUDPPort.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclQosTCPUDPPort.setDescription('Dst TCP/UDP port of priority by acl setting')NEWLINEaclQosVlanID = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 8, 2, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 4094))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aclQosVlanID.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclQosVlanID.setDescription('VLAN ID of priority by acl setting')NEWLINEaclQosProtocol = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 8, 2, 1, 8), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 255))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aclQosProtocol.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclQosProtocol.setDescription('Ip protocol number of priority by acl setting')NEWLINEaclQosIP6TC = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 8, 2, 1, 10), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aclQosIP6TC.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclQosIP6TC.setDescription('Ipv6 Traffic Class number of priority by acl setting')NEWLINEaclQosAssignClass = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 8, 2, 1, 98), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("class0", 0), ("class1", 1), ("class2", 2), ("class3", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aclQosAssignClass.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclQosAssignClass.setDescription('Be mapped class of priority by acl setting.')NEWLINEaclQosStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 12, 8, 2, 1, 99), RowStatus()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aclQosStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclQosStatus.setDescription('Status of priority by acl setting.')NEWLINEbandwidthCtrlSettings = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 13, 1))NEWLINEbandwidthCtrlTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 13, 1, 2), )NEWLINEif mibBuilder.loadTexts: bandwidthCtrlTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: bandwidthCtrlTable.setDescription('A table to control the rate limiting parameters either for the entire switch or for each interface in the switch.')NEWLINEbandwidthCtrlEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 13, 1, 2, 1), ).setIndexNames((0, "DES-1210-28MEbx", "bandwidthCtrlIndex"))NEWLINEif mibBuilder.loadTexts: bandwidthCtrlEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: bandwidthCtrlEntry.setDescription('An entry appears in this table for each physical interface in the switch.')NEWLINEbandwidthCtrlIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 13, 1, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 28))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: bandwidthCtrlIndex.setStatus('current')NEWLINEif mibBuilder.loadTexts: bandwidthCtrlIndex.setDescription('The interface index for which the configuration in this entry applies. For all machines give maximum port number.')NEWLINEbandwidthCtrlTxThreshold = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 13, 1, 2, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(64, 1024000), ))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: bandwidthCtrlTxThreshold.setStatus('current')NEWLINEif mibBuilder.loadTexts: bandwidthCtrlTxThreshold.setDescription("Configures interface Rate Limit (Packet that can be transferred on a port at a particular second). This object's value will take effect on the interface speed. Based on the operating speed of the port, the rate limit will be applied. This value can also be affected by the metering. A value of zero(0) disable rate limiting i.e. sets the port to full speed. The value can be set between 64~102400(Kbits per second) in FE port, 64~1024000 (Kbits per second) in GE port.")NEWLINEbandwidthCtrlRxThreshold = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 13, 1, 2, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(64, 1024000), ))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: bandwidthCtrlRxThreshold.setStatus('current')NEWLINEif mibBuilder.loadTexts: bandwidthCtrlRxThreshold.setDescription('Allows to configure the limiting value for the maximum number of receive packets that can be transmitted per second over this interface. Setting this object to the value zero disables rate limiting for receive packets on this interface. The value that can be set for this object is limited by the underlying hardware. The value can be set between 64~102400(Kbits per second) in FE port, 64~1024000(Kbits per second) in GE port.')NEWLINEbandwidthEffecTxThreshold = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 13, 1, 2, 1, 4), Integer32()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: bandwidthEffecTxThreshold.setStatus('current')NEWLINEif mibBuilder.loadTexts: bandwidthEffecTxThreshold.setDescription("This object's value will take effect on the interface speed. Based on the operating speed of the port, the rate limit will be applied. This value can also be affected by the metering. A value of zero(0) disable rate limiting i.e. sets the port to full speed. ")NEWLINEbandwidthEffecRxThreshold = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 13, 1, 2, 1, 5), Integer32()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: bandwidthEffecRxThreshold.setStatus('current')NEWLINEif mibBuilder.loadTexts: bandwidthEffecRxThreshold.setDescription('Allows to configure the limiting value for the maximum number of receive packets that can be transmitted per second over this interface. Setting this object to the value zero disables rate limiting for receive packets on this interface. The value that can be set for this object is limited by the underlying hardware. ')NEWLINEtrafficCtrlSettings = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 13, 4))NEWLINEtrafficCtrlTrap = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 13, 4, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("none", 0), ("stormOccurred", 1), ("stormCleared", 2), ("both", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: trafficCtrlTrap.setStatus('current')NEWLINEif mibBuilder.loadTexts: trafficCtrlTrap.setDescription('The trap setting of traffic control.')NEWLINEtrafficCtrlTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 13, 4, 2), )NEWLINEif mibBuilder.loadTexts: trafficCtrlTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: trafficCtrlTable.setDescription('The traffic control table.')NEWLINEtrafficCtrlEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 13, 4, 2, 1), ).setIndexNames((0, "DES-1210-28MEbx", "trafficCtrlIndex"))NEWLINEif mibBuilder.loadTexts: trafficCtrlEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: trafficCtrlEntry.setDescription('The traffic control entry.')NEWLINEtrafficCtrlIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 13, 4, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: trafficCtrlIndex.setStatus('current')NEWLINEif mibBuilder.loadTexts: trafficCtrlIndex.setDescription('The traffic control index.')NEWLINEtrafficCtrlActionMode = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 13, 4, 2, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("drop", 0), ("shutdown", 1)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: trafficCtrlActionMode.setStatus('current')NEWLINEif mibBuilder.loadTexts: trafficCtrlActionMode.setDescription('The action mode of traffic control.')NEWLINEtrafficCtrlType = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 13, 4, 2, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6, 7))).clone(namedValues=NamedValues(("none", 0), ("b", 1), ("m", 2), ("mb", 3), ("u", 4), ("ub", 5), ("um", 6), ("umb", 7)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: trafficCtrlType.setStatus('current')NEWLINEif mibBuilder.loadTexts: trafficCtrlType.setDescription('The control type of traffic control. (b: Broadcast, m: Multicast, u: Unknown Unicast)')NEWLINEtrafficCtrlThreshold = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 13, 4, 2, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 102400))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: trafficCtrlThreshold.setStatus('current')NEWLINEif mibBuilder.loadTexts: trafficCtrlThreshold.setDescription('The threshold of traffic control.')NEWLINEtrafficCtrlCountDown = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 13, 4, 2, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 30))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: trafficCtrlCountDown.setStatus('current')NEWLINEif mibBuilder.loadTexts: trafficCtrlCountDown.setDescription('The count down value of traffic control.')NEWLINEtrafficCtrlTimeInterval = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 13, 4, 2, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(5, 30))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: trafficCtrlTimeInterval.setStatus('current')NEWLINEif mibBuilder.loadTexts: trafficCtrlTimeInterval.setDescription('The time interval of traffic control.')NEWLINEtrafficCtrlAutoRecoverTime = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 13, 4, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: trafficCtrlAutoRecoverTime.setStatus('current')NEWLINEif mibBuilder.loadTexts: trafficCtrlAutoRecoverTime.setDescription('The recover time of traffic control.')NEWLINEsecurityTrustedHost = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 1))NEWLINEtrustedHostStatus = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2))).clone('disabled')).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: trustedHostStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: trustedHostStatus.setDescription('This object indicates trusted host function is enabled or disabled. When trusted host function is enabled, D-Link Smart Switches will only allow hosts which you trust to access and control the switch. Your local host IP Addresses must be one of the IP Addresses to avoid disconnection.')NEWLINEipv4trustedHostTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 1, 2), )NEWLINEif mibBuilder.loadTexts: ipv4trustedHostTable.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: ipv4trustedHostTable.setDescription('A table to configure trusted host in the system.')NEWLINEipv4trustedHostEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 1, 2, 1), ).setIndexNames((0, "DES-1210-28MEbx", "ipv4trustedHostIpAddr"), (0, "DES-1210-28MEbx", "ipv4trustedHostIpMask"))NEWLINEif mibBuilder.loadTexts: ipv4trustedHostEntry.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: ipv4trustedHostEntry.setDescription('Each entry in this table represents rules for particular trusted host.')NEWLINEipv4trustedHostIpAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 1, 2, 1, 1), IpAddress()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: ipv4trustedHostIpAddr.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: ipv4trustedHostIpAddr.setDescription('The IP address of host you allow to access to D-Link Smart Switch. Your local host IP Addresses must be one of the IP Addresses to avoid disconnection.')NEWLINEipv4trustedHostIpMask = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 1, 2, 1, 2), IpAddress()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: ipv4trustedHostIpMask.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: ipv4trustedHostIpMask.setDescription('Used to mask with IP address, it allow you set a subnet as a trusted host entry.')NEWLINEipv4trustedHostRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 1, 2, 1, 3), RowStatus()).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: ipv4trustedHostRowStatus.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: ipv4trustedHostRowStatus.setDescription('The status of an entry in the Trusted Host Table. Only a subset of the rowstatus variables (active, createAndGo, destroy) are available.')NEWLINEtrustedHostTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 1, 3), )NEWLINEif mibBuilder.loadTexts: trustedHostTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: trustedHostTable.setDescription('A table to configure trusted host for in the system.')NEWLINEtrustedHostEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 1, 3, 1), ).setIndexNames((0, "DES-1210-28MEbx", "trustedHostIPType"), (0, "DES-1210-28MEbx", "trustedHostIpAddr"), (0, "DES-1210-28MEbx", "trustedHostIpMask"))NEWLINEif mibBuilder.loadTexts: trustedHostEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: trustedHostEntry.setDescription('Each entry in this table represents rules for particular trusted host.')NEWLINEtrustedHostIPType = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 1, 3, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("iPv4", 1), ("iPv6", 2)))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: trustedHostIPType.setStatus('current')NEWLINEif mibBuilder.loadTexts: trustedHostIPType.setDescription('Type of IP interface.')NEWLINEtrustedHostIpAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 1, 3, 1, 2), Ipv6Address()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: trustedHostIpAddr.setStatus('current')NEWLINEif mibBuilder.loadTexts: trustedHostIpAddr.setDescription('The IP address of host you allow to access to D-Link Smart Switch. Your local host IPv4/6 Addresses must be one of the IP Addresses to avoid disconnection.')NEWLINEtrustedHostIpMask = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 1, 3, 1, 3), Ipv6Address()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: trustedHostIpMask.setStatus('current')NEWLINEif mibBuilder.loadTexts: trustedHostIpMask.setDescription('Used to mask with IPv4/6 address, it allow you set a subnet as a trusted host entry.')NEWLINEtrustedHostRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 1, 3, 1, 4), RowStatus()).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: trustedHostRowStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: trustedHostRowStatus.setDescription('The status of an entry in the Trusted Host Table. Only a subset of the rowstatus variables (active, createAndGo, destroy) are available.')NEWLINEsecurityARPSpoofPrevent = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 3))NEWLINEaRPSpoofPreventTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 3, 1), )NEWLINEif mibBuilder.loadTexts: aRPSpoofPreventTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: aRPSpoofPreventTable.setDescription('A table to control ARP Spoofing prevention for the entire switch or for each interface in the switch.')NEWLINEaRPSpoofPreventEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 3, 1, 1), ).setIndexNames((0, "DES-1210-28MEbx", "aRPSpoofPreventIpAddr"))NEWLINEif mibBuilder.loadTexts: aRPSpoofPreventEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: aRPSpoofPreventEntry.setDescription('An entry appears in this table for each interface in the system.')NEWLINEaRPSpoofPreventIpAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 3, 1, 1, 1), IpAddress())NEWLINEif mibBuilder.loadTexts: aRPSpoofPreventIpAddr.setStatus('current')NEWLINEif mibBuilder.loadTexts: aRPSpoofPreventIpAddr.setDescription("Specifies either the Network or Host address from which the switch can be managed. An address 0.0.0.0 indicates 'Any Manager'.")NEWLINEaRPSpoofPreventMacAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 3, 1, 1, 2), MacAddress().clone(hexValue="000102030405")).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aRPSpoofPreventMacAddress.setStatus('current')NEWLINEif mibBuilder.loadTexts: aRPSpoofPreventMacAddress.setDescription('Ethernet Mac Address.')NEWLINEaRPSpoofPreventPortList = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 3, 1, 1, 3), PortList()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aRPSpoofPreventPortList.setStatus('current')NEWLINEif mibBuilder.loadTexts: aRPSpoofPreventPortList.setDescription("Specifies the port numbers through which the authorized manager can access the switch. By default the authorized manager is allowed to access the switch through all the ports. If a set of ports are configured in the 'PortList', the manager can access the switch only through the configured ports.")NEWLINEaRPSpoofPreventRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 3, 1, 1, 4), RowStatus()).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: aRPSpoofPreventRowStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: aRPSpoofPreventRowStatus.setDescription('This object indicates the status of this entry.')NEWLINEsecuritySSL = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 5))NEWLINEsslSecurityHttpStatus = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 5, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2))).clone('disable')).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sslSecurityHttpStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: sslSecurityHttpStatus.setDescription('This object is for enabling or disabling secure HTTP in the system.')NEWLINEsslCiphers = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 5, 2))NEWLINEsslCipherSuiteList = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 5, 2, 1), Bits().clone(namedValues=NamedValues(("rsa-null-md5", 0), ("rsa-null-sha", 1), ("rsa-des-sha", 2), ("rsa-3des-sha", 3), ("dh-rsa-des-sha", 4), ("dh-rsa-3des-sha", 5), ("rsa-exp1024-des-sha", 6)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sslCipherSuiteList.setStatus('current')NEWLINEif mibBuilder.loadTexts: sslCipherSuiteList.setDescription('This object is to configure the cipher-suites list.')NEWLINEsecuritySSH = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 8))NEWLINEsshSecurityStatus = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 8, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2))).clone('disable')).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sshSecurityStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: sshSecurityStatus.setDescription('This object is for enabling or disabling ssh in the system.')NEWLINEsshMaxAuthFailAttempts = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 8, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(2, 20))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sshMaxAuthFailAttempts.setStatus('current')NEWLINEif mibBuilder.loadTexts: sshMaxAuthFailAttempts.setDescription('This object indicates the max auth fail retry attempt times.')NEWLINEsshSessionKeyRekeying = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 8, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("never", 0), ("ten-min", 1), ("thirty-min", 2), ("sixty-min", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sshSessionKeyRekeying.setStatus('current')NEWLINEif mibBuilder.loadTexts: sshSessionKeyRekeying.setDescription('This object indicates one SSH session rekey time interval.')NEWLINEsshMaxSession = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 8, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 8))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sshMaxSession.setStatus('current')NEWLINEif mibBuilder.loadTexts: sshMaxSession.setDescription('This object indicates max SSH session number supported in system.')NEWLINEsshConnectionTimeout = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 8, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(120, 600))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sshConnectionTimeout.setStatus('current')NEWLINEif mibBuilder.loadTexts: sshConnectionTimeout.setDescription('This object indicates SSH connection timeout value.')NEWLINEsshAuthenMethodPassWordAdmin = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 8, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sshAuthenMethodPassWordAdmin.setStatus('current')NEWLINEif mibBuilder.loadTexts: sshAuthenMethodPassWordAdmin.setDescription('The object indicates authen method password is enabled or disabled.')NEWLINEsshAuthenMethodPubKeyAdmin = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 8, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sshAuthenMethodPubKeyAdmin.setStatus('current')NEWLINEif mibBuilder.loadTexts: sshAuthenMethodPubKeyAdmin.setDescription('The object indicates authen method public-key is enabled or disabled.')NEWLINEsshAuthenMethodHostKeyAdmin = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 8, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sshAuthenMethodHostKeyAdmin.setStatus('current')NEWLINEif mibBuilder.loadTexts: sshAuthenMethodHostKeyAdmin.setDescription('The object indicates authen method host-key is enabled or disabled.')NEWLINEsshCipherSuiteList = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 8, 9), Bits().clone(namedValues=NamedValues(("tripleDESCBC", 0)))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: sshCipherSuiteList.setStatus('current')NEWLINEif mibBuilder.loadTexts: sshCipherSuiteList.setDescription('This object is to configure the cipher-suites list.')NEWLINEsshMacSuiteList = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 8, 10), Bits().clone(namedValues=NamedValues(("hMAC-SHA1", 0), ("hMAC-MD5", 1)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sshMacSuiteList.setStatus('current')NEWLINEif mibBuilder.loadTexts: sshMacSuiteList.setDescription('This object is to configure the MAC-list.')NEWLINEsshPublKeyRSAAdmin = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 8, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sshPublKeyRSAAdmin.setStatus('current')NEWLINEif mibBuilder.loadTexts: sshPublKeyRSAAdmin.setDescription('The object indicates Public key generating algorithm RSA is enabled or disabled.')NEWLINEsshUserInfoTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 8, 12), )NEWLINEif mibBuilder.loadTexts: sshUserInfoTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: sshUserInfoTable.setDescription('A table to configure SSH user auth in the system.')NEWLINEsshUserInfoEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 8, 12, 1), ).setIndexNames((0, "DES-1210-28MEbx", "sshUserInfoID"))NEWLINEif mibBuilder.loadTexts: sshUserInfoEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: sshUserInfoEntry.setDescription('An entry to configure user auth in the system.')NEWLINEsshUserInfoID = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 8, 12, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 8))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: sshUserInfoID.setStatus('current')NEWLINEif mibBuilder.loadTexts: sshUserInfoID.setDescription('The Schedule identifier. The maximum number of Schedule entry is the number of ports supported PoE function. The value must be between 1 and 8.')NEWLINEsshUserInfoUserName = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 8, 12, 1, 2), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 20))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: sshUserInfoUserName.setStatus('current')NEWLINEif mibBuilder.loadTexts: sshUserInfoUserName.setDescription("The ssh user name associated with the SSH suer Info. entry (e.g., `admin, user').")NEWLINEsshUserInfoAuth = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 8, 12, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(4, 2, 1))).clone(namedValues=NamedValues(("publickey", 4), ("password", 2), ("hostbased", 1)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sshUserInfoAuth.setStatus('current')NEWLINEif mibBuilder.loadTexts: sshUserInfoAuth.setDescription('The object indicates which auth used by the user.')NEWLINEsshUserInfoHostName = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 8, 12, 1, 4), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 20))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sshUserInfoHostName.setStatus('current')NEWLINEif mibBuilder.loadTexts: sshUserInfoHostName.setDescription("The ssh host name associated with the SSH suer Info. entry (e.g., `DUT1, DUT2').")NEWLINEsshUserInfoHostIp = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 8, 12, 1, 5), IpAddress()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sshUserInfoHostIp.setStatus('current')NEWLINEif mibBuilder.loadTexts: sshUserInfoHostIp.setDescription('SSH HostBased IP Address of the system.')NEWLINEsecurityPortSecurity = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 2))NEWLINEportSecTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 2, 1), )NEWLINEif mibBuilder.loadTexts: portSecTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: portSecTable.setDescription('A table to control port security features of the device.')NEWLINEportSecEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 2, 1, 1), ).setIndexNames((0, "DES-1210-28MEbx", "portSecIndex"))NEWLINEif mibBuilder.loadTexts: portSecEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: portSecEntry.setDescription('An entry appears in port security table for each interface in the system.')NEWLINEportSecIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 2, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 28))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: portSecIndex.setStatus('current')NEWLINEif mibBuilder.loadTexts: portSecIndex.setDescription('The interface index for which the configuration in this entry applies. For all machines give maximum port number.')NEWLINEportSecState = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 2, 1, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: portSecState.setStatus('current')NEWLINEif mibBuilder.loadTexts: portSecState.setDescription("Enable / disable port security admin state for the interface. A given ports' dynamic MAC address learning will be stopped such that the current source MAC addresses entered into the MAC address forwarding table can not be changed once the port security admin state is enabled.")NEWLINEportSecMLA = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 2, 1, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 64))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: portSecMLA.setStatus('current')NEWLINEif mibBuilder.loadTexts: portSecMLA.setDescription("Configures interface port security maximum learning address numbers. When given ports' admin state is enabled, allows forwarding table learning address number. The number can be set 0 to 64. Note: Set value 0 means cannot learn MAC address.")NEWLINEportSecLockAddrMode = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 2, 1, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("deleteOnReset", 1), ("deleteOnTimeout", 2), ("permanent", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: portSecLockAddrMode.setStatus('current')NEWLINEif mibBuilder.loadTexts: portSecLockAddrMode.setDescription('Configures port security lock address mode for the interface. deleteOnReset : The locked addresses will not age out until the Switch has been reset. deleteOnTimeout : The locked addresses will age out after the aging timer expires. Permanent : The locked addresses will not age out after the aging timer expires.')NEWLINEportSecFDBPermanentTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 2, 2), )NEWLINEif mibBuilder.loadTexts: portSecFDBPermanentTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: portSecFDBPermanentTable.setDescription('A table to control port security FDB Permanent of the device.')NEWLINEportSecFDBPermanentEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 2, 2, 1), ).setIndexNames((0, "DES-1210-28MEbx", "portSecFDBPermPort"), (0, "DES-1210-28MEbx", "portSecFDBPermIndex"))NEWLINEif mibBuilder.loadTexts: portSecFDBPermanentEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: portSecFDBPermanentEntry.setDescription('An entry appears in port security table for each interface in the system.')NEWLINEportSecFDBPermIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 2, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 28))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: portSecFDBPermIndex.setStatus('current')NEWLINEif mibBuilder.loadTexts: portSecFDBPermIndex.setDescription('The index of the port security MAC entry. For all machines give maximum port number.')NEWLINEportSecFDBPermVlanID = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 2, 2, 1, 2), Integer32()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: portSecFDBPermVlanID.setStatus('current')NEWLINEif mibBuilder.loadTexts: portSecFDBPermVlanID.setDescription('The VLAN ID of the port security MAC entry.')NEWLINEportSecFDBPermMac = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 2, 2, 1, 3), MacAddress()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: portSecFDBPermMac.setStatus('current')NEWLINEif mibBuilder.loadTexts: portSecFDBPermMac.setDescription('The MAC address associated of the port security MAC entry.')NEWLINEportSecFDBPermPort = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 2, 2, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 28))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: portSecFDBPermPort.setStatus('current')NEWLINEif mibBuilder.loadTexts: portSecFDBPermPort.setDescription('The forwarding port of the port security MAC entry. For all machines give maximum port number.')NEWLINEcableDiagTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 35, 1), )NEWLINEif mibBuilder.loadTexts: cableDiagTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: cableDiagTable.setDescription('A table that contains the cable situation for each port.')NEWLINEcableDiagEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 35, 1, 1), ).setIndexNames((0, "DES-1210-28MEbx", "cableDiagPortIndex"))NEWLINEif mibBuilder.loadTexts: cableDiagEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: cableDiagEntry.setDescription('A list of cable situations for each port on the device.')NEWLINEcableDiagPortIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 35, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 28))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: cableDiagPortIndex.setStatus('current')NEWLINEif mibBuilder.loadTexts: cableDiagPortIndex.setDescription('The interface index for which the configuration in this entry applies. For all machines give maximum port number.')NEWLINEcableDiagPortType = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 35, 1, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("fastEthernet", 0), ("gigaEthernet", 1), ("other", 2)))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: cableDiagPortType.setStatus('current')NEWLINEif mibBuilder.loadTexts: cableDiagPortType.setDescription('Indicates the supported port data rate classification.')NEWLINEcableDiagLinkStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 35, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("linkdown", 0), ("linkup", 1), ("other", 2)))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: cableDiagLinkStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: cableDiagLinkStatus.setDescription('This object indicates the link status.')NEWLINEcableDiagPair1Status = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 35, 1, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6, 7, 8))).clone(namedValues=NamedValues(("ok", 0), ("open", 1), ("short", 2), ("open-short", 3), ("crosstalk", 4), ("unknown", 5), ("count", 6), ("no-cable", 7), ("other", 8)))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: cableDiagPair1Status.setStatus('current')NEWLINEif mibBuilder.loadTexts: cableDiagPair1Status.setDescription('Cable diagnostics pair 1 test result.')NEWLINEcableDiagPair2Status = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 35, 1, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6, 7, 8))).clone(namedValues=NamedValues(("ok", 0), ("open", 1), ("short", 2), ("open-short", 3), ("crosstalk", 4), ("unknown", 5), ("count", 6), ("no-cable", 7), ("other", 8)))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: cableDiagPair2Status.setStatus('current')NEWLINEif mibBuilder.loadTexts: cableDiagPair2Status.setDescription('Cable diagnostics pair 2 test result.')NEWLINEcableDiagPair3Status = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 35, 1, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6, 7, 8))).clone(namedValues=NamedValues(("ok", 0), ("open", 1), ("short", 2), ("open-short", 3), ("crosstalk", 4), ("unknown", 5), ("count", 6), ("no-cable", 7), ("other", 8)))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: cableDiagPair3Status.setStatus('current')NEWLINEif mibBuilder.loadTexts: cableDiagPair3Status.setDescription('Cable diagnostics pair 3 test result.')NEWLINEcableDiagPair4Status = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 35, 1, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6, 7, 8))).clone(namedValues=NamedValues(("ok", 0), ("open", 1), ("short", 2), ("open-short", 3), ("crosstalk", 4), ("unknown", 5), ("count", 6), ("no-cable", 7), ("other", 8)))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: cableDiagPair4Status.setStatus('current')NEWLINEif mibBuilder.loadTexts: cableDiagPair4Status.setDescription('Cable diagnostics pair 4 test result.')NEWLINEcableDiagPair1Length = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 35, 1, 1, 8), Integer32()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: cableDiagPair1Length.setStatus('current')NEWLINEif mibBuilder.loadTexts: cableDiagPair1Length.setDescription('Cable Diagnostics pair 1 fault distance.')NEWLINEcableDiagPair2Length = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 35, 1, 1, 9), Integer32()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: cableDiagPair2Length.setStatus('current')NEWLINEif mibBuilder.loadTexts: cableDiagPair2Length.setDescription('Cable diagnostics pair 2 fault distance.')NEWLINEcableDiagPair3Length = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 35, 1, 1, 10), Integer32()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: cableDiagPair3Length.setStatus('current')NEWLINEif mibBuilder.loadTexts: cableDiagPair3Length.setDescription('Cable diagnostics pair 3 fault distance.')NEWLINEcableDiagPair4Length = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 35, 1, 1, 11), Integer32()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: cableDiagPair4Length.setStatus('current')NEWLINEif mibBuilder.loadTexts: cableDiagPair4Length.setDescription('Cable diagnostics pair 4 fault distance.')NEWLINEcableDiagAction = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 35, 1, 1, 12), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("action", 1), ("processing", 2), ("other", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: cableDiagAction.setStatus('current')NEWLINEif mibBuilder.loadTexts: cableDiagAction.setDescription('Function to run the cable diagnostic on selected port. Can not detect fiber ports')NEWLINEcableDiagStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 35, 1, 1, 13), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("notrun", 1), ("processing", 2), ("lasttestok", 3), ("lasttestfailed", 4)))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: cableDiagStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: cableDiagStatus.setDescription('Indicates the status of cable diagnostics on the port. not-run - cable diagnostics has never been run for this port processing - cable diagnostics is currently running on the port last-test-ok - the last cable diagnostics done on the port was successful last-test-failed - the last cable diagnostics done on the port failed')NEWLINEaclProfile = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 1))NEWLINEipv4aclProfileTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 1, 1), )NEWLINEif mibBuilder.loadTexts: ipv4aclProfileTable.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: ipv4aclProfileTable.setDescription(' A table to ACL profile . ')NEWLINEipv4aclProfileEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 1, 1, 1), ).setIndexNames((0, "DES-1210-28MEbx", "ipv4aclProfileNo"))NEWLINEif mibBuilder.loadTexts: ipv4aclProfileEntry.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: ipv4aclProfileEntry.setDescription(' Each entry in this table is a ACL profile. Index to the table is ACL profile ID. ')NEWLINEipv4aclProfileNo = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 1, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 50))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: ipv4aclProfileNo.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: ipv4aclProfileNo.setDescription('The ACL Profile ID. The ID 1 to 50 is user-defined ACL, and the ID more than 50 is reserved for system-defined ACL. The user only allow to create user-defined ACL ID. And system-defined ACL is read only.')NEWLINEipv4aclProfileType = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 1, 1, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 8, 9))).clone(namedValues=NamedValues(("l2", 1), ("l3", 2), ("impb", 3), ("arpSP-permit", 4), ("arpSP-deny", 5), ("aclQos", 8), ("userDefined", 9)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ipv4aclProfileType.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: ipv4aclProfileType.setDescription('The ACL Profile type, possible value are l2 (1) - for MAC-based rule, l3 (2) - for IPv4-based rule, arpSP_permit(4) - for ARP Spoofing prevention entry, arpSP_deny(5) - for ARP Spoofing prevention entry, voiceVlan(6) - for Voice VLAN OUI entry. userDefined(9) - for User Defined entry. Note that only l2, l3 and userDefined could be set by user, other is reserved for system to show information. ')NEWLINEipv4aclProfileRuleCount = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 1, 1, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: ipv4aclProfileRuleCount.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: ipv4aclProfileRuleCount.setDescription('The number of rules in this profile.')NEWLINEipv4aclProfileMask = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 1, 1, 1, 4), OctetString()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ipv4aclProfileMask.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: ipv4aclProfileMask.setDescription('Indicate which field want to care in the packet. Turn on the following bits to select the following items Type Item BIT ------------------------------------------ L2 DST_MAC 0 (LSB) L2 SRC_MAC 1 L2 VID 2 L2 8021P_PRIORITY 3 L2 ETHER_TYPE 4 L3 DSCP 5 L3 ICMP_TYPE 6 L3 ICMP_CODE 7 L3 IGMP_TYPE 8 L3 DST_IP 9 L3 SRC_IP 10 L3 DST_PORT 11 L3 SRC_PORT 12 L3 TCPFLAG 13 ARP-SP ARP_SENDER_MAC 14 ARP-SP ARP_SENDER_IP 15 L3 TOS 16 UDF UDF1 17 UDF UDF2 18 UDF UDF3 19 UDF UDF4 20 L3v6 TRAFFIC_CLASS 21 L3v6 DST_IPV6 22 L3v6 SRC_IPV6 23 (MSB) ------------------------------------------- The value is in Hex format. ')NEWLINEipv4aclProfileDstMacAddrMask = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 1, 1, 1, 5), MacAddress()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ipv4aclProfileDstMacAddrMask.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: ipv4aclProfileDstMacAddrMask.setDescription('The ACL Profile destination MAC address mask. If DST_MAC is turn on in aclProfileMask, it will work with its member rule field,aclL2RuleDstMacAddr, to caculate a range of MAC address which is really care. ')NEWLINEipv4aclProfileSrcMacAddrMask = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 1, 1, 1, 6), MacAddress()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ipv4aclProfileSrcMacAddrMask.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: ipv4aclProfileSrcMacAddrMask.setDescription('The ACL Profile source MAC address mask. If SRC_MAC is turn on in aclProfileMask, it will work with its member rule field,aclL2RuleSrcMacAddr, to caculate a range of MAC address which is really care. ')NEWLINEipv4aclProfileIPProtocol = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 1, 1, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 6, 17, 58, 256))).clone(namedValues=NamedValues(("none", 0), ("icmp", 1), ("igmp", 2), ("tcp", 6), ("udp", 17), ("icmpv6", 58), ("ipProtocolMask", 256)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ipv4aclProfileIPProtocol.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: ipv4aclProfileIPProtocol.setDescription('Indicate which IP Protocol will be care in this profile. Only profile type is l3 can set the IP protocol. For others, this field will be none. ')NEWLINEipv4aclProfileIPProtocolMask = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 1, 1, 1, 8), OctetString().clone(hexValue="FF")).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ipv4aclProfileIPProtocolMask.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: ipv4aclProfileIPProtocolMask.setDescription('The ACL Profile IP protocol mask. If aclProfileIPProtocol set to ipMask, this field will be refered. It will work with its member rule field,aclL3RuleProtocol, to caculate a range of IP protocol which is really care. The value is in HEX format. ')NEWLINEipv4aclProfileDstIpAddrMask = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 1, 1, 1, 9), IpAddress().clone(hexValue="FFFFFFFF")).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ipv4aclProfileDstIpAddrMask.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: ipv4aclProfileDstIpAddrMask.setDescription("The ACL Profile destination IP address mask. If DST_IP is turn on in aclProfileMask, it will work with its member rule field,aclL3RuleDstIpAddr, to caculate a range of IP address which is really care. The value is in HEX format, for example: '255.255.255.0' is presented to 'FFFFFF00' ")NEWLINEipv4aclProfileSrcIpAddrMask = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 1, 1, 1, 10), IpAddress().clone(hexValue="FFFFFFFF")).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ipv4aclProfileSrcIpAddrMask.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: ipv4aclProfileSrcIpAddrMask.setDescription("The ACL Profile source IP address mask. If SRC_IP is turn on in aclProfileMask, it will work with its member rule field,aclL3RuleSrcIpAddr, to caculate a range of IP address which is really care. The value is in HEX format, for example: '255.255.255.0' is presented to 'FFFFFF00' ")NEWLINEipv4aclProfileDstPortMask = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 1, 1, 1, 11), OctetString().clone(hexValue="FFFF")).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ipv4aclProfileDstPortMask.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: ipv4aclProfileDstPortMask.setDescription('The ACL Profile UDP/TCP destination port mask. If DST_PORT is turn on in aclProfileMask, it will work with its member rule field,aclL3RuleTcpUdpDstPort, to caculate a range of destination port which is really care. The value is in HEX format. ')NEWLINEipv4aclProfileSrcPortMask = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 1, 1, 1, 12), OctetString().clone(hexValue="FFFF")).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ipv4aclProfileSrcPortMask.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: ipv4aclProfileSrcPortMask.setDescription('The ACL Profile UDP/TCP source port mask. If SRC_PORT is turn on in aclProfileMask, it will work with its member rule field,aclL3RuleTcpUdpSrcPort, to caculate a range of source port which is really care. The value is in HEX format. ')NEWLINEipv4aclProfileArpSenderMacAddrMask = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 1, 1, 1, 13), MacAddress().clone(hexValue="FFFFFFFFFF")).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: ipv4aclProfileArpSenderMacAddrMask.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: ipv4aclProfileArpSenderMacAddrMask.setDescription("The ACL Profile Sender MAC mask. This is only for ARP Spoofing Prevention which is System-defined ACL, and it's not allow to modify. The value is in HEX format. ")NEWLINEipv4aclProfileArpSenderIpAddrMask = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 1, 1, 1, 14), IpAddress().clone(hexValue="FFFFFFFF")).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: ipv4aclProfileArpSenderIpAddrMask.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: ipv4aclProfileArpSenderIpAddrMask.setDescription("The ACL Profile Sender IP mask. This is only for ARP Spoofing Prevention which is System-defined ACL, and it's not allow to modify. The value is in HEX format. ")NEWLINEipv4aclProfileUdfOffsetMap = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 1, 1, 1, 15), OctetString()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ipv4aclProfileUdfOffsetMap.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: ipv4aclProfileUdfOffsetMap.setDescription('Indicate which Udf field want to care in the packet. Turn on the following bits to select the following items Type Item BIT ------------------------------------------ UDF Offset1 0 (LSB) UDF Offset2 1 UDF Offset3 2 UDF Offset4 3 ------------------------------------------- The value is in Hex format. ')NEWLINEipv4aclUdfOffsetBase1 = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 1, 1, 1, 16), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 2, 3))).clone(namedValues=NamedValues(("l2", 0), ("l3", 2), ("l4", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ipv4aclUdfOffsetBase1.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: ipv4aclUdfOffsetBase1.setDescription('The value of offset Base.')NEWLINEipv4aclUdfOffsetByte1 = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 1, 1, 1, 17), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 31))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ipv4aclUdfOffsetByte1.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: ipv4aclUdfOffsetByte1.setDescription('The value of offset Byte from base.')NEWLINEipv4aclUdfOffsetMask1 = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 1, 1, 1, 18), OctetString().clone(hexValue="FFFFFFFF")).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ipv4aclUdfOffsetMask1.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: ipv4aclUdfOffsetMask1.setDescription('The value of offset MAsk.')NEWLINEipv4aclUdfOffsetBase2 = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 1, 1, 1, 19), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 2, 3))).clone(namedValues=NamedValues(("l2", 0), ("l3", 2), ("l4", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ipv4aclUdfOffsetBase2.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: ipv4aclUdfOffsetBase2.setDescription('The value of offset Base.')NEWLINEipv4aclUdfOffsetByte2 = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 1, 1, 1, 20), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 31))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ipv4aclUdfOffsetByte2.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: ipv4aclUdfOffsetByte2.setDescription('The value of offset Byte from base.')NEWLINEipv4aclUdfOffsetMask2 = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 1, 1, 1, 21), OctetString().clone(hexValue="FFFFFFFF")).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ipv4aclUdfOffsetMask2.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: ipv4aclUdfOffsetMask2.setDescription('The value of offset MAsk.')NEWLINEipv4aclUdfOffsetBase3 = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 1, 1, 1, 22), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 2, 3))).clone(namedValues=NamedValues(("l2", 0), ("l3", 2), ("l4", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ipv4aclUdfOffsetBase3.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: ipv4aclUdfOffsetBase3.setDescription('The value of offset Base.')NEWLINEipv4aclUdfOffsetByte3 = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 1, 1, 1, 23), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 31))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ipv4aclUdfOffsetByte3.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: ipv4aclUdfOffsetByte3.setDescription('The value of offset Byte from base.')NEWLINEipv4aclUdfOffsetMask3 = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 1, 1, 1, 24), OctetString().clone(hexValue="FFFFFFFF")).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ipv4aclUdfOffsetMask3.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: ipv4aclUdfOffsetMask3.setDescription('The value of offset MAsk.')NEWLINEipv4aclUdfOffsetBase4 = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 1, 1, 1, 25), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 2, 3))).clone(namedValues=NamedValues(("l2", 0), ("l3", 2), ("l4", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ipv4aclUdfOffsetBase4.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: ipv4aclUdfOffsetBase4.setDescription('The value of offset Base.')NEWLINEipv4aclUdfOffsetByte4 = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 1, 1, 1, 26), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 31))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ipv4aclUdfOffsetByte4.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: ipv4aclUdfOffsetByte4.setDescription('The value of offset Byte from base.')NEWLINEipv4aclUdfOffsetMask4 = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 1, 1, 1, 27), OctetString().clone(hexValue="FFFFFFFF")).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ipv4aclUdfOffsetMask4.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: ipv4aclUdfOffsetMask4.setDescription('The value of offset MAsk.')NEWLINEipv4aclProfileStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 1, 1, 1, 28), RowStatus()).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: ipv4aclProfileStatus.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: ipv4aclProfileStatus.setDescription(" This object indicates the status of this entry, can only be set to 'createAndWait','active' and 'destroy'. When the value of the entry status is 'createAndWait', it could be set to 'active' only if the three values of aclProfileType, aclProfileMask and ProtocolType are not conflicted. ")NEWLINEaclProfileTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 1, 2), )NEWLINEif mibBuilder.loadTexts: aclProfileTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclProfileTable.setDescription(' A table to ACL profile . ')NEWLINEaclProfileEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 1, 2, 1), ).setIndexNames((0, "DES-1210-28MEbx", "aclProfileNo"))NEWLINEif mibBuilder.loadTexts: aclProfileEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclProfileEntry.setDescription(' Each entry in this table is a ACL profile. Index to the table is ACL profile ID. ')NEWLINEaclProfileNo = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 1, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 50))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: aclProfileNo.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclProfileNo.setDescription('The ACL Profile ID. The ID 1 to 50 is user-defined ACL, and the ID more than 50 is reserved for system-defined ACL. The user only allow to create user-defined ACL ID. And system-defined ACL is read only.')NEWLINEaclProfileType = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 1, 2, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 11, 3, 4, 5, 8, 9))).clone(namedValues=NamedValues(("l2", 1), ("l3v4", 2), ("l3v6", 11), ("impb", 3), ("arpSP-permit", 4), ("arpSP-deny", 5), ("aclQos", 8), ("userDefined", 9)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aclProfileType.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclProfileType.setDescription('The ACL Profile type, possible value are l2 (1) - for MAC-based rule, l3v4 (2) - for IPv4-based rule, l3v6 (11) - for IPv6-based rule, arpSP_permit(4) - for ARP Spoofing prevention entry, arpSP_deny(5) - for ARP Spoofing prevention entry, voiceVlan(6) - for Voice VLAN OUI entry. userDefined(9) - for User Defined entry. Note that only l2, l3 and userDefined could be set by user, other is reserved for system to show information. ')NEWLINEaclProfileRuleCount = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 1, 2, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: aclProfileRuleCount.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclProfileRuleCount.setDescription('The number of rules in this profile.')NEWLINEaclProfileMask = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 1, 2, 1, 4), OctetString()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aclProfileMask.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclProfileMask.setDescription('Indicate which field want to care in the packet. Turn on the following bits to select the following items Type Item BIT ------------------------------------------ L2 DST_MAC 0 (LSB) L2 SRC_MAC 1 L2 VID 2 L2 8021P_PRIORITY 3 L2 ETHER_TYPE 4 L3 DSCP 5 L3 ICMP_TYPE 6 L3 ICMP_CODE 7 L3 IGMP_TYPE 8 L3 DST_IP 9 L3 SRC_IP 10 L3 DST_PORT 11 L3 SRC_PORT 12 L3 TCPFLAG 13 ARP-SP ARP_SENDER_MAC 14 ARP-SP ARP_SENDER_IP 15 L3 TRAFFIC_CLASS 21 L3 TOS 16 UDF UDF1 17 UDF UDF2 18 UDF UDF3 19 UDF UDF4 20 L3v6 TRAFFIC_CLASS 21 L3v6 DST_IPV6 22 L3v6 SRC_IPV6 23 (MSB) ------------------------------------------- The value is in Hex format. ')NEWLINEaclProfileDstMacAddrMask = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 1, 2, 1, 5), MacAddress()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aclProfileDstMacAddrMask.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclProfileDstMacAddrMask.setDescription('The ACL Profile destination MAC address mask. If DST_MAC is turn on in aclProfileMask, it will work with its member rule field,aclL2RuleDstMacAddr, to caculate a range of MAC address which is really care. ')NEWLINEaclProfileSrcMacAddrMask = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 1, 2, 1, 6), MacAddress()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aclProfileSrcMacAddrMask.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclProfileSrcMacAddrMask.setDescription('The ACL Profile source MAC address mask. If SRC_MAC is turn on in aclProfileMask, it will work with its member rule field,aclL2RuleSrcMacAddr, to caculate a range of MAC address which is really care. ')NEWLINEaclProfileIPProtocol = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 1, 2, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 6, 17, 58, 256))).clone(namedValues=NamedValues(("none", 0), ("icmp", 1), ("igmp", 2), ("tcp", 6), ("udp", 17), ("icmpv6", 58), ("ipProtocolMask", 256)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aclProfileIPProtocol.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclProfileIPProtocol.setDescription('Indicate which IP Protocol will be care in this profile. Only profile type is l3 can set the IP protocol. For others, this field will be none. ')NEWLINEaclProfileIPProtocolMask = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 1, 2, 1, 8), OctetString().clone(hexValue="FF")).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aclProfileIPProtocolMask.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclProfileIPProtocolMask.setDescription('The ACL Profile IP protocol mask. If aclProfileIPProtocol set to ipMask, this field will be refered. It will work with its member rule field,aclL3RuleProtocol, to caculate a range of IP protocol which is really care. The value is in HEX format. ')NEWLINEaclProfileDstIpAddrMaskType = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 1, 2, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("iPv4", 1), ("iPv6", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aclProfileDstIpAddrMaskType.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclProfileDstIpAddrMaskType.setDescription('IPv6 Address type.')NEWLINEaclProfileDstIpAddrMask = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 1, 2, 1, 10), Ipv6Address().clone(hexValue="FFFFFFFF")).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aclProfileDstIpAddrMask.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclProfileDstIpAddrMask.setDescription("The ACL Profile destination IP address mask. If DST_IP is turn on in aclProfileMask, it will work with its member rule field,aclL3RuleDstIpAddr, to caculate a range of IP address which is really care. The value is in HEX format, for example: '255.255.255.0' is presented to 'FFFFFF00' ")NEWLINEaclProfileSrcIpAddrMaskType = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 1, 2, 1, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("iPv4", 1), ("iPv6", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aclProfileSrcIpAddrMaskType.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclProfileSrcIpAddrMaskType.setDescription('IPv6 Address type.')NEWLINEaclProfileSrcIpAddrMask = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 1, 2, 1, 12), Ipv6Address().clone(hexValue="FFFFFFFF")).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aclProfileSrcIpAddrMask.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclProfileSrcIpAddrMask.setDescription("The ACL Profile source IP address mask. If SRC_IP is turn on in aclProfileMask, it will work with its member rule field,aclL3RuleSrcIpAddr, to caculate a range of IP address which is really care. The value is in HEX format, for example: '255.255.255.0' is presented to 'FFFFFF00' ")NEWLINEaclProfileDstPortMask = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 1, 2, 1, 13), OctetString().clone(hexValue="FFFF")).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aclProfileDstPortMask.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclProfileDstPortMask.setDescription('The ACL Profile UDP/TCP destination port mask. If DST_PORT is turn on in aclProfileMask, it will work with its member rule field,aclL3RuleTcpUdpDstPort, to caculate a range of destination port which is really care. The value is in HEX format. ')NEWLINEaclProfileSrcPortMask = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 1, 2, 1, 14), OctetString().clone(hexValue="FFFF")).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aclProfileSrcPortMask.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclProfileSrcPortMask.setDescription('The ACL Profile UDP/TCP source port mask. If SRC_PORT is turn on in aclProfileMask, it will work with its member rule field,aclL3RuleTcpUdpSrcPort, to caculate a range of source port which is really care. The value is in HEX format. ')NEWLINEaclProfileArpSenderMacAddrMask = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 1, 2, 1, 15), MacAddress().clone(hexValue="FFFFFFFFFF")).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: aclProfileArpSenderMacAddrMask.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclProfileArpSenderMacAddrMask.setDescription("The ACL Profile Sender MAC mask. This is only for ARP Spoofing Prevention which is System-defined ACL, and it's not allow to modify. The value is in HEX format. ")NEWLINEaclProfileArpSenderIpAddrMask = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 1, 2, 1, 16), Ipv6Address().clone(hexValue="FFFFFFFF")).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: aclProfileArpSenderIpAddrMask.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclProfileArpSenderIpAddrMask.setDescription("The ACL Profile Sender IP mask. This is only for ARP Spoofing Prevention which is System-defined ACL, and it's not allow to modify. The value is in HEX format. ")NEWLINEaclProfileUdfOffsetMap = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 1, 2, 1, 17), OctetString()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aclProfileUdfOffsetMap.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclProfileUdfOffsetMap.setDescription('Indicate which Udf field want to care in the packet. Turn on the following bits to select the following items Type Item BIT ------------------------------------------ UDF Offset1 0 (LSB) UDF Offset2 1 UDF Offset3 2 UDF Offset4 3 ------------------------------------------- The value is in Hex format. ')NEWLINEaclUdfOffsetBase1 = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 1, 2, 1, 18), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 2, 3))).clone(namedValues=NamedValues(("l2", 0), ("l3", 2), ("l4", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aclUdfOffsetBase1.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclUdfOffsetBase1.setDescription('The value of offset Base.')NEWLINEaclUdfOffsetByte1 = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 1, 2, 1, 19), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 31))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aclUdfOffsetByte1.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclUdfOffsetByte1.setDescription('The value of offset Byte from base.')NEWLINEaclUdfOffsetMask1 = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 1, 2, 1, 20), OctetString().clone(hexValue="FFFFFFFF")).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aclUdfOffsetMask1.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclUdfOffsetMask1.setDescription('The value of offset MAsk.')NEWLINEaclUdfOffsetBase2 = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 1, 2, 1, 21), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 2, 3))).clone(namedValues=NamedValues(("l2", 0), ("l3", 2), ("l4", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aclUdfOffsetBase2.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclUdfOffsetBase2.setDescription('The value of offset Base.')NEWLINEaclUdfOffsetByte2 = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 1, 2, 1, 22), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 31))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aclUdfOffsetByte2.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclUdfOffsetByte2.setDescription('The value of offset Byte from base.')NEWLINEaclUdfOffsetMask2 = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 1, 2, 1, 23), OctetString().clone(hexValue="FFFFFFFF")).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aclUdfOffsetMask2.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclUdfOffsetMask2.setDescription('The value of offset MAsk.')NEWLINEaclUdfOffsetBase3 = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 1, 2, 1, 24), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 2, 3))).clone(namedValues=NamedValues(("l2", 0), ("l3", 2), ("l4", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aclUdfOffsetBase3.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclUdfOffsetBase3.setDescription('The value of offset Base.')NEWLINEaclUdfOffsetByte3 = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 1, 2, 1, 25), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 31))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aclUdfOffsetByte3.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclUdfOffsetByte3.setDescription('The value of offset Byte from base.')NEWLINEaclUdfOffsetMask3 = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 1, 2, 1, 26), OctetString().clone(hexValue="FFFFFFFF")).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aclUdfOffsetMask3.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclUdfOffsetMask3.setDescription('The value of offset MAsk.')NEWLINEaclUdfOffsetBase4 = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 1, 2, 1, 27), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 2, 3))).clone(namedValues=NamedValues(("l2", 0), ("l3", 2), ("l4", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aclUdfOffsetBase4.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclUdfOffsetBase4.setDescription('The value of offset Base.')NEWLINEaclUdfOffsetByte4 = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 1, 2, 1, 28), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 31))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aclUdfOffsetByte4.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclUdfOffsetByte4.setDescription('The value of offset Byte from base.')NEWLINEaclUdfOffsetMask4 = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 1, 2, 1, 29), OctetString().clone(hexValue="FFFFFFFF")).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aclUdfOffsetMask4.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclUdfOffsetMask4.setDescription('The value of offset MAsk.')NEWLINEaclProfileStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 1, 2, 1, 30), RowStatus()).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: aclProfileStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclProfileStatus.setDescription(" This object indicates the status of this entry, can only be set to 'createAndWait','active' and 'destroy'. When the value of the entry status is 'createAndWait', it could be set to 'active' only if the three values of aclProfileType, aclProfileMask and ProtocolType are not conflicted. ")NEWLINEaclL2Rule = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 2))NEWLINEaclL2RuleTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 2, 1), )NEWLINEif mibBuilder.loadTexts: aclL2RuleTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclL2RuleTable.setDescription('A table to configure L2 filter rules in the system.')NEWLINEaclL2RuleEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 2, 1, 1), ).setIndexNames((0, "DES-1210-28MEbx", "aclL2ProfileID"), (0, "DES-1210-28MEbx", "aclL2AccessID"))NEWLINEif mibBuilder.loadTexts: aclL2RuleEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclL2RuleEntry.setDescription('Each entry in this table is a L2 filter rule. Index to the table is the L2 filter number and Profile ID.')NEWLINEaclL2AccessID = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 2, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 250))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: aclL2AccessID.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclL2AccessID.setDescription('L2 Filter rule ID. 0 means auto assign.')NEWLINEaclL2ProfileID = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 2, 1, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 50)).clone(1)).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: aclL2ProfileID.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclL2ProfileID.setDescription('ACL Profile ID which this rule join.')NEWLINEaclL2RuleEtherType = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 2, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(-1, -1), ValueRangeConstraint(1501, 65535), )).clone(-1)).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aclL2RuleEtherType.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclL2RuleEtherType.setDescription("The value in the Type/Len field of a frame that will be matched to trigger this filter. The default value of this object is '-1', which means the rule don't care this condition.")NEWLINEaclL2RuleDstMacAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 2, 1, 1, 4), MacAddress()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aclL2RuleDstMacAddr.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclL2RuleDstMacAddr.setDescription("Destination MAC address to be matched with the packet. By Default, the Destination Mac Address will be zero,which means the rule don't care this condition.")NEWLINEaclL2RuleSrcMacAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 2, 1, 1, 5), MacAddress()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aclL2RuleSrcMacAddr.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclL2RuleSrcMacAddr.setDescription("Source MAC address to be matched with the packet. By Default, the Source Mac Address will be zero, which means the rule don't care this condition.. address")NEWLINEaclL2RuleVlanId = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 2, 1, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 4094)).clone(-1)).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aclL2RuleVlanId.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclL2RuleVlanId.setDescription("Vlan Id to be filtered. In case of Provider bridges, This Vlan Id will be treated as customer Vlan Id. By Default, the value will be '-1', which means the rule don't care this condition.")NEWLINEaclL2Rule1pPriority = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 2, 1, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 7)).clone(-1)).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aclL2Rule1pPriority.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclL2Rule1pPriority.setDescription("802.1p priority to be matched with the packet. By Default, the value will be '-1', which means the rule don't care this condition.")NEWLINEaclL2RuleDstMacAddrMask = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 2, 1, 1, 8), MacAddress()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: aclL2RuleDstMacAddrMask.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclL2RuleDstMacAddrMask.setDescription("The MAC address Mask work for Destination MAC address. This field is read-only and copy from it's Profile setting.")NEWLINEaclL2RuleSrcMacAddrMask = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 2, 1, 1, 9), MacAddress()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: aclL2RuleSrcMacAddrMask.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclL2RuleSrcMacAddrMask.setDescription("The MAC address Mask work for Source MAC address. This field is read-only and copy from it's Profile setting.")NEWLINEaclL2RuleInPortList = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 2, 1, 1, 10), PortList()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aclL2RuleInPortList.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclL2RuleInPortList.setDescription('Specifies the complete set of ports over which this filter is applied for packets ingress at ports in this list.')NEWLINEaclL2RuleAction = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 2, 1, 1, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 5, 6, 7))).clone(namedValues=NamedValues(("allow", 1), ("drop", 2), ("mirror", 3), ("replaceDSCP", 5), ("replace1P", 6), ("replaceQueue", 7))).clone('allow')).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aclL2RuleAction.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclL2RuleAction.setDescription("Specifies the action to be taken on the packet if the filter rule matches. If the action is 'allow', the packet will be forwarded according to the forwarding rules. If the action is 'drop', the packet will be discarded.")NEWLINEaclL2RuleRateLimit = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 2, 1, 1, 12), Unsigned32()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aclL2RuleRateLimit.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclL2RuleRateLimit.setDescription('Rate limit for matched packet.')NEWLINEaclL2RuleReplaceDSCP = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 2, 1, 1, 13), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 63))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aclL2RuleReplaceDSCP.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclL2RuleReplaceDSCP.setDescription('Replace DSCP for matched packet.')NEWLINEaclL2RuleReplace1P = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 2, 1, 1, 14), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 7))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aclL2RuleReplace1P.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclL2RuleReplace1P.setDescription('Replace DSCP for matched packet.')NEWLINEaclL2RuleReplaceQueue = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 2, 1, 1, 15), Integer32()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aclL2RuleReplaceQueue.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclL2RuleReplaceQueue.setDescription('ACL L2 Rule Replace Queue.')NEWLINEaclL2RuleFilterTimeRange = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 2, 1, 1, 16), OctetString()).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: aclL2RuleFilterTimeRange.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclL2RuleFilterTimeRange.setDescription('ACL L2 Filter Time Range')NEWLINEaclL2RuleVlanIdMask = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 2, 1, 1, 17), OctetString().clone(hexValue="FFFF")).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aclL2RuleVlanIdMask.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclL2RuleVlanIdMask.setDescription("Vlan Id to be filtered. In case of Provider bridges, This Vlan Id will be treated as customer Vlan Id. By Default, the value will be '-1', which means the rule don't care this condition.")NEWLINEaclL2RuleStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 2, 1, 1, 99), RowStatus()).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: aclL2RuleStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclL2RuleStatus.setDescription("This object indicates the status of this entry. An entry is created in this table when this object is SET to 'createAndWait'. The entry in this table is used when the status of this object is SET 'active'. The entry in this table is not used when this object is SET 'notInService'. An entry created in this table is be deleted when this object is SET 'destroy'.")NEWLINEaclL3Rule = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 3))NEWLINEaclL3RuleTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 3, 1), )NEWLINEif mibBuilder.loadTexts: aclL3RuleTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclL3RuleTable.setDescription(' A table to configure L3 filter rules in the system. ')NEWLINEaclL3RuleEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 3, 1, 1), ).setIndexNames((0, "DES-1210-28MEbx", "aclL3RuleProfileNo"), (0, "DES-1210-28MEbx", "aclL3RuleAccessID"))NEWLINEif mibBuilder.loadTexts: aclL3RuleEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclL3RuleEntry.setDescription(' Each entry in this table is a L3 filter rule. Index to the table is L3 filter number and Profile ID.')NEWLINEaclL3RuleAccessID = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 3, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 250))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: aclL3RuleAccessID.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclL3RuleAccessID.setDescription('L3 Filter rule ID. 0 means auto assign.')NEWLINEaclL3RuleProfileNo = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 3, 1, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 50))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: aclL3RuleProfileNo.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclL3RuleProfileNo.setDescription('The Profile ID which this rule join.')NEWLINEaclL3RuleProtocol = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 3, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 6, 17))).clone(namedValues=NamedValues(("icmp", 1), ("igmp", 2), ("tcp", 6), ("udp", 17)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aclL3RuleProtocol.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclL3RuleProtocol.setDescription(' The type of protocol to be checked against the packet.')NEWLINEaclL3RuleProtocolMask = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 3, 1, 1, 4), OctetString().clone(hexValue="FF")).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: aclL3RuleProtocolMask.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclL3RuleProtocolMask.setDescription("The IP protocol mask. This field is read-only and copy from it's Profile setting. It will work with the other field,aclL3RuleProtocol, to caculate a range of IP protocol which is really care. The value is in HEX format. ")NEWLINEaclL3RuleICMPMessageType = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 3, 1, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 255)).clone(-1)).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aclL3RuleICMPMessageType.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclL3RuleICMPMessageType.setDescription(" The message type to be checked against the packet. If the message type matches with the packet, then the packet will be dropped / allowed based on the action set in aclL3RuleAction. The default value is '-1',which means the rule don't care this condition. Some ICMP message types are: echoReply(0), destinationUnreachable(3), sourceQuench(4), redirect(5), echoRequest(8), timeExceeded(11), parameterProblem(12), timestampRequest(13), timestampReply(14), informationRequest(15), informationReply(16), addressMaskRequest(17), addressMaskReply (18), ")NEWLINEaclL3RuleICMPMessageCode = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 3, 1, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 255)).clone(-1)).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aclL3RuleICMPMessageCode.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclL3RuleICMPMessageCode.setDescription(" The message code to be checked against the packet. If the packet matches with the message code, then the packet will be dropped / allowed based on the action set in aclL3RuleAction. The default value is '-1', which means the rule don't care this condition. Some ICMP message codes are : networkUnreachable(0), hostUnreachable(1), protocolUnreachable(2), portUnreachable(3), fragmentNeed(4), sourceRouteFail(5), destNetworkUnknown(6), destHostUnknown(7), srcHostIsolated(8), destNetworkAdminProhibited(9), destHostAdminProhibited(10), networkUnreachableTOS(11), hostUnreachableTOS(12), ")NEWLINEaclL3RuleDstIpAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 3, 1, 1, 7), IpAddress().clone(hexValue="00000000")).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aclL3RuleDstIpAddr.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclL3RuleDstIpAddr.setDescription("Destination IP address to be matched with the packet. The default value will be zero, which means the rule don't care this condition.")NEWLINEaclL3RuleSrcIpAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 3, 1, 1, 8), IpAddress().clone(hexValue="00000000")).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aclL3RuleSrcIpAddr.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclL3RuleSrcIpAddr.setDescription("Source IP address to be matched with the packet. The default value will be zero, which means the rule don't care this condition.")NEWLINEaclL3RuleDstIpAddrMask = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 3, 1, 1, 9), IpAddress().clone(hexValue="FFFFFFFF")).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: aclL3RuleDstIpAddrMask.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclL3RuleDstIpAddrMask.setDescription("The IP subnet mask for Destination IP address. This field is read-only and copy from it's Profile setting. ")NEWLINEaclL3RuleSrcIpAddrMask = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 3, 1, 1, 10), IpAddress().clone(hexValue="FFFFFFFF")).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: aclL3RuleSrcIpAddrMask.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclL3RuleSrcIpAddrMask.setDescription("The IP subnet mask for Source IP address. This field is read-only and copy from it's Profile setting. ")NEWLINEaclL3RuleTcpUdpDstPort = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 3, 1, 1, 11), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 65535)).clone(-1)).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aclL3RuleTcpUdpDstPort.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclL3RuleTcpUdpDstPort.setDescription("The TCP / UDP destination port. The default value is -1, which means the rule don't care this condition.")NEWLINEaclL3RuleTcpUdpSrcPort = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 3, 1, 1, 12), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 65535)).clone(-1)).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aclL3RuleTcpUdpSrcPort.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclL3RuleTcpUdpSrcPort.setDescription("The TCP / UDP source port. The default value is -1, which means the rule don't care this condition.")NEWLINEaclL3RuleTcpUdpDstPortMask = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 3, 1, 1, 13), OctetString()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: aclL3RuleTcpUdpDstPortMask.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclL3RuleTcpUdpDstPortMask.setDescription("The TCP / UDP Destination port Mask. This field is read-only and copy from it's Profile setting. ")NEWLINEaclL3RuleTcpUdpSrcPortMask = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 3, 1, 1, 14), OctetString()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: aclL3RuleTcpUdpSrcPortMask.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclL3RuleTcpUdpSrcPortMask.setDescription("The TCP / UDP Source port Mask. This field is read-only and copy from it's Profile setting. ")NEWLINEaclL3RuleTcpAckBit = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 3, 1, 1, 15), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(-1, 1, 2))).clone(namedValues=NamedValues(("dont-care", -1), ("establish", 1), ("notEstablish", 2))).clone('dont-care')).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: aclL3RuleTcpAckBit.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclL3RuleTcpAckBit.setDescription(" The TCP ACK bit to be checked against the packet. The default value is 'dont_care'(-1), which means the rule don't care this condition.")NEWLINEaclL3RuleTcpRstBit = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 3, 1, 1, 16), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(-1, 1, 2))).clone(namedValues=NamedValues(("dont-care", -1), ("establish", 1), ("notEstablish", 2))).clone('dont-care')).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: aclL3RuleTcpRstBit.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclL3RuleTcpRstBit.setDescription(" The TCP RST bit to be checked against the packet. The default value is 'dont_care'(-1), which means the rule don't care this condition.")NEWLINEaclL3RuleTcpUrgBit = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 3, 1, 1, 17), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(-1, 1, 2))).clone(namedValues=NamedValues(("dont-care", -1), ("establish", 1), ("notEstablish", 2))).clone('dont-care')).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: aclL3RuleTcpUrgBit.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclL3RuleTcpUrgBit.setDescription(" The TCP Urg bit to be checked against the packet. The default value is 'dont_care'(-1), which means the rule don't care this condition.")NEWLINEaclL3RuleTcpPshBit = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 3, 1, 1, 18), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(-1, 1, 2))).clone(namedValues=NamedValues(("dont-care", -1), ("establish", 1), ("notEstablish", 2))).clone('dont-care')).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: aclL3RuleTcpPshBit.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclL3RuleTcpPshBit.setDescription(" The TCP Psh bit to be checked against the packet. The default value is 'dont_care'(-1). which means the rule don't care this condition.")NEWLINEaclL3RuleTcpSynBit = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 3, 1, 1, 19), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(-1, 1, 2))).clone(namedValues=NamedValues(("dont-care", -1), ("establish", 1), ("notEstablish", 2))).clone('dont-care')).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: aclL3RuleTcpSynBit.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclL3RuleTcpSynBit.setDescription(" The TCP Syn bit to be checked against the packet. The default value is 'dont_care'(-1), which means the rule don't care this condition.")NEWLINEaclL3RuleTcpFinBit = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 3, 1, 1, 20), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(-1, 1, 2))).clone(namedValues=NamedValues(("dont-care", -1), ("establish", 1), ("notEstablish", 2))).clone('dont-care')).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: aclL3RuleTcpFinBit.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclL3RuleTcpFinBit.setDescription(" The TCP Fin bit to be checked against the packet. The default value is 'dont_care'(-1), which means the rule don't care this condition.")NEWLINEaclL3RuleDscp = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 3, 1, 1, 21), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 63)).clone(-1)).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: aclL3RuleDscp.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclL3RuleDscp.setDescription(" The IP Dscp value to be checked against the packet. A default value is '-1', which means the rule don't care this condition.")NEWLINEaclL3RuleTos = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 3, 1, 1, 22), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 7)).clone(-1)).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: aclL3RuleTos.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclL3RuleTos.setDescription(" The IP Dscp value to be checked against the packet. A default value is '-1', which means the rule don't care this condition.")NEWLINEaclL3RuleIgmpType = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 3, 1, 1, 23), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 255)).clone(-1)).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aclL3RuleIgmpType.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclL3RuleIgmpType.setDescription(" The IGMP Type to be checked against the packet.A default value is '-1', which means the rule don't care this condition.")NEWLINEaclL3RulePortList = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 3, 1, 1, 24), PortList()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aclL3RulePortList.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclL3RulePortList.setDescription('Specifies the complete set of ports over which if the packet arrives this filter rule will be applicable.')NEWLINEaclL3RuleAction = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 3, 1, 1, 25), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 5, 6, 7))).clone(namedValues=NamedValues(("allow", 1), ("drop", 2), ("mirror", 3), ("replaceDSCP", 5), ("replace1P", 6), ("replaceQueue", 7))).clone('allow')).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aclL3RuleAction.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclL3RuleAction.setDescription('Specifies the action to be taken on the packet if the filter rule matches.')NEWLINEaclL3RuleRateLimit = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 3, 1, 1, 26), Unsigned32()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aclL3RuleRateLimit.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclL3RuleRateLimit.setDescription('Rate limit for matched packet.')NEWLINEaclL3RuleReplaceDSCP = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 3, 1, 1, 27), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 63))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aclL3RuleReplaceDSCP.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclL3RuleReplaceDSCP.setDescription('ReplaceDSCP for matched packet.')NEWLINEaclL3RuleReplace1P = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 3, 1, 1, 28), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 7))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aclL3RuleReplace1P.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclL3RuleReplace1P.setDescription('ReplaceDSCP for matched packet.')NEWLINEaclL3RuleReplaceQueue = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 3, 1, 1, 29), Integer32()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aclL3RuleReplaceQueue.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclL3RuleReplaceQueue.setDescription('Acl L3 Rule Replace Queue.')NEWLINEaclL3RuleFilterTimeRange = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 3, 1, 1, 30), OctetString()).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: aclL3RuleFilterTimeRange.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclL3RuleFilterTimeRange.setDescription('ACL L3 Filter Time Range')NEWLINEaclL3RuleStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 3, 1, 1, 99), RowStatus()).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: aclL3RuleStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclL3RuleStatus.setDescription("This object indicates the status of this entry. An entry is created in this table when this object is SET to 'createAndWait'. The entry in this table is used when the status of this object is SET 'active'. The entry in this table is not used when this object is SET 'notInService'. An entry created in this table is be deleted when this object is SET 'destroy'.")NEWLINEaclv6L3RuleTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 3, 2), )NEWLINEif mibBuilder.loadTexts: aclv6L3RuleTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclv6L3RuleTable.setDescription(' A table to configure L3 filter rules in the system. ')NEWLINEaclv6L3RuleEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 3, 2, 1), ).setIndexNames((0, "DES-1210-28MEbx", "aclv6L3RuleProfileNo"), (0, "DES-1210-28MEbx", "aclv6L3RuleAccessID"))NEWLINEif mibBuilder.loadTexts: aclv6L3RuleEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclv6L3RuleEntry.setDescription(' Each entry in this table is a L3 filter rule. Index to the table is L3 filter number and Profile ID.')NEWLINEaclv6L3RuleAccessID = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 3, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 250))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: aclv6L3RuleAccessID.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclv6L3RuleAccessID.setDescription('L3 Filter rule ID. 0 means auto assign.')NEWLINEaclv6L3RuleProfileNo = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 3, 2, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 50))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: aclv6L3RuleProfileNo.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclv6L3RuleProfileNo.setDescription('The Profile ID which this rule join.')NEWLINEaclv6L3RuleProtocol = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 3, 2, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(6, 17, 58))).clone(namedValues=NamedValues(("tcp", 6), ("udp", 17), ("icmpv6", 58)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aclv6L3RuleProtocol.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclv6L3RuleProtocol.setDescription(' The type of protocol to be checked against the packet.')NEWLINEaclv6L3RuleProtocolMask = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 3, 2, 1, 4), OctetString().clone(hexValue="FF")).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: aclv6L3RuleProtocolMask.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclv6L3RuleProtocolMask.setDescription("The IP protocol mask. This field is read-only and copy from it's Profile setting. It will work with the other field,aclL3RuleProtocol, to caculate a range of IP protocol which is really care. The value is in HEX format. ")NEWLINEaclv6L3RuleICMPMessageType = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 3, 2, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 255)).clone(-1)).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aclv6L3RuleICMPMessageType.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclv6L3RuleICMPMessageType.setDescription(" The message type to be checked against the packet. If the message type matches with the packet, then the packet will be dropped / allowed based on the action set in aclL3RuleAction. The default value is '-1',which means the rule don't care this condition. Some ICMP message types are: echoReply(0), destinationUnreachable(3), sourceQuench(4), redirect(5), echoRequest(8), timeExceeded(11), parameterProblem(12), timestampRequest(13), timestampReply(14), informationRequest(15), informationReply(16), addressMaskRequest(17), addressMaskReply (18), ")NEWLINEaclv6L3RuleICMPMessageCode = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 3, 2, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 255)).clone(-1)).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aclv6L3RuleICMPMessageCode.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclv6L3RuleICMPMessageCode.setDescription(" The message code to be checked against the packet. If the packet matches with the message code, then the packet will be dropped / allowed based on the action set in aclL3RuleAction. The default value is '-1', which means the rule don't care this condition. Some ICMP message codes are : networkUnreachable(0), hostUnreachable(1), protocolUnreachable(2), portUnreachable(3), fragmentNeed(4), sourceRouteFail(5), destNetworkUnknown(6), destHostUnknown(7), srcHostIsolated(8), destNetworkAdminProhibited(9), destHostAdminProhibited(10), networkUnreachableTOS(11), hostUnreachableTOS(12), ")NEWLINEaclv6L3RuleDstIpAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 3, 2, 1, 7), Ipv6Address().clone(hexValue="00000000")).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aclv6L3RuleDstIpAddr.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclv6L3RuleDstIpAddr.setDescription("Destination IP address to be matched with the packet. The default value will be zero, which means the rule don't care this condition.")NEWLINEaclv6L3RuleSrcIpAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 3, 2, 1, 8), Ipv6Address().clone(hexValue="00000000")).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aclv6L3RuleSrcIpAddr.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclv6L3RuleSrcIpAddr.setDescription("Source IP address to be matched with the packet. The default value will be zero, which means the rule don't care this condition.")NEWLINEaclv6L3RuleDstIpAddrMask = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 3, 2, 1, 9), Ipv6Address().clone(hexValue="FFFFFFFF")).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: aclv6L3RuleDstIpAddrMask.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclv6L3RuleDstIpAddrMask.setDescription("The IP subnet mask for Destination IP address. This field is read-only and copy from it's Profile setting. ")NEWLINEaclv6L3RuleSrcIpAddrMask = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 3, 2, 1, 10), Ipv6Address().clone(hexValue="FFFFFFFF")).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: aclv6L3RuleSrcIpAddrMask.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclv6L3RuleSrcIpAddrMask.setDescription("The IP subnet mask for Source IP address. This field is read-only and copy from it's Profile setting. ")NEWLINEaclv6L3RuleTcpUdpDstPort = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 3, 2, 1, 11), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 65535)).clone(-1)).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aclv6L3RuleTcpUdpDstPort.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclv6L3RuleTcpUdpDstPort.setDescription("The TCP / UDP destination port. The default value is -1, which means the rule don't care this condition.")NEWLINEaclv6L3RuleTcpUdpSrcPort = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 3, 2, 1, 12), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 65535)).clone(-1)).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aclv6L3RuleTcpUdpSrcPort.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclv6L3RuleTcpUdpSrcPort.setDescription("The TCP / UDP source port. The default value is -1, which means the rule don't care this condition.")NEWLINEaclv6L3RuleTcpUdpDstPortMask = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 3, 2, 1, 13), OctetString()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: aclv6L3RuleTcpUdpDstPortMask.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclv6L3RuleTcpUdpDstPortMask.setDescription("The TCP / UDP Destination port Mask. This field is read-only and copy from it's Profile setting. ")NEWLINEaclv6L3RuleTcpUdpSrcPortMask = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 3, 2, 1, 14), OctetString()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: aclv6L3RuleTcpUdpSrcPortMask.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclv6L3RuleTcpUdpSrcPortMask.setDescription("The TCP / UDP Source port Mask. This field is read-only and copy from it's Profile setting. ")NEWLINEaclv6L3RuleTcpAckBit = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 3, 2, 1, 15), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(-1, 1, 2))).clone(namedValues=NamedValues(("dont-care", -1), ("establish", 1), ("notEstablish", 2))).clone('dont-care')).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: aclv6L3RuleTcpAckBit.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclv6L3RuleTcpAckBit.setDescription(" The TCP ACK bit to be checked against the packet. The default value is 'dont_care'(-1), which means the rule don't care this condition.")NEWLINEaclv6L3RuleTcpRstBit = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 3, 2, 1, 16), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(-1, 1, 2))).clone(namedValues=NamedValues(("dont-care", -1), ("establish", 1), ("notEstablish", 2))).clone('dont-care')).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: aclv6L3RuleTcpRstBit.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclv6L3RuleTcpRstBit.setDescription(" The TCP RST bit to be checked against the packet. The default value is 'dont_care'(-1), which means the rule don't care this condition.")NEWLINEaclv6L3RuleTcpUrgBit = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 3, 2, 1, 17), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(-1, 1, 2))).clone(namedValues=NamedValues(("dont-care", -1), ("establish", 1), ("notEstablish", 2))).clone('dont-care')).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: aclv6L3RuleTcpUrgBit.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclv6L3RuleTcpUrgBit.setDescription(" The TCP Urg bit to be checked against the packet. The default value is 'dont_care'(-1), which means the rule don't care this condition.")NEWLINEaclv6L3RuleTcpPshBit = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 3, 2, 1, 18), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(-1, 1, 2))).clone(namedValues=NamedValues(("dont-care", -1), ("establish", 1), ("notEstablish", 2))).clone('dont-care')).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: aclv6L3RuleTcpPshBit.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclv6L3RuleTcpPshBit.setDescription(" The TCP Psh bit to be checked against the packet. The default value is 'dont_care'(-1). which means the rule don't care this condition.")NEWLINEaclv6L3RuleTcpSynBit = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 3, 2, 1, 19), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(-1, 1, 2))).clone(namedValues=NamedValues(("dont-care", -1), ("establish", 1), ("notEstablish", 2))).clone('dont-care')).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: aclv6L3RuleTcpSynBit.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclv6L3RuleTcpSynBit.setDescription(" The TCP Syn bit to be checked against the packet. The default value is 'dont_care'(-1), which means the rule don't care this condition.")NEWLINEaclv6L3RuleTcpFinBit = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 3, 2, 1, 20), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(-1, 1, 2))).clone(namedValues=NamedValues(("dont-care", -1), ("establish", 1), ("notEstablish", 2))).clone('dont-care')).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: aclv6L3RuleTcpFinBit.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclv6L3RuleTcpFinBit.setDescription(" The TCP Fin bit to be checked against the packet. The default value is 'dont_care'(-1), which means the rule don't care this condition.")NEWLINEaclv6L3RuleTrafficClass = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 3, 2, 1, 21), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 63)).clone(-1)).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: aclv6L3RuleTrafficClass.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclv6L3RuleTrafficClass.setDescription(" The IP Dscp value to be checked against the packet. A default value is '-1', which means the rule don't care this condition.")NEWLINEaclv6L3RulePortList = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 3, 2, 1, 23), PortList()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aclv6L3RulePortList.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclv6L3RulePortList.setDescription('Specifies the complete set of ports over which if the packet arrives this filter rule will be applicable.')NEWLINEaclv6L3RuleAction = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 3, 2, 1, 24), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 5, 6, 7))).clone(namedValues=NamedValues(("allow", 1), ("drop", 2), ("mirror", 3), ("replaceDSCP", 5), ("replace1P", 6), ("replaceQueue", 7))).clone('allow')).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aclv6L3RuleAction.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclv6L3RuleAction.setDescription('Specifies the action to be taken on the packet if the filter rule matches.')NEWLINEaclv6L3RuleRateLimit = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 3, 2, 1, 25), Unsigned32()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aclv6L3RuleRateLimit.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclv6L3RuleRateLimit.setDescription('Rate limit for matched packet.')NEWLINEaclv6L3RuleReplaceDSCP = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 3, 2, 1, 26), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 63))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aclv6L3RuleReplaceDSCP.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclv6L3RuleReplaceDSCP.setDescription('Replace DSCP for matched packet.')NEWLINEaclv6L3RuleReplace1P = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 3, 2, 1, 27), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 7))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aclv6L3RuleReplace1P.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclv6L3RuleReplace1P.setDescription('Replace DSCP for matched packet.')NEWLINEaclv6L3RuleReplaceQueue = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 3, 2, 1, 28), Integer32()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aclv6L3RuleReplaceQueue.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclv6L3RuleReplaceQueue.setDescription('Acl IPV6 L3 Rule Replace Queue.')NEWLINEaclv6L3RuleFilterTimeRange = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 3, 2, 1, 29), OctetString()).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: aclv6L3RuleFilterTimeRange.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclv6L3RuleFilterTimeRange.setDescription('ACL IPV6 L3 Filter Time Range')NEWLINEaclv6L3RuleStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 3, 2, 1, 99), RowStatus()).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: aclv6L3RuleStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclv6L3RuleStatus.setDescription("This object indicates the status of this entry. An entry is created in this table when this object is SET to 'createAndWait'. The entry in this table is used when the status of this object is SET 'active'. The entry in this table is not used when this object is SET 'notInService'. An entry created in this table is be deleted when this object is SET 'destroy'.")NEWLINEaclPacketRule = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 4))NEWLINEaclPacketRuleTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 4, 1), )NEWLINEif mibBuilder.loadTexts: aclPacketRuleTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclPacketRuleTable.setDescription('A table to configure Packet Content filter rules in the system.')NEWLINEaclPacketRuleEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 4, 1, 1), ).setIndexNames((0, "DES-1210-28MEbx", "aclPacketProfileID"), (0, "DES-1210-28MEbx", "aclPacketAccessID"))NEWLINEif mibBuilder.loadTexts: aclPacketRuleEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclPacketRuleEntry.setDescription('Each entry in this table is a Packet filter rule. Index to the table is the Packet filter number and Profile ID.')NEWLINEaclPacketAccessID = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 4, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 250))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: aclPacketAccessID.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclPacketAccessID.setDescription('Packet Filter rule ID. 0 means auto assign.')NEWLINEaclPacketProfileID = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 4, 1, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 50))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: aclPacketProfileID.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclPacketProfileID.setDescription('ACL Profile ID which this rule join.')NEWLINEaclPacketRuleOffsetValue1 = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 4, 1, 1, 3), OctetString()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aclPacketRuleOffsetValue1.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclPacketRuleOffsetValue1.setDescription('The filter value of Offset 1.')NEWLINEaclPacketRuleOffsetValue2 = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 4, 1, 1, 4), OctetString()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aclPacketRuleOffsetValue2.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclPacketRuleOffsetValue2.setDescription('The filter value of Offset 2.')NEWLINEaclPacketRuleOffsetValue3 = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 4, 1, 1, 5), OctetString()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aclPacketRuleOffsetValue3.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclPacketRuleOffsetValue3.setDescription('The filter value of Offset 3.')NEWLINEaclPacketRuleOffsetValue4 = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 4, 1, 1, 6), OctetString()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aclPacketRuleOffsetValue4.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclPacketRuleOffsetValue4.setDescription('The filter value of Offset 4.')NEWLINEaclPacketRuleInPortList = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 4, 1, 1, 7), PortList()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aclPacketRuleInPortList.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclPacketRuleInPortList.setDescription('Specifies the complete set of ports over which this filter is applied for packets ingress at ports in this list.')NEWLINEaclPacketRuleAction = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 4, 1, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 5, 6, 7))).clone(namedValues=NamedValues(("allow", 1), ("drop", 2), ("mirror", 3), ("replaceDSCP", 5), ("replace1P", 6), ("replaceQueue", 7))).clone('allow')).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aclPacketRuleAction.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclPacketRuleAction.setDescription("Specifies the action to be taken on the packet if the filter rule matches. If the action is 'allow', the packet will be forwarded according to the forwarding rules. If the action is 'drop', the packet will be discarded.")NEWLINEaclPacketRuleRateLimit = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 4, 1, 1, 9), Unsigned32()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aclPacketRuleRateLimit.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclPacketRuleRateLimit.setDescription('Rate limit for matched packet.')NEWLINEaclPacketRuleReplaceDSCP = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 4, 1, 1, 10), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 63))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aclPacketRuleReplaceDSCP.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclPacketRuleReplaceDSCP.setDescription('Replace DSCP for matched packet.')NEWLINEaclPacketRuleReplace1P = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 4, 1, 1, 11), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 7))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aclPacketRuleReplace1P.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclPacketRuleReplace1P.setDescription('Replace 1p for matched packet.')NEWLINEaclPacketRuleReplaceQueue = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 4, 1, 1, 12), Integer32()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aclPacketRuleReplaceQueue.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclPacketRuleReplaceQueue.setDescription('Acl Rule Replace Queue.')NEWLINEaclPacketRuleFilterTimeRange = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 4, 1, 1, 13), OctetString()).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: aclPacketRuleFilterTimeRange.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclPacketRuleFilterTimeRange.setDescription('Acl Filter Time Range')NEWLINEaclPacketRuleOffsetValue1Mask = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 4, 1, 1, 14), OctetString().clone(hexValue="FFFF")).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aclPacketRuleOffsetValue1Mask.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclPacketRuleOffsetValue1Mask.setDescription('The filter Mask of Offset 1.')NEWLINEaclPacketRuleOffsetValue2Mask = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 4, 1, 1, 15), OctetString().clone(hexValue="FFFF")).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aclPacketRuleOffsetValue2Mask.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclPacketRuleOffsetValue2Mask.setDescription('The filter Mask of Offset 2.')NEWLINEaclPacketRuleOffsetValue3Mask = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 4, 1, 1, 16), OctetString().clone(hexValue="FFFF")).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aclPacketRuleOffsetValue3Mask.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclPacketRuleOffsetValue3Mask.setDescription('The filter Mask of Offset 3.')NEWLINEaclPacketRuleOffsetValue4Mask = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 4, 1, 1, 17), OctetString().clone(hexValue="FFFF")).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aclPacketRuleOffsetValue4Mask.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclPacketRuleOffsetValue4Mask.setDescription('The filter Mask of Offset 4.')NEWLINEaclPacketRuleStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 4, 1, 1, 99), RowStatus()).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: aclPacketRuleStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclPacketRuleStatus.setDescription("This object indicates the status of this entry. An entry is created in this table when this object is SET to 'createAndWait'. The entry in this table is used when the status of this object is SET 'active'. The entry in this table is not used when this object is SET 'notInService'. An entry created in this table is be deleted when this object is SET 'destroy'.")NEWLINEaclFlowMeterRule = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 10))NEWLINEaclFlowMeterTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 10, 1), )NEWLINEif mibBuilder.loadTexts: aclFlowMeterTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclFlowMeterTable.setDescription('A table to configure L2 filter rules in the system.')NEWLINEaclFlowMeterEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 10, 1, 1), ).setIndexNames((0, "DES-1210-28MEbx", "aclFlowMeterProfileID"), (0, "DES-1210-28MEbx", "aclFlowMeterAccessID"))NEWLINEif mibBuilder.loadTexts: aclFlowMeterEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclFlowMeterEntry.setDescription('Each entry in this table is a L2 filter rule. Index to the table is the L2 filter number and Profile ID.')NEWLINEaclFlowMeterProfileID = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 10, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 50))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: aclFlowMeterProfileID.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclFlowMeterProfileID.setDescription('ACL Profile ID which this flow meter join.')NEWLINEaclFlowMeterAccessID = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 10, 1, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 250))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: aclFlowMeterAccessID.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclFlowMeterAccessID.setDescription('ACL Access ID which this flow meter join.')NEWLINEaclFlowMeterRate = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 10, 1, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(64, 1024000))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aclFlowMeterRate.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclFlowMeterRate.setDescription('The rate limiter of meter.')NEWLINEaclFlowMeterBurstSize = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 10, 1, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 1016))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aclFlowMeterBurstSize.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclFlowMeterBurstSize.setDescription('The burst size of meter.')NEWLINEaclFlowMeterReplaceDscp = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 10, 1, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 63))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aclFlowMeterReplaceDscp.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclFlowMeterReplaceDscp.setDescription('Replace DSCP for matched out-band packets when aclFlowMeterAction is replace DSCP.')NEWLINEaclFlowMeterAction = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 10, 1, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(2, 5))).clone(namedValues=NamedValues(("drop", 2), ("replaceDSCP", 5))).clone('drop')).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aclFlowMeterAction.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclFlowMeterAction.setDescription("Specifies the action to be taken on the out-band packet if the filter rule matches. If the action is 'drop', the packet will be discarded.")NEWLINEaclFlowMeterStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 15, 10, 1, 1, 99), RowStatus()).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: aclFlowMeterStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: aclFlowMeterStatus.setDescription("This object indicates the status of this entry. An entry is created in this table when this object is SET to 'createAndWait'. The entry in this table is used when the status of this object is SET 'active'. The entry in this table is not used when this object is SET 'notInService'. An entry created in this table is be deleted when this object is SET 'destroy'.")NEWLINEcpuFilterProfile = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 1))NEWLINEipv4cpuFilterProfileTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 1, 1), )NEWLINEif mibBuilder.loadTexts: ipv4cpuFilterProfileTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: ipv4cpuFilterProfileTable.setDescription(' A table to CPUInterfaceFilter profile . ')NEWLINEipv4cpuFilterProfileEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 1, 1, 1), ).setIndexNames((0, "DES-1210-28MEbx", "ipv4cpuFilterProfileNo"))NEWLINEif mibBuilder.loadTexts: ipv4cpuFilterProfileEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: ipv4cpuFilterProfileEntry.setDescription(' Each entry in this table is a CPUInterfaceFilter profile. Index to the table is CPUInterfaceFilter profile ID. ')NEWLINEipv4cpuFilterProfileNo = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 1, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 3))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: ipv4cpuFilterProfileNo.setStatus('current')NEWLINEif mibBuilder.loadTexts: ipv4cpuFilterProfileNo.setDescription('The CPUInterfaceFilter Profile ID. The ID 1 to 50 is user-defined CPUInterfaceFilter, and the ID more than 50 is reserved for system-defined CPUInterfaceFilter. The user only allow to create user-defined CPUInterfaceFilter ID. And system-defined CPUInterfaceFilter is read only.')NEWLINEipv4cpuFilterProfileType = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 1, 1, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 11))).clone(namedValues=NamedValues(("l2", 1), ("l3", 2), ("l3v6", 11)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ipv4cpuFilterProfileType.setStatus('current')NEWLINEif mibBuilder.loadTexts: ipv4cpuFilterProfileType.setDescription('The CPUInterfaceFilter Profile type, possible value are l2 (1) - for MAC-based rule, l3 (2) - for IPv4-based rule, l3v6 (11) - for IPv6-based rule ')NEWLINEipv4cpuFilterProfileRuleCount = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 1, 1, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: ipv4cpuFilterProfileRuleCount.setStatus('current')NEWLINEif mibBuilder.loadTexts: ipv4cpuFilterProfileRuleCount.setDescription('The number of rules in this profile.')NEWLINEipv4cpuFilterProfileMask = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 1, 1, 1, 4), OctetString()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ipv4cpuFilterProfileMask.setStatus('current')NEWLINEif mibBuilder.loadTexts: ipv4cpuFilterProfileMask.setDescription('Indicate which field want to care in the packet. Turn on the following bits to select the following items Type Item BIT ------------------------------------------ L2 DST_MAC 0 (LSB) L2 SRC_MAC 1 L2 VID 2 L2 8021P_PRIORITY 3 L2 ETHER_TYPE 4 L3 DSCP 5 L3 ICMP_TYPE 6 L3 ICMP_CODE 7 L3 IGMP_TYPE 8 L3 DST_IP 9 L3 SRC_IP 10 L3 DST_PORT 11 L3 SRC_PORT 12 L3 TCPFLAG 13 (MSB) ------------------------------------------- The value is in Hex format. ')NEWLINEipv4cpuFilterProfileDstMacAddrMask = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 1, 1, 1, 5), MacAddress()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ipv4cpuFilterProfileDstMacAddrMask.setStatus('current')NEWLINEif mibBuilder.loadTexts: ipv4cpuFilterProfileDstMacAddrMask.setDescription('The CPUInterfaceFilter Profile destination MAC address mask. If DST_MAC is turn on in cpuFilterProfileMask, it will work with its member rule field,cpuFilterL2RuleDstMacAddr, to caculate a range of MAC address which is really care. ')NEWLINEipv4cpuFilterProfileSrcMacAddrMask = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 1, 1, 1, 6), MacAddress()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ipv4cpuFilterProfileSrcMacAddrMask.setStatus('current')NEWLINEif mibBuilder.loadTexts: ipv4cpuFilterProfileSrcMacAddrMask.setDescription('The CPUInterfaceFilter Profile source MAC address mask. If SRC_MAC is turn on in cpuFilterProfileMask, it will work with its member rule field,cpuFilterL2RuleSrcMacAddr, to caculate a range of MAC address which is really care. ')NEWLINEipv4cpuFilterProfileIPProtocol = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 1, 1, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 6, 17, 255))).clone(namedValues=NamedValues(("none", 0), ("icmp", 1), ("igmp", 2), ("tcp", 6), ("udp", 17), ("ipMask", 255)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ipv4cpuFilterProfileIPProtocol.setStatus('current')NEWLINEif mibBuilder.loadTexts: ipv4cpuFilterProfileIPProtocol.setDescription('Indicate which IP Protocol will be care in this profile. Only profile type is l3 can set the IP protocol. For others, this field will be none. ')NEWLINEipv4cpuFilterProfileIPProtocolMask = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 1, 1, 1, 8), OctetString().clone(hexValue="FF")).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ipv4cpuFilterProfileIPProtocolMask.setStatus('current')NEWLINEif mibBuilder.loadTexts: ipv4cpuFilterProfileIPProtocolMask.setDescription('The CPUInterfaceFilter Profile IP protocol mask. If cpuFilterProfileIPProtocol set to ipMask, this field will be refered. It will work with its member rule field,cpuFilterL3RuleProtocol, to caculate a range of IP protocol which is really care. The value is in HEX format. ')NEWLINEipv4cpuFilterProfileDstIpAddrMask = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 1, 1, 1, 9), IpAddress().clone(hexValue="FFFFFFFF")).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ipv4cpuFilterProfileDstIpAddrMask.setStatus('current')NEWLINEif mibBuilder.loadTexts: ipv4cpuFilterProfileDstIpAddrMask.setDescription("The CPUInterfaceFilter Profile destination IP address mask. If DST_IP is turn on in cpuFilterProfileMask, it will work with its member rule field,cpuFilterL3RuleDstIpAddr, to caculate a range of IP address which is really care. The value is in HEX format, for example: '255.255.255.0' is presented to 'FFFFFF00' ")NEWLINEipv4cpuFilterProfileSrcIpAddrMask = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 1, 1, 1, 10), IpAddress().clone(hexValue="FFFFFFFF")).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ipv4cpuFilterProfileSrcIpAddrMask.setStatus('current')NEWLINEif mibBuilder.loadTexts: ipv4cpuFilterProfileSrcIpAddrMask.setDescription("The CPUInterfaceFilter Profile source IP address mask. If SRC_IP is turn on in cpuFilterProfileMask, it will work with its member rule field,cpuFilterL3RuleSrcIpAddr, to caculate a range of IP address which is really care. The value is in HEX format, for example: '255.255.255.0' is presented to 'FFFFFF00' ")NEWLINEipv4cpuFilterProfileDstPortMask = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 1, 1, 1, 11), OctetString().clone(hexValue="FFFF")).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ipv4cpuFilterProfileDstPortMask.setStatus('current')NEWLINEif mibBuilder.loadTexts: ipv4cpuFilterProfileDstPortMask.setDescription('The CPUInterfaceFilter Profile UDP/TCP destination port mask. If DST_PORT is turn on in cpuFilterProfileMask, it will work with its member rule field,cpuFilterL3RuleTcpUdpDstPort, to caculate a range of destination port which is really care. The value is in HEX format. ')NEWLINEipv4cpuFilterProfileSrcPortMask = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 1, 1, 1, 12), OctetString().clone(hexValue="FFFF")).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ipv4cpuFilterProfileSrcPortMask.setStatus('current')NEWLINEif mibBuilder.loadTexts: ipv4cpuFilterProfileSrcPortMask.setDescription('The CPUInterfaceFilter Profile UDP/TCP source port mask. If SRC_PORT is turn on in cpuFilterProfileMask, it will work with its member rule field,cpuFilterL3RuleTcpUdpSrcPort, to caculate a range of source port which is really care. The value is in HEX format. ')NEWLINEipv4cpuFilterProfileStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 1, 1, 1, 15), RowStatus()).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: ipv4cpuFilterProfileStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: ipv4cpuFilterProfileStatus.setDescription(" This object indicates the status of this entry, can only be set to 'createAndWait','active' and 'destroy'. When the value of the entry status is 'createAndWait', it could be set to 'active' only if the three values of cpuFilterProfileType, cpuFilterProfileMask and ProtocolType are not conflicted. ")NEWLINEcpuFilterProfileTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 1, 2), )NEWLINEif mibBuilder.loadTexts: cpuFilterProfileTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: cpuFilterProfileTable.setDescription(' A table to CPUInterfaceFilter profile . ')NEWLINEcpuFilterProfileEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 1, 2, 1), ).setIndexNames((0, "DES-1210-28MEbx", "cpuFilterProfileNo"))NEWLINEif mibBuilder.loadTexts: cpuFilterProfileEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: cpuFilterProfileEntry.setDescription(' Each entry in this table is a CPUInterfaceFilter profile. Index to the table is CPUInterfaceFilter profile ID. ')NEWLINEcpuFilterProfileNo = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 1, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 3))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: cpuFilterProfileNo.setStatus('current')NEWLINEif mibBuilder.loadTexts: cpuFilterProfileNo.setDescription('The CPUInterfaceFilter Profile ID. The ID 1 to 50 is user-defined CPUInterfaceFilter, and the ID more than 50 is reserved for system-defined CPUInterfaceFilter. The user only allow to create user-defined CPUInterfaceFilter ID. And system-defined CPUInterfaceFilter is read only.')NEWLINEcpuFilterProfileType = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 1, 2, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 11))).clone(namedValues=NamedValues(("l2", 1), ("l3", 2), ("l3v6", 11)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: cpuFilterProfileType.setStatus('current')NEWLINEif mibBuilder.loadTexts: cpuFilterProfileType.setDescription('The CPUInterfaceFilter Profile type, possible value are l2 (1) - for MAC-based rule, l3 (2) - for IPv4-based rule, l3v6 (11) - for IPv6-based rule ')NEWLINEcpuFilterProfileRuleCount = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 1, 2, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: cpuFilterProfileRuleCount.setStatus('current')NEWLINEif mibBuilder.loadTexts: cpuFilterProfileRuleCount.setDescription('The number of rules in this profile.')NEWLINEcpuFilterProfileMask = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 1, 2, 1, 4), OctetString()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: cpuFilterProfileMask.setStatus('current')NEWLINEif mibBuilder.loadTexts: cpuFilterProfileMask.setDescription('Indicate which field want to care in the packet. Turn on the following bits to select the following items Type Item BIT ------------------------------------------ L2 DST_MAC 0 (LSB) L2 SRC_MAC 1 L2 VID 2 L2 8021P_PRIORITY 3 L2 ETHER_TYPE 4 L3 DSCP 5 L3 ICMP_TYPE 6 L3 ICMP_CODE 7 L3 IGMP_TYPE 8 L3 DST_IP 9 L3 SRC_IP 10 L3 DST_PORT 11 L3 SRC_PORT 12 L3 TCPFLAG 13 (MSB) L3 TRAFFIC_CLASS 21 ------------------------------------------- The value is in Hex format. ')NEWLINEcpuFilterProfileDstMacAddrMask = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 1, 2, 1, 5), MacAddress()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: cpuFilterProfileDstMacAddrMask.setStatus('current')NEWLINEif mibBuilder.loadTexts: cpuFilterProfileDstMacAddrMask.setDescription('The CPUInterfaceFilter Profile destination MAC address mask. If DST_MAC is turn on in cpuFilterProfileMask, it will work with its member rule field,cpuFilterL2RuleDstMacAddr, to caculate a range of MAC address which is really care. ')NEWLINEcpuFilterProfileSrcMacAddrMask = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 1, 2, 1, 6), MacAddress()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: cpuFilterProfileSrcMacAddrMask.setStatus('current')NEWLINEif mibBuilder.loadTexts: cpuFilterProfileSrcMacAddrMask.setDescription('The CPUInterfaceFilter Profile source MAC address mask. If SRC_MAC is turn on in cpuFilterProfileMask, it will work with its member rule field,cpuFilterL2RuleSrcMacAddr, to caculate a range of MAC address which is really care. ')NEWLINEcpuFilterProfileIPProtocol = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 1, 2, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 6, 17, 255))).clone(namedValues=NamedValues(("none", 0), ("icmp", 1), ("igmp", 2), ("tcp", 6), ("udp", 17), ("ipMask", 255)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: cpuFilterProfileIPProtocol.setStatus('current')NEWLINEif mibBuilder.loadTexts: cpuFilterProfileIPProtocol.setDescription('Indicate which IP Protocol will be care in this profile. Only profile type is l3 can set the IP protocol. For others, this field will be none. ')NEWLINEcpuFilterProfileIPProtocolMask = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 1, 2, 1, 8), OctetString().clone(hexValue="FF")).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: cpuFilterProfileIPProtocolMask.setStatus('current')NEWLINEif mibBuilder.loadTexts: cpuFilterProfileIPProtocolMask.setDescription('The CPUInterfaceFilter Profile IP protocol mask. If cpuFilterProfileIPProtocol set to ipMask, this field will be refered. It will work with its member rule field,cpuFilterL3RuleProtocol, to caculate a range of IP protocol which is really care. The value is in HEX format. ')NEWLINEcpuFilterProfileDstIpAddrMaskType = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 1, 2, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("iPv4", 1), ("iPv6", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: cpuFilterProfileDstIpAddrMaskType.setStatus('current')NEWLINEif mibBuilder.loadTexts: cpuFilterProfileDstIpAddrMaskType.setDescription('IPv6 Address type.')NEWLINEcpuFilterProfileDstIpAddrMask = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 1, 2, 1, 10), Ipv6Address().clone(hexValue="FFFFFFFF")).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: cpuFilterProfileDstIpAddrMask.setStatus('current')NEWLINEif mibBuilder.loadTexts: cpuFilterProfileDstIpAddrMask.setDescription("The CPUInterfaceFilter Profile destination IP address mask. If DST_IP is turn on in cpuFilterProfileMask, it will work with its member rule field,cpuFilterL3RuleDstIpAddr, to caculate a range of IP address which is really care. The value is in HEX format, for example: '255.255.255.0' is presented to 'FFFFFF00' ")NEWLINEcpuFilterProfileSrcIpAddrMaskType = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 1, 2, 1, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("iPv4", 1), ("iPv6", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: cpuFilterProfileSrcIpAddrMaskType.setStatus('current')NEWLINEif mibBuilder.loadTexts: cpuFilterProfileSrcIpAddrMaskType.setDescription('IPv6 Address type.')NEWLINEcpuFilterProfileSrcIpAddrMask = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 1, 2, 1, 12), Ipv6Address().clone(hexValue="FFFFFFFF")).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: cpuFilterProfileSrcIpAddrMask.setStatus('current')NEWLINEif mibBuilder.loadTexts: cpuFilterProfileSrcIpAddrMask.setDescription("The CPUInterfaceFilter Profile source IP address mask. If SRC_IP is turn on in cpuFilterProfileMask, it will work with its member rule field,cpuFilterL3RuleSrcIpAddr, to caculate a range of IP address which is really care. The value is in HEX format, for example: '255.255.255.0' is presented to 'FFFFFF00' ")NEWLINEcpuFilterProfileDstPortMask = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 1, 2, 1, 13), OctetString().clone(hexValue="FFFF")).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: cpuFilterProfileDstPortMask.setStatus('current')NEWLINEif mibBuilder.loadTexts: cpuFilterProfileDstPortMask.setDescription('The CPUInterfaceFilter Profile UDP/TCP destination port mask. If DST_PORT is turn on in cpuFilterProfileMask, it will work with its member rule field,cpuFilterL3RuleTcpUdpDstPort, to caculate a range of destination port which is really care. The value is in HEX format. ')NEWLINEcpuFilterProfileSrcPortMask = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 1, 2, 1, 14), OctetString().clone(hexValue="FFFF")).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: cpuFilterProfileSrcPortMask.setStatus('current')NEWLINEif mibBuilder.loadTexts: cpuFilterProfileSrcPortMask.setDescription('The CPUInterfaceFilter Profile UDP/TCP source port mask. If SRC_PORT is turn on in cpuFilterProfileMask, it will work with its member rule field,cpuFilterL3RuleTcpUdpSrcPort, to caculate a range of source port which is really care. The value is in HEX format. ')NEWLINEcpuFilterProfileStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 1, 2, 1, 15), RowStatus()).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: cpuFilterProfileStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: cpuFilterProfileStatus.setDescription(" This object indicates the status of this entry, can only be set to 'createAndWait','active' and 'destroy'. When the value of the entry status is 'createAndWait', it could be set to 'active' only if the three values of cpuFilterProfileType, cpuFilterProfileMask and ProtocolType are not conflicted. ")NEWLINEcpuFilterL2Rule = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 2))NEWLINEcpuFilterL2RuleTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 2, 1), )NEWLINEif mibBuilder.loadTexts: cpuFilterL2RuleTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: cpuFilterL2RuleTable.setDescription('A table to configure L2 filter rules in the system.')NEWLINEcpuFilterL2RuleEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 2, 1, 1), ).setIndexNames((0, "DES-1210-28MEbx", "cpuFilterL2ProfileID"), (0, "DES-1210-28MEbx", "cpuFilterL2AccessID"))NEWLINEif mibBuilder.loadTexts: cpuFilterL2RuleEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: cpuFilterL2RuleEntry.setDescription('Each entry in this table is a L2 filter rule. Index to the table is the L2 filter number and Profile ID.')NEWLINEcpuFilterL2ProfileID = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 2, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 3))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: cpuFilterL2ProfileID.setStatus('current')NEWLINEif mibBuilder.loadTexts: cpuFilterL2ProfileID.setDescription('L2 Filter rule ID.')NEWLINEcpuFilterL2AccessID = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 2, 1, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 5)).clone(1)).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: cpuFilterL2AccessID.setStatus('current')NEWLINEif mibBuilder.loadTexts: cpuFilterL2AccessID.setDescription('CPUInterfaceFilter Profile ID which this rule join.')NEWLINEcpuFilterL2RuleEtherType = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 2, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(-1, -1), ValueRangeConstraint(1501, 65535), )).clone(-1)).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: cpuFilterL2RuleEtherType.setStatus('current')NEWLINEif mibBuilder.loadTexts: cpuFilterL2RuleEtherType.setDescription("The value in the Type/Len field of a frame that will be matched to trigger this filter. The default value of this object is '-1', which means the rule don't care this condition.")NEWLINEcpuFilterL2RuleDstMacAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 2, 1, 1, 4), MacAddress()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: cpuFilterL2RuleDstMacAddr.setStatus('current')NEWLINEif mibBuilder.loadTexts: cpuFilterL2RuleDstMacAddr.setDescription("Destination MAC address to be matched with the packet. By Default, the Destination Mac Address will be zero,which means the rule don't care this condition.")NEWLINEcpuFilterL2RuleSrcMacAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 2, 1, 1, 5), MacAddress()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: cpuFilterL2RuleSrcMacAddr.setStatus('current')NEWLINEif mibBuilder.loadTexts: cpuFilterL2RuleSrcMacAddr.setDescription("Source MAC address to be matched with the packet. By Default, the Source Mac Address will be zero, which means the rule don't care this condition.. address")NEWLINEcpuFilterL2RuleVlanId = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 2, 1, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 4094)).clone(-1)).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: cpuFilterL2RuleVlanId.setStatus('current')NEWLINEif mibBuilder.loadTexts: cpuFilterL2RuleVlanId.setDescription("Vlan Id to be filtered. In case of Provider bridges, This Vlan Id will be treated as customer Vlan Id. By Default, the value will be '-1', which means the rule don't care this condition.")NEWLINEcpuFilterL2Rule1pPriority = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 2, 1, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 7)).clone(-1)).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: cpuFilterL2Rule1pPriority.setStatus('current')NEWLINEif mibBuilder.loadTexts: cpuFilterL2Rule1pPriority.setDescription("802.1p priority to be matched with the packet. By Default, the value will be '-1', which means the rule don't care this condition.")NEWLINEcpuFilterL2RuleDstMacAddrMask = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 2, 1, 1, 8), MacAddress()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: cpuFilterL2RuleDstMacAddrMask.setStatus('current')NEWLINEif mibBuilder.loadTexts: cpuFilterL2RuleDstMacAddrMask.setDescription("The MAC address Mask work for Destination MAC address. This field is read-only and copy from it's Profile setting.")NEWLINEcpuFilterL2RuleSrcMacAddrMask = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 2, 1, 1, 9), MacAddress()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: cpuFilterL2RuleSrcMacAddrMask.setStatus('current')NEWLINEif mibBuilder.loadTexts: cpuFilterL2RuleSrcMacAddrMask.setDescription("The MAC address Mask work for Source MAC address. This field is read-only and copy from it's Profile setting.")NEWLINEcpuFilterL2RuleInPortList = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 2, 1, 1, 10), PortList()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: cpuFilterL2RuleInPortList.setStatus('current')NEWLINEif mibBuilder.loadTexts: cpuFilterL2RuleInPortList.setDescription('Specifies the complete set of ports over which this filter is applied for packets ingress at ports in this list.')NEWLINEcpuFilterL2RuleAction = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 2, 1, 1, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("allow", 1), ("drop", 2))).clone('allow')).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: cpuFilterL2RuleAction.setStatus('current')NEWLINEif mibBuilder.loadTexts: cpuFilterL2RuleAction.setDescription("Specifies the action to be taken on the packet if the filter rule matches. If the action is 'allow', the packet will be forwarded according to the forwarding rules. If the action is 'drop', the packet will be discarded.")NEWLINEcpuFilterL2RuleStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 2, 1, 1, 14), RowStatus()).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: cpuFilterL2RuleStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: cpuFilterL2RuleStatus.setDescription("This object indicates the status of this entry. An entry is created in this table when this object is SET to 'createAndWait'. The entry in this table is used when the status of this object is SET 'active'. The entry in this table is not used when this object is SET 'notInService'. An entry created in this table is be deleted when this object is SET 'destroy'.")NEWLINEcpuFilterL3Rule = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 3))NEWLINEcpuFilterL3RuleTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 3, 1), )NEWLINEif mibBuilder.loadTexts: cpuFilterL3RuleTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: cpuFilterL3RuleTable.setDescription(' A table to configure L3 filter rules in the system. ')NEWLINEcpuFilterL3RuleEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 3, 1, 1), ).setIndexNames((0, "DES-1210-28MEbx", "cpuFilterL3RuleProfileNo"), (0, "DES-1210-28MEbx", "cpuFilterL3RuleAccessID"))NEWLINEif mibBuilder.loadTexts: cpuFilterL3RuleEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: cpuFilterL3RuleEntry.setDescription(' Each entry in this table is a L3 filter rule. Index to the table is L3 filter number and Profile ID.')NEWLINEcpuFilterL3RuleProfileNo = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 3, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 5))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: cpuFilterL3RuleProfileNo.setStatus('current')NEWLINEif mibBuilder.loadTexts: cpuFilterL3RuleProfileNo.setDescription('L3 Filter rule ID.')NEWLINEcpuFilterL3RuleAccessID = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 3, 1, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 3))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: cpuFilterL3RuleAccessID.setStatus('current')NEWLINEif mibBuilder.loadTexts: cpuFilterL3RuleAccessID.setDescription('The Profile ID which this rule join.')NEWLINEcpuFilterL3RuleProtocol = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 3, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 6, 17))).clone(namedValues=NamedValues(("icmp", 1), ("igmp", 2), ("tcp", 6), ("udp", 17)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: cpuFilterL3RuleProtocol.setStatus('current')NEWLINEif mibBuilder.loadTexts: cpuFilterL3RuleProtocol.setDescription(' The type of protocol to be checked against the packet.')NEWLINEcpuFilterL3RuleProtocolMask = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 3, 1, 1, 4), OctetString().clone(hexValue="FF")).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: cpuFilterL3RuleProtocolMask.setStatus('current')NEWLINEif mibBuilder.loadTexts: cpuFilterL3RuleProtocolMask.setDescription("The IP protocol mask. This field is read-only and copy from it's Profile setting. It will work with the other field,cpuFilterL3RuleProtocol, to caculate a range of IP protocol which is really care. The value is in HEX format. ")NEWLINEcpuFilterL3RuleICMPMessageType = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 3, 1, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 255)).clone(-1)).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: cpuFilterL3RuleICMPMessageType.setStatus('current')NEWLINEif mibBuilder.loadTexts: cpuFilterL3RuleICMPMessageType.setDescription(" The message type to be checked against the packet. If the message type matches with the packet, then the packet will be dropped / allowed based on the action set in cpuFilterL3RuleAction. The default value is '-1',which means the rule don't care this condition. Some ICMP message types are: echoReply(0), destinationUnreachable(3), sourceQuench(4), redirect(5), echoRequest(8), timeExceeded(11), parameterProblem(12), timestampRequest(13), timestampReply(14), informationRequest(15), informationReply(16), addressMaskRequest(17), addressMaskReply (18), ")NEWLINEcpuFilterL3RuleICMPMessageCode = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 3, 1, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 255)).clone(-1)).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: cpuFilterL3RuleICMPMessageCode.setStatus('current')NEWLINEif mibBuilder.loadTexts: cpuFilterL3RuleICMPMessageCode.setDescription(" The message code to be checked against the packet. If the packet matches with the message code, then the packet will be dropped / allowed based on the action set in cpuFilterL3RuleAction. The default value is '-1', which means the rule don't care this condition. Some ICMP message codes are : networkUnreachable(0), hostUnreachable(1), protocolUnreachable(2), portUnreachable(3), fragmentNeed(4), sourceRouteFail(5), destNetworkUnknown(6), destHostUnknown(7), srcHostIsolated(8), destNetworkAdminProhibited(9), destHostAdminProhibited(10), networkUnreachableTOS(11), hostUnreachableTOS(12), ")NEWLINEcpuFilterL3RuleDstIpAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 3, 1, 1, 7), IpAddress().clone(hexValue="00000000")).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: cpuFilterL3RuleDstIpAddr.setStatus('current')NEWLINEif mibBuilder.loadTexts: cpuFilterL3RuleDstIpAddr.setDescription("Destination IP address to be matched with the packet. The default value will be zero, which means the rule don't care this condition.")NEWLINEcpuFilterL3RuleSrcIpAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 3, 1, 1, 8), IpAddress().clone(hexValue="00000000")).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: cpuFilterL3RuleSrcIpAddr.setStatus('current')NEWLINEif mibBuilder.loadTexts: cpuFilterL3RuleSrcIpAddr.setDescription("Source IP address to be matched with the packet. The default value will be zero, which means the rule don't care this condition.")NEWLINEcpuFilterL3RuleDstIpAddrMask = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 3, 1, 1, 9), IpAddress().clone(hexValue="FFFFFFFF")).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: cpuFilterL3RuleDstIpAddrMask.setStatus('current')NEWLINEif mibBuilder.loadTexts: cpuFilterL3RuleDstIpAddrMask.setDescription("The IP subnet mask for Destination IP address. This field is read-only and copy from it's Profile setting. ")NEWLINEcpuFilterL3RuleSrcIpAddrMask = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 3, 1, 1, 10), IpAddress().clone(hexValue="FFFFFFFF")).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: cpuFilterL3RuleSrcIpAddrMask.setStatus('current')NEWLINEif mibBuilder.loadTexts: cpuFilterL3RuleSrcIpAddrMask.setDescription("The IP subnet mask for Source IP address. This field is read-only and copy from it's Profile setting. ")NEWLINEcpuFilterL3RuleTcpUdpDstPort = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 3, 1, 1, 11), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 65535)).clone(-1)).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: cpuFilterL3RuleTcpUdpDstPort.setStatus('current')NEWLINEif mibBuilder.loadTexts: cpuFilterL3RuleTcpUdpDstPort.setDescription("The TCP / UDP destination port. The default value is -1, which means the rule don't care this condition.")NEWLINEcpuFilterL3RuleTcpUdpSrcPort = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 3, 1, 1, 12), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 65535)).clone(-1)).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: cpuFilterL3RuleTcpUdpSrcPort.setStatus('current')NEWLINEif mibBuilder.loadTexts: cpuFilterL3RuleTcpUdpSrcPort.setDescription("The TCP / UDP source port. The default value is -1, which means the rule don't care this condition.")NEWLINEcpuFilterL3RuleTcpUdpDstPortMask = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 3, 1, 1, 13), OctetString()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: cpuFilterL3RuleTcpUdpDstPortMask.setStatus('current')NEWLINEif mibBuilder.loadTexts: cpuFilterL3RuleTcpUdpDstPortMask.setDescription("The TCP / UDP Destination port Mask. This field is read-only and copy from it's Profile setting. ")NEWLINEcpuFilterL3RuleTcpUdpSrcPortMask = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 3, 1, 1, 14), OctetString()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: cpuFilterL3RuleTcpUdpSrcPortMask.setStatus('current')NEWLINEif mibBuilder.loadTexts: cpuFilterL3RuleTcpUdpSrcPortMask.setDescription("The TCP / UDP Source port Mask. This field is read-only and copy from it's Profile setting. ")NEWLINEcpuFilterL3RuleTcpAckBit = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 3, 1, 1, 15), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(-1, 1, 2))).clone(namedValues=NamedValues(("dontcare", -1), ("establish", 1), ("notEstablish", 2))).clone('dontcare')).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: cpuFilterL3RuleTcpAckBit.setStatus('current')NEWLINEif mibBuilder.loadTexts: cpuFilterL3RuleTcpAckBit.setDescription(" The TCP ACK bit to be checked against the packet. The default value is 'dontcare'(-1), which means the rule don't care this condition.")NEWLINEcpuFilterL3RuleTcpRstBit = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 3, 1, 1, 16), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(-1, 1, 2))).clone(namedValues=NamedValues(("dontcare", -1), ("establish", 1), ("notEstablish", 2))).clone('dontcare')).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: cpuFilterL3RuleTcpRstBit.setStatus('current')NEWLINEif mibBuilder.loadTexts: cpuFilterL3RuleTcpRstBit.setDescription(" The TCP RST bit to be checked against the packet. The default value is 'dontcare'(-1), which means the rule don't care this condition.")NEWLINEcpuFilterL3RuleTcpUrgBit = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 3, 1, 1, 17), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(-1, 1, 2))).clone(namedValues=NamedValues(("dontcare", -1), ("establish", 1), ("notEstablish", 2))).clone('dontcare')).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: cpuFilterL3RuleTcpUrgBit.setStatus('current')NEWLINEif mibBuilder.loadTexts: cpuFilterL3RuleTcpUrgBit.setDescription(" The TCP Urg bit to be checked against the packet. The default value is 'dontcare'(-1), which means the rule don't care this condition.")NEWLINEcpuFilterL3RuleTcpPshBit = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 3, 1, 1, 18), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(-1, 1, 2))).clone(namedValues=NamedValues(("dontcare", -1), ("establish", 1), ("notEstablish", 2))).clone('dontcare')).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: cpuFilterL3RuleTcpPshBit.setStatus('current')NEWLINEif mibBuilder.loadTexts: cpuFilterL3RuleTcpPshBit.setDescription(" The TCP Psh bit to be checked against the packet. The default value is 'dontcare'(-1). which means the rule don't care this condition.")NEWLINEcpuFilterL3RuleTcpSynBit = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 3, 1, 1, 19), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(-1, 1, 2))).clone(namedValues=NamedValues(("dontcare", -1), ("establish", 1), ("notEstablish", 2))).clone('dontcare')).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: cpuFilterL3RuleTcpSynBit.setStatus('current')NEWLINEif mibBuilder.loadTexts: cpuFilterL3RuleTcpSynBit.setDescription(" The TCP Syn bit to be checked against the packet. The default value is 'dontcare'(-1), which means the rule don't care this condition.")NEWLINEcpuFilterL3RuleTcpFinBit = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 3, 1, 1, 20), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(-1, 1, 2))).clone(namedValues=NamedValues(("dontcare", -1), ("establish", 1), ("notEstablish", 2))).clone('dontcare')).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: cpuFilterL3RuleTcpFinBit.setStatus('current')NEWLINEif mibBuilder.loadTexts: cpuFilterL3RuleTcpFinBit.setDescription(" The TCP Fin bit to be checked against the packet. The default value is 'dontcare'(-1), which means the rule don't care this condition.")NEWLINEcpuFilterL3RuleDscp = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 3, 1, 1, 21), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 63)).clone(-1)).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: cpuFilterL3RuleDscp.setStatus('current')NEWLINEif mibBuilder.loadTexts: cpuFilterL3RuleDscp.setDescription(" The IP Dscp value to be checked against the packet. A default value is '-1', which means the rule don't care this condition.")NEWLINEcpuFilterL3RuleIgmpType = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 3, 1, 1, 22), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 255)).clone(-1)).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: cpuFilterL3RuleIgmpType.setStatus('current')NEWLINEif mibBuilder.loadTexts: cpuFilterL3RuleIgmpType.setDescription(" The IGMP Type to be checked against the packet.A default value is '-1', which means the rule don't care this condition.")NEWLINEcpuFilterL3RulePortList = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 3, 1, 1, 23), PortList()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: cpuFilterL3RulePortList.setStatus('current')NEWLINEif mibBuilder.loadTexts: cpuFilterL3RulePortList.setDescription('Specifies the complete set of ports over which if the packet arrives this filter rule will be applicable.')NEWLINEcpuFilterL3RuleAction = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 3, 1, 1, 24), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("allow", 1), ("drop", 2))).clone('allow')).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: cpuFilterL3RuleAction.setStatus('current')NEWLINEif mibBuilder.loadTexts: cpuFilterL3RuleAction.setDescription('Specifies the action to be taken on the packet if the filter rule matches.')NEWLINEcpuFilterL3RuleStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 3, 1, 1, 27), RowStatus()).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: cpuFilterL3RuleStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: cpuFilterL3RuleStatus.setDescription("This object indicates the status of this entry. An entry is created in this table when this object is SET to 'createAndWait'. The entry in this table is used when the status of this object is SET 'active'. The entry in this table is not used when this object is SET 'notInService'. An entry created in this table is be deleted when this object is SET 'destroy'.")NEWLINEcpuFilterv6L3RuleTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 3, 2), )NEWLINEif mibBuilder.loadTexts: cpuFilterv6L3RuleTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: cpuFilterv6L3RuleTable.setDescription(' A table to configure L3 filter rules in the system. ')NEWLINEcpuFilterv6L3RuleEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 3, 2, 1), ).setIndexNames((0, "DES-1210-28MEbx", "cpuFilterv6L3RuleProfileNo"), (0, "DES-1210-28MEbx", "cpuFilterv6L3RuleAccessID"))NEWLINEif mibBuilder.loadTexts: cpuFilterv6L3RuleEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: cpuFilterv6L3RuleEntry.setDescription(' Each entry in this table is a L3 filter rule. Index to the table is L3 filter number and Profile ID.')NEWLINEcpuFilterv6L3RuleProfileNo = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 3, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 5))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: cpuFilterv6L3RuleProfileNo.setStatus('current')NEWLINEif mibBuilder.loadTexts: cpuFilterv6L3RuleProfileNo.setDescription('L3 Filter rule ID.')NEWLINEcpuFilterv6L3RuleAccessID = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 3, 2, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 3))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: cpuFilterv6L3RuleAccessID.setStatus('current')NEWLINEif mibBuilder.loadTexts: cpuFilterv6L3RuleAccessID.setDescription('The Profile ID which this rule join.')NEWLINEcpuFilterv6L3RuleProtocol = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 3, 2, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 6, 17))).clone(namedValues=NamedValues(("icmp", 1), ("tcp", 6), ("udp", 17)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: cpuFilterv6L3RuleProtocol.setStatus('current')NEWLINEif mibBuilder.loadTexts: cpuFilterv6L3RuleProtocol.setDescription(' The type of protocol to be checked against the packet.')NEWLINEcpuFilterv6L3RuleProtocolMask = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 3, 2, 1, 4), OctetString().clone(hexValue="FF")).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: cpuFilterv6L3RuleProtocolMask.setStatus('current')NEWLINEif mibBuilder.loadTexts: cpuFilterv6L3RuleProtocolMask.setDescription("The IP protocol mask. This field is read-only and copy from it's Profile setting. It will work with the other field,cpuFilterL3RuleProtocol, to caculate a range of IP protocol which is really care. The value is in HEX format. ")NEWLINEcpuFilterv6L3RuleICMPMessageType = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 3, 2, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 255)).clone(-1)).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: cpuFilterv6L3RuleICMPMessageType.setStatus('current')NEWLINEif mibBuilder.loadTexts: cpuFilterv6L3RuleICMPMessageType.setDescription(" The message type to be checked against the packet. If the message type matches with the packet, then the packet will be dropped / allowed based on the action set in cpuFilterL3RuleAction. The default value is '-1',which means the rule don't care this condition. Some ICMP message types are: echoReply(0), destinationUnreachable(3), sourceQuench(4), redirect(5), echoRequest(8), timeExceeded(11), parameterProblem(12), timestampRequest(13), timestampReply(14), informationRequest(15), informationReply(16), addressMaskRequest(17), addressMaskReply (18), ")NEWLINEcpuFilterv6L3RuleICMPMessageCode = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 3, 2, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 255)).clone(-1)).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: cpuFilterv6L3RuleICMPMessageCode.setStatus('current')NEWLINEif mibBuilder.loadTexts: cpuFilterv6L3RuleICMPMessageCode.setDescription(" The message code to be checked against the packet. If the packet matches with the message code, then the packet will be dropped / allowed based on the action set in cpuFilterL3RuleAction. The default value is '-1', which means the rule don't care this condition. Some ICMP message codes are : networkUnreachable(0), hostUnreachable(1), protocolUnreachable(2), portUnreachable(3), fragmentNeed(4), sourceRouteFail(5), destNetworkUnknown(6), destHostUnknown(7), srcHostIsolated(8), destNetworkAdminProhibited(9), destHostAdminProhibited(10), networkUnreachableTOS(11), hostUnreachableTOS(12), ")NEWLINEcpuFilterv6L3RuleDstIpAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 3, 2, 1, 7), Ipv6Address().clone(hexValue="00000000")).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: cpuFilterv6L3RuleDstIpAddr.setStatus('current')NEWLINEif mibBuilder.loadTexts: cpuFilterv6L3RuleDstIpAddr.setDescription("Destination IP address to be matched with the packet. The default value will be zero, which means the rule don't care this condition.")NEWLINEcpuFilterv6L3RuleSrcIpAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 3, 2, 1, 8), Ipv6Address().clone(hexValue="00000000")).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: cpuFilterv6L3RuleSrcIpAddr.setStatus('current')NEWLINEif mibBuilder.loadTexts: cpuFilterv6L3RuleSrcIpAddr.setDescription("Source IP address to be matched with the packet. The default value will be zero, which means the rule don't care this condition.")NEWLINEcpuFilterv6L3RuleDstIpAddrMask = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 3, 2, 1, 9), Ipv6Address().clone(hexValue="FFFFFFFF")).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: cpuFilterv6L3RuleDstIpAddrMask.setStatus('current')NEWLINEif mibBuilder.loadTexts: cpuFilterv6L3RuleDstIpAddrMask.setDescription("The IP subnet mask for Destination IP address. This field is read-only and copy from it's Profile setting. ")NEWLINEcpuFilterv6L3RuleSrcIpAddrMask = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 3, 2, 1, 10), Ipv6Address().clone(hexValue="FFFFFFFF")).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: cpuFilterv6L3RuleSrcIpAddrMask.setStatus('current')NEWLINEif mibBuilder.loadTexts: cpuFilterv6L3RuleSrcIpAddrMask.setDescription("The IP subnet mask for Source IP address. This field is read-only and copy from it's Profile setting. ")NEWLINEcpuFilterv6L3RuleTcpUdpDstPort = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 3, 2, 1, 11), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 65535)).clone(-1)).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: cpuFilterv6L3RuleTcpUdpDstPort.setStatus('current')NEWLINEif mibBuilder.loadTexts: cpuFilterv6L3RuleTcpUdpDstPort.setDescription("The TCP / UDP destination port. The default value is -1, which means the rule don't care this condition.")NEWLINEcpuFilterv6L3RuleTcpUdpSrcPort = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 3, 2, 1, 12), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 65535)).clone(-1)).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: cpuFilterv6L3RuleTcpUdpSrcPort.setStatus('current')NEWLINEif mibBuilder.loadTexts: cpuFilterv6L3RuleTcpUdpSrcPort.setDescription("The TCP / UDP source port. The default value is -1, which means the rule don't care this condition.")NEWLINEcpuFilterv6L3RuleTcpUdpDstPortMask = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 3, 2, 1, 13), OctetString()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: cpuFilterv6L3RuleTcpUdpDstPortMask.setStatus('current')NEWLINEif mibBuilder.loadTexts: cpuFilterv6L3RuleTcpUdpDstPortMask.setDescription("The TCP / UDP Destination port Mask. This field is read-only and copy from it's Profile setting. ")NEWLINEcpuFilterv6L3RuleTcpUdpSrcPortMask = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 3, 2, 1, 14), OctetString()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: cpuFilterv6L3RuleTcpUdpSrcPortMask.setStatus('current')NEWLINEif mibBuilder.loadTexts: cpuFilterv6L3RuleTcpUdpSrcPortMask.setDescription("The TCP / UDP Source port Mask. This field is read-only and copy from it's Profile setting. ")NEWLINEcpuFilterv6L3RuleTcpAckBit = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 3, 2, 1, 15), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(-1, 1, 2))).clone(namedValues=NamedValues(("dontcare", -1), ("establish", 1), ("notEstablish", 2))).clone('dontcare')).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: cpuFilterv6L3RuleTcpAckBit.setStatus('current')NEWLINEif mibBuilder.loadTexts: cpuFilterv6L3RuleTcpAckBit.setDescription(" The TCP ACK bit to be checked against the packet. The default value is 'dontcare'(-1), which means the rule don't care this condition.")NEWLINEcpuFilterv6L3RuleTcpRstBit = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 3, 2, 1, 16), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(-1, 1, 2))).clone(namedValues=NamedValues(("dontcare", -1), ("establish", 1), ("notEstablish", 2))).clone('dontcare')).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: cpuFilterv6L3RuleTcpRstBit.setStatus('current')NEWLINEif mibBuilder.loadTexts: cpuFilterv6L3RuleTcpRstBit.setDescription(" The TCP RST bit to be checked against the packet. The default value is 'dontcare'(-1), which means the rule don't care this condition.")NEWLINEcpuFilterv6L3RuleTcpUrgBit = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 3, 2, 1, 17), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(-1, 1, 2))).clone(namedValues=NamedValues(("dontcare", -1), ("establish", 1), ("notEstablish", 2))).clone('dontcare')).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: cpuFilterv6L3RuleTcpUrgBit.setStatus('current')NEWLINEif mibBuilder.loadTexts: cpuFilterv6L3RuleTcpUrgBit.setDescription(" The TCP Urg bit to be checked against the packet. The default value is 'dontcare'(-1), which means the rule don't care this condition.")NEWLINEcpuFilterv6L3RuleTcpPshBit = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 3, 2, 1, 18), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(-1, 1, 2))).clone(namedValues=NamedValues(("dontcare", -1), ("establish", 1), ("notEstablish", 2))).clone('dontcare')).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: cpuFilterv6L3RuleTcpPshBit.setStatus('current')NEWLINEif mibBuilder.loadTexts: cpuFilterv6L3RuleTcpPshBit.setDescription(" The TCP Psh bit to be checked against the packet. The default value is 'dontcare'(-1). which means the rule don't care this condition.")NEWLINEcpuFilterv6L3RuleTcpSynBit = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 3, 2, 1, 19), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(-1, 1, 2))).clone(namedValues=NamedValues(("dontcare", -1), ("establish", 1), ("notEstablish", 2))).clone('dontcare')).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: cpuFilterv6L3RuleTcpSynBit.setStatus('current')NEWLINEif mibBuilder.loadTexts: cpuFilterv6L3RuleTcpSynBit.setDescription(" The TCP Syn bit to be checked against the packet. The default value is 'dontcare'(-1), which means the rule don't care this condition.")NEWLINEcpuFilterv6L3RuleTcpFinBit = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 3, 2, 1, 20), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(-1, 1, 2))).clone(namedValues=NamedValues(("dontcare", -1), ("establish", 1), ("notEstablish", 2))).clone('dontcare')).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: cpuFilterv6L3RuleTcpFinBit.setStatus('current')NEWLINEif mibBuilder.loadTexts: cpuFilterv6L3RuleTcpFinBit.setDescription(" The TCP Fin bit to be checked against the packet. The default value is 'dontcare'(-1), which means the rule don't care this condition.")NEWLINEcpuFilterv6L3RuleTrafficClass = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 3, 2, 1, 21), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 63)).clone(-1)).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: cpuFilterv6L3RuleTrafficClass.setStatus('current')NEWLINEif mibBuilder.loadTexts: cpuFilterv6L3RuleTrafficClass.setDescription(" The IP Dscp value to be checked against the packet. A default value is '-1', which means the rule don't care this condition.")NEWLINEcpuFilterv6L3RulePortList = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 3, 2, 1, 22), PortList()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: cpuFilterv6L3RulePortList.setStatus('current')NEWLINEif mibBuilder.loadTexts: cpuFilterv6L3RulePortList.setDescription('Specifies the complete set of ports over which if the packet arrives this filter rule will be applicable.')NEWLINEcpuFilterv6L3RuleAction = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 3, 2, 1, 23), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("allow", 1), ("drop", 2))).clone('allow')).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: cpuFilterv6L3RuleAction.setStatus('current')NEWLINEif mibBuilder.loadTexts: cpuFilterv6L3RuleAction.setDescription('Specifies the action to be taken on the packet if the filter rule matches.')NEWLINEcpuFilterv6L3RuleStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 33, 3, 2, 1, 24), RowStatus()).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: cpuFilterv6L3RuleStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: cpuFilterv6L3RuleStatus.setDescription("This object indicates the status of this entry. An entry is created in this table when this object is SET to 'createAndWait'. The entry in this table is used when the status of this object is SET 'active'. The entry in this table is not used when this object is SET 'notInService'. An entry created in this table is be deleted when this object is SET 'destroy'.")NEWLINEsnmpGlobalState = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 5, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: snmpGlobalState.setStatus('current')NEWLINEif mibBuilder.loadTexts: snmpGlobalState.setDescription('This object is for enabling or disabling SNMP Community function.')NEWLINEsnmpV3User = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 5, 2))NEWLINEsnmpV3Group = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 5, 3))NEWLINEsnmpV3ViewTree = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 5, 4))NEWLINEsnmpV3Community = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 5, 5))NEWLINEsnmpV3Host = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 5, 6))NEWLINEsnmpV3EngineID = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 5, 7), SnmpEngineID()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: snmpV3EngineID.setStatus('current')NEWLINEif mibBuilder.loadTexts: snmpV3EngineID.setDescription("An SNMP engine's administratively-unique identifier. In a simple agent, this value is always that agent's own snmpEngineID value. The value can also take the value of the snmpEngineID of a remote SNMP engine with which this user can communicate.")NEWLINEsnmpV3Trap = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 5, 8))NEWLINEsnmpV3UserTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 5, 2, 1), )NEWLINEif mibBuilder.loadTexts: snmpV3UserTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: snmpV3UserTable.setDescription('')NEWLINEsnmpV3UserEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 5, 2, 1, 1), ).setIndexNames((0, "DES-1210-28MEbx", "snmpV3UserName"), (0, "DES-1210-28MEbx", "snmpV3UserVersion"))NEWLINEif mibBuilder.loadTexts: snmpV3UserEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: snmpV3UserEntry.setDescription('')NEWLINEsnmpV3UserName = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 5, 2, 1, 1, 1), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(1, 32))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: snmpV3UserName.setStatus('current')NEWLINEif mibBuilder.loadTexts: snmpV3UserName.setDescription('A human readable string representing the name of the user. This is the (User-based Security) Model dependent security ID. ')NEWLINEsnmpV3UserVersion = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 5, 2, 1, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("v1", 1), ("v2c", 2), ("v3", 3)))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: snmpV3UserVersion.setStatus('current')NEWLINEif mibBuilder.loadTexts: snmpV3UserVersion.setDescription('A human readable string representing the name of the user. This is the (User-based Security) Model dependent security ID. ')NEWLINEsnmpV3UserGroupName = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 5, 2, 1, 1, 3), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(1, 32))).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: snmpV3UserGroupName.setStatus('current')NEWLINEif mibBuilder.loadTexts: snmpV3UserGroupName.setDescription('The name of the group to which this entry (e.g., the combination of securityModel and securityName) belongs. This groupName is used as index into the vacmAccessTable to select an access control policy. However, a value in this table does not imply that an instance with the value exists in table vacmAccesTable. ')NEWLINEsnmpV3UserAuthProtocol = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 5, 2, 1, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("none", 1), ("md5", 2), ("sha", 3)))).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: snmpV3UserAuthProtocol.setStatus('current')NEWLINEif mibBuilder.loadTexts: snmpV3UserAuthProtocol.setDescription("An indication of whether messages sent on behalf of this user to/from the SNMP engine identified by usmUserEngineID, can be authenticated, and if so, the type of authentication protocol which is used. An instance of this object is created concurrently with the creation of any other object instance for the same user (i.e., as part of the processing of the set operation which creates the first object instance in the same conceptual row). If an initial set operation (i.e. at row creation time) tries to set a value for an unknown or unsupported protocol, then a 'wrongValue' error must be returned. The value will be overwritten/set when a set operation is performed on the corresponding instance of UserCloneFrom. Once instantiated, the value of such an instance of this object can only be changed via a set operation to the value of the NoAuthProtocol. If a set operation tries to change the value of an existing instance of this object to any value other than NoAuthProtocol, then an 'inconsistentValue' error must be returned. If a set operation tries to set the value to the NoAuthProtocol while the UserPrivProtocol value in the same row is not equal to NoPrivProtocol, then an 'inconsistentValue' error must be returned. That means that an SNMP command generator application must first ensure that the UserPrivProtocol is set to the NoPrivProtocol value before it can set the UserAuthProtocol value to NoAuthProtocol. ")NEWLINEsnmpV3UserAuthProtocolPassword = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 5, 2, 1, 1, 5), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(1, 32))).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: snmpV3UserAuthProtocolPassword.setStatus('current')NEWLINEif mibBuilder.loadTexts: snmpV3UserAuthProtocolPassword.setDescription('')NEWLINEsnmpV3UserPrivProtocol = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 5, 2, 1, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("none", 1), ("des", 2)))).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: snmpV3UserPrivProtocol.setStatus('current')NEWLINEif mibBuilder.loadTexts: snmpV3UserPrivProtocol.setDescription("An indication of whether messages sent on behalf of this user to/from the SNMP engine identified by usmUserEngineID, can be protected from disclosure, and if so, the type of privacy protocol which is used. An instance of this object is created concurrently with the creation of any other object instance for the same user (i.e., as part of the processing of the set operation which creates the first object instance in the same conceptual row). If an initial set operation (i.e. at row creation time) tries to set a value for an unknown or unsupported protocol, then a 'wrongValue' error must be returned. The value will be overwritten/set when a set operation is performed on the corresponding instance of usmUserCloneFrom. Once instantiated, the value of such an instance of this object can only be changed via a set operation to the value of the NoPrivProtocol. If a set operation tries to change the value of an existing instance of this object to any value other than NoPrivProtocol, then an 'inconsistentValue' error must be returned. Note that if any privacy protocol is used, then you must also use an authentication protocol. In other words, if usmUserPrivProtocol is set to anything else than NoPrivProtocol, then the corresponding instance of usmUserAuthProtocol cannot have a value of usmNoAuthProtocol. If it does, then an 'inconsistentValue' error must be returned. ")NEWLINEsnmpV3UserPrivProtocolPassword = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 5, 2, 1, 1, 7), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(1, 32))).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: snmpV3UserPrivProtocolPassword.setStatus('current')NEWLINEif mibBuilder.loadTexts: snmpV3UserPrivProtocolPassword.setDescription('')NEWLINEsnmpV3UserStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 5, 2, 1, 1, 8), RowStatus()).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: snmpV3UserStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: snmpV3UserStatus.setDescription("The status of this conceptual row. Until instances of all corresponding columns are appropriately configured, the value of the corresponding instance of the usmUserStatus column is 'notReady'. In particular, a newly created row for a user who employs authentication, cannot be made active until the corresponding usmUserCloneFrom and usmUserAuthKeyChange have been set. Further, a newly created row for a user who also employs privacy, cannot be made active until the usmUserPrivKeyChange has been set. The RowStatus TC [RFC2579] requires that this DESCRIPTION clause states under which circumstances other objects in this row can be modified: The value of this object has no effect on whether other objects in this conceptual row can be modified, except for usmUserOwnAuthKeyChange and usmUserOwnPrivKeyChange. For these 2 objects, the value of usmUserStatus MUST be active. ")NEWLINEsnmpV3GroupTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 5, 3, 1), )NEWLINEif mibBuilder.loadTexts: snmpV3GroupTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: snmpV3GroupTable.setDescription('')NEWLINEsnmpV3GroupEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 5, 3, 1, 1), ).setIndexNames((0, "DES-1210-28MEbx", "snmpV3GroupName"), (0, "DES-1210-28MEbx", "snmpV3GroupSecurityModel"), (0, "DES-1210-28MEbx", "snmpV3GroupSecurityLevel"))NEWLINEif mibBuilder.loadTexts: snmpV3GroupEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: snmpV3GroupEntry.setDescription('')NEWLINEsnmpV3GroupName = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 5, 3, 1, 1, 1), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(1, 32))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: snmpV3GroupName.setStatus('current')NEWLINEif mibBuilder.loadTexts: snmpV3GroupName.setDescription('The name of the group to which this entry (e.g., the combination of securityModel and securityName) belongs. This groupName is used as index into the vacmAccessTable to select an access control policy. However, a value in this table does not imply that an instance with the value exists in table vacmAccesTable. ')NEWLINEsnmpV3GroupSecurityModel = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 5, 3, 1, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("v1", 1), ("v2c", 2), ("v3", 3)))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: snmpV3GroupSecurityModel.setStatus('current')NEWLINEif mibBuilder.loadTexts: snmpV3GroupSecurityModel.setDescription('In order to gain the access rights allowed by this conceptual row, this securityModel must be in use. ')NEWLINEsnmpV3GroupSecurityLevel = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 5, 3, 1, 1, 3), SnmpSecurityLevel()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: snmpV3GroupSecurityLevel.setStatus('current')NEWLINEif mibBuilder.loadTexts: snmpV3GroupSecurityLevel.setDescription('The minimum level of security required in order to gain the access rights allowed by this conceptual row. A securityLevel of noAuthNoPriv is less than authNoPriv which in turn is less than authPriv. If multiple entries are equally indexed except for this vacmAccessSecurityLevel index, then the entry which has the highest value for vacmAccessSecurityLevel is selected. ')NEWLINEsnmpV3GroupReadViewName = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 5, 3, 1, 1, 4), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(0, 32))).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: snmpV3GroupReadViewName.setStatus('current')NEWLINEif mibBuilder.loadTexts: snmpV3GroupReadViewName.setDescription('The value of an instance of this object identifies the MIB view of the SNMP context to which this conceptual row authorizes read access. The identified MIB view is that one for which the vacmViewTreeFamilyViewName has the same value as the instance of this object; if the value is the empty string or if there is no active MIB view having this value of vacmViewTreeFamilyViewName, then no access is granted. ')NEWLINEsnmpV3GroupWriteViewName = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 5, 3, 1, 1, 5), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(0, 32))).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: snmpV3GroupWriteViewName.setStatus('current')NEWLINEif mibBuilder.loadTexts: snmpV3GroupWriteViewName.setDescription('The value of an instance of this object identifies the MIB view of the SNMP context to which this conceptual row authorizes write access. The identified MIB view is that one for which the vacmViewTreeFamilyViewName has the same value as the instance of this object; if the value is the empty string or if there is no active MIB view having this value of vacmViewTreeFamilyViewName, then no access is granted. ')NEWLINEsnmpV3GroupNotifyViewName = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 5, 3, 1, 1, 6), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(0, 32))).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: snmpV3GroupNotifyViewName.setStatus('current')NEWLINEif mibBuilder.loadTexts: snmpV3GroupNotifyViewName.setDescription('The value of an instance of this object identifies the MIB view of the SNMP context to which this conceptual row authorizes access for notifications. The identified MIB view is that one for which the vacmViewTreeFamilyViewName has the same value as the instance of this object; if the value is the empty string or if there is no active MIB view having this value of vacmViewTreeFamilyViewName, then no access is granted. ')NEWLINEsnmpV3GroupStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 5, 3, 1, 1, 7), RowStatus()).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: snmpV3GroupStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: snmpV3GroupStatus.setDescription('The status of this conceptual row. The RowStatus TC [RFC2579] requires that this DESCRIPTION clause states under which circumstances other objects in this row can be modified: The value of this object has no effect on whether other objects in this conceptual row can be modified. ')NEWLINEsnmpV3ViewTreeTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 5, 4, 1), )NEWLINEif mibBuilder.loadTexts: snmpV3ViewTreeTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: snmpV3ViewTreeTable.setDescription('')NEWLINEsnmpV3ViewTreeEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 5, 4, 1, 1), ).setIndexNames((0, "DES-1210-28MEbx", "snmpV3viewTreeName"), (0, "DES-1210-28MEbx", "snmpV3viewTreeSubtree"))NEWLINEif mibBuilder.loadTexts: snmpV3ViewTreeEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: snmpV3ViewTreeEntry.setDescription('')NEWLINEsnmpV3viewTreeName = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 5, 4, 1, 1, 1), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(1, 32))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: snmpV3viewTreeName.setStatus('current')NEWLINEif mibBuilder.loadTexts: snmpV3viewTreeName.setDescription('The human readable name for a family of view subtrees. ')NEWLINEsnmpV3viewTreeSubtree = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 5, 4, 1, 1, 2), ObjectIdentifier()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: snmpV3viewTreeSubtree.setStatus('current')NEWLINEif mibBuilder.loadTexts: snmpV3viewTreeSubtree.setDescription('The MIB subtree which when combined with the corresponding instance of vacmViewTreeFamilyMask defines a family of view subtrees. ')NEWLINEsnmpV3viewTreeMask = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 5, 4, 1, 1, 3), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 16))).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: snmpV3viewTreeMask.setStatus('current')NEWLINEif mibBuilder.loadTexts: snmpV3viewTreeMask.setDescription("The bit mask which, in combination with the corresponding instance of vacmViewTreeFamilySubtree, defines a family of view subtrees. Each bit of this bit mask corresponds to a sub-identifier of vacmViewTreeFamilySubtree, with the most significant bit of the i-th octet of this octet string value (extended if necessary, see below) corresponding to the (8*i - 7)-th sub-identifier, and the least significant bit of the i-th octet of this octet string corresponding to the (8*i)-th sub-identifier, where i is in the range 1 through 16. Each bit of this bit mask specifies whether or not the corresponding sub-identifiers must match when determining if an OBJECT IDENTIFIER is in this family of view subtrees; a '1' indicates that an exact match must occur; a '0' indicates 'wild card', i.e., any sub-identifier value matches. Thus, the OBJECT IDENTIFIER X of an object instance is contained in a family of view subtrees if, for each sub-identifier of the value of vacmViewTreeFamilySubtree, either: the i-th bit of vacmViewTreeFamilyMask is 0, or the i-th sub-identifier of X is equal to the i-th sub-identifier of the value of vacmViewTreeFamilySubtree. If the value of this bit mask is M bits long and there are more than M sub-identifiers in the corresponding instance of vacmViewTreeFamilySubtree, then the bit mask is extended with 1's to be the required length. Note that when the value of this object is the zero-length string, this extension rule results in a mask of all-1's being used (i.e., no 'wild card'), and the family of view subtrees is the one view subtree uniquely identified by the corresponding instance of vacmViewTreeFamilySubtree. Note that masks of length greater than zero length do not need to be supported. In this case this object is made read-only. ")NEWLINEsnmpV3viewTreeType = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 5, 4, 1, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("included", 1), ("excluded", 2)))).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: snmpV3viewTreeType.setStatus('current')NEWLINEif mibBuilder.loadTexts: snmpV3viewTreeType.setDescription('Indicates whether the corresponding instances of vacmViewTreeFamilySubtree and vacmViewTreeFamilyMask define a family of view subtrees which is included in or excluded from the MIB view. ')NEWLINEsnmpV3viewTreeStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 5, 4, 1, 1, 5), RowStatus()).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: snmpV3viewTreeStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: snmpV3viewTreeStatus.setDescription('The status of this conceptual row. The RowStatus TC [RFC2579] requires that this DESCRIPTION clause states under which circumstances other objects in this row can be modified: The value of this object has no effect on whether other objects in this conceptual row can be modified. ')NEWLINEsnmpV3CommunityTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 5, 5, 1), )NEWLINEif mibBuilder.loadTexts: snmpV3CommunityTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: snmpV3CommunityTable.setDescription('')NEWLINEsnmpV3CommunityEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 5, 5, 1, 1), ).setIndexNames((0, "DES-1210-28MEbx", "snmpV3CommunityName"))NEWLINEif mibBuilder.loadTexts: snmpV3CommunityEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: snmpV3CommunityEntry.setDescription('')NEWLINEsnmpV3CommunityName = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 5, 5, 1, 1, 1), OctetString().subtype(subtypeSpec=ValueSizeConstraint(1, 15))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: snmpV3CommunityName.setStatus('current')NEWLINEif mibBuilder.loadTexts: snmpV3CommunityName.setDescription('The unique index value of a row in this table.')NEWLINEsnmpV3CommunityPolicy = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 5, 5, 1, 1, 2), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(1, 32))).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: snmpV3CommunityPolicy.setStatus('current')NEWLINEif mibBuilder.loadTexts: snmpV3CommunityPolicy.setDescription('A human readable string representing the corresponding value of snmpCommunityName in a Security Model independent format.')NEWLINEsnmpV3CommunityStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 5, 5, 1, 1, 3), RowStatus()).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: snmpV3CommunityStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: snmpV3CommunityStatus.setDescription('The status of this conceptual row in the snmpCommunityTable. An entry in this table is not qualified for activation until instances of all corresponding columns have been initialized, either through default values, or through Set operations. The snmpCommunityName and snmpCommunitySecurityName objects must be explicitly set. There is no restriction on setting columns in this table when the value of snmpCommunityStatus is active(1).')NEWLINEipv4snmpV3HostTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 5, 6, 1), )NEWLINEif mibBuilder.loadTexts: ipv4snmpV3HostTable.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: ipv4snmpV3HostTable.setDescription('')NEWLINEipv4snmpV3HostEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 5, 6, 1, 1), ).setIndexNames((0, "DES-1210-28MEbx", "ipv4snmpV3HostAddress"))NEWLINEif mibBuilder.loadTexts: ipv4snmpV3HostEntry.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: ipv4snmpV3HostEntry.setDescription('')NEWLINEipv4snmpV3HostAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 5, 6, 1, 1, 1), IpAddress()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: ipv4snmpV3HostAddress.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: ipv4snmpV3HostAddress.setDescription('This object contains a transport address. The format of this address depends on the value of the snmpTargetAddrTDomain object. And this object is unique identifier associated with this snmpNotifyEntry.')NEWLINEipv4snmpV3HostCommunityName = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 5, 6, 1, 1, 2), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(1, 32))).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: ipv4snmpV3HostCommunityName.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: ipv4snmpV3HostCommunityName.setDescription('The locally arbitrary.')NEWLINEipv4snmpV3HostVersion = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 5, 6, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("v1", 1), ("v2c", 2), ("v3NoAuthNoPriv", 3), ("v3AuthNoPriv", 4), ("v3AuthPriv", 5)))).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: ipv4snmpV3HostVersion.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: ipv4snmpV3HostVersion.setDescription('The Level of Security to be used when generating SNMP messages using this entry.')NEWLINEipv4snmpV3HostStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 5, 6, 1, 1, 4), RowStatus()).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: ipv4snmpV3HostStatus.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: ipv4snmpV3HostStatus.setDescription('')NEWLINEsnmpV3HostTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 5, 6, 2), )NEWLINEif mibBuilder.loadTexts: snmpV3HostTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: snmpV3HostTable.setDescription('')NEWLINEsnmpV3HostEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 5, 6, 2, 1), ).setIndexNames((0, "DES-1210-28MEbx", "snmpV3HostAddress"), (0, "DES-1210-28MEbx", "snmpV3IPType"))NEWLINEif mibBuilder.loadTexts: snmpV3HostEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: snmpV3HostEntry.setDescription('')NEWLINEsnmpV3HostAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 5, 6, 2, 1, 1), Ipv6Address()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: snmpV3HostAddress.setStatus('current')NEWLINEif mibBuilder.loadTexts: snmpV3HostAddress.setDescription('This object contains a transport address. The format of this address depends on the value of the snmpTargetAddrTDomain object. And this object is unique identifier associated with this snmpNotifyEntry.')NEWLINEsnmpV3IPType = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 5, 6, 2, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("iPv4", 1), ("iPv6", 2)))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: snmpV3IPType.setStatus('current')NEWLINEif mibBuilder.loadTexts: snmpV3IPType.setDescription('Type of IP interface.')NEWLINEsnmpV3HostCommunityName = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 5, 6, 2, 1, 3), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(1, 32))).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: snmpV3HostCommunityName.setStatus('current')NEWLINEif mibBuilder.loadTexts: snmpV3HostCommunityName.setDescription('The locally arbitrary.')NEWLINEsnmpV3HostVersion = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 5, 6, 2, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("v1", 1), ("v2c", 2), ("v3NoAuthNoPriv", 3), ("v3AuthNoPriv", 4), ("v3AuthPriv", 5)))).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: snmpV3HostVersion.setStatus('current')NEWLINEif mibBuilder.loadTexts: snmpV3HostVersion.setDescription('The Level of Security to be used when generating SNMP messages using this entry.')NEWLINEsnmpV3HostInterfaceName = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 5, 6, 2, 1, 5), OctetString()).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: snmpV3HostInterfaceName.setStatus('current')NEWLINEif mibBuilder.loadTexts: snmpV3HostInterfaceName.setDescription('Specifies the interface name when the syslogSrvIP is linklocal address.')NEWLINEsnmpV3HostStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 5, 6, 2, 1, 6), RowStatus()).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: snmpV3HostStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: snmpV3HostStatus.setDescription('')NEWLINEsnmpV3TrapSNMPAuthentication = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 5, 8, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: snmpV3TrapSNMPAuthentication.setStatus('current')NEWLINEif mibBuilder.loadTexts: snmpV3TrapSNMPAuthentication.setDescription('This object is for enabling or disabling SNMP login fail event trap in the system.')NEWLINEsnmpV3TrapColdStart = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 5, 8, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: snmpV3TrapColdStart.setStatus('current')NEWLINEif mibBuilder.loadTexts: snmpV3TrapColdStart.setDescription('This object is for enabling or disabling devie Bootup event trap in the system.')NEWLINEsnmpV3TrapWarmStart = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 5, 8, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: snmpV3TrapWarmStart.setStatus('current')NEWLINEif mibBuilder.loadTexts: snmpV3TrapWarmStart.setDescription('This object is for enabling or disabling devie Bootup event trap in the system.')NEWLINEsnmpV3TrapLinkUpDown = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 5, 8, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: snmpV3TrapLinkUpDown.setStatus('current')NEWLINEif mibBuilder.loadTexts: snmpV3TrapLinkUpDown.setDescription('This object is for enabling or disabling Copper link up / link down event trap in the system.')NEWLINEsnmpV3TrapRSTPStateChange = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 5, 8, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: snmpV3TrapRSTPStateChange.setStatus('current')NEWLINEif mibBuilder.loadTexts: snmpV3TrapRSTPStateChange.setDescription('This object is for enabling or disabling RSTP topology change event trap in the system.')NEWLINEsnmpV3TrapFirmUpgrade = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 5, 8, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: snmpV3TrapFirmUpgrade.setStatus('current')NEWLINEif mibBuilder.loadTexts: snmpV3TrapFirmUpgrade.setDescription('This object is for enabling or disabling Firmware upgrade suess or fail event trap in the system.')NEWLINEsnmpV3TrapBPDUAttack = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 5, 8, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("none", 1), ("attackDetected", 2), ("attackCleared", 3), ("both", 4))).clone('none')).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: snmpV3TrapBPDUAttack.setStatus('current')NEWLINEif mibBuilder.loadTexts: snmpV3TrapBPDUAttack.setDescription('Used to configure trap settings for BPDU attack protection events.')NEWLINEsnmpV3TrapPortSecurity = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 5, 8, 12), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: snmpV3TrapPortSecurity.setStatus('current')NEWLINEif mibBuilder.loadTexts: snmpV3TrapPortSecurity.setDescription('')NEWLINEsnmpV3TrapIMPBViolation = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 5, 8, 13), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: snmpV3TrapIMPBViolation.setStatus('current')NEWLINEif mibBuilder.loadTexts: snmpV3TrapIMPBViolation.setDescription('')NEWLINEsnmpV3TrapLBD = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 5, 8, 14), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: snmpV3TrapLBD.setStatus('current')NEWLINEif mibBuilder.loadTexts: snmpV3TrapLBD.setDescription('')NEWLINEsnmpV3TrapDHCPServerScreening = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 5, 8, 15), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: snmpV3TrapDHCPServerScreening.setStatus('current')NEWLINEif mibBuilder.loadTexts: snmpV3TrapDHCPServerScreening.setDescription('')NEWLINEsnmpV3TrapDuplicateIPDetected = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 5, 8, 16), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: snmpV3TrapDuplicateIPDetected.setStatus('current')NEWLINEif mibBuilder.loadTexts: snmpV3TrapDuplicateIPDetected.setDescription('This object is for enabling or disabling send gratuitous trap when IP address conflicted in the network.')NEWLINEsnmpV3CommunityEncryption = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 5, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: snmpV3CommunityEncryption.setStatus('current')NEWLINEif mibBuilder.loadTexts: snmpV3CommunityEncryption.setDescription('This object is for enabling or disabling community encryption.')NEWLINEtraps = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 120, 0))NEWLINEsnmpTrapSNMPAuthentication = NotificationType((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 120, 0, 1))NEWLINEif mibBuilder.loadTexts: snmpTrapSNMPAuthentication.setStatus('current')NEWLINEif mibBuilder.loadTexts: snmpTrapSNMPAuthentication.setDescription('SnmpV3TrapSNMPAuthentication.')NEWLINEsnmpTrapColdStart = NotificationType((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 120, 0, 2))NEWLINEif mibBuilder.loadTexts: snmpTrapColdStart.setStatus('current')NEWLINEif mibBuilder.loadTexts: snmpTrapColdStart.setDescription('SnmpV3TrapColdStart.')NEWLINEsnmpTrapWarmStart = NotificationType((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 120, 0, 3))NEWLINEif mibBuilder.loadTexts: snmpTrapWarmStart.setStatus('current')NEWLINEif mibBuilder.loadTexts: snmpTrapWarmStart.setDescription('SnmpV3TrapWarmStart.')NEWLINEsnmpTrapCopperLinkUpDown = NotificationType((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 120, 0, 4))NEWLINEif mibBuilder.loadTexts: snmpTrapCopperLinkUpDown.setStatus('current')NEWLINEif mibBuilder.loadTexts: snmpTrapCopperLinkUpDown.setDescription('SnmpV3TrapCopperLinkUpDown.')NEWLINEsnmpTrapRSTPStateChange = NotificationType((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 120, 0, 5))NEWLINEif mibBuilder.loadTexts: snmpTrapRSTPStateChange.setStatus('current')NEWLINEif mibBuilder.loadTexts: snmpTrapRSTPStateChange.setDescription('SnmpV3TrapRSTPStateChange.')NEWLINEsnmpTrapFirmUpgrade = NotificationType((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 120, 0, 6))NEWLINEif mibBuilder.loadTexts: snmpTrapFirmUpgrade.setStatus('current')NEWLINEif mibBuilder.loadTexts: snmpTrapFirmUpgrade.setDescription('SnmpV3TrapFirmUpgrade.')NEWLINEsnmpTrapBPDUAttack = NotificationType((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 120, 0, 11))NEWLINEif mibBuilder.loadTexts: snmpTrapBPDUAttack.setStatus('current')NEWLINEif mibBuilder.loadTexts: snmpTrapBPDUAttack.setDescription('SnmpV3TrapBPDUAttack.')NEWLINEsnmpTrapPortSecurity = NotificationType((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 120, 0, 12))NEWLINEif mibBuilder.loadTexts: snmpTrapPortSecurity.setStatus('current')NEWLINEif mibBuilder.loadTexts: snmpTrapPortSecurity.setDescription('SnmpV3TrapPortSecurity.')NEWLINEsnmpTrapIMPBv2 = NotificationType((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 120, 0, 13))NEWLINEif mibBuilder.loadTexts: snmpTrapIMPBv2.setStatus('current')NEWLINEif mibBuilder.loadTexts: snmpTrapIMPBv2.setDescription('SnmpV3TrapIMPBv2.')NEWLINEsnmpTrapLBD = NotificationType((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 120, 0, 14))NEWLINEif mibBuilder.loadTexts: snmpTrapLBD.setStatus('current')NEWLINEif mibBuilder.loadTexts: snmpTrapLBD.setDescription('SnmpV3TrapLBD.')NEWLINEsnmpTrapDHCPScreen = NotificationType((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 120, 0, 15))NEWLINEif mibBuilder.loadTexts: snmpTrapDHCPScreen.setStatus('current')NEWLINEif mibBuilder.loadTexts: snmpTrapDHCPScreen.setDescription('SnmpV3TrapDHCPScreen.')NEWLINEsnmpTrapGratuitousArp = NotificationType((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 120, 0, 16))NEWLINEif mibBuilder.loadTexts: snmpTrapGratuitousArp.setStatus('current')NEWLINEif mibBuilder.loadTexts: snmpTrapGratuitousArp.setDescription('SnmpV3TrapGratuitousArp.')NEWLINEmacNotificatiotn = NotificationType((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 120, 0, 17))NEWLINEif mibBuilder.loadTexts: macNotificatiotn.setStatus('current')NEWLINEif mibBuilder.loadTexts: macNotificatiotn.setDescription(' This trap indicates the MAC address variations in the address table . ')NEWLINEduplicateIP = NotificationType((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 120, 0, 21))NEWLINEif mibBuilder.loadTexts: duplicateIP.setStatus('current')NEWLINEif mibBuilder.loadTexts: duplicateIP.setDescription(' duplicateIP . ')NEWLINEtrafficControl = NotificationType((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 120, 0, 22))NEWLINEif mibBuilder.loadTexts: trafficControl.setStatus('current')NEWLINEif mibBuilder.loadTexts: trafficControl.setDescription(' trafficControl. ')NEWLINEtopologyChange = NotificationType((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 120, 0, 23))NEWLINEif mibBuilder.loadTexts: topologyChange.setStatus('current')NEWLINEif mibBuilder.loadTexts: topologyChange.setDescription(' topologyChange. ')NEWLINEnewRootBrgaddress = NotificationType((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 120, 0, 24))NEWLINEif mibBuilder.loadTexts: newRootBrgaddress.setStatus('current')NEWLINEif mibBuilder.loadTexts: newRootBrgaddress.setDescription(' newRootBrgaddress. ')NEWLINEnewRootOlddesignatedroot = NotificationType((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 120, 0, 25))NEWLINEif mibBuilder.loadTexts: newRootOlddesignatedroot.setStatus('current')NEWLINEif mibBuilder.loadTexts: newRootOlddesignatedroot.setDescription(' newRootOlddesignatedroot. ')NEWLINEnewRootMSTibridgeregionalroot = NotificationType((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 120, 0, 26))NEWLINEif mibBuilder.loadTexts: newRootMSTibridgeregionalroot.setStatus('current')NEWLINEif mibBuilder.loadTexts: newRootMSTibridgeregionalroot.setDescription(' topologyChange. ')NEWLINEsyslogSettingGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 16, 1))NEWLINEsyslogEnable = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 16, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("disable", 0), ("enable", 1))).clone('disable')).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: syslogEnable.setStatus('current')NEWLINEif mibBuilder.loadTexts: syslogEnable.setDescription('This object is for enabling or disabling syslog alert features in the system and the syslog will save to flash or send to remote syslog server. System Logs record and manage events, as well as report errors and informational messages.')NEWLINEsyslogSaveMode = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 16, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("onDemand", 0), ("timeInterval", 1), ("logTrigger", 2))).clone('logTrigger')).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: syslogSaveMode.setStatus('current')NEWLINEif mibBuilder.loadTexts: syslogSaveMode.setDescription('This object is for choosing the method to save syslog into flash.')NEWLINEsyslogSaveMinutes = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 16, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535)).clone(30)).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: syslogSaveMinutes.setStatus('current')NEWLINEif mibBuilder.loadTexts: syslogSaveMinutes.setDescription("When savemode is time interval, it's used to set the interval minutes of system save syslog to flash.")NEWLINEipv4syslogServerGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 16, 2))NEWLINEipv4syslogServTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 16, 2, 1), )NEWLINEif mibBuilder.loadTexts: ipv4syslogServTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: ipv4syslogServTable.setDescription('The table of syslog remote server.')NEWLINEipv4syslogServEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 16, 2, 1, 1), ).setIndexNames((0, "DES-1210-28MEbx", "ipv4syslogServIndex"))NEWLINEif mibBuilder.loadTexts: ipv4syslogServEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: ipv4syslogServEntry.setDescription('The list of syslog remote server entry.')NEWLINEipv4syslogServIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 16, 2, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 4))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: ipv4syslogServIndex.setStatus('current')NEWLINEif mibBuilder.loadTexts: ipv4syslogServIndex.setDescription('The index of syslog remote server.')NEWLINEipv4syslogServAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 16, 2, 1, 1, 2), IpAddress()).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: ipv4syslogServAddr.setStatus('current')NEWLINEif mibBuilder.loadTexts: ipv4syslogServAddr.setDescription('The IP Address of syslog remote server.')NEWLINEipv4syslogServSeverity = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 16, 2, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(4, 6, 7))).clone(namedValues=NamedValues(("warning", 4), ("information", 6), ("all", 7)))).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: ipv4syslogServSeverity.setStatus('current')NEWLINEif mibBuilder.loadTexts: ipv4syslogServSeverity.setDescription('Specifies the log level option to be set for a specific server.')NEWLINEipv4syslogServFacility = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 16, 2, 1, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(128, 136, 144, 152, 160, 168, 176, 184))).clone(namedValues=NamedValues(("local0", 128), ("local1", 136), ("local2", 144), ("local3", 152), ("local4", 160), ("local5", 168), ("local6", 176), ("local7", 184))).clone('local0')).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: ipv4syslogServFacility.setStatus('current')NEWLINEif mibBuilder.loadTexts: ipv4syslogServFacility.setDescription('The Syslog standard facilities. The facility to be used when sending Syslog messages to this server.')NEWLINEipv4syslogServUDPport = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 16, 2, 1, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(514, 514), ValueRangeConstraint(6000, 65535), ))).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: ipv4syslogServUDPport.setStatus('current')NEWLINEif mibBuilder.loadTexts: ipv4syslogServUDPport.setDescription('The value is for setting UDP Port.')NEWLINEipv4syslogServSrvStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 16, 2, 1, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("disabled", 0), ("enabled", 1)))).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: ipv4syslogServSrvStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: ipv4syslogServSrvStatus.setDescription('The status for this server. If enable, system will send message to this server.')NEWLINEipv4syslogServSrvRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 16, 2, 1, 1, 7), RowStatus()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ipv4syslogServSrvRowStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: ipv4syslogServSrvRowStatus.setDescription('Row status of this server entry.')NEWLINEsyslogServerGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 16, 3))NEWLINEsyslogServTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 16, 3, 1), )NEWLINEif mibBuilder.loadTexts: syslogServTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: syslogServTable.setDescription('The table of syslog remote server.')NEWLINEsyslogServEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 16, 3, 1, 1), ).setIndexNames((0, "DES-1210-28MEbx", "syslogServIndex"))NEWLINEif mibBuilder.loadTexts: syslogServEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: syslogServEntry.setDescription('The list of syslog remote server entry.')NEWLINEsyslogServIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 16, 3, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 4))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: syslogServIndex.setStatus('current')NEWLINEif mibBuilder.loadTexts: syslogServIndex.setDescription('The index of syslog remote server.')NEWLINEsyslogServAddrType = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 16, 3, 1, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("ipv4", 1), ("ipv6", 2)))).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: syslogServAddrType.setStatus('current')NEWLINEif mibBuilder.loadTexts: syslogServAddrType.setDescription('Specifies the Address type of server.Address type shall be ipv4 or ipv6.')NEWLINEsyslogServAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 16, 3, 1, 1, 3), Ipv6Address()).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: syslogServAddr.setStatus('current')NEWLINEif mibBuilder.loadTexts: syslogServAddr.setDescription('Specifies the ServerIP to which the syslog shall be forwarded.')NEWLINEsyslogServInterfaceName = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 16, 3, 1, 1, 4), OctetString()).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: syslogServInterfaceName.setStatus('current')NEWLINEif mibBuilder.loadTexts: syslogServInterfaceName.setDescription('Specifies the interface name when the syslogServInterfaceName is linklocal address.')NEWLINEsyslogServSeverity = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 16, 3, 1, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(4, 6, 7))).clone(namedValues=NamedValues(("warning", 4), ("information", 6), ("all", 7)))).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: syslogServSeverity.setStatus('current')NEWLINEif mibBuilder.loadTexts: syslogServSeverity.setDescription('Specifies the log level option to be set for a specific server.')NEWLINEsyslogServFacility = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 16, 3, 1, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(128, 136, 144, 152, 160, 168, 176, 184))).clone(namedValues=NamedValues(("local0", 128), ("local1", 136), ("local2", 144), ("local3", 152), ("local4", 160), ("local5", 168), ("local6", 176), ("local7", 184))).clone('local0')).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: syslogServFacility.setStatus('current')NEWLINEif mibBuilder.loadTexts: syslogServFacility.setDescription('The Syslog standard facilities. The facility to be used when sending Syslog messages to this server.')NEWLINEsyslogServUDPport = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 16, 3, 1, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(514, 514), ValueRangeConstraint(6000, 65535), ))).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: syslogServUDPport.setStatus('current')NEWLINEif mibBuilder.loadTexts: syslogServUDPport.setDescription('The value is for setting UDP Port.')NEWLINEsyslogServSrvStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 16, 3, 1, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("disabled", 0), ("enabled", 1)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: syslogServSrvStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: syslogServSrvStatus.setDescription('The status for this server. If enable, system will send message to this server.')NEWLINEsyslogServSrvRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 16, 3, 1, 1, 9), RowStatus()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: syslogServSrvRowStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: syslogServSrvRowStatus.setDescription('Row status of this server entry.')NEWLINEsysLBDStateEnable = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 17, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2))).clone('disabled')).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sysLBDStateEnable.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysLBDStateEnable.setDescription('Enable/Disable Loopback detection function. The Loopback Detection function is used to detect the loop created by a specific port while Spanning Tree Protocol (STP) is not enabled in the network, especially when the down links are hubs or unmanaged switchs.The Switch will automatically shutdown the port and sends a log to the administrator.')NEWLINEsysLBDMode = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 17, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("port", 1), ("vlan", 2))).clone('port')).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sysLBDMode.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysLBDMode.setDescription('Loopback detection function mode.')NEWLINEsysLBDInterval = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 17, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 32767)).clone(2)).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sysLBDInterval.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysLBDInterval.setDescription('Set a Loop detection Interval between 1 and 32767 seconds. The default is 2 seconds. This time interval to be used at counting time seconds to resend the CTP packet automatically.')NEWLINEsysLBDRecoverTime = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 17, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(60, 1000000), )).clone(60)).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sysLBDRecoverTime.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysLBDRecoverTime.setDescription('This time interval to be used at counting time seconds to recover the disabled port automatically. The Loop Detection Recover Time can be set at 0 seconds, or 60 to 1000000 seconds. Entering 0 will disable the Loop Detection Recover Time. The default is 60 seconds.')NEWLINEsysLBDCtrlTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 17, 5), )NEWLINEif mibBuilder.loadTexts: sysLBDCtrlTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysLBDCtrlTable.setDescription('A table to control Loopback detection features either for the entire switch or for each interface in the switch.')NEWLINEsysLBDCtrlEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 17, 5, 1), ).setIndexNames((0, "DES-1210-28MEbx", "sysLBDCtrlIndex"))NEWLINEif mibBuilder.loadTexts: sysLBDCtrlEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysLBDCtrlEntry.setDescription('An entry appears in this table for each interface in the system.')NEWLINEsysLBDCtrlIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 17, 5, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 28))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: sysLBDCtrlIndex.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysLBDCtrlIndex.setDescription('The interface index of the port for which the configuration in this entry applies. For all machines give maximum port number.')NEWLINEsysLBDPortStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 17, 5, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2))).clone('disabled')).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sysLBDPortStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysLBDPortStatus.setDescription('Provides control to per port enable or disable the loopback detection function. Default is disabled.')NEWLINEsysLBDPortLoopStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 17, 5, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("normal", 1), ("loop", 2)))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: sysLBDPortLoopStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysLBDPortLoopStatus.setDescription('The loop status for this port.')NEWLINEsysLBDVlanLoopTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 17, 6), )NEWLINEif mibBuilder.loadTexts: sysLBDVlanLoopTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysLBDVlanLoopTable.setDescription('A table to display Loopback detection features by vlan mode .')NEWLINEsysLBDVlanLoopEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 17, 6, 1), ).setIndexNames((0, "DES-1210-28MEbx", "sysLBDVlanLoopIndex"))NEWLINEif mibBuilder.loadTexts: sysLBDVlanLoopEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysLBDVlanLoopEntry.setDescription('An entry appears in this table for each interface in the system.')NEWLINEsysLBDVlanLoopIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 17, 6, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 4094))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: sysLBDVlanLoopIndex.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysLBDVlanLoopIndex.setDescription('Display port lists loop status by vlan.')NEWLINEsysLBDVlanLoopPorts = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 17, 6, 1, 2), PortList()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: sysLBDVlanLoopPorts.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysLBDVlanLoopPorts.setDescription('Display port lists loop status by vlan.')NEWLINEsysMirrorStatus = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 18, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2))).clone('disabled')).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sysMirrorStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysMirrorStatus.setDescription('Enable/Disable Port Mirroring function. Default is disabled. Port Mirroring is a method of monitoring network traffic that forwards a copy of each incoming and/or outgoing packet from one port of the Switch to another port where the packet can be studied.')NEWLINEsysMirrorTargetPort = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 18, 2), Integer32()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sysMirrorTargetPort.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysMirrorTargetPort.setDescription('Specifies the port to which the mirrored traffic in the system is to be copied.')NEWLINEsysMirrorCtrlIngressMirroring = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 18, 3), PortList()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sysMirrorCtrlIngressMirroring.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysMirrorCtrlIngressMirroring.setDescription('Provides control to enable or disable mirroring of ingress traffic over this interface to the mirrored-to port.')NEWLINEsysMirrorCtrlEgressMirroring = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 18, 4), PortList()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sysMirrorCtrlEgressMirroring.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysMirrorCtrlEgressMirroring.setDescription('Provides control to enable or disable mirroring of egress traffic over this interface to the mirrored-to port.')NEWLINEsysTrapIP = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 30, 1), IpAddress()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sysTrapIP.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysTrapIP.setDescription("The smart console utility's IP address is used to recive trap events.")NEWLINEsysTrapSystemEvent = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 30, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("none", 0), ("deviceBootUp", 1), ("illegalLogin", 2), ("both", 3))).clone('none')).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sysTrapSystemEvent.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysTrapSystemEvent.setDescription('Enable/Disable system trap events in the switch system.')NEWLINEsysTrapFiberPortEvent = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 30, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2))).clone('disable')).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sysTrapFiberPortEvent.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysTrapFiberPortEvent.setDescription('Enable/Disable fiber port trap event in the system.')NEWLINEsysTrapTwistedPortEvent = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 30, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2))).clone('disable')).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sysTrapTwistedPortEvent.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysTrapTwistedPortEvent.setDescription('Enable/Disable twisted port trap event in the system.')NEWLINEsysTrapStateChangeEvent = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 30, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2))).clone('disable')).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sysTrapStateChangeEvent.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysTrapStateChangeEvent.setDescription('Enable/Disable RSTP state change trap event in the system.')NEWLINEsysTrapFirmUpgradeEvent = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 30, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2))).clone('disable')).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sysTrapFirmUpgradeEvent.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysTrapFirmUpgradeEvent.setDescription('Enable/Disable firmware upgrading trap event in the system.')NEWLINEsysTrapStatus = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 30, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2))).clone('disable')).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sysTrapStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysTrapStatus.setDescription('Enable/Disable trap event in the system.')NEWLINEsysTrapPortSecurity = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 30, 13), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sysTrapPortSecurity.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysTrapPortSecurity.setDescription('')NEWLINEsysTrapIMPBViolation = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 30, 14), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sysTrapIMPBViolation.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysTrapIMPBViolation.setDescription('')NEWLINEsysTrapLBD = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 30, 15), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sysTrapLBD.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysTrapLBD.setDescription('')NEWLINEsysTrapDHCPServerScreening = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 30, 16), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sysTrapDHCPServerScreening.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysTrapDHCPServerScreening.setDescription('')NEWLINEsysTrapDuplicateIPDetected = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 30, 17), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sysTrapDuplicateIPDetected.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysTrapDuplicateIPDetected.setDescription('This object is for enabling or disabling send gratuitous trap when IP address conflicted in the network.')NEWLINEipv4sysSNTPTimeSeconds = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 20, 1), Integer32()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ipv4sysSNTPTimeSeconds.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: ipv4sysSNTPTimeSeconds.setDescription('This object is for setting the system time in seconds from Epoch (00:00:00 UTC, January 1, 2009). Notice : input value must larger than 1230768000 (00:00:00 UTC, January 1, 2009) and smaller than 2145916799 (23:59:59 UTC, December 31, 2037).')NEWLINEipv4sysSNTPFirstServer = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 20, 2), IpAddress()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ipv4sysSNTPFirstServer.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: ipv4sysSNTPFirstServer.setDescription("SNTP First Server's IP Address")NEWLINEipv4sysSNTPSecondServer = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 20, 3), IpAddress()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ipv4sysSNTPSecondServer.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: ipv4sysSNTPSecondServer.setDescription("SNTP Second Server's IP Address")NEWLINEipv4sysSNTPPollInterval = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 20, 4), Integer32()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ipv4sysSNTPPollInterval.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: ipv4sysSNTPPollInterval.setDescription('SNTP Poll Interval In Seconds (30-99999) ')NEWLINEipv4sysSNTPState = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 20, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("sntp", 1), ("local", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ipv4sysSNTPState.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: ipv4sysSNTPState.setDescription('Enable/Disable SNTP function in the system.')NEWLINEipv4sysSNTPDSTOffset = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 20, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(30, 60, 90, 120))).clone(namedValues=NamedValues(("offset30min", 30), ("offset60min", 60), ("offset90min", 90), ("offset120min", 120)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ipv4sysSNTPDSTOffset.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: ipv4sysSNTPDSTOffset.setDescription('This object is for Daylight Saving Time Offset In (30/60/90/120) Minutes.')NEWLINEipv4sysSNTPGMTMinutes = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 20, 7), Integer32()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ipv4sysSNTPGMTMinutes.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: ipv4sysSNTPGMTMinutes.setDescription('Specifies the Time Zone Offset from GMT in +/- Minutes. (+780 ~ -720)')NEWLINEipv4sysSNTPDSTStartMon = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 20, 8), Integer32()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ipv4sysSNTPDSTStartMon.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: ipv4sysSNTPDSTStartMon.setDescription('The start month of Daylight Saving Time.')NEWLINEipv4sysSNTPDSTStartDay = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 20, 9), Integer32()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ipv4sysSNTPDSTStartDay.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: ipv4sysSNTPDSTStartDay.setDescription('The start day of Daylight Saving Time.')NEWLINEipv4sysSNTPDSTStartHour = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 20, 10), Integer32()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ipv4sysSNTPDSTStartHour.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: ipv4sysSNTPDSTStartHour.setDescription('The start hour of Daylight Saving Time.')NEWLINEipv4sysSNTPDSTStartMin = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 20, 11), Integer32()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ipv4sysSNTPDSTStartMin.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: ipv4sysSNTPDSTStartMin.setDescription('The start minute of Daylight Saving Time.')NEWLINEipv4sysSNTPDSTEndMon = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 20, 12), Integer32()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ipv4sysSNTPDSTEndMon.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: ipv4sysSNTPDSTEndMon.setDescription('The end month of Daylight Saving Time.')NEWLINEipv4sysSNTPDSTEndDay = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 20, 13), Integer32()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ipv4sysSNTPDSTEndDay.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: ipv4sysSNTPDSTEndDay.setDescription('The end day of Daylight Saving Time.')NEWLINEipv4sysSNTPDSTEndHour = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 20, 14), Integer32()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ipv4sysSNTPDSTEndHour.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: ipv4sysSNTPDSTEndHour.setDescription('The end hour of Daylight Saving Time.')NEWLINEipv4sysSNTPDSTEndMin = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 20, 15), Integer32()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ipv4sysSNTPDSTEndMin.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: ipv4sysSNTPDSTEndMin.setDescription('The end minute of Daylight Saving Time.')NEWLINEipv4sysSNTPDSTState = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 20, 16), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("annual", 1), ("disabled", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ipv4sysSNTPDSTState.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: ipv4sysSNTPDSTState.setDescription('This object is for Annual(1) or Disabled(2) DST state in the system.')NEWLINEsysSNTPServerTable = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 20, 17))NEWLINEsysSNTPTimeSeconds = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 20, 17, 1), Integer32()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sysSNTPTimeSeconds.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysSNTPTimeSeconds.setDescription('This object is for setting the system time in seconds from Epoch (00:00:00 UTC, January 1, 2009). Notice : input value must larger than 1230768000 (00:00:00 UTC, January 1, 2009) and smaller than 2145916799 (23:59:59 UTC, December 31, 2037).')NEWLINEsysSNTPFirstServer = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 20, 17, 2), Ipv6Address()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sysSNTPFirstServer.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysSNTPFirstServer.setDescription("SNTP First Server's IPv6 Address")NEWLINEsysSNTPFirstType = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 20, 17, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("iPv4", 1), ("iPv6", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sysSNTPFirstType.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysSNTPFirstType.setDescription("SNTP First Server's IPv6 Address type.")NEWLINEsysSNTPFirstInterfaceName = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 20, 17, 4), OctetString()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sysSNTPFirstInterfaceName.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysSNTPFirstInterfaceName.setDescription('Specifies the interface name when the sysSNTPFirstServer is linklocal address.')NEWLINEsysSNTPSecondServer = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 20, 17, 5), Ipv6Address()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sysSNTPSecondServer.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysSNTPSecondServer.setDescription("SNTP Second Server's IPv6 Address")NEWLINEsysSNTPSecondType = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 20, 17, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("iPv4", 1), ("iPv6", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sysSNTPSecondType.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysSNTPSecondType.setDescription("SNTP First Server's IPv6 Address type.")NEWLINEsysSNTPSecondInterfaceName = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 20, 17, 7), OctetString()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sysSNTPSecondInterfaceName.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysSNTPSecondInterfaceName.setDescription('Specifies the interface name when the sysSNTPSecondServer is linklocal address.')NEWLINEsysSNTPPollInterval = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 20, 17, 8), Integer32()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sysSNTPPollInterval.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysSNTPPollInterval.setDescription('SNTP Poll Interval In Seconds (30-99999) ')NEWLINEsysSNTPState = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 20, 17, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("sntp", 1), ("local", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sysSNTPState.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysSNTPState.setDescription('Enable/Disable SNTP function in the system.')NEWLINEsysSNTPDSTOffset = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 20, 17, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(30, 60, 90, 120))).clone(namedValues=NamedValues(("offset30min", 30), ("offset60min", 60), ("offset90min", 90), ("offset120min", 120)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sysSNTPDSTOffset.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysSNTPDSTOffset.setDescription('This object is for Daylight Saving Time Offset In (30/60/90/120) Minutes.')NEWLINEsysSNTPGMTMinutes = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 20, 17, 11), Integer32()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sysSNTPGMTMinutes.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysSNTPGMTMinutes.setDescription('Specifies the Time Zone Offset from GMT in +/- Minutes. (+780 ~ -720)')NEWLINEsysSNTPDSTStartMon = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 20, 17, 12), Integer32()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sysSNTPDSTStartMon.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysSNTPDSTStartMon.setDescription('The start month of Daylight Saving Time.')NEWLINEsysSNTPDSTStartDay = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 20, 17, 13), Integer32()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sysSNTPDSTStartDay.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysSNTPDSTStartDay.setDescription('The start day of Daylight Saving Time.')NEWLINEsysSNTPDSTStartHour = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 20, 17, 14), Integer32()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sysSNTPDSTStartHour.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysSNTPDSTStartHour.setDescription('The start hour of Daylight Saving Time.')NEWLINEsysSNTPDSTStartMin = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 20, 17, 15), Integer32()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sysSNTPDSTStartMin.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysSNTPDSTStartMin.setDescription('The start minute of Daylight Saving Time.')NEWLINEsysSNTPDSTEndMon = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 20, 17, 16), Integer32()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sysSNTPDSTEndMon.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysSNTPDSTEndMon.setDescription('The end month of Daylight Saving Time.')NEWLINEsysSNTPDSTEndDay = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 20, 17, 17), Integer32()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sysSNTPDSTEndDay.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysSNTPDSTEndDay.setDescription('The end day of Daylight Saving Time.')NEWLINEsysSNTPDSTEndHour = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 20, 17, 18), Integer32()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sysSNTPDSTEndHour.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysSNTPDSTEndHour.setDescription('The end hour of Daylight Saving Time.')NEWLINEsysSNTPDSTEndMin = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 20, 17, 19), Integer32()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sysSNTPDSTEndMin.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysSNTPDSTEndMin.setDescription('The end minute of Daylight Saving Time.')NEWLINEsysSNTPDSTState = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 20, 17, 20), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sysSNTPDSTState.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysSNTPDSTState.setDescription('This object is for Enabled(1) or Disabled(2) DST state in the system.')NEWLINEsysSNTPDSTMethod = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 20, 17, 30), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("annual", 1), ("repeating", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sysSNTPDSTMethod.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysSNTPDSTMethod.setDescription('This object is for Annual(1) or Repeating(2) DST method in the system.')NEWLINEsysSNTPDSTRepeatStartMon = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 20, 17, 31), Integer32()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sysSNTPDSTRepeatStartMon.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysSNTPDSTRepeatStartMon.setDescription('The start month of Daylight Saving Time in Repeating mode.')NEWLINEsysSNTPDSTRepeatStartWeek = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 20, 17, 32), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("last", 0), ("first", 1), ("second", 2), ("third", 3), ("fourth", 4), ("fifth", 5)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sysSNTPDSTRepeatStartWeek.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysSNTPDSTRepeatStartWeek.setDescription('The start week of Daylight Saving Time in Repeating mode.')NEWLINEsysSNTPDSTRepeatStartWeekDay = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 20, 17, 33), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6))).clone(namedValues=NamedValues(("sun", 0), ("mon", 1), ("tue", 2), ("wed", 3), ("thu", 4), ("fri", 5), ("sat", 6)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sysSNTPDSTRepeatStartWeekDay.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysSNTPDSTRepeatStartWeekDay.setDescription('The start weekday of Daylight Saving Time in Repeating mode.')NEWLINEsysSNTPDSTRepeatStartHour = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 20, 17, 34), Integer32()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sysSNTPDSTRepeatStartHour.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysSNTPDSTRepeatStartHour.setDescription('The start hour of Daylight Saving Time in Repeating mode..')NEWLINEsysSNTPDSTRepeatStartMin = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 20, 17, 35), Integer32()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sysSNTPDSTRepeatStartMin.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysSNTPDSTRepeatStartMin.setDescription('The start minute of Daylight Saving Time in Repeating mode.')NEWLINEsysSNTPDSTRepeatEndMon = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 20, 17, 36), Integer32()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sysSNTPDSTRepeatEndMon.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysSNTPDSTRepeatEndMon.setDescription('The end month of Daylight Saving Time in Repeating mode.')NEWLINEsysSNTPDSTRepeatEndWeek = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 20, 17, 37), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("last", 0), ("first", 1), ("second", 2), ("third", 3), ("fourth", 4), ("fifth", 5)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sysSNTPDSTRepeatEndWeek.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysSNTPDSTRepeatEndWeek.setDescription('The end week of Daylight Saving Time in Repeating mode.')NEWLINEsysSNTPDSTRepeatEndWeekDay = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 20, 17, 38), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6))).clone(namedValues=NamedValues(("sun", 0), ("mon", 1), ("tue", 2), ("wed", 3), ("thu", 4), ("fri", 5), ("sat", 6)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sysSNTPDSTRepeatEndWeekDay.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysSNTPDSTRepeatEndWeekDay.setDescription('The end weekday of Daylight Saving Time in Repeating mode.')NEWLINEsysSNTPDSTRepeatEndHour = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 20, 17, 39), Integer32()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sysSNTPDSTRepeatEndHour.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysSNTPDSTRepeatEndHour.setDescription('The end hour of Daylight Saving Time in Repeating mode..')NEWLINEsysSNTPDSTRepeatEndMin = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 20, 17, 40), Integer32()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sysSNTPDSTRepeatEndMin.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysSNTPDSTRepeatEndMin.setDescription('The end minute of Daylight Saving Time in Repeating mode.')NEWLINElimitIpMulticastProfileTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 45, 1), )NEWLINEif mibBuilder.loadTexts: limitIpMulticastProfileTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: limitIpMulticastProfileTable.setDescription('A list of the limit ip multicast Profile Table.')NEWLINElimitIpMulticastProfileEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 45, 1, 1), ).setIndexNames((0, "DES-1210-28MEbx", "limitIpMulticastIPType"), (0, "DES-1210-28MEbx", "limitIpMulticastProfileID"))NEWLINEif mibBuilder.loadTexts: limitIpMulticastProfileEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: limitIpMulticastProfileEntry.setDescription('A limit ip multicast entry maintain by the start IP Address, end ip address, profile id.')NEWLINElimitIpMulticastIPType = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 45, 1, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("ipv4", 1), ("ipv6", 2)))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: limitIpMulticastIPType.setStatus('current')NEWLINEif mibBuilder.loadTexts: limitIpMulticastIPType.setDescription('Indicate the IP type of profile.')NEWLINElimitIpMulticastProfileID = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 45, 1, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 24))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: limitIpMulticastProfileID.setStatus('current')NEWLINEif mibBuilder.loadTexts: limitIpMulticastProfileID.setDescription('The ProfileID of the limit ip multicast profile entry.')NEWLINElimitIpMulticastProfileName = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 45, 1, 1, 3), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 20))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: limitIpMulticastProfileName.setStatus('current')NEWLINEif mibBuilder.loadTexts: limitIpMulticastProfileName.setDescription('The ProfileName of the limit ip multicast profile entry.')NEWLINElimitIpMulticastProfileStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 45, 1, 1, 4), RowStatus()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: limitIpMulticastProfileStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: limitIpMulticastProfileStatus.setDescription('The status of an entry in the limit ip multicast profile Table. Only a subset of the rowstatus variables (active, createAndGo, destroy) are available.')NEWLINElimitIpMulticastEntryTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 45, 2), )NEWLINEif mibBuilder.loadTexts: limitIpMulticastEntryTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: limitIpMulticastEntryTable.setDescription('A list of the limit ip multicast entry Table.')NEWLINElimitIpMulticastEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 45, 2, 1), ).setIndexNames((0, "DES-1210-28MEbx", "limitIpMulticastEntryIPType"), (0, "DES-1210-28MEbx", "limitIpMulticastEntryProfileID"), (0, "DES-1210-28MEbx", "limitIpMulticaststartIpAddr"), (0, "DES-1210-28MEbx", "limitIpMulticastendIpAddr"))NEWLINEif mibBuilder.loadTexts: limitIpMulticastEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: limitIpMulticastEntry.setDescription('A limit ip multicast entry maintain by the start IP Address, end ip address, profile id.')NEWLINElimitIpMulticastEntryIPType = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 45, 2, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("ipv4", 1), ("ipv6", 2)))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: limitIpMulticastEntryIPType.setStatus('current')NEWLINEif mibBuilder.loadTexts: limitIpMulticastEntryIPType.setDescription('Indicate the IP type of entry.')NEWLINElimitIpMulticastEntryProfileID = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 45, 2, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 24))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: limitIpMulticastEntryProfileID.setStatus('current')NEWLINEif mibBuilder.loadTexts: limitIpMulticastEntryProfileID.setDescription('The ProfileID of the limit ip multicast entry.')NEWLINElimitIpMulticaststartIpAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 45, 2, 1, 3), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 16))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: limitIpMulticaststartIpAddr.setStatus('current')NEWLINEif mibBuilder.loadTexts: limitIpMulticaststartIpAddr.setDescription('The limit ip multicast IP address is used to set start ip')NEWLINElimitIpMulticastendIpAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 45, 2, 1, 4), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 16))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: limitIpMulticastendIpAddr.setStatus('current')NEWLINEif mibBuilder.loadTexts: limitIpMulticastendIpAddr.setDescription('The limit ip multicast IP address is used to set end ip')NEWLINElimitIpMulticastStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 45, 2, 1, 5), RowStatus()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: limitIpMulticastStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: limitIpMulticastStatus.setDescription('The status of an entry in the limit ip multicast entry Table. Only a subset of the rowstatus variables (active, createAndGo, destroy) are available.')NEWLINElimitIpMulticastPortTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 45, 3), )NEWLINEif mibBuilder.loadTexts: limitIpMulticastPortTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: limitIpMulticastPortTable.setDescription('A list of the limit ip multicast Port entry Table.')NEWLINElimitIpMulticastPortEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 45, 3, 1), ).setIndexNames((0, "DES-1210-28MEbx", "limitIpMulticastPortIPType"), (0, "DES-1210-28MEbx", "limitIpMulticastPortID"))NEWLINEif mibBuilder.loadTexts: limitIpMulticastPortEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: limitIpMulticastPortEntry.setDescription('A limit ip multicast entry maintain by the Port Index.')NEWLINElimitIpMulticastPortIPType = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 45, 3, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("ipv4", 1), ("ipv6", 2)))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: limitIpMulticastPortIPType.setStatus('current')NEWLINEif mibBuilder.loadTexts: limitIpMulticastPortIPType.setDescription('Indicate the IP type of entry.')NEWLINElimitIpMulticastPortID = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 45, 3, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 28))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: limitIpMulticastPortID.setStatus('current')NEWLINEif mibBuilder.loadTexts: limitIpMulticastPortID.setDescription('The Port Index of the limit ip multicast port entry. For all machines give maximum port number.')NEWLINElimitIpMulticastPortState = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 45, 3, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("permit", 1), ("deny", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: limitIpMulticastPortState.setStatus('current')NEWLINEif mibBuilder.loadTexts: limitIpMulticastPortState.setDescription('The limit ip multicast port state')NEWLINElimitIpMulticastPortProfileID = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 45, 3, 1, 4), PortList()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: limitIpMulticastPortProfileID.setStatus('current')NEWLINEif mibBuilder.loadTexts: limitIpMulticastPortProfileID.setDescription('The limit ip multicast port mapping profileID list.')NEWLINElimitIpMulticastPortMaxGrp = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 45, 3, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 256))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: limitIpMulticastPortMaxGrp.setStatus('current')NEWLINEif mibBuilder.loadTexts: limitIpMulticastPortMaxGrp.setDescription('The limit ip multicast per-port max group.')NEWLINEguestVlanName = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 24, 1), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 32))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: guestVlanName.setStatus('current')NEWLINEif mibBuilder.loadTexts: guestVlanName.setDescription('The VLAN name of guest VLAN.')NEWLINEguestVlanPort = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 24, 2), PortList()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: guestVlanPort.setStatus('current')NEWLINEif mibBuilder.loadTexts: guestVlanPort.setDescription('This object indicates the guest VLAN port members of this device.')NEWLINEguestVlanDelState = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 24, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("none", 1), ("start", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: guestVlanDelState.setStatus('current')NEWLINEif mibBuilder.loadTexts: guestVlanDelState.setDescription('Used to delete the guest VLAN.')NEWLINEprotocolGroupNameTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 101, 1), )NEWLINEif mibBuilder.loadTexts: protocolGroupNameTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: protocolGroupNameTable.setDescription('A table to control protocol group name features of the device.')NEWLINEprotocolGroupNameEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 101, 1, 1), ).setIndexNames((0, "DES-1210-28MEbx", "protocolGroupGID"))NEWLINEif mibBuilder.loadTexts: protocolGroupNameEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: protocolGroupNameEntry.setDescription('An entry appears in protocol group name table for each interface in the system.')NEWLINEprotocolGroupGID = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 101, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 16))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: protocolGroupGID.setStatus('current')NEWLINEif mibBuilder.loadTexts: protocolGroupGID.setDescription('The group ID of protocol group name table.')NEWLINEprotocolGroupName = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 101, 1, 1, 2), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 32))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: protocolGroupName.setStatus('current')NEWLINEif mibBuilder.loadTexts: protocolGroupName.setDescription('The group name of protocol group name table.')NEWLINEprotocolGroupTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 101, 2), )NEWLINEif mibBuilder.loadTexts: protocolGroupTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: protocolGroupTable.setDescription('A table to control protocol group features of the device.')NEWLINEprotocolGroupEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 101, 2, 1), ).setIndexNames((0, "DES-1210-28MEbx", "protocolGroupId"), (0, "DES-1210-28MEbx", "protocolGroupFrameType"), (0, "DES-1210-28MEbx", "protocolGroupProtocolValue"))NEWLINEif mibBuilder.loadTexts: protocolGroupEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: protocolGroupEntry.setDescription('An entry appears in protocol group table for each interface in the system.')NEWLINEprotocolGroupId = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 101, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 16))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: protocolGroupId.setStatus('current')NEWLINEif mibBuilder.loadTexts: protocolGroupId.setDescription('The group ID of protocol group table.')NEWLINEprotocolGroupFrameType = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 101, 2, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("ethernet", 1), ("ieee8023-snap", 2)))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: protocolGroupFrameType.setStatus('current')NEWLINEif mibBuilder.loadTexts: protocolGroupFrameType.setDescription('The frame type of protocol group table.')NEWLINEprotocolGroupProtocolValue = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 101, 2, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: protocolGroupProtocolValue.setStatus('current')NEWLINEif mibBuilder.loadTexts: protocolGroupProtocolValue.setDescription('The protocol value of protocol group table.')NEWLINEprotocolGroupRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 101, 2, 1, 99), RowStatus()).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: protocolGroupRowStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: protocolGroupRowStatus.setDescription('The row status of protocol group table.')NEWLINEprotocolVlanTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 101, 3), )NEWLINEif mibBuilder.loadTexts: protocolVlanTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: protocolVlanTable.setDescription('A table to control protocol vlan features of the device.')NEWLINEprotocolVlanEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 101, 3, 1), ).setIndexNames((0, "DES-1210-28MEbx", "protocolVlanPort"), (0, "DES-1210-28MEbx", "protocolVlanVID"), (0, "DES-1210-28MEbx", "protocolVlanGroupID"))NEWLINEif mibBuilder.loadTexts: protocolVlanEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: protocolVlanEntry.setDescription('An entry appears in protocol vlan table for each interface in the system.')NEWLINEprotocolVlanPort = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 101, 3, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 28))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: protocolVlanPort.setStatus('current')NEWLINEif mibBuilder.loadTexts: protocolVlanPort.setDescription('The interface number of protocol vlan table.')NEWLINEprotocolVlanVID = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 101, 3, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 4094))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: protocolVlanVID.setStatus('current')NEWLINEif mibBuilder.loadTexts: protocolVlanVID.setDescription('The vlan ID of protocol vlan table.')NEWLINEprotocolVlanGroupID = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 101, 3, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 16))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: protocolVlanGroupID.setStatus('current')NEWLINEif mibBuilder.loadTexts: protocolVlanGroupID.setDescription('The group ID of protocol vlan table.')NEWLINEprotocolVlanRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 101, 3, 1, 99), RowStatus()).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: protocolVlanRowStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: protocolVlanRowStatus.setDescription('The row status of protocol vlan table.')NEWLINEmacNotifyState = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 25, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: macNotifyState.setStatus('current')NEWLINEif mibBuilder.loadTexts: macNotifyState.setDescription('This object can enabled or disabled MAC Notification.')NEWLINEmacNotifyInterval = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 25, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: macNotifyInterval.setStatus('current')NEWLINEif mibBuilder.loadTexts: macNotifyInterval.setDescription('This object indicates the time interval in second for trigger the MAC notify message. ')NEWLINEmacNotifyHistorySize = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 25, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 500))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: macNotifyHistorySize.setStatus('current')NEWLINEif mibBuilder.loadTexts: macNotifyHistorySize.setDescription('This object indicates the history size of variation MAC in address table. The default value is 1 .')NEWLINEmacNotifyCtrlTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 25, 4), )NEWLINEif mibBuilder.loadTexts: macNotifyCtrlTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: macNotifyCtrlTable.setDescription('A table to control Loopback detection features either for the entire switch or for each interface in the switch.')NEWLINEmacNotifyCtrlEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 25, 4, 1), ).setIndexNames((0, "DES-1210-28MEbx", "macNotifyCtrlIndex"))NEWLINEif mibBuilder.loadTexts: macNotifyCtrlEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: macNotifyCtrlEntry.setDescription('An entry appears in this table for each interface in the system.')NEWLINEmacNotifyCtrlIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 25, 4, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 28))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: macNotifyCtrlIndex.setStatus('current')NEWLINEif mibBuilder.loadTexts: macNotifyCtrlIndex.setDescription('The interface index of the port for which the configuration in this entry applies. For all machines give maximum port number.')NEWLINEmacNotifyPortStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 25, 4, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2))).clone('disabled')).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: macNotifyPortStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: macNotifyPortStatus.setDescription('Provides control to per port enable or disable the loopback detection function. Default is disabled.')NEWLINEmacNotifyInfo = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 25, 5))NEWLINEmacNotifyInfoDiscription = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 25, 5, 1), OctetString().subtype(subtypeSpec=ValueSizeConstraint(1, 1024))).setMaxAccess("accessiblefornotify")NEWLINEif mibBuilder.loadTexts: macNotifyInfoDiscription.setStatus('current')NEWLINEif mibBuilder.loadTexts: macNotifyInfoDiscription.setDescription('This object indicates the information for the device MAC address changes. And the detailed information include: Operation Code + MAC address + Box ID + Port Number + Zero... Operation Code: 1, 2 and 3 1 means learned a new MAC address 2 means deleted an old MAC address. 3 means station movement. Box ID: The switch box ID, for standalone device, it always 1. Port Number: The port number learned or deleted for the box. Zero: Used to separate each message (Operate Code + MAC address + Box ID + Port Number).')NEWLINEsysBPDUAttackStateEnable = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 77, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2))).clone('disabled')).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sysBPDUAttackStateEnable.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysBPDUAttackStateEnable.setDescription('Use this to enable BPDU attack protection. The BPDU Attack Protection function and Spanning Tree Protocol for ports are mutually exclusive. When the STP function is enabled on a particular port, BPDU Attack Protection cannot be enabled.')NEWLINEsysBPDUAttackRecoverTime = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 77, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(60, 1000000), )).clone(60)).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sysBPDUAttackRecoverTime.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysBPDUAttackRecoverTime.setDescription('When a port enters under attack state, it can be disabled or blocked based on the configuration. The state can be recovered manually or by the auto recovery mechanism. This command is used to configure the auto-recovery timer. To manually recover the port, the user needs to disable and re-enable the port.')NEWLINEsysBPDUAttackCtrlTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 77, 3), )NEWLINEif mibBuilder.loadTexts: sysBPDUAttackCtrlTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysBPDUAttackCtrlTable.setDescription('A table to control BPDU Attack features either for the entire switch or for each interface in the switch.')NEWLINEsysBPDUAttackCtrlEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 77, 3, 1), ).setIndexNames((0, "DES-1210-28MEbx", "sysBPDUAttackCtrlIndex"))NEWLINEif mibBuilder.loadTexts: sysBPDUAttackCtrlEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysBPDUAttackCtrlEntry.setDescription('An entry appears in this table for each interface in the system.')NEWLINEsysBPDUAttackCtrlIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 77, 3, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 28))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: sysBPDUAttackCtrlIndex.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysBPDUAttackCtrlIndex.setDescription('The interface index of the port for which the configuration in this entry applies. For all machines give maximum port number.')NEWLINEsysBPDUAttackPortState = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 77, 3, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2))).clone('disabled')).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sysBPDUAttackPortState.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysBPDUAttackPortState.setDescription('Used to configure the BPDU Attack Protection state of a port. The default state is disable.')NEWLINEsysBPDUAttackPortMode = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 77, 3, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("drop", 1), ("block", 2), ("shutdown", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sysBPDUAttackPortMode.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysBPDUAttackPortMode.setDescription('Used to configure the BPDU Attack Protection mode of a port.')NEWLINEsysBPDUAttackPortStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 77, 3, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("normal", 1), ("underAttack", 2))).clone('normal')).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: sysBPDUAttackPortStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysBPDUAttackPortStatus.setDescription('Use this to view per port BPDU attack protection status.')NEWLINEsysBPDUAttackLog = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 77, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("none", 1), ("attackDetected", 2), ("attackCleared", 3), ("both", 4))).clone('none')).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sysBPDUAttackLog.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysBPDUAttackLog.setDescription('Used to configure log settings for BPDU attack protection events.')NEWLINEvlanTrunkSystem = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 36, 1))NEWLINEvlanTrunkGlobalStatus = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 36, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: vlanTrunkGlobalStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: vlanTrunkGlobalStatus.setDescription('This indicates the global state of the VLAN trunking feature of the device.')NEWLINEvlanTrunkTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 36, 1, 2), )NEWLINEif mibBuilder.loadTexts: vlanTrunkTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: vlanTrunkTable.setDescription('This table is used to manage the VLAN trunking feature of the device.')NEWLINEvlanTrunkEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 36, 1, 2, 1), ).setIndexNames((0, "DES-1210-28MEbx", "vlanTrunkIfIndex"))NEWLINEif mibBuilder.loadTexts: vlanTrunkEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: vlanTrunkEntry.setDescription('There is one entry in this table for each created port-channel port.')NEWLINEvlanTrunkIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 36, 1, 2, 1, 1), InterfaceIndex()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: vlanTrunkIfIndex.setStatus('current')NEWLINEif mibBuilder.loadTexts: vlanTrunkIfIndex.setDescription('The index of the port. ')NEWLINEvlanTrunkState = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 36, 1, 2, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: vlanTrunkState.setStatus('current')NEWLINEif mibBuilder.loadTexts: vlanTrunkState.setDescription('Sets the VLAN trunk status as enabled or disabled.')NEWLINEqinqSystem = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 37, 1))NEWLINEqinqVLANTranslation = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 37, 2))NEWLINEqinqGlobalStatus = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 37, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: qinqGlobalStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: qinqGlobalStatus.setDescription('This object is used to enable/disable the Q-in-Q status.')NEWLINEqinqTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 37, 1, 2), )NEWLINEif mibBuilder.loadTexts: qinqTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: qinqTable.setDescription('A table that contains Q-in-Q VLAN mode information about each port.')NEWLINEqinqEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 37, 1, 2, 1), ).setIndexNames((0, "DES-1210-28MEbx", "qinqIfIndex"))NEWLINEif mibBuilder.loadTexts: qinqEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: qinqEntry.setDescription('A list of Q-in-Q VLAN mode information for each port.')NEWLINEqinqIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 37, 1, 2, 1, 1), InterfaceIndex()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: qinqIfIndex.setStatus('current')NEWLINEif mibBuilder.loadTexts: qinqIfIndex.setDescription('The index of the port. ')NEWLINEqinqRoleState = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 37, 1, 2, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("nni", 1), ("uni", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: qinqRoleState.setStatus('current')NEWLINEif mibBuilder.loadTexts: qinqRoleState.setDescription('Sets the QinQ Role as NNI or UNI.')NEWLINEqinqOuterTPID = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 37, 1, 2, 1, 3), Unsigned32()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: qinqOuterTPID.setStatus('current')NEWLINEif mibBuilder.loadTexts: qinqOuterTPID.setDescription('Sets the QinQ Outer TPID value.')NEWLINEqinqTrustCVIDState = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 37, 1, 2, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: qinqTrustCVIDState.setStatus('current')NEWLINEif mibBuilder.loadTexts: qinqTrustCVIDState.setDescription('Sets the QinQ Trust CVID state as enabled or disabled.')NEWLINEqinqVLANTranslationState = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 37, 1, 2, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: qinqVLANTranslationState.setStatus('current')NEWLINEif mibBuilder.loadTexts: qinqVLANTranslationState.setDescription('Sets the QinQ VLANTranslation state as enabled or disabled.')NEWLINEqinqVlanTranslationCVIDTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 37, 2, 1), )NEWLINEif mibBuilder.loadTexts: qinqVlanTranslationCVIDTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: qinqVlanTranslationCVIDTable.setDescription("A table that contains VLAN translation information applied in enabling port's swQinQPortVlanTranslation, swQinQPortTrustCVID and QinQ.")NEWLINEqinqVlanTranslationCVIDEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 37, 2, 1, 1), ).setIndexNames((0, "DES-1210-28MEbx", "qinqVlanTranslationCVID"))NEWLINEif mibBuilder.loadTexts: qinqVlanTranslationCVIDEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: qinqVlanTranslationCVIDEntry.setDescription("A list of VLAN translation information applied in enabling a port's swQinQPortVlanTranslation, swQinQPortTrustCVID and QinQ.")NEWLINEqinqVlanTranslationCVID = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 37, 2, 1, 1, 1), Unsigned32()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: qinqVlanTranslationCVID.setStatus('current')NEWLINEif mibBuilder.loadTexts: qinqVlanTranslationCVID.setDescription('The customer VLAN identifier in a C-TAG.')NEWLINEqinqVlanTranslationSVID = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 37, 2, 1, 1, 2), Unsigned32()).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: qinqVlanTranslationSVID.setStatus('current')NEWLINEif mibBuilder.loadTexts: qinqVlanTranslationSVID.setDescription('A VLAN identifier conveyed in an S-TAG.')NEWLINEqinqVlanTranslationSVIDOperation = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 37, 2, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("add", 1), ("replace", 2)))).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: qinqVlanTranslationSVIDOperation.setStatus('current')NEWLINEif mibBuilder.loadTexts: qinqVlanTranslationSVIDOperation.setDescription("The 'add' action indicates to add a tag for the assigned SP-VLAN before the C-VLAN tag. If there is S-TAG in the packet, this rule will not take effect. The 'replace' action indicates to replace the C-VLAN in the tag by the SP-VLAN. If there is no C-TAG in the packet, this rule will not take effect.")NEWLINEqinqVlanTranslationCVIDRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 37, 2, 1, 1, 4), RowStatus()).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: qinqVlanTranslationCVIDRowStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: qinqVlanTranslationCVIDRowStatus.setDescription('This object indicates the status of this entry.')NEWLINEeoamSystem = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 51, 1))NEWLINEeoamLinkMonitor = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 51, 2))NEWLINEeoamTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 51, 1, 2), )NEWLINEif mibBuilder.loadTexts: eoamTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: eoamTable.setDescription('A table that contains EOAM mode information about each port.')NEWLINEeoamEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 51, 1, 2, 1), ).setIndexNames((0, "DES-1210-28MEbx", "eoamIfIndex"))NEWLINEif mibBuilder.loadTexts: eoamEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: eoamEntry.setDescription('A list of EOAM mode information for each port.')NEWLINEeoamIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 51, 1, 2, 1, 1), InterfaceIndex()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: eoamIfIndex.setStatus('current')NEWLINEif mibBuilder.loadTexts: eoamIfIndex.setDescription('The index of the port. ')NEWLINEeoamState = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 51, 1, 2, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: eoamState.setStatus('current')NEWLINEif mibBuilder.loadTexts: eoamState.setDescription('Sets the EOAM state enabled or disabled.')NEWLINEeoamMode = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 51, 1, 2, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("passive", 1), ("active", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: eoamMode.setStatus('current')NEWLINEif mibBuilder.loadTexts: eoamMode.setDescription('Sets the EOAM mode as active or passive.')NEWLINEeoamReceivedRemoteLoopback = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 51, 1, 2, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("ignore", 1), ("process", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: eoamReceivedRemoteLoopback.setStatus('current')NEWLINEif mibBuilder.loadTexts: eoamReceivedRemoteLoopback.setDescription('Sets the EOAM received or ignore remote loopback packets.')NEWLINEeoamRemoteLoopback = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 51, 1, 2, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6))).clone(namedValues=NamedValues(("noLoopBack", 1), ("startLoopBack", 2), ("remoteLoopBack", 3), ("stopLoopBack", 4), ("localLoopBack", 5), ("unknownLoopBack", 6)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: eoamRemoteLoopback.setStatus('current')NEWLINEif mibBuilder.loadTexts: eoamRemoteLoopback.setDescription('Sets the EOAM remote loopback start or stop.')NEWLINEeoamDyingGaspEnable = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 51, 1, 2, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: eoamDyingGaspEnable.setStatus('current')NEWLINEif mibBuilder.loadTexts: eoamDyingGaspEnable.setDescription('Sets the EOAM dying gasp state enabled or disabled.')NEWLINEeoamCriticalEventEnable = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 51, 1, 2, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: eoamCriticalEventEnable.setStatus('current')NEWLINEif mibBuilder.loadTexts: eoamCriticalEventEnable.setDescription('Sets the EOAM critical event state enabled or disabled.')NEWLINEeoamLinkMonitorTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 51, 2, 1), )NEWLINEif mibBuilder.loadTexts: eoamLinkMonitorTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: eoamLinkMonitorTable.setDescription('A table that contains EOAM link monitor information about each port.')NEWLINEeoamLinkMonitorEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 51, 2, 1, 1), ).setIndexNames((0, "DES-1210-28MEbx", "eoamLinkMonitorIfIndex"))NEWLINEif mibBuilder.loadTexts: eoamLinkMonitorEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: eoamLinkMonitorEntry.setDescription('A list of EOAM link monitor information for each port.')NEWLINEeoamLinkMonitorIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 51, 2, 1, 1, 1), InterfaceIndex()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: eoamLinkMonitorIfIndex.setStatus('current')NEWLINEif mibBuilder.loadTexts: eoamLinkMonitorIfIndex.setDescription('The index of the port. ')NEWLINEerrorSymbolNotifyState = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 51, 2, 1, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: errorSymbolNotifyState.setStatus('current')NEWLINEif mibBuilder.loadTexts: errorSymbolNotifyState.setDescription('Sets the EOAM error symbol notify state enabled or disabled.')NEWLINEerrorSymbolThreshold = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 51, 2, 1, 1, 3), Unsigned32()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: errorSymbolThreshold.setStatus('current')NEWLINEif mibBuilder.loadTexts: errorSymbolThreshold.setDescription('Sets the EOAM error symbol threshold.')NEWLINEerrorSymbolWindow = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 51, 2, 1, 1, 4), Unsigned32()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: errorSymbolWindow.setStatus('current')NEWLINEif mibBuilder.loadTexts: errorSymbolWindow.setDescription('Sets the EOAM error symbol window.')NEWLINEerrorFrameNotifyState = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 51, 2, 1, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: errorFrameNotifyState.setStatus('current')NEWLINEif mibBuilder.loadTexts: errorFrameNotifyState.setDescription('Sets the EOAM error frame notify state enabled or disabled.')NEWLINEerrorFrameThreshold = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 51, 2, 1, 1, 6), Unsigned32()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: errorFrameThreshold.setStatus('current')NEWLINEif mibBuilder.loadTexts: errorFrameThreshold.setDescription('Sets the EOAM error frame threshold.')NEWLINEerrorFrameWindow = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 51, 2, 1, 1, 7), Unsigned32()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: errorFrameWindow.setStatus('current')NEWLINEif mibBuilder.loadTexts: errorFrameWindow.setDescription('Sets the EOAM error symbol window.')NEWLINEerrorFrameSecondsNotifyState = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 51, 2, 1, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: errorFrameSecondsNotifyState.setStatus('current')NEWLINEif mibBuilder.loadTexts: errorFrameSecondsNotifyState.setDescription('Sets the EOAM error symbol notify state enabled or disabled.')NEWLINEerrorFrameSecondsThreshold = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 51, 2, 1, 1, 9), Unsigned32()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: errorFrameSecondsThreshold.setStatus('current')NEWLINEif mibBuilder.loadTexts: errorFrameSecondsThreshold.setDescription('Sets the EOAM error symbol threshold.')NEWLINEerrorFrameSecondsWindow = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 51, 2, 1, 1, 10), Unsigned32()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: errorFrameSecondsWindow.setStatus('current')NEWLINEif mibBuilder.loadTexts: errorFrameSecondsWindow.setDescription('Sets the EOAM error symbol window.')NEWLINEerrorFramePeriodNotifyState = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 51, 2, 1, 1, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: errorFramePeriodNotifyState.setStatus('current')NEWLINEif mibBuilder.loadTexts: errorFramePeriodNotifyState.setDescription('Sets the EOAM error symbol notify state enabled or disabled.')NEWLINEerrorFramePeriodThreshold = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 51, 2, 1, 1, 12), Unsigned32()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: errorFramePeriodThreshold.setStatus('current')NEWLINEif mibBuilder.loadTexts: errorFramePeriodThreshold.setDescription('Sets the EOAM error symbol threshold.')NEWLINEerrorFramePeriodWindow = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 51, 2, 1, 1, 13), Unsigned32()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: errorFramePeriodWindow.setStatus('current')NEWLINEif mibBuilder.loadTexts: errorFramePeriodWindow.setDescription('Sets the EOAM error symbol window.')NEWLINEduldSystem = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 52, 1))NEWLINEduldTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 52, 1, 1), )NEWLINEif mibBuilder.loadTexts: duldTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: duldTable.setDescription('A table that contains DULD mode information about each port.')NEWLINEduldEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 52, 1, 1, 1), ).setIndexNames((0, "DES-1210-28MEbx", "duldIfIndex"))NEWLINEif mibBuilder.loadTexts: duldEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: duldEntry.setDescription('A list of DULD mode information for each port.')NEWLINEduldIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 52, 1, 1, 1, 1), InterfaceIndex()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: duldIfIndex.setStatus('current')NEWLINEif mibBuilder.loadTexts: duldIfIndex.setDescription('The index of the port. ')NEWLINEduldState = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 52, 1, 1, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: duldState.setStatus('current')NEWLINEif mibBuilder.loadTexts: duldState.setDescription('Sets the DULD admin state enabled or disabled.')NEWLINEduldOperState = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 52, 1, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: duldOperState.setStatus('current')NEWLINEif mibBuilder.loadTexts: duldOperState.setDescription('Gets the DULD Oper state enabled or disabled.')NEWLINEduldMode = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 52, 1, 1, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("shutdown", 1), ("normal", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: duldMode.setStatus('current')NEWLINEif mibBuilder.loadTexts: duldMode.setDescription('Sets the DULD mode as shutdown or normal.')NEWLINEduldLinkStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 52, 1, 1, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("unknow", 1), ("bidirectional", 2), ("txFault", 3), ("rxFault", 4), ("linkDown", 5)))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: duldLinkStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: duldLinkStatus.setDescription('Gets the DULD link status.')NEWLINEduldDiscoveryTime = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 52, 1, 1, 1, 6), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(5, 65535))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: duldDiscoveryTime.setStatus('current')NEWLINEif mibBuilder.loadTexts: duldDiscoveryTime.setDescription('Sets the DULD discovery time.')NEWLINEduldRecoverTime = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 52, 1, 2), Unsigned32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(60, 1000000), )).clone(60)).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: duldRecoverTime.setStatus('current')NEWLINEif mibBuilder.loadTexts: duldRecoverTime.setDescription('Duld auto recover time.')NEWLINEdoSCtrlTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 99, 1), )NEWLINEif mibBuilder.loadTexts: doSCtrlTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: doSCtrlTable.setDescription('A table that holds the DoS prevention settings of the device.')NEWLINEdoSCtrlEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 99, 1, 1), ).setIndexNames((0, "DES-1210-28MEbx", "doSCtrlType"))NEWLINEif mibBuilder.loadTexts: doSCtrlEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: doSCtrlEntry.setDescription('A list of DoS prevention settings of the device.')NEWLINEdoSCtrlType = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 99, 1, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7))).clone(namedValues=NamedValues(("land-attack", 1), ("blat-attack", 2), ("smurf-attack", 3), ("tcp-null-scan", 4), ("tcp-xmascan", 5), ("tcp-synfin", 6), ("tcp-syn-srcport-less-1024", 7)))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: doSCtrlType.setStatus('current')NEWLINEif mibBuilder.loadTexts: doSCtrlType.setDescription('This object indicates the DoS prevention type.')NEWLINEdoSCtrlState = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 99, 1, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("disabled", 0), ("enabled", 1)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: doSCtrlState.setStatus('current')NEWLINEif mibBuilder.loadTexts: doSCtrlState.setDescription('This object indicates the status of the DoS prevention type.')NEWLINEdoSCtrlActionType = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 99, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("drop", 0), ("mirror", 1)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: doSCtrlActionType.setStatus('current')NEWLINEif mibBuilder.loadTexts: doSCtrlActionType.setDescription("This object indicates the action for the DoS prevention type. If this object is set to 'mirror' and DoSCtrlState is set to 'enable', the configuration will not take effect until a valid mirror port is specified. If mirror port is not valid the behavior will be the same as 'drop'")NEWLINEdoSCtrlMirrorPort = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 99, 1, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: doSCtrlMirrorPort.setStatus('current')NEWLINEif mibBuilder.loadTexts: doSCtrlMirrorPort.setDescription("This object indicates the port to which the attack packet will be forwarded. A value of 0 means that the DoS prevention action type is either not set to 'mirror'. or the 'mirror' DoS action is not active. When DoSCtrlActionType is set to 'mirror' with DoSCtrlState set to 'enable', setting this value to a valid port number will activate the 'mirror' DoS action.")NEWLINEdoSCtrlMirrorReplace1P = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 99, 1, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 7))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: doSCtrlMirrorReplace1P.setStatus('current')NEWLINEif mibBuilder.loadTexts: doSCtrlMirrorReplace1P.setDescription('This object indicates the packet to which the attack packet will be replaced 1p to mirror port. The Range of 1p is 0 ~ 7. If value set to -1, it means no chenged.')NEWLINEdoSCtrlMirrorRxRate = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 99, 1, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 1024000))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: doSCtrlMirrorRxRate.setStatus('current')NEWLINEif mibBuilder.loadTexts: doSCtrlMirrorRxRate.setDescription('This object indicates the packet to which the attack packet will be rate limited to mirror port. The Range of rx limit is 0 or 64~1024000. If rate set to 0, it means no limit.')NEWLINEdoSCtrlFrameCount = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 99, 1, 1, 7), Integer32()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: doSCtrlFrameCount.setStatus('current')NEWLINEif mibBuilder.loadTexts: doSCtrlFrameCount.setDescription('This object indicates the frame counts of the DoS prevention type.')NEWLINEdoSCtrlClearFrameCount = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 99, 1, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("normal", 0), ("clear", 1)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: doSCtrlClearFrameCount.setStatus('current')NEWLINEif mibBuilder.loadTexts: doSCtrlClearFrameCount.setDescription('This object will clear frame count when set to clear.')NEWLINEdosCtrlTrapLogState = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 99, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("disabled", 0), ("enabled", 1))).clone('disabled')).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: dosCtrlTrapLogState.setStatus('current')NEWLINEif mibBuilder.loadTexts: dosCtrlTrapLogState.setDescription('Enable/Disable Dos Trap Log function. Default is disabled.')NEWLINEswTimeRangeSettingTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 38, 1), )NEWLINEif mibBuilder.loadTexts: swTimeRangeSettingTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: swTimeRangeSettingTable.setDescription('A table to configure time Range in the system.')NEWLINEswTimeRangeSettingEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 38, 1, 1), ).setIndexNames((0, "DES-1210-28MEbx", "swTimeRangeIndex"))NEWLINEif mibBuilder.loadTexts: swTimeRangeSettingEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: swTimeRangeSettingEntry.setDescription('A schedule entry to configure time Range in the system.')NEWLINEswTimeRangeIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 38, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 52))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: swTimeRangeIndex.setStatus('current')NEWLINEif mibBuilder.loadTexts: swTimeRangeIndex.setDescription('The Time Range identifier. The maximum number of Schedule entry is the number of ports supported PoE function. The value must be between 1 and 52.')NEWLINEswTimeRangeName = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 38, 1, 1, 2), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 20))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: swTimeRangeName.setStatus('current')NEWLINEif mibBuilder.loadTexts: swTimeRangeName.setDescription("The Schedule name associated with the Schedule entry (e.g., `abc, bbb').")NEWLINEswTimeRangeDate = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 38, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: swTimeRangeDate.setStatus('current')NEWLINEif mibBuilder.loadTexts: swTimeRangeDate.setDescription('Enable/Disable date range checking while executing time base PoE.')NEWLINEswTimeRangeStartYear = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 38, 1, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023, 2024, 2025, 2026, 2027, 2028, 2029, 2030, 2031, 2032, 2033, 2034, 2035, 2036, 2037))).clone(namedValues=NamedValues(("y2009", 2009), ("y2010", 2010), ("y2011", 2011), ("y2012", 2012), ("y2013", 2013), ("y2014", 2014), ("y2015", 2015), ("y2016", 2016), ("y2017", 2017), ("y2018", 2018), ("y2019", 2019), ("y2020", 2020), ("y2021", 2021), ("y2022", 2022), ("y2023", 2023), ("y2024", 2024), ("y2025", 2025), ("y2026", 2026), ("y2027", 2027), ("y2028", 2028), ("y2029", 2029), ("y2030", 2030), ("y2031", 2031), ("y2032", 2032), ("y2033", 2033), ("y2034", 2034), ("y2035", 2035), ("y2036", 2036), ("y2037", 2037)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: swTimeRangeStartYear.setStatus('current')NEWLINEif mibBuilder.loadTexts: swTimeRangeStartYear.setDescription('Start year of the Schedule entry.')NEWLINEswTimeRangeStartMonth = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 38, 1, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12))).clone(namedValues=NamedValues(("january", 1), ("february", 2), ("march", 3), ("april", 4), ("may", 5), ("june", 6), ("july", 7), ("august", 8), ("september", 9), ("october", 10), ("november", 11), ("december", 12)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: swTimeRangeStartMonth.setStatus('current')NEWLINEif mibBuilder.loadTexts: swTimeRangeStartMonth.setDescription('Start month of the Schedule entry.')NEWLINEswTimeRangeStartDay = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 38, 1, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 31))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: swTimeRangeStartDay.setStatus('current')NEWLINEif mibBuilder.loadTexts: swTimeRangeStartDay.setDescription('Start day of the Schedule entry. The value must be from 1 to 31.')NEWLINEswTimeRangeStartHour = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 38, 1, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 23))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: swTimeRangeStartHour.setStatus('current')NEWLINEif mibBuilder.loadTexts: swTimeRangeStartHour.setDescription('Start hour of the Schedule entry. The value must be from 0 to 23.')NEWLINEswTimeRangeStartMinute = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 38, 1, 1, 8), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 59))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: swTimeRangeStartMinute.setStatus('current')NEWLINEif mibBuilder.loadTexts: swTimeRangeStartMinute.setDescription('Start minute of the Schedule entry. The value must be from 0 to 59.')NEWLINEswTimeRangeEndYear = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 38, 1, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023, 2024, 2025, 2026, 2027, 2028, 2029, 2030, 2031, 2032, 2033, 2034, 2035, 2036, 2037))).clone(namedValues=NamedValues(("y2009", 2009), ("y2010", 2010), ("y2011", 2011), ("y2012", 2012), ("y2013", 2013), ("y2014", 2014), ("y2015", 2015), ("y2016", 2016), ("y2017", 2017), ("y2018", 2018), ("y2019", 2019), ("y2020", 2020), ("y2021", 2021), ("y2022", 2022), ("y2023", 2023), ("y2024", 2024), ("y2025", 2025), ("y2026", 2026), ("y2027", 2027), ("y2028", 2028), ("y2029", 2029), ("y2030", 2030), ("y2031", 2031), ("y2032", 2032), ("y2033", 2033), ("y2034", 2034), ("y2035", 2035), ("y2036", 2036), ("y2037", 2037)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: swTimeRangeEndYear.setStatus('current')NEWLINEif mibBuilder.loadTexts: swTimeRangeEndYear.setDescription('End year of the Schedule entry.')NEWLINEswTimeRangeEndMonth = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 38, 1, 1, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12))).clone(namedValues=NamedValues(("january", 1), ("february", 2), ("march", 3), ("april", 4), ("may", 5), ("june", 6), ("july", 7), ("august", 8), ("september", 9), ("october", 10), ("november", 11), ("december", 12)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: swTimeRangeEndMonth.setStatus('current')NEWLINEif mibBuilder.loadTexts: swTimeRangeEndMonth.setDescription('End month of the Schedule entry.')NEWLINEswTimeRangeEndDay = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 38, 1, 1, 11), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 31))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: swTimeRangeEndDay.setStatus('current')NEWLINEif mibBuilder.loadTexts: swTimeRangeEndDay.setDescription('End day of the Schedule entry. The value must be from 1 to 31.')NEWLINEswTimeRangeEndHour = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 38, 1, 1, 12), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 23))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: swTimeRangeEndHour.setStatus('current')NEWLINEif mibBuilder.loadTexts: swTimeRangeEndHour.setDescription('End hour of the Schedule entry. The value must be from 0 to 23.')NEWLINEswTimeRangeEndMinute = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 38, 1, 1, 13), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 59))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: swTimeRangeEndMinute.setStatus('current')NEWLINEif mibBuilder.loadTexts: swTimeRangeEndMinute.setDescription('End minute of the Schedule entry. The value must be from 0 to 59.')NEWLINEswTimeRangeMonday = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 38, 1, 1, 14), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2))).clone('disable')).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: swTimeRangeMonday.setStatus('current')NEWLINEif mibBuilder.loadTexts: swTimeRangeMonday.setDescription('Enable/Disble scheduling Monday.')NEWLINEswTimeRangeTuesday = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 38, 1, 1, 15), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2))).clone('disable')).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: swTimeRangeTuesday.setStatus('current')NEWLINEif mibBuilder.loadTexts: swTimeRangeTuesday.setDescription('Enable/Disble scheduling Tuesday.')NEWLINEswTimeRangeWednesday = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 38, 1, 1, 16), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2))).clone('disable')).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: swTimeRangeWednesday.setStatus('current')NEWLINEif mibBuilder.loadTexts: swTimeRangeWednesday.setDescription('Enable/Disble scheduling Wednesday.')NEWLINEswTimeRangeThursday = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 38, 1, 1, 17), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2))).clone('disable')).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: swTimeRangeThursday.setStatus('current')NEWLINEif mibBuilder.loadTexts: swTimeRangeThursday.setDescription('Enable/Disble scheduling Thursday.')NEWLINEswTimeRangeFriday = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 38, 1, 1, 18), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2))).clone('disable')).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: swTimeRangeFriday.setStatus('current')NEWLINEif mibBuilder.loadTexts: swTimeRangeFriday.setDescription('Enable/Disble scheduling Friday.')NEWLINEswTimeRangeSaturday = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 38, 1, 1, 19), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2))).clone('disable')).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: swTimeRangeSaturday.setStatus('current')NEWLINEif mibBuilder.loadTexts: swTimeRangeSaturday.setDescription('Enable/Disble scheduling Saturday.')NEWLINEswTimeRangeSunday = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 38, 1, 1, 20), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2))).clone('disable')).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: swTimeRangeSunday.setStatus('current')NEWLINEif mibBuilder.loadTexts: swTimeRangeSunday.setDescription('Enable/Disble scheduling Sunday.')NEWLINEswTimeRangeRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 38, 1, 1, 21), RowStatus()).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: swTimeRangeRowStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: swTimeRangeRowStatus.setDescription('The status of an entry in the Time Range Information Table. Only a subset of the rowstatus variables (active, notinservice, createAndWait, destroy) are available.')NEWLINEdlinklldpState = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2))).clone('disable')).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: dlinklldpState.setStatus('current')NEWLINEif mibBuilder.loadTexts: dlinklldpState.setDescription('This object is used for enabling or disabling LLDP in the system.')NEWLINEdlinklldpMsgHoldMultiplier = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(2, 10))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: dlinklldpMsgHoldMultiplier.setStatus('current')NEWLINEif mibBuilder.loadTexts: dlinklldpMsgHoldMultiplier.setDescription('The time-to-live value expressed as a multiple of the lldpMessageTxInterval object.The actual time-to-live value used in LLDP frames, transmitted on behalf of this LLDP agent, can be expressed by the following formula: TTL = min(65535, (lldpMessageTxInterval * lldpMessageTxHoldMultiplier))')NEWLINEdlinklldpMsgTxInterval = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(5, 32768))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: dlinklldpMsgTxInterval.setStatus('current')NEWLINEif mibBuilder.loadTexts: dlinklldpMsgTxInterval.setDescription('This object is used for LLDP packet update frequency. The timer in units of seconds.')NEWLINEdlinklldpReinitDelay = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 10))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: dlinklldpReinitDelay.setStatus('current')NEWLINEif mibBuilder.loadTexts: dlinklldpReinitDelay.setDescription('This object is used for LLDP Reinitialization Delay. The timer in units of seconds.')NEWLINEdlinklldpTxDelay = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 8192))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: dlinklldpTxDelay.setStatus('current')NEWLINEif mibBuilder.loadTexts: dlinklldpTxDelay.setDescription('The lldpTxDelay indicates the delay (in units of seconds) between successive LLDP frame transmissions initiated by value/status changes in the LLDP local systems MIB. The recommended value for the lldpTxDelay is set by the following formula: 1 <= lldpTxDelay <= (0.25 * lldpMessageTxInterval).')NEWLINEdlinklldpConfigManAddrPortsTxEnable = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 6), PortList()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: dlinklldpConfigManAddrPortsTxEnable.setReference('IEEE 802.1AB-2005 10.2.1.1')NEWLINEif mibBuilder.loadTexts: dlinklldpConfigManAddrPortsTxEnable.setStatus('current')NEWLINEif mibBuilder.loadTexts: dlinklldpConfigManAddrPortsTxEnable.setDescription('A set of ports that are identified by a PortList, in which each port is represented as a bit. The corresponding local system management address instance will be transmitted on the member ports of the lldpManAddrPortsTxEnable. The default value for lldpConfigManAddrPortsTxEnable object is empty binary string, which means no ports are specified for advertising indicated management address instance.')NEWLINEclass LldpPortNumber(TextualConvention, Integer32):NEWLINE description = "Each port contained in the chassis (that is known to the LLDP agent) is uniquely identified by a port number. A port number has no mandatory relationship to an InterfaceIndex object (of the interfaces MIB, IETF RFC 2863). If the LLDP agent is a IEEE 802.1D, IEEE 802.1Q bridge, the LldpPortNumber will have the same value as the dot1dBasePort object (defined in IETF RFC 1493) associated corresponding bridge port. If the system hosting LLDP agent is not an IEEE 802.1D or an IEEE 802.1Q bridge, the LldpPortNumber will have the same value as the corresponding interface's InterfaceIndex object. Port numbers should be in the range of 1 and 4096 since a particular port is also represented by the corresponding port number bit in LldpPortList."NEWLINE status = 'current'NEWLINE displayHint = 'd'NEWLINE subtypeSpec = Integer32.subtypeSpec + ValueRangeConstraint(1, 4096)NEWLINENEWLINElldpPortConfigTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 11), )NEWLINEif mibBuilder.loadTexts: lldpPortConfigTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: lldpPortConfigTable.setDescription('The table that controls LLDP frame transmission on individual ports.')NEWLINElldpPortConfigEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 11, 1), ).setIndexNames((0, "DES-1210-28MEbx", "lldpPortConfigPortNum"))NEWLINEif mibBuilder.loadTexts: lldpPortConfigEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: lldpPortConfigEntry.setDescription('LLDP configuration information for a particular port. This configuration parameter controls the transmission and the reception of LLDP frames on those ports whose rows are created in this table.')NEWLINElldpPortConfigPortNum = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 11, 1, 1), LldpPortNumber())NEWLINEif mibBuilder.loadTexts: lldpPortConfigPortNum.setStatus('current')NEWLINEif mibBuilder.loadTexts: lldpPortConfigPortNum.setDescription('The index value used to identify the port component (contained in the local chassis with the LLDP agent) associated with this entry. The value of this object is used as a port index to the lldpPortConfigTable.')NEWLINElldpPortConfigAdminStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 11, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("txOnly", 1), ("rxOnly", 2), ("txAndRx", 3), ("disabled", 4))).clone('txAndRx')).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: lldpPortConfigAdminStatus.setReference('IEEE 802.1AB-2005 10.5.1')NEWLINEif mibBuilder.loadTexts: lldpPortConfigAdminStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: lldpPortConfigAdminStatus.setDescription("The administratively desired status of the local LLDP agent. If the associated lldpPortConfigAdminStatus object has a value of 'txOnly(1)', then LLDP agent will transmit LLDP frames on this port and it will not store any information about the remote systems connected. If the associated lldpPortConfigAdminStatus object has a value of 'rxOnly(2)', then the LLDP agent will receive, but it will not transmit LLDP frames on this port. If the associated lldpPortConfigAdminStatus object has a value of 'txAndRx(3)', then the LLDP agent will transmit and receive LLDP frames on this port. If the associated lldpPortConfigAdminStatus object has a value of 'disabled(4)', then LLDP agent will not transmit or receive LLDP frames on this port. If there is remote systems information which is received on this port and stored in other tables, before the port's lldpPortConfigAdminStatus becomes disabled, then the information will naturally age out.")NEWLINElldpPortConfigNotificationEnable = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 11, 1, 3), TruthValue().clone('false')).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: lldpPortConfigNotificationEnable.setStatus('current')NEWLINEif mibBuilder.loadTexts: lldpPortConfigNotificationEnable.setDescription('The lldpPortConfigNotificationEnable controls, on a per port basis, whether or not notifications from the agent are enabled. The value true(1) means that notifications are enabled; the value false(2) means that they are not.')NEWLINElldpPortConfigTLVsTxEnable = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 11, 1, 4), Bits().clone(namedValues=NamedValues(("portDesc", 0), ("sysName", 1), ("sysDesc", 2), ("sysCap", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: lldpPortConfigTLVsTxEnable.setReference('IEEE 802.1AB-2005 10.2.1.1')NEWLINEif mibBuilder.loadTexts: lldpPortConfigTLVsTxEnable.setStatus('current')NEWLINEif mibBuilder.loadTexts: lldpPortConfigTLVsTxEnable.setDescription("The lldpPortConfigTLVsTxEnable, defined as a bitmap, includes the basic set of LLDP TLVs whose transmission is allowed on the local LLDP agent by the network management. Each bit in the bitmap corresponds to a TLV type associated with a specific optional TLV. It should be noted that the organizationally-specific TLVs are excluded from the lldpTLVsTxEnable bitmap. LLDP Organization Specific Information Extension MIBs should have similar configuration object to control transmission of their organizationally defined TLVs. The bit 'portDesc(0)' indicates that LLDP agent should transmit 'Port Description TLV'. The bit 'sysName(1)' indicates that LLDP agent should transmit 'System Name TLV'. The bit 'sysDesc(2)' indicates that LLDP agent should transmit 'System Description TLV'. The bit 'sysCap(3)' indicates that LLDP agent should transmit 'System Capabilities TLV'. There is no bit reserved for the management address TLV type since transmission of management address TLVs are controlled by another object, lldpConfigManAddrTable. The default value for lldpPortConfigTLVsTxEnable object is empty set, which means no enumerated values are set. The value of this object must be restored from non-volatile storage after a re-initialization of the management system.")NEWLINElldpXdot3Objects = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 12))NEWLINElldpXdot3Config = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 12, 1))NEWLINElldpXdot3LocalData = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 12, 2))NEWLINElldpXdot3RemoteData = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 12, 3))NEWLINEclass LldpPowerPortClass(TextualConvention, Integer32):NEWLINE description = 'This TC describes the Power over Ethernet (PoE) port class.'NEWLINE status = 'current'NEWLINE subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2))NEWLINE namedValues = NamedValues(("pClassPSE", 1), ("pClassPD", 2))NEWLINENEWLINEclass LldpLinkAggStatusMap(TextualConvention, Bits):NEWLINE description = "This TC describes the link aggregation status. The bit 'aggCapable(0)' indicates the link is capable of being aggregated. The bit 'aggEnabled(1)' indicates the link is currently in aggregation."NEWLINE status = 'current'NEWLINE namedValues = NamedValues(("aggCapable", 0), ("aggEnabled", 1))NEWLINENEWLINElldpXdot3PortConfigTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 12, 1, 1), )NEWLINEif mibBuilder.loadTexts: lldpXdot3PortConfigTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: lldpXdot3PortConfigTable.setDescription('A table that controls selection of LLDP TLVs to be transmitted on individual ports.')NEWLINElldpXdot3PortConfigEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 12, 1, 1, 1), )NEWLINElldpPortConfigEntry.registerAugmentions(("DES-1210-28MEbx", "lldpXdot3PortConfigEntry"))NEWLINElldpXdot3PortConfigEntry.setIndexNames(*lldpPortConfigEntry.getIndexNames())NEWLINEif mibBuilder.loadTexts: lldpXdot3PortConfigEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: lldpXdot3PortConfigEntry.setDescription('LLDP configuration information that controls the transmission of IEEE 802.3 organizationally defined TLVs on LLDP transmission capable ports. This configuration object augments the lldpPortConfigEntry of the LLDP-MIB, therefore it is only present along with the port configuration defined by the associated lldpPortConfigEntry entry. Each active lldpXdot3PortConfigEntry must be from non-volatile storage (along with the corresponding lldpPortConfigEntry) after a re-initialization of the management system.')NEWLINElldpXdot3PortConfigTLVsTxEnable = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 12, 1, 1, 1, 1), Bits().clone(namedValues=NamedValues(("macPhyConfigStatus", 0), ("powerViaMDI", 1), ("linkAggregation", 2), ("maxFrameSize", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: lldpXdot3PortConfigTLVsTxEnable.setReference('IEEE 802.1AB-2005 10.2.1.1')NEWLINEif mibBuilder.loadTexts: lldpXdot3PortConfigTLVsTxEnable.setStatus('current')NEWLINEif mibBuilder.loadTexts: lldpXdot3PortConfigTLVsTxEnable.setDescription("The lldpXdot3PortConfigTLVsTxEnable, defined as a bitmap, includes the IEEE 802.3 organizationally defined set of LLDP TLVs whose transmission is allowed on the local LLDP agent by the network management. Each bit in the bitmap corresponds to an IEEE 802.3 subtype associated with a specific IEEE 802.3 optional TLV. The bit 0 is not used since there is no corresponding subtype. The bit 'macPhyConfigStatus(0)' indicates that LLDP agent should transmit 'MAC/PHY configuration/status TLV'. The bit 'powerViaMDI(1)' indicates that LLDP agent should transmit 'Power via MDI TLV'. The bit 'linkAggregation(2)' indicates that LLDP agent should transmit 'Link Aggregation TLV'. The bit 'maxFrameSize(3)' indicates that LLDP agent should transmit 'Maximum-frame-size TLV'. The default value for lldpXdot3PortConfigTLVsTxEnable object is an empty set, which means no enumerated values are set. The value of this object must be restored from non-volatile storage after a re-initialization of the management system.")NEWLINElldpXdot3LocPortTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 12, 2, 1), )NEWLINEif mibBuilder.loadTexts: lldpXdot3LocPortTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: lldpXdot3LocPortTable.setDescription('This table contains one row per port of Ethernet port information (as a part of the LLDP 802.3 organizational extension) on the local system known to this agent.')NEWLINElldpXdot3LocPortEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 12, 2, 1, 1), ).setIndexNames((0, "DES-1210-28MEbx", "lldpXdot3LocPortAutoNegSupported"))NEWLINEif mibBuilder.loadTexts: lldpXdot3LocPortEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: lldpXdot3LocPortEntry.setDescription('Information about a particular port component.')NEWLINElldpXdot3LocPortAutoNegSupported = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 12, 2, 1, 1, 1), TruthValue()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: lldpXdot3LocPortAutoNegSupported.setReference('IEEE 802.1AB-2005 G.2.1')NEWLINEif mibBuilder.loadTexts: lldpXdot3LocPortAutoNegSupported.setStatus('current')NEWLINEif mibBuilder.loadTexts: lldpXdot3LocPortAutoNegSupported.setDescription('The truth value used to indicate whether the given port (associated with the local system) supports Auto-negotiation.')NEWLINElldpXdot3LocPortAutoNegEnabled = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 12, 2, 1, 1, 2), TruthValue()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: lldpXdot3LocPortAutoNegEnabled.setReference('IEEE 802.1AB-2005 G.2.1')NEWLINEif mibBuilder.loadTexts: lldpXdot3LocPortAutoNegEnabled.setStatus('current')NEWLINEif mibBuilder.loadTexts: lldpXdot3LocPortAutoNegEnabled.setDescription('The truth value used to indicate whether port Auto-negotiation is enabled on the given port associated with the local system.')NEWLINElldpXdot3LocPortAutoNegAdvertisedCap = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 12, 2, 1, 1, 3), OctetString().subtype(subtypeSpec=ValueSizeConstraint(2, 2)).setFixedLength(2)).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: lldpXdot3LocPortAutoNegAdvertisedCap.setReference('IEEE 802.1AB-2005 G.2.2')NEWLINEif mibBuilder.loadTexts: lldpXdot3LocPortAutoNegAdvertisedCap.setStatus('current')NEWLINEif mibBuilder.loadTexts: lldpXdot3LocPortAutoNegAdvertisedCap.setDescription('This object contains the value (bitmap) of the ifMauAutoNegCapAdvertisedBits object (defined in IETF RFC 3636) which is associated with the given port on the local system.')NEWLINElldpXdot3LocPortOperMauType = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 12, 2, 1, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: lldpXdot3LocPortOperMauType.setReference('IEEE 802.1AB-2005 G.2.3')NEWLINEif mibBuilder.loadTexts: lldpXdot3LocPortOperMauType.setStatus('current')NEWLINEif mibBuilder.loadTexts: lldpXdot3LocPortOperMauType.setDescription('An integer value that indicates the operational MAU type of the given port on the local system. This object contains the integer value derived from the list position of the corresponding dot3MauType as listed in IETF RFC 3636 (or subsequent revisions) and is equal to the last number in the respective dot3MauType OID. For example, if the ifMauType object is dot3MauType1000BaseTHD which corresponds to {dot3MauType 29}, the numerical value of this field will be 29. For MAU types not listed in RFC 3636 (or subsequent revisions), the value of this field shall be set to zero.')NEWLINElldpXdot3LocPowerTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 12, 2, 2), )NEWLINEif mibBuilder.loadTexts: lldpXdot3LocPowerTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: lldpXdot3LocPowerTable.setDescription('This table contains one row per port of power ethernet information (as a part of the LLDP 802.3 organizational extension) on the local system known to this agent.')NEWLINElldpXdot3LocPowerEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 12, 2, 2, 1), ).setIndexNames((0, "DES-1210-28MEbx", "lldpXdot3LocPowerPortClass"))NEWLINEif mibBuilder.loadTexts: lldpXdot3LocPowerEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: lldpXdot3LocPowerEntry.setDescription('Information about a particular port component.')NEWLINElldpXdot3LocPowerPortClass = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 12, 2, 2, 1, 1), LldpPowerPortClass()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: lldpXdot3LocPowerPortClass.setReference('IEEE 802.1AB-2005 G.3.1')NEWLINEif mibBuilder.loadTexts: lldpXdot3LocPowerPortClass.setStatus('current')NEWLINEif mibBuilder.loadTexts: lldpXdot3LocPowerPortClass.setDescription('The value that identifies the port Class of the given port associated with the local system.')NEWLINElldpXdot3LocPowerMDISupported = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 12, 2, 2, 1, 2), TruthValue()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: lldpXdot3LocPowerMDISupported.setReference('IEEE 802.1AB-2005 G.3.1')NEWLINEif mibBuilder.loadTexts: lldpXdot3LocPowerMDISupported.setStatus('current')NEWLINEif mibBuilder.loadTexts: lldpXdot3LocPowerMDISupported.setDescription('The truth value used to indicate whether the MDI power is supported on the given port associated with the local system.')NEWLINElldpXdot3LocPowerMDIEnabled = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 12, 2, 2, 1, 3), TruthValue()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: lldpXdot3LocPowerMDIEnabled.setReference('IEEE 802.1AB-2005 G.3.1')NEWLINEif mibBuilder.loadTexts: lldpXdot3LocPowerMDIEnabled.setStatus('current')NEWLINEif mibBuilder.loadTexts: lldpXdot3LocPowerMDIEnabled.setDescription('The truth value used to identify whether MDI power is enabled on the given port associated with the local system.')NEWLINElldpXdot3LocPowerPairControlable = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 12, 2, 2, 1, 4), TruthValue()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: lldpXdot3LocPowerPairControlable.setReference('IEEE 802.1AB-2005 G.3.1')NEWLINEif mibBuilder.loadTexts: lldpXdot3LocPowerPairControlable.setStatus('current')NEWLINEif mibBuilder.loadTexts: lldpXdot3LocPowerPairControlable.setDescription('The truth value is derived from the value of pethPsePortPowerPairsControlAbility object (defined in IETF RFC 3621) and is used to indicate whether the pair selection can be controlled on the given port associated with the local system.')NEWLINElldpXdot3LocPowerPairs = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 12, 2, 2, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(1, 1), ValueRangeConstraint(2, 2), ))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: lldpXdot3LocPowerPairs.setReference('IEEE 802.1AB-2005 G.3.2')NEWLINEif mibBuilder.loadTexts: lldpXdot3LocPowerPairs.setStatus('current')NEWLINEif mibBuilder.loadTexts: lldpXdot3LocPowerPairs.setDescription('This object contains the value of the pethPsePortPowerPairs object (defined in IETF RFC 3621) which is associated with the given port on the local system.')NEWLINElldpXdot3LocPowerClass = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 12, 2, 2, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(1, 1), ValueRangeConstraint(2, 2), ValueRangeConstraint(3, 3), ValueRangeConstraint(4, 4), ValueRangeConstraint(5, 5), ))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: lldpXdot3LocPowerClass.setReference('IEEE 802.1AB-2005 G.3.3')NEWLINEif mibBuilder.loadTexts: lldpXdot3LocPowerClass.setStatus('current')NEWLINEif mibBuilder.loadTexts: lldpXdot3LocPowerClass.setDescription('This object contains the value of the pethPsePortPowerClassifications object (defined in IETF RFC 3621) which is associated with the given port on the local system.')NEWLINElldpXdot3LocLinkAggTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 12, 2, 3), )NEWLINEif mibBuilder.loadTexts: lldpXdot3LocLinkAggTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: lldpXdot3LocLinkAggTable.setDescription('This table contains one row per port of link aggregation information (as a part of the LLDP 802.3 organizational extension) on the local system known to this agent.')NEWLINElldpXdot3LocLinkAggEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 12, 2, 3, 1), ).setIndexNames((0, "DES-1210-28MEbx", "lldpXdot3LocLinkAggStatus"))NEWLINEif mibBuilder.loadTexts: lldpXdot3LocLinkAggEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: lldpXdot3LocLinkAggEntry.setDescription('Link Aggregation information about a particular port component.')NEWLINElldpXdot3LocLinkAggStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 12, 2, 3, 1, 1), LldpLinkAggStatusMap()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: lldpXdot3LocLinkAggStatus.setReference('IEEE 802.1AB-2005 G.4.1')NEWLINEif mibBuilder.loadTexts: lldpXdot3LocLinkAggStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: lldpXdot3LocLinkAggStatus.setDescription('The bitmap value contains the link aggregation capabilities and the current aggregation status of the link.')NEWLINElldpXdot3LocLinkAggPortId = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 12, 2, 3, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(1, 2147483647), ))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: lldpXdot3LocLinkAggPortId.setReference('IEEE 802.1AB-2005 G.4.2')NEWLINEif mibBuilder.loadTexts: lldpXdot3LocLinkAggPortId.setStatus('current')NEWLINEif mibBuilder.loadTexts: lldpXdot3LocLinkAggPortId.setDescription('This object contains the IEEE 802.3 aggregated port identifier, aAggPortID (IEEE 802.3-2002, 30.7.2.1.1), derived from the ifNumber of the ifIndex for the port component in link aggregation. If the port is not in link aggregation state and/or it does not support link aggregation, this value should be set to zero.')NEWLINElldpXdot3LocMaxFrameSizeTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 12, 2, 4), )NEWLINEif mibBuilder.loadTexts: lldpXdot3LocMaxFrameSizeTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: lldpXdot3LocMaxFrameSizeTable.setDescription('This table contains one row per port of maximum frame size information (as a part of the LLDP 802.3 organizational extension) on the local system known to this agent.')NEWLINElldpXdot3LocMaxFrameSizeEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 12, 2, 4, 1), ).setIndexNames((0, "DES-1210-28MEbx", "lldpXdot3LocMaxFrameSize"))NEWLINEif mibBuilder.loadTexts: lldpXdot3LocMaxFrameSizeEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: lldpXdot3LocMaxFrameSizeEntry.setDescription('Maximum Frame Size information about a particular port component.')NEWLINElldpXdot3LocMaxFrameSize = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 12, 2, 4, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: lldpXdot3LocMaxFrameSize.setReference('IEEE 802.1AB-2005 G.5.1')NEWLINEif mibBuilder.loadTexts: lldpXdot3LocMaxFrameSize.setStatus('current')NEWLINEif mibBuilder.loadTexts: lldpXdot3LocMaxFrameSize.setDescription('An integer value indicating the maximum supported frame size in octets on the given port of the local system.')NEWLINElldpXdot3RemPortTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 12, 3, 1), )NEWLINEif mibBuilder.loadTexts: lldpXdot3RemPortTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: lldpXdot3RemPortTable.setDescription('This table contains Ethernet port information (as a part of the LLDP 802.3 organizational extension) of the remote system.')NEWLINElldpXdot3RemPortEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 12, 3, 1, 1), ).setIndexNames((0, "DES-1210-28MEbx", "lldpXdot3RemPortAutoNegSupported"))NEWLINEif mibBuilder.loadTexts: lldpXdot3RemPortEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: lldpXdot3RemPortEntry.setDescription('Information about a particular physical network connection.')NEWLINElldpXdot3RemPortAutoNegSupported = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 12, 3, 1, 1, 1), TruthValue()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: lldpXdot3RemPortAutoNegSupported.setReference('IEEE 802.1AB-2005 G.2.1')NEWLINEif mibBuilder.loadTexts: lldpXdot3RemPortAutoNegSupported.setStatus('current')NEWLINEif mibBuilder.loadTexts: lldpXdot3RemPortAutoNegSupported.setDescription('The truth value used to indicate whether the given port (associated with remote system) supports Auto-negotiation.')NEWLINElldpXdot3RemPortAutoNegEnabled = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 12, 3, 1, 1, 2), TruthValue()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: lldpXdot3RemPortAutoNegEnabled.setReference('IEEE 802.1AB-2005 G.2.1')NEWLINEif mibBuilder.loadTexts: lldpXdot3RemPortAutoNegEnabled.setStatus('current')NEWLINEif mibBuilder.loadTexts: lldpXdot3RemPortAutoNegEnabled.setDescription('The truth value used to indicate whether port Auto-negotiation is enabled on the given port associated with the remote system.')NEWLINElldpXdot3RemPortAutoNegAdvertisedCap = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 12, 3, 1, 1, 3), OctetString().subtype(subtypeSpec=ValueSizeConstraint(2, 2)).setFixedLength(2)).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: lldpXdot3RemPortAutoNegAdvertisedCap.setReference('IEEE 802.1AB-2005 G.2.2')NEWLINEif mibBuilder.loadTexts: lldpXdot3RemPortAutoNegAdvertisedCap.setStatus('current')NEWLINEif mibBuilder.loadTexts: lldpXdot3RemPortAutoNegAdvertisedCap.setDescription('This object contains the value (bitmap) of the ifMauAutoNegCapAdvertisedBits object (defined in IETF RFC 3636) which is associated with the given port on the remote system.')NEWLINElldpXdot3RemPortOperMauType = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 12, 3, 1, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: lldpXdot3RemPortOperMauType.setReference('IEEE 802.1AB-2005 G.2.3')NEWLINEif mibBuilder.loadTexts: lldpXdot3RemPortOperMauType.setStatus('current')NEWLINEif mibBuilder.loadTexts: lldpXdot3RemPortOperMauType.setDescription('An integer value that indicates the operational MAU type of the sending device. This object contains the integer value derived from the list position of the corresponding dot3MauType as listed in in IETF RFC 3636 (or subsequent revisions) and is equal to the last number in the respective dot3MauType OID. For example, if the ifMauType object is dot3MauType1000BaseTHD which corresponds to {dot3MauType 29}, the numerical value of this field will be 29. For MAU types not listed in RFC 3636 (or subsequent revisions), the value of this field shall be set to zero.')NEWLINElldpXdot3RemPowerTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 12, 3, 2), )NEWLINEif mibBuilder.loadTexts: lldpXdot3RemPowerTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: lldpXdot3RemPowerTable.setDescription('This table contains Ethernet power information (as a part of the LLDP 802.3 organizational extension) of the remote system.')NEWLINElldpXdot3RemPowerEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 12, 3, 2, 1), ).setIndexNames((0, "DES-1210-28MEbx", "lldpXdot3RemPowerPortClass"))NEWLINEif mibBuilder.loadTexts: lldpXdot3RemPowerEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: lldpXdot3RemPowerEntry.setDescription('Information about a particular physical network connection.')NEWLINElldpXdot3RemPowerPortClass = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 12, 3, 2, 1, 1), LldpPowerPortClass()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: lldpXdot3RemPowerPortClass.setReference('IEEE 802.1AB-2005 G.3.1')NEWLINEif mibBuilder.loadTexts: lldpXdot3RemPowerPortClass.setStatus('current')NEWLINEif mibBuilder.loadTexts: lldpXdot3RemPowerPortClass.setDescription('The value that identifies the port Class of the given port associated with the remote system.')NEWLINElldpXdot3RemPowerMDISupported = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 12, 3, 2, 1, 2), TruthValue()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: lldpXdot3RemPowerMDISupported.setReference('IEEE 802.1AB-2005 G.3.1')NEWLINEif mibBuilder.loadTexts: lldpXdot3RemPowerMDISupported.setStatus('current')NEWLINEif mibBuilder.loadTexts: lldpXdot3RemPowerMDISupported.setDescription('The truth value used to indicate whether the MDI power is supported on the given port associated with the remote system.')NEWLINElldpXdot3RemPowerMDIEnabled = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 12, 3, 2, 1, 3), TruthValue()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: lldpXdot3RemPowerMDIEnabled.setReference('IEEE 802.1AB-2005 G.3.1')NEWLINEif mibBuilder.loadTexts: lldpXdot3RemPowerMDIEnabled.setStatus('current')NEWLINEif mibBuilder.loadTexts: lldpXdot3RemPowerMDIEnabled.setDescription('The truth value used to identify whether MDI power is enabled on the given port associated with the remote system.')NEWLINElldpXdot3RemPowerPairControlable = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 12, 3, 2, 1, 4), TruthValue()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: lldpXdot3RemPowerPairControlable.setReference('IEEE 802.1AB-2005 G.3.1')NEWLINEif mibBuilder.loadTexts: lldpXdot3RemPowerPairControlable.setStatus('current')NEWLINEif mibBuilder.loadTexts: lldpXdot3RemPowerPairControlable.setDescription('The truth value is derived from the value of pethPsePortPowerPairsControlAbility object (defined in IETF RFC 3621) and is used to indicate whether the pair selection can be controlled on the given port associated with the remote system.')NEWLINElldpXdot3RemPowerPairs = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 12, 3, 2, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(1, 1), ValueRangeConstraint(2, 2), ))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: lldpXdot3RemPowerPairs.setReference('IEEE 802.1AB-2005 G.3.2')NEWLINEif mibBuilder.loadTexts: lldpXdot3RemPowerPairs.setStatus('current')NEWLINEif mibBuilder.loadTexts: lldpXdot3RemPowerPairs.setDescription('This object contains the value of the pethPsePortPowerPairs object (defined in IETF RFC 3621) which is associated with the given port on the remote system.')NEWLINElldpXdot3RemPowerClass = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 12, 3, 2, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(1, 1), ValueRangeConstraint(2, 2), ValueRangeConstraint(3, 3), ValueRangeConstraint(4, 4), ValueRangeConstraint(5, 5), ))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: lldpXdot3RemPowerClass.setReference('IEEE 802.1AB-2005 G.3.3')NEWLINEif mibBuilder.loadTexts: lldpXdot3RemPowerClass.setStatus('current')NEWLINEif mibBuilder.loadTexts: lldpXdot3RemPowerClass.setDescription('This object contains the value of the pethPsePortPowerClassifications object (defined in IETF RFC 3621) which is associated with the given port on the remote system.')NEWLINElldpXdot3RemLinkAggTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 12, 3, 3), )NEWLINEif mibBuilder.loadTexts: lldpXdot3RemLinkAggTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: lldpXdot3RemLinkAggTable.setDescription('This table contains port link aggregation information (as a part of the LLDP 802.3 organizational extension) of the remote system.')NEWLINElldpXdot3RemLinkAggEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 12, 3, 3, 1), ).setIndexNames((0, "DES-1210-28MEbx", "lldpXdot3RemLinkAggStatus"))NEWLINEif mibBuilder.loadTexts: lldpXdot3RemLinkAggEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: lldpXdot3RemLinkAggEntry.setDescription("Link Aggregation information about remote system's port component.")NEWLINElldpXdot3RemLinkAggStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 12, 3, 3, 1, 1), LldpLinkAggStatusMap()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: lldpXdot3RemLinkAggStatus.setReference('IEEE 802.1AB-2005 G.4.1')NEWLINEif mibBuilder.loadTexts: lldpXdot3RemLinkAggStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: lldpXdot3RemLinkAggStatus.setDescription('The bitmap value contains the link aggregation capabilities and the current aggregation status of the link.')NEWLINElldpXdot3RemLinkAggPortId = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 12, 3, 3, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(1, 2147483647), ))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: lldpXdot3RemLinkAggPortId.setReference('IEEE 802.1AB-2005 G.4.2')NEWLINEif mibBuilder.loadTexts: lldpXdot3RemLinkAggPortId.setStatus('current')NEWLINEif mibBuilder.loadTexts: lldpXdot3RemLinkAggPortId.setDescription('This object contains the IEEE 802.3 aggregated port identifier, aAggPortID (IEEE 802.3-2002, 30.7.2.1.1), derived from the ifNumber of the ifIndex for the port component associated with the remote system. If the remote port is not in link aggregation state and/or it does not support link aggregation, this value should be zero.')NEWLINElldpXdot3RemMaxFrameSizeTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 12, 3, 4), )NEWLINEif mibBuilder.loadTexts: lldpXdot3RemMaxFrameSizeTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: lldpXdot3RemMaxFrameSizeTable.setDescription('This table contains one row per port of maximum frame size information (as a part of the LLDP 802.3 organizational extension) of the remote system.')NEWLINElldpXdot3RemMaxFrameSizeEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 12, 3, 4, 1), ).setIndexNames((0, "DES-1210-28MEbx", "lldpXdot3RemMaxFrameSize"))NEWLINEif mibBuilder.loadTexts: lldpXdot3RemMaxFrameSizeEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: lldpXdot3RemMaxFrameSizeEntry.setDescription('Maximum Frame Size information about a particular port component.')NEWLINElldpXdot3RemMaxFrameSize = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 12, 3, 4, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: lldpXdot3RemMaxFrameSize.setReference('IEEE 802.1AB-2005 G.5.1')NEWLINEif mibBuilder.loadTexts: lldpXdot3RemMaxFrameSize.setStatus('current')NEWLINEif mibBuilder.loadTexts: lldpXdot3RemMaxFrameSize.setDescription('An integer value indicating the maximum supported frame size in octets on the port component associated with the remote system.')NEWLINElldpXdot1Objects = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 13))NEWLINElldpXdot1Config = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 13, 1))NEWLINElldpXdot1LocalData = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 13, 2))NEWLINElldpXdot1RemoteData = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 13, 3))NEWLINElldpXdot1ConfigPortVlanTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 13, 1, 1), )NEWLINEif mibBuilder.loadTexts: lldpXdot1ConfigPortVlanTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: lldpXdot1ConfigPortVlanTable.setDescription('A table that controls selection of LLDP Port VLAN-ID TLVs to be transmitted on individual ports.')NEWLINElldpXdot1ConfigPortVlanEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 13, 1, 1, 1), )NEWLINElldpPortConfigEntry.registerAugmentions(("DES-1210-28MEbx", "lldpXdot1ConfigPortVlanEntry"))NEWLINElldpXdot1ConfigPortVlanEntry.setIndexNames(*lldpPortConfigEntry.getIndexNames())NEWLINEif mibBuilder.loadTexts: lldpXdot1ConfigPortVlanEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: lldpXdot1ConfigPortVlanEntry.setDescription('LLDP configuration information that controls the transmission of IEEE 802.1 organizationally defined Port VLAN-ID TLV on LLDP transmission capable ports. This configuration object augments the lldpPortConfigEntry of the LLDP-MIB, therefore it is only present along with the port configuration defined by the associated lldpPortConfigEntry entry. Each active lldpConfigEntry must be restored from non-volatile storage (along with the corresponding lldpPortConfigEntry) after a re-initialization of the management system.')NEWLINElldpXdot1ConfigPortVlanTxEnable = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 13, 1, 1, 1, 1), TruthValue().clone('false')).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: lldpXdot1ConfigPortVlanTxEnable.setReference('IEEE 802.1AB-2005 10.2.1.1')NEWLINEif mibBuilder.loadTexts: lldpXdot1ConfigPortVlanTxEnable.setStatus('current')NEWLINEif mibBuilder.loadTexts: lldpXdot1ConfigPortVlanTxEnable.setDescription('The lldpXdot1ConfigPortVlanTxEnable, which is defined as a truth value and configured by the network management, determines whether the IEEE 802.1 organizationally defined port VLAN TLV transmission is allowed on a given LLDP transmission capable port. The value of this object must be restored from non-volatile storage after a re-initialization of the management system.')NEWLINElldpXdot1LocVlanNameTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 13, 2, 3), )NEWLINEif mibBuilder.loadTexts: lldpXdot1LocVlanNameTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: lldpXdot1LocVlanNameTable.setDescription('This table contains one or more rows per IEEE 802.1Q VLAN name information on the local system known to this agent.')NEWLINElldpXdot1LocVlanNameEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 13, 2, 3, 1), ).setIndexNames((0, "DES-1210-28MEbx", "lldpXdot1LocVlanId"))NEWLINEif mibBuilder.loadTexts: lldpXdot1LocVlanNameEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: lldpXdot1LocVlanNameEntry.setDescription('VLAN name Information about a particular port component. There may be multiple VLANs, identified by a particular lldpXdot1LocVlanId, configured on the given port.')NEWLINElldpXdot1LocVlanId = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 13, 2, 3, 1, 1), VlanId())NEWLINEif mibBuilder.loadTexts: lldpXdot1LocVlanId.setReference('IEEE 802.1AB-2005 F.4.2')NEWLINEif mibBuilder.loadTexts: lldpXdot1LocVlanId.setStatus('current')NEWLINEif mibBuilder.loadTexts: lldpXdot1LocVlanId.setDescription('The integer value used to identify the IEEE 802.1Q VLAN IDs with which the given port is compatible.')NEWLINElldpXdot1LocVlanName = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 13, 2, 3, 1, 2), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(1, 32))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: lldpXdot1LocVlanName.setReference('IEEE 802.1AB-2005 F.4.4')NEWLINEif mibBuilder.loadTexts: lldpXdot1LocVlanName.setStatus('current')NEWLINEif mibBuilder.loadTexts: lldpXdot1LocVlanName.setDescription('The string value used to identify VLAN name identified by the Vlan Id associated with the given port on the local system. This object should contain the value of the dot1QVLANStaticName object (defined in IETF RFC 2674) identified with the given lldpXdot1LocVlanId.')NEWLINElldpXdot1ConfigVlanNameTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 13, 1, 2), )NEWLINEif mibBuilder.loadTexts: lldpXdot1ConfigVlanNameTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: lldpXdot1ConfigVlanNameTable.setDescription('The table that controls selection of LLDP VLAN name TLV instances to be transmitted on individual ports.')NEWLINElldpXdot1ConfigVlanNameEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 13, 1, 2, 1), )NEWLINElldpXdot1LocVlanNameEntry.registerAugmentions(("DES-1210-28MEbx", "lldpXdot1ConfigVlanNameEntry"))NEWLINElldpXdot1ConfigVlanNameEntry.setIndexNames(*lldpXdot1LocVlanNameEntry.getIndexNames())NEWLINEif mibBuilder.loadTexts: lldpXdot1ConfigVlanNameEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: lldpXdot1ConfigVlanNameEntry.setDescription('LLDP configuration information that specifies the set of ports (represented as a PortList) on which the Local System VLAN name instance will be transmitted. This configuration object augments the lldpLocVlanEntry, therefore it is only present along with the VLAN Name instance contained in the associated lldpLocVlanNameEntry entry. Each active lldpXdot1ConfigVlanNameEntry must be restored from non-volatile storage (along with the corresponding lldpXdot1LocVlanNameEntry) after a re-initialization of the management system.')NEWLINElldpXdot1ConfigVlanNameTxEnable = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 13, 1, 2, 1, 1), TruthValue().clone('false')).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: lldpXdot1ConfigVlanNameTxEnable.setReference('IEEE 802.1AB-2005 10.2.1.1')NEWLINEif mibBuilder.loadTexts: lldpXdot1ConfigVlanNameTxEnable.setStatus('current')NEWLINEif mibBuilder.loadTexts: lldpXdot1ConfigVlanNameTxEnable.setDescription('The boolean value that indicates whether the corresponding Local System VLAN name instance will be transmitted on the port defined by the given lldpXdot1LocVlanNameEntry. The value of this object must be restored from non-volatile storage after a re-initialization of the management system.')NEWLINElldpXdot1LocProtoVlanTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 13, 2, 2), )NEWLINEif mibBuilder.loadTexts: lldpXdot1LocProtoVlanTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: lldpXdot1LocProtoVlanTable.setDescription('This table contains one or more rows per Port and Protocol VLAN information about the local system.')NEWLINElldpXdot1LocProtoVlanEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 13, 2, 2, 1), ).setIndexNames((0, "DES-1210-28MEbx", "lldpXdot1LocProtoVlanId"))NEWLINEif mibBuilder.loadTexts: lldpXdot1LocProtoVlanEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: lldpXdot1LocProtoVlanEntry.setDescription('Port and protocol VLAN ID Information about a particular port component. There may be multiple port and protocol VLANs, identified by a particular lldpXdot1LocProtoVlanId, configured on the given port.')NEWLINElldpXdot1LocProtoVlanId = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 13, 2, 2, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(1, 4094), )))NEWLINEif mibBuilder.loadTexts: lldpXdot1LocProtoVlanId.setReference('IEEE 802.1AB-2005 F.3.2')NEWLINEif mibBuilder.loadTexts: lldpXdot1LocProtoVlanId.setStatus('current')NEWLINEif mibBuilder.loadTexts: lldpXdot1LocProtoVlanId.setDescription('The integer value used to identify the port and protocol VLANs associated with the given port associated with the local system. A value of zero shall be used if the system either does not know the protocol VLAN ID (PPVID) or does not support port and protocol VLAN operation.')NEWLINElldpXdot1LocProtoVlanSupported = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 13, 2, 2, 1, 2), TruthValue()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: lldpXdot1LocProtoVlanSupported.setReference('IEEE 802.1AB-2005 F.3.1')NEWLINEif mibBuilder.loadTexts: lldpXdot1LocProtoVlanSupported.setStatus('current')NEWLINEif mibBuilder.loadTexts: lldpXdot1LocProtoVlanSupported.setDescription('The truth value used to indicate whether the given port (associated with the local system) supports port and protocol VLANs.')NEWLINElldpXdot1LocProtoVlanEnabled = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 13, 2, 2, 1, 3), TruthValue()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: lldpXdot1LocProtoVlanEnabled.setReference('IEEE 802.1AB-2005 F.3.1')NEWLINEif mibBuilder.loadTexts: lldpXdot1LocProtoVlanEnabled.setStatus('current')NEWLINEif mibBuilder.loadTexts: lldpXdot1LocProtoVlanEnabled.setDescription('The truth value used to indicate whether the port and protocol VLANs are enabled on the given port associated with the local system.')NEWLINElldpXdot1ConfigProtoVlanTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 13, 1, 3), )NEWLINEif mibBuilder.loadTexts: lldpXdot1ConfigProtoVlanTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: lldpXdot1ConfigProtoVlanTable.setDescription('The table that controls selection of LLDP Port and Protocol VLAN ID TLV instances to be transmitted on individual ports.')NEWLINElldpXdot1ConfigProtoVlanEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 13, 1, 3, 1), )NEWLINElldpXdot1LocProtoVlanEntry.registerAugmentions(("DES-1210-28MEbx", "lldpXdot1ConfigProtoVlanEntry"))NEWLINElldpXdot1ConfigProtoVlanEntry.setIndexNames(*lldpXdot1LocProtoVlanEntry.getIndexNames())NEWLINEif mibBuilder.loadTexts: lldpXdot1ConfigProtoVlanEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: lldpXdot1ConfigProtoVlanEntry.setDescription('LLDP configuration information that specifies the set of ports (represented as a PortList) on which the Local System Protocol VLAN instance will be transmitted. This configuration object augments the lldpXdot1LocVlanEntry, therefore it is only present along with the Port and Protocol VLAN ID instance contained in the associated lldpXdot1LocVlanEntry entry. Each active lldpXdot1ConfigProtoVlanEntry must be restored from non-volatile storage (along with the corresponding lldpXdot1LocProtoVlanEntry) after a re-initialization of the management system.')NEWLINElldpXdot1ConfigProtoVlanTxEnable = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 13, 1, 3, 1, 1), TruthValue().clone('false')).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: lldpXdot1ConfigProtoVlanTxEnable.setReference('IEEE 802.1AB-2005 10.2.1.1')NEWLINEif mibBuilder.loadTexts: lldpXdot1ConfigProtoVlanTxEnable.setStatus('current')NEWLINEif mibBuilder.loadTexts: lldpXdot1ConfigProtoVlanTxEnable.setDescription('The boolean value that indicates whether the corresponding Local System Port and Protocol VLAN instance will be transmitted on the port defined by the given lldpXdot1LocProtoVlanEntry. The value of this object must be restored from non-volatile storage after a re-initialization of the management system.')NEWLINElldpXdot1LocProtocolTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 13, 2, 4), )NEWLINEif mibBuilder.loadTexts: lldpXdot1LocProtocolTable.setReference('IEEE 802.1AB-2005 F.5')NEWLINEif mibBuilder.loadTexts: lldpXdot1LocProtocolTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: lldpXdot1LocProtocolTable.setDescription('This table contains one or more rows per protocol identity information on the local system known to this agent.')NEWLINElldpXdot1LocProtocolEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 13, 2, 4, 1), ).setIndexNames((0, "DES-1210-28MEbx", "lldpXdot1LocProtocolIndex"))NEWLINEif mibBuilder.loadTexts: lldpXdot1LocProtocolEntry.setReference('IEEE 802.1AB-2005 F.5')NEWLINEif mibBuilder.loadTexts: lldpXdot1LocProtocolEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: lldpXdot1LocProtocolEntry.setDescription('Information about particular protocols that are accessible through the given port component. There may be multiple protocols, identified by particular lldpXdot1ProtocolIndex, and lldpLocPortNum.')NEWLINElldpXdot1LocProtocolIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 13, 2, 4, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647)))NEWLINEif mibBuilder.loadTexts: lldpXdot1LocProtocolIndex.setStatus('current')NEWLINEif mibBuilder.loadTexts: lldpXdot1LocProtocolIndex.setDescription('This object represents an arbitrary local integer value used by this agent to identify a particular protocol identity.')NEWLINElldpXdot1LocProtocolId = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 13, 2, 4, 1, 2), OctetString().subtype(subtypeSpec=ValueSizeConstraint(1, 255))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: lldpXdot1LocProtocolId.setReference('IEEE 802.1AB-2005 F.5.3')NEWLINEif mibBuilder.loadTexts: lldpXdot1LocProtocolId.setStatus('current')NEWLINEif mibBuilder.loadTexts: lldpXdot1LocProtocolId.setDescription('The octet string value used to identify the protocols associated with the given port of the local system.')NEWLINElldpXdot1ConfigProtocolTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 13, 1, 4), )NEWLINEif mibBuilder.loadTexts: lldpXdot1ConfigProtocolTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: lldpXdot1ConfigProtocolTable.setDescription('The table that controls selection of LLDP Protocol TLV instances to be transmitted on individual ports.')NEWLINElldpXdot1ConfigProtocolEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 13, 1, 4, 1), )NEWLINElldpXdot1LocProtocolEntry.registerAugmentions(("DES-1210-28MEbx", "lldpXdot1ConfigProtocolEntry"))NEWLINElldpXdot1ConfigProtocolEntry.setIndexNames(*lldpXdot1LocProtocolEntry.getIndexNames())NEWLINEif mibBuilder.loadTexts: lldpXdot1ConfigProtocolEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: lldpXdot1ConfigProtocolEntry.setDescription('LLDP configuration information that specifies the set of ports (represented as a PortList) on which the Local System Protocol instance will be transmitted. This configuration object augments the lldpXdot1LocProtoEntry, therefore it is only present along with the Protocol instance contained in the associated lldpXdot1LocProtoEntry entry. Each active lldpXdot1ConfigProtocolEntry must be restored from non-volatile storage (along with the corresponding lldpXdot1LocProtocolEntry) after a re-initialization of the management system.')NEWLINElldpXdot1ConfigProtocolTxEnable = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 13, 1, 4, 1, 1), TruthValue().clone('false')).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: lldpXdot1ConfigProtocolTxEnable.setReference('IEEE 802.1AB-2005 10.2.1.1')NEWLINEif mibBuilder.loadTexts: lldpXdot1ConfigProtocolTxEnable.setStatus('current')NEWLINEif mibBuilder.loadTexts: lldpXdot1ConfigProtocolTxEnable.setDescription('The boolean value that indicates whether the corresponding Local System Protocol Identity instance will be transmitted on the port defined by the given lldpXdot1LocProtocolEntry. The value of this object must be restored from non-volatile storage after a re-initialization of the management system.')NEWLINElldpXdot1LocTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 13, 2, 1), )NEWLINEif mibBuilder.loadTexts: lldpXdot1LocTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: lldpXdot1LocTable.setDescription('This table contains one row per port for IEEE 802.1 organizationally defined LLDP extension on the local system known to this agent.')NEWLINElldpXdot1LocEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 13, 2, 1, 1), ).setIndexNames((0, "DES-1210-28MEbx", "lldpXdot1LocPortVlanId"))NEWLINEif mibBuilder.loadTexts: lldpXdot1LocEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: lldpXdot1LocEntry.setDescription('Information about IEEE 802.1 organizationally defined LLDP extension.')NEWLINElldpXdot1LocPortVlanId = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 13, 2, 1, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(1, 4094), ))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: lldpXdot1LocPortVlanId.setReference('IEEE 802.1AB-2005 F.2.1')NEWLINEif mibBuilder.loadTexts: lldpXdot1LocPortVlanId.setStatus('current')NEWLINEif mibBuilder.loadTexts: lldpXdot1LocPortVlanId.setDescription("The integer value used to identify the port's VLAN identifier associated with the local system. A value of zero shall be used if the system either does not know the PVID or does not support port-based VLAN operation.")NEWLINElldpXdot1RemTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 13, 3, 1), )NEWLINEif mibBuilder.loadTexts: lldpXdot1RemTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: lldpXdot1RemTable.setDescription('This table contains one or more rows per physical network connection known to this agent. The agent may wish to ensure that only one lldpXdot1RemEntry is present for each local port, or it may choose to maintain multiple lldpXdot1RemEntries for the same local port.')NEWLINElldpXdot1RemEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 13, 3, 1, 1), ).setIndexNames((0, "DES-1210-28MEbx", "lldpXdot1RemPortVlanId"))NEWLINEif mibBuilder.loadTexts: lldpXdot1RemEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: lldpXdot1RemEntry.setDescription('Information about a particular port component.')NEWLINElldpXdot1RemPortVlanId = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 13, 3, 1, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(1, 4094), ))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: lldpXdot1RemPortVlanId.setReference('IEEE 802.1AB-2005 F.2.1')NEWLINEif mibBuilder.loadTexts: lldpXdot1RemPortVlanId.setStatus('current')NEWLINEif mibBuilder.loadTexts: lldpXdot1RemPortVlanId.setDescription("The integer value used to identify the port's VLAN identifier associated with the remote system. if the remote system either does not know the PVID or does not support port-based VLAN operation, the value of lldpXdot1RemPortVlanId should be zero.")NEWLINElldpXdot1RemProtoVlanTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 13, 3, 2), )NEWLINEif mibBuilder.loadTexts: lldpXdot1RemProtoVlanTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: lldpXdot1RemProtoVlanTable.setDescription('This table contains one or more rows per Port and Protocol VLAN information about the remote system, received on the given port.')NEWLINElldpXdot1RemProtoVlanEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 13, 3, 2, 1), ).setIndexNames((0, "DES-1210-28MEbx", "lldpXdot1RemProtoVlanId"))NEWLINEif mibBuilder.loadTexts: lldpXdot1RemProtoVlanEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: lldpXdot1RemProtoVlanEntry.setDescription('Port and protocol VLAN name Information about a particular port component. There may be multiple protocol VLANs, identified by a particular lldpXdot1RemProtoVlanId, configured on the remote system.')NEWLINElldpXdot1RemProtoVlanId = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 13, 3, 2, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(1, 4094), )))NEWLINEif mibBuilder.loadTexts: lldpXdot1RemProtoVlanId.setReference('IEEE 802.1AB-2005 F.3.2')NEWLINEif mibBuilder.loadTexts: lldpXdot1RemProtoVlanId.setStatus('current')NEWLINEif mibBuilder.loadTexts: lldpXdot1RemProtoVlanId.setDescription('The integer value used to identify the port and protocol VLANs associated with the given port associated with the remote system. If port and protocol VLANs are not supported on the given port associated with the remote system, or if the port is not enabled with any port and protocol VLAN, the value of lldpXdot1RemProtoVlanId should be zero.')NEWLINElldpXdot1RemProtoVlanSupported = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 13, 3, 2, 1, 2), TruthValue()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: lldpXdot1RemProtoVlanSupported.setReference('IEEE 802.1AB-2005 F.3.1')NEWLINEif mibBuilder.loadTexts: lldpXdot1RemProtoVlanSupported.setStatus('current')NEWLINEif mibBuilder.loadTexts: lldpXdot1RemProtoVlanSupported.setDescription('The truth value used to indicate whether the given port (associated with the remote system) is capable of supporting port and protocol VLANs.')NEWLINElldpXdot1RemProtoVlanEnabled = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 13, 3, 2, 1, 3), TruthValue()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: lldpXdot1RemProtoVlanEnabled.setReference('IEEE 802.1AB-2005 F.3.1')NEWLINEif mibBuilder.loadTexts: lldpXdot1RemProtoVlanEnabled.setStatus('current')NEWLINEif mibBuilder.loadTexts: lldpXdot1RemProtoVlanEnabled.setDescription('The truth value used to indicate whether the port and protocol VLANs are enabled on the given port associated with the remote system.')NEWLINElldpXdot1RemVlanNameTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 13, 3, 3), )NEWLINEif mibBuilder.loadTexts: lldpXdot1RemVlanNameTable.setReference('IEEE 802.1AB-2005 F.4')NEWLINEif mibBuilder.loadTexts: lldpXdot1RemVlanNameTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: lldpXdot1RemVlanNameTable.setDescription('This table contains one or more rows per IEEE 802.1Q VLAN name information about the remote system, received on the given port.')NEWLINElldpXdot1RemVlanNameEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 13, 3, 3, 1), ).setIndexNames((0, "DES-1210-28MEbx", "lldpXdot1RemVlanId"))NEWLINEif mibBuilder.loadTexts: lldpXdot1RemVlanNameEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: lldpXdot1RemVlanNameEntry.setDescription('VLAN name Information about a particular port component. There may be multiple VLANs, identified by a particular lldpXdot1RemVlanId, received on the given port.')NEWLINElldpXdot1RemVlanId = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 13, 3, 3, 1, 1), VlanId())NEWLINEif mibBuilder.loadTexts: lldpXdot1RemVlanId.setReference('IEEE 802.1AB-2005 F.4.2')NEWLINEif mibBuilder.loadTexts: lldpXdot1RemVlanId.setStatus('current')NEWLINEif mibBuilder.loadTexts: lldpXdot1RemVlanId.setDescription('The integer value used to identify the IEEE 802.1Q VLAN IDs with which the given port of the remote system is compatible.')NEWLINElldpXdot1RemVlanName = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 13, 3, 3, 1, 2), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(1, 32))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: lldpXdot1RemVlanName.setReference('IEEE 802.1AB-2005 F.4.4')NEWLINEif mibBuilder.loadTexts: lldpXdot1RemVlanName.setStatus('current')NEWLINEif mibBuilder.loadTexts: lldpXdot1RemVlanName.setDescription('The string value used to identify VLAN name identified by the VLAN Id associated with the remote system.')NEWLINElldpXdot1RemProtocolTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 13, 3, 4), )NEWLINEif mibBuilder.loadTexts: lldpXdot1RemProtocolTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: lldpXdot1RemProtocolTable.setDescription('This table contains one or more rows per protocol information about the remote system, received on the given port.')NEWLINElldpXdot1RemProtocolEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 13, 3, 4, 1), ).setIndexNames((0, "DES-1210-28MEbx", "lldpXdot1RemProtocolIndex"))NEWLINEif mibBuilder.loadTexts: lldpXdot1RemProtocolEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: lldpXdot1RemProtocolEntry.setDescription('Protocol information about a particular port component. There may be multiple protocols, identified by a particular lldpXdot1ProtocolIndex, received on the given port.')NEWLINElldpXdot1RemProtocolIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 13, 3, 4, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647)))NEWLINEif mibBuilder.loadTexts: lldpXdot1RemProtocolIndex.setStatus('current')NEWLINEif mibBuilder.loadTexts: lldpXdot1RemProtocolIndex.setDescription('This object represents an arbitrary local integer value used by this agent to identify a particular protocol identity.')NEWLINElldpXdot1RemProtocolId = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 32, 13, 3, 4, 1, 2), OctetString().subtype(subtypeSpec=ValueSizeConstraint(1, 255))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: lldpXdot1RemProtocolId.setReference('IEEE 802.1AB-2005 F.5.3')NEWLINEif mibBuilder.loadTexts: lldpXdot1RemProtocolId.setStatus('current')NEWLINEif mibBuilder.loadTexts: lldpXdot1RemProtocolId.setDescription('The octet string value used to identify the protocols associated with the given port of remote system.')NEWLINEsecurityDhcpServerScreen = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 7))NEWLINEdhcpServerScreenEnablePortlist = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 7, 1), PortList()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: dhcpServerScreenEnablePortlist.setStatus('current')NEWLINEif mibBuilder.loadTexts: dhcpServerScreenEnablePortlist.setDescription('To enable or disable DHCP Server Screening port list.')NEWLINEdhcpServerScreenEnableVlanlist = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 7, 2), OctetString()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: dhcpServerScreenEnableVlanlist.setStatus('current')NEWLINEif mibBuilder.loadTexts: dhcpServerScreenEnableVlanlist.setDescription('To enable or disable DHCP Server Screening vlan list.')NEWLINEdhcpServerScreenLogSuppressDuration = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 7, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 5, 30))).clone(namedValues=NamedValues(("one-min", 1), ("five-min", 5), ("thirty-min", 30)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: dhcpServerScreenLogSuppressDuration.setStatus('current')NEWLINEif mibBuilder.loadTexts: dhcpServerScreenLogSuppressDuration.setDescription('DSS Trap Log Suppress Duration.')NEWLINEfilterDHCPServerTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 7, 4), )NEWLINEif mibBuilder.loadTexts: filterDHCPServerTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: filterDHCPServerTable.setDescription('A table to control filter DHCP Server for the entire switch or for each interface in the switch.')NEWLINEfilterDHCPServerEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 7, 4, 1), ).setIndexNames((0, "DES-1210-28MEbx", "filterDHCPServerIpAddr"), (0, "DES-1210-28MEbx", "filterDHCPServerClientMacAddr"))NEWLINEif mibBuilder.loadTexts: filterDHCPServerEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: filterDHCPServerEntry.setDescription('An entry appears in this table for each interface in the system.')NEWLINEfilterDHCPServerIpAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 7, 4, 1, 1), IpAddress())NEWLINEif mibBuilder.loadTexts: filterDHCPServerIpAddr.setStatus('current')NEWLINEif mibBuilder.loadTexts: filterDHCPServerIpAddr.setDescription("Specifies either the Network or Host address from which the switch can be managed. An address 0.0.0.0 indicates 'Any Manager'.")NEWLINEfilterDHCPServerClientMacAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 7, 4, 1, 2), MacAddress().clone(hexValue="000102030405"))NEWLINEif mibBuilder.loadTexts: filterDHCPServerClientMacAddr.setStatus('current')NEWLINEif mibBuilder.loadTexts: filterDHCPServerClientMacAddr.setDescription('Ethernet Mac Address.')NEWLINEfilterDHCPServerPortList = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 7, 4, 1, 3), PortList()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: filterDHCPServerPortList.setStatus('current')NEWLINEif mibBuilder.loadTexts: filterDHCPServerPortList.setDescription("Specifies the port numbers through which the authorized manager can access the switch. By default the authorized manager is allowed to access the switch through all the ports. If a set of ports are configured in the 'PortList', the manager can access the switch only through the configured ports.")NEWLINEfilterDHCPServerVlanList = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 7, 4, 1, 4), OctetString()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: filterDHCPServerVlanList.setStatus('current')NEWLINEif mibBuilder.loadTexts: filterDHCPServerVlanList.setDescription("Specifies the port numbers through which the authorized manager can access the switch. By default the authorized manager is allowed to access the switch through all the ports. If a set of ports are configured in the 'PortList', the manager can access the switch only through the configured ports.")NEWLINEfilterDHCPServerRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 7, 4, 1, 99), RowStatus()).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: filterDHCPServerRowStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: filterDHCPServerRowStatus.setDescription('This object indicates the status of this entry.')NEWLINEsecurityTrafficSeg = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 9))NEWLINEtrafficSegTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 9, 1), )NEWLINEif mibBuilder.loadTexts: trafficSegTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: trafficSegTable.setDescription('A Port-channel is created through ifMain table. After the creation of the port-channel, corresponding logical interface will be created in the ifMain table. This Port-channel table is indexed through Key values and allows to configure link selection policy and the Mac address for the port-channel. All other objects in this table displays the details of the port-channel')NEWLINEtrafficSegEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 9, 1, 1), ).setIndexNames((0, "DES-1210-28MEbx", "trafficSegIfIndex"))NEWLINEif mibBuilder.loadTexts: trafficSegEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: trafficSegEntry.setDescription('There is one entry in this table for each created port-channel port')NEWLINEtrafficSegIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 9, 1, 1, 1), InterfaceIndex()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: trafficSegIfIndex.setStatus('current')NEWLINEif mibBuilder.loadTexts: trafficSegIfIndex.setDescription("The ifIndex of the port-channel(Aggregator's interface index). ")NEWLINEtrafficSegMemberList = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 9, 1, 1, 2), PortList()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: trafficSegMemberList.setStatus('current')NEWLINEif mibBuilder.loadTexts: trafficSegMemberList.setDescription('Port list of port channel.')NEWLINEsecurityAAC = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 11))NEWLINEaacAuthenAdminState = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 11, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aacAuthenAdminState.setStatus('current')NEWLINEif mibBuilder.loadTexts: aacAuthenAdminState.setDescription('This object indicates the Access Authentication is enable or disable.')NEWLINEaacAuthParamResponseTimeout = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 11, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aacAuthParamResponseTimeout.setStatus('current')NEWLINEif mibBuilder.loadTexts: aacAuthParamResponseTimeout.setDescription('Timeout in second for login authentication response.')NEWLINEaacAuthParamAttempt = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 11, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 255))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aacAuthParamAttempt.setStatus('current')NEWLINEif mibBuilder.loadTexts: aacAuthParamAttempt.setDescription('The amount for login authentication, if login failure exceed, connection or access would be locked.')NEWLINEaacAPAuthMethodGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 11, 4))NEWLINEaacAPLoginMethod = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 11, 4, 1))NEWLINEaacAPEnableMethod = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 11, 4, 2))NEWLINEaacAPConsoleLoginMethod = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 11, 4, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 8))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aacAPConsoleLoginMethod.setStatus('current')NEWLINEif mibBuilder.loadTexts: aacAPConsoleLoginMethod.setDescription('Specify the way which has to execute authentication while login the system and the method for authentication.Access system via local console')NEWLINEaacAPTelnetLoginMethod = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 11, 4, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 8))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aacAPTelnetLoginMethod.setStatus('current')NEWLINEif mibBuilder.loadTexts: aacAPTelnetLoginMethod.setDescription('Specify the way which has to execute authentication while login the system and the method for authentication.Access system via telnet.')NEWLINEaacAPSSHLoginMethod = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 11, 4, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 8))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aacAPSSHLoginMethod.setStatus('current')NEWLINEif mibBuilder.loadTexts: aacAPSSHLoginMethod.setDescription('Specify the way which has to execute authentication while login the system and the method for authentication.Access system via SSH.')NEWLINEaacAPHttpLoginMethod = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 11, 4, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 8))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aacAPHttpLoginMethod.setStatus('current')NEWLINEif mibBuilder.loadTexts: aacAPHttpLoginMethod.setDescription('Specify the way which has to execute authentication while login the system and the method for authentication.Access system via HTTP.')NEWLINEaacAPConsoleEnableMethod = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 11, 4, 2, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 8))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aacAPConsoleEnableMethod.setStatus('current')NEWLINEif mibBuilder.loadTexts: aacAPConsoleEnableMethod.setDescription('Specify the way which has to execute authentication while login the system and the method for authentication.Access system via local console.')NEWLINEaacAPTelnetEnableMethod = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 11, 4, 2, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 8))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aacAPTelnetEnableMethod.setStatus('current')NEWLINEif mibBuilder.loadTexts: aacAPTelnetEnableMethod.setDescription('Specify the way which has to execute authentication while login the system and the method for authentication.Access system via telnet.')NEWLINEaacAPSSHEnableMethod = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 11, 4, 2, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 8))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aacAPSSHEnableMethod.setStatus('current')NEWLINEif mibBuilder.loadTexts: aacAPSSHEnableMethod.setDescription('Specify the way which has to execute authentication while login the system and the method for authentication.Access system via SSH.')NEWLINEaacAPHttpEnableMethod = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 11, 4, 2, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 8))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aacAPHttpEnableMethod.setStatus('current')NEWLINEif mibBuilder.loadTexts: aacAPHttpEnableMethod.setDescription('Specify the way which has to execute authentication while login the system and the method for authentication.Access system via HTTP.')NEWLINEaacServerGroupTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 11, 5), )NEWLINEif mibBuilder.loadTexts: aacServerGroupTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: aacServerGroupTable.setDescription('A table that contains informations about server group.')NEWLINEaacServerGroupEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 11, 5, 1), ).setIndexNames((0, "DES-1210-28MEbx", "aacServerGroupIndex"))NEWLINEif mibBuilder.loadTexts: aacServerGroupEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: aacServerGroupEntry.setDescription('A list of the group including servers.')NEWLINEaacServerGroupIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 11, 5, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(2, 9))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: aacServerGroupIndex.setStatus('current')NEWLINEif mibBuilder.loadTexts: aacServerGroupIndex.setDescription('A value that uniquely identifies this SwAACServerGroupEntry .')NEWLINEaacServerGroupName = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 11, 5, 1, 2), OctetString().subtype(subtypeSpec=ValueSizeConstraint(1, 15))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aacServerGroupName.setStatus('current')NEWLINEif mibBuilder.loadTexts: aacServerGroupName.setDescription("A human-readable text string of the method group. The name is writable only if Group is new created, which the value of aacServerGroupRowStatus is 'notReady'.")NEWLINEaacServersInGroup = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 11, 5, 1, 3), Bits().clone(namedValues=NamedValues(("id1", 0), ("id2", 1), ("id3", 2), ("id4", 3), ("id5", 4), ("id6", 5), ("id7", 6), ("id8", 7), ("id9", 8), ("id10", 9), ("id11", 10), ("id12", 11), ("id13", 12), ("id14", 13), ("id15", 14), ("id16", 15)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aacServersInGroup.setStatus('current')NEWLINEif mibBuilder.loadTexts: aacServersInGroup.setDescription('The list of servers in the group, each bit indicates a specified server ID. The server must be created before including it.')NEWLINEaacServerGroupRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 11, 5, 1, 4), RowStatus()).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: aacServerGroupRowStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: aacServerGroupRowStatus.setDescription("This object indicates the status of this entry. An entry is created in this table when this object is SET to 'createAndWait'. The entry in this table is used when the status of this object is SET 'active'. The entry in this table is not used when this object is SET 'notInService'. An entry created in this table is be deleted when this object is SET 'destroy'.")NEWLINEiPv4aacServerInfoTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 11, 6), )NEWLINEif mibBuilder.loadTexts: iPv4aacServerInfoTable.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: iPv4aacServerInfoTable.setDescription('A table that contains information about severs.')NEWLINEiPv4aacServerInfoEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 11, 6, 1), ).setIndexNames((0, "DES-1210-28MEbx", "iPv4aacServerIndex"))NEWLINEif mibBuilder.loadTexts: iPv4aacServerInfoEntry.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: iPv4aacServerInfoEntry.setDescription('A list of the information of server .')NEWLINEiPv4aacServerIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 11, 6, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 16))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: iPv4aacServerIndex.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: iPv4aacServerIndex.setDescription('A value that uniquely identifies this SwAACServerGroupEntry.')NEWLINEiPv4aacServerIPAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 11, 6, 1, 2), IpAddress()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: iPv4aacServerIPAddr.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: iPv4aacServerIPAddr.setDescription('The IP address of Server')NEWLINEiPv4aacServerAuthProtocol = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 11, 6, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("tacacsPlus", 1), ("radius", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: iPv4aacServerAuthProtocol.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: iPv4aacServerAuthProtocol.setDescription('The authentication protocol provided by the Server.')NEWLINEiPv4aacServerAuthPort = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 11, 6, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: iPv4aacServerAuthPort.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: iPv4aacServerAuthPort.setDescription('The TCP/IP port .')NEWLINEiPv4aacServerAuthKey = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 11, 6, 1, 5), OctetString().subtype(subtypeSpec=ValueSizeConstraint(1, 254))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: iPv4aacServerAuthKey.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: iPv4aacServerAuthKey.setDescription('The key used while authentication process.')NEWLINEiPv4aacServerTimeout = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 11, 6, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 255))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: iPv4aacServerTimeout.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: iPv4aacServerTimeout.setDescription('Server response timeout .')NEWLINEiPv4aacServerRetryCount = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 11, 6, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 255))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: iPv4aacServerRetryCount.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: iPv4aacServerRetryCount.setDescription('Client retry count . (-1: No retry mechanism)')NEWLINEiPv4aacServerRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 11, 6, 1, 8), RowStatus()).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: iPv4aacServerRowStatus.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: iPv4aacServerRowStatus.setDescription("This object indicates the status of this entry. An entry is created in this table when this object is SET to 'createAndWait'. The entry in this table is used when the status of this object is SET 'active'. The entry in this table is not used when this object is SET 'notInService'. An entry created in this table is be deleted when this object is SET 'destroy'.")NEWLINEaacServerInfoTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 11, 7), )NEWLINEif mibBuilder.loadTexts: aacServerInfoTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: aacServerInfoTable.setDescription('A table that contains information about severs.')NEWLINEaacServerInfoEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 11, 7, 1), ).setIndexNames((0, "DES-1210-28MEbx", "aacServerIndex"))NEWLINEif mibBuilder.loadTexts: aacServerInfoEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: aacServerInfoEntry.setDescription('A list of the information of server .')NEWLINEaacServerIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 11, 7, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 16))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: aacServerIndex.setStatus('current')NEWLINEif mibBuilder.loadTexts: aacServerIndex.setDescription('A value that uniquely identifies this SwAACServerGroupEntry.')NEWLINEaacServerIPType = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 11, 7, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2)).clone(1)).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aacServerIPType.setStatus('current')NEWLINEif mibBuilder.loadTexts: aacServerIPType.setDescription('The IP address of the AAC server IP type referred to in this table entry. (IPv4=1, IPv6=2)')NEWLINEaacServerIPAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 11, 7, 1, 3), Ipv6Address()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aacServerIPAddr.setStatus('current')NEWLINEif mibBuilder.loadTexts: aacServerIPAddr.setDescription('The IP address of Server')NEWLINEaacServerInterfaceName = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 11, 7, 1, 4), OctetString()).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: aacServerInterfaceName.setStatus('current')NEWLINEif mibBuilder.loadTexts: aacServerInterfaceName.setDescription('Specifies the interface name when the aacServerIPAddr is linklocal address.')NEWLINEaacServerAuthProtocol = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 11, 7, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("tacacsPlus", 1), ("radius", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aacServerAuthProtocol.setStatus('current')NEWLINEif mibBuilder.loadTexts: aacServerAuthProtocol.setDescription('The authentication protocol provided by the Server.')NEWLINEaacServerAuthPort = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 11, 7, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aacServerAuthPort.setStatus('current')NEWLINEif mibBuilder.loadTexts: aacServerAuthPort.setDescription('The TCP/IP port .')NEWLINEaacServerAuthKey = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 11, 7, 1, 7), OctetString().subtype(subtypeSpec=ValueSizeConstraint(1, 254))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aacServerAuthKey.setStatus('current')NEWLINEif mibBuilder.loadTexts: aacServerAuthKey.setDescription('The key used while authentication process.')NEWLINEaacServerTimeout = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 11, 7, 1, 8), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 255))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aacServerTimeout.setStatus('current')NEWLINEif mibBuilder.loadTexts: aacServerTimeout.setDescription('Server response timeout .')NEWLINEaacServerRetryCount = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 11, 7, 1, 9), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 255))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aacServerRetryCount.setStatus('current')NEWLINEif mibBuilder.loadTexts: aacServerRetryCount.setDescription('Client retry count . (-1: No retry mechanism)')NEWLINEaacServerAccountingPort = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 11, 7, 1, 10), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aacServerAccountingPort.setStatus('current')NEWLINEif mibBuilder.loadTexts: aacServerAccountingPort.setDescription('The accounting port .')NEWLINEaacServerRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 11, 7, 1, 99), RowStatus()).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: aacServerRowStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: aacServerRowStatus.setDescription("This object indicates the status of this entry. An entry is created in this table when this object is SET to 'createAndWait'. The entry in this table is used when the status of this object is SET 'active'. The entry in this table is not used when this object is SET 'notInService'. An entry created in this table is be deleted when this object is SET 'destroy'.")NEWLINEaacLoginMethodListTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 11, 8), )NEWLINEif mibBuilder.loadTexts: aacLoginMethodListTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: aacLoginMethodListTable.setDescription('A table that contains information about Login authentication method lists.')NEWLINEaacLoginMethodListEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 11, 8, 1), ).setIndexNames((0, "DES-1210-28MEbx", "aacLoginMethodListIndex"))NEWLINEif mibBuilder.loadTexts: aacLoginMethodListEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: aacLoginMethodListEntry.setDescription('A list of the Authentication methods.')NEWLINEaacLoginMethodListIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 11, 8, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 8))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: aacLoginMethodListIndex.setStatus('current')NEWLINEif mibBuilder.loadTexts: aacLoginMethodListIndex.setDescription('A value that identifies this method list.')NEWLINEaacLoginMethodListName = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 11, 8, 1, 2), OctetString().subtype(subtypeSpec=ValueSizeConstraint(1, 15))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aacLoginMethodListName.setStatus('current')NEWLINEif mibBuilder.loadTexts: aacLoginMethodListName.setDescription('A human-readable text string of the method list.')NEWLINEaacLoginMethod1 = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 11, 8, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(-1, 0, 1, 2))).clone(namedValues=NamedValues(("none", -1), ("local", 0), ("tacacsPlus", 1), ("radius", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aacLoginMethod1.setStatus('current')NEWLINEif mibBuilder.loadTexts: aacLoginMethod1.setDescription('The type of Login method list. Besides the pre-defined type, it also allow to be set user-defined group by aacServerGroupIndex.')NEWLINEaacLoginMethod2 = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 11, 8, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(-1, 0, 1, 2))).clone(namedValues=NamedValues(("none", -1), ("local", 0), ("tacacsPlus", 1), ("radius", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aacLoginMethod2.setStatus('current')NEWLINEif mibBuilder.loadTexts: aacLoginMethod2.setDescription('The type of Login method list. Besides the pre-defined type, it also allow to be set user-defined group by aacServerGroupIndex.')NEWLINEaacLoginMethod3 = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 11, 8, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(-1, 0, 1, 2))).clone(namedValues=NamedValues(("none", -1), ("local", 0), ("tacacsPlus", 1), ("radius", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aacLoginMethod3.setStatus('current')NEWLINEif mibBuilder.loadTexts: aacLoginMethod3.setDescription('The type of Login method list. Besides the pre-defined type, it also allow to be set user-defined group by aacServerGroupIndex.')NEWLINEaacLoginMethod4 = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 11, 8, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(-1, 0, 1, 2))).clone(namedValues=NamedValues(("none", -1), ("local", 0), ("tacacsPlus", 1), ("radius", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aacLoginMethod4.setStatus('current')NEWLINEif mibBuilder.loadTexts: aacLoginMethod4.setDescription('The type of Login method list. Besides the pre-defined type, it also allow to be set user-defined group by aacServerGroupIndex.')NEWLINEaacLoginMethodListRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 11, 8, 1, 7), RowStatus()).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: aacLoginMethodListRowStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: aacLoginMethodListRowStatus.setDescription("This object indicates the status of this entry. An entry is created in this table when this object is SET to 'createAndWait'. The entry in this table is used when the status of this object is SET 'active'. The entry in this table is not used when this object is SET 'notInService'. An entry created in this table is be deleted when this object is SET 'destroy'.")NEWLINEaacEnableMethodListTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 11, 9), )NEWLINEif mibBuilder.loadTexts: aacEnableMethodListTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: aacEnableMethodListTable.setDescription('A table that contains information about Enable authentication method lists.')NEWLINEaacEnableMethodListEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 11, 9, 1), ).setIndexNames((0, "DES-1210-28MEbx", "aacEnableMethodListIndex"))NEWLINEif mibBuilder.loadTexts: aacEnableMethodListEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: aacEnableMethodListEntry.setDescription('A list of the Authentication methods.')NEWLINEaacEnableMethodListIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 11, 9, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 8))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: aacEnableMethodListIndex.setStatus('current')NEWLINEif mibBuilder.loadTexts: aacEnableMethodListIndex.setDescription('A value that identifies this method list.')NEWLINEaacEnableMethodListName = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 11, 9, 1, 2), OctetString().subtype(subtypeSpec=ValueSizeConstraint(1, 15))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aacEnableMethodListName.setStatus('current')NEWLINEif mibBuilder.loadTexts: aacEnableMethodListName.setDescription('A human-readable text string of the method list.')NEWLINEaacEnableMethod1 = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 11, 9, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(-1, 0, 1, 2))).clone(namedValues=NamedValues(("none", -1), ("local", 0), ("tacacsPlus", 1), ("radius", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aacEnableMethod1.setStatus('current')NEWLINEif mibBuilder.loadTexts: aacEnableMethod1.setDescription('The type of Login method list. Besides the pre-defined type, it also allow to be set user-defined group by aacServerGroupIndex.')NEWLINEaacEnableMethod2 = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 11, 9, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(-1, 0, 1, 2))).clone(namedValues=NamedValues(("none", -1), ("local", 0), ("tacacsPlus", 1), ("radius", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aacEnableMethod2.setStatus('current')NEWLINEif mibBuilder.loadTexts: aacEnableMethod2.setDescription('The type of Login method list. Besides the pre-defined type, it also allow to be set user-defined group by aacServerGroupIndex.')NEWLINEaacEnableMethod3 = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 11, 9, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(-1, 0, 1, 2))).clone(namedValues=NamedValues(("none", -1), ("local", 0), ("tacacsPlus", 1), ("radius", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aacEnableMethod3.setStatus('current')NEWLINEif mibBuilder.loadTexts: aacEnableMethod3.setDescription('The type of Login method list. Besides the pre-defined type, it also allow to be set user-defined group by aacServerGroupIndex.')NEWLINEaacEnableMethod4 = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 11, 9, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(-1, 0, 1, 2))).clone(namedValues=NamedValues(("none", -1), ("local", 0), ("tacacsPlus", 1), ("radius", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aacEnableMethod4.setStatus('current')NEWLINEif mibBuilder.loadTexts: aacEnableMethod4.setDescription('The type of Login method list. Besides the pre-defined type, it also allow to be set user-defined group by aacServerGroupIndex.')NEWLINEaacEnableMethodListRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 11, 9, 1, 7), RowStatus()).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: aacEnableMethodListRowStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: aacEnableMethodListRowStatus.setDescription("This object indicates the status of this entry. An entry is created in this table when this object is SET to 'createAndWait'. The entry in this table is used when the status of this object is SET 'active'. The entry in this table is not used when this object is SET 'notInService'. An entry created in this table is be deleted when this object is SET 'destroy'.")NEWLINEaacLocalEnablePassword = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 11, 10), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 15))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aacLocalEnablePassword.setStatus('current')NEWLINEif mibBuilder.loadTexts: aacLocalEnablePassword.setDescription('This object is used to set Local Enable Password.')NEWLINEaacAccountingMethodListTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 11, 11), )NEWLINEif mibBuilder.loadTexts: aacAccountingMethodListTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: aacAccountingMethodListTable.setDescription('A table that contains information about Accounting authentication method lists.')NEWLINEaacAccountingMethodListEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 11, 11, 1), ).setIndexNames((0, "DES-1210-28MEbx", "aacAccountingMethodListIndex"))NEWLINEif mibBuilder.loadTexts: aacAccountingMethodListEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: aacAccountingMethodListEntry.setDescription('A list of the Authentication methods.')NEWLINEaacAccountingMethodListIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 11, 11, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 8))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: aacAccountingMethodListIndex.setStatus('current')NEWLINEif mibBuilder.loadTexts: aacAccountingMethodListIndex.setDescription('A value that identifies this method list.')NEWLINEaacAccountingMethodListName = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 11, 11, 1, 2), OctetString().subtype(subtypeSpec=ValueSizeConstraint(1, 15))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aacAccountingMethodListName.setStatus('current')NEWLINEif mibBuilder.loadTexts: aacAccountingMethodListName.setDescription('A human-readable text string of the method list.')NEWLINEaacAccountingMethod1 = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 11, 11, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(-1, 0, 1, 2))).clone(namedValues=NamedValues(("none", -1), ("local", 0), ("tacacsPlus", 1), ("radius", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aacAccountingMethod1.setStatus('current')NEWLINEif mibBuilder.loadTexts: aacAccountingMethod1.setDescription('The type of Accounting method list. Besides the pre-defined type, it also allow to be set user-defined group by aacServerGroupIndex.')NEWLINEaacAccountingMethod2 = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 11, 11, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(-1, 0, 1, 2))).clone(namedValues=NamedValues(("none", -1), ("local", 0), ("tacacsPlus", 1), ("radius", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aacAccountingMethod2.setStatus('current')NEWLINEif mibBuilder.loadTexts: aacAccountingMethod2.setDescription('The type of Accounting method list. Besides the pre-defined type, it also allow to be set user-defined group by aacServerGroupIndex.')NEWLINEaacAccountingMethod3 = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 11, 11, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(-1, 0, 1, 2))).clone(namedValues=NamedValues(("none", -1), ("local", 0), ("tacacsPlus", 1), ("radius", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aacAccountingMethod3.setStatus('current')NEWLINEif mibBuilder.loadTexts: aacAccountingMethod3.setDescription('The type of Accounting method list. Besides the pre-defined type, it also allow to be set user-defined group by aacServerGroupIndex.')NEWLINEaacAccountingMethod4 = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 11, 11, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(-1, 0, 1, 2))).clone(namedValues=NamedValues(("none", -1), ("local", 0), ("tacacsPlus", 1), ("radius", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aacAccountingMethod4.setStatus('current')NEWLINEif mibBuilder.loadTexts: aacAccountingMethod4.setDescription('The type of Accounting method list. Besides the pre-defined type, it also allow to be set user-defined group by aacServerGroupIndex.')NEWLINEaacAccountingMethodListRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 11, 11, 1, 7), RowStatus()).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: aacAccountingMethodListRowStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: aacAccountingMethodListRowStatus.setDescription("This object indicates the status of this entry. An entry is created in this table when this object is SET to 'createAndWait'. The entry in this table is used when the status of this object is SET 'active'. The entry in this table is not used when this object is SET 'notInService'. An entry created in this table is be deleted when this object is SET 'destroy'.")NEWLINEaacAccountingServiceIndex = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 11, 12))NEWLINEaacAccountingServiceNetwork = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 11, 12, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, -1))).clone(namedValues=NamedValues(("radius-only", 0), ("default-method-list", 1), ("method-list-name", 2), ("disabled", -1))).clone(-1)).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aacAccountingServiceNetwork.setStatus('current')NEWLINEif mibBuilder.loadTexts: aacAccountingServiceNetwork.setDescription('This object indicates aac Accounting Service Network is radius_only, default_method_list, method_list_name and disable about Accounting Service Network.')NEWLINEaacAccountingServiceShell = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 11, 12, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, -1))).clone(namedValues=NamedValues(("radius-only", 0), ("default-method-list", 1), ("method-list-name", 2), ("disabled", -1))).clone(-1)).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aacAccountingServiceShell.setStatus('current')NEWLINEif mibBuilder.loadTexts: aacAccountingServiceShell.setDescription('This object indicates aac Accounting Service Shell is radius_only, default_method_list, method_list_name and disable about Accounting Service Network.')NEWLINEaacAccountingServiceSystem = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 11, 12, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, -1))).clone(namedValues=NamedValues(("radius-only", 0), ("default-method-list", 1), ("method-list-name", 2), ("disabled", -1))).clone(-1)).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aacAccountingServiceSystem.setStatus('current')NEWLINEif mibBuilder.loadTexts: aacAccountingServiceSystem.setDescription('This object indicates aac Accounting System Shell is radius_only, default_method_list, method_list_name and disable about Accounting Service Network.')NEWLINEaacAccountingServiceCommand = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 11, 13))NEWLINEaacAccountingServiceCommandAdministrator = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 11, 13, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, -1))).clone(namedValues=NamedValues(("method1", 0), ("method2", 1), ("method3", 2), ("method4", 3), ("disabled", -1))).clone(-1)).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aacAccountingServiceCommandAdministrator.setStatus('current')NEWLINEif mibBuilder.loadTexts: aacAccountingServiceCommandAdministrator.setDescription('This object indicates aac Accounting Command Admin is method1, method2, method3 , method4 and disable about Accounting Service Command')NEWLINEaacAccountingServiceCommandOperator = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 11, 13, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, -1))).clone(namedValues=NamedValues(("method1", 0), ("method2", 1), ("method3", 2), ("method4", 3), ("disabled", -1))).clone(-1)).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aacAccountingServiceCommandOperator.setStatus('current')NEWLINEif mibBuilder.loadTexts: aacAccountingServiceCommandOperator.setDescription('This object indicates aac Accounting Command Operato is method1, method2, method3 , method4 and disable about Accounting Service Command')NEWLINEaacAccountingServiceCommandPoweruser = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 11, 13, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, -1))).clone(namedValues=NamedValues(("method1", 0), ("method2", 1), ("method3", 2), ("method4", 3), ("disabled", -1))).clone(-1)).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aacAccountingServiceCommandPoweruser.setStatus('current')NEWLINEif mibBuilder.loadTexts: aacAccountingServiceCommandPoweruser.setDescription('This object indicates aac Accounting Command Power user is method1, method2, method3 , method4 and disable about Accounting Service Command')NEWLINEaacAccountingServiceCommandUser = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 11, 13, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, -1))).clone(namedValues=NamedValues(("method1", 0), ("method2", 1), ("method3", 2), ("method4", 3), ("disabled", -1))).clone(-1)).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aacAccountingServiceCommandUser.setStatus('current')NEWLINEif mibBuilder.loadTexts: aacAccountingServiceCommandUser.setDescription('This object indicates aac Accounting Command User is method1, method2, method3 , method4 and disable about Accounting Service Command')NEWLINEaacServerPasswordEncryption = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 14, 11, 14), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: aacServerPasswordEncryption.setStatus('current')NEWLINEif mibBuilder.loadTexts: aacServerPasswordEncryption.setDescription('This object is used to configure server password encryption status.')NEWLINEmcastFilterPortTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 49, 1), )NEWLINEif mibBuilder.loadTexts: mcastFilterPortTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: mcastFilterPortTable.setDescription('A table to control multicast filtering modes.')NEWLINEmcastFilterPortEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 49, 1, 1), ).setIndexNames((0, "DES-1210-28MEbx", "mcastFilterPortIndex"))NEWLINEif mibBuilder.loadTexts: mcastFilterPortEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: mcastFilterPortEntry.setDescription('An entry appears in this table for each interface in the mcastFiltertem. Index to the table is the interface index of the port.')NEWLINEmcastFilterPortIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 49, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 28)))NEWLINEif mibBuilder.loadTexts: mcastFilterPortIndex.setStatus('current')NEWLINEif mibBuilder.loadTexts: mcastFilterPortIndex.setDescription('Interface index of the port for which the configuration in this entry applies. For all machines give maximum port number.')NEWLINEmcastFilterPortType = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 49, 1, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("forward", 1), ("filter", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: mcastFilterPortType.setStatus('current')NEWLINEif mibBuilder.loadTexts: mcastFilterPortType.setDescription('Configures the multicast filtering modes as below : forward -Forwards all unregistered groups. filter -Filters all unregistered groups.')NEWLINEstaticARPTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 34, 2), )NEWLINEif mibBuilder.loadTexts: staticARPTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: staticARPTable.setDescription('A list of the Static MACs')NEWLINEstaticARPEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 34, 2, 1), ).setIndexNames((0, "DES-1210-28MEbx", "staticARPIP"), (0, "DES-1210-28MEbx", "staticARPMac"))NEWLINEif mibBuilder.loadTexts: staticARPEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: staticARPEntry.setDescription('A Static MAC entry containing the mac and forwarding port.')NEWLINEstaticARPIP = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 34, 2, 1, 2), IpAddress()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: staticARPIP.setStatus('current')NEWLINEif mibBuilder.loadTexts: staticARPIP.setDescription('The VLAN ID of the static ARP IP.')NEWLINEstaticARPMac = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 34, 2, 1, 3), MacAddress()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: staticARPMac.setStatus('current')NEWLINEif mibBuilder.loadTexts: staticARPMac.setDescription('The MAC address associated of the static ARP entry.')NEWLINEstaticARPRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 34, 2, 1, 5), RowStatus()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: staticARPRowStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: staticARPRowStatus.setDescription('The status of an entry in the Static ARP Table. Only a subset of the rowstatus variables (active, createAndGo, destroy) are available. The trunk member port can not set up static ARP.')NEWLINEsysGratuitousARPGlobalSettings = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 48, 1))NEWLINEsysGratuitousARPSettings = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 48, 2))NEWLINEsysGratuitousARPIPIfStatusUp = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 48, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2))).clone('disable')).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sysGratuitousARPIPIfStatusUp.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysGratuitousARPIPIfStatusUp.setDescription('This object indicates Send On IP Interface Status Up is enabled or disabled.')NEWLINEsysGratuitousARPDuplicateIPDetected = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 48, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2))).clone('disable')).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sysGratuitousARPDuplicateIPDetected.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysGratuitousARPDuplicateIPDetected.setDescription('This object indicates Send On Duplicate IP Detected is enabled or disabled.')NEWLINEsysGratuitousARPLearning = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 48, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2))).clone('disable')).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sysGratuitousARPLearning.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysGratuitousARPLearning.setDescription('This object indicates Gratuitous ARP Learning is enabled or disabled.')NEWLINEsysGratuitousARPTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 48, 2, 1), )NEWLINEif mibBuilder.loadTexts: sysGratuitousARPTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysGratuitousARPTable.setDescription('Set/Add Gratuitous ARP interface name and interval time.')NEWLINEsysGratuitousARPEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 48, 2, 1, 1), ).setIndexNames((0, "DES-1210-28MEbx", "sysGratuitousARPIFName"))NEWLINEif mibBuilder.loadTexts: sysGratuitousARPEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysGratuitousARPEntry.setDescription('The entry of gratuitous ARP!')NEWLINEsysGratuitousARPIFName = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 48, 2, 1, 1, 1), OctetString().subtype(subtypeSpec=ValueSizeConstraint(1, 24))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: sysGratuitousARPIFName.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysGratuitousARPIFName.setDescription('Interface name.')NEWLINEsysGratuitousARPInterval = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 48, 2, 1, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: sysGratuitousARPInterval.setStatus('current')NEWLINEif mibBuilder.loadTexts: sysGratuitousARPInterval.setDescription('Gratuitous ARP interval time for each interface.')NEWLINEagentCPUutilization = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 100, 1))NEWLINEagentMEMutilization = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 100, 2))NEWLINEagentCPUutilizationIn5sec = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 100, 1, 1), Integer32()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: agentCPUutilizationIn5sec.setStatus('current')NEWLINEif mibBuilder.loadTexts: agentCPUutilizationIn5sec.setDescription('The time scale is set at 5 second intervals. The value will be between 0% (idle) and 100% (very busy).')NEWLINEagentCPUutilizationIn1min = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 100, 1, 2), Integer32()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: agentCPUutilizationIn1min.setStatus('current')NEWLINEif mibBuilder.loadTexts: agentCPUutilizationIn1min.setDescription('The time scale is set at 1 minute intervals. The value will be between 0% (idle) and 100% (very busy).')NEWLINEagentCPUutilizationIn5min = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 100, 1, 3), Integer32()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: agentCPUutilizationIn5min.setStatus('current')NEWLINEif mibBuilder.loadTexts: agentCPUutilizationIn5min.setDescription('The time scale is set at 5 minute intervals. The value will be between 0% (idle) and 100% (very busy).')NEWLINEagentMEMutilizationIn5sec = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 100, 2, 1), Integer32()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: agentMEMutilizationIn5sec.setStatus('current')NEWLINEif mibBuilder.loadTexts: agentMEMutilizationIn5sec.setDescription('The time scale is set at 5 second intervals. The value will be between 0% (idle) and 100% (very busy).')NEWLINEagentMEMutilizationIn1min = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 100, 2, 2), Integer32()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: agentMEMutilizationIn1min.setStatus('current')NEWLINEif mibBuilder.loadTexts: agentMEMutilizationIn1min.setDescription('The time scale is set at 1 minute intervals. The value will be between 0% (idle) and 100% (very busy).')NEWLINEagentMEMutilizationIn5min = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 100, 2, 3), Integer32()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: agentMEMutilizationIn5min.setStatus('current')NEWLINEif mibBuilder.loadTexts: agentMEMutilizationIn5min.setDescription('The time scale is set at 5 minute intervals. The value will be between 0% (idle) and 100% (very busy).')NEWLINEl2PTState = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 102, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: l2PTState.setStatus('current')NEWLINEif mibBuilder.loadTexts: l2PTState.setDescription('This object indicates the global state of Layer 2 protocol tunneling.')NEWLINEl2PTPortTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 102, 2), )NEWLINEif mibBuilder.loadTexts: l2PTPortTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: l2PTPortTable.setDescription('A table that cont ains the cable situation for each port.')NEWLINEl2PTEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 102, 2, 1), ).setIndexNames((0, "DES-1210-28MEbx", "l2PTPortIndex"))NEWLINEif mibBuilder.loadTexts: l2PTEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: l2PTEntry.setDescription('A list of cable situations for each port on the device.')NEWLINEl2PTPortIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 102, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 28)))NEWLINEif mibBuilder.loadTexts: l2PTPortIndex.setStatus('current')NEWLINEif mibBuilder.loadTexts: l2PTPortIndex.setDescription('This object indicates the port number. For all machines give maximum port number.')NEWLINEl2PTPortType = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 102, 2, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("none", 1), ("uni", 2), ("nni", 3))).clone('none')).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: l2PTPortType.setStatus('current')NEWLINEif mibBuilder.loadTexts: l2PTPortType.setDescription("This object indicates the Layer 2 protocol tunneling port type. The 'none' value indicates that the port is normal. Layer 2 protocol tunneling is disabled on this port. The 'uni' value indicates that the port is connected to the customer site. A Layer 2 PDU received on a UNI port can be tunneled to a remote customer site across the provider network. The 'nni' value indicates that the port is connected to the provider network. A Tunneled Layer 2 PDU received on an NNI port will be restored to its original format.")NEWLINEl2PTProtocol = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 102, 2, 1, 3), Bits().clone(namedValues=NamedValues(("stp", 0), ("gvrp", 1), ("macCC", 2), ("macCD", 3)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: l2PTProtocol.setStatus('current')NEWLINEif mibBuilder.loadTexts: l2PTProtocol.setDescription("This object indicates the tunneled protocols on this port. This object can only be applied on a UNI port. If the 'stp' BIT is set, the STP BPDU will be tunneled. If the 'gvrp' BIT is set, the GVRP PDU will be tunneled. If the 'mac-01-00-0C-CC-CC-CC' BIT is set, the PDU with the destination MAC address 01-00-0C-CC-CC-CC will be tunneled . If the 'mac-01-00-0C-CC-CC-CD' BIT is set, then the PDU with the destination MAC address 01-00-0C-CC-CC-CD will be tunneled.")NEWLINEl2PTThresholdTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 102, 3), )NEWLINEif mibBuilder.loadTexts: l2PTThresholdTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: l2PTThresholdTable.setDescription('This table contains the protocol tunneling threshold of a UNI port.')NEWLINEl2PTThresholdEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 102, 3, 1), ).setIndexNames((0, "DES-1210-28MEbx", "l2PTPortIndex"), (0, "DES-1210-28MEbx", "l2PTProtocolIndex"))NEWLINEif mibBuilder.loadTexts: l2PTThresholdEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: l2PTThresholdEntry.setDescription('A list with the Layer2 Protocol tunneling threshold.')NEWLINEl2PTProtocolIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 102, 3, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("stp", 1), ("gvrp", 2), ("macCC", 3), ("macCD", 4))))NEWLINEif mibBuilder.loadTexts: l2PTProtocolIndex.setStatus('current')NEWLINEif mibBuilder.loadTexts: l2PTProtocolIndex.setDescription('This object indicates the tunneled protocol of the port.')NEWLINEl2PTDropThreshold = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 102, 3, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: l2PTDropThreshold.setStatus('current')NEWLINEif mibBuilder.loadTexts: l2PTDropThreshold.setDescription('This object indicates the drop threshold for a given protocol on a UNI port. If the arrival rate of a tunneled protocol has reached its threshold, the received PDUs of this protocol will be dropped. The value 0 indicates there is no threshold for the protocol.')NEWLINEipv4smtpState = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 40, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("disabled", 0), ("enabled", 1)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ipv4smtpState.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: ipv4smtpState.setDescription('Enable or Disable SMTP function.')NEWLINEipv4smtpServerAddr = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 40, 2), IpAddress()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ipv4smtpServerAddr.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: ipv4smtpServerAddr.setDescription("SMTP Server's IP Address")NEWLINEipv4smtpServerPort = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 40, 3), Integer32()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ipv4smtpServerPort.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: ipv4smtpServerPort.setDescription("SMTP Server's port")NEWLINEipv4smtpSelfMailAddr = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 40, 4), OctetString()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ipv4smtpSelfMailAddr.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: ipv4smtpSelfMailAddr.setDescription("The sender's (DUT) mail address .")NEWLINEipv4smtpRecvMailAddrTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 40, 5), )NEWLINEif mibBuilder.loadTexts: ipv4smtpRecvMailAddrTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: ipv4smtpRecvMailAddrTable.setDescription("Receivers' mail address table.")NEWLINEipv4smtpRecvMailAddrEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 40, 5, 1), ).setIndexNames((0, "DES-1210-28MEbx", "ipv4smtpRecvMailAddrIndex"))NEWLINEif mibBuilder.loadTexts: ipv4smtpRecvMailAddrEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: ipv4smtpRecvMailAddrEntry.setDescription("Receivers' mail address entry.")NEWLINEipv4smtpRecvMailAddrIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 40, 5, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 8))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: ipv4smtpRecvMailAddrIndex.setStatus('current')NEWLINEif mibBuilder.loadTexts: ipv4smtpRecvMailAddrIndex.setDescription("Receivers' mail address index (1~8).")NEWLINEipv4smtpRecvMailAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 40, 5, 1, 2), OctetString()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ipv4smtpRecvMailAddr.setStatus('current')NEWLINEif mibBuilder.loadTexts: ipv4smtpRecvMailAddr.setDescription("Receivers' mail address.")NEWLINEipv4smtpRecvMailAddrStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 40, 5, 1, 3), RowStatus()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ipv4smtpRecvMailAddrStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: ipv4smtpRecvMailAddrStatus.setDescription("Rowstatus of the receiver's mail address.")NEWLINEsysSMTPServerGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 40, 6))NEWLINEsmtpState = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 40, 6, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("disabled", 0), ("enabled", 1)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: smtpState.setStatus('current')NEWLINEif mibBuilder.loadTexts: smtpState.setDescription('Enable or Disable SMTP function.')NEWLINEsmtpServerAddr = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 40, 6, 2), Ipv6Address()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: smtpServerAddr.setStatus('current')NEWLINEif mibBuilder.loadTexts: smtpServerAddr.setDescription("SMTP Server's IP Address")NEWLINEsmtpServerAddrType = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 40, 6, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("iPv4", 1), ("iPv6", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: smtpServerAddrType.setStatus('current')NEWLINEif mibBuilder.loadTexts: smtpServerAddrType.setDescription("SMTP Server's Address type.")NEWLINEsmtpServerAddrInterfaceName = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 40, 6, 4), OctetString()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: smtpServerAddrInterfaceName.setStatus('current')NEWLINEif mibBuilder.loadTexts: smtpServerAddrInterfaceName.setDescription('Specifies the interface name when the smtpServerAddrInterfaceName is linklocal address.')NEWLINEsmtpServerPort = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 40, 6, 5), Integer32()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: smtpServerPort.setStatus('current')NEWLINEif mibBuilder.loadTexts: smtpServerPort.setDescription("SMTP Server's port")NEWLINEsmtpSelfMailAddr = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 40, 6, 6), OctetString()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: smtpSelfMailAddr.setStatus('current')NEWLINEif mibBuilder.loadTexts: smtpSelfMailAddr.setDescription("The sender's (DUT) mail address .")NEWLINEsmtpRecvMailAddrTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 40, 6, 7), )NEWLINEif mibBuilder.loadTexts: smtpRecvMailAddrTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: smtpRecvMailAddrTable.setDescription("Receivers' mail address table.")NEWLINEsmtpRecvMailAddrEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 40, 6, 7, 1), ).setIndexNames((0, "DES-1210-28MEbx", "smtpRecvMailAddrIndex"))NEWLINEif mibBuilder.loadTexts: smtpRecvMailAddrEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: smtpRecvMailAddrEntry.setDescription("Receivers' mail address entry.")NEWLINEsmtpRecvMailAddrIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 40, 6, 7, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 8))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: smtpRecvMailAddrIndex.setStatus('current')NEWLINEif mibBuilder.loadTexts: smtpRecvMailAddrIndex.setDescription("Receivers' mail address index (1~8).")NEWLINEsmtpRecvMailAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 40, 6, 7, 1, 2), OctetString()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: smtpRecvMailAddr.setStatus('current')NEWLINEif mibBuilder.loadTexts: smtpRecvMailAddr.setDescription("Receivers' mail address.")NEWLINEsmtpRecvMailAddrStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 40, 6, 7, 1, 3), RowStatus()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: smtpRecvMailAddrStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: smtpRecvMailAddrStatus.setDescription("Rowstatus of the receiver's mail address.")NEWLINEigmpMulticastVlanStatus = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 27, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2))).clone('disabled')).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: igmpMulticastVlanStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: igmpMulticastVlanStatus.setDescription('Enable/Disable IGMP Multicast Vlan function.')NEWLINEigmpMulticastVlanTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 27, 2), )NEWLINEif mibBuilder.loadTexts: igmpMulticastVlanTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: igmpMulticastVlanTable.setDescription('Information about the IGMP snooping multicast VLAN table.')NEWLINEigmpMulticastVlanEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 27, 2, 1), ).setIndexNames((0, "DES-1210-28MEbx", "igmpMulticastVlanid"))NEWLINEif mibBuilder.loadTexts: igmpMulticastVlanEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: igmpMulticastVlanEntry.setDescription('The entry of igmpMulticastVlanTable.')NEWLINEigmpMulticastVlanid = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 27, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(2, 4094))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: igmpMulticastVlanid.setStatus('current')NEWLINEif mibBuilder.loadTexts: igmpMulticastVlanid.setDescription('This object indicates the VLAN ID of the IGMP snooping multicast VLAN entry.')NEWLINEigmpMulticastVlanName = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 27, 2, 1, 2), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 32))).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: igmpMulticastVlanName.setStatus('current')NEWLINEif mibBuilder.loadTexts: igmpMulticastVlanName.setDescription('This object indicates the VLAN name of the IGMP snooping multicast VLAN entry.')NEWLINEigmpMulticastVlanSourcePort = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 27, 2, 1, 3), PortList()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: igmpMulticastVlanSourcePort.setStatus('current')NEWLINEif mibBuilder.loadTexts: igmpMulticastVlanSourcePort.setDescription('This object indicates the port list of the source ports of the IGMP snooping multicast VLAN. The source ports will be set as tag ports of the VLAN entry and the IGMP control messages received from the member ports will be forwarded to the source ports.')NEWLINEigmpMulticastVlanMemberPort = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 27, 2, 1, 4), PortList()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: igmpMulticastVlanMemberPort.setStatus('current')NEWLINEif mibBuilder.loadTexts: igmpMulticastVlanMemberPort.setDescription('This object indicates the port list of the member ports of the IGMP snooping multicast VLAN. The source ports will be set as untagged ports of the VLAN entry and the IGMP control messages received from the member ports will be forwarded to the source ports.')NEWLINEigmpMulticastVlanTagMemberPort = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 27, 2, 1, 5), PortList()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: igmpMulticastVlanTagMemberPort.setStatus('current')NEWLINEif mibBuilder.loadTexts: igmpMulticastVlanTagMemberPort.setDescription('This object indicates the port list of the tag member ports of the IGMP snooping multicast VLAN.')NEWLINEigmpMulticastVlanUntaggedSourcePort = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 27, 2, 1, 6), PortList()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: igmpMulticastVlanUntaggedSourcePort.setStatus('current')NEWLINEif mibBuilder.loadTexts: igmpMulticastVlanUntaggedSourcePort.setDescription('This object indicates the port list of the untag source ports of the IGMP snooping multicast VLAN.')NEWLINEigmpMulticastVlanState = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 27, 2, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: igmpMulticastVlanState.setStatus('current')NEWLINEif mibBuilder.loadTexts: igmpMulticastVlanState.setDescription('This object can be used to enable or disable the IGMP snooping multicast VLAN.')NEWLINEigmpMulticastVlanReplaceSourceIp = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 27, 2, 1, 8), IpAddress()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: igmpMulticastVlanReplaceSourceIp.setStatus('current')NEWLINEif mibBuilder.loadTexts: igmpMulticastVlanReplaceSourceIp.setDescription('The replacement source IP of this multicast VLAN.')NEWLINEigmpMulticastVlanRemapPriority = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 27, 2, 1, 9), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 7)).clone(-1)).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: igmpMulticastVlanRemapPriority.setStatus('current')NEWLINEif mibBuilder.loadTexts: igmpMulticastVlanRemapPriority.setDescription('The remap priority of this multicast VLAN.')NEWLINEigmpMulticastVlanReplacePriority = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 27, 2, 1, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2))).clone('disabled')).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: igmpMulticastVlanReplacePriority.setStatus('current')NEWLINEif mibBuilder.loadTexts: igmpMulticastVlanReplacePriority.setDescription('The replacement priority of this multicast VLAN.')NEWLINEigmpMulticastVlanRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 27, 2, 1, 11), RowStatus()).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: igmpMulticastVlanRowStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: igmpMulticastVlanRowStatus.setDescription('This object indicates the status of this entry.')NEWLINEigmpMulticastVlanGroupTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 27, 3), )NEWLINEif mibBuilder.loadTexts: igmpMulticastVlanGroupTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: igmpMulticastVlanGroupTable.setDescription('The table containing the IGMP snooping multicast VLAN group information')NEWLINEigmpMulticastVlanGroupEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 27, 3, 1), ).setIndexNames((0, "DES-1210-28MEbx", "igmpMulticastVlanGroupVid"), (0, "DES-1210-28MEbx", "igmpMulticastVlanGroupFromIp"), (0, "DES-1210-28MEbx", "igmpMulticastVlanGroupToIp"))NEWLINEif mibBuilder.loadTexts: igmpMulticastVlanGroupEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: igmpMulticastVlanGroupEntry.setDescription('Information about the current IGMP snooping multicast VLAN group.')NEWLINEigmpMulticastVlanGroupVid = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 27, 3, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 4094))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: igmpMulticastVlanGroupVid.setStatus('current')NEWLINEif mibBuilder.loadTexts: igmpMulticastVlanGroupVid.setDescription('This object indicates the VID of the IGMP snooping multicast VLAN group.')NEWLINEigmpMulticastVlanGroupFromIp = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 27, 3, 1, 2), IpAddress()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: igmpMulticastVlanGroupFromIp.setStatus('current')NEWLINEif mibBuilder.loadTexts: igmpMulticastVlanGroupFromIp.setDescription('Specifies the multicast address list for this VLAN.')NEWLINEigmpMulticastVlanGroupToIp = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 27, 3, 1, 3), IpAddress()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: igmpMulticastVlanGroupToIp.setStatus('current')NEWLINEif mibBuilder.loadTexts: igmpMulticastVlanGroupToIp.setDescription('Specifies the multicast address list for this VLAN.')NEWLINEigmpMulticastVlanGroupStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 27, 3, 1, 4), RowStatus()).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: igmpMulticastVlanGroupStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: igmpMulticastVlanGroupStatus.setDescription('This object indicates the status of this entry.')NEWLINEmulticastVlanTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 27, 4), )NEWLINEif mibBuilder.loadTexts: multicastVlanTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: multicastVlanTable.setDescription('Information about the IGMP/MLD snooping multicast VLAN table.')NEWLINEmulticastVlanEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 27, 4, 1), ).setIndexNames((0, "DES-1210-28MEbx", "multicastVlanid"))NEWLINEif mibBuilder.loadTexts: multicastVlanEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: multicastVlanEntry.setDescription('The entry of multicastVlanTable.')NEWLINEmulticastVlanid = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 27, 4, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(2, 4094))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: multicastVlanid.setStatus('current')NEWLINEif mibBuilder.loadTexts: multicastVlanid.setDescription('This object indicates the VLAN ID of the IGMP/MLD snooping multicast VLAN entry.')NEWLINEmulticastVlanName = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 27, 4, 1, 2), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 32))).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: multicastVlanName.setStatus('current')NEWLINEif mibBuilder.loadTexts: multicastVlanName.setDescription('This object indicates the VLAN name of the IGMP/MLD snooping multicast VLAN entry.')NEWLINEmulticastVlanSourcePort = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 27, 4, 1, 3), PortList()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: multicastVlanSourcePort.setStatus('current')NEWLINEif mibBuilder.loadTexts: multicastVlanSourcePort.setDescription('This object indicates the port list of the source ports of the IGMP/MLD snooping multicast VLAN. The source ports will be set as tag ports of the VLAN entry and the IGMP control messages received from themember ports will be forwarded to the source ports.')NEWLINEmulticastVlanMemberPort = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 27, 4, 1, 4), PortList()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: multicastVlanMemberPort.setStatus('current')NEWLINEif mibBuilder.loadTexts: multicastVlanMemberPort.setDescription('This object indicates the port list of the member ports of the IGMP/MLD snooping multicast VLAN. The source ports will be set as untagged ports of the VLAN entry and the IGMP control messages received from themember ports will be forwarded to the source ports.')NEWLINEmulticastVlanTagMemberPort = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 27, 4, 1, 5), PortList()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: multicastVlanTagMemberPort.setStatus('current')NEWLINEif mibBuilder.loadTexts: multicastVlanTagMemberPort.setDescription('This object indicates the port list of the tag member ports of the IGMP/MLD snooping multicast VLAN.')NEWLINEmulticastVlanUntaggedSourcePort = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 27, 4, 1, 6), PortList()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: multicastVlanUntaggedSourcePort.setStatus('current')NEWLINEif mibBuilder.loadTexts: multicastVlanUntaggedSourcePort.setDescription('This object indicates the port list of the untag source ports of the IGMP/MLD snooping multicast VLAN.')NEWLINEmulticastVlanState = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 27, 4, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: multicastVlanState.setStatus('current')NEWLINEif mibBuilder.loadTexts: multicastVlanState.setDescription('This object can be used to enable or disable the IGMP/MLD snooping multicast VLAN.')NEWLINEmulticastVlanIgmpReplaceSourceIp = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 27, 4, 1, 8), IpAddress()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: multicastVlanIgmpReplaceSourceIp.setStatus('current')NEWLINEif mibBuilder.loadTexts: multicastVlanIgmpReplaceSourceIp.setDescription('The replacement source IP of this IGMP snooping multicast VLAN.')NEWLINEmulticastVlanMldReplaceSourceIp = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 27, 4, 1, 9), Ipv6Address()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: multicastVlanMldReplaceSourceIp.setStatus('current')NEWLINEif mibBuilder.loadTexts: multicastVlanMldReplaceSourceIp.setDescription('The replacement source IP of this MLD snooping multicast VLAN.')NEWLINEmulticastVlanRemapPriority = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 27, 4, 1, 10), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 7)).clone(-1)).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: multicastVlanRemapPriority.setStatus('current')NEWLINEif mibBuilder.loadTexts: multicastVlanRemapPriority.setDescription('The remap priority of this multicast VLAN.')NEWLINEmulticastVlanReplacePriority = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 27, 4, 1, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2))).clone('disabled')).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: multicastVlanReplacePriority.setStatus('current')NEWLINEif mibBuilder.loadTexts: multicastVlanReplacePriority.setDescription('The replacement priority of this multicast VLAN.')NEWLINEmulticastVlanRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 27, 4, 1, 12), RowStatus()).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: multicastVlanRowStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: multicastVlanRowStatus.setDescription('This object indicates the status of this entry.')NEWLINEmulticastVlanGroupTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 27, 5), )NEWLINEif mibBuilder.loadTexts: multicastVlanGroupTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: multicastVlanGroupTable.setDescription('The table containing the IGMP/MLD snooping multicast VLAN group information')NEWLINEmulticastVlanGroupEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 27, 5, 1), ).setIndexNames((0, "DES-1210-28MEbx", "multicastVlanGroupVid"), (0, "DES-1210-28MEbx", "multicastVlanGroupIpType"), (0, "DES-1210-28MEbx", "multicastVlanGroupFromIp"), (0, "DES-1210-28MEbx", "multicastVlanGroupToIp"))NEWLINEif mibBuilder.loadTexts: multicastVlanGroupEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: multicastVlanGroupEntry.setDescription('The entry of multicastVlanGroupTable.')NEWLINEmulticastVlanGroupVid = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 27, 5, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 4094))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: multicastVlanGroupVid.setStatus('current')NEWLINEif mibBuilder.loadTexts: multicastVlanGroupVid.setDescription('This object indicates the VID of the IGMP/MLD snooping multicast VLAN group.')NEWLINEmulticastVlanGroupIpType = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 27, 5, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("iPv4", 1), ("iPv6", 2)))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: multicastVlanGroupIpType.setStatus('current')NEWLINEif mibBuilder.loadTexts: multicastVlanGroupIpType.setDescription('Type of specifies the multicast address list for this VLAN.')NEWLINEmulticastVlanGroupFromIp = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 27, 5, 1, 3), Ipv6Address()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: multicastVlanGroupFromIp.setStatus('current')NEWLINEif mibBuilder.loadTexts: multicastVlanGroupFromIp.setDescription('Specifies the multicast address list for this VLAN.')NEWLINEmulticastVlanGroupToIp = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 27, 5, 1, 4), Ipv6Address()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: multicastVlanGroupToIp.setStatus('current')NEWLINEif mibBuilder.loadTexts: multicastVlanGroupToIp.setDescription('Specifies the multicast address list for this VLAN.')NEWLINEmulticastVlanGroupStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 27, 5, 1, 5), RowStatus()).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: multicastVlanGroupStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: multicastVlanGroupStatus.setDescription('This object indicates the status of this entry.')NEWLINEpppoeGlobalState = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 98, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("disabled", 0), ("enabled", 1)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: pppoeGlobalState.setStatus('current')NEWLINEif mibBuilder.loadTexts: pppoeGlobalState.setDescription('PPPoE global state')NEWLINEpppoePortTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 98, 2), )NEWLINEif mibBuilder.loadTexts: pppoePortTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: pppoePortTable.setDescription('A table to control PPPoE features of the device.')NEWLINEpppoePortEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 98, 2, 1), ).setIndexNames((0, "DES-1210-28MEbx", "pppoePortIndex"))NEWLINEif mibBuilder.loadTexts: pppoePortEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: pppoePortEntry.setDescription('An entry appears in PPPoE table for each interface in the system.')NEWLINEpppoePortIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 98, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 6))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: pppoePortIndex.setStatus('current')NEWLINEif mibBuilder.loadTexts: pppoePortIndex.setDescription('Interface index of the port for the configuration in this entry applies.')NEWLINEpppoePortState = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 98, 2, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("disabled", 0), ("enabled", 1)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: pppoePortState.setStatus('current')NEWLINEif mibBuilder.loadTexts: pppoePortState.setDescription('PPPoE per port state')NEWLINEpppoePortCircuitIDType = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 98, 2, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4))).clone(namedValues=NamedValues(("ip", 0), ("mac", 1), ("udf", 2), ("vendor2", 3), ("vendor3", 4)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: pppoePortCircuitIDType.setStatus('current')NEWLINEif mibBuilder.loadTexts: pppoePortCircuitIDType.setDescription('PPPoE per port circuit ID type')NEWLINEpppoePortUDFString = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 98, 2, 1, 4), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 32))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: pppoePortUDFString.setStatus('current')NEWLINEif mibBuilder.loadTexts: pppoePortUDFString.setDescription('PPPoE per port UDF string')NEWLINEpppoePortCircuitIDVendor3String = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 98, 2, 1, 5), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 32))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: pppoePortCircuitIDVendor3String.setStatus('current')NEWLINEif mibBuilder.loadTexts: pppoePortCircuitIDVendor3String.setDescription('PPPoE per port circuit ID vendor3 string')NEWLINEpppoePortRemoteIDType = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 98, 2, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("default", 0), ("vendor2", 1), ("vendor3", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: pppoePortRemoteIDType.setStatus('current')NEWLINEif mibBuilder.loadTexts: pppoePortRemoteIDType.setDescription('PPPoE per port remote ID type')NEWLINEpppoePortRemoteIDVendor3String = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 98, 2, 1, 7), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 32))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: pppoePortRemoteIDVendor3String.setStatus('current')NEWLINEif mibBuilder.loadTexts: pppoePortRemoteIDVendor3String.setDescription('PPPoE per port remote ID vendor3 string')NEWLINErmonGlobalState = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 22, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: rmonGlobalState.setStatus('current')NEWLINEif mibBuilder.loadTexts: rmonGlobalState.setDescription('This object is for enabling or disabling RMON function.')NEWLINErmonStatistics = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 22, 2))NEWLINErmonHistory = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 22, 3))NEWLINErmonAlarm = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 22, 4))NEWLINErmonEvent = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 22, 5))NEWLINErmonStatsTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 22, 2, 1), )NEWLINEif mibBuilder.loadTexts: rmonStatsTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: rmonStatsTable.setDescription('A list of Ethernet statistics entries.')NEWLINErmonStatsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 22, 2, 1, 1), ).setIndexNames((0, "DES-1210-28MEbx", "rmonStatsIndex"))NEWLINEif mibBuilder.loadTexts: rmonStatsEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: rmonStatsEntry.setDescription('A collection of statistics kept for a particular Ethernet interface. As an example, an instance of the etherStatsPkts object might be named etherStatsPkts.1')NEWLINErmonStatsIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 22, 2, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: rmonStatsIndex.setStatus('current')NEWLINEif mibBuilder.loadTexts: rmonStatsIndex.setDescription('The value of this object uniquely identifies this etherStats entry.')NEWLINErmonStatsDataSource = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 22, 2, 1, 1, 2), ObjectIdentifier()).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: rmonStatsDataSource.setStatus('current')NEWLINEif mibBuilder.loadTexts: rmonStatsDataSource.setDescription('This object identifies the source of the data that this etherStats entry is configured to analyze. This source can be any ethernet interface on this device. In order to identify a particular interface, this object shall identify the instance of the ifIndex object, defined in RFC 2233 [17], for the desired interface. For example, if an entry were to receive data from interface #1, this object would be set to ifIndex.1. The statistics in this group reflect all packets on the local network segment attached to the identified interface. An agent may or may not be able to tell if fundamental changes to the media of the interface have occurred and necessitate an invalidation of this entry. For example, a hot-pluggable ethernet card could be pulled out and replaced by a token-ring card. In such a case, if the agent has such knowledge of the change, it is recommended that it invalidate this entry. This object may not be modified if the associated etherStatsStatus object is equal to valid(1).')NEWLINErmonStatsOwner = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 22, 2, 1, 1, 3), OwnerString()).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: rmonStatsOwner.setStatus('current')NEWLINEif mibBuilder.loadTexts: rmonStatsOwner.setDescription('The entity that configured this entry and is therefore using the resources assigned to it.')NEWLINErmonStatsStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 22, 2, 1, 1, 4), RmonStatus()).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: rmonStatsStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: rmonStatsStatus.setDescription('The status of this etherStats entry.')NEWLINErmonHistoryTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 22, 3, 1), )NEWLINEif mibBuilder.loadTexts: rmonHistoryTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: rmonHistoryTable.setDescription('A list of history control entries.')NEWLINErmonHistoryEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 22, 3, 1, 1), ).setIndexNames((0, "DES-1210-28MEbx", "rmonHistoryIndex"))NEWLINEif mibBuilder.loadTexts: rmonHistoryEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: rmonHistoryEntry.setDescription('A list of parameters that set up a periodic sampling of statistics. As an example, an instance of the historyControlInterval object might be named historyControlInterval.2')NEWLINErmonHistoryIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 22, 3, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: rmonHistoryIndex.setStatus('current')NEWLINEif mibBuilder.loadTexts: rmonHistoryIndex.setDescription('An index that uniquely identifies an entry in the historyControl table. Each such entry defines a set of samples at a particular interval for an interface on the device.')NEWLINErmonHistoryDataSource = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 22, 3, 1, 1, 2), ObjectIdentifier()).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: rmonHistoryDataSource.setStatus('current')NEWLINEif mibBuilder.loadTexts: rmonHistoryDataSource.setDescription('This object identifies the source of the data for which historical data was collected and placed in a media-specific table on behalf of this historyControlEntry. This source can be any interface on this device. In order to identify a particular interface, this object shall identify the instance of the ifIndex object, defined in RFC 2233 [17], for the desired interface. For example, if an entry were to receive data from interface #1, this object would be set to ifIndex.1. The statistics in this group reflect all packets on the local network segment attached to the identified interface. An agent may or may not be able to tell if fundamental changes to the media of the interface have occurred and necessitate an invalidation of this entry. For example, a hot-pluggable ethernet card could be pulled out and replaced by a token-ring card. In such a case, if the agent has such knowledge of the change, it is recommended that it invalidate this entry. This object may not be modified if the associated historyControlStatus object is equal to valid(1).')NEWLINErmonHistoryBucketsRequested = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 22, 3, 1, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535)).clone(50)).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: rmonHistoryBucketsRequested.setStatus('current')NEWLINEif mibBuilder.loadTexts: rmonHistoryBucketsRequested.setDescription('The requested number of discrete time intervals over which data is to be saved in the part of the media-specific table associated with this historyControlEntry. When this object is created or modified, the probe should set historyControlBucketsGranted as closely to this object as is possible for the particular probe implementation and available resources.')NEWLINErmonHistoryInterval = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 22, 3, 1, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 3600)).clone(1800)).setUnits('Seconds').setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: rmonHistoryInterval.setStatus('current')NEWLINEif mibBuilder.loadTexts: rmonHistoryInterval.setDescription("The interval in seconds over which the data is sampled for each bucket in the part of the media-specific table associated with this historyControlEntry. This interval can be set to any number of seconds between 1 and 3600 (1 hour). Because the counters in a bucket may overflow at their maximum value with no indication, a prudent manager will take into account the possibility of overflow in any of the associated counters. It is important to consider the minimum time in which any counter could overflow on a particular media type and set the historyControlInterval object to a value less than this interval. This is typically most important for the 'octets' counter in any media-specific table. For example, on an Ethernet network, the etherHistoryOctets counter could overflow in about one hour at the Ethernet's maximum utilization. This object may not be modified if the associated historyControlStatus object is equal to valid(1).")NEWLINErmonHistoryOwner = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 22, 3, 1, 1, 5), OwnerString()).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: rmonHistoryOwner.setStatus('current')NEWLINEif mibBuilder.loadTexts: rmonHistoryOwner.setDescription('The entity that configured this entry and is therefore using the resources assigned to it.')NEWLINErmonHistoryStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 22, 3, 1, 1, 6), RmonStatus()).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: rmonHistoryStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: rmonHistoryStatus.setDescription('The status of this historyControl entry. Each instance of the media-specific table associated with this historyControlEntry will be deleted by the agent if this historyControlEntry is not equal to valid(1).')NEWLINErmonAlarmTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 22, 4, 1), )NEWLINEif mibBuilder.loadTexts: rmonAlarmTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: rmonAlarmTable.setDescription('A list of alarm entries.')NEWLINErmonAlarmEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 22, 4, 1, 1), ).setIndexNames((0, "DES-1210-28MEbx", "rmonAlarmIndex"))NEWLINEif mibBuilder.loadTexts: rmonAlarmEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: rmonAlarmEntry.setDescription('A list of parameters that set up a periodic checking for alarm conditions. For example, an instance of the alarmValue object might be named alarmValue.8')NEWLINErmonAlarmIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 22, 4, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: rmonAlarmIndex.setStatus('current')NEWLINEif mibBuilder.loadTexts: rmonAlarmIndex.setDescription('An index that uniquely identifies an entry in the alarm table. Each such entry defines a diagnostic sample at a particular interval for an object on the device.')NEWLINErmonAlarmInterval = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 22, 4, 1, 1, 2), Integer32()).setUnits('Seconds').setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: rmonAlarmInterval.setStatus('current')NEWLINEif mibBuilder.loadTexts: rmonAlarmInterval.setDescription('The interval in seconds over which the data is sampled and compared with the rising and falling thresholds. When setting this variable, care should be taken in the case of deltaValue sampling - the interval should be set short enough that the sampled variable is very unlikely to increase or decrease by more than 2^31 - 1 during a single sampling interval. This object may not be modified if the associated alarmStatus object is equal to valid(1).')NEWLINErmonAlarmVariable = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 22, 4, 1, 1, 3), ObjectIdentifier()).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: rmonAlarmVariable.setStatus('current')NEWLINEif mibBuilder.loadTexts: rmonAlarmVariable.setDescription('The object identifier of the particular variable to be sampled. Only variables that resolve to an ASN.1 primitive type of INTEGER (INTEGER, Integer32, Counter32, Counter64, Gauge, or TimeTicks) may be sampled. Because SNMP access control is articulated entirely in terms of the contents of MIB views, no access control mechanism exists that can restrict the value of this object to identify only those objects that exist in a particular MIB view. Because there is thus no acceptable means of restricting the read access that could be obtained through the alarm mechanism, the probe must only grant write access to this object in those views that have read access to all objects on the probe. During a set operation, if the supplied variable name is not available in the selected MIB view, a badValue error must be returned. If at any time the variable name of an established alarmEntry is no longer available in the selected MIB view, the probe must change the status of this alarmEntry to invalid(4). This object may not be modified if the associated alarmStatus object is equal to valid(1).')NEWLINErmonAlarmSampleType = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 22, 4, 1, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("absoluteValue", 1), ("deltaValue", 2)))).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: rmonAlarmSampleType.setStatus('current')NEWLINEif mibBuilder.loadTexts: rmonAlarmSampleType.setDescription('The method of sampling the selected variable and calculating the value to be compared against the thresholds. If the value of this object is absoluteValue(1), the value of the selected variable will be compared directly with the thresholds at the end of the sampling interval. If the value of this object is deltaValue(2), the value of the selected variable at the last sample will be subtracted from the current value, and the difference compared with the thresholds. This object may not be modified if the associated alarmStatus object is equal to valid(1).')NEWLINErmonAlarmRisingThreshold = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 22, 4, 1, 1, 5), Integer32()).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: rmonAlarmRisingThreshold.setStatus('current')NEWLINEif mibBuilder.loadTexts: rmonAlarmRisingThreshold.setDescription('A threshold for the sampled statistic. When the current sampled value is greater than or equal to this threshold, and the value at the last sampling interval was less than this threshold, a single event will be generated. A single event will also be generated if the first sample after this entry becomes valid is greater than or equal to this threshold and the associated alarmStartupAlarm is equal to risingAlarm(1) or risingOrFallingAlarm(3). After a rising event is generated, another such event will not be generated until the sampled value falls below this threshold and reaches the alarmFallingThreshold. This object may not be modified if the associated alarmStatus object is equal to valid(1).')NEWLINErmonAlarmFallingThreshold = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 22, 4, 1, 1, 6), Integer32()).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: rmonAlarmFallingThreshold.setStatus('current')NEWLINEif mibBuilder.loadTexts: rmonAlarmFallingThreshold.setDescription('A threshold for the sampled statistic. When the current sampled value is less than or equal to this threshold, and the value at the last sampling interval was greater than this threshold, a single event will be generated. A single event will also be generated if the first sample after this entry becomes valid is less than or equal to this threshold and the associated alarmStartupAlarm is equal to fallingAlarm(2) or risingOrFallingAlarm(3). After a falling event is generated, another such event will not be generated until the sampled value rises above this threshold and reaches the alarmRisingThreshold. This object may not be modified if the associated alarmStatus object is equal to valid(1).')NEWLINErmonAlarmRisingEventIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 22, 4, 1, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: rmonAlarmRisingEventIndex.setStatus('current')NEWLINEif mibBuilder.loadTexts: rmonAlarmRisingEventIndex.setDescription('The index of the eventEntry that is used when a rising threshold is crossed. The eventEntry identified by a particular value of this index is the same as identified by the same value of the eventIndex object. If there is no corresponding entry in the eventTable, then no association exists. In particular, if this value is zero, no associated event will be generated, as zero is not a valid event index. This object may not be modified if the associated alarmStatus object is equal to valid(1).')NEWLINErmonAlarmFallingEventIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 22, 4, 1, 1, 8), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: rmonAlarmFallingEventIndex.setStatus('current')NEWLINEif mibBuilder.loadTexts: rmonAlarmFallingEventIndex.setDescription('The index of the eventEntry that is used when a falling threshold is crossed. The eventEntry identified by a particular value of this index is the same as identified by the same value of the eventIndex object. If there is no corresponding entry in the eventTable, then no association exists. In particular, if this value is zero, no associated event will be generated, as zero is not a valid event index. This object may not be modified if the associated alarmStatus object is equal to valid(1).')NEWLINErmonAlarmOwner = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 22, 4, 1, 1, 9), OwnerString()).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: rmonAlarmOwner.setStatus('current')NEWLINEif mibBuilder.loadTexts: rmonAlarmOwner.setDescription('The entity that configured this entry and is therefore using the resources assigned to it.')NEWLINErmonAlarmStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 22, 4, 1, 1, 10), RmonStatus()).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: rmonAlarmStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: rmonAlarmStatus.setDescription('The status of this alarm entry.')NEWLINErmonEventTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 22, 5, 1), )NEWLINEif mibBuilder.loadTexts: rmonEventTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: rmonEventTable.setDescription('A list of events to be generated.')NEWLINErmonEventEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 22, 5, 1, 1), ).setIndexNames((0, "DES-1210-28MEbx", "rmonEventIndex"))NEWLINEif mibBuilder.loadTexts: rmonEventEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: rmonEventEntry.setDescription('A set of parameters that describe an event to be generated when certain conditions are met. As an example, an instance of the eventLastTimeSent object might be named eventLastTimeSent.6')NEWLINErmonEventIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 22, 5, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: rmonEventIndex.setStatus('current')NEWLINEif mibBuilder.loadTexts: rmonEventIndex.setDescription('An index that uniquely identifies an entry in the event table. Each such entry defines one event that is to be generated when the appropriate conditions occur.')NEWLINErmonEventDescription = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 22, 5, 1, 1, 2), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 127))).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: rmonEventDescription.setStatus('current')NEWLINEif mibBuilder.loadTexts: rmonEventDescription.setDescription('A comment describing this event entry.')NEWLINErmonEventType = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 22, 5, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("none", 1), ("log", 2), ("snmptrap", 3), ("logandtrap", 4)))).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: rmonEventType.setStatus('current')NEWLINEif mibBuilder.loadTexts: rmonEventType.setDescription('The type of notification that the probe will make about this event. In the case of log, an entry is made in the log table for each event. In the case of snmp-trap, an SNMP trap is sent to one or more management stations.')NEWLINErmonEventCommunity = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 22, 5, 1, 1, 4), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 127))).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: rmonEventCommunity.setStatus('current')NEWLINEif mibBuilder.loadTexts: rmonEventCommunity.setDescription('If an SNMP trap is to be sent, it will be sent to the SNMP community specified by this octet string.')NEWLINErmonEventOwner = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 22, 5, 1, 1, 5), OwnerString()).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: rmonEventOwner.setStatus('current')NEWLINEif mibBuilder.loadTexts: rmonEventOwner.setDescription("The entity that configured this entry and is therefore using the resources assigned to it. If this object contains a string starting with 'monitor' and has associated entries in the log table, all connected management stations should retrieve those log entries, as they may have significance to all management stations connected to this device")NEWLINErmonEventStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 22, 5, 1, 1, 6), RmonStatus()).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: rmonEventStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: rmonEventStatus.setDescription('The status of this event entry. If this object is not equal to valid(1), all associated log entries shall be deleted by the agent.')NEWLINEneighborTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 50, 1), )NEWLINEif mibBuilder.loadTexts: neighborTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: neighborTable.setDescription('A list of the Neighbor Cache Table.')NEWLINEneighborEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 50, 1, 1), ).setIndexNames((0, "DES-1210-28MEbx", "neighborIfindex"), (0, "DES-1210-28MEbx", "neighborIPv6Addr"), (0, "DES-1210-28MEbx", "neighborMACAddr"))NEWLINEif mibBuilder.loadTexts: neighborEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: neighborEntry.setDescription('A Neighbor cache entry containing the ifindex and ipv6 addr.')NEWLINEneighborIfindex = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 50, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 255))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: neighborIfindex.setStatus('current')NEWLINEif mibBuilder.loadTexts: neighborIfindex.setDescription('The interface index of the Neighbor entry. Must be conform to the existing interface name.')NEWLINEneighborIPv6Addr = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 50, 1, 1, 2), Ipv6Address()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: neighborIPv6Addr.setStatus('current')NEWLINEif mibBuilder.loadTexts: neighborIPv6Addr.setDescription('Allows the entry of an IP address that will be a Neighbor entry into the Neighbor Cache Table.')NEWLINEneighborMACAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 50, 1, 1, 3), MacAddress()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: neighborMACAddr.setStatus('current')NEWLINEif mibBuilder.loadTexts: neighborMACAddr.setDescription('The MAC address associated of the Neighbor entry.')NEWLINEneighborType = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 50, 1, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("static", 1), ("dynamic", 2)))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: neighborType.setStatus('current')NEWLINEif mibBuilder.loadTexts: neighborType.setDescription('The type associated of the Neighbor entry.')NEWLINEneighborCacheState = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 50, 1, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7))).clone(namedValues=NamedValues(("static", 1), ("reachable", 2), ("incomplete", 3), ("stale", 4), ("delay", 5), ("probe", 6), ("notinservice", 7)))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: neighborCacheState.setStatus('current')NEWLINEif mibBuilder.loadTexts: neighborCacheState.setDescription('The type associated of the Neighbor entry.')NEWLINEneighborActiveStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 50, 1, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("active", 1), ("inactive", 2)))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: neighborActiveStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: neighborActiveStatus.setDescription('The active status of the Neighbor entry.')NEWLINEneighborRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 50, 1, 1, 7), RowStatus()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: neighborRowStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: neighborRowStatus.setDescription('The status of an entry in the Neighbor Cache Table. Only a subset of the rowstatus variables (active, createAndGo, destroy) are available.')NEWLINEdhcpv6RelayControl = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 86, 1))NEWLINEdhcpv6RelayManagement = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 86, 2))NEWLINEdhcpv6RelayOption37 = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 86, 3))NEWLINEdhcpv6RelayOption38 = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 86, 4))NEWLINEdhcpv6RelayOption18 = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 86, 5))NEWLINEdhcpv6RelayState = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 86, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: dhcpv6RelayState.setStatus('current')NEWLINEif mibBuilder.loadTexts: dhcpv6RelayState.setDescription('This object indicates DHCPv6 relay function is enabled or disabled.')NEWLINEdhcpv6RelayHopCount = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 86, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 16))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: dhcpv6RelayHopCount.setStatus('current')NEWLINEif mibBuilder.loadTexts: dhcpv6RelayHopCount.setDescription('This object indicates the maximum number of router hops that the DHCPv6 packets can cross.')NEWLINEdhcpv6RelayInterfaceSettingsTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 86, 2, 1), )NEWLINEif mibBuilder.loadTexts: dhcpv6RelayInterfaceSettingsTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: dhcpv6RelayInterfaceSettingsTable.setDescription('This table indicates the IP address as a destination to forward (relay) DHCP packets to.')NEWLINEdhcpv6RelayInterfaceSettingsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 86, 2, 1, 1), ).setIndexNames((0, "DES-1210-28MEbx", "dhcpv6RelayInterface"), (0, "DES-1210-28MEbx", "dhcpv6RelayServerIP"))NEWLINEif mibBuilder.loadTexts: dhcpv6RelayInterfaceSettingsEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: dhcpv6RelayInterfaceSettingsEntry.setDescription('A list of information indicates the IP address as a destination to forward (relay) DHCP packets to.')NEWLINEdhcpv6RelayInterface = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 86, 2, 1, 1, 1), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 12))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: dhcpv6RelayInterface.setStatus('current')NEWLINEif mibBuilder.loadTexts: dhcpv6RelayInterface.setDescription('This object indicates the maximum number of router hops that the DHCPv6 packets can cross.')NEWLINEdhcpv6RelayServerIP = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 86, 2, 1, 1, 2), Ipv6Address()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: dhcpv6RelayServerIP.setStatus('current')NEWLINEif mibBuilder.loadTexts: dhcpv6RelayServerIP.setDescription('This object indicates the DHCP server IP address.')NEWLINEdhcpv6RelayInterfaceSettingsRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 86, 2, 1, 1, 99), RowStatus()).setMaxAccess("readcreate")NEWLINEif mibBuilder.loadTexts: dhcpv6RelayInterfaceSettingsRowStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: dhcpv6RelayInterfaceSettingsRowStatus.setDescription('This object indicates the status of this entry.')NEWLINEdhcpv6RelayOption37State = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 86, 3, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("disabled", 0), ("enabled", 1)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: dhcpv6RelayOption37State.setStatus('current')NEWLINEif mibBuilder.loadTexts: dhcpv6RelayOption37State.setDescription('This object indicates DHCPv6 relay option 37 function is enabled or disabled.')NEWLINEdhcpv6RelayOption37CheckState = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 86, 3, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("disabled", 0), ("enabled", 1)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: dhcpv6RelayOption37CheckState.setStatus('current')NEWLINEif mibBuilder.loadTexts: dhcpv6RelayOption37CheckState.setDescription('This object indicates DHCPv6 relay option 37 Check function is enabled or disabled.')NEWLINEdhcpv6RelayOption37RemoteIDType = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 86, 3, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("default", 0), ("cid-with-user-define", 1), ("user-define", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: dhcpv6RelayOption37RemoteIDType.setStatus('current')NEWLINEif mibBuilder.loadTexts: dhcpv6RelayOption37RemoteIDType.setDescription('This object indicates the type of remote ID.')NEWLINEdhcpv6RelayOption37RemoteID = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 86, 3, 4), DisplayString()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: dhcpv6RelayOption37RemoteID.setStatus('current')NEWLINEif mibBuilder.loadTexts: dhcpv6RelayOption37RemoteID.setDescription('This object displays the current remote ID of the device. If RemoteIDType is set to default, the value will be the MAC address of the device, and this object cannot be modified. If RemoteIDType is set to user-defined, a new value can be written to this object.')NEWLINEdhcpv6RelayOpt38Table = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 86, 4, 1), )NEWLINEif mibBuilder.loadTexts: dhcpv6RelayOpt38Table.setStatus('current')NEWLINEif mibBuilder.loadTexts: dhcpv6RelayOpt38Table.setDescription('A table to control port security features of the device.')NEWLINEdhcpv6RelayOpt38Entry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 86, 4, 1, 1), ).setIndexNames((0, "DES-1210-28MEbx", "dhcpv6RelayOpt38PortIndex"))NEWLINEif mibBuilder.loadTexts: dhcpv6RelayOpt38Entry.setStatus('current')NEWLINEif mibBuilder.loadTexts: dhcpv6RelayOpt38Entry.setDescription('An entry appears in port security table for each interface in the system.')NEWLINEdhcpv6RelayOpt38PortIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 86, 4, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 28))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: dhcpv6RelayOpt38PortIndex.setStatus('current')NEWLINEif mibBuilder.loadTexts: dhcpv6RelayOpt38PortIndex.setDescription('The interface index for which the configuration in this entry applies. For all machines give maximum port number.')NEWLINEdhcpv6RelayOpt38PortState = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 86, 4, 1, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("disabled", 0), ("enabled", 1)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: dhcpv6RelayOpt38PortState.setStatus('current')NEWLINEif mibBuilder.loadTexts: dhcpv6RelayOpt38PortState.setDescription('Enable / disable option 38 port state.')NEWLINEdhcpv6RelayOpt38PortType = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 86, 4, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("default", 0), ("user-defined", 1)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: dhcpv6RelayOpt38PortType.setStatus('current')NEWLINEif mibBuilder.loadTexts: dhcpv6RelayOpt38PortType.setDescription('Configure option 38 port Type.')NEWLINEdhcpv6RelayOpt38PortID = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 86, 4, 1, 1, 4), DisplayString()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: dhcpv6RelayOpt38PortID.setStatus('current')NEWLINEif mibBuilder.loadTexts: dhcpv6RelayOpt38PortID.setDescription('Configure option 38 port ID. Only works when type is user-defined')NEWLINEdhcpv6RelayOption18State = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 86, 5, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("disabled", 0), ("enabled", 1)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: dhcpv6RelayOption18State.setStatus('current')NEWLINEif mibBuilder.loadTexts: dhcpv6RelayOption18State.setDescription('This object indicates DHCPv6 relay option 18 function is enabled or disabled.')NEWLINEdhcpv6RelayOption18CheckState = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 86, 5, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("disabled", 0), ("enabled", 1)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: dhcpv6RelayOption18CheckState.setStatus('current')NEWLINEif mibBuilder.loadTexts: dhcpv6RelayOption18CheckState.setDescription('This object indicates DHCPv6 relay option 18 Check function is enabled or disabled.')NEWLINEdhcpv6RelayOption18InterfaceIDType = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 86, 5, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("default", 0), ("cid", 1), ("vendor1", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: dhcpv6RelayOption18InterfaceIDType.setStatus('current')NEWLINEif mibBuilder.loadTexts: dhcpv6RelayOption18InterfaceIDType.setDescription('This object indicates the type of Interface ID.')NEWLINEmacBasedVlanTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 70, 1), )NEWLINEif mibBuilder.loadTexts: macBasedVlanTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: macBasedVlanTable.setDescription('A table that contains information on Vlan-MAC address mapping.')NEWLINEmacBasedVlanEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 70, 1, 1), ).setIndexNames((0, "DES-1210-28MEbx", "vlanMacMapIndex"))NEWLINEif mibBuilder.loadTexts: macBasedVlanEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: macBasedVlanEntry.setDescription('Entry that contains Vlan-MAC address mapping.')NEWLINEvlanMacMapIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 70, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 128))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: vlanMacMapIndex.setStatus('current')NEWLINEif mibBuilder.loadTexts: vlanMacMapIndex.setDescription('Index of cmMacBasedVlanEntry. This object indicates the mac vlan entry for which the configurations in cmMacBasedVlanEntry is to be done.')NEWLINEvlanMacMapAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 70, 1, 1, 2), MacAddress()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: vlanMacMapAddr.setStatus('current')NEWLINEif mibBuilder.loadTexts: vlanMacMapAddr.setDescription('The Mac address for which the Vlan mapping is present in the entry.')NEWLINEvlanMacMapAddrMask = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 70, 1, 1, 3), MacAddress()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: vlanMacMapAddrMask.setStatus('current')NEWLINEif mibBuilder.loadTexts: vlanMacMapAddrMask.setDescription('The Mac address for which the Vlan mapping is present in the entry.')NEWLINEvlanMacMapVid = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 70, 1, 1, 4), VlanIndex()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: vlanMacMapVid.setStatus('current')NEWLINEif mibBuilder.loadTexts: vlanMacMapVid.setDescription('The Vlan to which the mac address of this entry is mapped to.')NEWLINEvlanMacStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 70, 1, 1, 5), DisplayString()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: vlanMacStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: vlanMacStatus.setDescription('The status given to the mac-vlan entry.')NEWLINEvlanMacType = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 70, 1, 1, 6), DisplayString()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: vlanMacType.setStatus('current')NEWLINEif mibBuilder.loadTexts: vlanMacType.setDescription('The type given to the mac-vlan entry.')NEWLINEvlanMacMapRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 70, 1, 1, 99), RowStatus()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: vlanMacMapRowStatus.setStatus('current')NEWLINEif mibBuilder.loadTexts: vlanMacMapRowStatus.setDescription('The row status of the entry.')NEWLINEmacBasedVlanMethod = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 70, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("single", 1), ("range", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: macBasedVlanMethod.setStatus('current')NEWLINEif mibBuilder.loadTexts: macBasedVlanMethod.setDescription('A method of Vlan-MAC address mapping.')NEWLINEsfpVendorInfoTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 104, 1), )NEWLINEif mibBuilder.loadTexts: sfpVendorInfoTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: sfpVendorInfoTable.setDescription('This table indicates the IP address as a destination to forward (relay) DHCP packets to.')NEWLINEsfpVendorInfoEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 104, 1, 1), ).setIndexNames((0, "DES-1210-28MEbx", "sfpPortIndex"))NEWLINEif mibBuilder.loadTexts: sfpVendorInfoEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: sfpVendorInfoEntry.setDescription('A list of information indicates the IP address as a destination to forward (relay) DHCP packets to.')NEWLINEsfpPortIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 104, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 28))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: sfpPortIndex.setStatus('current')NEWLINEif mibBuilder.loadTexts: sfpPortIndex.setDescription('The available of index for fiber ports.')NEWLINEsfpConnectorType = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 104, 1, 1, 2), DisplayString()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: sfpConnectorType.setStatus('current')NEWLINEif mibBuilder.loadTexts: sfpConnectorType.setDescription('')NEWLINEsfpTranceiverCode = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 104, 1, 1, 3), DisplayString()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: sfpTranceiverCode.setStatus('current')NEWLINEif mibBuilder.loadTexts: sfpTranceiverCode.setDescription('')NEWLINEsfpBaudRate = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 104, 1, 1, 4), DisplayString()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: sfpBaudRate.setStatus('current')NEWLINEif mibBuilder.loadTexts: sfpBaudRate.setDescription('')NEWLINEsfpVendorName = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 104, 1, 1, 5), DisplayString()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: sfpVendorName.setStatus('current')NEWLINEif mibBuilder.loadTexts: sfpVendorName.setDescription('')NEWLINEsfpVendorOui = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 104, 1, 1, 6), DisplayString()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: sfpVendorOui.setStatus('current')NEWLINEif mibBuilder.loadTexts: sfpVendorOui.setDescription('')NEWLINEsfpVendorPn = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 104, 1, 1, 7), DisplayString()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: sfpVendorPn.setStatus('current')NEWLINEif mibBuilder.loadTexts: sfpVendorPn.setDescription('')NEWLINEsfpVendorRev = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 104, 1, 1, 8), DisplayString()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: sfpVendorRev.setStatus('current')NEWLINEif mibBuilder.loadTexts: sfpVendorRev.setDescription('')NEWLINEsfpWavelength = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 104, 1, 1, 9), DisplayString()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: sfpWavelength.setStatus('current')NEWLINEif mibBuilder.loadTexts: sfpWavelength.setDescription('')NEWLINEsfpVendorSn = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 104, 1, 1, 10), DisplayString()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: sfpVendorSn.setStatus('current')NEWLINEif mibBuilder.loadTexts: sfpVendorSn.setDescription('')NEWLINEsfpDateCode = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 104, 1, 1, 11), DisplayString()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: sfpDateCode.setStatus('current')NEWLINEif mibBuilder.loadTexts: sfpDateCode.setDescription('')NEWLINEddmCtrl = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 105, 1))NEWLINEddmInfo = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 105, 2))NEWLINEddmPowerUnit = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 105, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("mw", 0), ("dbm", 1))).clone('mw')).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ddmPowerUnit.setStatus('current')NEWLINEif mibBuilder.loadTexts: ddmPowerUnit.setDescription('This object indicates the TX/RX power global unit.')NEWLINEddmActionMgmtTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 105, 1, 2), )NEWLINEif mibBuilder.loadTexts: ddmActionMgmtTable.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: ddmActionMgmtTable.setDescription('This table contains the configuration of the action taken when any parameter exceeds its threshold.')NEWLINEddmActionMgmtEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 105, 1, 2, 1), ).setIndexNames((0, "DES-1210-28MEbx", "ddmActionPort"))NEWLINEif mibBuilder.loadTexts: ddmActionMgmtEntry.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: ddmActionMgmtEntry.setDescription('This is an entry of the swDdmConfigActionTable.')NEWLINEddmActionPort = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 105, 1, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 28))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: ddmActionPort.setStatus('current')NEWLINEif mibBuilder.loadTexts: ddmActionPort.setDescription('This object indicates the port. The available of index for fiber ports.')NEWLINEddmActionState = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 105, 1, 2, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("disable", 0), ("enable", 1)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ddmActionState.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: ddmActionState.setDescription('This object indicates the action type.')NEWLINEddmActionShutdown = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 105, 1, 2, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("none", 0), ("alarm", 1), ("warning", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ddmActionShutdown.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: ddmActionShutdown.setDescription('This object indicates the action type.')NEWLINEddmThresholdMgmtTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 105, 1, 3), )NEWLINEif mibBuilder.loadTexts: ddmThresholdMgmtTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: ddmThresholdMgmtTable.setDescription('This table contains DDM temperature configuration information.')NEWLINEddmThresholdMgmtEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 105, 1, 3, 1), ).setIndexNames((0, "DES-1210-28MEbx", "ddmThresholdPort"), (0, "DES-1210-28MEbx", "ddmThresholdType"))NEWLINEif mibBuilder.loadTexts: ddmThresholdMgmtEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: ddmThresholdMgmtEntry.setDescription('This is an entry of the swDdmConfigThresholdTable.')NEWLINEddmThresholdPort = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 105, 1, 3, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 28))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: ddmThresholdPort.setStatus('current')NEWLINEif mibBuilder.loadTexts: ddmThresholdPort.setDescription('This object indicates the port. The available of index for fiber ports.')NEWLINEddmThresholdType = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 105, 1, 3, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4))).clone(namedValues=NamedValues(("temperature", 0), ("voltage", 1), ("bias", 2), ("txPower", 3), ("rxPower", 4)))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: ddmThresholdType.setStatus('current')NEWLINEif mibBuilder.loadTexts: ddmThresholdType.setDescription('This object indicates the threshold type.')NEWLINEddmHighAlarm = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 105, 1, 3, 1, 3), DisplayString()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ddmHighAlarm.setStatus('current')NEWLINEif mibBuilder.loadTexts: ddmHighAlarm.setDescription('This object indicates the high alarm threshold value to be configured. As the value is a floating point data type, the DisplayString type is used to define this parameter.')NEWLINEddmLowAlarm = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 105, 1, 3, 1, 4), DisplayString()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ddmLowAlarm.setStatus('current')NEWLINEif mibBuilder.loadTexts: ddmLowAlarm.setDescription('This object indicates the low alarm threshold value to be configured. As the value is a floating data type, the DisplayString type is used to define this parameter.')NEWLINEddmHighWarning = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 105, 1, 3, 1, 5), DisplayString()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ddmHighWarning.setStatus('current')NEWLINEif mibBuilder.loadTexts: ddmHighWarning.setDescription('This object indicates the high warning threshold value to be configured. As the value is a floating data type, the DisplayString type is used to define this parameter.')NEWLINEddmLowWarning = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 105, 1, 3, 1, 6), DisplayString()).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ddmLowWarning.setStatus('current')NEWLINEif mibBuilder.loadTexts: ddmLowWarning.setDescription('This object indicates the low warning threshold value to be configured. As the value is a floating data type, the DisplayString type is used to define this parameter.')NEWLINEddmStatus = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 105, 2, 1))NEWLINEddmStatusTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 105, 2, 1, 1), )NEWLINEif mibBuilder.loadTexts: ddmStatusTable.setStatus('current')NEWLINEif mibBuilder.loadTexts: ddmStatusTable.setDescription('This table contains the DDM status information.')NEWLINEddmStatusEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 105, 2, 1, 1, 1), ).setIndexNames((0, "DES-1210-28MEbx", "ddmStatusPort"))NEWLINEif mibBuilder.loadTexts: ddmStatusEntry.setStatus('current')NEWLINEif mibBuilder.loadTexts: ddmStatusEntry.setDescription('This is an entry of the ddmStatusTable.')NEWLINEddmStatusPort = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 105, 2, 1, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 28))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: ddmStatusPort.setStatus('current')NEWLINEif mibBuilder.loadTexts: ddmStatusPort.setDescription('This object indicates the port. The available of index for fiber ports.')NEWLINEddmTemperature = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 105, 2, 1, 1, 1, 2), DisplayString()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: ddmTemperature.setStatus('current')NEWLINEif mibBuilder.loadTexts: ddmTemperature.setDescription('This object indicates the real time value of the temperature. As the value is a floating point data type, the DisplayString type is used to define this parameter.')NEWLINEddmVoltage = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 105, 2, 1, 1, 1, 3), DisplayString()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: ddmVoltage.setStatus('current')NEWLINEif mibBuilder.loadTexts: ddmVoltage.setDescription('This object indicates the real time value of the supply voltage. As the value value is a floating point data type, the DisplayString type is used to define this parameter.')NEWLINEddmBiasCurrent = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 105, 2, 1, 1, 1, 4), DisplayString()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: ddmBiasCurrent.setStatus('current')NEWLINEif mibBuilder.loadTexts: ddmBiasCurrent.setDescription('This object indicates the real time value of the tx bias.')NEWLINEddmTxPower = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 105, 2, 1, 1, 1, 5), DisplayString()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: ddmTxPower.setStatus('current')NEWLINEif mibBuilder.loadTexts: ddmTxPower.setDescription('This object indicates the real time value of the tx power. As the value is a floating point data type, the DisplayString type is used to define this parameter.')NEWLINEddmRxPower = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 105, 2, 1, 1, 1, 6), DisplayString()).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: ddmRxPower.setStatus('current')NEWLINEif mibBuilder.loadTexts: ddmRxPower.setDescription('This object indicates the real time value of the rx power. As the value is a floating data type, the DisplayString type is used to define this parameter.')NEWLINEftpFwTable = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 107, 1))NEWLINEftpConfigTable = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 107, 2))NEWLINEftpFwServerIpAddress = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 107, 1, 1), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 64))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ftpFwServerIpAddress.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: ftpFwServerIpAddress.setDescription("The FTP server's IPv4 address or IPv6 address is used to upload or download firmware.")NEWLINEftpFwImageFileName = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 107, 1, 2), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 64))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ftpFwImageFileName.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: ftpFwImageFileName.setDescription('Firmware file name used to upload or download firmware.')NEWLINEftpFwUsername = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 107, 1, 3), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 20))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ftpFwUsername.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: ftpFwUsername.setDescription('FTP username to login FTP.')NEWLINEftpFwPassword = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 107, 1, 4), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 20))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ftpFwPassword.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: ftpFwPassword.setDescription('FTP password to login FTP.')NEWLINEftpFwPath = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 107, 1, 5), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 64))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ftpFwPath.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: ftpFwPath.setDescription('FTP path can find file folder.')NEWLINEftpFwPort = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 107, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ftpFwPort.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: ftpFwPort.setDescription('FTP port to login FTP.')NEWLINEftpFwFTPOperation = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 107, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("none", 0), ("download", 1), ("upload", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ftpFwFTPOperation.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: ftpFwFTPOperation.setDescription('The FTP operates to perform downloading the firmware image to the unit. This object is used in conjunction with FTP settings')NEWLINEftpFwFTPOperationStatus = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 107, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4))).clone(namedValues=NamedValues(("none", 0), ("success", 1), ("fail", 2), ("progressing", 3), ("transmit", 4)))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: ftpFwFTPOperationStatus.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: ftpFwFTPOperationStatus.setDescription('The FTP operation status represent firmware backup or upgrade status.')NEWLINEftpConfigServerIpAddress = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 107, 2, 1), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 64))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ftpConfigServerIpAddress.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: ftpConfigServerIpAddress.setDescription("The FTP server's IPv4 address or IPv6 address is used to upload or download firmware.")NEWLINEftpConfigFileName = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 107, 2, 2), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 64))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ftpConfigFileName.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: ftpConfigFileName.setDescription('Config file name used to upload or download Config.')NEWLINEftpConfigUsername = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 107, 2, 3), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 20))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ftpConfigUsername.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: ftpConfigUsername.setDescription('FTP username to login FTP.')NEWLINEftpConfigPassword = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 107, 2, 4), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 20))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ftpConfigPassword.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: ftpConfigPassword.setDescription('FTP password to login FTP.')NEWLINEftpConfigPath = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 107, 2, 5), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 64))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ftpConfigPath.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: ftpConfigPath.setDescription('FTP path can find file folder.')NEWLINEftpConfigPort = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 107, 2, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ftpConfigPort.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: ftpConfigPort.setDescription('FTP port to login FTP.')NEWLINEftpConfigConfigID = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 107, 2, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("configID1", 1), ("configID2", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ftpConfigConfigID.setStatus('current')NEWLINEif mibBuilder.loadTexts: ftpConfigConfigID.setDescription('Config image id can select imageid1 or imageid2 to flash')NEWLINEftpConfigFTPOperation = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 107, 2, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("none", 0), ("download", 1), ("upload", 2)))).setMaxAccess("readwrite")NEWLINEif mibBuilder.loadTexts: ftpConfigFTPOperation.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: ftpConfigFTPOperation.setDescription('The FTP operates to perform downloading the config image to the unit. This object is used in conjunction with FTP settings')NEWLINEftpConfigFTPOperationStatus = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 75, 15, 2, 107, 2, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4))).clone(namedValues=NamedValues(("none", 0), ("success", 1), ("fail", 2), ("progressing", 3), ("transmit", 4)))).setMaxAccess("readonly")NEWLINEif mibBuilder.loadTexts: ftpConfigFTPOperationStatus.setStatus('obsolete')NEWLINEif mibBuilder.loadTexts: ftpConfigFTPOperationStatus.setDescription('The FTP operation status represent config backup or upgrade status.')NEWLINEmibBuilder.exportSymbols("DES-1210-28MEbx", swAuthRadiusServerTable=swAuthRadiusServerTable, stpNewRootTrapStatus=stpNewRootTrapStatus, ipv4sysSNTPDSTEndMon=ipv4sysSNTPDSTEndMon, cpuFilterv6L3RuleProfileNo=cpuFilterv6L3RuleProfileNo, iPv4aacServerAuthKey=iPv4aacServerAuthKey, pppoePortRemoteIDType=pppoePortRemoteIDType, ipv4aclProfileEntry=ipv4aclProfileEntry, sysPortErrPortIndex=sysPortErrPortIndex, ipv4aclQosVlanID=ipv4aclQosVlanID, dlinklldpState=dlinklldpState, laPortControl=laPortControl, cpuFilterProfileStatus=cpuFilterProfileStatus, sfpDateCode=sfpDateCode, impbBlockListMacAddress=impbBlockListMacAddress, swAuthUserName=swAuthUserName, companyDHCPv6Relay=companyDHCPv6Relay, aclL3RuleTcpPshBit=aclL3RuleTcpPshBit, lldpXdot3RemLinkAggEntry=lldpXdot3RemLinkAggEntry, portSecFDBPermanentTable=portSecFDBPermanentTable, aacEnableMethodListEntry=aacEnableMethodListEntry, cpuFilterL3RuleSrcIpAddr=cpuFilterL3RuleSrcIpAddr, trafficCtrlTimeInterval=trafficCtrlTimeInterval, companyQoSGroup=companyQoSGroup, cpuFilterL2RuleDstMacAddrMask=cpuFilterL2RuleDstMacAddrMask, mldsHostTable=mldsHostTable, protocolVlanEntry=protocolVlanEntry, swAuthAuthConfigPortControl=swAuthAuthConfigPortControl, errorSymbolWindow=errorSymbolWindow, ipv4aclUdfOffsetBase1=ipv4aclUdfOffsetBase1, mstCistPortEntry=mstCistPortEntry, iPv4swAuthRadiusServerAuthenticationPort=iPv4swAuthRadiusServerAuthenticationPort, OwnerString=OwnerString, staticAutoLearningList=staticAutoLearningList, VlanIndex=VlanIndex, lldpXdot1RemTable=lldpXdot1RemTable, dhcpBOOTPRelayTimeThreshold=dhcpBOOTPRelayTimeThreshold, ipv4trustedHostEntry=ipv4trustedHostEntry, igmpMulticastVlanRowStatus=igmpMulticastVlanRowStatus, aclL2RuleEntry=aclL2RuleEntry, aclL3RuleAction=aclL3RuleAction, aacAccountingMethod1=aacAccountingMethod1, ftpConfigConfigID=ftpConfigConfigID, tftpCfgTargetServerIpAddress=tftpCfgTargetServerIpAddress, igmpMulticastVlanGroupToIp=igmpMulticastVlanGroupToIp, dhcpBOOTPRelayInterface=dhcpBOOTPRelayInterface, lldpXdot3RemMaxFrameSizeTable=lldpXdot3RemMaxFrameSizeTable, sysDhcpAutoConfigTimeout=sysDhcpAutoConfigTimeout, pppoePortEntry=pppoePortEntry, rmonAlarmFallingEventIndex=rmonAlarmFallingEventIndex, snmpV3GroupSecurityModel=snmpV3GroupSecurityModel, rmonAlarmTable=rmonAlarmTable, sshUserInfoID=sshUserInfoID, snmpTrapCopperLinkUpDown=snmpTrapCopperLinkUpDown, snmpV3CommunityEncryption=snmpV3CommunityEncryption, mldsVlanCfgQuerier=mldsVlanCfgQuerier, ipv4cpuFilterProfileMask=ipv4cpuFilterProfileMask, qinqEntry=qinqEntry, aclUdfOffsetMask2=aclUdfOffsetMask2, neighborActiveStatus=neighborActiveStatus, qosDiffServType31=qosDiffServType31, qosUserPriIndex=qosUserPriIndex, ipv4cpuFilterProfileTable=ipv4cpuFilterProfileTable, ipv4aclQosStatus=ipv4aclQosStatus, sysBPDUAttackRecoverTime=sysBPDUAttackRecoverTime, cosBandwidthCtrlSettings=cosBandwidthCtrlSettings, staticVlanBaseAutoLearnList3k=staticVlanBaseAutoLearnList3k, ipv4sysSNTPDSTStartDay=ipv4sysSNTPDSTStartDay, cableDiagPair1Length=cableDiagPair1Length, ipv4syslogServUDPport=ipv4syslogServUDPport, ipv4sysSNTPTimeSeconds=ipv4sysSNTPTimeSeconds, ipv4aclUdfOffsetBase4=ipv4aclUdfOffsetBase4, lldpXdot3RemLinkAggPortId=lldpXdot3RemLinkAggPortId, ftpConfigServerIpAddress=ftpConfigServerIpAddress, autoFdbMacAddress=autoFdbMacAddress, qosPriSettings=qosPriSettings, lldpPortConfigEntry=lldpPortConfigEntry, lldpXdot3RemPortAutoNegEnabled=lldpXdot3RemPortAutoNegEnabled, ipifV6AddressIpType=ipifV6AddressIpType, ipv4aclUdfOffsetByte4=ipv4aclUdfOffsetByte4, aclProfileArpSenderIpAddrMask=aclProfileArpSenderIpAddrMask, swTimeRangeThursday=swTimeRangeThursday, rmonAlarmStatus=rmonAlarmStatus, igmpMulticastVlanName=igmpMulticastVlanName, cpuFilterL3RuleTable=cpuFilterL3RuleTable, rmonStatsStatus=rmonStatsStatus, rmonHistory=rmonHistory, ddmLowWarning=ddmLowWarning, sshPublKeyRSAAdmin=sshPublKeyRSAAdmin, companySNMPV3=companySNMPV3, staticMac=staticMac, aclL3Rule=aclL3Rule, aacAccountingServiceCommand=aacAccountingServiceCommand, trafficCtrlSettings=trafficCtrlSettings, snmpV3GroupTable=snmpV3GroupTable, ipifV6AddressRowStatus=ipifV6AddressRowStatus, rmonEvent=rmonEvent, sysGratuitousARPEntry=sysGratuitousARPEntry, macNotifyCtrlTable=macNotifyCtrlTable, eoamIfIndex=eoamIfIndex, qinqVlanTranslationSVIDOperation=qinqVlanTranslationSVIDOperation, ddmThresholdMgmtTable=ddmThresholdMgmtTable, stpMaxAge=stpMaxAge, aacServerGroupName=aacServerGroupName, ftpFwImageFileName=ftpFwImageFileName, sshSecurityStatus=sshSecurityStatus, snmpV3viewTreeType=snmpV3viewTreeType, sysLBDVlanLoopEntry=sysLBDVlanLoopEntry, dhcpBOOTPRelayOption82CheckState=dhcpBOOTPRelayOption82CheckState, aclv6L3RuleTable=aclv6L3RuleTable, stpBridgeGlobal=stpBridgeGlobal, neighborMACAddr=neighborMACAddr, laStatus=laStatus, dlinklldpMsgHoldMultiplier=dlinklldpMsgHoldMultiplier, aacAPHttpLoginMethod=aacAPHttpLoginMethod, dhcpv6RelayInterfaceSettingsTable=dhcpv6RelayInterfaceSettingsTable, aclFlowMeterEntry=aclFlowMeterEntry, sysPortMediaType=sysPortMediaType, sysPortMediaTypeOui=sysPortMediaTypeOui, dhcpv6RelayOption37State=dhcpv6RelayOption37State, stpTxHoldCount=stpTxHoldCount, sshMaxSession=sshMaxSession, sysSNTPTimeSeconds=sysSNTPTimeSeconds, swAuthAuthQuietPeriod=swAuthAuthQuietPeriod, sshConnectionTimeout=sshConnectionTimeout, ipv4cpuFilterProfileRuleCount=ipv4cpuFilterProfileRuleCount, securitySSL=securitySSL, bandwidthCtrlSettings=bandwidthCtrlSettings, syslogServSrvStatus=syslogServSrvStatus, sysGratuitousARPGlobalSettings=sysGratuitousARPGlobalSettings, ftpConfigTable=ftpConfigTable, cpuFilterProfileDstPortMask=cpuFilterProfileDstPortMask, cpuFilterv6L3RuleTcpSynBit=cpuFilterv6L3RuleTcpSynBit, cpuFilterProfileMask=cpuFilterProfileMask, ipv4cpuFilterProfileSrcPortMask=ipv4cpuFilterProfileSrcPortMask, impbPortDHCPv6VlanList3k=impbPortDHCPv6VlanList3k, aRPSpoofPreventRowStatus=aRPSpoofPreventRowStatus, aacAuthParamResponseTimeout=aacAuthParamResponseTimeout, iPv4aacServerTimeout=iPv4aacServerTimeout, rmonStatistics=rmonStatistics, sysUser=sysUser, multicastVlanTable=multicastVlanTable, sysLBDRecoverTime=sysLBDRecoverTime, aclv6L3RuleRateLimit=aclv6L3RuleRateLimit, companyAuthGroup=companyAuthGroup, aclFlowMeterBurstSize=aclFlowMeterBurstSize, lldpXdot3RemPowerClass=lldpXdot3RemPowerClass, qosDiffServType10=qosDiffServType10, sfpBaudRate=sfpBaudRate, ipv4snmpV3HostTable=ipv4snmpV3HostTable, cpuFilterL3RuleDstIpAddrMask=cpuFilterL3RuleDstIpAddrMask, aclL3RuleFilterTimeRange=aclL3RuleFilterTimeRange, staticVlanBaseAutoLearnList4k=staticVlanBaseAutoLearnList4k, trafficCtrlAutoRecoverTime=trafficCtrlAutoRecoverTime, macNotifyHistorySize=macNotifyHistorySize, sysGratuitousARPIFName=sysGratuitousARPIFName, cpuFilterL3RuleTcpSynBit=cpuFilterL3RuleTcpSynBit, lldpXdot3RemPowerEntry=lldpXdot3RemPowerEntry, gvrpSettingsLeaveAllTime=gvrpSettingsLeaveAllTime, sysSNTPDSTStartMin=sysSNTPDSTStartMin, aclL3RuleTcpFinBit=aclL3RuleTcpFinBit, impbBindingtrapsign=impbBindingtrapsign, cpuFilterProfileSrcPortMask=cpuFilterProfileSrcPortMask, cableDiagLinkStatus=cableDiagLinkStatus, snmpV3viewTreeName=snmpV3viewTreeName, newRootBrgaddress=newRootBrgaddress, qosDiffServType34=qosDiffServType34, igmpMulticastVlanUntaggedSourcePort=igmpMulticastVlanUntaggedSourcePort, ipv4cpuFilterProfileDstIpAddrMask=ipv4cpuFilterProfileDstIpAddrMask, ipv4sysIpAddr=ipv4sysIpAddr, cpuFilterL3RuleIgmpType=cpuFilterL3RuleIgmpType, snmpV3HostAddress=snmpV3HostAddress, macNotifyCtrlIndex=macNotifyCtrlIndex, mldsVlanRouterVlanId=mldsVlanRouterVlanId, swTimeRangeEndYear=swTimeRangeEndYear, qosTOSType02=qosTOSType02, doSCtrlMirrorPort=doSCtrlMirrorPort, lldpXdot3LocPowerMDISupported=lldpXdot3LocPowerMDISupported, cpuFilterL3RuleAction=cpuFilterL3RuleAction, multicastVlanMldReplaceSourceIp=multicastVlanMldReplaceSourceIp, cpuFilterv6L3RuleAction=cpuFilterv6L3RuleAction, sysMirrorCtrlEgressMirroring=sysMirrorCtrlEgressMirroring, sysSNTPFirstInterfaceName=sysSNTPFirstInterfaceName, trustedHostStatus=trustedHostStatus, impbPortDHCPSnoopingState=impbPortDHCPSnoopingState, iPv4swAuthRadiusServerAddress=iPv4swAuthRadiusServerAddress, ipifV6AddressEntry=ipifV6AddressEntry, stpModuleStatus=stpModuleStatus, cpuFilterL3RuleDscp=cpuFilterL3RuleDscp, mldsVlanMulticastGroupTable=mldsVlanMulticastGroupTable, portSecEntry=portSecEntry, baudRateConfiguration=baudRateConfiguration, lldpXdot1LocProtocolIndex=lldpXdot1LocProtocolIndex, cpuFilterProfileDstIpAddrMaskType=cpuFilterProfileDstIpAddrMaskType, ipv4snmpV3HostStatus=ipv4snmpV3HostStatus, tftpCfgTargetTftpOperationStatus=tftpCfgTargetTftpOperationStatus, trafficCtrlActionMode=trafficCtrlActionMode, syslogServFacility=syslogServFacility, cpuFilterProfileType=cpuFilterProfileType, pppoeGlobalState=pppoeGlobalState, qosDiffServType55=qosDiffServType55, aclQosStatus=aclQosStatus, mstCistPort=mstCistPort, staticMcastVlanID=staticMcastVlanID, igsHostTableHostIPAddress=igsHostTableHostIPAddress, aacLoginMethodListRowStatus=aacLoginMethodListRowStatus, sysSNTPDSTStartHour=sysSNTPDSTStartHour, staticARPRowStatus=staticARPRowStatus, sysPortCtrlMediumType=sysPortCtrlMediumType, mstMstiPortTable=mstMstiPortTable, sysLoginTimeoutInterval=sysLoginTimeoutInterval, lldpXdot1RemVlanNameEntry=lldpXdot1RemVlanNameEntry, laPortChannelMode=laPortChannelMode, ipv4cpuFilterProfileEntry=ipv4cpuFilterProfileEntry, aclL2RuleEtherType=aclL2RuleEtherType, aclQosProtocol=aclQosProtocol, cpuFilterL2RuleTable=cpuFilterL2RuleTable, swAuthRadiusServerTimeout=swAuthRadiusServerTimeout, aclL3RuleTcpRstBit=aclL3RuleTcpRstBit, companyL2PT=companyL2PT, duldRecoverTime=duldRecoverTime, trafficCtrlEntry=trafficCtrlEntry, cpuFilterL3RuleDstIpAddr=cpuFilterL3RuleDstIpAddr, smtpServerAddrInterfaceName=smtpServerAddrInterfaceName, aclL3RuleTos=aclL3RuleTos, tftpCfgTargetInterfaceName=tftpCfgTargetInterfaceName, aclPacketRuleOffsetValue2=aclPacketRuleOffsetValue2, lldpXdot3RemPowerPortClass=lldpXdot3RemPowerPortClass, aacAccountingMethodListIndex=aacAccountingMethodListIndex, iPv4swAuthRadiusServerEntry=iPv4swAuthRadiusServerEntry, aclProfileTable=aclProfileTable, qosTOSType01=qosTOSType01, aacServersInGroup=aacServersInGroup, ipv4aclUdfOffsetMask2=ipv4aclUdfOffsetMask2, sysSNTPDSTRepeatStartMin=sysSNTPDSTRepeatStartMin, snmpV3viewTreeSubtree=snmpV3viewTreeSubtree, stpPortPathCost=stpPortPathCost, lldpXdot3RemPowerPairControlable=lldpXdot3RemPowerPairControlable, qosTOSType03=qosTOSType03, PYSNMP_MODULE_ID=des_1210_28mebx, qinqVlanTranslationCVIDEntry=qinqVlanTranslationCVIDEntry, aclUdfOffsetMask4=aclUdfOffsetMask4, aclL3RuleTable=aclL3RuleTable, sfpVendorOui=sfpVendorOui, igsStatus=igsStatus, impbPortState=impbPortState, autoFdbPort=autoFdbPort, ipv4snmpV3HostCommunityName=ipv4snmpV3HostCommunityName, cpuFilterL2Rule1pPriority=cpuFilterL2Rule1pPriority, lldpXdot3RemPortOperMauType=lldpXdot3RemPortOperMauType, ddmActionState=ddmActionState, aclProfileNo=aclProfileNo, lldpXdot1LocProtocolEntry=lldpXdot1LocProtocolEntry, mldsVlanMulticastGroupIpAddress=mldsVlanMulticastGroupIpAddress, protocolGroupId=protocolGroupId)NEWLINEmibBuilder.exportSymbols("DES-1210-28MEbx", qosDiffServType23=qosDiffServType23, aacAPLoginMethod=aacAPLoginMethod, companyIpifGroup=companyIpifGroup, sysSNTPDSTRepeatEndWeek=sysSNTPDSTRepeatEndWeek, igsHost=igsHost, eoamEntry=eoamEntry, sshCipherSuiteList=sshCipherSuiteList, ddmActionShutdown=ddmActionShutdown, cosBandwidthEffectiveTX=cosBandwidthEffectiveTX, dhcpv6RelayManagement=dhcpv6RelayManagement, rmonEventStatus=rmonEventStatus, snmpV3GroupStatus=snmpV3GroupStatus, Ipv6Address=Ipv6Address, aacEnableMethodListRowStatus=aacEnableMethodListRowStatus, sysSNTPDSTMethod=sysSNTPDSTMethod, aacLoginMethod4=aacLoginMethod4, aacServerTimeout=aacServerTimeout, companyTrapSetting=companyTrapSetting, limitIpMulticastProfileID=limitIpMulticastProfileID, ddmThresholdMgmtEntry=ddmThresholdMgmtEntry, qinqRoleState=qinqRoleState, qosDiffServType01=qosDiffServType01, qinqVlanTranslationCVID=qinqVlanTranslationCVID, sshUserInfoEntry=sshUserInfoEntry, dlinklldpMsgTxInterval=dlinklldpMsgTxInterval, sysGratuitousARPIPIfStatusUp=sysGratuitousARPIPIfStatusUp, sysSave=sysSave, sysRestart=sysRestart, dhcpv6RelayOpt38PortID=dhcpv6RelayOpt38PortID, lldpXdot3LocLinkAggPortId=lldpXdot3LocLinkAggPortId, swAuthRadiusServerAddress=swAuthRadiusServerAddress, igsVlanMulticastGroupMacAddress=igsVlanMulticastGroupMacAddress, sysLBDCtrlIndex=sysLBDCtrlIndex, aclPacketRuleOffsetValue3=aclPacketRuleOffsetValue3, aclv6L3RuleDstIpAddr=aclv6L3RuleDstIpAddr, dot1qVlanManagementOnOff=dot1qVlanManagementOnOff, aacAccountingMethod2=aacAccountingMethod2, securityPortSecurity=securityPortSecurity, impbDhcpSnoopingMacAddress=impbDhcpSnoopingMacAddress, lldpXdot1ConfigProtoVlanEntry=lldpXdot1ConfigProtoVlanEntry, bandwidthCtrlEntry=bandwidthCtrlEntry, igsVlanRobustnessValue=igsVlanRobustnessValue, vlanMacType=vlanMacType, snmpV3TrapFirmUpgrade=snmpV3TrapFirmUpgrade, companyGuestVlan=companyGuestVlan, cpuFilterProfileDstMacAddrMask=cpuFilterProfileDstMacAddrMask, cpuFilterL3RuleTcpUdpDstPort=cpuFilterL3RuleTcpUdpDstPort, ipv4cpuFilterProfileStatus=ipv4cpuFilterProfileStatus, swTimeRangeTuesday=swTimeRangeTuesday, cpuFilterv6L3RuleTcpFinBit=cpuFilterv6L3RuleTcpFinBit, sshMacSuiteList=sshMacSuiteList, mstMstiPort=mstMstiPort, cosBandwidthCtrlEntry=cosBandwidthCtrlEntry, swAuthCtrlPktFwdMode=swAuthCtrlPktFwdMode, l2PTPortTable=l2PTPortTable, aclv6L3RuleReplace1P=aclv6L3RuleReplace1P, sysPortCtrlType=sysPortCtrlType, sysLBDMode=sysLBDMode, pppoePortCircuitIDType=pppoePortCircuitIDType, duldTable=duldTable, qosDiffServType37=qosDiffServType37, ipv4sysSNTPGMTMinutes=ipv4sysSNTPGMTMinutes, sysBPDUAttackCtrlEntry=sysBPDUAttackCtrlEntry, aclL3RuleDscp=aclL3RuleDscp, limitIpMulticastIPType=limitIpMulticastIPType, companyAgentBasicInfo=companyAgentBasicInfo, newRootOlddesignatedroot=newRootOlddesignatedroot, bandwidthEffecTxThreshold=bandwidthEffecTxThreshold, sysSNTPFirstServer=sysSNTPFirstServer, igsVlanRouterTable=igsVlanRouterTable, limitIpMulticastEntryIPType=limitIpMulticastEntryIPType, duldState=duldState, aclv6L3RuleReplaceQueue=aclv6L3RuleReplaceQueue, snmpV3Trap=snmpV3Trap, igsVlanQuerierVersionStatus=igsVlanQuerierVersionStatus, ftpConfigPort=ftpConfigPort, multicastVlanUntaggedSourcePort=multicastVlanUntaggedSourcePort, companyMulticastFilter=companyMulticastFilter, sysGratuitousARPTable=sysGratuitousARPTable, sfpVendorRev=sfpVendorRev, aclUdfOffsetByte3=aclUdfOffsetByte3, aclL3RuleProtocolMask=aclL3RuleProtocolMask, vlanMacMapVid=vlanMacMapVid, lldpXdot1ConfigVlanNameTable=lldpXdot1ConfigVlanNameTable, aacServerGroupIndex=aacServerGroupIndex, aclL3RuleTcpUdpSrcPort=aclL3RuleTcpUdpSrcPort, doSCtrlMirrorRxRate=doSCtrlMirrorRxRate, cpuFilterL2RuleVlanId=cpuFilterL2RuleVlanId, aclL3RulePortList=aclL3RulePortList, sysGratuitousARPInterval=sysGratuitousARPInterval, swAuthUserPassword=swAuthUserPassword, aacServerIndex=aacServerIndex, impbBindingListTable=impbBindingListTable, igsVlanMulticastGroupIpAddress=igsVlanMulticastGroupIpAddress, rmonAlarmRisingThreshold=rmonAlarmRisingThreshold, vlanTrunkEntry=vlanTrunkEntry, lldpXdot3LocMaxFrameSizeEntry=lldpXdot3LocMaxFrameSizeEntry, companyStaticMAC=companyStaticMAC, dhcpv6RelayOption38=dhcpv6RelayOption38, impbPortDHCPMaxEntryIPv6=impbPortDHCPMaxEntryIPv6, stpRootCost=stpRootCost, aclL2RuleReplace1P=aclL2RuleReplace1P, aclQosIndex=aclQosIndex, syslogServTable=syslogServTable, lldpXdot1LocTable=lldpXdot1LocTable, sfpWavelength=sfpWavelength, multicastVlanRemapPriority=multicastVlanRemapPriority, trustedHostIPType=trustedHostIPType, trafficCtrlTrap=trafficCtrlTrap, rmonAlarmEntry=rmonAlarmEntry, qosDiffServTypeGroup=qosDiffServTypeGroup, dhcpOption12HostName=dhcpOption12HostName, companyTimeRangeMgmt=companyTimeRangeMgmt, impbBindingtrap=impbBindingtrap, multicastVlanIgmpReplaceSourceIp=multicastVlanIgmpReplaceSourceIp, qinqVlanTranslationCVIDTable=qinqVlanTranslationCVIDTable, qosUserPriorityTable=qosUserPriorityTable, qosDiffServType04=qosDiffServType04, qosAclPrioritySettings=qosAclPrioritySettings, portSecIndex=portSecIndex, iPv4swAuthRadiusServerAccountingPort=iPv4swAuthRadiusServerAccountingPort, aclUdfOffsetBase2=aclUdfOffsetBase2, stpAdminPortPathCost=stpAdminPortPathCost, aclL2RuleVlanId=aclL2RuleVlanId, ipv4sysSNTPDSTState=ipv4sysSNTPDSTState, trafficControl=trafficControl, cpuFilterv6L3RuleTrafficClass=cpuFilterv6L3RuleTrafficClass, tftpCfgTargetTftpOperation=tftpCfgTargetTftpOperation, ddmActionPort=ddmActionPort, qosDiffServType53=qosDiffServType53, cpuFilterL2AccessID=cpuFilterL2AccessID, dhcpBOOTPRelayInterfaceSettingsEntry=dhcpBOOTPRelayInterfaceSettingsEntry, limitIpMulticastPortTable=limitIpMulticastPortTable, aacServerIPType=aacServerIPType, ftpFwFTPOperationStatus=ftpFwFTPOperationStatus, swTimeRangeSettingEntry=swTimeRangeSettingEntry, qosDiffServType51=qosDiffServType51, sysLBDCtrlEntry=sysLBDCtrlEntry, ipifVLANname=ipifVLANname, igmpMulticastVlanGroupVid=igmpMulticastVlanGroupVid, multicastVlanGroupStatus=multicastVlanGroupStatus, ipv4cpuFilterProfileIPProtocol=ipv4cpuFilterProfileIPProtocol, stpInstance=stpInstance, snmpV3GroupEntry=snmpV3GroupEntry, ipv4cpuFilterProfileNo=ipv4cpuFilterProfileNo, sysSNTPDSTStartDay=sysSNTPDSTStartDay, aclUdfOffsetByte1=aclUdfOffsetByte1, dlinklldpTxDelay=dlinklldpTxDelay, qosDiffServType17=qosDiffServType17, lldpXdot1LocProtoVlanEnabled=lldpXdot1LocProtoVlanEnabled, errorFramePeriodWindow=errorFramePeriodWindow, qosDiffServType06=qosDiffServType06, snmpV3Host=snmpV3Host, gvrpSettingsIngressChecking=gvrpSettingsIngressChecking, sysSNTPDSTStartMon=sysSNTPDSTStartMon, sysBPDUAttackCtrlTable=sysBPDUAttackCtrlTable, macNotificatiotn=macNotificatiotn, qosDiffServType57=qosDiffServType57, companyTftpGroup=companyTftpGroup, swAuthRadiusServer=swAuthRadiusServer, rmonHistoryInterval=rmonHistoryInterval, aclv6L3RuleTcpUdpDstPortMask=aclv6L3RuleTcpUdpDstPortMask, dhcpBOOTPRelayState=dhcpBOOTPRelayState, mldsHost=mldsHost, autoFdbVlanID=autoFdbVlanID, impbPortDHCPv4VlanList2k=impbPortDHCPv4VlanList2k, igsVlanRouterVlanId=igsVlanRouterVlanId, eoamLinkMonitorIfIndex=eoamLinkMonitorIfIndex, swAuthAuthDirection=swAuthAuthDirection, qosDSCPTOSMode=qosDSCPTOSMode, companyTraps=companyTraps, securityTrafficSeg=securityTrafficSeg, cpuFilterv6L3RuleICMPMessageType=cpuFilterv6L3RuleICMPMessageType, companyBPDUAttack=companyBPDUAttack, sysPortMediaTypeDateCode=sysPortMediaTypeDateCode, mldsVlanFastLeave=mldsVlanFastLeave, lldpXdot3RemLinkAggTable=lldpXdot3RemLinkAggTable, aacLoginMethodListTable=aacLoginMethodListTable, mcastFilterPortTable=mcastFilterPortTable, companyDHCPRelay=companyDHCPRelay, aclUdfOffsetByte2=aclUdfOffsetByte2, aacServerRowStatus=aacServerRowStatus, mstCistVlanMapped2k=mstCistVlanMapped2k, l2PTPortType=l2PTPortType, rmonHistoryIndex=rmonHistoryIndex, ftpConfigFTPOperation=ftpConfigFTPOperation, limitIpMulticastEntryTable=limitIpMulticastEntryTable, aRPSpoofPreventPortList=aRPSpoofPreventPortList, sysTrapIMPBViolation=sysTrapIMPBViolation, stpTopologyChangeTrapStatus=stpTopologyChangeTrapStatus, impbPortNDInspectionState=impbPortNDInspectionState, qosDiffServType59=qosDiffServType59, lldpXdot1LocProtoVlanTable=lldpXdot1LocProtoVlanTable, staticARPIP=staticARPIP, snmpV3UserName=snmpV3UserName, eoamRemoteLoopback=eoamRemoteLoopback, aclProfileMask=aclProfileMask, vlanTrunkSystem=vlanTrunkSystem, aclProfileRuleCount=aclProfileRuleCount, qosDiffServType60=qosDiffServType60, snmpV3Community=snmpV3Community, rmonEventDescription=rmonEventDescription, mldsVlanFilterTable=mldsVlanFilterTable, cpuFilterL3RuleProtocolMask=cpuFilterL3RuleProtocolMask, snmpGlobalState=snmpGlobalState, cpuFilterProfileSrcMacAddrMask=cpuFilterProfileSrcMacAddrMask, qosDiffServType12=qosDiffServType12, ipv4trustedHostIpAddr=ipv4trustedHostIpAddr, qosDiffServType62=qosDiffServType62, stpProtocolVersion=stpProtocolVersion, snmpTrapIMPBv2=snmpTrapIMPBv2, limitIpMulticastPortIPType=limitIpMulticastPortIPType, ddmLowAlarm=ddmLowAlarm, ipv4syslogServEntry=ipv4syslogServEntry, aacAPSSHEnableMethod=aacAPSSHEnableMethod, sfpPortIndex=sfpPortIndex, sshAuthenMethodHostKeyAdmin=sshAuthenMethodHostKeyAdmin, aclL2RuleFilterTimeRange=aclL2RuleFilterTimeRange, qosDiffServType38=qosDiffServType38, mldsVlanRouterEntry=mldsVlanRouterEntry, cpuFilterL3RuleICMPMessageCode=cpuFilterL3RuleICMPMessageCode, duplicateIP=duplicateIP, cpuFilterProfile=cpuFilterProfile, companySTP=companySTP, igsVlanQueryMaxResponseTime=igsVlanQueryMaxResponseTime, qosPriSetPortType=qosPriSetPortType, snmpV3CommunityPolicy=snmpV3CommunityPolicy, lldpXdot1RemProtocolIndex=lldpXdot1RemProtocolIndex, mldsVlanRouterTable=mldsVlanRouterTable, gvrpSettingsGVRPState=gvrpSettingsGVRPState, snmpV3UserPrivProtocol=snmpV3UserPrivProtocol, sysBootupConfigID=sysBootupConfigID, swTimeRangeStartDay=swTimeRangeStartDay, agentMEMutilizationIn5min=agentMEMutilizationIn5min, mldsVlanDataDrivenLearningStatus=mldsVlanDataDrivenLearningStatus, qosDiffServType32=qosDiffServType32, companySfpVendorInfo=companySfpVendorInfo, aacEnableMethod3=aacEnableMethod3, eoamTable=eoamTable, aclv6L3RulePortList=aclv6L3RulePortList, swTimeRangeFriday=swTimeRangeFriday, igsVlanRtrPortList=igsVlanRtrPortList, swAuthRadiusServerInterfaceName=swAuthRadiusServerInterfaceName, pppoePortCircuitIDVendor3String=pppoePortCircuitIDVendor3String, mcastFilterPortEntry=mcastFilterPortEntry, aclL2RuleSrcMacAddrMask=aclL2RuleSrcMacAddrMask, snmpV3TrapDuplicateIPDetected=snmpV3TrapDuplicateIPDetected, companyNeighbor=companyNeighbor, cosClassEntry=cosClassEntry, qosUserPriEntry=qosUserPriEntry, aclL3RuleTcpUrgBit=aclL3RuleTcpUrgBit, aacAccountingServiceCommandOperator=aacAccountingServiceCommandOperator, staticMcastEntry=staticMcastEntry, snmpTrapSNMPAuthentication=snmpTrapSNMPAuthentication)NEWLINEmibBuilder.exportSymbols("DES-1210-28MEbx", cpuFilterL3Rule=cpuFilterL3Rule, impbLogState=impbLogState, mldsVlanReportSuppression=mldsVlanReportSuppression, aclL3RuleTcpUdpDstPortMask=aclL3RuleTcpUdpDstPortMask, ipv4aclProfileDstMacAddrMask=ipv4aclProfileDstMacAddrMask, sysSNTPDSTRepeatStartMon=sysSNTPDSTRepeatStartMon, trustedHostTable=trustedHostTable, staticVlanBaseDisableAutoLearn=staticVlanBaseDisableAutoLearn, cpuFilterL2RuleSrcMacAddrMask=cpuFilterL2RuleSrcMacAddrMask, aclL2RuleDstMacAddrMask=aclL2RuleDstMacAddrMask, aacLoginMethod1=aacLoginMethod1, companyProtocolVlan=companyProtocolVlan, snmpV3TrapLinkUpDown=snmpV3TrapLinkUpDown, sshSessionKeyRekeying=sshSessionKeyRekeying, tftpCfgTargetGroup=tftpCfgTargetGroup, ftpConfigFileName=ftpConfigFileName, stpPortState=stpPortState, cableDiagPair1Status=cableDiagPair1Status, ipv4cpuFilterProfileSrcIpAddrMask=ipv4cpuFilterProfileSrcIpAddrMask, qosDiffServType03=qosDiffServType03, rmonEventTable=rmonEventTable, igsVlanFilterTable=igsVlanFilterTable, aacAccountingServiceShell=aacAccountingServiceShell, limitIpMulticastendIpAddr=limitIpMulticastendIpAddr, lldpXdot3PortConfigEntry=lldpXdot3PortConfigEntry, dhcpv6RelayServerIP=dhcpv6RelayServerIP, pppoePortRemoteIDVendor3String=pppoePortRemoteIDVendor3String, swAuthUser=swAuthUser, sysSerialNumber=sysSerialNumber, qosDiffServType22=qosDiffServType22, swTimeRangeStartHour=swTimeRangeStartHour, sysLBDCtrlTable=sysLBDCtrlTable, mstMstiForcePortState=mstMstiForcePortState, qosDiffServType02=qosDiffServType02, qosDiffServType00=qosDiffServType00, snmpV3TrapIMPBViolation=snmpV3TrapIMPBViolation, impbPortDHCPv6VlanList2k=impbPortDHCPv6VlanList2k, ipv4sysSNTPSecondServer=ipv4sysSNTPSecondServer, swAuthAuthReAuthPeriod=swAuthAuthReAuthPeriod, swAuthRadiusServerStatus=swAuthRadiusServerStatus, impbBlockListPort=impbBlockListPort, impbBlockListEntry=impbBlockListEntry, rmonGlobalState=rmonGlobalState, protocolVlanGroupID=protocolVlanGroupID, syslogServSrvRowStatus=syslogServSrvRowStatus, ipv4cpuFilterProfileSrcMacAddrMask=ipv4cpuFilterProfileSrcMacAddrMask, snmpV3GroupSecurityLevel=snmpV3GroupSecurityLevel, staticARPEntry=staticARPEntry, errorFramePeriodNotifyState=errorFramePeriodNotifyState, stpPortProtocolMigration=stpPortProtocolMigration, sysWebPortNumber=sysWebPortNumber, ftpFwPassword=ftpFwPassword, aacAPTelnetEnableMethod=aacAPTelnetEnableMethod, guestVlanPort=guestVlanPort, sysMACAgingTime=sysMACAgingTime, ipv4aclProfileDstIpAddrMask=ipv4aclProfileDstIpAddrMask, sysLBDInterval=sysLBDInterval, dhcpv6RelayHopCount=dhcpv6RelayHopCount, stpNewRootTraps=stpNewRootTraps, sysGateway=sysGateway, ipifv6DHCPStatus=ipifv6DHCPStatus, igmpMulticastVlanReplacePriority=igmpMulticastVlanReplacePriority, swTimeRangeName=swTimeRangeName, sshUserInfoTable=sshUserInfoTable, staticMcastMac=staticMcastMac, doSCtrlClearFrameCount=doSCtrlClearFrameCount, protocolGroupNameEntry=protocolGroupNameEntry, neighborIPv6Addr=neighborIPv6Addr, agentCPUutilizationIn5min=agentCPUutilizationIn5min, rmonAlarmIndex=rmonAlarmIndex, qosDiffServType35=qosDiffServType35, smtpRecvMailAddrStatus=smtpRecvMailAddrStatus, dhcpServerScreenEnablePortlist=dhcpServerScreenEnablePortlist, limitIpMulticastPortProfileID=limitIpMulticastPortProfileID, impbAutoScanStatus=impbAutoScanStatus, aclL2RuleDstMacAddr=aclL2RuleDstMacAddr, smtpServerAddr=smtpServerAddr, trafficCtrlTable=trafficCtrlTable, authProtocol=authProtocol, igsVlanQueryInterval=igsVlanQueryInterval, igmpMulticastVlanGroupFromIp=igmpMulticastVlanGroupFromIp, rmonHistoryTable=rmonHistoryTable, sysPortDescIndex=sysPortDescIndex, cosWeight=cosWeight, staticMcastTable=staticMcastTable, macBasedVlanTable=macBasedVlanTable, aclv6L3RuleTcpUrgBit=aclv6L3RuleTcpUrgBit, dlinklldpReinitDelay=dlinklldpReinitDelay, impbAutoScanPort=impbAutoScanPort, lldpXdot3LocPowerPortClass=lldpXdot3LocPowerPortClass, aclPacketRuleStatus=aclPacketRuleStatus, sysContactName=sysContactName, lldpXdot1ConfigPortVlanEntry=lldpXdot1ConfigPortVlanEntry, floodfdbOnOff=floodfdbOnOff, eoamDyingGaspEnable=eoamDyingGaspEnable, cableDiagPortIndex=cableDiagPortIndex, impbVlanModeState=impbVlanModeState, snmpV3HostStatus=snmpV3HostStatus, tftpFwTargetTftpOperationStatus=tftpFwTargetTftpOperationStatus, lldpXdot3RemLinkAggStatus=lldpXdot3RemLinkAggStatus, duldMode=duldMode, ipv4aclProfileMask=ipv4aclProfileMask, ipv4cpuFilterProfileDstPortMask=ipv4cpuFilterProfileDstPortMask, vlanTrunkIfIndex=vlanTrunkIfIndex, staticEntry=staticEntry, ftpFwServerIpAddress=ftpFwServerIpAddress, portSecTable=portSecTable, aclv6L3RuleStatus=aclv6L3RuleStatus, igsVlanSnoopStatus=igsVlanSnoopStatus, aclL3RuleTcpUdpDstPort=aclL3RuleTcpUdpDstPort, aclL2ProfileID=aclL2ProfileID, autologoutConfiguration=autologoutConfiguration, portSecLockAddrMode=portSecLockAddrMode, sysPortMediaTypeEntry=sysPortMediaTypeEntry, l2PTThresholdEntry=l2PTThresholdEntry, mldsHostTablePort=mldsHostTablePort, stpPort=stpPort, aacLocalEnablePassword=aacLocalEnablePassword, swAuthAuthConfigPortNumber=swAuthAuthConfigPortNumber, mstInstanceIndex=mstInstanceIndex, mldsHostTableVLANID=mldsHostTableVLANID, aclQosIP6TC=aclQosIP6TC, l2PTState=l2PTState, ipv4trustedHostTable=ipv4trustedHostTable, portSecMLA=portSecMLA, swAuthRadiusServerRetransmit=swAuthRadiusServerRetransmit, mldsVlanQuerier=mldsVlanQuerier, mstCistPortDesignatedBridge=mstCistPortDesignatedBridge, aacServerInfoTable=aacServerInfoTable, swAuthPortAccessControlEntry=swAuthPortAccessControlEntry, sysPortMediaTypeIndex=sysPortMediaTypeIndex, aacLoginMethodListName=aacLoginMethodListName, dhcpBOOTPRelayOption82CircuitIDType=dhcpBOOTPRelayOption82CircuitIDType, ipv4aclProfileDstPortMask=ipv4aclProfileDstPortMask, qosDiffServType16=qosDiffServType16, aclFlowMeterAction=aclFlowMeterAction, stpFowardBPDU=stpFowardBPDU, trustedHostIpMask=trustedHostIpMask, aacServerAuthKey=aacServerAuthKey, cableDiagPair4Status=cableDiagPair4Status, mstCistPortPathCost=mstCistPortPathCost, ipv4sysSNTPDSTStartHour=ipv4sysSNTPDSTStartHour, portSecFDBPermIndex=portSecFDBPermIndex, ipv4aclProfileIPProtocolMask=ipv4aclProfileIPProtocolMask, lldpXdot1Objects=lldpXdot1Objects, mstCistCurrentPortRole=mstCistCurrentPortRole, smtpState=smtpState, igsVlanDataDrivenLearningStatus=igsVlanDataDrivenLearningStatus, syslogServUDPport=syslogServUDPport, swTimeRangeStartMonth=swTimeRangeStartMonth, rmonAlarmFallingThreshold=rmonAlarmFallingThreshold, aclProfileDstMacAddrMask=aclProfileDstMacAddrMask, impbPortAllowZeroIPState=impbPortAllowZeroIPState, cpuFilterL3RuleEntry=cpuFilterL3RuleEntry, ipv4aclUdfOffsetMask1=ipv4aclUdfOffsetMask1, staticVlanBaseAutoLearnList1k=staticVlanBaseAutoLearnList1k, mstInstanceVlanMapped=mstInstanceVlanMapped, ipv4syslogServFacility=ipv4syslogServFacility, aclPacketProfileID=aclPacketProfileID, qosDiffServType20=qosDiffServType20, sshMaxAuthFailAttempts=sshMaxAuthFailAttempts, aacEnableMethod2=aacEnableMethod2, sysMirrorCtrlIngressMirroring=sysMirrorCtrlIngressMirroring, rmonAlarmSampleType=rmonAlarmSampleType, multicastVlanGroupIpType=multicastVlanGroupIpType, sysBPDUAttackPortMode=sysBPDUAttackPortMode, sysPortCtrlTable=sysPortCtrlTable, snmpV3UserEntry=snmpV3UserEntry, sysSNTPDSTRepeatEndMon=sysSNTPDSTRepeatEndMon, tftpCfgTargetTftpIncrement=tftpCfgTargetTftpIncrement, mstMstiPortPathCost=mstMstiPortPathCost, aclFlowMeterRule=aclFlowMeterRule, cpuFilterL2Rule=cpuFilterL2Rule, securityIpMacPortBinding=securityIpMacPortBinding, sysSNTPSecondInterfaceName=sysSNTPSecondInterfaceName, smtpSelfMailAddr=smtpSelfMailAddr, snmpV3Group=snmpV3Group, mstMstiPortAdminPathCost=mstMstiPortAdminPathCost, cosBandwidthEffectiveRX=cosBandwidthEffectiveRX, dot1qVlanPVIDAutoAssignOnOff=dot1qVlanPVIDAutoAssignOnOff, mstCistVlanMapped3k=mstCistVlanMapped3k, vlanTrunkState=vlanTrunkState, swAuthAuthMaxReq=swAuthAuthMaxReq, dhcpLocalRelayTable=dhcpLocalRelayTable, aclv6L3RuleTrafficClass=aclv6L3RuleTrafficClass, ftpConfigFTPOperationStatus=ftpConfigFTPOperationStatus, limitIpMulticastPortMaxGrp=limitIpMulticastPortMaxGrp, impbPortIpInspectionState=impbPortIpInspectionState, ftpFwPort=ftpFwPort, aclv6L3RuleSrcIpAddr=aclv6L3RuleSrcIpAddr, ddmThresholdPort=ddmThresholdPort, igmpMulticastVlanEntry=igmpMulticastVlanEntry, companyFTPGroup=companyFTPGroup, aclL2RuleVlanIdMask=aclL2RuleVlanIdMask, companyStaticARP=companyStaticARP, tftpCfgTargetTftpConfigID=tftpCfgTargetTftpConfigID, igsVlanFilterVlanId=igsVlanFilterVlanId, sysLBDVlanLoopTable=sysLBDVlanLoopTable, sysDhcpAutoImage=sysDhcpAutoImage, sysTrapStatus=sysTrapStatus, mldsVlanMulticastGroupMacAddress=mldsVlanMulticastGroupMacAddress, sysPortCtrlOperStatus=sysPortCtrlOperStatus, dhcpBOOTPRelayOption82RemoteIDType=dhcpBOOTPRelayOption82RemoteIDType, LldpManAddress=LldpManAddress, ddmHighWarning=ddmHighWarning, gvrpSettingsAcceptableFrameType=gvrpSettingsAcceptableFrameType, ddmActionMgmtTable=ddmActionMgmtTable, qosDiffServType50=qosDiffServType50, lldpXdot3RemPowerMDISupported=lldpXdot3RemPowerMDISupported, protocolVlanTable=protocolVlanTable, snmpV3UserStatus=snmpV3UserStatus, lldpXdot1LocVlanNameEntry=lldpXdot1LocVlanNameEntry, sysSNTPDSTEndDay=sysSNTPDSTEndDay, aclL2Rule1pPriority=aclL2Rule1pPriority, stpBridgeMaxAge=stpBridgeMaxAge, aclL2AccessID=aclL2AccessID, gvrpSettingsPVID=gvrpSettingsPVID, staticVlanID=staticVlanID, ipv4sysSNTPDSTEndHour=ipv4sysSNTPDSTEndHour, aacAccountingMethodListRowStatus=aacAccountingMethodListRowStatus, cpuFilterL2RuleEtherType=cpuFilterL2RuleEtherType, ipv4smtpRecvMailAddrStatus=ipv4smtpRecvMailAddrStatus, impbAutoScanMacAddress=impbAutoScanMacAddress, lldpXdot1ConfigPortVlanTxEnable=lldpXdot1ConfigPortVlanTxEnable, impbPortDHCPMaxEntryIPv4=impbPortDHCPMaxEntryIPv4, ipv4syslogServSrvRowStatus=ipv4syslogServSrvRowStatus, mstConfigurationIdentification=mstConfigurationIdentification, tftpCfgTargetImageFileName=tftpCfgTargetImageFileName, oldDesignatedRoot=oldDesignatedRoot, dhcpBOOTPRelayOption82Policy=dhcpBOOTPRelayOption82Policy, mstCistVlanMapped=mstCistVlanMapped, swAuthAuthTxPeriod=swAuthAuthTxPeriod, aacAccountingServiceCommandAdministrator=aacAccountingServiceCommandAdministrator, sfpVendorName=sfpVendorName, aclUdfOffsetByte4=aclUdfOffsetByte4, iPv4swAuthRadiusServerKey=iPv4swAuthRadiusServerKey, snmpV3ViewTreeTable=snmpV3ViewTreeTable, cpuFilterL3RuleAccessID=cpuFilterL3RuleAccessID, filterDHCPServerVlanList=filterDHCPServerVlanList, impbAutoScanIpAddressFrom=impbAutoScanIpAddressFrom, laPortControlTable=laPortControlTable, dhcpBOOTPRelayOption82State=dhcpBOOTPRelayOption82State, aclv6L3RuleProtocol=aclv6L3RuleProtocol, sysSNTPSecondServer=sysSNTPSecondServer, dhcpv6RelayInterfaceSettingsRowStatus=dhcpv6RelayInterfaceSettingsRowStatus, mldsVlanQueryInterval=mldsVlanQueryInterval, stpBridgeForwardDelay=stpBridgeForwardDelay, mldsVlanFilterVlanId=mldsVlanFilterVlanId, companyTrafficMgmt=companyTrafficMgmt, ipv4snmpV3HostAddress=ipv4snmpV3HostAddress, sysBPDUAttackPortState=sysBPDUAttackPortState, des_1210_28mebx=des_1210_28mebx, sysPortMediaTypePn=sysPortMediaTypePn, aacServerInterfaceName=aacServerInterfaceName)NEWLINEmibBuilder.exportSymbols("DES-1210-28MEbx", laPortChannelTable=laPortChannelTable, mldsVlanMulticastGroupPortList=mldsVlanMulticastGroupPortList, rmonHistoryOwner=rmonHistoryOwner, sysBPDUAttackLog=sysBPDUAttackLog, aacAPConsoleEnableMethod=aacAPConsoleEnableMethod, multicastVlanMemberPort=multicastVlanMemberPort, cableDiagPair2Length=cableDiagPair2Length, qosEffectiveDefaultPriority=qosEffectiveDefaultPriority, ipv4aclQosTCPUDPPort=ipv4aclQosTCPUDPPort, sysPortCtrlSpeed=sysPortCtrlSpeed, igmpMulticastVlanTagMemberPort=igmpMulticastVlanTagMemberPort, ddmPowerUnit=ddmPowerUnit, sysTrapDHCPServerScreening=sysTrapDHCPServerScreening, ipv4syslogServIndex=ipv4syslogServIndex, lldpXdot3RemPowerPairs=lldpXdot3RemPowerPairs, igsVlanMulticastGroupEntry=igsVlanMulticastGroupEntry, aclProfileSrcIpAddrMaskType=aclProfileSrcIpAddrMaskType, cpuFilterv6L3RuleStatus=cpuFilterv6L3RuleStatus, lldpXdot3LocLinkAggEntry=lldpXdot3LocLinkAggEntry, qosDiffServType05=qosDiffServType05, dhcpServerScreenLogSuppressDuration=dhcpServerScreenLogSuppressDuration, dhcpv6RelayOption37RemoteID=dhcpv6RelayOption37RemoteID, sysBPDUAttackCtrlIndex=sysBPDUAttackCtrlIndex, lldpXdot3Config=lldpXdot3Config, iPv4aacServerInfoEntry=iPv4aacServerInfoEntry, mldsVlanQueryMaxResponseTime=mldsVlanQueryMaxResponseTime, aclL3RuleICMPMessageCode=aclL3RuleICMPMessageCode, staticARPTable=staticARPTable, LldpPortNumber=LldpPortNumber, lldpXdot1RemoteData=lldpXdot1RemoteData, mstiRevisionLevel=mstiRevisionLevel, sslCipherSuiteList=sslCipherSuiteList, sysTrapIP=sysTrapIP, cpuFilterv6L3RuleTable=cpuFilterv6L3RuleTable, cosBandwidthCtrlClassIndex=cosBandwidthCtrlClassIndex, mldsVlanSnoopStatus=mldsVlanSnoopStatus, aclPacketRuleTable=aclPacketRuleTable, protocolGroupTable=protocolGroupTable, stpPortFowardBPDU=stpPortFowardBPDU, cpuFilterProfileIPProtocol=cpuFilterProfileIPProtocol, ipv4aclQosMACAddr=ipv4aclQosMACAddr, sslSecurityHttpStatus=sslSecurityHttpStatus, aclL3RuleReplaceDSCP=aclL3RuleReplaceDSCP, snmpV3viewTreeStatus=snmpV3viewTreeStatus, protocolGroupGID=protocolGroupGID, snmpV3GroupWriteViewName=snmpV3GroupWriteViewName, aacServerAuthProtocol=aacServerAuthProtocol, dhcpLocalRelaySettingsState=dhcpLocalRelaySettingsState, dhcpBOOTPRelayControl=dhcpBOOTPRelayControl, cableDiagAction=cableDiagAction, aacServerInfoEntry=aacServerInfoEntry, neighborTable=neighborTable, eoamLinkMonitor=eoamLinkMonitor, ipv4aclUdfOffsetMask3=ipv4aclUdfOffsetMask3, qosDiffServType25=qosDiffServType25, securityDhcpServerScreen=securityDhcpServerScreen, sfpVendorInfoEntry=sfpVendorInfoEntry, multicastVlanReplacePriority=multicastVlanReplacePriority, ipv4sysSNTPFirstServer=ipv4sysSNTPFirstServer, sshUserInfoUserName=sshUserInfoUserName, mstCistForcePortState=mstCistForcePortState, dhcpBOOTPRelayOption82RemoteID=dhcpBOOTPRelayOption82RemoteID, ipv4sysIpAddrCfgMode=ipv4sysIpAddrCfgMode, aclProfileSrcPortMask=aclProfileSrcPortMask, cpuFilterL3RuleTcpRstBit=cpuFilterL3RuleTcpRstBit, mcastFilterPortIndex=mcastFilterPortIndex, cpuFilterL2RuleStatus=cpuFilterL2RuleStatus, mcastFilterPortType=mcastFilterPortType, impbAutoScanVlanId=impbAutoScanVlanId, impbAutoScanCurrentStatus=impbAutoScanCurrentStatus, qosDiffServType45=qosDiffServType45, cosBandwidthValue=cosBandwidthValue, lldpXdot3LocPortOperMauType=lldpXdot3LocPortOperMauType, mldsRouterPortPurgeInterval=mldsRouterPortPurgeInterval, aacLoginMethodListEntry=aacLoginMethodListEntry, ftpFwPath=ftpFwPath, tftpCfgServerIpAddress=tftpCfgServerIpAddress, staticVlanBaseAutoLearnList2k=staticVlanBaseAutoLearnList2k, aclL3RuleReplaceQueue=aclL3RuleReplaceQueue, companyLLDPSetting=companyLLDPSetting, laPortActorTimeout=laPortActorTimeout, iPv4aacServerIndex=iPv4aacServerIndex, cpuFilterL3RuleStatus=cpuFilterL3RuleStatus, snmpV3UserGroupName=snmpV3UserGroupName, aclProfile=aclProfile, snmpV3TrapRSTPStateChange=snmpV3TrapRSTPStateChange, rmonStatsTable=rmonStatsTable, swAuthRadiusServerIndex=swAuthRadiusServerIndex, lldpXdot1RemProtoVlanEntry=lldpXdot1RemProtoVlanEntry, aacEnableMethod4=aacEnableMethod4, cpuFilterL3RuleTcpUdpSrcPortMask=cpuFilterL3RuleTcpUdpSrcPortMask, autoFdbIPAddress=autoFdbIPAddress, qosDefaultUserPriEntry=qosDefaultUserPriEntry, limitIpMulticastProfileStatus=limitIpMulticastProfileStatus, aclL2RuleInPortList=aclL2RuleInPortList, lldpXdot1RemProtoVlanId=lldpXdot1RemProtoVlanId, lldpXdot1RemProtocolTable=lldpXdot1RemProtocolTable, macBasedVlanEntry=macBasedVlanEntry, newRootMSTibridgeregionalroot=newRootMSTibridgeregionalroot, dhcpv6RelayInterface=dhcpv6RelayInterface, aclFlowMeterStatus=aclFlowMeterStatus, ipv4smtpRecvMailAddrIndex=ipv4smtpRecvMailAddrIndex, sysPortDescMediumType=sysPortDescMediumType, mstInstanceVlanMapped2k=mstInstanceVlanMapped2k, swAuthUserTable=swAuthUserTable, sysFirmwareVersion=sysFirmwareVersion, aclQosAssignClass=aclQosAssignClass, swTimeRangeEndMonth=swTimeRangeEndMonth, tftpConfigTftpOperation=tftpConfigTftpOperation, mstCistPortAdminPathCost=mstCistPortAdminPathCost, ddmTxPower=ddmTxPower, miscReset=miscReset, companyDuld=companyDuld, lldpPortConfigTLVsTxEnable=lldpPortConfigTLVsTxEnable, aacAPConsoleLoginMethod=aacAPConsoleLoginMethod, sysPortUpLinkTime=sysPortUpLinkTime, aacEnableMethodListTable=aacEnableMethodListTable, duldSystem=duldSystem, syslogEnable=syslogEnable, sysPortErrTable=sysPortErrTable, cableDiagPair4Length=cableDiagPair4Length, ipv4sysIpSubnetMask=ipv4sysIpSubnetMask, swAuthAuthCapability=swAuthAuthCapability, companyMiscGroup=companyMiscGroup, telnetUDPPort=telnetUDPPort, qosDiffServType63=qosDiffServType63, qosDiffServType28=qosDiffServType28, lldpXdot1RemProtoVlanEnabled=lldpXdot1RemProtoVlanEnabled, igsHostTablePort=igsHostTablePort, qosDiffServType07=qosDiffServType07, cosBandwidthCtrlPortIndex=cosBandwidthCtrlPortIndex, lldpXdot1ConfigProtocolTxEnable=lldpXdot1ConfigProtocolTxEnable, telnetsettingManagementOnOff=telnetsettingManagementOnOff, rmonEventIndex=rmonEventIndex, rmonStatsDataSource=rmonStatsDataSource, companySecurity=companySecurity, mstSetVlanList=mstSetVlanList, sshAuthenMethodPassWordAdmin=sshAuthenMethodPassWordAdmin, snmpV3TrapBPDUAttack=snmpV3TrapBPDUAttack, sfpTranceiverCode=sfpTranceiverCode, swAuthMode=swAuthMode, dhcpServerScreenEnableVlanlist=dhcpServerScreenEnableVlanlist, staticMcastEgressPorts=staticMcastEgressPorts, qosDiffServType15=qosDiffServType15, igsVlanRouterEntry=igsVlanRouterEntry, dhcpv6RelayOption18CheckState=dhcpv6RelayOption18CheckState, aclL2RuleReplaceDSCP=aclL2RuleReplaceDSCP, igmpMulticastVlanTable=igmpMulticastVlanTable, lldpXdot1LocPortVlanId=lldpXdot1LocPortVlanId, ipv4smtpRecvMailAddrEntry=ipv4smtpRecvMailAddrEntry, ipv4syslogServTable=ipv4syslogServTable, doSCtrlMirrorReplace1P=doSCtrlMirrorReplace1P, limitIpMulticastProfileEntry=limitIpMulticastProfileEntry, sysIpAddr=sysIpAddr, ipv4cpuFilterProfileIPProtocolMask=ipv4cpuFilterProfileIPProtocolMask, cpuFilterL3RuleTcpUdpDstPortMask=cpuFilterL3RuleTcpUdpDstPortMask, cpuFilterL2RuleSrcMacAddr=cpuFilterL2RuleSrcMacAddr, mstMstiPortPriority=mstMstiPortPriority, aclFlowMeterProfileID=aclFlowMeterProfileID, qosTOSType04=qosTOSType04, rmonAlarmInterval=rmonAlarmInterval, aclUdfOffsetMask1=aclUdfOffsetMask1, rmonAlarmRisingEventIndex=rmonAlarmRisingEventIndex, snmpV3HostVersion=snmpV3HostVersion, eoamLinkMonitorEntry=eoamLinkMonitorEntry, dhcpLocalRelayEnablePortlist=dhcpLocalRelayEnablePortlist, swAuthRadiusServerKey=swAuthRadiusServerKey, staticTable=staticTable, companySyslog=companySyslog, qosDiffServType36=qosDiffServType36, sysSNTPDSTRepeatStartWeek=sysSNTPDSTRepeatStartWeek, aclv6L3RuleProfileNo=aclv6L3RuleProfileNo, cpuFilterv6L3RuleICMPMessageCode=cpuFilterv6L3RuleICMPMessageCode, cableDiagPair3Status=cableDiagPair3Status, aclPacketRuleOffsetValue2Mask=aclPacketRuleOffsetValue2Mask, tftpConfigFileName=tftpConfigFileName, dot1qVlanForbiddenPorts=dot1qVlanForbiddenPorts, multicastVlanSourcePort=multicastVlanSourcePort, stpBridgePriority=stpBridgePriority, sysJumboFrameEnable=sysJumboFrameEnable, ipv4sysSNTPDSTStartMon=ipv4sysSNTPDSTStartMon, lldpXdot3LocPortAutoNegSupported=lldpXdot3LocPortAutoNegSupported, dhcpv6RelayOpt38PortIndex=dhcpv6RelayOpt38PortIndex, trustedHostRowStatus=trustedHostRowStatus, syslogServInterfaceName=syslogServInterfaceName, limitIpMulticastPortState=limitIpMulticastPortState, companySMTP=companySMTP, portSecFDBPermanentEntry=portSecFDBPermanentEntry, neighborEntry=neighborEntry, cpuFilterv6L3RuleTcpUdpDstPort=cpuFilterv6L3RuleTcpUdpDstPort, lldpXdot3LocPortEntry=lldpXdot3LocPortEntry, mldsHostEntry=mldsHostEntry, igsHostPortPurgeInterval=igsHostPortPurgeInterval, snmpV3TrapPortSecurity=snmpV3TrapPortSecurity, sysPortErrPortState=sysPortErrPortState, lldpXdot1RemVlanNameTable=lldpXdot1RemVlanNameTable, dhcpBOOTPRelayHopCount=dhcpBOOTPRelayHopCount, impbBlockListVlanId=impbBlockListVlanId, ddmActionMgmtEntry=ddmActionMgmtEntry, stpPortHelloTime=stpPortHelloTime, RmonStatus=RmonStatus, cpuFilterL3RuleProfileNo=cpuFilterL3RuleProfileNo, ddmRxPower=ddmRxPower, ipv4aclQosTable=ipv4aclQosTable, cpuFilterv6L3RuleTcpUdpSrcPortMask=cpuFilterv6L3RuleTcpUdpSrcPortMask, ddmCtrl=ddmCtrl, companyLimitIp=companyLimitIp, syslogServerGroup=syslogServerGroup, sysType=sysType, sysCommandLogging=sysCommandLogging, igsVlanQuerier=igsVlanQuerier, qosDiffServType21=qosDiffServType21, aacServerAccountingPort=aacServerAccountingPort, ipv4aclQosIndex=ipv4aclQosIndex, snmpV3HostCommunityName=snmpV3HostCommunityName, lldpXdot1RemProtocolEntry=lldpXdot1RemProtocolEntry, impbAutoScanBinding=impbAutoScanBinding, eoamState=eoamState, sysLBDVlanLoopIndex=sysLBDVlanLoopIndex, vlanMacStatus=vlanMacStatus, trafficSegIfIndex=trafficSegIfIndex, qinqVlanTranslationCVIDRowStatus=qinqVlanTranslationCVIDRowStatus, multicastVlanEntry=multicastVlanEntry, igmpMulticastVlanGroupTable=igmpMulticastVlanGroupTable, cpuFilterL2RuleEntry=cpuFilterL2RuleEntry, duldDiscoveryTime=duldDiscoveryTime, doSCtrlTable=doSCtrlTable, aacEnableMethodListName=aacEnableMethodListName, igsRouterPortPurgeInterval=igsRouterPortPurgeInterval, dhcpBOOTPRelayServerIP=dhcpBOOTPRelayServerIP, syslogSettingGroup=syslogSettingGroup, snmpTrapRSTPStateChange=snmpTrapRSTPStateChange, dhcpv6RelayOpt38PortType=dhcpv6RelayOpt38PortType, ipv4syslogServSeverity=ipv4syslogServSeverity, swAuthRadiusServerAccountingPort=swAuthRadiusServerAccountingPort, aclv6L3RuleTcpPshBit=aclv6L3RuleTcpPshBit, limitIpMulticaststartIpAddr=limitIpMulticaststartIpAddr, dosCtrlTrapLogState=dosCtrlTrapLogState, cosScheduleMechanism=cosScheduleMechanism, lldpXdot3LocPowerClass=lldpXdot3LocPowerClass, guestVlanDelState=guestVlanDelState, impbAutoScanEntry=impbAutoScanEntry, autoFdbTable=autoFdbTable, lldpXdot1RemVlanName=lldpXdot1RemVlanName, sysSNTPDSTEndMon=sysSNTPDSTEndMon, ipv4aclProfileSrcIpAddrMask=ipv4aclProfileSrcIpAddrMask, impbPortDHCPv4VlanList1k=impbPortDHCPv4VlanList1k, lldpXdot1ConfigProtoVlanTxEnable=lldpXdot1ConfigProtoVlanTxEnable, qosDiffServType19=qosDiffServType19, l2PTThresholdTable=l2PTThresholdTable, ipifV6AddressIpPrefix=ipifV6AddressIpPrefix, swTimeRangeStartMinute=swTimeRangeStartMinute, snmpTrapLBD=snmpTrapLBD, aclProfileType=aclProfileType)NEWLINEmibBuilder.exportSymbols("DES-1210-28MEbx", cpuFilterL3RuleICMPMessageType=cpuFilterL3RuleICMPMessageType, pppoePortState=pppoePortState, companyVLANTrunk=companyVLANTrunk, snmpV3UserTable=snmpV3UserTable, sysSNTPDSTRepeatStartHour=sysSNTPDSTRepeatStartHour, aclv6L3RuleICMPMessageType=aclv6L3RuleICMPMessageType, sysPortMediaTypeRev=sysPortMediaTypeRev, mstiBridgeRegionalRoot=mstiBridgeRegionalRoot, mldsHostPortPurgeInterval=mldsHostPortPurgeInterval, dot1qVlanUntaggedPorts=dot1qVlanUntaggedPorts, lldpXdot1LocProtocolTable=lldpXdot1LocProtocolTable, igmpMulticastVlanReplaceSourceIp=igmpMulticastVlanReplaceSourceIp, dhcpLocalRelaySettingsVLANID=dhcpLocalRelaySettingsVLANID, aclQosEntry=aclQosEntry, igsVlanReportSuppression=igsVlanReportSuppression, laAlgorithm=laAlgorithm, swAuthUserStatus=swAuthUserStatus, companyRMON=companyRMON, dhcpBOOTPRelayInterfaceSettingsTable=dhcpBOOTPRelayInterfaceSettingsTable, companyQinQ=companyQinQ, aclL3RuleProfileNo=aclL3RuleProfileNo, rmonEventCommunity=rmonEventCommunity, sysSNTPDSTOffset=sysSNTPDSTOffset, aclProfileDstIpAddrMask=aclProfileDstIpAddrMask, sysFromIP=sysFromIP, swAuthPortAccessCtrl=swAuthPortAccessCtrl, qinqVLANTranslation=qinqVLANTranslation, ipv4smtpRecvMailAddrTable=ipv4smtpRecvMailAddrTable, ftpFwUsername=ftpFwUsername, bandwidthCtrlTable=bandwidthCtrlTable, vlanMacMapAddrMask=vlanMacMapAddrMask, igmpMulticastVlanRemapPriority=igmpMulticastVlanRemapPriority, qosDiffServType27=qosDiffServType27, lldpXdot1LocEntry=lldpXdot1LocEntry, cpuFilterv6L3RuleTcpRstBit=cpuFilterv6L3RuleTcpRstBit, cpuFilterL3RuleTcpUdpSrcPort=cpuFilterL3RuleTcpUdpSrcPort, iPv4aacServerIPAddr=iPv4aacServerIPAddr, dhcpv6RelayOption18InterfaceIDType=dhcpv6RelayOption18InterfaceIDType, smtpServerAddrType=smtpServerAddrType, mldsVlanGrpQueryInterval=mldsVlanGrpQueryInterval, aclQosTCPUDPPort=aclQosTCPUDPPort, sysFirmwareInfomation=sysFirmwareInfomation, swTimeRangeRowStatus=swTimeRangeRowStatus, ddmStatusPort=ddmStatusPort, lldpXdot1ConfigProtocolTable=lldpXdot1ConfigProtocolTable, aclL3RuleDstIpAddrMask=aclL3RuleDstIpAddrMask, doSCtrlEntry=doSCtrlEntry, dhcpBOOTPRelayManagement=dhcpBOOTPRelayManagement, eoamMode=eoamMode, aacLoginMethod3=aacLoginMethod3, impbAutoScanTable=impbAutoScanTable, aclQosVlanID=aclQosVlanID, ipv4aclQosType=ipv4aclQosType, multicastVlanGroupVid=multicastVlanGroupVid, stpForwardDelay=stpForwardDelay, iPv4aacServerRowStatus=iPv4aacServerRowStatus, igmpMulticastVlanStatus=igmpMulticastVlanStatus, lldpXdot3LocPortAutoNegAdvertisedCap=lldpXdot3LocPortAutoNegAdvertisedCap, sysPortCtrlFlowControlOper=sysPortCtrlFlowControlOper, mldsStatus=mldsStatus, aacAPSSHLoginMethod=aacAPSSHLoginMethod, ipv4trustedHostRowStatus=ipv4trustedHostRowStatus, pppoePortIndex=pppoePortIndex, sshUserInfoHostName=sshUserInfoHostName, aclPacketAccessID=aclPacketAccessID, snmpV3UserPrivProtocolPassword=snmpV3UserPrivProtocolPassword, sysTrapPortSecurity=sysTrapPortSecurity, d_link=d_link, swAuthRadiusIPType=swAuthRadiusIPType, aacEnableMethod1=aacEnableMethod1, macNotifyInfo=macNotifyInfo, iPv4swAuthRadiusServerTable=iPv4swAuthRadiusServerTable, lldpXdot1RemVlanId=lldpXdot1RemVlanId, stpPortRestrictedTCN=stpPortRestrictedTCN, aclv6L3RuleFilterTimeRange=aclv6L3RuleFilterTimeRange, dot1qVlanManagementid=dot1qVlanManagementid, qosUserPriClass=qosUserPriClass, aclUdfOffsetBase1=aclUdfOffsetBase1, aclPacketRuleFilterTimeRange=aclPacketRuleFilterTimeRange, multicastVlanState=multicastVlanState, aclUdfOffsetBase4=aclUdfOffsetBase4, companyMacNotify=companyMacNotify, companyCableDiagnostic=companyCableDiagnostic, mldsHostTableGroupAddress=mldsHostTableGroupAddress, autoFdbStatus=autoFdbStatus, snmpV3CommunityEntry=snmpV3CommunityEntry, ipv4aclQosEntry=ipv4aclQosEntry, swAuthAuthReAuthentication=swAuthAuthReAuthentication, gvrpSettingsLeaveTime=gvrpSettingsLeaveTime, ipv4smtpSelfMailAddr=ipv4smtpSelfMailAddr, lldpXdot1Config=lldpXdot1Config, aacAuthenAdminState=aacAuthenAdminState, qosDiffServType43=qosDiffServType43, lldpXdot1LocVlanId=lldpXdot1LocVlanId, filterDHCPServerEntry=filterDHCPServerEntry, cpuFilterv6L3RuleTcpUdpSrcPort=cpuFilterv6L3RuleTcpUdpSrcPort, LldpPowerPortClass=LldpPowerPortClass, trafficCtrlCountDown=trafficCtrlCountDown, sysSNTPDSTRepeatStartWeekDay=sysSNTPDSTRepeatStartWeekDay, aclL3RuleICMPMessageType=aclL3RuleICMPMessageType, mstCistStatus=mstCistStatus, sysIpSubnetMask=sysIpSubnetMask, ddmStatusEntry=ddmStatusEntry, aacServerIPAddr=aacServerIPAddr, snmpV3UserVersion=snmpV3UserVersion, mldsHostTableHostIPAddress=mldsHostTableHostIPAddress, aclProfileDstIpAddrMaskType=aclProfileDstIpAddrMaskType, lldpXdot3LocPortTable=lldpXdot3LocPortTable, agentMEMutilizationIn5sec=agentMEMutilizationIn5sec, igsVlanCfgQuerier=igsVlanCfgQuerier, doSCtrlFrameCount=doSCtrlFrameCount, aclPacketRuleOffsetValue1=aclPacketRuleOffsetValue1, cosClassIndex=cosClassIndex, errorFrameWindow=errorFrameWindow, mldsVlanMulticastGroupEntry=mldsVlanMulticastGroupEntry, aacServerGroupRowStatus=aacServerGroupRowStatus, rmonStatsOwner=rmonStatsOwner, snmpV3TrapWarmStart=snmpV3TrapWarmStart, macNotifyInterval=macNotifyInterval, sysVersion=sysVersion, sysSafeGuardEnable=sysSafeGuardEnable, portSecState=portSecState, cpuFilterv6L3RuleSrcIpAddr=cpuFilterv6L3RuleSrcIpAddr, qinqGlobalStatus=qinqGlobalStatus, sysTrapDuplicateIPDetected=sysTrapDuplicateIPDetected, sysLBDVlanLoopPorts=sysLBDVlanLoopPorts, qinqTable=qinqTable, aRPSpoofPreventTable=aRPSpoofPreventTable, companyEoam=companyEoam, protocolGroupRowStatus=protocolGroupRowStatus, agentMEMutilization=agentMEMutilization, dhcpBOOTPRelayEnablePortlist=dhcpBOOTPRelayEnablePortlist, swTimeRangeSaturday=swTimeRangeSaturday, mstiConfigurationName=mstiConfigurationName, dhcpBOOTPRelayInterfaceSettingsRowStatus=dhcpBOOTPRelayInterfaceSettingsRowStatus, cosBandwidthCtrlTable=cosBandwidthCtrlTable, vlanMacMapAddr=vlanMacMapAddr, eoamSystem=eoamSystem, aclL3RuleProtocol=aclL3RuleProtocol, tftpFwTargetServerIpType=tftpFwTargetServerIpType, staticDisableAutoLearn=staticDisableAutoLearn, traps=traps, aclUdfOffsetMask3=aclUdfOffsetMask3, staticMcastIpAddr=staticMcastIpAddr, multicastVlanid=multicastVlanid, errorFrameSecondsWindow=errorFrameSecondsWindow, lldpXdot1ConfigVlanNameEntry=lldpXdot1ConfigVlanNameEntry, impbPortDHCPv6VlanList4k=impbPortDHCPv6VlanList4k, cpuFilterv6L3RuleTcpAckBit=cpuFilterv6L3RuleTcpAckBit, lldpXdot3LocPowerPairControlable=lldpXdot3LocPowerPairControlable, agentCPUutilizationIn5sec=agentCPUutilizationIn5sec, qosDiffServType61=qosDiffServType61, sfpVendorPn=sfpVendorPn, staticVlanBaseTable=staticVlanBaseTable, lldpXdot3PortConfigTLVsTxEnable=lldpXdot3PortConfigTLVsTxEnable, stpBridgeHelloTime=stpBridgeHelloTime, macNotifyInfoDiscription=macNotifyInfoDiscription, lldpXdot3LocMaxFrameSizeTable=lldpXdot3LocMaxFrameSizeTable, aclProfileDstPortMask=aclProfileDstPortMask, sysPortCtrlEntry=sysPortCtrlEntry, aclPacketRuleRateLimit=aclPacketRuleRateLimit, ipv4aclProfileSrcPortMask=ipv4aclProfileSrcPortMask, ipifSupportV4V6Info=ipifSupportV4V6Info, sysPortDescriptionTable=sysPortDescriptionTable, aclProfileArpSenderMacAddrMask=aclProfileArpSenderMacAddrMask, sysSNTPSecondType=sysSNTPSecondType, impbPortArpInspectionState=impbPortArpInspectionState, aclv6L3RuleAccessID=aclv6L3RuleAccessID, limitIpMulticastPortEntry=limitIpMulticastPortEntry, igsVlanMulticastGroupTable=igsVlanMulticastGroupTable, impbBlockListIpAddress=impbBlockListIpAddress, companyACLGroup=companyACLGroup, portSecFDBPermMac=portSecFDBPermMac, aacAPAuthMethodGroup=aacAPAuthMethodGroup, sysHardwareVersion=sysHardwareVersion, aclv6L3RuleICMPMessageCode=aclv6L3RuleICMPMessageCode, ftpConfigPassword=ftpConfigPassword, ipv4aclUdfOffsetByte3=ipv4aclUdfOffsetByte3, dhcpBOOTPRelayOption82CircuitID=dhcpBOOTPRelayOption82CircuitID, qosDiffServType48=qosDiffServType48, l2PTDropThreshold=l2PTDropThreshold, companyMldsGroup=companyMldsGroup, mstCistBridgePriority=mstCistBridgePriority, companyDHCPLocalRelay=companyDHCPLocalRelay, sysPortCtrlIndex=sysPortCtrlIndex, lldpXdot3LocPowerMDIEnabled=lldpXdot3LocPowerMDIEnabled, protocolVlanRowStatus=protocolVlanRowStatus, aclQosMACAddr=aclQosMACAddr, mldsVlanFbdRtrPortList=mldsVlanFbdRtrPortList, aclv6L3RuleTcpRstBit=aclv6L3RuleTcpRstBit, igsHostTableGroupAddress=igsHostTableGroupAddress, aclL3RuleReplace1P=aclL3RuleReplace1P, sysLBDPortLoopStatus=sysLBDPortLoopStatus, ipv4smtpRecvMailAddr=ipv4smtpRecvMailAddr, ipv4aclUdfOffsetBase2=ipv4aclUdfOffsetBase2, cpuFilterProfileIPProtocolMask=cpuFilterProfileIPProtocolMask, aacLoginMethodListIndex=aacLoginMethodListIndex, vlanMacMapIndex=vlanMacMapIndex, stpRootBridge=stpRootBridge, bandwidthCtrlIndex=bandwidthCtrlIndex, aclL3RuleTcpAckBit=aclL3RuleTcpAckBit, aclv6L3RuleDstIpAddrMask=aclv6L3RuleDstIpAddrMask, rmonHistoryEntry=rmonHistoryEntry, aacAccountingServiceSystem=aacAccountingServiceSystem, laPortChannelIfIndex=laPortChannelIfIndex, dhcpLocalRelayTableEntry=dhcpLocalRelayTableEntry, rmonEventType=rmonEventType, aacAccountingServiceCommandPoweruser=aacAccountingServiceCommandPoweruser, sysPortErrEntry=sysPortErrEntry, qinqTrustCVIDState=qinqTrustCVIDState, aclL3RuleTcpUdpSrcPortMask=aclL3RuleTcpUdpSrcPortMask, doSCtrlState=doSCtrlState, PortList=PortList, ipv4cpuFilterProfileDstMacAddrMask=ipv4cpuFilterProfileDstMacAddrMask, qosDiffServTOS=qosDiffServTOS, aclFlowMeterRate=aclFlowMeterRate, aacAPEnableMethod=aacAPEnableMethod, qosDefaultUserPri=qosDefaultUserPri, qinqSystem=qinqSystem, macNotifyCtrlEntry=macNotifyCtrlEntry, dot1qVlanEntry=dot1qVlanEntry, lldpXdot1ConfigPortVlanTable=lldpXdot1ConfigPortVlanTable, macBasedVlanMethod=macBasedVlanMethod, aclv6L3RuleTcpFinBit=aclv6L3RuleTcpFinBit, multicastVlanName=multicastVlanName, dhcpv6RelayOption37=dhcpv6RelayOption37, lldpXdot3RemMaxFrameSizeEntry=lldpXdot3RemMaxFrameSizeEntry, dhcpv6RelayOption18State=dhcpv6RelayOption18State, swAuthStatus=swAuthStatus, companyIgsGroup=companyIgsGroup, neighborIfindex=neighborIfindex, sysPortMediaTypeVendorName=sysPortMediaTypeVendorName, aclv6L3RuleProtocolMask=aclv6L3RuleProtocolMask, mldsDataDrivenLearningMaxLearnedEntryVlaue=mldsDataDrivenLearningMaxLearnedEntryVlaue, stpPortPriority=stpPortPriority, doSCtrlActionType=doSCtrlActionType, ipv4aclUdfOffsetMask4=ipv4aclUdfOffsetMask4, impbAutoScanIpAddress=impbAutoScanIpAddress, aclPacketRuleOffsetValue4=aclPacketRuleOffsetValue4, swTimeRangeMonday=swTimeRangeMonday, aclv6L3RuleTcpUdpSrcPortMask=aclv6L3RuleTcpUdpSrcPortMask, aacAccountingMethodListEntry=aacAccountingMethodListEntry, impbBindingListRowStatus=impbBindingListRowStatus, ddmStatusTable=ddmStatusTable, lldpXdot1LocProtocolId=lldpXdot1LocProtocolId, cpuFilterL2ProfileID=cpuFilterL2ProfileID, companyGVRPGroup=companyGVRPGroup, aclL3RuleEntry=aclL3RuleEntry, Timeout=Timeout, aclv6L3RuleTcpSynBit=aclv6L3RuleTcpSynBit, sysSNTPState=sysSNTPState, errorFrameSecondsThreshold=errorFrameSecondsThreshold, snmpV3GroupName=snmpV3GroupName, lldpXdot1ConfigVlanNameTxEnable=lldpXdot1ConfigVlanNameTxEnable)NEWLINEmibBuilder.exportSymbols("DES-1210-28MEbx", ftpConfigPath=ftpConfigPath, ipv4aclUdfOffsetByte2=ipv4aclUdfOffsetByte2, snmpV3GroupNotifyViewName=snmpV3GroupNotifyViewName, snmpV3UserAuthProtocolPassword=snmpV3UserAuthProtocolPassword, BridgeId=BridgeId, aclPacketRuleOffsetValue3Mask=aclPacketRuleOffsetValue3Mask, vlanMacMapRowStatus=vlanMacMapRowStatus, laSystem=laSystem, dlink_DES1210SeriesProd=dlink_DES1210SeriesProd, protocolGroupNameTable=protocolGroupNameTable, ipv4aclProfileType=ipv4aclProfileType, ddmThresholdType=ddmThresholdType, ddmInfo=ddmInfo, iPv4aacServerInfoTable=iPv4aacServerInfoTable, limitIpMulticastProfileTable=limitIpMulticastProfileTable, aclv6L3RuleSrcIpAddrMask=aclv6L3RuleSrcIpAddrMask, lldpXdot1RemProtoVlanTable=lldpXdot1RemProtoVlanTable, multicastVlanGroupTable=multicastVlanGroupTable, autoFdbEntry=autoFdbEntry, limitIpMulticastEntryProfileID=limitIpMulticastEntryProfileID, companySystem=companySystem, aclProfileUdfOffsetMap=aclProfileUdfOffsetMap, impbPortDHCPv6VlanList1k=impbPortDHCPv6VlanList1k, sysSNTPGMTMinutes=sysSNTPGMTMinutes, mldsVlanMulticastGroupVlanId=mldsVlanMulticastGroupVlanId, aclL3RuleSrcIpAddr=aclL3RuleSrcIpAddr, aclL3RuleStatus=aclL3RuleStatus, stpPortRestrictedRole=stpPortRestrictedRole, lldpPortConfigNotificationEnable=lldpPortConfigNotificationEnable, aclFlowMeterReplaceDscp=aclFlowMeterReplaceDscp, aclv6L3RuleEntry=aclv6L3RuleEntry, rmonAlarmOwner=rmonAlarmOwner, qosTOSType00=qosTOSType00, ipv4sysIprouteHops=ipv4sysIprouteHops, limitIpMulticastProfileName=limitIpMulticastProfileName, mldsVlanRtrPortList=mldsVlanRtrPortList, cpuFilterL3RuleTcpFinBit=cpuFilterL3RuleTcpFinBit, macNotifyPortStatus=macNotifyPortStatus, rmonEventOwner=rmonEventOwner, mstResetVlanList=mstResetVlanList, cpuFilterv6L3RuleProtocol=cpuFilterv6L3RuleProtocol, aclProfileSrcMacAddrMask=aclProfileSrcMacAddrMask, tftpFwServerIpAddress=tftpFwServerIpAddress, swAuthAuthServerTimeout=swAuthAuthServerTimeout, lldpXdot3LocLinkAggStatus=lldpXdot3LocLinkAggStatus, agentCPUutilization=agentCPUutilization, cableDiagEntry=cableDiagEntry, cpuFilterL2RuleAction=cpuFilterL2RuleAction, cpuFilterL3RuleTcpUrgBit=cpuFilterL3RuleTcpUrgBit, pppoePortTable=pppoePortTable, securityTrustedHost=securityTrustedHost, syslogSaveMode=syslogSaveMode, dhcpv6RelayOption18=dhcpv6RelayOption18, eoamReceivedRemoteLoopback=eoamReceivedRemoteLoopback, impbDhcpSnoopingTable=impbDhcpSnoopingTable, aacAccountingMethod4=aacAccountingMethod4, swAuthRadiusServerEntry=swAuthRadiusServerEntry, impbBindingListPort=impbBindingListPort, snmpTrapBPDUAttack=snmpTrapBPDUAttack, duldOperState=duldOperState, snmpV3CommunityStatus=snmpV3CommunityStatus, dhcpv6RelayState=dhcpv6RelayState, aacAPTelnetLoginMethod=aacAPTelnetLoginMethod, cpuFilterL3RuleProtocol=cpuFilterL3RuleProtocol, ipv4aclProfileNo=ipv4aclProfileNo, rmonHistoryDataSource=rmonHistoryDataSource, sysPortType=sysPortType, mstMstiBridgeEntry=mstMstiBridgeEntry, aclL3RuleSrcIpAddrMask=aclL3RuleSrcIpAddrMask, swTimeRangeSunday=swTimeRangeSunday, stpPortStatus=stpPortStatus, igmpMulticastVlanid=igmpMulticastVlanid, dhcpRelayVlanSettingsVLANID=dhcpRelayVlanSettingsVLANID, bandwidthEffecRxThreshold=bandwidthEffecRxThreshold, impbPortForwardDHCPPktState=impbPortForwardDHCPPktState, sysPortDescriptionEntry=sysPortDescriptionEntry, aclPacketRuleOffsetValue4Mask=aclPacketRuleOffsetValue4Mask, lldpXdot1LocProtoVlanSupported=lldpXdot1LocProtoVlanSupported, aclL2RuleAction=aclL2RuleAction, aacAccountingServiceIndex=aacAccountingServiceIndex, sysSize=sysSize, swTimeRangeSettingTable=swTimeRangeSettingTable, sysSNTPDSTRepeatEndHour=sysSNTPDSTRepeatEndHour, aclL3RuleDstIpAddr=aclL3RuleDstIpAddr, aclL3RuleAccessID=aclL3RuleAccessID, swAuthenCtrl=swAuthenCtrl, ipv4aclQosIPAddr=ipv4aclQosIPAddr, lldpXdot1LocVlanName=lldpXdot1LocVlanName, limitIpMulticastEntry=limitIpMulticastEntry, aclProfileEntry=aclProfileEntry, qosDiffServType33=qosDiffServType33, LldpLinkAggStatusMap=LldpLinkAggStatusMap, igmpMulticastVlanMemberPort=igmpMulticastVlanMemberPort, aclPacketRuleInPortList=aclPacketRuleInPortList, lldpXdot3RemMaxFrameSize=lldpXdot3RemMaxFrameSize, ipv4dhcpOption12HostName=ipv4dhcpOption12HostName, pppoePortUDFString=pppoePortUDFString, aRPSpoofPreventIpAddr=aRPSpoofPreventIpAddr, l2PTProtocol=l2PTProtocol, multicastVlanGroupFromIp=multicastVlanGroupFromIp, filterDHCPServerTable=filterDHCPServerTable, sysSMTPServerGroup=sysSMTPServerGroup, cosOutputSchedule=cosOutputSchedule, lldpXdot3PortConfigTable=lldpXdot3PortConfigTable, multicastVlanTagMemberPort=multicastVlanTagMemberPort, lldpXdot3RemPortEntry=lldpXdot3RemPortEntry, ipv4syslogServSrvStatus=ipv4syslogServSrvStatus, swTimeRangeEndHour=swTimeRangeEndHour, companyLA=companyLA, snmpV3TrapColdStart=snmpV3TrapColdStart, lldpPortConfigTable=lldpPortConfigTable, swTimeRangeStartYear=swTimeRangeStartYear, qosDiffServType40=qosDiffServType40, aclPacketRuleReplaceDSCP=aclPacketRuleReplaceDSCP, limitIpMulticastStatus=limitIpMulticastStatus, snmpV3ViewTree=snmpV3ViewTree, stpPortEntry=stpPortEntry, impbBindingtraplog=impbBindingtraplog, cpuFilterv6L3RuleEntry=cpuFilterv6L3RuleEntry, errorFrameThreshold=errorFrameThreshold, lldpXdot3RemPowerTable=lldpXdot3RemPowerTable, protocolGroupProtocolValue=protocolGroupProtocolValue, aacLoginMethod2=aacLoginMethod2, sysUpdateTime=sysUpdateTime, companyMacBasedVlan=companyMacBasedVlan, snmpV3CommunityName=snmpV3CommunityName, igsHostTable=igsHostTable, qosPriSettingsTable=qosPriSettingsTable, cpuFilterv6L3RuleTcpUdpDstPortMask=cpuFilterv6L3RuleTcpUdpDstPortMask, qinqOuterTPID=qinqOuterTPID, lldpPortConfigPortNum=lldpPortConfigPortNum, guestVlanName=guestVlanName, impbDhcpSnoopingEntry=impbDhcpSnoopingEntry, aclQosTable=aclQosTable, sysTrapLBD=sysTrapLBD, LacpKey=LacpKey, qosPriSetPortIndex=qosPriSetPortIndex, qosDiffServType29=qosDiffServType29, ipv4sysSNTPState=ipv4sysSNTPState, cpuFilterL3RuleTcpAckBit=cpuFilterL3RuleTcpAckBit, ipv4aclUdfOffsetByte1=ipv4aclUdfOffsetByte1, aclL2RuleTable=aclL2RuleTable, lldpXdot3RemoteData=lldpXdot3RemoteData, cableDiagPair3Length=cableDiagPair3Length, cpuFilterProfileNo=cpuFilterProfileNo, mstMstiStatus=mstMstiStatus, sysBPDUAttackStateEnable=sysBPDUAttackStateEnable, qosDiffServType44=qosDiffServType44, trafficCtrlIndex=trafficCtrlIndex, companyCPUInterfaceFilterGroup=companyCPUInterfaceFilterGroup, qosDefaultPriority=qosDefaultPriority, companyGratuitousARP=companyGratuitousARP, qosDiffServType47=qosDiffServType47, ipv4aclProfileUdfOffsetMap=ipv4aclProfileUdfOffsetMap, ipifV6AddressIpAddr=ipifV6AddressIpAddr, snmpTrapFirmUpgrade=snmpTrapFirmUpgrade, impbVlanModeVlanList=impbVlanModeVlanList, dhcpv6RelayOption37RemoteIDType=dhcpv6RelayOption37RemoteIDType, bandwidthCtrlTxThreshold=bandwidthCtrlTxThreshold, aclL2RuleStatus=aclL2RuleStatus, dhcpv6RelayOpt38PortState=dhcpv6RelayOpt38PortState, lldpXdot1RemEntry=lldpXdot1RemEntry, cableDiagStatus=cableDiagStatus, mldsVlanFilterEntry=mldsVlanFilterEntry, duldEntry=duldEntry, qosDiffServType18=qosDiffServType18, lldpXdot1LocalData=lldpXdot1LocalData, agentMEMutilizationIn1min=agentMEMutilizationIn1min, laPortActorActivity=laPortActorActivity, companyMirror=companyMirror, sysPortMediaTypeSn=sysPortMediaTypeSn, swAuthPortAccessControlTable=swAuthPortAccessControlTable, aclv6L3RuleTcpUdpSrcPort=aclv6L3RuleTcpUdpSrcPort, aacAccountingMethodListName=aacAccountingMethodListName, impbPortDHCPv4VlanList4k=impbPortDHCPv4VlanList4k, swTimeRangeIndex=swTimeRangeIndex, tftpFwTargetInterfaceName=tftpFwTargetInterfaceName, multicastVlanRowStatus=multicastVlanRowStatus, impbAutoScanIpAddressTo=impbAutoScanIpAddressTo, ipifv6NSRetransmitTime=ipifv6NSRetransmitTime, mstMstiInstanceIndex=mstMstiInstanceIndex, limitIpMulticastPortID=limitIpMulticastPortID, eoamLinkMonitorTable=eoamLinkMonitorTable, impbPortDHCPv6SetVlanList=impbPortDHCPv6SetVlanList, impbDhcpSnoopingIpAddress=impbDhcpSnoopingIpAddress, cpuFilterProfileSrcIpAddrMask=cpuFilterProfileSrcIpAddrMask, swTimeRangeEndDay=swTimeRangeEndDay, mstCistVlanMapped4k=mstCistVlanMapped4k, gvrpGVRPGlobalSettingsOnOff=gvrpGVRPGlobalSettingsOnOff, dhcpv6RelayInterfaceSettingsEntry=dhcpv6RelayInterfaceSettingsEntry, snmpV3UserAuthProtocol=snmpV3UserAuthProtocol, lldpXdot3RemPowerMDIEnabled=lldpXdot3RemPowerMDIEnabled, qosTOSType06=qosTOSType06, ipv4smtpServerPort=ipv4smtpServerPort, aacAccountingMethod3=aacAccountingMethod3, laPortControlIndex=laPortControlIndex, gvrpSettingsPortControlIndex=gvrpSettingsPortControlIndex, aacServerPasswordEncryption=aacServerPasswordEncryption, sysBPDUAttackPortStatus=sysBPDUAttackPortStatus, qosUserPriority=qosUserPriority, impbDhcpSnoopingLeaseTime=impbDhcpSnoopingLeaseTime, iPv4aacServerRetryCount=iPv4aacServerRetryCount, ipv4aclProfileRuleCount=ipv4aclProfileRuleCount, dhcpv6RelayOpt38Entry=dhcpv6RelayOpt38Entry, companyDoSCtrl=companyDoSCtrl, protocolVlanVID=protocolVlanVID, ddmHighAlarm=ddmHighAlarm, sysSwitchName=sysSwitchName, portSecFDBPermVlanID=portSecFDBPermVlanID, ipv4aclProfileTable=ipv4aclProfileTable, des_1210_28me=des_1210_28me, igsVlanFastLeave=igsVlanFastLeave, iPv4swAuthRadiusServerRetransmit=iPv4swAuthRadiusServerRetransmit, miscStatisticsReset=miscStatisticsReset, ipv4sysSNTPDSTStartMin=ipv4sysSNTPDSTStartMin, lldpXdot3LocalData=lldpXdot3LocalData, mstInstanceVlanMapped4k=mstInstanceVlanMapped4k, trustedHostEntry=trustedHostEntry, ftpConfigUsername=ftpConfigUsername, igsDataDrivenLearningMaxLearnedEntryVlaue=igsDataDrivenLearningMaxLearnedEntryVlaue, multicastVlanGroupToIp=multicastVlanGroupToIp, ipv4dhcpOption12Status=ipv4dhcpOption12Status, errorFrameNotifyState=errorFrameNotifyState, qosDiffServType39=qosDiffServType39, aacAuthParamAttempt=aacAuthParamAttempt, ipifV6AddressMainIndex=ipifV6AddressMainIndex, sysTrapTwistedPortEvent=sysTrapTwistedPortEvent, staticStatus=staticStatus, sysMirrorTargetPort=sysMirrorTargetPort, qinqIfIndex=qinqIfIndex, mldsVlanRobustnessValue=mldsVlanRobustnessValue, swAuthUserEntry=swAuthUserEntry, errorSymbolNotifyState=errorSymbolNotifyState, tftpFwTftpOperationStatus=tftpFwTftpOperationStatus, qosDiffServType30=qosDiffServType30, cpuFilterL2RuleDstMacAddr=cpuFilterL2RuleDstMacAddr, lldpPortConfigAdminStatus=lldpPortConfigAdminStatus, agentCPUutilizationIn1min=agentCPUutilizationIn1min, ipv4snmpV3HostVersion=ipv4snmpV3HostVersion, sysGratuitousARPLearning=sysGratuitousARPLearning, ipv4smtpServerAddr=ipv4smtpServerAddr, aacServerAuthPort=aacServerAuthPort, qosTOSGroup=qosTOSGroup, ddmTemperature=ddmTemperature, cpuFilterv6L3RuleDstIpAddrMask=cpuFilterv6L3RuleDstIpAddrMask, sshUserInfoAuth=sshUserInfoAuth, impbBlockListStatus=impbBlockListStatus, ipv4aclProfileIPProtocol=ipv4aclProfileIPProtocol, ipv4aclProfileStatus=ipv4aclProfileStatus, lldpXdot1RemPortVlanId=lldpXdot1RemPortVlanId, sysSNTPServerTable=sysSNTPServerTable, sysSNTPDSTEndMin=sysSNTPDSTEndMin, qosDefaultUserPriTable=qosDefaultUserPriTable, rmonEventEntry=rmonEventEntry)NEWLINEmibBuilder.exportSymbols("DES-1210-28MEbx", dot1qVlanAdvertisementStatus=dot1qVlanAdvertisementStatus, lldpXdot3LocPowerTable=lldpXdot3LocPowerTable, qosDiffServType26=qosDiffServType26, aclv6L3RuleTcpAckBit=aclv6L3RuleTcpAckBit, filterDHCPServerRowStatus=filterDHCPServerRowStatus, impbPortIndex=impbPortIndex, ipv4trustedHostIpMask=ipv4trustedHostIpMask, ddmVoltage=ddmVoltage, aacAPHttpEnableMethod=aacAPHttpEnableMethod, swAuthAuthSuppTimeout=swAuthAuthSuppTimeout, snmpV3TrapSNMPAuthentication=snmpV3TrapSNMPAuthentication, sysPortErrPortReason=sysPortErrPortReason, staticVlanBaseEnableAutoLearn=staticVlanBaseEnableAutoLearn, gvrpSettingsJoinTime=gvrpSettingsJoinTime, macNotifyState=macNotifyState, aacServerGroupEntry=aacServerGroupEntry, igmpMulticastVlanGroupStatus=igmpMulticastVlanGroupStatus, mldsVlan=mldsVlan, impbPortDHCPv4SetVlanList=impbPortDHCPv4SetVlanList, qosTOSType05=qosTOSType05, ddmBiasCurrent=ddmBiasCurrent, cpuFilterv6L3RuleProtocolMask=cpuFilterv6L3RuleProtocolMask, qosDiffServType13=qosDiffServType13, mldsSystem=mldsSystem, staticARPMac=staticARPMac, ipv4sysSNTPDSTEndMin=ipv4sysSNTPDSTEndMin, qosTOSType07=qosTOSType07, rmonHistoryStatus=rmonHistoryStatus, tftpFwTargetTftpOperation=tftpFwTargetTftpOperation, aclQosIPv6Addr=aclQosIPv6Addr, igsVlan=igsVlan, qosDiffServType09=qosDiffServType09, lldpXdot1LocVlanNameTable=lldpXdot1LocVlanNameTable, ipv4sysIprouteGateway=ipv4sysIprouteGateway, duldLinkStatus=duldLinkStatus, stpPortTable=stpPortTable, gvrpSettingsTable=gvrpSettingsTable, dot1qVlanName=dot1qVlanName, ipifName=ipifName, trafficSegMemberList=trafficSegMemberList, swTimeRangeEndMinute=swTimeRangeEndMinute, cpuFilterv6L3RuleDstIpAddr=cpuFilterv6L3RuleDstIpAddr, sysSNTPDSTRepeatEndMin=sysSNTPDSTRepeatEndMin, sysTrapFirmUpgradeEvent=sysTrapFirmUpgradeEvent, qosDiffServType46=qosDiffServType46, l2PTPortIndex=l2PTPortIndex, aRPSpoofPreventMacAddress=aRPSpoofPreventMacAddress, cpuFilterProfileDstIpAddrMask=cpuFilterProfileDstIpAddrMask, aacAccountingServiceNetwork=aacAccountingServiceNetwork, sysPortCtrlMDI=sysPortCtrlMDI, iPv4swAuthRadiusServerStatus=iPv4swAuthRadiusServerStatus, dlink_products=dlink_products, impbBindingListMacAddress=impbBindingListMacAddress, dhcpBOOTPRelayManagementOption82=dhcpBOOTPRelayManagementOption82, aacEnableMethodListIndex=aacEnableMethodListIndex, sysSNTPPollInterval=sysSNTPPollInterval, lldpXdot3Objects=lldpXdot3Objects, sysPortCtrlCapability=sysPortCtrlCapability, mstMstiPortEntry=mstMstiPortEntry, snmpV3GroupReadViewName=snmpV3GroupReadViewName, ftpFwFTPOperation=ftpFwFTPOperation, mstMstiBridgeTable=mstMstiBridgeTable, aclProfileIPProtocol=aclProfileIPProtocol, securitySSH=securitySSH, aclL2RuleReplaceQueue=aclL2RuleReplaceQueue, qosDiffServType08=qosDiffServType08, lldpXdot3RemPortAutoNegAdvertisedCap=lldpXdot3RemPortAutoNegAdvertisedCap, trafficSegTable=trafficSegTable, snmpV3TrapDHCPServerScreening=snmpV3TrapDHCPServerScreening, mstMstiCurrentPortRole=mstMstiCurrentPortRole, dhcpv6RelayOption37CheckState=dhcpv6RelayOption37CheckState, igmpMulticastVlanSourcePort=igmpMulticastVlanSourcePort, stpInstancePortTable=stpInstancePortTable, trafficCtrlThreshold=trafficCtrlThreshold, trustedHostIpAddr=trustedHostIpAddr, ipv4snmpV3HostEntry=ipv4snmpV3HostEntry, cpuFilterv6L3RuleSrcIpAddrMask=cpuFilterv6L3RuleSrcIpAddrMask, staticPort=staticPort, companySNTPSetting=companySNTPSetting, cableDiagPortType=cableDiagPortType, snmpV3HostTable=snmpV3HostTable, aclPacketRuleReplace1P=aclPacketRuleReplace1P, igsSystem=igsSystem, dlinklldpConfigManAddrPortsTxEnable=dlinklldpConfigManAddrPortsTxEnable, impbRoamingState=impbRoamingState, sysLocationName=sysLocationName, vlanTrunkGlobalStatus=vlanTrunkGlobalStatus, rmonHistoryBucketsRequested=rmonHistoryBucketsRequested, lldpXdot3LocPowerEntry=lldpXdot3LocPowerEntry, smtpRecvMailAddrTable=smtpRecvMailAddrTable, sysPortMediaTypeTable=sysPortMediaTypeTable, sysMirrorStatus=sysMirrorStatus, syslogServEntry=syslogServEntry, aclPacketRuleOffsetValue1Mask=aclPacketRuleOffsetValue1Mask, snmpV3IPType=snmpV3IPType, securityARPSpoofPrevent=securityARPSpoofPrevent, lldpXdot3RemPortAutoNegSupported=lldpXdot3RemPortAutoNegSupported, aclv6L3RuleTcpUdpDstPort=aclv6L3RuleTcpUdpDstPort, cpuFilterv6L3RuleTcpUrgBit=cpuFilterv6L3RuleTcpUrgBit, igsVlanRouterPortList=igsVlanRouterPortList, syslogServIndex=syslogServIndex, impbPortDHCPv4VlanList3k=impbPortDHCPv4VlanList3k, companyLBD=companyLBD, aclProfileStatus=aclProfileStatus, sysWebState=sysWebState, sysIpAddrCfgMode=sysIpAddrCfgMode, rmonAlarmVariable=rmonAlarmVariable, stpRootPort=stpRootPort, sysGroupInterval=sysGroupInterval, qosDiffServType52=qosDiffServType52, tftpConfigTftpOperationStatus=tftpConfigTftpOperationStatus, aclv6L3RuleReplaceDSCP=aclv6L3RuleReplaceDSCP, lldpXdot3RemPortTable=lldpXdot3RemPortTable, ipv4smtpState=ipv4smtpState, errorFramePeriodThreshold=errorFramePeriodThreshold, protocolGroupName=protocolGroupName, PortLaMode=PortLaMode, igsVlanFbdRtrPortList=igsVlanFbdRtrPortList, ipv4sysSNTPDSTEndDay=ipv4sysSNTPDSTEndDay, qinqVLANTranslationState=qinqVLANTranslationState, snmpTrapGratuitousArp=snmpTrapGratuitousArp, igsVlanMulticastGroupVlanId=igsVlanMulticastGroupVlanId, aclFlowMeterAccessID=aclFlowMeterAccessID, dhcpRelayVlanTable=dhcpRelayVlanTable, companyDot1qVlanGroup=companyDot1qVlanGroup, portSecFDBPermPort=portSecFDBPermPort, cpuFilterProfileRuleCount=cpuFilterProfileRuleCount, snmpV3HostInterfaceName=snmpV3HostInterfaceName, ipifv6DefaultGateway=ipifv6DefaultGateway, cpuFilterProfileTable=cpuFilterProfileTable, aacAccountingServiceCommandUser=aacAccountingServiceCommandUser, cpuFilterProfileEntry=cpuFilterProfileEntry, duldIfIndex=duldIfIndex, protocolGroupEntry=protocolGroupEntry, stpPortEdge=stpPortEdge, snmpTrapPortSecurity=snmpTrapPortSecurity, l2PTProtocolIndex=l2PTProtocolIndex, smtpServerPort=smtpServerPort, ipifV6AddressTable=ipifV6AddressTable, trafficSegEntry=trafficSegEntry, qosDiffServType49=qosDiffServType49, aclQosType=aclQosType, vlanTrunkTable=vlanTrunkTable, cosClassTable=cosClassTable, mstCistPortTable=mstCistPortTable, tftpCfgTargetServerIpType=tftpCfgTargetServerIpType, qosDiffServType42=qosDiffServType42, dhcpRelayVlanTableEntry=dhcpRelayVlanTableEntry, aacServerGroupTable=aacServerGroupTable, dot1qVlanAsyOnOff=dot1qVlanAsyOnOff, protocolGroupFrameType=protocolGroupFrameType, laPortChannelMasterPort=laPortChannelMasterPort, aacAccountingMethodListTable=aacAccountingMethodListTable, l2PTEntry=l2PTEntry, igsReportToAllPort=igsReportToAllPort, neighborRowStatus=neighborRowStatus, brgAddress=brgAddress, qinqVlanTranslationSVID=qinqVlanTranslationSVID, cpuFilterL3RulePortList=cpuFilterL3RulePortList, lldpXdot3LocPowerPairs=lldpXdot3LocPowerPairs, impbPortProtocolState=impbPortProtocolState, qosPriSettingsEntry=qosPriSettingsEntry, filterDHCPServerIpAddr=filterDHCPServerIpAddr, sysGratuitousARPDuplicateIPDetected=sysGratuitousARPDuplicateIPDetected, tftpFwImageFileName=tftpFwImageFileName, ipv4aclProfileArpSenderIpAddrMask=ipv4aclProfileArpSenderIpAddrMask, syslogServAddr=syslogServAddr, sysPortCtrlFlowControl=sysPortCtrlFlowControl, aclv6L3RuleAction=aclv6L3RuleAction, lldpXdot1LocProtoVlanId=lldpXdot1LocProtoVlanId, sysPortErrPortStatus=sysPortErrPortStatus, mldsVlanRouterPortList=mldsVlanRouterPortList, laPortControlEntry=laPortControlEntry, iPv4swAuthRadiusServerTimeout=iPv4swAuthRadiusServerTimeout, ipv4aclQosProtocol=ipv4aclQosProtocol, snmpTrapWarmStart=snmpTrapWarmStart, dhcpRelayVlanSettingsState=dhcpRelayVlanSettingsState, multicastVlanGroupEntry=multicastVlanGroupEntry, autoRefreshConfiguration=autoRefreshConfiguration, filterDHCPServerPortList=filterDHCPServerPortList, topologyChange=topologyChange, securityAAC=securityAAC, lldpXdot1RemProtocolId=lldpXdot1RemProtocolId, cpuFilterProfileSrcIpAddrMaskType=cpuFilterProfileSrcIpAddrMaskType, syslogServAddrType=syslogServAddrType, ipv4syslogServerGroup=ipv4syslogServerGroup, cpuFilterv6L3RulePortList=cpuFilterv6L3RulePortList, mstCistPortPriority=mstCistPortPriority, swTimeRangeDate=swTimeRangeDate, sysDhcpAutoConfiguration=sysDhcpAutoConfiguration, sysLBDStateEnable=sysLBDStateEnable, tftpFwTargetGroup=tftpFwTargetGroup, sysSNTPDSTState=sysSNTPDSTState, igsVlanGrpQueryInterval=igsVlanGrpQueryInterval, snmpV3CommunityTable=snmpV3CommunityTable, tftpFwTftpOperation=tftpFwTftpOperation, companyDDM=companyDDM, qosDiffServType24=qosDiffServType24, igmpMulticastVlanState=igmpMulticastVlanState, aRPSpoofPreventEntry=aRPSpoofPreventEntry, snmpTrapDHCPScreen=snmpTrapDHCPScreen, smtpRecvMailAddrIndex=smtpRecvMailAddrIndex, cableDiagPair2Status=cableDiagPair2Status, aclPacketRuleReplaceQueue=aclPacketRuleReplaceQueue, impbSettingTable=impbSettingTable, impbDHCPv6PrefixDelegationSnoopState=impbDHCPv6PrefixDelegationSnoopState, protocolVlanPort=protocolVlanPort, mstMstiPortDesignatedBridge=mstMstiPortDesignatedBridge, lldpXdot1LocProtoVlanEntry=lldpXdot1LocProtoVlanEntry, sysTrapSystemEvent=sysTrapSystemEvent, ipv4aclQosAssignClass=ipv4aclQosAssignClass, lldpXdot3LocPortAutoNegEnabled=lldpXdot3LocPortAutoNegEnabled, igsVlanFilterEntry=igsVlanFilterEntry, aclProfileSrcIpAddrMask=aclProfileSrcIpAddrMask, igsHostTableVLANID=igsHostTableVLANID, aclL3RuleIgmpType=aclL3RuleIgmpType, swAuthRadiusServerAuthenticationPort=swAuthRadiusServerAuthenticationPort, sysSNTPDSTEndHour=sysSNTPDSTEndHour, lldpXdot1RemProtoVlanSupported=lldpXdot1RemProtoVlanSupported, ipv4aclProfileSrcMacAddrMask=ipv4aclProfileSrcMacAddrMask, sysTrapFiberPortEvent=sysTrapFiberPortEvent, ipv4aclUdfOffsetBase3=ipv4aclUdfOffsetBase3, lldpXdot3LocMaxFrameSize=lldpXdot3LocMaxFrameSize, iPv4aacServerAuthProtocol=iPv4aacServerAuthProtocol, trafficCtrlType=trafficCtrlType, sfpConnectorType=sfpConnectorType, companyPPPoE=companyPPPoE, syslogSaveMinutes=syslogSaveMinutes, errorFrameSecondsNotifyState=errorFrameSecondsNotifyState, cpuFilterL2RuleInPortList=cpuFilterL2RuleInPortList, ipifv6AutolinkloStatus=ipifv6AutolinkloStatus, impbBindingListEntry=impbBindingListEntry, iPv4aacServerAuthPort=iPv4aacServerAuthPort, aclProfileIPProtocolMask=aclProfileIPProtocolMask, smtpRecvMailAddrEntry=smtpRecvMailAddrEntry, laPortChannelEntry=laPortChannelEntry, tftpFwTargetServerIpAddress=tftpFwTargetServerIpAddress, rmonStatsIndex=rmonStatsIndex, ftpFwTable=ftpFwTable, laPortChannelMemberList=laPortChannelMemberList, aclPacketRule=aclPacketRule, qosDiffServType54=qosDiffServType54, cpuFilterv6L3RuleTcpPshBit=cpuFilterv6L3RuleTcpPshBit, sysARPAgingTime=sysARPAgingTime, errorSymbolThreshold=errorSymbolThreshold, qosDefaultUserPriPortIndex=qosDefaultUserPriPortIndex, aclPacketRuleAction=aclPacketRuleAction, aclL2RuleSrcMacAddr=aclL2RuleSrcMacAddr, qosDiffServType56=qosDiffServType56, snmpV3HostEntry=snmpV3HostEntry, swTimeRangeWednesday=swTimeRangeWednesday, dhcpOption12Status=dhcpOption12Status, filterDHCPServerClientMacAddr=filterDHCPServerClientMacAddr, aclL2RuleRateLimit=aclL2RuleRateLimit)NEWLINEmibBuilder.exportSymbols("DES-1210-28MEbx", cpuFilterL3RuleTcpPshBit=cpuFilterL3RuleTcpPshBit, sysGratuitousARPSettings=sysGratuitousARPSettings, igsVlanMulticastGroupPortList=igsVlanMulticastGroupPortList, snmpV3ViewTreeEntry=snmpV3ViewTreeEntry, sshUserInfoHostIp=sshUserInfoHostIp, autoFdbTimeStamp=autoFdbTimeStamp, mstVlanMstiMappingTable=mstVlanMstiMappingTable, igsHostEntry=igsHostEntry, sshAuthenMethodPubKeyAdmin=sshAuthenMethodPubKeyAdmin, dot1qVlanRowStatus=dot1qVlanRowStatus, staticMcastStatus=staticMcastStatus, impbDhcpSnoopingPort=impbDhcpSnoopingPort, aclL2Rule=aclL2Rule, aclFlowMeterTable=aclFlowMeterTable, sysPortDescString=sysPortDescString, aclUdfOffsetBase3=aclUdfOffsetBase3, ipv4cpuFilterProfileType=ipv4cpuFilterProfileType, sfpVendorSn=sfpVendorSn, snmpTrapColdStart=snmpTrapColdStart, impbBindingListIpAddress=impbBindingListIpAddress, mstMstiBridgePriority=mstMstiBridgePriority, dot1qVlanEgressPorts=dot1qVlanEgressPorts, cpuFilterL3RuleSrcIpAddrMask=cpuFilterL3RuleSrcIpAddrMask, aclL3RuleRateLimit=aclL3RuleRateLimit, gvrpSettingsEntry=gvrpSettingsEntry, mstInstanceVlanMapped3k=mstInstanceVlanMapped3k, doSCtrlType=doSCtrlType, aclL3RuleTcpSynBit=aclL3RuleTcpSynBit, bandwidthCtrlRxThreshold=bandwidthCtrlRxThreshold, sysTrapStateChangeEvent=sysTrapStateChangeEvent, ipifv6GlobalStatus=ipifv6GlobalStatus, rmonStatsEntry=rmonStatsEntry, stpPortAdminP2P=stpPortAdminP2P, mstVlanMstiMappingEntry=mstVlanMstiMappingEntry, iPv4swAuthRadiusServerIndex=iPv4swAuthRadiusServerIndex, qosDiffServType11=qosDiffServType11, syslogServSeverity=syslogServSeverity, dhcpv6RelayControl=dhcpv6RelayControl, sslCiphers=sslCiphers, aclQosIPAddr=aclQosIPAddr, lldpXdot1ConfigProtoVlanTable=lldpXdot1ConfigProtoVlanTable, qosDiffServType58=qosDiffServType58, ipv4sysGateway=ipv4sysGateway, impbBlockListTable=impbBlockListTable, aclPacketRuleEntry=aclPacketRuleEntry, eoamCriticalEventEnable=eoamCriticalEventEnable, snmpV3TrapLBD=snmpV3TrapLBD, sfpVendorInfoTable=sfpVendorInfoTable, ipv4aclProfileArpSenderMacAddrMask=ipv4aclProfileArpSenderMacAddrMask, dot1qVlanTable=dot1qVlanTable, lldpXdot1ConfigProtocolEntry=lldpXdot1ConfigProtocolEntry, igmpMulticastVlanGroupEntry=igmpMulticastVlanGroupEntry, cpuFilterv6L3RuleAccessID=cpuFilterv6L3RuleAccessID, sysLBDPortStatus=sysLBDPortStatus, snmpV3EngineID=snmpV3EngineID, aacServerRetryCount=aacServerRetryCount, smtpRecvMailAddr=smtpRecvMailAddr, cableDiagTable=cableDiagTable, neighborType=neighborType, ipv4syslogServAddr=ipv4syslogServAddr, tftpFwTargetImageFileName=tftpFwTargetImageFileName, dhcpv6RelayOpt38Table=dhcpv6RelayOpt38Table, ddmStatus=ddmStatus, snmpV3viewTreeMask=snmpV3viewTreeMask, companyISMVLAN=companyISMVLAN, lldpXdot3LocLinkAggTable=lldpXdot3LocLinkAggTable, sysSNTPDSTRepeatEndWeekDay=sysSNTPDSTRepeatEndWeekDay, ipv4sysSNTPDSTOffset=ipv4sysSNTPDSTOffset, neighborCacheState=neighborCacheState, igsVlanDataDrivenLearningAgeOutStatus=igsVlanDataDrivenLearningAgeOutStatus, impbSettingEntry=impbSettingEntry, snmpV3User=snmpV3User, laPortActorPortPriority=laPortActorPortPriority, dhcpLocalRelayGlobalState=dhcpLocalRelayGlobalState, companyStaticMcast=companyStaticMcast, rmonAlarm=rmonAlarm, sysSNTPFirstType=sysSNTPFirstType, qosDiffServType14=qosDiffServType14, qosDiffServType41=qosDiffServType41, ipv4sysSNTPPollInterval=ipv4sysSNTPPollInterval)NEWLINE |
NEWLINE# This file helps to compute a version number in source trees obtained fromNEWLINE# git-archive tarball (such as those provided by githubs download-from-tagNEWLINE# feature). Distribution tarballs (built by setup.py sdist) and buildNEWLINE# directories (produced by setup.py build) will contain a much shorter fileNEWLINE# that just contains the computed version number.NEWLINENEWLINE# This file is released into the public domain. Generated byNEWLINE# versioneer-0.18 (https://github.com/warner/python-versioneer)NEWLINENEWLINE"""Git implementation of _version.py."""NEWLINENEWLINEimport errnoNEWLINEimport osNEWLINEimport reNEWLINEimport subprocessNEWLINEimport sysNEWLINENEWLINENEWLINEdef get_keywords():NEWLINE """Get the keywords needed to look up the version information."""NEWLINE # these strings will be replaced by git during git-archive.NEWLINE # setup.py/versioneer.py will grep for the variable names, so they mustNEWLINE # each be defined on a line of their own. _version.py will just callNEWLINE # get_keywords().NEWLINE git_refnames = "$Format:%d$"NEWLINE git_full = "$Format:%H$"NEWLINE git_date = "$Format:%ci$"NEWLINE keywords = {"refnames": git_refnames, "full": git_full, "date": git_date}NEWLINE return keywordsNEWLINENEWLINENEWLINEclass VersioneerConfig:NEWLINE """Container for Versioneer configuration parameters."""NEWLINENEWLINENEWLINEdef get_config():NEWLINE """Create, populate and return the VersioneerConfig() object."""NEWLINE # these strings are filled in when 'setup.py versioneer' createsNEWLINE # _version.pyNEWLINE cfg = VersioneerConfig()NEWLINE cfg.VCS = "git"NEWLINE cfg.style = ""NEWLINE cfg.tag_prefix = ""NEWLINE cfg.parentdir_prefix = "magic-wormhole-mailbox-server"NEWLINE cfg.versionfile_source = "src/wormhole_mailbox_server/_version.py"NEWLINE cfg.verbose = FalseNEWLINE return cfgNEWLINENEWLINENEWLINEclass NotThisMethod(Exception):NEWLINE """Exception raised if a method is not valid for the current scenario."""NEWLINENEWLINENEWLINELONG_VERSION_PY = {}NEWLINEHANDLERS = {}NEWLINENEWLINENEWLINEdef register_vcs_handler(vcs, method): # decoratorNEWLINE """Decorator to mark a method as the handler for a particular VCS."""NEWLINE def decorate(f):NEWLINE """Store f in HANDLERS[vcs][method]."""NEWLINE if vcs not in HANDLERS:NEWLINE HANDLERS[vcs] = {}NEWLINE HANDLERS[vcs][method] = fNEWLINE return fNEWLINE return decorateNEWLINENEWLINENEWLINEdef run_command(commands, args, cwd=None, verbose=False, hide_stderr=False,NEWLINE env=None):NEWLINE """Call the given command(s)."""NEWLINE assert isinstance(commands, list)NEWLINE p = NoneNEWLINE for c in commands:NEWLINE try:NEWLINE dispcmd = str([c] + args)NEWLINE # remember shell=False, so use git.cmd on windows, not just gitNEWLINE p = subprocess.Popen([c] + args, cwd=cwd, env=env,NEWLINE stdout=subprocess.PIPE,NEWLINE stderr=(subprocess.PIPE if hide_stderrNEWLINE else None))NEWLINE breakNEWLINE except EnvironmentError:NEWLINE e = sys.exc_info()[1]NEWLINE if e.errno == errno.ENOENT:NEWLINE continueNEWLINE if verbose:NEWLINE print("unable to run %s" % dispcmd)NEWLINE print(e)NEWLINE return None, NoneNEWLINE else:NEWLINE if verbose:NEWLINE print("unable to find command, tried %s" % (commands,))NEWLINE return None, NoneNEWLINE stdout = p.communicate()[0].strip()NEWLINE if sys.version_info[0] >= 3:NEWLINE stdout = stdout.decode()NEWLINE if p.returncode != 0:NEWLINE if verbose:NEWLINE print("unable to run %s (error)" % dispcmd)NEWLINE print("stdout was %s" % stdout)NEWLINE return None, p.returncodeNEWLINE return stdout, p.returncodeNEWLINENEWLINENEWLINEdef versions_from_parentdir(parentdir_prefix, root, verbose):NEWLINE """Try to determine the version from the parent directory name.NEWLINENEWLINE Source tarballs conventionally unpack into a directory that includes bothNEWLINE the project name and a version string. We will also support searching upNEWLINE two directory levels for an appropriately named parent directoryNEWLINE """NEWLINE rootdirs = []NEWLINENEWLINE for i in range(3):NEWLINE dirname = os.path.basename(root)NEWLINE if dirname.startswith(parentdir_prefix):NEWLINE return {"version": dirname[len(parentdir_prefix):],NEWLINE "full-revisionid": None,NEWLINE "dirty": False, "error": None, "date": None}NEWLINE else:NEWLINE rootdirs.append(root)NEWLINE root = os.path.dirname(root) # up a levelNEWLINENEWLINE if verbose:NEWLINE print("Tried directories %s but none started with prefix %s" %NEWLINE (str(rootdirs), parentdir_prefix))NEWLINE raise NotThisMethod("rootdir doesn't start with parentdir_prefix")NEWLINENEWLINENEWLINE@register_vcs_handler("git", "get_keywords")NEWLINEdef git_get_keywords(versionfile_abs):NEWLINE """Extract version information from the given file."""NEWLINE # the code embedded in _version.py can just fetch the value of theseNEWLINE # keywords. When used from setup.py, we don't want to import _version.py,NEWLINE # so we do it with a regexp instead. This function is not used fromNEWLINE # _version.py.NEWLINE keywords = {}NEWLINE try:NEWLINE f = open(versionfile_abs, "r")NEWLINE for line in f.readlines():NEWLINE if line.strip().startswith("git_refnames ="):NEWLINE mo = re.search(r'=\s*"(.*)"', line)NEWLINE if mo:NEWLINE keywords["refnames"] = mo.group(1)NEWLINE if line.strip().startswith("git_full ="):NEWLINE mo = re.search(r'=\s*"(.*)"', line)NEWLINE if mo:NEWLINE keywords["full"] = mo.group(1)NEWLINE if line.strip().startswith("git_date ="):NEWLINE mo = re.search(r'=\s*"(.*)"', line)NEWLINE if mo:NEWLINE keywords["date"] = mo.group(1)NEWLINE f.close()NEWLINE except EnvironmentError:NEWLINE passNEWLINE return keywordsNEWLINENEWLINENEWLINE@register_vcs_handler("git", "keywords")NEWLINEdef git_versions_from_keywords(keywords, tag_prefix, verbose):NEWLINE """Get version information from git keywords."""NEWLINE if not keywords:NEWLINE raise NotThisMethod("no keywords at all, weird")NEWLINE date = keywords.get("date")NEWLINE if date is not None:NEWLINE # git-2.2.0 added "%cI", which expands to an ISO-8601 -compliantNEWLINE # datestamp. However we prefer "%ci" (which expands to an "ISO-8601NEWLINE # -like" string, which we must then edit to make compliant), becauseNEWLINE # it's been around since git-1.5.3, and it's too difficult toNEWLINE # discover which version we're using, or to work around using anNEWLINE # older one.NEWLINE date = date.strip().replace(" ", "T", 1).replace(" ", "", 1)NEWLINE refnames = keywords["refnames"].strip()NEWLINE if refnames.startswith("$Format"):NEWLINE if verbose:NEWLINE print("keywords are unexpanded, not using")NEWLINE raise NotThisMethod("unexpanded keywords, not a git-archive tarball")NEWLINE refs = set([r.strip() for r in refnames.strip("()").split(",")])NEWLINE # starting in git-1.8.3, tags are listed as "tag: foo-1.0" instead ofNEWLINE # just "foo-1.0". If we see a "tag: " prefix, prefer those.NEWLINE TAG = "tag: "NEWLINE tags = set([r[len(TAG):] for r in refs if r.startswith(TAG)])NEWLINE if not tags:NEWLINE # Either we're using git < 1.8.3, or there really are no tags. We useNEWLINE # a heuristic: assume all version tags have a digit. The old git %dNEWLINE # expansion behaves like git log --decorate=short and strips out theNEWLINE # refs/heads/ and refs/tags/ prefixes that would let us distinguishNEWLINE # between branches and tags. By ignoring refnames without digits, weNEWLINE # filter out many common branch names like "release" andNEWLINE # "stabilization", as well as "HEAD" and "master".NEWLINE tags = set([r for r in refs if re.search(r'\d', r)])NEWLINE if verbose:NEWLINE print("discarding '%s', no digits" % ",".join(refs - tags))NEWLINE if verbose:NEWLINE print("likely tags: %s" % ",".join(sorted(tags)))NEWLINE for ref in sorted(tags):NEWLINE # sorting will prefer e.g. "2.0" over "2.0rc1"NEWLINE if ref.startswith(tag_prefix):NEWLINE r = ref[len(tag_prefix):]NEWLINE if verbose:NEWLINE print("picking %s" % r)NEWLINE return {"version": r,NEWLINE "full-revisionid": keywords["full"].strip(),NEWLINE "dirty": False, "error": None,NEWLINE "date": date}NEWLINE # no suitable tags, so version is "0+unknown", but full hex is still thereNEWLINE if verbose:NEWLINE print("no suitable tags, using unknown + full revision id")NEWLINE return {"version": "0+unknown",NEWLINE "full-revisionid": keywords["full"].strip(),NEWLINE "dirty": False, "error": "no suitable tags", "date": None}NEWLINENEWLINENEWLINE@register_vcs_handler("git", "pieces_from_vcs")NEWLINEdef git_pieces_from_vcs(tag_prefix, root, verbose, run_command=run_command):NEWLINE """Get version from 'git describe' in the root of the source tree.NEWLINENEWLINE This only gets called if the git-archive 'subst' keywords were *not*NEWLINE expanded, and _version.py hasn't already been rewritten with a shortNEWLINE version string, meaning we're inside a checked out source tree.NEWLINE """NEWLINE GITS = ["git"]NEWLINE if sys.platform == "win32":NEWLINE GITS = ["git.cmd", "git.exe"]NEWLINENEWLINE out, rc = run_command(GITS, ["rev-parse", "--git-dir"], cwd=root,NEWLINE hide_stderr=True)NEWLINE if rc != 0:NEWLINE if verbose:NEWLINE print("Directory %s not under git control" % root)NEWLINE raise NotThisMethod("'git rev-parse --git-dir' returned error")NEWLINENEWLINE # if there is a tag matching tag_prefix, this yields TAG-NUM-gHEX[-dirty]NEWLINE # if there isn't one, this yields HEX[-dirty] (no NUM)NEWLINE describe_out, rc = run_command(GITS, ["describe", "--tags", "--dirty",NEWLINE "--always", "--long",NEWLINE "--match", "%s*" % tag_prefix],NEWLINE cwd=root)NEWLINE # --long was added in git-1.5.5NEWLINE if describe_out is None:NEWLINE raise NotThisMethod("'git describe' failed")NEWLINE describe_out = describe_out.strip()NEWLINE full_out, rc = run_command(GITS, ["rev-parse", "HEAD"], cwd=root)NEWLINE if full_out is None:NEWLINE raise NotThisMethod("'git rev-parse' failed")NEWLINE full_out = full_out.strip()NEWLINENEWLINE pieces = {}NEWLINE pieces["long"] = full_outNEWLINE pieces["short"] = full_out[:7] # maybe improved laterNEWLINE pieces["error"] = NoneNEWLINENEWLINE # parse describe_out. It will be like TAG-NUM-gHEX[-dirty] or HEX[-dirty]NEWLINE # TAG might have hyphens.NEWLINE git_describe = describe_outNEWLINENEWLINE # look for -dirty suffixNEWLINE dirty = git_describe.endswith("-dirty")NEWLINE pieces["dirty"] = dirtyNEWLINE if dirty:NEWLINE git_describe = git_describe[:git_describe.rindex("-dirty")]NEWLINENEWLINE # now we have TAG-NUM-gHEX or HEXNEWLINENEWLINE if "-" in git_describe:NEWLINE # TAG-NUM-gHEXNEWLINE mo = re.search(r'^(.+)-(\d+)-g([0-9a-f]+)$', git_describe)NEWLINE if not mo:NEWLINE # unparseable. Maybe git-describe is misbehaving?NEWLINE pieces["error"] = ("unable to parse git-describe output: '%s'"NEWLINE % describe_out)NEWLINE return piecesNEWLINENEWLINE # tagNEWLINE full_tag = mo.group(1)NEWLINE if not full_tag.startswith(tag_prefix):NEWLINE if verbose:NEWLINE fmt = "tag '%s' doesn't start with prefix '%s'"NEWLINE print(fmt % (full_tag, tag_prefix))NEWLINE pieces["error"] = ("tag '%s' doesn't start with prefix '%s'"NEWLINE % (full_tag, tag_prefix))NEWLINE return piecesNEWLINE pieces["closest-tag"] = full_tag[len(tag_prefix):]NEWLINENEWLINE # distance: number of commits since tagNEWLINE pieces["distance"] = int(mo.group(2))NEWLINENEWLINE # commit: short hex revision IDNEWLINE pieces["short"] = mo.group(3)NEWLINENEWLINE else:NEWLINE # HEX: no tagsNEWLINE pieces["closest-tag"] = NoneNEWLINE count_out, rc = run_command(GITS, ["rev-list", "HEAD", "--count"],NEWLINE cwd=root)NEWLINE pieces["distance"] = int(count_out) # total number of commitsNEWLINENEWLINE # commit date: see ISO-8601 comment in git_versions_from_keywords()NEWLINE date = run_command(GITS, ["show", "-s", "--format=%ci", "HEAD"],NEWLINE cwd=root)[0].strip()NEWLINE pieces["date"] = date.strip().replace(" ", "T", 1).replace(" ", "", 1)NEWLINENEWLINE return piecesNEWLINENEWLINENEWLINEdef plus_or_dot(pieces):NEWLINE """Return a + if we don't already have one, else return a ."""NEWLINE if "+" in pieces.get("closest-tag", ""):NEWLINE return "."NEWLINE return "+"NEWLINENEWLINENEWLINEdef render_pep440(pieces):NEWLINE """Build up version string, with post-release "local version identifier".NEWLINENEWLINE Our goal: TAG[+DISTANCE.gHEX[.dirty]] . Note that if youNEWLINE get a tagged build and then dirty it, you'll get TAG+0.gHEX.dirtyNEWLINENEWLINE Exceptions:NEWLINE 1: no tags. git_describe was just HEX. 0+untagged.DISTANCE.gHEX[.dirty]NEWLINE """NEWLINE if pieces["closest-tag"]:NEWLINE rendered = pieces["closest-tag"]NEWLINE if pieces["distance"] or pieces["dirty"]:NEWLINE rendered += plus_or_dot(pieces)NEWLINE rendered += "%d.g%s" % (pieces["distance"], pieces["short"])NEWLINE if pieces["dirty"]:NEWLINE rendered += ".dirty"NEWLINE else:NEWLINE # exception #1NEWLINE rendered = "0+untagged.%d.g%s" % (pieces["distance"],NEWLINE pieces["short"])NEWLINE if pieces["dirty"]:NEWLINE rendered += ".dirty"NEWLINE return renderedNEWLINENEWLINENEWLINEdef render_pep440_pre(pieces):NEWLINE """TAG[.post.devDISTANCE] -- No -dirty.NEWLINENEWLINE Exceptions:NEWLINE 1: no tags. 0.post.devDISTANCENEWLINE """NEWLINE if pieces["closest-tag"]:NEWLINE rendered = pieces["closest-tag"]NEWLINE if pieces["distance"]:NEWLINE rendered += ".post.dev%d" % pieces["distance"]NEWLINE else:NEWLINE # exception #1NEWLINE rendered = "0.post.dev%d" % pieces["distance"]NEWLINE return renderedNEWLINENEWLINENEWLINEdef render_pep440_post(pieces):NEWLINE """TAG[.postDISTANCE[.dev0]+gHEX] .NEWLINENEWLINE The ".dev0" means dirty. Note that .dev0 sorts backwardsNEWLINE (a dirty tree will appear "older" than the corresponding clean one),NEWLINE but you shouldn't be releasing software with -dirty anyways.NEWLINENEWLINE Exceptions:NEWLINE 1: no tags. 0.postDISTANCE[.dev0]NEWLINE """NEWLINE if pieces["closest-tag"]:NEWLINE rendered = pieces["closest-tag"]NEWLINE if pieces["distance"] or pieces["dirty"]:NEWLINE rendered += ".post%d" % pieces["distance"]NEWLINE if pieces["dirty"]:NEWLINE rendered += ".dev0"NEWLINE rendered += plus_or_dot(pieces)NEWLINE rendered += "g%s" % pieces["short"]NEWLINE else:NEWLINE # exception #1NEWLINE rendered = "0.post%d" % pieces["distance"]NEWLINE if pieces["dirty"]:NEWLINE rendered += ".dev0"NEWLINE rendered += "+g%s" % pieces["short"]NEWLINE return renderedNEWLINENEWLINENEWLINEdef render_pep440_old(pieces):NEWLINE """TAG[.postDISTANCE[.dev0]] .NEWLINENEWLINE The ".dev0" means dirty.NEWLINENEWLINE Eexceptions:NEWLINE 1: no tags. 0.postDISTANCE[.dev0]NEWLINE """NEWLINE if pieces["closest-tag"]:NEWLINE rendered = pieces["closest-tag"]NEWLINE if pieces["distance"] or pieces["dirty"]:NEWLINE rendered += ".post%d" % pieces["distance"]NEWLINE if pieces["dirty"]:NEWLINE rendered += ".dev0"NEWLINE else:NEWLINE # exception #1NEWLINE rendered = "0.post%d" % pieces["distance"]NEWLINE if pieces["dirty"]:NEWLINE rendered += ".dev0"NEWLINE return renderedNEWLINENEWLINENEWLINEdef render_git_describe(pieces):NEWLINE """TAG[-DISTANCE-gHEX][-dirty].NEWLINENEWLINE Like 'git describe --tags --dirty --always'.NEWLINENEWLINE Exceptions:NEWLINE 1: no tags. HEX[-dirty] (note: no 'g' prefix)NEWLINE """NEWLINE if pieces["closest-tag"]:NEWLINE rendered = pieces["closest-tag"]NEWLINE if pieces["distance"]:NEWLINE rendered += "-%d-g%s" % (pieces["distance"], pieces["short"])NEWLINE else:NEWLINE # exception #1NEWLINE rendered = pieces["short"]NEWLINE if pieces["dirty"]:NEWLINE rendered += "-dirty"NEWLINE return renderedNEWLINENEWLINENEWLINEdef render_git_describe_long(pieces):NEWLINE """TAG-DISTANCE-gHEX[-dirty].NEWLINENEWLINE Like 'git describe --tags --dirty --always -long'.NEWLINE The distance/hash is unconditional.NEWLINENEWLINE Exceptions:NEWLINE 1: no tags. HEX[-dirty] (note: no 'g' prefix)NEWLINE """NEWLINE if pieces["closest-tag"]:NEWLINE rendered = pieces["closest-tag"]NEWLINE rendered += "-%d-g%s" % (pieces["distance"], pieces["short"])NEWLINE else:NEWLINE # exception #1NEWLINE rendered = pieces["short"]NEWLINE if pieces["dirty"]:NEWLINE rendered += "-dirty"NEWLINE return renderedNEWLINENEWLINENEWLINEdef render(pieces, style):NEWLINE """Render the given version pieces into the requested style."""NEWLINE if pieces["error"]:NEWLINE return {"version": "unknown",NEWLINE "full-revisionid": pieces.get("long"),NEWLINE "dirty": None,NEWLINE "error": pieces["error"],NEWLINE "date": None}NEWLINENEWLINE if not style or style == "default":NEWLINE style = "pep440" # the defaultNEWLINENEWLINE if style == "pep440":NEWLINE rendered = render_pep440(pieces)NEWLINE elif style == "pep440-pre":NEWLINE rendered = render_pep440_pre(pieces)NEWLINE elif style == "pep440-post":NEWLINE rendered = render_pep440_post(pieces)NEWLINE elif style == "pep440-old":NEWLINE rendered = render_pep440_old(pieces)NEWLINE elif style == "git-describe":NEWLINE rendered = render_git_describe(pieces)NEWLINE elif style == "git-describe-long":NEWLINE rendered = render_git_describe_long(pieces)NEWLINE else:NEWLINE raise ValueError("unknown style '%s'" % style)NEWLINENEWLINE return {"version": rendered, "full-revisionid": pieces["long"],NEWLINE "dirty": pieces["dirty"], "error": None,NEWLINE "date": pieces.get("date")}NEWLINENEWLINENEWLINEdef get_versions():NEWLINE """Get version information or return default if unable to do so."""NEWLINE # I am in _version.py, which lives at ROOT/VERSIONFILE_SOURCE. If we haveNEWLINE # __file__, we can work backwards from there to the root. SomeNEWLINE # py2exe/bbfreeze/non-CPython implementations don't do __file__, in whichNEWLINE # case we can only use expanded keywords.NEWLINENEWLINE cfg = get_config()NEWLINE verbose = cfg.verboseNEWLINENEWLINE try:NEWLINE return git_versions_from_keywords(get_keywords(), cfg.tag_prefix,NEWLINE verbose)NEWLINE except NotThisMethod:NEWLINE passNEWLINENEWLINE try:NEWLINE root = os.path.realpath(__file__)NEWLINE # versionfile_source is the relative path from the top of the sourceNEWLINE # tree (where the .git directory might live) to this file. InvertNEWLINE # this to find the root from __file__.NEWLINE for i in cfg.versionfile_source.split('/'):NEWLINE root = os.path.dirname(root)NEWLINE except NameError:NEWLINE return {"version": "0+unknown", "full-revisionid": None,NEWLINE "dirty": None,NEWLINE "error": "unable to find root of source tree",NEWLINE "date": None}NEWLINENEWLINE try:NEWLINE pieces = git_pieces_from_vcs(cfg.tag_prefix, root, verbose)NEWLINE return render(pieces, cfg.style)NEWLINE except NotThisMethod:NEWLINE passNEWLINENEWLINE try:NEWLINE if cfg.parentdir_prefix:NEWLINE return versions_from_parentdir(cfg.parentdir_prefix, root, verbose)NEWLINE except NotThisMethod:NEWLINE passNEWLINENEWLINE return {"version": "0+unknown", "full-revisionid": None,NEWLINE "dirty": None,NEWLINE "error": "unable to compute version", "date": None}NEWLINE |
# Copyright 2017 AT&T Intellectual Property. All other rights reserved.NEWLINE#NEWLINE# Licensed under the Apache License, Version 2.0 (the "License");NEWLINE# you may not use this file except in compliance with the License.NEWLINE# You may obtain a copy of the License atNEWLINE#NEWLINE# http://www.apache.org/licenses/LICENSE-2.0NEWLINE#NEWLINE# Unless required by applicable law or agreed to in writing, softwareNEWLINE# distributed under the License is distributed on an "AS IS" BASIS,NEWLINE# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.NEWLINE# See the License for the specific language governing permissions andNEWLINE# limitations under the License.NEWLINE"""Noop driver for manually executing OOB tasks."""NEWLINENEWLINEimport timeNEWLINEimport loggingNEWLINENEWLINEfrom oslo_config import cfgNEWLINENEWLINEimport drydock_provisioner.error as errorsNEWLINENEWLINEimport drydock_provisioner.objects.fields as hd_fieldsNEWLINENEWLINEimport drydock_provisioner.drivers.oob.driver as oobNEWLINENEWLINENEWLINEclass ManualDriver(oob.OobDriver):NEWLINENEWLINE oob_types_supported = ['manual']NEWLINENEWLINE def __init__(self, **kwargs):NEWLINE super(ManualDriver, self).__init__(**kwargs)NEWLINENEWLINE self.driver_name = "manual_driver"NEWLINE self.driver_key = "manual_driver"NEWLINE self.driver_desc = "Manual (Noop) OOB Driver"NEWLINENEWLINE self.logger = logging.getLogger(cfg.CONF.logging.oobdriver_logger_name)NEWLINENEWLINE def execute_task(self, task_id):NEWLINE task = self.state_manager.get_task(task_id)NEWLINENEWLINE if task is None:NEWLINE self.logger.error("Invalid task %s" % (task_id))NEWLINE raise errors.DriverError("Invalid task %s" % (task_id))NEWLINENEWLINE if task.action not in self.supported_actions:NEWLINE self.logger.error("Driver %s doesn't support task action %s" %NEWLINE (self.driver_desc, task.action))NEWLINE raise errors.DriverError("Driver %s doesn't support task action %s"NEWLINE % (self.driver_desc, task.action))NEWLINENEWLINE design_ref = task.design_refNEWLINENEWLINE if design_ref is None:NEWLINE raise errors.DriverError(NEWLINE "No design ID specified in task %s" % (task_id))NEWLINENEWLINE self.orchestrator.task_field_update(NEWLINE task.get_id(), status=hd_fields.TaskStatus.Running)NEWLINENEWLINE self.logger.info("Sleeping 60s to allow time for manual OOB %s action"NEWLINE % task.action)NEWLINENEWLINE time.sleep(60)NEWLINENEWLINE task.set_status(hd_fields.TaskStatus.Complete)NEWLINE task.success()NEWLINE task.save()NEWLINENEWLINE returnNEWLINE |
from datetime import dateNEWLINEfrom datetime import datetimeNEWLINEfrom datetime import timedelta as deltaNEWLINENEWLINEimport sysNEWLINEimport numpy as npNEWLINEimport xarray as xrNEWLINENEWLINEfrom parcels.grid import GridCodeNEWLINEfrom parcels.grid import CurvilinearGridNEWLINEfrom parcels.kernel import KernelNEWLINEfrom parcels.particle import JITParticleNEWLINEfrom parcels.particlefile import ParticleFileNEWLINEfrom parcels.tools.statuscodes import StateCodeNEWLINEfrom .baseparticleset import BaseParticleSetNEWLINEfrom .collectionsoa import ParticleCollectionSOANEWLINEfrom .collectionsoa import ParticleCollectionIteratorSOANEWLINEfrom parcels.tools.converters import _get_cftime_calendarsNEWLINEfrom parcels.tools.loggers import loggerNEWLINEtry:NEWLINE from mpi4py import MPINEWLINEexcept:NEWLINE MPI = NoneNEWLINE# == comment CK: prevents us from adding KDTree as 'mandatory' dependency == #NEWLINEtry:NEWLINE from pykdtree.kdtree import KDTreeNEWLINEexcept:NEWLINE KDTree = NoneNEWLINENEWLINE__all__ = ['ParticleSet', 'ParticleSetSOA']NEWLINENEWLINENEWLINEdef _convert_to_array(var):NEWLINE """Convert lists and single integers/floats to one-dimensional numpyNEWLINE arraysNEWLINE """NEWLINE if isinstance(var, np.ndarray):NEWLINE return var.flatten()NEWLINE elif isinstance(var, (int, float, np.float32, np.int32)):NEWLINE return np.array([var])NEWLINE else:NEWLINE return np.array(var)NEWLINENEWLINENEWLINEdef _convert_to_reltime(time):NEWLINE """Check to determine if the value of the time parameter needs to beNEWLINE converted to a relative value (relative to the time_origin).NEWLINE """NEWLINE if isinstance(time, np.datetime64) or (hasattr(time, 'calendar') and time.calendar in _get_cftime_calendars()):NEWLINE return TrueNEWLINE return FalseNEWLINENEWLINENEWLINEclass ParticleSetSOA(BaseParticleSet):NEWLINE """Container class for storing particle and executing kernel over them.NEWLINENEWLINE Please note that this currently only supports fixed size particle sets.NEWLINENEWLINE :param fieldset: :mod:`parcels.fieldset.FieldSet` object from which to sample velocity.NEWLINE While fieldset=None is supported, this will throw a warning as it breaks most Parcels functionalityNEWLINE :param pclass: Optional :mod:`parcels.particle.JITParticle` orNEWLINE :mod:`parcels.particle.ScipyParticle` object that defines custom particleNEWLINE :param lon: List of initial longitude values for particlesNEWLINE :param lat: List of initial latitude values for particlesNEWLINE :param depth: Optional list of initial depth values for particles. Default is 0mNEWLINE :param time: Optional list of initial time values for particles. Default is fieldset.U.grid.time[0]NEWLINE :param repeatdt: Optional interval (in seconds) on which to repeat the release of the ParticleSetNEWLINE :param lonlatdepth_dtype: Floating precision for lon, lat, depth particle coordinates.NEWLINE It is either np.float32 or np.float64. Default is np.float32 if fieldset.U.interp_method is 'linear'NEWLINE and np.float64 if the interpolation method is 'cgrid_velocity'NEWLINE :param pid_orig: Optional list of (offsets for) the particle IDsNEWLINE :param partitions: List of cores on which to distribute the particles for MPI runs. Default: None, in which case particlesNEWLINE are distributed automatically on the processorsNEWLINENEWLINE Other Variables can be initialised using further arguments (e.g. v=... for a Variable named 'v')NEWLINE """NEWLINENEWLINE def __init__(self, fieldset=None, pclass=JITParticle, lon=None, lat=None, depth=None, time=None, repeatdt=None, lonlatdepth_dtype=None, pid_orig=None, **kwargs):NEWLINE super(ParticleSetSOA, self).__init__()NEWLINE self.fieldset = fieldsetNEWLINE if self.fieldset is None:NEWLINE logger.warning_once("No FieldSet provided in ParticleSet generation. "NEWLINE "This breaks most Parcels functionality")NEWLINE else:NEWLINE self.fieldset.check_complete()NEWLINE partitions = kwargs.pop('partitions', None)NEWLINENEWLINE lon = np.empty(shape=0) if lon is None else _convert_to_array(lon)NEWLINE lat = np.empty(shape=0) if lat is None else _convert_to_array(lat)NEWLINENEWLINE if isinstance(pid_orig, (type(None), type(False))):NEWLINE pid_orig = np.arange(lon.size)NEWLINENEWLINE if depth is None:NEWLINE mindepth = self.fieldset.gridset.dimrange('depth')[0] if self.fieldset is not None else 0NEWLINE depth = np.ones(lon.size) * mindepthNEWLINE else:NEWLINE depth = _convert_to_array(depth)NEWLINE assert lon.size == lat.size and lon.size == depth.size, (NEWLINE 'lon, lat, depth don''t all have the same lenghts')NEWLINENEWLINE time = _convert_to_array(time)NEWLINE time = np.repeat(time, lon.size) if time.size == 1 else timeNEWLINENEWLINE if time.size > 0 and type(time[0]) in [datetime, date]:NEWLINE time = np.array([np.datetime64(t) for t in time])NEWLINE self.time_origin = fieldset.time_origin if self.fieldset is not None else 0NEWLINE if time.size > 0 and isinstance(time[0], np.timedelta64) and not self.time_origin:NEWLINE raise NotImplementedError('If fieldset.time_origin is not a date, time of a particle must be a double')NEWLINE time = np.array([self.time_origin.reltime(t) if _convert_to_reltime(t) else t for t in time])NEWLINE assert lon.size == time.size, (NEWLINE 'time and positions (lon, lat, depth) don''t have the same lengths.')NEWLINENEWLINE if lonlatdepth_dtype is None:NEWLINE if fieldset is not None:NEWLINE lonlatdepth_dtype = self.lonlatdepth_dtype_from_field_interp_method(fieldset.U)NEWLINE else:NEWLINE lonlatdepth_dtype = np.float32NEWLINE assert lonlatdepth_dtype in [np.float32, np.float64], \NEWLINE 'lon lat depth precision should be set to either np.float32 or np.float64'NEWLINENEWLINE for kwvar in kwargs:NEWLINE kwargs[kwvar] = _convert_to_array(kwargs[kwvar])NEWLINE assert lon.size == kwargs[kwvar].size, (NEWLINE '%s and positions (lon, lat, depth) don''t have the same lengths.' % kwvar)NEWLINENEWLINE self.repeatdt = repeatdt.total_seconds() if isinstance(repeatdt, delta) else repeatdtNEWLINE if self.repeatdt:NEWLINE if self.repeatdt <= 0:NEWLINE raise('Repeatdt should be > 0')NEWLINE if time[0] and not np.allclose(time, time[0]):NEWLINE raise ('All Particle.time should be the same when repeatdt is not None')NEWLINE self.repeatpclass = pclassNEWLINE self.repeatkwargs = kwargsNEWLINENEWLINE ngrids = fieldset.gridset.size if fieldset is not None else 1NEWLINE self._collection = ParticleCollectionSOA(pclass, lon=lon, lat=lat, depth=depth, time=time, lonlatdepth_dtype=lonlatdepth_dtype, pid_orig=pid_orig, partitions=partitions, ngrid=ngrids, **kwargs)NEWLINENEWLINE if self.repeatdt:NEWLINE if len(time) > 0 and time[0] is None:NEWLINE self.repeat_starttime = time[0]NEWLINE else:NEWLINE if self._collection.data['time'][0] and not np.allclose(self._collection.data['time'], self._collection.data['time'][0]):NEWLINE raise ValueError('All Particle.time should be the same when repeatdt is not None')NEWLINE self.repeat_starttime = self._collection.data['time'][0]NEWLINE self.repeatlon = self._collection.data['lon']NEWLINE self.repeatlat = self._collection.data['lat']NEWLINE self.repeatdepth = self._collection.data['depth']NEWLINE for kwvar in kwargs:NEWLINE self.repeatkwargs[kwvar] = self._collection.data[kwvar]NEWLINENEWLINE if self.repeatdt:NEWLINE if MPI and self._collection.pu_indicators is not None:NEWLINE mpi_comm = MPI.COMM_WORLDNEWLINE mpi_rank = mpi_comm.Get_rank()NEWLINE self.repeatpid = pid_orig[self._collection.pu_indicators == mpi_rank]NEWLINENEWLINE self.kernel = NoneNEWLINENEWLINE def _set_particle_vector(self, name, value):NEWLINE """Set attributes of all particles to new values.NEWLINENEWLINE :param name: Name of the attribute (str).NEWLINE :param value: New value to set the attribute of the particles to.NEWLINE """NEWLINE self.collection._data[name][:] = valueNEWLINENEWLINE def _impute_release_times(self, default):NEWLINE """Set attribute 'time' to default if encountering NaN values.NEWLINENEWLINE :param default: Default release time.NEWLINE :return: Minimum and maximum release times.NEWLINE """NEWLINE if np.any(np.isnan(self._collection.data['time'])):NEWLINE self._collection.data['time'][np.isnan(self._collection.data['time'])] = defaultNEWLINE return np.min(self._collection.data['time']), np.max(self._collection.data['time'])NEWLINENEWLINE def data_indices(self, variable_name, compare_values, invert=False):NEWLINE """Get the indices of all particles where the value ofNEWLINE `variable_name` equals (one of) `compare_values`.NEWLINENEWLINE :param variable_name: Name of the variable to check.NEWLINE :param compare_values: Value or list of values to compare to.NEWLINE :param invert: Whether to invert the selection. I.e., when True,NEWLINE return all indices that do not equal (one of)NEWLINE `compare_values`.NEWLINE :return: Numpy array of indices that satisfy the test.NEWLINE """NEWLINE compare_values = np.array([compare_values, ]) if type(compare_values) not in [list, dict, np.ndarray] else compare_valuesNEWLINE return np.where(np.isin(self._collection.data[variable_name], compare_values, invert=invert))[0]NEWLINENEWLINE def indexed_subset(self, indices):NEWLINE return ParticleCollectionIteratorSOA(self._collection,NEWLINE subset=indices)NEWLINENEWLINE def populate_indices(self):NEWLINE """Pre-populate guesses of particle xi/yi indices using a kdtree.NEWLINENEWLINE This is only intended for curvilinear grids, where the initial index searchNEWLINE may be quite expensive.NEWLINE """NEWLINENEWLINE if self.fieldset is None:NEWLINE # we need to be attached to a fieldset to have a validNEWLINE # gridset to search for indicesNEWLINE returnNEWLINENEWLINE if KDTree is None:NEWLINE returnNEWLINE else:NEWLINE for i, grid in enumerate(self.fieldset.gridset.grids):NEWLINE if not isinstance(grid, CurvilinearGrid):NEWLINE continueNEWLINENEWLINE tree_data = np.stack((grid.lon.flat, grid.lat.flat), axis=-1)NEWLINE tree = KDTree(tree_data)NEWLINE # stack all the particle positions for a single queryNEWLINE pts = np.stack((self._collection.data['lon'], self._collection.data['lat']), axis=-1)NEWLINE # query datatype needs to match tree datatypeNEWLINE _, idx = tree.query(pts.astype(tree_data.dtype))NEWLINE yi, xi = np.unravel_index(idx, grid.lon.shape)NEWLINENEWLINE self._collection.data['xi'][:, i] = xiNEWLINE self._collection.data['yi'][:, i] = yiNEWLINENEWLINE @propertyNEWLINE def error_particles(self):NEWLINE """Get an iterator over all particles that are in an error state.NEWLINENEWLINE :return: Collection iterator over error particles.NEWLINE """NEWLINE error_indices = self.data_indices('state', [StateCode.Success, StateCode.Evaluate], invert=True)NEWLINE return ParticleCollectionIteratorSOA(self._collection, subset=error_indices)NEWLINENEWLINE @propertyNEWLINE def num_error_particles(self):NEWLINE """Get the number of particles that are in an error state.NEWLINENEWLINE :return: The number of error particles.NEWLINE """NEWLINE return np.sum(np.isin(NEWLINE self._collection.data['state'],NEWLINE [StateCode.Success, StateCode.Evaluate], invert=True))NEWLINENEWLINE def __getitem__(self, index):NEWLINE """Get a single particle by index"""NEWLINE return self._collection.get_single_by_index(index)NEWLINENEWLINE def cstruct(self):NEWLINE """NEWLINE 'cstruct' returns the ctypes mapping of the combined collections cstruct and the fieldset cstruct.NEWLINE This depends on the specific structure in question.NEWLINE """NEWLINE cstruct = self._collection.cstruct()NEWLINE return cstructNEWLINENEWLINE @propertyNEWLINE def ctypes_struct(self):NEWLINE return self.cstruct()NEWLINENEWLINE @classmethodNEWLINE def monte_carlo_sample(cls, start_field, size, mode='monte_carlo'):NEWLINE """NEWLINE Converts a starting field into a monte-carlo sample of lons and lats.NEWLINENEWLINE :param start_field: :mod:`parcels.fieldset.Field` object for initialising particles stochastically (horizontally) according to the presented density field.NEWLINENEWLINE returns list(lon), list(lat)NEWLINE """NEWLINE if mode == 'monte_carlo':NEWLINE data = start_field.data if isinstance(start_field.data, np.ndarray) else np.array(start_field.data)NEWLINE if start_field.interp_method == 'cgrid_tracer':NEWLINE p_interior = np.squeeze(data[0, 1:, 1:])NEWLINE else: # if A-gridNEWLINE d = dataNEWLINE p_interior = (d[0, :-1, :-1] + d[0, 1:, :-1] + d[0, :-1, 1:] + d[0, 1:, 1:])/4.NEWLINE p_interior = np.where(d[0, :-1, :-1] == 0, 0, p_interior)NEWLINE p_interior = np.where(d[0, 1:, :-1] == 0, 0, p_interior)NEWLINE p_interior = np.where(d[0, 1:, 1:] == 0, 0, p_interior)NEWLINE p_interior = np.where(d[0, :-1, 1:] == 0, 0, p_interior)NEWLINE p = np.reshape(p_interior, (1, p_interior.size))NEWLINE inds = np.random.choice(p_interior.size, size, replace=True, p=p[0] / np.sum(p))NEWLINE xsi = np.random.uniform(size=len(inds))NEWLINE eta = np.random.uniform(size=len(inds))NEWLINE j, i = np.unravel_index(inds, p_interior.shape)NEWLINE grid = start_field.gridNEWLINE lon, lat = ([], [])NEWLINE if grid.gtype in [GridCode.RectilinearZGrid, GridCode.RectilinearSGrid]:NEWLINE lon = grid.lon[i] + xsi * (grid.lon[i + 1] - grid.lon[i])NEWLINE lat = grid.lat[j] + eta * (grid.lat[j + 1] - grid.lat[j])NEWLINE else:NEWLINE lons = np.array([grid.lon[j, i], grid.lon[j, i+1], grid.lon[j+1, i+1], grid.lon[j+1, i]])NEWLINE if grid.mesh == 'spherical':NEWLINE lons[1:] = np.where(lons[1:] - lons[0] > 180, lons[1:]-360, lons[1:])NEWLINE lons[1:] = np.where(-lons[1:] + lons[0] > 180, lons[1:]+360, lons[1:])NEWLINE lon = (1-xsi)*(1-eta) * lons[0] +\NEWLINE xsi*(1-eta) * lons[1] +\NEWLINE xsi*eta * lons[2] +\NEWLINE (1-xsi)*eta * lons[3]NEWLINE lat = (1-xsi)*(1-eta) * grid.lat[j, i] +\NEWLINE xsi*(1-eta) * grid.lat[j, i+1] +\NEWLINE xsi*eta * grid.lat[j+1, i+1] +\NEWLINE (1-xsi)*eta * grid.lat[j+1, i]NEWLINE return list(lon), list(lat)NEWLINE else:NEWLINE raise NotImplementedError('Mode %s not implemented. Please use "monte carlo" algorithm instead.' % mode)NEWLINENEWLINE @classmethodNEWLINE def from_field(cls, fieldset, pclass, start_field, size, mode='monte_carlo', depth=None, time=None, repeatdt=None, lonlatdepth_dtype=None):NEWLINE """Initialise the ParticleSet randomly drawn according to distribution from a fieldNEWLINENEWLINE :param fieldset: :mod:`parcels.fieldset.FieldSet` object from which to sample velocityNEWLINE :param pclass: mod:`parcels.particle.JITParticle` or :mod:`parcels.particle.ScipyParticle`NEWLINE object that defines custom particleNEWLINE :param start_field: Field for initialising particles stochastically (horizontally) according to the presented density field.NEWLINE :param size: Initial size of particle setNEWLINE :param mode: Type of random sampling. Currently only 'monte_carlo' is implementedNEWLINE :param depth: Optional list of initial depth values for particles. Default is 0mNEWLINE :param time: Optional start time value for particles. Default is fieldset.U.time[0]NEWLINE :param repeatdt: Optional interval (in seconds) on which to repeat the release of the ParticleSetNEWLINE :param lonlatdepth_dtype: Floating precision for lon, lat, depth particle coordinates.NEWLINE It is either np.float32 or np.float64. Default is np.float32 if fieldset.U.interp_method is 'linear'NEWLINE and np.float64 if the interpolation method is 'cgrid_velocity'NEWLINE """NEWLINE lon, lat = cls.monte_carlo_sample(start_field, size, mode)NEWLINENEWLINE return cls(fieldset=fieldset, pclass=pclass, lon=lon, lat=lat, depth=depth, time=time,NEWLINE lonlatdepth_dtype=lonlatdepth_dtype, repeatdt=repeatdt)NEWLINENEWLINE @classmethodNEWLINE def from_particlefile(cls, fieldset, pclass, filename, restart=True, restarttime=None, repeatdt=None, lonlatdepth_dtype=None, **kwargs):NEWLINE """Initialise the ParticleSet from a netcdf ParticleFile.NEWLINE This creates a new ParticleSet based on locations of all particles writtenNEWLINE in a netcdf ParticleFile at a certain time. Particle IDs are preserved if restart=TrueNEWLINENEWLINE :param fieldset: :mod:`parcels.fieldset.FieldSet` object from which to sample velocityNEWLINE :param pclass: mod:`parcels.particle.JITParticle` or :mod:`parcels.particle.ScipyParticle`NEWLINE object that defines custom particleNEWLINE :param filename: Name of the particlefile from which to read initial conditionsNEWLINE :param restart: Boolean to signal if pset is used for a restart (default is True).NEWLINE In that case, Particle IDs are preserved.NEWLINE :param restarttime: time at which the Particles will be restarted. Default is the last time written.NEWLINE Alternatively, restarttime could be a time value (including np.datetime64) orNEWLINE a callable function such as np.nanmin. The last is useful when running with dt < 0.NEWLINE :param repeatdt: Optional interval (in seconds) on which to repeat the release of the ParticleSetNEWLINE :param lonlatdepth_dtype: Floating precision for lon, lat, depth particle coordinates.NEWLINE It is either np.float32 or np.float64. Default is np.float32 if fieldset.U.interp_method is 'linear'NEWLINE and np.float64 if the interpolation method is 'cgrid_velocity'NEWLINE """NEWLINENEWLINE if repeatdt is not None:NEWLINE logger.warning('Note that the `repeatdt` argument is not retained from %s, and that 'NEWLINE 'setting a new repeatdt will start particles from the _new_ particle 'NEWLINE 'locations.' % filename)NEWLINENEWLINE pfile = xr.open_dataset(str(filename), decode_cf=True)NEWLINE pfile_vars = [v for v in pfile.data_vars]NEWLINENEWLINE vars = {}NEWLINE to_write = {}NEWLINE for v in pclass.getPType().variables:NEWLINE if v.name in pfile_vars:NEWLINE vars[v.name] = np.ma.filled(pfile.variables[v.name], np.nan)NEWLINE elif v.name not in ['xi', 'yi', 'zi', 'ti', 'dt', '_next_dt', 'depth', 'id', 'fileid', 'state'] \NEWLINE and v.to_write:NEWLINE raise RuntimeError('Variable %s is in pclass but not in the particlefile' % v.name)NEWLINE to_write[v.name] = v.to_writeNEWLINE vars['depth'] = np.ma.filled(pfile.variables['z'], np.nan)NEWLINE vars['id'] = np.ma.filled(pfile.variables['trajectory'], np.nan)NEWLINENEWLINE if isinstance(vars['time'][0, 0], np.timedelta64):NEWLINE vars['time'] = np.array([t/np.timedelta64(1, 's') for t in vars['time']])NEWLINENEWLINE if restarttime is None:NEWLINE restarttime = np.nanmax(vars['time'])NEWLINE elif callable(restarttime):NEWLINE restarttime = restarttime(vars['time'])NEWLINE else:NEWLINE restarttime = restarttimeNEWLINENEWLINE inds = np.where(vars['time'] == restarttime)NEWLINE for v in vars:NEWLINE if to_write[v] is True:NEWLINE vars[v] = vars[v][inds]NEWLINE elif to_write[v] == 'once':NEWLINE vars[v] = vars[v][inds[0]]NEWLINE if v not in ['lon', 'lat', 'depth', 'time', 'id']:NEWLINE kwargs[v] = vars[v]NEWLINENEWLINE if restart:NEWLINE pclass.setLastID(0) # reset to zero offsetNEWLINE else:NEWLINE vars['id'] = NoneNEWLINENEWLINE return cls(fieldset=fieldset, pclass=pclass, lon=vars['lon'], lat=vars['lat'],NEWLINE depth=vars['depth'], time=vars['time'], pid_orig=vars['id'],NEWLINE lonlatdepth_dtype=lonlatdepth_dtype, repeatdt=repeatdt, **kwargs)NEWLINENEWLINE def to_dict(self, pfile, time, deleted_only=False):NEWLINE """NEWLINE Convert all Particle data from one time step to a python dictionary.NEWLINE :param pfile: ParticleFile object requesting the conversionNEWLINE :param time: Time at which to write ParticleSetNEWLINE :param deleted_only: Flag to write only the deleted ParticlesNEWLINE returns two dictionaries: one for all variables to be written each outputdt,NEWLINE and one for all variables to be written onceNEWLINE """NEWLINE return self._collection.toDictionary(pfile=pfile, time=time,NEWLINE deleted_only=deleted_only)NEWLINENEWLINE @propertyNEWLINE def size(self):NEWLINE # ==== to change at some point - len and size are different things ==== #NEWLINE return len(self._collection)NEWLINENEWLINE def __repr__(self):NEWLINE return "\n".join([str(p) for p in self])NEWLINENEWLINE def __len__(self):NEWLINE return len(self._collection)NEWLINENEWLINE def __sizeof__(self):NEWLINE return sys.getsizeof(self._collection)NEWLINENEWLINE def __iadd__(self, particles):NEWLINE """Add particles to the ParticleSet. Note that this is anNEWLINE incremental add, the particles will be added to the ParticleSetNEWLINE on which this function is called.NEWLINENEWLINE :param particles: Another ParticleSet containing particles to addNEWLINE to this one.NEWLINE :return: The current ParticleSetNEWLINE """NEWLINE self.add(particles)NEWLINE return selfNEWLINENEWLINE def add(self, particles):NEWLINE """Add particles to the ParticleSet. Note that this is anNEWLINE incremental add, the particles will be added to the ParticleSetNEWLINE on which this function is called.NEWLINENEWLINE :param particles: Another ParticleSet containing particles to addNEWLINE to this one.NEWLINE :return: The current ParticleSetNEWLINE """NEWLINE if isinstance(particles, BaseParticleSet):NEWLINE particles = particles.collectionNEWLINE self._collection += particlesNEWLINE return selfNEWLINENEWLINE def remove_indices(self, indices):NEWLINE """Method to remove particles from the ParticleSet, based on their `indices`"""NEWLINE if type(indices) in [int, np.int32, np.intp]:NEWLINE self._collection.remove_single_by_index(indices)NEWLINE else:NEWLINE self._collection.remove_multi_by_indices(indices)NEWLINENEWLINE def remove_booleanvector(self, indices):NEWLINE """Method to remove particles from the ParticleSet, based on an array of booleans"""NEWLINE self.remove_indices(np.where(indices)[0])NEWLINENEWLINE def show(self, with_particles=True, show_time=None, field=None, domain=None, projection=None,NEWLINE land=True, vmin=None, vmax=None, savefile=None, animation=False, **kwargs):NEWLINE """Method to 'show' a Parcels ParticleSetNEWLINENEWLINE :param with_particles: Boolean whether to show particlesNEWLINE :param show_time: Time at which to show the ParticleSetNEWLINE :param field: Field to plot under particles (either None, a Field object, or 'vector')NEWLINE :param domain: dictionary (with keys 'N', 'S', 'E', 'W') defining domain to showNEWLINE :param projection: type of cartopy projection to use (default PlateCarree)NEWLINE :param land: Boolean whether to show land. This is ignored for flat meshesNEWLINE :param vmin: minimum colour scale (only in single-plot mode)NEWLINE :param vmax: maximum colour scale (only in single-plot mode)NEWLINE :param savefile: Name of a file to save the plot toNEWLINE :param animation: Boolean whether result is a single plot, or an animationNEWLINE """NEWLINE from parcels.plotting import plotparticlesNEWLINE plotparticles(particles=self, with_particles=with_particles, show_time=show_time, field=field, domain=domain,NEWLINE projection=projection, land=land, vmin=vmin, vmax=vmax, savefile=savefile, animation=animation, **kwargs)NEWLINENEWLINE def density(self, field_name=None, particle_val=None, relative=False, area_scale=False):NEWLINE """Method to calculate the density of particles in a ParticleSet from their locations,NEWLINE through a 2D histogram.NEWLINENEWLINE :param field: Optional :mod:`parcels.field.Field` object to calculate the histogramNEWLINE on. Default is `fieldset.U`NEWLINE :param particle_val: Optional numpy-array of values to weigh each particle with,NEWLINE or string name of particle variable to use weigh particles with.NEWLINE Default is None, resulting in a value of 1 for each particleNEWLINE :param relative: Boolean to control whether the density is scaled by the totalNEWLINE weight of all particles. Default is FalseNEWLINE :param area_scale: Boolean to control whether the density is scaled by the areaNEWLINE (in m^2) of each grid cell. Default is FalseNEWLINE """NEWLINENEWLINE field_name = field_name if field_name else "U"NEWLINE field = getattr(self.fieldset, field_name)NEWLINENEWLINE f_str = """NEWLINEdef search_kernel(particle, fieldset, time):NEWLINE x = fieldset.{}[time, particle.depth, particle.lat, particle.lon]NEWLINE """.format(field_name)NEWLINENEWLINE k = Kernel(NEWLINE self.fieldset,NEWLINE self._collection.ptype,NEWLINE funcname="search_kernel",NEWLINE funcvars=["particle", "fieldset", "time", "x"],NEWLINE funccode=f_str,NEWLINE )NEWLINE self.execute(pyfunc=k, runtime=0)NEWLINENEWLINE if isinstance(particle_val, str):NEWLINE particle_val = self._collection._data[particle_val]NEWLINE else:NEWLINE particle_val = particle_val if particle_val else np.ones(self.size)NEWLINE density = np.zeros((field.grid.lat.size, field.grid.lon.size), dtype=np.float32)NEWLINENEWLINE for i, p in enumerate(self):NEWLINE try: # breaks if either p.xi, p.yi, p.zi, p.ti do not exist (in scipy) or field not in fieldsetNEWLINE if p.ti[field.igrid] < 0: # xi, yi, zi, ti, not initialisedNEWLINE raise('error')NEWLINE xi = p.xi[field.igrid]NEWLINE yi = p.yi[field.igrid]NEWLINE except:NEWLINE _, _, _, xi, yi, _ = field.search_indices(p.lon, p.lat, p.depth, 0, 0, search2D=True)NEWLINE density[yi, xi] += particle_val[i]NEWLINENEWLINE if relative:NEWLINE density /= np.sum(particle_val)NEWLINENEWLINE if area_scale:NEWLINE density /= field.cell_areas()NEWLINENEWLINE return densityNEWLINENEWLINE def Kernel(self, pyfunc, c_include="", delete_cfiles=True):NEWLINE """Wrapper method to convert a `pyfunc` into a :class:`parcels.kernel.Kernel` objectNEWLINE based on `fieldset` and `ptype` of the ParticleSetNEWLINENEWLINE :param delete_cfiles: Boolean whether to delete the C-files after compilation in JIT mode (default is True)NEWLINE """NEWLINE return Kernel(self.fieldset, self.collection.ptype, pyfunc=pyfunc, c_include=c_include,NEWLINE delete_cfiles=delete_cfiles)NEWLINENEWLINE def ParticleFile(self, *args, **kwargs):NEWLINE """Wrapper method to initialise a :class:`parcels.particlefile.ParticleFile`NEWLINE object from the ParticleSet"""NEWLINE return ParticleFile(*args, particleset=self, **kwargs)NEWLINENEWLINE def set_variable_write_status(self, var, write_status):NEWLINE """NEWLINE Method to set the write status of a VariableNEWLINE :param var: Name of the variable (string)NEWLINE :param write_status: Write status of the variable (True, False orNEWLINE 'once')NEWLINE """NEWLINE self._collection.set_variable_write_status(var, write_status)NEWLINENEWLINENEWLINE# ParticleSet is an alias for ParticleSetSOA, i.e. the defaultNEWLINE# implementation for storing particles is the Structure of ArraysNEWLINE# approach.NEWLINEParticleSet = ParticleSetSOANEWLINE |
import FWCore.ParameterSet.Config as cmsNEWLINENEWLINEprocess = cms.Process("TEST")NEWLINENEWLINEprocess.source = cms.Source("EmptySource",NEWLINE firstRun = cms.untracked.uint32(1),NEWLINE firstLuminosityBlock = cms.untracked.uint32(2),NEWLINE firstEvent = cms.untracked.uint32(15),NEWLINE numberEventsInRun = cms.untracked.uint32(100),NEWLINE numberEventsInLuminosityBlock = cms.untracked.uint32(100)NEWLINE)NEWLINENEWLINEprocess.maxEvents = cms.untracked.PSet(NEWLINE input = cms.untracked.int32(1)NEWLINE)NEWLINENEWLINEprocess.out = cms.OutputModule("PoolOutputModule",NEWLINE fileName = cms.untracked.string('testRandomServiceTest2.root')NEWLINE)NEWLINEprocess.RandomNumberGeneratorService = cms.Service("RandomNumberGeneratorService",NEWLINENEWLINE t1 = cms.PSet(NEWLINE initialSeed = cms.untracked.uint32(7)NEWLINE ),NEWLINE t2 = cms.PSet(NEWLINE engineName = cms.untracked.string('RanecuEngine'),NEWLINE initialSeedSet = cms.untracked.vuint32(7, 7)NEWLINE ),NEWLINE t3 = cms.PSet(NEWLINE initialSeed = cms.untracked.uint32(7),NEWLINE engineName = cms.untracked.string('TRandom3')NEWLINE ),NEWLINE t4 = cms.PSet(NEWLINE engineName = cms.untracked.string('HepJamesRandom'),NEWLINE initialSeed = cms.untracked.uint32(7)NEWLINE ),NEWLINE t5 = cms.PSet(NEWLINE initialSeed = cms.untracked.uint32(7),NEWLINE engineName = cms.untracked.string('TRandom3')NEWLINE ),NEWLINE enableChecking = cms.untracked.bool(True),NEWLINE restoreFileName = cms.untracked.string('StashState3.data')NEWLINE)NEWLINENEWLINEprocess.t1 = cms.EDAnalyzer("TestRandomNumberServiceGlobal",NEWLINE engineName = cms.untracked.string('HepJamesRandom'),NEWLINE seeds = cms.untracked.vuint32(81),NEWLINE offset = cms.untracked.uint32(2),NEWLINE maxEvents = cms.untracked.uint32(15),NEWLINE nStreams = cms.untracked.uint32(1),NEWLINE skippedEvents = cms.untracked.vuint32(4),NEWLINE seedByLumi = cms.untracked.vuint32(0, 82, 82, 202, 202)NEWLINE)NEWLINEprocess.t2 = cms.EDAnalyzer("TestRandomNumberServiceGlobal",NEWLINE engineName = cms.untracked.string('RanecuEngine'),NEWLINE seeds = cms.untracked.vuint32(1, 2),NEWLINE offset = cms.untracked.uint32(2),NEWLINE maxEvents = cms.untracked.uint32(15),NEWLINE nStreams = cms.untracked.uint32(1),NEWLINE skippedEvents = cms.untracked.vuint32(4),NEWLINE seedByLumi = cms.untracked.vuint32(0, 2, 2, 203, 203)NEWLINE)NEWLINEprocess.t3 = cms.EDAnalyzer("TestRandomNumberServiceGlobal",NEWLINE engineName = cms.untracked.string('TRandom3'),NEWLINE seeds = cms.untracked.vuint32(83),NEWLINE offset = cms.untracked.uint32(2),NEWLINE maxEvents = cms.untracked.uint32(15),NEWLINE nStreams = cms.untracked.uint32(1),NEWLINE skippedEvents = cms.untracked.vuint32(4),NEWLINE seedByLumi = cms.untracked.vuint32(0, 84, 84, 204, 204)NEWLINE)NEWLINEprocess.t4 = cms.EDAnalyzer("TestRandomNumberServiceGlobal",NEWLINE engineName = cms.untracked.string('HepJamesRandom'),NEWLINE seeds = cms.untracked.vuint32(84),NEWLINE offset = cms.untracked.uint32(2),NEWLINE maxEvents = cms.untracked.uint32(15),NEWLINE nStreams = cms.untracked.uint32(1),NEWLINE skippedEvents = cms.untracked.vuint32(4),NEWLINE seedByLumi = cms.untracked.vuint32(0, 85, 85, 205, 205)NEWLINE)NEWLINENEWLINEprocess.p = cms.Path(process.t1+process.t2+process.t3+process.t4)NEWLINEprocess.o = cms.EndPath(process.out)NEWLINE |
from typing import Any, Dict, GeneratorNEWLINENEWLINEimport pytestNEWLINEfrom pydantic import BaseModelNEWLINENEWLINEfrom xpresso import App, Dependant, FromFormData, Path, SecurityNEWLINEfrom xpresso.security import OAuth2, OAuth2PasswordRequestFormStrictNEWLINEfrom xpresso.testclient import TestClientNEWLINEfrom xpresso.typing import AnnotatedNEWLINENEWLINEreusable_oauth2 = OAuth2(NEWLINE flows={NEWLINE "password": {NEWLINE "tokenUrl": "token",NEWLINE "scopes": {"read:users": "Read the users", "write:users": "Create users"},NEWLINE }NEWLINE }NEWLINE)NEWLINENEWLINENEWLINEclass User(BaseModel):NEWLINE username: strNEWLINENEWLINENEWLINE# Here we use string annotations to test themNEWLINEdef get_current_user(oauth_header: "Annotated[str, Security(reusable_oauth2)]"):NEWLINE user = User(username=oauth_header)NEWLINE return userNEWLINENEWLINENEWLINE# Here we use string annotations to test themNEWLINEdef login(form_data: "FromFormData[OAuth2PasswordRequestFormStrict]"):NEWLINE return form_dataNEWLINENEWLINENEWLINE# Here we use string annotations to test themNEWLINEdef read_current_user(current_user: "Annotated[User, Dependant(get_current_user)]"):NEWLINE return current_userNEWLINENEWLINENEWLINEapp = App(NEWLINE [NEWLINE Path("/users/me", get=read_current_user),NEWLINE Path("/login", post=login),NEWLINE ]NEWLINE)NEWLINENEWLINENEWLINE@pytest.fixtureNEWLINEdef client() -> Generator[TestClient, None, None]:NEWLINE with TestClient(app) as client:NEWLINE yield clientNEWLINENEWLINENEWLINEopenapi_schema: Dict[str, Any] = {NEWLINE "openapi": "3.0.3",NEWLINE "info": {"title": "API", "version": "0.1.0"},NEWLINE "paths": {NEWLINE "/users/me": {NEWLINE "get": {NEWLINE "responses": {"200": {"description": "Successful Response"}},NEWLINE "security": [{"OAuth2": []}],NEWLINE }NEWLINE },NEWLINE "/login": {NEWLINE "post": {NEWLINE "responses": {NEWLINE "200": {"description": "Successful Response"},NEWLINE "422": {NEWLINE "description": "Validation Error",NEWLINE "content": {NEWLINE "application/json": {NEWLINE "schema": {NEWLINE "$ref": "#/components/schemas/HTTPValidationError"NEWLINE }NEWLINE }NEWLINE },NEWLINE },NEWLINE },NEWLINE "requestBody": {NEWLINE "content": {NEWLINE "application/x-www-form-urlencoded": {NEWLINE "schema": {NEWLINE "required": [NEWLINE "grant_type",NEWLINE "username",NEWLINE "password",NEWLINE "scopes",NEWLINE ],NEWLINE "type": "object",NEWLINE "properties": {NEWLINE "grant_type": {NEWLINE "title": "Grant Type",NEWLINE "enum": ["password"],NEWLINE "type": "string",NEWLINE },NEWLINE "username": {"title": "Username", "type": "string"},NEWLINE "password": {"title": "Password", "type": "string"},NEWLINE "scopes": {NEWLINE "title": "Scopes",NEWLINE "type": "array",NEWLINE "items": {"type": "string"},NEWLINE },NEWLINE "client_id": {NEWLINE "title": "Client Id",NEWLINE "type": "string",NEWLINE "nullable": True,NEWLINE },NEWLINE "client_secret": {NEWLINE "title": "Client Secret",NEWLINE "type": "string",NEWLINE "nullable": True,NEWLINE },NEWLINE },NEWLINE },NEWLINE "encoding": {NEWLINE "grant_type": {"style": "form", "explode": True},NEWLINE "username": {"style": "form", "explode": True},NEWLINE "password": {"style": "form", "explode": True},NEWLINE "scopes": {"style": "spaceDelimited", "explode": False},NEWLINE "client_id": {"style": "form", "explode": True},NEWLINE "client_secret": {"style": "form", "explode": True},NEWLINE },NEWLINE }NEWLINE },NEWLINE "required": True,NEWLINE },NEWLINE }NEWLINE },NEWLINE },NEWLINE "components": {NEWLINE "schemas": {NEWLINE "ValidationError": {NEWLINE "title": "ValidationError",NEWLINE "required": ["loc", "msg", "type"],NEWLINE "type": "object",NEWLINE "properties": {NEWLINE "loc": {NEWLINE "title": "Location",NEWLINE "type": "array",NEWLINE "items": {"oneOf": [{"type": "string"}, {"type": "integer"}]},NEWLINE },NEWLINE "msg": {"title": "Message", "type": "string"},NEWLINE "type": {"title": "Error Type", "type": "string"},NEWLINE },NEWLINE },NEWLINE "HTTPValidationError": {NEWLINE "title": "HTTPValidationError",NEWLINE "type": "object",NEWLINE "properties": {NEWLINE "detail": {NEWLINE "title": "Detail",NEWLINE "type": "array",NEWLINE "items": {"$ref": "#/components/schemas/ValidationError"},NEWLINE }NEWLINE },NEWLINE },NEWLINE },NEWLINE "securitySchemes": {NEWLINE "OAuth2": {NEWLINE "type": "oauth2",NEWLINE "flows": {NEWLINE "password": {NEWLINE "scopes": {NEWLINE "read:users": "Read the users",NEWLINE "write:users": "Create users",NEWLINE },NEWLINE "tokenUrl": "token",NEWLINE }NEWLINE },NEWLINE }NEWLINE },NEWLINE },NEWLINE}NEWLINENEWLINENEWLINEdef test_openapi_schema(client: TestClient):NEWLINE response = client.get("/openapi.json")NEWLINE assert response.status_code == 200, response.textNEWLINE assert response.json() == openapi_schemaNEWLINENEWLINENEWLINEdef test_security_oauth2(client: TestClient):NEWLINE response = client.get("/users/me", headers={"Authorization": "Bearer footokenbar"})NEWLINE assert response.status_code == 200, response.textNEWLINE assert response.json() == {"username": "Bearer footokenbar"}NEWLINENEWLINENEWLINEdef test_security_oauth2_password_other_header(client: TestClient):NEWLINE response = client.get("/users/me", headers={"Authorization": "Other footokenbar"})NEWLINE assert response.status_code == 200, response.textNEWLINE assert response.json() == {"username": "Other footokenbar"}NEWLINENEWLINENEWLINEdef test_security_oauth2_password_bearer_no_header(client: TestClient):NEWLINE response = client.get("/users/me")NEWLINE assert response.status_code == 401, response.textNEWLINE assert response.json() == {"detail": "Not authenticated"}NEWLINENEWLINENEWLINErequired_params = {NEWLINE "detail": [NEWLINE {NEWLINE "loc": ["body", "grant_type"],NEWLINE "msg": "field required",NEWLINE "type": "value_error.missing",NEWLINE },NEWLINE {NEWLINE "loc": ["body", "username"],NEWLINE "msg": "field required",NEWLINE "type": "value_error.missing",NEWLINE },NEWLINE {NEWLINE "loc": ["body", "password"],NEWLINE "msg": "field required",NEWLINE "type": "value_error.missing",NEWLINE },NEWLINE ]NEWLINE}NEWLINENEWLINEgrant_type_required = {NEWLINE "detail": [NEWLINE {NEWLINE "loc": ["body", "grant_type"],NEWLINE "msg": "field required",NEWLINE "type": "value_error.missing",NEWLINE }NEWLINE ]NEWLINE}NEWLINENEWLINEgrant_type_incorrect = {NEWLINE "detail": [NEWLINE {NEWLINE "loc": ["body", "grant_type"],NEWLINE "msg": "unexpected value; permitted: 'password'",NEWLINE "type": "value_error.const",NEWLINE "ctx": {"given": "incorrect", "permitted": ["password"]},NEWLINE }NEWLINE ]NEWLINE}NEWLINENEWLINENEWLINE@pytest.mark.parametrize(NEWLINE "data,expected_status,expected_response",NEWLINE [NEWLINE (None, 422, required_params),NEWLINE ({"username": "johndoe", "password": "secret"}, 422, grant_type_required),NEWLINE (NEWLINE {"username": "johndoe", "password": "secret", "grant_type": "incorrect"},NEWLINE 422,NEWLINE grant_type_incorrect,NEWLINE ),NEWLINE (NEWLINE {"username": "johndoe", "password": "secret", "grant_type": "password"},NEWLINE 200,NEWLINE {NEWLINE "grant_type": "password",NEWLINE "username": "johndoe",NEWLINE "password": "secret",NEWLINE "scopes": [],NEWLINE "client_id": None,NEWLINE "client_secret": None,NEWLINE },NEWLINE ),NEWLINE ],NEWLINE)NEWLINEdef test_strict_login(data, expected_status, expected_response, client: TestClient):NEWLINE response = client.post(NEWLINE "/login",NEWLINE data=data,NEWLINE headers={"Content-Type": "application/x-www-form-urlencoded"},NEWLINE )NEWLINE assert response.status_code == expected_statusNEWLINE assert response.json() == expected_responseNEWLINE |
#!/usr/bin/env python3NEWLINE# -*- coding: utf-8 -*-NEWLINE"""NEWLINECreated on Thu Feb 20 17:06:27 2020NEWLINENEWLINE@author: priyankaNEWLINE"""NEWLINENEWLINE # -*- coding: utf-8 -*-NEWLINENEWLINE# Form implementation generated from reading ui file 'test_v1_tabs.ui'NEWLINE#NEWLINE# Created by: PyQt5 UI code generator 5.12.2NEWLINE#NEWLINE# WARNING! All changes made in this file will be lost!NEWLINENEWLINEfrom PyQt5 import QtCore, QtGui, QtWidgetsNEWLINEfrom PyQt5.QtWidgets import QApplication, QMainWindow, QFileDialog, QPushButton, QWidget, QMessageBox, QFormLayout, QGroupBox, QScrollAreaNEWLINEfrom PyQt5.QtSvg import QSvgWidgetNEWLINEfrom PyQt5.QtCore import QProcess, QBasicTimerNEWLINEfrom PyQt5.QtGui import QPainter, QBrush, QPenNEWLINEimport webbrowserNEWLINEimport fileinputNEWLINEimport pandas as pdNEWLINEimport numpy as npNEWLINEimport gzipNEWLINEfrom multiprocessing import ProcessNEWLINEimport globNEWLINEimport datetime as dtNEWLINEimport pickleNEWLINEimport subprocessNEWLINEimport timeNEWLINEimport shlexNEWLINEimport osNEWLINEimport loggingNEWLINEimport stringNEWLINEimport reNEWLINEimport pickleNEWLINEimport sysNEWLINENEWLINENEWLINEmodule_dir=os.path.dirname(__file__)NEWLINEclass Ui_MainWindow(object):NEWLINE def setupUi(self, MainWindow):NEWLINE MainWindow.setObjectName("iCOMIC Pipeline")NEWLINE MainWindow.resize(725, 746)NEWLINE MainWindow.setFixedSize(725, 746)NEWLINE# MainWindow.setStyleSheet("background-image: url(os.path.join(module_dir,'./mainwindow.png'));")NEWLINE sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred)NEWLINE sizePolicy.setHorizontalStretch(0)NEWLINE sizePolicy.setVerticalStretch(0)NEWLINE sizePolicy.setHeightForWidth(MainWindow.sizePolicy().hasHeightForWidth())NEWLINE MainWindow.setSizePolicy(sizePolicy)NEWLINE self.centralwidget = QtWidgets.QWidget(MainWindow)NEWLINE self.centralwidget.setObjectName("centralwidget")NEWLINE MainWindow.setWindowFlags(QtCore.Qt.WindowMinimizeButtonHint | QtCore.Qt.WindowCloseButtonHint);NEWLINE ## ADDed##NEWLINE self.verticalLayout = QtWidgets.QVBoxLayout(self.centralwidget)NEWLINE self.verticalLayout.setObjectName("verticalLayout")NEWLINE ##NEWLINE self.PipelinetabWidget = QtWidgets.QTabWidget(self.centralwidget)NEWLINE self.PipelinetabWidget.setGeometry(QtCore.QRect(10, 10, 701, 530))NEWLINE self.PipelinetabWidget.setObjectName("PipelinetabWidget")NEWLINE self.DNAseq = QtWidgets.QWidget()NEWLINE self.DNAseq.setObjectName("DNAseq")NEWLINE self.DNAtabWidget = QtWidgets.QTabWidget(self.DNAseq)NEWLINE self.DNAtabWidget.setGeometry(QtCore.QRect(0, 0, 695, 507))NEWLINE self.DNAtabWidget.setObjectName("DNAtabWidget")NEWLINE dnatab_img = os.path.join(module_dir,'dnatab.png')NEWLINE self.DNAtabWidget.setStyleSheet("background-image: url({});".format(dnatab_img))NEWLINE NEWLINENEWLINE ### Test Run Button Grey ###NEWLINE self.one_passed = FalseNEWLINE self.two_passed = FalseNEWLINE ## Make Input as first tab ##NEWLINE self.input_dna = QtWidgets.QWidget()NEWLINE self.input_dna.setObjectName("input_dna")NEWLINE self.SamplesYesradioButton = QtWidgets.QRadioButton(self.input_dna)NEWLINE self.SamplesYesradioButton.move(70, 30)NEWLINE self.SamplesYesradioButton.setObjectName("SamplesYesradioButton")NEWLINE self.SamplesYesradioButton.setChecked(True)NEWLINE self.SamplesNoradioButton = QtWidgets.QRadioButton(self.input_dna)NEWLINE self.SamplesNoradioButton.move(70, 90)NEWLINE self.SamplesNoradioButton.setObjectName("SamplesNoradioButton")NEWLINE self.SampleOrlabel = QtWidgets.QLabel(self.input_dna)NEWLINE self.SampleOrlabel.move(130, 60)NEWLINE font = QtGui.QFont()NEWLINE font.setPointSize(12)NEWLINE font.setItalic(True)NEWLINE self.SampleOrlabel.setFont(font)NEWLINE self.SampleOrlabel.setObjectName("SampleOrlabel")NEWLINE NEWLINE NEWLINE font_label = QtGui.QFont()NEWLINE font_label.setPointSize(8.5)NEWLINE color = QtGui.QColor(233, 10, 150)NEWLINE self.SampleFilelabelDNA = QtWidgets.QLabel(self.input_dna)NEWLINE self.SampleFilelabelDNA.setGeometry(QtCore.QRect(20, 150, 93, 23))NEWLINE self.SampleFilelabelDNA.setObjectName("SampleFilelabelDNA")NEWLINE self.SampleFilelabelDNA.setEnabled(True)NEWLINE self.SampleslineEditDNA = QtWidgets.QLineEdit(self.input_dna)NEWLINE self.SampleslineEditDNA.setGeometry(QtCore.QRect(200, 150, 385, 23))NEWLINE self.SampleslineEditDNA.setObjectName("SampleslineEditDNA")NEWLINE self.SampleslineEditDNA.setEnabled(True)NEWLINE self.SamplesBrowseButtonDNA = QtWidgets.QPushButton(self.input_dna)NEWLINE self.SamplesBrowseButtonDNA.setGeometry(QtCore.QRect(600, 150, 30, 25))NEWLINE self.SamplesBrowseButtonDNA.setObjectName("SamplesBrowseButtonDNA")NEWLINE self.SamplesBrowseButtonDNA.setEnabled(True)NEWLINE self.SamplesErrortextDNA = QtWidgets.QLabel(self.input_dna)NEWLINE self.SamplesErrortextDNA.setGeometry(QtCore.QRect(200, 170, 385, 23))NEWLINE self.SamplesErrortextDNA.setFont(font_label)NEWLINE self.SamplesErrortextDNA.setStyleSheet("color: red")NEWLINE self.UnitsFilelabelDNA = QtWidgets.QLabel(self.input_dna)NEWLINE self.UnitsFilelabelDNA.setGeometry(QtCore.QRect(20, 210, 95, 17))NEWLINE self.UnitsFilelabelDNA.setObjectName("UnitsFilelabelDNA")NEWLINE self.UnitsFilelabelDNA.setEnabled(False)NEWLINE self.UnitslineEditDNA = QtWidgets.QLineEdit(self.input_dna)NEWLINE self.UnitslineEditDNA.setGeometry(QtCore.QRect(200, 210, 385, 23))NEWLINE self.UnitslineEditDNA.setObjectName("UnitslineEditDNA")NEWLINE self.UnitslineEditDNA.setEnabled(False)NEWLINE self.UnitsBrowseButtonDNA = QtWidgets.QPushButton(self.input_dna)NEWLINE self.UnitsBrowseButtonDNA.setGeometry(QtCore.QRect(600, 210, 30, 25))NEWLINE self.UnitsBrowseButtonDNA.setObjectName("UnitsBrowseButtonDNA")NEWLINE self.UnitsBrowseButtonDNA.setEnabled(False)NEWLINE self.UnitsErrortextDNA = QtWidgets.QLabel(self.input_dna)NEWLINE self.UnitsErrortextDNA.setGeometry(QtCore.QRect(200, 230, 385, 23))NEWLINE self.UnitsErrortextDNA.setFont(font_label)NEWLINE self.UnitsErrortextDNA.setStyleSheet("color: red")NEWLINE self.UnitsErroriconDNA = QtWidgets.QPushButton(self.input_dna)NEWLINE self.UnitsErroriconDNA.setGeometry(QtCore.QRect(635, 107, 20, 20))NEWLINE self.UnitsErroriconDNA.setToolTip("Input Units file!")NEWLINE self.UnitsErroriconDNA.setFont(font_label)NEWLINE self.UnitsErroriconDNA.hide()NEWLINE self.UnitsErroriconDNA.setIcon(QtGui.QIcon(os.path.join(module_dir,'./icons/warning.svg')))NEWLINE self.RefGenomelabelDNA = QtWidgets.QLabel(self.input_dna)NEWLINE self.RefGenomelabelDNA.setGeometry(QtCore.QRect(20, 270, 125, 17))NEWLINE self.RefGenomelabelDNA.setObjectName("RefGenomelabelDNA")NEWLINE self.RefGenomelineEditDNA = QtWidgets.QLineEdit(self.input_dna)NEWLINE self.RefGenomelineEditDNA.setGeometry(QtCore.QRect(200, 270, 385, 23))NEWLINE self.RefGenomelineEditDNA.setObjectName("RefGenomelineEditDNA")NEWLINE self.RefGenomeBrowseButtonDNA = QtWidgets.QPushButton(self.input_dna)NEWLINE self.RefGenomeBrowseButtonDNA.setGeometry(QtCore.QRect(600, 270, 30, 25))NEWLINE self.RefGenomeBrowseButtonDNA.setObjectName("RefGenomeBrowseButtonDNA")NEWLINE self.RefGenomeErrortextDNA = QtWidgets.QLabel(self.input_dna)NEWLINE self.RefGenomeErrortextDNA.setGeometry(QtCore.QRect(200, 300, 385, 23))NEWLINE self.RefGenomeErrortextDNA.setFont(font_label)NEWLINE self.RefGenomeErrortextDNA.setStyleSheet("color: red")NEWLINE self.RefVariantlabelDNA = QtWidgets.QLabel(self.input_dna)NEWLINE self.RefVariantlabelDNA.setGeometry(QtCore.QRect(20, 330, 157, 17))NEWLINE self.RefVariantlabelDNA.setObjectName("RefVariantlabelDNA")NEWLINE self.RefVariantlineEditDNA = QtWidgets.QLineEdit(self.input_dna)NEWLINE self.RefVariantlineEditDNA.setGeometry(QtCore.QRect(200, 330, 385, 23))NEWLINE self.RefVariantlineEditDNA.setObjectName("RefVariantlineEditDNA")NEWLINE self.RefVariantErrortextDNA = QtWidgets.QLabel(self.input_dna)NEWLINE self.RefVariantErrortextDNA.setGeometry(QtCore.QRect(200, 350, 385, 23))NEWLINE self.RefVariantErrortextDNA.setFont(font_label)NEWLINE self.RefVariantErrortextDNA.setStyleSheet("color: red")NEWLINE self.RefVariantpushButton = QtWidgets.QPushButton(self.input_dna)NEWLINE self.RefVariantpushButton.setGeometry(QtCore.QRect(600, 330, 30, 25))NEWLINE self.RefVariantpushButton.setObjectName("RefVariantpushButton")NEWLINE self.CorelabelDNA = QtWidgets.QLabel(self.input_dna)NEWLINE self.CorelabelDNA.setGeometry(QtCore.QRect(20, 390, 157, 17))NEWLINE self.CorelabelDNA.setObjectName("CorelabelDNA")NEWLINE self.CorelineEditDNA = QtWidgets.QLineEdit(self.input_dna)NEWLINE self.CorelineEditDNA.setGeometry(QtCore.QRect(200, 390, 250, 23))NEWLINE self.CorelineEditDNA.setObjectName("CorelineEditDNA")NEWLINE self.CoreErrortextDNA = QtWidgets.QLabel(self.input_dna)NEWLINE self.CoreErrortextDNA.setGeometry(QtCore.QRect(200, 415, 250, 23))NEWLINE self.CoreErrortextDNA.setFont(font_label)NEWLINE self.CoreErrortextDNA.setStyleSheet("color: red")NEWLINENEWLINE NEWLINE self.nextbuttoninputDNA = QtWidgets.QPushButton(self.input_dna)NEWLINE self.nextbuttoninputDNA.setGeometry(QtCore.QRect(635, 400, 45, 45))NEWLINE self.nextbuttoninputDNA.setObjectName("nextbuttoninputDNA")NEWLINENEWLINE NEWLINE #####info icon####NEWLINE ###dna###NEWLINE NEWLINE font_info = QtGui.QFont()NEWLINE font_info.setPointSize(8.5)NEWLINENEWLINE NEWLINE self.SampleFileinfoicon_dna = QtWidgets.QPushButton(self.input_dna)NEWLINE self.SampleFileinfoicon_dna.setFlat(True)NEWLINE self.SampleFileinfoicon_dna.setGeometry(QtCore.QRect(120, 153, 20, 20))NEWLINE self.SampleFileinfoicon_dna.setToolTip("Browse for the folder containing all the relevant sample files.\n The filenames for all the fastq input data are required to be in the following format.\n (sample_name)_(condition(tumor/normal))_Rep(replicate_number)_R(1 /2 {1 for read1 and 2 for read2}).fastq.\n Example:hcc1395_normal_Rep1_R1.fastq")NEWLINE self.SampleFileinfoicon_dna.setFont(font_info)NEWLINE self.SampleFileinfoicon_dna.setIcon(QtGui.QIcon(os.path.join(module_dir,'./icons/info.svg')))NEWLINE self.SampleFileinfoicon_dna.setIconSize(QtCore.QSize(13, 13))NEWLINE NEWLINE self.UnitsFileinfoicon_dna = QtWidgets.QPushButton(self.input_dna)NEWLINE self.UnitsFileinfoicon_dna.setFlat(True)NEWLINE self.UnitsFileinfoicon_dna.setGeometry(QtCore.QRect(116, 209, 20, 20))NEWLINE self.UnitsFileinfoicon_dna.setToolTip("Browse for the tab separated text file containing the sample information. \n The table is required to be formatted as follows.\n The column names should take the order: Sample, Unit, Condition, fq1, fq2.\n (Sample- Sample name, Unit- Number of replications, \n Condition- normal/ tumor/ leave blank if the condition is not specified, \n fq1 - Path of Read 1,fq2 - Path of Read 2/ leave blank for single-end reads).\n An example table has been provided for your reference")NEWLINE self.UnitsFileinfoicon_dna.setFont(font_info)NEWLINE self.UnitsFileinfoicon_dna.setIcon(QtGui.QIcon(os.path.join(module_dir,'./icons/info.svg')))NEWLINE self.UnitsFileinfoicon_dna.setIconSize(QtCore.QSize(13, 13))NEWLINE NEWLINE self.RefGenomeinfoicon_dna = QtWidgets.QPushButton(self.input_dna)NEWLINE self.RefGenomeinfoicon_dna.setFlat(True)NEWLINE self.RefGenomeinfoicon_dna.setGeometry(QtCore.QRect(142, 270, 20, 20))NEWLINE self.RefGenomeinfoicon_dna.setToolTip("A reference genome is a digital nucleic acid database \n assembled to be a representative example of a species’ set of genes.\n It allows for fast alignment of sequences as it is less computationally intensive \n to align sequences to a known sequence map rather than to assemble it piece by piece.\n For this field, specify the path to the pre-downloaded reference genome fastq file")NEWLINE self.RefGenomeinfoicon_dna.setFont(font_info)NEWLINE self.RefGenomeinfoicon_dna.setIcon(QtGui.QIcon(os.path.join(module_dir,'./icons/info.svg')))NEWLINE self.RefGenomeinfoicon_dna.setIconSize(QtCore.QSize(13, 13)) NEWLINE NEWLINE self.RefVariantinfoicon_dna = QtWidgets.QPushButton(self.input_dna)NEWLINE self.RefVariantinfoicon_dna.setFlat(True)NEWLINE self.RefVariantinfoicon_dna.setGeometry(QtCore.QRect(177, 329, 20, 20))NEWLINE self.RefVariantinfoicon_dna.setToolTip("A vcf file specifying the known variant locations")NEWLINE self.RefVariantinfoicon_dna.setFont(font_info)NEWLINE self.RefVariantinfoicon_dna.setIcon(QtGui.QIcon(os.path.join(module_dir,'./icons/info.svg')))NEWLINE self.RefVariantinfoicon_dna.setIconSize(QtCore.QSize(13, 13)) NEWLINE NEWLINE self.SamplesYesradioinfoicon_dna = QtWidgets.QPushButton(self.input_dna)NEWLINE self.SamplesYesradioinfoicon_dna.setFlat(True)NEWLINE self.SamplesYesradioinfoicon_dna.setGeometry(QtCore.QRect(210, 32, 20, 20))NEWLINE self.SamplesYesradioinfoicon_dna.setToolTip("Specify the path to the folder containing all the relevant sample files.\n The filenames for all the fastq input data are required to be in the following format.\n (sample_name)_(condition(tumor/normal))_Rep(replicate_number)_R(1 /2 {1 for read1 and 2 for read2}).fastq. \nExample:hcc1395_normal_Rep1_R1.fastq.")NEWLINE self.SamplesYesradioinfoicon_dna.setFont(font_info)NEWLINE self.SamplesYesradioinfoicon_dna.setIcon(QtGui.QIcon(os.path.join(module_dir,'./icons/info.svg')))NEWLINE self.SamplesYesradioinfoicon_dna.setIconSize(QtCore.QSize(13, 13)) NEWLINE NEWLINE NEWLINE self.SamplesNoradioinfoicon_dna = QtWidgets.QPushButton(self.input_dna)NEWLINE self.SamplesNoradioinfoicon_dna.setFlat(True)NEWLINE self.SamplesNoradioinfoicon_dna.setGeometry(QtCore.QRect(210, 90, 20, 20))NEWLINE self.SamplesNoradioinfoicon_dna.setToolTip("Specify the tab-delimited text file containing the sample information.\n The table is required to be formatted as follows.\n The column names should take the order: Sample, Unit, Condition, fq1, fq2. \n(Sample- Sample name, Unit- Number of replications, Condition- normal/ tumor/ leave blank if the condition is not specified,\n fq1 - Path of Read 1,fq2 - Path of Read 2/ leave blank for single-end reads).\n An example table has been provided for your reference")NEWLINE self.SamplesNoradioinfoicon_dna.setFont(font_info)NEWLINE self.SamplesNoradioinfoicon_dna.setIcon(QtGui.QIcon(os.path.join(module_dir,'./icons/info.svg')))NEWLINE self.SamplesNoradioinfoicon_dna.setIconSize(QtCore.QSize(13, 13))NEWLINENEWLINENEWLINE self.coreinfoicon_dna = QtWidgets.QPushButton(self.input_dna)NEWLINE self.coreinfoicon_dna.setFlat(True)NEWLINE self.coreinfoicon_dna.setGeometry(QtCore.QRect(140, 390, 20, 20))NEWLINE self.coreinfoicon_dna.setToolTip("Input the number of threads to run")NEWLINE self.coreinfoicon_dna.setFont(font_info)NEWLINE self.coreinfoicon_dna.setIcon(QtGui.QIcon(os.path.join(module_dir,'./icons/info.svg')))NEWLINE self.coreinfoicon_dna.setIconSize(QtCore.QSize(13, 13)) NEWLINE NEWLINE self.DNAtabWidget.addTab(self.input_dna, "")NEWLINE ## End ##NEWLINE ## Add QC ##NEWLINE self.QC_dna = QtWidgets.QWidget()NEWLINE self.QC_dna.setObjectName("QC_dna")NEWLINE# self.QC_dna.setEnabled(False)NEWLINE ## Added from QC_Index##NEWLINE self.QCresults = QtWidgets.QPushButton(self.QC_dna)NEWLINE self.QCresults.setGeometry(QtCore.QRect(10, 30, 150, 23))NEWLINE self.QCresults.setText("Quality Control Results")NEWLINE self.QCresults.setStyleSheet("background-color: #704214")NEWLINE self.QCresultsButtonErroricon = QtWidgets.QPushButton(self.QC_dna)NEWLINE self.QCresultsButtonErroricon.setGeometry(QtCore.QRect(186, 32, 20, 20))NEWLINE self.QCresultsButtonErroricon.setToolTip("Check and Run View Quality control Results Again!")NEWLINE self.QCresultsButtonErroricon.setFont(font_label)NEWLINE self.QCresultsButtonErroricon.setIcon(QtGui.QIcon(os.path.join(module_dir,'./icons/warning.svg')))NEWLINE self.QCresultsButtonErroricon.hide()NEWLINE self.QClabel = QtWidgets.QLabel(self.QC_dna)NEWLINE self.QClabel.setGeometry(QtCore.QRect(10, 85, 151, 21))NEWLINE font = QtGui.QFont()NEWLINE font.setPointSize(12)NEWLINE font.setItalic(True)NEWLINE self.QClabel.setFont(font)NEWLINE self.QClabel.setObjectName("QClabel")NEWLINE self.QCYesradioButton = QtWidgets.QRadioButton(self.QC_dna)NEWLINE self.QCYesradioButton.setGeometry(QtCore.QRect(170, 85, 117, 22))NEWLINE self.QCYesradioButton.setObjectName("QCYesradioButton")NEWLINE# self.QCYesradioButton.setChecked(True)NEWLINE self.QCNoradioButton = QtWidgets.QRadioButton(self.QC_dna)NEWLINE self.QCNoradioButton.setGeometry(QtCore.QRect(250, 85, 117, 22))NEWLINE self.QCNoradioButton.setObjectName("QCNoradioButton")NEWLINE self.QCNoradioButton.setChecked(True)NEWLINE self.InputParamslabel = QtWidgets.QLabel(self.QC_dna)NEWLINE self.InputParamslabel.setGeometry(QtCore.QRect(10, 140, 171, 17))NEWLINE font = QtGui.QFont()NEWLINE font.setPointSize(12)NEWLINE font.setBold(True)NEWLINE font.setWeight(75)NEWLINE self.InputParamslabel.setFont(font)NEWLINE self.InputParamslabel.setObjectName("InputParamslabel")NEWLINENEWLINE self.CutadaptlineEdit = QtWidgets.QLineEdit(self.QC_dna)NEWLINE self.CutadaptlineEdit.setGeometry(QtCore.QRect(120, 200, 481, 23))NEWLINE self.CutadaptlineEdit.setObjectName("CutadaptlineEdit")NEWLINE self.Cutadaptlabel = QtWidgets.QLabel(self.QC_dna)NEWLINE self.Cutadaptlabel.setGeometry(QtCore.QRect(10, 200, 67, 17))NEWLINE self.Cutadaptlabel.setObjectName("Cutadaptlabel")NEWLINENEWLINE self.horizontalLayoutWidget = QtWidgets.QWidget(self.QC_dna)NEWLINE self.horizontalLayoutWidget.setGeometry(QtCore.QRect(235, 273, 240, 31))NEWLINE self.horizontalLayoutWidget.setObjectName("horizontalLayoutWidget")NEWLINE self.horizontalLayout_4 = QtWidgets.QHBoxLayout(self.horizontalLayoutWidget)NEWLINE self.horizontalLayout_4.setContentsMargins(0, 0, 0, 0)NEWLINE self.horizontalLayout_4.setObjectName("horizontalLayout_4")NEWLINENEWLINE self.RunQCpushButton = QtWidgets.QPushButton(self.horizontalLayoutWidget)NEWLINE self.RunQCpushButton.setObjectName("RunQCpushButton")NEWLINE self.horizontalLayout_4.addWidget(self.RunQCpushButton)NEWLINE self.RunQCButtonErroricon = QtWidgets.QPushButton(self.QC_dna)NEWLINE self.RunQCButtonErroricon.setGeometry(QtCore.QRect(500, 277, 20, 20))NEWLINE self.RunQCButtonErroricon.setToolTip("Check and Run Trimming Again!")NEWLINE self.RunQCButtonErroricon.setFont(font_label)NEWLINE self.RunQCButtonErroricon.setIcon(QtGui.QIcon(os.path.join(module_dir,'./icons/warning.svg')))NEWLINE# self.horizontalLayout_4.addWidget(self.RunQCButtonErroricon)NEWLINE self.RunQCButtonErroricon.hide()NEWLINE self.InputParamslabel.setEnabled(False)NEWLINE self.Cutadaptlabel.setEnabled(False)NEWLINE self.CutadaptlineEdit.setEnabled(False)NEWLINE self.RunQCpushButton.setEnabled(False)NEWLINE ##QC_Progressbar##NEWLINE self.progressBar_sub1_dna = QtWidgets.QProgressBar(self.QC_dna)NEWLINE self.progressBar_sub1_dna.setGeometry(QtCore.QRect(10, 355, 665, 17))NEWLINE self.progressBar_sub1_dna.setProperty("value", 0)NEWLINE self.progressBar_sub1_dna.setObjectName("progressBar_sub1_dna")NEWLINENEWLINE ###NEWLINE self.nextbuttonqcDNA = QtWidgets.QPushButton(self.QC_dna)NEWLINE self.nextbuttonqcDNA.setGeometry(QtCore.QRect(635, 400, 45, 45))NEWLINE self.nextbuttonqcDNA.setObjectName("nextbuttonqcDNA")NEWLINE self.nextbuttonqcDNA.setEnabled(True)NEWLINE ###NEWLINE self.previousbuttonqcDNA = QtWidgets.QPushButton(self.QC_dna)NEWLINE self.previousbuttonqcDNA.setGeometry(QtCore.QRect(10, 400, 45, 45))NEWLINE self.previousbuttonqcDNA.setObjectName("previousbuttonqcDNA")NEWLINE NEWLINE NEWLINE NEWLINE font_info = QtGui.QFont()NEWLINE font_info.setPointSize(8.5)NEWLINE NEWLINE self.QCresultsinfoicon_dna = QtWidgets.QPushButton(self.QC_dna)NEWLINE self.QCresultsinfoicon_dna.setFlat(True)NEWLINE self.QCresultsinfoicon_dna.setGeometry(QtCore.QRect(166, 33, 20, 20))NEWLINE self.QCresultsinfoicon_dna.setToolTip("Generates a MultiQC report consisting of statistical metrics\n aggregated from FastQC for each sample input file.\n If the results obtained are satisfactory, you may move onto the next tab.\n If not, proceed to trim the reads to improve the quality of your data")NEWLINE self.QCresultsinfoicon_dna.setFont(font_info)NEWLINE self.QCresultsinfoicon_dna.setIcon(QtGui.QIcon(os.path.join(module_dir,'./icons/info.svg')))NEWLINE self.QCresultsinfoicon_dna.setIconSize(QtCore.QSize(13, 13)) NEWLINE NEWLINE self.QClabelinfoicon_dna = QtWidgets.QPushButton(self.QC_dna)NEWLINE self.QClabelinfoicon_dna.setFlat(True)NEWLINE self.QClabelinfoicon_dna.setGeometry(QtCore.QRect(131, 87, 20, 20))NEWLINE self.QClabelinfoicon_dna.setToolTip("Selecting 'Yes' will remove the adapter sequences from your data thereby improving data quality.\n 'No' can be selected if you are satisfied with the data quality")NEWLINE self.QClabelinfoicon_dna.setFont(font_info)NEWLINE self.QClabelinfoicon_dna.setIcon(QtGui.QIcon(os.path.join(module_dir,'./icons/info.svg')))NEWLINE self.QClabelinfoicon_dna.setIconSize(QtCore.QSize(13, 13)) NEWLINE NEWLINE self.Cutadaptlabelinfoicon_dna = QtWidgets.QPushButton(self.QC_dna)NEWLINE self.Cutadaptlabelinfoicon_dna.setFlat(True)NEWLINE self.Cutadaptlabelinfoicon_dna.setGeometry(QtCore.QRect(70, 199, 20, 20))NEWLINE self.Cutadaptlabelinfoicon_dna.setToolTip("Please input the necessary parameters for the tool cutadapt.\n It may include the adapter sequences.\n Refer https://cutadapt.readthedocs.io/en/stable/guide.html#adapter-types for details")NEWLINE self.Cutadaptlabelinfoicon_dna.setFont(font_info)NEWLINE self.Cutadaptlabelinfoicon_dna.setIcon(QtGui.QIcon(os.path.join(module_dir,'./icons/info.svg')))NEWLINE self.Cutadaptlabelinfoicon_dna.setIconSize(QtCore.QSize(13, 13)) NEWLINE NEWLINE self.RunQCpushButtoninfoicon_dna = QtWidgets.QPushButton(self.QC_dna)NEWLINE self.RunQCpushButtoninfoicon_dna.setFlat(True)NEWLINE self.RunQCpushButtoninfoicon_dna.setGeometry(QtCore.QRect(480, 277, 20, 20))NEWLINE self.RunQCpushButtoninfoicon_dna.setToolTip("Please choose yes to trim your reads if the input sequences are of poor quality.\n You may proceed to the next section if your reads are good enough for alignment")NEWLINE self.RunQCpushButtoninfoicon_dna.setFont(font_info)NEWLINE self.RunQCpushButtoninfoicon_dna.setIcon(QtGui.QIcon(os.path.join(module_dir,'./icons/info.svg')))NEWLINE self.RunQCpushButtoninfoicon_dna.setIconSize(QtCore.QSize(13, 13)) NEWLINE NEWLINE NEWLINE self.DNAtabWidget.addTab(self.QC_dna, "")NEWLINE ## End ##NEWLINE self.Tool_dna = QtWidgets.QWidget()NEWLINE self.Tool_dna.setObjectName("Tool_dna")NEWLINENEWLINE self.create_aligner_groupbox()NEWLINE self.create_vc_groupbox()NEWLINE self.create_annotator_groupbox()NEWLINE self.create_group_next()NEWLINE NEWLINE NEWLINE NEWLINE self.layout = QtWidgets.QHBoxLayout(self.Tool_dna)NEWLINE self.scrollArea = QtWidgets.QScrollArea(self.Tool_dna)NEWLINE self.scrollArea.setWidgetResizable(True)NEWLINE self.scrollAreaWidgetContents = QtWidgets.QWidget()NEWLINE self.gridLayout = QtWidgets.QGridLayout(self.scrollAreaWidgetContents)NEWLINE self.scrollArea.setWidget(self.scrollAreaWidgetContents)NEWLINE self.layout.addWidget(self.scrollArea)NEWLINE NEWLINE self.grp_list=[self.aligner_groupbox, self.vc_groupbox, self.annotator_groupbox, self.next_groupbox]NEWLINE for i in range(4):NEWLINE self.gridLayout.addWidget(self.grp_list[i], i,0)NEWLINE NEWLINE NEWLINE self.DNAtabWidget.addTab(self.Tool_dna, "")NEWLINENEWLINENEWLINE NEWLINENEWLINE ## End ##NEWLINE NEWLINE ##Add Run##NEWLINE self.run_dna = QtWidgets.QWidget()NEWLINE self.run_dna.setObjectName("run_dna")NEWLINE NEWLINE self.RunButton_dna = QtWidgets.QPushButton(self.run_dna)NEWLINE self.RunButton_dna.setGeometry(QtCore.QRect(300, 140, 100, 100))NEWLINE self.RunButton_dna.setObjectName("RunButton_dna")NEWLINE self.RunLabel_dna = QtWidgets.QLabel(self.run_dna)NEWLINE self.RunLabel_dna.setGeometry(QtCore.QRect(330, 255, 180, 17))NEWLINE self.RunLabel_dna.setObjectName("RunLabel_dna")NEWLINE NEWLINE NEWLINE self.RunButtonErroricon_dna = QtWidgets.QPushButton(self.run_dna)NEWLINE self.RunButtonErroricon_dna.setGeometry(QtCore.QRect(420, 172, 30, 30))NEWLINE self.RunButtonErroricon_dna.setToolTip("Click Run Button and Run Again!")NEWLINE self.RunButtonErroricon_dna.setFont(font_label)NEWLINE self.RunButtonErroricon_dna.setIcon(QtGui.QIcon(os.path.join(module_dir,'./icons/warning.svg')))NEWLINE self.RunButtonErroricon_dna.hide() NEWLINE NEWLINENEWLINE NEWLINE self.progressBar_dna = QtWidgets.QProgressBar(self.run_dna)NEWLINE self.progressBar_dna.setGeometry(QtCore.QRect(10, 340, 670, 23))NEWLINE self.progressBar_dna.setProperty("value", 0)NEWLINE# self.progressBar.setMaximum(3)NEWLINE self.progressBar_dna.setObjectName("progressBar_dna") NEWLINE NEWLINE self.nextbuttonrunDNA = QtWidgets.QPushButton(self.run_dna)NEWLINE self.nextbuttonrunDNA.setGeometry(QtCore.QRect(635, 400, 45, 45))NEWLINE self.nextbuttonrunDNA.setObjectName("nextbuttonrunDNA")NEWLINE ###NEWLINE self.previousbuttonrunDNA = QtWidgets.QPushButton(self.run_dna)NEWLINE self.previousbuttonrunDNA.setGeometry(QtCore.QRect(10, 400,45, 45))NEWLINE self.previousbuttonrunDNA.setObjectName("previousbuttonrunDNA")NEWLINE NEWLINE font_info = QtGui.QFont()NEWLINE font_info.setPointSize(8.5)NEWLINE NEWLINE self.RunButtoninfoicon_dna = QtWidgets.QPushButton(self.run_dna)NEWLINE self.RunButtoninfoicon_dna.setFlat(True)NEWLINE self.RunButtoninfoicon_dna.setGeometry(QtCore.QRect(400, 180, 20, 20))NEWLINE self.RunButtoninfoicon_dna.setToolTip("Click to start your analysis")NEWLINE self.RunButtoninfoicon_dna.setFont(font_info)NEWLINE self.RunButtoninfoicon_dna.setIcon(QtGui.QIcon(os.path.join(module_dir,'./icons/info.svg')))NEWLINE self.RunButtoninfoicon_dna.setIconSize(QtCore.QSize(13, 13)) NEWLINE NEWLINENEWLINE NEWLINE NEWLINE self.DNAtabWidget.addTab(self.run_dna, "")NEWLINE ##End##NEWLINE ##Add Result DNA##NEWLINE self.result_dna = QtWidgets.QWidget()NEWLINE self.result_dna.setObjectName("result_dna")NEWLINE NEWLINE self.DNAtabWidget.addTab(self.result_dna, "")NEWLINENEWLINE font_resulttab = QtGui.QFont()NEWLINE font_resulttab.setPointSize(16)NEWLINE self.pushbutton_result1_dna=QtWidgets.QPushButton(self.result_dna)NEWLINE self.pushbutton_result1_dna.setText(" Run statistics")NEWLINE self.pushbutton_result1_dna.setIcon(QtGui.QIcon(os.path.join(module_dir,'./icons/runstatistics.svg')))NEWLINE self.pushbutton_result1_dna.setIconSize(QtCore.QSize(40, 40))NEWLINE self.pushbutton_result1_dna.setFont(font_resulttab)NEWLINE self.pushbutton_result1_dna.setStyleSheet("background-color: #704214")NEWLINE self.pushbutton_result1_dna.setGeometry(QtCore.QRect(215, 50, 255, 48))NEWLINENEWLINE self.pushbutton_result2_dna=QtWidgets.QPushButton(self.result_dna)NEWLINE self.pushbutton_result2_dna.setText(" Variants called")NEWLINE self.pushbutton_result2_dna.setIcon(QtGui.QIcon(os.path.join(module_dir,'./icons/document.svg')))NEWLINE self.pushbutton_result2_dna.setIconSize(QtCore.QSize(40, 40))NEWLINE self.pushbutton_result2_dna.setFont(font_resulttab)NEWLINE self.pushbutton_result2_dna.setStyleSheet("background-color: #704214")NEWLINE self.pushbutton_result2_dna.setGeometry(QtCore.QRect(215, 125, 255, 48))NEWLINENEWLINE self.pushbutton_result3_dna=QtWidgets.QPushButton(self.result_dna)NEWLINE self.pushbutton_result3_dna.setText("Annotated variants")NEWLINE self.pushbutton_result3_dna.setIcon(QtGui.QIcon(os.path.join(module_dir,'./icons/document.svg')))NEWLINE self.pushbutton_result3_dna.setIconSize(QtCore.QSize(40, 40))NEWLINE self.pushbutton_result3_dna.setFont(font_resulttab)NEWLINE self.pushbutton_result3_dna.setStyleSheet("background-color: #704214")NEWLINE self.pushbutton_result3_dna.setGeometry(QtCore.QRect(215, 200, 255, 48))NEWLINE NEWLINE self.proceedlabel = QtWidgets.QLabel(self.result_dna)NEWLINE self.proceedlabel.setGeometry(QtCore.QRect(150, 285, 281, 21))NEWLINE font = QtGui.QFont()NEWLINE font.setPointSize(12)NEWLINE# font.setItalic(True)NEWLINE self.proceedlabel.setFont(font)NEWLINE self.proceedlabel.setObjectName("proceedlabel")NEWLINE self.proceedlabel.setText("Proceed with cTaG or NBDriver?")NEWLINE self.pYesradioButton = QtWidgets.QRadioButton(self.result_dna)NEWLINE self.pYesradioButton.setGeometry(QtCore.QRect(450, 285, 117, 22))NEWLINE self.pYesradioButton.setObjectName("pYesradioButton")NEWLINE self.pYesradioButton.setFont(font)NEWLINE self.pYesradioButton.setText("Yes")NEWLINE# self.SamplesNoradioButton.setText(_translate("MainWindow", "Upload from Table"))NEWLINE# self.QCYesradioButton.setChecked(True)NEWLINE self.pNoradioButton = QtWidgets.QRadioButton(self.result_dna)NEWLINE self.pNoradioButton.setGeometry(QtCore.QRect(530, 285, 117, 22))NEWLINE self.pNoradioButton.setObjectName("pNoradioButton")NEWLINE self.pNoradioButton.setFont(font)NEWLINE self.pNoradioButton.setText("No")NEWLINE self.pNoradioButton.setChecked(True)NEWLINE NEWLINE self.ctagradioButton = QtWidgets.QCheckBox(self.result_dna)NEWLINE self.ctagradioButton.setFont(font)NEWLINE self.ctagradioButton.setGeometry(QtCore.QRect(250, 345, 117, 22))NEWLINE self.ctagradioButton.setText("cTaG")NEWLINE self.nbradioButton = QtWidgets.QCheckBox(self.result_dna)NEWLINE self.nbradioButton.setFont(font)NEWLINE self.nbradioButton.setGeometry(QtCore.QRect(350, 345, 117, 22))NEWLINE self.nbradioButton.setText("NBDriver")NEWLINE# self.nbradioButton.setChecked(True)NEWLINE font_next = QtGui.QFont()NEWLINE font_next.setPointSize(12)NEWLINE self.nextbuttonresult = QtWidgets.QPushButton(self.result_dna)NEWLINE self.nextbuttonresult.setGeometry(QtCore.QRect(635, 400, 45, 45))NEWLINE self.nextbuttonresult.setIcon(QtGui.QIcon(os.path.join(module_dir,'./icons/arrow.svg')))NEWLINE self.nextbuttonresult.setStyleSheet("background-color: #704214")NEWLINE# self.nextbuttonresult.setFont(font_next)NEWLINE# self.nextbuttonresult.setText("Generate MAF file")NEWLINE self.nextbuttonresult.setIconSize(QtCore.QSize(35, 35))NEWLINE NEWLINE self.nbinfoiconradio = QtWidgets.QPushButton(self.result_dna)NEWLINE self.nbinfoiconradio.setFlat(True)NEWLINE self.nbinfoiconradio.setGeometry(QtCore.QRect(450, 347, 20, 20))NEWLINE self.nbinfoiconradio.setToolTip("NBDriver predictions has been derived using hg19 reference genome only and \n the input vcf file must be kept inside /NBDriver_ICOMIC/vcf")NEWLINE self.nbinfoiconradio.setFont(font_info)NEWLINE self.nbinfoiconradio.setIcon(QtGui.QIcon(os.path.join(module_dir,'./icons/info.svg')))NEWLINE self.nbinfoiconradio.setIconSize(QtCore.QSize(13, 13)) NEWLINE NEWLINE self.ctagradioButton.setEnabled(False)NEWLINE self.nbradioButton.setEnabled(False)NEWLINE self.nextbuttonresult.setEnabled(False)NEWLINE self.nbinfoiconradio.setEnabled(False)NEWLINE NEWLINE NEWLINE ##End## NEWLINE NEWLINENEWLINE ## End ##NEWLINE self.PipelinetabWidget.addTab(self.DNAseq, "")NEWLINENEWLINE self.RNAseq = QtWidgets.QWidget()NEWLINE self.RNAseq.setObjectName("RNAseq")NEWLINE self.RNAtabWidget = QtWidgets.QTabWidget(self.RNAseq)NEWLINE self.RNAtabWidget.setGeometry(QtCore.QRect(0, 0, 695, 507))NEWLINE self.RNAtabWidget.setMovable(False)NEWLINE self.RNAtabWidget.setTabBarAutoHide(False)NEWLINE self.RNAtabWidget.setObjectName("RNAtabWidget")NEWLINE# self.RNAtabWidget.setStyleSheet("background-color: #F0F9EC")NEWLINE dnatab_img = os.path.join(module_dir,'dnatab.png')NEWLINE self.RNAtabWidget.setStyleSheet("background-image: url({});".format(dnatab_img))NEWLINE ## Make Input as first tab ##NEWLINE self.input_rna = QtWidgets.QWidget()NEWLINE self.input_rna.setObjectName("input_rna")NEWLINE self.SamplesYesradioButton_rna = QtWidgets.QRadioButton(self.input_rna)NEWLINE self.SamplesYesradioButton_rna.move(70, 30)NEWLINE self.SamplesYesradioButton_rna.setObjectName("SamplesYesradioButton_rna")NEWLINE self.SamplesYesradioButton_rna.setChecked(True)NEWLINE self.SamplesNoradioButton_rna = QtWidgets.QRadioButton(self.input_rna)NEWLINE self.SamplesNoradioButton_rna.move(70, 90)NEWLINE self.SamplesNoradioButton_rna.setObjectName("SamplesNoradioButton_rna")NEWLINE self.SampleOrlabel_rna = QtWidgets.QLabel(self.input_rna)NEWLINE self.SampleOrlabel_rna.move(130, 60)NEWLINE font = QtGui.QFont()NEWLINE font.setPointSize(12)NEWLINE font.setItalic(True)NEWLINE self.SampleOrlabel_rna.setFont(font)NEWLINE self.SampleOrlabel_rna.setObjectName("SampleOrlabel_rna")NEWLINENEWLINE self.SampleFolderlabel = QtWidgets.QLabel(self.input_rna)NEWLINE self.SampleFolderlabel.setGeometry(QtCore.QRect(20, 135, 113, 23))NEWLINE self.SampleFolderlabel.setObjectName("SampleFolderlabel")NEWLINE self.SampleFolderlabel.setEnabled(True)NEWLINE self.SampleFolderLineEdit = QtWidgets.QLineEdit(self.input_rna)NEWLINE self.SampleFolderLineEdit.setGeometry(QtCore.QRect(200, 135, 385, 23))NEWLINE self.SampleFolderLineEdit.setObjectName("SampleFolderLineEdit")NEWLINE self.SampleFolderLineEdit.setEnabled(True)NEWLINE self.SampleFolderBrowseButton = QtWidgets.QPushButton(self.input_rna)NEWLINE self.SampleFolderBrowseButton.setGeometry(QtCore.QRect(600, 135, 30, 25))NEWLINE self.SampleFolderBrowseButton.setObjectName("SampleFolderBrowseButton")NEWLINE self.SampleFolderBrowseButton.setEnabled(True)NEWLINE self.SampleFolderErrortextRNA = QtWidgets.QLabel(self.input_rna)NEWLINE self.SampleFolderErrortextRNA.setGeometry(QtCore.QRect(200, 165, 385, 15))NEWLINE self.SampleFolderErrortextRNA.setFont(font_label)NEWLINE self.SampleFolderErrortextRNA.setStyleSheet("color: red")NEWLINE self.Sampletablelabel = QtWidgets.QLabel(self.input_rna)NEWLINE self.Sampletablelabel.setGeometry(QtCore.QRect(20, 190, 113, 17))NEWLINE self.Sampletablelabel.setObjectName("Sampletablelabel")NEWLINE self.Sampletablelabel.setEnabled(False)NEWLINE self.SampletablelineEdit = QtWidgets.QLineEdit(self.input_rna)NEWLINE self.SampletablelineEdit.setGeometry(QtCore.QRect(200, 190, 385, 23))NEWLINE self.SampletablelineEdit.setObjectName("SampletablelineEdit")NEWLINE self.SampletablelineEdit.setEnabled(False)NEWLINE self.SampletableBrowseButton = QtWidgets.QPushButton(self.input_rna)NEWLINE self.SampletableBrowseButton.setGeometry(QtCore.QRect(600, 190, 30, 25))NEWLINE self.SampletableBrowseButton.setObjectName("SampletableBrowseButton")NEWLINE self.SampletableBrowseButton.setEnabled(False)NEWLINE self.SampletableErrortextRNA = QtWidgets.QLabel(self.input_rna)NEWLINE self.SampletableErrortextRNA.setGeometry(QtCore.QRect(200, 220, 385, 23))NEWLINE self.SampletableErrortextRNA.setFont(font_label)NEWLINE self.SampletableErrortextRNA.setStyleSheet("color: red")NEWLINE self.FastaFilelabel = QtWidgets.QLabel(self.input_rna)NEWLINE self.FastaFilelabel.setGeometry(QtCore.QRect(20, 240, 131, 17))NEWLINE self.FastaFilelabel.setObjectName("FastaFilelabel")NEWLINE self.FastalineEdit = QtWidgets.QLineEdit(self.input_rna)NEWLINE self.FastalineEdit.setGeometry(QtCore.QRect(200, 240, 385, 23))NEWLINE self.FastalineEdit.setObjectName("FastalineEdit")NEWLINE self.FastaBrowseButton = QtWidgets.QPushButton(self.input_rna)NEWLINE self.FastaBrowseButton.setGeometry(QtCore.QRect(600, 240, 30, 25))NEWLINE self.FastaBrowseButton.setObjectName("FastaBrowseButton")NEWLINE self.FastaErrortextRNA = QtWidgets.QLabel(self.input_rna)NEWLINE self.FastaErrortextRNA.setGeometry(QtCore.QRect(200, 265, 385, 23))NEWLINE self.FastaErrortextRNA.setFont(font_label)NEWLINE self.FastaErrortextRNA.setStyleSheet("color: red")NEWLINE self.AnnotatedFilelabelRNA = QtWidgets.QLabel(self.input_rna)NEWLINE self.AnnotatedFilelabelRNA.setGeometry(QtCore.QRect(20, 290, 171, 17))NEWLINE self.AnnotatedFilelabelRNA.setObjectName("AnnotatedFilelabelRNA")NEWLINE self.AnnotatedlineEditRNA = QtWidgets.QLineEdit(self.input_rna)NEWLINE self.AnnotatedlineEditRNA.setGeometry(QtCore.QRect(200, 290, 385, 23))NEWLINE self.AnnotatedlineEditRNA.setObjectName("AnnotatedlineEditRNA")NEWLINE self.AnnotatedBrowserButtonRNA = QtWidgets.QPushButton(self.input_rna)NEWLINE self.AnnotatedBrowserButtonRNA.setGeometry(QtCore.QRect(600, 290, 30, 25))NEWLINE self.AnnotatedBrowserButtonRNA.setObjectName("AnnotatedBrowserButtonRNA")NEWLINE self.AnnotatedErrortextRNA = QtWidgets.QLabel(self.input_rna)NEWLINE self.AnnotatedErrortextRNA.setGeometry(QtCore.QRect(200, 315, 385, 23))NEWLINE self.AnnotatedErrortextRNA.setFont(font_label)NEWLINE self.AnnotatedErrortextRNA.setStyleSheet("color: red")NEWLINENEWLINE self.CorelabelRNA = QtWidgets.QLabel(self.input_rna)NEWLINE self.CorelabelRNA.setGeometry(QtCore.QRect(20, 340, 157, 17))NEWLINE self.CorelabelRNA.setObjectName("CorelabelRNA")NEWLINE self.CorelineEditRNA = QtWidgets.QLineEdit(self.input_rna)NEWLINE self.CorelineEditRNA.setGeometry(QtCore.QRect(200, 340, 250, 23))NEWLINE self.CorelineEditRNA.setObjectName("CorelineEditRNA")NEWLINE self.CoreErrortextRNA = QtWidgets.QLabel(self.input_rna)NEWLINE self.CoreErrortextRNA.setGeometry(QtCore.QRect(200, 365, 250, 23))NEWLINE self.CoreErrortextRNA.setFont(font_label)NEWLINE self.CoreErrortextRNA.setStyleSheet("color: red")NEWLINE NEWLINE ###NEWLINENEWLINE ###NEWLINE NEWLINE font_label = QtGui.QFont()NEWLINE font_label.setPointSize(8.5)NEWLINENEWLINE NEWLINE NEWLINE NEWLINE self.nextbuttoninputRNA = QtWidgets.QPushButton(self.input_rna)NEWLINE self.nextbuttoninputRNA.setGeometry(QtCore.QRect(635, 400, 45, 45))NEWLINE self.nextbuttoninputRNA.setObjectName("nextbuttoninputRNA")NEWLINE NEWLINE #####info icon####NEWLINE ###rna###NEWLINE font_info = QtGui.QFont()NEWLINE font_info.setPointSize(8.5) NEWLINE NEWLINENEWLINE NEWLINE self.SampleFolderinfoicon_rna = QtWidgets.QPushButton(self.input_rna)NEWLINE self.SampleFolderinfoicon_rna.setFlat(True)NEWLINE self.SampleFolderinfoicon_rna.setGeometry(QtCore.QRect(120, 139, 20, 20))NEWLINE self.SampleFolderinfoicon_rna.setToolTip("Browse for the folder containing all the relevant sample files.\n The filenames for all the fastq input data are required to be in the following format.\n (sample_name)_(condition(tumor/normal))_Rep(replicate_number)_R(1 /2 {1 for read1 and 2 for read2}).fastq.\n Example:hcc1395_normal_Rep1_R1.fastq")NEWLINE self.SampleFolderinfoicon_rna.setFont(font_info)NEWLINE self.SampleFolderinfoicon_rna.setIcon(QtGui.QIcon(os.path.join(module_dir,'./icons/info.svg')))NEWLINE self.SampleFolderinfoicon_rna.setIconSize(QtCore.QSize(13, 13))NEWLINE NEWLINE self.Sampletableinfoicon_rna = QtWidgets.QPushButton(self.input_rna)NEWLINE self.Sampletableinfoicon_rna.setFlat(True)NEWLINE self.Sampletableinfoicon_rna.setGeometry(QtCore.QRect(116, 190, 20, 20))NEWLINE self.Sampletableinfoicon_rna.setToolTip("Browse for the tab separated text file containing the sample information. \n The table is required to be formatted as follows.\n The column names should take the order: Sample, Unit, Condition, fq1, fq2.\n (Sample- Sample name, Unit- Number of replications, \n Condition- normal/ tumor/ leave blank if the condition is not specified, \n fq1 - Path of Read 1,fq2 - Path of Read 2/ leave blank for single-end reads).\n An example table has been provided for your reference")NEWLINE self.Sampletableinfoicon_rna.setFont(font_info)NEWLINE self.Sampletableinfoicon_rna.setIcon(QtGui.QIcon(os.path.join(module_dir,'./icons/info.svg')))NEWLINE self.Sampletableinfoicon_rna.setIconSize(QtCore.QSize(13, 13))NEWLINE NEWLINE self.FastaFileinfoicon_rna = QtWidgets.QPushButton(self.input_rna)NEWLINE self.FastaFileinfoicon_rna.setFlat(True)NEWLINE self.FastaFileinfoicon_rna.setGeometry(QtCore.QRect(84, 240, 20, 20))NEWLINE self.FastaFileinfoicon_rna.setToolTip("A reference genome is a digital nucleic acid database \n assembled to be a representative example of a species’ set of genes.\n It allows for fast alignment of sequences as it is less computationally intensive \n to align sequences to a known sequence map rather than to assemble it piece by piece.\n For this field, specify the path to the pre-downloaded reference genome fastq file")NEWLINE self.FastaFileinfoicon_rna.setFont(font_info)NEWLINE self.FastaFileinfoicon_rna.setIcon(QtGui.QIcon(os.path.join(module_dir,'./icons/info.svg')))NEWLINE self.FastaFileinfoicon_rna.setIconSize(QtCore.QSize(13, 13)) NEWLINE NEWLINE self.AnnotatedFileinfoicon_rna = QtWidgets.QPushButton(self.input_rna)NEWLINE self.AnnotatedFileinfoicon_rna.setFlat(True)NEWLINE self.AnnotatedFileinfoicon_rna.setGeometry(QtCore.QRect(114, 290, 20, 20))NEWLINE self.AnnotatedFileinfoicon_rna.setToolTip("An annotation file is the gene transfer format (GTF) file containing the gene structure information")NEWLINE self.AnnotatedFileinfoicon_rna.setFont(font_info)NEWLINE self.AnnotatedFileinfoicon_rna.setIcon(QtGui.QIcon(os.path.join(module_dir,'./icons/info.svg')))NEWLINE self.AnnotatedFileinfoicon_rna.setIconSize(QtCore.QSize(13, 13)) NEWLINENEWLINENEWLINE NEWLINE self.SamplesYesradioinfoicon_rna = QtWidgets.QPushButton(self.input_rna)NEWLINE self.SamplesYesradioinfoicon_rna.setFlat(True)NEWLINE self.SamplesYesradioinfoicon_rna.setGeometry(QtCore.QRect(210, 32, 20, 20))NEWLINE self.SamplesYesradioinfoicon_rna.setToolTip("Specify the path to the folder containing all the relevant sample files.\n The filenames for all the fastq input data are required to be in the following format.\n (sample_name)_(condition(tumor/normal))_Rep(replicate_number)_R(1 /2 {1 for read1 and 2 for read2}).fastq. \nExample:hcc1395_normal_Rep1_R1.fastq")NEWLINE self.SamplesYesradioinfoicon_rna.setFont(font_info)NEWLINE self.SamplesYesradioinfoicon_rna.setIcon(QtGui.QIcon(os.path.join(module_dir,'./icons/info.svg')))NEWLINE self.SamplesYesradioinfoicon_rna.setIconSize(QtCore.QSize(13, 13)) NEWLINE NEWLINE NEWLINE self.SamplesNoradioinfoicon_rna = QtWidgets.QPushButton(self.input_rna)NEWLINE self.SamplesNoradioinfoicon_rna.setFlat(True)NEWLINE self.SamplesNoradioinfoicon_rna.setGeometry(QtCore.QRect(210, 90, 20, 20))NEWLINE self.SamplesNoradioinfoicon_rna.setToolTip("Specify the tab-delimited text file containing the sample information.\n The table is required to be formatted as follows.\n The column names should take the order: Sample, Unit, Condition, fq1, fq2. \n(Sample- Sample name, Unit- Number of replications, Condition- normal/ tumor/ leave blank if the condition is not specified,\n fq1 - Path of Read 1,fq2 - Path of Read 2/ leave blank for single-end reads).\n An example table has been provided for your reference")NEWLINE self.SamplesNoradioinfoicon_rna.setFont(font_info)NEWLINE self.SamplesNoradioinfoicon_rna.setIcon(QtGui.QIcon(os.path.join(module_dir,'./icons/info.svg')))NEWLINE self.SamplesNoradioinfoicon_rna.setIconSize(QtCore.QSize(13, 13))NEWLINE NEWLINE self.coreinfoicon_rna = QtWidgets.QPushButton(self.input_rna)NEWLINE self.coreinfoicon_rna.setFlat(True)NEWLINE self.coreinfoicon_rna.setGeometry(QtCore.QRect(140, 340, 20, 20))NEWLINE self.coreinfoicon_rna.setToolTip("Input the number of threads to run")NEWLINE self.coreinfoicon_rna.setFont(font_info)NEWLINE self.coreinfoicon_rna.setIcon(QtGui.QIcon(os.path.join(module_dir,'./icons/info.svg')))NEWLINE self.coreinfoicon_rna.setIconSize(QtCore.QSize(13, 13)) NEWLINE NEWLINE self.RNAtabWidget.addTab(self.input_rna, "")NEWLINE ## End ##NEWLINE NEWLINE ## Add QC ##NEWLINE self.QC_rna = QtWidgets.QWidget()NEWLINE self.QC_rna.setObjectName("QC_rna")NEWLINE ##QC_RNA Added##NEWLINE self.QCresults_rna = QtWidgets.QPushButton(self.QC_rna)NEWLINE self.QCresults_rna.setGeometry(QtCore.QRect(10, 30, 150, 23))NEWLINE self.QCresults_rna.setText("Quality Control Results")NEWLINE self.QCresults_rna.setStyleSheet("background-color: #704214")NEWLINE self.QCresultsButtonErroricon_rna = QtWidgets.QPushButton(self.QC_rna)NEWLINE self.QCresultsButtonErroricon_rna.setGeometry(QtCore.QRect(186, 32, 20, 20))NEWLINE self.QCresultsButtonErroricon_rna.setToolTip("Check and Run View Quality control Results Again!")NEWLINE self.QCresultsButtonErroricon_rna.setFont(font_label)NEWLINE self.QCresultsButtonErroricon_rna.setIcon(QtGui.QIcon(os.path.join(module_dir,'./icons/warning.svg')))NEWLINE self.QCresultsButtonErroricon_rna.hide()NEWLINE self.QClabel_rna = QtWidgets.QLabel(self.QC_rna)NEWLINE self.QClabel_rna.setGeometry(QtCore.QRect(10, 85, 151, 21))NEWLINE font = QtGui.QFont()NEWLINE font.setPointSize(12)NEWLINE font.setItalic(True)NEWLINE self.QClabel_rna.setFont(font)NEWLINE self.QClabel_rna.setObjectName("QClabel_rna")NEWLINE self.QCYesradioButton_rna = QtWidgets.QRadioButton(self.QC_rna)NEWLINE self.QCYesradioButton_rna.setGeometry(QtCore.QRect(170, 85, 117, 22))NEWLINE self.QCYesradioButton_rna.setObjectName("QCYesradioButton_rna")NEWLINE# self.QCYesradioButton_rna.setChecked(True)NEWLINE self.QCNoradioButton_rna = QtWidgets.QRadioButton(self.QC_rna)NEWLINE self.QCNoradioButton_rna.setGeometry(QtCore.QRect(250, 85, 117, 22))NEWLINE self.QCNoradioButton_rna.setObjectName("QCNoradioButton_rna")NEWLINE self.QCNoradioButton_rna.setChecked(True)NEWLINE self.InputParamslabel_rna = QtWidgets.QLabel(self.QC_rna)NEWLINE self.InputParamslabel_rna.setGeometry(QtCore.QRect(10, 140, 171, 17))NEWLINE self.InputParamslabel_rna.setEnabled(False)NEWLINE font = QtGui.QFont()NEWLINE font.setPointSize(12)NEWLINE font.setBold(True)NEWLINE font.setWeight(75)NEWLINE self.InputParamslabel_rna.setFont(font)NEWLINE self.InputParamslabel_rna.setObjectName("InputParamslabel_rna")NEWLINENEWLINE self.CutadaptlineEdit_rna = QtWidgets.QLineEdit(self.QC_rna)NEWLINE self.CutadaptlineEdit_rna.setGeometry(QtCore.QRect(120, 200, 481, 23))NEWLINE self.CutadaptlineEdit_rna.setObjectName("CutadaptlineEdit_rna")NEWLINE self.Cutadaptlabel_rna = QtWidgets.QLabel(self.QC_rna)NEWLINE self.Cutadaptlabel_rna.setGeometry(QtCore.QRect(10, 200, 67, 17))NEWLINE self.Cutadaptlabel_rna.setObjectName("Cutadaptlabel_rna")NEWLINE self.Cutadaptlabel_rna.setEnabled(False)NEWLINE self.CutadaptlineEdit_rna.setEnabled(False)NEWLINENEWLINE self.horizontalLayoutWidget_rna = QtWidgets.QWidget(self.QC_rna)NEWLINE self.horizontalLayoutWidget_rna.setGeometry(QtCore.QRect(235, 273, 240, 31))NEWLINE self.horizontalLayoutWidget_rna.setObjectName("horizontalLayoutWidget_rna")NEWLINE self.horizontalLayout_4_rna = QtWidgets.QHBoxLayout(self.horizontalLayoutWidget_rna)NEWLINE self.horizontalLayout_4_rna.setContentsMargins(0, 0, 0, 0)NEWLINE self.horizontalLayout_4_rna.setObjectName("horizontalLayout_4_rna")NEWLINENEWLINE self.RunQCpushButton_rna = QtWidgets.QPushButton(self.horizontalLayoutWidget_rna)NEWLINE self.RunQCpushButton_rna.setObjectName("RunQCpushButton_rna")NEWLINE self.RunQCpushButton_rna.setEnabled(False)NEWLINE self.horizontalLayout_4_rna.addWidget(self.RunQCpushButton_rna)NEWLINE self.RunQCButtonErroricon_rna = QtWidgets.QPushButton(self.QC_rna)NEWLINE self.RunQCButtonErroricon_rna.setGeometry(QtCore.QRect(500, 277, 20, 20))NEWLINE self.RunQCButtonErroricon_rna.setToolTip("Check and Run Trimming Again!")NEWLINE self.RunQCButtonErroricon_rna.setFont(font_label)NEWLINE self.RunQCButtonErroricon_rna.setIcon(QtGui.QIcon(os.path.join(module_dir,'./icons/warning.svg')))NEWLINENEWLINE self.RunQCButtonErroricon_rna.hide()NEWLINE ##QC_Progressbar##NEWLINE self.progressBar_sub1_rna = QtWidgets.QProgressBar(self.QC_rna)NEWLINE self.progressBar_sub1_rna.setGeometry(QtCore.QRect(10, 355, 665, 17))NEWLINE self.progressBar_sub1_rna.setProperty("value", 0)NEWLINE self.progressBar_sub1_rna.setObjectName("progressBar_sub1_rna")NEWLINE ###NEWLINE self.nextbuttonqcRNA = QtWidgets.QPushButton(self.QC_rna)NEWLINE self.nextbuttonqcRNA.setGeometry(QtCore.QRect(635, 400, 45, 45))NEWLINE self.nextbuttonqcRNA.setObjectName("nextbuttonqcRNA")NEWLINE# self.nextbuttonqcRNA.setEnabled(False)NEWLINE ###NEWLINE self.previousbuttonqcRNA = QtWidgets.QPushButton(self.QC_rna)NEWLINE self.previousbuttonqcRNA.setGeometry(QtCore.QRect(10, 400,45, 45))NEWLINE self.previousbuttonqcRNA.setObjectName("previousbuttonqcRNA")NEWLINE NEWLINE NEWLINE font_info = QtGui.QFont()NEWLINE font_info.setPointSize(8.5)NEWLINE NEWLINE self.QCresultsinfoicon_rna = QtWidgets.QPushButton(self.QC_rna)NEWLINE self.QCresultsinfoicon_rna.setFlat(True)NEWLINE self.QCresultsinfoicon_rna.setGeometry(QtCore.QRect(166, 33, 20, 20))NEWLINE self.QCresultsinfoicon_rna.setToolTip("Generates a MultiQC report consisting of statistical metrics\n aggregated from FastQC for each sample input file.\n If the results obtained are satisfactory, you may move onto the next tab.\n If not, proceed to trim the reads to improve the quality of your data")NEWLINE self.QCresultsinfoicon_rna.setFont(font_info)NEWLINE self.QCresultsinfoicon_rna.setIcon(QtGui.QIcon(os.path.join(module_dir,'./icons/info.svg')))NEWLINE self.QCresultsinfoicon_rna.setIconSize(QtCore.QSize(13, 13)) NEWLINE NEWLINE self.QClabelinfoicon_rna = QtWidgets.QPushButton(self.QC_rna)NEWLINE self.QClabelinfoicon_rna.setFlat(True)NEWLINE self.QClabelinfoicon_rna.setGeometry(QtCore.QRect(131, 87, 20, 20))NEWLINE self.QClabelinfoicon_rna.setToolTip("Selecting 'Yes' will remove the adapter sequences from your data thereby improving data quality.\n 'No' can be selected if you are satisfied with the data quality")NEWLINE self.QClabelinfoicon_rna.setFont(font_info)NEWLINE self.QClabelinfoicon_rna.setIcon(QtGui.QIcon(os.path.join(module_dir,'./icons/info.svg')))NEWLINE self.QClabelinfoicon_rna.setIconSize(QtCore.QSize(13, 13)) NEWLINE NEWLINE self.Cutadaptlabelinfoicon_rna = QtWidgets.QPushButton(self.QC_rna)NEWLINE self.Cutadaptlabelinfoicon_rna.setFlat(True)NEWLINE self.Cutadaptlabelinfoicon_rna.setGeometry(QtCore.QRect(70, 199, 20, 20))NEWLINE self.Cutadaptlabelinfoicon_rna.setToolTip("Please input the necessary parameters for the tool cutadapt.\n It may include the adapter sequences.\n Refer https://cutadapt.readthedocs.io/en/stable/guide.html#adapter-types for details")NEWLINE self.Cutadaptlabelinfoicon_rna.setFont(font_info)NEWLINE self.Cutadaptlabelinfoicon_rna.setIcon(QtGui.QIcon(os.path.join(module_dir,'./icons/info.svg')))NEWLINE self.Cutadaptlabelinfoicon_rna.setIconSize(QtCore.QSize(13, 13)) NEWLINE NEWLINE self.RunQCpushButtoninfoicon_rna = QtWidgets.QPushButton(self.QC_rna)NEWLINE self.RunQCpushButtoninfoicon_rna.setFlat(True)NEWLINE self.RunQCpushButtoninfoicon_rna.setGeometry(QtCore.QRect(480, 277, 20, 20))NEWLINE self.RunQCpushButtoninfoicon_rna.setToolTip("Please choose yes to trim your reads if the input sequences are of poor quality.\n You may proceed to the next section if your reads are good enough for alignment")NEWLINE self.RunQCpushButtoninfoicon_rna.setFont(font_info)NEWLINE self.RunQCpushButtoninfoicon_rna.setIcon(QtGui.QIcon(os.path.join(module_dir,'./icons/info.svg')))NEWLINE self.RunQCpushButtoninfoicon_rna.setIconSize(QtCore.QSize(13, 13)) NEWLINE NEWLINE self.RNAtabWidget.addTab(self.QC_rna, "")NEWLINE ## End ##NEWLINE self.Tool_rna = QtWidgets.QWidget()NEWLINE self.Tool_rna.setObjectName("Tool_rna")NEWLINE NEWLINE toolstab_img = os.path.join(module_dir,'toolstab.png')NEWLINE self.Tool_rna.setStyleSheet("background-image: url({});".format(toolstab_img))NEWLINE NEWLINE self.create_aligner_groupbox_rna()NEWLINE self.create_em_groupbox()NEWLINE self.create_de_groupbox()NEWLINE self.create_group_next_rna()NEWLINE self.nextbuttoninputRNANEWLINE self.layout_rna = QtWidgets.QHBoxLayout(self.Tool_rna)NEWLINE self.scrollArea_rna = QtWidgets.QScrollArea(self.Tool_rna)NEWLINE self.scrollArea_rna.setWidgetResizable(True)NEWLINE self.scrollAreaWidgetContents_rna = QtWidgets.QWidget()NEWLINE self.gridLayout_rna = QtWidgets.QGridLayout(self.scrollAreaWidgetContents_rna)NEWLINE self.scrollArea_rna.setWidget(self.scrollAreaWidgetContents_rna)NEWLINE self.layout_rna.addWidget(self.scrollArea_rna)NEWLINE NEWLINE self.grp_list_rna=[self.aligner_groupbox_rna, self.em_groupbox, self.de_groupbox, self.next_groupbox_rna]NEWLINE for i in range(4):NEWLINE self.gridLayout_rna.addWidget(self.grp_list_rna[i], i,0)NEWLINE NEWLINE self.RNAtabWidget.addTab(self.Tool_rna, "")NEWLINENEWLINE ## End ##NEWLINE NEWLINE ##Add Run##NEWLINE self.run_rna = QtWidgets.QWidget()NEWLINE self.run_rna.setObjectName("run_rna")NEWLINE NEWLINE self.RunButton = QtWidgets.QPushButton(self.run_rna)NEWLINE self.RunButton.setGeometry(QtCore.QRect(300, 140, 100, 100))NEWLINE self.RunButton.setObjectName("RunButton")NEWLINE self.RunLabel = QtWidgets.QLabel(self.run_rna)NEWLINE self.RunLabel.setGeometry(QtCore.QRect(330, 255, 180, 17))NEWLINE self.RunLabel.setObjectName("RunLabel")NEWLINE NEWLINE self.RunButtonErroricon = QtWidgets.QPushButton(self.run_rna)NEWLINE self.RunButtonErroricon.setGeometry(QtCore.QRect(420, 172, 30, 30))NEWLINE self.RunButtonErroricon.setToolTip("Click Run Button and Run Again!")NEWLINE self.RunButtonErroricon.setFont(font_label)NEWLINE self.RunButtonErroricon.setIcon(QtGui.QIcon(os.path.join(module_dir,'./icons/warning.svg')))NEWLINE self.RunButtonErroricon.hide() NEWLINE NEWLINE NEWLINE self.progressBar = QtWidgets.QProgressBar(self.run_rna)NEWLINE self.progressBar.setGeometry(QtCore.QRect(10, 340, 670, 23))NEWLINE self.progressBar.setProperty("value", 0)NEWLINE# self.progressBar.setMaximum(3)NEWLINE self.progressBar.setObjectName("progressBar") NEWLINE NEWLINE NEWLINE self.nextbuttonrunRNA = QtWidgets.QPushButton(self.run_rna)NEWLINE self.nextbuttonrunRNA.setGeometry(QtCore.QRect(635, 400, 45, 45))NEWLINE self.nextbuttonrunRNA.setObjectName("nextbuttonrunRNA")NEWLINE ###NEWLINE self.previousbuttonrunRNA = QtWidgets.QPushButton(self.run_rna)NEWLINE self.previousbuttonrunRNA.setGeometry(QtCore.QRect(10, 400,45, 45))NEWLINE self.previousbuttonrunRNA.setObjectName("previousbuttonrunRNA") NEWLINE NEWLINE NEWLINE font_info = QtGui.QFont()NEWLINE font_info.setPointSize(8.5)NEWLINE NEWLINE self.RunButtoninfoicon_rna = QtWidgets.QPushButton(self.run_rna)NEWLINE self.RunButtoninfoicon_rna.setFlat(True)NEWLINE self.RunButtoninfoicon_rna.setGeometry(QtCore.QRect(400, 180, 20, 20))NEWLINE self.RunButtoninfoicon_rna.setToolTip("Click to start your analysis")NEWLINE self.RunButtoninfoicon_rna.setFont(font_info)NEWLINE self.RunButtoninfoicon_rna.setIcon(QtGui.QIcon(os.path.join(module_dir,'./icons/info.svg')))NEWLINE self.RunButtoninfoicon_rna.setIconSize(QtCore.QSize(13, 13)) NEWLINE NEWLINENEWLINE NEWLINE self.RNAtabWidget.addTab(self.run_rna, "")NEWLINE ##End##NEWLINE ##Add Result RNA##NEWLINE self.result_rna = QtWidgets.QWidget()NEWLINE self.result_rna.setObjectName("result_rna")NEWLINE font_resulttab = QtGui.QFont()NEWLINE font_resulttab.setPointSize(16)NEWLINENEWLINE self.pushbutton_result1_rna=QtWidgets.QPushButton(self.result_rna)NEWLINE self.pushbutton_result1_rna.setText("Run statistics")NEWLINE self.pushbutton_result1_rna.setIcon(QtGui.QIcon(os.path.join(module_dir,'./icons/runstatistics.svg')))NEWLINE self.pushbutton_result1_rna.setIconSize(QtCore.QSize(40, 40))NEWLINE self.pushbutton_result1_rna.setFont(font_resulttab)NEWLINE self.pushbutton_result1_rna.setStyleSheet("background-color: #704214")NEWLINE self.pushbutton_result1_rna.setGeometry(QtCore.QRect(215, 145, 255, 48))NEWLINENEWLINE self.pushbutton_result2_rna=QtWidgets.QPushButton(self.result_rna)NEWLINE self.pushbutton_result2_rna.setText("DE Genes")NEWLINE self.pushbutton_result2_rna.setIcon(QtGui.QIcon(os.path.join(module_dir,'./icons/document.svg')))NEWLINE self.pushbutton_result2_rna.setIconSize(QtCore.QSize(40, 40))NEWLINE self.pushbutton_result2_rna.setFont(font_resulttab)NEWLINE self.pushbutton_result2_rna.setStyleSheet("background-color: #704214")NEWLINE self.pushbutton_result2_rna.setGeometry(QtCore.QRect(215, 245, 255, 48))NEWLINENEWLINE self.pushbutton_result3_rna=QtWidgets.QPushButton(self.result_rna)NEWLINE self.pushbutton_result3_rna.setText("Plots")NEWLINE self.pushbutton_result3_rna.setIcon(QtGui.QIcon(os.path.join(module_dir,'./icons/plots.svg')))NEWLINE self.pushbutton_result3_rna.setIconSize(QtCore.QSize(40, 40))NEWLINE self.pushbutton_result3_rna.setFont(font_resulttab)NEWLINE self.pushbutton_result3_rna.setStyleSheet("background-color: #704214")NEWLINE self.pushbutton_result3_rna.setGeometry(QtCore.QRect(215, 345, 255, 48))NEWLINE NEWLINE self.RNAtabWidget.addTab(self.result_rna, "")NEWLINE ##End## NEWLINE NEWLINE ## Add Create ##NEWLINENEWLINE ## End ##NEWLINE self.PipelinetabWidget.addTab(self.RNAseq, "")NEWLINE NEWLINE self.CTAG = QtWidgets.QWidget()NEWLINE self.CTAG.setObjectName("CTAG")NEWLINE self.CTAGtabWidget = QtWidgets.QTabWidget(self.CTAG)NEWLINE self.CTAGtabWidget.setGeometry(QtCore.QRect(0, 0, 695, 507))NEWLINE self.CTAGtabWidget.setMovable(False)NEWLINE self.CTAGtabWidget.setTabBarAutoHide(False)NEWLINE self.CTAGtabWidget.setObjectName("CTAGtabWidget")NEWLINE dnatab_img = os.path.join(module_dir,'dnatab.png')NEWLINE self.CTAGtabWidget.setStyleSheet("background-image: url({});".format(dnatab_img))NEWLINE self.ctaglabel = QtWidgets.QLabel(self.CTAG)NEWLINE self.ctaglabel.setGeometry(QtCore.QRect(15, 25, 400, 20))NEWLINE self.ctaglabel.setObjectName("ctaglabel")NEWLINE self.ctaglabel.setEnabled(True)NEWLINE NEWLINE self.ctaglabel2 = QtWidgets.QLabel(self.CTAG)NEWLINE self.ctaglabel2.setGeometry(QtCore.QRect(20, 35, 1000, 100))NEWLINE self.ctaglabel2.setObjectName("ctaglabel2")NEWLINE self.ctaglabel2.setEnabled(True)NEWLINE NEWLINE self.ctaglabel3 = QtWidgets.QLabel(self.CTAG)NEWLINE self.ctaglabel3.setGeometry(QtCore.QRect(65, 90, 400, 100))NEWLINE self.ctaglabel3.setObjectName("ctaglabel3")NEWLINE self.ctaglabel3.setEnabled(True)NEWLINE self.ctaglabel3.setOpenExternalLinks(True)NEWLINE# urlLink = "<a href="https://github.com/.RamanLab/NBDriver"> NBDriver</a>"NEWLINE self.ctaggithubbutton = QtWidgets.QPushButton(self.CTAG)NEWLINE self.ctaggithubbutton.setGeometry(QtCore.QRect(20, 130, 30, 25))NEWLINE self.ctaggithubbutton.setObjectName("ctaggithubbutton") NEWLINE NEWLINE self.maflineEdit = QtWidgets.QLineEdit(self.CTAG)NEWLINE self.maflineEdit.setGeometry(QtCore.QRect(160, 200, 450, 23))NEWLINE self.maflineEdit.setObjectName("maflineEdit")NEWLINE self.maflabel = QtWidgets.QLabel(self.CTAG)NEWLINE self.maflabel.setGeometry(QtCore.QRect(10, 200, 100, 17))NEWLINE self.maflabel.setObjectName("maflabel")NEWLINE self.maflabel.setEnabled(True)NEWLINE self.maflineEdit.setEnabled(True)NEWLINE self.mafBrowseButton = QtWidgets.QPushButton(self.CTAG)NEWLINE self.mafBrowseButton.setGeometry(QtCore.QRect(620, 200, 30, 25))NEWLINE self.mafBrowseButton.setObjectName("mafBrowseButton")NEWLINE NEWLINE self.mafparamlineEdit = QtWidgets.QLineEdit(self.CTAG)NEWLINE self.mafparamlineEdit.setGeometry(QtCore.QRect(200, 260, 155, 23))NEWLINE self.mafparamlineEdit.setObjectName("maflineEdit")NEWLINE self.mafparamlineEdit1 = QtWidgets.QLineEdit(self.CTAG)NEWLINE self.mafparamlineEdit1.setGeometry(QtCore.QRect(440, 260, 155, 23))NEWLINE self.mafparamlineEdit1.setObjectName("maflineEdit")NEWLINE self.mafparamlabel = QtWidgets.QLabel(self.CTAG)NEWLINE self.mafparamlabel.setGeometry(QtCore.QRect(10, 260, 100, 17))NEWLINE self.mafparamlabel.setObjectName("maflabel")NEWLINE self.mafparamlabel.setEnabled(True)NEWLINE self.mafparamlineEdit.setEnabled(True)NEWLINE self.mafparamlabel1 = QtWidgets.QLabel(self.CTAG)NEWLINE self.mafparamlabel1.setGeometry(QtCore.QRect(170, 260, 50, 17))NEWLINE self.mafparamlabel1.setObjectName("maflabel1")NEWLINE self.mafparamlabel2 = QtWidgets.QLabel(self.CTAG)NEWLINE self.mafparamlabel2.setGeometry(QtCore.QRect(410, 260, 50, 17))NEWLINE self.mafparamlabel2.setObjectName("maflabel2")NEWLINE self.runctagpushButton = QtWidgets.QPushButton(self.CTAG)NEWLINE self.runctagpushButton.setGeometry(QtCore.QRect(270, 350, 200, 30))NEWLINE self.runctagpushButton.setObjectName("runctagpushButton")NEWLINE NEWLINE self.resultctagpushButton = QtWidgets.QPushButton(self.CTAG)NEWLINE self.resultctagpushButton.setGeometry(QtCore.QRect(290, 410, 150, 50))NEWLINE self.resultctagpushButton.setObjectName("resultctagpushButton")NEWLINE NEWLINE self.ctaginfoiconmaf = QtWidgets.QPushButton(self.CTAG)NEWLINE self.ctaginfoiconmaf.setFlat(True)NEWLINE self.ctaginfoiconmaf.setGeometry(QtCore.QRect(109, 200, 20, 20))NEWLINE self.ctaginfoiconmaf.setToolTip("path to the maf file")NEWLINE self.ctaginfoiconmaf.setFont(font_info)NEWLINE self.ctaginfoiconmaf.setIcon(QtGui.QIcon(os.path.join(module_dir,'./icons/info.svg')))NEWLINE self.ctaginfoiconmaf.setIconSize(QtCore.QSize(13, 13)) NEWLINE NEWLINE self.ctaginfoiconparam = QtWidgets.QPushButton(self.CTAG)NEWLINE self.ctaginfoiconparam.setFlat(True)NEWLINE self.ctaginfoiconparam.setGeometry(QtCore.QRect(90, 260, 20, 20))NEWLINE self.ctaginfoiconparam.setToolTip("enter the parameters --maxmut and --percentile")NEWLINE self.ctaginfoiconparam.setFont(font_info)NEWLINE self.ctaginfoiconparam.setIcon(QtGui.QIcon(os.path.join(module_dir,'./icons/info.svg')))NEWLINE self.ctaginfoiconparam.setIconSize(QtCore.QSize(13, 13)) NEWLINE NEWLINE self.ctaginfoiconrun = QtWidgets.QPushButton(self.CTAG)NEWLINE self.ctaginfoiconrun.setFlat(True)NEWLINE self.ctaginfoiconrun.setGeometry(QtCore.QRect(472, 355, 20, 20))NEWLINE self.ctaginfoiconrun.setToolTip("Click Run to run the analysis")NEWLINE self.ctaginfoiconrun.setFont(font_info)NEWLINE self.ctaginfoiconrun.setIcon(QtGui.QIcon(os.path.join(module_dir,'./icons/info.svg')))NEWLINE self.ctaginfoiconrun.setIconSize(QtCore.QSize(13, 13)) NEWLINE NEWLINE self.ctaginfoiconres = QtWidgets.QPushButton(self.CTAG)NEWLINE self.ctaginfoiconres.setFlat(True)NEWLINE self.ctaginfoiconres.setGeometry(QtCore.QRect(447, 423, 20, 20))NEWLINE self.ctaginfoiconres.setToolTip("Click View Results to open the results")NEWLINE self.ctaginfoiconres.setFont(font_info)NEWLINE self.ctaginfoiconres.setIcon(QtGui.QIcon(os.path.join(module_dir,'./icons/info.svg')))NEWLINE self.ctaginfoiconres.setIconSize(QtCore.QSize(13, 13))NEWLINE NEWLINE self.PipelinetabWidget.addTab(self.CTAG, "")NEWLINE NEWLINE self.NB = QtWidgets.QWidget()NEWLINE self.NB.setObjectName("NV")NEWLINE self.NBtabWidget = QtWidgets.QTabWidget(self.NB)NEWLINE self.NBtabWidget.setGeometry(QtCore.QRect(0, 0, 695, 507))NEWLINE self.NBtabWidget.setMovable(False)NEWLINE self.NBtabWidget.setTabBarAutoHide(False)NEWLINE self.NBtabWidget.setObjectName("NBtabWidget")NEWLINE dnatab_img = os.path.join(module_dir,'dnatab.png')NEWLINE self.NBtabWidget.setStyleSheet("background-image: url({});".format(dnatab_img))NEWLINE NEWLINE self.nblabel = QtWidgets.QLabel(self.NB)NEWLINE self.nblabel.setGeometry(QtCore.QRect(15, 25, 400, 20))NEWLINE self.nblabel.setObjectName("nblabel")NEWLINE self.nblabel.setEnabled(True)NEWLINE NEWLINE self.nblabel2 = QtWidgets.QLabel(self.NB)NEWLINE self.nblabel2.setGeometry(QtCore.QRect(20, 35, 1000, 100))NEWLINE self.nblabel2.setObjectName("nblabel2")NEWLINE self.nblabel2.setEnabled(True)NEWLINE NEWLINE self.nblabel3 = QtWidgets.QLabel(self.NB)NEWLINE self.nblabel3.setGeometry(QtCore.QRect(65, 90, 400, 100))NEWLINE self.nblabel3.setObjectName("nblabel3")NEWLINE self.nblabel3.setEnabled(True)NEWLINE self.nblabel3.setOpenExternalLinks(True)NEWLINE# urlLink = "<a href="https://github.com/.RamanLab/NBDriver"> NBDriver</a>"NEWLINE self.nbgithubbutton = QtWidgets.QPushButton(self.NB)NEWLINE self.nbgithubbutton.setGeometry(QtCore.QRect(20, 130, 30, 25))NEWLINE self.nbgithubbutton.setObjectName("nbgithubbutton")NEWLINE self.nbpaperbutton = QtWidgets.QPushButton(self.NB)NEWLINE self.nbpaperbutton.setGeometry(QtCore.QRect(140, 130, 30, 25))NEWLINE self.nbpaperbutton.setObjectName("nbpaperbutton")NEWLINE NEWLINE self.nblabel5 = QtWidgets.QLabel(self.NB)NEWLINE self.nblabel5.setGeometry(QtCore.QRect(185, 90, 400, 100))NEWLINE self.nblabel5.setObjectName("nblabel5")NEWLINE self.nblabel5.setEnabled(True)NEWLINE self.nblabel5.setOpenExternalLinks(True)NEWLINE self.nblabel4 = QtWidgets.QLabel(self.NB)NEWLINE self.nblabel4.setGeometry(QtCore.QRect(10, 160, 1000, 100))NEWLINE self.nblabel4.setObjectName("nblabel4") NEWLINE self.nblabel6 = QtWidgets.QLabel(self.NB)NEWLINE self.nblabel6.setGeometry(QtCore.QRect(151, 161, 100, 100))NEWLINE self.nblabel6.setObjectName("nblabel6")NEWLINE self.nblabel6.setEnabled(True)NEWLINE self.nblabel6.setOpenExternalLinks(True)NEWLINE NEWLINE self.vcflineEdit = QtWidgets.QLineEdit(self.NB)NEWLINE self.vcflineEdit.setGeometry(QtCore.QRect(160, 250, 450, 23))NEWLINE self.vcflineEdit.setObjectName("vcflineEdit")NEWLINE self.vcflabel = QtWidgets.QLabel(self.NB)NEWLINE self.vcflabel.setGeometry(QtCore.QRect(10, 250, 100, 17))NEWLINE self.vcflabel.setObjectName("vcflabel")NEWLINE self.vcflabel.setEnabled(True)NEWLINE self.vcflineEdit.setEnabled(True)NEWLINE self.vcfBrowseButton = QtWidgets.QPushButton(self.NB)NEWLINE self.vcfBrowseButton.setGeometry(QtCore.QRect(620, 250, 30, 25))NEWLINE self.vcfBrowseButton.setObjectName("vcfBrowseButton")NEWLINE self.runnbpushButton = QtWidgets.QPushButton(self.NB)NEWLINE self.runnbpushButton.setGeometry(QtCore.QRect(270, 350, 200, 30))NEWLINE self.runnbpushButton.setObjectName("runnbpushButton")NEWLINE NEWLINE self.resultnbpushButton = QtWidgets.QPushButton(self.NB)NEWLINE self.resultnbpushButton.setGeometry(QtCore.QRect(290, 410, 150, 50))NEWLINE self.resultnbpushButton.setObjectName("resultnbpushButton")NEWLINE NEWLINE self.nbinfoiconvcf = QtWidgets.QPushButton(self.NB)NEWLINE self.nbinfoiconvcf.setFlat(True)NEWLINE self.nbinfoiconvcf.setGeometry(QtCore.QRect(109, 250, 20, 20))NEWLINE self.nbinfoiconvcf.setToolTip("path to the vcf file")NEWLINE self.nbinfoiconvcf.setFont(font_info)NEWLINE self.nbinfoiconvcf.setIcon(QtGui.QIcon(os.path.join(module_dir,'./icons/info.svg')))NEWLINE self.nbinfoiconvcf.setIconSize(QtCore.QSize(13, 13)) NEWLINE NEWLINE self.nbinfoiconrun = QtWidgets.QPushButton(self.NB)NEWLINE self.nbinfoiconrun.setFlat(True)NEWLINE self.nbinfoiconrun.setGeometry(QtCore.QRect(472, 355, 20, 20))NEWLINE self.nbinfoiconrun.setToolTip("Click Run to run the analysis")NEWLINE self.nbinfoiconrun.setFont(font_info)NEWLINE self.nbinfoiconrun.setIcon(QtGui.QIcon(os.path.join(module_dir,'./icons/info.svg')))NEWLINE self.nbinfoiconrun.setIconSize(QtCore.QSize(13, 13)) NEWLINE NEWLINE self.nbinfoiconres = QtWidgets.QPushButton(self.NB)NEWLINE self.nbinfoiconres.setFlat(True)NEWLINE self.nbinfoiconres.setGeometry(QtCore.QRect(447, 423, 20, 20))NEWLINE self.nbinfoiconres.setToolTip("Click View Results to open the results")NEWLINE self.nbinfoiconres.setFont(font_info)NEWLINE self.nbinfoiconres.setIcon(QtGui.QIcon(os.path.join(module_dir,'./icons/info.svg')))NEWLINE self.nbinfoiconres.setIconSize(QtCore.QSize(13, 13))NEWLINE NEWLINE self.PipelinetabWidget.addTab(self.NB, "")NEWLINENEWLINENEWLINE NEWLINE self.ShellTab = QtWidgets.QTabWidget(self.centralwidget)NEWLINE self.ShellTab.setGeometry(QtCore.QRect(10, 550, 701, 151))NEWLINE self.ShellTab.setObjectName("ShellTab")NEWLINE# self.ShellTab.setStyleSheet("background-color: #F0F9EC")NEWLINE shell_img = os.path.join(module_dir,'shell1.png')NEWLINE self.ShellTab.setStyleSheet("background-image: url({});".format(shell_img)) NEWLINE NEWLINE self.SnakemakeOutputTab = QtWidgets.QWidget()NEWLINE self.SnakemakeOutputTab.setObjectName("SnakemakeOutputTab")NEWLINE self.textBrowser = QtWidgets.QTextBrowser(self.SnakemakeOutputTab)NEWLINE self.textBrowser.setGeometry(QtCore.QRect(0, 0, 695, 118))NEWLINE self.textBrowser.setObjectName("textBrowser")NEWLINE self.textBrowser.setReadOnly(True)NEWLINENEWLINE self.ShellTab.addTab(self.SnakemakeOutputTab, "")NEWLINE NEWLINE self.PipelinetabWidget.addTab(self.NB, "")NEWLINENEWLINENEWLINE# self.layoutWidget.raise_()NEWLINE self.PipelinetabWidget.raise_()NEWLINE self.progressBar_sub1_dna.raise_()NEWLINE self.progressBar_sub2_dna.raise_()NEWLINE# self.progressBar_sub3.raise_()NEWLINE# self.progressBar.raise_()NEWLINE self.ShellTab.raise_()NEWLINE self.RefVariantpushButton.raise_()NEWLINE self.UnitsBrowseButtonDNA.raise_()NEWLINE self.SampleslineEditDNA.raise_()NEWLINE self.RefGenomeBrowseButtonDNA.raise_()NEWLINE self.SampleFilelabelDNA.raise_()NEWLINE self.UnitsFilelabelDNA.raise_()NEWLINE self.RefVariantlabelDNA.raise_()NEWLINE# self.RefNamelineEdit.raise_()NEWLINE self.RefGenomelineEditDNA.raise_()NEWLINE self.RefGenomelabelDNA.raise_()NEWLINE self.RefNamelabelDNA.raise_()NEWLINE self.SamplesBrowseButtonDNA.raise_()NEWLINE self.UnitslineEditDNA.raise_()NEWLINE self.RefNamecomboBoxDNA.raise_()NEWLINE self.RefVariantpushButton.raise_()NEWLINE self.RefVariantlineEditDNA.raise_()NEWLINE self.UnitsBrowseButtonDNA.raise_()NEWLINE self.SampleslineEditDNA.raise_()NEWLINE self.RefGenomeBrowseButtonDNA.raise_()NEWLINE self.SampleFilelabelDNA.raise_()NEWLINE self.UnitsFilelabelDNA.raise_()NEWLINE self.RefVariantlabelDNA.raise_()NEWLINE self.RefGenomelineEditDNA.raise_()NEWLINE self.RefGenomelabelDNA.raise_()NEWLINE self.RefNamelabelDNA.raise_()NEWLINE self.SamplesBrowseButtonDNA.raise_()NEWLINE self.UnitslineEditDNA.raise_()NEWLINE MainWindow.setCentralWidget(self.centralwidget)NEWLINE self.statusbar = QtWidgets.QStatusBar(MainWindow)NEWLINE self.statusbar.setObjectName("statusbar")NEWLINE MainWindow.setStatusBar(self.statusbar)NEWLINE self.menubar = QtWidgets.QMenuBar(MainWindow)NEWLINE self.menubar.setGeometry(QtCore.QRect(0, 0, 619, 25))NEWLINE self.menubar.setObjectName("menubar")NEWLINE self.menuFile = QtWidgets.QMenu(self.menubar)NEWLINE self.menuFile.setObjectName("menuFile")NEWLINE self.menuOption = QtWidgets.QMenu(self.menubar)NEWLINE self.menuOption.setObjectName("menuOption")NEWLINE self.menuHelp = QtWidgets.QMenu(self.menubar)NEWLINE self.menuHelp.setObjectName("menuHelp")NEWLINE MainWindow.setMenuBar(self.menubar)NEWLINE self.actionQuit = QtWidgets.QAction(MainWindow)NEWLINE self.actionQuit.setObjectName("actionQuit")NEWLINE self.actionAbout = QtWidgets.QAction(MainWindow)NEWLINE self.actionAbout.setObjectName("actionAbout")NEWLINE self.actionQuick_Start = QtWidgets.QAction(MainWindow)NEWLINE self.actionQuick_Start.setObjectName("actionQuick_Start")NEWLINE self.actionAbout_2 = QtWidgets.QAction(MainWindow)NEWLINE self.actionAbout_2.setObjectName("actionAbout_2")NEWLINE self.actionSnakemake_Options = QtWidgets.QAction(MainWindow)NEWLINE self.actionSnakemake_Options.setObjectName("actionSnakemake_Options")NEWLINE self.menuFile.addAction(self.actionQuit)NEWLINE self.menuOption.addAction(self.actionSnakemake_Options)NEWLINE self.menuHelp.addAction(self.actionQuick_Start)NEWLINE self.menuHelp.addAction(self.actionAbout_2)NEWLINE self.menubar.addAction(self.menuFile.menuAction())NEWLINE self.menubar.addAction(self.menuOption.menuAction())NEWLINE self.menubar.addAction(self.menuHelp.menuAction())NEWLINENEWLINE self.retranslateUi(MainWindow)NEWLINE self.PipelinetabWidget.setCurrentIndex(0)NEWLINE self.DNAtabWidget.setCurrentIndex(0)NEWLINE self.RNAtabWidget.setCurrentIndex(0)NEWLINE self.ShellTab.setCurrentIndex(0)NEWLINE self.actionQuit.triggered.connect(MainWindow.close)NEWLINE# QtCore.Qt.WindowMaximizeButton.hide()NEWLINE NEWLINE QtCore.QMetaObject.connectSlotsByName(MainWindow)NEWLINE self._colors = {NEWLINE 'green': QtGui.QColor(0,170,0),NEWLINE 'red': QtGui.QColor(170,0,0),NEWLINE 'orange': QtGui.QColor(170,150,0),NEWLINE 'blue': QtGui.QColor(0,90,154),NEWLINE 'black': QtGui.QColor(0,0,0),NEWLINE }NEWLINE NEWLINE ####set all tabs disabled###NEWLINE# =============================================================================NEWLINE self.DNAtabWidget.setTabEnabled(1, False)NEWLINE self.DNAtabWidget.setTabEnabled(2, False)NEWLINE self.DNAtabWidget.setTabEnabled(3, False)NEWLINE self.DNAtabWidget.setTabEnabled(4, False)NEWLINE self.DNAtabWidget.setTabEnabled(5, False)NEWLINE NEWLINE self.RNAtabWidget.setTabEnabled(1, False)NEWLINE self.RNAtabWidget.setTabEnabled(2, False)NEWLINE self.RNAtabWidget.setTabEnabled(3, False)NEWLINE self.RNAtabWidget.setTabEnabled(4, False)NEWLINE self.RNAtabWidget.setTabEnabled(5, False)NEWLINE# =============================================================================NEWLINENEWLINE NEWLINENEWLINE############NEWLINENEWLINENEWLINE############NEWLINE def retranslateUi(self, MainWindow):NEWLINE _translate = QtCore.QCoreApplication.translateNEWLINE MainWindow.setWindowTitle(_translate("MainWindow", "iCOMIC"))NEWLINE MainWindow.setWindowIcon(QtGui.QIcon(os.path.join(module_dir,'./icons/taskbar1.png')))NEWLINE #self.PipelinetabWidget.setToolTip(_translate("MainWindow", "Performs Quality Control and Creates Mandatory files to run the pipeline"))NEWLINE ## Add Input as first tab ##NEWLINE# self.SampleOrlabel.setToolTip(_translate("MainWindow", "This option performs all the Quality Control operations like fastQC, Cutadapt and MultiQC "))NEWLINE self.SampleOrlabel.setText(_translate("MainWindow", "Or"))NEWLINE# self.SamplesYesradioButton.setToolTip(_translate("MainWindow", "Files should be in specified format"))NEWLINE self.SamplesYesradioButton.setText(_translate("MainWindow", "Upload from Folder"))NEWLINE# self.SamplesNoradioButton.setToolTip(_translate("MainWindow", "Tables should contain all the information"))NEWLINE self.SamplesNoradioButton.setText(_translate("MainWindow", "Upload from Table"))NEWLINE# self.UnitsBrowseButtonDNA.setText(_translate("MainWindow", "Browse"))NEWLINE self.UnitsBrowseButtonDNA.setIcon(QtGui.QIcon(os.path.join(module_dir,'./icons/browse.png')))NEWLINE self.UnitsBrowseButtonDNA.setIconSize(QtCore.QSize(22, 22))NEWLINE self.UnitsBrowseButtonDNA.setToolTip("Browse Samples Table")NEWLINE# self.RefGenomeBrowseButtonDNA.setText(_translate("MainWindow", "Browse"))NEWLINE self.RefGenomeBrowseButtonDNA.setIcon(QtGui.QIcon(os.path.join(module_dir,'./icons/browse.png')))NEWLINE# self.RefGenomeBrowseButtonDNA.setStyleSheet("background-color: #aeaeae")NEWLINE self.RefGenomeBrowseButtonDNA.setToolTip("Browse Reference Genome")NEWLINE self.RefGenomeBrowseButtonDNA.setIconSize(QtCore.QSize(22, 22))NEWLINE self.UnitsFilelabelDNA.setText(_translate("MainWindow", "Samples Table"))NEWLINE self.RefGenomelabelDNA.setText(_translate("MainWindow", "Reference Genome"))NEWLINE self.SampleFilelabelDNA.setText(_translate("MainWindow", "Samples Folder"))NEWLINE self.CorelabelDNA.setText(_translate("MainWindow", "Maximum threads"))NEWLINE self.CorelineEditDNA.setText(_translate("MainWindow", "1"))NEWLINE# self.SamplesBrowseButtonDNA.setText(_translate("MainWindow", "Browse"))NEWLINE self.SamplesBrowseButtonDNA.setIcon(QtGui.QIcon(os.path.join(module_dir,'./icons/browse.png')))NEWLINE self.SamplesBrowseButtonDNA.setIconSize(QtCore.QSize(22, 22))NEWLINE# self.SamplesBrowseButtonDNA.setStyleSheet("background-color: #aeaeae")NEWLINE self.SamplesBrowseButtonDNA.setToolTip("Browse Samples Folder")NEWLINE self.RefVariantlabelDNA.setText(_translate("MainWindow", "Reference Known Variant"))NEWLINE# self.RefVariantpushButton.setText(_translate("MainWindow", "Browse"))NEWLINE self.RefVariantpushButton.setIcon(QtGui.QIcon(os.path.join(module_dir,'./icons/browse.png')))NEWLINE# self.RefVariantpushButton.setStyleSheet("background-color: #aeaeae")NEWLINE self.RefVariantpushButton.setToolTip("Browse Reference Known Variant")NEWLINE self.RefVariantpushButton.setIconSize(QtCore.QSize(22, 22))NEWLINE self.RefNamelabelDNA.setText(_translate("MainWindow", "Reference Name (as in SnpEff Database)"))NEWLINENEWLINE self.nextbuttoninputDNA.setIcon(QtGui.QIcon(os.path.join(module_dir,'./icons/arrow.svg')))NEWLINE self.nextbuttoninputDNA.setIconSize(QtCore.QSize(35, 35))NEWLINE self.nextbuttoninputDNA.setStyleSheet("background-color: #704214")NEWLINE self.DNAtabWidget.setTabText(self.DNAtabWidget.indexOf(self.input_dna), _translate("MainWindow", " Input Data "))NEWLINE self.DNAtabWidget.setTabIcon(self.DNAtabWidget.indexOf(self.input_dna), QtGui.QIcon(os.path.join(module_dir,'./icons/input.svg')))NEWLINE# self.DNAtabWidget.setStyleSheet(self.DNAtabWidget.indexOf(self.input_dna), ("background-color: #EBF6F5"))NEWLINE self.DNAtabWidget.setIconSize(QtCore.QSize(22, 22))NEWLINE NEWLINE ## End ###NEWLINE NEWLINE ##Label progres bar##NEWLINENEWLINE NEWLINE ## Add QC ##NEWLINE self.QClabel.setToolTip(_translate("MainWindow", "This option performs all the Quality Control operations like fastQC, Cutadapt and MultiQC "))NEWLINE self.QClabel.setText(_translate("MainWindow", "Trim the reads"))NEWLINE self.QCYesradioButton.setToolTip(_translate("MainWindow", "Enables Quality Control Processing"))NEWLINE self.QCYesradioButton.setText(_translate("MainWindow", "Yes"))NEWLINE self.QCNoradioButton.setToolTip(_translate("MainWindow", "Disables Quality Control Processing"))NEWLINE self.QCNoradioButton.setText(_translate("MainWindow", "No"))NEWLINE self.InputParamslabel.setText(_translate("MainWindow", "Input Parameters:"))NEWLINENEWLINE self.Cutadaptlabel.setText(_translate("MainWindow", "Cutadapt"))NEWLINE self.CutadaptlineEdit.setText(_translate("MainWindow", "-q 20"))NEWLINENEWLINE self.RunQCpushButton.setText(_translate("MainWindow", "Trimming"))NEWLINE self.RunQCpushButton.setIcon(QtGui.QIcon(os.path.join(module_dir,'./icons/run1.svg')))NEWLINE self.RunQCpushButton.setIconSize(QtCore.QSize(22, 22))NEWLINE self.RunQCpushButton.setStyleSheet("background-color: #704214")NEWLINE self.nextbuttonqcDNA.setIcon(QtGui.QIcon(os.path.join(module_dir,'./icons/arrow.svg')))NEWLINE self.nextbuttonqcDNA.setStyleSheet("background-color: #704214")NEWLINE self.nextbuttonqcDNA.setIconSize(QtCore.QSize(35, 35))NEWLINE self.previousbuttonqcDNA.setIcon(QtGui.QIcon(os.path.join(module_dir,'./icons/arrow1.svg')))NEWLINE self.previousbuttonqcDNA.setStyleSheet("background-color: #704214")NEWLINE self.previousbuttonqcDNA.setIconSize(QtCore.QSize(35, 35))NEWLINE self.DNAtabWidget.setTabText(self.DNAtabWidget.indexOf(self.QC_dna), _translate("MainWindow", " Quality Control "))NEWLINE self.DNAtabWidget.setTabIcon(self.DNAtabWidget.indexOf(self.QC_dna), QtGui.QIcon(os.path.join(module_dir,'./icons/qc.svg')))NEWLINE NEWLINE NEWLINE ## End ##NEWLINENEWLINE self.AlignercomboBoxDNA.setItemText(0, _translate("MainWindow", "BWA_MEM"))NEWLINE self.AlignercomboBoxDNA.setItemText(1, _translate("MainWindow", "GEM3"))NEWLINE self.AlignercomboBoxDNA.setItemText(2, _translate("MainWindow", "Bowtie2"))NEWLINE# NEWLINE self.AnnotatorcomboBoxDNA.setItemText(0, _translate("MainWindow", "SnpEff"))NEWLINE self.AnnotatorcomboBoxDNA.setItemText(1, _translate("MainWindow", "Annovar"))NEWLINENEWLINE self.nextbuttontoolDNA.setIcon(QtGui.QIcon(os.path.join(module_dir,'./icons/arrow.svg')))NEWLINE self.nextbuttontoolDNA.setStyleSheet("background-color: #704214")NEWLINE self.nextbuttontoolDNA.setIconSize(QtCore.QSize(35, 35))NEWLINE self.previousbuttontoolDNA.setIcon(QtGui.QIcon(os.path.join(module_dir,'./icons/arrow1.svg')))NEWLINE self.previousbuttontoolDNA.setStyleSheet("background-color: #704214")NEWLINE self.previousbuttontoolDNA.setIconSize(QtCore.QSize(35, 35))NEWLINE self.DNAtabWidget.setTabText(self.DNAtabWidget.indexOf(self.Tool_dna), _translate("MainWindow", " Tools Selection "))NEWLINE toolstab_img = os.path.join(module_dir,'toolstab.png')NEWLINE self.Tool_dna.setStyleSheet("background-image: url({});".format(toolstab_img))NEWLINE self.DNAtabWidget.setTabIcon(self.DNAtabWidget.indexOf(self.Tool_dna), QtGui.QIcon(os.path.join(module_dir,'./icons/tools.svg')))NEWLINE NEWLINE ## Add Index ##NEWLINENEWLINE self.BWAIndexlineEdit.setToolTip(_translate("MainWindow", "Input the path of the Index for " + self.AlignercomboBoxDNA.currentText()))NEWLINE self.BWAIndexpushButton.setToolTip(_translate("MainWindow", "Click this to select one of the already available index or for a custom index"))NEWLINE self.BWAIndexpushButton.setIcon(QtGui.QIcon(os.path.join(module_dir,'./icons/browse.png')))NEWLINE self.BWAIndexpushButton.setIconSize(QtCore.QSize(22, 22))NEWLINE self.BWAIndexpushButton.setToolTip("Browse Index File")NEWLINE self.OrLabel_dna.setText(_translate("MainWindow", "Or"))NEWLINENEWLINE self.RunIndexdnapushButton.setText(_translate("MainWindow", "Generate Index"))NEWLINE self.RunIndexdnapushButton.setIcon(QtGui.QIcon(os.path.join(module_dir,'./icons/run1.svg')))NEWLINE self.RunIndexdnapushButton.setStyleSheet("background-color: #704214")NEWLINE self.RunIndexdnapushButton.setIconSize(QtCore.QSize (22, 22))NEWLINE NEWLINE NEWLINENEWLINE NEWLINE ## Add run DNA##NEWLINE self.DNAtabWidget.setTabText(self.DNAtabWidget.indexOf(self.run_dna), _translate("MainWindow", " Run "))NEWLINE NEWLINE self.DNAtabWidget.setTabIcon(self.DNAtabWidget.indexOf(self.run_dna), QtGui.QIcon(os.path.join(module_dir,'./icons/run1.svg')))NEWLINE self.DNAtabWidget.setIconSize(QtCore.QSize(22, 22))NEWLINE NEWLINE self.nextbuttonrunDNA.setIcon(QtGui.QIcon(os.path.join(module_dir,'./icons/arrow.svg')))NEWLINE self.nextbuttonrunDNA.setStyleSheet("background-color: #704214")NEWLINE self.nextbuttonrunDNA.setIconSize(QtCore.QSize(35, 35))NEWLINE self.previousbuttonrunDNA.setIcon(QtGui.QIcon(os.path.join(module_dir,'./icons/arrow1.svg')))NEWLINE self.previousbuttonrunDNA.setStyleSheet("background-color: #704214")NEWLINE self.previousbuttonrunDNA.setIconSize(QtCore.QSize(35, 35))NEWLINE ##End##NEWLINE ##Add Result DNA##NEWLINE self.DNAtabWidget.setTabText(self.DNAtabWidget.indexOf(self.result_dna), _translate("MainWindow", " Results "))NEWLINE self.DNAtabWidget.setTabIcon(self.DNAtabWidget.indexOf(self.result_dna), QtGui.QIcon(os.path.join(module_dir,'./icons/results.svg')))NEWLINENEWLINE self.DNAtabWidget.setIconSize(QtCore.QSize(22, 22))NEWLINE ##End##NEWLINE NEWLINE ## Add run RNA##NEWLINE self.RNAtabWidget.setTabText(self.RNAtabWidget.indexOf(self.run_rna), _translate("MainWindow", " Run "))NEWLINE self.RNAtabWidget.setTabIcon(self.RNAtabWidget.indexOf(self.run_rna), QtGui.QIcon(os.path.join(module_dir,'./icons/run1.svg')))NEWLINE self.RNAtabWidget.setIconSize(QtCore.QSize(22, 22))NEWLINE self.nextbuttonrunRNA.setIcon(QtGui.QIcon(os.path.join(module_dir,'./icons/arrow.svg')))NEWLINE self.nextbuttonrunRNA.setStyleSheet("background-color: #704214")NEWLINE self.nextbuttonrunRNA.setIconSize(QtCore.QSize(35, 35))NEWLINE self.previousbuttonrunRNA.setIcon(QtGui.QIcon(os.path.join(module_dir,'./icons/arrow1.svg')))NEWLINE self.previousbuttonrunRNA.setStyleSheet("background-color: #704214")NEWLINE self.previousbuttonrunRNA.setIconSize(QtCore.QSize(35, 35))NEWLINE ##End##NEWLINE ##Add Result RNA##NEWLINE self.RNAtabWidget.setTabText(self.RNAtabWidget.indexOf(self.result_rna), _translate("MainWindow", " Results "))NEWLINE self.RNAtabWidget.setTabIcon(self.RNAtabWidget.indexOf(self.result_rna), QtGui.QIcon(os.path.join(module_dir,'./icons/results.svg')))NEWLINE self.RNAtabWidget.setIconSize(QtCore.QSize(22, 22))NEWLINE ##End## NEWLINE NEWLINE self.RunButton.setIcon(QtGui.QIcon(os.path.join(module_dir,'./icons/run1.svg')))NEWLINE self.RunButton.setIconSize(QtCore.QSize(50, 50))NEWLINE self.RunButton.setStyleSheet("background-color:#704214")NEWLINE NEWLINE self.RunButton_dna.setIcon(QtGui.QIcon(os.path.join(module_dir,'./icons/run1.svg')))NEWLINE self.RunButton_dna.setIconSize(QtCore.QSize(50, 50))NEWLINE self.RunButton_dna.setStyleSheet("background-color:#704214") NEWLINE NEWLINENEWLINE self.RunLabel.setText(_translate("MainWindow", "Run"))NEWLINE font_label = QtGui.QFont()NEWLINE font_label.setPointSize(15)NEWLINE font_label.setBold(True)NEWLINE self.RunLabel.setFont(font_label)NEWLINE NEWLINE NEWLINE self.RunLabel_dna.setFont(font_label)NEWLINE self.RunLabel_dna.setText(_translate("MainWindow", "Run"))NEWLINE NEWLINENEWLINENEWLINE self.PipelinetabWidget.setTabText(self.PipelinetabWidget.indexOf(self.DNAseq), _translate("MainWindow", "DNA-Seq Pipeline"))NEWLINE self.PipelinetabWidget.setTabIcon(self.PipelinetabWidget.indexOf(self.DNAseq), QtGui.QIcon(os.path.join(module_dir,'./icons/dna.svg')))NEWLINE self.PipelinetabWidget.setIconSize(QtCore.QSize(22, 22))NEWLINENEWLINE self.PipelinetabWidget.setTabToolTip(self.PipelinetabWidget.indexOf(self.DNAseq), _translate("MainWindow", "Select this pipeline to generate Annotated VCFs"))NEWLINENEWLINE ## Make Input as first tab ##NEWLINE self.SampleOrlabel_rna.setText(_translate("MainWindow", "Or"))NEWLINE self.SamplesYesradioButton_rna.setText(_translate("MainWindow", "Upload from Folder"))NEWLINE self.SamplesNoradioButton_rna.setText(_translate("MainWindow", "Upload from Table"))NEWLINENEWLINE self.SampleFolderlabel.setText(_translate("MainWindow", "Samples Folder"))NEWLINE self.SampleFolderBrowseButton.setIcon(QtGui.QIcon(os.path.join(module_dir,'./icons/browse.png')))NEWLINE self.SampleFolderBrowseButton.setIconSize(QtCore.QSize(22, 22))NEWLINE self.SampleFolderBrowseButton.setToolTip("Browse Samples Folder")NEWLINE self.Sampletablelabel.setText(_translate("MainWindow", "Samples Table"))NEWLINE NEWLINE self.FastaFilelabel.setText(_translate("MainWindow", "Fasta File"))NEWLINE self.AnnotatedFilelabelRNA.setText(_translate("MainWindow", "Annotated File"))NEWLINE NEWLINE self.SampletableBrowseButton.setIcon(QtGui.QIcon(os.path.join(module_dir,'./icons/browse.png')))NEWLINE self.SampletableBrowseButton.setIconSize(QtCore.QSize(22, 22))NEWLINE self.SampletableBrowseButton.setToolTip("Browse Samples Table")NEWLINE NEWLINE self.FastaBrowseButton.setIcon(QtGui.QIcon(os.path.join(module_dir,'./icons/browse.png')))NEWLINE self.FastaBrowseButton.setIconSize(QtCore.QSize(22, 22))NEWLINE self.FastaBrowseButton.setToolTip("Browse Fasta File")NEWLINE self.AnnotatedBrowserButtonRNA.setIcon(QtGui.QIcon(os.path.join(module_dir,'./icons/browse.png')))NEWLINE self.AnnotatedBrowserButtonRNA.setIconSize(QtCore.QSize(22, 22))NEWLINE self.AnnotatedBrowserButtonRNA.setToolTip("Browse Annotated File")NEWLINENEWLINE self.CorelabelRNA.setText(_translate("MainWindow", "Maximum threads"))NEWLINE self.CorelineEditRNA.setText(_translate("MainWindow", "1"))NEWLINE NEWLINENEWLINE self.nextbuttoninputRNA.setIcon(QtGui.QIcon(os.path.join(module_dir,'./icons/arrow.svg')))NEWLINE self.nextbuttoninputRNA.setStyleSheet("background-color: #704214")NEWLINE self.nextbuttoninputRNA.setIconSize(QtCore.QSize(35, 35))NEWLINE self.RNAtabWidget.setTabText(self.RNAtabWidget.indexOf(self.input_rna), _translate("MainWindow", " Input Data "))NEWLINE self.RNAtabWidget.setTabIcon(self.RNAtabWidget.indexOf(self.input_rna), QtGui.QIcon(os.path.join(module_dir,'./icons/input.svg')))NEWLINE self.RNAtabWidget.setIconSize(QtCore.QSize(22, 22))NEWLINE NEWLINE ## End ##NEWLINE ## Add QC ##NEWLINE self.QClabel_rna.setToolTip(_translate("MainWindow", "This option performs all the Quality Control operations like fastQC, Cutadapt and MultiQC "))NEWLINE self.QClabel_rna.setText(_translate("MainWindow", "Trim the reads"))NEWLINE self.QCYesradioButton_rna.setToolTip(_translate("MainWindow", "Enables Quality Control Processing"))NEWLINE self.QCYesradioButton_rna.setText(_translate("MainWindow", "Yes"))NEWLINE self.QCNoradioButton_rna.setToolTip(_translate("MainWindow", "Disables Quality Control Processing"))NEWLINE self.QCNoradioButton_rna.setText(_translate("MainWindow", "No"))NEWLINE self.InputParamslabel_rna.setText(_translate("MainWindow", "Input Parameters:"))NEWLINENEWLINE self.Cutadaptlabel_rna.setText(_translate("MainWindow", "Cutadapt"))NEWLINE self.CutadaptlineEdit_rna.setText(_translate("MainWindow", " --adapter AGATCGGAAGAGCACACGTCTGAACTCCAGTCAC -A AGATCGGAAGAGCGTCGTGTAGGGAAAGAGTGTAGATCTCGGTGGTCGCCGTATCATT "))NEWLINENEWLINE self.RunQCpushButton_rna.setText(_translate("MainWindow", "Trimming"))NEWLINE self.RunQCpushButton_rna.setIcon(QtGui.QIcon(os.path.join(module_dir,'./icons/run1.svg')))NEWLINE self.RunQCpushButton_rna.setIconSize(QtCore.QSize(22, 22))NEWLINE self.RunQCpushButton_rna.setStyleSheet("background-color: #704214")NEWLINE self.nextbuttonqcRNA.setIcon(QtGui.QIcon(os.path.join(module_dir,'./icons/arrow.svg')))NEWLINE self.nextbuttonqcRNA.setStyleSheet("background-color: #704214")NEWLINE self.nextbuttonqcRNA.setIconSize(QtCore.QSize(35, 35))NEWLINE self.previousbuttonqcRNA.setIcon(QtGui.QIcon(os.path.join(module_dir,'./icons/arrow1.svg')))NEWLINE self.previousbuttonqcRNA.setStyleSheet("background-color: #704214")NEWLINE self.previousbuttonqcRNA.setIconSize(QtCore.QSize(35, 35))NEWLINE self.RNAtabWidget.setTabText(self.RNAtabWidget.indexOf(self.QC_rna), _translate("MainWindow", " Quality Control "))NEWLINE self.RNAtabWidget.setTabIcon(self.RNAtabWidget.indexOf(self.QC_rna), QtGui.QIcon(os.path.join(module_dir,'./icons/qc.svg')))NEWLINE NEWLINENEWLINE ## End ##NEWLINENEWLINE self.AlignercomboBoxRNA.setItemText(0, _translate("MainWindow", "HISAT2"))NEWLINE self.AlignercomboBoxRNA.setItemText(1, _translate("MainWindow", "STAR"))NEWLINENEWLINE self.EMcomboBoxRNA.setItemText(0, _translate("MainWindow", "StringTie"))NEWLINE self.EMcomboBoxRNA.setItemText(1, _translate("MainWindow", "HTSeq"))NEWLINENEWLINE self.DEcomboBoxRNA.setItemText(0, _translate("MainWindow", "ballgown"))NEWLINE self.DEcomboBoxRNA.setItemText(1, _translate("MainWindow", "DESeq2"))NEWLINE self.nextbuttontoolRNA.setIcon(QtGui.QIcon(os.path.join(module_dir,'./icons/arrow.svg')))NEWLINE self.nextbuttontoolRNA.setStyleSheet("background-color: #704214")NEWLINE self.nextbuttontoolRNA.setIconSize(QtCore.QSize(35, 35))NEWLINE self.previousbuttontoolRNA.setIcon(QtGui.QIcon(os.path.join(module_dir,'./icons/arrow1.svg')))NEWLINE self.previousbuttontoolRNA.setStyleSheet("background-color: #704214")NEWLINE self.previousbuttontoolRNA.setIconSize(QtCore.QSize(35, 35))NEWLINE self.RNAtabWidget.setTabText(self.RNAtabWidget.indexOf(self.Tool_rna), _translate("MainWindow", " Tools Selection "))NEWLINE self.RNAtabWidget.setTabIcon(self.RNAtabWidget.indexOf(self.Tool_rna), QtGui.QIcon(os.path.join(module_dir,'./icons/tools.svg')))NEWLINE ## Add Index ##NEWLINE self.StarIndexlineEdit.setToolTip(_translate("MainWindow", "Input the path of the Index for" + self.AlignercomboBoxRNA.currentText()))NEWLINE self.StarIndexpushButton.setToolTip(_translate("MainWindow", "Click this to select one of the pre-installed index or for a custom index"))NEWLINE self.StarIndexpushButton.setIcon(QtGui.QIcon(os.path.join(module_dir,'./icons/browse.png')))NEWLINE self.StarIndexpushButton.setIconSize(QtCore.QSize(22, 22))NEWLINE self.StarIndexpushButton.setToolTip("Browse Index File")NEWLINE self.OrLabel_rna.setText(_translate("MainWindow", "Or"))NEWLINENEWLINE self.RunIndexrnapushButton.setText(_translate("MainWindow", "Generate Index"))NEWLINE self.RunIndexrnapushButton.setIcon(QtGui.QIcon(os.path.join(module_dir,'./icons/run1.svg')))NEWLINE self.RunIndexrnapushButton.setStyleSheet("background-color: #704214")NEWLINE self.RunIndexrnapushButton.setIconSize(QtCore.QSize(22, 22))NEWLINENEWLINE self.PipelinetabWidget.setTabText(self.PipelinetabWidget.indexOf(self.RNAseq), _translate("MainWindow", "RNA-Seq Pipeline"))NEWLINE self.PipelinetabWidget.setTabIcon(self.PipelinetabWidget.indexOf(self.RNAseq), QtGui.QIcon(os.path.join(module_dir,'./icons/rna.svg')))NEWLINE self.PipelinetabWidget.setTabToolTip(self.PipelinetabWidget.indexOf(self.RNAseq), _translate("MainWindow", "Select this pipeline to generate Differentially Expressed Genes"))NEWLINE self.ShellTab.setTabText(self.ShellTab.indexOf(self.SnakemakeOutputTab), _translate("MainWindow", "Logs"))NEWLINE self.ShellTab.setTabIcon(self.ShellTab.indexOf(self.SnakemakeOutputTab), QtGui.QIcon(os.path.join(module_dir,'./icons/log.svg')))NEWLINE self.ShellTab.setIconSize(QtCore.QSize(22, 22))NEWLINE NEWLINE NEWLINE self.PipelinetabWidget.setTabText(self.PipelinetabWidget.indexOf(self.CTAG), _translate("MainWindow", "cTaG"))NEWLINE NEWLINE font_label = QtGui.QFont()NEWLINE font_label.setPointSize(12)NEWLINE font_label.setBold(True)NEWLINE NEWLINE font_label2 = QtGui.QFont()NEWLINE font_label2.setPointSize(10)NEWLINE font_label2.setBold(False) NEWLINE NEWLINE self.maflabel.setText(_translate("MainWindow", "Path to MAF file"))NEWLINE self.mafparamlabel.setText(_translate("MainWindow", "Parameters"))NEWLINE self.mafparamlabel1.setText(_translate("MainWindow", "- m"))NEWLINE self.mafparamlabel2.setText(_translate("MainWindow", "- p"))NEWLINE self.mafparamlineEdit.setText(_translate("MainWindow", "2000"))NEWLINE self.mafparamlineEdit1.setText(_translate("MainWindow", "5"))NEWLINE NEWLINE self.ctaglabel.setText(_translate("MainWindow", "cTaG (classify TSG and OG)"))NEWLINE self.ctaglabel.setFont(font_label)NEWLINE self.ctaglabel2.setText(_translate("MainWindow", "cTaG is a tool used to identify tumour suppressor genes (TSGs)\n and oncogenes (OGs) using somatic mutation data.The cTaG model \n returns the list of all genes labelled as TSG or OG or unlabelled\n along with predictions made by each model and whether\n the gene is among the top predictions ")) NEWLINE self.ctaglabel2.setFont(font_label2)NEWLINE urlLink1 = "<a href=\'https://github.com/RamanLab/cTaG'>cTaG</a>"NEWLINE self.ctaglabel3.setText(_translate("MainWindow", urlLink1 ))NEWLINE self.ctaggithubbutton.setIcon(QtGui.QIcon(os.path.join(module_dir,'./icons/github.png')))NEWLINE self.ctaggithubbutton.setIconSize(QtCore.QSize(22, 22))NEWLINE self.ctaggithubbutton.setToolTip("GitHub link")NEWLINE NEWLINE self.mafBrowseButton.setIcon(QtGui.QIcon(os.path.join(module_dir,'./icons/browse.png')))NEWLINE self.mafBrowseButton.setToolTip("Browse MAF File")NEWLINE self.mafBrowseButton.setIconSize(QtCore.QSize(22, 22))NEWLINE NEWLINE self.runctagpushButton.setText(_translate("MainWindow", "cTaG"))NEWLINE self.runctagpushButton.setIcon(QtGui.QIcon(os.path.join(module_dir,'./icons/run1.svg')))NEWLINE self.runctagpushButton.setText(_translate("MainWindow", " Run cTaG"))NEWLINE self.runctagpushButton.setIconSize(QtCore.QSize (22, 22)) NEWLINE NEWLINE self.resultctagpushButton.setText(_translate("MainWindow", "cTAG"))NEWLINE self.resultctagpushButton.setIcon(QtGui.QIcon(os.path.join(module_dir,'./icons/document.svg')))NEWLINE self.resultctagpushButton.setText(_translate("MainWindow", " View Results"))NEWLINE self.resultctagpushButton.setIconSize(QtCore.QSize (22, 22)) NEWLINE NEWLINE self.PipelinetabWidget.setTabText(self.PipelinetabWidget.indexOf(self.NB), _translate("MainWindow", "NBDriver"))NEWLINE NEWLINE font_label = QtGui.QFont()NEWLINE font_label.setPointSize(12)NEWLINE font_label.setBold(True)NEWLINE NEWLINE font_label2 = QtGui.QFont()NEWLINE font_label2.setPointSize(10)NEWLINE font_label2.setBold(False)NEWLINE NEWLINE NEWLINE self.vcflabel.setText(_translate("MainWindow", "Path to VCF file"))NEWLINE self.nblabel.setText(_translate("MainWindow", "NBDriver (NEIGHBORHOOD Driver)"))NEWLINE self.nblabel.setFont(font_label)NEWLINE self.nblabel2.setText(_translate("MainWindow", "NBDriver is a tool used to differentiate between driver \n and passenger mutations using features derived from \n the neighborhood sequences of somatic mutations.NBDriver \n returns a list of all mutations labelled as Driver or Passenger")) NEWLINE self.nblabel2.setFont(font_label2)NEWLINE NEWLINE urlLink = "<a href=\'https://github.com/RamanLab/NBDriver'>NBDriver</a>"NEWLINE self.nblabel3.setText(_translate("MainWindow", urlLink ))NEWLINE urlLink1 = "<a href=\'https://doi.org/10.3390/cancers13102366'>Banerjee et al.</a>"NEWLINE self.nblabel5.setText(_translate("MainWindow", urlLink1 ))NEWLINE self.nbgithubbutton.setIcon(QtGui.QIcon(os.path.join(module_dir,'./icons/github.png')))NEWLINE self.nbgithubbutton.setIconSize(QtCore.QSize(22, 22))NEWLINE self.nbgithubbutton.setToolTip("GitHub link")NEWLINE self.nbpaperbutton.setIcon(QtGui.QIcon(os.path.join(module_dir,'./icons/document.svg')))NEWLINE self.nbpaperbutton.setIconSize(QtCore.QSize(22, 22))NEWLINE self.nbpaperbutton.setToolTip("GitHub link")NEWLINE urlLink2 = "<a href=\'https://doi.org/10.5281/zenodo.5759698'>link</a>"NEWLINE self.nblabel4.setText(_translate("MainWindow", " NBDriver predictions has been derived using hg19 reference genome only. The user needs to download the \n reference file from this and put it in the /NBDriver_iCOMIC/ directory and the input vcf file must be \n kept inside /NBDriver_ICOMIC/vcf directory and renamed as NBDriver_vcf.vcf" ))NEWLINE self.nblabel6.setText(_translate("MainWindow", urlLink2 ))NEWLINE NEWLINE self.vcfBrowseButton.setIcon(QtGui.QIcon(os.path.join(module_dir,'./icons/browse.png')))NEWLINE self.vcfBrowseButton.setToolTip("Browse VCF File")NEWLINE self.vcfBrowseButton.setIconSize(QtCore.QSize(22, 22))NEWLINE NEWLINE self.runnbpushButton.setText(_translate("MainWindow", "NBDriver"))NEWLINE self.runnbpushButton.setIcon(QtGui.QIcon(os.path.join(module_dir,'./icons/run1.svg')))NEWLINE self.runnbpushButton.setText(_translate("MainWindow", " Run NBDriver"))NEWLINE self.runnbpushButton.setIconSize(QtCore.QSize (22, 22)) NEWLINE NEWLINE self.resultnbpushButton.setText(_translate("MainWindow", "NBDriver"))NEWLINE self.resultnbpushButton.setIcon(QtGui.QIcon(os.path.join(module_dir,'./icons/document.svg')))NEWLINE self.resultnbpushButton.setText(_translate("MainWindow", " View Results"))NEWLINE self.resultnbpushButton.setIconSize(QtCore.QSize (22, 22)) NEWLINE NEWLINE NEWLINENEWLINE self.menuFile.setTitle(_translate("MainWindow", "File"))NEWLINE self.menuOption.setTitle(_translate("MainWindow", "Option"))NEWLINE self.menuHelp.setTitle(_translate("MainWindow", "Help"))NEWLINE self.actionQuit.setText(_translate("MainWindow", "Quit"))NEWLINE self.actionAbout.setText(_translate("MainWindow", "About"))NEWLINE self.actionQuick_Start.setText(_translate("MainWindow", "Quick Start"))NEWLINE self.actionAbout_2.setText(_translate("MainWindow", "About"))NEWLINE self.actionSnakemake_Options.setText(_translate("MainWindow", "Snakemake Options"))NEWLINE ##Changelabel on choosing tools##NEWLINENEWLINE NEWLINE self.nextbuttoninputDNA.clicked.connect(self.on_clicked_nextbuttoninputDNA)NEWLINE self.nextbuttonqcDNA.clicked.connect(self.on_clicked_nextbuttonqcDNA)NEWLINE self.nextbuttontoolDNA.clicked.connect(self.on_clicked_nextbuttonparamsDNA)NEWLINE self.nextbuttontoolDNA.clicked.connect(self.on_clicked_nextbuttontoolDNA)NEWLINE self.previousbuttonqcDNA.clicked.connect(self.on_clicked_previousbuttonqcDNA)NEWLINE self.previousbuttontoolDNA.clicked.connect(self.on_clicked_previousbuttontoolDNA)NEWLINE self.previousbuttonrunRNA.clicked.connect(self.on_clicked_previousbuttonrunDNA)NEWLINE self.nextbuttoninputRNA.clicked.connect(self.on_clicked_nextbuttoninputRNA)NEWLINE self.nextbuttonqcRNA.clicked.connect(self.on_clicked_nextbuttonqcRNA)NEWLINE self.nextbuttontoolRNA.clicked.connect(self.on_clicked_nextbuttonparamsRNA)NEWLINE self.nextbuttontoolRNA.clicked.connect(self.on_clicked_nextbuttontoolRNA)NEWLINE self.previousbuttonqcRNA.clicked.connect(self.on_clicked_previousbuttonqcRNA)NEWLINE self.previousbuttontoolRNA.clicked.connect(self.on_clicked_previousbuttontoolRNA)NEWLINE NEWLINE self.SamplesNoradioButton.toggled.connect(self.on_check_SamplesNo_dna)NEWLINE self.SamplesNoradioButton_rna.toggled.connect(self.on_check_SamplesNo_rna)NEWLINE self.QCresults.clicked.connect(self.show_qc_textbox)NEWLINE self.QCresults.clicked.connect(self.show_qc_results)NEWLINE NEWLINE self.QCYesradioButton.toggled.connect(self.on_check_QC_dna)NEWLINE self.QCYesradioButton_rna.toggled.connect(self.on_check_QC_rna)NEWLINE self.QCresults_rna.clicked.connect(self.show_qc_textbox)NEWLINE self.QCresults_rna.clicked.connect(self.show_qc_results_rna)NEWLINE NEWLINE self.aligner_add_dna.clicked.connect(self.advanced_aligner)NEWLINE self.vc_add_dna.clicked.connect(self.advanced_vc)NEWLINE self.annotator_add_dna.clicked.connect(self.advanced_annotator)NEWLINE self.aligner_add_rna.clicked.connect(self.advanced_aligner_rna)NEWLINE self.em_add_rna.clicked.connect(self.advanced_em)NEWLINE self.de_add_rna.clicked.connect(self.advanced_de)NEWLINE self.AnnotatorcomboBoxDNA.currentIndexChanged.connect(self.not_snpeff)NEWLINE self.AlignercomboBoxDNA.currentIndexChanged.connect(self.param_display)NEWLINE self.VCcomboBoxDNA.currentIndexChanged.connect(self.param_display)NEWLINE self.AnnotatorcomboBoxDNA.currentIndexChanged.connect(self.param_display)NEWLINE self.AlignercomboBoxRNA.currentIndexChanged.connect(self.param_display_rna)NEWLINE self.EMcomboBoxRNA.currentIndexChanged.connect(self.param_display_rna)NEWLINE self.DEcomboBoxRNA.currentIndexChanged.connect(self.param_display_rna)NEWLINE NEWLINE self.pushbutton_result1_dna.clicked.connect(self.multiqc_result)NEWLINE self.pushbutton_result2_dna.clicked.connect(self.vcf_result)NEWLINE self.pushbutton_result3_dna.clicked.connect(self.annotated_result)NEWLINE self.pushbutton_result1_rna.clicked.connect(self.multiqc_result_rna)NEWLINE self.pushbutton_result2_rna.clicked.connect(self.de_result)NEWLINE self.pushbutton_result3_rna.clicked.connect(self.plot_view)NEWLINE NEWLINE self.RunButton_dna.clicked.connect(self.run_action_textbox)NEWLINE self.RunButton_dna.clicked.connect(self.run_action_dna)NEWLINE self.RunButton.clicked.connect(self.run_action_textbox)NEWLINE self.RunButton.clicked.connect(self.run_action_rna)NEWLINE NEWLINE self.pYesradioButton.toggled.connect(self.on_check_proceed)NEWLINE self.nextbuttonresult.clicked.connect(self.on_click_nextresults)NEWLINENEWLINENEWLINENEWLINE ##data_browse##NEWLINE self.SamplesBrowseButtonDNA.clicked.connect(self.browse_data_samples)NEWLINE self.UnitsBrowseButtonDNA.clicked.connect(self.browse_data_units)NEWLINE self.RefGenomeBrowseButtonDNA.clicked.connect(self.browse_data_ref)NEWLINE self.RefVariantpushButton.clicked.connect(self.browse_data_kv)NEWLINE ##Enable browse button for index##NEWLINE self.BWAIndexpushButton.clicked.connect(self.browse_bwaindex_dna)NEWLINENEWLINE self.StarIndexpushButton.clicked.connect(self.browse_star_rna)NEWLINENEWLINE self.SampletableBrowseButton.clicked.connect(self.browse_data_sampletable)NEWLINE self.FastaBrowseButton.clicked.connect(self.browse_data_fasta)NEWLINE self.AnnotatedBrowserButtonRNA.clicked.connect(self.browse_data_annotated)NEWLINE self.SampleFolderBrowseButton.clicked.connect(self.browse_samples_folder)NEWLINE ##Run_QC##NEWLINENEWLINE self.RunQCpushButton.clicked.connect(self.run_qc_textbox)NEWLINE self.RunQCpushButton.clicked.connect(self.run_qc_dna)NEWLINENEWLINE self.RunQCpushButton_rna.clicked.connect(self.run_qc_rna_textbox)NEWLINE self.RunQCpushButton_rna.clicked.connect(self.run_qc_rna)NEWLINE NEWLINE ##Add additional parameters##NEWLINE ##Run_indexing##NEWLINENEWLINE self.RunIndexdnapushButton.clicked.connect(self.run_index_text)NEWLINE self.RunIndexdnapushButton.clicked.connect(self.run_index_dna)NEWLINE self.RunIndexrnapushButton.clicked.connect(self.run_index_text)NEWLINE self.RunIndexrnapushButton.clicked.connect(self.run_index_rna)NEWLINE ##Run_main##NEWLINE ##run cTAG##NEWLINE NEWLINE self.mafBrowseButton.clicked.connect(self.browse_data_maf)NEWLINE self.runctagpushButton.clicked.connect(self.on_click_run_ctag)NEWLINE self.resultctagpushButton.clicked.connect(self.on_click_result_ctag)NEWLINE NEWLINE NEWLINE self.vcfBrowseButton.clicked.connect(self.browse_data_vcf)NEWLINE self.runnbpushButton.clicked.connect(self.on_click_run_nbdriver)NEWLINE self.resultnbpushButton.clicked.connect(self.on_click_result_nbdriver)NEWLINE NEWLINE NEWLINE ##show dag##NEWLINE ##menu_popups##NEWLINE self.actionAbout_2.triggered.connect(self.about)NEWLINE self.actionQuick_Start.triggered.connect(self.quick_start)NEWLINENEWLINE# =============================================================================NEWLINE def on_click_nextresults(self):NEWLINE if self.ctagradioButton.isChecked() == True:NEWLINE self.PipelinetabWidget.setCurrentIndex(2)NEWLINE subprocess.run(["snakemake", "--use-conda", "-j", self.CorelineEditDNA.text(), "-s", "Snakefile_maf"]) NEWLINE elif self.nbradioButton.isChecked() == True:NEWLINE self.PipelinetabWidget.setCurrentIndex(3)NEWLINE else:NEWLINE passNEWLINE def on_click_run_ctag(self):NEWLINE subprocess.run(["python","cTaG/code/cTaG.py","-i", self.maflineEdit.text(), "-o", (os.getcwd()+"/cTaG/results"), "-c","/cTaG", "-m", self.mafparamlineEdit.text(), "-p", self.mafparamlineEdit1.text()])NEWLINE NEWLINE def on_click_result_ctag(self):NEWLINE path='cTaG/results/CVpredictions.txt'NEWLINE self.result_dialog= ResultsDialog(path)NEWLINE self.result_dialog.show()NEWLINE NEWLINE def on_click_run_nbdriver(self):NEWLINE subprocess.run([(os.getcwd()+"/NBDriver_ICOMIC/run.sh")])NEWLINE NEWLINE def on_click_result_nbdriver(self):NEWLINE path='NBDriver_Predictions.csv'NEWLINE self.result_dialog= ResultsDialog(path)NEWLINE self.result_dialog.show()NEWLINE NEWLINE def run_results_textbox(self):NEWLINE subprocess.run(["snakemake", "--unlock", "-j", "1"])NEWLINE self.textBrowser.setTextColor(self._colors['blue'])NEWLINE self.textBrowser.append("Please be patient, while we generate MAF files \n\n")NEWLINENEWLINENEWLINE def multiqc_result(self):NEWLINE if os.path.exists("results_dna/multiqc/multiqc.html"):NEWLINE self.textBrowser.setTextColor(self._colors['blue'])NEWLINE filename = "results_dna/multiqc/multiqc.html"NEWLINE webbrowser.get('google-chrome').open(filename, new=0, autoraise=True)NEWLINE else:NEWLINE passNEWLINE NEWLINE def vcf_result(self):NEWLINE path='results_dna/filtered/all.vcf.gz'NEWLINE self.result_dialog= ResultsDialog(path)NEWLINENEWLINE NEWLINE self.result_dialog.show()NEWLINE NEWLINE def annotated_result(self):NEWLINE if self.AnnotatorcomboBoxDNA.currentText()=="SnpEff":NEWLINE path = "results_dna/annotated/all.vcf"NEWLINE elif self.AnnotatorcomboBoxDNA.currentText()=="Annovar":NEWLINE path = "results_dna/annotated/all.hg19_multianno.vcf"NEWLINE# path = "results_dna/annotated/all.multianno.vcf"NEWLINE self.result_dialog= ResultsDialog(path)NEWLINE self.result_dialog.show()NEWLINE else:NEWLINE passNEWLINE self.result_dialog= ResultsDialog(path)NEWLINE self.result_dialog.show()NEWLINE NEWLINE def de_result(self):NEWLINE if self.DEcomboBoxRNA.currentText() == 'ballgown':NEWLINE path='results/de_results/SigDE.txt'NEWLINE elif self.DEcomboBoxRNA.currentText() == 'DESeq2':NEWLINE path = 'results/de_results/DESeq2_normalized_counts.txt'NEWLINE self.result_dialog= ResultsDialog(path)NEWLINE self.result_dialog.show()NEWLINE else:NEWLINE passNEWLINE self.result_dialog= ResultsDialog(path)NEWLINE self.result_dialog.show()NEWLINE NEWLINE def plot_view(self):NEWLINE if os.path.exists("results/de_results/plot_output.pdf"):NEWLINE filename = "results/de_results/plot_output.pdf"NEWLINE webbrowser.get('google-chrome').open(filename, new=0, autoraise=True)NEWLINE elif os.path.exists("results/de_results/Rplots.pdf"):NEWLINE filename = "results/de_results/Rplots.pdf "NEWLINE webbrowser.get('google-chrome').open(filename, new=0, autoraise=True)NEWLINE else:NEWLINE passNEWLINENEWLINE NEWLINE def multiqc_result_rna(self):NEWLINE if os.path.exists("results/multiqc/multiqc.html"):NEWLINE self.textBrowser.setTextColor(self._colors['blue'])NEWLINE filename = "results/multiqc/multiqc.html"NEWLINE webbrowser.get('google-chrome').open(filename, new=0, autoraise=True)NEWLINE else:NEWLINE passNEWLINE NEWLINE def create_aligner_groupbox(self):NEWLINE font_label = QtGui.QFont()NEWLINE font_label.setPointSize(8.5)NEWLINE color = QtGui.QColor(233, 10, 150)NEWLINE self.aligner_groupbox = QGroupBox("Aligner")NEWLINE self.vlayout= QtWidgets.QVBoxLayout()NEWLINE self.hlayout0_aligner = QtWidgets.QHBoxLayout()NEWLINE font_info = QtGui.QFont()NEWLINE font_info.setPointSize(8.5)NEWLINE self.Alignerninfoicon_dna = QtWidgets.QPushButton(self.aligner_groupbox)NEWLINE self.Alignerninfoicon_dna.setFlat(True)NEWLINE self.Alignerninfoicon_dna.setGeometry(QtCore.QRect(48, 0, 20, 20))NEWLINE self.Alignerninfoicon_dna.setToolTip("Software for arranging sequences to identify regions of similarity")NEWLINE self.Alignerninfoicon_dna.setFont(font_info)NEWLINE self.Alignerninfoicon_dna.setIcon(QtGui.QIcon(os.path.join(module_dir,'./icons/info.svg')))NEWLINE self.Alignerninfoicon_dna.setIconSize(QtCore.QSize(13, 13)) NEWLINE NEWLINE self.AlignercomboBoxDNA = QtWidgets.QComboBox()NEWLINE self.AlignercomboBoxDNA.move(20, 10)NEWLINE self.AlignercomboBoxDNA.setSizeAdjustPolicy(QtWidgets.QComboBox.AdjustToContents)NEWLINE self.AlignercomboBoxDNA.setObjectName("AlignercomboBoxDNA")NEWLINE self.AlignercomboBoxDNA.addItem("")NEWLINE self.AlignercomboBoxDNA.addItem("")NEWLINE self.AlignercomboBoxDNA.addItem("")NEWLINE self.hlayout0_aligner.addWidget(self.AlignercomboBoxDNA)NEWLINE self.hlayout0_aligner.addStretch(0)NEWLINE self.vlayout.addItem(self.hlayout0_aligner)NEWLINE self.hlayout1_aligner = QtWidgets.QHBoxLayout()NEWLINE self.hlayout1_aligner.setSpacing(10)NEWLINE self.BWAIndexlabel = QtWidgets.QLabel()NEWLINE self.BWAIndexlabel.setObjectName("BWAIndexlabel")NEWLINE self.BWAIndexlineEdit = QtWidgets.QLineEdit()NEWLINE self.BWAIndexlineEdit.setObjectName("BWAIndexlineEdit")NEWLINE self.BWAIndexpushButton = QtWidgets.QPushButton()NEWLINE self.BWAIndexpushButton.setObjectName("BWAIndexpushButton")NEWLINE NEWLINE self.hlayout1_aligner.addWidget(self.BWAIndexlabel)NEWLINE self.hlayout1_aligner.addWidget(self.BWAIndexlineEdit)NEWLINE self.hlayout1_aligner.addWidget(self.BWAIndexpushButton)NEWLINE self.vlayout.addItem(self.hlayout1_aligner)NEWLINE NEWLINE self.hlayout1_error_aligner = QtWidgets.QHBoxLayout()NEWLINE self.BWAIndexErrortext = QtWidgets.QLabel()NEWLINE self.BWAIndexErrortext.setGeometry(QtCore.QRect(170, 113, 331, 22))NEWLINE self.BWAIndexErrortext.setObjectName("BWAIndexErrortext")NEWLINE self.BWAIndexErrortext.setStyleSheet("color: red")NEWLINE self.BWAIndexErrortext.setFont(font_label)NEWLINE self.BWAIndexErrortext.hide()NEWLINE self.hlayout1_error_aligner.addWidget(self.BWAIndexErrortext, 0, alignment=QtCore.Qt.AlignCenter)NEWLINE self.vlayout.addItem(self.hlayout1_error_aligner)NEWLINE NEWLINE self.hlayout0_or = QtWidgets.QHBoxLayout()NEWLINE self.OrLabel_dna = QtWidgets.QLabel()NEWLINE self.OrLabel_dna.setGeometry(QtCore.QRect(340, 130, 270, 23))NEWLINE self.OrLabel_dna.setObjectName("OrLabel_dna")NEWLINE self.hlayout0_or.addWidget(self.OrLabel_dna, 0, alignment=QtCore.Qt.AlignCenter)NEWLINE self.vlayout.addItem(self.hlayout0_or)NEWLINE NEWLINE self.hlayout0_runindex = QtWidgets.QHBoxLayout()NEWLINE self.RunIndexdnapushButton = QtWidgets.QPushButton()NEWLINE self.RunIndexdnapushButton.setObjectName("RunIndexdnapushButton")NEWLINE self.hlayout0_runindex.addWidget(self.RunIndexdnapushButton, 0, alignment=QtCore.Qt.AlignCenter)NEWLINE self.RunIndexdnaButtonErroricon = QtWidgets.QPushButton()NEWLINE self.RunIndexdnaButtonErroricon.setGeometry(QtCore.QRect(480, 175, 20, 20))NEWLINE self.RunIndexdnaButtonErroricon.setToolTip("Check and Run Index Again!")NEWLINE self.RunIndexdnaButtonErroricon.setFont(font_label)NEWLINE self.RunIndexdnaButtonErroricon.setIcon(QtGui.QIcon(os.path.join(module_dir,'./icons/warning.svg')))NEWLINE self.hlayout0_runindex.addWidget(self.RunIndexdnaButtonErroricon, 0, alignment=QtCore.Qt.AlignCenter)NEWLINE self.RunIndexdnaButtonErroricon.hide()NEWLINE self.vlayout.addItem(self.hlayout0_runindex)NEWLINE NEWLINE self.hlayout0_pb = QtWidgets.QHBoxLayout()NEWLINE self.hlayout0_pb.setGeometry(QtCore.QRect(10, 230, 665, 17))NEWLINE self.progressBar_sub2_dna = QtWidgets.QProgressBar()NEWLINE self.progressBar_sub2_dna.setProperty("value", 0)NEWLINE self.progressBar_sub2_dna.setObjectName("progressBar_sub2_dna")NEWLINE self.hlayout0_pb.addWidget(self.progressBar_sub2_dna)NEWLINE self.vlayout.addItem(self.hlayout0_pb)NEWLINENEWLINE NEWLINE NEWLINE self.param1_label_dna_1 = QtWidgets.QLabel()NEWLINE self.param1_label_dna_1.setGeometry(QtCore.QRect(20, 40, 91, 18))NEWLINE self.param1_lineEdit_dna_1 = QtWidgets.QLineEdit()NEWLINE self.param1_lineEdit_dna_1.setGeometry(QtCore.QRect(120, 40, 70, 18))NEWLINE self.param1_label_dna_3 = QtWidgets.QLabel()NEWLINE self.param1_label_dna_3.setGeometry(QtCore.QRect(200, 40, 91, 18))NEWLINE self.param1_lineEdit_dna_3 = QtWidgets.QLineEdit()NEWLINE self.param1_lineEdit_dna_3.setGeometry(QtCore.QRect(280, 40, 70, 18))NEWLINE self.param1_label_dna_5 = QtWidgets.QLabel()NEWLINE self.param1_label_dna_5.setGeometry(QtCore.QRect(360, 40, 91, 18))NEWLINE self.param1_lineEdit_dna_5 = QtWidgets.QLineEdit()NEWLINE self.param1_lineEdit_dna_5.setGeometry(QtCore.QRect(440, 40, 70, 18))NEWLINENEWLINE NEWLINE self.param1_label_dna_2 = QtWidgets.QLabel()NEWLINE self.param1_label_dna_2.setGeometry(QtCore.QRect(20, 65, 91, 18))NEWLINE self.param1_lineEdit_dna_2 = QtWidgets.QLineEdit()NEWLINE self.param1_lineEdit_dna_2.setGeometry(QtCore.QRect(120, 65, 70, 18))NEWLINE self.param1_label_dna_4 = QtWidgets.QLabel()NEWLINE self.param1_label_dna_4.setGeometry(QtCore.QRect(200, 65, 91, 18))NEWLINE self.param1_lineEdit_dna_4 = QtWidgets.QLineEdit()NEWLINE self.param1_lineEdit_dna_4.setGeometry(QtCore.QRect(280, 65, 70, 18))NEWLINE self.param1_label_dna_6 = QtWidgets.QLabel()NEWLINE self.param1_label_dna_6.setGeometry(QtCore.QRect(360, 65, 91, 18))NEWLINE self.param1_lineEdit_dna_6 = QtWidgets.QLineEdit()NEWLINE self.param1_lineEdit_dna_6.setGeometry(QtCore.QRect(440, 65, 70, 18))NEWLINE NEWLINE self.grid_aligner = QtWidgets.QGridLayout()NEWLINE self.grid_aligner.setSpacing(10)NEWLINE self.grid_aligner.addWidget(self.param1_label_dna_1, 0, 0)NEWLINE self.grid_aligner.addWidget(self.param1_lineEdit_dna_1, 0, 1)NEWLINE self.grid_aligner.addWidget(self.param1_label_dna_3, 0, 2)NEWLINE self.grid_aligner.addWidget(self.param1_lineEdit_dna_3, 0, 3)NEWLINE self.grid_aligner.addWidget(self.param1_label_dna_5, 0, 4)NEWLINE self.grid_aligner.addWidget(self.param1_lineEdit_dna_5, 0, 5)NEWLINE self.grid_aligner.addWidget(self.param1_label_dna_2, 1,0)NEWLINE self.grid_aligner.addWidget(self.param1_lineEdit_dna_2, 1,1)NEWLINE self.grid_aligner.addWidget(self.param1_label_dna_4, 1,2)NEWLINE self.grid_aligner.addWidget(self.param1_lineEdit_dna_4, 1, 3)NEWLINE self.grid_aligner.addWidget(self.param1_label_dna_6, 1,4)NEWLINE self.grid_aligner.addWidget(self.param1_lineEdit_dna_6, 1,5)NEWLINE NEWLINE self.vlayout.addItem(self.grid_aligner)NEWLINE NEWLINE NEWLINE self.hlayout4_aligner = QtWidgets.QHBoxLayout()NEWLINE self.hlayout4_aligner.addStretch(1)NEWLINE self.aligner_add_dna = QtWidgets.QPushButton()NEWLINE self.aligner_add_dna.setGeometry(QtCore.QRect(530, 45, 70, 30))NEWLINE self.aligner_add_dna.setText("Advanced")NEWLINE self.aligner_add_dna.setStyleSheet("background-color: #704214")NEWLINE self.hlayout4_aligner.addWidget(self.aligner_add_dna)NEWLINE self.vlayout.addItem(self.hlayout4_aligner)NEWLINE NEWLINE self.aligner_groupbox.setLayout(self.vlayout)NEWLINE NEWLINE font_param = QtGui.QFont()NEWLINE font_param.setBold(True)NEWLINENEWLINE NEWLINE ##set of lbels and lineedits for params##NEWLINE NEWLINE self.param1_label_dna_1.hide()NEWLINE self.param1_label_dna_2.hide()NEWLINE self.param1_label_dna_3.hide()NEWLINE self.param1_label_dna_4.hide()NEWLINE self.param1_label_dna_5.hide()NEWLINE self.param1_label_dna_6.hide()NEWLINE self.param1_lineEdit_dna_1.hide()NEWLINE self.param1_lineEdit_dna_2.hide()NEWLINE self.param1_lineEdit_dna_3.hide()NEWLINE self.param1_lineEdit_dna_4.hide()NEWLINE self.param1_lineEdit_dna_5.hide()NEWLINE self.param1_lineEdit_dna_6.hide()NEWLINE NEWLINE NEWLINE NEWLINE NEWLINE def create_vc_groupbox(self):NEWLINE self.vc_groupbox = QGroupBox("Variant caller")NEWLINE self.vlayout_vc= QtWidgets.QVBoxLayout()NEWLINE self.hlayout0_vc = QtWidgets.QHBoxLayout()NEWLINE NEWLINE font_info = QtGui.QFont()NEWLINE font_info.setPointSize(8.5)NEWLINE self.VariantCallerninfoicon_dna = QtWidgets.QPushButton(self.vc_groupbox)NEWLINE self.VariantCallerninfoicon_dna.setFlat(True)NEWLINE self.VariantCallerninfoicon_dna.setGeometry(QtCore.QRect(84, 0, 20, 20))NEWLINE self.VariantCallerninfoicon_dna.setToolTip("Variant calling is the process by which variants are identified from \n the sample sequence data in comparison to the reference sequence.")NEWLINE self.VariantCallerninfoicon_dna.setFont(font_info)NEWLINE self.VariantCallerninfoicon_dna.setIcon(QtGui.QIcon(os.path.join(module_dir,'./icons/info.svg')))NEWLINE self.VariantCallerninfoicon_dna.setIconSize(QtCore.QSize(13, 13)) NEWLINE NEWLINE self.VCcomboBoxDNA = QtWidgets.QComboBox()NEWLINE self.VCcomboBoxDNA.setSizeAdjustPolicy(QtWidgets.QComboBox.AdjustToContents)NEWLINE self.VCcomboBoxDNA.setObjectName("VCcomboBoxDNA")NEWLINE self.VCcomboBoxDNA.addItem("")NEWLINE self.hlayout0_vc.addWidget(self.VCcomboBoxDNA)NEWLINE self.hlayout0_vc.addStretch(0)NEWLINE self.vlayout_vc.addItem(self.hlayout0_vc)NEWLINE NEWLINE NEWLINE self.param2_label_dna_1 = QtWidgets.QLabel()NEWLINE self.param2_label_dna_1.setGeometry(QtCore.QRect(20, 40, 91, 18))NEWLINE self.param2_lineEdit_dna_1 = QtWidgets.QLineEdit()NEWLINE self.param2_lineEdit_dna_1.setGeometry(QtCore.QRect(120, 40, 70, 18))NEWLINE self.param2_label_dna_3 = QtWidgets.QLabel()NEWLINE self.param2_label_dna_3.setGeometry(QtCore.QRect(200, 40, 91, 18))NEWLINE self.param2_lineEdit_dna_3 = QtWidgets.QLineEdit()NEWLINE self.param2_lineEdit_dna_3.setGeometry(QtCore.QRect(280, 40, 70, 18))NEWLINE self.param2_label_dna_5 = QtWidgets.QLabel()NEWLINE self.param2_label_dna_5.setGeometry(QtCore.QRect(360, 40, 91, 18))NEWLINE self.param2_lineEdit_dna_5 = QtWidgets.QLineEdit()NEWLINE self.param2_lineEdit_dna_5.setGeometry(QtCore.QRect(440, 40, 70, 18))NEWLINE NEWLINE self.param2_label_dna_2 = QtWidgets.QLabel()NEWLINE self.param2_label_dna_2.setGeometry(QtCore.QRect(20, 65, 91, 18))NEWLINE self.param2_lineEdit_dna_2 = QtWidgets.QLineEdit()NEWLINE self.param2_lineEdit_dna_2.setGeometry(QtCore.QRect(120, 65, 70, 18))NEWLINE self.param2_label_dna_4 = QtWidgets.QLabel()NEWLINE self.param2_label_dna_4.setGeometry(QtCore.QRect(200, 65, 91, 18))NEWLINE self.param2_lineEdit_dna_4 = QtWidgets.QLineEdit()NEWLINE self.param2_lineEdit_dna_4.setGeometry(QtCore.QRect(280, 65, 70, 18))NEWLINE self.param2_label_dna_6 = QtWidgets.QLabel()NEWLINE self.param2_label_dna_6.setGeometry(QtCore.QRect(360, 65, 91, 18))NEWLINE self.param2_lineEdit_dna_6 = QtWidgets.QLineEdit()NEWLINE self.param2_lineEdit_dna_6.setGeometry(QtCore.QRect(440, 65, 70, 18))NEWLINE NEWLINE self.grid_vc = QtWidgets.QGridLayout()NEWLINE self.grid_vc.setSpacing(10)NEWLINE self.grid_vc.addWidget(self.param2_label_dna_1, 0, 0)NEWLINE self.grid_vc.addWidget(self.param2_lineEdit_dna_1, 0, 1)NEWLINE self.grid_vc.addWidget(self.param2_label_dna_3, 0, 2)NEWLINE self.grid_vc.addWidget(self.param2_lineEdit_dna_3, 0, 3)NEWLINE self.grid_vc.addWidget(self.param2_label_dna_5, 0, 4)NEWLINE self.grid_vc.addWidget(self.param2_lineEdit_dna_5, 0, 5)NEWLINE self.grid_vc.addWidget(self.param2_label_dna_2, 1,0)NEWLINE self.grid_vc.addWidget(self.param2_lineEdit_dna_2, 1,1)NEWLINE self.grid_vc.addWidget(self.param2_label_dna_4, 1,2)NEWLINE self.grid_vc.addWidget(self.param2_lineEdit_dna_4, 1, 3)NEWLINE self.grid_vc.addWidget(self.param2_label_dna_6, 1,4)NEWLINE self.grid_vc.addWidget(self.param2_lineEdit_dna_6, 1,5)NEWLINE NEWLINE self.vlayout_vc.addItem(self.grid_vc)NEWLINE self.param2_label_dna_1.hide()NEWLINE self.param2_label_dna_2.hide()NEWLINE self.param2_label_dna_3.hide()NEWLINE self.param2_label_dna_4.hide()NEWLINE self.param2_label_dna_5.hide()NEWLINE self.param2_label_dna_6.hide()NEWLINE self.param2_lineEdit_dna_1.hide()NEWLINE self.param2_lineEdit_dna_2.hide()NEWLINE self.param2_lineEdit_dna_3.hide()NEWLINE self.param2_lineEdit_dna_4.hide()NEWLINE self.param2_lineEdit_dna_5.hide()NEWLINE self.param2_lineEdit_dna_6.hide()NEWLINE NEWLINE self.hlayout4_vc = QtWidgets.QHBoxLayout()NEWLINE self.hlayout4_vc.addStretch(1)NEWLINE self.vc_add_dna = QtWidgets.QPushButton()NEWLINE self.vc_add_dna.setGeometry(QtCore.QRect(530, 45, 70, 30))NEWLINE self.vc_add_dna.setText("Advanced")NEWLINE self.vc_add_dna.setStyleSheet("background-color: #704214")NEWLINE self.hlayout4_vc.addWidget(self.vc_add_dna)NEWLINE self.vlayout_vc.addItem(self.hlayout4_vc)NEWLINE NEWLINE self.vc_groupbox.setLayout(self.vlayout_vc)NEWLINE NEWLINE def create_annotator_groupbox(self):NEWLINE self.annotator_groupbox = QGroupBox("Annotator")NEWLINE self.vlayout_annotator= QtWidgets.QVBoxLayout()NEWLINE self.vlayout.setSpacing(20)NEWLINE self.hlayout0_annotator = QtWidgets.QHBoxLayout()NEWLINE NEWLINE self.hlayout1_warning_annotator = QtWidgets.QHBoxLayout()NEWLINE self.AnnotatorWarningtext = QtWidgets.QLabel()NEWLINE self.AnnotatorWarningtext.setGeometry(QtCore.QRect(90, 0, 331, 22))NEWLINE self.AnnotatorWarningtext.setObjectName("AnnotatorWarningtext")NEWLINE self.AnnotatorWarningtext.setStyleSheet("color: orange")NEWLINE self.AnnotatorWarningtext.setText("Choose Annovar if proceeding for cTaG or NBDriver")NEWLINE self.hlayout1_warning_annotator.addWidget(self.AnnotatorWarningtext, 0, alignment=QtCore.Qt.AlignCenter)NEWLINE self.vlayout_annotator.addItem(self.hlayout1_warning_annotator)NEWLINE NEWLINE font_info = QtGui.QFont()NEWLINE font_info.setPointSize(8.5)NEWLINE self.Annotatorninfoicon_dna = QtWidgets.QPushButton(self.annotator_groupbox)NEWLINE self.Annotatorninfoicon_dna.setFlat(True)NEWLINE self.Annotatorninfoicon_dna.setGeometry(QtCore.QRect(64, 0, 20, 20))NEWLINE self.Annotatorninfoicon_dna.setToolTip("Software for functionally annotating the identified variants")NEWLINE self.Annotatorninfoicon_dna.setFont(font_info)NEWLINE self.Annotatorninfoicon_dna.setIcon(QtGui.QIcon(os.path.join(module_dir,'./icons/info.svg')))NEWLINE self.Annotatorninfoicon_dna.setIconSize(QtCore.QSize(13, 13)) NEWLINE NEWLINE self.AnnotatorcomboBoxDNA = QtWidgets.QComboBox()NEWLINE self.AnnotatorcomboBoxDNA.setSizeAdjustPolicy(QtWidgets.QComboBox.AdjustToContents)NEWLINE self.AnnotatorcomboBoxDNA.setObjectName("AnnotatorcomboBoxDNA")NEWLINE self.AnnotatorcomboBoxDNA.addItem("")NEWLINE self.AnnotatorcomboBoxDNA.addItem("")NEWLINE self.hlayout0_annotator.addWidget(self.AnnotatorcomboBoxDNA)NEWLINE self.hlayout0_annotator.addStretch(0)NEWLINE self.vlayout_annotator.addItem(self.hlayout0_annotator)NEWLINE NEWLINE self.hlayout1_annotator = QtWidgets.QHBoxLayout()NEWLINE self.RefNamelabelDNA = QtWidgets.QLabel()NEWLINE self.RefNamelabelDNA.setObjectName("RefNamelabelDNA")NEWLINE self.RefNamecomboBoxDNA = QtWidgets.QComboBox()NEWLINE self.RefNamecomboBoxDNA.setObjectName("RefNamecomboBoxDNA")NEWLINE self.RefNamecomboBoxDNA.addItem("hg38")NEWLINE self.RefNamecomboBoxDNA.addItem("GRCh38.86")NEWLINE self.RefNamecomboBoxDNA.addItem("hg19")NEWLINE self.RefNamecomboBoxDNA.addItem("GRCh37.75")NEWLINE self.hlayout1_annotator.addWidget(self.RefNamelabelDNA)NEWLINE self.hlayout1_annotator.addWidget(self.RefNamecomboBoxDNA)NEWLINE self.vlayout_annotator.addItem(self.hlayout1_annotator)NEWLINE NEWLINE NEWLINE self.param3_label_dna_1 = QtWidgets.QLabel()NEWLINE self.param3_label_dna_1.setGeometry(QtCore.QRect(20, 40, 91, 18))NEWLINE self.param3_lineEdit_dna_1 = QtWidgets.QLineEdit()NEWLINE self.param3_lineEdit_dna_1.setGeometry(QtCore.QRect(120, 40, 70, 18))NEWLINE self.param3_label_dna_3 = QtWidgets.QLabel()NEWLINE self.param3_label_dna_3.setGeometry(QtCore.QRect(200, 40, 91, 18))NEWLINE self.param3_lineEdit_dna_3 = QtWidgets.QLineEdit()NEWLINE self.param3_lineEdit_dna_3.setGeometry(QtCore.QRect(280, 40, 70, 18))NEWLINE self.param3_label_dna_5 = QtWidgets.QLabel()NEWLINE self.param3_label_dna_5.setGeometry(QtCore.QRect(360, 40, 91, 18))NEWLINE self.param3_lineEdit_dna_5 = QtWidgets.QLineEdit()NEWLINE self.param3_lineEdit_dna_5.setGeometry(QtCore.QRect(440, 40, 70, 18))NEWLINE NEWLINE self.param3_label_dna_2 = QtWidgets.QLabel()NEWLINE self.param3_label_dna_2.setGeometry(QtCore.QRect(20, 65, 91, 18))NEWLINE self.param3_lineEdit_dna_2 = QtWidgets.QLineEdit()NEWLINE self.param3_lineEdit_dna_2.setGeometry(QtCore.QRect(120, 65, 70, 18))NEWLINE self.param3_label_dna_4 = QtWidgets.QLabel()NEWLINE self.param3_label_dna_4.setGeometry(QtCore.QRect(200, 65, 91, 18))NEWLINE self.param3_lineEdit_dna_4 = QtWidgets.QLineEdit()NEWLINE self.param3_lineEdit_dna_4.setGeometry(QtCore.QRect(280, 65, 70, 18))NEWLINE self.param3_label_dna_6 = QtWidgets.QLabel()NEWLINE self.param3_label_dna_6.setGeometry(QtCore.QRect(360, 65, 91, 18))NEWLINE self.param3_lineEdit_dna_6 = QtWidgets.QLineEdit()NEWLINE self.param3_lineEdit_dna_6.setGeometry(QtCore.QRect(440, 65, 70, 18))NEWLINE NEWLINE self.grid_annotator = QtWidgets.QGridLayout()NEWLINE self.grid_annotator.setSpacing(10)NEWLINE self.grid_annotator.addWidget(self.param3_label_dna_1, 0, 0)NEWLINE self.grid_annotator.addWidget(self.param3_lineEdit_dna_1, 0, 1)NEWLINE self.grid_annotator.addWidget(self.param3_label_dna_3, 0, 2)NEWLINE self.grid_annotator.addWidget(self.param3_lineEdit_dna_3, 0, 3)NEWLINE self.grid_annotator.addWidget(self.param3_label_dna_5, 0, 4)NEWLINE self.grid_annotator.addWidget(self.param3_lineEdit_dna_5, 0, 5)NEWLINE self.grid_annotator.addWidget(self.param3_label_dna_2, 1,0)NEWLINE self.grid_annotator.addWidget(self.param3_lineEdit_dna_2, 1,1)NEWLINE self.grid_annotator.addWidget(self.param3_label_dna_4, 1,2)NEWLINE self.grid_annotator.addWidget(self.param3_lineEdit_dna_4, 1, 3)NEWLINE self.grid_annotator.addWidget(self.param3_label_dna_6, 1,4)NEWLINE self.grid_annotator.addWidget(self.param3_lineEdit_dna_6, 1,5)NEWLINE NEWLINE self.param3_label_dna_1.hide()NEWLINE self.param3_label_dna_2.hide()NEWLINE self.param3_label_dna_3.hide()NEWLINE self.param3_label_dna_4.hide()NEWLINE self.param3_label_dna_5.hide()NEWLINE self.param3_label_dna_6.hide()NEWLINE self.param3_lineEdit_dna_1.hide()NEWLINE self.param3_lineEdit_dna_2.hide()NEWLINE self.param3_lineEdit_dna_3.hide()NEWLINE self.param3_lineEdit_dna_4.hide()NEWLINE self.param3_lineEdit_dna_5.hide()NEWLINE self.param3_lineEdit_dna_6.hide()NEWLINE NEWLINE self.vlayout_annotator.addItem(self.grid_annotator)NEWLINE NEWLINE self.hlayout4_annotator = QtWidgets.QHBoxLayout()NEWLINE self.hlayout4_annotator.addStretch(1)NEWLINE self.annotator_add_dna = QtWidgets.QPushButton()NEWLINE self.annotator_add_dna.setGeometry(QtCore.QRect(530, 45, 70, 30))NEWLINE self.annotator_add_dna.setText("Advanced")NEWLINE self.annotator_add_dna.setStyleSheet("background-color: #704214")NEWLINE self.hlayout4_annotator.addWidget(self.annotator_add_dna)NEWLINE self.vlayout_annotator.addItem(self.hlayout4_annotator)NEWLINE self.annotator_groupbox.setLayout(self.vlayout_annotator)NEWLINE NEWLINE def create_group_next(self):NEWLINE self.next_groupbox = QGroupBox()NEWLINE self.vlayout_next= QtWidgets.QVBoxLayout()NEWLINE self.nextbuttontoolDNA = QtWidgets.QPushButton()NEWLINE self.nextbuttontoolDNA.setGeometry(QtCore.QRect(635, 400, 45, 45))NEWLINE self.nextbuttontoolDNA.setObjectName("nextbuttontoolDNA")NEWLINE ###NEWLINE self.previousbuttontoolDNA = QtWidgets.QPushButton()NEWLINE self.previousbuttontoolDNA.setGeometry(QtCore.QRect(10, 400, 45, 45))NEWLINE self.previousbuttontoolDNA.setObjectName("previousbuttontoolDNA")NEWLINE NEWLINE self.hbox_next = QtWidgets.QHBoxLayout()NEWLINE self.hbox_next.addWidget(self.previousbuttontoolDNA, 0, alignment=QtCore.Qt.AlignLeft)NEWLINE self.hbox_next.addWidget(self.nextbuttontoolDNA, 0, alignment=QtCore.Qt.AlignRight)NEWLINE NEWLINE self.vlayout_next.addItem(self.hbox_next)NEWLINE self.next_groupbox.setLayout(self.vlayout_next)NEWLINE NEWLINE def create_aligner_groupbox_rna(self):NEWLINE font_label = QtGui.QFont()NEWLINE font_label.setPointSize(8.5)NEWLINE color = QtGui.QColor(233, 10, 150)NEWLINE self.aligner_groupbox_rna = QGroupBox("Aligner")NEWLINE self.vlayout_rna= QtWidgets.QVBoxLayout()NEWLINE self.hlayout0_aligner_rna = QtWidgets.QHBoxLayout()NEWLINE NEWLINE font_info = QtGui.QFont()NEWLINE font_info.setPointSize(8.5)NEWLINE self.Alignerninfoicon_rna = QtWidgets.QPushButton(self.aligner_groupbox_rna)NEWLINE self.Alignerninfoicon_rna.setFlat(True)NEWLINE self.Alignerninfoicon_rna.setGeometry(QtCore.QRect(48, 0, 20, 20))NEWLINE self.Alignerninfoicon_rna.setToolTip("Software for arranging sequences to identify regions of similarity")NEWLINE self.Alignerninfoicon_rna.setFont(font_info)NEWLINE self.Alignerninfoicon_rna.setIcon(QtGui.QIcon(os.path.join(module_dir,'./icons/info.svg')))NEWLINE self.Alignerninfoicon_rna.setIconSize(QtCore.QSize(13, 13)) NEWLINE NEWLINE self.AlignercomboBoxRNA = QtWidgets.QComboBox()NEWLINE self.AlignercomboBoxRNA.move(20, 10)NEWLINE self.AlignercomboBoxRNA.setSizeAdjustPolicy(QtWidgets.QComboBox.AdjustToContents)NEWLINE self.AlignercomboBoxRNA.setObjectName("AlignercomboBoxRNA")NEWLINE self.AlignercomboBoxRNA.addItem("")NEWLINE self.AlignercomboBoxRNA.addItem("")NEWLINE self.hlayout0_aligner_rna.addWidget(self.AlignercomboBoxRNA)NEWLINE self.hlayout0_aligner_rna.addStretch(0)NEWLINE self.vlayout_rna.addItem(self.hlayout0_aligner_rna)NEWLINE self.hlayout1_aligner_rna = QtWidgets.QHBoxLayout()NEWLINE self.hlayout1_aligner_rna.setSpacing(10)NEWLINE self.StarIndexlabel = QtWidgets.QLabel()NEWLINE self.StarIndexlabel.setObjectName("StarIndexlabel")NEWLINE self.StarIndexlineEdit = QtWidgets.QLineEdit()NEWLINE self.StarIndexpushButton = QtWidgets.QPushButton()NEWLINE self.StarIndexpushButton.setObjectName("StarIndexpushButton")NEWLINE NEWLINE self.hlayout1_aligner_rna.addWidget(self.StarIndexlabel)NEWLINE self.hlayout1_aligner_rna.addWidget(self.StarIndexlineEdit)NEWLINE self.hlayout1_aligner_rna.addWidget(self.StarIndexpushButton)NEWLINE self.vlayout_rna.addItem(self.hlayout1_aligner_rna)NEWLINE NEWLINE self.hlayout1_error_aligner_rna = QtWidgets.QHBoxLayout()NEWLINE self.StarIndexErrortext = QtWidgets.QLabel()NEWLINE self.StarIndexErrortext.setGeometry(QtCore.QRect(170, 116, 300, 15))NEWLINE self.StarIndexErrortext.setFont(font_label)NEWLINE self.StarIndexErrortext.setStyleSheet("color: red")NEWLINE self.StarIndexErrortext.hide()NEWLINE self.hlayout1_error_aligner_rna.addWidget(self.StarIndexErrortext, 0, alignment=QtCore.Qt.AlignCenter)NEWLINE self.vlayout_rna.addItem(self.hlayout1_error_aligner_rna)NEWLINE NEWLINE self.hlayout0_or_rna = QtWidgets.QHBoxLayout()NEWLINE self.OrLabel_rna = QtWidgets.QLabel()NEWLINE self.OrLabel_rna.setGeometry(QtCore.QRect(340, 130, 270, 23))NEWLINE self.OrLabel_rna.setObjectName("OrLabel_rna")NEWLINE self.hlayout0_or_rna.addWidget(self.OrLabel_rna, 0, alignment=QtCore.Qt.AlignCenter)NEWLINE self.vlayout_rna.addItem(self.hlayout0_or_rna)NEWLINE NEWLINE self.hlayout0_runindex_rna = QtWidgets.QHBoxLayout()NEWLINE self.RunIndexrnapushButton = QtWidgets.QPushButton()NEWLINE self.RunIndexrnapushButton.setObjectName("RunIndexrnapushButton")NEWLINE self.hlayout0_runindex_rna.addWidget(self.RunIndexrnapushButton, 0, alignment=QtCore.Qt.AlignCenter)NEWLINE self.RunIndexrnaButtonErroricon = QtWidgets.QPushButton()NEWLINE self.RunIndexrnaButtonErroricon.setGeometry(QtCore.QRect(480, 175, 20, 20))NEWLINE self.RunIndexrnaButtonErroricon.setToolTip("Check and Run Index Again!")NEWLINE self.RunIndexrnaButtonErroricon.setFont(font_label)NEWLINE self.RunIndexrnaButtonErroricon.setIcon(QtGui.QIcon(os.path.join(module_dir,'./icons/warning.svg')))NEWLINE self.RunIndexrnaButtonErroricon.hide()NEWLINE self.hlayout0_runindex_rna.addWidget(self.RunIndexrnaButtonErroricon, 0, alignment=QtCore.Qt.AlignCenter)NEWLINE self.vlayout_rna.addItem(self.hlayout0_runindex_rna)NEWLINE NEWLINE self.hlayout0_pb_rna = QtWidgets.QHBoxLayout()NEWLINE self.progressBar_sub2_rna = QtWidgets.QProgressBar()NEWLINE self.progressBar_sub2_rna.setGeometry(QtCore.QRect(10, 230, 665, 17))NEWLINE self.progressBar_sub2_rna.setProperty("value", 0)NEWLINE self.progressBar_sub2_rna.setObjectName("progressBar_sub2_rna")NEWLINE self.hlayout0_pb_rna.addWidget(self.progressBar_sub2_rna)NEWLINE self.vlayout_rna.addItem(self.hlayout0_pb_rna)NEWLINE NEWLINE self.param1_label_rna_1 = QtWidgets.QLabel()NEWLINE self.param1_label_rna_1.setGeometry(QtCore.QRect(20, 40, 91, 18))NEWLINE self.param1_lineEdit_rna_1 = QtWidgets.QLineEdit()NEWLINE self.param1_lineEdit_rna_1.setGeometry(QtCore.QRect(120, 40, 70, 18))NEWLINE self.param1_label_rna_3 = QtWidgets.QLabel()NEWLINE self.param1_label_rna_3.setGeometry(QtCore.QRect(200, 40, 91, 18))NEWLINE self.param1_lineEdit_rna_3 = QtWidgets.QLineEdit()NEWLINE self.param1_lineEdit_rna_3.setGeometry(QtCore.QRect(280, 40, 70, 18))NEWLINE self.param1_label_rna_5 = QtWidgets.QLabel()NEWLINE self.param1_label_rna_5.setGeometry(QtCore.QRect(360, 40, 91, 18))NEWLINE self.param1_lineEdit_rna_5 = QtWidgets.QLineEdit()NEWLINE self.param1_lineEdit_rna_5.setGeometry(QtCore.QRect(440, 40, 70, 18))NEWLINENEWLINE NEWLINE self.param1_label_rna_2 = QtWidgets.QLabel()NEWLINE self.param1_label_rna_2.setGeometry(QtCore.QRect(20, 65, 91, 18))NEWLINE self.param1_lineEdit_rna_2 = QtWidgets.QLineEdit()NEWLINE self.param1_lineEdit_rna_2.setGeometry(QtCore.QRect(120, 65, 70, 18))NEWLINE self.param1_label_rna_4 = QtWidgets.QLabel()NEWLINE self.param1_label_rna_4.setGeometry(QtCore.QRect(200, 65, 91, 18))NEWLINE self.param1_lineEdit_rna_4 = QtWidgets.QLineEdit()NEWLINE self.param1_lineEdit_rna_4.setGeometry(QtCore.QRect(280, 65, 70, 18))NEWLINE self.param1_label_rna_6 = QtWidgets.QLabel()NEWLINE self.param1_label_rna_6.setGeometry(QtCore.QRect(360, 65, 91, 18))NEWLINE self.param1_lineEdit_rna_6 = QtWidgets.QLineEdit()NEWLINE self.param1_lineEdit_rna_6.setGeometry(QtCore.QRect(440, 65, 70, 18))NEWLINE NEWLINE self.grid_aligner_rna = QtWidgets.QGridLayout()NEWLINE self.grid_aligner_rna.setSpacing(10)NEWLINE self.grid_aligner_rna.addWidget(self.param1_label_rna_1, 0, 0)NEWLINE self.grid_aligner_rna.addWidget(self.param1_lineEdit_rna_1, 0, 1)NEWLINE self.grid_aligner_rna.addWidget(self.param1_label_rna_3, 0, 2)NEWLINE self.grid_aligner_rna.addWidget(self.param1_lineEdit_rna_3, 0, 3)NEWLINE self.grid_aligner_rna.addWidget(self.param1_label_rna_5, 0, 4)NEWLINE self.grid_aligner_rna.addWidget(self.param1_lineEdit_rna_5, 0, 5)NEWLINE self.grid_aligner_rna.addWidget(self.param1_label_rna_2, 1,0)NEWLINE self.grid_aligner_rna.addWidget(self.param1_lineEdit_rna_2, 1,1)NEWLINE self.grid_aligner_rna.addWidget(self.param1_label_rna_4, 1,2)NEWLINE self.grid_aligner_rna.addWidget(self.param1_lineEdit_rna_4, 1, 3)NEWLINE self.grid_aligner_rna.addWidget(self.param1_label_rna_6, 1,4)NEWLINE self.grid_aligner_rna.addWidget(self.param1_lineEdit_rna_6, 1,5)NEWLINE NEWLINE self.vlayout_rna.addItem(self.grid_aligner_rna)NEWLINE NEWLINE NEWLINE self.hlayout4_aligner_rna = QtWidgets.QHBoxLayout()NEWLINE self.hlayout4_aligner_rna.addStretch(1)NEWLINE self.aligner_add_rna = QtWidgets.QPushButton()NEWLINE self.aligner_add_rna.setGeometry(QtCore.QRect(530, 45, 70, 30))NEWLINE self.aligner_add_rna.setText("Advanced")NEWLINE self.aligner_add_rna.setStyleSheet("background-color: #704214")NEWLINE self.hlayout4_aligner_rna.addWidget(self.aligner_add_rna)NEWLINE self.vlayout_rna.addItem(self.hlayout4_aligner_rna)NEWLINE NEWLINE self.aligner_groupbox_rna.setLayout(self.vlayout_rna)NEWLINE NEWLINE font_param = QtGui.QFont()NEWLINE font_param.setBold(True)NEWLINENEWLINE NEWLINE ##set of lbels and lineedits for params##NEWLINE NEWLINE self.param1_label_rna_1.hide()NEWLINE self.param1_label_rna_2.hide()NEWLINE self.param1_label_rna_3.hide()NEWLINE self.param1_label_rna_4.hide()NEWLINE self.param1_label_rna_5.hide()NEWLINE self.param1_label_rna_6.hide()NEWLINE self.param1_lineEdit_rna_1.hide()NEWLINE self.param1_lineEdit_rna_2.hide()NEWLINE self.param1_lineEdit_rna_3.hide()NEWLINE self.param1_lineEdit_rna_4.hide()NEWLINE self.param1_lineEdit_rna_5.hide()NEWLINE self.param1_lineEdit_rna_6.hide()NEWLINE NEWLINE NEWLINE NEWLINE NEWLINE def create_em_groupbox(self):NEWLINE self.em_groupbox = QGroupBox("Expression Modeller")NEWLINE self.vlayout_em= QtWidgets.QVBoxLayout()NEWLINE self.hlayout0_em = QtWidgets.QHBoxLayout()NEWLINE NEWLINE font_info = QtGui.QFont()NEWLINE font_info.setPointSize(8.5)NEWLINE self.eminfoicon_rna = QtWidgets.QPushButton(self.em_groupbox)NEWLINE self.eminfoicon_rna.setFlat(True)NEWLINE self.eminfoicon_rna.setGeometry(QtCore.QRect(125, 0, 20, 20))NEWLINE self.eminfoicon_rna.setToolTip("Expression modelling refers to count the reads mapped \n to individual genes from the aligned the file")NEWLINE self.eminfoicon_rna.setFont(font_info)NEWLINE self.eminfoicon_rna.setIcon(QtGui.QIcon(os.path.join(module_dir,'./icons/info.svg')))NEWLINE self.eminfoicon_rna.setIconSize(QtCore.QSize(13, 13)) NEWLINE NEWLINE self.EMcomboBoxRNA = QtWidgets.QComboBox()NEWLINE self.EMcomboBoxRNA.setObjectName("EMcomboBoxRNA")NEWLINE self.EMcomboBoxRNA.addItem("")NEWLINE self.EMcomboBoxRNA.addItem("")NEWLINE self.hlayout0_em.addWidget(self.EMcomboBoxRNA)NEWLINE self.hlayout0_em.addStretch(0)NEWLINE self.vlayout_em.addItem(self.hlayout0_em)NEWLINE NEWLINE NEWLINE self.param2_label_rna_1 = QtWidgets.QLabel()NEWLINE self.param2_label_rna_1.setGeometry(QtCore.QRect(20, 40, 91, 18))NEWLINE self.param2_lineEdit_rna_1 = QtWidgets.QLineEdit()NEWLINE self.param2_lineEdit_rna_1.setGeometry(QtCore.QRect(120, 40, 70, 18))NEWLINE self.param2_label_rna_3 = QtWidgets.QLabel()NEWLINE self.param2_label_rna_3.setGeometry(QtCore.QRect(200, 40, 91, 18))NEWLINE self.param2_lineEdit_rna_3 = QtWidgets.QLineEdit()NEWLINE self.param2_lineEdit_rna_3.setGeometry(QtCore.QRect(280, 40, 70, 18))NEWLINE self.param2_label_rna_5 = QtWidgets.QLabel()NEWLINE self.param2_label_rna_5.setGeometry(QtCore.QRect(360, 40, 91, 18))NEWLINE self.param2_lineEdit_rna_5 = QtWidgets.QLineEdit()NEWLINE self.param2_lineEdit_rna_5.setGeometry(QtCore.QRect(440, 40, 70, 18))NEWLINE NEWLINE self.param2_label_rna_2 = QtWidgets.QLabel()NEWLINE self.param2_label_rna_2.setGeometry(QtCore.QRect(20, 65, 91, 18))NEWLINE self.param2_lineEdit_rna_2 = QtWidgets.QLineEdit()NEWLINE self.param2_lineEdit_rna_2.setGeometry(QtCore.QRect(120, 65, 70, 18))NEWLINE self.param2_label_rna_4 = QtWidgets.QLabel()NEWLINE self.param2_label_rna_4.setGeometry(QtCore.QRect(200, 65, 91, 18))NEWLINE self.param2_lineEdit_rna_4 = QtWidgets.QLineEdit()NEWLINE self.param2_lineEdit_rna_4.setGeometry(QtCore.QRect(280, 65, 70, 18))NEWLINE self.param2_label_rna_6 = QtWidgets.QLabel()NEWLINE self.param2_label_rna_6.setGeometry(QtCore.QRect(360, 65, 91, 18))NEWLINE self.param2_lineEdit_rna_6 = QtWidgets.QLineEdit()NEWLINE self.param2_lineEdit_rna_6.setGeometry(QtCore.QRect(440, 65, 70, 18))NEWLINE NEWLINE self.grid_em = QtWidgets.QGridLayout()NEWLINE self.grid_em.setSpacing(10)NEWLINE self.grid_em.addWidget(self.param2_label_rna_1, 0, 0)NEWLINE self.grid_em.addWidget(self.param2_lineEdit_rna_1, 0, 1)NEWLINE self.grid_em.addWidget(self.param2_label_rna_3, 0, 2)NEWLINE self.grid_em.addWidget(self.param2_lineEdit_rna_3, 0, 3)NEWLINE self.grid_em.addWidget(self.param2_label_rna_5, 0, 4)NEWLINE self.grid_em.addWidget(self.param2_lineEdit_rna_5, 0, 5)NEWLINE self.grid_em.addWidget(self.param2_label_rna_2, 1,0)NEWLINE self.grid_em.addWidget(self.param2_lineEdit_rna_2, 1,1)NEWLINE self.grid_em.addWidget(self.param2_label_rna_4, 1,2)NEWLINE self.grid_em.addWidget(self.param2_lineEdit_rna_4, 1, 3)NEWLINE self.grid_em.addWidget(self.param2_label_rna_6, 1,4)NEWLINE self.grid_em.addWidget(self.param2_lineEdit_rna_6, 1,5)NEWLINE NEWLINE self.vlayout_em.addItem(self.grid_em)NEWLINE self.param2_label_rna_1.hide()NEWLINE self.param2_label_rna_2.hide()NEWLINE self.param2_label_rna_3.hide()NEWLINE self.param2_label_rna_4.hide()NEWLINE self.param2_label_rna_5.hide()NEWLINE self.param2_label_rna_6.hide()NEWLINE self.param2_lineEdit_rna_1.hide()NEWLINE self.param2_lineEdit_rna_2.hide()NEWLINE self.param2_lineEdit_rna_3.hide()NEWLINE self.param2_lineEdit_rna_4.hide()NEWLINE self.param2_lineEdit_rna_5.hide()NEWLINE self.param2_lineEdit_rna_6.hide()NEWLINE NEWLINE self.hlayout4_em = QtWidgets.QHBoxLayout()NEWLINE self.hlayout4_em.addStretch(1)NEWLINE self.em_add_rna = QtWidgets.QPushButton()NEWLINE self.em_add_rna.setGeometry(QtCore.QRect(530, 45, 70, 30))NEWLINE self.em_add_rna.setText("Advanced")NEWLINE self.em_add_rna.setStyleSheet("background-color: #704214")NEWLINE self.hlayout4_em.addWidget(self.em_add_rna)NEWLINE self.vlayout_em.addItem(self.hlayout4_em)NEWLINE NEWLINE self.em_groupbox.setLayout(self.vlayout_em)NEWLINE NEWLINE def create_de_groupbox(self):NEWLINE self.de_groupbox = QGroupBox("Differential Expression")NEWLINE self.vlayout_de= QtWidgets.QVBoxLayout()NEWLINE self.vlayout_de.setSpacing(20)NEWLINE self.hlayout0_de = QtWidgets.QHBoxLayout()NEWLINE NEWLINE font_info = QtGui.QFont()NEWLINE font_info.setPointSize(8.5)NEWLINE self.deninfoicon_rna = QtWidgets.QPushButton(self.de_groupbox)NEWLINE self.deninfoicon_rna.setFlat(True)NEWLINE self.deninfoicon_rna.setGeometry(QtCore.QRect(140, 0, 20, 20))NEWLINE self.deninfoicon_rna.setToolTip("Differential expression analysis referes to the normalization of read count data \n and employing statistical methods to discover quantitative changes\n in expression levels between different data groups")NEWLINE self.deninfoicon_rna.setFont(font_info)NEWLINE self.deninfoicon_rna.setIcon(QtGui.QIcon(os.path.join(module_dir,'./icons/info.svg')))NEWLINE self.deninfoicon_rna.setIconSize(QtCore.QSize(13, 13)) NEWLINE NEWLINE self.DEcomboBoxRNA = QtWidgets.QComboBox()NEWLINE self.DEcomboBoxRNA.setObjectName("DEcomboBoxRNA")NEWLINE self.DEcomboBoxRNA.addItem("")NEWLINE self.DEcomboBoxRNA.addItem("")NEWLINE self.hlayout0_de.addWidget(self.DEcomboBoxRNA)NEWLINE self.hlayout0_de.addStretch(0)NEWLINE self.vlayout_de.addItem(self.hlayout0_de)NEWLINE NEWLINENEWLINE NEWLINE NEWLINE self.param3_label_rna_1 = QtWidgets.QLabel()NEWLINE self.param3_label_rna_1.setGeometry(QtCore.QRect(20, 40, 91, 18))NEWLINE self.param3_lineEdit_rna_1 = QtWidgets.QLineEdit()NEWLINE self.param3_lineEdit_rna_1.setGeometry(QtCore.QRect(120, 40, 70, 18))NEWLINE self.param3_label_rna_3 = QtWidgets.QLabel()NEWLINE self.param3_label_rna_3.setGeometry(QtCore.QRect(200, 40, 91, 18))NEWLINE self.param3_lineEdit_rna_3 = QtWidgets.QLineEdit()NEWLINE self.param3_lineEdit_rna_3.setGeometry(QtCore.QRect(280, 40, 70, 18))NEWLINE self.param3_label_rna_5 = QtWidgets.QLabel()NEWLINE self.param3_label_rna_5.setGeometry(QtCore.QRect(360, 40, 91, 18))NEWLINE self.param3_lineEdit_rna_5 = QtWidgets.QLineEdit()NEWLINE self.param3_lineEdit_rna_5.setGeometry(QtCore.QRect(440, 40, 70, 18))NEWLINE NEWLINE self.param3_label_rna_2 = QtWidgets.QLabel()NEWLINE self.param3_label_rna_2.setGeometry(QtCore.QRect(20, 65, 91, 18))NEWLINE self.param3_lineEdit_rna_2 = QtWidgets.QLineEdit()NEWLINE self.param3_lineEdit_rna_2.setGeometry(QtCore.QRect(120, 65, 70, 18))NEWLINE self.param3_label_rna_4 = QtWidgets.QLabel()NEWLINE self.param3_label_rna_4.setGeometry(QtCore.QRect(200, 65, 91, 18))NEWLINE self.param3_lineEdit_rna_4 = QtWidgets.QLineEdit()NEWLINE self.param3_lineEdit_rna_4.setGeometry(QtCore.QRect(280, 65, 70, 18))NEWLINE self.param3_label_rna_6 = QtWidgets.QLabel()NEWLINE self.param3_label_rna_6.setGeometry(QtCore.QRect(360, 65, 91, 18))NEWLINE self.param3_lineEdit_rna_6 = QtWidgets.QLineEdit()NEWLINE self.param3_lineEdit_rna_6.setGeometry(QtCore.QRect(440, 65, 70, 18))NEWLINE NEWLINE self.grid_de = QtWidgets.QGridLayout()NEWLINE self.grid_de.setSpacing(10)NEWLINE self.grid_de.addWidget(self.param3_label_rna_1, 0, 0)NEWLINE self.grid_de.addWidget(self.param3_lineEdit_rna_1, 0, 1)NEWLINE self.grid_de.addWidget(self.param3_label_rna_3, 0, 2)NEWLINE self.grid_de.addWidget(self.param3_lineEdit_rna_3, 0, 3)NEWLINE self.grid_de.addWidget(self.param3_label_rna_5, 0, 4)NEWLINE self.grid_de.addWidget(self.param3_lineEdit_rna_5, 0, 5)NEWLINE self.grid_de.addWidget(self.param3_label_rna_2, 1,0)NEWLINE self.grid_de.addWidget(self.param3_lineEdit_rna_2, 1,1)NEWLINE self.grid_de.addWidget(self.param3_label_rna_4, 1,2)NEWLINE self.grid_de.addWidget(self.param3_lineEdit_rna_4, 1, 3)NEWLINE self.grid_de.addWidget(self.param3_label_rna_6, 1,4)NEWLINE self.grid_de.addWidget(self.param3_lineEdit_rna_6, 1,5)NEWLINE NEWLINE self.param3_label_rna_1.hide()NEWLINE self.param3_label_rna_2.hide()NEWLINE self.param3_label_rna_3.hide()NEWLINE self.param3_label_rna_4.hide()NEWLINE self.param3_label_rna_5.hide()NEWLINE self.param3_label_rna_6.hide()NEWLINE self.param3_lineEdit_rna_1.hide()NEWLINE self.param3_lineEdit_rna_2.hide()NEWLINE self.param3_lineEdit_rna_3.hide()NEWLINE self.param3_lineEdit_rna_4.hide()NEWLINE self.param3_lineEdit_rna_5.hide()NEWLINE self.param3_lineEdit_rna_6.hide()NEWLINE NEWLINE self.vlayout_de.addItem(self.grid_de)NEWLINE NEWLINE self.hlayout4_de = QtWidgets.QHBoxLayout()NEWLINE self.hlayout4_de.addStretch(1)NEWLINE self.de_add_rna = QtWidgets.QPushButton()NEWLINE self.de_add_rna.setGeometry(QtCore.QRect(530, 45, 70, 30))NEWLINE self.de_add_rna.setText("Advanced")NEWLINE self.de_add_rna.setStyleSheet("background-color: #704214")NEWLINE self.hlayout4_de.addWidget(self.de_add_rna)NEWLINE self.vlayout_de.addItem(self.hlayout4_de)NEWLINE self.de_groupbox.setLayout(self.vlayout_de)NEWLINE NEWLINE def create_group_next_rna(self):NEWLINE self.next_groupbox_rna = QGroupBox()NEWLINE self.vlayout_next_rna= QtWidgets.QVBoxLayout()NEWLINE self.nextbuttontoolRNA = QtWidgets.QPushButton()NEWLINE self.nextbuttontoolRNA.setGeometry(QtCore.QRect(635, 400, 45, 45))NEWLINE self.nextbuttontoolRNA.setObjectName("nextbuttontoolRNA")NEWLINE ###NEWLINE self.previousbuttontoolRNA = QtWidgets.QPushButton()NEWLINE self.previousbuttontoolRNA.setGeometry(QtCore.QRect(10, 400, 45, 45))NEWLINE self.previousbuttontoolRNA.setObjectName("previousbuttontoolRNA")NEWLINE NEWLINE self.hbox_next_rna = QtWidgets.QHBoxLayout()NEWLINE self.hbox_next_rna.addWidget(self.previousbuttontoolRNA, 0, alignment=QtCore.Qt.AlignLeft)NEWLINE self.hbox_next_rna.addWidget(self.nextbuttontoolRNA, 0, alignment=QtCore.Qt.AlignRight)NEWLINE NEWLINE self.vlayout_next_rna.addItem(self.hbox_next_rna)NEWLINE self.next_groupbox_rna.setLayout(self.vlayout_next_rna)NEWLINE NEWLINE def get_essential(self, path, essential_line_edit_array):NEWLINE dataframe = pd.read_csv(path, header =0)NEWLINE self.essential = dataframe[dataframe["Essential"] == "yes"]NEWLINE self.new_essential = [essential_line_edit_array[i].text() for i in range(len(self.essential))]NEWLINE self.essential['New_value'] = self.new_essentialNEWLINE self.essential['New_value'] = self.essential['New_value'].astype('str')NEWLINE self.essential = self.essential.reset_index()NEWLINE self.essential_dict = dict()NEWLINE for row in self.essential.itertuples():NEWLINE if row[6] != row[8]:NEWLINE self.essential_dict[row[2]] = row[8]NEWLINE return self.essential_dictNEWLINE NEWLINE def get_additional_int(self, path):NEWLINE dataframe = pd.read_csv(path, header =0)NEWLINE self.additional_int = dataframe[(dataframe["Value"] == 'INT') & (dataframe["Essential"] == 'no')]NEWLINE self.new_values_int = [j.text() for j in self.adv_dialog.line_edit_list_int]NEWLINE self.additional_int['New Value'] = self.new_values_intNEWLINE self.additional_int['New Value'] = self.additional_int['New Value'].astype('str')NEWLINE self.additional_int = self.additional_int.reset_index()NEWLINE self.snakefile_dict_int = dict()NEWLINE for row in self.additional_int.itertuples():NEWLINE if row[6] != row[8]:NEWLINE self.snakefile_dict_int[row[2]] = row[8]NEWLINE return self.snakefile_dict_intNEWLINE NEWLINE def get_additional_float(self, path):NEWLINE dataframe = pd.read_csv(path, header =0)NEWLINE self.additional_float = dataframe[(dataframe["Value"] == 'FLOAT') & (dataframe["Essential"] == 'no')]NEWLINE self.new_values_float = [j.text() for j in self.adv_dialog.line_edit_list_float]NEWLINE self.additional_float['New Value'] = self.new_values_floatNEWLINE self.additional_float['New Value'] = self.additional_float['New Value'].astype('str')NEWLINE self.additional_float = self.additional_float.reset_index()NEWLINE self.snakefile_dict_float = dict()NEWLINE for row in self.additional_float.itertuples():NEWLINE if row[6] != row[8]:NEWLINE self.snakefile_dict_float[row[2]] = row[8]NEWLINE return self.snakefile_dict_floatNEWLINE NEWLINE def get_additional_str(self, path):NEWLINE dataframe = pd.read_csv(path, header =0)NEWLINE self.additional_str = dataframe[(dataframe["Value"] == 'STR') & (dataframe["Essential"] == 'no')]NEWLINE self.new_values_str = [j.text() for j in self.adv_dialog.line_edit_list_str]NEWLINE self.additional_str['New Value'] = self.new_values_strNEWLINE self.additional_str['New Value'] = self.additional_str['New Value'].astype('str')NEWLINE self.additional_str = self.additional_str.reset_index()NEWLINE self.snakefile_dict_str = dict()NEWLINE for j in self.adv_dialog.label_list_str:NEWLINE if j.isChecked() == True:NEWLINE self.new_values_str.append("TRUE")NEWLINE else:NEWLINE self.new_values_str.append("FALSE")NEWLINE self.additional_str['New Value'] = self.new_values_strNEWLINE self.additional_str['New Value'] = self.additional_str['New Value'].astype('str')NEWLINE self.additional_str = self.additional_str.reset_index()NEWLINE self.snakefile_dict_str = dict()NEWLINE for row in self.additional_str.itertuples():NEWLINE if row[6] != row[8]:NEWLINE self.snakefile_dict_str[row[2]] = row[8]NEWLINE return self.snakefile_dict_strNEWLINE NEWLINE def get_additional_na(self, path):NEWLINE dataframe = pd.read_csv(path, header =0)NEWLINE self.additional_na = dataframe[(dataframe["Value"] == 'na') & (dataframe["Essential"] == 'no')]NEWLINE self.new_values_na=[]NEWLINE for j in self.adv_dialog.radio_label_list_na:NEWLINE if j.isChecked() == True:NEWLINE self.new_values_na.append("yes")NEWLINE else:NEWLINE self.new_values_na.append("na")NEWLINE self.additional_na['New Value'] = self.new_values_naNEWLINE self.additional_na['New Value'] = self.additional_na['New Value'].astype('str')NEWLINE self.additional_na = self.additional_na.reset_index()NEWLINE self.snakefile_dict_na = dict()NEWLINE for row in self.additional_na.itertuples():NEWLINE if row[6] != row[8]:NEWLINE self.snakefile_dict_na[row[2]] = row[8]NEWLINE return self.snakefile_dict_naNEWLINE NEWLINE NEWLINE def on_clicked_nextbuttoninputDNA(self):NEWLINE if self.SamplesYesradioButton.isChecked() == True:NEWLINE if self.SampleslineEditDNA.text() == '':NEWLINE self.SamplesErrortextDNA.show()NEWLINE self.SamplesErrortextDNA.setText("Input Samples folder path!")NEWLINE self.DNAtabWidget.setCurrentIndex(0)NEWLINE self.DNAtabWidget.setTabEnabled(1, False)NEWLINE elif not os.path.exists(self.SampleslineEditDNA.text()):NEWLINE self.SamplesErrortextDNA.show()NEWLINE self.SamplesErrortextDNA.setText("File doesn't exist! Check the path!")NEWLINE self.DNAtabWidget.setCurrentIndex(0)NEWLINE self.DNAtabWidget.setTabEnabled(1, False)NEWLINE else:NEWLINE inputfile = fileinput.input("check_for_correct_filename_check.py", inplace = 1)NEWLINE for l in inputfile:NEWLINE if "test_dir =" in l:NEWLINE print(l.replace(l, "test_dir = '"+self.SampleslineEditDNA.text()+"/'"))NEWLINE else:NEWLINE print(l.rstrip())NEWLINE inputfile.close()NEWLINE subprocess.run(["python", "check_for_correct_filename_check.py"])NEWLINE if os.path.exists('name_check.txt'):NEWLINE self.DNAtabWidget.setCurrentIndex(0)NEWLINE self.DNAtabWidget.setTabEnabled(1, False)NEWLINE with open('name_check.txt') as errorcheck:NEWLINE content = errorcheck.readline()NEWLINE self.SamplesErrortextDNA.show()NEWLINE self.SamplesErrortextDNA.setText(content.rstrip())NEWLINE else:NEWLINE file = fileinput.input("write_tsv.py", inplace = 1)NEWLINE for l in file:NEWLINE if "test_dir =" in l:NEWLINE print(l.replace(l, "test_dir = '"+self.SampleslineEditDNA.text()+"/'"))NEWLINE else:NEWLINE print(l.rstrip())NEWLINE file.close()NEWLINE subprocess.run(["python", "write_tsv.py"])NEWLINE unitsdf =pd.read_table('units.tsv', header=0)NEWLINE self.UnitslineEditDNA.setText("units.tsv")NEWLINE Row_list =[]NEWLINE for index, rows in unitsdf.iterrows():NEWLINE my_list =[rows.condition]NEWLINE Row_list.append(my_list)NEWLINE if ['tumor'] in Row_list:NEWLINE self.VCcomboBoxDNA.setItemText(0, "Mutect2")NEWLINENEWLINE else:NEWLINE self.VCcomboBoxDNA.addItem("")NEWLINE self.VCcomboBoxDNA.addItem("")NEWLINE self.VCcomboBoxDNA.setItemText(0, "GATK_HC")NEWLINE self.VCcomboBoxDNA.setItemText(1, "bcftools_call")NEWLINE self.VCcomboBoxDNA.setItemText(2, "freebayes")NEWLINE NEWLINE NEWLINE NEWLINE if self.RefGenomelineEditDNA.text() == '':NEWLINE self.RefGenomeErrortextDNA.show()NEWLINE self.RefGenomeErrortextDNA.setText("Input reference genome file!")NEWLINE self.DNAtabWidget.setCurrentIndex(0)NEWLINE self.DNAtabWidget.setTabEnabled(1, False)NEWLINE elif not os.path.exists(self.RefGenomelineEditDNA.text()):NEWLINE self.RefGenomeErrortextDNA.show()NEWLINE self.RefGenomeErrortextDNA.setText("File doesn't exist! Check the path!")NEWLINE self.DNAtabWidget.setCurrentIndex(0)NEWLINE self.DNAtabWidget.setTabEnabled(1, False)NEWLINE elif os.path.splitext(self.RefGenomelineEditDNA.text())[-1] != ".fa":NEWLINE self.RefGenomeErrortextDNA.show()NEWLINE self.RefGenomeErrortextDNA.setText("File should have extension '.fa'")NEWLINE self.DNAtabWidget.setCurrentIndex(0)NEWLINE self.DNAtabWidget.setTabEnabled(1, False)NEWLINENEWLINE NEWLINE if self.RefVariantlineEditDNA.text()== '':NEWLINE self.RefVariantErrortextDNA.show()NEWLINE self.RefVariantErrortextDNA.setText("Input reference known variants file!")NEWLINE self.DNAtabWidget.setCurrentIndex(0)NEWLINE self.DNAtabWidget.setTabEnabled(1, False)NEWLINE elif not os.path.exists(self.RefVariantlineEditDNA.text()):NEWLINE self.RefVariantErrortextDNA.show()NEWLINE self.RefVariantErrortextDNA.setText("File doesn't exist! Check the path!")NEWLINE self.DNAtabWidget.setCurrentIndex(0)NEWLINE self.DNAtabWidget.setTabEnabled(1, False)NEWLINE elif os.path.splitext(self.RefVariantlineEditDNA.text())[-1] != ".gz":NEWLINE self.RefVariantErrortextDNA.show()NEWLINE self.RefVariantErrortextDNA.setText("File should have extension '.gz'")NEWLINE self.DNAtabWidget.setCurrentIndex(0)NEWLINE self.DNAtabWidget.setTabEnabled(1, False)NEWLINE elif (self.RefVariantlineEditDNA.text()).split(".")[-2] != "vcf":NEWLINE self.RefVariantErrortextDNA.show()NEWLINE self.RefVariantErrortextDNA.setText("File should be compressed 'vcf'")NEWLINE self.DNAtabWidget.setCurrentIndex(0)NEWLINE self.DNAtabWidget.setTabEnabled(1, False)NEWLINE if self.CorelineEditDNA.text()=='':NEWLINE self.CoreErrortextDNA.show()NEWLINE self.CoreErrortextDNA.setText("Input number of threads available")NEWLINE self.DNAtabWidget.setCurrentIndex(0)NEWLINE self.DNAtabWidget.setTabEnabled(1, False)NEWLINE elif not self.CorelineEditDNA.text().isnumeric():NEWLINE self.CoreErrortextDNA.show()NEWLINE self.CoreErrortextDNA.setText("Number of threads should be an integer")NEWLINE self.DNAtabWidget.setCurrentIndex(0)NEWLINE self.DNAtabWidget.setTabEnabled(1, False)NEWLINE elif (os.path.splitext(self.RefGenomelineEditDNA.text())[-1] == ".fa" and not os.path.exists('name_check.txt') and os.path.splitext(self.RefVariantlineEditDNA.text())[-1] == ".gz" and (self.RefVariantlineEditDNA.text().split(".")[-2]) == 'vcf' and self.CorelineEditDNA.text().isnumeric()):NEWLINE self.SamplesErrortextDNA.hide()NEWLINE self.UnitsErrortextDNA.hide()NEWLINE self.RefGenomeErrortextDNA.hide()NEWLINE self.RefVariantErrortextDNA.hide()NEWLINE self.DNAtabWidget.setCurrentIndex(1)NEWLINE self.DNAtabWidget.setTabEnabled(1, True)NEWLINE self.textBrowser.setTextColor(self._colors['blue'])NEWLINE self.textBrowser.append("Click on the 'View Quality control Results' button to view the FastQC report \n")NEWLINE else:NEWLINE if self.UnitslineEditDNA.text() == '':NEWLINE self.UnitsErrortextDNA.show()NEWLINE self.UnitsErrortextDNA.setText("Input Units table!")NEWLINE self.DNAtabWidget.setCurrentIndex(0)NEWLINE self.DNAtabWidget.setTabEnabled(1, False)NEWLINE elif not os.path.exists(self.UnitslineEditDNA.text()):NEWLINE self.UnitsErrortextDNA.show()NEWLINE self.UnitsErrortextDNA.setText("File doesn't exist! Check the path!")NEWLINE self.DNAtabWidget.setCurrentIndex(0)NEWLINE self.DNAtabWidget.setTabEnabled(1, False)NEWLINE elif os.path.splitext(self.UnitslineEditDNA.text())[-1] != ".tsv":NEWLINE self.UnitsErrortextDNA.show()NEWLINE self.UnitsErrortextDNA.setText("File should have extension '.tsv'")NEWLINE self.DNAtabWidget.setCurrentIndex(0)NEWLINE self.DNAtabWidget.setTabEnabled(1, False)NEWLINE else:NEWLINE list_tsv_col = ['sample', 'unit', 'condition', 'fq1', 'fq2']NEWLINE unitsdf =pd.read_table(self.UnitslineEditDNA.text(), header=0)NEWLINE if list(unitsdf) != list_tsv_col:NEWLINE self.UnitsErrortextDNA.show()NEWLINE self.UnitsErrortextDNA.setText("Table not in given format! Check!")NEWLINE else:NEWLINE arr = []NEWLINE for item in unitsdf["sample"]:NEWLINE arr.append(item)NEWLINE sample_df = pd.DataFrame({'sample': np.unique(arr)})NEWLINE sample_df.to_csv('samples.tsv', sep = '\t', index=False)NEWLINE Row_list =[]NEWLINE for index, rows in unitsdf.iterrows():NEWLINE my_list =[rows.condition]NEWLINE Row_list.append(my_list)NEWLINE if ['tumor'] in Row_list:NEWLINE self.VCcomboBoxDNA.setItemText(0, "Mutect2")NEWLINENEWLINE else:NEWLINE self.VCcomboBoxDNA.addItem("")NEWLINE self.VCcomboBoxDNA.addItem("")NEWLINE self.VCcomboBoxDNA.setItemText(0, "GATK_HC")NEWLINE self.VCcomboBoxDNA.setItemText(1, "bcftools_call")NEWLINE self.VCcomboBoxDNA.setItemText(2, "freebayes")NEWLINE if self.RefGenomelineEditDNA.text() == '':NEWLINE self.RefGenomeErrortextDNA.show()NEWLINE self.RefGenomeErrortextDNA.setText("Input reference genome file!")NEWLINE self.DNAtabWidget.setCurrentIndex(0)NEWLINE self.DNAtabWidget.setTabEnabled(1, False)NEWLINE elif not os.path.exists(self.RefGenomelineEditDNA.text()):NEWLINE self.RefGenomeErrortextDNA.show()NEWLINE self.RefGenomeErrortextDNA.setText("File doesn't exist! Check the path!")NEWLINE self.DNAtabWidget.setCurrentIndex(0)NEWLINE self.DNAtabWidget.setTabEnabled(1, False)NEWLINE elif os.path.splitext(self.RefGenomelineEditDNA.text())[-1] != ".fa":NEWLINE self.RefGenomeErrortextDNA.show()NEWLINE self.RefGenomeErrortextDNA.setText("File should have extension '.fa'")NEWLINE self.DNAtabWidget.setCurrentIndex(0)NEWLINE self.DNAtabWidget.setTabEnabled(1, False)NEWLINENEWLINE if self.RefVariantlineEditDNA.text()== '':NEWLINE self.RefVariantErrortextDNA.show()NEWLINE self.RefVariantErrortextDNA.setText("Input reference known variants file!")NEWLINE self.DNAtabWidget.setCurrentIndex(0)NEWLINE self.DNAtabWidget.setTabEnabled(1, False)NEWLINE elif not os.path.exists(self.RefVariantlineEditDNA.text()):NEWLINE self.RefVariantErrortextDNA.show()NEWLINE self.RefVariantErrortextDNA.setText("File doesn't exist! Check the path!")NEWLINE self.DNAtabWidget.setCurrentIndex(0)NEWLINE self.DNAtabWidget.setTabEnabled(1, False)NEWLINE elif os.path.splitext(self.RefVariantlineEditDNA.text())[-1] != ".gz":NEWLINE self.RefVariantErrortextDNA.show()NEWLINE self.RefVariantErrortextDNA.setText("File should have extension '.gz'")NEWLINE self.DNAtabWidget.setCurrentIndex(0)NEWLINE self.DNAtabWidget.setTabEnabled(1, False)NEWLINE elif (self.RefVariantlineEditDNA.text()).split(".")[-2] != "vcf":NEWLINE self.RefVariantErrortextDNA.show()NEWLINE self.RefVariantErrortextDNA.setText("File should be compressed 'vcf'")NEWLINE self.DNAtabWidget.setCurrentIndex(0)NEWLINE self.DNAtabWidget.setTabEnabled(1, False)NEWLINE if self.CorelineEditDNA.text()=='':NEWLINE self.CoreErrortextDNA.show()NEWLINE self.CoreErrortextDNA.setText("Input number of threads available")NEWLINE self.DNAtabWidget.setCurrentIndex(0)NEWLINE self.DNAtabWidget.setTabEnabled(1, False)NEWLINE elif not self.CorelineEditDNA.text().isnumeric():NEWLINE self.CoreErrortextDNA.show()NEWLINE self.CoreErrortextDNA.setText("Number of threads should be an integer")NEWLINE self.DNAtabWidget.setCurrentIndex(0)NEWLINE self.DNAtabWidget.setTabEnabled(1, False)NEWLINE elif (list(unitsdf) == list_tsv_col and os.path.splitext(self.RefGenomelineEditDNA.text())[-1] == ".fa" and os.path.splitext(self.RefVariantlineEditDNA.text())[-1] == ".gz" and (self.RefVariantlineEditDNA.text().split(".")[-2]) == 'vcf' and self.CorelineEditDNA.text().isnumeric()):NEWLINE self.SamplesErrortextDNA.hide()NEWLINE self.UnitsErrortextDNA.hide()NEWLINE self.RefGenomeErrortextDNA.hide()NEWLINE self.RefVariantErrortextDNA.hide()NEWLINE self.DNAtabWidget.setCurrentIndex(1)NEWLINE self.DNAtabWidget.setTabEnabled(1, True)NEWLINE self.textBrowser.setTextColor(self._colors['blue'])NEWLINE self.textBrowser.append("Click on the 'View Quality control Results' button to view the FastQC report \n")NEWLINENEWLINE NEWLINE def param_display(self):NEWLINE _translate = QtCore.QCoreApplication.translateNEWLINE path_aligner = './params/'+self.AlignercomboBoxDNA.currentText()+'.csv'NEWLINE path_vc = './params/'+self.VCcomboBoxDNA.currentText()+'.csv'NEWLINE path_annotator = './params/'+self.AnnotatorcomboBoxDNA.currentText()+'.csv'NEWLINENEWLINE dataframe = pd.read_csv(path_aligner, header=0) # specifying that the table has column namesNEWLINE essential = dataframe[dataframe["Essential"] == "yes"]NEWLINE NEWLINE number_of_essential = len(essential) # returns number of essential parametersNEWLINE label_array_param1 = [self.param1_label_dna_1, self.param1_label_dna_2, self.param1_label_dna_3, self.param1_label_dna_4, self.param1_label_dna_5, self.param1_label_dna_6]NEWLINE line_edit_array_param1 = [self.param1_lineEdit_dna_1,self.param1_lineEdit_dna_2, self.param1_lineEdit_dna_3, self.param1_lineEdit_dna_4, self.param1_lineEdit_dna_5, self.param1_lineEdit_dna_6]NEWLINE for i, j, k in zip(range(number_of_essential), label_array_param1, line_edit_array_param1): NEWLINE j.show()NEWLINE j.setText(essential.iloc[i, 2])NEWLINE k.show()NEWLINE k.setText(str(essential.iloc[i, 4]))NEWLINE NEWLINE NEWLINE NEWLINE dataframe_vc = pd.read_csv(path_vc, header=0) # specifying that the table has column namesNEWLINE essential_vc = dataframe_vc[dataframe_vc["Essential"] == "yes"]NEWLINE NEWLINE number_of_essential_vc = len(essential_vc) # returns number of essential parametersNEWLINE label_array_param2 = [self.param2_label_dna_1, self.param2_label_dna_2, self.param2_label_dna_3, self.param2_label_dna_4, self.param2_label_dna_5, self.param2_label_dna_6]NEWLINE line_edit_array_param2 = [self.param2_lineEdit_dna_1,self.param2_lineEdit_dna_2, self.param2_lineEdit_dna_3, self.param2_lineEdit_dna_4, self.param2_lineEdit_dna_5, self.param2_lineEdit_dna_6]NEWLINE for i, j, k in zip(range(number_of_essential_vc), label_array_param2, line_edit_array_param2): NEWLINE j.show()NEWLINE j.setText(essential_vc.iloc[i, 2])NEWLINE k.show()NEWLINE k.setText(str(essential_vc.iloc[i, 4]))NEWLINE NEWLINE dataframe_annotator = pd.read_csv(path_annotator, header=0) # specifying that the table has column namesNEWLINE essential_annotator = dataframe_annotator[dataframe_annotator["Essential"] == "yes"]NEWLINE NEWLINE number_of_essential_annotator = len(essential_annotator) # returns number of essential parametersNEWLINE label_array_param3 = [self.param3_label_dna_1, self.param3_label_dna_2, self.param3_label_dna_3, self.param3_label_dna_4, self.param3_label_dna_5, self.param3_label_dna_6]NEWLINE line_edit_array_param3 = [self.param3_lineEdit_dna_1,self.param3_lineEdit_dna_2, self.param3_lineEdit_dna_3, self.param3_lineEdit_dna_4, self.param3_lineEdit_dna_5, self.param3_lineEdit_dna_6]NEWLINE for i, j, k in zip(range(number_of_essential_annotator), label_array_param3, line_edit_array_param3): NEWLINE j.show()NEWLINE j.setText(essential_annotator.iloc[i, 2])NEWLINE k.show()NEWLINE k.setText(str(essential_annotator.iloc[i, 4]))NEWLINE NEWLINE self.BWAIndexlabel.setText(_translate("MainWindow", "Index for " + self.AlignercomboBoxDNA.currentText()))NEWLINE self.BWAIndexlineEdit.setToolTip(_translate("MainWindow", "Input the path of the Index for" + self.AlignercomboBoxDNA.currentText()))NEWLINE NEWLINE def on_clicking_browse_samples(self):NEWLINE self.SamplesErrortextDNA.hide()NEWLINE NEWLINE def on_clicked_nextbuttonqcDNA(self):NEWLINE self.param_display()NEWLINE if os.path.exists("results_dna/qc"):NEWLINE self.DNAtabWidget.setCurrentIndex(2)NEWLINE self.DNAtabWidget.setTabEnabled(2, True)NEWLINE else:NEWLINE self.qc_warning = showQCDialog()NEWLINE if self.qc_warning.returnValue==QMessageBox.Yes:NEWLINE self.DNAtabWidget.setCurrentIndex(2)NEWLINE self.DNAtabWidget.setTabEnabled(2, True)NEWLINE NEWLINE if self.qc_warning.returnValue== QMessageBox.Cancel:NEWLINE self.DNAtabWidget.setCurrentIndex(1)NEWLINE self.DNAtabWidget.setTabEnabled(2, False)NEWLINE self.DNAtabWidget.setTabEnabled(2, True)NEWLINE def on_clicked_nextbuttontoolDNA(self):NEWLINE self.index_warning()NEWLINE self.DNAtabWidget.setCurrentIndex(3)NEWLINE self.DNAtabWidget.setTabEnabled(3, True)NEWLINE NEWLINE self.create_config_dna()NEWLINE self.create_snakefile_dna()NEWLINE self.if_annovar()NEWLINE self.textBrowser.setTextColor(self._colors['blue'])NEWLINE self.textBrowser.append("Click on the 'Run' button below to start your analysis \n")NEWLINENEWLINE def index_warning(self):NEWLINE if self.BWAIndexlineEdit.text()=='':NEWLINE self.BWAIndexErrortext.show()NEWLINE self.BWAIndexErrortext.setText("Please input index path!")NEWLINE self.DNAtabWidget.setCurrentIndex(3)NEWLINE self.DNAtabWidget.setTabEnabled(4, False)NEWLINE else:NEWLINE self.DNAtabWidget.setCurrentIndex(4)NEWLINE self.DNAtabWidget.setTabEnabled(4, True)NEWLINE NEWLINE def on_clicked_nextbuttonparamsDNA(self):NEWLINENEWLINE self.essential_dict_aligner = self.get_essential(path ='./params/'+self.AlignercomboBoxDNA.currentText()+'.csv', essential_line_edit_array= [self.param1_lineEdit_dna_1,self.param1_lineEdit_dna_2, self.param1_lineEdit_dna_3, self.param1_lineEdit_dna_4, self.param1_lineEdit_dna_5, self.param1_lineEdit_dna_6] )NEWLINE with open('aligner_params.txt', 'w') as aligner_params:NEWLINE aligner_params.write(self.AlignercomboBoxDNA.currentText() + " : '")NEWLINE for k, v in self.essential_dict_aligner.items():NEWLINE aligner_params.write(k +' '+ str(v) + " ")NEWLINE aligner_params.write("'")NEWLINE aligner_params.close()NEWLINE self.essential_dict_vc = self.get_essential(path ='./params/'+self.VCcomboBoxDNA.currentText()+'.csv', essential_line_edit_array =[self.param2_lineEdit_dna_1,self.param2_lineEdit_dna_2, self.param2_lineEdit_dna_3, self.param2_lineEdit_dna_4, self.param2_lineEdit_dna_5, self.param2_lineEdit_dna_6])NEWLINE with open('vc_params.txt', 'w') as vc_params:NEWLINE vc_params.write(self.VCcomboBoxDNA.currentText() + " : '")NEWLINE for k, v in self.essential_dict_vc.items():NEWLINE vc_params.write(k +' '+ str(v) + " ")NEWLINE vc_params.write("'")NEWLINE vc_params.close()NEWLINE self.essential_dict_annotator = self.get_essential(path ='./params/'+self.AnnotatorcomboBoxDNA.currentText()+'.csv', essential_line_edit_array=[self.param3_lineEdit_dna_1,self.param3_lineEdit_dna_2, self.param3_lineEdit_dna_3, self.param3_lineEdit_dna_4, self.param3_lineEdit_dna_5, self.param3_lineEdit_dna_6] )NEWLINE with open('annotator_params.txt', 'w') as annotator_params:NEWLINE if self.AnnotatorcomboBoxDNA.currentText() == "SnpEff":NEWLINE annotator_params.write(self.AnnotatorcomboBoxDNA.currentText() + " : '-Xmx4g ")NEWLINE else:NEWLINE annotator_params.write(self.AnnotatorcomboBoxDNA.currentText() + " : '")NEWLINE for k, v in self.essential_dict_annotator.items():NEWLINE annotator_params.write(k +' '+ str(v) + " ")NEWLINE annotator_params.write("'")NEWLINE annotator_params.close()NEWLINE NEWLINENEWLINE NEWLINE NEWLINE NEWLINE def on_clicked_previousbuttonqcDNA(self):NEWLINE self.DNAtabWidget.setCurrentIndex(0)NEWLINE self.DNAtabWidget.setTabEnabled(0, True)NEWLINE def on_clicked_previousbuttontoolDNA(self):NEWLINE self.DNAtabWidget.setCurrentIndex(1)NEWLINE self.DNAtabWidget.setTabEnabled(1, True)NEWLINE def on_clicked_previousbuttonindexDNA(self):NEWLINE self.DNAtabWidget.setCurrentIndex(2)NEWLINE self.DNAtabWidget.setTabEnabled(2, True)NEWLINE def on_clicked_previousbuttonparamsDNA(self):NEWLINE self.DNAtabWidget.setCurrentIndex(3) NEWLINE self.DNAtabWidget.setTabEnabled(3, True)NEWLINE NEWLINE def on_clicked_previousbuttonrunDNA(self):NEWLINE self.DNAtabWidget.setCurrentIndex(2) NEWLINE self.DNAtabWidget.setTabEnabled(2, True)NEWLINE NEWLINE def on_clicked_previousbuttonresultDNA(self):NEWLINE self.DNAtabWidget.setCurrentIndex(3) NEWLINE self.DNAtabWidget.setTabEnabled(3, True)NEWLINE NEWLINE def on_clicked_nextbuttoninputRNA(self):NEWLINENEWLINE if self.SamplesYesradioButton_rna.isChecked() == True:NEWLINE if self.SampleFolderLineEdit.text() == '':NEWLINE self.SampleFolderErrortextRNA.show()NEWLINE self.SampleFolderErrortextRNA.setText("Input Samples folder path!")NEWLINE self.RNAtabWidget.setCurrentIndex(0)NEWLINE self.RNAtabWidget.setTabEnabled(1, False)NEWLINE elif not os.path.exists(self.SampleFolderLineEdit.text()):NEWLINE self.SampleFolderErrortextRNA.show()NEWLINE self.SampleFolderErrortextRNA.setText("File doesn't exist! Check the path!")NEWLINE self.RNAtabWidget.setCurrentIndex(0)NEWLINE self.RNAtabWidget.setTabEnabled(1, False)NEWLINE else :NEWLINE inputfile = fileinput.input("check_for_correct_filename_check.py", inplace = 1)NEWLINE for l in inputfile:NEWLINE if "test_dir =" in l:NEWLINE print(l.replace(l, "test_dir = '"+self.SampleFolderLineEdit.text()+"'"))NEWLINE else:NEWLINE print(l.rstrip())NEWLINE inputfile.close()NEWLINE subprocess.run(["python", "check_for_correct_filename_check.py"])NEWLINE if os.path.exists('name_check.txt'):NEWLINE self.RNAtabWidget.setCurrentIndex(0)NEWLINE self.RNAtabWidget.setTabEnabled(1, False)NEWLINE with open('name_check.txt') as errorcheck:NEWLINE content = errorcheck.readline()NEWLINE self.SampleFolderErrortextRNA.show()NEWLINE self.SampleFolderErrortextRNA.setText(content.rstrip())NEWLINE else:NEWLINE# passNEWLINE file = fileinput.input("write_tsv_rna.py", inplace = 1)NEWLINE for l in file:NEWLINE if "test_dir =" in l:NEWLINE print(l.replace(l, "test_dir = '"+self.SampleFolderLineEdit.text()+"/'"))NEWLINE else:NEWLINE print(l.rstrip())NEWLINE file.close()NEWLINE subprocess.run(["python", "write_tsv_rna.py"])NEWLINE unitsdf =pd.read_table('units.tsv', header=0)NEWLINE self.UnitslineEditDNA.setText("units.tsv")NEWLINE Row_list =[]NEWLINE for index, rows in unitsdf.iterrows():NEWLINE my_list =[rows.condition]NEWLINE Row_list.append(my_list)NEWLINENEWLINE if self.FastalineEdit.text() == '':NEWLINE self.FastaErrortextRNA.show()NEWLINE self.FastaErrortextRNA.setText("Input Fasta file!")NEWLINE self.RNAtabWidget.setCurrentIndex(0)NEWLINE self.RNAtabWidget.setTabEnabled(1, False)NEWLINE elif not os.path.exists(self.FastalineEdit.text()):NEWLINE self.FastaErrortextRNA.show()NEWLINE self.FastaErrortextRNA.setText("File doesn't exist! Check the path!")NEWLINE self.RNAtabWidget.setCurrentIndex(0)NEWLINE self.RNAtabWidget.setTabEnabled(1, False)NEWLINE elif os.path.splitext(self.FastalineEdit.text())[-1] != ".fa":NEWLINE self.FastaErrortextRNA.show()NEWLINE self.FastaErrortextRNA.setText("File should have extension '.fa'")NEWLINE self.RNAtabWidget.setCurrentIndex(0)NEWLINE self.RNAtabWidget.setTabEnabled(1, False)NEWLINENEWLINE if self.AnnotatedlineEditRNA.text()== '':NEWLINE self.AnnotatedErrortextRNA.show()NEWLINE self.AnnotatedErrortextRNA.setText("Input Annotated file!")NEWLINE self.RNAtabWidget.setCurrentIndex(0)NEWLINE self.RNAtabWidget.setTabEnabled(1, False)NEWLINE elif not os.path.exists(self.AnnotatedlineEditRNA.text()):NEWLINE self.AnnotatedErrortextRNA.show()NEWLINE self.AnnotatedErrortextRNA.setText("File doesn't exist! Check the path!")NEWLINE self.RNAtabWidget.setCurrentIndex(0)NEWLINE self.RNAtabWidget.setTabEnabled(1, False)NEWLINE elif os.path.splitext(self.AnnotatedlineEditRNA.text())[-1] != ".gtf":NEWLINE self.AnnotatedErrortextRNA.show()NEWLINE self.AnnotatedErrortextRNA.setText("File should have extension '.gtf'")NEWLINE self.RNAtabWidget.setCurrentIndex(0)NEWLINE self.RNAtabWidget.setTabEnabled(1, False)NEWLINENEWLINE if self.CorelineEditRNA.text()=='':NEWLINE self.CoreErrortextRNA.show()NEWLINE self.CoreErrortextRNA.setText("Input number of threads available")NEWLINE self.RNAtabWidget.setCurrentIndex(0)NEWLINE self.RNAtabWidget.setTabEnabled(1, False)NEWLINE elif not self.CorelineEditRNA.text().isnumeric():NEWLINE# print("File doesn't exist! Check the path!")NEWLINE self.CoreErrortextRNA.show()NEWLINE self.CoreErrortextRNA.setText("Number of threads should be an integer")NEWLINE self.RNAtabWidget.setCurrentIndex(0)NEWLINE self.RNAtabWidget.setTabEnabled(1, False)NEWLINE elif (os.path.splitext(self.FastalineEdit.text())[-1] == ".fa" and not os.path.exists('name_check.txt') and os.path.splitext(self.AnnotatedlineEditRNA.text())[-1] == ".gtf" and self.CorelineEditRNA.text().isnumeric()): NEWLINE self.FastaErrortextRNA.hide()NEWLINE self.SampleFolderErrortextRNA.hide()NEWLINE self.AnnotatedErrortextRNA.hide()NEWLINE self.RNAtabWidget.setCurrentIndex(1)NEWLINE self.RNAtabWidget.setTabEnabled(1, True)NEWLINE self.textBrowser.setTextColor(self._colors['blue'])NEWLINE self.textBrowser.append("Click on the 'View Quality control Results' button below to view the FastQC report \n")NEWLINENEWLINE else:NEWLINE if self.SampleFolderLineEdit.text() == '':NEWLINE self.SampleFolderErrortextRNA.show()NEWLINE self.SampleFolderErrortextRNA.setText("Input Samples folder path!")NEWLINE self.RNAtabWidget.setCurrentIndex(0)NEWLINE self.RNAtabWidget.setTabEnabled(1, False)NEWLINE elif not os.path.exists(self.SampleFolderLineEdit.text()):NEWLINE self.SampleFolderErrortextRNA.show()NEWLINE self.SampleFolderErrortextRNA.setText("File doesn't exist! Check the path!")NEWLINE self.RNAtabWidget.setCurrentIndex(0)NEWLINE self.RNAtabWidget.setTabEnabled(1, False)NEWLINENEWLINE if self.SampletablelineEdit.text() == '':NEWLINE self.SampletableErrortextRNA.show()NEWLINE self.SampletableErrortextRNA.setText("Input Sample Table!")NEWLINE self.RNAtabWidget.setCurrentIndex(0)NEWLINE self.RNAtabWidget.setTabEnabled(1, False)NEWLINE elif not os.path.exists(self.SampletablelineEdit.text()):NEWLINE self.SampletableErrortextRNA.show()NEWLINE self.SampletableErrortextRNA.setText("File doesn't exist! Check the path!")NEWLINE self.RNAtabWidget.setCurrentIndex(0)NEWLINE self.RNAtabWidget.setTabEnabled(1, False)NEWLINE elif os.path.splitext(self.SampletablelineEdit.text())[-1] != ".tsv":NEWLINE self.SampletableErrortextRNA.show()NEWLINE self.SampletableErrortextRNA.setText("File should have extension '.tsv'")NEWLINE self.RNAtabWidget.setCurrentIndex(0)NEWLINE self.RNAtabWidget.setTabEnabled(1, False)NEWLINE else:NEWLINE list_tsv_col = ['sample', 'unit', 'condition', 'fq1', 'fq2']NEWLINE unitsdf =pd.read_table(self.SampletablelineEdit.text(), header=0)NEWLINE if list(unitsdf) != list_tsv_col:NEWLINE self.SampletableErrortextRNA.show()NEWLINE self.SampletableErrortextRNA.setText("Table not in given format! Check!")NEWLINE else:NEWLINE subprocess.run(["python", "rename.py"])NEWLINE if os.path.exists("rename_check.txt"):NEWLINE with open('rename_check.txt') as errorcheck:NEWLINE content = errorcheck.readline()NEWLINE self.SampletableErrortextRNA.show()NEWLINE self.SampletableErrortextRNA.setText(content.rstrip())NEWLINE NEWLINE else:NEWLINE passNEWLINENEWLINE if self.FastalineEdit.text() == '':NEWLINE self.FastaErrortextRNA.show()NEWLINE self.FastaErrortextRNA.setText("Input Fasta file!")NEWLINE self.RNAtabWidget.setCurrentIndex(0)NEWLINE self.RNAtabWidget.setTabEnabled(1, False)NEWLINE elif not os.path.exists(self.FastalineEdit.text()):NEWLINE self.FastaErrortextRNA.show()NEWLINE self.FastaErrortextRNA.setText("File doesn't exist! Check the path!")NEWLINE self.RNAtabWidget.setCurrentIndex(0)NEWLINE self.RNAtabWidget.setTabEnabled(1, False)NEWLINE elif os.path.splitext(self.FastalineEdit.text())[-1] != ".fa":NEWLINE self.FastaErrortextRNA.show()NEWLINE self.FastaErrortextRNA.setText("File should have extension '.fa'")NEWLINE self.RNAtabWidget.setCurrentIndex(0)NEWLINE self.RNAtabWidget.setTabEnabled(1, False)NEWLINENEWLINE if self.AnnotatedlineEditRNA.text()== '':NEWLINE self.AnnotatedErrortextRNA.show()NEWLINE self.AnnotatedErrortextRNA.setText("Input Annotated file!")NEWLINE self.RNAtabWidget.setCurrentIndex(0)NEWLINE self.RNAtabWidget.setTabEnabled(1, False)NEWLINE elif not os.path.exists(self.AnnotatedlineEditRNA.text()):NEWLINE self.AnnotatedErrortextRNA.show()NEWLINE self.AnnotatedErrortextRNA.setText("File doesn't exist! Check the path!")NEWLINE self.RNAtabWidget.setCurrentIndex(0)NEWLINE self.RNAtabWidget.setTabEnabled(1, False)NEWLINE elif os.path.splitext(self.AnnotatedlineEditRNA.text())[-1] != ".gtf":NEWLINE self.AnnotatedErrortextRNA.show()NEWLINE self.AnnotatedErrortextRNA.setText("File should have extension '.gtf'")NEWLINE self.RNAtabWidget.setCurrentIndex(0)NEWLINE self.RNAtabWidget.setTabEnabled(1, False)NEWLINENEWLINE if self.CorelineEditRNA.text()=='':NEWLINE self.CoreErrortextRNA.show()NEWLINE self.CoreErrortextRNA.setText("Input number of threads available")NEWLINE self.RNAtabWidget.setCurrentIndex(0)NEWLINE self.RNAtabWidget.setTabEnabled(1, False)NEWLINE elif not self.CorelineEditRNA.text().isnumeric():NEWLINE# print("File doesn't exist! Check the path!")NEWLINE self.CoreErrortextRNA.show()NEWLINE self.CoreErrortextRNA.setText("Number of threads should be an integer")NEWLINE self.RNAtabWidget.setCurrentIndex(0)NEWLINE self.RNAtabWidget.setTabEnabled(1, False)NEWLINE elif (os.path.splitext(self.FastalineEdit.text())[-1] == ".fa" and list(unitsdf) == list_tsv_col and not os.path.exists('name_check.txt') and not os.path.exists('rename_check.txt') and os.path.splitext(self.AnnotatedlineEditRNA.text())[-1] == ".gtf" and self.CorelineEditDNA.text().isnumeric()):NEWLINE self.FastaErrortextRNA.hide()NEWLINE self.SampleFolderErrortextRNA.hide()NEWLINE self.SampletableErrortextRNA.hide()NEWLINE self.AnnotatedErrortextRNA.hide()NEWLINE self.RNAtabWidget.setCurrentIndex(1)NEWLINE self.RNAtabWidget.setTabEnabled(1, True)NEWLINE self.textBrowser.setTextColor(self._colors['blue'])NEWLINE self.textBrowser.append("Click on the 'View Quality control Results' button below to view the FastQC report \n")NEWLINENEWLINE NEWLINE def on_clicked_nextbuttonqcRNA(self):NEWLINE self.param_display_rna()NEWLINE if os.path.exists("results/fastqc"):NEWLINE self.RNAtabWidget.setCurrentIndex(2)NEWLINE self.RNAtabWidget.setTabEnabled(2, True)NEWLINE else:NEWLINE self.qc_warning = showQCDialog()NEWLINE if self.qc_warning.returnValue==QMessageBox.Yes:NEWLINE self.RNAtabWidget.setCurrentIndex(2)NEWLINE self.RNAtabWidget.setTabEnabled(2, True)NEWLINE NEWLINE if self.qc_warning.returnValue== QMessageBox.Cancel:NEWLINE self.RNAtabWidget.setCurrentIndex(1)NEWLINE self.RNAtabWidget.setTabEnabled(2, False)NEWLINE NEWLINE self.RNAtabWidget.setTabEnabled(2, True)NEWLINE def on_clicked_nextbuttontoolRNA(self):NEWLINE self.index_warning_rna()NEWLINE self.create_snakefile_rna()NEWLINE self.create_config_rna()NEWLINE self.textBrowser.setTextColor(self._colors['blue'])NEWLINE self.textBrowser.append("Click on the 'Run' button below to start your analysis \n")NEWLINE NEWLINE self.RNAtabWidget.setCurrentIndex(3)NEWLINE self.RNAtabWidget.setTabEnabled(3, True)NEWLINE NEWLINE def param_display_rna(self):NEWLINE _translate = QtCore.QCoreApplication.translateNEWLINE self.StarIndexlabel.setText(_translate("MainWindow", "Index for " + self.AlignercomboBoxRNA.currentText()))NEWLINE self.StarIndexlineEdit.setToolTip(_translate("MainWindow", "Input the path of the Index for" + self.AlignercomboBoxRNA.currentText()))NEWLINE path_aligner_rna = './params/'+self.AlignercomboBoxRNA.currentText()+'.csv'NEWLINE path_em = './params/'+self.EMcomboBoxRNA.currentText()+'.csv'NEWLINE path_de = './params/'+self.DEcomboBoxRNA.currentText()+'.csv'NEWLINENEWLINE dataframe = pd.read_csv(path_aligner_rna, header=0) # specifying that the table has column namesNEWLINE essential = dataframe[dataframe["Essential"] == "yes"]NEWLINE NEWLINE number_of_essential = len(essential) # returns number of essential parametersNEWLINE label_array_param1 = [self.param1_label_rna_1, self.param1_label_rna_2, self.param1_label_rna_3, self.param1_label_rna_4, self.param1_label_rna_5, self.param1_label_rna_6]NEWLINE line_edit_array_param1 = [self.param1_lineEdit_rna_1,self.param1_lineEdit_rna_2, self.param1_lineEdit_rna_3, self.param1_lineEdit_rna_4, self.param1_lineEdit_rna_5, self.param1_lineEdit_rna_6]NEWLINE for i, j, k in zip(range(number_of_essential), label_array_param1, line_edit_array_param1): NEWLINE j.show()NEWLINE j.setText(essential.iloc[i, 2])NEWLINE k.show()NEWLINE k.setText(str(essential.iloc[i, 4]))NEWLINE NEWLINE dataframe_em = pd.read_csv(path_em, header=0) # specifying that the table has column namesNEWLINE essential_em = dataframe_em[dataframe_em["Essential"] == "yes"]NEWLINE NEWLINE number_of_essential_em = len(essential_em) # returns number of essential parametersNEWLINE label_array_param2 = [self.param2_label_rna_1, self.param2_label_rna_2, self.param2_label_rna_3, self.param2_label_rna_4, self.param2_label_rna_5, self.param2_label_rna_6]NEWLINE line_edit_array_param2 = [self.param2_lineEdit_rna_1,self.param2_lineEdit_rna_2, self.param2_lineEdit_rna_3, self.param2_lineEdit_rna_4, self.param2_lineEdit_rna_5, self.param2_lineEdit_rna_6]NEWLINE for i, j, k in zip(range(number_of_essential_em), label_array_param2, line_edit_array_param2): NEWLINE j.show()NEWLINE j.setText(essential_em.iloc[i, 2])NEWLINE k.show()NEWLINE k.setText(str(essential_em.iloc[i, 4]))NEWLINE NEWLINE dataframe_de = pd.read_csv(path_de, header=0) # specifying that the table has column namesNEWLINE essential_de = dataframe_de[dataframe_de["Essential"] == "yes"]NEWLINE NEWLINE number_of_essential_de = len(essential_de) # returns number of essential parametersNEWLINE label_array_param3 = [self.param3_label_rna_1, self.param3_label_rna_2, self.param3_label_rna_3, self.param3_label_rna_4, self.param3_label_rna_5, self.param3_label_rna_6]NEWLINE line_edit_array_param3 = [self.param3_lineEdit_rna_1,self.param3_lineEdit_rna_2, self.param3_lineEdit_rna_3, self.param3_lineEdit_rna_4, self.param3_lineEdit_rna_5, self.param3_lineEdit_rna_6]NEWLINE for i, j, k in zip(range(number_of_essential_de), label_array_param3, line_edit_array_param3): NEWLINE j.show()NEWLINE j.setText(essential_de.iloc[i, 2])NEWLINE k.show()NEWLINE k.setText(str(essential_de.iloc[i, 4]))NEWLINE NEWLINE NEWLINE NEWLINE def index_warning_rna(self):NEWLINE if self.StarIndexlineEdit.text()=='':NEWLINE self.StarIndexErrortext.show()NEWLINE self.StarIndexErrortext.setText("Please input index path!")NEWLINE self.RNAtabWidget.setCurrentIndex(3)NEWLINE self.RNAtabWidget.setTabEnabled(4, False)NEWLINE elif not os.path.exists(self.StarIndexlineEdit.text()):NEWLINE self.StarIndexErrortext.show()NEWLINE self.StarIndexErrortext.setText("File doesn't exist! Please check the path!")NEWLINE self.RNAtabWidget.setCurrentIndex(3)NEWLINE self.RNAtabWidget.setTabEnabled(4, False)NEWLINENEWLINE else:NEWLINE self.RNAtabWidget.setCurrentIndex(4)NEWLINE self.RNAtabWidget.setTabEnabled(4, True)NEWLINENEWLINE def on_clicked_nextbuttonparamsRNA(self):NEWLINENEWLINE NEWLINE self.essential_dict_aligner_rna = self.get_essential(path ='./params/'+self.AlignercomboBoxRNA.currentText()+'.csv', essential_line_edit_array= [self.param1_lineEdit_rna_1,self.param1_lineEdit_rna_2, self.param1_lineEdit_rna_3, self.param1_lineEdit_rna_4, self.param1_lineEdit_rna_5, self.param1_lineEdit_rna_6] )NEWLINE with open('aligner_params_rna.txt', 'w') as aligner_params_rna:NEWLINE aligner_params_rna.write(self.AlignercomboBoxRNA.currentText() + " : '")NEWLINE for k, v in self.essential_dict_aligner_rna.items():NEWLINE aligner_params_rna.write(k +' '+ str(v) + " ")NEWLINE aligner_params_rna.write("'")NEWLINE aligner_params_rna.close()NEWLINE self.essential_dict_em = self.get_essential(path ='./params/'+self.EMcomboBoxRNA.currentText()+'.csv', essential_line_edit_array =[self.param2_lineEdit_rna_1,self.param2_lineEdit_rna_2, self.param2_lineEdit_rna_3, self.param2_lineEdit_rna_4, self.param2_lineEdit_rna_5, self.param2_lineEdit_rna_6])NEWLINE with open('em_params.txt', 'w') as em_params:NEWLINE em_params.write(self.EMcomboBoxRNA.currentText() + " : '")NEWLINE for k, v in self.essential_dict_em.items():NEWLINE em_params.write(k +' '+ str(v) + " ")NEWLINE em_params.write("'")NEWLINE em_params.close()NEWLINE self.essential_dict_de = self.get_essential(path ='./params/'+self.DEcomboBoxRNA.currentText()+'.csv', essential_line_edit_array=[self.param3_lineEdit_rna_1,self.param3_lineEdit_rna_2, self.param3_lineEdit_rna_3, self.param3_lineEdit_rna_4, self.param3_lineEdit_rna_5, self.param3_lineEdit_rna_6] )NEWLINE with open('de_params.txt', 'w') as de_params:NEWLINE de_params.write(self.DEcomboBoxRNA.currentText() + " : '")NEWLINE for k, v in self.essential_dict_de.items():NEWLINE de_params.write(k +' '+ str(v) + " ")NEWLINE de_params.write("'")NEWLINE de_params.close()NEWLINE def on_clicked_previousbuttonqcRNA(self):NEWLINE self.RNAtabWidget.setCurrentIndex(0)NEWLINE self.RNAtabWidget.setTabEnabled(6, True)NEWLINE def on_clicked_previousbuttontoolRNA(self):NEWLINE self.RNAtabWidget.setCurrentIndex(1)NEWLINE self.RNAtabWidget.setTabEnabled(1, True)NEWLINE def on_clicked_previousbuttonindexRNA(self):NEWLINE self.RNAtabWidget.setCurrentIndex(2)NEWLINE self.RNAtabWidget.setTabEnabled(2, True)NEWLINE def on_clicked_previousbuttonparamsRNA(self):NEWLINE self.RNAtabWidget.setCurrentIndex(3)NEWLINE self.RNAtabWidget.setTabEnabled(3, True)NEWLINE NEWLINE def on_clicked_previousbuttonrunRNA(self):NEWLINE self.RNAtabWidget.setCurrentIndex(2) NEWLINE self.RNAtabWidget.setTabEnabled(2, True)NEWLINE NEWLINE def on_clicked_previousbuttonresultRNA(self):NEWLINE self.RNAtabWidget.setCurrentIndex(3) NEWLINE self.RNAtabWidget.setTabEnabled(3, True)NEWLINE NEWLINENEWLINE NEWLINE def show_dag(self):NEWLINE with open("Snakefile", "r+") as snake:NEWLINE line= snake.readline()NEWLINE if '"rules/common_dna.smk"' in line:NEWLINE svg_filename = self.AlignercomboBoxDNA.currentText() + self.VCcomboBoxDNA.currentText() + self.AnnotatorcomboBoxDNA.currentText() + ".svg"NEWLINE else:NEWLINE svg_filename = self.AlignercomboBoxRNA.currentText() + self.EMcomboBoxRNA.currentText() + self.DEcomboBoxRNA.currentText() + ".svg"NEWLINE if os.path.exists(svg_filename):NEWLINE self.diag = SVGDialog(svg_filename)NEWLINE self.diag.show()NEWLINE else:NEWLINE self.textBrowser.setTextColor(self._colors['red'])NEWLINE self.textBrowser.append("Error creating DAG!")NEWLINE NEWLINE NEWLINENEWLINE NEWLINE NEWLINE def advanced_aligner(self):NEWLINE path = './params/'+self.AlignercomboBoxDNA.currentText()+'.csv'NEWLINE self.adv_dialog = AdvancedDialog(path)NEWLINE self.adv_dialog.show()NEWLINE retval = self.adv_dialog.exec_NEWLINE self.adv_dialog.button.accepted.connect(self.close_and_write_aligner)NEWLINE NEWLINE NEWLINE NEWLINE def close_and_write_aligner(self):NEWLINENEWLINE self.snakefile_dict_aligner_int = self.get_additional_int(path='./params/'+self.AlignercomboBoxDNA.currentText()+'.csv')NEWLINE self.snakefile_dict_aligner_float = self.get_additional_float(path='./params/'+self.AlignercomboBoxDNA.currentText()+'.csv')NEWLINE self.snakefile_dict_aligner_str = self.get_additional_str(path='./params/'+self.AlignercomboBoxDNA.currentText()+'.csv')NEWLINE self.snakefile_dict_aligner_na = self.get_additional_na(path='./params/'+self.AlignercomboBoxDNA.currentText()+'.csv')NEWLINE self.essential_dict_aligner = self.get_essential(path ='./params/'+self.AlignercomboBoxDNA.currentText()+'.csv', essential_line_edit_array= [self.param1_lineEdit_dna_1,self.param1_lineEdit_dna_2, self.param1_lineEdit_dna_3, self.param1_lineEdit_dna_4, self.param1_lineEdit_dna_5, self.param1_lineEdit_dna_6])NEWLINE with open('aligner_params.txt', 'w') as aligner_params:NEWLINE aligner_params.write(self.AlignercomboBoxDNA.currentText() + " : '")NEWLINE for k, v in self.snakefile_dict_aligner_int.items():NEWLINE aligner_params.write( k +''+ str(v) +" " )NEWLINE for k, v in self.snakefile_dict_aligner_float.items():NEWLINE aligner_params.write( k +''+ str(v) +" " )NEWLINE for k, v in self.snakefile_dict_aligner_str.items():NEWLINE aligner_params.write( k +''+ str(v) +" " )NEWLINE for k, v in self.snakefile_dict_aligner_na.items():NEWLINE aligner_params.write( k +' ')NEWLINE for k, v in self.essential_dict_aligner.items():NEWLINE aligner_params.write(k +''+ str(v) + " ")NEWLINE aligner_params.write("'")NEWLINE aligner_params.close()NEWLINE NEWLINE self.adv_dialog.close()NEWLINE NEWLINE def advanced_vc(self):NEWLINE path = './params/'+self.VCcomboBoxDNA.currentText()+'.csv'NEWLINE self.adv_dialog = AdvancedDialog(path)NEWLINE self.adv_dialog.show()NEWLINE retval = self.adv_dialog.exec_NEWLINE self.adv_dialog.button.accepted.connect(self.close_and_write_vc)NEWLINE NEWLINE def close_and_write_vc(self):NEWLINENEWLINE self.snakefile_dict_vc_int = self.get_additional_int(path='./params/'+self.VCcomboBoxDNA.currentText()+'.csv')NEWLINE self.snakefile_dict_vc_float = self.get_additional_float(path='./params/'+self.VCcomboBoxDNA.currentText()+'.csv')NEWLINE self.snakefile_dict_vc_str = self.get_additional_str(path='./params/'+self.VCcomboBoxDNA.currentText()+'.csv')NEWLINE self.snakefile_dict_vc_na = self.get_additional_na(path='./params/'+self.VCcomboBoxDNA.currentText()+'.csv')NEWLINE self.essential_dict_vc = self.get_essential(path ='./params/'+self.VCcomboBoxDNA.currentText()+'.csv', essential_line_edit_array= [self.param2_lineEdit_dna_1,self.param2_lineEdit_dna_2, self.param2_lineEdit_dna_3, self.param2_lineEdit_dna_4, self.param2_lineEdit_dna_5, self.param2_lineEdit_dna_6])NEWLINE with open('vc_params.txt', 'w') as vc_params:NEWLINE vc_params.write(self.VCcomboBoxDNA.currentText() + " : '")NEWLINE for k, v in self.snakefile_dict_vc_int.items():NEWLINE vc_params.write( k +''+ str(v) +" " )NEWLINE for k,v in self.snakefile_dict_vc_float.items():NEWLINE vc_params.write( k +''+ str(v) +" " )NEWLINE for k,v in self.snakefile_dict_vc_str.items():NEWLINE vc_params.write( k +''+ str(v) +" " )NEWLINE for k,v in self.snakefile_dict_vc_na.items():NEWLINE vc_params.write( k +' ')NEWLINE for k, v in self.essential_dict_vc.items():NEWLINE vc_params.write(k +''+ str(v) + " ")NEWLINE vc_params.write("'")NEWLINE vc_params.close()NEWLINE NEWLINE self.adv_dialog.close()NEWLINE NEWLINE def advanced_annotator(self):NEWLINE path = './params/'+self.AnnotatorcomboBoxDNA.currentText()+'.csv'NEWLINE self.adv_dialog = AdvancedDialog(path)NEWLINE self.adv_dialog.show()NEWLINE retval = self.adv_dialog.exec_NEWLINE self.adv_dialog.button.accepted.connect(self.close_and_write_annotator)NEWLINE NEWLINE def close_and_write_annotator(self):NEWLINENEWLINE self.snakefile_dict_annotator_int = self.get_additional_int(path='./params/'+self.AnnotatorcomboBoxDNA.currentText()+'.csv')NEWLINE self.snakefile_dict_annotator_float = self.get_additional_float(path='./params/'+self.AnnotatorcomboBoxDNA.currentText()+'.csv')NEWLINE self.snakefile_dict_annotator_str = self.get_additional_str(path='./params/'+self.AnnotatorcomboBoxDNA.currentText()+'.csv')NEWLINE self.snakefile_dict_annotator_na = self.get_additional_na(path='./params/'+self.AnnotatorcomboBoxDNA.currentText()+'.csv')NEWLINE self.essential_dict_annotator = self.get_essential(path ='./params/'+self.AnnotatorcomboBoxDNA.currentText()+'.csv', essential_line_edit_array= [self.param3_lineEdit_dna_1,self.param3_lineEdit_dna_2, self.param3_lineEdit_dna_3, self.param3_lineEdit_dna_4, self.param3_lineEdit_dna_5, self.param3_lineEdit_dna_6])NEWLINE with open('annotator_params.txt', 'w') as annotator_params:NEWLINE if self.AnnotatorcomboBoxDNA.currentText() == "SnpEff":NEWLINE annotator_params.write(self.AnnotatorcomboBoxDNA.currentText() + " : '-Xmx4g ")NEWLINE else:NEWLINE annotator_params.write(self.AnnotatorcomboBoxDNA.currentText() + " : '")NEWLINE for k, v in self.snakefile_dict_annotator_int.items():NEWLINE annotator_params.write( k +' '+ str(v) +" " )NEWLINE for k, v in self.snakefile_dict_annotator_float.items():NEWLINE annotator_params.write( k +' '+ str(v) +" " )NEWLINE for k, v in self.snakefile_dict_annotator_str.items():NEWLINE annotator_params.write( k +' '+ str(v) +" " )NEWLINE for k, v in self.snakefile_dict_annotator_na.items():NEWLINE annotator_params.write( k +' ' )NEWLINE for k, v in self.essential_dict_annotator.items():NEWLINE annotator_params.write(k +''+ str(v) + " ")NEWLINE annotator_params.write("'")NEWLINE annotator_params.close()NEWLINE NEWLINE self.adv_dialog.close()NEWLINE NEWLINE def advanced_aligner_rna(self):NEWLINE path = './params/'+self.AlignercomboBoxRNA.currentText()+'.csv'NEWLINE self.adv_dialog = AdvancedDialog(path)NEWLINE self.adv_dialog.show()NEWLINE retval = self.adv_dialog.exec_NEWLINE self.adv_dialog.button.accepted.connect(self.close_and_write_aligner_rna)NEWLINE NEWLINE def close_and_write_aligner_rna(self):NEWLINENEWLINE self.snakefile_dict_aligner_rna_int = self.get_additional_int(path='./params/'+self.AlignercomboBoxRNA.currentText()+'.csv')NEWLINE self.snakefile_dict_aligner_rna_float = self.get_additional_float(path='./params/'+self.AlignercomboBoxRNA.currentText()+'.csv')NEWLINE self.snakefile_dict_aligner_rna_str = self.get_additional_str(path='./params/'+self.AlignercomboBoxRNA.currentText()+'.csv')NEWLINE self.snakefile_dict_aligner_rna_na = self.get_additional_na(path='./params/'+self.AlignercomboBoxRNA.currentText()+'.csv')NEWLINE self.essential_dict_aligner_rna = self.get_essential(path ='./params/'+self.AlignercomboBoxRNA.currentText()+'.csv', essential_line_edit_array= [self.param1_lineEdit_rna_1,self.param1_lineEdit_rna_2, self.param1_lineEdit_rna_3, self.param1_lineEdit_rna_4, self.param1_lineEdit_rna_5, self.param1_lineEdit_rna_6])NEWLINE with open('aligner_params_rna.txt', 'w') as aligner_params_rna:NEWLINE aligner_params_rna.write(self.AlignercomboBoxRNA.currentText() + " : '")NEWLINE for k, v in self.snakefile_dict_aligner_rna_int.items():NEWLINE aligner_params_rna.write( k +''+ str(v) +" " )NEWLINE for k, v in self.snakefile_dict_aligner_rna_float.items():NEWLINE aligner_params_rna.write( k +''+ str(v) +" " )NEWLINE for k, v in self.snakefile_dict_aligner_rna_str.items():NEWLINE aligner_params_rna.write( k +''+ str(v) +" " )NEWLINE for k, v in self.snakefile_dict_aligner_rna_na.items():NEWLINE aligner_params_rna.write( k +' ')NEWLINE for k, v in self.essential_dict_aligner_rna.items():NEWLINE aligner_params_rna.write(k +''+ str(v) + " ")NEWLINE aligner_params_rna.write("'")NEWLINE aligner_params_rna.close()NEWLINE NEWLINENEWLINE NEWLINE self.adv_dialog.close()NEWLINE NEWLINE def advanced_em(self):NEWLINE path = './params/'+self.EMcomboBoxRNA.currentText()+'.csv'NEWLINE self.adv_dialog = AdvancedDialog(path)NEWLINE self.adv_dialog.show()NEWLINE retval = self.adv_dialog.exec_NEWLINE self.adv_dialog.button.accepted.connect(self.close_and_write_em)NEWLINE NEWLINE def close_and_write_em(self):NEWLINENEWLINE self.snakefile_dict_em_int = self.get_additional_int(path='./params/'+self.EMcomboBoxRNA.currentText()+'.csv')NEWLINE self.snakefile_dict_em_float = self.get_additional_float(path='./params/'+self.EMcomboBoxRNA.currentText()+'.csv')NEWLINE self.snakefile_dict_em_str = self.get_additional_str(path='./params/'+self.EMcomboBoxRNA.currentText()+'.csv')NEWLINE self.snakefile_dict_em_na = self.get_additional_na(path='./params/'+self.EMcomboBoxRNA.currentText()+'.csv')NEWLINE self.essential_dict_em = self.get_essential(path ='./params/'+self.EMcomboBoxRNA.currentText()+'.csv', essential_line_edit_array= [self.param2_lineEdit_rna_1,self.param2_lineEdit_rna_2, self.param2_lineEdit_rna_3, self.param2_lineEdit_rna_4, self.param2_lineEdit_rna_5, self.param2_lineEdit_rna_6])NEWLINE with open('em_params.txt', 'w') as em_params:NEWLINE em_params.write(self.EMcomboBoxRNA.currentText() + " : '")NEWLINE for k, v in self.snakefile_dict_em_int.items():NEWLINE em_params.write( k +''+ str(v) +" " )NEWLINE for k, v in self.snakefile_dict_em_float.items():NEWLINE em_params.write( k +''+ str(v) +" " )NEWLINE for k, v in self.snakefile_dict_em_str.items():NEWLINE em_params.write( k +''+ str(v) +" " )NEWLINE for k, v in self.snakefile_dict_em_na.items():NEWLINE em_params.write( k +' ')NEWLINE for k, v in self.essential_dict_em.items():NEWLINE em_params.write(k +''+ str(v) + " ")NEWLINE em_params.write("'")NEWLINE em_params.close()NEWLINE NEWLINE self.adv_dialog.close()NEWLINE NEWLINE def advanced_de(self):NEWLINE path = './params/'+self.DEcomboBoxRNA.currentText()+'.csv'NEWLINE self.adv_dialog = AdvancedDialog(path)NEWLINE self.adv_dialog.show()NEWLINE retval = self.adv_dialog.exec_NEWLINE self.adv_dialog.button.accepted.connect(self.close_and_write_de)NEWLINE NEWLINE def close_and_write_de(self):NEWLINENEWLINE self.snakefile_dict_de_int = self.get_additional_int(path='./params/'+self.DEcomboBoxRNA.currentText()+'.csv')NEWLINE self.snakefile_dict_de_float = self.get_additional_float(path='./params/'+self.DEcomboBoxRNA.currentText()+'.csv')NEWLINE self.snakefile_dict_de_str = self.get_additional_str(path='./params/'+self.DEcomboBoxRNA.currentText()+'.csv')NEWLINE self.snakefile_dict_de_na = self.get_additional_na(path='./params/'+self.DEcomboBoxRNA.currentText()+'.csv')NEWLINE self.essential_dict_de = self.get_essential(path ='./params/'+self.DEcomboBoxRNA.currentText()+'.csv', essential_line_edit_array= [self.param3_lineEdit_rna_1,self.param3_lineEdit_rna_2, self.param3_lineEdit_rna_3, self.param3_lineEdit_rna_4, self.param3_lineEdit_rna_5, self.param3_lineEdit_rna_6])NEWLINE with open('de_params.txt', 'w') as de_params:NEWLINE de_params.write(self.DEcomboBoxRNA.currentText() + " : '")NEWLINE for k, v in self.snakefile_dict_de_int.items():NEWLINE de_params.write( k +''+ str(v) +" " )NEWLINE for k, v in self.snakefile_dict_de_float.items():NEWLINE de_params.write( k +''+ str(v) +" " )NEWLINE for k, v in self.snakefile_dict_de_str.items():NEWLINE de_params.write( k +''+ str(v) +" " )NEWLINE for k, v in self.snakefile_dict_de_na.items():NEWLINE de_params.write( k +' ')NEWLINE for k, v in self.essential_dict_de.items():NEWLINE de_params.write(k +''+ str(v) + " ")NEWLINE de_params.write("'")NEWLINE de_params.close()NEWLINE NEWLINE self.adv_dialog.close()NEWLINE NEWLINE def check_run_button(self):NEWLINE if self.one_passed == self.two_passed is True:NEWLINE self.RunButton.setEnabled(True)NEWLINE self.RunLabel.setEnabled(True)NEWLINE NEWLINENEWLINE def on_check_SamplesNo_dna(self,is_toggle):NEWLINE if is_toggle:NEWLINE self.UnitsFilelabelDNA.setEnabled(True)NEWLINE self.UnitslineEditDNA.setEnabled(True)NEWLINE self.UnitsBrowseButtonDNA.setEnabled(True)NEWLINE self.SampleFilelabelDNA.setEnabled(False)NEWLINE self.SampleslineEditDNA.setEnabled(False)NEWLINE self.SamplesBrowseButtonDNA.setEnabled(False)NEWLINE else:NEWLINE self.UnitsFilelabelDNA.setEnabled(False)NEWLINE self.UnitslineEditDNA.setEnabled(False)NEWLINE self.UnitsBrowseButtonDNA.setEnabled(False)NEWLINE self.SampleFilelabelDNA.setEnabled(True)NEWLINE self.SampleslineEditDNA.setEnabled(True)NEWLINE self.SamplesBrowseButtonDNA.setEnabled(True)NEWLINE NEWLINE def on_check_SamplesNo_rna(self,is_toggle):NEWLINE if is_toggle:NEWLINE self.Sampletablelabel.setEnabled(True)NEWLINE self.SampletablelineEdit.setEnabled(True)NEWLINE self.SampletableBrowseButton.setEnabled(True)NEWLINE#==============================================================================NEWLINE self.SampleFolderlabel.setEnabled(False)NEWLINE self.SampleFolderLineEdit.setEnabled(False)NEWLINE self.SampleFolderBrowseButton.setEnabled(False)NEWLINE#==============================================================================NEWLINE else:NEWLINE self.Sampletablelabel.setEnabled(False)NEWLINE self.SampletablelineEdit.setEnabled(False)NEWLINE self.SampletableBrowseButton.setEnabled(False)NEWLINE#==============================================================================NEWLINE self.SampleFolderlabel.setEnabled(True)NEWLINE self.SampleFolderLineEdit.setEnabled(True)NEWLINE self.SampleFolderBrowseButton.setEnabled(True)NEWLINE#==============================================================================NEWLINENEWLINE def on_check_QC_dna(self,is_toggle):NEWLINE if is_toggle:NEWLINE self.InputParamslabel.setEnabled(True)NEWLINE self.Cutadaptlabel.setEnabled(True)NEWLINE self.CutadaptlineEdit.setEnabled(True)NEWLINE self.RunQCpushButton.setEnabled(True)NEWLINE else:NEWLINE self.InputParamslabel.setEnabled(False)NEWLINE self.Cutadaptlabel.setEnabled(False)NEWLINE self.CutadaptlineEdit.setEnabled(False)NEWLINE self.RunQCpushButton.setEnabled(False)NEWLINENEWLINE def on_check_QC_rna(self,is_toggle):NEWLINE if is_toggle:NEWLINE self.InputParamslabel_rna.setEnabled(True)NEWLINE self.Cutadaptlabel_rna.setEnabled(True) NEWLINE self.CutadaptlineEdit_rna.setEnabled(True)NEWLINE self.RunQCpushButton_rna.setEnabled(True)NEWLINE else:NEWLINE self.InputParamslabel_rna.setEnabled(False)NEWLINE self.Cutadaptlabel_rna.setEnabled(False)NEWLINE self.CutadaptlineEdit_rna.setEnabled(False)NEWLINENEWLINE self.RunQCpushButton_rna.setEnabled(False)NEWLINENEWLINENEWLINE def browse_data_sampletable(self):NEWLINE if os.path.exists('rename_check.txt'):NEWLINE os.remove('rename_check.txt')NEWLINE else:NEWLINE passNEWLINE self.SampletableErrortextRNA.hide()NEWLINE data_path_sampletable, _ =QtWidgets.QFileDialog.getOpenFileName(None,'Open File',r"",'*.tsv')NEWLINE self.SampletablelineEdit.setText(data_path_sampletable)NEWLINE with open('data_path_sampletable.pickle', 'wb') as handle:NEWLINE pickle.dump(data_path_sampletable,handle,protocol=pickle.HIGHEST_PROTOCOL)NEWLINENEWLINE def browse_data_fasta(self):NEWLINE self.FastaErrortextRNA.hide()NEWLINE data_path_fasta, _ =QtWidgets.QFileDialog.getOpenFileName(None,'Open File',r"",'*.fa *.fa.gz')NEWLINE self.FastalineEdit.setText(data_path_fasta)NEWLINE with open('data_path_fasta.pickle', 'wb') as handle:NEWLINE pickle.dump(data_path_fasta,handle,protocol=pickle.HIGHEST_PROTOCOL)NEWLINENEWLINE def browse_data_annotated(self):NEWLINE self.AnnotatedErrortextRNA.hide()NEWLINE data_path_annotated, _ =QtWidgets.QFileDialog.getOpenFileName(None,'Open File',r"",'*.gtf *.gtf.gz')NEWLINE self.AnnotatedlineEditRNA.setText(data_path_annotated)NEWLINE with open('data_path_annotated.pickle', 'wb') as handle:NEWLINE pickle.dump(data_path_annotated,handle,protocol=pickle.HIGHEST_PROTOCOL)NEWLINENEWLINENEWLINE NEWLINE def browse_samples_folder(self):NEWLINE self.SampleFolderErrortextRNA.hide()NEWLINE if os.path.exists("name_check.txt"):NEWLINE os.remove("name_check.txt")NEWLINE else:NEWLINE passNEWLINE my_dir_sample = QtWidgets.QFileDialog.getExistingDirectory(NEWLINE None,NEWLINE "Open a folder")NEWLINE self.SampleFolderLineEdit.setText(my_dir_sample)NEWLINE NEWLINENEWLINE def browse_data_samples(self):NEWLINENEWLINE self.SamplesErrortextDNA.hide()NEWLINE if os.path.exists("name_check.txt"):NEWLINE os.remove("name_check.txt")NEWLINE else:NEWLINE passNEWLINE my_dir_sample = QtWidgets.QFileDialog.getExistingDirectory(NEWLINE None,NEWLINE "Open a folder")NEWLINE self.SampleslineEditDNA.setText(my_dir_sample)NEWLINENEWLINE def browse_data_units(self):NEWLINE self.UnitsErrortextDNA.hide()NEWLINE data_path_units, _ =QtWidgets.QFileDialog.getOpenFileName(None,'Open File',r"",'*.tsv')NEWLINE self.UnitslineEditDNA.setText(data_path_units)NEWLINE with open('data_path_units.pickle', 'wb') as handle:NEWLINE pickle.dump(data_path_units,handle,protocol=pickle.HIGHEST_PROTOCOL)NEWLINENEWLINENEWLINE NEWLINE def browse_data_ref(self):NEWLINENEWLINE self.RefGenomeErrortextDNA.hide()NEWLINE data_path_ref, _ =QtWidgets.QFileDialog.getOpenFileName(None,'Open File',r"",'*.fa *.fa.gz')NEWLINE self.RefGenomelineEditDNA.setText(data_path_ref)NEWLINE with open('data_path_ref.pickle', 'wb') as handle:NEWLINE pickle.dump(data_path_ref,handle,protocol=pickle.HIGHEST_PROTOCOL)NEWLINENEWLINE def browse_data_kv(self):NEWLINE self.RefVariantErrortextDNA.hide()NEWLINE data_path_kv, _ =QtWidgets.QFileDialog.getOpenFileName(None,'Open File',r"",'*.gz')NEWLINE self.RefVariantlineEditDNA.setText(data_path_kv)NEWLINE with open('data_path_kv.pickle', 'wb') as handle:NEWLINE pickle.dump(data_path_kv,handle,protocol=pickle.HIGHEST_PROTOCOL)NEWLINENEWLINE def browse_bwaindex_dna(self):NEWLINE self.BWAIndexErrortext.hide()NEWLINE self._set_color(self._colors['blue'].name(),pb =self.progressBar_sub2_dna)NEWLINE data_path_bwadna, _ =QtWidgets.QFileDialog.getOpenFileName(None,'Open File')NEWLINE self.BWAIndexlineEdit.setText(data_path_bwadna)NEWLINE with open('data_path_bwadna.pickle', 'wb') as handle:NEWLINE pickle.dump(data_path_bwadna,handle,protocol=pickle.HIGHEST_PROTOCOL)NEWLINENEWLINENEWLINE def browse_data_maf(self):NEWLINE data_path_maf, _ =QtWidgets.QFileDialog.getOpenFileName(None,'Open File',r"",'*.maf *.maf.gz')NEWLINE self.maflineEdit.setText(data_path_maf)NEWLINE with open('data_path_maf.pickle', 'wb') as handle:NEWLINE pickle.dump(data_path_maf,handle,protocol=pickle.HIGHEST_PROTOCOL)NEWLINENEWLINE def browse_data_vcf(self):NEWLINE data_path_vcf, _ =QtWidgets.QFileDialog.getOpenFileName(None,'Open File','./NBDriver_ICOMIC/vcf/','*.vcf *.vcf.gz')NEWLINE self.vcflineEdit.setText(data_path_vcf)NEWLINE with open('data_path_vcf.pickle', 'wb') as handle:NEWLINE pickle.dump(data_path_vcf,handle,protocol=pickle.HIGHEST_PROTOCOL)NEWLINENEWLINE def browse_star_rna(self):NEWLINE self.StarIndexErrortext.hide()NEWLINE self._set_color(self._colors['blue'].name(),pb =self.progressBar_sub2_rna)NEWLINE my_dir_star = QtWidgets.QFileDialog.getExistingDirectory(NEWLINE None,NEWLINE "Open a folder")NEWLINE self.StarIndexlineEdit.setText(my_dir_star)NEWLINENEWLINENEWLINE NEWLINE def _set_color(self, color, pb):NEWLINE pb.setStyleSheet("""NEWLINE QProgressBar {{NEWLINE color: black;NEWLINE border: 2px solid grey;NEWLINE margin: 2px;NEWLINE border-radius: 5px;NEWLINE text-align: center;NEWLINE }}NEWLINE QProgressBar::chunk {{NEWLINE background: {};NEWLINE }}""".format(color))NEWLINE def _set_pb_color_sub(self, color, pb):NEWLINE self._set_color(self, color, pb )NEWLINE def _set_pb2_color_dna(self, color):NEWLINE self._set_color(self, color, pb = self.progressBar_sub2_dna)NEWLINE def _set_pb1_color_rna(self, color):NEWLINE self._set_color(self, color, pb=self.progressBar_sub1_rna)NEWLINE def _set_pb2_color_rna(self, color):NEWLINE self._set_color(self, color, pb=self.progressBar_sub2_rna)NEWLINE NEWLINE def func_pb_update(self, sub_pb, sub_pb_frac, initial_sub, initial_main, error_icon):NEWLINE time.sleep(2)NEWLINE files = glob.glob('.snakemake/log/*.log')NEWLINE filename_=max(files , key = os.path.getctime)NEWLINE f = open(filename_, 'r')NEWLINE while True:NEWLINE line = ''NEWLINE while len(line) == 0 or line[-1] != '\n':NEWLINE tail = f.readline()NEWLINE if tail == '':NEWLINE breakNEWLINE line += tailNEWLINE self.textBrowser.append(line)NEWLINE if '%' in line:NEWLINE self.textBrowser.setTextColor(self._colors['black'])NEWLINE per = line.split('(', 1)[1].split(')')[0]NEWLINE percent = per[:-1]NEWLINE sub_pb.setValue(initial_sub + int(percent)/sub_pb_frac)NEWLINE elif 'Error: Directory cannot be locked' in line:NEWLINE self._set_color(self._colors['red'].name(),pb =sub_pb)NEWLINE self.textBrowser.setTextColor(self._colors['red'])NEWLINE self.textBrowser.append(line)NEWLINE breakNEWLINE subprocess.run(["snakemake", "--unlock"])NEWLINENEWLINE elif 'CalledProcessError' in line:NEWLINE self._set_color(self._colors['red'].name(),pb =sub_pb)NEWLINE self.textBrowser.setTextColor(self._colors['red'])NEWLINE breakNEWLINE elif 'WorkflowError' in line:NEWLINE self._set_color(self._colors['red'].name(),pb =sub_pb)NEWLINE self.textBrowser.setTextColor(self._colors['red'])NEWLINE breakNEWLINE elif 'Error' in line:NEWLINE self._set_color(self._colors['red'].name(),pb =sub_pb)NEWLINE self.textBrowser.setTextColor(self._colors['red'])NEWLINE breakNEWLINE elif 'Missing' in line:NEWLINE print(line)NEWLINE self._set_color(self._colors['red'].name(),pb =sub_pb)NEWLINE self.textBrowser.setTextColor(self._colors['red'])NEWLINE error_icon.show()NEWLINE error_icon.setToolTip("Missing input file! Check the inputs")NEWLINE breakNEWLINE elif '(100%) done' in line:NEWLINE self.textBrowser.setTextColor(self._colors['black'])NEWLINE sub_pb.setValue(initial_sub + 100/sub_pb_frac)NEWLINE elif 'Nothing to be done' in line:NEWLINE self.textBrowser.setTextColor(self._colors['black'])NEWLINE sub_pb.setValue(initial_sub + 100/sub_pb_frac)NEWLINE breakNEWLINE else:NEWLINE passNEWLINE if ('Complete log' in line):NEWLINE breakNEWLINE elif 'Missing' in line:NEWLINE self._set_color(self._colors['red'].name(),pb =sub_pb)NEWLINE breakNEWLINE elif 'Exiting' in line:NEWLINE self._set_color(self._colors['red'].name(),pb =sub_pb)NEWLINE breakNEWLINE NEWLINE def show_qc_textbox(self):NEWLINE subprocess.run(["snakemake", "--unlock", "-j", "1"])NEWLINE self.textBrowser.setTextColor(self._colors['black'])NEWLINE self.textBrowser.append("QC Results being generated. Please wait! \n")NEWLINENEWLINE def show_qc_results(self):NEWLINE self.progressBar_sub1_dna.setValue(1)NEWLINE self.textBrowser.setTextColor(self._colors['black'])NEWLINE self.nextbuttonqcDNA.setEnabled(True)NEWLINE self._set_color(self._colors['blue'].name(),pb =self.progressBar_sub1_dna)NEWLINE conf = open('config.yaml', 'w')NEWLINE conf.write('samples: samples.tsv \n')NEWLINE conf.write('units: '+ self.UnitslineEditDNA.text() + '\n'+'ref: \n')NEWLINE conf.write(' genome: '+ self.RefGenomelineEditDNA.text() + '\n')NEWLINE conf.write("processing: \n")NEWLINE conf.write(" remove-duplicates: true\n")NEWLINE conf.write('threads: ' + self.CorelineEditDNA.text() + '\n')NEWLINE conf.close()NEWLINE time.sleep(0.1)NEWLINENEWLINE NEWLINE snake = open('Snakefile', "w")NEWLINE snake.write('include: "rules/common_dna.smk"\n')NEWLINE snake.write('rule all:\n')NEWLINE snake.write(' input:\n')NEWLINE snake.write(' expand("results_dna/qc/fastqc/{u.sample}-{u.unit}-{u.condition}.html", u = units.itertuples()),\n')NEWLINE snake.write(' expand("results_dna/qc/fastqc/{u.sample}-{u.unit}-{u.condition}.zip", u = units.itertuples()),\n')NEWLINE snake.write('include: "rules/qc_dna.smk"\n')NEWLINE snake.close()NEWLINE NEWLINENEWLINE NEWLINE NEWLINE def func_qc():NEWLINE subprocess.run(["snakemake", "--use-conda", "--cores", self.CorelineEditDNA.text()])NEWLINE NEWLINE def multi_qc():NEWLINE subprocess.run(["snakemake", "--use-conda", "-s", "Snakefile_multiqc", "--cores", self.CorelineEditDNA.text()])NEWLINENEWLINE self.textBrowser.setTextColor(self._colors['black'])NEWLINE p1 = Process(target=func_qc)NEWLINE p1.start()NEWLINE NEWLINE p2 = Process(target=self.func_pb_update( sub_pb=self.progressBar_sub1_dna, sub_pb_frac=4, initial_sub = 0, initial_main=0, error_icon=self.QCresultsButtonErroricon))NEWLINE p2.start()NEWLINE NEWLINE if self.progressBar_sub1_dna.value()==100/4:NEWLINE p3 = Process(target=multi_qc)NEWLINE self.progressBar_sub1_dna.setValue(26)NEWLINE NEWLINE p3.start()NEWLINE NEWLINE p4 = Process(target= self.func_pb_update( sub_pb=self.progressBar_sub1_dna, sub_pb_frac=4, initial_sub = 25, initial_main=0, error_icon=self.QCresultsButtonErroricon))NEWLINE p4.start()NEWLINE NEWLINE if os.path.exists("results_dna/qc/multiqc.html"):NEWLINE self.textBrowser.setTextColor(self._colors['blue'])NEWLINE self.textBrowser.append("MultiQC results generated! Wait till the result is dispalyed and then proceed to the next tab \n\n")NEWLINE filename = "results_dna/qc/multiqc.html"NEWLINE webbrowser.get('google-chrome').open(filename, new=0, autoraise=True)NEWLINE else:NEWLINE passNEWLINENEWLINENEWLINE def show_qc_results_rna(self):NEWLINE self.progressBar_sub1_rna.setValue(1)NEWLINE self.nextbuttonqcRNA.setEnabled(True)NEWLINE self._set_color(self._colors['blue'].name(),pb =self.progressBar_sub1_rna)NEWLINE self.textBrowser.setTextColor(self._colors['black'])NEWLINE self.textBrowser.append("QC Results being generated. Please wait! \n")NEWLINE time.sleep(0.1)NEWLINE conf = open('config.yaml', 'w')NEWLINE conf.write('units: units.tsv \n')NEWLINE conf.write('ref: \n')NEWLINE conf.write(' annotation: '+ self.AnnotatedlineEditRNA.text() + '\n')NEWLINE conf.write(' fasta: '+self.FastalineEdit.text() + '\n')NEWLINE conf.write('params: \n')NEWLINE conf.write("sample: " + self.SampleFolderLineEdit.text() + "\n")NEWLINE conf.write('threads: ' + self.CorelineEditRNA.text() + '\n')NEWLINE conf.close()NEWLINE time.sleep(0.1)NEWLINE self.textBrowser.setTextColor(self._colors['black'])NEWLINE self.textBrowser.append("Snakefile created for Quality Check!! \nPlease refer to the file: Snakefile in your working directory. \n\n")NEWLINE snakef = open('Snakefile', "w")NEWLINE snakef.write('include: "rules/common_rna.smk"\n')NEWLINE snakef.write('rule all:\n')NEWLINE snakef.write(' input:\n')NEWLINE snakef.write(" expand('results/fastqc/{sample}_{condition}_Rep{rep}.html', sample=samples, condition=type, rep=reps),\n")NEWLINE snakef.write(" expand('results/fastqc/{sample}_{condition}_Rep{rep}.zip', sample=samples, condition=type, rep=reps),\n")NEWLINE snakef.write('include: "rules/qc_rna.smk"\n')NEWLINE snakef.close()NEWLINE NEWLINE time.sleep(0.1)NEWLINE NEWLINE def func_qc():NEWLINE process1 = subprocess.Popen(["snakemake", "--use-conda", "--cores", self.CorelineEditRNA.text()], shell =True, stdout=subprocess.PIPE)NEWLINE output1 = process1.communicate()NEWLINENEWLINE def multi_qc():NEWLINE subprocess.run(["snakemake", "--use-conda", "-s", "Snakefile_multiqc_rna", "--cores", self.CorelineEditRNA.text()])NEWLINE self.textBrowser.setTextColor(self._colors['black'])NEWLINE p1 = Process(target=func_qc)NEWLINE p1.start()NEWLINE NEWLINE p2 = Process(target=self.func_pb_update( sub_pb=self.progressBar_sub1_rna, sub_pb_frac=4, initial_sub = 0, initial_main=0, error_icon=self.QCresultsButtonErroricon_rna))NEWLINE p2.start()NEWLINE NEWLINE if self.progressBar_sub1_rna.value()==100/4:NEWLINE p3 = Process(target=multi_qc)NEWLINE self.progressBar_sub1_rna.setValue(26)NEWLINE p3.start()NEWLINE NEWLINE p4 = Process(target= self.func_pb_update( sub_pb=self.progressBar_sub1_rna, sub_pb_frac=4, initial_sub = 25, initial_main=0, error_icon=self.QCresultsButtonErroricon_rna))NEWLINE p4.start()NEWLINE else:NEWLINE passNEWLINE NEWLINE if os.path.exists("results/fastqc/multiqc.html"):NEWLINE self.textBrowser.setTextColor(self._colors['blue'])NEWLINE self.textBrowser.append("MultiQC results generated! Proceed to the next tab \n\n")NEWLINE filename = "results/fastqc/multiqc.html"NEWLINE webbrowser.get('google-chrome').open(filename, new=0, autoraise=True)NEWLINE else:NEWLINE passNEWLINENEWLINE def run_qc_textbox(self):NEWLINE subprocess.run(["snakemake", "--unlock", "-j", "1"])NEWLINE self.textBrowser.setTextColor(self._colors['black'])NEWLINE self.textBrowser.append("Running Quality Check!! \n\n") NEWLINE NEWLINE NEWLINE def run_qc_dna(self, line):NEWLINE self.progressBar_sub1_dna.setValue(51)NEWLINE self._set_color(self._colors['blue'].name(),pb =self.progressBar_sub1_dna)NEWLINE self.textBrowser.setTextColor(self._colors['black'])NEWLINE self.textBrowser.append("Config file created for Quality Check!! \nPlease refer to the file: config.yaml in your working directory. \n\n")NEWLINE conf = open('config.yaml', 'w')NEWLINE conf.write('samples: ./samples.tsv \n')NEWLINE conf.write('units: '+ self.UnitslineEditDNA.text() + '\n'+'ref: \n')NEWLINE conf.write(" name: " + self.RefNamecomboBoxDNA.currentText() + "\n")NEWLINE conf.write(' genome: '+ self.RefGenomelineEditDNA.text() + '\n')NEWLINE conf.write(' genome-name: '+ os.path.basename(self.RefGenomelineEditDNA.text()) + '\n')NEWLINE conf.write(' known-variants: '+ self.RefVariantlineEditDNA.text() + '\n')NEWLINE conf.write("processing: \n")NEWLINE conf.write(" remove-duplicates: true\n")NEWLINE conf.write('threads: ' + self.CorelineEditDNA.text() + '\n')NEWLINE conf.write('params: \n')NEWLINE conf.write(" cutadapt: '" + self.CutadaptlineEdit.text() + "' \n")NEWLINE conf.close()NEWLINE NEWLINE time.sleep(0.1)NEWLINE self.textBrowser.setTextColor(self._colors['black'])NEWLINE self.textBrowser.append("Snakefile created for Quality Check!! \nPlease refer to the file: Snakefile in your working directory. \n\n")NEWLINE snake = open('Snakefile', "w")NEWLINE snake.write('include: "rules/common_dna.smk"\n')NEWLINE snake.write('rule all:\n')NEWLINE snake.write(' input:\n')NEWLINE snake.write(' expand("results_dna/trimmed/fastqc_after/{u.sample}-{u.unit}-{u.condition}.aftertrim.html", u = units.itertuples()),\n')NEWLINE snake.write(' expand("results_dna/trimmed/fastqc_after/{u.sample}-{u.unit}-{u.condition}.aftertrim.zip", u = units.itertuples()) \n')NEWLINE snake.write('include: "rules/cutadapt_dna.smk"\n')NEWLINE snake.write('include: "rules/fastqc_after_dna.smk"\n')NEWLINE snake.close()NEWLINE NEWLINE time.sleep(0.1)NEWLINE NEWLINE def func1():NEWLINE NEWLINE process1 = subprocess.run(["snakemake", "--use-conda", "--cores", self.CorelineEditDNA.text()])NEWLINE p1 = Process(target=func1)NEWLINE p1.start()NEWLINE p2 = Process(target=self.func_pb_update( sub_pb=self.progressBar_sub1_dna, sub_pb_frac=4, initial_sub = 50, initial_main=0, error_icon=self.RunQCButtonErroricon))NEWLINE p2.start()NEWLINE NEWLINE def multi_qc():NEWLINE subprocess.run(["snakemake", "--use-conda", "-s", "Snakefile_after", "--cores", self.CorelineEditDNA.text()])NEWLINE NEWLINE if self.progressBar_sub1_dna.value()==75:NEWLINE self.textBrowser.setTextColor(self._colors['black'])NEWLINE self.textBrowser.append("Running Quality Check!! \n\n")NEWLINE p3 = Process(target=multi_qc)NEWLINE self.progressBar_sub1_dna.setValue(76)NEWLINE p3.start()NEWLINE NEWLINE p4 = Process(target= self.func_pb_update( sub_pb=self.progressBar_sub1_dna, sub_pb_frac=4, initial_sub = 75, initial_main=0, error_icon=self.QCresultsButtonErroricon))NEWLINE p4.start()NEWLINE else:NEWLINE passNEWLINE NEWLINE if os.path.exists("results_dna/qc/multiqc_after.html"):NEWLINE filename = "results_dna/qc/multiqc_after.html"NEWLINE webbrowser.get('google-chrome').open(filename, new=0, autoraise=True)NEWLINE else:NEWLINE passNEWLINE NEWLINE NEWLINENEWLINE def run_qc_rna_textbox(self):NEWLINE self.textBrowser.setTextColor(self._colors['black'])NEWLINE self.textBrowser.append("Running Quality Check!! \n\n")NEWLINE subprocess.run(["snakemake", "--unlock", "-j", "1"])NEWLINENEWLINE def run_qc_rna(self, line):NEWLINE self.progressBar_sub1_rna.setValue(51)NEWLINE self._set_color(self._colors['blue'].name(),pb =self.progressBar_sub1_rna)NEWLINE self.textBrowser.setTextColor(self._colors['black'])NEWLINE self.textBrowser.append("Config file created for Quality Check!! \nPlease refer to the file: config.yaml in your working directory. \n\n")NEWLINE conf = open('config.yaml', 'w')NEWLINE conf.write('units: units.tsv \n')NEWLINE conf.write('ref: \n')NEWLINE conf.write(' annotation: '+ self.AnnotatedlineEditRNA.text() + '\n')NEWLINE conf.write(' fasta: '+self.FastalineEdit.text() + '\n')NEWLINE conf.write('threads: ' + self.CorelineEditRNA.text() + '\n')NEWLINE conf.write('params: \n')NEWLINE conf.write(" cutadapt: '" + self.CutadaptlineEdit_rna.text() + "' \n")NEWLINE conf.write("sample: " + self.SampleFolderLineEdit.text() + "\n")NEWLINE conf.close()NEWLINE time.sleep(0.1)NEWLINE self.textBrowser.setTextColor(self._colors['black'])NEWLINE self.textBrowser.append("Snakefile created for Quality Check!! \nPlease refer to the file: Snakefile in your working directory. \n\n")NEWLINE snakef = open('Snakefile', "w")NEWLINE snakef.write('include: "rules/common_rna.smk"\n')NEWLINE snakef.write('rule all:\n')NEWLINE snakef.write(' input:\n')NEWLINE snakef.write(" expand('results/cutadapt/fastqc_after/{sample}_{condition}_Rep{rep}.aftertrim.html', sample=samples, condition=type, rep=reps),\n")NEWLINE snakef.write(" expand('results/cutadapt/fastqc_after/{sample}_{condition}_Rep{rep}.aftertrim.zip', sample=samples, condition=type, rep=reps),\n")NEWLINE snakef.write('include: "rules/cutadapt_rna.smk"\n')NEWLINE snakef.write('include: "rules/fastqc_after_rna.smk"\n')NEWLINE snakef.close()NEWLINE time.sleep(0.1)NEWLINE def func_qc_rna():NEWLINE NEWLINE process2 = subprocess.run(["snakemake", "--use-conda", "--cores", self.CorelineEditRNA.text()])NEWLINE output2 = process2.communicate()NEWLINE NEWLINE p1 = Process(target=func_qc_rna)NEWLINE p1.start()NEWLINE p2 = Process(target=self.func_pb_update( sub_pb=self.progressBar_sub1_rna, sub_pb_frac=4, initial_sub = 50, initial_main=0, error_icon=self.RunQCButtonErroricon_rna))NEWLINE p2.start() NEWLINE NEWLINE def multi_qc_rna():NEWLINE subprocess.run(["snakemake", "--use-conda", "-s", "Snakefile_after_rna", "--cores", self.CorelineEditRNA.text()])NEWLINE NEWLINE if self.progressBar_sub1_rna.value()==75:NEWLINE self.textBrowser.setTextColor(self._colors['black'])NEWLINE self.textBrowser.append("Running Quality Check!! \n\n")NEWLINE p3 = Process(target=multi_qc_rna)NEWLINE self.progressBar_sub1_rna.setValue(76)NEWLINE p3.start()NEWLINE NEWLINE p4 = Process(target= self.func_pb_update( sub_pb=self.progressBar_sub1_rna, sub_pb_frac=4, initial_sub = 75, initial_main=0, error_icon=self.QCresultsButtonErroricon_rna))NEWLINE p4.start()NEWLINE else:NEWLINE passNEWLINE NEWLINE if os.path.exists("results/cutadapt/fastqc_after/multiqc_after.html"):NEWLINE filename = "results/cutadapt/fastqc_after/multiqc_after.html"NEWLINE webbrowser.get('google-chrome').open(filename, new=0, autoraise=True)NEWLINE else:NEWLINE passNEWLINE NEWLINE def run_index_text(self):NEWLINE subprocess.run(["snakemake", "--unlock", "-j", "1"])NEWLINE self.textBrowser.setTextColor(self._colors['black'])NEWLINE self.textBrowser.append("Creating Index for "+self.AlignercomboBoxDNA.currentText()+ "!! \n\n")NEWLINE NEWLINE def run_index_dna(self):NEWLINE self.progressBar_sub2_dna.setValue(1)NEWLINE self._set_color(self._colors['blue'].name(),pb =self.progressBar_sub2_dna)NEWLINE conf = open('config.yaml', 'w')NEWLINE conf.write('samples: ./samples.tsv \n')NEWLINE conf.write('units: '+ self.UnitslineEditDNA.text() + '\n'+'ref: \n')NEWLINE conf.write(" name: " + self.RefNamecomboBoxDNA.currentText() + "\n")NEWLINE conf.write(' genome: '+ self.RefGenomelineEditDNA.text() + '\n')NEWLINE conf.write(' genome-name: '+ os.path.basename(self.RefGenomelineEditDNA.text()) + '\n')NEWLINE conf.write(' genome-dict: '+ os.path.splitext(self.RefGenomelineEditDNA.text())[0] + '\n')NEWLINE conf.write(' known-variants: '+ self.RefVariantlineEditDNA.text() + '\n')NEWLINE conf.write('threads: ' + self.CorelineEditRNA.text() + '\n')NEWLINE conf.write("processing: \n")NEWLINE conf.write(" remove-duplicates: true\n")NEWLINE conf.write("threads: " + self.CorelineEditDNA.text() + "\n")NEWLINE conf.write('params: \n')NEWLINE conf.write(" cutadapt: '" + self.CutadaptlineEdit.text() + "' \n")NEWLINE conf.close()NEWLINE time.sleep(0.1)NEWLINE self.textBrowser.setTextColor(self._colors['black'])NEWLINE self.textBrowser.append("Config file created for generating index!! \nPlease refer to the file: config.yaml in your working directory. \n\n")NEWLINE rule = open('rule_all_index.txt', 'r')NEWLINE snakef = open('Snakefile', "w")NEWLINE snakef.write('include: "rules/common_dna.smk"\n')NEWLINE snakef.write('rule all:\n')NEWLINE snakef.write(' input:\n')NEWLINE for line in rule:NEWLINE if self.AlignercomboBoxDNA.currentText() in line:NEWLINE snakef.write(line)NEWLINE else:NEWLINE passNEWLINE rule.close()NEWLINE snakef.write('\ninclude: "rules/' + self.AlignercomboBoxDNA.currentText() + '_index.smk" \n')NEWLINE snakef.close()NEWLINE time.sleep(0.1)NEWLINENEWLINE def func_index_dna():NEWLINE NEWLINE process3 = subprocess.run(["snakemake", "--use-conda", "-s", "Snakefile", "--cores", self.CorelineEditDNA.text()])NEWLINE p1 = Process(target=func_index_dna)NEWLINE p1.start()NEWLINE p2 = Process(target=self.func_pb_update( sub_pb=self.progressBar_sub2_dna, sub_pb_frac=1, initial_sub = 0, initial_main=0, error_icon=self.RunIndexdnaButtonErroricon))NEWLINE p2.start()NEWLINE# self.textBrowser.insertPlainText("Creating Index for "+self.AlignercomboBoxDNA.currentText()+ "!! \n\n")NEWLINE if self.AlignercomboBoxDNA.currentText() == "BWA_MEM":NEWLINE self.BWAIndexlineEdit.setText("results_dna/index/BWA_MEM/" +os.path.basename(self.RefGenomelineEditDNA.text()))NEWLINE elif self.AlignercomboBoxDNA.currentText() == 'GEM3':NEWLINE self.BWAIndexlineEdit.setText("results_dna/index/"+self.AlignercomboBoxDNA.currentText()+ "/"+os.path.basename(self.RefGenomelineEditDNA.text())+".gem")NEWLINE else:NEWLINE self.BWAIndexlineEdit.setText("results_dna/index/"+self.AlignercomboBoxDNA.currentText()+ "/"+os.path.basename(self.RefGenomelineEditDNA.text()))NEWLINE# self.BWAIndexlineEdit.setText(os.getcwd()+"/results_dna/index/"+self.AlignercomboBoxDNA.currentText()+ "/"+os.path.basename(self.RefGenomelineEditDNA.text())+".gem")NEWLINE if self.progressBar_sub2_dna.value() == 100:NEWLINE self.textBrowser.setTextColor(self._colors['black'])NEWLINE self.textBrowser.append("Index created in results_dna/index/" +self.AlignercomboBoxDNA.currentText() +"/ !! \n\n")NEWLINE else:NEWLINE passNEWLINE NEWLINE def run_index_rna(self):NEWLINE self.progressBar_sub2_dna.setValue(1)NEWLINE self._set_color(self._colors['blue'].name(),pb =self.progressBar_sub2_dna)NEWLINE self.textBrowser.setTextColor(self._colors['black'])NEWLINE self.textBrowser.append("Config file created for generating index!! \nPlease refer to the file: config.yaml in your working directory. \n\n")NEWLINE conf = open('config.yaml', 'w')NEWLINE conf.write('units: units.tsv \n')NEWLINE conf.write('ref: \n')NEWLINE conf.write(' annotation: '+ self.AnnotatedlineEditRNA.text() + '\n')NEWLINE conf.write(' fasta: '+self.FastalineEdit.text() + '\n')NEWLINE conf.write('threads: ' + self.CorelineEditRNA.text() + '\n')NEWLINE conf.write('params: \n')NEWLINE conf.write(" cutadapt: '" + self.CutadaptlineEdit_rna.text() + "' \n")NEWLINE conf.write("sample: " + self.SampleFolderLineEdit.text() + "\n")NEWLINE conf.close()NEWLINE NEWLINE time.sleep(0.1)NEWLINE self.textBrowser.setTextColor(self._colors['black'])NEWLINE self.textBrowser.append("Snakefilefile created for generating index!! \nPlease refer to the file: Snakefile_index in your working directory. \n\n")NEWLINE rule = open('rule_all_index.txt', 'r')NEWLINE snakef = open('Snakefile', "w")NEWLINE snakef.write('configfile: "config.yaml"\n')NEWLINE snakef.write('rule all:\n')NEWLINE snakef.write(' input:\n')NEWLINE for line in rule:NEWLINE if self.AlignercomboBoxRNA.currentText() in line:NEWLINE snakef.write(line)NEWLINE snakef.write('\ninclude: "rules/' + self.AlignercomboBoxRNA.currentText() + '_index.smk" \n')NEWLINE rule.close()NEWLINE snakef.close()NEWLINE NEWLINE time.sleep(0.1)NEWLINE def func_index_rna():NEWLINE NEWLINE process4 = subprocess.run(["snakemake", "--use-conda", "-s", "Snakefile", "--cores", self.CorelineEditDNA.text()])NEWLINE output4 = process4.communicate()NEWLINE self.textBrowser.setTextColor(self._colors['black'])NEWLINE self.textBrowser.append("Creating Index for "+self.AlignercomboBoxRNA.currentText()+ "!! \n\n")NEWLINE p1 = Process(target=func_index_rna)NEWLINE p1.start()NEWLINE p2 = Process(target=self.func_pb_update( sub_pb=self.progressBar_sub2_rna, sub_pb_frac=1, initial_sub = 0, initial_main=0, error_icon=self.RunIndexrnaButtonErroricon))NEWLINE p2.start()NEWLINE self.StarIndexlineEdit.setText(os.getcwd()+"/results/index/"+self.AlignercomboBoxRNA.currentText())NEWLINE if self.progressBar_sub2_dna.value() == 100:NEWLINE self.textBrowser.setTextColor(self._colors['black'])NEWLINE self.textBrowser.append("Index created in results/index/" +self.AlignercomboBoxRNA.currentText() +"/ !! \n\n")NEWLINE else:NEWLINE passNEWLINENEWLINE def create_config_dna(self):NEWLINE conf = open('config.yaml', 'w')NEWLINE conf.write('samples: ./samples.tsv \n')NEWLINE conf.write('units: '+ self.UnitslineEditDNA.text() + '\n'+'ref: \n')NEWLINE conf.write(" name: " + self.RefNamecomboBoxDNA.currentText() + "\n")NEWLINE conf.write(' genome: '+ self.RefGenomelineEditDNA.text() + '\n')NEWLINE conf.write(' genome-name: '+ os.path.basename(self.RefGenomelineEditDNA.text()) + '\n')NEWLINE conf.write(' genome-dict: '+ os.path.splitext(self.RefGenomelineEditDNA.text())[0] + '\n')NEWLINE conf.write(' known-variants: '+ self.RefVariantlineEditDNA.text() + '\n')NEWLINE conf.write("processing: \n")NEWLINE conf.write(" remove-duplicates: true\n")NEWLINE conf.write('index: \n')NEWLINE conf.write(' '+ self.AlignercomboBoxDNA.currentText() + ': ' + self.BWAIndexlineEdit.text() + '\n')NEWLINE conf.write('threads: ' + self.CorelineEditDNA.text() + '\n')NEWLINE conf.write('params: \n')NEWLINE conf.write(" cutadapt: '" + self.CutadaptlineEdit.text() + "' \n")NEWLINE aligner_params = open("aligner_params.txt", 'r').read().replace('\n', '')NEWLINE conf.write(" " + aligner_params + '\n')NEWLINE vc_params = open("vc_params.txt", 'r').read().replace('\n', '')NEWLINE conf.write(" " + vc_params + '\n')NEWLINE annotator_params = open("annotator_params.txt", 'r').read().replace('\n', '')NEWLINE conf.write(" " + annotator_params + '\n')NEWLINENEWLINE conf.write(" picard: \n")NEWLINE conf.write(" MarkDuplicates: REMOVE_DUPLICATES=true VALIDATION_STRINGENCY=SILENT \n")NEWLINE conf.write("filtering:\n")NEWLINE conf.write(" vqsr: false\n")NEWLINE conf.write(" hard:\n")NEWLINE conf.write(" snvs:\n")NEWLINE conf.write(" " + '"QD < 2.0 || FS > 60.0 || MQ < 40.0 || MQRankSum < -12.5 || ReadPosRankSum < -8.0"\n')NEWLINE conf.write(" "+"indels:\n")NEWLINE conf.write(" "+'"QD < 2.0 || FS > 200.0 || ReadPosRankSum < -20.0"\n')NEWLINE conf.close()NEWLINE self.textBrowser.setTextColor(self._colors['black'])NEWLINE self.textBrowser.append("Config file created for DNA Seq analysis!! \nPlease refer to the file: config.yaml in your working directory. \n\n")NEWLINENEWLINENEWLINE def create_snakefile_dna(self):NEWLINE snake = open('Snakefile', "w")NEWLINE snake.write('include: "rules/common_dna.smk"\n')NEWLINE snake.write('rule all:\n')NEWLINE snake.write(' input:\n')NEWLINE snake.write(' expand("results_dna/mapped/{u.sample}-{u.unit}-{u.condition}.sorted.bam", u = units.itertuples()),\n')NEWLINE snake.write(' expand("results_dna/dedup/{u.sample}-{u.unit}-{u.condition}.bam", u = units.itertuples()),\n')NEWLINE snake.write(' "results_dna/filtered/all.vcf.gz",\n')NEWLINE snake.write(' "results_dna/multiqc/multiqc.html",\n')NEWLINE snake.write(' config["ref"]["genome-dict"]+ ".dict",\n')NEWLINE snake.write(' config["ref"]["genome"]+ ".fai",\n')NEWLINE snake.write('\ninclude: "rules/' + self.AlignercomboBoxDNA.currentText() + '.smk" \n')NEWLINE snake.write('include: "rules/' + self.VCcomboBoxDNA.currentText() + '.smk" \n')NEWLINE snake.write('include: "rules/' + self.AnnotatorcomboBoxDNA.currentText() + '.smk" \n')NEWLINE snake.close()NEWLINE self.textBrowser.setTextColor(self._colors['black'])NEWLINE self.textBrowser.append("Snakefile created for DNA Seq analysis!! \nPlease refer to the file: Snakefile in your working directory. \n\n")NEWLINENEWLINE def not_snpeff(self):NEWLINE self.param_display()NEWLINE if self.AnnotatorcomboBoxDNA.currentText() == 'SnpEff':NEWLINE self.RefNamelabelDNA.show()NEWLINE self.RefNamecomboBoxDNA.show()NEWLINE else:NEWLINE self.RefNamelabelDNA.setText("Reference name (as in Annovar database)")NEWLINE self.RefNamelabelDNA.show()NEWLINE self.RefNamecomboBoxDNA.show()NEWLINENEWLINE def if_annovar(self):NEWLINE with open('Snakefile', 'r+') as fd:NEWLINE contents = fd.readlines()NEWLINE if self.AnnotatorcomboBoxDNA.currentText() == 'Annovar':NEWLINE self.RefNamelabelDNA.setText("Reference name (as in Annovar database)")NEWLINE contents.insert(7, ' "results_dna/filtered/all.avinput",\n')NEWLINE contents.insert(10, ' "results_dna/annotated/all." + config["ref"]["name"] + "_multianno.vcf", \n')NEWLINE fd.seek(0) # readlines consumes the iterator, so we need to start overNEWLINE fd.writelines(contents)NEWLINE else:NEWLINE contents.insert(8, ' "results_dna/annotated/all.vcf", \n')NEWLINE fd.seek(0) # readlines consumes the iterator, so we need to start overNEWLINE fd.writelines(contents)NEWLINE fd.close()NEWLINENEWLINE def create_config_rna(self):NEWLINE conf = open('config.yaml', 'w')NEWLINE conf.write('units: units.tsv \n')NEWLINE conf.write('ref: \n')NEWLINE if self.AlignercomboBoxRNA.currentText() == 'HISAT2':NEWLINE conf.write(' index-'+self.AlignercomboBoxRNA.currentText() + ': ' + self.StarIndexlineEdit.text() + '/ \n')NEWLINE elif self.AlignercomboBoxRNA.currentText() == 'bowtie2':NEWLINE conf.write(' index-'+ self.AlignercomboBoxRNA.currentText() + ': ' + self.StarIndexlineEdit.text() + '/bowtie2-index \n')NEWLINE else:NEWLINE conf.write(' index-'+ self.AlignercomboBoxRNA.currentText() + ': ' + self.StarIndexlineEdit.text() + '\n')NEWLINE conf.write(' annotation: '+ self.AnnotatedlineEditRNA.text() + '\n')NEWLINE conf.write(' fasta: '+self.FastalineEdit.text() + '\n')NEWLINE conf.write('threads: ' + self.CorelineEditRNA.text() + '\n')NEWLINE conf.write('params: \n')NEWLINE conf.write(" cutadapt: '" + self.CutadaptlineEdit_rna.text() + "' \n")NEWLINE aligner_params_rna = open("aligner_params_rna.txt", 'r').read().replace('\n', '')NEWLINE conf.write(" " + aligner_params_rna + '\n')NEWLINE em_params = open("em_params.txt", 'r').read().replace('\n', '')NEWLINE conf.write(" " + em_params + '\n')NEWLINE de_params = open("de_params.txt", 'r').read().replace('\n', '')NEWLINE conf.write(" " + de_params + '\n')NEWLINE NEWLINE conf.write("sample: " + self.SampleFolderLineEdit.text() + "\n")NEWLINE conf.close()NEWLINE self.textBrowser.setTextColor(self._colors['black'])NEWLINE self.textBrowser.append("Config file created for RNA Seq analysis!! \nPlease refer to the file: config.yaml in your working directory. \n\n")NEWLINENEWLINENEWLINE def create_snakefile_rna(self):NEWLINE snakef = open('Snakefile', 'w')NEWLINE snakef.write('include: "rules/common_rna.smk"\n')NEWLINE snakef.write('rule all:\n')NEWLINE snakef.write(' input:\n')NEWLINE if self.AlignercomboBoxRNA.currentText() == 'HISAT2':NEWLINE snakef.write(" expand('results/aligner_results/{sample}_{condition}_Rep{rep}.sam', sample=samples, condition=type, rep=reps),\n")NEWLINE snakef.write(" expand('results/aligner_results/{sample}_{condition}_Rep{rep}.bam', sample=samples, condition=type, rep=reps),\n")NEWLINE elif self.AlignercomboBoxRNA.currentText() == 'STAR':NEWLINE snakef.write(" expand('results/aligner_results/{sample}_{condition}_Rep{rep}/Aligned.out.sam', sample=samples, condition=type, rep=reps),\n")NEWLINE snakef.write(" expand('results/aligner_results/{sample}_{condition}_Rep{rep}.bam', sample=samples, condition=type, rep=reps),\n")NEWLINE if self.EMcomboBoxRNA.currentText() == 'StringTie':NEWLINE snakef.write(" expand('results/em_results/{sample}_{condition}_Rep{rep}/{sample}_{condition}_Rep{rep}_transcript.gtf', sample=samples, condition=type, rep=reps),\n")NEWLINE snakef.write(" expand('results/em_results/{sample}_{condition}_Rep{rep}/{sample}_{condition}_Rep{rep}_gene_abundances.tsv', sample=samples, condition=type, rep=reps),\n")NEWLINE snakef.write(" expand('results/em_results/{sample}_{condition}_Rep{rep}/{sample}_{condition}_Rep{rep}_cov_ref.gtf', sample=samples, condition=type, rep=reps),\n")NEWLINE elif self.EMcomboBoxRNA.currentText() == 'HTSeq':NEWLINE snakef.write(" expand('results/em_results/{sample}_{condition}_Rep{rep}.counts', sample=samples, condition=type, rep=reps),\n")NEWLINE snakef.write(' "results/em_results/emtable.tsv",\n')NEWLINE if self.DEcomboBoxRNA.currentText() == 'ballgown':NEWLINE snakef.write(" expand('results/de_results/SigDE.txt'),\n")NEWLINE elif self.DEcomboBoxRNA.currentText() == 'DESeq2':NEWLINE snakef.write(" expand('results/de_results/DESeq2_normalized_counts.txt'),\n")NEWLINE snakef.write(' "results/multiqc/multiqc.html",\n')NEWLINE snakef.write('include: "rules/' + self.AlignercomboBoxRNA.currentText() + '.smk" \n')NEWLINE snakef.write('include: "rules/' + self.EMcomboBoxRNA.currentText() + '.smk" \n')NEWLINE snakef.write('include: "rules/' + self.DEcomboBoxRNA.currentText() + '.smk" \n')NEWLINE snakef.close()NEWLINE self.textBrowser.setTextColor(self._colors['black'])NEWLINE self.textBrowser.append("Snakefile created for RNA Seq analysis!! \nPlease refer to the file: Snakefile in your working directory. \n\n")NEWLINENEWLINE def create_dag(self):NEWLINE with open("Snakefile", "r+") as snake:NEWLINE line= snake.readline()NEWLINE if '"rules/common_dna.smk"' in line:NEWLINE svg_filename = self.AlignercomboBoxDNA.currentText() + self.VCcomboBoxDNA.currentText() + self.AnnotatorcomboBoxDNA.currentText() + ".svg"NEWLINE else:NEWLINE svg_filename = self.AlignercomboBoxRNA.currentText() + self.EMcomboBoxRNA.currentText() + self.DEcomboBoxRNA.currentText() + ".svg"NEWLINE print(svg_filename)NEWLINE subprocess.run(["snakemake", "--rulegraph", "|", "dot", "-Tsvg", "-o", '"'+ svg_filename+ '"'], shell =True, stdout=subprocess.PIPE)NEWLINENEWLINENEWLINE def about(self):NEWLINE url = 'icomic.readthedocs.io'NEWLINE widget = About()NEWLINE widget.setText("iCOMIC version 0.1")NEWLINE widget.setInformativeText("""NEWLINE Online documentation on <a href="http://%(url)s">%(url)s</a>NEWLINE <br>NEWLINE <br>NEWLINE Authors: Anjana Anilkumar Sithara, Devi Priyanka Maripuri, Keerthika Moorthy, Sai Sruthi Amirtha Ganesh, Philge Philip, Shayantan Banerjee, Malvika Sudhakar, Karthik Raman NEWLINE """ % {"url": url})NEWLINE widget.setWindowTitle("iCOMIC")NEWLINE retval = widget.exec_()NEWLINE if retval == QtWidgets.QMessageBox.Ok:NEWLINE widget.close()NEWLINENEWLINE def quick_start(self):NEWLINE url = 'iCOMIC.readthedocs.io'NEWLINE pipelines_text = "<ul>\n"NEWLINE msg = HelpDialog(pipelines=pipelines_text)NEWLINE retval = msg.exec_()NEWLINE if retval == QtWidgets.QMessageBox.Ok:NEWLINE msg.close()NEWLINENEWLINENEWLINE NEWLINE def run_action_textbox(self):NEWLINE subprocess.run(["snakemake", "--unlock", "-j", "1"])NEWLINE self.textBrowser.setTextColor(self._colors['black'])NEWLINE self.textBrowser.append("Please be patient, while we analyze your data... \n\n")NEWLINENEWLINE def run_action_dna(self):NEWLINE self._set_color(self._colors['blue'].name(),pb =self.progressBar_dna)NEWLINE self.progressBar_dna.setValue(1)NEWLINE NEWLINE def func_run_action():NEWLINE process5 = subprocess.run(["snakemake", "--use-conda", "-j", self.CorelineEditDNA.text()])NEWLINE NEWLINE NEWLINE p1 = Process(target=func_run_action)NEWLINE p1.start()NEWLINE p2 = Process(target=self.func_pb_update( sub_pb=self.progressBar_dna, sub_pb_frac=1, initial_sub = 0, initial_main=0, error_icon=self.RunButtonErroricon_dna))NEWLINE p2.start()NEWLINE NEWLINE if self.progressBar_dna.value() == 100:NEWLINE self._set_color(self._colors['green'].name(),pb =self.progressBar_dna)NEWLINE self.nextbuttonrunDNA.setEnabled(True)NEWLINE self.DNAtabWidget.setCurrentIndex(4)NEWLINE self.DNAtabWidget.setTabEnabled(4, True)NEWLINE else:NEWLINE passNEWLINE NEWLINENEWLINE def run_action_rna(self):NEWLINE self.progressBar.setValue(1)NEWLINE self._set_color(self._colors['blue'].name(),pb =self.progressBar)NEWLINE def func_run_action():NEWLINE process5 = subprocess.run(["snakemake", "--use-conda", "--cores", self.CorelineEditDNA.text()])NEWLINE NEWLINE NEWLINE p1 = Process(target=func_run_action)NEWLINE p1.start()NEWLINE p2 = Process(target=self.func_pb_update( sub_pb=self.progressBar, sub_pb_frac=1, initial_sub = 0, initial_main=0, error_icon=self.RunButtonErroricon))NEWLINE p2.start()NEWLINE if self.progressBar.value() == 100:NEWLINE self._set_color(self._colors['green'].name(),pb =self.progressBar)NEWLINE self.nextbuttonrunRNA.setEnabled(True)NEWLINE self.RNAtabWidget.setCurrentIndex(4)NEWLINE self.RNAtabWidget.setTabEnabled(4, True)NEWLINE else:NEWLINE passNEWLINE NEWLINE NEWLINE def on_check_proceed(self,is_toggle):NEWLINE if is_toggle:NEWLINE self.ctagradioButton.setEnabled(True)NEWLINE self.nbradioButton.setEnabled(True)NEWLINE self.nextbuttonresult.setEnabled(True)NEWLINE self.nbinfoiconradio.setEnabled(True)NEWLINE else:NEWLINE self.ctagradioButton.setEnabled(False)NEWLINE self.nbradioButton.setEnabled(False)NEWLINE self.nextbuttonresult.setEnabled(False)NEWLINE self.nbinfoiconradio.setEnabled(False)NEWLINENEWLINENEWLINENEWLINEclass About(QtWidgets.QMessageBox):NEWLINE """A resizable QMessageBox for the About dialog"""NEWLINENEWLINE def __init__(self, *args, **kwargs):NEWLINE super(About, self).__init__(*args, **kwargs)NEWLINE self.setSizeGripEnabled(True)NEWLINE self.setIcon(QtWidgets.QMessageBox.Information)NEWLINE self.setWindowTitle("iCOMIC")NEWLINE self.setStandardButtons(QtWidgets.QMessageBox.Ok)NEWLINENEWLINE def event(self, e):NEWLINE result = super(About, self).event(e)NEWLINENEWLINE self.setMinimumHeight(0)NEWLINE self.setMaximumHeight(16777215)NEWLINE self.setMinimumWidth(500)NEWLINE self.setMaximumWidth(16777215)NEWLINE self.setSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)NEWLINENEWLINE return resultNEWLINENEWLINEclass Ui_Help(object):NEWLINE def setupUi(self, Help):NEWLINE Help.setObjectName("Help")NEWLINE Help.resize(456, 582)NEWLINE self.gridLayout = QtWidgets.QGridLayout(Help)NEWLINE self.gridLayout.setObjectName("gridLayout")NEWLINE self.verticalLayout = QtWidgets.QVBoxLayout()NEWLINE self.verticalLayout.setObjectName("verticalLayout")NEWLINE self.textBrowser = QtWidgets.QTextBrowser(Help)NEWLINE self.textBrowser.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOn)NEWLINE self.textBrowser.setOpenExternalLinks(True)NEWLINE self.textBrowser.setObjectName("textBrowser")NEWLINE self.verticalLayout.addWidget(self.textBrowser)NEWLINE self.buttonBox = QtWidgets.QDialogButtonBox(Help)NEWLINE self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Ok)NEWLINE self.buttonBox.setObjectName("buttonBox")NEWLINE self.verticalLayout.addWidget(self.buttonBox)NEWLINE self.gridLayout.addLayout(self.verticalLayout, 0, 0, 1, 1)NEWLINENEWLINE self.retranslateUi(Help)NEWLINE QtCore.QMetaObject.connectSlotsByName(Help)NEWLINENEWLINE def retranslateUi(self, Help):NEWLINE _translate = QtCore.QCoreApplication.translateNEWLINE Help.setWindowTitle(_translate("Help", "iCOMIC Help"))NEWLINENEWLINEhelptxt = """NEWLINE<div style="fontsize:12px">NEWLINE<p>NEWLINE<b>iCOMIC</b> pipeline enables the ready analysis of RNA-Seq and Whole Genome Sequencing data.NEWLINE ICOMIC has an inbuilt library of tools with predefined valid combinations.NEWLINE</p>NEWLINE <p>NEWLINE The user will have the freedom to choose any possible combination of tools,NEWLINE however a benchmarked list of pipelines is provided (seeNEWLINE<a href="http://iCOMIC.readthedocs.io">iCOMIC.readthedocs.io</a> for details).NEWLINE </p>NEWLINENEWLINE <p>NEWLINE Here is a typical set of actions to run iCOMIC pipelines:NEWLINE <ol>NEWLINE <li> Select a pipeline. </li>NEWLINE <li> Input the required data files.</li>NEWLINE <li> Check 'yes' for Quality Control if you want to do quality check andNEWLINE trimming and also mention the additional parameters if required.</li>NEWLINE <ul>NEWLINE <li> Tool for Quality Control: FastQC </li>NEWLINE <li> Tool for trimming the reads: Cutadapt </li>NEWLINE </ul>NEWLINE <li> Click on 'Create snakefile for QC Analysis' button for creatingNEWLINE the Snakefile and 'Create config file for QC Analysis' button forNEWLINE config file. </li>NEWLINE <li> Click on 'Run Quality Control' to perform Quality check. </li>NEWLINE <li> Select the tools for analysis. </li>NEWLINE <li> Input the index files. </li>NEWLINE <li> Enter additional parameters for each tool if required. </li>NEWLINE <li> Click on 'Create snakefile' button for creating the Snakefile andNEWLINE 'Create config file' button for config file. </li>NEWLINE <li> Click 'Run' to run the pipeline.</li>NEWLINE </ol>NEWLINE"""NEWLINENEWLINENEWLINEclass HelpDialog(QtWidgets.QDialog):NEWLINE """todo"""NEWLINE def __init__(self, parent=None, pipelines=""):NEWLINE super().__init__(parent=parent)NEWLINE self.ui = Ui_Help()NEWLINE self.ui.setupUi(self)NEWLINE self.ui.textBrowser.setText(helptxt % {"pipelines": pipelines})NEWLINE self.ui.buttonBox.accepted.connect(self.close)NEWLINENEWLINE NEWLINENEWLINEclass SVGDialog(QtWidgets.QDialog):NEWLINE """Dialog to show a SVG image"""NEWLINE def __init__(self, filename):NEWLINE super().__init__()NEWLINE self.main_layout = QtWidgets.QVBoxLayout(self)NEWLINE self.setWindowTitle("DAG")NEWLINENEWLINE if os.path.exists(filename):NEWLINE widget = QSvgWidget(filename)NEWLINE self.main_layout.addWidget(widget)NEWLINENEWLINEclass QCResultsDialog(QtWidgets.QWidget):NEWLINE """Dialog to show a SVG image"""NEWLINE def __init__(self, filename):NEWLINE super().__init__()NEWLINE self.initUI()NEWLINE NEWLINE def initUI(self):NEWLINE self.closeButton = QtWidgets.QPushButton("Close")NEWLINE self.main_layout = QtWidgets.QHBoxLayout(self)NEWLINE self.main_layout.addStretch(1)NEWLINE self.main_layout.addWidget(self.closeButton)NEWLINE self.vbox = QtWidgets.QVBoxLayout(self)NEWLINE self.vbox.addStretch(2)NEWLINE self.vbox.addLayout(self.main_layout)NEWLINE self.setLayout(self.vbox) NEWLINE self.setGeometry(300, 300, 300, 150)NEWLINE self.setWindowTitle("FastQC Results")NEWLINE NEWLINEclass AdvancedDialog(QtWidgets.QDialog):NEWLINE def __init__(self, path):NEWLINE super().__init__()NEWLINE self.setWindowTitle("Advanced Options")NEWLINE self.setStyleSheet("background-color: #C3E7B5")NEWLINE self.top = 200NEWLINE self.left = 500NEWLINE self.width = 600NEWLINE self.height = 550NEWLINE self.setGeometry(self.left, self.top, self.width, self.height)NEWLINE formLayout =QFormLayout()NEWLINE groupBox = QGroupBox()NEWLINE groupBox.setStyleSheet("background-color: #F0F9EC")NEWLINE dataframe = pd.read_csv(path, header=0) # specifying that the table has column namesNEWLINE add_int_param = dataframe[(dataframe["Value"] == 'INT') & (dataframe["Essential"] == 'no')]NEWLINE num_add_int_param = len(add_int_param)NEWLINE add_float_param = dataframe[(dataframe["Value"] == 'FLOAT') & (dataframe["Essential"] == 'no')]NEWLINE num_add_float_param=len(add_float_param)NEWLINE add_na_param = dataframe[(dataframe["Value"] == 'na') & (dataframe["Essential"] == 'no')]NEWLINE num_add_na_param=len(add_na_param)NEWLINE add_str_param = dataframe[(dataframe["Value"] == 'STR') & (dataframe["Essential"] == 'no')]NEWLINE num_add_str_param=len(add_str_param)NEWLINE NEWLINE self.button = QtWidgets.QDialogButtonBox(self)NEWLINE self.button.setStandardButtons(QtWidgets.QDialogButtonBox.Ok)NEWLINE self.button.move(450,510)NEWLINE NEWLINE self.label_list_int = []NEWLINE self.line_edit_list_int = []NEWLINE self.label_list_float = []NEWLINE self.line_edit_list_float = []NEWLINE self.radio_label_list_na = []NEWLINE self.line_edit_list_str = []NEWLINE self.label_list_str = []NEWLINE for y in range(num_add_int_param):NEWLINE label_name = str(add_int_param.iloc[y, 2])NEWLINE self.label_name = QtWidgets.QLabel(label_name)NEWLINE self.label_list_int.append(self.label_name)NEWLINE default_value = str(add_int_param.iloc[y, 4])NEWLINE self.line_edit = QtWidgets.QLineEdit(default_value)NEWLINE self.line_edit_list_int.append(self.line_edit)NEWLINE formLayout.addRow(self.label_list_int[y], self.line_edit_list_int[y])NEWLINE for x in range(num_add_float_param):NEWLINE label_name = str(add_float_param.iloc[x, 2])NEWLINE self.label_name = QtWidgets.QLabel(label_name)NEWLINE self.label_list_float.append(self.label_name)NEWLINE default_value = str(add_float_param.iloc[x, 4])NEWLINE self.line_edit = QtWidgets.QLineEdit(default_value)NEWLINE self.line_edit_list_float.append(self.line_edit)NEWLINE formLayout.addRow(self.label_list_float[x], self.line_edit_list_float[x])NEWLINE for p in range(num_add_str_param):NEWLINE label_name = str(add_str_param.iloc[p, 2])NEWLINE self.label_name = QtWidgets.QLabel(label_name)NEWLINE self.label_list_str.append(self.label_name)NEWLINE default_value = str(add_str_param.iloc[p, 4])NEWLINE self.line_edit = QtWidgets.QLineEdit(default_value)NEWLINE self.line_edit_list_str.append(self.line_edit)NEWLINE formLayout.addRow(self.label_list_str[p], self.line_edit_list_str[p])NEWLINE formLayout.addRow(self.label_list_str[p])NEWLINE for z in range(num_add_na_param):NEWLINE radio_name = str(add_na_param.iloc[z, 2])NEWLINE self.radio_name = QtWidgets.QCheckBox(radio_name)NEWLINE self.radio_name.setChecked(False)NEWLINE self.radio_label_list_na.append(self.radio_name)NEWLINE formLayout.addRow(self.radio_label_list_na[z])NEWLINE NEWLINENEWLINE NEWLINE groupBox.setLayout(formLayout)NEWLINE scroll = QScrollArea()NEWLINE scroll.setWidget(groupBox)NEWLINE scroll.setWidgetResizable(True)NEWLINE scroll.setFixedHeight(450)NEWLINE layout = QtWidgets.QVBoxLayout(self)NEWLINE layout.addWidget(scroll)NEWLINE NEWLINEclass AdvancedDialog_old(QtWidgets.QDialog):NEWLINE def __init__(self, path):NEWLINE super().__init__()NEWLINE self.setWindowTitle("Advanced Options")NEWLINE self.top = 200NEWLINE self.left = 500NEWLINE self.width = 600NEWLINE self.height = 550NEWLINE self.setGeometry(self.left, self.top, self.width, self.height)NEWLINE formLayout =QFormLayout()NEWLINE groupBox = QGroupBox()NEWLINE dataframe = pd.read_csv(path, header=0) # specifying that the table has column namesNEWLINE additional = dataframe[dataframe["Essential"] == "no"]NEWLINE number_of_additional = len(additional)NEWLINE NEWLINE self.button = QtWidgets.QDialogButtonBox(self)NEWLINE self.button.setStandardButtons(QtWidgets.QDialogButtonBox.Ok)NEWLINE self.button.move(450,510)NEWLINE self.label_list = []NEWLINE self.line_edit_list = []NEWLINE for x in range(number_of_additional):NEWLINE label_name = str(additional.iloc[x, 2])NEWLINE self.label_name = QtWidgets.QLabel(label_name)NEWLINE self.label_list.append(self.label_name)NEWLINE default_value = str(additional.iloc[x, 4])NEWLINE self.line_edit = QtWidgets.QLineEdit(default_value)NEWLINE self.line_edit_list.append(self.line_edit)NEWLINE formLayout.addRow(self.label_list[x], self.line_edit_list[x])NEWLINE groupBox.setLayout(formLayout)NEWLINE scroll = QScrollArea()NEWLINE scroll.setWidget(groupBox)NEWLINE scroll.setWidgetResizable(True)NEWLINE scroll.setFixedHeight(450)NEWLINE layout = QtWidgets.QVBoxLayout(self)NEWLINE layout.addWidget(scroll)NEWLINEclass showQCDialog():NEWLINE def __init__(self):NEWLINE super().__init__()NEWLINE msgBox = QMessageBox()NEWLINE msgBox.setIcon(QMessageBox.Question)NEWLINE self.left = 700NEWLINE self.top = 450NEWLINE self.width = 320NEWLINE self.height = 400NEWLINE msgBox.setGeometry(self.left, self.top, self.width, self.height)NEWLINE msgBox.setText("Are you sure you want to proceed without Quality control of your data?")NEWLINE msgBox.setWindowTitle("WARNING")NEWLINE msgBox.resize(200,64)NEWLINE msgBox.setStandardButtons(QMessageBox.Yes | QMessageBox.Cancel)NEWLINENEWLINE self.returnValue = msgBox.exec()NEWLINE NEWLINEclass ResultsDialog(QtWidgets.QMainWindow):NEWLINE def __init__(self, path):NEWLINE super().__init__() NEWLINENEWLINE self.textEdit = QtWidgets.QTextEdit()NEWLINE self.setCentralWidget(self.textEdit)NEWLINE self.statusBar()NEWLINE self.setGeometry(300, 300, 350, 300)NEWLINE self.setWindowTitle(os.path.basename(path))NEWLINE self.show()NEWLINE if os.path.splitext(path)[-1] == ".gz":NEWLINE with gzip.open(path, 'rb') as f:NEWLINE data = f.read()NEWLINE self.textEdit.setText(data.decode("utf-8"))NEWLINE else:NEWLINE with open(path, 'r') as f:NEWLINE data = f.read()NEWLINE self.textEdit.setText(data)NEWLINENEWLINEclass ResultsDialog_old(QtWidgets.QMainWindow):NEWLINENEWLINE def __init__(self, path):NEWLINE super().__init__()NEWLINE NEWLINE self.initUI()NEWLINENEWLINENEWLINE def initUI(self): NEWLINENEWLINE self.textEdit = QtWidgets.QTextEdit()NEWLINE self.setCentralWidget(self.textEdit)NEWLINE self.statusBar()NEWLINENEWLINE self.showDialog()NEWLINE self.setGeometry(300, 300, 350, 300)NEWLINE self.setWindowTitle("filtered vcf")NEWLINE self.show()NEWLINE def showDialog(self):NEWLINE with gzip.open(path, 'rb') as f:NEWLINE data = f.read()NEWLINE self.textEdit.setText(data.decode("utf-8"))NEWLINENEWLINE NEWLINENEWLINENEWLINENEWLINENEWLINEdef main():NEWLINE NEWLINE app = QtWidgets.QApplication(sys.argv)NEWLINE MainWindow = QtWidgets.QMainWindow()NEWLINE ui = Ui_MainWindow()NEWLINE ui.setupUi(MainWindow)NEWLINE MainWindow.show()NEWLINE sys.exit(app.exec_())NEWLINENEWLINEmain() |
import rlpNEWLINENEWLINEfrom bxutils.logging.log_level import LogLevelNEWLINENEWLINEfrom bxgateway.messages.eth.protocol.eth_protocol_message import EthProtocolMessageNEWLINEfrom bxgateway.messages.eth.protocol.eth_protocol_message_type import EthProtocolMessageTypeNEWLINEfrom bxgateway.messages.eth.serializers.block_header import BlockHeaderNEWLINEfrom bxgateway.utils.eth import rlp_utilsNEWLINENEWLINENEWLINEclass BlockHeadersEthProtocolMessage(EthProtocolMessage):NEWLINE msg_type = EthProtocolMessageType.BLOCK_HEADERSNEWLINENEWLINE fields = [("block_headers", rlp.sedes.CountableList(BlockHeader))]NEWLINENEWLINE def __repr__(self):NEWLINE headers = self.get_block_headers()NEWLINE headers_repr = list(headers[:1])NEWLINE if len(headers) > 1:NEWLINE headers_repr.append(headers[-1])NEWLINE return f"BlockHeadersEthProtocolMessage<headers_count: {len(headers)} " \NEWLINE f"headers: [{'...'.join([h.hash().hex() for h in headers_repr])}]>"NEWLINENEWLINE def get_block_headers(self):NEWLINE return self.get_field_value("block_headers")NEWLINENEWLINE def get_block_headers_bytes(self):NEWLINE if self._memory_view is None:NEWLINE self.serialize()NEWLINENEWLINE return rlp_utils.get_first_list_field_items_bytes(self._memory_view)NEWLINENEWLINE @classmethodNEWLINE def from_header_bytes(cls, header_bytes: memoryview) -> "BlockHeadersEthProtocolMessage":NEWLINE headers_list_prefix = rlp_utils.get_length_prefix_list(len(header_bytes))NEWLINENEWLINE msg_bytes = bytearray(len(headers_list_prefix) + len(header_bytes))NEWLINE msg_bytes[:len(headers_list_prefix)] = headers_list_prefixNEWLINE msg_bytes[len(headers_list_prefix):] = header_bytesNEWLINENEWLINE return cls(msg_bytes)NEWLINENEWLINE def log_level(self):NEWLINE return LogLevel.DEBUGNEWLINE |
from panda3d.core import DepthOffsetAttrib, NodePath, Vec3, Vec4, TextNodeNEWLINEfrom direct.directnotify import DirectNotifyGlobalNEWLINEfrom direct.fsm.FSM import FSMNEWLINEfrom direct.interval.FunctionInterval import WaitNEWLINEfrom direct.interval.IntervalGlobal import Func, LerpHprInterval, LerpScaleInterval, LerpFunctionIntervalNEWLINEfrom direct.interval.MetaInterval import Sequence, ParallelNEWLINEfrom direct.distributed.ClockDelta import globalClockDeltaNEWLINEfrom toontown.toonbase import ToontownGlobalsNEWLINEfrom toontown.effects import DustCloudNEWLINEimport CogdoFlyingGameGlobals as Globals, CogdoUtilNEWLINEfrom CogdoFlyingObjects import CogdoFlyingGatherableNEWLINEfrom CogdoFlyingUtil import swapAvatarShadowPlacerNEWLINENEWLINEclass CogdoFlyingPlayer(FSM):NEWLINE notify = DirectNotifyGlobal.directNotify.newCategory('CogdoFlyingPlayer')NEWLINENEWLINE def __init__(self, toon):NEWLINE FSM.__init__(self, 'CogdoFlyingPlayer')NEWLINE self.toon = toonNEWLINE self.toon.reparentTo(render)NEWLINE self.legalEaglesTargeting = []NEWLINE self.activeBuffs = []NEWLINE self.initModels()NEWLINE self.initIntervals()NEWLINE self.netTimeSentToStartDeath = 0NEWLINE self.backpackState = -1NEWLINE self.lastBackpackState = -1NEWLINE self.lastPropellerSpinRate = Globals.Gameplay.NormalPropSpeedNEWLINE self.propellerSpinRate = Globals.Gameplay.NormalPropSpeedNEWLINE self.setFuelState(Globals.Gameplay.FuelStates.FuelNoPropeller)NEWLINE self.setOldFuelState(self.fuelState)NEWLINE CogdoFlyingPlayer.setBlades(self, Globals.Gameplay.FuelStates.FuelNoPropeller)NEWLINE self.setBackpackState(Globals.Gameplay.BackpackStates.Normal)NEWLINENEWLINE def initModels(self):NEWLINE self.createPropeller()NEWLINE self.createRedTapeRing()NEWLINENEWLINE def createPropeller(self):NEWLINE self.propellerSmoke = DustCloud.DustCloud(self.toon, wantSound=False)NEWLINE self.propellerSmoke.setBillboardPointEye()NEWLINE self.propellerSmoke.setBin('fixed', 5002)NEWLINE self.backpack = CogdoUtil.loadFlyingModel('propellerPack')NEWLINE self.backpack.setScale(1.3)NEWLINE self.backpack.setHpr(180.0, 0.0, 0.0)NEWLINE self.backpackInstances = []NEWLINE self.backpackTextureCard = CogdoUtil.loadFlyingModel('propellerPack_card')NEWLINE parts = self.toon.getTorsoParts()NEWLINE for part in parts:NEWLINE backpackInstance = part.attachNewNode('backpackInstance')NEWLINE animal = self.toon.style.getAnimal()NEWLINE bodyScale = ToontownGlobals.toonBodyScales[animal]NEWLINE backpackHeight = ToontownGlobals.torsoHeightDict[self.toon.style.torso] * bodyScale - 0.5NEWLINE backpackInstance.setPos(0.0, -0.325, backpackHeight)NEWLINE self.backpackInstances.append(backpackInstance)NEWLINE self.backpack.instanceTo(backpackInstance)NEWLINENEWLINE self.propInstances = []NEWLINE self.propeller = CogdoUtil.loadFlyingModel('toonPropeller')NEWLINE for part in self.backpackInstances:NEWLINE propInstance = part.attachNewNode('propInstance')NEWLINE propInstance.setPos(0.0, -0.275, 0.0)NEWLINE propInstance.setHpr(0.0, 20.0, 0.0)NEWLINE propInstance.setScale(1.0, 1.0, 1.25)NEWLINE self.propInstances.append(propInstance)NEWLINE self.propeller.instanceTo(propInstance)NEWLINENEWLINE self.blades = []NEWLINE self.activeBlades = []NEWLINE index = 1NEWLINE blade = self.propeller.find('**/propeller%d' % index)NEWLINE while not blade.isEmpty():NEWLINE self.blades.append(blade)NEWLINE index += 1NEWLINE blade = self.propeller.find('**/propeller%d' % index)NEWLINENEWLINE for blade in self.blades:NEWLINE self.activeBlades.append(blade)NEWLINENEWLINE def createRedTapeRing(self):NEWLINE self.redTapeRing = CogdoUtil.loadFlyingModel('redTapeRing')NEWLINE self.redTapeRing.setTwoSided(True)NEWLINE self.redTapeRing.reparentTo(self.toon)NEWLINE self.redTapeRing.hide()NEWLINE self.redTapeRing.setScale(1.25)NEWLINE self.redTapeRing.setZ(self.toon.getHeight() / 2.0)NEWLINENEWLINE def initIntervals(self):NEWLINE self.baseSpinDuration = 1.0NEWLINE self.propellerSpinLerp = LerpFunctionInterval(self.propeller.setH, fromData=0.0, toData=360.0, duration=self.baseSpinDuration, name='%s.propellerSpinLerp-%s' % (self.__class__.__name__, self.toon.doId))NEWLINE singleBlinkTime = Globals.Gameplay.TargetedWarningSingleBlinkTimeNEWLINE blinkTime = Globals.Gameplay.TargetedWarningBlinkTimeNEWLINE self.blinkLoop = Sequence(Wait(singleBlinkTime / 2.0), Func(self.setBackpackTexture, Globals.Gameplay.BackpackStates.Attacked), Wait(singleBlinkTime / 2.0), Func(self.setBackpackTexture, Globals.Gameplay.BackpackStates.Targeted), name='%s.blinkLoop-%s' % (self.__class__.__name__, self.toon.doId))NEWLINE self.blinkWarningSeq = Sequence(Func(self.blinkLoop.loop), Wait(blinkTime), Func(self.blinkLoop.clearToInitial), name='%s.blinkWarningSeq-%s' % (self.__class__.__name__, self.toon.doId))NEWLINE dur = Globals.Gameplay.BackpackRefuelDurationNEWLINE self.refuelSeq = Sequence(Func(self.setPropellerSpinRate, Globals.Gameplay.RefuelPropSpeed), Wait(dur), Func(self.returnBackpackToLastStateFunc), name='%s.refuelSeq-%s' % (self.__class__.__name__, self.toon.doId))NEWLINE scale = self.redTapeRing.getScale()NEWLINE pulseTime = 1.0NEWLINE self.pulseBubbleSeq = Parallel(Sequence(LerpFunctionInterval(self.redTapeRing.setScale, fromData=scale, toData=scale * 1.1, duration=pulseTime / 2.0, blendType='easeInOut'), LerpFunctionInterval(self.redTapeRing.setScale, fromData=scale * 1.1, toData=scale, duration=pulseTime / 2.0, blendType='easeInOut')), LerpHprInterval(self.redTapeRing, pulseTime, Vec3(360, 0, 0), startHpr=Vec3(0, 0, 0)), name='%s.pulseBubbleSeq-%s' % (self.__class__.__name__, self.toon.doId))NEWLINE bouncePercent = 1.2NEWLINE scaleTime = 0.5NEWLINE scaleBounceTime = 0.25NEWLINE self.popUpBubbleLerp = LerpScaleInterval(self.redTapeRing, scaleTime, scale * bouncePercent, startScale=0.0, blendType='easeInOut')NEWLINE self.popUpBubbleSeq = Sequence(Func(self.updateLerpStartScale, self.popUpBubbleLerp, self.redTapeRing), Func(self.redTapeRing.show), self.popUpBubbleLerp, LerpScaleInterval(self.redTapeRing, scaleBounceTime, scale, startScale=scale * bouncePercent, blendType='easeInOut'), Func(self.pulseBubbleSeq.loop), name='%s.popUpBubbleSeq-%s' % (self.__class__.__name__, self.toon.doId))NEWLINE self.removeBubbleLerp = LerpScaleInterval(self.redTapeRing, scaleBounceTime, scale * bouncePercent, startScale=scale, blendType='easeInOut')NEWLINE self.removeBubbleSeq = Sequence(Func(self.pulseBubbleSeq.clearToInitial), Func(self.updateLerpStartScale, self.removeBubbleLerp, self.redTapeRing), self.removeBubbleLerp, LerpScaleInterval(self.redTapeRing, scaleTime, 0.0, startScale=scale * bouncePercent, blendType='easeInOut'), Func(self.redTapeRing.hide), name='%s.removeBubbleSeq-%s' % (self.__class__.__name__, self.toon.doId))NEWLINE self.redTapeRing.setScale(0.0)NEWLINE self.deathInterval = Sequence(Parallel(LerpHprInterval(self.toon, 1.0, Vec3(720, 0, 0)), LerpFunctionInterval(self.toon.setScale, fromData=1.0, toData=0.1, duration=1.0)), Func(self.toon.stash), name='%s.deathInterval-%s' % (self.__class__.__name__, self.toon.doId))NEWLINE self.spawnInterval = Sequence(Func(self.toon.stash), Func(self.resetToon), Wait(1.0), Func(self.toon.setAnimState, 'TeleportIn'), Func(self.toon.unstash), name='%s.spawnInterval-%s' % (self.__class__.__name__, self.toon.doId))NEWLINE singleBlinkTime = Globals.Gameplay.InvulSingleBlinkTimeNEWLINE blinkTime = Globals.Gameplay.InvulBlinkTimeNEWLINE invulBuffTime = Globals.Gameplay.InvulBuffTimeNEWLINE self.blinkBubbleLoop = Sequence(LerpFunctionInterval(self.redTapeRing.setAlphaScale, fromData=1.0, toData=0.0, duration=singleBlinkTime / 2.0, blendType='easeInOut'), LerpFunctionInterval(self.redTapeRing.setAlphaScale, fromData=0.0, toData=1.0, duration=singleBlinkTime / 2.0, blendType='easeInOut'), name='%s.blinkBubbleLoop-%s' % (self.__class__.__name__, self.toon.doId))NEWLINE self.blinkBubbleSeq = Sequence(Wait(invulBuffTime - blinkTime), Func(self.blinkBubbleLoop.loop), Wait(blinkTime), Func(self.blinkBubbleLoop.finish), name='%s.blinkBubbleSeq-%s' % (self.__class__.__name__, self.toon.doId))NEWLINENEWLINE def returnBackpackToLastStateFunc(self):NEWLINE if self.backpackState == Globals.Gameplay.BackpackStates.Refuel:NEWLINE self.returnBackpackToLastState()NEWLINENEWLINE def setPropellerSpinRateFunc(self):NEWLINE if self.propellerSpinRate == Globals.Gameplay.RefuelPropSpeed:NEWLINE self.setPropellerSpinRate(self.lastPropellerSpinRate)NEWLINENEWLINE def returnBackpackToLastState(self):NEWLINE self.setBackpackState(self.lastBackpackState)NEWLINENEWLINE def setBackpackState(self, state):NEWLINE if state == self.backpackState:NEWLINE returnNEWLINE self.lastBackpackState = self.backpackStateNEWLINE self.backpackState = stateNEWLINE self.blinkWarningSeq.clearToInitial()NEWLINE self.refuelSeq.clearToInitial()NEWLINE self.blinkLoop.clearToInitial()NEWLINE if self.lastBackpackState == Globals.Gameplay.BackpackStates.Refuel:NEWLINE self.setPropellerSpinRateFunc()NEWLINE if state in Globals.Gameplay.BackpackStates:NEWLINE if state == Globals.Gameplay.BackpackStates.Normal:NEWLINE passNEWLINE else:NEWLINE if state == Globals.Gameplay.BackpackStates.Targeted:NEWLINE passNEWLINE else:NEWLINE if state == Globals.Gameplay.BackpackStates.Refuel:NEWLINE self.refuelSeq.start()NEWLINE else:NEWLINE if state == Globals.Gameplay.BackpackStates.Attacked:NEWLINE self.blinkWarningSeq.start()NEWLINE self.setBackpackTexture(state)NEWLINENEWLINE def setBackpackTexture(self, state):NEWLINE texName = Globals.Gameplay.BackpackState2TextureName[state]NEWLINE tex = self.backpackTextureCard.findTexture(texName)NEWLINE self.backpack.setTexture(tex, 1)NEWLINENEWLINE def updateLerpStartScale(self, lerp, nodepath):NEWLINE lerp.setStartScale(nodepath.getScale())NEWLINENEWLINE def handleEnterGatherable(self, gatherable, elapsedTime):NEWLINE if gatherable.type == Globals.Level.GatherableTypes.InvulPowerup:NEWLINE self.blinkBubbleSeq.clearToInitial()NEWLINE self.blinkBubbleSeq.start(elapsedTime)NEWLINE self.removeBubbleSeq.clearToInitial()NEWLINE self.popUpBubbleSeq.start()NEWLINE if gatherable.type not in self.activeBuffs:NEWLINE self.activeBuffs.append(gatherable.type)NEWLINE else:NEWLINE if gatherable.type == Globals.Level.GatherableTypes.Propeller:NEWLINE self.setBackpackState(Globals.Gameplay.BackpackStates.Refuel)NEWLINENEWLINE def handleDebuffPowerup(self, pickupType, elapsedTime):NEWLINE if pickupType == Globals.Level.GatherableTypes.InvulPowerup:NEWLINE self.blinkBubbleSeq.finish()NEWLINE self.popUpBubbleSeq.clearToInitial()NEWLINE self.removeBubbleSeq.start()NEWLINE if pickupType in self.activeBuffs:NEWLINE self.activeBuffs.remove(pickupType)NEWLINENEWLINE def isBuffActive(self, pickupType):NEWLINE if pickupType in self.activeBuffs:NEWLINE return TrueNEWLINE return FalseNEWLINENEWLINE def isInvulnerable(self):NEWLINE if Globals.Level.GatherableTypes.InvulPowerup in self.activeBuffs:NEWLINE return TrueNEWLINE return FalseNEWLINENEWLINE def setFuelState(self, fuelState):NEWLINE self.fuelState = fuelStateNEWLINENEWLINE def setOldFuelState(self, fuelState):NEWLINE self.oldFuelState = fuelStateNEWLINENEWLINE def hasFuelStateChanged(self):NEWLINE if self.fuelState != self.oldFuelState:NEWLINE return TrueNEWLINE return FalseNEWLINENEWLINE def updatePropellerSmoke(self):NEWLINE if not self.hasFuelStateChanged():NEWLINE returnNEWLINE if self.fuelState in [Globals.Gameplay.FuelStates.FuelNoPropeller, Globals.Gameplay.FuelStates.FuelNormal]:NEWLINE self.propellerSmoke.stop()NEWLINE else:NEWLINE if self.fuelState in [Globals.Gameplay.FuelStates.FuelVeryLow, Globals.Gameplay.FuelStates.FuelEmpty]:NEWLINE self.propellerSmoke.stop()NEWLINE self.propellerSmoke.setScale(0.25)NEWLINE self.propellerSmoke.setZ(self.toon.getHeight() + 2.5)NEWLINE self.propellerSmoke.loop(rate=48)NEWLINE else:NEWLINE if self.fuelState in [Globals.Gameplay.FuelStates.FuelLow]:NEWLINE self.propellerSmoke.stop()NEWLINE self.propellerSmoke.setScale(0.0825)NEWLINE self.propellerSmoke.setZ(self.toon.getHeight() + 2.0)NEWLINE self.propellerSmoke.loop(rate=24)NEWLINENEWLINE def resetBlades(self):NEWLINE self.setBlades(len(self.blades))NEWLINENEWLINE def setAsLegalEagleTarget(self, legalEagle):NEWLINE if legalEagle not in self.legalEaglesTargeting:NEWLINE self.legalEaglesTargeting.append(legalEagle)NEWLINENEWLINE def removeAsLegalEagleTarget(self, legalEagle):NEWLINE if legalEagle in self.legalEaglesTargeting:NEWLINE self.legalEaglesTargeting.remove(legalEagle)NEWLINENEWLINE def isLegalEagleTarget(self):NEWLINE if len(self.legalEaglesTargeting) > 0:NEWLINE return TrueNEWLINE return FalseNEWLINENEWLINE def setBlades(self, fuelState):NEWLINE if fuelState not in Globals.Gameplay.FuelStates:NEWLINE returnNEWLINE numBlades = fuelState - 1NEWLINE if len(self.activeBlades) != numBlades:NEWLINE for i in xrange(len(self.activeBlades)):NEWLINE blade = self.activeBlades.pop()NEWLINE blade.stash()NEWLINENEWLINE if numBlades > len(self.blades):NEWLINE numBlades = len(self.blades)NEWLINE if numBlades > 0:NEWLINE for i in xrange(numBlades):NEWLINE blade = self.blades[i]NEWLINE self.activeBlades.append(blade)NEWLINE blade.unstash()NEWLINENEWLINE if fuelState == Globals.Gameplay.FuelStates.FuelNoPropeller:NEWLINE for prop in self.propInstances:NEWLINE prop.hide()NEWLINENEWLINE else:NEWLINE for prop in self.propInstances:NEWLINE prop.show()NEWLINENEWLINE self.setFuelState(fuelState)NEWLINE self.updatePropellerSmoke()NEWLINE self.setOldFuelState(self.fuelState)NEWLINENEWLINE def bladeLost(self):NEWLINE if len(self.activeBlades) > 0:NEWLINE blade = self.activeBlades.pop()NEWLINE blade.stash()NEWLINE self.setFuelState(len(self.activeBlades) + 1)NEWLINE self.updatePropellerSmoke()NEWLINE self.setOldFuelState(self.fuelState)NEWLINENEWLINE def setPropellerSpinRate(self, newRate):NEWLINE self.lastPropellerSpinRate = self.propellerSpinRateNEWLINE self.propellerSpinRate = newRateNEWLINE self.notify.debug('(%s) New propeller speed:%s, old propeller speed:%s' % (self.toon.doId, self.propellerSpinRate, self.lastPropellerSpinRate))NEWLINE self.propellerSpinLerp.setPlayRate(newRate)NEWLINENEWLINE def died(self, elapsedTime):NEWLINE self.deathInterval.start(elapsedTime)NEWLINE self.propellerSmoke.stop()NEWLINENEWLINE def spawn(self, elapsedTime):NEWLINE self.spawnInterval.start(elapsedTime)NEWLINENEWLINE def resetToon(self):NEWLINE self.toon.setScale(1.0)NEWLINENEWLINE def enable(self):NEWLINE self.toon.setAnimState('Happy', 1.0)NEWLINE self.toon.setForceJumpIdle(True)NEWLINE self.toon.setSpeed(0, 0)NEWLINE self.setPropellerSpinRate(Globals.Gameplay.NormalPropSpeed)NEWLINE self.propellerSpinLerp.loop()NEWLINENEWLINE def disable(self):NEWLINE passNEWLINENEWLINE def unload(self):NEWLINE self.ignoreAll()NEWLINE if self.toon:NEWLINE self.toon.showName()NEWLINE self.backpackTextureCard.removeNode()NEWLINE del self.backpackTextureCardNEWLINE self.refuelSeq.clearToInitial()NEWLINE del self.refuelSeqNEWLINE self.pulseBubbleSeq.clearToInitial()NEWLINE del self.pulseBubbleSeqNEWLINE self.blinkBubbleLoop.clearToInitial()NEWLINE del self.blinkBubbleLoopNEWLINE self.blinkBubbleSeq.clearToInitial()NEWLINE del self.blinkBubbleSeqNEWLINE self.popUpBubbleLerp.clearToInitial()NEWLINE del self.popUpBubbleLerpNEWLINE self.popUpBubbleSeq.clearToInitial()NEWLINE del self.popUpBubbleSeqNEWLINE self.removeBubbleLerp.clearToInitial()NEWLINE del self.removeBubbleLerpNEWLINE self.removeBubbleSeq.clearToInitial()NEWLINE del self.removeBubbleSeqNEWLINE self.propellerSmoke.destroy()NEWLINE del self.propellerSmokeNEWLINE self.blinkWarningSeq.clearToInitial()NEWLINE del self.blinkWarningSeqNEWLINE self.blinkLoop.clearToInitial()NEWLINE del self.blinkLoopNEWLINE self.redTapeRing.removeNode()NEWLINE del self.redTapeRingNEWLINE self.propellerSpinLerp.clearToInitial()NEWLINE del self.propellerSpinLerpNEWLINE for prop in self.propInstances:NEWLINE prop.removeNode()NEWLINENEWLINE del self.propInstances[:]NEWLINE self.propeller.removeNode()NEWLINE del self.propellerNEWLINE for backpack in self.backpackInstances:NEWLINE backpack.removeNode()NEWLINENEWLINE del self.backpackInstances[:]NEWLINE self.backpack.removeNode()NEWLINE del self.backpackNEWLINE del self.activeBuffs[:]NEWLINE del self.legalEaglesTargeting[:]NEWLINE del self.toonNEWLINE self.toon = NoneNEWLINE if self.deathInterval:NEWLINE self.deathInterval.clearToInitial()NEWLINE self.deathInterval = NoneNEWLINE if self.spawnInterval:NEWLINE self.spawnInterval.clearToInitial()NEWLINE self.spawnInterval = NoneNEWLINE returnNEWLINENEWLINE def start(self):NEWLINE swapAvatarShadowPlacer(self.toon, self.toon.uniqueName('toonShadowPlacer'))NEWLINE self.toon.startSmooth()NEWLINENEWLINE def exit(self):NEWLINE self.toon.setForceJumpIdle(False)NEWLINE self.propellerSmoke.reparentTo(hidden)NEWLINE self.propellerSmoke.stop()NEWLINE if self.toon:NEWLINE CogdoFlyingPlayer.resetToon(self)NEWLINE self.toon.setActiveShadow(0)NEWLINE self.toon.deleteDropShadow()NEWLINE self.toon.initializeDropShadow()NEWLINE self.toon.setActiveShadow(1)NEWLINE else:NEWLINE self.notify.warning("There's no toon in offstage, this is bad!") |
"""JSON Web Encryption utilities."""NEWLINENEWLINEimport binasciiNEWLINEimport jsonNEWLINENEWLINEfrom collections import OrderedDictNEWLINEfrom typing import Any, Dict, Iterable, List, Mapping, Optional, UnionNEWLINENEWLINEfrom marshmallow import fields, Schema, ValidationErrorNEWLINENEWLINEfrom ..wallet.util import b64_to_bytes, bytes_to_b64NEWLINENEWLINEIDENT_ENC_KEY = "encrypted_key"NEWLINEIDENT_HEADER = "header"NEWLINEIDENT_PROTECTED = "protected"NEWLINEIDENT_RECIPIENTS = "recipients"NEWLINENEWLINENEWLINEdef b64url(value: Union[bytes, str]) -> str:NEWLINE """Encode a string or bytes value as unpadded base64-URL."""NEWLINE if isinstance(value, str):NEWLINE value = value.encode("utf-8")NEWLINE return bytes_to_b64(value, urlsafe=True, pad=False)NEWLINENEWLINENEWLINEdef from_b64url(value: str) -> bytes:NEWLINE """Decode an unpadded base64-URL value."""NEWLINE try:NEWLINE return b64_to_bytes(value, urlsafe=True)NEWLINE except binascii.Error:NEWLINE raise ValidationError("Error decoding base64 value")NEWLINENEWLINENEWLINEclass B64Value(fields.Str):NEWLINE """A marshmallow-compatible wrapper for base64-URL values."""NEWLINENEWLINE def _serialize(self, value, attr, obj, **kwargs) -> Optional[str]:NEWLINE if value is None:NEWLINE return NoneNEWLINE if not isinstance(value, bytes):NEWLINE return TypeError("Expected bytes")NEWLINE return b64url(value)NEWLINENEWLINE def _deserialize(self, value, attr, data, **kwargs) -> Any:NEWLINE value = super()._deserialize(value, attr, data, **kwargs)NEWLINE return from_b64url(value)NEWLINENEWLINENEWLINEclass JweSchema(Schema):NEWLINE """JWE envelope schema."""NEWLINENEWLINE protected = fields.Str(required=True)NEWLINE unprotected = fields.Dict(required=False)NEWLINE recipients = fields.List(fields.Dict(), required=False)NEWLINE ciphertext = B64Value(required=True)NEWLINE iv = B64Value(required=True)NEWLINE tag = B64Value(required=True)NEWLINE aad = B64Value(required=False)NEWLINE # flattened:NEWLINE header = fields.Dict(required=False)NEWLINE encrypted_key = B64Value(required=False)NEWLINENEWLINENEWLINEclass JweRecipientSchema(Schema):NEWLINE """JWE recipient schema."""NEWLINENEWLINE encrypted_key = B64Value(required=True)NEWLINE header = fields.Dict(many=True, required=False)NEWLINENEWLINENEWLINEclass JweRecipient:NEWLINE """A single message recipient."""NEWLINENEWLINE def __init__(self, *, encrypted_key: bytes, header: dict = None) -> "JweRecipient":NEWLINE """Initialize the JWE recipient."""NEWLINE self.encrypted_key = encrypted_keyNEWLINE self.header = header or {}NEWLINENEWLINE @classmethodNEWLINE def deserialize(cls, entry: Mapping[str, Any]) -> "JweRecipient":NEWLINE """Deserialize a JWE recipient from a mapping."""NEWLINE vals = JweRecipientSchema().load(entry)NEWLINE return cls(**vals)NEWLINENEWLINE def serialize(self) -> dict:NEWLINE """Serialize the JWE recipient to a mapping."""NEWLINE ret = OrderedDict([("encrypted_key", b64url(self.encrypted_key))])NEWLINE if self.header:NEWLINE ret["header"] = self.headerNEWLINE return retNEWLINENEWLINENEWLINEclass JweEnvelope:NEWLINE """JWE envelope instance."""NEWLINENEWLINE def __init__(NEWLINE self,NEWLINE *,NEWLINE protected: dict = None,NEWLINE protected_b64: bytes = None,NEWLINE unprotected: dict = None,NEWLINE ciphertext: bytes = None,NEWLINE iv: bytes = None,NEWLINE tag: bytes = None,NEWLINE aad: bytes = None,NEWLINE with_protected_recipients: bool = False,NEWLINE with_flatten_recipients: bool = True,NEWLINE ):NEWLINE """Initialize a new JWE envelope instance."""NEWLINE self.protected = protectedNEWLINE self.protected_b64 = protected_b64NEWLINE self.unprotected = unprotected or OrderedDict()NEWLINE self.ciphertext = ciphertextNEWLINE self.iv = ivNEWLINE self.tag = tagNEWLINE self.aad = aadNEWLINE self.with_protected_recipients = with_protected_recipientsNEWLINE self.with_flatten_recipients = with_flatten_recipientsNEWLINE self._recipients: List[JweRecipient] = []NEWLINENEWLINE @classmethodNEWLINE def from_json(cls, message: Union[bytes, str]) -> "JweEnvelope":NEWLINE """Decode a JWE envelope from a JSON string or bytes value."""NEWLINE try:NEWLINE return cls._deserialize(JweSchema().loads(message))NEWLINE except json.JSONDecodeError:NEWLINE raise ValidationError("Invalid JWE: not JSON")NEWLINENEWLINE @classmethodNEWLINE def deserialize(cls, message: Mapping[str, Any]) -> "JweEnvelope":NEWLINE """Deserialize a JWE envelope from a mapping."""NEWLINE return cls._deserialize(JweSchema().load(message))NEWLINENEWLINE @classmethodNEWLINE def _deserialize(cls, parsed: Mapping[str, Any]) -> "JweEnvelope":NEWLINE protected_b64 = parsed[IDENT_PROTECTED]NEWLINE try:NEWLINE protected: dict = json.loads(from_b64url(protected_b64))NEWLINE except json.JSONDecodeError:NEWLINE raise ValidationError(NEWLINE "Invalid JWE: invalid JSON for protected headers"NEWLINE ) from NoneNEWLINE unprotected = parsed.get("unprotected") or dict()NEWLINE if protected.keys() & unprotected.keys():NEWLINE raise ValidationError("Invalid JWE: duplicate header")NEWLINENEWLINE encrypted_key = protected.get(IDENT_ENC_KEY) or parsed.get(IDENT_ENC_KEY)NEWLINE recipients = NoneNEWLINE protected_recipients = FalseNEWLINE flat_recipients = FalseNEWLINENEWLINE if IDENT_RECIPIENTS in protected:NEWLINE recipients = protected.pop(IDENT_RECIPIENTS)NEWLINE if IDENT_RECIPIENTS in parsed:NEWLINE raise ValidationError("Invalid JWE: duplicate recipients block")NEWLINE protected_recipients = TrueNEWLINE elif IDENT_RECIPIENTS in parsed:NEWLINE recipients = parsed[IDENT_RECIPIENTS]NEWLINENEWLINE if IDENT_ENC_KEY in protected:NEWLINE encrypted_key = from_b64url(protected.pop(IDENT_ENC_KEY))NEWLINE header = protected.pop(IDENT_HEADER) if IDENT_HEADER in protected else NoneNEWLINE protected_recipients = TrueNEWLINE elif IDENT_ENC_KEY in parsed:NEWLINE encrypted_key = parsed[IDENT_ENC_KEY]NEWLINE header = parsed.get(IDENT_HEADER)NEWLINENEWLINE if recipients:NEWLINE if encrypted_key:NEWLINE raise ValidationError("Invalid JWE: flattened form with 'recipients'")NEWLINE recipients = [JweRecipient.deserialize(recip) for recip in recipients]NEWLINE elif encrypted_key:NEWLINE recipients = [NEWLINE JweRecipient(NEWLINE encrypted_key=encrypted_key,NEWLINE header=header,NEWLINE )NEWLINE ]NEWLINE flat_recipients = TrueNEWLINE else:NEWLINE raise ValidationError("Invalid JWE: no recipients")NEWLINENEWLINE inst = cls(NEWLINE protected=protected,NEWLINE protected_b64=protected_b64,NEWLINE unprotected=unprotected,NEWLINE ciphertext=parsed["ciphertext"],NEWLINE iv=parsed.get("iv"),NEWLINE tag=parsed["tag"],NEWLINE aad=parsed.get("aad"),NEWLINE with_protected_recipients=protected_recipients,NEWLINE with_flatten_recipients=flat_recipients,NEWLINE )NEWLINE all_h = protected.keys() | unprotected.keys()NEWLINE for recip in recipients:NEWLINE if recip.header and recip.header.keys() & all_h:NEWLINE raise ValidationError("Invalid JWE: duplicate header")NEWLINE inst.add_recipient(recip)NEWLINENEWLINE return instNEWLINENEWLINE def serialize(self) -> dict:NEWLINE """Serialize the JWE envelope to a mapping."""NEWLINE if self.protected_b64 is None:NEWLINE raise ValidationError("Missing protected: use set_protected")NEWLINE if self.ciphertext is None:NEWLINE raise ValidationError("Missing ciphertext for JWE")NEWLINE if self.iv is None:NEWLINE raise ValidationError("Missing iv (nonce) for JWE")NEWLINE if self.tag is None:NEWLINE raise ValidationError("Missing tag for JWE")NEWLINE env = OrderedDict()NEWLINE env["protected"] = self.protected_b64NEWLINE if self.unprotected:NEWLINE env["unprotected"] = self.unprotected.copy()NEWLINE if not self.with_protected_recipients:NEWLINE recipients = self.recipients_jsonNEWLINE if self.with_flatten_recipients and len(recipients) == 1:NEWLINE for k in recipients[0]:NEWLINE env[k] = recipients[0][k]NEWLINE elif recipients:NEWLINE env[IDENT_RECIPIENTS] = recipientsNEWLINE else:NEWLINE raise ValidationError("Missing message recipients")NEWLINE env["iv"] = b64url(self.iv)NEWLINE env["ciphertext"] = b64url(self.ciphertext)NEWLINE env["tag"] = b64url(self.tag)NEWLINE if self.aad:NEWLINE env["aad"] = b64url(self.aad)NEWLINE return envNEWLINENEWLINE def to_json(self) -> str:NEWLINE """Serialize the JWE envelope to a JSON string."""NEWLINE return json.dumps(self.serialize())NEWLINENEWLINE def add_recipient(self, recip: JweRecipient):NEWLINE """Add a recipient to the JWE envelope."""NEWLINE self._recipients.append(recip)NEWLINENEWLINE def set_protected(NEWLINE self,NEWLINE protected: Mapping[str, Any],NEWLINE ):NEWLINE """Set the protected headers of the JWE envelope."""NEWLINE protected = OrderedDict(protected.items())NEWLINE if self.with_protected_recipients:NEWLINE recipients = self.recipients_jsonNEWLINE if self.with_flatten_recipients and len(recipients) == 1:NEWLINE protected.update(recipients[0])NEWLINE elif recipients:NEWLINE protected[IDENT_RECIPIENTS] = recipientsNEWLINE else:NEWLINE raise ValidationError("Missing message recipients")NEWLINE self.protected_b64 = b64url(json.dumps(protected))NEWLINENEWLINE @propertyNEWLINE def protected_bytes(self) -> bytes:NEWLINE """Access the protected data encoded as bytes.NEWLINENEWLINE This value is used in the additional authenticated data when encrypting.NEWLINE """NEWLINE return (NEWLINE self.protected_b64.encode("utf-8")NEWLINE if self.protected_b64 is not NoneNEWLINE else NoneNEWLINE )NEWLINENEWLINE def set_payload(self, ciphertext: bytes, iv: bytes, tag: bytes, aad: bytes = None):NEWLINE """Set the payload of the JWE envelope."""NEWLINE self.ciphertext = ciphertextNEWLINE self.iv = ivNEWLINE self.tag = tagNEWLINE self.aad = aadNEWLINENEWLINE @propertyNEWLINE def recipients(self) -> Iterable[JweRecipient]:NEWLINE """Accessor for an iterator over the JWE recipients.NEWLINENEWLINE The headers for each recipient include protected and unprotected headers from theNEWLINE outer envelope.NEWLINE """NEWLINE header = self.protected.copy()NEWLINE header.update(self.unprotected)NEWLINE for recip in self._recipients:NEWLINE if recip.header:NEWLINE recip_h = header.copy()NEWLINE recip_h.update(recip.header)NEWLINE yield JweRecipient(encrypted_key=recip.encrypted_key, header=recip_h)NEWLINE else:NEWLINE yield JweRecipient(encrypted_key=recip.encrypted_key, header=header)NEWLINENEWLINE @propertyNEWLINE def recipients_json(self) -> List[Dict[str, Any]]:NEWLINE """Encode the current recipients for JSON."""NEWLINE return [recip.serialize() for recip in self._recipients]NEWLINENEWLINE @propertyNEWLINE def recipient_key_ids(self) -> Iterable[JweRecipient]:NEWLINE """Accessor for an iterator over the JWE recipient key identifiers."""NEWLINE for recip in self._recipients:NEWLINE if recip.header and "kid" in recip.header:NEWLINE yield recip.header["kid"]NEWLINENEWLINE def get_recipient(self, kid: str) -> JweRecipient:NEWLINE """Find a recipient by key ID."""NEWLINE for recip in self._recipients:NEWLINE if recip.header and recip.header.get("kid") == kid:NEWLINE header = self.protected.copy()NEWLINE header.update(self.unprotected)NEWLINE header.update(recip.header)NEWLINE return JweRecipient(encrypted_key=recip.encrypted_key, header=header)NEWLINENEWLINE @propertyNEWLINE def combined_aad(self) -> bytes:NEWLINE """Accessor for the additional authenticated data."""NEWLINE aad = self.protected_bytesNEWLINE if self.aad:NEWLINE aad += b"." + b64url(self.aad).encode("utf-8")NEWLINE return aadNEWLINE |
#NEWLINE# Copyright 2019 The FATE Authors. All Rights Reserved.NEWLINE#NEWLINE# Licensed under the Apache License, Version 2.0 (the "License");NEWLINE# you may not use this file except in compliance with the License.NEWLINE# You may obtain a copy of the License atNEWLINE#NEWLINE# http://www.apache.org/licenses/LICENSE-2.0NEWLINE#NEWLINE# Unless required by applicable law or agreed to in writing, softwareNEWLINE# distributed under the License is distributed on an "AS IS" BASIS,NEWLINE# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.NEWLINE# See the License for the specific language governing permissions andNEWLINE# limitations under the License.NEWLINE#NEWLINENEWLINEimport argparseNEWLINENEWLINEfrom pipeline.backend.pipeline import PipeLineNEWLINEfrom pipeline.component import DataTransformNEWLINEfrom pipeline.component import HeteroPoissonNEWLINEfrom pipeline.component import IntersectionNEWLINEfrom pipeline.component import ReaderNEWLINEfrom pipeline.interface import DataNEWLINENEWLINEfrom pipeline.utils.tools import load_job_configNEWLINENEWLINENEWLINEdef main(config="../../config.yaml", namespace=""):NEWLINE # obtain configNEWLINE if isinstance(config, str):NEWLINE config = load_job_config(config)NEWLINE parties = config.partiesNEWLINE guest = parties.guest[0]NEWLINE host = parties.host[0]NEWLINE arbiter = parties.arbiter[0]NEWLINENEWLINE guest_train_data = {"name": "dvisits_hetero_guest", "namespace": f"experiment{namespace}"}NEWLINE host_train_data = {"name": "dvisits_hetero_host", "namespace": f"experiment{namespace}"}NEWLINENEWLINE pipeline = PipeLine().set_initiator(role='guest', party_id=guest).set_roles(guest=guest, host=host, arbiter=arbiter)NEWLINENEWLINE reader_0 = Reader(name="reader_0")NEWLINE reader_0.get_party_instance(role='guest', party_id=guest).component_param(table=guest_train_data)NEWLINE reader_0.get_party_instance(role='host', party_id=host).component_param(table=host_train_data)NEWLINENEWLINE data_transform_0 = DataTransform(name="data_transform_0")NEWLINE data_transform_0.get_party_instance(role='guest', party_id=guest).component_param(with_label=True, output_format="dense",NEWLINE label_name="doctorco", label_type="float",)NEWLINE data_transform_0.get_party_instance(role='host', party_id=host).component_param(with_label=False)NEWLINENEWLINE intersection_0 = Intersection(name="intersection_0")NEWLINE hetero_poisson_0 = HeteroPoisson(name="hetero_poisson_0", early_stop="diff", max_iter=5,NEWLINE penalty="None", optimizer="sgd", tol=0.001,NEWLINE batch_size=-1, learning_rate=0.15, decay=0.0,NEWLINE decay_sqrt=False, alpha=0.01,NEWLINE init_param={"init_method": "zeros"},NEWLINE stepwise_param={"score_name": "AIC", "direction": "both",NEWLINE "need_stepwise": True, "max_step": 1, "nvmin": 2NEWLINE })NEWLINE pipeline.add_component(reader_0)NEWLINE pipeline.add_component(data_transform_0, data=Data(data=reader_0.output.data))NEWLINE pipeline.add_component(intersection_0, data=Data(data=data_transform_0.output.data))NEWLINE pipeline.add_component(hetero_poisson_0, data=Data(train_data=intersection_0.output.data))NEWLINENEWLINE pipeline.compile()NEWLINENEWLINE pipeline.fit()NEWLINENEWLINE # print(pipeline.get_component("hetero_poisson_0").get_summary())NEWLINENEWLINENEWLINEif __name__ == "__main__":NEWLINE parser = argparse.ArgumentParser("PIPELINE DEMO")NEWLINE parser.add_argument("-config", type=str,NEWLINE help="config file")NEWLINE args = parser.parse_args()NEWLINE if args.config is not None:NEWLINE main(args.config)NEWLINE else:NEWLINE main() |
# -*- coding: utf-8 -*-NEWLINE#NEWLINE# Copyright (C) 2005-2007 Christopher Lenz <cmlenz@gmx.de>NEWLINE# Copyright (C) 2007-2010 Edgewall SoftwareNEWLINE# All rights reserved.NEWLINE#NEWLINE# This software is licensed as described in the file COPYING, whichNEWLINE# you should have received as part of this distribution. The termsNEWLINE# are also available at http://bitten.edgewall.org/wiki/License.NEWLINENEWLINE"""Implementation of the Bitten web interface."""NEWLINENEWLINEimport posixpathNEWLINEimport reNEWLINEimport timeNEWLINEfrom StringIO import StringIONEWLINEfrom datetime import datetimeNEWLINENEWLINEimport pkg_resourcesNEWLINEfrom genshi.builder import tagNEWLINEfrom trac.attachment import AttachmentModule, AttachmentNEWLINEfrom trac.core import *NEWLINEfrom trac.config import OptionNEWLINEfrom trac.mimeview.api import ContextNEWLINEfrom trac.perm import PermissionErrorNEWLINEfrom trac.resource import Resource, get_resource_urlNEWLINEfrom trac.timeline import ITimelineEventProviderNEWLINEfrom trac.util import escape, pretty_timedelta, format_datetime, shorten_line, \NEWLINE Markup, arityNEWLINEfrom trac.util.datefmt import to_timestamp, to_datetime, utcNEWLINEfrom trac.util.html import htmlNEWLINEfrom trac.web import IRequestHandler, IRequestFilter, HTTPNotFoundNEWLINEfrom trac.web.chrome import INavigationContributor, ITemplateProvider, \NEWLINE add_link, add_stylesheet, add_ctxtnav, \NEWLINE prevnext_nav, add_script, add_warningNEWLINEfrom trac.versioncontrol import NoSuchChangeset, NoSuchNodeNEWLINEfrom trac.wiki import wiki_to_html, wiki_to_onelinerNEWLINEfrom bitten.api import ILogFormatter, IReportChartGenerator, IReportSummarizerNEWLINEfrom bitten.master import BuildMasterNEWLINEfrom bitten.model import BuildConfig, TargetPlatform, Build, BuildStep, \NEWLINE BuildLog, ReportNEWLINEfrom bitten.queue import collect_changesNEWLINEfrom bitten.util.repository import get_repos, get_chgset_resource, display_revNEWLINEfrom bitten.util import jsonNEWLINENEWLINE_status_label = {Build.PENDING: 'pending',NEWLINE Build.IN_PROGRESS: 'in progress',NEWLINE Build.SUCCESS: 'completed',NEWLINE Build.FAILURE: 'failed'}NEWLINE_status_title = {Build.PENDING: 'Pending',NEWLINE Build.IN_PROGRESS: 'In Progress',NEWLINE Build.SUCCESS: 'Success',NEWLINE Build.FAILURE: 'Failure'}NEWLINE_step_status_label = {BuildStep.SUCCESS: 'success',NEWLINE BuildStep.FAILURE: 'failed',NEWLINE BuildStep.IN_PROGRESS: 'in progress'}NEWLINENEWLINEdef _get_build_data(env, req, build, repos_name=None):NEWLINE chgset_url = ''NEWLINE if repos_name:NEWLINE chgset_resource = get_chgset_resource(env, repos_name, build.rev)NEWLINE chgset_url = get_resource_url(env, chgset_resource, req.href)NEWLINE platform = TargetPlatform.fetch(env, build.platform)NEWLINE data = {'id': build.id, 'name': build.slave, 'rev': build.rev,NEWLINE 'status': _status_label[build.status],NEWLINE 'platform': getattr(platform, 'name', 'unknown'),NEWLINE 'cls': _status_label[build.status].replace(' ', '-'),NEWLINE 'href': req.href.build(build.config, build.id),NEWLINE 'chgset_href': chgset_url}NEWLINE if build.started:NEWLINE data['started'] = format_datetime(build.started)NEWLINE data['started_delta'] = pretty_timedelta(build.started)NEWLINE data['duration'] = pretty_timedelta(build.started)NEWLINE if build.stopped:NEWLINE data['stopped'] = format_datetime(build.stopped)NEWLINE data['stopped_delta'] = pretty_timedelta(build.stopped)NEWLINE data['duration'] = pretty_timedelta(build.stopped, build.started)NEWLINE data['slave'] = {NEWLINE 'name': build.slave,NEWLINE 'ipnr': build.slave_info.get(Build.IP_ADDRESS),NEWLINE 'os_name': build.slave_info.get(Build.OS_NAME),NEWLINE 'os_family': build.slave_info.get(Build.OS_FAMILY),NEWLINE 'os_version': build.slave_info.get(Build.OS_VERSION),NEWLINE 'machine': build.slave_info.get(Build.MACHINE),NEWLINE 'processor': build.slave_info.get(Build.PROCESSOR)NEWLINE }NEWLINE return dataNEWLINENEWLINEdef _has_permission(perm, repos, path, rev=None, raise_error=False):NEWLINE if hasattr(repos, 'authz'):NEWLINE if not repos.authz.has_permission(path):NEWLINE if not raise_error:NEWLINE return FalseNEWLINE repos.authz.assert_permission(path)NEWLINE else:NEWLINE node = repos.get_node(path, rev)NEWLINE if not node.can_view(perm):NEWLINE if not raise_error:NEWLINE return FalseNEWLINE raise PermissionError('BROWSER_VIEW', node.resource)NEWLINE return TrueNEWLINENEWLINEclass BittenChrome(Component):NEWLINE """Provides the Bitten templates and static resources."""NEWLINENEWLINE implements(INavigationContributor, ITemplateProvider)NEWLINENEWLINE # INavigationContributor methodsNEWLINENEWLINE def get_active_navigation_item(self, req):NEWLINE passNEWLINENEWLINE def get_navigation_items(self, req):NEWLINE """Return the navigation item for access the build status overview fromNEWLINE the Trac navigation bar."""NEWLINE if 'BUILD_VIEW' in req.perm:NEWLINE status = ''NEWLINE if BuildMaster(self.env).quick_status:NEWLINE for config in BuildConfig.select(self.env,NEWLINE include_inactive=False):NEWLINE prev_rev = NoneNEWLINE for platform, rev, build in collect_changes(config, req.authname):NEWLINE if rev != prev_rev:NEWLINE if prev_rev is not None:NEWLINE breakNEWLINE prev_rev = revNEWLINE if build:NEWLINE build_data = _get_build_data(self.env, req, build)NEWLINE if build_data['status'] == 'failed':NEWLINE status='bittenfailed'NEWLINE breakNEWLINE if build_data['status'] == 'in progress':NEWLINE status='bitteninprogress'NEWLINE elif not status:NEWLINE if (build_data['status'] == 'completed'):NEWLINE status='bittencompleted'NEWLINE if not status:NEWLINE status='bittenpending'NEWLINE yield ('mainnav', 'build',NEWLINE tag.a('Build Status', href=req.href.build(), accesskey=5,NEWLINE class_=status))NEWLINENEWLINE # ITemplatesProvider methodsNEWLINENEWLINE def get_htdocs_dirs(self):NEWLINE """Return the directories containing static resources."""NEWLINE return [('bitten', pkg_resources.resource_filename(__name__, 'htdocs'))]NEWLINENEWLINE def get_templates_dirs(self):NEWLINE """Return the directories containing templates."""NEWLINE return [pkg_resources.resource_filename(__name__, 'templates')]NEWLINENEWLINENEWLINEclass BuildConfigController(Component):NEWLINE """Implements the web interface for build configurations."""NEWLINENEWLINE implements(IRequestHandler, IRequestFilter, INavigationContributor)NEWLINENEWLINE # Configuration optionsNEWLINENEWLINE chart_style = Option('bitten', 'chart_style', 'height: 220px; width: 220px;', doc=NEWLINE """Style attribute for charts. Mostly useful for setting the height and width.""")NEWLINENEWLINE # INavigationContributor methodsNEWLINENEWLINE def get_active_navigation_item(self, req):NEWLINE return 'build'NEWLINENEWLINE def get_navigation_items(self, req):NEWLINE return []NEWLINENEWLINE # IRequestHandler methodsNEWLINENEWLINE def match_request(self, req):NEWLINE match = re.match(r'/build(?:/([\w.-]+))?/?$', req.path_info)NEWLINE if match:NEWLINE if match.group(1):NEWLINE req.args['config'] = match.group(1)NEWLINE return TrueNEWLINENEWLINE def process_request(self, req):NEWLINE req.perm.require('BUILD_VIEW')NEWLINENEWLINE action = req.args.get('action')NEWLINE view = req.args.get('view')NEWLINE config = req.args.get('config')NEWLINENEWLINE if config:NEWLINE data = self._render_config(req, config)NEWLINE elif view == 'inprogress':NEWLINE data = self._render_inprogress(req)NEWLINE else:NEWLINE data = self._render_overview(req)NEWLINENEWLINE add_stylesheet(req, 'bitten/bitten.css')NEWLINE return 'bitten_config.html', data, NoneNEWLINENEWLINE # IRequestHandler methodsNEWLINENEWLINE def pre_process_request(self, req, handler):NEWLINE return handlerNEWLINENEWLINE def post_process_request(self, req, template, data, content_type):NEWLINE if template:NEWLINE add_stylesheet(req, 'bitten/bitten.css')NEWLINENEWLINE return template, data, content_typeNEWLINENEWLINE # Internal methodsNEWLINENEWLINE def _render_overview(self, req):NEWLINE data = {'title': 'Build Status'}NEWLINE show_all = FalseNEWLINE if req.args.get('show') == 'all':NEWLINE show_all = TrueNEWLINE data['show_all'] = show_allNEWLINENEWLINE configs = []NEWLINE for config in BuildConfig.select(self.env, include_inactive=show_all):NEWLINE repos_name, repos, repos_path = get_repos(self.env, config.path,NEWLINE req.authname)NEWLINE rev = config.max_rev or repos.youngest_revNEWLINE try:NEWLINE if not _has_permission(req.perm, repos, repos_path, rev=rev):NEWLINE continueNEWLINE except NoSuchNode:NEWLINE add_warning(req, "Configuration '%s' points to non-existing "NEWLINE "path '/%s' at revision '%s'. Configuration skipped." \NEWLINE % (config.name, config.path, rev))NEWLINE continueNEWLINENEWLINE description = config.descriptionNEWLINE if description:NEWLINE description = wiki_to_html(description, self.env, req)NEWLINENEWLINE platforms_data = []NEWLINE for platform in TargetPlatform.select(self.env, config=config.name):NEWLINE pd = { 'name': platform.name,NEWLINE 'id': platform.id,NEWLINE 'builds_pending': len(list(Build.select(self.env,NEWLINE config=config.name, status=Build.PENDING,NEWLINE platform=platform.id))),NEWLINE 'builds_inprogress': len(list(Build.select(self.env,NEWLINE config=config.name, status=Build.IN_PROGRESS,NEWLINE platform=platform.id)))NEWLINE }NEWLINE platforms_data.append(pd)NEWLINENEWLINE config_data = {NEWLINE 'name': config.name, 'label': config.label or config.name,NEWLINE 'active': config.active, 'path': config.path,NEWLINE 'description': description,NEWLINE 'builds_pending' : len(list(Build.select(self.env,NEWLINE config=config.name,NEWLINE status=Build.PENDING))),NEWLINE 'builds_inprogress' : len(list(Build.select(self.env,NEWLINE config=config.name,NEWLINE status=Build.IN_PROGRESS))),NEWLINE 'href': req.href.build(config.name),NEWLINE 'builds': [],NEWLINE 'platforms': platforms_dataNEWLINE }NEWLINE configs.append(config_data)NEWLINE if not config.active:NEWLINE continueNEWLINENEWLINE prev_rev = NoneNEWLINE for platform, rev, build in collect_changes(config, req.authname):NEWLINE if rev != prev_rev:NEWLINE if prev_rev is None:NEWLINE chgset = repos.get_changeset(rev)NEWLINE chgset_resource = get_chgset_resource(self.env, NEWLINE repos_name, rev)NEWLINE config_data['youngest_rev'] = {NEWLINE 'id': rev,NEWLINE 'href': get_resource_url(self.env, chgset_resource,NEWLINE req.href),NEWLINE 'display_rev': display_rev(repos, rev),NEWLINE 'author': chgset.author or 'anonymous',NEWLINE 'date': format_datetime(chgset.date),NEWLINE 'message': wiki_to_oneliner(NEWLINE shorten_line(chgset.message), self.env, req=req)NEWLINE }NEWLINE else:NEWLINE breakNEWLINE prev_rev = revNEWLINE if build:NEWLINE build_data = _get_build_data(self.env, req, build, repos_name)NEWLINE build_data['platform'] = platform.nameNEWLINE config_data['builds'].append(build_data)NEWLINE else:NEWLINE config_data['builds'].append({NEWLINE 'platform': platform.name, 'status': 'pending'NEWLINE })NEWLINENEWLINE data['configs'] = sorted(configs, key=lambda x:x['label'].lower())NEWLINE data['page_mode'] = 'overview'NEWLINENEWLINE in_progress_builds = Build.select(self.env, status=Build.IN_PROGRESS)NEWLINE pending_builds = Build.select(self.env, status=Build.PENDING)NEWLINENEWLINE data['builds_pending'] = len(list(pending_builds))NEWLINE data['builds_inprogress'] = len(list(in_progress_builds))NEWLINENEWLINE add_link(req, 'views', req.href.build(view='inprogress'),NEWLINE 'In Progress Builds')NEWLINE add_ctxtnav(req, 'In Progress Builds',NEWLINE req.href.build(view='inprogress'))NEWLINE return dataNEWLINENEWLINE def _render_inprogress(self, req):NEWLINE data = {'title': 'In Progress Builds',NEWLINE 'page_mode': 'view-inprogress'}NEWLINENEWLINE configs = []NEWLINE for config in BuildConfig.select(self.env, include_inactive=False):NEWLINE repos_name, repos, repos_path = get_repos(self.env, config.path,NEWLINE req.authname)NEWLINE rev = config.max_rev or repos.youngest_revNEWLINE try:NEWLINE if not _has_permission(req.perm, repos, repos_path, rev=rev):NEWLINE continueNEWLINE except NoSuchNode:NEWLINE add_warning(req, "Configuration '%s' points to non-existing "NEWLINE "path '/%s' at revision '%s'. Configuration skipped." \NEWLINE % (config.name, config.path, rev))NEWLINE continueNEWLINENEWLINE self.log.debug(config.name)NEWLINE if not config.active:NEWLINE continueNEWLINENEWLINE in_progress_builds = Build.select(self.env, config=config.name,NEWLINE status=Build.IN_PROGRESS)NEWLINENEWLINE current_builds = 0NEWLINE builds = []NEWLINE # sort correctly by revision.NEWLINE for build in sorted(in_progress_builds,NEWLINE cmp=lambda x, y: int(y.rev_time) - int(x.rev_time)):NEWLINE rev = build.revNEWLINE build_data = _get_build_data(self.env, req, build, repos_name)NEWLINE build_data['rev'] = revNEWLINE build_data['rev_href'] = build_data['chgset_href']NEWLINE platform = TargetPlatform.fetch(self.env, build.platform)NEWLINE build_data['platform'] = platform.nameNEWLINE build_data['steps'] = []NEWLINENEWLINE for step in BuildStep.select(self.env, build=build.id):NEWLINE build_data['steps'].append({NEWLINE 'name': step.name,NEWLINE 'description': step.description,NEWLINE 'duration': to_datetime(step.stopped or int(time.time()), utc) - \NEWLINE to_datetime(step.started, utc),NEWLINE 'status': _step_status_label[step.status],NEWLINE 'cls': _step_status_label[step.status].replace(' ', '-'),NEWLINE 'errors': step.errors,NEWLINE 'href': build_data['href'] + '#step_' + step.nameNEWLINE })NEWLINENEWLINE builds.append(build_data)NEWLINE current_builds += 1NEWLINENEWLINE if current_builds == 0:NEWLINE continueNEWLINENEWLINE description = config.descriptionNEWLINE if description:NEWLINE description = wiki_to_html(description, self.env, req)NEWLINE configs.append({NEWLINE 'name': config.name, 'label': config.label or config.name,NEWLINE 'active': config.active, 'path': config.path,NEWLINE 'description': description,NEWLINE 'href': req.href.build(config.name),NEWLINE 'builds': buildsNEWLINE })NEWLINENEWLINE data['configs'] = sorted(configs, key=lambda x:x['label'].lower())NEWLINE return dataNEWLINENEWLINE def _render_config(self, req, config_name):NEWLINENEWLINE config = BuildConfig.fetch(self.env, config_name)NEWLINE if not config:NEWLINE raise HTTPNotFound("Build configuration '%s' does not exist." \NEWLINE % config_name)NEWLINENEWLINE repos_name, repos, repos_path = get_repos(self.env, config.path,NEWLINE req.authname)NEWLINENEWLINE rev = config.max_rev or repos.youngest_revNEWLINE try:NEWLINE _has_permission(req.perm, repos, repos_path, rev=rev,NEWLINE raise_error=True)NEWLINE except NoSuchNode:NEWLINE raise TracError("Permission checking against repository path %s "NEWLINE "at revision %s failed." % (config.path, rev))NEWLINENEWLINE data = {'title': 'Build Configuration "%s"' \NEWLINE % config.label or config.name,NEWLINE 'page_mode': 'view_config'}NEWLINE add_link(req, 'up', req.href.build(), 'Build Status')NEWLINE description = config.descriptionNEWLINE if description:NEWLINE description = wiki_to_html(description, self.env, req)NEWLINENEWLINE pending_builds = list(Build.select(self.env,NEWLINE config=config.name, status=Build.PENDING))NEWLINE inprogress_builds = list(Build.select(self.env,NEWLINE config=config.name, status=Build.IN_PROGRESS))NEWLINENEWLINE min_chgset_url = ''NEWLINE if config.min_rev:NEWLINE min_chgset_resource = get_chgset_resource(self.env, repos_name,NEWLINE config.min_rev)NEWLINE min_chgset_url = get_resource_url(self.env, min_chgset_resource,NEWLINE req.href),NEWLINE max_chgset_url = ''NEWLINE if config.max_rev:NEWLINE max_chgset_resource = get_chgset_resource(self.env, repos_name,NEWLINE config.max_rev)NEWLINE max_chgset_url = get_resource_url(self.env, max_chgset_resource,NEWLINE req.href),NEWLINENEWLINE data['config'] = {NEWLINE 'name': config.name, 'label': config.label, 'path': config.path,NEWLINE 'min_rev': config.min_rev,NEWLINE 'min_rev_href': min_chgset_url,NEWLINE 'max_rev': config.max_rev,NEWLINE 'max_rev_href': max_chgset_url,NEWLINE 'active': config.active, 'description': description,NEWLINE 'browser_href': req.href.browser(config.path),NEWLINE 'builds_pending' : len(pending_builds),NEWLINE 'builds_inprogress' : len(inprogress_builds)NEWLINE }NEWLINENEWLINE context = Context.from_request(req, config.resource)NEWLINE data['context'] = contextNEWLINE data['config']['attachments'] = AttachmentModule(self.env).attachment_data(context)NEWLINENEWLINE platforms = list(TargetPlatform.select(self.env, config=config_name))NEWLINE data['config']['platforms'] = [NEWLINE { 'name': platform.name,NEWLINE 'id': platform.id,NEWLINE 'builds_pending': len(list(Build.select(self.env,NEWLINE config=config.name,NEWLINE status=Build.PENDING,NEWLINE platform=platform.id))),NEWLINE 'builds_inprogress': len(list(Build.select(self.env,NEWLINE config=config.name,NEWLINE status=Build.IN_PROGRESS,NEWLINE platform=platform.id)))NEWLINE }NEWLINE for platform in platformsNEWLINE ]NEWLINENEWLINE has_reports = FalseNEWLINE for report in Report.select(self.env, config=config.name):NEWLINE has_reports = TrueNEWLINE breakNEWLINENEWLINE if has_reports:NEWLINE chart_generators = []NEWLINE report_categories = list(self._report_categories_for_config(config))NEWLINE for generator in ReportChartController(self.env).generators:NEWLINE for category in generator.get_supported_categories():NEWLINE if category in report_categories:NEWLINE chart_generators.append({NEWLINE 'href': req.href.build(config.name, 'chart/' + category),NEWLINE 'category': category,NEWLINE 'style': self.config.get('bitten', 'chart_style'),NEWLINE })NEWLINE data['config']['charts'] = chart_generatorsNEWLINENEWLINE page = max(1, int(req.args.get('page', 1)))NEWLINE more = FalseNEWLINE data['page_number'] = pageNEWLINENEWLINE builds_per_page = 12 * len(platforms)NEWLINE idx = 0NEWLINE builds = {}NEWLINE revisions = []NEWLINE build_order = []NEWLINE for platform, rev, build in collect_changes(config,authname=req.authname):NEWLINE if idx >= page * builds_per_page:NEWLINE more = TrueNEWLINE breakNEWLINE elif idx >= (page - 1) * builds_per_page:NEWLINE if rev not in builds:NEWLINE revisions.append(rev)NEWLINE builds.setdefault(rev, {})NEWLINE chgset_resource = get_chgset_resource(self.env, repos_name, rev)NEWLINE builds[rev].setdefault('href', get_resource_url(self.env,NEWLINE chgset_resource, req.href))NEWLINE build_order.append((rev, repos.get_changeset(rev).date))NEWLINE builds[rev].setdefault('display_rev', display_rev(repos, rev))NEWLINE if build and build.status != Build.PENDING:NEWLINE build_data = _get_build_data(self.env, req, build)NEWLINE build_data['steps'] = []NEWLINE for step in BuildStep.select(self.env, build=build.id):NEWLINE build_data['steps'].append({NEWLINE 'name': step.name,NEWLINE 'description': step.description,NEWLINE 'duration': to_datetime(step.stopped or int(time.time()), utc) - \NEWLINE to_datetime(step.started, utc),NEWLINE 'status': _step_status_label[step.status],NEWLINE 'cls': _step_status_label[step.status].replace(' ', '-'),NEWLINENEWLINE 'errors': step.errors,NEWLINE 'href': build_data['href'] + '#step_' + step.nameNEWLINE })NEWLINE builds[rev][platform.id] = build_dataNEWLINE idx += 1NEWLINE data['config']['build_order'] = [r[0] for r in sorted(build_order,NEWLINE key=lambda x: x[1],NEWLINE reverse=True)]NEWLINE data['config']['builds'] = buildsNEWLINE data['config']['revisions'] = revisionsNEWLINENEWLINE if page > 1:NEWLINE if page == 2:NEWLINE prev_href = req.href.build(config.name)NEWLINE else:NEWLINE prev_href = req.href.build(config.name, page=page - 1)NEWLINE add_link(req, 'prev', prev_href, 'Previous Page')NEWLINE if more:NEWLINE next_href = req.href.build(config.name, page=page + 1)NEWLINE add_link(req, 'next', next_href, 'Next Page')NEWLINE if arity(prevnext_nav) == 4: # Trac 0.12 compat, see #450NEWLINE prevnext_nav(req, 'Previous Page', 'Next Page')NEWLINE else:NEWLINE prevnext_nav (req, 'Page')NEWLINE return dataNEWLINENEWLINE def _report_categories_for_config(self, config):NEWLINE """Yields the categories of reports that exist for active buildsNEWLINE of this configuration.NEWLINE """NEWLINENEWLINENEWLINE for (category, ) in self.env.db_query("""SELECT DISTINCT report.category as categoryNEWLINEFROM bitten_build AS buildNEWLINEJOIN bitten_report AS report ON (report.build=build.id)NEWLINEWHERE build.config=%s AND build.rev_time >= %s AND build.rev_time <= %s""",NEWLINE (config.name,NEWLINE config.min_rev_time(self.env),NEWLINE config.max_rev_time(self.env))):NEWLINE yield categoryNEWLINENEWLINENEWLINEclass BuildController(Component):NEWLINE """Renders the build page."""NEWLINE implements(INavigationContributor, IRequestHandler, ITimelineEventProvider)NEWLINENEWLINE log_formatters = ExtensionPoint(ILogFormatter)NEWLINE report_summarizers = ExtensionPoint(IReportSummarizer)NEWLINENEWLINE # INavigationContributor methodsNEWLINENEWLINE def get_active_navigation_item(self, req):NEWLINE return 'build'NEWLINENEWLINE def get_navigation_items(self, req):NEWLINE return []NEWLINENEWLINE # IRequestHandler methodsNEWLINENEWLINE def match_request(self, req):NEWLINE match = re.match(r'/build/([\w.-]+)/(\d+)', req.path_info)NEWLINE if match:NEWLINE if match.group(1):NEWLINE req.args['config'] = match.group(1)NEWLINE if match.group(2):NEWLINE req.args['id'] = match.group(2)NEWLINE return TrueNEWLINENEWLINE def process_request(self, req):NEWLINE req.perm.require('BUILD_VIEW')NEWLINENEWLINE build_id = int(req.args.get('id'))NEWLINE build = Build.fetch(self.env, build_id)NEWLINE if not build:NEWLINE raise HTTPNotFound("Build '%s' does not exist." \NEWLINE % build_id)NEWLINENEWLINE if req.method == 'POST':NEWLINE if req.args.get('action') == 'invalidate':NEWLINE self._do_invalidate(req, build)NEWLINE req.redirect(req.href.build(build.config, build.id))NEWLINENEWLINE add_link(req, 'up', req.href.build(build.config),NEWLINE 'Build Configuration')NEWLINE data = {'title': 'Build %s - %s' % (build_id,NEWLINE _status_title[build.status]),NEWLINE 'page_mode': 'view_build',NEWLINE 'build': {}}NEWLINE config = BuildConfig.fetch(self.env, build.config)NEWLINE data['build']['config'] = {NEWLINE 'name': config.label or config.name,NEWLINE 'href': req.href.build(config.name)NEWLINE }NEWLINENEWLINE context = Context.from_request(req, build.resource)NEWLINE data['context'] = contextNEWLINE data['build']['attachments'] = AttachmentModule(self.env).attachment_data(context)NEWLINENEWLINE formatters = []NEWLINE for formatter in self.log_formatters:NEWLINE formatters.append(formatter.get_formatter(req, build))NEWLINENEWLINE summarizers = {} # keyed by report typeNEWLINE for summarizer in self.report_summarizers:NEWLINE categories = summarizer.get_supported_categories()NEWLINE summarizers.update(dict([(cat, summarizer) for cat in categories]))NEWLINENEWLINE repos_name, repos, repos_path = get_repos(self.env, config.path,NEWLINE req.authname)NEWLINENEWLINE _has_permission(req.perm, repos, repos_path, rev=build.rev, raise_error=True)NEWLINENEWLINE data['build'].update(_get_build_data(self.env, req, build, repos_name))NEWLINE steps = []NEWLINE for step in BuildStep.select(self.env, build=build.id):NEWLINE steps.append({NEWLINE 'name': step.name, 'description': step.description,NEWLINE 'duration': pretty_timedelta(step.started, step.stopped or int(time.time())),NEWLINE 'status': _step_status_label[step.status],NEWLINE 'cls': _step_status_label[step.status].replace(' ', '-'),NEWLINE 'errors': step.errors,NEWLINE 'log': self._render_log(req, build, formatters, step),NEWLINE 'reports': self._render_reports(req, config, build, summarizers,NEWLINE step)NEWLINE })NEWLINE data['build']['steps'] = stepsNEWLINE data['build']['can_delete'] = ('BUILD_DELETE' in req.perm \NEWLINE and build.status != build.PENDING)NEWLINENEWLINE chgset = repos.get_changeset(build.rev)NEWLINE data['build']['chgset_author'] = chgset.authorNEWLINE data['build']['display_rev'] = display_rev(repos, build.rev)NEWLINENEWLINE add_script(req, 'common/js/folding.js')NEWLINE add_script(req, 'bitten/tabset.js')NEWLINE add_script(req, 'bitten/jquery.flot.js')NEWLINE add_stylesheet(req, 'bitten/bitten.css')NEWLINE return 'bitten_build.html', data, NoneNEWLINENEWLINE # ITimelineEventProvider methodsNEWLINENEWLINE def get_timeline_filters(self, req):NEWLINE if 'BUILD_VIEW' in req.perm:NEWLINE yield ('build', 'Builds')NEWLINENEWLINE def get_timeline_events(self, req, start, stop, filters):NEWLINE if 'build' not in filters:NEWLINE returnNEWLINENEWLINE # Attachments (will be rendered by attachment module)NEWLINE for event in AttachmentModule(self.env).get_timeline_events(NEWLINE req, Resource('build'), start, stop):NEWLINE yield eventNEWLINENEWLINE start = to_timestamp(start)NEWLINE stop = to_timestamp(stop)NEWLINENEWLINE add_stylesheet(req, 'bitten/bitten.css')NEWLINENEWLINE with self.env.db_query as db:NEWLINE cursor = db.cursor()NEWLINE cursor.execute("SELECT b.id,b.config,c.label,c.path, b.rev,p.name,"NEWLINE "b.stopped,b.status FROM bitten_build AS b"NEWLINE " INNER JOIN bitten_config AS c ON (c.name=b.config) "NEWLINE " INNER JOIN bitten_platform AS p ON (p.id=b.platform) "NEWLINE "WHERE b.stopped>=%s AND b.stopped<=%s "NEWLINE "AND b.status IN (%s, %s) ORDER BY b.stopped",NEWLINE (start, stop, Build.SUCCESS, Build.FAILURE))NEWLINENEWLINE event_kinds = {Build.SUCCESS: 'successbuild',NEWLINE Build.FAILURE: 'failedbuild'}NEWLINENEWLINE for id_, config, label, path, rev, platform, stopped, status in cursor:NEWLINE config_object = BuildConfig.fetch(self.env, config)NEWLINE repos_name, repos, repos_path = get_repos(self.env,NEWLINE config_object.path,NEWLINE req.authname)NEWLINE if not _has_permission(req.perm, repos, repos_path, rev=rev):NEWLINE continueNEWLINE errors = []NEWLINE if status == Build.FAILURE:NEWLINE for step in BuildStep.select(self.env, build=id_,NEWLINE status=BuildStep.FAILURE):NEWLINE errors += [(step.name, error) for errorNEWLINE in step.errors]NEWLINE yield (event_kinds[status], to_datetime(stopped, utc), None,NEWLINE (id_, config, label, display_rev(repos, rev), platform,NEWLINE status, errors))NEWLINENEWLINE def render_timeline_event(self, context, field, event):NEWLINE id_, config, label, rev, platform, status, errors = event[3]NEWLINENEWLINE if field == 'url':NEWLINE return context.href.build(config, id_)NEWLINENEWLINE elif field == 'title':NEWLINE return tag('Build of ', tag.em('%s [%s]' % (label, rev)),NEWLINE ' on %s %s' % (platform, _status_label[status]))NEWLINENEWLINE elif field == 'description':NEWLINE message = ''NEWLINE if context.req.args.get('format') == 'rss':NEWLINE if errors:NEWLINE buf = StringIO()NEWLINE prev_step = NoneNEWLINE for step, error in errors:NEWLINE if step != prev_step:NEWLINE if prev_step is not None:NEWLINE buf.write('</ul>')NEWLINE buf.write('<p>Step %s failed:</p><ul>' \NEWLINE % escape(step))NEWLINE prev_step = stepNEWLINE buf.write('<li>%s</li>' % escape(error))NEWLINE buf.write('</ul>')NEWLINE message = Markup(buf.getvalue())NEWLINE else:NEWLINE if errors:NEWLINE steps = []NEWLINE for step, error in errors:NEWLINE if step not in steps:NEWLINE steps.append(step)NEWLINE steps = [Markup('<em>%s</em>') % step for step in steps]NEWLINE if len(steps) < 2:NEWLINE message = steps[0]NEWLINE elif len(steps) == 2:NEWLINE message = Markup(' and ').join(steps)NEWLINE elif len(steps) > 2:NEWLINE message = Markup(', ').join(steps[:-1]) + ', and ' + \NEWLINE steps[-1]NEWLINE message = Markup('Step%s %s failed') % (NEWLINE len(steps) != 1 and 's' or '', message)NEWLINE return messageNEWLINENEWLINE # Internal methodsNEWLINENEWLINE def _do_invalidate(self, req, build):NEWLINE self.log.info('Invalidating build %d', build.id)NEWLINENEWLINE with self.env.db_transaction as db:NEWLINE for step in BuildStep.select(self.env, build=build.id):NEWLINE step.delete()NEWLINENEWLINE build.slave = NoneNEWLINE build.started = 0NEWLINE build.stopped = 0NEWLINE build.last_activity = 0NEWLINE build.status = Build.PENDINGNEWLINE build.slave_info = {}NEWLINE build.update()NEWLINENEWLINE Attachment.delete_all(self.env, 'build', build.resource.id)NEWLINENEWLINE #commitNEWLINENEWLINE req.redirect(req.href.build(build.config))NEWLINENEWLINE def _render_log(self, req, build, formatters, step):NEWLINE items = []NEWLINE for log in BuildLog.select(self.env, build=build.id, step=step.name):NEWLINE for level, message in log.messages:NEWLINE for format in formatters:NEWLINE message = format(step, log.generator, level, message)NEWLINE items.append({'level': level, 'message': message})NEWLINE return itemsNEWLINENEWLINE def _render_reports(self, req, config, build, summarizers, step):NEWLINE reports = []NEWLINE for report in Report.select(self.env, build=build.id, step=step.name):NEWLINE summarizer = summarizers.get(report.category)NEWLINE if summarizer:NEWLINE tmpl, data = summarizer.render_summary(req, config, build,NEWLINE step, report.category)NEWLINE reports.append({'category': report.category,NEWLINE 'template': tmpl, 'data': data})NEWLINE else:NEWLINE tmpl = data = NoneNEWLINE return reportsNEWLINENEWLINENEWLINEclass ReportChartController(Component):NEWLINE implements(IRequestHandler)NEWLINENEWLINE generators = ExtensionPoint(IReportChartGenerator)NEWLINENEWLINE # IRequestHandler methodsNEWLINE def match_request(self, req):NEWLINE match = re.match(r'/build/([\w.-]+)/chart/(\w+)', req.path_info)NEWLINE if match:NEWLINE req.args['config'] = match.group(1)NEWLINE req.args['category'] = match.group(2)NEWLINE return TrueNEWLINENEWLINE def process_request(self, req):NEWLINE category = req.args.get('category')NEWLINE config = BuildConfig.fetch(self.env, name=req.args.get('config'))NEWLINENEWLINE for generator in self.generators:NEWLINE if category in generator.get_supported_categories():NEWLINE tmpl, data = generator.generate_chart_data(req, config,NEWLINE category)NEWLINE breakNEWLINE else:NEWLINE raise TracError('Unknown report category "%s"' % category)NEWLINENEWLINE data['dumps'] = json.to_jsonNEWLINENEWLINE return tmpl, data, 'text/plain'NEWLINENEWLINENEWLINEclass SourceFileLinkFormatter(Component):NEWLINE """Detects references to files in the build log and renders them as linksNEWLINE to the repository browser.NEWLINE """NEWLINENEWLINE implements(ILogFormatter)NEWLINENEWLINE _fileref_re = re.compile(r'(?P<prefix>-[A-Za-z])?(?P<path>[\w.-]+(?:[\\/][\w.-]+)+)(?P<line>:\d+)?')NEWLINENEWLINE def get_formatter(self, req, build):NEWLINE """Return the log message formatter function."""NEWLINE config = BuildConfig.fetch(self.env, name=build.config)NEWLINE repos_name, repos, repos_path = get_repos(self.env, config.path,NEWLINE req.authname)NEWLINE href = req.href.browserNEWLINE cache = {}NEWLINENEWLINE def _replace(m):NEWLINE filepath = posixpath.normpath(m.group('path').replace('\\', '/'))NEWLINE if not cache.get(filepath) is True:NEWLINE parts = filepath.split('/')NEWLINE path = ''NEWLINE for part in parts:NEWLINE path = posixpath.join(path, part)NEWLINE if path not in cache:NEWLINE try:NEWLINE full_path = posixpath.join(config.path, path)NEWLINE full_path = posixpath.normpath(full_path)NEWLINE if full_path.startswith(config.path + "/") \NEWLINE or full_path == config.path:NEWLINE repos.get_node(full_path,NEWLINE build.rev)NEWLINE cache[path] = TrueNEWLINE else:NEWLINE cache[path] = FalseNEWLINE except TracError:NEWLINE cache[path] = FalseNEWLINE if cache[path] is False:NEWLINE return m.group(0)NEWLINE link = href(config.path, filepath)NEWLINE if m.group('line'):NEWLINE link += '#L' + m.group('line')[1:]NEWLINE return Markup(tag.a(m.group(0), href=link))NEWLINENEWLINE def _formatter(step, type, level, message):NEWLINE buf = []NEWLINE offset = 0NEWLINE for mo in self._fileref_re.finditer(message):NEWLINE start, end = mo.span()NEWLINE if start > offset:NEWLINE buf.append(message[offset:start])NEWLINE buf.append(_replace(mo))NEWLINE offset = endNEWLINE if offset < len(message):NEWLINE buf.append(message[offset:])NEWLINE return Markup("").join(buf)NEWLINENEWLINE return _formatterNEWLINE |
# Copyright (C) 2021 Intel CorporationNEWLINE#NEWLINE# SPDX-License-Identifier: MITNEWLINENEWLINEimport osNEWLINEimport base64NEWLINEimport uuidNEWLINENEWLINEfrom django.conf import settingsNEWLINEfrom django.core.cache import cacheNEWLINEfrom rest_framework import statusNEWLINEfrom rest_framework.response import ResponseNEWLINENEWLINEfrom cvat.apps.engine.serializers import DataSerializerNEWLINENEWLINEclass TusFile:NEWLINE _tus_cache_timeout = 3600NEWLINE def __init__(self, file_id, upload_dir):NEWLINE self.file_id = file_idNEWLINE self.upload_dir = upload_dirNEWLINE self.file_path = os.path.join(self.upload_dir, self.file_id)NEWLINE self.filename = cache.get("tus-uploads/{}/filename".format(file_id))NEWLINE self.file_size = int(cache.get("tus-uploads/{}/file_size".format(file_id)))NEWLINE self.metadata = cache.get("tus-uploads/{}/metadata".format(file_id))NEWLINE self.offset = cache.get("tus-uploads/{}/offset".format(file_id))NEWLINENEWLINE def init_file(self):NEWLINE os.makedirs(self.upload_dir, exist_ok=True)NEWLINE file_path = os.path.join(self.upload_dir, self.file_id)NEWLINE with open(file_path, 'wb') as file:NEWLINE file.seek(self.file_size - 1)NEWLINE file.write(b'\0')NEWLINENEWLINE def write_chunk(self, chunk):NEWLINE with open(self.file_path, 'r+b') as file:NEWLINE file.seek(chunk.offset)NEWLINE file.write(chunk.content)NEWLINE self.offset = cache.incr("tus-uploads/{}/offset".format(self.file_id), chunk.size)NEWLINENEWLINE def is_complete(self):NEWLINE return self.offset == self.file_sizeNEWLINENEWLINE def rename(self):NEWLINE file_id_path = os.path.join(self.upload_dir, self.file_id)NEWLINE file_path = os.path.join(self.upload_dir, self.filename)NEWLINE file_exists = os.path.lexists(os.path.join(self.upload_dir, self.filename))NEWLINE if file_exists:NEWLINE raise FileExistsError("File {} is already uploaded".format(self.filename))NEWLINE os.rename(file_id_path, file_path)NEWLINENEWLINE def clean(self):NEWLINE cache.delete_many([NEWLINE "tus-uploads/{}/file_size".format(self.file_id),NEWLINE "tus-uploads/{}/filename".format(self.file_id),NEWLINE "tus-uploads/{}/offset".format(self.file_id),NEWLINE "tus-uploads/{}/metadata".format(self.file_id),NEWLINE ])NEWLINENEWLINE @staticmethodNEWLINE def get_tusfile(file_id, upload_dir):NEWLINE file_exists = cache.get("tus-uploads/{}/filename".format(file_id), None) is not NoneNEWLINE if file_exists:NEWLINE return TusFile(file_id, upload_dir)NEWLINE return NoneNEWLINENEWLINE @staticmethodNEWLINE def create_file(metadata, file_size, upload_dir):NEWLINE file_id = str(uuid.uuid4())NEWLINE cache.add("tus-uploads/{}/filename".format(file_id), "{}".format(metadata.get("filename")), TusFile._tus_cache_timeout)NEWLINE cache.add("tus-uploads/{}/file_size".format(file_id), file_size, TusFile._tus_cache_timeout)NEWLINE cache.add("tus-uploads/{}/offset".format(file_id), 0, TusFile._tus_cache_timeout)NEWLINE cache.add("tus-uploads/{}/metadata".format(file_id), metadata, TusFile._tus_cache_timeout)NEWLINENEWLINE tus_file = TusFile(file_id, upload_dir)NEWLINE tus_file.init_file()NEWLINE return tus_fileNEWLINENEWLINEclass TusChunk:NEWLINE def __init__(self, request):NEWLINE self.META = request.METANEWLINE self.offset = int(request.META.get("HTTP_UPLOAD_OFFSET", 0))NEWLINE self.size = int(request.META.get("CONTENT_LENGTH", settings.TUS_DEFAULT_CHUNK_SIZE))NEWLINE self.content = request.bodyNEWLINENEWLINE# This upload mixin is implemented using tusNEWLINE# tus is open protocol for file uploads (see more https://tus.io/)NEWLINEclass UploadMixin(object):NEWLINE _tus_api_version = '1.0.0'NEWLINE _tus_api_version_supported = ['1.0.0']NEWLINE _tus_api_extensions = []NEWLINE _tus_max_file_size = str(settings.TUS_MAX_FILE_SIZE)NEWLINE _base_tus_headers = {NEWLINE 'Tus-Resumable': _tus_api_version,NEWLINE 'Tus-Version': ",".join(_tus_api_version_supported),NEWLINE 'Tus-Extension': ",".join(_tus_api_extensions),NEWLINE 'Tus-Max-Size': _tus_max_file_size,NEWLINE 'Access-Control-Allow-Origin': "*",NEWLINE 'Access-Control-Allow-Methods': "PATCH,HEAD,GET,POST,OPTIONS",NEWLINE 'Access-Control-Expose-Headers': "Tus-Resumable,upload-length,upload-metadata,Location,Upload-Offset",NEWLINE 'Access-Control-Allow-Headers': "Tus-Resumable,upload-length,upload-metadata,Location,Upload-Offset,content-type",NEWLINE 'Cache-Control': 'no-store'NEWLINE }NEWLINE file_id_regex = r'(?P<file_id>\b[0-9a-f]{8}\b-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-\b[0-9a-f]{12}\b)'NEWLINENEWLINE def _tus_response(self, status, data=None, extra_headers=None):NEWLINE response = Response(data, status)NEWLINE for key, value in self._base_tus_headers.items():NEWLINE response.__setitem__(key, value)NEWLINE if extra_headers:NEWLINE for key, value in extra_headers.items():NEWLINE response.__setitem__(key, value)NEWLINE return responseNEWLINENEWLINE def _get_metadata(self, request):NEWLINE metadata = {}NEWLINE if request.META.get("HTTP_UPLOAD_METADATA"):NEWLINE for kv in request.META.get("HTTP_UPLOAD_METADATA").split(","):NEWLINE splited_metadata = kv.split(" ")NEWLINE if len(splited_metadata) == 2:NEWLINE key, value = splited_metadataNEWLINE value = base64.b64decode(value)NEWLINE if isinstance(value, bytes):NEWLINE value = value.decode()NEWLINE metadata[key] = valueNEWLINE else:NEWLINE metadata[splited_metadata[0]] = ""NEWLINE return metadataNEWLINENEWLINE def upload_data(self, request):NEWLINE tus_request = request.headers.get('Upload-Length', None) is not None or request.method == 'OPTIONS'NEWLINE bulk_file_upload = request.headers.get('Upload-Multiple', None) is not NoneNEWLINE start_upload = request.headers.get('Upload-Start', None) is not NoneNEWLINE finish_upload = request.headers.get('Upload-Finish', None) is not NoneNEWLINE one_request_upload = start_upload and finish_uploadNEWLINE if one_request_upload or finish_upload:NEWLINE return self.upload_finished(request)NEWLINE elif start_upload:NEWLINE return Response(status=status.HTTP_202_ACCEPTED)NEWLINE elif tus_request:NEWLINE return self.init_tus_upload(request)NEWLINE elif bulk_file_upload:NEWLINE return self.append(request)NEWLINE else: # backward compatibility case - no upload headers were foundNEWLINE return self.upload_finished(request)NEWLINENEWLINE def init_tus_upload(self, request):NEWLINE if request.method == 'OPTIONS':NEWLINE return self._tus_response(status=status.HTTP_204)NEWLINE else:NEWLINE metadata = self._get_metadata(request)NEWLINE filename = metadata.get('filename', '')NEWLINE if not self.validate_filename(filename):NEWLINE return self._tus_response(status=status.HTTP_400_BAD_REQUEST,NEWLINE data="File name {} is not allowed".format(filename))NEWLINENEWLINENEWLINE message_id = request.META.get("HTTP_MESSAGE_ID")NEWLINE if message_id:NEWLINE metadata["message_id"] = base64.b64decode(message_id)NEWLINENEWLINE file_exists = os.path.lexists(os.path.join(self.get_upload_dir(), filename))NEWLINE if file_exists:NEWLINE return self._tus_response(status=status.HTTP_409_CONFLICT,NEWLINE data="File with same name already exists")NEWLINENEWLINE file_size = int(request.META.get("HTTP_UPLOAD_LENGTH", "0"))NEWLINE if file_size > int(self._tus_max_file_size):NEWLINE return self._tus_response(status=status.HTTP_413_REQUEST_ENTITY_TOO_LARGE,NEWLINE data="File size exceeds max limit of {} bytes".format(self._tus_max_file_size))NEWLINENEWLINE tus_file = TusFile.create_file(metadata, file_size, self.get_upload_dir())NEWLINENEWLINE location = request.build_absolute_uri()NEWLINE if 'HTTP_X_FORWARDED_HOST' not in request.META:NEWLINE location = request.META.get('HTTP_ORIGIN') + request.META.get('PATH_INFO')NEWLINE return self._tus_response(NEWLINE status=status.HTTP_201_CREATED,NEWLINE extra_headers={'Location': '{}{}'.format(location, tus_file.file_id)})NEWLINENEWLINE def append_tus_chunk(self, request, file_id):NEWLINE if request.method == 'HEAD':NEWLINE tus_file = TusFile.get_tusfile(str(file_id), self.get_upload_dir())NEWLINE if tus_file:NEWLINE return self._tus_response(status=status.HTTP_200_OK, extra_headers={NEWLINE 'Upload-Offset': tus_file.offset,NEWLINE 'Upload-Length': tus_file.file_size})NEWLINE return self._tus_response(status=status.HTTP_404_NOT_FOUND)NEWLINE else:NEWLINE tus_file = TusFile.get_tusfile(str(file_id), self.get_upload_dir())NEWLINE chunk = TusChunk(request)NEWLINENEWLINE if chunk.offset != tus_file.offset:NEWLINE return self._tus_response(status=status.HTTP_409_CONFLICT)NEWLINENEWLINE if chunk.offset > tus_file.file_size:NEWLINE return self._tus_response(status=status.HTTP_413_REQUEST_ENTITY_TOO_LARGE)NEWLINENEWLINE tus_file.write_chunk(chunk)NEWLINENEWLINE if tus_file.is_complete():NEWLINE tus_file.rename()NEWLINE tus_file.clean()NEWLINENEWLINE return self._tus_response(status=status.HTTP_204_NO_CONTENT,NEWLINE extra_headers={'Upload-Offset': tus_file.offset})NEWLINENEWLINE def validate_filename(self, filename):NEWLINE upload_dir = self.get_upload_dir()NEWLINE file_path = os.path.join(upload_dir, filename)NEWLINE return os.path.commonprefix((os.path.realpath(file_path), upload_dir)) == upload_dirNEWLINENEWLINE def get_upload_dir(self):NEWLINE return self._object.data.get_upload_dirname()NEWLINENEWLINE def get_request_client_files(self, request):NEWLINE serializer = DataSerializer(self._object, data=request.data)NEWLINE serializer.is_valid(raise_exception=True)NEWLINE data = {k: v for k, v in serializer.validated_data.items()}NEWLINE return data.get('client_files', None)NEWLINENEWLINE def append(self, request):NEWLINE client_files = self.get_request_client_files(request)NEWLINE if client_files:NEWLINE upload_dir = self.get_upload_dir()NEWLINE for client_file in client_files:NEWLINE with open(os.path.join(upload_dir, client_file['file'].name), 'ab+') as destination:NEWLINE destination.write(client_file['file'].read())NEWLINE return Response(status=status.HTTP_200_OK)NEWLINENEWLINE # override this to do stuff after uploadNEWLINE def upload_finished(self, request):NEWLINE raise NotImplementedError('You need to implement upload_finished in UploadMixin')NEWLINE |
# Licensed to Elasticsearch B.V. under one or more contributorNEWLINE# license agreements. See the NOTICE file distributed withNEWLINE# this work for additional information regarding copyrightNEWLINE# ownership. Elasticsearch B.V. licenses this file to you underNEWLINE# the Apache License, Version 2.0 (the "License"); you mayNEWLINE# not use this file except in compliance with the License.NEWLINE# You may obtain a copy of the License atNEWLINE#NEWLINE# http://www.apache.org/licenses/LICENSE-2.0NEWLINE#NEWLINE# Unless required by applicable law or agreed to in writing,NEWLINE# software distributed under the License is distributed on anNEWLINE# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANYNEWLINE# KIND, either express or implied. See the License for theNEWLINE# specific language governing permissions and limitationsNEWLINE# under the License.NEWLINENEWLINE# File called _pytest for PyCharm compatabilityNEWLINENEWLINEimport pytestNEWLINENEWLINEfrom tests.common import TestDataNEWLINENEWLINENEWLINEclass TestDataFrameFilter(TestData):NEWLINE def test_filter_arguments_mutually_exclusive(self, df):NEWLINE with pytest.raises(TypeError):NEWLINE df.filter(items=[], like="!", regex="!")NEWLINE with pytest.raises(TypeError):NEWLINE df.filter(items=[], regex="!")NEWLINE with pytest.raises(TypeError):NEWLINE df.filter(items=[], like="!")NEWLINE with pytest.raises(TypeError):NEWLINE df.filter(like="!", regex="!")NEWLINE with pytest.raises(TypeError):NEWLINE df.filter()NEWLINENEWLINE @pytest.mark.parametrize(NEWLINE "items",NEWLINE [NEWLINE ["DestCountry", "Cancelled", "AvgTicketPrice"],NEWLINE [],NEWLINE ["notfound", "AvgTicketPrice"],NEWLINE ],NEWLINE )NEWLINE def test_filter_columns_items(self, df, items):NEWLINE df.filter(items=items)NEWLINENEWLINE @pytest.mark.parametrize("like", ["Flight", "Nope"])NEWLINE def test_filter_columns_like(self, df, like):NEWLINE df.filter(like=like)NEWLINENEWLINE @pytest.mark.parametrize("regex", ["^Flig", "^Flight.*r$", ".*", "^[^C]"])NEWLINE def test_filter_columns_regex(self, df, regex):NEWLINE df.filter(regex=regex)NEWLINENEWLINE @pytest.mark.parametrize("items", [[], ["20"], [str(x) for x in range(30)]])NEWLINE def test_filter_index_items(self, df, items):NEWLINE df.filter(items=items, axis=0)NEWLINENEWLINE def test_filter_index_like_and_regex(self):NEWLINE ed_flights_small = self.ed_flights_small()NEWLINENEWLINE with pytest.raises(NotImplementedError):NEWLINE ed_flights_small.filter(like="2", axis=0)NEWLINE with pytest.raises(NotImplementedError):NEWLINE ed_flights_small.filter(regex="^2", axis=0)NEWLINENEWLINE def test_filter_index_order(self):NEWLINE # Filtering dataframe should retain order of itemsNEWLINE ed_flights = self.ed_flights()NEWLINENEWLINE items = ["4", "2", "3", "1", "0"]NEWLINENEWLINE assert [NEWLINE i for i in ed_flights.filter(axis="index", items=items).to_pandas().indexNEWLINE ] == itemsNEWLINE |
# Copyright 2017 AT&T Intellectual Property. All other rights reserved.NEWLINE#NEWLINE# Licensed under the Apache License, Version 2.0 (the "License");NEWLINE# you may not use this file except in compliance with the License.NEWLINE# You may obtain a copy of the License atNEWLINE#NEWLINE# http://www.apache.org/licenses/LICENSE-2.0NEWLINE#NEWLINE# Unless required by applicable law or agreed to in writing, softwareNEWLINE# distributed under the License is distributed on an "AS IS" BASIS,NEWLINE# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.NEWLINE# See the License for the specific language governing permissions andNEWLINE# limitations under the License.NEWLINE"""Noop driver for manually executing OOB tasks."""NEWLINENEWLINEimport timeNEWLINEimport loggingNEWLINENEWLINEfrom oslo_config import cfgNEWLINENEWLINEimport drydock_provisioner.error as errorsNEWLINENEWLINEimport drydock_provisioner.objects.fields as hd_fieldsNEWLINENEWLINEimport drydock_provisioner.drivers.oob.driver as oobNEWLINENEWLINENEWLINEclass ManualDriver(oob.OobDriver):NEWLINENEWLINE oob_types_supported = ['manual']NEWLINENEWLINE def __init__(self, **kwargs):NEWLINE super(ManualDriver, self).__init__(**kwargs)NEWLINENEWLINE self.driver_name = "manual_driver"NEWLINE self.driver_key = "manual_driver"NEWLINE self.driver_desc = "Manual (Noop) OOB Driver"NEWLINENEWLINE self.logger = logging.getLogger(cfg.CONF.logging.oobdriver_logger_name)NEWLINENEWLINE def execute_task(self, task_id):NEWLINE task = self.state_manager.get_task(task_id)NEWLINENEWLINE if task is None:NEWLINE self.logger.error("Invalid task %s" % (task_id))NEWLINE raise errors.DriverError("Invalid task %s" % (task_id))NEWLINENEWLINE if task.action not in self.supported_actions:NEWLINE self.logger.error("Driver %s doesn't support task action %s" %NEWLINE (self.driver_desc, task.action))NEWLINE raise errors.DriverError("Driver %s doesn't support task action %s"NEWLINE % (self.driver_desc, task.action))NEWLINENEWLINE design_ref = task.design_refNEWLINENEWLINE if design_ref is None:NEWLINE raise errors.DriverError(NEWLINE "No design ID specified in task %s" % (task_id))NEWLINENEWLINE self.orchestrator.task_field_update(NEWLINE task.get_id(), status=hd_fields.TaskStatus.Running)NEWLINENEWLINE self.logger.info("Sleeping 60s to allow time for manual OOB %s action"NEWLINE % task.action)NEWLINENEWLINE time.sleep(60)NEWLINENEWLINE task.set_status(hd_fields.TaskStatus.Complete)NEWLINE task.success()NEWLINE task.save()NEWLINENEWLINE returnNEWLINE |
def define_targets(rules):NEWLINE rules.py_library(NEWLINE name = "torchgen",NEWLINE srcs = rules.glob(["**/*.py"]),NEWLINE deps = [NEWLINE rules.requirement("PyYAML"),NEWLINE rules.requirement("typing-extensions"),NEWLINE ],NEWLINE visibility = ["//visibility:public"],NEWLINE )NEWLINENEWLINE rules.py_binary(NEWLINE name = "gen",NEWLINE srcs = [":torchgen"],NEWLINE visibility = ["//visibility:public"],NEWLINE )NEWLINE |
version = '0.0.7'NEWLINEtime = '2021-10-22 16:08:00'NEWLINE |
from django.db import modelsNEWLINEimport django.contrib.auth.modelsNEWLINENEWLINENEWLINE# class Admin(models.Model):NEWLINE# password = models.CharField(max_length=128)NEWLINE# last_login = models.DateTimeField()NEWLINE# is_superuser = models.BooleanField()NEWLINE# first_name = models.CharField(max_length=30)NEWLINE# last_name = models.CharField(max_length=30)NEWLINE# email = models.EmailField(max_length=254)NEWLINE# is_staff = models.BooleanField()NEWLINE# is_active = models.BooleanField()NEWLINE# date_joined = models.DateTimeField()NEWLINE# username = models.CharField(max_length=30)NEWLINE#NEWLINE# class Meta:NEWLINE# db_table = "auth_user"NEWLINENEWLINENEWLINEclass Statistics(models.Model):NEWLINE new_order = models.IntegerField()NEWLINE new_visitors = models.IntegerField()NEWLINE new_user = models.IntegerField()NEWLINE profit_today = models.IntegerField()NEWLINENEWLINE class Meta:NEWLINE db_table = "admin_site_statistics"NEWLINENEWLINENEWLINEclass EmailEntity(models.Model):NEWLINE user = models.ForeignKey(django.contrib.auth.models.User, related_name='email_owner')NEWLINE #MIME headerNEWLINE mime_from = models.EmailField(max_length=128)NEWLINE mime_to = models.CharField(max_length=128)NEWLINE mime_cc = models.CharField(max_length=128)NEWLINE mime_bcc = models.CharField(max_length=128)NEWLINE mime_date = models.DateTimeField()NEWLINE mime_subject = models.CharField(max_length=128)NEWLINE mime_transfer_encoding = models.CharField(max_length=8)NEWLINE #MIME contentNEWLINE content_type = models.CharField(max_length=8)NEWLINENEWLINE #local statusNEWLINE readed = models.BooleanField()NEWLINENEWLINE class Meta:NEWLINE db_table = "admin_email_inbox"NEWLINE |
from typing import List, Dict, SetNEWLINEfrom itertools import chainNEWLINEimport reNEWLINEfrom collections import defaultdict, CounterNEWLINENEWLINENEWLINEclass BytePairEncoding(object):NEWLINE """ Byte Pair Encoding classNEWLINE We aren't gonna use this class for encoding. Because it is too slow......NEWLINE We will use sentence piece Google have made.NEWLINE Thus, this class is just for special token index reference.NEWLINE """NEWLINE PAD_token = '<pad>'NEWLINE PAD_token_idx = 0NEWLINE UNK_token = '<unk>'NEWLINE UNK_token_idx = 1NEWLINE CLS_token = '<cls>'NEWLINE CLS_token_idx = 2NEWLINE SEP_token = '<sep>'NEWLINE SEP_token_idx = 3NEWLINE MSK_token = '<msk>'NEWLINE MSK_token_idx = 4NEWLINENEWLINE WORD_END = '_'NEWLINENEWLINE def __init__(self, corpus: List[List[str]], max_vocab_size: int) -> None:NEWLINE self.idx2word = build_bpe(corpus, max_vocab_size)NEWLINENEWLINE def encode(self, sentence: List[str]) -> List[int]:NEWLINE return encode(sentence, self.idx2word)NEWLINENEWLINE def decoder(self, tokens: List[int]) -> List[str]:NEWLINE return decode(tokens, self.idx2word)NEWLINENEWLINENEWLINEdef build_bpe(NEWLINE corpus: List[str],NEWLINE max_vocab_size: intNEWLINE) -> List[int]:NEWLINE """ BPE Vocabulary BuilderNEWLINE Implement vocabulary builder for byte pair encoding.NEWLINE Please sort your idx2word by subword length in descending manner.NEWLINENEWLINE Hint: Counter in collection library would be helpfulNEWLINENEWLINE Note: If you convert sentences list to word frequence dictionary,NEWLINE building speed is enhanced significantly because duplicated words areNEWLINE preprocessed togetherNEWLINENEWLINE Arguments:NEWLINE corpus -- List of words to build vocabNEWLINE max_vocab_size -- The maximum size of vocabNEWLINENEWLINE Return:NEWLINE idx2word -- Subword listNEWLINE """NEWLINE # Special tokensNEWLINE PAD = BytePairEncoding.PAD_token # Index of <PAD> must be 0NEWLINE UNK = BytePairEncoding.UNK_token # Index of <UNK> must be 1NEWLINE CLS = BytePairEncoding.CLS_token # Index of <CLS> must be 2NEWLINE SEP = BytePairEncoding.SEP_token # Index of <SEP> must be 3NEWLINE MSK = BytePairEncoding.MSK_token # Index of <MSK> must be 4NEWLINE SPECIAL = [PAD, UNK, CLS, SEP, MSK]NEWLINENEWLINE WORD_END = BytePairEncoding.WORD_END # Use this token as the end of a wordNEWLINE # YOUR CODE HERENEWLINE # 1. character vocabulary로 symbol vocab 초기화하고 단어를 sequence of chars로 표현NEWLINE vocab = {" ".join(list(word) + [WORD_END]): ct for word, ct in Counter(corpus).items()}NEWLINE chars = list(set([char for word in corpus for char in word]))NEWLINE num_merges = max_vocab_size - len(SPECIAL) - 1 - len(chars)NEWLINE # 2. number of merge operation에 도달할 때 까지 아래 두 과정을 반복한다NEWLINE for _ in range(num_merges):NEWLINE # 2-a. symbol pair를 센다. 합칠 pair가 없다면 loop을 종료한다.NEWLINE pairs = defaultdict(int)NEWLINE for word, freq in vocab.items():NEWLINE symbols = word.split()NEWLINE for i in range(len(symbols)-1):NEWLINE pairs[symbols[i],symbols[i+1]] += freqNEWLINE if not pairs:NEWLINE breakNEWLINE # 2-b. 가장 빈번히 등장하는 pairs를 합쳐 새로운 symbol로 대체한다NEWLINE best = max(pairs, key=pairs.get)NEWLINE new_vocab = {}NEWLINE bigram = re.escape(' '.join(best))NEWLINE p = re.compile(r'(?<!\S)' + bigram + r'(?!\S)')NEWLINE for word in vocab:NEWLINE w_out = p.sub(''.join(best), word)NEWLINE new_vocab[w_out] = vocab[word]NEWLINE vocab = new_vocabNEWLINE chars.append(''.join(best))NEWLINE idx2word = SPECIAL + sorted(chars, key=len, reverse=True) + [WORD_END]NEWLINE return idx2wordNEWLINE |
from __future__ import unicode_literalsNEWLINEfrom django.db import modelsNEWLINE#from django.utils import timezoneNEWLINEfrom accounts.models import UserNEWLINENEWLINE NEWLINE# 계산 객체 생성NEWLINEclass Inference(models.Model):NEWLINE author = models.ForeignKey(User, NEWLINE null = True, # DB에 null 저장을 허용(탈퇴 퇴출 등).NEWLINE blank= False, # 입력 창에서는 반드시 author가 존재해야함.NEWLINE on_delete=models.SET_NULL)NEWLINE title = models.CharField(max_length=200)NEWLINE memo = models.TextField(blank = True, null = True)NEWLINENEWLINE input_data = models.FileField(upload_to='list/files/%Y/%m/%d/', blank = True)NEWLINENEWLINE output_data = models.FileField(upload_to='list/files/%Y/%m/%d/', blank = True, null = True)NEWLINENEWLINE output_text = models.CharField(max_length=200,NEWLINE blank = True,NEWLINE null = True)NEWLINENEWLINE thumbnail = models.ImageField(u'썸네일', NEWLINE upload_to='%Y/%m/%d', blank=True, null=True)NEWLINE created_at = models.DateTimeField(auto_now_add = True)NEWLINE updated_at = models.DateTimeField(auto_now = True)NEWLINENEWLINE def __str__(self):NEWLINE return f'[{self.pk}] {self.title} :: {self.author}' |
"""Config Flow for PlayStation 4."""NEWLINEfrom collections import OrderedDictNEWLINEimport loggingNEWLINENEWLINEimport voluptuous as volNEWLINENEWLINEfrom homeassistant import config_entriesNEWLINEfrom homeassistant.components.ps4.const import (NEWLINE DEFAULT_NAME, DEFAULT_REGION, DOMAIN, REGIONS)NEWLINEfrom homeassistant.const import (NEWLINE CONF_CODE, CONF_HOST, CONF_IP_ADDRESS, CONF_NAME, CONF_REGION, CONF_TOKEN)NEWLINENEWLINE_LOGGER = logging.getLogger(__name__)NEWLINENEWLINEUDP_PORT = 987NEWLINETCP_PORT = 997NEWLINEPORT_MSG = {UDP_PORT: 'port_987_bind_error', TCP_PORT: 'port_997_bind_error'}NEWLINENEWLINENEWLINE@config_entries.HANDLERS.register(DOMAIN)NEWLINEclass PlayStation4FlowHandler(config_entries.ConfigFlow):NEWLINE """Handle a PlayStation 4 config flow."""NEWLINENEWLINE VERSION = 1NEWLINE CONNECTION_CLASS = config_entries.CONN_CLASS_LOCAL_POLLNEWLINENEWLINE def __init__(self):NEWLINE """Initialize the config flow."""NEWLINE from pyps4_homeassistant import HelperNEWLINENEWLINE self.helper = Helper()NEWLINE self.creds = NoneNEWLINE self.name = NoneNEWLINE self.host = NoneNEWLINE self.region = NoneNEWLINE self.pin = NoneNEWLINENEWLINE async def async_step_user(self, user_input=None):NEWLINE """Handle a user config flow."""NEWLINE # Check if able to bind to ports: UDP 987, TCP 997.NEWLINE ports = PORT_MSG.keys()NEWLINE failed = await self.hass.async_add_executor_job(NEWLINE self.helper.port_bind, ports)NEWLINE if failed in ports:NEWLINE reason = PORT_MSG[failed]NEWLINE return self.async_abort(reason=reason)NEWLINE # Skip Creds Step if a device is configured.NEWLINE if self.hass.config_entries.async_entries(DOMAIN):NEWLINE return await self.async_step_link()NEWLINE return await self.async_step_creds()NEWLINENEWLINE async def async_step_creds(self, user_input=None):NEWLINE """Return PS4 credentials from 2nd Screen App."""NEWLINE if user_input is not None:NEWLINE self.creds = await self.hass.async_add_executor_job(NEWLINE self.helper.get_creds)NEWLINENEWLINE if self.creds is not None:NEWLINE return await self.async_step_link()NEWLINE return self.async_abort(reason='credential_error')NEWLINENEWLINE return self.async_show_form(NEWLINE step_id='creds')NEWLINENEWLINE async def async_step_link(self, user_input=None):NEWLINE """Prompt user input. Create or edit entry."""NEWLINE errors = {}NEWLINENEWLINE # Search for device.NEWLINE devices = await self.hass.async_add_executor_job(NEWLINE self.helper.has_devices)NEWLINENEWLINE # Abort if can't find device.NEWLINE if not devices:NEWLINE return self.async_abort(reason='no_devices_found')NEWLINENEWLINE device_list = [NEWLINE device['host-ip'] for device in devices]NEWLINENEWLINE # If entry exists check that devices found aren't configured.NEWLINE if self.hass.config_entries.async_entries(DOMAIN):NEWLINE for entry in self.hass.config_entries.async_entries(DOMAIN):NEWLINE conf_devices = entry.data['devices']NEWLINE for c_device in conf_devices:NEWLINE if c_device['host'] in device_list:NEWLINE # Remove configured device from search list.NEWLINE device_list.remove(c_device['host'])NEWLINE # If list is empty then all devices are configured.NEWLINE if not device_list:NEWLINE return self.async_abort(reason='devices_configured')NEWLINENEWLINE # Login to PS4 with user data.NEWLINE if user_input is not None:NEWLINE self.region = user_input[CONF_REGION]NEWLINE self.name = user_input[CONF_NAME]NEWLINE self.pin = user_input[CONF_CODE]NEWLINE self.host = user_input[CONF_IP_ADDRESS]NEWLINENEWLINE is_ready, is_login = await self.hass.async_add_executor_job(NEWLINE self.helper.link, self.host, self.creds, self.pin)NEWLINENEWLINE if is_ready is False:NEWLINE errors['base'] = 'not_ready'NEWLINE elif is_login is False:NEWLINE errors['base'] = 'login_failed'NEWLINE else:NEWLINE device = {NEWLINE CONF_HOST: self.host,NEWLINE CONF_NAME: self.name,NEWLINE CONF_REGION: self.regionNEWLINE }NEWLINENEWLINE # Create entry.NEWLINE return self.async_create_entry(NEWLINE title='PlayStation 4',NEWLINE data={NEWLINE CONF_TOKEN: self.creds,NEWLINE 'devices': [device],NEWLINE },NEWLINE )NEWLINENEWLINE # Show User Input form.NEWLINE link_schema = OrderedDict()NEWLINE link_schema[vol.Required(CONF_IP_ADDRESS)] = vol.In(list(device_list))NEWLINE link_schema[vol.Required(NEWLINE CONF_REGION, default=DEFAULT_REGION)] = vol.In(list(REGIONS))NEWLINE link_schema[vol.Required(CONF_CODE)] = strNEWLINE link_schema[vol.Required(CONF_NAME, default=DEFAULT_NAME)] = strNEWLINENEWLINE return self.async_show_form(NEWLINE step_id='link',NEWLINE data_schema=vol.Schema(link_schema),NEWLINE errors=errors,NEWLINE )NEWLINE |
# Copyright 2015 The Crashpad Authors. All rights reserved.NEWLINE#NEWLINE# Licensed under the Apache License, Version 2.0 (the "License");NEWLINE# you may not use this file except in compliance with the License.NEWLINE# You may obtain a copy of the License atNEWLINE#NEWLINE# http://www.apache.org/licenses/LICENSE-2.0NEWLINE#NEWLINE# Unless required by applicable law or agreed to in writing, softwareNEWLINE# distributed under the License is distributed on an "AS IS" BASIS,NEWLINE# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.NEWLINE# See the License for the specific language governing permissions andNEWLINE# limitations under the License.NEWLINENEWLINE{NEWLINE 'includes': [NEWLINE '../build/crashpad.gypi',NEWLINE ],NEWLINE 'targets': [NEWLINE {NEWLINE 'target_name': 'crashpad_test',NEWLINE 'type': 'static_library',NEWLINE 'dependencies': [NEWLINE '../compat/compat.gyp:crashpad_compat',NEWLINE '../third_party/gtest/gtest.gyp:gtest',NEWLINE '../third_party/mini_chromium/mini_chromium.gyp:base',NEWLINE '../util/util.gyp:crashpad_util',NEWLINE ],NEWLINE 'include_dirs': [NEWLINE '..',NEWLINE ],NEWLINE 'sources': [NEWLINE 'errors.cc',NEWLINE 'errors.h',NEWLINE 'file.cc',NEWLINE 'file.h',NEWLINE 'filesystem.cc',NEWLINE 'filesystem.h',NEWLINE 'gtest_death.h',NEWLINE 'hex_string.cc',NEWLINE 'hex_string.h',NEWLINE 'linux/fake_ptrace_connection.cc',NEWLINE 'linux/fake_ptrace_connection.h',NEWLINE 'linux/get_tls.cc',NEWLINE 'linux/get_tls.h',NEWLINE 'mac/dyld.cc',NEWLINE 'mac/dyld.h',NEWLINE 'mac/exception_swallower.cc',NEWLINE 'mac/exception_swallower.h',NEWLINE 'mac/mach_errors.cc',NEWLINE 'mac/mach_errors.h',NEWLINE 'mac/mach_multiprocess.cc',NEWLINE 'mac/mach_multiprocess.h',NEWLINE 'main_arguments.cc',NEWLINE 'main_arguments.h',NEWLINE 'multiprocess.h',NEWLINE 'multiprocess_exec.cc',NEWLINE 'multiprocess_exec.h',NEWLINE 'multiprocess_exec_posix.cc',NEWLINE 'multiprocess_exec_win.cc',NEWLINE 'multiprocess_posix.cc',NEWLINE 'process_type.cc',NEWLINE 'process_type.h',NEWLINE 'scoped_guarded_page.h',NEWLINE 'scoped_guarded_page_posix.cc',NEWLINE 'scoped_module_handle.cc',NEWLINE 'scoped_module_handle.h',NEWLINE 'scoped_temp_dir.cc',NEWLINE 'scoped_temp_dir.h',NEWLINE 'scoped_temp_dir_posix.cc',NEWLINE 'scoped_temp_dir_win.cc',NEWLINE 'test_paths.cc',NEWLINE 'test_paths.h',NEWLINE 'win/child_launcher.cc',NEWLINE 'win/child_launcher.h',NEWLINE 'win/win_child_process.cc',NEWLINE 'win/win_child_process.h',NEWLINE 'win/win_multiprocess.cc',NEWLINE 'win/win_multiprocess.h',NEWLINE 'win/win_multiprocess_with_temp_dir.cc',NEWLINE 'win/win_multiprocess_with_temp_dir.h',NEWLINE ],NEWLINE 'direct_dependent_settings': {NEWLINE 'include_dirs': [NEWLINE '..',NEWLINE ],NEWLINE },NEWLINE 'conditions': [NEWLINE ['OS=="mac"', {NEWLINE 'dependencies': [NEWLINE '../handler/handler.gyp:crashpad_handler_lib',NEWLINE '../snapshot/snapshot.gyp:crashpad_snapshot',NEWLINE ],NEWLINE 'link_settings': {NEWLINE 'libraries': [NEWLINE '$(SDKROOT)/usr/lib/libbsm.dylib',NEWLINE ],NEWLINE },NEWLINE }],NEWLINE ['OS=="win"', {NEWLINE 'link_settings': {NEWLINE 'libraries': [NEWLINE '-lshell32.lib',NEWLINE ],NEWLINE },NEWLINE }],NEWLINE ],NEWLINE 'target_conditions': [NEWLINE ['OS=="android"', {NEWLINE 'sources/': [NEWLINE ['include', '^linux/'],NEWLINE ],NEWLINE }],NEWLINE ],NEWLINE },NEWLINE {NEWLINE 'target_name': 'crashpad_gmock_main',NEWLINE 'type': 'static_library',NEWLINE 'dependencies': [NEWLINE 'crashpad_test',NEWLINE '../third_party/gtest/gmock.gyp:gmock',NEWLINE '../third_party/gtest/gtest.gyp:gtest',NEWLINE '../third_party/mini_chromium/mini_chromium.gyp:base',NEWLINE ],NEWLINE 'include_dirs': [NEWLINE '..',NEWLINE ],NEWLINE 'defines': [NEWLINE 'CRASHPAD_TEST_LAUNCHER_GMOCK=1',NEWLINE ],NEWLINE 'sources': [NEWLINE 'gtest_main.cc',NEWLINE ],NEWLINE },NEWLINE {NEWLINE 'target_name': 'crashpad_gtest_main',NEWLINE 'type': 'static_library',NEWLINE 'dependencies': [NEWLINE 'crashpad_test',NEWLINE '../third_party/gtest/gtest.gyp:gtest',NEWLINE '../third_party/mini_chromium/mini_chromium.gyp:base',NEWLINE ],NEWLINE 'include_dirs': [NEWLINE '..',NEWLINE ],NEWLINE 'defines': [NEWLINE 'CRASHPAD_TEST_LAUNCHER_GTEST=1',NEWLINE ],NEWLINE 'sources': [NEWLINE 'gtest_main.cc',NEWLINE ],NEWLINE },NEWLINE ],NEWLINE}NEWLINE |
from typing import ListNEWLINENEWLINENEWLINEclass InvoiceProfiles:NEWLINE def __init__(self, invoice_profiles: List[str]):NEWLINE self.invoice_profiles = invoice_profilesNEWLINENEWLINE def as_list(self) -> List:NEWLINE return [{"value": invoice_profile} for invoice_profile in self.invoice_profiles]NEWLINE |
# vim: tabstop=4 shiftwidth=4 softtabstop=4NEWLINENEWLINE# Copyright 2011 OpenStack FoundationNEWLINE#NEWLINE# Licensed under the Apache License, Version 2.0 (the "License"); you mayNEWLINE# not use this file except in compliance with the License. You may obtainNEWLINE# a copy of the License atNEWLINE#NEWLINE# http://www.apache.org/licenses/LICENSE-2.0NEWLINE#NEWLINE# Unless required by applicable law or agreed to in writing, softwareNEWLINE# distributed under the License is distributed on an "AS IS" BASIS, WITHOUTNEWLINE# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See theNEWLINE# License for the specific language governing permissions and limitationsNEWLINE# under the License.NEWLINE"""NEWLINEA module where we define some basic units for use across Cinder.NEWLINE"""NEWLINENEWLINEKiB = 1024NEWLINEMiB = KiB * 1024NEWLINEGiB = MiB * 1024NEWLINE |
from django.db import modelsNEWLINEfrom django.contrib.auth.models import AbstractBaseUser, BaseUserManager, \NEWLINE PermissionsMixinNEWLINENEWLINEclass UserManager(BaseUserManager):NEWLINE def create_user(self, email, password=None, **extra_fields):NEWLINE """creates and saves a new user"""NEWLINE if not email:NEWLINE raise ValueError('Users must have an email address')NEWLINE user = self.model(email=self.normalize_email(email), **extra_fields)NEWLINE user.set_password(password)NEWLINE user.save(using=self._db)NEWLINE return userNEWLINENEWLINE def create_superuser(self, email, password):NEWLINE """Creates and saves a new super user"""NEWLINE user = self.create_user(email, password)NEWLINE user.is_staff = TrueNEWLINE user.is_superuser = TrueNEWLINE user.save(using= self._db)NEWLINE return user NEWLINENEWLINENEWLINEclass User(AbstractBaseUser,PermissionsMixin):NEWLINE """custom user model that supports using email insteadof username"""NEWLINE email = models.EmailField(max_length=255, unique=True)NEWLINE name = models.CharField(max_length=255)NEWLINE is_active = models.BooleanField(default=True)NEWLINE is_staff = models.BooleanField(default=False)NEWLINENEWLINE objects = UserManager()NEWLINENEWLINE USERNAME_FIELD = 'email' |
# -*- coding: utf-8 -*-NEWLINE# Generated by Django 1.10.5 on 2017-06-25 16:40NEWLINEfrom __future__ import unicode_literalsNEWLINENEWLINEfrom django.db import migrations, modelsNEWLINENEWLINENEWLINEclass Migration(migrations.Migration):NEWLINENEWLINE dependencies = [NEWLINE ('websites', '0005_auto_20170625_1840'),NEWLINE ]NEWLINENEWLINE operations = [NEWLINE migrations.AlterField(NEWLINE model_name='websitedirective',NEWLINE name='name',NEWLINE field=models.CharField(choices=[(None, '-------'), ('SSL', [('ssl-ca', 'SSL CA'), ('ssl-cert', 'SSL cert'), ('ssl-key', 'SSL key')]), ('HTTPD', [('redirect', 'Redirection'), ('proxy', 'Proxy'), ('error-document', 'ErrorDocumentRoot')]), ('ModSecurity', [('sec-rule-remove', 'SecRuleRemoveById'), ('sec-engine', 'SecRuleEngine Off')]), ('SaaS', [('wordpress-saas', 'WordPress SaaS'), ('dokuwiki-saas', 'DokuWiki SaaS'), ('drupal-saas', 'Drupdal SaaS'), ('moodle-saas', 'Moodle SaaS')])], db_index=True, max_length=128, verbose_name='name'),NEWLINE ),NEWLINE ]NEWLINE |
import numpy as npNEWLINEfrom gym.envs.registration import registerNEWLINENEWLINEfrom onpolicy.envs.highway.highway_env import utilsNEWLINEfrom onpolicy.envs.highway.highway_env.envs.common.abstract import AbstractEnvNEWLINEfrom onpolicy.envs.highway.highway_env.road.lane import LineType, StraightLaneNEWLINEfrom onpolicy.envs.highway.highway_env.road.road import Road, RoadNetworkNEWLINEfrom onpolicy.envs.highway.highway_env.vehicle.controller import MDPVehicleNEWLINENEWLINENEWLINEclass TwoWayEnv(AbstractEnv):NEWLINENEWLINE """NEWLINE A risk management task: the agent is driving on a two-way lane with icoming traffic.NEWLINENEWLINE It must balance making progress by overtaking and ensuring safety.NEWLINENEWLINE These conflicting objectives are implemented by a reward signal and a constraint signal,NEWLINE in the CMDP/BMDP framework.NEWLINE """NEWLINENEWLINE COLLISION_REWARD: float = 0NEWLINE LEFT_LANE_CONSTRAINT: float = 1NEWLINE LEFT_LANE_REWARD: float = 0.2NEWLINE HIGH_SPEED_REWARD: float = 0.8NEWLINENEWLINE @classmethodNEWLINE def default_config(cls) -> dict:NEWLINE config = super().default_config()NEWLINE config.update({NEWLINE "observation": {NEWLINE "type": "TimeToCollision",NEWLINE "horizon": 5NEWLINE },NEWLINE "action": {NEWLINE "type": "DiscreteMetaAction",NEWLINE },NEWLINE })NEWLINE return configNEWLINENEWLINE def _reward(self, action: int) -> float:NEWLINE """NEWLINE The vehicle is rewarded for driving with high speedNEWLINE :param action: the action performedNEWLINE :return: the reward of the state-action transitionNEWLINE """NEWLINE neighbours = self.road.network.all_side_lanes(self.vehicle.lane_index)NEWLINENEWLINE reward = self.HIGH_SPEED_REWARD * self.vehicle.speed_index / (self.vehicle.SPEED_COUNT - 1) \NEWLINE + self.LEFT_LANE_REWARD * (len(neighbours) - 1 - self.vehicle.target_lane_index[2]) / (len(neighbours) - 1)NEWLINE return rewardNEWLINENEWLINE def _is_terminal(self) -> bool:NEWLINE """The episode is over if the ego vehicle crashed or the time is out."""NEWLINE return self.vehicle.crashedNEWLINENEWLINE def _cost(self, action: int) -> float:NEWLINE """The constraint signal is the time spent driving on the opposite lane, and occurrence of collisions."""NEWLINE return float(self.vehicle.crashed) + float(self.vehicle.lane_index[2] == 0)/15NEWLINENEWLINE def _reset(self) -> np.ndarray:NEWLINE self._make_road()NEWLINE self._make_vehicles()NEWLINENEWLINE def _make_road(self, length=800):NEWLINE """NEWLINE Make a road composed of a two-way road.NEWLINENEWLINE :return: the roadNEWLINE """NEWLINE net = RoadNetwork()NEWLINENEWLINE # LanesNEWLINE net.add_lane("a", "b", StraightLane([0, 0], [length, 0],NEWLINE line_types=(LineType.CONTINUOUS_LINE, LineType.STRIPED)))NEWLINE net.add_lane("a", "b", StraightLane([0, StraightLane.DEFAULT_WIDTH], [length, StraightLane.DEFAULT_WIDTH],NEWLINE line_types=(LineType.NONE, LineType.CONTINUOUS_LINE)))NEWLINE net.add_lane("b", "a", StraightLane([length, 0], [0, 0],NEWLINE line_types=(LineType.NONE, LineType.NONE)))NEWLINENEWLINE road = Road(network=net, np_random=self.np_random, record_history=self.config["show_trajectories"])NEWLINE self.road = roadNEWLINENEWLINE def _make_vehicles(self) -> None:NEWLINE """NEWLINE Populate a road with several vehicles on the roadNEWLINENEWLINE :return: the ego-vehicleNEWLINE """NEWLINE road = self.roadNEWLINE ego_vehicle = self.action_type.vehicle_class(road,NEWLINE road.network.get_lane(("a", "b", 1)).position(30, 0),NEWLINE speed=30)NEWLINE road.vehicles.append(ego_vehicle)NEWLINE self.vehicle = ego_vehicleNEWLINENEWLINE vehicles_type = utils.class_from_path(self.config["npc_vehicles_type"])NEWLINE for i in range(3):NEWLINE self.road.vehicles.append(NEWLINE vehicles_type(road,NEWLINE position=road.network.get_lane(("a", "b", 1))NEWLINE .position(70+40*i + 10*self.np_random.randn(), 0),NEWLINE heading=road.network.get_lane(("a", "b", 1)).heading_at(70+40*i),NEWLINE speed=24 + 2*self.np_random.randn(),NEWLINE enable_lane_change=False)NEWLINE )NEWLINE for i in range(2):NEWLINE v = vehicles_type(road,NEWLINE position=road.network.get_lane(("b", "a", 0))NEWLINE .position(200+100*i + 10*self.np_random.randn(), 0),NEWLINE heading=road.network.get_lane(("b", "a", 0)).heading_at(200+100*i),NEWLINE speed=20 + 5*self.np_random.randn(),NEWLINE enable_lane_change=False)NEWLINE v.target_lane_index = ("b", "a", 0)NEWLINE self.road.vehicles.append(v)NEWLINENEWLINENEWLINEregister(NEWLINE id='two-way-v0',NEWLINE entry_point='highway_env.envs:TwoWayEnv',NEWLINE max_episode_steps=15NEWLINE)NEWLINE |
'''NEWLINECreated by auto_sdk on 2020.11.17NEWLINE'''NEWLINEfrom dingtalk.api.base import RestApiNEWLINEclass OapiKacDatavDingGetRequest(RestApi):NEWLINE def __init__(self,url=None):NEWLINE RestApi.__init__(self,url)NEWLINE self.ding_usage_summary_request = NoneNEWLINENEWLINE def getHttpMethod(self):NEWLINE return 'POST'NEWLINENEWLINE def getapiname(self):NEWLINE return 'dingtalk.oapi.kac.datav.ding.get'NEWLINE |
from datetime import datetime, dateNEWLINEfrom marqeta.response_models.transaction_model import TransactionModelNEWLINEfrom marqeta.response_models import datetime_objectNEWLINEimport jsonNEWLINEimport reNEWLINENEWLINEclass AdvancedSimulationResponseModel(object):NEWLINENEWLINE def __init__(self, json_response):NEWLINE self.json_response = json_responseNEWLINENEWLINE def __str__(self):NEWLINE return json.dumps(self.json_response, default=self.json_serial)NEWLINENEWLINE @staticmethodNEWLINE def json_serial(o):NEWLINE if isinstance(o, datetime) or isinstance(o, date):NEWLINE return o.__str__()NEWLINENEWLINE @propertyNEWLINE def transaction(self):NEWLINE if 'transaction' in self.json_response:NEWLINE return TransactionModel(self.json_response['transaction'])NEWLINENEWLINE @propertyNEWLINE def raw_iso8583(self):NEWLINE return self.json_response.get('raw_iso8583', None)NEWLINENEWLINE def __repr__(self):NEWLINE return '<Marqeta.response_models.advanced_simulation_response_model.AdvancedSimulationResponseModel>' + self.__str__()NEWLINE |
import unittestNEWLINENEWLINEfrom tests.mapreduce import MapReduceTestCaseNEWLINENEWLINENEWLINEdef all_tests():NEWLINE suite = unittest.TestSuite()NEWLINE suite.addTest(unittest.makeSuite(MapReduceTestCase))NEWLINE return suiteNEWLINE |
#NEWLINE# Licensed under the Apache License, Version 2.0 (the "License");NEWLINE# you may not use this file except in compliance with the License.NEWLINE# You may obtain a copy of the License atNEWLINE#NEWLINE# http://www.apache.org/licenses/LICENSE-2.0NEWLINE#NEWLINE# Unless required by applicable law or agreed to in writing, softwareNEWLINE# distributed under the License is distributed on an "AS IS" BASIS,NEWLINE# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.NEWLINE# See the License for the specific language governing permissions andNEWLINE# limitations under the License.NEWLINENEWLINEfrom neutron_lib import exceptions as q_excNEWLINENEWLINENEWLINEclass ArrayLBaaSv2DriverException(q_exc.NeutronException):NEWLINE """General Array LBaaSv2 Driver Exception."""NEWLINENEWLINE def __init__(self, message=None):NEWLINE if message:NEWLINE self.message = messageNEWLINENEWLINENEWLINEclass ArrayNoAttachedLoadbalancerException(ArrayLBaaSv2DriverException):NEWLINE """Exception thrown when an LBaaSv2 object has not parent Loadbalancer."""NEWLINENEWLINE message = "Entity has no associated loadbalancer"NEWLINENEWLINE def __str__(self):NEWLINE return self.messageNEWLINE |
#NEWLINE# Copyright 2019 The FATE Authors. All Rights Reserved.NEWLINE#NEWLINE# Licensed under the Apache License, Version 2.0 (the "License");NEWLINE# you may not use this file except in compliance with the License.NEWLINE# You may obtain a copy of the License atNEWLINE#NEWLINE# http://www.apache.org/licenses/LICENSE-2.0NEWLINE#NEWLINE# Unless required by applicable law or agreed to in writing, softwareNEWLINE# distributed under the License is distributed on an "AS IS" BASIS,NEWLINE# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.NEWLINE# See the License for the specific language governing permissions andNEWLINE# limitations under the License.NEWLINE#NEWLINEimport ioNEWLINEimport osNEWLINEfrom typing import IterableNEWLINENEWLINEfrom pyarrow import fsNEWLINENEWLINEfrom fate_arch.common import hdfs_utilsNEWLINEfrom fate_arch.common.log import getLoggerNEWLINEfrom fate_arch.storage import StorageEngine, HDFSStorageTypeNEWLINEfrom fate_arch.storage import StorageTableBaseNEWLINENEWLINELOGGER = getLogger()NEWLINENEWLINENEWLINEclass StorageTable(StorageTableBase):NEWLINE def __init__(self,NEWLINE address=None,NEWLINE name: str = None,NEWLINE namespace: str = None,NEWLINE partitions: int = None,NEWLINE storage_type: HDFSStorageType = None,NEWLINE options=None):NEWLINE super(StorageTable, self).__init__(name=name, namespace=namespace)NEWLINE self._address = addressNEWLINE self._name = nameNEWLINE self._namespace = namespaceNEWLINE self._partitions = partitions if partitions else 1NEWLINE self._type = storage_type if storage_type else HDFSStorageType.DISKNEWLINE self._options = options if options else {}NEWLINE self._engine = StorageEngine.HDFSNEWLINENEWLINE # tricky way to load libhdfsNEWLINE try:NEWLINE from pyarrow import HadoopFileSystemNEWLINE HadoopFileSystem(self._path)NEWLINE except Exception as e:NEWLINE LOGGER.warning(f"load libhdfs failed: {e}")NEWLINE self._hdfs_client = fs.HadoopFileSystem.from_uri(self._path)NEWLINENEWLINE def get_name(self):NEWLINE return self._nameNEWLINENEWLINE def get_namespace(self):NEWLINE return self._namespaceNEWLINENEWLINE def get_address(self):NEWLINE return self._addressNEWLINENEWLINE def get_engine(self):NEWLINE return self._engineNEWLINENEWLINE def get_type(self):NEWLINE return self._typeNEWLINENEWLINE def get_partitions(self):NEWLINE return self._partitionsNEWLINENEWLINE def get_options(self):NEWLINE return self._optionsNEWLINENEWLINE def put_all(self, kv_list: Iterable, append=True, assume_file_exist=False, **kwargs):NEWLINE LOGGER.info(f"put in hdfs file: {self._path}")NEWLINE if append and (assume_file_exist or self._exist()):NEWLINE stream = self._hdfs_client.open_append_stream(path=self._path, compression=None)NEWLINE else:NEWLINE stream = self._hdfs_client.open_output_stream(path=self._path, compression=None)NEWLINENEWLINE counter = 0NEWLINE with io.TextIOWrapper(stream) as writer:NEWLINE for k, v in kv_list:NEWLINE writer.write(hdfs_utils.serialize(k, v))NEWLINE writer.write(hdfs_utils.NEWLINE)NEWLINE counter = counter + 1NEWLINE self._meta.update_metas(count=counter)NEWLINENEWLINE def collect(self, **kwargs) -> list:NEWLINE for line in self._as_generator():NEWLINE yield hdfs_utils.deserialize(line.rstrip())NEWLINENEWLINE def read(self) -> list:NEWLINE for line in self._as_generator():NEWLINE yield lineNEWLINENEWLINE def destroy(self):NEWLINE super().destroy()NEWLINE self._hdfs_client.delete_file(self._path)NEWLINENEWLINE def count(self):NEWLINE count = 0NEWLINE for _ in self._as_generator():NEWLINE count += 1NEWLINE self.get_meta().update_metas(count=count)NEWLINE return countNEWLINENEWLINE def save_as(self, address, partitions=None, name=None, namespace=None, schema=None, **kwargs):NEWLINE super().save_as(name, namespace, partitions=partitions, schema=schema)NEWLINE self._hdfs_client.copy_file(src=self._path, dst=address.path)NEWLINE return StorageTable(address=address, partitions=partitions, name=name, namespace=namespace, **kwargs)NEWLINENEWLINE def close(self):NEWLINE passNEWLINENEWLINE @propertyNEWLINE def _path(self) -> str:NEWLINE return f"{self._address.name_node}/{self._address.path}"NEWLINENEWLINE def _exist(self):NEWLINE info = self._hdfs_client.get_file_info([self._path])[0]NEWLINE return info.type != fs.FileType.NotFoundNEWLINENEWLINE def _as_generator(self):NEWLINE info = self._hdfs_client.get_file_info([self._path])[0]NEWLINE if info.type == fs.FileType.NotFound:NEWLINE raise FileNotFoundError(f"file {self._path} not found")NEWLINENEWLINE elif info.type == fs.FileType.File:NEWLINE with io.TextIOWrapper(buffer=self._hdfs_client.open_input_stream(self._path),NEWLINE encoding="utf-8") as reader:NEWLINE for line in reader:NEWLINE yield lineNEWLINENEWLINE else:NEWLINE selector = fs.FileSelector(os.path.join("/", self._address.path))NEWLINE file_infos = self._hdfs_client.get_file_info(selector)NEWLINE for file_info in file_infos:NEWLINE if file_info.base_name == "_SUCCESS":NEWLINE continueNEWLINE assert file_info.is_file, f"{self._path} is directory contains a subdirectory: {file_info.path}"NEWLINE with io.TextIOWrapper(NEWLINE buffer=self._hdfs_client.open_input_stream(f"{self._address.name_node}/{file_info.path}"),NEWLINE encoding="utf-8") as reader:NEWLINE for line in reader:NEWLINE yield lineNEWLINE |
# coding=utf-8NEWLINE# --------------------------------------------------------------------------NEWLINE# Copyright (c) Microsoft Corporation. All rights reserved.NEWLINE# Licensed under the MIT License. See License.txt in the project root forNEWLINE# license information.NEWLINE#NEWLINE# Code generated by Microsoft (R) AutoRest Code Generator.NEWLINE# Changes may cause incorrect behavior and will be lost if the code isNEWLINE# regenerated.NEWLINE# --------------------------------------------------------------------------NEWLINENEWLINEfrom .azure_entity_resource import AzureEntityResourceNEWLINENEWLINENEWLINEclass ImmutabilityPolicy(AzureEntityResource):NEWLINE """The ImmutabilityPolicy property of a blob container, including Id, resourceNEWLINE name, resource type, Etag.NEWLINENEWLINE Variables are only populated by the server, and will be ignored whenNEWLINE sending a request.NEWLINENEWLINE All required parameters must be populated in order to send to Azure.NEWLINENEWLINE :ivar id: Fully qualified resource Id for the resource. Ex -NEWLINE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}NEWLINE :vartype id: strNEWLINE :ivar name: The name of the resourceNEWLINE :vartype name: strNEWLINE :ivar type: The type of the resource. Ex-NEWLINE Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts.NEWLINE :vartype type: strNEWLINE :ivar etag: Resource Etag.NEWLINE :vartype etag: strNEWLINE :param immutability_period_since_creation_in_days: Required. TheNEWLINE immutability period for the blobs in the container since the policyNEWLINE creation, in days.NEWLINE :type immutability_period_since_creation_in_days: intNEWLINE :ivar state: The ImmutabilityPolicy state of a blob container, possibleNEWLINE values include: Locked and Unlocked. Possible values include: 'Locked',NEWLINE 'Unlocked'NEWLINE :vartype state: str orNEWLINE ~azure.mgmt.storage.v2018_11_01.models.ImmutabilityPolicyStateNEWLINE """NEWLINENEWLINE _validation = {NEWLINE 'id': {'readonly': True},NEWLINE 'name': {'readonly': True},NEWLINE 'type': {'readonly': True},NEWLINE 'etag': {'readonly': True},NEWLINE 'immutability_period_since_creation_in_days': {'required': True},NEWLINE 'state': {'readonly': True},NEWLINE }NEWLINENEWLINE _attribute_map = {NEWLINE 'id': {'key': 'id', 'type': 'str'},NEWLINE 'name': {'key': 'name', 'type': 'str'},NEWLINE 'type': {'key': 'type', 'type': 'str'},NEWLINE 'etag': {'key': 'etag', 'type': 'str'},NEWLINE 'immutability_period_since_creation_in_days': {'key': 'properties.immutabilityPeriodSinceCreationInDays', 'type': 'int'},NEWLINE 'state': {'key': 'properties.state', 'type': 'str'},NEWLINE }NEWLINENEWLINE def __init__(self, **kwargs):NEWLINE super(ImmutabilityPolicy, self).__init__(**kwargs)NEWLINE self.immutability_period_since_creation_in_days = kwargs.get('immutability_period_since_creation_in_days', None)NEWLINE self.state = NoneNEWLINE |
import FWCore.ParameterSet.Config as cmsNEWLINENEWLINEL1GtRunSettingsViewer = cms.EDAnalyzer("L1GtRunSettingsViewer",NEWLINE prescalesKey = cms.string(""),NEWLINE maskAlgoKey = cms.string(""),NEWLINE maskTechKey = cms.string(""),NEWLINE maskVetoAlgoKey = cms.string(""),NEWLINE maskVetoTechKey = cms.string("")NEWLINE )NEWLINE |
# -*- coding: utf-8 -*-NEWLINENEWLINE# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:NEWLINE# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-codeNEWLINENEWLINEfrom ccxt.async_support.base.exchange import ExchangeNEWLINEimport base64NEWLINEimport hashlibNEWLINEfrom ccxt.base.errors import ArgumentsRequiredNEWLINENEWLINENEWLINEclass negociecoins (Exchange):NEWLINENEWLINE def describe(self):NEWLINE return self.deep_extend(super(negociecoins, self).describe(), {NEWLINE 'id': 'negociecoins',NEWLINE 'name': 'NegocieCoins',NEWLINE 'countries': ['BR'],NEWLINE 'rateLimit': 1000,NEWLINE 'version': 'v3',NEWLINE 'has': {NEWLINE 'createMarketOrder': False,NEWLINE 'fetchOrder': True,NEWLINE 'fetchOrders': True,NEWLINE 'fetchOpenOrders': True,NEWLINE 'fetchClosedOrders': True,NEWLINE },NEWLINE 'urls': {NEWLINE 'logo': 'https://user-images.githubusercontent.com/1294454/38008571-25a6246e-3258-11e8-969b-aeb691049245.jpg',NEWLINE 'api': {NEWLINE 'public': 'https://broker.negociecoins.com.br/api/v3',NEWLINE 'private': 'https://broker.negociecoins.com.br/tradeapi/v1',NEWLINE },NEWLINE 'www': 'https://www.negociecoins.com.br',NEWLINE 'doc': [NEWLINE 'https://www.negociecoins.com.br/documentacao-tradeapi',NEWLINE 'https://www.negociecoins.com.br/documentacao-api',NEWLINE ],NEWLINE 'fees': 'https://www.negociecoins.com.br/comissoes',NEWLINE },NEWLINE 'api': {NEWLINE 'public': {NEWLINE 'get': [NEWLINE '{PAR}/ticker',NEWLINE '{PAR}/orderbook',NEWLINE '{PAR}/trades',NEWLINE '{PAR}/trades/{timestamp_inicial}',NEWLINE '{PAR}/trades/{timestamp_inicial}/{timestamp_final}',NEWLINE ],NEWLINE },NEWLINE 'private': {NEWLINE 'get': [NEWLINE 'user/balance',NEWLINE 'user/order/{orderId}',NEWLINE ],NEWLINE 'post': [NEWLINE 'user/order',NEWLINE 'user/orders',NEWLINE ],NEWLINE 'delete': [NEWLINE 'user/order/{orderId}',NEWLINE ],NEWLINE },NEWLINE },NEWLINE 'markets': {NEWLINE 'B2X/BRL': {'id': 'b2xbrl', 'symbol': 'B2X/BRL', 'base': 'B2X', 'quote': 'BRL'},NEWLINE 'BCH/BRL': {'id': 'bchbrl', 'symbol': 'BCH/BRL', 'base': 'BCH', 'quote': 'BRL'},NEWLINE 'BTC/BRL': {'id': 'btcbrl', 'symbol': 'BTC/BRL', 'base': 'BTC', 'quote': 'BRL'},NEWLINE 'BTG/BRL': {'id': 'btgbrl', 'symbol': 'BTG/BRL', 'base': 'BTG', 'quote': 'BRL'},NEWLINE 'DASH/BRL': {'id': 'dashbrl', 'symbol': 'DASH/BRL', 'base': 'DASH', 'quote': 'BRL'},NEWLINE 'LTC/BRL': {'id': 'ltcbrl', 'symbol': 'LTC/BRL', 'base': 'LTC', 'quote': 'BRL'},NEWLINE },NEWLINE 'fees': {NEWLINE 'trading': {NEWLINE 'maker': 0.003,NEWLINE 'taker': 0.004,NEWLINE },NEWLINE 'funding': {NEWLINE 'withdraw': {NEWLINE 'BTC': 0.001,NEWLINE 'BCH': 0.00003,NEWLINE 'BTG': 0.00009,NEWLINE 'LTC': 0.005,NEWLINE },NEWLINE },NEWLINE },NEWLINE 'limits': {NEWLINE 'amount': {NEWLINE 'min': 0.001,NEWLINE 'max': None,NEWLINE },NEWLINE },NEWLINE 'precision': {NEWLINE 'amount': 8,NEWLINE 'price': 8,NEWLINE },NEWLINE })NEWLINENEWLINE def parse_ticker(self, ticker, market=None):NEWLINE timestamp = ticker['date'] * 1000NEWLINE symbol = market['symbol'] if (market is not None) else NoneNEWLINE last = self.safe_float(ticker, 'last')NEWLINE return {NEWLINE 'symbol': symbol,NEWLINE 'timestamp': timestamp,NEWLINE 'datetime': self.iso8601(timestamp),NEWLINE 'high': self.safe_float(ticker, 'high'),NEWLINE 'low': self.safe_float(ticker, 'low'),NEWLINE 'bid': self.safe_float(ticker, 'buy'),NEWLINE 'bidVolume': None,NEWLINE 'ask': self.safe_float(ticker, 'sell'),NEWLINE 'askVolume': None,NEWLINE 'vwap': None,NEWLINE 'open': None,NEWLINE 'close': last,NEWLINE 'last': last,NEWLINE 'previousClose': None,NEWLINE 'change': None,NEWLINE 'percentage': None,NEWLINE 'average': None,NEWLINE 'baseVolume': self.safe_float(ticker, 'vol'),NEWLINE 'quoteVolume': None,NEWLINE 'info': ticker,NEWLINE }NEWLINENEWLINE async def fetch_ticker(self, symbol, params={}):NEWLINE await self.load_markets()NEWLINE market = self.market(symbol)NEWLINE request = {NEWLINE 'PAR': market['id'],NEWLINE }NEWLINE ticker = await self.publicGetPARTicker(self.extend(request, params))NEWLINE return self.parse_ticker(ticker, market)NEWLINENEWLINE async def fetch_order_book(self, symbol, limit=None, params={}):NEWLINE await self.load_markets()NEWLINE request = {NEWLINE 'PAR': self.market_id(symbol),NEWLINE }NEWLINE response = await self.publicGetPAROrderbook(self.extend(request, params))NEWLINE return self.parse_order_book(response, None, 'bid', 'ask', 'price', 'quantity')NEWLINENEWLINE def parse_trade(self, trade, market=None):NEWLINE timestamp = trade['date'] * 1000NEWLINE price = self.safe_float(trade, 'price')NEWLINE amount = self.safe_float(trade, 'amount')NEWLINE cost = NoneNEWLINE if price is not None:NEWLINE if amount is not None:NEWLINE cost = price * amountNEWLINE symbol = NoneNEWLINE if market is not None:NEWLINE symbol = market['symbol']NEWLINE id = self.safe_string(trade, 'tid')NEWLINE type = 'limit'NEWLINE side = self.safe_string_lower(trade, 'type')NEWLINE return {NEWLINE 'timestamp': timestamp,NEWLINE 'datetime': self.iso8601(timestamp),NEWLINE 'symbol': symbol,NEWLINE 'id': id,NEWLINE 'order': None,NEWLINE 'type': type,NEWLINE 'side': side,NEWLINE 'price': price,NEWLINE 'amount': amount,NEWLINE 'cost': cost,NEWLINE 'fee': None,NEWLINE 'info': trade,NEWLINE }NEWLINENEWLINE async def fetch_trades(self, symbol, since=None, limit=None, params={}):NEWLINE await self.load_markets()NEWLINE market = self.market(symbol)NEWLINE if since is None:NEWLINE since = 0NEWLINE request = {NEWLINE 'PAR': market['id'],NEWLINE 'timestamp_inicial': int(since / 1000),NEWLINE }NEWLINE response = await self.publicGetPARTradesTimestampInicial(self.extend(request, params))NEWLINE return self.parse_trades(response, market, since, limit)NEWLINENEWLINE async def fetch_balance(self, params={}):NEWLINE await self.load_markets()NEWLINE response = await self.privateGetUserBalance(params)NEWLINE #NEWLINE # {NEWLINE # "coins": [NEWLINE # {"name":"BRL","available":0.0,"openOrders":0.0,"withdraw":0.0,"total":0.0},NEWLINE # {"name":"BTC","available":0.0,"openOrders":0.0,"withdraw":0.0,"total":0.0},NEWLINE # ],NEWLINE # }NEWLINE #NEWLINE result = {'info': response}NEWLINE balances = self.safe_value(response, 'coins')NEWLINE for i in range(0, len(balances)):NEWLINE balance = balances[i]NEWLINE currencyId = self.safe_string(balance, 'name')NEWLINE code = self.safe_currency_code(currencyId)NEWLINE openOrders = self.safe_float(balance, 'openOrders')NEWLINE withdraw = self.safe_float(balance, 'withdraw')NEWLINE account = {NEWLINE 'free': self.safe_float(balance, 'total'),NEWLINE 'used': self.sum(openOrders, withdraw),NEWLINE 'total': self.safe_float(balance, 'available'),NEWLINE }NEWLINE result[code] = accountNEWLINE return self.parse_balance(result)NEWLINENEWLINE def parse_order_status(self, status):NEWLINE statuses = {NEWLINE 'filled': 'closed',NEWLINE 'cancelled': 'canceled',NEWLINE 'partially filled': 'open',NEWLINE 'pending': 'open',NEWLINE 'rejected': 'rejected',NEWLINE }NEWLINE return self.safe_string(statuses, status, status)NEWLINENEWLINE def parse_order(self, order, market=None):NEWLINE symbol = NoneNEWLINE if market is None:NEWLINE marketId = self.safe_string(order, 'pair')NEWLINE market = self.safe_value(self.marketsById, marketId)NEWLINE if market:NEWLINE symbol = market['symbol']NEWLINE timestamp = self.parse8601(self.safe_string(order, 'created'))NEWLINE price = self.safe_float(order, 'price')NEWLINE amount = self.safe_float(order, 'quantity')NEWLINE cost = self.safe_float(order, 'total')NEWLINE remaining = self.safe_float(order, 'pending_quantity')NEWLINE filled = self.safe_float(order, 'executed_quantity')NEWLINE status = self.parse_order_status(self.safe_string(order, 'status'))NEWLINE trades = NoneNEWLINE # if order['operations']:NEWLINE # trades = self.parse_trades(order['operations'])NEWLINE return {NEWLINE 'id': str(order['id']),NEWLINE 'datetime': self.iso8601(timestamp),NEWLINE 'timestamp': timestamp,NEWLINE 'lastTradeTimestamp': None,NEWLINE 'status': status,NEWLINE 'symbol': symbol,NEWLINE 'type': 'limit',NEWLINE 'side': order['type'],NEWLINE 'price': price,NEWLINE 'cost': cost,NEWLINE 'amount': amount,NEWLINE 'filled': filled,NEWLINE 'remaining': remaining,NEWLINE 'trades': trades,NEWLINE 'fee': {NEWLINE 'currency': market['quote'],NEWLINE 'cost': self.safe_float(order, 'fee'),NEWLINE },NEWLINE 'info': order,NEWLINE }NEWLINENEWLINE async def create_order(self, symbol, type, side, amount, price=None, params={}):NEWLINE await self.load_markets()NEWLINE market = self.market(symbol)NEWLINE request = {NEWLINE 'pair': market['id'],NEWLINE 'price': self.price_to_precision(symbol, price),NEWLINE 'volume': self.amount_to_precision(symbol, amount),NEWLINE 'type': side,NEWLINE }NEWLINE response = await self.privatePostUserOrder(self.extend(request, params))NEWLINE order = self.parse_order(response[0], market)NEWLINE id = order['id']NEWLINE self.orders[id] = orderNEWLINE return orderNEWLINENEWLINE async def cancel_order(self, id, symbol=None, params={}):NEWLINE await self.load_markets()NEWLINE market = self.markets[symbol]NEWLINE request = {NEWLINE 'orderId': id,NEWLINE }NEWLINE response = await self.privateDeleteUserOrderOrderId(self.extend(request, params))NEWLINE return self.parse_order(response[0], market)NEWLINENEWLINE async def fetch_order(self, id, symbol=None, params={}):NEWLINE await self.load_markets()NEWLINE request = {NEWLINE 'orderId': id,NEWLINE }NEWLINE order = await self.privateGetUserOrderOrderId(self.extend(request, params))NEWLINE return self.parse_order(order[0])NEWLINENEWLINE async def fetch_orders(self, symbol=None, since=None, limit=None, params={}):NEWLINE await self.load_markets()NEWLINE if symbol is None:NEWLINE raise ArgumentsRequired(self.id + ' fetchOrders() requires a symbol argument')NEWLINE market = self.market(symbol)NEWLINE request = {NEWLINE 'pair': market['id'],NEWLINE # type: buy, sellNEWLINE # status: cancelled, filled, partially filled, pending, rejectedNEWLINE # startIdNEWLINE # endIdNEWLINE # startDate yyyy-MM-ddNEWLINE # endDate: yyyy-MM-ddNEWLINE }NEWLINE if since is not None:NEWLINE request['startDate'] = self.ymd(since)NEWLINE if limit is not None:NEWLINE request['pageSize'] = limitNEWLINE orders = await self.privatePostUserOrders(self.extend(request, params))NEWLINE return self.parse_orders(orders, market)NEWLINENEWLINE async def fetch_open_orders(self, symbol=None, since=None, limit=None, params={}):NEWLINE request = {NEWLINE 'status': 'pending',NEWLINE }NEWLINE return await self.fetch_orders(symbol, since, limit, self.extend(request, params))NEWLINENEWLINE async def fetch_closed_orders(self, symbol=None, since=None, limit=None, params={}):NEWLINE request = {NEWLINE 'status': 'filled',NEWLINE }NEWLINE return await self.fetch_orders(symbol, since, limit, self.extend(request, params))NEWLINENEWLINE def nonce(self):NEWLINE return self.milliseconds()NEWLINENEWLINE def sign(self, path, api='public', method='GET', params={}, headers=None, body=None):NEWLINE url = self.urls['api'][api] + '/' + self.implode_params(path, params)NEWLINE query = self.omit(params, self.extract_params(path))NEWLINE queryString = self.urlencode(query)NEWLINE if api == 'public':NEWLINE if len(queryString):NEWLINE url += '?' + queryStringNEWLINE else:NEWLINE self.check_required_credentials()NEWLINE timestamp = str(self.seconds())NEWLINE nonce = str(self.nonce())NEWLINE content = ''NEWLINE if len(queryString):NEWLINE body = self.json(query)NEWLINE content = self.hash(self.encode(body), 'md5', 'base64')NEWLINE else:NEWLINE body = ''NEWLINE uri = self.encode_uri_component(url).lower()NEWLINE payload = ''.join([self.apiKey, method, uri, timestamp, nonce, content])NEWLINE secret = base64.b64decode(self.secret)NEWLINE signature = self.hmac(self.encode(payload), secret, hashlib.sha256, 'base64')NEWLINE signature = self.decode(signature)NEWLINE auth = ':'.join([self.apiKey, signature, nonce, timestamp])NEWLINE headers = {NEWLINE 'Authorization': 'amx ' + auth,NEWLINE }NEWLINE if method == 'POST':NEWLINE headers['Content-Type'] = 'application/json; charset=UTF-8'NEWLINE headers['Content-Length'] = len(body)NEWLINE elif len(queryString):NEWLINE url += '?' + queryStringNEWLINE body = NoneNEWLINE return {'url': url, 'method': method, 'body': body, 'headers': headers}NEWLINE |
# import numpyNEWLINEimport numpy as npNEWLINENEWLINE# importing qiskitNEWLINEimport qiskitNEWLINEfrom qiskit import QuantumCircuit, ClassicalRegister, QuantumRegisterNEWLINEfrom qiskit.compiler import schedule, transpileNEWLINENEWLINEfrom qiskit.test.mock.backends.almaden import FakeAlmadenNEWLINEbackend = FakeAlmaden()NEWLINENEWLINEfrom qiskit.pulse.instructions.play import PlayNEWLINENEWLINE# importing audio utilsNEWLINEfrom scipy.io.wavfile import writeNEWLINENEWLINE# CONSTANTSNEWLINEsampling_rate = 44100 * 3NEWLINENEWLINEdef test_qiskit(): return qiskit.__qiskit_version__NEWLINENEWLINEdef char_to_qc(char_str):NEWLINE char_bin = '0'+' '.join(format(ord(x), 'b') for x in char_str)NEWLINENEWLINE char = QuantumRegister(8, name='char')NEWLINE output = QuantumRegister(1, name='output')NEWLINE meas = ClassicalRegister(8, name='meas')NEWLINE char_qc = QuantumCircuit(char, output, meas)NEWLINENEWLINE char_qc.h(char[:])NEWLINE char_qc.h(output)NEWLINE char_qc.z(output)NEWLINE char_qc.barrier()NEWLINENEWLINE for i, bit in enumerate(char_bin):NEWLINE if int(bit): char_qc.cx(char[i], output[0])NEWLINE char_qc.barrier()NEWLINENEWLINE char_qc.h(char[:])NEWLINE char_qc.barrier()NEWLINENEWLINE return char_qc.reverse_bits()NEWLINENEWLINEdef pulse_schedule_to_complex_waveform(pulse_schedule):NEWLINE instructions = pulse_schedule.instructionsNEWLINE waveform = [instruction[1].pulse.samples for instruction in instructions if type(instruction[1]) == Play]NEWLINE waveform = np.concatenate(waveform).ravel()NEWLINE return waveformNEWLINENEWLINEdef complex_waveform_to_amplitude_waveform(waveform): return np.asarray([np.absolute(z) for z in waveform])NEWLINENEWLINEdef get_audio_waveform(string):NEWLINE words = string.split(" ")NEWLINE audio_waveform = np.array([])NEWLINE for word in words:NEWLINE word_waveforms = [ pulse_schedule_to_complex_waveform(schedule(transpile(char_to_qc(char), backend), backend)) for char in word ]NEWLINE waveform_size = max([waveform.size for waveform in word_waveforms])NEWLINE word_waveform = np.zeros(waveform_size)NEWLINE for waveform in word_waveforms: NEWLINE word_waveform = word_waveform + np.pad(waveform, (0, waveform_size - waveform.size), mode='constant')NEWLINE audio_waveform = np.concatenate((audio_waveform, complex_waveform_to_amplitude_waveform(waveform)))NEWLINE return audio_waveformNEWLINENEWLINEdef generate_wav(string):NEWLINE data = get_audio_waveform(string)NEWLINE scaled = np.int16(data/np.max(np.abs(data)) * 32767)NEWLINE write('/tmp/output.wav', sampling_rate, scaled) |
# Author: Steven J. Bethard <steven.bethard@gmail.com>.NEWLINENEWLINE"""Command-line parsing libraryNEWLINENEWLINEThis module is an optparse-inspired command-line parsing library that:NEWLINENEWLINE - handles both optional and positional argumentsNEWLINE - produces highly informative usage messagesNEWLINE - supports parsers that dispatch to sub-parsersNEWLINENEWLINEThe following is a simple usage example that sums integers from theNEWLINEcommand-line and writes the result to a file::NEWLINENEWLINE parser = argparse.ArgumentParser(NEWLINE description='sum the integers at the command line')NEWLINE parser.add_argument(NEWLINE 'integers', metavar='int', nargs='+', type=int,NEWLINE help='an integer to be summed')NEWLINE parser.add_argument(NEWLINE '--log', default=sys.stdout, type=argparse.FileType('w'),NEWLINE help='the file where the sum should be written')NEWLINE args = parser.parse_args()NEWLINE args.log.write('%s' % sum(args.integers))NEWLINE args.log.close()NEWLINENEWLINEThe module contains the following public classes:NEWLINENEWLINE - ArgumentParser -- The main entry point for command-line parsing. As theNEWLINE example above shows, the add_argument() method is used to populateNEWLINE the parser with actions for optional and positional arguments. ThenNEWLINE the parse_args() method is invoked to convert the args at theNEWLINE command-line into an object with attributes.NEWLINENEWLINE - ArgumentError -- The exception raised by ArgumentParser objects whenNEWLINE there are errors with the parser's actions. Errors raised whileNEWLINE parsing the command-line are caught by ArgumentParser and emittedNEWLINE as command-line messages.NEWLINENEWLINE - FileType -- A factory for defining types of files to be created. As theNEWLINE example above shows, instances of FileType are typically passed asNEWLINE the type= argument of add_argument() calls.NEWLINENEWLINE - Action -- The base class for parser actions. Typically actions areNEWLINE selected by passing strings like 'store_true' or 'append_const' toNEWLINE the action= argument of add_argument(). However, for greaterNEWLINE customization of ArgumentParser actions, subclasses of Action mayNEWLINE be defined and passed as the action= argument.NEWLINENEWLINE - HelpFormatter, RawDescriptionHelpFormatter, RawTextHelpFormatter,NEWLINE ArgumentDefaultsHelpFormatter -- Formatter classes whichNEWLINE may be passed as the formatter_class= argument to theNEWLINE ArgumentParser constructor. HelpFormatter is the default,NEWLINE RawDescriptionHelpFormatter and RawTextHelpFormatter tell the parserNEWLINE not to change the formatting for help text, andNEWLINE ArgumentDefaultsHelpFormatter adds information about argument defaultsNEWLINE to the help.NEWLINENEWLINEAll other classes in this module are considered implementation details.NEWLINE(Also note that HelpFormatter and RawDescriptionHelpFormatter are onlyNEWLINEconsidered public as object names -- the API of the formatter objects isNEWLINEstill considered an implementation detail.)NEWLINE"""NEWLINENEWLINE__version__ = '1.1'NEWLINE__all__ = [NEWLINE 'ArgumentParser',NEWLINE 'ArgumentError',NEWLINE 'ArgumentTypeError',NEWLINE 'FileType',NEWLINE 'HelpFormatter',NEWLINE 'ArgumentDefaultsHelpFormatter',NEWLINE 'RawDescriptionHelpFormatter',NEWLINE 'RawTextHelpFormatter',NEWLINE 'Namespace',NEWLINE 'Action',NEWLINE 'ONE_OR_MORE',NEWLINE 'OPTIONAL',NEWLINE 'PARSER',NEWLINE 'REMAINDER',NEWLINE 'SUPPRESS',NEWLINE 'ZERO_OR_MORE',NEWLINE]NEWLINENEWLINENEWLINEimport collections as _collectionsNEWLINEimport copy as _copyNEWLINEimport os as _osNEWLINEimport re as _reNEWLINEimport sys as _sysNEWLINEimport textwrap as _textwrapNEWLINENEWLINEfrom gettext import gettext as _NEWLINENEWLINENEWLINEdef _callable(obj):NEWLINE return hasattr(obj, '__call__') or hasattr(obj, '__bases__')NEWLINENEWLINENEWLINESUPPRESS = '==SUPPRESS=='NEWLINENEWLINEOPTIONAL = '?'NEWLINEZERO_OR_MORE = '*'NEWLINEONE_OR_MORE = '+'NEWLINEPARSER = 'A...'NEWLINEREMAINDER = '...'NEWLINE_UNRECOGNIZED_ARGS_ATTR = '_unrecognized_args'NEWLINENEWLINE# =============================NEWLINE# Utility functions and classesNEWLINE# =============================NEWLINENEWLINEclass _AttributeHolder(object):NEWLINE """Abstract base class that provides __repr__.NEWLINENEWLINE The __repr__ method returns a string in the format::NEWLINE ClassName(attr=name, attr=name, ...)NEWLINE The attributes are determined either by a class-level attribute,NEWLINE '_kwarg_names', or by inspecting the instance __dict__.NEWLINE """NEWLINENEWLINE def __repr__(self):NEWLINE type_name = type(self).__name__NEWLINE arg_strings = []NEWLINE for arg in self._get_args():NEWLINE arg_strings.append(repr(arg))NEWLINE for name, value in self._get_kwargs():NEWLINE arg_strings.append('%s=%r' % (name, value))NEWLINE return '%s(%s)' % (type_name, ', '.join(arg_strings))NEWLINENEWLINE def _get_kwargs(self):NEWLINE return sorted(self.__dict__.items())NEWLINENEWLINE def _get_args(self):NEWLINE return []NEWLINENEWLINENEWLINEdef _ensure_value(namespace, name, value):NEWLINE if getattr(namespace, name, None) is None:NEWLINE setattr(namespace, name, value)NEWLINE return getattr(namespace, name)NEWLINENEWLINENEWLINE# ===============NEWLINE# Formatting HelpNEWLINE# ===============NEWLINENEWLINEclass HelpFormatter(object):NEWLINE """Formatter for generating usage messages and argument help strings.NEWLINENEWLINE Only the name of this class is considered a public API. All the methodsNEWLINE provided by the class are considered an implementation detail.NEWLINE """NEWLINENEWLINE def __init__(self,NEWLINE prog,NEWLINE indent_increment=2,NEWLINE max_help_position=24,NEWLINE width=None):NEWLINENEWLINE # default setting for widthNEWLINE if width is None:NEWLINE try:NEWLINE width = int(_os.environ['COLUMNS'])NEWLINE except (KeyError, ValueError):NEWLINE width = 80NEWLINE width -= 2NEWLINENEWLINE self._prog = progNEWLINE self._indent_increment = indent_incrementNEWLINE self._max_help_position = max_help_positionNEWLINE self._max_help_position = min(max_help_position,NEWLINE max(width - 20, indent_increment * 2))NEWLINE self._width = widthNEWLINENEWLINE self._current_indent = 0NEWLINE self._level = 0NEWLINE self._action_max_length = 0NEWLINENEWLINE self._root_section = self._Section(self, None)NEWLINE self._current_section = self._root_sectionNEWLINENEWLINE self._whitespace_matcher = _re.compile(r'\s+')NEWLINE self._long_break_matcher = _re.compile(r'\n\n\n+')NEWLINENEWLINE # ===============================NEWLINE # Section and indentation methodsNEWLINE # ===============================NEWLINE def _indent(self):NEWLINE self._current_indent += self._indent_incrementNEWLINE self._level += 1NEWLINENEWLINE def _dedent(self):NEWLINE self._current_indent -= self._indent_incrementNEWLINE assert self._current_indent >= 0, 'Indent decreased below 0.'NEWLINE self._level -= 1NEWLINENEWLINE class _Section(object):NEWLINENEWLINE def __init__(self, formatter, parent, heading=None):NEWLINE self.formatter = formatterNEWLINE self.parent = parentNEWLINE self.heading = headingNEWLINE self.items = []NEWLINENEWLINE def format_help(self):NEWLINE # format the indented sectionNEWLINE if self.parent is not None:NEWLINE self.formatter._indent()NEWLINE join = self.formatter._join_partsNEWLINE for func, args in self.items:NEWLINE func(*args)NEWLINE item_help = join([func(*args) for func, args in self.items])NEWLINE if self.parent is not None:NEWLINE self.formatter._dedent()NEWLINENEWLINE # return nothing if the section was emptyNEWLINE if not item_help:NEWLINE return ''NEWLINENEWLINE # add the heading if the section was non-emptyNEWLINE if self.heading is not SUPPRESS and self.heading is not None:NEWLINE current_indent = self.formatter._current_indentNEWLINE heading = '%*s%s:\n' % (current_indent, '', self.heading)NEWLINE else:NEWLINE heading = ''NEWLINENEWLINE # join the section-initial newline, the heading and the helpNEWLINE return join(['\n', heading, item_help, '\n'])NEWLINENEWLINE def _add_item(self, func, args):NEWLINE self._current_section.items.append((func, args))NEWLINENEWLINE # ========================NEWLINE # Message building methodsNEWLINE # ========================NEWLINE def start_section(self, heading):NEWLINE self._indent()NEWLINE section = self._Section(self, self._current_section, heading)NEWLINE self._add_item(section.format_help, [])NEWLINE self._current_section = sectionNEWLINENEWLINE def end_section(self):NEWLINE self._current_section = self._current_section.parentNEWLINE self._dedent()NEWLINENEWLINE def add_text(self, text):NEWLINE if text is not SUPPRESS and text is not None:NEWLINE self._add_item(self._format_text, [text])NEWLINENEWLINE def add_usage(self, usage, actions, groups, prefix=None):NEWLINE if usage is not SUPPRESS:NEWLINE args = usage, actions, groups, prefixNEWLINE self._add_item(self._format_usage, args)NEWLINENEWLINE def add_argument(self, action):NEWLINE if action.help is not SUPPRESS:NEWLINENEWLINE # find all invocationsNEWLINE get_invocation = self._format_action_invocationNEWLINE invocations = [get_invocation(action)]NEWLINE for subaction in self._iter_indented_subactions(action):NEWLINE invocations.append(get_invocation(subaction))NEWLINENEWLINE # update the maximum item lengthNEWLINE invocation_length = max([len(s) for s in invocations])NEWLINE action_length = invocation_length + self._current_indentNEWLINE self._action_max_length = max(self._action_max_length,NEWLINE action_length)NEWLINENEWLINE # add the item to the listNEWLINE self._add_item(self._format_action, [action])NEWLINENEWLINE def add_arguments(self, actions):NEWLINE for action in actions:NEWLINE self.add_argument(action)NEWLINENEWLINE # =======================NEWLINE # Help-formatting methodsNEWLINE # =======================NEWLINE def format_help(self):NEWLINE help = self._root_section.format_help()NEWLINE if help:NEWLINE help = self._long_break_matcher.sub('\n\n', help)NEWLINE help = help.strip('\n') + '\n'NEWLINE return helpNEWLINENEWLINE def _join_parts(self, part_strings):NEWLINE return ''.join([partNEWLINE for part in part_stringsNEWLINE if part and part is not SUPPRESS])NEWLINENEWLINE def _format_usage(self, usage, actions, groups, prefix):NEWLINE if prefix is None:NEWLINE prefix = _('usage: ')NEWLINENEWLINE # if usage is specified, use thatNEWLINE if usage is not None:NEWLINE usage = usage % dict(prog=self._prog)NEWLINENEWLINE # if no optionals or positionals are available, usage is just progNEWLINE elif usage is None and not actions:NEWLINE usage = '%(prog)s' % dict(prog=self._prog)NEWLINENEWLINE # if optionals and positionals are available, calculate usageNEWLINE elif usage is None:NEWLINE prog = '%(prog)s' % dict(prog=self._prog)NEWLINENEWLINE # split optionals from positionalsNEWLINE optionals = []NEWLINE positionals = []NEWLINE for action in actions:NEWLINE if action.option_strings:NEWLINE optionals.append(action)NEWLINE else:NEWLINE positionals.append(action)NEWLINENEWLINE # build full usage stringNEWLINE format = self._format_actions_usageNEWLINE action_usage = format(optionals + positionals, groups)NEWLINE usage = ' '.join([s for s in [prog, action_usage] if s])NEWLINENEWLINE # wrap the usage parts if it's too longNEWLINE text_width = self._width - self._current_indentNEWLINE if len(prefix) + len(usage) > text_width:NEWLINENEWLINE # break usage into wrappable partsNEWLINE part_regexp = (NEWLINE r'\(.*?\)+(?=\s|$)|'NEWLINE r'\[.*?\]+(?=\s|$)|'NEWLINE r'\S+'NEWLINE )NEWLINE opt_usage = format(optionals, groups)NEWLINE pos_usage = format(positionals, groups)NEWLINE opt_parts = _re.findall(part_regexp, opt_usage)NEWLINE pos_parts = _re.findall(part_regexp, pos_usage)NEWLINE assert ' '.join(opt_parts) == opt_usageNEWLINE assert ' '.join(pos_parts) == pos_usageNEWLINENEWLINE # helper for wrapping linesNEWLINE def get_lines(parts, indent, prefix=None):NEWLINE lines = []NEWLINE line = []NEWLINE if prefix is not None:NEWLINE line_len = len(prefix) - 1NEWLINE else:NEWLINE line_len = len(indent) - 1NEWLINE for part in parts:NEWLINE if line_len + 1 + len(part) > text_width and line:NEWLINE lines.append(indent + ' '.join(line))NEWLINE line = []NEWLINE line_len = len(indent) - 1NEWLINE line.append(part)NEWLINE line_len += len(part) + 1NEWLINE if line:NEWLINE lines.append(indent + ' '.join(line))NEWLINE if prefix is not None:NEWLINE lines[0] = lines[0][len(indent):]NEWLINE return linesNEWLINENEWLINE # if prog is short, follow it with optionals or positionalsNEWLINE if len(prefix) + len(prog) <= 0.75 * text_width:NEWLINE indent = ' ' * (len(prefix) + len(prog) + 1)NEWLINE if opt_parts:NEWLINE lines = get_lines([prog] + opt_parts, indent, prefix)NEWLINE lines.extend(get_lines(pos_parts, indent))NEWLINE elif pos_parts:NEWLINE lines = get_lines([prog] + pos_parts, indent, prefix)NEWLINE else:NEWLINE lines = [prog]NEWLINENEWLINE # if prog is long, put it on its own lineNEWLINE else:NEWLINE indent = ' ' * len(prefix)NEWLINE parts = opt_parts + pos_partsNEWLINE lines = get_lines(parts, indent)NEWLINE if len(lines) > 1:NEWLINE lines = []NEWLINE lines.extend(get_lines(opt_parts, indent))NEWLINE lines.extend(get_lines(pos_parts, indent))NEWLINE lines = [prog] + linesNEWLINENEWLINE # join lines into usageNEWLINE usage = '\n'.join(lines)NEWLINENEWLINE # prefix with 'usage:'NEWLINE return '%s%s\n\n' % (prefix, usage)NEWLINENEWLINE def _format_actions_usage(self, actions, groups):NEWLINE # find group indices and identify actions in groupsNEWLINE group_actions = set()NEWLINE inserts = {}NEWLINE for group in groups:NEWLINE try:NEWLINE start = actions.index(group._group_actions[0])NEWLINE except ValueError:NEWLINE continueNEWLINE else:NEWLINE end = start + len(group._group_actions)NEWLINE if actions[start:end] == group._group_actions:NEWLINE for action in group._group_actions:NEWLINE group_actions.add(action)NEWLINE if not group.required:NEWLINE if start in inserts:NEWLINE inserts[start] += ' ['NEWLINE else:NEWLINE inserts[start] = '['NEWLINE inserts[end] = ']'NEWLINE else:NEWLINE if start in inserts:NEWLINE inserts[start] += ' ('NEWLINE else:NEWLINE inserts[start] = '('NEWLINE inserts[end] = ')'NEWLINE for i in range(start + 1, end):NEWLINE inserts[i] = '|'NEWLINENEWLINE # collect all actions format stringsNEWLINE parts = []NEWLINE for i, action in enumerate(actions):NEWLINENEWLINE # suppressed arguments are marked with NoneNEWLINE # remove | separators for suppressed argumentsNEWLINE if action.help is SUPPRESS:NEWLINE parts.append(None)NEWLINE if inserts.get(i) == '|':NEWLINE inserts.pop(i)NEWLINE elif inserts.get(i + 1) == '|':NEWLINE inserts.pop(i + 1)NEWLINENEWLINE # produce all arg stringsNEWLINE elif not action.option_strings:NEWLINE part = self._format_args(action, action.dest)NEWLINENEWLINE # if it's in a group, strip the outer []NEWLINE if action in group_actions:NEWLINE if part[0] == '[' and part[-1] == ']':NEWLINE part = part[1:-1]NEWLINENEWLINE # add the action string to the listNEWLINE parts.append(part)NEWLINENEWLINE # produce the first way to invoke the option in bracketsNEWLINE else:NEWLINE option_string = action.option_strings[0]NEWLINENEWLINE # if the Optional doesn't take a value, format is:NEWLINE # -s or --longNEWLINE if action.nargs == 0:NEWLINE part = '%s' % option_stringNEWLINENEWLINE # if the Optional takes a value, format is:NEWLINE # -s ARGS or --long ARGSNEWLINE else:NEWLINE default = action.dest.upper()NEWLINE args_string = self._format_args(action, default)NEWLINE part = '%s %s' % (option_string, args_string)NEWLINENEWLINE # make it look optional if it's not required or in a groupNEWLINE if not action.required and action not in group_actions:NEWLINE part = '[%s]' % partNEWLINENEWLINE # add the action string to the listNEWLINE parts.append(part)NEWLINENEWLINE # insert things at the necessary indicesNEWLINE for i in sorted(inserts, reverse=True):NEWLINE parts[i:i] = [inserts[i]]NEWLINENEWLINE # join all the action items with spacesNEWLINE text = ' '.join([item for item in parts if item is not None])NEWLINENEWLINE # clean up separators for mutually exclusive groupsNEWLINE open = r'[\[(]'NEWLINE close = r'[\])]'NEWLINE text = _re.sub(r'(%s) ' % open, r'\1', text)NEWLINE text = _re.sub(r' (%s)' % close, r'\1', text)NEWLINE text = _re.sub(r'%s *%s' % (open, close), r'', text)NEWLINE text = _re.sub(r'\(([^|]*)\)', r'\1', text)NEWLINE text = text.strip()NEWLINENEWLINE # return the textNEWLINE return textNEWLINENEWLINE def _format_text(self, text):NEWLINE if '%(prog)' in text:NEWLINE text = text % dict(prog=self._prog)NEWLINE text_width = max(self._width - self._current_indent, 11)NEWLINE indent = ' ' * self._current_indentNEWLINE return self._fill_text(text, text_width, indent) + '\n\n'NEWLINENEWLINE def _format_action(self, action):NEWLINE # determine the required width and the entry labelNEWLINE help_position = min(self._action_max_length + 2,NEWLINE self._max_help_position)NEWLINE help_width = max(self._width - help_position, 11)NEWLINE action_width = help_position - self._current_indent - 2NEWLINE action_header = self._format_action_invocation(action)NEWLINENEWLINE # ho nelp; start on same line and add a final newlineNEWLINE if not action.help:NEWLINE tup = self._current_indent, '', action_headerNEWLINE action_header = '%*s%s\n' % tupNEWLINENEWLINE # short action name; start on the same line and pad two spacesNEWLINE elif len(action_header) <= action_width:NEWLINE tup = self._current_indent, '', action_width, action_headerNEWLINE action_header = '%*s%-*s ' % tupNEWLINE indent_first = 0NEWLINENEWLINE # long action name; start on the next lineNEWLINE else:NEWLINE tup = self._current_indent, '', action_headerNEWLINE action_header = '%*s%s\n' % tupNEWLINE indent_first = help_positionNEWLINENEWLINE # collect the pieces of the action helpNEWLINE parts = [action_header]NEWLINENEWLINE # if there was help for the action, add lines of help textNEWLINE if action.help:NEWLINE help_text = self._expand_help(action)NEWLINE help_lines = self._split_lines(help_text, help_width)NEWLINE parts.append('%*s%s\n' % (indent_first, '', help_lines[0]))NEWLINE for line in help_lines[1:]:NEWLINE parts.append('%*s%s\n' % (help_position, '', line))NEWLINENEWLINE # or add a newline if the description doesn't end with oneNEWLINE elif not action_header.endswith('\n'):NEWLINE parts.append('\n')NEWLINENEWLINE # if there are any sub-actions, add their help as wellNEWLINE for subaction in self._iter_indented_subactions(action):NEWLINE parts.append(self._format_action(subaction))NEWLINENEWLINE # return a single stringNEWLINE return self._join_parts(parts)NEWLINENEWLINE def _format_action_invocation(self, action):NEWLINE if not action.option_strings:NEWLINE metavar, = self._metavar_formatter(action, action.dest)(1)NEWLINE return metavarNEWLINENEWLINE else:NEWLINE parts = []NEWLINENEWLINE # if the Optional doesn't take a value, format is:NEWLINE # -s, --longNEWLINE if action.nargs == 0:NEWLINE parts.extend(action.option_strings)NEWLINENEWLINE # if the Optional takes a value, format is:NEWLINE # -s ARGS, --long ARGSNEWLINE else:NEWLINE default = action.dest.upper()NEWLINE args_string = self._format_args(action, default)NEWLINE for option_string in action.option_strings:NEWLINE parts.append('%s %s' % (option_string, args_string))NEWLINENEWLINE return ', '.join(parts)NEWLINENEWLINE def _metavar_formatter(self, action, default_metavar):NEWLINE if action.metavar is not None:NEWLINE result = action.metavarNEWLINE elif action.choices is not None:NEWLINE choice_strs = [str(choice) for choice in action.choices]NEWLINE result = '{%s}' % ','.join(choice_strs)NEWLINE else:NEWLINE result = default_metavarNEWLINENEWLINE def format(tuple_size):NEWLINE if isinstance(result, tuple):NEWLINE return resultNEWLINE else:NEWLINE return (result, ) * tuple_sizeNEWLINE return formatNEWLINENEWLINE def _format_args(self, action, default_metavar):NEWLINE get_metavar = self._metavar_formatter(action, default_metavar)NEWLINE if action.nargs is None:NEWLINE result = '%s' % get_metavar(1)NEWLINE elif action.nargs == OPTIONAL:NEWLINE result = '[%s]' % get_metavar(1)NEWLINE elif action.nargs == ZERO_OR_MORE:NEWLINE result = '[%s [%s ...]]' % get_metavar(2)NEWLINE elif action.nargs == ONE_OR_MORE:NEWLINE result = '%s [%s ...]' % get_metavar(2)NEWLINE elif action.nargs == REMAINDER:NEWLINE result = '...'NEWLINE elif action.nargs == PARSER:NEWLINE result = '%s ...' % get_metavar(1)NEWLINE else:NEWLINE formats = ['%s' for _ in range(action.nargs)]NEWLINE result = ' '.join(formats) % get_metavar(action.nargs)NEWLINE return resultNEWLINENEWLINE def _expand_help(self, action):NEWLINE params = dict(vars(action), prog=self._prog)NEWLINE for name in list(params):NEWLINE if params[name] is SUPPRESS:NEWLINE del params[name]NEWLINE for name in list(params):NEWLINE if hasattr(params[name], '__name__'):NEWLINE params[name] = params[name].__name__NEWLINE if params.get('choices') is not None:NEWLINE choices_str = ', '.join([str(c) for c in params['choices']])NEWLINE params['choices'] = choices_strNEWLINE return self._get_help_string(action) % paramsNEWLINENEWLINE def _iter_indented_subactions(self, action):NEWLINE try:NEWLINE get_subactions = action._get_subactionsNEWLINE except AttributeError:NEWLINE passNEWLINE else:NEWLINE self._indent()NEWLINE for subaction in get_subactions():NEWLINE yield subactionNEWLINE self._dedent()NEWLINENEWLINE def _split_lines(self, text, width):NEWLINE text = self._whitespace_matcher.sub(' ', text).strip()NEWLINE return _textwrap.wrap(text, width)NEWLINENEWLINE def _fill_text(self, text, width, indent):NEWLINE text = self._whitespace_matcher.sub(' ', text).strip()NEWLINE return _textwrap.fill(text, width, initial_indent=indent,NEWLINE subsequent_indent=indent)NEWLINENEWLINE def _get_help_string(self, action):NEWLINE return action.helpNEWLINENEWLINENEWLINEclass RawDescriptionHelpFormatter(HelpFormatter):NEWLINE """Help message formatter which retains any formatting in descriptions.NEWLINENEWLINE Only the name of this class is considered a public API. All the methodsNEWLINE provided by the class are considered an implementation detail.NEWLINE """NEWLINENEWLINE def _fill_text(self, text, width, indent):NEWLINE return ''.join([indent + line for line in text.splitlines(True)])NEWLINENEWLINENEWLINEclass RawTextHelpFormatter(RawDescriptionHelpFormatter):NEWLINE """Help message formatter which retains formatting of all help text.NEWLINENEWLINE Only the name of this class is considered a public API. All the methodsNEWLINE provided by the class are considered an implementation detail.NEWLINE """NEWLINENEWLINE def _split_lines(self, text, width):NEWLINE return text.splitlines()NEWLINENEWLINENEWLINEclass ArgumentDefaultsHelpFormatter(HelpFormatter):NEWLINE """Help message formatter which adds default values to argument help.NEWLINENEWLINE Only the name of this class is considered a public API. All the methodsNEWLINE provided by the class are considered an implementation detail.NEWLINE """NEWLINENEWLINE def _get_help_string(self, action):NEWLINE help = action.helpNEWLINE if '%(default)' not in action.help:NEWLINE if action.default is not SUPPRESS:NEWLINE defaulting_nargs = [OPTIONAL, ZERO_OR_MORE]NEWLINE if action.option_strings or action.nargs in defaulting_nargs:NEWLINE help += ' (default: %(default)s)'NEWLINE return helpNEWLINENEWLINENEWLINE# =====================NEWLINE# Options and ArgumentsNEWLINE# =====================NEWLINENEWLINEdef _get_action_name(argument):NEWLINE if argument is None:NEWLINE return NoneNEWLINE elif argument.option_strings:NEWLINE return '/'.join(argument.option_strings)NEWLINE elif argument.metavar not in (None, SUPPRESS):NEWLINE return argument.metavarNEWLINE elif argument.dest not in (None, SUPPRESS):NEWLINE return argument.destNEWLINE else:NEWLINE return NoneNEWLINENEWLINENEWLINEclass ArgumentError(Exception):NEWLINE """An error from creating or using an argument (optional or positional).NEWLINENEWLINE The string value of this exception is the message, augmented withNEWLINE information about the argument that caused it.NEWLINE """NEWLINENEWLINE def __init__(self, argument, message):NEWLINE self.argument_name = _get_action_name(argument)NEWLINE self.message = messageNEWLINENEWLINE def __str__(self):NEWLINE if self.argument_name is None:NEWLINE format = '%(message)s'NEWLINE else:NEWLINE format = 'argument %(argument_name)s: %(message)s'NEWLINE return format % dict(message=self.message,NEWLINE argument_name=self.argument_name)NEWLINENEWLINENEWLINEclass ArgumentTypeError(Exception):NEWLINE """An error from trying to convert a command line string to a type."""NEWLINE passNEWLINENEWLINENEWLINE# ==============NEWLINE# Action classesNEWLINE# ==============NEWLINENEWLINEclass Action(_AttributeHolder):NEWLINE """Information about how to convert command line strings to Python objects.NEWLINENEWLINE Action objects are used by an ArgumentParser to represent the informationNEWLINE needed to parse a single argument from one or more strings from theNEWLINE command line. The keyword arguments to the Action constructor are alsoNEWLINE all attributes of Action instances.NEWLINENEWLINE Keyword Arguments:NEWLINENEWLINE - option_strings -- A list of command-line option strings whichNEWLINE should be associated with this action.NEWLINENEWLINE - dest -- The name of the attribute to hold the created object(s)NEWLINENEWLINE - nargs -- The number of command-line arguments that should beNEWLINE consumed. By default, one argument will be consumed and a singleNEWLINE value will be produced. Other values include:NEWLINE - N (an integer) consumes N arguments (and produces a list)NEWLINE - '?' consumes zero or one argumentsNEWLINE - '*' consumes zero or more arguments (and produces a list)NEWLINE - '+' consumes one or more arguments (and produces a list)NEWLINE Note that the difference between the default and nargs=1 is thatNEWLINE with the default, a single value will be produced, while withNEWLINE nargs=1, a list containing a single value will be produced.NEWLINENEWLINE - const -- The value to be produced if the option is specified and theNEWLINE option uses an action that takes no values.NEWLINENEWLINE - default -- The value to be produced if the option is not specified.NEWLINENEWLINE - type -- A callable that accepts a single string argument, andNEWLINE returns the converted value. The standard Python types str, int,NEWLINE float, and complex are useful examples of such callables. If None,NEWLINE str is used.NEWLINENEWLINE - choices -- A container of values that should be allowed. If not None,NEWLINE after a command-line argument has been converted to the appropriateNEWLINE type, an exception will be raised if it is not a member of thisNEWLINE collection.NEWLINENEWLINE - required -- True if the action must always be specified at theNEWLINE command line. This is only meaningful for optional command-lineNEWLINE arguments.NEWLINENEWLINE - help -- The help string describing the argument.NEWLINENEWLINE - metavar -- The name to be used for the option's argument with theNEWLINE help string. If None, the 'dest' value will be used as the name.NEWLINE """NEWLINENEWLINE def __init__(self,NEWLINE option_strings,NEWLINE dest,NEWLINE nargs=None,NEWLINE const=None,NEWLINE default=None,NEWLINE type=None,NEWLINE choices=None,NEWLINE required=False,NEWLINE help=None,NEWLINE metavar=None):NEWLINE self.option_strings = option_stringsNEWLINE self.dest = destNEWLINE self.nargs = nargsNEWLINE self.const = constNEWLINE self.default = defaultNEWLINE self.type = typeNEWLINE self.choices = choicesNEWLINE self.required = requiredNEWLINE self.help = helpNEWLINE self.metavar = metavarNEWLINENEWLINE def _get_kwargs(self):NEWLINE names = [NEWLINE 'option_strings',NEWLINE 'dest',NEWLINE 'nargs',NEWLINE 'const',NEWLINE 'default',NEWLINE 'type',NEWLINE 'choices',NEWLINE 'help',NEWLINE 'metavar',NEWLINE ]NEWLINE return [(name, getattr(self, name)) for name in names]NEWLINENEWLINE def __call__(self, parser, namespace, values, option_string=None):NEWLINE raise NotImplementedError(_('.__call__() not defined'))NEWLINENEWLINENEWLINEclass _StoreAction(Action):NEWLINENEWLINE def __init__(self,NEWLINE option_strings,NEWLINE dest,NEWLINE nargs=None,NEWLINE const=None,NEWLINE default=None,NEWLINE type=None,NEWLINE choices=None,NEWLINE required=False,NEWLINE help=None,NEWLINE metavar=None):NEWLINE if nargs == 0:NEWLINE raise ValueError('nargs for store actions must be > 0; if you 'NEWLINE 'have nothing to store, actions such as store 'NEWLINE 'true or store const may be more appropriate')NEWLINE if const is not None and nargs != OPTIONAL:NEWLINE raise ValueError('nargs must be %r to supply const' % OPTIONAL)NEWLINE super(_StoreAction, self).__init__(NEWLINE option_strings=option_strings,NEWLINE dest=dest,NEWLINE nargs=nargs,NEWLINE const=const,NEWLINE default=default,NEWLINE type=type,NEWLINE choices=choices,NEWLINE required=required,NEWLINE help=help,NEWLINE metavar=metavar)NEWLINENEWLINE def __call__(self, parser, namespace, values, option_string=None):NEWLINE setattr(namespace, self.dest, values)NEWLINENEWLINENEWLINEclass _StoreConstAction(Action):NEWLINENEWLINE def __init__(self,NEWLINE option_strings,NEWLINE dest,NEWLINE const,NEWLINE default=None,NEWLINE required=False,NEWLINE help=None,NEWLINE metavar=None):NEWLINE super(_StoreConstAction, self).__init__(NEWLINE option_strings=option_strings,NEWLINE dest=dest,NEWLINE nargs=0,NEWLINE const=const,NEWLINE default=default,NEWLINE required=required,NEWLINE help=help)NEWLINENEWLINE def __call__(self, parser, namespace, values, option_string=None):NEWLINE setattr(namespace, self.dest, self.const)NEWLINENEWLINENEWLINEclass _StoreTrueAction(_StoreConstAction):NEWLINENEWLINE def __init__(self,NEWLINE option_strings,NEWLINE dest,NEWLINE default=False,NEWLINE required=False,NEWLINE help=None):NEWLINE super(_StoreTrueAction, self).__init__(NEWLINE option_strings=option_strings,NEWLINE dest=dest,NEWLINE const=True,NEWLINE default=default,NEWLINE required=required,NEWLINE help=help)NEWLINENEWLINENEWLINEclass _StoreFalseAction(_StoreConstAction):NEWLINENEWLINE def __init__(self,NEWLINE option_strings,NEWLINE dest,NEWLINE default=True,NEWLINE required=False,NEWLINE help=None):NEWLINE super(_StoreFalseAction, self).__init__(NEWLINE option_strings=option_strings,NEWLINE dest=dest,NEWLINE const=False,NEWLINE default=default,NEWLINE required=required,NEWLINE help=help)NEWLINENEWLINENEWLINEclass _AppendAction(Action):NEWLINENEWLINE def __init__(self,NEWLINE option_strings,NEWLINE dest,NEWLINE nargs=None,NEWLINE const=None,NEWLINE default=None,NEWLINE type=None,NEWLINE choices=None,NEWLINE required=False,NEWLINE help=None,NEWLINE metavar=None):NEWLINE if nargs == 0:NEWLINE raise ValueError('nargs for append actions must be > 0; if arg 'NEWLINE 'strings are not supplying the value to append, 'NEWLINE 'the append const action may be more appropriate')NEWLINE if const is not None and nargs != OPTIONAL:NEWLINE raise ValueError('nargs must be %r to supply const' % OPTIONAL)NEWLINE super(_AppendAction, self).__init__(NEWLINE option_strings=option_strings,NEWLINE dest=dest,NEWLINE nargs=nargs,NEWLINE const=const,NEWLINE default=default,NEWLINE type=type,NEWLINE choices=choices,NEWLINE required=required,NEWLINE help=help,NEWLINE metavar=metavar)NEWLINENEWLINE def __call__(self, parser, namespace, values, option_string=None):NEWLINE items = _copy.copy(_ensure_value(namespace, self.dest, []))NEWLINE items.append(values)NEWLINE setattr(namespace, self.dest, items)NEWLINENEWLINENEWLINEclass _AppendConstAction(Action):NEWLINENEWLINE def __init__(self,NEWLINE option_strings,NEWLINE dest,NEWLINE const,NEWLINE default=None,NEWLINE required=False,NEWLINE help=None,NEWLINE metavar=None):NEWLINE super(_AppendConstAction, self).__init__(NEWLINE option_strings=option_strings,NEWLINE dest=dest,NEWLINE nargs=0,NEWLINE const=const,NEWLINE default=default,NEWLINE required=required,NEWLINE help=help,NEWLINE metavar=metavar)NEWLINENEWLINE def __call__(self, parser, namespace, values, option_string=None):NEWLINE items = _copy.copy(_ensure_value(namespace, self.dest, []))NEWLINE items.append(self.const)NEWLINE setattr(namespace, self.dest, items)NEWLINENEWLINENEWLINEclass _CountAction(Action):NEWLINENEWLINE def __init__(self,NEWLINE option_strings,NEWLINE dest,NEWLINE default=None,NEWLINE required=False,NEWLINE help=None):NEWLINE super(_CountAction, self).__init__(NEWLINE option_strings=option_strings,NEWLINE dest=dest,NEWLINE nargs=0,NEWLINE default=default,NEWLINE required=required,NEWLINE help=help)NEWLINENEWLINE def __call__(self, parser, namespace, values, option_string=None):NEWLINE new_count = _ensure_value(namespace, self.dest, 0) + 1NEWLINE setattr(namespace, self.dest, new_count)NEWLINENEWLINENEWLINEclass _HelpAction(Action):NEWLINENEWLINE def __init__(self,NEWLINE option_strings,NEWLINE dest=SUPPRESS,NEWLINE default=SUPPRESS,NEWLINE help=None):NEWLINE super(_HelpAction, self).__init__(NEWLINE option_strings=option_strings,NEWLINE dest=dest,NEWLINE default=default,NEWLINE nargs=0,NEWLINE help=help)NEWLINENEWLINE def __call__(self, parser, namespace, values, option_string=None):NEWLINE parser.print_help()NEWLINE parser.exit()NEWLINENEWLINENEWLINEclass _VersionAction(Action):NEWLINENEWLINE def __init__(self,NEWLINE option_strings,NEWLINE version=None,NEWLINE dest=SUPPRESS,NEWLINE default=SUPPRESS,NEWLINE help="show program's version number and exit"):NEWLINE super(_VersionAction, self).__init__(NEWLINE option_strings=option_strings,NEWLINE dest=dest,NEWLINE default=default,NEWLINE nargs=0,NEWLINE help=help)NEWLINE self.version = versionNEWLINENEWLINE def __call__(self, parser, namespace, values, option_string=None):NEWLINE version = self.versionNEWLINE if version is None:NEWLINE version = parser.versionNEWLINE formatter = parser._get_formatter()NEWLINE formatter.add_text(version)NEWLINE parser.exit(message=formatter.format_help())NEWLINENEWLINENEWLINEclass _SubParsersAction(Action):NEWLINENEWLINE class _ChoicesPseudoAction(Action):NEWLINENEWLINE def __init__(self, name, help):NEWLINE sup = super(_SubParsersAction._ChoicesPseudoAction, self)NEWLINE sup.__init__(option_strings=[], dest=name, help=help)NEWLINENEWLINE def __init__(self,NEWLINE option_strings,NEWLINE prog,NEWLINE parser_class,NEWLINE dest=SUPPRESS,NEWLINE help=None,NEWLINE metavar=None):NEWLINENEWLINE self._prog_prefix = progNEWLINE self._parser_class = parser_classNEWLINE self._name_parser_map = _collections.OrderedDict()NEWLINE self._choices_actions = []NEWLINENEWLINE super(_SubParsersAction, self).__init__(NEWLINE option_strings=option_strings,NEWLINE dest=dest,NEWLINE nargs=PARSER,NEWLINE choices=self._name_parser_map,NEWLINE help=help,NEWLINE metavar=metavar)NEWLINENEWLINE def add_parser(self, name, **kwargs):NEWLINE # set prog from the existing prefixNEWLINE if kwargs.get('prog') is None:NEWLINE kwargs['prog'] = '%s %s' % (self._prog_prefix, name)NEWLINENEWLINE # create a pseudo-action to hold the choice helpNEWLINE if 'help' in kwargs:NEWLINE help = kwargs.pop('help')NEWLINE choice_action = self._ChoicesPseudoAction(name, help)NEWLINE self._choices_actions.append(choice_action)NEWLINENEWLINE # create the parser and add it to the mapNEWLINE parser = self._parser_class(**kwargs)NEWLINE self._name_parser_map[name] = parserNEWLINE return parserNEWLINENEWLINE def _get_subactions(self):NEWLINE return self._choices_actionsNEWLINENEWLINE def __call__(self, parser, namespace, values, option_string=None):NEWLINE parser_name = values[0]NEWLINE arg_strings = values[1:]NEWLINENEWLINE # set the parser name if requestedNEWLINE if self.dest is not SUPPRESS:NEWLINE setattr(namespace, self.dest, parser_name)NEWLINENEWLINE # select the parserNEWLINE try:NEWLINE parser = self._name_parser_map[parser_name]NEWLINE except KeyError:NEWLINE tup = parser_name, ', '.join(self._name_parser_map)NEWLINE msg = _('unknown parser %r (choices: %s)') % tupNEWLINE raise ArgumentError(self, msg)NEWLINENEWLINE # parse all the remaining options into the namespaceNEWLINE # store any unrecognized options on the object, so that the topNEWLINE # level parser can decide what to do with themNEWLINENEWLINE # In case this subparser defines new defaults, we parse themNEWLINE # in a new namespace object and then update the originalNEWLINE # namespace for the relevant parts.NEWLINE subnamespace, arg_strings = parser.parse_known_args(arg_strings, None)NEWLINE for key, value in vars(subnamespace).items():NEWLINE setattr(namespace, key, value)NEWLINENEWLINE if arg_strings:NEWLINE vars(namespace).setdefault(_UNRECOGNIZED_ARGS_ATTR, [])NEWLINE getattr(namespace, _UNRECOGNIZED_ARGS_ATTR).extend(arg_strings)NEWLINENEWLINENEWLINE# ==============NEWLINE# Type classesNEWLINE# ==============NEWLINENEWLINEclass FileType(object):NEWLINE """Factory for creating file object typesNEWLINENEWLINE Instances of FileType are typically passed as type= arguments to theNEWLINE ArgumentParser add_argument() method.NEWLINENEWLINE Keyword Arguments:NEWLINE - mode -- A string indicating how the file is to be opened. Accepts theNEWLINE same values as the builtin open() function.NEWLINE - bufsize -- The file's desired buffer size. Accepts the same values asNEWLINE the builtin open() function.NEWLINE """NEWLINENEWLINE def __init__(self, mode='r', bufsize=-1):NEWLINE self._mode = modeNEWLINE self._bufsize = bufsizeNEWLINENEWLINE def __call__(self, string):NEWLINE # the special argument "-" means sys.std{in,out}NEWLINE if string == '-':NEWLINE if 'r' in self._mode:NEWLINE return _sys.stdinNEWLINE elif 'w' in self._mode:NEWLINE return _sys.stdoutNEWLINE else:NEWLINE msg = _('argument "-" with mode %r') % self._modeNEWLINE raise ValueError(msg)NEWLINENEWLINE # all other arguments are used as file namesNEWLINE try:NEWLINE return open(string, self._mode, self._bufsize)NEWLINE except IOError as e:NEWLINE message = _("can't open '%s': %s")NEWLINE raise ArgumentTypeError(message % (string, e))NEWLINENEWLINE def __repr__(self):NEWLINE args = self._mode, self._bufsizeNEWLINE args_str = ', '.join(repr(arg) for arg in args if arg != -1)NEWLINE return '%s(%s)' % (type(self).__name__, args_str)NEWLINENEWLINE# ===========================NEWLINE# Optional and Positional ParsingNEWLINE# ===========================NEWLINENEWLINEclass Namespace(_AttributeHolder):NEWLINE """Simple object for storing attributes.NEWLINENEWLINE Implements equality by attribute names and values, and provides a simpleNEWLINE string representation.NEWLINE """NEWLINENEWLINE def __init__(self, **kwargs):NEWLINE for name in kwargs:NEWLINE setattr(self, name, kwargs[name])NEWLINENEWLINE __hash__ = NoneNEWLINENEWLINE def __eq__(self, other):NEWLINE if not isinstance(other, Namespace):NEWLINE return NotImplementedNEWLINE return vars(self) == vars(other)NEWLINENEWLINE def __ne__(self, other):NEWLINE if not isinstance(other, Namespace):NEWLINE return NotImplementedNEWLINE return not (self == other)NEWLINENEWLINE def __contains__(self, key):NEWLINE return key in self.__dict__NEWLINENEWLINENEWLINEclass _ActionsContainer(object):NEWLINENEWLINE def __init__(self,NEWLINE description,NEWLINE prefix_chars,NEWLINE argument_default,NEWLINE conflict_handler):NEWLINE super(_ActionsContainer, self).__init__()NEWLINENEWLINE self.description = descriptionNEWLINE self.argument_default = argument_defaultNEWLINE self.prefix_chars = prefix_charsNEWLINE self.conflict_handler = conflict_handlerNEWLINENEWLINE # set up registriesNEWLINE self._registries = {}NEWLINENEWLINE # register actionsNEWLINE self.register('action', None, _StoreAction)NEWLINE self.register('action', 'store', _StoreAction)NEWLINE self.register('action', 'store_const', _StoreConstAction)NEWLINE self.register('action', 'store_true', _StoreTrueAction)NEWLINE self.register('action', 'store_false', _StoreFalseAction)NEWLINE self.register('action', 'append', _AppendAction)NEWLINE self.register('action', 'append_const', _AppendConstAction)NEWLINE self.register('action', 'count', _CountAction)NEWLINE self.register('action', 'help', _HelpAction)NEWLINE self.register('action', 'version', _VersionAction)NEWLINE self.register('action', 'parsers', _SubParsersAction)NEWLINENEWLINE # raise an exception if the conflict handler is invalidNEWLINE self._get_handler()NEWLINENEWLINE # action storageNEWLINE self._actions = []NEWLINE self._option_string_actions = {}NEWLINENEWLINE # groupsNEWLINE self._action_groups = []NEWLINE self._mutually_exclusive_groups = []NEWLINENEWLINE # defaults storageNEWLINE self._defaults = {}NEWLINENEWLINE # determines whether an "option" looks like a negative numberNEWLINE self._negative_number_matcher = _re.compile(r'^-\d+$|^-\d*\.\d+$')NEWLINENEWLINE # whether or not there are any optionals that look like negativeNEWLINE # numbers -- uses a list so it can be shared and editedNEWLINE self._has_negative_number_optionals = []NEWLINENEWLINE # ====================NEWLINE # Registration methodsNEWLINE # ====================NEWLINE def register(self, registry_name, value, object):NEWLINE registry = self._registries.setdefault(registry_name, {})NEWLINE registry[value] = objectNEWLINENEWLINE def _registry_get(self, registry_name, value, default=None):NEWLINE return self._registries[registry_name].get(value, default)NEWLINENEWLINE # ==================================NEWLINE # Namespace default accessor methodsNEWLINE # ==================================NEWLINE def set_defaults(self, **kwargs):NEWLINE self._defaults.update(kwargs)NEWLINENEWLINE # if these defaults match any existing arguments, replaceNEWLINE # the previous default on the object with the new oneNEWLINE for action in self._actions:NEWLINE if action.dest in kwargs:NEWLINE action.default = kwargs[action.dest]NEWLINENEWLINE def get_default(self, dest):NEWLINE for action in self._actions:NEWLINE if action.dest == dest and action.default is not None:NEWLINE return action.defaultNEWLINE return self._defaults.get(dest, None)NEWLINENEWLINENEWLINE # =======================NEWLINE # Adding argument actionsNEWLINE # =======================NEWLINE def add_argument(self, *args, **kwargs):NEWLINE """NEWLINE add_argument(dest, ..., name=value, ...)NEWLINE add_argument(option_string, option_string, ..., name=value, ...)NEWLINE """NEWLINENEWLINE # if no positional args are supplied or only one is supplied andNEWLINE # it doesn't look like an option string, parse a positionalNEWLINE # argumentNEWLINE chars = self.prefix_charsNEWLINE if not args or len(args) == 1 and args[0][0] not in chars:NEWLINE if args and 'dest' in kwargs:NEWLINE raise ValueError('dest supplied twice for positional argument')NEWLINE kwargs = self._get_positional_kwargs(*args, **kwargs)NEWLINENEWLINE # otherwise, we're adding an optional argumentNEWLINE else:NEWLINE kwargs = self._get_optional_kwargs(*args, **kwargs)NEWLINENEWLINE # if no default was supplied, use the parser-level defaultNEWLINE if 'default' not in kwargs:NEWLINE dest = kwargs['dest']NEWLINE if dest in self._defaults:NEWLINE kwargs['default'] = self._defaults[dest]NEWLINE elif self.argument_default is not None:NEWLINE kwargs['default'] = self.argument_defaultNEWLINENEWLINE # create the action object, and add it to the parserNEWLINE action_class = self._pop_action_class(kwargs)NEWLINE if not _callable(action_class):NEWLINE raise ValueError('unknown action "%s"' % (action_class,))NEWLINE action = action_class(**kwargs)NEWLINENEWLINE # raise an error if the action type is not callableNEWLINE type_func = self._registry_get('type', action.type, action.type)NEWLINE if not _callable(type_func):NEWLINE raise ValueError('%r is not callable' % (type_func,))NEWLINENEWLINE # raise an error if the metavar does not match the typeNEWLINE if hasattr(self, "_get_formatter"):NEWLINE try:NEWLINE self._get_formatter()._format_args(action, None)NEWLINE except TypeError:NEWLINE raise ValueError("length of metavar tuple does not match nargs")NEWLINENEWLINE return self._add_action(action)NEWLINENEWLINE def add_argument_group(self, *args, **kwargs):NEWLINE group = _ArgumentGroup(self, *args, **kwargs)NEWLINE self._action_groups.append(group)NEWLINE return groupNEWLINENEWLINE def add_mutually_exclusive_group(self, **kwargs):NEWLINE group = _MutuallyExclusiveGroup(self, **kwargs)NEWLINE self._mutually_exclusive_groups.append(group)NEWLINE return groupNEWLINENEWLINE def _add_action(self, action):NEWLINE # resolve any conflictsNEWLINE self._check_conflict(action)NEWLINENEWLINE # add to actions listNEWLINE self._actions.append(action)NEWLINE action.container = selfNEWLINENEWLINE # index the action by any option strings it hasNEWLINE for option_string in action.option_strings:NEWLINE self._option_string_actions[option_string] = actionNEWLINENEWLINE # set the flag if any option strings look like negative numbersNEWLINE for option_string in action.option_strings:NEWLINE if self._negative_number_matcher.match(option_string):NEWLINE if not self._has_negative_number_optionals:NEWLINE self._has_negative_number_optionals.append(True)NEWLINENEWLINE # return the created actionNEWLINE return actionNEWLINENEWLINE def _remove_action(self, action):NEWLINE self._actions.remove(action)NEWLINENEWLINE def _add_container_actions(self, container):NEWLINE # collect groups by titlesNEWLINE title_group_map = {}NEWLINE for group in self._action_groups:NEWLINE if group.title in title_group_map:NEWLINE msg = _('cannot merge actions - two groups are named %r')NEWLINE raise ValueError(msg % (group.title))NEWLINE title_group_map[group.title] = groupNEWLINENEWLINE # map each action to its groupNEWLINE group_map = {}NEWLINE for group in container._action_groups:NEWLINENEWLINE # if a group with the title exists, use that, otherwiseNEWLINE # create a new group matching the container's groupNEWLINE if group.title not in title_group_map:NEWLINE title_group_map[group.title] = self.add_argument_group(NEWLINE title=group.title,NEWLINE description=group.description,NEWLINE conflict_handler=group.conflict_handler)NEWLINENEWLINE # map the actions to their new groupNEWLINE for action in group._group_actions:NEWLINE group_map[action] = title_group_map[group.title]NEWLINENEWLINE # add container's mutually exclusive groupsNEWLINE # NOTE: if add_mutually_exclusive_group ever gains title= andNEWLINE # description= then this code will need to be expanded as aboveNEWLINE for group in container._mutually_exclusive_groups:NEWLINE mutex_group = self.add_mutually_exclusive_group(NEWLINE required=group.required)NEWLINENEWLINE # map the actions to their new mutex groupNEWLINE for action in group._group_actions:NEWLINE group_map[action] = mutex_groupNEWLINENEWLINE # add all actions to this container or their groupNEWLINE for action in container._actions:NEWLINE group_map.get(action, self)._add_action(action)NEWLINENEWLINE def _get_positional_kwargs(self, dest, **kwargs):NEWLINE # make sure required is not specifiedNEWLINE if 'required' in kwargs:NEWLINE msg = _("'required' is an invalid argument for positionals")NEWLINE raise TypeError(msg)NEWLINENEWLINE # mark positional arguments as required if at least one isNEWLINE # always requiredNEWLINE if kwargs.get('nargs') not in [OPTIONAL, ZERO_OR_MORE]:NEWLINE kwargs['required'] = TrueNEWLINE if kwargs.get('nargs') == ZERO_OR_MORE and 'default' not in kwargs:NEWLINE kwargs['required'] = TrueNEWLINENEWLINE # return the keyword arguments with no option stringsNEWLINE return dict(kwargs, dest=dest, option_strings=[])NEWLINENEWLINE def _get_optional_kwargs(self, *args, **kwargs):NEWLINE # determine short and long option stringsNEWLINE option_strings = []NEWLINE long_option_strings = []NEWLINE for option_string in args:NEWLINE # error on strings that don't start with an appropriate prefixNEWLINE if not option_string[0] in self.prefix_chars:NEWLINE msg = _('invalid option string %r: 'NEWLINE 'must start with a character %r')NEWLINE tup = option_string, self.prefix_charsNEWLINE raise ValueError(msg % tup)NEWLINENEWLINE # strings starting with two prefix characters are long optionsNEWLINE option_strings.append(option_string)NEWLINE if option_string[0] in self.prefix_chars:NEWLINE if len(option_string) > 1:NEWLINE if option_string[1] in self.prefix_chars:NEWLINE long_option_strings.append(option_string)NEWLINENEWLINE # infer destination, '--foo-bar' -> 'foo_bar' and '-x' -> 'x'NEWLINE dest = kwargs.pop('dest', None)NEWLINE if dest is None:NEWLINE if long_option_strings:NEWLINE dest_option_string = long_option_strings[0]NEWLINE else:NEWLINE dest_option_string = option_strings[0]NEWLINE dest = dest_option_string.lstrip(self.prefix_chars)NEWLINE if not dest:NEWLINE msg = _('dest= is required for options like %r')NEWLINE raise ValueError(msg % option_string)NEWLINE dest = dest.replace('-', '_')NEWLINENEWLINE # return the updated keyword argumentsNEWLINE return dict(kwargs, dest=dest, option_strings=option_strings)NEWLINENEWLINE def _pop_action_class(self, kwargs, default=None):NEWLINE action = kwargs.pop('action', default)NEWLINE return self._registry_get('action', action, action)NEWLINENEWLINE def _get_handler(self):NEWLINE # determine function from conflict handler stringNEWLINE handler_func_name = '_handle_conflict_%s' % self.conflict_handlerNEWLINE try:NEWLINE return getattr(self, handler_func_name)NEWLINE except AttributeError:NEWLINE msg = _('invalid conflict_resolution value: %r')NEWLINE raise ValueError(msg % self.conflict_handler)NEWLINENEWLINE def _check_conflict(self, action):NEWLINENEWLINE # find all options that conflict with this optionNEWLINE confl_optionals = []NEWLINE for option_string in action.option_strings:NEWLINE if option_string in self._option_string_actions:NEWLINE confl_optional = self._option_string_actions[option_string]NEWLINE confl_optionals.append((option_string, confl_optional))NEWLINENEWLINE # resolve any conflictsNEWLINE if confl_optionals:NEWLINE conflict_handler = self._get_handler()NEWLINE conflict_handler(action, confl_optionals)NEWLINENEWLINE def _handle_conflict_error(self, action, conflicting_actions):NEWLINE message = _('conflicting option string(s): %s')NEWLINE conflict_string = ', '.join([option_stringNEWLINE for option_string, actionNEWLINE in conflicting_actions])NEWLINE raise ArgumentError(action, message % conflict_string)NEWLINENEWLINE def _handle_conflict_resolve(self, action, conflicting_actions):NEWLINENEWLINE # remove all conflicting optionsNEWLINE for option_string, action in conflicting_actions:NEWLINENEWLINE # remove the conflicting optionNEWLINE action.option_strings.remove(option_string)NEWLINE self._option_string_actions.pop(option_string, None)NEWLINENEWLINE # if the option now has no option string, remove it from theNEWLINE # container holding itNEWLINE if not action.option_strings:NEWLINE action.container._remove_action(action)NEWLINENEWLINENEWLINEclass _ArgumentGroup(_ActionsContainer):NEWLINENEWLINE def __init__(self, container, title=None, description=None, **kwargs):NEWLINE # add any missing keyword arguments by checking the containerNEWLINE update = kwargs.setdefaultNEWLINE update('conflict_handler', container.conflict_handler)NEWLINE update('prefix_chars', container.prefix_chars)NEWLINE update('argument_default', container.argument_default)NEWLINE super_init = super(_ArgumentGroup, self).__init__NEWLINE super_init(description=description, **kwargs)NEWLINENEWLINE # group attributesNEWLINE self.title = titleNEWLINE self._group_actions = []NEWLINENEWLINE # share most attributes with the containerNEWLINE self._registries = container._registriesNEWLINE self._actions = container._actionsNEWLINE self._option_string_actions = container._option_string_actionsNEWLINE self._defaults = container._defaultsNEWLINE self._has_negative_number_optionals = \NEWLINE container._has_negative_number_optionalsNEWLINE self._mutually_exclusive_groups = container._mutually_exclusive_groupsNEWLINENEWLINE def _add_action(self, action):NEWLINE action = super(_ArgumentGroup, self)._add_action(action)NEWLINE self._group_actions.append(action)NEWLINE return actionNEWLINENEWLINE def _remove_action(self, action):NEWLINE super(_ArgumentGroup, self)._remove_action(action)NEWLINE self._group_actions.remove(action)NEWLINENEWLINENEWLINEclass _MutuallyExclusiveGroup(_ArgumentGroup):NEWLINENEWLINE def __init__(self, container, required=False):NEWLINE super(_MutuallyExclusiveGroup, self).__init__(container)NEWLINE self.required = requiredNEWLINE self._container = containerNEWLINENEWLINE def _add_action(self, action):NEWLINE if action.required:NEWLINE msg = _('mutually exclusive arguments must be optional')NEWLINE raise ValueError(msg)NEWLINE action = self._container._add_action(action)NEWLINE self._group_actions.append(action)NEWLINE return actionNEWLINENEWLINE def _remove_action(self, action):NEWLINE self._container._remove_action(action)NEWLINE self._group_actions.remove(action)NEWLINENEWLINENEWLINEclass ArgumentParser(_AttributeHolder, _ActionsContainer):NEWLINE """Object for parsing command line strings into Python objects.NEWLINENEWLINE Keyword Arguments:NEWLINE - prog -- The name of the program (default: sys.argv[0])NEWLINE - usage -- A usage message (default: auto-generated from arguments)NEWLINE - description -- A description of what the program doesNEWLINE - epilog -- Text following the argument descriptionsNEWLINE - parents -- Parsers whose arguments should be copied into this oneNEWLINE - formatter_class -- HelpFormatter class for printing help messagesNEWLINE - prefix_chars -- Characters that prefix optional argumentsNEWLINE - fromfile_prefix_chars -- Characters that prefix files containingNEWLINE additional argumentsNEWLINE - argument_default -- The default value for all argumentsNEWLINE - conflict_handler -- String indicating how to handle conflictsNEWLINE - add_help -- Add a -h/-help optionNEWLINE """NEWLINENEWLINE def __init__(self,NEWLINE prog=None,NEWLINE usage=None,NEWLINE description=None,NEWLINE epilog=None,NEWLINE version=None,NEWLINE parents=[],NEWLINE formatter_class=HelpFormatter,NEWLINE prefix_chars='-',NEWLINE fromfile_prefix_chars=None,NEWLINE argument_default=None,NEWLINE conflict_handler='error',NEWLINE add_help=True):NEWLINENEWLINE if version is not None:NEWLINE import warningsNEWLINE warnings.warn(NEWLINE """The "version" argument to ArgumentParser is deprecated. """NEWLINE """Please use """NEWLINE """"add_argument(..., action='version', version="N", ...)" """NEWLINE """instead""", DeprecationWarning)NEWLINENEWLINE superinit = super(ArgumentParser, self).__init__NEWLINE superinit(description=description,NEWLINE prefix_chars=prefix_chars,NEWLINE argument_default=argument_default,NEWLINE conflict_handler=conflict_handler)NEWLINENEWLINE # default setting for progNEWLINE if prog is None:NEWLINE prog = _os.path.basename(_sys.argv[0])NEWLINENEWLINE self.prog = progNEWLINE self.usage = usageNEWLINE self.epilog = epilogNEWLINE self.version = versionNEWLINE self.formatter_class = formatter_classNEWLINE self.fromfile_prefix_chars = fromfile_prefix_charsNEWLINE self.add_help = add_helpNEWLINENEWLINE add_group = self.add_argument_groupNEWLINE self._positionals = add_group(_('positional arguments'))NEWLINE self._optionals = add_group(_('optional arguments'))NEWLINE self._subparsers = NoneNEWLINENEWLINE # register typesNEWLINE def identity(string):NEWLINE return stringNEWLINE self.register('type', None, identity)NEWLINENEWLINE # add help and version arguments if necessaryNEWLINE # (using explicit default to override global argument_default)NEWLINE default_prefix = '-' if '-' in prefix_chars else prefix_chars[0]NEWLINE if self.add_help:NEWLINE self.add_argument(NEWLINE default_prefix+'h', default_prefix*2+'help',NEWLINE action='help', default=SUPPRESS,NEWLINE help=_('show this help message and exit'))NEWLINE if self.version:NEWLINE self.add_argument(NEWLINE default_prefix+'v', default_prefix*2+'version',NEWLINE action='version', default=SUPPRESS,NEWLINE version=self.version,NEWLINE help=_("show program's version number and exit"))NEWLINENEWLINE # add parent arguments and defaultsNEWLINE for parent in parents:NEWLINE self._add_container_actions(parent)NEWLINE try:NEWLINE defaults = parent._defaultsNEWLINE except AttributeError:NEWLINE passNEWLINE else:NEWLINE self._defaults.update(defaults)NEWLINENEWLINE # =======================NEWLINE # Pretty __repr__ methodsNEWLINE # =======================NEWLINE def _get_kwargs(self):NEWLINE names = [NEWLINE 'prog',NEWLINE 'usage',NEWLINE 'description',NEWLINE 'version',NEWLINE 'formatter_class',NEWLINE 'conflict_handler',NEWLINE 'add_help',NEWLINE ]NEWLINE return [(name, getattr(self, name)) for name in names]NEWLINENEWLINE # ==================================NEWLINE # Optional/Positional adding methodsNEWLINE # ==================================NEWLINE def add_subparsers(self, **kwargs):NEWLINE if self._subparsers is not None:NEWLINE self.error(_('cannot have multiple subparser arguments'))NEWLINENEWLINE # add the parser class to the arguments if it's not presentNEWLINE kwargs.setdefault('parser_class', type(self))NEWLINENEWLINE if 'title' in kwargs or 'description' in kwargs:NEWLINE title = _(kwargs.pop('title', 'subcommands'))NEWLINE description = _(kwargs.pop('description', None))NEWLINE self._subparsers = self.add_argument_group(title, description)NEWLINE else:NEWLINE self._subparsers = self._positionalsNEWLINENEWLINE # prog defaults to the usage message of this parser, skippingNEWLINE # optional arguments and with no "usage:" prefixNEWLINE if kwargs.get('prog') is None:NEWLINE formatter = self._get_formatter()NEWLINE positionals = self._get_positional_actions()NEWLINE groups = self._mutually_exclusive_groupsNEWLINE formatter.add_usage(self.usage, positionals, groups, '')NEWLINE kwargs['prog'] = formatter.format_help().strip()NEWLINENEWLINE # create the parsers action and add it to the positionals listNEWLINE parsers_class = self._pop_action_class(kwargs, 'parsers')NEWLINE action = parsers_class(option_strings=[], **kwargs)NEWLINE self._subparsers._add_action(action)NEWLINENEWLINE # return the created parsers actionNEWLINE return actionNEWLINENEWLINE def _add_action(self, action):NEWLINE if action.option_strings:NEWLINE self._optionals._add_action(action)NEWLINE else:NEWLINE self._positionals._add_action(action)NEWLINE return actionNEWLINENEWLINE def _get_optional_actions(self):NEWLINE return [actionNEWLINE for action in self._actionsNEWLINE if action.option_strings]NEWLINENEWLINE def _get_positional_actions(self):NEWLINE return [actionNEWLINE for action in self._actionsNEWLINE if not action.option_strings]NEWLINENEWLINE # =====================================NEWLINE # Command line argument parsing methodsNEWLINE # =====================================NEWLINE def parse_args(self, args=None, namespace=None):NEWLINE args, argv = self.parse_known_args(args, namespace)NEWLINE if argv:NEWLINE msg = _('unrecognized arguments: %s')NEWLINE self.error(msg % ' '.join(argv))NEWLINE return argsNEWLINENEWLINE def parse_known_args(self, args=None, namespace=None):NEWLINE if args is None:NEWLINE # args default to the system argsNEWLINE args = _sys.argv[1:]NEWLINE else:NEWLINE # make sure that args are mutableNEWLINE args = list(args)NEWLINENEWLINE # default Namespace built from parser defaultsNEWLINE if namespace is None:NEWLINE namespace = Namespace()NEWLINENEWLINE # add any action defaults that aren't presentNEWLINE for action in self._actions:NEWLINE if action.dest is not SUPPRESS:NEWLINE if not hasattr(namespace, action.dest):NEWLINE if action.default is not SUPPRESS:NEWLINE setattr(namespace, action.dest, action.default)NEWLINENEWLINE # add any parser defaults that aren't presentNEWLINE for dest in self._defaults:NEWLINE if not hasattr(namespace, dest):NEWLINE setattr(namespace, dest, self._defaults[dest])NEWLINENEWLINE # parse the arguments and exit if there are any errorsNEWLINE try:NEWLINE namespace, args = self._parse_known_args(args, namespace)NEWLINE if hasattr(namespace, _UNRECOGNIZED_ARGS_ATTR):NEWLINE args.extend(getattr(namespace, _UNRECOGNIZED_ARGS_ATTR))NEWLINE delattr(namespace, _UNRECOGNIZED_ARGS_ATTR)NEWLINE return namespace, argsNEWLINE except ArgumentError:NEWLINE err = _sys.exc_info()[1]NEWLINE self.error(str(err))NEWLINENEWLINE def _parse_known_args(self, arg_strings, namespace):NEWLINE # replace arg strings that are file referencesNEWLINE if self.fromfile_prefix_chars is not None:NEWLINE arg_strings = self._read_args_from_files(arg_strings)NEWLINENEWLINE # map all mutually exclusive arguments to the other argumentsNEWLINE # they can't occur withNEWLINE action_conflicts = {}NEWLINE for mutex_group in self._mutually_exclusive_groups:NEWLINE group_actions = mutex_group._group_actionsNEWLINE for i, mutex_action in enumerate(mutex_group._group_actions):NEWLINE conflicts = action_conflicts.setdefault(mutex_action, [])NEWLINE conflicts.extend(group_actions[:i])NEWLINE conflicts.extend(group_actions[i + 1:])NEWLINENEWLINE # find all option indices, and determine the arg_string_patternNEWLINE # which has an 'O' if there is an option at an index,NEWLINE # an 'A' if there is an argument, or a '-' if there is a '--'NEWLINE option_string_indices = {}NEWLINE arg_string_pattern_parts = []NEWLINE arg_strings_iter = iter(arg_strings)NEWLINE for i, arg_string in enumerate(arg_strings_iter):NEWLINENEWLINE # all args after -- are non-optionsNEWLINE if arg_string == '--':NEWLINE arg_string_pattern_parts.append('-')NEWLINE for arg_string in arg_strings_iter:NEWLINE arg_string_pattern_parts.append('A')NEWLINENEWLINE # otherwise, add the arg to the arg stringsNEWLINE # and note the index if it was an optionNEWLINE else:NEWLINE option_tuple = self._parse_optional(arg_string)NEWLINE if option_tuple is None:NEWLINE pattern = 'A'NEWLINE else:NEWLINE option_string_indices[i] = option_tupleNEWLINE pattern = 'O'NEWLINE arg_string_pattern_parts.append(pattern)NEWLINENEWLINE # join the pieces together to form the patternNEWLINE arg_strings_pattern = ''.join(arg_string_pattern_parts)NEWLINENEWLINE # converts arg strings to the appropriate and then takes the actionNEWLINE seen_actions = set()NEWLINE seen_non_default_actions = set()NEWLINENEWLINE def take_action(action, argument_strings, option_string=None):NEWLINE seen_actions.add(action)NEWLINE argument_values = self._get_values(action, argument_strings)NEWLINENEWLINE # error if this argument is not allowed with other previouslyNEWLINE # seen arguments, assuming that actions that use the defaultNEWLINE # value don't really count as "present"NEWLINE if argument_values is not action.default:NEWLINE seen_non_default_actions.add(action)NEWLINE for conflict_action in action_conflicts.get(action, []):NEWLINE if conflict_action in seen_non_default_actions:NEWLINE msg = _('not allowed with argument %s')NEWLINE action_name = _get_action_name(conflict_action)NEWLINE raise ArgumentError(action, msg % action_name)NEWLINENEWLINE # take the action if we didn't receive a SUPPRESS valueNEWLINE # (e.g. from a default)NEWLINE if argument_values is not SUPPRESS:NEWLINE action(self, namespace, argument_values, option_string)NEWLINENEWLINE # function to convert arg_strings into an optional actionNEWLINE def consume_optional(start_index):NEWLINENEWLINE # get the optional identified at this indexNEWLINE option_tuple = option_string_indices[start_index]NEWLINE action, option_string, explicit_arg = option_tupleNEWLINENEWLINE # identify additional optionals in the same arg stringNEWLINE # (e.g. -xyz is the same as -x -y -z if no args are required)NEWLINE match_argument = self._match_argumentNEWLINE action_tuples = []NEWLINE while True:NEWLINENEWLINE # if we found no optional action, skip itNEWLINE if action is None:NEWLINE extras.append(arg_strings[start_index])NEWLINE return start_index + 1NEWLINENEWLINE # if there is an explicit argument, try to match theNEWLINE # optional's string arguments to only thisNEWLINE if explicit_arg is not None:NEWLINE arg_count = match_argument(action, 'A')NEWLINENEWLINE # if the action is a single-dash option and takes noNEWLINE # arguments, try to parse more single-dash options outNEWLINE # of the tail of the option stringNEWLINE chars = self.prefix_charsNEWLINE if arg_count == 0 and option_string[1] not in chars:NEWLINE action_tuples.append((action, [], option_string))NEWLINE char = option_string[0]NEWLINE option_string = char + explicit_arg[0]NEWLINE new_explicit_arg = explicit_arg[1:] or NoneNEWLINE optionals_map = self._option_string_actionsNEWLINE if option_string in optionals_map:NEWLINE action = optionals_map[option_string]NEWLINE explicit_arg = new_explicit_argNEWLINE else:NEWLINE msg = _('ignored explicit argument %r')NEWLINE raise ArgumentError(action, msg % explicit_arg)NEWLINENEWLINE # if the action expect exactly one argument, we'veNEWLINE # successfully matched the option; exit the loopNEWLINE elif arg_count == 1:NEWLINE stop = start_index + 1NEWLINE args = [explicit_arg]NEWLINE action_tuples.append((action, args, option_string))NEWLINE breakNEWLINENEWLINE # error if a double-dash option did not use theNEWLINE # explicit argumentNEWLINE else:NEWLINE msg = _('ignored explicit argument %r')NEWLINE raise ArgumentError(action, msg % explicit_arg)NEWLINENEWLINE # if there is no explicit argument, try to match theNEWLINE # optional's string arguments with the following stringsNEWLINE # if successful, exit the loopNEWLINE else:NEWLINE start = start_index + 1NEWLINE selected_patterns = arg_strings_pattern[start:]NEWLINE arg_count = match_argument(action, selected_patterns)NEWLINE stop = start + arg_countNEWLINE args = arg_strings[start:stop]NEWLINE action_tuples.append((action, args, option_string))NEWLINE breakNEWLINENEWLINE # add the Optional to the list and return the index at whichNEWLINE # the Optional's string args stoppedNEWLINE assert action_tuplesNEWLINE for action, args, option_string in action_tuples:NEWLINE take_action(action, args, option_string)NEWLINE return stopNEWLINENEWLINE # the list of Positionals left to be parsed; this is modifiedNEWLINE # by consume_positionals()NEWLINE positionals = self._get_positional_actions()NEWLINENEWLINE # function to convert arg_strings into positional actionsNEWLINE def consume_positionals(start_index):NEWLINE # match as many Positionals as possibleNEWLINE match_partial = self._match_arguments_partialNEWLINE selected_pattern = arg_strings_pattern[start_index:]NEWLINE arg_counts = match_partial(positionals, selected_pattern)NEWLINENEWLINE # slice off the appropriate arg strings for each PositionalNEWLINE # and add the Positional and its args to the listNEWLINE for action, arg_count in zip(positionals, arg_counts):NEWLINE args = arg_strings[start_index: start_index + arg_count]NEWLINE start_index += arg_countNEWLINE take_action(action, args)NEWLINENEWLINE # slice off the Positionals that we just parsed and return theNEWLINE # index at which the Positionals' string args stoppedNEWLINE positionals[:] = positionals[len(arg_counts):]NEWLINE return start_indexNEWLINENEWLINE # consume Positionals and Optionals alternately, until we haveNEWLINE # passed the last option stringNEWLINE extras = []NEWLINE start_index = 0NEWLINE if option_string_indices:NEWLINE max_option_string_index = max(option_string_indices)NEWLINE else:NEWLINE max_option_string_index = -1NEWLINE while start_index <= max_option_string_index:NEWLINENEWLINE # consume any Positionals preceding the next optionNEWLINE next_option_string_index = min([NEWLINE indexNEWLINE for index in option_string_indicesNEWLINE if index >= start_index])NEWLINE if start_index != next_option_string_index:NEWLINE positionals_end_index = consume_positionals(start_index)NEWLINENEWLINE # only try to parse the next optional if we didn't consumeNEWLINE # the option string during the positionals parsingNEWLINE if positionals_end_index > start_index:NEWLINE start_index = positionals_end_indexNEWLINE continueNEWLINE else:NEWLINE start_index = positionals_end_indexNEWLINENEWLINE # if we consumed all the positionals we could and we're notNEWLINE # at the index of an option string, there were extra argumentsNEWLINE if start_index not in option_string_indices:NEWLINE strings = arg_strings[start_index:next_option_string_index]NEWLINE extras.extend(strings)NEWLINE start_index = next_option_string_indexNEWLINENEWLINE # consume the next optional and any arguments for itNEWLINE start_index = consume_optional(start_index)NEWLINENEWLINE # consume any positionals following the last OptionalNEWLINE stop_index = consume_positionals(start_index)NEWLINENEWLINE # if we didn't consume all the argument strings, there were extrasNEWLINE extras.extend(arg_strings[stop_index:])NEWLINENEWLINE # if we didn't use all the Positional objects, there were too fewNEWLINE # arg strings supplied.NEWLINE if positionals:NEWLINE self.error(_('too few arguments'))NEWLINENEWLINE # make sure all required actions were present, and convert defaults.NEWLINE for action in self._actions:NEWLINE if action not in seen_actions:NEWLINE if action.required:NEWLINE name = _get_action_name(action)NEWLINE self.error(_('argument %s is required') % name)NEWLINE else:NEWLINE # Convert action default now instead of doing it beforeNEWLINE # parsing arguments to avoid calling convert functionsNEWLINE # twice (which may fail) if the argument was given, butNEWLINE # only if it was defined already in the namespaceNEWLINE if (action.default is not None andNEWLINE isinstance(action.default, basestring) andNEWLINE hasattr(namespace, action.dest) andNEWLINE action.default is getattr(namespace, action.dest)):NEWLINE setattr(namespace, action.dest,NEWLINE self._get_value(action, action.default))NEWLINENEWLINE # make sure all required groups had one option presentNEWLINE for group in self._mutually_exclusive_groups:NEWLINE if group.required:NEWLINE for action in group._group_actions:NEWLINE if action in seen_non_default_actions:NEWLINE breakNEWLINENEWLINE # if no actions were used, report the errorNEWLINE else:NEWLINE names = [_get_action_name(action)NEWLINE for action in group._group_actionsNEWLINE if action.help is not SUPPRESS]NEWLINE msg = _('one of the arguments %s is required')NEWLINE self.error(msg % ' '.join(names))NEWLINENEWLINE # return the updated namespace and the extra argumentsNEWLINE return namespace, extrasNEWLINENEWLINE def _read_args_from_files(self, arg_strings):NEWLINE # expand arguments referencing filesNEWLINE new_arg_strings = []NEWLINE for arg_string in arg_strings:NEWLINENEWLINE # for regular arguments, just add them back into the listNEWLINE if not arg_string or arg_string[0] not in self.fromfile_prefix_chars:NEWLINE new_arg_strings.append(arg_string)NEWLINENEWLINE # replace arguments referencing files with the file contentNEWLINE else:NEWLINE try:NEWLINE args_file = open(arg_string[1:])NEWLINE try:NEWLINE arg_strings = []NEWLINE for arg_line in args_file.read().splitlines():NEWLINE for arg in self.convert_arg_line_to_args(arg_line):NEWLINE arg_strings.append(arg)NEWLINE arg_strings = self._read_args_from_files(arg_strings)NEWLINE new_arg_strings.extend(arg_strings)NEWLINE finally:NEWLINE args_file.close()NEWLINE except IOError:NEWLINE err = _sys.exc_info()[1]NEWLINE self.error(str(err))NEWLINENEWLINE # return the modified argument listNEWLINE return new_arg_stringsNEWLINENEWLINE def convert_arg_line_to_args(self, arg_line):NEWLINE return [arg_line]NEWLINENEWLINE def _match_argument(self, action, arg_strings_pattern):NEWLINE # match the pattern for this action to the arg stringsNEWLINE nargs_pattern = self._get_nargs_pattern(action)NEWLINE match = _re.match(nargs_pattern, arg_strings_pattern)NEWLINENEWLINE # raise an exception if we weren't able to find a matchNEWLINE if match is None:NEWLINE nargs_errors = {NEWLINE None: _('expected one argument'),NEWLINE OPTIONAL: _('expected at most one argument'),NEWLINE ONE_OR_MORE: _('expected at least one argument'),NEWLINE }NEWLINE default = _('expected %s argument(s)') % action.nargsNEWLINE msg = nargs_errors.get(action.nargs, default)NEWLINE raise ArgumentError(action, msg)NEWLINENEWLINE # return the number of arguments matchedNEWLINE return len(match.group(1))NEWLINENEWLINE def _match_arguments_partial(self, actions, arg_strings_pattern):NEWLINE # progressively shorten the actions list by slicing off theNEWLINE # final actions until we find a matchNEWLINE result = []NEWLINE for i in range(len(actions), 0, -1):NEWLINE actions_slice = actions[:i]NEWLINE pattern = ''.join([self._get_nargs_pattern(action)NEWLINE for action in actions_slice])NEWLINE match = _re.match(pattern, arg_strings_pattern)NEWLINE if match is not None:NEWLINE result.extend([len(string) for string in match.groups()])NEWLINE breakNEWLINENEWLINE # return the list of arg string countsNEWLINE return resultNEWLINENEWLINE def _parse_optional(self, arg_string):NEWLINE # if it's an empty string, it was meant to be a positionalNEWLINE if not arg_string:NEWLINE return NoneNEWLINENEWLINE # if it doesn't start with a prefix, it was meant to be positionalNEWLINE if not arg_string[0] in self.prefix_chars:NEWLINE return NoneNEWLINENEWLINE # if the option string is present in the parser, return the actionNEWLINE if arg_string in self._option_string_actions:NEWLINE action = self._option_string_actions[arg_string]NEWLINE return action, arg_string, NoneNEWLINENEWLINE # if it's just a single character, it was meant to be positionalNEWLINE if len(arg_string) == 1:NEWLINE return NoneNEWLINENEWLINE # if the option string before the "=" is present, return the actionNEWLINE if '=' in arg_string:NEWLINE option_string, explicit_arg = arg_string.split('=', 1)NEWLINE if option_string in self._option_string_actions:NEWLINE action = self._option_string_actions[option_string]NEWLINE return action, option_string, explicit_argNEWLINENEWLINE # search through all possible prefixes of the option stringNEWLINE # and all actions in the parser for possible interpretationsNEWLINE option_tuples = self._get_option_tuples(arg_string)NEWLINENEWLINE # if multiple actions match, the option string was ambiguousNEWLINE if len(option_tuples) > 1:NEWLINE options = ', '.join([option_stringNEWLINE for action, option_string, explicit_arg in option_tuples])NEWLINE tup = arg_string, optionsNEWLINE self.error(_('ambiguous option: %s could match %s') % tup)NEWLINENEWLINE # if exactly one action matched, this segmentation is good,NEWLINE # so return the parsed actionNEWLINE elif len(option_tuples) == 1:NEWLINE option_tuple, = option_tuplesNEWLINE return option_tupleNEWLINENEWLINE # if it was not found as an option, but it looks like a negativeNEWLINE # number, it was meant to be positionalNEWLINE # unless there are negative-number-like optionsNEWLINE if self._negative_number_matcher.match(arg_string):NEWLINE if not self._has_negative_number_optionals:NEWLINE return NoneNEWLINENEWLINE # if it contains a space, it was meant to be a positionalNEWLINE if ' ' in arg_string:NEWLINE return NoneNEWLINENEWLINE # it was meant to be an optional but there is no such optionNEWLINE # in this parser (though it might be a valid option in a subparser)NEWLINE return None, arg_string, NoneNEWLINENEWLINE def _get_option_tuples(self, option_string):NEWLINE result = []NEWLINENEWLINE # option strings starting with two prefix characters are onlyNEWLINE # split at the '='NEWLINE chars = self.prefix_charsNEWLINE if option_string[0] in chars and option_string[1] in chars:NEWLINE if '=' in option_string:NEWLINE option_prefix, explicit_arg = option_string.split('=', 1)NEWLINE else:NEWLINE option_prefix = option_stringNEWLINE explicit_arg = NoneNEWLINE for option_string in self._option_string_actions:NEWLINE if option_string.startswith(option_prefix):NEWLINE action = self._option_string_actions[option_string]NEWLINE tup = action, option_string, explicit_argNEWLINE result.append(tup)NEWLINENEWLINE # single character options can be concatenated with their argumentsNEWLINE # but multiple character options always have to have their argumentNEWLINE # separateNEWLINE elif option_string[0] in chars and option_string[1] not in chars:NEWLINE option_prefix = option_stringNEWLINE explicit_arg = NoneNEWLINE short_option_prefix = option_string[:2]NEWLINE short_explicit_arg = option_string[2:]NEWLINENEWLINE for option_string in self._option_string_actions:NEWLINE if option_string == short_option_prefix:NEWLINE action = self._option_string_actions[option_string]NEWLINE tup = action, option_string, short_explicit_argNEWLINE result.append(tup)NEWLINE elif option_string.startswith(option_prefix):NEWLINE action = self._option_string_actions[option_string]NEWLINE tup = action, option_string, explicit_argNEWLINE result.append(tup)NEWLINENEWLINE # shouldn't ever get hereNEWLINE else:NEWLINE self.error(_('unexpected option string: %s') % option_string)NEWLINENEWLINE # return the collected option tuplesNEWLINE return resultNEWLINENEWLINE def _get_nargs_pattern(self, action):NEWLINE # in all examples below, we have to allow for '--' argsNEWLINE # which are represented as '-' in the patternNEWLINE nargs = action.nargsNEWLINENEWLINE # the default (None) is assumed to be a single argumentNEWLINE if nargs is None:NEWLINE nargs_pattern = '(-*A-*)'NEWLINENEWLINE # allow zero or one argumentsNEWLINE elif nargs == OPTIONAL:NEWLINE nargs_pattern = '(-*A?-*)'NEWLINENEWLINE # allow zero or more argumentsNEWLINE elif nargs == ZERO_OR_MORE:NEWLINE nargs_pattern = '(-*[A-]*)'NEWLINENEWLINE # allow one or more argumentsNEWLINE elif nargs == ONE_OR_MORE:NEWLINE nargs_pattern = '(-*A[A-]*)'NEWLINENEWLINE # allow any number of options or argumentsNEWLINE elif nargs == REMAINDER:NEWLINE nargs_pattern = '([-AO]*)'NEWLINENEWLINE # allow one argument followed by any number of options or argumentsNEWLINE elif nargs == PARSER:NEWLINE nargs_pattern = '(-*A[-AO]*)'NEWLINENEWLINE # all others should be integersNEWLINE else:NEWLINE nargs_pattern = '(-*%s-*)' % '-*'.join('A' * nargs)NEWLINENEWLINE # if this is an optional action, -- is not allowedNEWLINE if action.option_strings:NEWLINE nargs_pattern = nargs_pattern.replace('-*', '')NEWLINE nargs_pattern = nargs_pattern.replace('-', '')NEWLINENEWLINE # return the patternNEWLINE return nargs_patternNEWLINENEWLINE # ========================NEWLINE # Value conversion methodsNEWLINE # ========================NEWLINE def _get_values(self, action, arg_strings):NEWLINE # for everything but PARSER, REMAINDER args, strip out first '--'NEWLINE if action.nargs not in [PARSER, REMAINDER]:NEWLINE try:NEWLINE arg_strings.remove('--')NEWLINE except ValueError:NEWLINE passNEWLINENEWLINE # optional argument produces a default when not presentNEWLINE if not arg_strings and action.nargs == OPTIONAL:NEWLINE if action.option_strings:NEWLINE value = action.constNEWLINE else:NEWLINE value = action.defaultNEWLINE if isinstance(value, basestring):NEWLINE value = self._get_value(action, value)NEWLINE self._check_value(action, value)NEWLINENEWLINE # when nargs='*' on a positional, if there were no command-lineNEWLINE # args, use the default if it is anything other than NoneNEWLINE elif (not arg_strings and action.nargs == ZERO_OR_MORE andNEWLINE not action.option_strings):NEWLINE if action.default is not None:NEWLINE value = action.defaultNEWLINE else:NEWLINE value = arg_stringsNEWLINE self._check_value(action, value)NEWLINENEWLINE # single argument or optional argument produces a single valueNEWLINE elif len(arg_strings) == 1 and action.nargs in [None, OPTIONAL]:NEWLINE arg_string, = arg_stringsNEWLINE value = self._get_value(action, arg_string)NEWLINE self._check_value(action, value)NEWLINENEWLINE # REMAINDER arguments convert all values, checking noneNEWLINE elif action.nargs == REMAINDER:NEWLINE value = [self._get_value(action, v) for v in arg_strings]NEWLINENEWLINE # PARSER arguments convert all values, but check only the firstNEWLINE elif action.nargs == PARSER:NEWLINE value = [self._get_value(action, v) for v in arg_strings]NEWLINE self._check_value(action, value[0])NEWLINENEWLINE # all other types of nargs produce a listNEWLINE else:NEWLINE value = [self._get_value(action, v) for v in arg_strings]NEWLINE for v in value:NEWLINE self._check_value(action, v)NEWLINENEWLINE # return the converted valueNEWLINE return valueNEWLINENEWLINE def _get_value(self, action, arg_string):NEWLINE type_func = self._registry_get('type', action.type, action.type)NEWLINE if not _callable(type_func):NEWLINE msg = _('%r is not callable')NEWLINE raise ArgumentError(action, msg % type_func)NEWLINENEWLINE # convert the value to the appropriate typeNEWLINE try:NEWLINE result = type_func(arg_string)NEWLINENEWLINE # ArgumentTypeErrors indicate errorsNEWLINE except ArgumentTypeError:NEWLINE name = getattr(action.type, '__name__', repr(action.type))NEWLINE msg = str(_sys.exc_info()[1])NEWLINE raise ArgumentError(action, msg)NEWLINENEWLINE # TypeErrors or ValueErrors also indicate errorsNEWLINE except (TypeError, ValueError):NEWLINE name = getattr(action.type, '__name__', repr(action.type))NEWLINE msg = _('invalid %s value: %r')NEWLINE raise ArgumentError(action, msg % (name, arg_string))NEWLINENEWLINE # return the converted valueNEWLINE return resultNEWLINENEWLINE def _check_value(self, action, value):NEWLINE # converted value must be one of the choices (if specified)NEWLINE if action.choices is not None and value not in action.choices:NEWLINE tup = value, ', '.join(map(repr, action.choices))NEWLINE msg = _('invalid choice: %r (choose from %s)') % tupNEWLINE raise ArgumentError(action, msg)NEWLINENEWLINE # =======================NEWLINE # Help-formatting methodsNEWLINE # =======================NEWLINE def format_usage(self):NEWLINE formatter = self._get_formatter()NEWLINE formatter.add_usage(self.usage, self._actions,NEWLINE self._mutually_exclusive_groups)NEWLINE return formatter.format_help()NEWLINENEWLINE def format_help(self):NEWLINE formatter = self._get_formatter()NEWLINENEWLINE # usageNEWLINE formatter.add_usage(self.usage, self._actions,NEWLINE self._mutually_exclusive_groups)NEWLINENEWLINE # descriptionNEWLINE formatter.add_text(self.description)NEWLINENEWLINE # positionals, optionals and user-defined groupsNEWLINE for action_group in self._action_groups:NEWLINE formatter.start_section(action_group.title)NEWLINE formatter.add_text(action_group.description)NEWLINE formatter.add_arguments(action_group._group_actions)NEWLINE formatter.end_section()NEWLINENEWLINE # epilogNEWLINE formatter.add_text(self.epilog)NEWLINENEWLINE # determine help from format aboveNEWLINE return formatter.format_help()NEWLINENEWLINE def format_version(self):NEWLINE import warningsNEWLINE warnings.warn(NEWLINE 'The format_version method is deprecated -- the "version" 'NEWLINE 'argument to ArgumentParser is no longer supported.',NEWLINE DeprecationWarning)NEWLINE formatter = self._get_formatter()NEWLINE formatter.add_text(self.version)NEWLINE return formatter.format_help()NEWLINENEWLINE def _get_formatter(self):NEWLINE return self.formatter_class(prog=self.prog)NEWLINENEWLINE # =====================NEWLINE # Help-printing methodsNEWLINE # =====================NEWLINE def print_usage(self, file=None):NEWLINE if file is None:NEWLINE file = _sys.stdoutNEWLINE self._print_message(self.format_usage(), file)NEWLINENEWLINE def print_help(self, file=None):NEWLINE if file is None:NEWLINE file = _sys.stdoutNEWLINE self._print_message(self.format_help(), file)NEWLINENEWLINE def print_version(self, file=None):NEWLINE import warningsNEWLINE warnings.warn(NEWLINE 'The print_version method is deprecated -- the "version" 'NEWLINE 'argument to ArgumentParser is no longer supported.',NEWLINE DeprecationWarning)NEWLINE self._print_message(self.format_version(), file)NEWLINENEWLINE def _print_message(self, message, file=None):NEWLINE if message:NEWLINE if file is None:NEWLINE file = _sys.stderrNEWLINE file.write(message)NEWLINENEWLINE # ===============NEWLINE # Exiting methodsNEWLINE # ===============NEWLINE def exit(self, status=0, message=None):NEWLINE if message:NEWLINE self._print_message(message, _sys.stderr)NEWLINE _sys.exit(status)NEWLINENEWLINE def error(self, message):NEWLINE """error(message: string)NEWLINENEWLINE Prints a usage message incorporating the message to stderr andNEWLINE exits.NEWLINENEWLINE If you override this in a subclass, it should not return -- itNEWLINE should either exit or raise an exception.NEWLINE """NEWLINE self.print_usage(_sys.stderr)NEWLINE self.exit(2, _('%s: error: %s\n') % (self.prog, message))NEWLINE |
#!/usr/bin/env pythonNEWLINENEWLINE# Copyright (c) 2013 Intel Corporation. All rights reserved.NEWLINE# Use of this source code is governed by a BSD-style license that can beNEWLINE# found in the LICENSE file.NEWLINE# pylint: disable=F0401NEWLINENEWLINEimport osNEWLINEimport shutilNEWLINEimport sysNEWLINEfrom common_function import RemoveUnusedFilesInReleaseModeNEWLINENEWLINEdef Clean(dir_to_clean):NEWLINE if os.path.isdir(dir_to_clean):NEWLINE shutil.rmtree(dir_to_clean)NEWLINENEWLINENEWLINEdef PrepareFromChromium(target_dir):NEWLINE gyp_dir = os.path.join(target_dir, 'scripts', 'gyp')NEWLINE if not os.path.exists(gyp_dir):NEWLINE os.makedirs(gyp_dir)NEWLINE shutil.copytree('../build/android/gyp/util', os.path.join(gyp_dir, 'util'))NEWLINE shutil.copy('../build/android/gyp/ant.py', gyp_dir)NEWLINENEWLINENEWLINEdef PrepareFromXwalk(src_dir, target_dir):NEWLINE '''Prepare different files for app packaging tools. All resources are used byNEWLINE make_apk.py.NEWLINE '''NEWLINE # Get the dir of source code from src_dir: ../../.NEWLINE source_code_dir = os.path.dirname(os.path.dirname(src_dir))NEWLINENEWLINE # The directories for source and target .jar files.NEWLINE jar_src_dir = os.path.join(src_dir, 'lib.java')NEWLINE jar_target_dir = os.path.join(target_dir, 'libs')NEWLINENEWLINE # The directories for generated resources.NEWLINE gen_res_src_dir = os.path.join(src_dir, 'gen')NEWLINE gen_res_target_dir = os.path.join(target_dir, 'gen')NEWLINENEWLINE # The directory for source packaging tools.NEWLINE tools_src_dir = os.path.join(source_code_dir, 'xwalk/app/tools/android')NEWLINENEWLINE # The directories for source and target gyp.NEWLINE gyp_src_dir = os.path.join(tools_src_dir, 'gyp')NEWLINE gyp_target_dir = os.path.join(target_dir, 'scripts/gyp')NEWLINENEWLINE # The source file/directory list to be copied and the target directory list.NEWLINE source_target_list = [NEWLINE (os.path.join(source_code_dir, 'xwalk/VERSION'), target_dir),NEWLINENEWLINE # This jar is needed for 'javac' compile.NEWLINE (os.path.join(jar_src_dir, 'xwalk_app_runtime_java.jar'), jar_target_dir),NEWLINE (os.path.join(jar_src_dir, 'xwalk_core_embedded.dex.jar'), jar_target_dir),NEWLINENEWLINE # Native library, like libxwalkcore.so.NEWLINE (os.path.join(src_dir, 'xwalk_runtime_lib_apk/libs/x86'),NEWLINE os.path.join(target_dir, 'native_libs/x86/libs/x86')),NEWLINE (os.path.join(src_dir, 'xwalk_runtime_lib_apk/libs/armeabi-v7a'),NEWLINE os.path.join(target_dir, 'native_libs/armeabi-v7a/libs/armeabi-v7a')),NEWLINENEWLINE # Native source package(xwalk.pak) and related js files for extension.NEWLINE (os.path.join(src_dir, 'xwalk_runtime_lib/assets'),NEWLINE os.path.join(target_dir, 'native_libs_res')),NEWLINENEWLINE # Various Java resources.NEWLINE (os.path.join(source_code_dir, 'content/public/android/java/res'),NEWLINE os.path.join(target_dir, 'libs_res/content')),NEWLINE (os.path.join(source_code_dir, 'ui/android/java/res'),NEWLINE os.path.join(target_dir, 'libs_res/ui')),NEWLINE (os.path.join(source_code_dir, 'xwalk/runtime/android/java/res'),NEWLINE os.path.join(target_dir, 'libs_res/runtime')),NEWLINENEWLINE (os.path.join(gen_res_src_dir, 'ui_java/java_R'),NEWLINE os.path.join(gen_res_target_dir, 'ui_java/java_R')),NEWLINE (os.path.join(gen_res_src_dir, 'ui_java/res_crunched'),NEWLINE os.path.join(gen_res_target_dir, 'ui_java/res_crunched')),NEWLINE (os.path.join(gen_res_src_dir, 'ui_java/res_grit'),NEWLINE os.path.join(gen_res_target_dir, 'ui_java/res_grit')),NEWLINE (os.path.join(gen_res_src_dir, 'ui_java/res_v14_compatibility'),NEWLINE os.path.join(gen_res_target_dir, 'ui_java/res_v14_compatibility')),NEWLINENEWLINE (os.path.join(gen_res_src_dir, 'content_java/java_R'),NEWLINE os.path.join(gen_res_target_dir, 'content_java/java_R')),NEWLINE (os.path.join(gen_res_src_dir, 'content_java/res_crunched'),NEWLINE os.path.join(gen_res_target_dir, 'content_java/res_crunched')),NEWLINE (os.path.join(gen_res_src_dir, 'content_java/res_grit'),NEWLINE os.path.join(gen_res_target_dir, 'content_java/res_grit')),NEWLINE (os.path.join(gen_res_src_dir, 'content_java/res_v14_compatibility'),NEWLINE os.path.join(gen_res_target_dir, 'content_java/res_v14_compatibility')),NEWLINENEWLINE (os.path.join(gen_res_src_dir, 'xwalk_core_java/java_R'),NEWLINE os.path.join(gen_res_target_dir, 'xwalk_core_java/java_R')),NEWLINE (os.path.join(gen_res_src_dir, 'xwalk_core_java/res_crunched'),NEWLINE os.path.join(gen_res_target_dir, 'xwalk_core_java/res_crunched')),NEWLINE (os.path.join(gen_res_src_dir, 'xwalk_core_java/res_grit'),NEWLINE os.path.join(gen_res_target_dir, 'xwalk_core_java/res_grit')),NEWLINE (os.path.join(gen_res_src_dir, 'xwalk_core_java/res_v14_compatibility'),NEWLINE os.path.join(gen_res_target_dir, 'xwalk_core_java/res_v14_compatibility')),NEWLINENEWLINE # The app wrapper code. It's the template Java code.NEWLINE (os.path.join(source_code_dir, 'xwalk/app/android/app_template'),NEWLINE os.path.join(target_dir, 'app_src')),NEWLINENEWLINE # Copy below 5 files to overwrite the existing ones from Chromium.NEWLINE (os.path.join(gyp_src_dir, 'util/build_utils.py'),NEWLINE os.path.join(gyp_target_dir, 'util')),NEWLINE (os.path.join(gyp_src_dir, 'dex.py'), gyp_target_dir),NEWLINE (os.path.join(gyp_src_dir, 'finalize_apk.py'), gyp_target_dir),NEWLINE (os.path.join(gyp_src_dir, 'jar.py'), gyp_target_dir),NEWLINE (os.path.join(gyp_src_dir, 'javac.py'), gyp_target_dir),NEWLINENEWLINE # Build and python tools.NEWLINE (os.path.join(tools_src_dir, 'ant'),NEWLINE os.path.join(target_dir, 'scripts/ant')),NEWLINE (os.path.join(tools_src_dir, 'customize.py'), target_dir),NEWLINE (os.path.join(tools_src_dir, 'handle_permissions.py'), target_dir),NEWLINE (os.path.join(tools_src_dir, 'handle_xml.py'), target_dir),NEWLINE (os.path.join(tools_src_dir, 'make_apk.py'), target_dir),NEWLINE (os.path.join(tools_src_dir, 'manifest_json_parser.py'), target_dir),NEWLINE (os.path.join(tools_src_dir, 'parse_xpk.py'), target_dir)NEWLINE ]NEWLINENEWLINE for index in range(len(source_target_list)):NEWLINE source_path, target_path = source_target_list[index]NEWLINENEWLINE # Process source.NEWLINE if not os.path.exists(source_path):NEWLINE print ('The source path "%s" does not exist.' % source_path)NEWLINE continueNEWLINENEWLINE source_is_file = os.path.isfile(source_path)NEWLINENEWLINE # Process target.NEWLINE if source_is_file and not os.path.exists(target_path):NEWLINE os.makedirs(target_path)NEWLINENEWLINE # Do copy.NEWLINE if source_is_file:NEWLINE shutil.copy(source_path, target_path)NEWLINE else:NEWLINE shutil.copytree(source_path, target_path)NEWLINENEWLINE # Remove unused files.NEWLINE mode = os.path.basename(os.path.dirname(target_dir))NEWLINE RemoveUnusedFilesInReleaseMode(mode, os.path.join(target_dir, 'native_libs'))NEWLINENEWLINENEWLINEdef main(args):NEWLINE if len(args) != 1:NEWLINE print 'You must provide only one argument: folder to update'NEWLINE return 1NEWLINE target_dir = args[0]NEWLINE src_dir = os.path.dirname(target_dir)NEWLINE Clean(target_dir)NEWLINE PrepareFromChromium(target_dir)NEWLINE PrepareFromXwalk(src_dir, target_dir)NEWLINENEWLINENEWLINEif __name__ == '__main__':NEWLINE sys.exit(main(sys.argv[1:]))NEWLINE |
"""NEWLINEMetric Learning for Kernel Regression (MLKR), Weinberger et al.,NEWLINENEWLINEMLKR is an algorithm for supervised metric learning, which learns a distanceNEWLINEfunction by directly minimising the leave-one-out regression error. ThisNEWLINEalgorithm can also be viewed as a supervised variation of PCA and can be usedNEWLINEfor dimensionality reduction and high dimensional data visualization.NEWLINE"""NEWLINEfrom __future__ import division, print_functionNEWLINEimport numpy as npNEWLINEfrom scipy.optimize import minimizeNEWLINEfrom scipy.spatial.distance import pdist, squareformNEWLINEfrom sklearn.decomposition import PCANEWLINEfrom sklearn.utils.validation import check_X_yNEWLINENEWLINEfrom .base_metric import BaseMetricLearnerNEWLINENEWLINEEPS = np.finfo(float).epsNEWLINENEWLINENEWLINEclass MLKR(BaseMetricLearner):NEWLINE """Metric Learning for Kernel Regression (MLKR)"""NEWLINE def __init__(self, num_dims=None, A0=None, epsilon=0.01, alpha=0.0001,NEWLINE max_iter=1000):NEWLINE """NEWLINE Initialize MLKR.NEWLINENEWLINE ParametersNEWLINE ----------NEWLINE num_dims : int, optionalNEWLINE Dimensionality of reduced space (defaults to dimension of X)NEWLINENEWLINE A0: array-like, optionalNEWLINE Initialization of transformation matrix. Defaults to PCA loadings.NEWLINENEWLINE epsilon: float, optionalNEWLINE Step size for congujate gradient descent.NEWLINENEWLINE alpha: float, optionalNEWLINE Stopping criterion for congujate gradient descent.NEWLINENEWLINE max_iter: int, optionalNEWLINE Cap on number of congugate gradient iterations.NEWLINE """NEWLINE self.num_dims = num_dimsNEWLINE self.A0 = A0NEWLINE self.epsilon = epsilonNEWLINE self.alpha = alphaNEWLINE self.max_iter = max_iterNEWLINENEWLINE def _process_inputs(self, X, y):NEWLINE self.X_, y = check_X_y(X, y)NEWLINE n, d = self.X_.shapeNEWLINE if y.shape[0] != n:NEWLINE raise ValueError('Data and label lengths mismatch: %d != %d'NEWLINE % (n, y.shape[0]))NEWLINENEWLINE A = self.A0NEWLINE m = self.num_dimsNEWLINE if m is None:NEWLINE m = dNEWLINE if A is None:NEWLINE # initialize to PCA transformation matrixNEWLINE # note: not the same as n_components=m !NEWLINE A = PCA().fit(X).components_.T[:m]NEWLINE elif A.shape != (m, d):NEWLINE raise ValueError('A0 needs shape (%d,%d) but got %s' % (NEWLINE m, d, A.shape))NEWLINE return self.X_, y, ANEWLINENEWLINE def fit(self, X, y):NEWLINE """NEWLINE Fit MLKR modelNEWLINENEWLINE Parameters:NEWLINE ----------NEWLINE X : (n x d) array of samplesNEWLINE y : (n) data labelsNEWLINE """NEWLINE X, y, A = self._process_inputs(X, y)NEWLINENEWLINE # note: this line takes (n*n*d) memory!NEWLINE # for larger datasets, we'll need to compute dX as we goNEWLINE dX = (X[None] - X[:, None]).reshape((-1, X.shape[1]))NEWLINENEWLINE res = minimize(_loss, A.ravel(), (X, y, dX), method='CG', jac=True,NEWLINE tol=self.alpha,NEWLINE options=dict(maxiter=self.max_iter, eps=self.epsilon))NEWLINE self.transformer_ = res.x.reshape(A.shape)NEWLINE self.n_iter_ = res.nitNEWLINE return selfNEWLINENEWLINE def transformer(self):NEWLINE return self.transformer_NEWLINENEWLINENEWLINEdef _loss(flatA, X, y, dX):NEWLINE A = flatA.reshape((-1, X.shape[1]))NEWLINE dist = pdist(X, metric='mahalanobis', VI=A.T.dot(A))NEWLINE K = squareform(np.exp(-dist**2))NEWLINE denom = np.maximum(K.sum(axis=0), EPS)NEWLINE yhat = K.dot(y) / denomNEWLINE ydiff = yhat - yNEWLINE cost = (ydiff**2).sum()NEWLINENEWLINE # also compute the gradientNEWLINE np.fill_diagonal(K, 1)NEWLINE W = 2 * K * (np.outer(ydiff, ydiff) / denom)NEWLINE # note: this is the part that the matlab impl drops to C forNEWLINE M = (dX.T * W.ravel()).dot(dX)NEWLINE grad = 2 * A.dot(M)NEWLINE return cost, grad.ravel()NEWLINE |
# coding: utf-8NEWLINE"""NEWLINE Cisco IntersightNEWLINENEWLINE Cisco Intersight is a management platform delivered as a service with embedded analytics for your Cisco and 3rd party IT infrastructure. This platform offers an intelligent level of management that enables IT organizations to analyze, simplify, and automate their environments in more advanced ways than the prior generations of tools. Cisco Intersight provides an integrated and intuitive management experience for resources in the traditional data center as well as at the edge. With flexible deployment options to address complex security needs, getting started with Intersight is quick and easy. Cisco Intersight has deep integration with Cisco UCS and HyperFlex systems allowing for remote deployment, configuration, and ongoing maintenance. The model-based deployment works for a single system in a remote location or hundreds of systems in a data center and enables rapid, standardized configuration and deployment. It also streamlines maintaining those systems whether you are working with small or very large configurations. # noqa: E501NEWLINENEWLINE The version of the OpenAPI document: 1.0.9-1295NEWLINE Contact: intersight@cisco.comNEWLINE Generated by: https://openapi-generator.techNEWLINE"""NEWLINENEWLINEfrom __future__ import absolute_importNEWLINENEWLINEimport unittestNEWLINENEWLINEimport intersightNEWLINEfrom intersight.models.syslog_policy_list import SyslogPolicyList # noqa: E501NEWLINEfrom intersight.rest import ApiExceptionNEWLINENEWLINENEWLINEclass TestSyslogPolicyList(unittest.TestCase):NEWLINE """SyslogPolicyList unit test stubs"""NEWLINE def setUp(self):NEWLINE passNEWLINENEWLINE def tearDown(self):NEWLINE passNEWLINENEWLINE def testSyslogPolicyList(self):NEWLINE """Test SyslogPolicyList"""NEWLINE # FIXME: construct object with mandatory attributes with example valuesNEWLINE # model = intersight.models.syslog_policy_list.SyslogPolicyList() # noqa: E501NEWLINE passNEWLINENEWLINENEWLINEif __name__ == '__main__':NEWLINE unittest.main()NEWLINE |
#!/usr/bin/env python3NEWLINE# -*- coding: utf-8 -*-NEWLINENEWLINENEWLINEdef test_list():NEWLINE L1 = ['Hello', 'World', 18, 'Apple', None]NEWLINE L2 = [i.lower() for i in L1 if isinstance(i, str)]NEWLINE print(L1)NEWLINE print(L2)NEWLINENEWLINENEWLINEif __name__ == '__main__':NEWLINE print('list comprehensions:')NEWLINE print('range 1~10:', [i for i in range(1, 11)])NEWLINE print('square 1~10:', [i * i for i in range(1, 11)])NEWLINE print('square odd 1~10:', [i * i for i in range(1, 11) if i % 2 == 0])NEWLINE print('combine alpha:', [i + j for i in 'ABC' for j in 'XYZ'])NEWLINE test_list()NEWLINE |
from django.conf import settingsNEWLINEfrom hashids import HashidsNEWLINENEWLINENEWLINEdef get_hashids():NEWLINE return Hashids(NEWLINE salt=settings.SECRET_KEY, min_length=4, alphabet="abcdefghijklmnopqrstuvwxyz"NEWLINE )NEWLINENEWLINENEWLINEdef decode_hashid(hashid):NEWLINE hashids = get_hashids()NEWLINENEWLINE return hashids.decode(hashid)[0]NEWLINENEWLINENEWLINEdef encode_hashid(value):NEWLINE hashids = get_hashids()NEWLINENEWLINE return hashids.encode(value)NEWLINE |
# Copyright 2016 Confluent Inc.NEWLINE#NEWLINE# Licensed under the Apache License, Version 2.0 (the "License");NEWLINE# you may not use this file except in compliance with the License.NEWLINE# You may obtain a copy of the License atNEWLINE#NEWLINE# http://www.apache.org/licenses/LICENSE-2.0NEWLINE#NEWLINE# Unless required by applicable law or agreed to in writing, softwareNEWLINE# distributed under the License is distributed on an "AS IS" BASIS,NEWLINE# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.NEWLINE# See the License for the specific language governing permissions andNEWLINE# limitations under the License.NEWLINENEWLINENEWLINEimport datetimeNEWLINEimport jsonNEWLINEimport osNEWLINEimport reNEWLINEimport signalNEWLINEimport socketNEWLINEimport sysNEWLINEimport timeNEWLINENEWLINENEWLINEclass VerifiableClient(object):NEWLINE """NEWLINE Generic base class for a kafkatest verifiable client.NEWLINE Implements the common kafkatest protocol and semantics.NEWLINE """NEWLINE def __init__(self, conf):NEWLINE """NEWLINE """NEWLINE super(VerifiableClient, self).__init__()NEWLINE self.conf = confNEWLINE self.conf['client.id'] = 'python@' + socket.gethostname()NEWLINE self.run = TrueNEWLINE signal.signal(signal.SIGTERM, self.sig_term)NEWLINE self.dbg('Pid is %d' % os.getpid())NEWLINENEWLINE def sig_term(self, sig, frame):NEWLINE self.dbg('SIGTERM')NEWLINE self.run = FalseNEWLINENEWLINE @staticmethodNEWLINE def _timestamp():NEWLINE return time.strftime('%H:%M:%S', time.localtime())NEWLINENEWLINE def dbg(self, s):NEWLINE """ Debugging printout """NEWLINE sys.stderr.write('%% %s DEBUG: %s\n' % (self._timestamp(), s))NEWLINENEWLINE def err(self, s, term=False):NEWLINE """ Error printout, if term=True the process will terminate immediately. """NEWLINE sys.stderr.write('%% %s ERROR: %s\n' % (self._timestamp(), s))NEWLINE if term:NEWLINE sys.stderr.write('%% FATAL ERROR ^\n')NEWLINE sys.exit(1)NEWLINENEWLINE def send(self, d):NEWLINE """ Send dict as JSON to stdout for consumtion by kafkatest handler """NEWLINE d['_time'] = str(datetime.datetime.now())NEWLINE self.dbg('SEND: %s' % json.dumps(d))NEWLINE sys.stdout.write('%s\n' % json.dumps(d))NEWLINE sys.stdout.flush()NEWLINENEWLINE @staticmethodNEWLINE def set_config(conf, args):NEWLINE """ Set client config properties using args dict. """NEWLINE for n, v in args.iteritems():NEWLINE if v is None:NEWLINE continueNEWLINE # Things to ignoreNEWLINE if '.' not in n:NEWLINE # App config, skipNEWLINE continueNEWLINE if n.startswith('topic.'):NEWLINE # Set "topic.<...>" properties on default topic conf dictNEWLINE conf['default.topic.config'][n[6:]] = vNEWLINE elif n == 'partition.assignment.strategy':NEWLINE # Convert Java class name to config value.NEWLINE # "org.apache.kafka.clients.consumer.RangeAssignor" -> "range"NEWLINE conf[n] = re.sub(r'org.apache.kafka.clients.consumer.(\w+)Assignor',NEWLINE lambda x: x.group(1).lower(), v)NEWLINE else:NEWLINE conf[n] = vNEWLINE |
#!/usr/bin/env pythonNEWLINE# -*- coding: utf-8 -*-NEWLINE# @Time : 2018/12/24 10:05 AMNEWLINE# @Author : zhangzhenNEWLINE# @Site : NEWLINE# @File : torch_lstm_classification.pyNEWLINE# @Software: PyCharmNEWLINEimport torchNEWLINEimport torchvisionNEWLINEfrom torch import nnNEWLINEimport torch.utils.data as DataNEWLINEfrom torch.autograd import VariableNEWLINEimport torchvision.datasets as dsNEWLINEimport torchvision.transforms as transformsNEWLINEimport matplotlib.pyplot as pltNEWLINENEWLINEtorch.manual_seed(1) # reproducibleNEWLINENEWLINE# hyper ParametersNEWLINEEPOCH = 1NEWLINEBATCH_SIZE = 128NEWLINETIME_STEP = 28NEWLINEINPUT_SIZE = 28NEWLINELR = 0.01NEWLINEDOWNLOAD_MNIST = FalseNEWLINEROOT = '/Users/zhangzhen/gitRepository/AnalyticsVidhya/data/mnist'NEWLINEtrain_data = torchvision.datasets.MNIST(NEWLINE root=ROOT,NEWLINE train=True,NEWLINE transform=torchvision.transforms.ToTensor(),NEWLINE download=DOWNLOAD_MNIST,NEWLINE)NEWLINENEWLINE# plt.imshow(train_data.train_data[0], cmap='gray')NEWLINE# plt.show()NEWLINEtest_data = torchvision.datasets.MNIST(NEWLINE root=ROOT,NEWLINE train=False,NEWLINE)NEWLINENEWLINE# batch settingNEWLINEtrain_loader = Data.DataLoader(NEWLINE dataset=train_data,NEWLINE batch_size=BATCH_SIZE,NEWLINE shuffle=TrueNEWLINE)NEWLINE# simplify data setNEWLINEtest_x = Variable(test_data.test_data, volatile=True).type(torch.FloatTensor)[: 2000]/255.NEWLINEtest_y = test_data.test_labels.numpy().squeeze()[: 2000]NEWLINENEWLINEprint(test_x.shape, test_y.shape)NEWLINENEWLINENEWLINEclass RNN(nn.Module):NEWLINENEWLINE def __init__(self):NEWLINE super(RNN, self).__init__()NEWLINENEWLINE self.rnn = nn.LSTM(NEWLINE input_size=INPUT_SIZE,NEWLINE hidden_size=64,NEWLINE num_layers=2,NEWLINE batch_first=True, # False -> (time_step, batch, input) True -> (batch, time_step, input)NEWLINE )NEWLINE self.out = nn.Linear(64, 10)NEWLINENEWLINE def forward(self, *input):NEWLINE r_out, h_state = self.rnn(input[0], None) # x-> (batch, time_step, input_size)NEWLINE out = self.out(r_out[:, -1, :]) # (batch, time_step, input)NEWLINE return outNEWLINENEWLINENEWLINEif __name__ == '__main__':NEWLINENEWLINE rnn = RNN()NEWLINE # print(rnn)NEWLINE optimizer = torch.optim.Adam(rnn.parameters(), lr=LR)NEWLINE loss_func = nn.CrossEntropyLoss()NEWLINENEWLINE for epoch in range(EPOCH):NEWLINE for step, (x, y) in enumerate(train_loader):NEWLINE b_x = Variable(x.view(-1, 28, 28))NEWLINE b_y = Variable(y)NEWLINE output = rnn(b_x)NEWLINE loss = loss_func(output, b_y)NEWLINENEWLINE optimizer.zero_grad()NEWLINE loss.backward()NEWLINE optimizer.step()NEWLINENEWLINE if step % 50 == 0:NEWLINE test_out = rnn(test_x)NEWLINE pred_y = torch.max(test_out, 1)[1].data.numpy().squeeze()NEWLINE acc = sum(pred_y==test_y)/test_y.sizeNEWLINE print('Epoch:', epoch, '| train loss: %.4f' % loss.item(), 'test acc: %.4f' % acc)NEWLINENEWLINE # print 10 predictions from test dataNEWLINE test_output = rnn(test_x[:10])NEWLINE pred_y = torch.max(test_output, 1)[1].data.numpy().squeeze()NEWLINE print(pred_y, 'prediction number')NEWLINE print(test_y[:10], 'real number')NEWLINE |
# Generated by Django 2.0 on 2019-12-22 18:26NEWLINENEWLINEfrom django.db import migrations, modelsNEWLINENEWLINENEWLINEclass Migration(migrations.Migration):NEWLINENEWLINE dependencies = [NEWLINE ('products', '0012_auto_20191222_2354'),NEWLINE ]NEWLINENEWLINE operations = [NEWLINE migrations.AlterField(NEWLINE model_name='product',NEWLINE name='slug',NEWLINE field=models.SlugField(blank=True, unique=True),NEWLINE ),NEWLINE ]NEWLINE |
# coding: utf-8NEWLINENEWLINE"""NEWLINE HyperOneNEWLINENEWLINE HyperOne API # noqa: E501NEWLINENEWLINE The version of the OpenAPI document: 0.1.0NEWLINE Generated by: https://openapi-generator.techNEWLINE"""NEWLINENEWLINENEWLINEimport pprintNEWLINEimport re # noqa: F401NEWLINENEWLINEimport sixNEWLINENEWLINEfrom h1.configuration import ConfigurationNEWLINENEWLINENEWLINEclass Vault(object):NEWLINE """NOTE: This class is auto generated by OpenAPI Generator.NEWLINE Ref: https://openapi-generator.techNEWLINENEWLINE Do not edit the class manually.NEWLINE """NEWLINENEWLINE """NEWLINE Attributes:NEWLINE openapi_types (dict): The key is attribute nameNEWLINE and the value is attribute type.NEWLINE attribute_map (dict): The key is attribute nameNEWLINE and the value is json key in definition.NEWLINE """NEWLINE openapi_types = {NEWLINE 'id': 'str',NEWLINE 'name': 'str',NEWLINE 'flavour': 'str',NEWLINE 'modified_on': 'datetime',NEWLINE 'modified_by': 'str',NEWLINE 'created_on': 'datetime',NEWLINE 'created_by': 'str',NEWLINE 'state': 'str',NEWLINE 'project': 'str',NEWLINE 'uri': 'str',NEWLINE 'size_used': 'float',NEWLINE 'size': 'float',NEWLINE 'fqdn': 'str',NEWLINE 'tag': 'list[Tag]'NEWLINE }NEWLINENEWLINE attribute_map = {NEWLINE 'id': 'id',NEWLINE 'name': 'name',NEWLINE 'flavour': 'flavour',NEWLINE 'modified_on': 'modifiedOn',NEWLINE 'modified_by': 'modifiedBy',NEWLINE 'created_on': 'createdOn',NEWLINE 'created_by': 'createdBy',NEWLINE 'state': 'state',NEWLINE 'project': 'project',NEWLINE 'uri': 'uri',NEWLINE 'size_used': 'sizeUsed',NEWLINE 'size': 'size',NEWLINE 'fqdn': 'fqdn',NEWLINE 'tag': 'tag'NEWLINE }NEWLINENEWLINE def __init__(self, id=None, name=None, flavour=None, modified_on=None, modified_by=None, created_on=None, created_by=None, state=None, project=None, uri=None, size_used=None, size=None, fqdn=None, tag=None, local_vars_configuration=None): # noqa: E501NEWLINE """Vault - a model defined in OpenAPI""" # noqa: E501NEWLINE if local_vars_configuration is None:NEWLINE local_vars_configuration = Configuration()NEWLINE self.local_vars_configuration = local_vars_configurationNEWLINENEWLINE self._id = NoneNEWLINE self._name = NoneNEWLINE self._flavour = NoneNEWLINE self._modified_on = NoneNEWLINE self._modified_by = NoneNEWLINE self._created_on = NoneNEWLINE self._created_by = NoneNEWLINE self._state = NoneNEWLINE self._project = NoneNEWLINE self._uri = NoneNEWLINE self._size_used = NoneNEWLINE self._size = NoneNEWLINE self._fqdn = NoneNEWLINE self._tag = NoneNEWLINE self.discriminator = NoneNEWLINENEWLINE if id is not None:NEWLINE self.id = idNEWLINE if name is not None:NEWLINE self.name = nameNEWLINE if flavour is not None:NEWLINE self.flavour = flavourNEWLINE if modified_on is not None:NEWLINE self.modified_on = modified_onNEWLINE if modified_by is not None:NEWLINE self.modified_by = modified_byNEWLINE if created_on is not None:NEWLINE self.created_on = created_onNEWLINE if created_by is not None:NEWLINE self.created_by = created_byNEWLINE if state is not None:NEWLINE self.state = stateNEWLINE if project is not None:NEWLINE self.project = projectNEWLINE if uri is not None:NEWLINE self.uri = uriNEWLINE if size_used is not None:NEWLINE self.size_used = size_usedNEWLINE if size is not None:NEWLINE self.size = sizeNEWLINE if fqdn is not None:NEWLINE self.fqdn = fqdnNEWLINE if tag is not None:NEWLINE self.tag = tagNEWLINENEWLINE @propertyNEWLINE def id(self):NEWLINE """Gets the id of this Vault. # noqa: E501NEWLINENEWLINENEWLINE :return: The id of this Vault. # noqa: E501NEWLINE :rtype: strNEWLINE """NEWLINE return self._idNEWLINENEWLINE @id.setterNEWLINE def id(self, id):NEWLINE """Sets the id of this Vault.NEWLINENEWLINENEWLINE :param id: The id of this Vault. # noqa: E501NEWLINE :type: strNEWLINE """NEWLINENEWLINE self._id = idNEWLINENEWLINE @propertyNEWLINE def name(self):NEWLINE """Gets the name of this Vault. # noqa: E501NEWLINENEWLINENEWLINE :return: The name of this Vault. # noqa: E501NEWLINE :rtype: strNEWLINE """NEWLINE return self._nameNEWLINENEWLINE @name.setterNEWLINE def name(self, name):NEWLINE """Sets the name of this Vault.NEWLINENEWLINENEWLINE :param name: The name of this Vault. # noqa: E501NEWLINE :type: strNEWLINE """NEWLINENEWLINE self._name = nameNEWLINENEWLINE @propertyNEWLINE def flavour(self):NEWLINE """Gets the flavour of this Vault. # noqa: E501NEWLINENEWLINENEWLINE :return: The flavour of this Vault. # noqa: E501NEWLINE :rtype: strNEWLINE """NEWLINE return self._flavourNEWLINENEWLINE @flavour.setterNEWLINE def flavour(self, flavour):NEWLINE """Sets the flavour of this Vault.NEWLINENEWLINENEWLINE :param flavour: The flavour of this Vault. # noqa: E501NEWLINE :type: strNEWLINE """NEWLINENEWLINE self._flavour = flavourNEWLINENEWLINE @propertyNEWLINE def modified_on(self):NEWLINE """Gets the modified_on of this Vault. # noqa: E501NEWLINENEWLINENEWLINE :return: The modified_on of this Vault. # noqa: E501NEWLINE :rtype: datetimeNEWLINE """NEWLINE return self._modified_onNEWLINENEWLINE @modified_on.setterNEWLINE def modified_on(self, modified_on):NEWLINE """Sets the modified_on of this Vault.NEWLINENEWLINENEWLINE :param modified_on: The modified_on of this Vault. # noqa: E501NEWLINE :type: datetimeNEWLINE """NEWLINENEWLINE self._modified_on = modified_onNEWLINENEWLINE @propertyNEWLINE def modified_by(self):NEWLINE """Gets the modified_by of this Vault. # noqa: E501NEWLINENEWLINENEWLINE :return: The modified_by of this Vault. # noqa: E501NEWLINE :rtype: strNEWLINE """NEWLINE return self._modified_byNEWLINENEWLINE @modified_by.setterNEWLINE def modified_by(self, modified_by):NEWLINE """Sets the modified_by of this Vault.NEWLINENEWLINENEWLINE :param modified_by: The modified_by of this Vault. # noqa: E501NEWLINE :type: strNEWLINE """NEWLINENEWLINE self._modified_by = modified_byNEWLINENEWLINE @propertyNEWLINE def created_on(self):NEWLINE """Gets the created_on of this Vault. # noqa: E501NEWLINENEWLINENEWLINE :return: The created_on of this Vault. # noqa: E501NEWLINE :rtype: datetimeNEWLINE """NEWLINE return self._created_onNEWLINENEWLINE @created_on.setterNEWLINE def created_on(self, created_on):NEWLINE """Sets the created_on of this Vault.NEWLINENEWLINENEWLINE :param created_on: The created_on of this Vault. # noqa: E501NEWLINE :type: datetimeNEWLINE """NEWLINENEWLINE self._created_on = created_onNEWLINENEWLINE @propertyNEWLINE def created_by(self):NEWLINE """Gets the created_by of this Vault. # noqa: E501NEWLINENEWLINENEWLINE :return: The created_by of this Vault. # noqa: E501NEWLINE :rtype: strNEWLINE """NEWLINE return self._created_byNEWLINENEWLINE @created_by.setterNEWLINE def created_by(self, created_by):NEWLINE """Sets the created_by of this Vault.NEWLINENEWLINENEWLINE :param created_by: The created_by of this Vault. # noqa: E501NEWLINE :type: strNEWLINE """NEWLINENEWLINE self._created_by = created_byNEWLINENEWLINE @propertyNEWLINE def state(self):NEWLINE """Gets the state of this Vault. # noqa: E501NEWLINENEWLINENEWLINE :return: The state of this Vault. # noqa: E501NEWLINE :rtype: strNEWLINE """NEWLINE return self._stateNEWLINENEWLINE @state.setterNEWLINE def state(self, state):NEWLINE """Sets the state of this Vault.NEWLINENEWLINENEWLINE :param state: The state of this Vault. # noqa: E501NEWLINE :type: strNEWLINE """NEWLINE allowed_values = ["Online", "Off", "Unknown", "Processing", "NotCreated"] # noqa: E501NEWLINE if self.local_vars_configuration.client_side_validation and state not in allowed_values: # noqa: E501NEWLINE raise ValueError(NEWLINE "Invalid value for `state` ({0}), must be one of {1}" # noqa: E501NEWLINE .format(state, allowed_values)NEWLINE )NEWLINENEWLINE self._state = stateNEWLINENEWLINE @propertyNEWLINE def project(self):NEWLINE """Gets the project of this Vault. # noqa: E501NEWLINENEWLINENEWLINE :return: The project of this Vault. # noqa: E501NEWLINE :rtype: strNEWLINE """NEWLINE return self._projectNEWLINENEWLINE @project.setterNEWLINE def project(self, project):NEWLINE """Sets the project of this Vault.NEWLINENEWLINENEWLINE :param project: The project of this Vault. # noqa: E501NEWLINE :type: strNEWLINE """NEWLINENEWLINE self._project = projectNEWLINENEWLINE @propertyNEWLINE def uri(self):NEWLINE """Gets the uri of this Vault. # noqa: E501NEWLINENEWLINENEWLINE :return: The uri of this Vault. # noqa: E501NEWLINE :rtype: strNEWLINE """NEWLINE return self._uriNEWLINENEWLINE @uri.setterNEWLINE def uri(self, uri):NEWLINE """Sets the uri of this Vault.NEWLINENEWLINENEWLINE :param uri: The uri of this Vault. # noqa: E501NEWLINE :type: strNEWLINE """NEWLINENEWLINE self._uri = uriNEWLINENEWLINE @propertyNEWLINE def size_used(self):NEWLINE """Gets the size_used of this Vault. # noqa: E501NEWLINENEWLINENEWLINE :return: The size_used of this Vault. # noqa: E501NEWLINE :rtype: floatNEWLINE """NEWLINE return self._size_usedNEWLINENEWLINE @size_used.setterNEWLINE def size_used(self, size_used):NEWLINE """Sets the size_used of this Vault.NEWLINENEWLINENEWLINE :param size_used: The size_used of this Vault. # noqa: E501NEWLINE :type: floatNEWLINE """NEWLINENEWLINE self._size_used = size_usedNEWLINENEWLINE @propertyNEWLINE def size(self):NEWLINE """Gets the size of this Vault. # noqa: E501NEWLINENEWLINENEWLINE :return: The size of this Vault. # noqa: E501NEWLINE :rtype: floatNEWLINE """NEWLINE return self._sizeNEWLINENEWLINE @size.setterNEWLINE def size(self, size):NEWLINE """Sets the size of this Vault.NEWLINENEWLINENEWLINE :param size: The size of this Vault. # noqa: E501NEWLINE :type: floatNEWLINE """NEWLINENEWLINE self._size = sizeNEWLINENEWLINE @propertyNEWLINE def fqdn(self):NEWLINE """Gets the fqdn of this Vault. # noqa: E501NEWLINENEWLINENEWLINE :return: The fqdn of this Vault. # noqa: E501NEWLINE :rtype: strNEWLINE """NEWLINE return self._fqdnNEWLINENEWLINE @fqdn.setterNEWLINE def fqdn(self, fqdn):NEWLINE """Sets the fqdn of this Vault.NEWLINENEWLINENEWLINE :param fqdn: The fqdn of this Vault. # noqa: E501NEWLINE :type: strNEWLINE """NEWLINENEWLINE self._fqdn = fqdnNEWLINENEWLINE @propertyNEWLINE def tag(self):NEWLINE """Gets the tag of this Vault. # noqa: E501NEWLINENEWLINENEWLINE :return: The tag of this Vault. # noqa: E501NEWLINE :rtype: list[Tag]NEWLINE """NEWLINE return self._tagNEWLINENEWLINE @tag.setterNEWLINE def tag(self, tag):NEWLINE """Sets the tag of this Vault.NEWLINENEWLINENEWLINE :param tag: The tag of this Vault. # noqa: E501NEWLINE :type: list[Tag]NEWLINE """NEWLINENEWLINE self._tag = tagNEWLINENEWLINE def to_dict(self):NEWLINE """Returns the model properties as a dict"""NEWLINE result = {}NEWLINENEWLINE for attr, _ in six.iteritems(self.openapi_types):NEWLINE value = getattr(self, attr)NEWLINE if isinstance(value, list):NEWLINE result[attr] = list(map(NEWLINE lambda x: x.to_dict() if hasattr(x, "to_dict") else x,NEWLINE valueNEWLINE ))NEWLINE elif hasattr(value, "to_dict"):NEWLINE result[attr] = value.to_dict()NEWLINE elif isinstance(value, dict):NEWLINE result[attr] = dict(map(NEWLINE lambda item: (item[0], item[1].to_dict())NEWLINE if hasattr(item[1], "to_dict") else item,NEWLINE value.items()NEWLINE ))NEWLINE else:NEWLINE result[attr] = valueNEWLINENEWLINE return resultNEWLINENEWLINE def to_str(self):NEWLINE """Returns the string representation of the model"""NEWLINE return pprint.pformat(self.to_dict())NEWLINENEWLINE def __repr__(self):NEWLINE """For `print` and `pprint`"""NEWLINE return self.to_str()NEWLINENEWLINE def __eq__(self, other):NEWLINE """Returns true if both objects are equal"""NEWLINE if not isinstance(other, Vault):NEWLINE return FalseNEWLINENEWLINE return self.to_dict() == other.to_dict()NEWLINENEWLINE def __ne__(self, other):NEWLINE """Returns true if both objects are not equal"""NEWLINE if not isinstance(other, Vault):NEWLINE return TrueNEWLINENEWLINE return self.to_dict() != other.to_dict()NEWLINE |
# Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved.NEWLINE#NEWLINE# Licensed under the Apache License, Version 2.0 (the "License");NEWLINE# you may not use this file except in compliance with the License.NEWLINE# You may obtain a copy of the License atNEWLINE#NEWLINE# http://www.apache.org/licenses/LICENSE-2.0NEWLINE#NEWLINE# Unless required by applicable law or agreed to in writing, softwareNEWLINE# distributed under the License is distributed on an "AS IS" BASIS,NEWLINE# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.NEWLINE# See the License for the specific language governing permissions andNEWLINE# limitations under the License.NEWLINENEWLINEimport argparseNEWLINEimport osNEWLINEimport randomNEWLINEimport timeNEWLINEimport mathNEWLINEimport sysNEWLINEfrom functools import partialNEWLINENEWLINEimport numpy as npNEWLINEimport paddleNEWLINENEWLINEimport paddlenlp as ppnlpNEWLINEfrom paddlenlp.transformers import LinearDecayWithWarmupNEWLINEfrom paddlenlp.metrics import ChunkEvaluatorNEWLINEfrom paddlenlp.datasets import load_datasetNEWLINEfrom paddlenlp.data import Stack, Tuple, PadNEWLINEfrom paddlenlp.utils.log import loggerNEWLINENEWLINE# from paddlenlp.trainer.trainer_base import TrainerBaseNEWLINEsys.path.insert(0, os.path.abspath("."))NEWLINEfrom utils import DictNEWLINENEWLINENEWLINEdef tokenize_and_align_labels(example, tokenizer, no_entity_id,NEWLINE max_seq_len=512):NEWLINE labels = example['labels']NEWLINE example = example['tokens']NEWLINE tokenized_input = tokenizer(NEWLINE example,NEWLINE is_split_into_words=True,NEWLINE max_seq_len=max_seq_len, )NEWLINENEWLINE # -2 for [CLS] and [SEP]NEWLINE if len(tokenized_input['input_ids']) - 2 < len(labels):NEWLINE labels = labels[:len(tokenized_input['input_ids']) - 2]NEWLINE tokenized_input['labels'] = [no_entity_id] + labels + [no_entity_id]NEWLINE tokenized_input['labels'] += [no_entity_id] * (NEWLINE len(tokenized_input['input_ids']) - len(tokenized_input['labels']))NEWLINENEWLINE return tokenized_inputNEWLINENEWLINENEWLINEdef ner_collator(tokenizer, args):NEWLINE batchify_fn = lambda samples, fn=Dict({NEWLINE 'input_ids': Pad(axis=0, pad_val=tokenizer.pad_token_id, dtype='int32'), # inputNEWLINE 'token_type_ids': Pad(axis=0, pad_val=tokenizer.pad_token_type_id, dtype='int32'), # segmentNEWLINE 'labels': Pad(axis=0, pad_val=args.ignore_label, dtype='int64') # labelNEWLINE }): fn(samples)NEWLINENEWLINE return batchify_fnNEWLINENEWLINENEWLINEdef ner_trans_fn(example, tokenizer, args):NEWLINE return tokenize_and_align_labels(NEWLINE example,NEWLINE tokenizer=tokenizer,NEWLINE no_entity_id=args.no_entity_id,NEWLINE max_seq_len=args.max_seq_length)NEWLINE |
#!/usr/bin/env pythonNEWLINE## -*- coding: utf-8 -*-NEWLINE# Licensed to Cloudera, Inc. under oneNEWLINE# or more contributor license agreements. See the NOTICE fileNEWLINE# distributed with this work for additional informationNEWLINE# regarding copyright ownership. Cloudera, Inc. licenses this fileNEWLINE# to you under the Apache License, Version 2.0 (theNEWLINE# "License"); you may not use this file except in complianceNEWLINE# with the License. You may obtain a copy of the License atNEWLINE#NEWLINE# http://www.apache.org/licenses/LICENSE-2.0NEWLINE#NEWLINE# Unless required by applicable law or agreed to in writing, softwareNEWLINE# distributed under the License is distributed on an "AS IS" BASIS,NEWLINE# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.NEWLINE# See the License for the specific language governing permissions andNEWLINE# limitations under the License.NEWLINENEWLINEimport jsonNEWLINEimport sysNEWLINEimport unittestNEWLINENEWLINEfrom django.urls import reverseNEWLINEfrom nose.plugins.skip import SkipTestNEWLINEfrom nose.tools import assert_equal, assert_true, assert_falseNEWLINENEWLINEfrom desktop.auth.backend import rewrite_user, is_adminNEWLINEfrom desktop.conf import ENABLE_CONNECTORS, ENABLE_ORGANIZATIONSNEWLINEfrom desktop.lib.connectors.api import _get_installed_connectorsNEWLINEfrom desktop.lib.django_test_util import make_logged_in_clientNEWLINENEWLINEfrom useradmin.models import User, update_app_permissions, get_default_user_group, ConnectorNEWLINEfrom useradmin.permissions import HuePermission, GroupPermissionNEWLINENEWLINEif sys.version_info[0] > 2:NEWLINE from unittest.mock import patch, MockNEWLINEelse:NEWLINE from mock import patch, MockNEWLINENEWLINENEWLINEclass TestApi(object):NEWLINENEWLINE def setUp(self):NEWLINE self.client = make_logged_in_client(username="admin_test_connector", recreate=True, is_superuser=False, is_admin=True)NEWLINE self.user = User.objects.get(username="admin_test_connector")NEWLINENEWLINE @classmethodNEWLINE def setUpClass(cls):NEWLINE cls._class_resets = [NEWLINE ENABLE_CONNECTORS.set_for_testing(True),NEWLINE ]NEWLINENEWLINE @classmethodNEWLINE def tearDownClass(cls):NEWLINE for reset in cls._class_resets:NEWLINE reset()NEWLINENEWLINENEWLINE def test_install_connector_examples(self):NEWLINENEWLINE with patch('desktop.lib.connectors.api._create_connector_examples') as _create_connector_examples:NEWLINE with patch('desktop.lib.connectors.api.update_app_permissions') as update_app_permissions:NEWLINE _create_connector_examples.return_value = ['Connector 1'], ['Connector 2']NEWLINENEWLINE response = self.client.post(NEWLINE reverse('connectors.api.install_connector_examples')NEWLINE )NEWLINE data = json.loads(response.content)NEWLINENEWLINE assert_equal(200, response.status_code)NEWLINE assert_equal(NEWLINE 'Added connectors: Connector 1. 'NEWLINE 'Already installed connectors: Connector 2',NEWLINE data['message'],NEWLINE dataNEWLINE )NEWLINE |
#!/usr/bin/pythonNEWLINE# -*- coding: utf-8 -*-NEWLINE#NEWLINE# Copyright: (c) 2018, F5 Networks Inc.NEWLINE# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)NEWLINENEWLINEfrom __future__ import absolute_import, division, print_functionNEWLINE__metaclass__ = typeNEWLINENEWLINEDOCUMENTATION = r'''NEWLINE---NEWLINEmodule: bigip_gtm_globalNEWLINEshort_description: Manages global GTM settingsNEWLINEdescription:NEWLINE - Manages global BIG-IP GTM (now BIG-IP DNS) settings. These settings include general, load balancing, and metricsNEWLINE related settings.NEWLINEversion_added: "1.0.0"NEWLINEoptions:NEWLINE synchronization:NEWLINE description:NEWLINE - Specifies whether this system is a member of a synchronization group.NEWLINE - When you enable synchronization, the system periodically queries other systems inNEWLINE the synchronization group to obtain and distribute configuration and metrics collectionNEWLINE updates.NEWLINE - The synchronization group may contain systems configured as Global Traffic Manager (DNS) andNEWLINE Link Controller systems.NEWLINE type: boolNEWLINE synchronization_group_name:NEWLINE description:NEWLINE - Specifies the name of the synchronization group to which the system belongs.NEWLINE type: strNEWLINE synchronize_zone_files:NEWLINE description:NEWLINE - Specifies the system synchronizes Domain Name System (DNS) zone files among theNEWLINE synchronization group members.NEWLINE type: boolNEWLINEextends_documentation_fragment: f5networks.f5_modules.f5NEWLINEauthor:NEWLINE - Tim Rupp (@caphrim007)NEWLINE - Wojciech Wypior (@wojtek0806)NEWLINE'''NEWLINENEWLINEEXAMPLES = r'''NEWLINE- name: Configure synchronization settingsNEWLINE bigip_gtm_global:NEWLINE synchronization: yesNEWLINE synchronization_group_name: my-groupNEWLINE synchronize_zone_files: yesNEWLINE state: presentNEWLINE provider:NEWLINE user: adminNEWLINE password: secretNEWLINE server: lb.mydomain.comNEWLINE delegate_to: localhostNEWLINE'''NEWLINENEWLINERETURN = r'''NEWLINEsynchronization:NEWLINE description: The synchronization setting on the system.NEWLINE returned: changedNEWLINE type: boolNEWLINE sample: trueNEWLINEsynchronization_group_name:NEWLINE description: The synchronization group name.NEWLINE returned: changedNEWLINE type: strNEWLINE sample: my-groupNEWLINEsynchronize_zone_files:NEWLINE description: Whether or not the system will synchronize zone files.NEWLINE returned: changedNEWLINE type: strNEWLINE sample: my-groupNEWLINE'''NEWLINEfrom datetime import datetimeNEWLINEfrom ansible.module_utils.basic import AnsibleModuleNEWLINENEWLINEfrom ..module_utils.bigip import F5RestClientNEWLINEfrom ..module_utils.common import (NEWLINE F5ModuleError, AnsibleF5Parameters, f5_argument_specNEWLINE)NEWLINEfrom ..module_utils.icontrol import (NEWLINE module_provisioned, tmos_versionNEWLINE)NEWLINEfrom ..module_utils.teem import send_teemNEWLINENEWLINENEWLINEclass Parameters(AnsibleF5Parameters):NEWLINE api_map = {NEWLINE 'synchronizationGroupName': 'synchronization_group_name',NEWLINE 'synchronizeZoneFiles': 'synchronize_zone_files',NEWLINE }NEWLINENEWLINE api_attributes = [NEWLINE 'synchronizeZoneFiles',NEWLINE 'synchronizationGroupName',NEWLINE 'synchronization',NEWLINE ]NEWLINENEWLINE returnables = [NEWLINE 'synchronization',NEWLINE 'synchronization_group_name',NEWLINE 'synchronize_zone_files',NEWLINE ]NEWLINENEWLINE updatables = [NEWLINE 'synchronization',NEWLINE 'synchronization_group_name',NEWLINE 'synchronize_zone_files',NEWLINE ]NEWLINENEWLINENEWLINEclass ApiParameters(Parameters):NEWLINE @propertyNEWLINE def synchronization(self):NEWLINE if self._values['synchronization'] is None:NEWLINE return NoneNEWLINE elif self._values['synchronization'] == 'no':NEWLINE return FalseNEWLINE else:NEWLINE return TrueNEWLINENEWLINE @propertyNEWLINE def synchronize_zone_files(self):NEWLINE if self._values['synchronize_zone_files'] is None:NEWLINE return NoneNEWLINE elif self._values['synchronize_zone_files'] == 'no':NEWLINE return FalseNEWLINE else:NEWLINE return TrueNEWLINENEWLINE @propertyNEWLINE def synchronization_group_name(self):NEWLINE if self._values['synchronization_group_name'] is None:NEWLINE return NoneNEWLINE return str(self._values['synchronization_group_name'])NEWLINENEWLINENEWLINEclass ModuleParameters(Parameters):NEWLINE passNEWLINENEWLINENEWLINEclass Changes(Parameters):NEWLINE def to_return(self):NEWLINE result = {}NEWLINE try:NEWLINE for returnable in self.returnables:NEWLINE result[returnable] = getattr(self, returnable)NEWLINE result = self._filter_params(result)NEWLINE except Exception:NEWLINE raiseNEWLINE return resultNEWLINENEWLINENEWLINEclass UsableChanges(Changes):NEWLINE @propertyNEWLINE def synchronization(self):NEWLINE if self._values['synchronization'] is None:NEWLINE return NoneNEWLINE elif self._values['synchronization'] is False:NEWLINE return 'no'NEWLINE else:NEWLINE return 'yes'NEWLINENEWLINE @propertyNEWLINE def synchronize_zone_files(self):NEWLINE if self._values['synchronize_zone_files'] is None:NEWLINE return NoneNEWLINE elif self._values['synchronize_zone_files'] is False:NEWLINE return 'no'NEWLINE else:NEWLINE return 'yes'NEWLINENEWLINENEWLINEclass ReportableChanges(Changes):NEWLINE passNEWLINENEWLINENEWLINEclass Difference(object):NEWLINE def __init__(self, want, have=None):NEWLINE self.want = wantNEWLINE self.have = haveNEWLINENEWLINE def compare(self, param):NEWLINE try:NEWLINE result = getattr(self, param)NEWLINE return resultNEWLINE except AttributeError:NEWLINE return self.__default(param)NEWLINENEWLINE def __default(self, param):NEWLINE attr1 = getattr(self.want, param)NEWLINE try:NEWLINE attr2 = getattr(self.have, param)NEWLINE if attr1 != attr2:NEWLINE return attr1NEWLINE except AttributeError:NEWLINE return attr1NEWLINENEWLINE @propertyNEWLINE def synchronization_group_name(self):NEWLINE if self.want.synchronization_group_name is None:NEWLINE return NoneNEWLINE if self.want.synchronization_group_name == '' and self.have.synchronization_group_name is None:NEWLINE return NoneNEWLINE if self.want.synchronization_group_name != self.have.synchronization_group_name:NEWLINE return self.want.synchronization_group_nameNEWLINENEWLINENEWLINEclass ModuleManager(object):NEWLINE def __init__(self, *args, **kwargs):NEWLINE self.module = kwargs.get('module', None)NEWLINE self.client = F5RestClient(**self.module.params)NEWLINE self.want = ModuleParameters(params=self.module.params)NEWLINE self.have = ApiParameters()NEWLINE self.changes = UsableChanges()NEWLINENEWLINE def _update_changed_options(self):NEWLINE diff = Difference(self.want, self.have)NEWLINE updatables = Parameters.updatablesNEWLINE changed = dict()NEWLINE for k in updatables:NEWLINE change = diff.compare(k)NEWLINE if change is None:NEWLINE continueNEWLINE else:NEWLINE if isinstance(change, dict):NEWLINE changed.update(change)NEWLINE else:NEWLINE changed[k] = changeNEWLINE if changed:NEWLINE self.changes = UsableChanges(params=changed)NEWLINE return TrueNEWLINE return FalseNEWLINENEWLINE def _announce_deprecations(self, result):NEWLINE warnings = result.pop('__warnings', [])NEWLINE for warning in warnings:NEWLINE self.client.module.deprecate(NEWLINE msg=warning['msg'],NEWLINE version=warning['version']NEWLINE )NEWLINENEWLINE def exec_module(self):NEWLINE start = datetime.now().isoformat()NEWLINE version = tmos_version(self.client)NEWLINE if not module_provisioned(self.client, 'gtm'):NEWLINE raise F5ModuleError(NEWLINE "GTM must be provisioned to use this module."NEWLINE )NEWLINE result = dict()NEWLINENEWLINE changed = self.present()NEWLINENEWLINE reportable = ReportableChanges(params=self.changes.to_return())NEWLINE changes = reportable.to_return()NEWLINE result.update(**changes)NEWLINE result.update(dict(changed=changed))NEWLINE self._announce_deprecations(result)NEWLINE send_teem(start, self.client, self.module, version)NEWLINE return resultNEWLINENEWLINE def present(self):NEWLINE return self.update()NEWLINENEWLINE def update(self):NEWLINE self.have = self.read_current_from_device()NEWLINE if not self.should_update():NEWLINE return FalseNEWLINE if self.module.check_mode:NEWLINE return TrueNEWLINE self.update_on_device()NEWLINE return TrueNEWLINENEWLINE def should_update(self):NEWLINE result = self._update_changed_options()NEWLINE if result:NEWLINE return TrueNEWLINE return FalseNEWLINENEWLINE def update_on_device(self):NEWLINE params = self.changes.api_params()NEWLINE uri = "https://{0}:{1}/mgmt/tm/gtm/global-settings/general/".format(NEWLINE self.client.provider['server'],NEWLINE self.client.provider['server_port'],NEWLINE )NEWLINE resp = self.client.api.patch(uri, json=params)NEWLINE try:NEWLINE response = resp.json()NEWLINE except ValueError as ex:NEWLINE raise F5ModuleError(str(ex))NEWLINENEWLINE if resp.status in [200, 201] or 'code' in response and response['code'] in [200, 201]:NEWLINE return TrueNEWLINE raise F5ModuleError(resp.content)NEWLINENEWLINE def read_current_from_device(self):NEWLINE uri = "https://{0}:{1}/mgmt/tm/gtm/global-settings/general/".format(NEWLINE self.client.provider['server'],NEWLINE self.client.provider['server_port'],NEWLINE )NEWLINE resp = self.client.api.get(uri)NEWLINE try:NEWLINE response = resp.json()NEWLINE except ValueError as ex:NEWLINE raise F5ModuleError(str(ex))NEWLINENEWLINE if resp.status in [200, 201] or 'code' in response and response['code'] in [200, 201]:NEWLINE return ApiParameters(params=response)NEWLINE raise F5ModuleError(resp.content)NEWLINENEWLINENEWLINEclass ArgumentSpec(object):NEWLINE def __init__(self):NEWLINE self.supports_check_mode = TrueNEWLINE argument_spec = dict(NEWLINE synchronization=dict(type='bool'),NEWLINE synchronization_group_name=dict(),NEWLINE synchronize_zone_files=dict(type='bool')NEWLINE )NEWLINE self.argument_spec = {}NEWLINE self.argument_spec.update(f5_argument_spec)NEWLINE self.argument_spec.update(argument_spec)NEWLINENEWLINENEWLINEdef main():NEWLINE spec = ArgumentSpec()NEWLINENEWLINE module = AnsibleModule(NEWLINE argument_spec=spec.argument_spec,NEWLINE supports_check_mode=spec.supports_check_mode,NEWLINE )NEWLINENEWLINE try:NEWLINE mm = ModuleManager(module=module)NEWLINE results = mm.exec_module()NEWLINE module.exit_json(**results)NEWLINE except F5ModuleError as ex:NEWLINE module.fail_json(msg=str(ex))NEWLINENEWLINENEWLINEif __name__ == '__main__':NEWLINE main()NEWLINE |
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.NEWLINE#NEWLINE# Licensed under the Apache License, Version 2.0 (the "License");NEWLINE# you may not use this file except in compliance with the License.NEWLINE# You may obtain a copy of the License atNEWLINE#NEWLINE# http://www.apache.org/licenses/LICENSE-2.0NEWLINE#NEWLINE# Unless required by applicable law or agreed to in writing, softwareNEWLINE# distributed under the License is distributed on an "AS IS" BASIS,NEWLINE# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.NEWLINE# See the License for the specific language governing permissions andNEWLINE# limitations under the License.NEWLINENEWLINEfrom __future__ import print_functionNEWLINEimport copyNEWLINEimport warningsNEWLINEimport paddleNEWLINEimport osNEWLINEimport numpy as npNEWLINEfrom paddle.fluid.framework import dygraph_onlyNEWLINEfrom paddle.fluid import compilerNEWLINEfrom .role_maker import UserDefinedRoleMaker, PaddleCloudRoleMaker, RoleMakerBaseNEWLINEfrom .strategy_compiler import StrategyCompilerNEWLINEfrom .distributed_strategy import DistributedStrategyNEWLINEfrom .meta_optimizer_factory import MetaOptimizerFactoryNEWLINEfrom .runtime_factory import RuntimeFactoryNEWLINEfrom paddle.fluid.wrapped_decorator import wrap_decoratorNEWLINEfrom paddle.fluid.dygraph import parallel_helperNEWLINEfrom . import topology as tpNEWLINEfrom .topology import ParallelModeNEWLINEfrom ..meta_parallel import TensorParallel, model_parallel_random_seedNEWLINEfrom ..meta_parallel import PipelineParallel, ShardingParallelNEWLINEfrom ..meta_optimizers import HybridParallelOptimizerNEWLINEfrom ..meta_optimizers import HybridParallelGradScalerNEWLINENEWLINE__all__ = []NEWLINENEWLINENEWLINEdef _inited_runtime_handler_(func):NEWLINE def __impl__(*args, **kwargs):NEWLINE cls = args[0]NEWLINENEWLINE if cls._runtime_handle is None:NEWLINE raise ValueError("Fleet can not find suitable runtime handler")NEWLINENEWLINE return func(*args, **kwargs)NEWLINENEWLINE return __impl__NEWLINENEWLINENEWLINEdef _is_non_distributed_check_(func):NEWLINE def __impl__(*args, **kwargs):NEWLINE cls = args[0]NEWLINENEWLINE if cls._role_maker is not None and cls._role_maker._is_non_distributed(NEWLINE ) is True:NEWLINE warnings.warn(NEWLINE "%s() function doesn't work when use non_distributed fleet." %NEWLINE (func.__name__))NEWLINE returnNEWLINENEWLINE return func(*args, **kwargs)NEWLINENEWLINE return __impl__NEWLINENEWLINENEWLINEinited_runtime_handler = wrap_decorator(_inited_runtime_handler_)NEWLINEis_non_distributed_check = wrap_decorator(_is_non_distributed_check_)NEWLINENEWLINENEWLINEclass Fleet(object):NEWLINE """NEWLINE Unified API for distributed training of PaddlePaddleNEWLINE Please reference the https://github.com/PaddlePaddle/FleetX for detailsNEWLINENEWLINENEWLINE Returns:NEWLINE Fleet: A Fleet instanceNEWLINENEWLINE Example for collective training:NEWLINENEWLINE .. code-block:: pythonNEWLINENEWLINE import paddleNEWLINE paddle.enable_static()NEWLINE import paddle.distributed.fleet as fleetNEWLINENEWLINE fleet.init(is_collective=True)NEWLINENEWLINE strategy = fleet.DistributedStrategy()NEWLINE optimizer = paddle.optimizer.SGD(learning_rate=0.001)NEWLINE optimizer = fleet.distributed_optimizer(optimizer, strategy=strategy)NEWLINENEWLINE # do distributed trainingNEWLINENEWLINENEWLINE Example for parameter server training:NEWLINENEWLINE .. code-block:: pythonNEWLINENEWLINE import paddleNEWLINE paddle.enable_static()NEWLINE import paddle.distributed.fleet as fleetNEWLINE strategy = fleet.DistributedStrategy()NEWLINE fleet.init(strategy=strategy)NEWLINENEWLINE optimizer = paddle.optimizer.SGD(learning_rate=0.001)NEWLINE optimizer = fleet.distributed_optimizer(optimizer)NEWLINENEWLINE if fleet.is_first_worker():NEWLINE print("this is first worker")NEWLINENEWLINE print("current node index: {}".format(fleet.worker_index()))NEWLINE print("total number of worker num: {}".format(fleet.worker_num()))NEWLINENEWLINE if fleet.is_worker():NEWLINE print("this is worker")NEWLINE print("worker endpoints: {}".format(fleet.worker_endpoints(to_string=True)))NEWLINENEWLINE print("server num: {}".format(fleet.server_num()))NEWLINE print("server endpoints: {}".format(fleet.server_endpoints(to_string=True)))NEWLINENEWLINE if fleet.is_server():NEWLINE print("this is server")NEWLINE fleet.stop_worker()NEWLINENEWLINENEWLINE """NEWLINENEWLINE def __init__(self):NEWLINE self._role_maker = NoneNEWLINE self.strategy_compiler = NoneNEWLINE self._is_collective = FalseNEWLINE self._runtime_handle = NoneNEWLINE self._util = NoneNEWLINE self._context = {}NEWLINENEWLINE def init(self, role_maker=None, is_collective=False, strategy=None):NEWLINE """NEWLINE Initialize role_maker in Fleet.NEWLINENEWLINE This function is responsible for the distributed architectureNEWLINE what you want to run your code behind.NEWLINENEWLINE Args:NEWLINE role_maker (RoleMakerBase, optional): A ``RoleMakerBase`` containing the configurationNEWLINE of environment variables related to distributed training.If you did not initialize NEWLINE the rolemaker by yourself, it will be automatically initialized to PaddleRoleMaker.NEWLINE The default value is None.NEWLINE is_collective (Boolean, optional): A ``Boolean`` variable determines whether the program NEWLINE runs on the CPU or GPU. False means set distributed training using CPU, and True meansNEWLINE GPU.The default value is False.The default value is False.NEWLINE strategy (DistributedStrategy): Extra properties for distributed training. NEWLINE For details, please refer to paddle.distributed.fleet.DistributedStrategy. Default: None.NEWLINENEWLINENEWLINE Returns:NEWLINE NoneNEWLINENEWLINE Examples1:NEWLINENEWLINE .. code-block:: pythonNEWLINENEWLINE import paddle.distributed.fleet as fleetNEWLINE fleet.init()NEWLINENEWLINE Examples2:NEWLINENEWLINE .. code-block:: pythonNEWLINENEWLINE import paddle.distributed.fleet as fleetNEWLINE fleet.init(is_collective=True)NEWLINENEWLINE Examples3:NEWLINENEWLINE .. code-block:: pythonNEWLINENEWLINE import paddle.distributed.fleet as fleetNEWLINE role = fleet.PaddleCloudRoleMaker()NEWLINE fleet.init(role)NEWLINENEWLINE Examples4:NEWLINENEWLINE .. code-block:: pythonNEWLINENEWLINE import paddle.distributed.fleet as fleetNEWLINE strategy = fleet.DistributedStrategy()NEWLINE fleet.init(strategy=strategy)NEWLINENEWLINE """NEWLINE if strategy is None:NEWLINE strategy = DistributedStrategy()NEWLINE self._user_defined_strategy = copy.deepcopy(strategy)NEWLINENEWLINE if role_maker is None:NEWLINE if isinstance(is_collective, bool):NEWLINE self._is_collective = is_collectiveNEWLINE self._role_maker = PaddleCloudRoleMaker(NEWLINE is_collective=self._is_collective)NEWLINE else:NEWLINE raise ValueError(NEWLINE "`is_collective` should be instance of `bool`, but got {}".NEWLINE format(type(is_collective)))NEWLINE else:NEWLINE if isinstance(role_maker, RoleMakerBase):NEWLINE self._role_maker = role_makerNEWLINE self._is_collective = role_maker._is_collectiveNEWLINE else:NEWLINE raise ValueError(NEWLINE "`role_maker` should be subclass of `RoleMakerBase`, but got {}".NEWLINE format(type(role_maker)))NEWLINE self._role_maker._generate_role()NEWLINENEWLINE import paddle.distributed.fleet as fleetNEWLINE fleet.util._set_role_maker(self._role_maker)NEWLINENEWLINE self.strategy_compiler = StrategyCompiler()NEWLINENEWLINE if self._role_maker._is_non_distributed() and self._is_collective:NEWLINE if paddle.fluid.core.is_compiled_with_cuda():NEWLINE gpus_num = paddle.fluid.core.get_cuda_device_count()NEWLINE if gpus_num != 1:NEWLINE raise ValueError(NEWLINE "CUDA_VISIBLE_DEVICES shoule be set only 1 card if you use `python` to launch fleet program."NEWLINE )NEWLINENEWLINE if paddle.fluid.framework.in_dygraph_mode():NEWLINE if self.worker_num() == 1:NEWLINE # if worker_num is 1, should construct default topology & hcgNEWLINE self._topology = tp.CommunicateTopology()NEWLINE self._hcg = tp.HybridCommunicateGroup(self._topology)NEWLINE returnNEWLINE if parallel_helper._is_parallel_ctx_initialized():NEWLINE warnings.warn(NEWLINE "The dygraph parallel environment has been initialized.")NEWLINE else:NEWLINE # FLAGS_nccl_nrings is used for dynamic graph multi-stream communicationNEWLINE if "FLAGS_nccl_nrings" in os.environ:NEWLINE warnings.warn(NEWLINE "You have set the environment variable FLAGS_nccl_nrings "NEWLINE "outside the program, so the nccl_comm_num in "NEWLINE "DistributedStrategy will not take effect here.")NEWLINE else:NEWLINE os.environ["FLAGS_nccl_nrings"] = str(NEWLINE self._user_defined_strategy.nccl_comm_num)NEWLINE paddle.distributed.init_parallel_env()NEWLINENEWLINE # init hybrid parallel environment in dygraphNEWLINE if tp._HYBRID_PARALLEL_GROUP is None:NEWLINE self._init_hybrid_parallel_env()NEWLINE else:NEWLINE warnings.warn(NEWLINE "The dygraph hybrid parallel environment has been initialized."NEWLINE )NEWLINE elif self._is_collective:NEWLINE use_sharding = self._user_defined_strategy.shardingNEWLINENEWLINE # global groupNEWLINE global_rank = self.worker_index()NEWLINE global_world_size = self.worker_num()NEWLINE # NOTE(wangxi): see sharding_optimizerNEWLINE global_ring_id = 3 if use_sharding else 0NEWLINE global_ranks = list(range(global_world_size))NEWLINENEWLINE if tp._HYBRID_PARALLEL_GROUP is None: tp._CommunicateGroup()NEWLINE cg = tp._HYBRID_PARALLEL_GROUPNEWLINE self._hcg = cgNEWLINE cg.set_comm_group('global', global_rank, global_world_size,NEWLINE global_ring_id, global_ranks)NEWLINENEWLINE use_tensor_parallel = self._user_defined_strategy.tensor_parallelNEWLINE use_mp = use_sharding or use_tensor_parallelNEWLINENEWLINE # hybrid groupNEWLINE if use_mp is False: returnNEWLINENEWLINE mp_degree_sharding = 1NEWLINE mp_degree_tensor_parallel = 1NEWLINE if use_sharding:NEWLINE sharding_configs = self._user_defined_strategy.sharding_configsNEWLINE mp_degree_sharding = int(sharding_configs['mp_degree'])NEWLINENEWLINE if use_tensor_parallel:NEWLINE tensor_parallel_configs = self._user_defined_strategy.tensor_parallel_configsNEWLINE mp_degree_tensor_parallel = int(tensor_parallel_configs[NEWLINE 'tensor_parallel_degree'])NEWLINENEWLINE if use_sharding and use_tensor_parallel:NEWLINE assert mp_degree_sharding == mp_degree_tensor_parallelNEWLINENEWLINE mp_degree = mp_degree_sharding if use_sharding else mp_degree_tensor_parallelNEWLINENEWLINE if mp_degree > 1:NEWLINE assert global_world_size % mp_degree == 0NEWLINE # NOTE(wangxi): mp_ring_id sync with sharding_optimizer.py _build_groupsNEWLINE mp_ring_id = 0NEWLINE mp_rank = global_rank % mp_degreeNEWLINE mp_group_id = global_rank // mp_degreeNEWLINE mp_group_ranks = [NEWLINE idx for idx in global_ranksNEWLINE if idx // mp_degree == mp_group_idNEWLINE ]NEWLINE cg.set_comm_group('model', mp_rank, mp_degree, mp_ring_id,NEWLINE mp_group_ranks)NEWLINENEWLINE def _init_hybrid_parallel_env(self):NEWLINE """initialize the hybrid environmentNEWLINE """NEWLINE self.hybrid_configs = self._user_defined_strategy.hybrid_configsNEWLINE self.dp_degree = self.hybrid_configs["dp_degree"]NEWLINE self.mp_degree = self.hybrid_configs["mp_degree"]NEWLINE self.pp_degree = self.hybrid_configs["pp_degree"]NEWLINE self.sharding_degree = self.hybrid_configs["sharding_degree"]NEWLINENEWLINE assert self.mp_degree >= 0, "mp_degree should be greater or equal to 0"NEWLINE assert self.pp_degree >= 0, "pp_degree should be greater or equal to 0"NEWLINE assert self.sharding_degree >= 0, "sharding_degree should be greater or equal to 0"NEWLINENEWLINE self.mp_degree = max(self.mp_degree, 1)NEWLINE self.pp_degree = max(self.pp_degree, 1)NEWLINENEWLINE if self.dp_degree < 0:NEWLINE nranks = paddle.distributed.get_world_size()NEWLINE self.dp_degree = nranks // (self.mp_degree * self.pp_degree)NEWLINENEWLINE self.dp_degree = max(self.dp_degree, 1)NEWLINENEWLINE self._topology = tp.CommunicateTopology(NEWLINE hybrid_group_names=["data", "pipe", "sharding", "model"],NEWLINE dims=[NEWLINE self.dp_degree, self.pp_degree, self.sharding_degree,NEWLINE self.mp_degreeNEWLINE ])NEWLINENEWLINE self._hcg = tp.HybridCommunicateGroup(self._topology)NEWLINENEWLINE if self.mp_degree > 1:NEWLINE tensor_parallel_configs = self._user_defined_strategy.tensor_parallel_configsNEWLINE tensor_init_seed = tensor_parallel_configs["tensor_init_seed"]NEWLINE if tensor_init_seed == -1:NEWLINE model_parallel_random_seed()NEWLINE else:NEWLINE model_parallel_random_seed(tensor_init_seed)NEWLINENEWLINE def get_hybrid_communicate_group(self):NEWLINE assert self._hcg is not NoneNEWLINE return self._hcgNEWLINENEWLINE def get_hybrid_parallel_topology(self):NEWLINE assert self._topology is not NoneNEWLINE return self._topologyNEWLINENEWLINE def is_first_worker(self):NEWLINE """NEWLINE Check whether the node is the first instance of worker.NEWLINENEWLINE Returns:NEWLINE bool: True if this is the first node of worker,NEWLINE False if not.NEWLINENEWLINE Examples:NEWLINENEWLINE .. code-block:: pythonNEWLINENEWLINE import paddle.distributed.fleet as fleetNEWLINE fleet.init()NEWLINE fleet.is_first_worker()NEWLINENEWLINE """NEWLINE return self._role_maker._is_first_worker()NEWLINENEWLINE def worker_index(self):NEWLINE """NEWLINE Get current worker index.NEWLINENEWLINE Returns:NEWLINE int: node idNEWLINENEWLINE Examples:NEWLINENEWLINE .. code-block:: pythonNEWLINENEWLINE import paddle.distributed.fleet as fleetNEWLINE fleet.init()NEWLINE fleet.worker_index()NEWLINENEWLINE """NEWLINE return self._role_maker._worker_index()NEWLINENEWLINE def worker_num(self):NEWLINE """NEWLINE Get current total worker number.NEWLINENEWLINE Returns:NEWLINE int: worker numbersNEWLINENEWLINE Examples:NEWLINENEWLINE .. code-block:: pythonNEWLINENEWLINE import paddle.distributed.fleet as fleetNEWLINE fleet.init()NEWLINE fleet.worker_num()NEWLINENEWLINE """NEWLINE return self._role_maker._worker_num()NEWLINENEWLINE def node_num(self):NEWLINE return self._role_maker._get_node_num()NEWLINENEWLINE def local_rank(self):NEWLINE return self._role_maker._get_local_rank()NEWLINENEWLINE def local_device_ids(self):NEWLINE return self._role_maker._get_local_device_ids()NEWLINENEWLINE def world_device_ids(self):NEWLINE return self._role_maker._get_world_device_ids()NEWLINENEWLINE def is_worker(self):NEWLINE """NEWLINE Check whether the node is an instance of worker.NEWLINENEWLINE Returns:NEWLINE bool: True if this is a node of worker,NEWLINE False if not.NEWLINENEWLINE Examples:NEWLINENEWLINE .. code-block:: pythonNEWLINENEWLINE import paddle.distributed.fleet as fleetNEWLINE fleet.init()NEWLINE fleet.is_worker()NEWLINENEWLINE """NEWLINE return self._role_maker._is_worker()NEWLINENEWLINE def worker_endpoints(self, to_string=False):NEWLINE """NEWLINE Get current worker endpoints, such as ["127.0.0.1:1001", "127.0.0.1:1002"].NEWLINENEWLINE Returns:NEWLINE list/string: server endpointsNEWLINENEWLINE Examples:NEWLINENEWLINE .. code-block:: pythonNEWLINENEWLINE import paddle.distributed.fleet as fleetNEWLINE fleet.init()NEWLINE fleet.worker_endpoints()NEWLINENEWLINE """NEWLINE if to_string:NEWLINE return ",".join(self._role_maker._get_trainer_endpoints())NEWLINE else:NEWLINE return self._role_maker._get_trainer_endpoints()NEWLINENEWLINE def server_num(self):NEWLINE """NEWLINE Get current total worker number.NEWLINENEWLINE Returns:NEWLINE int: server numberNEWLINENEWLINE Examples:NEWLINENEWLINE .. code-block:: pythonNEWLINENEWLINE import paddle.distributed.fleet as fleetNEWLINE fleet.init()NEWLINE fleet.server_num()NEWLINE """NEWLINE return len(self._role_maker._get_pserver_endpoints())NEWLINENEWLINE def server_index(self):NEWLINE """NEWLINE Get current server index.NEWLINENEWLINE Returns:NEWLINE int: node idNEWLINENEWLINE Examples:NEWLINENEWLINE .. code-block:: pythonNEWLINENEWLINE import paddle.distributed.fleet as fleetNEWLINE fleet.init()NEWLINE fleet.server_index()NEWLINENEWLINE """NEWLINE return self._role_maker._server_index()NEWLINENEWLINE def server_endpoints(self, to_string=False):NEWLINE """NEWLINE Get current server endpoints, such as ["127.0.0.1:1001", "127.0.0.1:1002"].NEWLINENEWLINE Returns:NEWLINE list/string: server endpointsNEWLINENEWLINE Examples:NEWLINENEWLINE .. code-block:: pythonNEWLINENEWLINE import paddle.distributed.fleet as fleetNEWLINE fleet.init()NEWLINE fleet.server_endpoints()NEWLINENEWLINE """NEWLINENEWLINE if to_string:NEWLINE return ",".join(self._role_maker._get_pserver_endpoints())NEWLINE else:NEWLINE return self._role_maker._get_pserver_endpoints()NEWLINENEWLINE def is_server(self):NEWLINE """NEWLINE Check whether the node is an instance of server.NEWLINENEWLINE Returns:NEWLINE bool: True if this is a node of server,NEWLINE False if not.NEWLINENEWLINE Examples:NEWLINENEWLINE .. code-block:: pythonNEWLINENEWLINE import paddle.distributed.fleet as fleetNEWLINE fleet.init()NEWLINE fleet.is_server()NEWLINENEWLINE """NEWLINE return self._role_maker._is_server(NEWLINE ) or self._role_maker._is_heter_worker()NEWLINENEWLINE def barrier_worker(self):NEWLINE """NEWLINE barrier all workersNEWLINENEWLINE Returns:NEWLINE NoneNEWLINE """NEWLINE self._role_maker._barrier("worker")NEWLINENEWLINE @is_non_distributed_checkNEWLINE @inited_runtime_handlerNEWLINE def init_worker(self):NEWLINE """NEWLINE initialize `Communicator` for parameter server training.NEWLINENEWLINENEWLINE Returns:NEWLINE NoneNEWLINENEWLINE Examples:NEWLINENEWLINE .. code-block:: pythonNEWLINENEWLINE import paddle.distributed.fleet as fleetNEWLINE fleet.init()NEWLINENEWLINE # build netNEWLINE # fleet.distributed_optimizer(...)NEWLINENEWLINE fleet.init_worker()NEWLINENEWLINE """NEWLINE self._runtime_handle._init_worker()NEWLINENEWLINE @is_non_distributed_checkNEWLINE @inited_runtime_handlerNEWLINE def init_server(self, *args, **kwargs):NEWLINE """NEWLINE init_server executor to initialize startup program,NEWLINE if the `args` is not empty, it will run load_persistables for increment training.NEWLINENEWLINENEWLINE Returns:NEWLINE NoneNEWLINENEWLINE Examples:NEWLINENEWLINE .. code-block:: pythonNEWLINENEWLINE import paddle.distributed.fleet as fleetNEWLINE fleet.init()NEWLINENEWLINE # build netNEWLINE # fleet.distributed_optimizer(...)NEWLINENEWLINE fleet.init_server()NEWLINENEWLINE """NEWLINE self._runtime_handle._init_server(*args, **kwargs)NEWLINENEWLINE def load_model(self, path, mode):NEWLINE """NEWLINE load fleet model from pathNEWLINENEWLINENEWLINE Returns:NEWLINE NoneNEWLINENEWLINE Examples:NEWLINENEWLINE .. code-block:: pythonNEWLINENEWLINE import paddle.distributed.fleet as fleetNEWLINE fleet.init()NEWLINENEWLINE # build netNEWLINE # fleet.distributed_optimizer(...)NEWLINENEWLINE fleet.load_model("path", "mode")NEWLINENEWLINE """NEWLINE self._runtime_handle.load_model(path, mode)NEWLINENEWLINE @is_non_distributed_checkNEWLINE @inited_runtime_handlerNEWLINE def run_server(self):NEWLINE """NEWLINE run server will run pserver main program with executor.NEWLINENEWLINE Returns:NEWLINE NoneNEWLINENEWLINE Examples:NEWLINENEWLINE .. code-block:: pythonNEWLINENEWLINE import paddle.distributed.fleet as fleetNEWLINE fleet.init()NEWLINENEWLINE # build netNEWLINE # fleet.distributed_optimizer(...)NEWLINENEWLINE if fleet.is_server():NEWLINE fleet.init_server()NEWLINENEWLINE """NEWLINE self._runtime_handle._run_server()NEWLINENEWLINE @is_non_distributed_checkNEWLINE @inited_runtime_handlerNEWLINE def stop_worker(self):NEWLINE """NEWLINE stop `Communicator` and give training complete notice to parameter server.NEWLINENEWLINE Returns:NEWLINE NoneNEWLINENEWLINE Examples:NEWLINENEWLINE .. code-block:: pythonNEWLINENEWLINE import paddle.distributed.fleet as fleetNEWLINE fleet.init()NEWLINENEWLINE # build netNEWLINE # fleet.distributed_optimizer(...)NEWLINENEWLINE fleet.init_server()NEWLINENEWLINE """NEWLINE self._runtime_handle._stop_worker()NEWLINENEWLINE def save(self, dirname, feed=[], fetch=[], **configs):NEWLINE inference = TrueNEWLINENEWLINE if not feed and not fetch:NEWLINE inference = FalseNEWLINENEWLINE place = paddle.CPUPlace()NEWLINE executor = paddle.static.Executor(place)NEWLINENEWLINE if inference:NEWLINE feeded_var_names = []NEWLINE fetch_var_names = []NEWLINENEWLINE for var in feed:NEWLINE if isinstance(var, str):NEWLINE feeded_var_names.append(var)NEWLINE elif isinstance(var, paddle.static.Variable):NEWLINE feeded_var_names.append(var.name)NEWLINE else:NEWLINE raise ValueError("feed must be [str|Variable]")NEWLINENEWLINE for var in fetch:NEWLINE if isinstance(var, str):NEWLINE fetch_var_names.append(var)NEWLINE elif isinstance(var, paddle.static.Variable):NEWLINE fetch_var_names.append(var.name)NEWLINE else:NEWLINE raise ValueError("feed must be [str|Variable]")NEWLINENEWLINE fetch_vars = [NEWLINE paddle.static.default_main_program().global_block().var(name)NEWLINE for name in fetch_var_namesNEWLINE ]NEWLINENEWLINE self._runtime_handle._save_inference_model(NEWLINE executor, dirname, feeded_var_names, fetch_vars, None, True, 0)NEWLINE else:NEWLINE increment_mode = 0NEWLINE if "mode" in configs:NEWLINE increment_mode = int(configs["mode"])NEWLINE self._runtime_handle._save_persistables(NEWLINE executor, dirname, main_program=None, mode=increment_mode)NEWLINENEWLINE def save_inference_model(self,NEWLINE executor,NEWLINE dirname,NEWLINE feeded_var_names,NEWLINE target_vars,NEWLINE main_program=None,NEWLINE export_for_deployment=True,NEWLINE mode=0):NEWLINE """NEWLINE save inference model for inference.NEWLINENEWLINE Returns:NEWLINE NoneNEWLINENEWLINE Examples:NEWLINENEWLINE .. code-block:: pythonNEWLINENEWLINE import paddle.distributed.fleet as fleetNEWLINE fleet.init()NEWLINENEWLINE # build netNEWLINE # fleet.distributed_optimizer(...)NEWLINENEWLINE fleet.init_server()NEWLINENEWLINE """NEWLINE # warnings.warn(NEWLINE # "'save_inference_model' is a deprecated, will be deleted after v2.2.0, Please use fleet.save instead."NEWLINE # )NEWLINENEWLINE self._runtime_handle._save_inference_model(NEWLINE executor, dirname, feeded_var_names, target_vars, main_program,NEWLINE export_for_deployment, mode)NEWLINENEWLINE def save_persistables(self, executor, dirname, main_program=None, mode=0):NEWLINE """NEWLINENEWLINE saves all persistable tensors from :code:`main_program` toNEWLINE the folder :code:`dirname`. You can refer toNEWLINENEWLINE The :code:`dirname` is used to specify the folder where persistable tensorsNEWLINE are going to be saved. If you would like to save tensors in separateNEWLINE files, set :code:`filename` None.NEWLINENEWLINE Args:NEWLINE executor(Executor): The executor to run for saving persistable tensors.NEWLINE You can refer to :ref:`api_guide_executor_en` forNEWLINE more details.NEWLINENEWLINE dirname(str, optional): The saving directory path.NEWLINE When you need to save the parameter to the memory, set it to None.NEWLINE main_program(Program, optional): The program whose persistbale tensors willNEWLINE be saved. Default: None.NEWLINENEWLINENEWLINE Returns:NEWLINE NoneNEWLINENEWLINE Examples:NEWLINENEWLINE .. code-block:: textNEWLINENEWLINE import paddleNEWLINE paddle.enable_static()NEWLINE import paddle.distributed.fleet as fleetNEWLINENEWLINE fleet.init()NEWLINENEWLINE # build netNEWLINE # fleet.distributed_optimizer(...)NEWLINENEWLINE exe = paddle.static.Executor(paddle.CPUPlace())NEWLINE fleet.save_persistables(exe, "dirname", paddle.static.default_main_program())NEWLINENEWLINE """NEWLINE # warnings.warn(NEWLINE # "'save_persistables' is a deprecated, will be deleted after v2.2.0, Please use fleet.save instead."NEWLINE # )NEWLINENEWLINE self._runtime_handle._save_persistables(executor, dirname, main_program,NEWLINE mode)NEWLINENEWLINE def shrink(self, threshold):NEWLINE self._runtime_handle._shrink(threshold)NEWLINENEWLINE def distributed_optimizer(self, optimizer, strategy=None):NEWLINE """NEWLINE Optimizer for distributed training.NEWLINENEWLINE For the distributed training, this method would rebuild a new instance of DistributedOptimizer.NEWLINE Which has basic Optimizer function and special features for distributed training.NEWLINENEWLINE Args:NEWLINE optimizer(Optimizer): The executor to run for init server.NEWLINE strategy(DistributedStrategy): Extra properties for distributed optimizer. NEWLINE It is recommended to use DistributedStrategy in fleet.init(). The strategyNEWLINE here is for compatibility. If the strategy in fleet.distributed_optimizer() NEWLINE is not None, then it will overwrite the DistributedStrategy in fleet.init(), NEWLINE which will take effect in distributed training.NEWLINENEWLINE Returns:NEWLINE Fleet: instance of fleet.NEWLINENEWLINE Examples:NEWLINENEWLINE .. code-block:: pythonNEWLINENEWLINE import paddleNEWLINE import paddle.distributed.fleet as fleetNEWLINE fleet.init(is_collective=True)NEWLINE strategy = fleet.DistributedStrategy()NEWLINE optimizer = paddle.optimizer.SGD(learning_rate=0.001)NEWLINE optimizer = fleet.distributed_optimizer(optimizer, strategy=strategy)NEWLINENEWLINE """NEWLINE self.user_defined_optimizer = optimizerNEWLINENEWLINE if strategy is not None:NEWLINE if self._is_collective:NEWLINE warnings.warn(NEWLINE "It is recommended to use DistributedStrategy "NEWLINE "in fleet.init(). The strategy here is only for compatibility. "NEWLINE "If the strategy in fleet.distributed_optimizer() is "NEWLINE "not None, then it will overwrite the DistributedStrategy in fleet.init(), "NEWLINE "which will take effect in distributed training.")NEWLINE self._user_defined_strategy = copy.deepcopy(strategy)NEWLINENEWLINE self._context = {}NEWLINENEWLINE if paddle.fluid.framework.in_dygraph_mode():NEWLINE if self.worker_num() > 1:NEWLINE return HybridParallelOptimizer(optimizer, self._hcg,NEWLINE self._user_defined_strategy)NEWLINE else:NEWLINE return optimizerNEWLINE return selfNEWLINENEWLINE @dygraph_onlyNEWLINE def distributed_model(self, model):NEWLINE """NEWLINE Return distributed data parallel model (Only work in dygraph mode)NEWLINENEWLINE Args:NEWLINE model (Layer): the user-defind model which inherits Layer.NEWLINENEWLINE Returns:NEWLINE distributed data parallel model which inherits Layer.NEWLINENEWLINE Examples:NEWLINENEWLINE .. code-block:: pythonNEWLINENEWLINE import paddleNEWLINE import paddle.nn as nnNEWLINE from paddle.distributed import fleetNEWLINENEWLINE class LinearNet(nn.Layer):NEWLINE def __init__(self):NEWLINE super(LinearNet, self).__init__()NEWLINE self._linear1 = nn.Linear(10, 10)NEWLINE self._linear2 = nn.Linear(10, 1)NEWLINENEWLINE def forward(self, x):NEWLINE return self._linear2(self._linear1(x))NEWLINENEWLINE # 1. initialize fleet environmentNEWLINE fleet.init(is_collective=True)NEWLINENEWLINE # 2. create layer & optimizerNEWLINE layer = LinearNet()NEWLINE loss_fn = nn.MSELoss()NEWLINE adam = paddle.optimizer.Adam(NEWLINE learning_rate=0.001, parameters=layer.parameters())NEWLINENEWLINE # 3. get data_parallel model using fleetNEWLINE adam = fleet.distributed_optimizer(adam)NEWLINE dp_layer = fleet.distributed_model(layer)NEWLINENEWLINE # 4. run layerNEWLINE inputs = paddle.randn([10, 10], 'float32')NEWLINE outputs = dp_layer(inputs)NEWLINE labels = paddle.randn([10, 1], 'float32')NEWLINE loss = loss_fn(outputs, labels)NEWLINENEWLINE print("loss:", loss.numpy())NEWLINENEWLINE loss.backward()NEWLINENEWLINE adam.step()NEWLINE adam.clear_grad()NEWLINENEWLINENEWLINE """NEWLINE assert model is not None, "model should not be None"NEWLINE if self.worker_num() <= 1:NEWLINE return modelNEWLINENEWLINE if self._hcg.get_parallel_mode() == ParallelMode.SHARDING_PARALLEL:NEWLINE distributed_model = ShardingParallel(NEWLINE model, self._hcg, strategy=self._user_defined_strategy)NEWLINE elif self._hcg.get_parallel_mode() == ParallelMode.DATA_PARALLEL:NEWLINE distributed_model = paddle.DataParallel(NEWLINE model,NEWLINE comm_buffer_size=self._user_defined_strategy.NEWLINE fuse_grad_size_in_MB,NEWLINE last_comm_buffer_size=self._user_defined_strategy.NEWLINE last_comm_group_size_MB,NEWLINE find_unused_parameters=self._user_defined_strategy.NEWLINE find_unused_parameters)NEWLINE elif self._hcg.get_parallel_mode() == ParallelMode.TENSOR_PARALLEL:NEWLINE distributed_model = TensorParallel(NEWLINE model, self._hcg, strategy=self._user_defined_strategy)NEWLINE elif self._hcg.get_parallel_mode() == ParallelMode.PIPELINE_PARALLEL:NEWLINE distributed_model = PipelineParallel(NEWLINE model, self._hcg, strategy=self._user_defined_strategy)NEWLINENEWLINE return distributed_modelNEWLINENEWLINE @dygraph_onlyNEWLINE def state_dict(self):NEWLINE """NEWLINE Get state dict information from optimizer.NEWLINE (Only work in dygraph mode)NEWLINENEWLINE Returns: NEWLINE state_dict(dict) : dict contains all the Tensor used by optimizerNEWLINENEWLINE Examples:NEWLINE .. code-block:: pythonNEWLINENEWLINE import numpy as npNEWLINE import paddleNEWLINE from paddle.distributed import fleetNEWLINENEWLINE fleet.init(is_collective=True)NEWLINENEWLINE value = np.arange(26).reshape(2, 13).astype("float32")NEWLINE a = paddle.to_tensor(value)NEWLINENEWLINE layer = paddle.nn.Linear(13, 5)NEWLINE adam = paddle.optimizer.Adam(learning_rate=0.01, parameters=layer.parameters())NEWLINENEWLINE adam = fleet.distributed_optimizer(adam)NEWLINE dp_layer = fleet.distributed_model(layer)NEWLINE state_dict = adam.state_dict()NEWLINE """NEWLINE # imitate target optimizer retrievalNEWLINE return self.user_defined_optimizer.state_dict()NEWLINENEWLINE @dygraph_onlyNEWLINE def set_state_dict(self, state_dict):NEWLINE """NEWLINE Load optimizer state dict.NEWLINE (Only work in dygraph mode)NEWLINENEWLINE Args: NEWLINE state_dict(dict) : Dict contains all the Tensor needed by optimizerNEWLINENEWLINE Returns:NEWLINE NoneNEWLINENEWLINE Examples:NEWLINE .. code-block:: pythonNEWLINENEWLINE import numpy as npNEWLINE import paddleNEWLINE from paddle.distributed import fleetNEWLINENEWLINE fleet.init(is_collective=True)NEWLINENEWLINE value = np.arange(26).reshape(2, 13).astype("float32")NEWLINE a = paddle.to_tensor(value)NEWLINENEWLINE layer = paddle.nn.Linear(13, 5)NEWLINE adam = paddle.optimizer.Adam(learning_rate=0.01, parameters=layer.parameters())NEWLINENEWLINE adam = fleet.distributed_optimizer(adam)NEWLINE dp_layer = fleet.distributed_model(layer)NEWLINE state_dict = adam.state_dict()NEWLINE paddle.save(state_dict, "paddle_dy")NEWLINE para_state_dict = paddle.load("paddle_dy")NEWLINE adam.set_state_dict(para_state_dict)NEWLINE """NEWLINE # imitate target optimizer retrievalNEWLINE return self.user_defined_optimizer.set_state_dict(state_dict)NEWLINENEWLINE @dygraph_onlyNEWLINE def set_lr(self, value):NEWLINE """NEWLINE Set the value of the learning rate manually in the optimizer. NEWLINE (Only work in dygraph mode)NEWLINENEWLINE Args:NEWLINE value (float|Tensor): the value of learning rateNEWLINENEWLINE Returns: NEWLINE None NEWLINENEWLINE Examples:NEWLINE .. code-block:: pythonNEWLINENEWLINE import numpy as npNEWLINE import paddleNEWLINE from paddle.distributed import fleetNEWLINENEWLINE fleet.init(is_collective=True)NEWLINENEWLINE value = np.arange(26).reshape(2, 13).astype("float32")NEWLINE a = paddle.to_tensor(value)NEWLINENEWLINE layer = paddle.nn.Linear(13, 5)NEWLINE adam = paddle.optimizer.Adam(learning_rate=0.01, parameters=layer.parameters())NEWLINENEWLINE adam = fleet.distributed_optimizer(adam)NEWLINE dp_layer = fleet.distributed_model(layer)NEWLINENEWLINE lr_list = [0.2, 0.3, 0.4, 0.5, 0.6]NEWLINE for i in range(5):NEWLINE adam.set_lr(lr_list[i])NEWLINE lr = adam.get_lr()NEWLINE print("current lr is {}".format(lr))NEWLINE # Print:NEWLINE # current lr is 0.2NEWLINE # current lr is 0.3NEWLINE # current lr is 0.4NEWLINE # current lr is 0.5NEWLINE # current lr is 0.6NEWLINE """NEWLINE # imitate target optimizer retrievalNEWLINE return self.user_defined_optimizer.set_lr(value)NEWLINENEWLINE @dygraph_onlyNEWLINE def get_lr(self):NEWLINE """NEWLINE Get current step learning rate.NEWLINE (Only work in dygraph mode)NEWLINENEWLINE Returns:NEWLINE float: The learning rate of the current step.NEWLINENEWLINE Examples:NEWLINENEWLINE .. code-block:: pythonNEWLINENEWLINE import numpy as npNEWLINE import paddleNEWLINE from paddle.distributed import fleetNEWLINENEWLINE fleet.init(is_collective=True)NEWLINENEWLINE value = np.arange(26).reshape(2, 13).astype("float32")NEWLINE a = paddle.to_tensor(value)NEWLINENEWLINE layer = paddle.nn.Linear(13, 5)NEWLINE adam = paddle.optimizer.Adam(learning_rate=0.01, parameters=layer.parameters())NEWLINENEWLINE adam = fleet.distributed_optimizer(adam)NEWLINE dp_layer = fleet.distributed_model(layer)NEWLINENEWLINE lr = adam.get_lr()NEWLINE print(lr) # 0.01NEWLINE """NEWLINE # imitate target optimizer retrievalNEWLINE return self.user_defined_optimizer.get_lr()NEWLINENEWLINE @dygraph_onlyNEWLINE def step(self):NEWLINE """NEWLINE Execute the optimizer once.NEWLINE (Only work in dygraph mode)NEWLINENEWLINE Returns:NEWLINE NoneNEWLINENEWLINE Examples:NEWLINENEWLINE .. code-block:: pythonNEWLINENEWLINE import paddleNEWLINE import paddle.nn as nnNEWLINE from paddle.distributed import fleetNEWLINENEWLINE class LinearNet(nn.Layer):NEWLINE def __init__(self):NEWLINE super(LinearNet, self).__init__()NEWLINE self._linear1 = nn.Linear(10, 10)NEWLINE self._linear2 = nn.Linear(10, 1)NEWLINENEWLINE def forward(self, x):NEWLINE return self._linear2(self._linear1(x))NEWLINENEWLINE # 1. initialize fleet environmentNEWLINE fleet.init(is_collective=True)NEWLINENEWLINE # 2. create layer & optimizerNEWLINE layer = LinearNet()NEWLINE loss_fn = nn.MSELoss()NEWLINE adam = paddle.optimizer.Adam(NEWLINE learning_rate=0.001, parameters=layer.parameters())NEWLINENEWLINE # 3. get data_parallel model using fleetNEWLINE adam = fleet.distributed_optimizer(adam)NEWLINE dp_layer = fleet.distributed_model(layer)NEWLINENEWLINE # 4. run layerNEWLINE inputs = paddle.randn([10, 10], 'float32')NEWLINE outputs = dp_layer(inputs)NEWLINE labels = paddle.randn([10, 1], 'float32')NEWLINE loss = loss_fn(outputs, labels)NEWLINENEWLINE print("loss:", loss.numpy())NEWLINENEWLINE loss.backward()NEWLINENEWLINE adam.step()NEWLINE adam.clear_grad()NEWLINENEWLINENEWLINE """NEWLINE # imitate target optimizer retrievalNEWLINE return self.user_defined_optimizer.step()NEWLINENEWLINE @dygraph_onlyNEWLINE def clear_grad(self):NEWLINE """NEWLINE Clear the gradients of all optimized parameters for model.NEWLINE (Only work in dygraph mode)NEWLINENEWLINE Returns: NEWLINE NoneNEWLINENEWLINE Examples:NEWLINENEWLINE .. code-block:: pythonNEWLINENEWLINE import paddleNEWLINE import paddle.nn as nnNEWLINE from paddle.distributed import fleetNEWLINENEWLINE class LinearNet(nn.Layer):NEWLINE def __init__(self):NEWLINE super(LinearNet, self).__init__()NEWLINE self._linear1 = nn.Linear(10, 10)NEWLINE self._linear2 = nn.Linear(10, 1)NEWLINENEWLINE def forward(self, x):NEWLINE return self._linear2(self._linear1(x))NEWLINENEWLINE # 1. initialize fleet environmentNEWLINE fleet.init(is_collective=True)NEWLINENEWLINE # 2. create layer & optimizerNEWLINE layer = LinearNet()NEWLINE loss_fn = nn.MSELoss()NEWLINE adam = paddle.optimizer.Adam(NEWLINE learning_rate=0.001, parameters=layer.parameters())NEWLINENEWLINE # 3. get data_parallel model using fleetNEWLINE adam = fleet.distributed_optimizer(adam)NEWLINE dp_layer = fleet.distributed_model(layer)NEWLINENEWLINE # 4. run layerNEWLINE inputs = paddle.randn([10, 10], 'float32')NEWLINE outputs = dp_layer(inputs)NEWLINE labels = paddle.randn([10, 1], 'float32')NEWLINE loss = loss_fn(outputs, labels)NEWLINENEWLINE print("loss:", loss.numpy())NEWLINENEWLINE loss.backward()NEWLINENEWLINE adam.step()NEWLINE adam.clear_grad()NEWLINENEWLINE """NEWLINE # imitate target optimizer retrievalNEWLINE return self.user_defined_optimizer.clear_grad()NEWLINENEWLINE def _get_amp_optimizer(self):NEWLINE # imitate target optimizer retrievalNEWLINE amp_optimizer = NoneNEWLINE for optimizer in self.strategy_compiler._get_applied_meta_optimizer():NEWLINE if hasattr(optimizer, 'amp_init'):NEWLINE amp_optimizer = optimizerNEWLINE breakNEWLINENEWLINE if amp_optimizer is None:NEWLINE if hasattr(self.user_defined_optimizer, 'amp_init'):NEWLINE amp_optimizer = self.user_defined_optimizerNEWLINENEWLINE assert amp_optimizer is not None, \NEWLINE "amp_init can only be used when the amp(auto mixed precision) strategy is turned on."NEWLINE return amp_optimizerNEWLINENEWLINE def get_loss_scaling(self):NEWLINE """Return the real-time loss scaling factor.NEWLINE """NEWLINE amp_optimizer = self._get_amp_optimizer()NEWLINE return amp_optimizer.get_loss_scaling()NEWLINENEWLINE def amp_init(self,NEWLINE place,NEWLINE scope=None,NEWLINE test_program=None,NEWLINE use_fp16_test=False):NEWLINE """NEWLINE Init the amp training, such as cast fp32 parameters to fp16 type.NEWLINE NEWLINE Args:NEWLINE place(CUDAPlace): place is used to initialize NEWLINE fp16 parameters with fp32 values.NEWLINE scope(Scope): The scope is used to find fp32 parameters.NEWLINE test_program(Program): The program is used for testing.NEWLINE use_fp16_test(bool): Whether to use fp16 testing.NEWLINE NEWLINE Examples:NEWLINE .. code-block:: pythonNEWLINENEWLINE import numpy as npNEWLINE import paddleNEWLINE import paddle.nn.functional as FNEWLINE paddle.enable_static()NEWLINENEWLINE def run_example_code():NEWLINE place = paddle.CUDAPlace(0)NEWLINE exe = paddle.static.Executor(place)NEWLINE data = paddle.static.data(name='X', shape=[None, 1, 28, 28], dtype='float32')NEWLINE conv2d = paddle.static.nn.conv2d(input=data, num_filters=6, filter_size=3)NEWLINE # 1) Use fp16_guard to control the range of fp16 kernels used.NEWLINE with paddle.static.amp.fp16_guard():NEWLINE bn = paddle.static.nn.batch_norm(input=conv2d, act="relu")NEWLINE pool = F.max_pool2d(bn, kernel_size=2, stride=2)NEWLINE hidden = paddle.static.nn.fc(pool, size=10)NEWLINE loss = paddle.mean(hidden)NEWLINE # 2) Create the optimizer and set `multi_precision` to True.NEWLINE # Setting `multi_precision` to True can avoid the poor accuracyNEWLINE # or the slow convergence in a way. NEWLINE optimizer = paddle.optimizer.Momentum(learning_rate=0.01, multi_precision=True)NEWLINE # 3) These ops in `custom_black_list` will keep in the float32 computation type.NEWLINE amp_list = paddle.static.amp.CustomOpLists(NEWLINE custom_black_list=['pool2d'])NEWLINE # 4) The entry of Paddle AMP.NEWLINE # Enable pure fp16 training by setting `use_pure_fp16` to True.NEWLINE optimizer = paddle.static.amp.decorate(NEWLINE optimizer,NEWLINE amp_list,NEWLINE init_loss_scaling=128.0,NEWLINE use_dynamic_loss_scaling=True,NEWLINE use_pure_fp16=True)NEWLINE # If you don't use the default_startup_program(), you sholud passNEWLINE # your defined `startup_program` into `minimize`.NEWLINE optimizer.minimize(loss)NEWLINE exe.run(paddle.static.default_startup_program())NEWLINE # 5) Use `amp_init` after FP32 parameters initialization(such as `exe.run(startup_program)`).NEWLINE # If you want to perform the testing process, you should pass `test_program` into `amp_init`.NEWLINE optimizer.amp_init(place, scope=paddle.static.global_scope())NEWLINE NEWLINE if paddle.is_compiled_with_cuda() and len(paddle.static.cuda_places()) > 0:NEWLINE run_example_code() NEWLINE """NEWLINE amp_optimizer = self._get_amp_optimizer()NEWLINE return amp_optimizer.amp_init(place, scope, test_program, use_fp16_test)NEWLINENEWLINE def _final_strategy(self):NEWLINE if "valid_strategy" not in self._context:NEWLINE print(NEWLINE "WARNING: You may need to call minimize function before this function is called"NEWLINE )NEWLINE return {}NEWLINE else:NEWLINE return self._context["valid_strategy"]NEWLINENEWLINE def _get_applied_meta_list(self):NEWLINE if "applied_meta_list" not in self._context:NEWLINE print(NEWLINE "WARNING: You may need to call minimize function before _get_applied_meta_list called"NEWLINE )NEWLINE return []NEWLINE else:NEWLINE return self._context["applied_meta_list"]NEWLINENEWLINE def _get_applied_graph_list(self):NEWLINE if "applied_graph_list" not in self._context:NEWLINE print(NEWLINE "WARNING: You may need to call minimize function before _get_applied_graph_list called"NEWLINE )NEWLINE return []NEWLINE else:NEWLINE return self._context["applied_graph_list"]NEWLINENEWLINE def minimize(self,NEWLINE loss,NEWLINE startup_program=None,NEWLINE parameter_list=None,NEWLINE no_grad_set=None):NEWLINE """NEWLINE Add distributed operations to minimize ``loss`` by updating ``parameter_list``.NEWLINENEWLINE Args:NEWLINE loss (Tensor): A ``Tensor`` containing the value to minimize.NEWLINE startup_program (Program, optional): :ref:`api_fluid_Program` forNEWLINE initializing parameters in ``parameter_list``. The default valueNEWLINE is None, at this time :ref:`api_fluid_default_startup_program` will be used.NEWLINE parameter_list (Iterable, optional): Iterable of ``Tensor`` or ``Tensor.name`` to updateNEWLINE to minimize ``loss``. The default value is None, at this time all parametersNEWLINE will be updated.NEWLINE no_grad_set (set, optional): Set of ``Tensor`` or ``Tensor.name`` that don't needNEWLINE to be updated. The default value is None.NEWLINENEWLINE Returns:NEWLINE tuple: tuple (optimize_ops, params_grads), A list of operators appendedNEWLINE by minimize and a list of (param, grad) tensor pairs, param isNEWLINE ``Parameter``, grad is the gradient value corresponding to the parameter.NEWLINE The returned tuple can be passed to ``fetch_list`` in ``Executor.run()`` toNEWLINE indicate program pruning. If so, the program will be pruned by ``feed`` andNEWLINE ``fetch_list`` before run, see details in ``Executor``.NEWLINENEWLINE Examples:NEWLINENEWLINE .. code-block:: pythonNEWLINENEWLINE import paddleNEWLINE paddle.enable_static()NEWLINE import paddle.distributed.fleet as fleetNEWLINE import paddle.nn.functional as FNEWLINENEWLINE hid_dim = 10NEWLINE label_dim = 2NEWLINE input_x = paddle.static.data(name='x', shape=[None, 13], dtype='float32')NEWLINE input_y = paddle.static.data(name='y', shape=[None, 1], dtype='int64')NEWLINE fc_1 = paddle.static.nn.fc(x=input_x, size=hid_dim, activation='tanh')NEWLINE fc_2 = paddle.static.nn.fc(x=fc_1, size=hid_dim, activation='tanh')NEWLINE prediction = paddle.static.nn.fc(x=[fc_2], size=label_dim, activation='softmax')NEWLINE cost = F.cross_entropy(input=prediction, label=input_y)NEWLINE avg_cost = paddle.mean(x=cost)NEWLINENEWLINE fleet.init(is_collective=True)NEWLINE strategy = fleet.DistributedStrategy()NEWLINE optimizer = paddle.optimizer.SGD(learning_rate=0.001)NEWLINE optimizer = fleet.distributed_optimizer(optimizer, strategy=strategy)NEWLINE optimizer.minimize(avg_cost)NEWLINENEWLINE # for more examples, please reference https://github.com/PaddlePaddle/FleetXNEWLINENEWLINE """NEWLINE context = {}NEWLINE context["user_defined_strategy"] = copy.deepcopy(NEWLINE self._user_defined_strategy)NEWLINE if paddle.fluid.framework.in_dygraph_mode():NEWLINE # imitate target optimizer retrievalNEWLINE target_opt = self.user_defined_optimizerNEWLINE self._context = contextNEWLINE return target_opt.minimize(loss)NEWLINENEWLINE # cache original feed forward programNEWLINE self.origin_main_program = loss.block.programNEWLINE context["origin_main_program"] = self.origin_main_programNEWLINE context["loss"] = lossNEWLINE if startup_program == None:NEWLINE self.origin_startup_program = \NEWLINE paddle.static.default_startup_program().clone(for_test=False)NEWLINE startup_program = paddle.static.default_startup_program()NEWLINE else:NEWLINE self.origin_startup_program = \NEWLINE startup_program.clone(for_test=False)NEWLINENEWLINE context["origin_startup_program"] = startup_programNEWLINE context["role_maker"] = self._role_makerNEWLINENEWLINE # compile timeNEWLINE distributed_optimizer_list = \NEWLINE MetaOptimizerFactory()._get_valid_meta_optimizers(NEWLINE self.user_defined_optimizer)NEWLINENEWLINE context["user_defined_strategy"] = copy.deepcopy(NEWLINE self._user_defined_strategy)NEWLINE copy_user_defined_strategy = copy.deepcopy(self._user_defined_strategy)NEWLINENEWLINE # trigger the auto-parallel in very strict conditionNEWLINE # strategy = DistributedStrategy()NEWLINE # strategy.auto = TrueNEWLINE # optimizer = paddle.optimizer.SGD(learning_rate=0.1)NEWLINE # optimizer = fleet.distributed_optimizer(optimizer, strategy)NEWLINE if copy_user_defined_strategy._is_strict_auto():NEWLINE # turn on all the strategy for each optimizerNEWLINE for opt in distributed_optimizer_list:NEWLINE opt._enable_strategy(copy_user_defined_strategy, context)NEWLINENEWLINE valid_optimizer_list = []NEWLINE valid_graph_optimizer_list = []NEWLINE can_not_apply_optimizer_list = []NEWLINE # recall meta optimizers for rankingNEWLINE for opt in distributed_optimizer_list:NEWLINE opt._set_basic_info(loss, self._role_maker,NEWLINE self.user_defined_optimizer,NEWLINE copy_user_defined_strategy)NEWLINE if opt._can_apply() and not opt._is_graph_out():NEWLINE valid_optimizer_list.append(opt)NEWLINE elif opt._can_apply() and opt._is_graph_out():NEWLINE valid_graph_optimizer_list.append(opt)NEWLINE else:NEWLINE can_not_apply_optimizer_list.append(opt)NEWLINE # combine recalled meta optimizers to be a valid meta optimizerNEWLINE meta_optimizer, graph_optimizer = \NEWLINE self.strategy_compiler.generate_optimizer(NEWLINE loss, self._role_maker, self.user_defined_optimizer,NEWLINE copy_user_defined_strategy, valid_optimizer_list,NEWLINE valid_graph_optimizer_list)NEWLINENEWLINE valid_strategy = self.strategy_compiler._get_valid_strategy(NEWLINE copy_user_defined_strategy, can_not_apply_optimizer_list)NEWLINENEWLINE context["valid_strategy"] = copy.deepcopy(valid_strategy)NEWLINENEWLINE applied_meta_list = self.strategy_compiler._get_applied_meta_list()NEWLINE applied_graph_list = self.strategy_compiler._get_applied_graph_list()NEWLINENEWLINE context['applied_meta_list'] = applied_meta_listNEWLINE context['applied_graph_list'] = applied_graph_listNEWLINENEWLINE self._context = contextNEWLINENEWLINE self.valid_strategy = valid_strategyNEWLINE self.valid_strategy._enable_env()NEWLINENEWLINE optimize_ops = []NEWLINE params_grads = []NEWLINENEWLINE if self._role_maker._is_non_distributed() and not self._is_collective:NEWLINE if self._runtime_handle is None:NEWLINE self._runtime_handle = RuntimeFactory()._create_runtime(context)NEWLINENEWLINE compiled_program = compiler.CompiledProgram(NEWLINE self.origin_main_program).with_data_parallel(NEWLINE loss_name=loss.name, share_vars_from=None)NEWLINE loss.block.program._graph = compiled_programNEWLINE return self.user_defined_optimizer.minimize(NEWLINE loss, startup_program, parameter_list, no_grad_set=no_grad_set)NEWLINENEWLINE if meta_optimizer:NEWLINE optimize_ops, params_grads = meta_optimizer.minimize(NEWLINE loss, startup_program, parameter_list, no_grad_set=no_grad_set)NEWLINENEWLINE default_program = paddle.static.default_main_program()NEWLINENEWLINE if id(default_program) != id(loss.block.program):NEWLINE paddle.fluid.framework.switch_main_program(loss.block.program)NEWLINENEWLINE else:NEWLINE optimize_ops, params_grads = self.user_defined_optimizer.minimize(NEWLINE loss, startup_program, parameter_list, no_grad_set=no_grad_set)NEWLINENEWLINE context["program_optimize_ops"] = optimize_opsNEWLINE context["program_params_grads"] = params_gradsNEWLINENEWLINE if graph_optimizer:NEWLINE optimize_ops, params_grads = graph_optimizer.minimize(NEWLINE loss, startup_program, parameter_list, no_grad_set=no_grad_set)NEWLINE # since we do not encourage users to use graph operationsNEWLINE # if a graph optimizer takes effect, mostlyNEWLINE # optimizers_ops and params_grads are NoneNEWLINE # i.e. users can not modify current computation graph anymoreNEWLINE context["graph_optimize_ops"] = optimize_opsNEWLINE context["graph_optimize_grads"] = params_gradsNEWLINENEWLINE if self._runtime_handle is None:NEWLINE self._runtime_handle = RuntimeFactory()._create_runtime(context)NEWLINENEWLINE import paddle.distributed.fleet as fleetNEWLINE fleet.util._set_strategy(context["valid_strategy"])NEWLINENEWLINE return optimize_ops, params_gradsNEWLINENEWLINE @dygraph_onlyNEWLINE def distributed_scaler(self, scaler):NEWLINE return HybridParallelGradScaler(scaler, self._hcg)NEWLINE |
#MenuTitle: Build Circled GlyphsNEWLINE# -*- coding: utf-8 -*-NEWLINEfrom __future__ import division, print_function, unicode_literalsNEWLINE__doc__="""NEWLINEBuilds circled numbers and letters (U+24B6...24EA and U+2460...2473) from _part.circle and the letters and figures.NEWLINE"""NEWLINENEWLINEfrom Foundation import NSPointNEWLINEimport mathNEWLINENEWLINEminDistanceBetweenFigures = 90.0NEWLINENEWLINEthisFont = Glyphs.font # frontmost fontNEWLINEthisFontMaster = thisFont.selectedFontMaster # active masterNEWLINEselectedLayers = thisFont.selectedLayers # active layers of selected glyphsNEWLINEcircledGlyphNames = ["one.circled", "two.circled", "three.circled", "four.circled", "five.circled", "six.circled", "seven.circled", "eight.circled", "nine.circled", "one_zero.circled", "one_one.circled", "one_two.circled", "one_three.circled", "one_four.circled", "one_five.circled", "one_six.circled", "one_seven.circled", "one_eight.circled", "one_nine.circled", "two_zero.circled", "A.circled", "B.circled", "C.circled", "D.circled", "E.circled", "F.circled", "G.circled", "H.circled", "I.circled", "J.circled", "K.circled", "L.circled", "M.circled", "N.circled", "O.circled", "P.circled", "Q.circled", "R.circled", "S.circled", "T.circled", "U.circled", "V.circled", "W.circled", "X.circled", "Y.circled", "Z.circled", "a.circled", "b.circled", "c.circled", "d.circled", "e.circled", "f.circled", "g.circled", "h.circled", "i.circled", "j.circled", "k.circled", "l.circled", "m.circled", "n.circled", "o.circled", "p.circled", "q.circled", "r.circled", "s.circled", "t.circled", "u.circled", "v.circled", "w.circled", "x.circled", "y.circled", "z.circled", "zero.circled"]NEWLINENEWLINENEWLINENEWLINEdef offsetLayer( thisLayer, offset, makeStroke=False, position=0.5, autoStroke=False ):NEWLINE offsetFilter = NSClassFromString("GlyphsFilterOffsetCurve")NEWLINE offsetFilter.offsetLayer_offsetX_offsetY_makeStroke_autoStroke_position_error_shadow_(NEWLINE thisLayer,NEWLINE offset, offset, # horizontal and vertical offsetNEWLINE makeStroke, # if True, creates a strokeNEWLINE autoStroke, # if True, distorts resulting shape to vertical metricsNEWLINE position, # stroke distribution to the left and right, 0.5 = middleNEWLINE None, None )NEWLINENEWLINEdef transform(shiftX=0.0, shiftY=0.0, rotate=0.0, skew=0.0, scale=1.0):NEWLINE """NEWLINE Returns an NSAffineTransform object for transforming layers.NEWLINE Apply an NSAffineTransform t object like this:NEWLINE Layer.transform_checkForSelection_doComponents_(t,False,True)NEWLINE Access its transformation matrix like this:NEWLINE tMatrix = t.transformStruct() # returns the 6-float tupleNEWLINE Apply the matrix tuple like this:NEWLINE Layer.applyTransform(tMatrix)NEWLINE Component.applyTransform(tMatrix)NEWLINE Path.applyTransform(tMatrix)NEWLINE Chain multiple NSAffineTransform objects t1, t2 like this:NEWLINE t1.appendTransform_(t2)NEWLINE """NEWLINE myTransform = NSAffineTransform.transform()NEWLINE if rotate:NEWLINE myTransform.rotateByDegrees_(rotate)NEWLINE if scale != 1.0:NEWLINE myTransform.scaleBy_(scale)NEWLINE if not (shiftX == 0.0 and shiftY == 0.0):NEWLINE myTransform.translateXBy_yBy_(shiftX,shiftY)NEWLINE if skew:NEWLINE skewStruct = NSAffineTransformStruct()NEWLINE skewStruct.m11 = 1.0NEWLINE skewStruct.m22 = 1.0NEWLINE skewStruct.m21 = math.tan(math.radians(skew))NEWLINE skewTransform = NSAffineTransform.transform()NEWLINE skewTransform.setTransformStruct_(skewStruct)NEWLINE myTransform.appendTransform_(skewTransform)NEWLINE return myTransformNEWLINENEWLINEdef centerOfRect(rect):NEWLINE """NEWLINE Returns the center of NSRect rect as an NSPoint.NEWLINE """NEWLINE x = rect.origin.x + rect.size.width * 0.5NEWLINE y = rect.origin.y + rect.size.height * 0.5NEWLINE return NSPoint(x,y)NEWLINENEWLINEdef combinedBounds(rects):NEWLINE bottomLeft = NSPoint( 1000.0, 100.0 )NEWLINE topRight = NSPoint( 0.0, 0.0 )NEWLINE for thisRect in rects:NEWLINE bottomLeft.x = min( thisRect.origin.x, bottomLeft.x )NEWLINE bottomLeft.y = min( thisRect.origin.y, bottomLeft.y )NEWLINE topRight.x = max( topRight.x, thisRect.origin.x+thisRect.size.width )NEWLINE topRight.y = max( topRight.y, thisRect.origin.y+thisRect.size.height )NEWLINE combinedRect = NSRect()NEWLINE combinedRect.origin = bottomLeftNEWLINE combinedRect.size = NSSize( topRight.x-bottomLeft.x, topRight.y-bottomLeft.y )NEWLINE return combinedRectNEWLINENEWLINEdef measureLayerAtHeightFromLeftOrRight( thisLayer, height, leftSide=True ):NEWLINE leftX = thisLayer.bounds.origin.xNEWLINE rightX = leftX + thisLayer.bounds.size.widthNEWLINE y = heightNEWLINE returnIndex = 1NEWLINE if not leftSide:NEWLINE returnIndex = -2NEWLINE measurement = thisLayer.intersectionsBetweenPoints( NSPoint(leftX,y), NSPoint(rightX,y) )[returnIndex].pointValue().xNEWLINE if leftSide:NEWLINE distance = measurement - leftXNEWLINE else:NEWLINE distance = rightX - measurementNEWLINE return distanceNEWLINENEWLINEdef minDistanceBetweenTwoLayers( comp1, comp2, interval=5.0 ):NEWLINE topY = min( comp1.bounds.origin.y+comp1.bounds.size.height, comp2.bounds.origin.y+comp2.bounds.size.height )NEWLINE bottomY = max( comp1.bounds.origin.y, comp2.bounds.origin.y )NEWLINE distance = topY - bottomYNEWLINE minDist = NoneNEWLINE for i in range(int(distance/interval)):NEWLINE height = bottomY + i * intervalNEWLINE left = measureLayerAtHeightFromLeftOrRight( comp1, height, leftSide=False )NEWLINE right = measureLayerAtHeightFromLeftOrRight( comp2, height, leftSide=True )NEWLINE total = left+rightNEWLINE if minDist == None or minDist > total:NEWLINE minDist = totalNEWLINE return minDistNEWLINENEWLINEdef placeComponentsAtDistance( thisLayer, comp1, comp2, interval=5.0, distance=10.0 ):NEWLINE thisMaster = thisLayer.associatedFontMaster()NEWLINE masterID = thisMaster.idNEWLINE original1 = comp1.component.layers[masterID]NEWLINE original2 = comp2.component.layers[masterID]NEWLINE minDist = minDistanceBetweenTwoLayers( original1, original2, interval=interval )NEWLINE comp2shift = distance - minDistNEWLINE addedSBs = original1.RSB + original2.LSBNEWLINE comp2.x = comp1.x + original1.width - addedSBs + comp2shiftNEWLINENEWLINEdef process( thisLayer, compName1, compName2, distance=10.0, interval=5.0 ):NEWLINE if compName1 and compName2:NEWLINE compCount = len(thisLayer.components)NEWLINE for compName in (compName1,compName2):NEWLINE newComp = GSComponent(compName)NEWLINE thisLayer.components.append(newComp)NEWLINE newComp.disableAlignment = TrueNEWLINE placeComponentsAtDistance( thisLayer, thisLayer.components[compCount], thisLayer.components[compCount+1] )NEWLINE else:NEWLINE return FalseNEWLINENEWLINENEWLINEdef buildCircledGlyph( thisGlyph, circleName, scaleFactors ):NEWLINE thisFont = thisGlyph.font()NEWLINE thisGlyph.setWidthMetricsKey_( "=%i" % thisFont.upm )NEWLINE circleGlyph = thisFont.glyphs[circleName]NEWLINE NEWLINE for i, thisMaster in enumerate(thisFont.masters):NEWLINE figureHeight = NoneNEWLINE scaleFactor = scaleFactors[i]NEWLINE thisLayer = thisGlyph.layers[thisMaster.id]NEWLINE circleLayer = circleGlyph.layers[thisMaster.id]NEWLINE circleScaleFactor = thisFont.upm * 0.9 / ( circleLayer.bounds.size.width )NEWLINE thisLayer.clear()NEWLINE thisLayer.syncMetrics()NEWLINE NEWLINE # add circle:NEWLINE assumedCenter = NSPoint( thisFont.upm*0.5, thisFont.upm*0.3 ) # hardcodedNEWLINE circleComponent = GSComponent(circleName)NEWLINE thisLayer.components.append(circleComponent)NEWLINE NEWLINE # scale circle:NEWLINE circleScale = transform( scale=circleScaleFactor ).transformStruct()NEWLINE circleComponent.applyTransform( circleScale )NEWLINE NEWLINE # move circle:NEWLINE circleBounds = thisLayer.components[0].boundsNEWLINE circleCenter = centerOfRect(circleBounds)NEWLINE xShift = assumedCenter.x - circleCenter.xNEWLINE yShift = assumedCenter.y - circleCenter.yNEWLINE circleShift = transform( shiftX=xShift, shiftY=yShift ).transformStruct()NEWLINE circleComponent.applyTransform(circleShift)NEWLINE NEWLINE # find components to addNEWLINE suffixlessName = thisGlyph.nameNEWLINE if "." in suffixlessName:NEWLINE suffixlessName = thisGlyph.name[:thisGlyph.name.find(".")]NEWLINE componentNames = suffixlessName.split("_")NEWLINE NEWLINE # add one component in the center:NEWLINE if componentNames:NEWLINE advance = 0NEWLINE for j, compName in enumerate(componentNames):NEWLINE lfName = "%s.lf" % compNameNEWLINE osfName = "%s.osf" % compNameNEWLINE if thisFont.glyphs[lfName]:NEWLINE compName = lfNameNEWLINE elif thisFont.glyphs[osfName]:NEWLINE compName = osfNameNEWLINE NEWLINE innerComponent = GSComponent( compName )NEWLINE thisLayer.components.append( innerComponent )NEWLINE innerComponent.position = NSPoint( advance, 0.0 )NEWLINE NEWLINE if j > 0:NEWLINE innerComponent.disableAlignment = TrueNEWLINE placeComponentsAtDistance( NEWLINE thisLayer,NEWLINE thisLayer.components[-2], NEWLINE thisLayer.components[-1], # same as innerComponentNEWLINE distance = minDistanceBetweenFiguresNEWLINE )NEWLINE NEWLINE originalLayerWidth = thisFont.glyphs[compName].layers[thisMaster.id].widthNEWLINE advance += originalLayerWidthNEWLINE NEWLINE collectedBounds = [ c.bounds for c in thisLayer.components[1:] ]NEWLINE compCenter = centerOfRect( combinedBounds(collectedBounds) )NEWLINE circleCenter = centerOfRect( circleComponent.bounds )NEWLINE NEWLINE # scale and move it in place:NEWLINE shift = transform( shiftX=-compCenter.x, shiftY=-compCenter.y ).transformStruct()NEWLINE scaleToFit = transform( scale=scaleFactor*circleScaleFactor ).transformStruct()NEWLINE backshift = transform( shiftX=circleCenter.x, shiftY=circleCenter.y ).transformStruct()NEWLINE NEWLINE compensateStroke = []NEWLINE for innerComponent in thisLayer.components[1:]:NEWLINE NEWLINE # optically shift so top anchor is in center:NEWLINE originalLayer = topAnchor = innerComponent.component.layers[thisMaster.id]NEWLINE topAnchor = originalLayer.anchors["top"]NEWLINE if topAnchor:NEWLINE anchorCenter = topAnchor.xNEWLINE boundsCenter = centerOfRect(originalLayer.bounds).xNEWLINE opticalCorrection = boundsCenter-anchorCenterNEWLINE if opticalCorrection != 0.0:NEWLINE threshold = 35.0NEWLINE if abs(opticalCorrection) > threshold:NEWLINE posNeg = opticalCorrection/abs(opticalCorrection)NEWLINE rest = abs(opticalCorrection) - thresholdNEWLINE opticalCorrection = posNeg * ( threshold + rest * 1/rest**0.3 )NEWLINE print("--", opticalCorrection)NEWLINE opticalShift = transform( shiftX = opticalCorrection ).transformStruct()NEWLINE innerComponent.applyTransform( opticalShift )NEWLINE NEWLINE NEWLINE innerComponent.applyTransform( shift )NEWLINE innerComponent.applyTransform( scaleToFit )NEWLINE innerComponent.applyTransform( backshift )NEWLINE NEWLINE # move components closer to center:NEWLINE #move = 15.0NEWLINE #hOffset = circleCenter.x - centerOfRect(innerComponent.bounds).xNEWLINE #if abs(hOffset) > move:NEWLINE # hOffset = (hOffset/abs(hOffset))*moveNEWLINE #if hOffset != 0.0:NEWLINE # moveCloser = transform( shiftX=hOffset ).transformStruct()NEWLINE # innerComponent.applyTransform( moveCloser )NEWLINE NEWLINE # compensatory shift:NEWLINE if thisGlyph.name in ("two_zero.circled", "one_nine.circled", "one_zero.circled"):NEWLINE compensate = transform( shiftX=10.0 ).transformStruct()NEWLINE innerComponent.applyTransform( compensate )NEWLINE NEWLINE NEWLINE NEWLINE if innerComponent.component.glyphInfo.category == "Number":NEWLINE if figureHeight == None:NEWLINE figureHeight = innerComponent.position.yNEWLINE else:NEWLINE innerComponent.position.y = figureHeightNEWLINE NEWLINE compensateStroke.append(innerComponent)NEWLINE NEWLINE # auffetten:NEWLINE isNumber = FalseNEWLINE for i in range(len(compensateStroke))[::-1]:NEWLINE componentToDecompose = compensateStroke[i]NEWLINE if componentToDecompose.component.category == "Number":NEWLINE isNumber = TrueNEWLINE thisLayer.decomposeComponent_(componentToDecompose)NEWLINE NEWLINE offsetLayer( thisLayer, 4.0 ) #4.0 if isNumber else 3.0 )NEWLINE thisLayer.anchors = NoneNEWLINE NEWLINE NEWLINE NEWLINENEWLINENEWLINEdef buildCirclePart( thisFont, glyphName ):NEWLINE partCircle = (NEWLINE (NEWLINE (353.0, 0.0),NEWLINE ((152.0, 0.0),(0.0, 150.0),(0.0, 348.0)),NEWLINE ((0.0, 549.0),(152.0, 700.0),(353.0, 700.0)),NEWLINE ((556.0, 700.0),(708.0, 549.0),(708.0, 348.0)),NEWLINE ((708.0, 149.0),(556.0, 0.0),(353.0, 0.0))NEWLINE ),NEWLINE )NEWLINE NEWLINE thisGlyph = thisFont.glyphs[glyphName]NEWLINE if not thisGlyph:NEWLINE thisGlyph = GSGlyph()NEWLINE thisGlyph.name = glyphNameNEWLINE thisFont.glyphs.append( thisGlyph )NEWLINE print("Generated %s" % glyphName)NEWLINE NEWLINE thisGlyph.export = FalseNEWLINE NEWLINE # find zero for reference:NEWLINE zeroGlyph = thisFont.glyphs["zero.lf"]NEWLINE if not zeroGlyph:NEWLINE zeroGlyph = thisFont.glyphs["zero.tf"]NEWLINE if not zeroGlyph:NEWLINE zeroGlyph = thisFont.glyphs["zero"]NEWLINE NEWLINE # draw in every layer:NEWLINE for thisLayer in thisGlyph.layers:NEWLINE # make sure it is empty:NEWLINE thisLayer.clear()NEWLINE NEWLINE # draw outer circle:NEWLINE for thisPath in partCircle:NEWLINE pen = thisLayer.getPen()NEWLINE pen.moveTo( thisPath[0] )NEWLINE for thisSegment in thisPath[1:]:NEWLINE if len(thisSegment) == 2: # linetoNEWLINE pen.lineTo( thisSegment )NEWLINE elif len(thisSegment) == 3: # curvetoNEWLINE pen.curveTo(NEWLINE thisSegment[0],NEWLINE thisSegment[1],NEWLINE thisSegment[2]NEWLINE )NEWLINE else:NEWLINE print("%s: Path drawing error. Could not process this segment:\n" % (glyphName, thisSegment))NEWLINE pen.closePath()NEWLINE pen.endPath()NEWLINE NEWLINE # scale circle to match zero:NEWLINE if zeroGlyph:NEWLINE zeroBounds = zeroGlyph.layers[thisLayer.associatedMasterId].boundsNEWLINE zeroHeight = zeroBounds.size.heightNEWLINE if zeroHeight: # zero could be emptyNEWLINE zeroOvershoot = -zeroBounds.origin.yNEWLINE overshootDiff = zeroOvershoot - 5.0NEWLINE actualHeight = thisLayer.bounds.size.heightNEWLINE correctedHeight = zeroHeight - 2 * overshootDiffNEWLINE if correctedHeight != actualHeight:NEWLINE scaleFactor = correctedHeight/actualHeightNEWLINE correction = transform(shiftY=5.0)NEWLINE correction.appendTransform_( transform(scale=scaleFactor) )NEWLINE correction.appendTransform_( transform(-5.0) )NEWLINE thisLayer.applyTransform( correction.transformStruct() )NEWLINENEWLINE # inner circle, scaled down:NEWLINE currentHeight = thisLayer.bounds.size.heightNEWLINE outerCircle = thisLayer.paths[0]NEWLINE innerCircle = outerCircle.copy()NEWLINE thisLayer.paths.append(innerCircle)NEWLINE NEWLINE # scale down inner circle:NEWLINE stemSize = 50.0NEWLINE hstems = thisLayer.associatedFontMaster().horizontalStemsNEWLINE vstems = thisLayer.associatedFontMaster().verticalStemsNEWLINE if hstems and vstems:NEWLINE stemSize = (hstems[0] + vstems[0]) * 0.25NEWLINE NEWLINE maximumStemSize = currentHeight * 0.28NEWLINE stemSize = min(maximumStemSize,stemSize)NEWLINE smallerBy = stemSize * 2 * 1.06NEWLINE newHeight = currentHeight - smallerByNEWLINE scaleFactor = newHeight/currentHeightNEWLINE scale = transform(scale=scaleFactor).transformStruct()NEWLINE NEWLINE centerX = innerCircle.bounds.origin.x + innerCircle.bounds.size.width * 0.5NEWLINE centerY = innerCircle.bounds.origin.y + innerCircle.bounds.size.height * 0.5NEWLINE shift = transform(shiftX=-centerX, shiftY=-centerY).transformStruct()NEWLINE shiftBack = transform(shiftX=centerX, shiftY=centerY).transformStruct()NEWLINE NEWLINE innerCircle.applyTransform( shift )NEWLINE innerCircle.applyTransform( scale )NEWLINE innerCircle.applyTransform( shiftBack )NEWLINENEWLINE # tidy up paths and set width:NEWLINE thisLayer.correctPathDirection()NEWLINE thisLayer.cleanUpPaths()NEWLINE thisLayer.LSB = 40.0NEWLINE thisLayer.RSB = 40.0NEWLINE NEWLINE # add anchor:NEWLINE centerX = thisLayer.bounds.origin.x + thisLayer.bounds.size.width * 0.5NEWLINE centerY = thisLayer.bounds.origin.y + thisLayer.bounds.size.height * 0.5NEWLINE centerAnchor = GSAnchor()NEWLINE centerAnchor.name = "#center"NEWLINE centerAnchor.position = NSPoint( centerX, centerY )NEWLINE thisLayer.anchors.append(centerAnchor)NEWLINENEWLINEdef boxArea(thisLayer):NEWLINE return thisLayer.bounds.size.width * thisLayer.bounds.size.heightNEWLINENEWLINEthisFont.disableUpdateInterface() # suppresses UI updates in Font ViewNEWLINENEWLINENEWLINE# add circle if not present in font already:NEWLINEcircleName = "_part.circle"NEWLINEif not thisFont.glyphs[circleName]:NEWLINE buildCirclePart( thisFont, circleName )NEWLINEcircleGlyph = thisFont.glyphs[circleName]NEWLINENEWLINE# determining scale of inscribed letters:NEWLINEscaleFactors = []NEWLINEfor thisMaster in thisFont.masters:NEWLINE radius = circleGlyph.layers[thisMaster.id].paths[1].bounds.size.width * 0.5NEWLINE maxArea = 0.0NEWLINE biggestLayer = NoneNEWLINE for glyphName in circledGlyphNames:NEWLINE if "." in glyphName:NEWLINE glyphName = glyphName[:glyphName.find(".")]NEWLINE thisGlyph = thisFont.glyphs[glyphName]NEWLINE if thisGlyph:NEWLINE thisLayer = thisGlyph.layers[thisMaster.id]NEWLINE thisArea = boxArea(thisLayer)NEWLINE if thisArea > maxArea:NEWLINE maxArea = thisAreaNEWLINE biggestLayer = thisLayerNEWLINE NEWLINE angleInRadians = math.atan2( biggestLayer.bounds.size.height, biggestLayer.bounds.size.width )NEWLINE scaledHeight = math.sin(angleInRadians) * radius * 2 * 0.9NEWLINE scaleFactor = scaledHeight / biggestLayer.bounds.size.heightNEWLINE scaleFactors.append(scaleFactor)NEWLINE NEWLINENEWLINEfor glyphName in circledGlyphNames:NEWLINE thisGlyph = thisFont.glyphs[glyphName]NEWLINE if not thisGlyph:NEWLINE thisGlyph = GSGlyph()NEWLINE thisGlyph.name = glyphNameNEWLINE thisFont.glyphs.append(thisGlyph)NEWLINENEWLINE thisGlyph.beginUndo() # begin undo groupingNEWLINE print("Building %s" % thisGlyph.name)NEWLINE buildCircledGlyph( thisGlyph, circleName, scaleFactors )NEWLINE thisGlyph.endUndo() # end undo groupingNEWLINENEWLINEthisFont.enableUpdateInterface() # re-enables UI updates in Font ViewNEWLINE |
"""NEWLINEAbstract agent for the gym-idsgame environmentNEWLINE"""NEWLINEfrom abc import ABCNEWLINE#from gym_idsgame.envs.dao.game_config import GameConfigNEWLINENEWLINEclass Agent(ABC):NEWLINE """NEWLINE Abstract class representing an agentNEWLINE """NEWLINENEWLINE def __init__(self, game_config):NEWLINE """NEWLINE Class constructorNEWLINENEWLINE :param game_config: the game configurationNEWLINE """NEWLINE self.game_config = game_configNEWLINE # if self.game_config is None:NEWLINE # self.game_config = GameConfig()NEWLINE |
import usocket as socketNEWLINEimport uselectNEWLINEfrom utime import ticks_add, ticks_ms, ticks_diffNEWLINENEWLINENEWLINEclass MQTTException(Exception):NEWLINE passNEWLINENEWLINENEWLINEdef pid_gen(pid=0):NEWLINE while True:NEWLINE pid = pid + 1 if pid < 65535 else 1NEWLINE yield pidNEWLINENEWLINENEWLINEclass MQTTClient:NEWLINENEWLINE def __init__(self, client_id, server, port=0, user=None, password=None, keepalive=0,NEWLINE ssl=False, ssl_params=None, socket_timeout=5, message_timeout=10):NEWLINE """NEWLINE Default constructor, initializes MQTTClient object.NEWLINE :param client_id: Unique MQTT ID attached to client.NEWLINE :type client_id: strNEWLINE :param server: MQTT host address.NEWLINE :type server strNEWLINE :param port: MQTT Port, typically 1883. If unset, the port number will default to 1883 of 8883 base on ssl.NEWLINE :type port: intNEWLINE :param user: Username if your server requires it.NEWLINE :type user: strNEWLINE :param password: Password if your server requires it.NEWLINE :type password: strNEWLINE :param keepalive: The Keep Alive is a time interval measured in seconds since the lastNEWLINE correct control packet was received.NEWLINE :type keepalive: intNEWLINE :param ssl: Require SSL for the connection.NEWLINE :type ssl: boolNEWLINE :param ssl_params: Required SSL parameters.NEWLINE :type ssl_params: dictNEWLINE :param socket_timeout: The time in seconds after which the socket interrupts the connection to the server whenNEWLINE no data exchange takes place. None - socket blocking, positive number - seconds to wait.NEWLINE :type socket_timeout: intNEWLINE :param message_timeout: The time in seconds after which the library recognizes that a message with QoS=1NEWLINE or topic subscription has not been received by the server.NEWLINE :type message_timeout: intNEWLINE """NEWLINE if port == 0:NEWLINE port = 8883 if ssl else 1883NEWLINE self.client_id = client_idNEWLINE self.sock = NoneNEWLINE self.poller_r = NoneNEWLINE self.poller_w = NoneNEWLINE self.server = serverNEWLINE self.port = portNEWLINE self.ssl = sslNEWLINE self.ssl_params = ssl_params if ssl_params else {}NEWLINE self.newpid = pid_gen()NEWLINE if not getattr(self, 'cb', None):NEWLINE self.cb = NoneNEWLINE if not getattr(self, 'cbstat', None):NEWLINE self.cbstat = lambda p, s: NoneNEWLINE self.user = userNEWLINE self.pswd = passwordNEWLINE self.keepalive = keepaliveNEWLINE self.lw_topic = NoneNEWLINE self.lw_msg = NoneNEWLINE self.lw_qos = 0NEWLINE self.lw_retain = FalseNEWLINE self.rcv_pids = {} # PUBACK and SUBACK pids awaiting ACK responseNEWLINENEWLINE self.last_ping = ticks_ms() # Time of the last PING sentNEWLINE self.last_cpacket = ticks_ms() # Time of last Control PacketNEWLINENEWLINE self.socket_timeout = socket_timeoutNEWLINE self.message_timeout = message_timeoutNEWLINENEWLINE def _read(self, n):NEWLINE """NEWLINE Private class method.NEWLINE :param n: Expected length of read bytesNEWLINE :type n: intNEWLINE :return:NEWLINE """NEWLINE # in non-blocking mode, may not download enough dataNEWLINE try:NEWLINE msg = b''NEWLINE for i in range(n):NEWLINE self._sock_timeout(self.poller_r, self.socket_timeout)NEWLINE msg += self.sock.read(1)NEWLINE except AttributeError:NEWLINE raise MQTTException(8)NEWLINE if msg == b'': # Connection closed by host (?)NEWLINE raise MQTTException(1)NEWLINE if len(msg) != n:NEWLINE raise MQTTException(2)NEWLINE return msgNEWLINENEWLINE def _write(self, bytes_wr, length=-1):NEWLINE """NEWLINE Private class method.NEWLINE :param bytes_wr: Bytes sequence for writingNEWLINE :type bytes_wr: bytesNEWLINE :param length: Expected length of write bytesNEWLINE :type length: intNEWLINE :return:NEWLINE """NEWLINE # In non-blocking socket mode, the entire block of data may not be sent.NEWLINE try:NEWLINE self._sock_timeout(self.poller_w, self.socket_timeout)NEWLINE out = self.sock.write(bytes_wr, length)NEWLINE except AttributeError:NEWLINE raise MQTTException(8)NEWLINE if length < 0:NEWLINE if out != len(bytes_wr):NEWLINE raise MQTTException(3)NEWLINE else:NEWLINE if out != length:NEWLINE raise MQTTException(3)NEWLINE return outNEWLINENEWLINE def _send_str(self, s):NEWLINE """NEWLINE Private class method.NEWLINE :param s:NEWLINE :type s: byteNEWLINE :return: NoneNEWLINE """NEWLINE assert len(s) < 65536NEWLINE self._write(len(s).to_bytes(2, 'big'))NEWLINE self._write(s)NEWLINENEWLINE def _recv_len(self):NEWLINE """NEWLINE Private class method.NEWLINE :return:NEWLINE :rtype intNEWLINE """NEWLINE n = 0NEWLINE sh = 0NEWLINE while 1:NEWLINE b = self._read(1)[0]NEWLINE n |= (b & 0x7f) << shNEWLINE if not b & 0x80:NEWLINE return nNEWLINE sh += 7NEWLINENEWLINE def _varlen_encode(self, value, buf, offset=0):NEWLINE assert value < 268435456 # 2**28, i.e. max. four 7-bit bytesNEWLINE while value > 0x7f:NEWLINE buf[offset] = (value & 0x7f) | 0x80NEWLINE value >>= 7NEWLINE offset += 1NEWLINE buf[offset] = valueNEWLINE return offset + 1NEWLINENEWLINE def _sock_timeout(self, poller, socket_timeout):NEWLINE if self.sock:NEWLINE res = poller.poll(-1 if socket_timeout is None else int(socket_timeout * 1000))NEWLINE if not res:NEWLINE raise MQTTException(30)NEWLINE else:NEWLINE raise MQTTException(28)NEWLINENEWLINE def set_callback(self, f):NEWLINE """NEWLINE Set callback for received subscription messages.NEWLINE :param f: callable(topic, msg, retained, duplicate)NEWLINE """NEWLINE self.cb = fNEWLINENEWLINE def set_callback_status(self, f):NEWLINE """NEWLINE Set the callback for information about whether the sent packet (QoS=1)NEWLINE or subscription was received or not by the server.NEWLINE :param f: callable(pid, status)NEWLINE Where:NEWLINE status = 0 - timeoutNEWLINE status = 1 - successfully deliveredNEWLINE status = 2 - Unknown PID. It is also possible that the PID is outdated,NEWLINE i.e. it came out of the message timeout.NEWLINE """NEWLINE self.cbstat = fNEWLINENEWLINE def set_last_will(self, topic, msg, retain=False, qos=0):NEWLINE """NEWLINE Sets the last will and testament of the client. This is used to perform an action by the brokerNEWLINE in the event that the client "dies".NEWLINE Learn more at https://www.hivemq.com/blog/mqtt-essentials-part-9-last-will-and-testament/NEWLINE :param topic: Topic of LWT. Takes the from "path/to/topic"NEWLINE :type topic: byteNEWLINE :param msg: Message to be published to LWT topic.NEWLINE :type msg: byteNEWLINE :param retain: Have the MQTT broker retain the message.NEWLINE :type retain: boolNEWLINE :param qos: Sets quality of service level. Accepts values 0 to 2. PLEASE NOTE qos=2 is not actually supported.NEWLINE :type qos: intNEWLINE :return: NoneNEWLINE """NEWLINE assert 0 <= qos <= 2NEWLINE assert topicNEWLINE self.lw_topic = topicNEWLINE self.lw_msg = msgNEWLINE self.lw_qos = qosNEWLINE self.lw_retain = retainNEWLINENEWLINE def connect(self, clean_session=True):NEWLINE """NEWLINE Establishes connection with the MQTT server.NEWLINE :param clean_session: Starts new session on true, resumes past session if false.NEWLINE :type clean_session: boolNEWLINE :return: Existing persistent session of the client from previous interactions.NEWLINE :rtype: boolNEWLINE """NEWLINE self.sock = socket.socket()NEWLINE addr = socket.getaddrinfo(self.server, self.port)[0][-1]NEWLINE self.sock.connect(addr)NEWLINE if self.ssl:NEWLINE import usslNEWLINE self.sock = ussl.wrap_socket(self.sock, **self.ssl_params)NEWLINENEWLINE self.poller_r = uselect.poll()NEWLINE self.poller_r.register(self.sock, uselect.POLLIN)NEWLINE self.poller_w = uselect.poll()NEWLINE self.poller_w.register(self.sock, uselect.POLLOUT)NEWLINENEWLINE # Byte nr - descNEWLINE # 1 - \x10 0001 - Connect Command, 0000 - ReservedNEWLINE # 2 - Remaining LengthNEWLINE # PROTOCOL NAME (3.1.2.1 Protocol Name)NEWLINE # 3,4 - protocol name length len('MQTT')NEWLINE # 5-8 = 'MQTT'NEWLINE # PROTOCOL LEVEL (3.1.2.2 Protocol Level)NEWLINE # 9 - mqtt version 0x04NEWLINE # CONNECT FLAGSNEWLINE # 10 - connection flagsNEWLINE # X... .... = User Name FlagNEWLINE # .X.. .... = Password FlagNEWLINE # ..X. .... = Will RetainNEWLINE # ...X X... = QoS LevelNEWLINE # .... .X.. = Will FlagNEWLINE # .... ..X. = Clean Session FlagNEWLINE # .... ...0 = (Reserved) It must be 0!NEWLINE # KEEP ALIVENEWLINE # 11,12 - keepaliveNEWLINE # 13,14 - client ID lengthNEWLINE # 15-15+len(client_id) - byte(client_id)NEWLINE premsg = bytearray(b"\x10\0\0\0\0\0")NEWLINE msg = bytearray(b"\0\x04MQTT\x04\0\0\0")NEWLINENEWLINE sz = 10 + 2 + len(self.client_id)NEWLINENEWLINE msg[7] = bool(clean_session) << 1NEWLINE # Clean session = True, remove current sessionNEWLINE if bool(clean_session):NEWLINE self.rcv_pids.clear()NEWLINE if self.user is not None:NEWLINE sz += 2 + len(self.user)NEWLINE msg[7] |= 1 << 7 # User Name FlagNEWLINE if self.pswd is not None:NEWLINE sz += 2 + len(self.pswd)NEWLINE msg[7] |= 1 << 6 # # Password FlagNEWLINE if self.keepalive:NEWLINE assert self.keepalive < 65536NEWLINE msg[8] |= self.keepalive >> 8NEWLINE msg[9] |= self.keepalive & 0x00FFNEWLINE if self.lw_topic:NEWLINE sz += 2 + len(self.lw_topic) + 2 + len(self.lw_msg)NEWLINE msg[7] |= 0x4 | (self.lw_qos & 0x1) << 3 | (self.lw_qos & 0x2) << 3NEWLINE msg[7] |= self.lw_retain << 5NEWLINENEWLINE plen = self._varlen_encode(sz, premsg, 1)NEWLINE self._write(premsg, plen)NEWLINE self._write(msg)NEWLINE self._send_str(self.client_id)NEWLINE if self.lw_topic:NEWLINE self._send_str(self.lw_topic)NEWLINE self._send_str(self.lw_msg)NEWLINE if self.user is not None:NEWLINE self._send_str(self.user)NEWLINE if self.pswd is not None:NEWLINE self._send_str(self.pswd)NEWLINE resp = self._read(4)NEWLINE if not (resp[0] == 0x20 and resp[1] == 0x02): # control packet type, Remaining Length == 2NEWLINE raise MQTTException(29)NEWLINE if resp[3] != 0:NEWLINE if 1 <= resp[3] <= 5:NEWLINE raise MQTTException(20 + resp[3])NEWLINE else:NEWLINE raise MQTTException(20, resp[3])NEWLINE self.last_cpacket = ticks_ms()NEWLINE return resp[2] & 1 # Is existing persistent session of the client from previous interactions.NEWLINENEWLINE def disconnect(self):NEWLINE """NEWLINE Disconnects from the MQTT server.NEWLINE :return: NoneNEWLINE """NEWLINE self._write(b"\xe0\0")NEWLINE self.poller_r.unregister(self.sock)NEWLINE self.poller_w.unregister(self.sock)NEWLINE self.poller_r = NoneNEWLINE self.poller_w = NoneNEWLINE self.sock.close()NEWLINE self.sock = NoneNEWLINENEWLINE def ping(self):NEWLINE """NEWLINE Pings the MQTT server.NEWLINE :return: NoneNEWLINE """NEWLINE self._write(b"\xc0\0")NEWLINE self.last_ping = ticks_ms()NEWLINENEWLINE def publish(self, topic, msg, retain=False, qos=0, dup=False):NEWLINE """NEWLINE Publishes a message to a specified topic.NEWLINE :param topic: Topic you wish to publish to. Takes the form "path/to/topic"NEWLINE :type topic: byteNEWLINE :param msg: Message to publish to topic.NEWLINE :type msg: byteNEWLINE :param retain: Have the MQTT broker retain the message.NEWLINE :type retain: boolNEWLINE :param qos: Sets quality of service level. Accepts values 0 to 2. PLEASE NOTE qos=2 is not actually supported.NEWLINE :type qos: intNEWLINE :param dup: Duplicate delivery of a PUBLISH Control PacketNEWLINE :type dup: boolNEWLINE :return: NoneNEWLINE """NEWLINE assert qos in (0, 1)NEWLINE pkt = bytearray(b"\x30\0\0\0\0")NEWLINE pkt[0] |= qos << 1 | retain | int(dup) << 3NEWLINE sz = 2 + len(topic) + len(msg)NEWLINE if qos > 0:NEWLINE sz += 2NEWLINE plen = self._varlen_encode(sz, pkt, 1)NEWLINE self._write(pkt, plen)NEWLINE self._send_str(topic)NEWLINE if qos > 0:NEWLINE pid = next(self.newpid)NEWLINE self._write(pid.to_bytes(2, 'big'))NEWLINE self._write(msg)NEWLINE if qos > 0:NEWLINE self.rcv_pids[pid] = ticks_add(ticks_ms(), self.message_timeout * 1000)NEWLINE return pidNEWLINENEWLINE def subscribe(self, topic, qos=0):NEWLINE """NEWLINE Subscribes to a given topic.NEWLINE :param topic: Topic you wish to publish to. Takes the form "path/to/topic"NEWLINE :type topic: byteNEWLINE :param qos: Sets quality of service level. Accepts values 0 to 1. This gives the maximum QoS level at whichNEWLINE the Server can send Application Messages to the Client.NEWLINE :type qos: intNEWLINE :return: NoneNEWLINE """NEWLINE assert qos in (0, 1)NEWLINE assert self.cb is not None, "Subscribe callback is not set"NEWLINE pkt = bytearray(b"\x82\0\0\0\0\0\0")NEWLINE pid = next(self.newpid)NEWLINE sz = 2 + 2 + len(topic) + 1NEWLINE plen = self._varlen_encode(sz, pkt, 1)NEWLINE pkt[plen:plen + 2] = pid.to_bytes(2, 'big')NEWLINE self._write(pkt, plen + 2)NEWLINE self._send_str(topic)NEWLINE self._write(qos.to_bytes(1, "little")) # maximum QOS value that can be given by the server to the clientNEWLINE self.rcv_pids[pid] = ticks_add(ticks_ms(), self.message_timeout * 1000)NEWLINE return pidNEWLINENEWLINE def _message_timeout(self):NEWLINE curr_tick = ticks_ms()NEWLINE for pid, timeout in self.rcv_pids.items():NEWLINE if ticks_diff(timeout, curr_tick) <= 0:NEWLINE self.rcv_pids.pop(pid)NEWLINE self.cbstat(pid, 0)NEWLINENEWLINE def check_msg(self):NEWLINE """NEWLINE Checks whether a pending message from server is available.NEWLINE If socket_timeout=None, this is the socket lock mode. That is, it waits until the data can be read.NEWLINE Otherwise it will return None, after the time set in the socket_timeout.NEWLINE It processes such messages:NEWLINE - response to PINGNEWLINE - messages from subscribed topics that are processed by functions set by the set_callback method.NEWLINE - reply from the server that he received a QoS=1 message or subscribed to a topicNEWLINE :return: NoneNEWLINE """NEWLINE if self.sock:NEWLINE if not self.poller_r.poll(-1 if self.socket_timeout is None else 1):NEWLINE self._message_timeout()NEWLINE return NoneNEWLINE try:NEWLINE res = self._read(1) # Throws OSError on WiFi failNEWLINE if not res:NEWLINE self._message_timeout()NEWLINE return NoneNEWLINE except OSError as e:NEWLINE if e.args[0] == 110: # Occurs when no incomming dataNEWLINE self._message_timeout()NEWLINE return NoneNEWLINE else:NEWLINE raise eNEWLINE else:NEWLINE raise MQTTException(28)NEWLINENEWLINE if res == b"\xd0": # PINGRESPNEWLINE if self._read(1)[0] != 0:NEWLINE MQTTException(-1)NEWLINE self.last_cpacket = ticks_ms()NEWLINE returnNEWLINENEWLINE op = res[0]NEWLINENEWLINE if op == 0x40: # PUBACKNEWLINE sz = self._read(1)NEWLINE if sz != b"\x02":NEWLINE raise MQTTException(-1)NEWLINE rcv_pid = int.from_bytes(self._read(2), 'big')NEWLINE if rcv_pid in self.rcv_pids:NEWLINE self.last_cpacket = ticks_ms()NEWLINE self.rcv_pids.pop(rcv_pid)NEWLINE self.cbstat(rcv_pid, 1)NEWLINE else:NEWLINE self.cbstat(rcv_pid, 2)NEWLINENEWLINE if op == 0x90: # SUBACK Packet fixed headerNEWLINE resp = self._read(4)NEWLINE # Byte - descNEWLINE # 1 - Remaining Length 2(varible header) + len(payload)=1NEWLINE # 2,3 - PIDNEWLINE # 4 - PayloadNEWLINE if resp[0] != 0x03:NEWLINE raise MQTTException(40, resp)NEWLINE if resp[3] == 0x80:NEWLINE raise MQTTException(44)NEWLINE if resp[3] not in (0, 1, 2):NEWLINE raise MQTTException(40, resp)NEWLINE pid = resp[2] | (resp[1] << 8)NEWLINE if pid in self.rcv_pids:NEWLINE self.last_cpacket = ticks_ms()NEWLINE self.rcv_pids.pop(pid)NEWLINE self.cbstat(pid, 1)NEWLINE else:NEWLINE raise MQTTException(5)NEWLINENEWLINE self._message_timeout()NEWLINENEWLINE if op & 0xf0 != 0x30: # 3.3 PUBLISH – Publish messageNEWLINE return opNEWLINE sz = self._recv_len()NEWLINE topic_len = int.from_bytes(self._read(2), 'big')NEWLINE topic = self._read(topic_len)NEWLINE sz -= topic_len + 2NEWLINE if op & 6: # QoS level > 0NEWLINE pid = int.from_bytes(self._read(2), 'big')NEWLINE sz -= 2NEWLINE msg = self._read(sz) if sz else b''NEWLINE retained = op & 0x01NEWLINE dup = op & 0x08NEWLINE self.cb(topic, msg)#, bool(retained), bool(dup))NEWLINE self.last_cpacket = ticks_ms()NEWLINE if op & 6 == 2: # QoS==1NEWLINE self._write(b"\x40\x02") # Send PUBACKNEWLINE self._write(pid.to_bytes(2, 'big'))NEWLINE elif op & 6 == 4: # QoS==2NEWLINE raise NotImplementedError()NEWLINE elif op & 6 == 6: # 3.3.1.2 QoS - Reserved – must not be usedNEWLINE raise MQTTException(-1)NEWLINENEWLINE def wait_msg(self):NEWLINE """NEWLINE This method waits for a message from the server.NEWLINE Compatibility with previous versions.NEWLINE It is recommended not to use this method. Set socket_time=None instead.NEWLINE """NEWLINE st_old = self.socket_timeoutNEWLINE self.socket_timeout = NoneNEWLINE out = self.check_msg()NEWLINE self.socket_timeout = st_oldNEWLINE return |
# pylint:disable=no-memberNEWLINEfrom time import sleepNEWLINEfrom typing import ListNEWLINENEWLINEfrom dagster import Field, Output, opNEWLINEfrom dagster.core.definitions.decorators.graph import graphNEWLINEfrom dagster.core.definitions.output import OutNEWLINENEWLINENEWLINE@opNEWLINEdef sleeper(context, units: List[int]) -> int:NEWLINE tot = 0NEWLINE for sec in units:NEWLINE context.log.info("Sleeping for {} seconds".format(sec))NEWLINE sleep(sec)NEWLINE tot += secNEWLINENEWLINE return totNEWLINENEWLINENEWLINE@op(NEWLINE config_schema=[int],NEWLINE out={NEWLINE "out_1": Out(List[int]),NEWLINE "out_2": Out(List[int]),NEWLINE "out_3": Out(List[int]),NEWLINE "out_4": Out(List[int]),NEWLINE },NEWLINE)NEWLINEdef giver(context):NEWLINE units = context.op_configNEWLINE queues: List[List[int]] = [[], [], [], []]NEWLINE for i, sec in enumerate(units):NEWLINE queues[i % 4].append(sec)NEWLINENEWLINE return queues[0], queues[1], queues[2], queues[3]NEWLINENEWLINENEWLINE@op(NEWLINE config_schema={"fail": Field(bool, is_required=False, default_value=False)},NEWLINE out=Out(int, is_required=False),NEWLINE)NEWLINEdef total(context, in_1, in_2, in_3, in_4):NEWLINE result = in_1 + in_2 + in_3 + in_4NEWLINE if context.op_config["fail"]:NEWLINE yield Output(result, "result")NEWLINE # skip the failing opNEWLINE context.log.info(str(result))NEWLINENEWLINENEWLINE@opNEWLINEdef will_fail(i):NEWLINE raise Exception(i)NEWLINENEWLINENEWLINE@graph(NEWLINE description=("Demo diamond-shaped graph that has four-path parallel structure of ops."),NEWLINE)NEWLINEdef sleepy():NEWLINE giver_res = giver()NEWLINENEWLINE will_fail(NEWLINE total(NEWLINE in_1=sleeper(units=giver_res.out_1),NEWLINE in_2=sleeper(units=giver_res.out_2),NEWLINE in_3=sleeper(units=giver_res.out_3),NEWLINE in_4=sleeper(units=giver_res.out_4),NEWLINE )NEWLINE )NEWLINENEWLINENEWLINEsleepy_job = sleepy.to_job(NEWLINE config={NEWLINE "ops": {"giver": {"config": [2, 2, 2, 2]}},NEWLINE },NEWLINE)NEWLINE |
#!/usr/bin/env pythonNEWLINEimport argparseNEWLINEimport networkx as nxNEWLINEimport numpy as npNEWLINEimport matplotlib as mplNEWLINEimport matplotlib.pyplot as pltNEWLINEfrom matplotlib import rcNEWLINEimport prmfNEWLINEimport prmf.plotNEWLINErc('text', usetex=True)NEWLINENEWLINEDPI = prmf.plot.DPINEWLINEEPSILON = np.finfo(np.float32).epsNEWLINENEWLINEdef project(w, G):NEWLINE inds = []NEWLINE for node in G:NEWLINE inds.append(node)NEWLINE inds = sorted(inds)NEWLINE return w[inds]NEWLINENEWLINEdef manifold_penalty(w, G):NEWLINE L = nx.laplacian_matrix(G).todense()NEWLINE w = project(w, G)NEWLINE return L.dot(w).dot(w)NEWLINENEWLINEdef ignore_penalty(w, G):NEWLINE # node identifiers are indexesNEWLINE rv = 0.0NEWLINE w = project(w, G)NEWLINE for i in range(w.shape[0]):NEWLINE rv += 1 / (w[i] + 1)NEWLINE return rvNEWLINENEWLINEif __name__ == "__main__":NEWLINE parser = argparse.ArgumentParser()NEWLINE parser.add_argument("--outfile")NEWLINE args = parser.parse_args()NEWLINENEWLINE fig = plt.figure()NEWLINE fig = plt.figure(figsize=(1000/DPI, 500/DPI), dpi=DPI)NEWLINENEWLINE gs = mpl.gridspec.GridSpec(1, 5, width_ratios=[1,5,1,1,5])NEWLINE ax1 = plt.subplot(gs[0,0])NEWLINE ax2 = plt.subplot(gs[0,1])NEWLINE #ax3 = plt.subplot(gs[0,2])NEWLINE ax4 = plt.subplot(gs[0,3])NEWLINE ax5 = plt.subplot(gs[0,4])NEWLINENEWLINE # graph defined on 2-NEWLINE order = 7NEWLINE nodelist = list(range(order))NEWLINE G = nx.path_graph(order)NEWLINE G.remove_node(0)NEWLINE G.remove_node(1)NEWLINE #G.add_edge(3,6)NEWLINENEWLINE # no penalty because smoothNEWLINE data1 = np.array([0.8, 0.9, 0.0, 0.0, 0.0, 0.0, 0.0])NEWLINE data1[data1 == 0] = EPSILONNEWLINE vmin = 0.0NEWLINE vmax = 1.0NEWLINE prmf.plot.plot_vec(data1, ax1, aspect=3, vmin=vmin, vmax=vmax)NEWLINENEWLINE man_pen = manifold_penalty(data1, G)[0,0]NEWLINE title1 = "$w^T L w = {:1.3f}$".format(man_pen)NEWLINENEWLINE # introduce penalty term for above dataNEWLINE man_pen = manifold_penalty(data1, G)[0,0]NEWLINE ign_pen = ignore_penalty(data1, G)NEWLINE title2 = r'$w^T L w + \sum_L \frac{1}{w_L + 1} = ' + '{:1.3f}'.format(man_pen + ign_pen) + r'$'NEWLINENEWLINE title = title1 + '\n' + title2NEWLINE pos = prmf.plot.plot_graph(G, ax2, title=title, title_fontsize=24, title_y=1.08)NEWLINE #prmf.plot.plot_graph(G, ax3, pos=pos, title=title)NEWLINENEWLINE # penalty because not smooth on 2-NEWLINE data2 = np.array([0.0, 0.1, 0.8, 0.9, 0.8, 0.9, 0.7])NEWLINE data2[data2 == 0] = EPSILONNEWLINE prmf.plot.plot_vec(data2, ax4, aspect=3, vmin=vmin, vmax=vmax)NEWLINENEWLINE man_pen = manifold_penalty(data2, G)[0,0]NEWLINE ign_pen = ignore_penalty(data2, G)NEWLINE title = r'$w^T L w + \sum_L \frac{1}{w_L + 1} = ' + '{:1.3f}'.format(man_pen + ign_pen) + '$'NEWLINE prmf.plot.plot_graph(G, ax5, pos=pos, title=title, title_fontsize=24, title_y=1.08)NEWLINENEWLINE plt.savefig(args.outfile, bbox_inches='tight')NEWLINE |
from Find_the_last_Fibonacci_digit_hardcore_version_6_kyu import last_fib_digitNEWLINEimport unittestNEWLINENEWLINEclass Fibonacci(unittest.TestCase):NEWLINE def test_1(self):NEWLINE n = 7000006NEWLINE result = 3NEWLINE self.assertEqual(last_fib_digit(n), result)NEWLINE def test_1(self):NEWLINE n = 9000000008NEWLINE result = 4NEWLINE self.assertEqual(last_fib_digit(n), result) NEWLINENEWLINEif __name__ == "__main__":NEWLINE unittest.main() |
#!/usr/bin/env pythonNEWLINENEWLINEimport scipy as spNEWLINEimport netCDF4 as ncNEWLINEfrom scipy import interpolateNEWLINENEWLINE#gi=nc.Dataset('/discover/nobackup/yvikhlia/coupled/Forcings/a288x181_o720x410/INPUT/grid_spec.nc')NEWLINE#loni=gi.variables['x_T'][:]; lati=gi.variables['y_T'][:]NEWLINE#jm,im=loni.shapeNEWLINENEWLINEloni,lati=sp.meshgrid(sp.arange(-179.875,180,0.25),sp.arange(-89.875,90,0.25))NEWLINEloni[loni>79.875]-=360.NEWLINEjm,im=720,1440NEWLINENEWLINEvlist=[]NEWLINEvlist.append(('head','f4',16))NEWLINEvlist.append(('h1','i4',1))NEWLINEvlist.append(('kpar','f4',(jm,im)))NEWLINEvlist.append(('h2','i4',1))NEWLINENEWLINE#a=sp.memmap('/discover/nobackup/yvikhlia/coupled/Forcings/a288x181_o720x410/SEAWIFS_KPAR_mon_clim.720x410',dtype=vlist,mode='r')NEWLINEa=sp.memmap('/discover/nobackup/projects/gmao/share/dao_ops/fvInput/g5gcm/bcs/realtime/SST/1440x720/SEAWIFS_KPAR_mon_clim.1440x720',dtype=vlist,mode='r')NEWLINENEWLINE#go=nc.Dataset('/home/yvikhlya/nobackup/coupled/4_0_beta10/GEOSagcm/src/GEOSgcs_GridComp/GEOSgcm_GridComp/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Shared/Raster/data/MOM/1440x1080/grid_spec.nc')NEWLINEgo=nc.Dataset('/home/yvikhlia/nobackup/coupled/Forcings/MOM6/CF0090x6C_TM0360xTM0210/INPUT/ocean_hgrid.nc')NEWLINE#lono=go.variables['x_T'][:]; lato=go.variables['y_T'][:]NEWLINElono=go.variables['x'][1::2,1::2]; lato=go.variables['y'][1::2,1::2]NEWLINEjm,im=lono.shapeNEWLINENEWLINEvlist=[]NEWLINEvlist.append(('head','f4',16))NEWLINEvlist.append(('h1','i4',1))NEWLINEvlist.append(('kpar','f4',(jm,im)))NEWLINEvlist.append(('h2','i4',1))NEWLINEb=sp.zeros(14,dtype=vlist)NEWLINENEWLINEfor i,x in enumerate(a):NEWLINE print iNEWLINE xx=x['kpar'][:]NEWLINE b[i]['head'][:]=x['head'][:]NEWLINE b[i]['h1']=im*jm*4NEWLINE b[i]['kpar'][:]=interpolate.griddata(zip(loni.flatten(),lati.flatten()),xx.flatten(),(lono,lato))NEWLINE b[i]['h2']=im*jm*4NEWLINENEWLINEb['head'][:,13]=im; b['head'][:,14]=jmNEWLINEb['kpar'][sp.isnan(b['kpar'])]=1.0NEWLINEb['kpar'][:,1060:,:]=1.0NEWLINEb.tofile('SEAWIFS_KPAR_mon_clim.360x210')NEWLINE |
from django.conf import settingsNEWLINEfrom rest_framework.routers import DefaultRouter, SimpleRouterNEWLINEfrom django.urls import pathNEWLINEfrom scrape_imdb.movies.views import MovieSerializerView, scrape_moviesNEWLINENEWLINEfrom scrape_imdb.users.api.views import UserViewSetNEWLINENEWLINEif settings.DEBUG:NEWLINE router = DefaultRouter()NEWLINEelse:NEWLINE router = SimpleRouter()NEWLINENEWLINErouter.register("users", UserViewSet)NEWLINErouter.register("movies", MovieSerializerView)NEWLINENEWLINEapp_name = "api"NEWLINEurlpatterns = router.urlsNEWLINENEWLINEurlpatterns += [path("utils/scrape_movies", scrape_movies)]NEWLINE |
import osNEWLINENEWLINEimport torchNEWLINEimport torch.nn as nnNEWLINEimport torch.nn.functional as FNEWLINEimport torchvisionNEWLINEimport torchvision.datasets as datasetsNEWLINEimport torchvision.transforms as transformsNEWLINEfrom pl_bolts.datamodules import CIFAR10DataModuleNEWLINEfrom pl_bolts.callbacks import PrintTableMetricsCallbackNEWLINEfrom pl_bolts.transforms.dataset_normalizations import cifar10_normalizationNEWLINEfrom pytorch_lightning import LightningModule, seed_everything, TrainerNEWLINEfrom pytorch_lightning.callbacks import LearningRateMonitorNEWLINEfrom pytorch_lightning.loggers import TensorBoardLogger, MLFlowLoggerNEWLINEfrom pytorch_lightning.callbacks import CallbackNEWLINEfrom pytorch_lightning.callbacks import EarlyStopping, ModelCheckpointNEWLINEfrom torch.optim.lr_scheduler import OneCycleLRNEWLINEfrom torch.optim.swa_utils import AveragedModel, update_bnNEWLINEfrom torchmetrics.functional import accuracyNEWLINEimport sysNEWLINEsys.path.append("../../")NEWLINEfrom autotorch.models.network import init_networkNEWLINEfrom autotorch.autoptl.custom_trainer import CustomTrainerNEWLINENEWLINEseed_everything(7)NEWLINENEWLINEPATH_DATASETS = os.environ.get(NEWLINE '/media/robin/DATA/datatsets/image_data/cifar10')NEWLINEAVAIL_GPUS = min(1, torch.cuda.device_count())NEWLINEBATCH_SIZE = 16 if AVAIL_GPUS else 32NEWLINENUM_WORKERS = int(os.cpu_count() / 2)NEWLINENEWLINEtrain_transforms = torchvision.transforms.Compose([NEWLINE torchvision.transforms.RandomResizedCrop(32),NEWLINE torchvision.transforms.RandomHorizontalFlip(),NEWLINE torchvision.transforms.ToTensor(),NEWLINE cifar10_normalization(),NEWLINE])NEWLINENEWLINEtest_transforms = torchvision.transforms.Compose([NEWLINE torchvision.transforms.RandomResizedCrop(32),NEWLINE torchvision.transforms.ToTensor(),NEWLINE cifar10_normalization(),NEWLINE])NEWLINENEWLINEcifar10_dm = CIFAR10DataModule(NEWLINE data_dir=PATH_DATASETS,NEWLINE batch_size=BATCH_SIZE,NEWLINE num_workers=NUM_WORKERS,NEWLINE train_transforms=train_transforms,NEWLINE test_transforms=test_transforms,NEWLINE val_transforms=test_transforms,NEWLINE)NEWLINENEWLINE# Data loading codeNEWLINEroot_dir = '/media/robin/DATA/datatsets/image_data/shopee-iet/images'NEWLINEtraindir = os.path.join(root_dir, 'train')NEWLINEvaldir = os.path.join(root_dir, 'val')NEWLINEnormalize = transforms.Normalize(mean=[0.485, 0.456, 0.406],NEWLINE std=[0.229, 0.224, 0.225])NEWLINENEWLINEtrain_dataset = datasets.ImageFolder(NEWLINE traindir,NEWLINE transforms.Compose([NEWLINE transforms.RandomResizedCrop(224),NEWLINE transforms.RandomHorizontalFlip(),NEWLINE transforms.ToTensor(),NEWLINE normalize,NEWLINE ]))NEWLINENEWLINEtrain_sampler = NoneNEWLINEtrain_loader = torch.utils.data.DataLoader(train_dataset,NEWLINE batch_size=32,NEWLINE shuffle=(train_sampler is None),NEWLINE num_workers=0,NEWLINE pin_memory=True,NEWLINE sampler=train_sampler)NEWLINENEWLINEval_dataset = datasets.ImageFolder(NEWLINE valdir,NEWLINE transforms.Compose([NEWLINE transforms.Resize(256),NEWLINE transforms.CenterCrop(224),NEWLINE transforms.ToTensor(),NEWLINE normalize,NEWLINE ]))NEWLINENEWLINEval_loader = torch.utils.data.DataLoader(val_dataset,NEWLINE batch_size=32,NEWLINE shuffle=False,NEWLINE num_workers=0,NEWLINE pin_memory=True)NEWLINENEWLINENEWLINEdef create_model(model_name):NEWLINE model = torchvision.models.resnet18(pretrained=False, num_classes=4)NEWLINE # model = init_network(model_name, num_class=10, pretrained=True)NEWLINE # model.conv1 = nn.Conv2d(3,NEWLINE # 64,NEWLINE # kernel_size=(3, 3),NEWLINE # stride=(1, 1),NEWLINE # padding=(1, 1),NEWLINE # bias=False)NEWLINE # model.maxpool = nn.Identity()NEWLINE return modelNEWLINENEWLINENEWLINEclass LitResnet(LightningModule):NEWLINE def __init__(self, lr=0.05):NEWLINE super().__init__()NEWLINENEWLINE self.save_hyperparameters()NEWLINE self.model = create_model('resnet18')NEWLINENEWLINE def forward(self, x):NEWLINE out = self.model(x)NEWLINE return F.log_softmax(out, dim=1)NEWLINENEWLINE def training_step(self, batch, batch_idx):NEWLINE x, y = batchNEWLINE y_hat = self.model(x)NEWLINE loss = F.cross_entropy(y_hat, y)NEWLINENEWLINE # logs metrics for each training_step,NEWLINE # and the average across the epoch, to the progress bar and loggerNEWLINE self.log('train_loss',NEWLINE loss,NEWLINE on_step=True,NEWLINE on_epoch=True,NEWLINE prog_bar=True,NEWLINE logger=True,NEWLINE sync_dist=True)NEWLINE return lossNEWLINENEWLINE def evaluate(self, batch, stage=None):NEWLINE x, y = batchNEWLINE logits = self(x)NEWLINE loss = F.nll_loss(logits, y)NEWLINE preds = torch.argmax(logits, dim=1)NEWLINE acc = accuracy(preds, y)NEWLINENEWLINE if stage:NEWLINE self.log(f'{stage}_loss', loss, prog_bar=True)NEWLINE self.log(f'{stage}_acc', acc, prog_bar=True)NEWLINENEWLINE def validation_step(self, batch, batch_idx):NEWLINE self.evaluate(batch, 'val')NEWLINENEWLINE # def test_step(self, batch, batch_idx):NEWLINE # self.evaluate(batch, 'test')NEWLINENEWLINE def test_step(self, batch, batch_idx):NEWLINE x, y = batchNEWLINE # implement your ownNEWLINE logits = self(x)NEWLINE loss = F.nll_loss(logits, y)NEWLINE preds = torch.argmax(logits, dim=1)NEWLINE acc = accuracy(preds, y)NEWLINE # log the outputs!NEWLINE self.log_dict({'test_loss': loss, 'test_acc': acc})NEWLINENEWLINE def configure_optimizers(self):NEWLINE optimizer = torch.optim.SGD(NEWLINE self.parameters(),NEWLINE lr=self.hparams.lr,NEWLINE momentum=0.9,NEWLINE weight_decay=5e-4,NEWLINE )NEWLINE steps_per_epoch = 45000 // BATCH_SIZENEWLINE scheduler_dict = {NEWLINE 'scheduler':NEWLINE OneCycleLR(NEWLINE optimizer,NEWLINE 0.1,NEWLINE epochs=self.trainer.max_epochs,NEWLINE steps_per_epoch=steps_per_epoch,NEWLINE ),NEWLINE 'interval':NEWLINE 'step',NEWLINE }NEWLINENEWLINE return {NEWLINE 'optimizer': optimizer,NEWLINE 'lr_scheduler': scheduler_dict,NEWLINE }NEWLINENEWLINE def configure_callbacks(self):NEWLINE checkpoint = ModelCheckpoint(monitor="val_loss")NEWLINE return [checkpoint]NEWLINENEWLINENEWLINEclass PrintCallback(Callback):NEWLINE def on_train_start(self, trainer, pl_module):NEWLINE print("Training is started!")NEWLINENEWLINE def on_train_end(self, trainer, pl_module):NEWLINE print("Training is done.")NEWLINENEWLINENEWLINEearly_stop_callback = EarlyStopping(monitor='val_acc',NEWLINE min_delta=0.00,NEWLINE patience=3,NEWLINE verbose=False,NEWLINE mode='max')NEWLINENEWLINEmodel = LitResnet(lr=0.05)NEWLINEmodel.datamodule = cifar10_dmNEWLINEtrainer = CustomTrainer(NEWLINE progress_bar_refresh_rate=50,NEWLINE log_every_n_steps=1,NEWLINE log_gpu_memory='all',NEWLINE max_epochs=10,NEWLINE gpus=AVAIL_GPUS,NEWLINE sync_batchnorm=True,NEWLINE limit_train_batches=1.0,NEWLINE checkpoint_callback=True,NEWLINE check_val_every_n_epoch=1,NEWLINE precision=16,NEWLINE profiler="simple",NEWLINE val_check_interval=1.0,NEWLINE weights_summary='top',NEWLINE auto_scale_batch_size=True,NEWLINE benchmark=True,NEWLINE weights_save_path='lightning_logs/',NEWLINE default_root_dir=os.getcwd(),NEWLINE max_time={NEWLINE "days": 1,NEWLINE "hours": 5NEWLINE },NEWLINE logger=[NEWLINE TensorBoardLogger(save_dir='lightning_logs/',NEWLINE version="0",NEWLINE name='resnet'),NEWLINE MLFlowLogger(save_dir='mlflow_logs/')NEWLINE ],NEWLINE callbacks=[NEWLINE LearningRateMonitor(logging_interval='step'),NEWLINE PrintTableMetricsCallback(),NEWLINE early_stop_callback,NEWLINE ],NEWLINE)NEWLINENEWLINE# trainer.fit(model, cifar10_dm)NEWLINE# trainer.test(model, datamodule=cifar10_dm)NEWLINENEWLINEtrainer.fit(model, train_dataloader=train_loader, val_dataloaders=val_loader)NEWLINEtrainer.test(model, val_loader)NEWLINENEWLINE |
try:NEWLINE from django.conf.urls import url, includeNEWLINEexcept ImportError:NEWLINE from django.urls import url, includeNEWLINENEWLINEurlpatterns = [NEWLINE url(r'^', include('notify.urls', namespace='notifications')),NEWLINE]NEWLINE |
## @fileNEWLINE# This file contained the parser for define sections in INF file NEWLINE#NEWLINE# Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>NEWLINE#NEWLINE# This program and the accompanying materials are licensed and made available NEWLINE# under the terms and conditions of the BSD License which accompanies this NEWLINE# distribution. The full text of the license may be found at NEWLINE# http://opensource.org/licenses/bsd-license.phpNEWLINE#NEWLINE# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,NEWLINE# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.NEWLINE#NEWLINENEWLINE'''NEWLINEInfDefineSectionParserNEWLINE'''NEWLINE##NEWLINE# Import ModulesNEWLINE#NEWLINEimport reNEWLINENEWLINEfrom Library import DataType as DTNEWLINEfrom Library import GlobalDataNEWLINEfrom Library.Parsing import MacroParserNEWLINEfrom Library.Misc import GetSplitValueListNEWLINEfrom Library.ParserValidate import IsValidArchNEWLINEfrom Object.Parser.InfCommonObject import InfLineCommentObjectNEWLINEfrom Object.Parser.InfDefineObject import InfDefMemberNEWLINEfrom Parser.InfParserMisc import InfExpandMacroNEWLINEfrom Object.Parser.InfMisc import ErrorInInfNEWLINEfrom Logger import StringTable as STNEWLINEfrom Parser.InfParserMisc import InfParserSectionRootNEWLINENEWLINE## __GetValidateArchListNEWLINE# NEWLINE#NEWLINEdef GetValidateArchList(LineContent):NEWLINE NEWLINE TempArch = ''NEWLINE ArchList = []NEWLINE ValidateAcrhPatten = re.compile(r"^\s*#\s*VALID_ARCHITECTURES\s*=\s*.*$", re.DOTALL)NEWLINE NEWLINE if ValidateAcrhPatten.match(LineContent):NEWLINE TempArch = GetSplitValueList(LineContent, DT.TAB_EQUAL_SPLIT, 1)[1]NEWLINE NEWLINE TempArch = GetSplitValueList(TempArch, '(', 1)[0]NEWLINE NEWLINE ArchList = re.split('\s+', TempArch)NEWLINE NewArchList = []NEWLINE for Arch in ArchList:NEWLINE if IsValidArch(Arch):NEWLINE NewArchList.append(Arch)NEWLINE NEWLINE ArchList = NewArchListNEWLINE NEWLINE return ArchList NEWLINENEWLINEclass InfDefinSectionParser(InfParserSectionRoot):NEWLINE def InfDefineParser(self, SectionString, InfSectionObject, FileName, SectionComment):NEWLINE NEWLINE if SectionComment:NEWLINE passNEWLINE #NEWLINE # Parser Defines section content and fill self._ContentList dict.NEWLINE #NEWLINE StillCommentFalg = FalseNEWLINE HeaderComments = []NEWLINE SectionContent = ''NEWLINE ArchList = []NEWLINE _ContentList = []NEWLINE _ValueList = []NEWLINE #NEWLINE # Add WORKSPACE to global Marco dict.NEWLINE #NEWLINE self.FileLocalMacros['WORKSPACE'] = GlobalData.gWORKSPACENEWLINE NEWLINE for Line in SectionString:NEWLINE LineContent = Line[0]NEWLINE LineNo = Line[1]NEWLINE TailComments = ''NEWLINE LineComment = NoneNEWLINE NEWLINE LineInfo = ['', -1, '']NEWLINE LineInfo[0] = FileNameNEWLINE LineInfo[1] = LineNoNEWLINE LineInfo[2] = LineContentNEWLINE NEWLINE if LineContent.strip() == '':NEWLINE continueNEWLINE #NEWLINE # The first time encountered VALIDATE_ARCHITECHERS will be considered as support arch list.NEWLINE #NEWLINE if not ArchList:NEWLINE ArchList = GetValidateArchList(LineContent)NEWLINENEWLINE #NEWLINE # Parser CommentNEWLINE #NEWLINE if LineContent.strip().startswith(DT.TAB_COMMENT_SPLIT):NEWLINE #NEWLINE # Last line is comments, and this line go on.NEWLINE #NEWLINE if StillCommentFalg:NEWLINE HeaderComments.append(Line)NEWLINE SectionContent += LineContent + DT.END_OF_LINENEWLINE continueNEWLINE #NEWLINE # First time encounter comment NEWLINE #NEWLINE else:NEWLINE #NEWLINE # Clear original dataNEWLINE #NEWLINE HeaderComments = []NEWLINE HeaderComments.append(Line)NEWLINE StillCommentFalg = TrueNEWLINE SectionContent += LineContent + DT.END_OF_LINENEWLINE continueNEWLINE else:NEWLINE StillCommentFalg = FalseNEWLINE NEWLINE if len(HeaderComments) >= 1:NEWLINE LineComment = InfLineCommentObject()NEWLINE LineCommentContent = ''NEWLINE for Item in HeaderComments:NEWLINE LineCommentContent += Item[0] + DT.END_OF_LINENEWLINE LineComment.SetHeaderComments(LineCommentContent)NEWLINE NEWLINE #NEWLINE # Find Tail comment.NEWLINE #NEWLINE if LineContent.find(DT.TAB_COMMENT_SPLIT) > -1:NEWLINE TailComments = LineContent[LineContent.find(DT.TAB_COMMENT_SPLIT):]NEWLINE LineContent = LineContent[:LineContent.find(DT.TAB_COMMENT_SPLIT)]NEWLINE if LineComment == None:NEWLINE LineComment = InfLineCommentObject()NEWLINE LineComment.SetTailComments(TailComments)NEWLINE NEWLINE #NEWLINE # Find MacroNEWLINE #NEWLINE Name, Value = MacroParser((LineContent, LineNo), NEWLINE FileName, NEWLINE DT.MODEL_META_DATA_HEADER, NEWLINE self.FileLocalMacros)NEWLINE if Name != None:NEWLINE self.FileLocalMacros[Name] = ValueNEWLINE continue NEWLINENEWLINE #NEWLINE # Replace with [Defines] section MacroNEWLINE #NEWLINE LineContent = InfExpandMacro(LineContent, NEWLINE (FileName, LineContent, LineNo), NEWLINE self.FileLocalMacros, NEWLINE None, True)NEWLINE NEWLINE SectionContent += LineContent + DT.END_OF_LINENEWLINE NEWLINE TokenList = GetSplitValueList(LineContent, DT.TAB_EQUAL_SPLIT, 1)NEWLINE if len(TokenList) < 2:NEWLINE ErrorInInf(ST.ERR_INF_PARSER_DEFINE_ITEM_NO_VALUE,NEWLINE LineInfo=LineInfo) NEWLINE _ValueList[0:len(TokenList)] = TokenListNEWLINE if not _ValueList[0]:NEWLINE ErrorInInf(ST.ERR_INF_PARSER_DEFINE_ITEM_NO_NAME,NEWLINE LineInfo=LineInfo)NEWLINE if not _ValueList[1]:NEWLINE ErrorInInf(ST.ERR_INF_PARSER_DEFINE_ITEM_NO_VALUE,NEWLINE LineInfo=LineInfo) NEWLINE NEWLINE Name, Value = _ValueList[0], _ValueList[1] NEWLINE NEWLINE InfDefMemberObj = InfDefMember(Name, Value)NEWLINE if (LineComment != None):NEWLINE InfDefMemberObj.Comments.SetHeaderComments(LineComment.GetHeaderComments())NEWLINE InfDefMemberObj.Comments.SetTailComments(LineComment.GetTailComments())NEWLINE NEWLINE InfDefMemberObj.CurrentLine.SetFileName(self.FullPath)NEWLINE InfDefMemberObj.CurrentLine.SetLineString(LineContent)NEWLINE InfDefMemberObj.CurrentLine.SetLineNo(LineNo)NEWLINE NEWLINE _ContentList.append(InfDefMemberObj)NEWLINE HeaderComments = []NEWLINE TailComments = ''NEWLINE NEWLINE #NEWLINE # Current Define section archsNEWLINE #NEWLINE if not ArchList:NEWLINE ArchList = ['COMMON']NEWLINE NEWLINE InfSectionObject.SetAllContent(SectionContent) NEWLINE NEWLINE InfSectionObject.SetDefines(_ContentList, Arch=ArchList)NEWLINE |
# Copyright 2019 The Chromium Authors. All rights reserved.NEWLINE# Use of this source code is governed by a BSD-style license that can beNEWLINE# found in the LICENSE file.NEWLINENEWLINEfrom __future__ import absolute_importNEWLINEfrom __future__ import divisionNEWLINEfrom __future__ import print_functionNEWLINENEWLINEimport codecsNEWLINEimport csvNEWLINEimport gzipNEWLINEimport jsonNEWLINEimport loggingNEWLINENEWLINEfrom six.moves import map # pylint: disable=redefined-builtinNEWLINEfrom tracing_build import html2trace, trace2htmlNEWLINENEWLINEGZIP_FILENAME_SUFFIX = '.gz'NEWLINEHTML_FILENAME_SUFFIX = '.html'NEWLINEJSON_FILENAME_SUFFIX = '.json'NEWLINENEWLINETRACE_METADATA_ARG_NAME_MAP = {NEWLINE 'process_sort_index': 'sort_index',NEWLINE 'process_name': 'name'NEWLINE}NEWLINENEWLINENEWLINEdef LoadTraces(chrome_trace_filename):NEWLINE """Load traces from a file and return them as a python list.NEWLINENEWLINE There are several tools in tracing/bin that deal with reading traces from aNEWLINE file. None of them does exactly what we need here. In particular,NEWLINE merge_traces.LoadTrace will discard all traces but one if an HTML file hasNEWLINE several traces.NEWLINENEWLINE TODO(chiniforooshan): create a module for reading/writing different trace fileNEWLINE formats and make every other tool use that module.NEWLINE """NEWLINE traces = []NEWLINE if chrome_trace_filename.endswith(GZIP_FILENAME_SUFFIX):NEWLINE with gzip.open(chrome_trace_filename, 'rb') as f:NEWLINE traces.append(json.load(f))NEWLINE elif chrome_trace_filename.endswith(HTML_FILENAME_SUFFIX):NEWLINE with codecs.open(chrome_trace_filename, mode='r', encoding='utf-8') as f:NEWLINE traces = html2trace.ReadTracesFromHTMLFile(f)NEWLINE elif chrome_trace_filename.endswith(JSON_FILENAME_SUFFIX):NEWLINE with open(chrome_trace_filename, 'r') as f:NEWLINE traces.append(json.load(f))NEWLINE else:NEWLINE raise Exception('Unknown trace file suffix: %s', chrome_trace_filename)NEWLINE return list(map(_ConvertToDictIfNecessary, traces))NEWLINENEWLINENEWLINEdef WriteTraces(output_filename, traces):NEWLINE if output_filename.endswith(GZIP_FILENAME_SUFFIX):NEWLINE with gzip.open(output_filename, 'wb') as f:NEWLINE json.dump(_ConcatTraces(traces), f)NEWLINE elif output_filename.endswith(HTML_FILENAME_SUFFIX):NEWLINE with codecs.open(output_filename, mode='w', encoding='utf-8') as f:NEWLINE trace2html.WriteHTMLForTraceDataToFile(NEWLINE traces, 'Chrome trace with Snapdragon profiler data', f)NEWLINE elif output_filename.endswith(JSON_FILENAME_SUFFIX):NEWLINE with open(output_filename, 'w') as f:NEWLINE json.dump(_ConcatTraces(traces), f)NEWLINE else:NEWLINE raise Exception('Unknown trace file suffix: %s', output_filename)NEWLINENEWLINENEWLINEdef LoadCSV(csv_filename):NEWLINE with open(csv_filename, 'r') as csv_file:NEWLINE reader = csv.DictReader(csv_file, delimiter=',')NEWLINE for row in reader:NEWLINE yield rowNEWLINENEWLINENEWLINEdef AddSnapdragonProfilerData(traces, snapdragon_csv):NEWLINE clock_offset = NoneNEWLINE min_ts = NoneNEWLINE max_ts = 0NEWLINE max_pid = 0NEWLINE for trace in traces:NEWLINE should_use_timestamps_from_this_trace = FalseNEWLINE if 'metadata' in trace and 'clock-offset-since-epoch' in trace['metadata']:NEWLINE if clock_offset is not None:NEWLINE logging.warning('Found more than one clock offset')NEWLINE else:NEWLINE clock_offset = int(trace['metadata']['clock-offset-since-epoch'])NEWLINE should_use_timestamps_from_this_trace = TrueNEWLINE if 'traceEvents' in trace:NEWLINE for event in trace['traceEvents']:NEWLINE max_pid = max(max_pid, event['pid'], event['tid'])NEWLINE if should_use_timestamps_from_this_trace and event['ph'] != 'M':NEWLINE ts = event['ts']NEWLINE max_ts = max(ts + (event['dur'] if 'dur' in event else 0), max_ts)NEWLINE if min_ts is None or min_ts > ts:NEWLINE min_ts = tsNEWLINE if clock_offset is None:NEWLINE raise Exception('Cannot find clock offset in Chrome traces')NEWLINENEWLINE process_names = {}NEWLINE num_counter_events = 0NEWLINE events = []NEWLINE for row in snapdragon_csv:NEWLINE ts = int(row['TimestampRaw']) - clock_offsetNEWLINE if ts < min_ts or ts > max_ts:NEWLINE continueNEWLINE if row['Process'] not in process_names:NEWLINE max_pid += 1NEWLINE process_names[row['Process']] = max_pidNEWLINE events.append(_MetadataEvent(max_pid, 'process_sort_index', -7))NEWLINE events.append(_MetadataEvent(max_pid, 'process_name', row['Process']))NEWLINE pid = process_names[row['Process']]NEWLINE events.append(_CounterEvent(pid, ts, row['Metric'], row['Value']))NEWLINE num_counter_events += 1NEWLINE logging.info('Added %d counter events.', num_counter_events)NEWLINE traces.append({'traceEvents': events})NEWLINENEWLINENEWLINEdef _ConcatTraces(traces):NEWLINE # As long as at most one of the traces has a field with a non-list value, e.g.NEWLINE # a metadata field, we can trivially concat them.NEWLINE #NEWLINE # TODO(chiniforooshan): to support writing several traces with severalNEWLINE # metadata fields in a JSON file, we can write a simpleNEWLINE # trace_list_importer.html that treats each of them as a subtrace.NEWLINE #NEWLINE # Note: metadata fields should not be confused with metadata trace events.NEWLINE result = NoneNEWLINE for trace in traces:NEWLINE if result is None:NEWLINE result = trace.copy()NEWLINE continueNEWLINE for k, v in trace.items():NEWLINE if k in result:NEWLINE if not isinstance(v, list):NEWLINE raise Exception('Cannot concat two traces with non-list values 'NEWLINE '(e.g. two traces with metadata)')NEWLINE result[k].extend(v)NEWLINE else:NEWLINE result[k] = list(v) if isinstance(v, list) else vNEWLINE return resultNEWLINENEWLINENEWLINEdef _ConvertToDictIfNecessary(trace):NEWLINE return {'traceEvents': trace} if isinstance(trace, list) else traceNEWLINENEWLINENEWLINEdef _MetadataEvent(pid, name, value):NEWLINE if name not in TRACE_METADATA_ARG_NAME_MAP:NEWLINE raise Exception('Unknown metadata name: %s', name)NEWLINE arg_name = TRACE_METADATA_ARG_NAME_MAP[name]NEWLINE return {NEWLINE 'pid': pid,NEWLINE 'tid': pid,NEWLINE 'ts': 0,NEWLINE 'ph': 'M',NEWLINE 'cat': '__metadata',NEWLINE 'name': name,NEWLINE 'args': {arg_name: value}NEWLINE }NEWLINENEWLINENEWLINEdef _CounterEvent(pid, timestamp, name, value):NEWLINE if not isinstance(value, float):NEWLINE value = float(value)NEWLINE return {NEWLINE 'pid': pid,NEWLINE 'tid': pid,NEWLINE 'ts': timestamp,NEWLINE 'ph': 'C',NEWLINE 'name': name,NEWLINE 'args': {'Value': value}NEWLINE }NEWLINE |
import unittestNEWLINENEWLINEfrom cubes.sql.mapper import StarSchemaMapper, distill_namingNEWLINEfrom cubes.model import AttributeNEWLINENEWLINEfrom ..common import CubesTestCaseBase, create_providerNEWLINENEWLINEclass MapperTestCase(CubesTestCaseBase):NEWLINE def setUp(self):NEWLINE super(MapperTestCase, self).setUp()NEWLINENEWLINE self.provider = create_provider("mapper_test.json")NEWLINENEWLINE self.cube = self.provider.cube("sales")NEWLINE naming = {NEWLINE "dimension_prefix": "dim_",NEWLINE "dimension_suffix": "_dim"NEWLINE }NEWLINE self.naming = distill_naming(naming)NEWLINE self.mapper = StarSchemaMapper(self.cube, self.naming)NEWLINENEWLINE self.mapper.mappings = {NEWLINE "product.name": "product.product_name",NEWLINE "product.category": "product.category_id",NEWLINE "subcategory.name.en": "subcategory.subcategory_name_en",NEWLINE "subcategory.name.sk": "subcategory.subcategory_name_sk"NEWLINE }NEWLINENEWLINE def test_logical_reference(self):NEWLINENEWLINE dim = self.provider.dimension("date")NEWLINE attr = Attribute("month", dimension=dim)NEWLINE self.assertEqual("date.month", attr.ref)NEWLINENEWLINE dim = self.provider.dimension("product")NEWLINE attr = Attribute("category", dimension=dim)NEWLINE self.assertEqual("product.category", attr.ref)NEWLINENEWLINE dim = self.provider.dimension("flag")NEWLINE attr = Attribute("flag", dimension=dim)NEWLINE self.assertEqual("flag", attr.ref)NEWLINENEWLINE attr = Attribute("measure", dimension=None)NEWLINE self.assertEqual("measure", attr.ref)NEWLINENEWLINE def assertMapping(self, expected, logical_ref, mapper=None):NEWLINE """Create string reference by concatentanig table and column name.NEWLINE No schema is expected (is ignored)."""NEWLINENEWLINE attr = self.cube.attribute(logical_ref)NEWLINE mapper = mapper or self.mapperNEWLINE ref = mapper[attr]NEWLINE sref = ref[1] + "." + ref[2]NEWLINENEWLINE self.assertEqual(expected, sref)NEWLINENEWLINE def test_physical_refs_dimensions(self):NEWLINE """Testing correct default mappings of dimensions (with and withoutNEWLINE explicit default prefix) in physical references."""NEWLINENEWLINE # No dimension prefixNEWLINE self.mapper.naming.dimension_prefix = ""NEWLINE self.mapper.naming.dimension_suffix = ""NEWLINE self.assertMapping("date.year", "date.year")NEWLINE self.assertMapping("sales.flag", "flag")NEWLINE self.assertMapping("sales.amount", "amount")NEWLINENEWLINE # With prefixNEWLINE self.mapper.naming.dimension_prefix = "dm_"NEWLINE self.assertMapping("dm_date.year", "date.year")NEWLINE self.assertMapping("dm_date.month_name", "date.month_name")NEWLINE self.assertMapping("sales.flag", "flag")NEWLINE self.assertMapping("sales.amount", "amount")NEWLINENEWLINE def test_physical_refs_flat_dims(self):NEWLINE self.cube.fact = NoneNEWLINE self.assertMapping("sales.flag", "flag")NEWLINENEWLINE def test_physical_refs_facts(self):NEWLINE """Testing correct mappings of fact attributes in physical references"""NEWLINENEWLINE fact = self.cube.factNEWLINE self.cube.fact = NoneNEWLINE self.assertMapping("sales.amount", "amount")NEWLINE # self.assertEqual("sales.flag", sref("flag.flag"))NEWLINE self.cube.fact = factNEWLINENEWLINE def test_physical_refs_with_mappings_and_locales(self):NEWLINE """Testing mappings of mapped attributes and localized attributes inNEWLINE physical references"""NEWLINENEWLINE self.mapper.mappings = self.cube.mappingsNEWLINE # Test defaultsNEWLINE # Localized mapper is localizing to 'sk', non-localized mapper isNEWLINE # localizing to default 'en'NEWLINE #NEWLINE # Mapper with locale that we haveNEWLINE sk_mapper = StarSchemaMapper(self.cube, self.naming, locale="sk")NEWLINENEWLINE # Mapper with locale that we don't haveNEWLINE de_mapper = StarSchemaMapper(self.cube, self.naming, locale="de")NEWLINENEWLINE self.assertMapping("dim_date_dim.month_name", "date.month_name")NEWLINENEWLINE self.assertMapping("dim_category_dim.category_name_en",NEWLINE "product.category_name")NEWLINENEWLINE self.assertMapping("dim_category_dim.category_name_sk",NEWLINE "product.category_name", sk_mapper)NEWLINENEWLINE # This should default to 'en' since we don't have 'de' locale and theNEWLINE # 'en' locale is the default oneNEWLINE self.assertMapping("dim_category_dim.category_name_en",NEWLINE "product.category_name", de_mapper)NEWLINENEWLINE # Test with mappingNEWLINE self.assertMapping("dim_product_dim.product_name", "product.name")NEWLINE self.assertMapping("dim_product_dim.category_id", "product.category")NEWLINENEWLINE # The product name is not localized, we should get the same for anyNEWLINE # mapperNEWLINE self.assertMapping("dim_product_dim.product_name", "product.name",NEWLINE sk_mapper)NEWLINE self.assertMapping("dim_product_dim.product_name", "product.name",NEWLINE de_mapper)NEWLINENEWLINE self.assertMapping("dim_category_dim.subcategory_name_en",NEWLINE "product.subcategory_name")NEWLINE self.assertMapping("dim_category_dim.subcategory_name_sk",NEWLINE "product.subcategory_name",NEWLINE sk_mapper)NEWLINE self.assertMapping("dim_category_dim.subcategory_name_en",NEWLINE "product.subcategory_name",NEWLINE de_mapper)NEWLINENEWLINE |
from test_common import get_sample_layer, get_opsNEWLINEfrom nose.tools import assert_raisesNEWLINEimport tvmNEWLINENEWLINEdef test_set_tiling_wrong_inputs():NEWLINE layer = get_sample_layer()NEWLINE with assert_raises(Exception):NEWLINE # wrong iv nameNEWLINE layer.set_tiling("n", [4, 1, 1, 1])NEWLINENEWLINE with assert_raises(Exception):NEWLINE # wrong tiling lengthNEWLINE layer.set_tiling("N", [4, 1, 1, 1, 1])NEWLINENEWLINE with assert_raises(Exception):NEWLINE # wrong tiling valueNEWLINE layer.set_tiling("N", [4, 2, 1, 1])NEWLINENEWLINE # correct caseNEWLINE layer.set_tiling("N", [4, 1, 1, 1])NEWLINENEWLINENEWLINEdef test_set_tiling():NEWLINE layer = get_sample_layer()NEWLINE assert layer._loop_TCs["N_DRAM"] == 4NEWLINE assert layer._loop_TCs["N_SPM"] == 1NEWLINE assert layer._loop_TCs["N_RF"] == 1NEWLINE assert layer._loop_TCs["N_Spatial"] == 1NEWLINENEWLINE layer.set_tiling("N", [1, 1, 2, 2])NEWLINE assert layer._loop_TCs["N_DRAM"] == 1NEWLINE assert layer._loop_TCs["N_SPM"] == 1NEWLINE assert layer._loop_TCs["N_RF"] == 2NEWLINE assert layer._loop_TCs["N_Spatial"] == 2NEWLINENEWLINENEWLINEdef test_set_ordering():NEWLINE layer = get_sample_layer()NEWLINE new_order = ["M", "C", "Ox", "N", "Oy", "Fx", "Fy"]NEWLINE layer.set_ordering("DRAM", new_order)NEWLINE assert layer._loop_IVs["DRAM"] == [ x+"_DRAM" for x in new_order ]NEWLINENEWLINENEWLINEdef test_get_loop():NEWLINE layer = get_sample_layer()NEWLINE loop = layer._get_loop()NEWLINENEWLINENEWLINEdef test_get_stores():NEWLINE layer = get_sample_layer()NEWLINE stores = layer._get_stores()NEWLINE assert len(stores) == 1NEWLINE store = stores[0]NEWLINE assert isinstance(store, tvm.stmt.Store)NEWLINENEWLINE stores = layer._get_stores(pass_init=False)NEWLINE assert len(stores) == 2NEWLINE assert store in storesNEWLINE for store in stores:NEWLINE assert isinstance(store, tvm.stmt.Store)NEWLINENEWLINENEWLINEdef test_get_reads_writes():NEWLINE layer = get_sample_layer()NEWLINE reads, writes = layer._get_reads_writes()NEWLINE assert len(reads) == 3NEWLINE assert len(writes) == 1NEWLINE for read in reads:NEWLINE assert isinstance(read, tvm.expr.Load)NEWLINE for write in writes:NEWLINE assert isinstance(write, tvm.stmt.Store)NEWLINENEWLINENEWLINEdef test_get_reads_writes_of_operand():NEWLINE layer = get_sample_layer()NEWLINE reads, writes = layer._get_reads_writes_of_operand(layer._O.name)NEWLINE assert len(reads) == 1 and len(writes) == 1NEWLINE reads, writes = layer._get_reads_writes_of_operand(layer._W.name)NEWLINE assert len(reads) == 1 and len(writes) == 0NEWLINE reads, writes = layer._get_reads_writes_of_operand(layer._I.name)NEWLINE assert len(reads) == 1 and len(writes) == 0NEWLINENEWLINENEWLINEdef test_get_operands():NEWLINE layer = get_sample_layer()NEWLINE O_write, O_read, I, W = get_ops(layer)NEWLINE operands = layer._get_operands()NEWLINENEWLINE assert O_write in operands[layer._O.name]NEWLINE assert O_read in operands[layer._O.name]NEWLINE assert I in operands[layer._I.name]NEWLINE assert W in operands[layer._W.name]NEWLINENEWLINENEWLINEdef test_get_num_different_pixels():NEWLINE layer = get_sample_layer()NEWLINE reads, writes = layer._get_reads_writes_of_operand(layer._I.name)NEWLINE assert layer._get_num_different_pixels(reads[0], [1, 2, 2, 14, 14, 3, 3]) == 512NEWLINENEWLINENEWLINEdef test_get_index_vars():NEWLINE layer = get_sample_layer()NEWLINE O_write, O_read, I, W = get_ops(layer)NEWLINE assert layer._get_index_vars(O_write) == ["N", "M", "Ox", "Oy"]NEWLINE assert layer._get_index_vars(O_read) == ["N", "M", "Ox", "Oy"]NEWLINE assert set(layer._get_index_vars(I)) == set(["N", "C", "Ox", "Oy", "Fx", "Fy"])NEWLINE assert layer._get_index_vars(W) == ["M", "C", "Fx", "Fy"]NEWLINENEWLINENEWLINEdef test_get_index_exprs():NEWLINE layer = get_sample_layer()NEWLINE O_write, O_read, I, W = get_ops(layer)NEWLINE keys = ["n", "m", "c", "ox", "oy", "fx", "fy"]NEWLINE values = [ int(layer.get_TripCounts(key.title(), "loop") / layer.get_TripCounts(key.title(), "DRAM")) for key in layer.base_TCs ]NEWLINE local_vars = dict(zip(keys, values))NEWLINE assert layer._get_index_expr_evaluated(I, 0, local_vars) == 16NEWLINE assert layer._get_index_expr_evaluated(I, 1, local_vars) == 16NEWLINE assert layer._get_index_expr_evaluated(I, 2, local_vars) == 32NEWLINE assert layer._get_index_expr_evaluated(I, 3, local_vars) == 1NEWLINENEWLINENEWLINEdef test_get_tensor_from_name():NEWLINE layer = get_sample_layer()NEWLINE assert layer._get_tensor_from_name("I") == layer._INEWLINE assert layer._get_tensor_from_name("O") == layer._ONEWLINE assert layer._get_tensor_from_name("W") == layer._W |
"""Builder class used to transform a mypy AST to the IR form.NEWLINENEWLINEThe IRBuilder class maintains transformation state and provides accessNEWLINEto various helpers used to implement the transform.NEWLINENEWLINEThe top-level transform control logic is in mypyc.irbuild.main.NEWLINENEWLINEmypyc.irbuild.visitor.IRBuilderVisitor is used to dispatch based on mypyNEWLINEAST node type to code that actually does the bulk of the work. ForNEWLINEexample, expressions are transformed in mypyc.irbuild.expression andNEWLINEfunctions are transformed in mypyc.irbuild.function.NEWLINE"""NEWLINENEWLINEfrom mypyc.irbuild.prepare import RegisterImplInfoNEWLINEfrom typing import Callable, Dict, List, Tuple, Optional, Union, Sequence, Set, AnyNEWLINEfrom typing_extensions import overloadNEWLINEfrom mypy.backports import OrderedDictNEWLINENEWLINEfrom mypy.build import GraphNEWLINEfrom mypy.nodes import (NEWLINE MypyFile, SymbolNode, Statement, OpExpr, IntExpr, NameExpr, LDEF, Var, UnaryExpr,NEWLINE CallExpr, IndexExpr, Expression, MemberExpr, RefExpr, Lvalue, TupleExpr,NEWLINE TypeInfo, Decorator, OverloadedFuncDef, StarExpr, ComparisonExpr, GDEF,NEWLINE ArgKind, ARG_POS, ARG_NAMED, FuncDef,NEWLINE)NEWLINEfrom mypy.types import (NEWLINE Type, Instance, TupleType, UninhabitedType, get_proper_typeNEWLINE)NEWLINEfrom mypy.maptype import map_instance_to_supertypeNEWLINEfrom mypy.visitor import ExpressionVisitor, StatementVisitorNEWLINEfrom mypy.util import split_targetNEWLINENEWLINEfrom mypyc.common import TEMP_ATTR_NAME, SELF_NAMENEWLINEfrom mypyc.irbuild.prebuildvisitor import PreBuildVisitorNEWLINEfrom mypyc.ir.ops import (NEWLINE BasicBlock, Integer, Value, Register, Op, Assign, Branch, Unreachable, TupleGet, GetAttr,NEWLINE SetAttr, LoadStatic, InitStatic, NAMESPACE_MODULE, RaiseStandardErrorNEWLINE)NEWLINEfrom mypyc.ir.rtypes import (NEWLINE RType, RTuple, RInstance, c_int_rprimitive, int_rprimitive, dict_rprimitive,NEWLINE none_rprimitive, is_none_rprimitive, object_rprimitive, is_object_rprimitive,NEWLINE str_rprimitive, is_tagged, is_list_rprimitive, is_tuple_rprimitive, c_pyssize_t_rprimitiveNEWLINE)NEWLINEfrom mypyc.ir.func_ir import FuncIR, INVALID_FUNC_DEF, RuntimeArg, FuncSignature, FuncDeclNEWLINEfrom mypyc.ir.class_ir import ClassIR, NonExtClassInfoNEWLINEfrom mypyc.primitives.registry import CFunctionDescription, function_opsNEWLINEfrom mypyc.primitives.list_ops import to_list, list_pop_last, list_get_item_unsafe_opNEWLINEfrom mypyc.primitives.dict_ops import dict_get_item_op, dict_set_item_opNEWLINEfrom mypyc.primitives.generic_ops import py_setattr_op, iter_op, next_opNEWLINEfrom mypyc.primitives.misc_ops import (NEWLINE import_op, check_unpack_count_op, get_module_dict_op, import_extra_args_opNEWLINE)NEWLINEfrom mypyc.crash import catch_errorsNEWLINEfrom mypyc.options import CompilerOptionsNEWLINEfrom mypyc.errors import ErrorsNEWLINEfrom mypyc.irbuild.nonlocalcontrol import (NEWLINE NonlocalControl, BaseNonlocalControl, LoopNonlocalControl, GeneratorNonlocalControlNEWLINE)NEWLINEfrom mypyc.irbuild.targets import (NEWLINE AssignmentTarget, AssignmentTargetRegister, AssignmentTargetIndex, AssignmentTargetAttr,NEWLINE AssignmentTargetTupleNEWLINE)NEWLINEfrom mypyc.irbuild.context import FuncInfo, ImplicitClassNEWLINEfrom mypyc.irbuild.mapper import MapperNEWLINEfrom mypyc.irbuild.ll_builder import LowLevelIRBuilderNEWLINEfrom mypyc.irbuild.util import is_constantNEWLINENEWLINENEWLINEclass IRVisitor(ExpressionVisitor[Value], StatementVisitor[None]):NEWLINE passNEWLINENEWLINENEWLINEclass UnsupportedException(Exception):NEWLINE passNEWLINENEWLINENEWLINESymbolTarget = Union[AssignmentTargetRegister, AssignmentTargetAttr]NEWLINENEWLINENEWLINEclass IRBuilder:NEWLINE def __init__(self,NEWLINE current_module: str,NEWLINE types: Dict[Expression, Type],NEWLINE graph: Graph,NEWLINE errors: Errors,NEWLINE mapper: Mapper,NEWLINE pbv: PreBuildVisitor,NEWLINE visitor: IRVisitor,NEWLINE options: CompilerOptions,NEWLINE singledispatch_impls: Dict[FuncDef, List[RegisterImplInfo]]) -> None:NEWLINE self.builder = LowLevelIRBuilder(current_module, mapper, options)NEWLINE self.builders = [self.builder]NEWLINE self.symtables: List[OrderedDict[SymbolNode, SymbolTarget]] = [OrderedDict()]NEWLINE self.runtime_args: List[List[RuntimeArg]] = [[]]NEWLINE self.function_name_stack: List[str] = []NEWLINE self.class_ir_stack: List[ClassIR] = []NEWLINENEWLINE self.current_module = current_moduleNEWLINE self.mapper = mapperNEWLINE self.types = typesNEWLINE self.graph = graphNEWLINE self.ret_types: List[RType] = []NEWLINE self.functions: List[FuncIR] = []NEWLINE self.classes: List[ClassIR] = []NEWLINE self.final_names: List[Tuple[str, RType]] = []NEWLINE self.callable_class_names: Set[str] = set()NEWLINE self.options = optionsNEWLINENEWLINE # These variables keep track of the number of lambdas, implicit indices, and implicitNEWLINE # iterators instantiated so we avoid name conflicts. The indices and iterators areNEWLINE # instantiated from for-loops.NEWLINE self.lambda_counter = 0NEWLINE self.temp_counter = 0NEWLINENEWLINE # These variables are populated from the first-pass PreBuildVisitor.NEWLINE self.free_variables = pbv.free_variablesNEWLINE self.prop_setters = pbv.prop_settersNEWLINE self.encapsulating_funcs = pbv.encapsulating_funcsNEWLINE self.nested_fitems = pbv.nested_funcs.keys()NEWLINE self.fdefs_to_decorators = pbv.funcs_to_decoratorsNEWLINE self.singledispatch_impls = singledispatch_implsNEWLINENEWLINE self.visitor = visitorNEWLINENEWLINE # This list operates similarly to a function call stack for nested functions. Whenever aNEWLINE # function definition begins to be generated, a FuncInfo instance is added to the stack,NEWLINE # and information about that function (e.g. whether it is nested, its environment class toNEWLINE # be generated) is stored in that FuncInfo instance. When the function is done beingNEWLINE # generated, its corresponding FuncInfo is popped off the stack.NEWLINE self.fn_info = FuncInfo(INVALID_FUNC_DEF, '', '')NEWLINE self.fn_infos: List[FuncInfo] = [self.fn_info]NEWLINENEWLINE # This list operates as a stack of constructs that modify theNEWLINE # behavior of nonlocal control flow constructs.NEWLINE self.nonlocal_control: List[NonlocalControl] = []NEWLINENEWLINE self.errors = errorsNEWLINE # Notionally a list of all of the modules imported by theNEWLINE # module being compiled, but stored as an OrderedDict so weNEWLINE # can also do quick lookups.NEWLINE self.imports: OrderedDict[str, None] = OrderedDict()NEWLINENEWLINE # High-level controlNEWLINENEWLINE def set_module(self, module_name: str, module_path: str) -> None:NEWLINE """Set the name and path of the current module.NEWLINENEWLINE This must be called before transforming any AST nodes.NEWLINE """NEWLINE self.module_name = module_nameNEWLINE self.module_path = module_pathNEWLINENEWLINE @overloadNEWLINE def accept(self, node: Expression) -> Value: ...NEWLINENEWLINE @overloadNEWLINE def accept(self, node: Statement) -> None: ...NEWLINENEWLINE def accept(self, node: Union[Statement, Expression]) -> Optional[Value]:NEWLINE """Transform an expression or a statement."""NEWLINE with self.catch_errors(node.line):NEWLINE if isinstance(node, Expression):NEWLINE try:NEWLINE res = node.accept(self.visitor)NEWLINE res = self.coerce(res, self.node_type(node), node.line)NEWLINE # If we hit an error during compilation, we want toNEWLINE # keep trying, so we can produce more errorNEWLINE # messages. Generate a temp of the right type to keepNEWLINE # from causing more downstream trouble.NEWLINE except UnsupportedException:NEWLINE res = Register(self.node_type(node))NEWLINE return resNEWLINE else:NEWLINE try:NEWLINE node.accept(self.visitor)NEWLINE except UnsupportedException:NEWLINE passNEWLINE return NoneNEWLINENEWLINE # Pass through methods for the most common low-level builder ops, for convenience.NEWLINENEWLINE def add(self, op: Op) -> Value:NEWLINE return self.builder.add(op)NEWLINENEWLINE def goto(self, target: BasicBlock) -> None:NEWLINE self.builder.goto(target)NEWLINENEWLINE def activate_block(self, block: BasicBlock) -> None:NEWLINE self.builder.activate_block(block)NEWLINENEWLINE def goto_and_activate(self, block: BasicBlock) -> None:NEWLINE self.builder.goto_and_activate(block)NEWLINENEWLINE def self(self) -> Register:NEWLINE return self.builder.self()NEWLINENEWLINE def py_get_attr(self, obj: Value, attr: str, line: int) -> Value:NEWLINE return self.builder.py_get_attr(obj, attr, line)NEWLINENEWLINE def load_str(self, value: str) -> Value:NEWLINE return self.builder.load_str(value)NEWLINENEWLINE def load_bytes_from_str_literal(self, value: str) -> Value:NEWLINE """Load bytes object from a string literal.NEWLINENEWLINE The literal characters of BytesExpr (the characters inside b'')NEWLINE are stored in BytesExpr.value, whose type is 'str' not 'bytes'.NEWLINE Thus we perform a special conversion here.NEWLINE """NEWLINE bytes_value = bytes(value, 'utf8').decode('unicode-escape').encode('raw-unicode-escape')NEWLINE return self.builder.load_bytes(bytes_value)NEWLINENEWLINE def load_int(self, value: int) -> Value:NEWLINE return self.builder.load_int(value)NEWLINENEWLINE def unary_op(self, lreg: Value, expr_op: str, line: int) -> Value:NEWLINE return self.builder.unary_op(lreg, expr_op, line)NEWLINENEWLINE def binary_op(self, lreg: Value, rreg: Value, expr_op: str, line: int) -> Value:NEWLINE return self.builder.binary_op(lreg, rreg, expr_op, line)NEWLINENEWLINE def coerce(self, src: Value, target_type: RType, line: int, force: bool = False) -> Value:NEWLINE return self.builder.coerce(src, target_type, line, force)NEWLINENEWLINE def none_object(self) -> Value:NEWLINE return self.builder.none_object()NEWLINENEWLINE def none(self) -> Value:NEWLINE return self.builder.none()NEWLINENEWLINE def true(self) -> Value:NEWLINE return self.builder.true()NEWLINENEWLINE def false(self) -> Value:NEWLINE return self.builder.false()NEWLINENEWLINE def new_list_op(self, values: List[Value], line: int) -> Value:NEWLINE return self.builder.new_list_op(values, line)NEWLINENEWLINE def new_set_op(self, values: List[Value], line: int) -> Value:NEWLINE return self.builder.new_set_op(values, line)NEWLINENEWLINE def translate_is_op(self,NEWLINE lreg: Value,NEWLINE rreg: Value,NEWLINE expr_op: str,NEWLINE line: int) -> Value:NEWLINE return self.builder.translate_is_op(lreg, rreg, expr_op, line)NEWLINENEWLINE def py_call(self,NEWLINE function: Value,NEWLINE arg_values: List[Value],NEWLINE line: int,NEWLINE arg_kinds: Optional[List[ArgKind]] = None,NEWLINE arg_names: Optional[Sequence[Optional[str]]] = None) -> Value:NEWLINE return self.builder.py_call(function, arg_values, line, arg_kinds, arg_names)NEWLINENEWLINE def add_bool_branch(self, value: Value, true: BasicBlock, false: BasicBlock) -> None:NEWLINE self.builder.add_bool_branch(value, true, false)NEWLINENEWLINE def load_native_type_object(self, fullname: str) -> Value:NEWLINE return self.builder.load_native_type_object(fullname)NEWLINENEWLINE def gen_method_call(self,NEWLINE base: Value,NEWLINE name: str,NEWLINE arg_values: List[Value],NEWLINE result_type: Optional[RType],NEWLINE line: int,NEWLINE arg_kinds: Optional[List[ArgKind]] = None,NEWLINE arg_names: Optional[List[Optional[str]]] = None) -> Value:NEWLINE return self.builder.gen_method_call(NEWLINE base, name, arg_values, result_type, line, arg_kinds, arg_namesNEWLINE )NEWLINENEWLINE def load_module(self, name: str) -> Value:NEWLINE return self.builder.load_module(name)NEWLINENEWLINE def call_c(self, desc: CFunctionDescription, args: List[Value], line: int) -> Value:NEWLINE return self.builder.call_c(desc, args, line)NEWLINENEWLINE def int_op(self, type: RType, lhs: Value, rhs: Value, op: int, line: int) -> Value:NEWLINE return self.builder.int_op(type, lhs, rhs, op, line)NEWLINENEWLINE def compare_tagged(self, lhs: Value, rhs: Value, op: str, line: int) -> Value:NEWLINE return self.builder.compare_tagged(lhs, rhs, op, line)NEWLINENEWLINE def compare_tuples(self, lhs: Value, rhs: Value, op: str, line: int) -> Value:NEWLINE return self.builder.compare_tuples(lhs, rhs, op, line)NEWLINENEWLINE def builtin_len(self, val: Value, line: int) -> Value:NEWLINE return self.builder.builtin_len(val, line)NEWLINENEWLINE def new_tuple(self, items: List[Value], line: int) -> Value:NEWLINE return self.builder.new_tuple(items, line)NEWLINENEWLINE # Helpers for IR buildingNEWLINENEWLINE def add_to_non_ext_dict(self, non_ext: NonExtClassInfo,NEWLINE key: str, val: Value, line: int) -> None:NEWLINE # Add an attribute entry into the class dict of a non-extension class.NEWLINE key_unicode = self.load_str(key)NEWLINE self.call_c(dict_set_item_op, [non_ext.dict, key_unicode, val], line)NEWLINENEWLINE def gen_import_from(self, id: str, globals_dict: Value,NEWLINE imported: List[str], line: int) -> Value:NEWLINE self.imports[id] = NoneNEWLINENEWLINE null_dict = Integer(0, dict_rprimitive, line)NEWLINE names_to_import = self.new_list_op([self.load_str(name) for name in imported], line)NEWLINE zero_int = Integer(0, c_int_rprimitive, line)NEWLINE value = self.call_c(NEWLINE import_extra_args_op,NEWLINE [self.load_str(id), globals_dict, null_dict, names_to_import, zero_int],NEWLINE line,NEWLINE )NEWLINE self.add(InitStatic(value, id, namespace=NAMESPACE_MODULE))NEWLINE return valueNEWLINENEWLINE def gen_import(self, id: str, line: int) -> None:NEWLINE self.imports[id] = NoneNEWLINENEWLINE needs_import, out = BasicBlock(), BasicBlock()NEWLINE self.check_if_module_loaded(id, line, needs_import, out)NEWLINENEWLINE self.activate_block(needs_import)NEWLINE value = self.call_c(import_op, [self.load_str(id)], line)NEWLINE self.add(InitStatic(value, id, namespace=NAMESPACE_MODULE))NEWLINE self.goto_and_activate(out)NEWLINENEWLINE def check_if_module_loaded(self, id: str, line: int,NEWLINE needs_import: BasicBlock, out: BasicBlock) -> None:NEWLINE """Generate code that checks if the module `id` has been loaded yet.NEWLINENEWLINE Arguments:NEWLINE id: name of module to check if importedNEWLINE line: line number that the import occurs onNEWLINE needs_import: the BasicBlock that is run if the module has not been loaded yetNEWLINE out: the BasicBlock that is run if the module has already been loaded"""NEWLINE first_load = self.load_module(id)NEWLINE comparison = self.translate_is_op(first_load, self.none_object(), 'is not', line)NEWLINE self.add_bool_branch(comparison, out, needs_import)NEWLINENEWLINE def get_module(self, module: str, line: int) -> Value:NEWLINE # Python 3.7 has a nice 'PyImport_GetModule' function that we can't use :(NEWLINE mod_dict = self.call_c(get_module_dict_op, [], line)NEWLINE # Get module object from modules dict.NEWLINE return self.call_c(dict_get_item_op,NEWLINE [mod_dict, self.load_str(module)], line)NEWLINENEWLINE def get_module_attr(self, module: str, attr: str, line: int) -> Value:NEWLINE """Look up an attribute of a module without storing it in the local namespace.NEWLINENEWLINE For example, get_module_attr('typing', 'TypedDict', line) results inNEWLINE the value of 'typing.TypedDict'.NEWLINENEWLINE Import the module if needed.NEWLINE """NEWLINE self.gen_import(module, line)NEWLINE module_obj = self.get_module(module, line)NEWLINE return self.py_get_attr(module_obj, attr, line)NEWLINENEWLINE def assign_if_null(self, target: Register,NEWLINE get_val: Callable[[], Value], line: int) -> None:NEWLINE """If target is NULL, assign value produced by get_val to it."""NEWLINE error_block, body_block = BasicBlock(), BasicBlock()NEWLINE self.add(Branch(target, error_block, body_block, Branch.IS_ERROR))NEWLINE self.activate_block(error_block)NEWLINE self.add(Assign(target, self.coerce(get_val(), target.type, line)))NEWLINE self.goto(body_block)NEWLINE self.activate_block(body_block)NEWLINENEWLINE def maybe_add_implicit_return(self) -> None:NEWLINE if is_none_rprimitive(self.ret_types[-1]) or is_object_rprimitive(self.ret_types[-1]):NEWLINE self.add_implicit_return()NEWLINE else:NEWLINE self.add_implicit_unreachable()NEWLINENEWLINE def add_implicit_return(self) -> None:NEWLINE block = self.builder.blocks[-1]NEWLINE if not block.terminated:NEWLINE retval = self.coerce(self.builder.none(), self.ret_types[-1], -1)NEWLINE self.nonlocal_control[-1].gen_return(self, retval, self.fn_info.fitem.line)NEWLINENEWLINE def add_implicit_unreachable(self) -> None:NEWLINE block = self.builder.blocks[-1]NEWLINE if not block.terminated:NEWLINE self.add(Unreachable())NEWLINENEWLINE def disallow_class_assignments(self, lvalues: List[Lvalue], line: int) -> None:NEWLINE # Some best-effort attempts to disallow assigning to classNEWLINE # variables that aren't marked ClassVar, since we blatantlyNEWLINE # miscompile the interaction between instance and classNEWLINE # variables.NEWLINE for lvalue in lvalues:NEWLINE if (isinstance(lvalue, MemberExpr)NEWLINE and isinstance(lvalue.expr, RefExpr)NEWLINE and isinstance(lvalue.expr.node, TypeInfo)):NEWLINE var = lvalue.expr.node[lvalue.name].nodeNEWLINE if isinstance(var, Var) and not var.is_classvar:NEWLINE self.error(NEWLINE "Only class variables defined as ClassVar can be assigned to",NEWLINE line)NEWLINENEWLINE def non_function_scope(self) -> bool:NEWLINE # Currently the stack always has at least two items: dummy and top-level.NEWLINE return len(self.fn_infos) <= 2NEWLINENEWLINE def init_final_static(self,NEWLINE lvalue: Lvalue,NEWLINE rvalue_reg: Value,NEWLINE class_name: Optional[str] = None,NEWLINE *,NEWLINE type_override: Optional[RType] = None) -> None:NEWLINE assert isinstance(lvalue, NameExpr)NEWLINE assert isinstance(lvalue.node, Var)NEWLINE if lvalue.node.final_value is None:NEWLINE if class_name is None:NEWLINE name = lvalue.nameNEWLINE else:NEWLINE name = '{}.{}'.format(class_name, lvalue.name)NEWLINE assert name is not None, "Full name not set for variable"NEWLINE coerced = self.coerce(rvalue_reg, type_override or self.node_type(lvalue), lvalue.line)NEWLINE self.final_names.append((name, coerced.type))NEWLINE self.add(InitStatic(coerced, name, self.module_name))NEWLINENEWLINE def load_final_static(self, fullname: str, typ: RType, line: int,NEWLINE error_name: Optional[str] = None) -> Value:NEWLINE split_name = split_target(self.graph, fullname)NEWLINE assert split_name is not NoneNEWLINE module, name = split_nameNEWLINE return self.builder.load_static_checked(NEWLINE typ, name, module, line=line,NEWLINE error_msg='value for final name "{}" was not set'.format(error_name))NEWLINENEWLINE def load_final_literal_value(self, val: Union[int, str, bytes, float, bool],NEWLINE line: int) -> Value:NEWLINE """Load value of a final name or class-level attribute."""NEWLINE if isinstance(val, bool):NEWLINE if val:NEWLINE return self.true()NEWLINE else:NEWLINE return self.false()NEWLINE elif isinstance(val, int):NEWLINE # TODO: take care of negative integer initializersNEWLINE # (probably easier to fix this in mypy itself).NEWLINE return self.builder.load_int(val)NEWLINE elif isinstance(val, float):NEWLINE return self.builder.load_float(val)NEWLINE elif isinstance(val, str):NEWLINE return self.builder.load_str(val)NEWLINE elif isinstance(val, bytes):NEWLINE return self.builder.load_bytes(val)NEWLINE else:NEWLINE assert False, "Unsupported final literal value"NEWLINENEWLINE def get_assignment_target(self, lvalue: Lvalue,NEWLINE line: int = -1) -> AssignmentTarget:NEWLINE if isinstance(lvalue, NameExpr):NEWLINE # If we are visiting a decorator, then the SymbolNode we really want to be looking atNEWLINE # is the function that is decorated, not the entire Decorator node itself.NEWLINE symbol = lvalue.nodeNEWLINE if isinstance(symbol, Decorator):NEWLINE symbol = symbol.funcNEWLINE if symbol is None:NEWLINE # New semantic analyzer doesn't create ad-hoc Vars for special forms.NEWLINE assert lvalue.is_special_formNEWLINE symbol = Var(lvalue.name)NEWLINE if lvalue.kind == LDEF:NEWLINE if symbol not in self.symtables[-1]:NEWLINE # If the function is a generator function, then first define a new variableNEWLINE # in the current function's environment class. Next, define a target thatNEWLINE # refers to the newly defined variable in that environment class. Add theNEWLINE # target to the table containing class environment variables, as well as theNEWLINE # current environment.NEWLINE if self.fn_info.is_generator:NEWLINE return self.add_var_to_env_class(symbol, self.node_type(lvalue),NEWLINE self.fn_info.generator_class,NEWLINE reassign=False)NEWLINENEWLINE # Otherwise define a new local variable.NEWLINE return self.add_local_reg(symbol, self.node_type(lvalue))NEWLINE else:NEWLINE # Assign to a previously defined variable.NEWLINE return self.lookup(symbol)NEWLINE elif lvalue.kind == GDEF:NEWLINE globals_dict = self.load_globals_dict()NEWLINE name = self.load_str(lvalue.name)NEWLINE return AssignmentTargetIndex(globals_dict, name)NEWLINE else:NEWLINE assert False, lvalue.kindNEWLINE elif isinstance(lvalue, IndexExpr):NEWLINE # Indexed assignment x[y] = eNEWLINE base = self.accept(lvalue.base)NEWLINE index = self.accept(lvalue.index)NEWLINE return AssignmentTargetIndex(base, index)NEWLINE elif isinstance(lvalue, MemberExpr):NEWLINE # Attribute assignment x.y = eNEWLINE obj = self.accept(lvalue.expr)NEWLINE return AssignmentTargetAttr(obj, lvalue.name)NEWLINE elif isinstance(lvalue, TupleExpr):NEWLINE # Multiple assignment a, ..., b = eNEWLINE star_idx: Optional[int] = NoneNEWLINE lvalues = []NEWLINE for idx, item in enumerate(lvalue.items):NEWLINE targ = self.get_assignment_target(item)NEWLINE lvalues.append(targ)NEWLINE if isinstance(item, StarExpr):NEWLINE if star_idx is not None:NEWLINE self.error("Two starred expressions in assignment", line)NEWLINE star_idx = idxNEWLINENEWLINE return AssignmentTargetTuple(lvalues, star_idx)NEWLINENEWLINE elif isinstance(lvalue, StarExpr):NEWLINE return self.get_assignment_target(lvalue.expr)NEWLINENEWLINE assert False, 'Unsupported lvalue: %r' % lvalueNEWLINENEWLINE def read(self, target: Union[Value, AssignmentTarget], line: int = -1) -> Value:NEWLINE if isinstance(target, Value):NEWLINE return targetNEWLINE if isinstance(target, AssignmentTargetRegister):NEWLINE return target.registerNEWLINE if isinstance(target, AssignmentTargetIndex):NEWLINE reg = self.gen_method_call(NEWLINE target.base, '__getitem__', [target.index], target.type, line)NEWLINE if reg is not None:NEWLINE return regNEWLINE assert False, target.base.typeNEWLINE if isinstance(target, AssignmentTargetAttr):NEWLINE if isinstance(target.obj.type, RInstance) and target.obj.type.class_ir.is_ext_class:NEWLINE return self.add(GetAttr(target.obj, target.attr, line))NEWLINE else:NEWLINE return self.py_get_attr(target.obj, target.attr, line)NEWLINENEWLINE assert False, 'Unsupported lvalue: %r' % targetNEWLINENEWLINE def assign(self,NEWLINE target: Union[Register, AssignmentTarget],NEWLINE rvalue_reg: Value,NEWLINE line: int) -> None:NEWLINE if isinstance(target, Register):NEWLINE self.add(Assign(target, rvalue_reg))NEWLINE elif isinstance(target, AssignmentTargetRegister):NEWLINE rvalue_reg = self.coerce(rvalue_reg, target.type, line)NEWLINE self.add(Assign(target.register, rvalue_reg))NEWLINE elif isinstance(target, AssignmentTargetAttr):NEWLINE if isinstance(target.obj_type, RInstance):NEWLINE rvalue_reg = self.coerce(rvalue_reg, target.type, line)NEWLINE self.add(SetAttr(target.obj, target.attr, rvalue_reg, line))NEWLINE else:NEWLINE key = self.load_str(target.attr)NEWLINE boxed_reg = self.builder.box(rvalue_reg)NEWLINE self.call_c(py_setattr_op, [target.obj, key, boxed_reg], line)NEWLINE elif isinstance(target, AssignmentTargetIndex):NEWLINE target_reg2 = self.gen_method_call(NEWLINE target.base, '__setitem__', [target.index, rvalue_reg], None, line)NEWLINE assert target_reg2 is not None, target.base.typeNEWLINE elif isinstance(target, AssignmentTargetTuple):NEWLINE if isinstance(rvalue_reg.type, RTuple) and target.star_idx is None:NEWLINE rtypes = rvalue_reg.type.typesNEWLINE assert len(rtypes) == len(target.items)NEWLINE for i in range(len(rtypes)):NEWLINE item_value = self.add(TupleGet(rvalue_reg, i, line))NEWLINE self.assign(target.items[i], item_value, line)NEWLINE elif ((is_list_rprimitive(rvalue_reg.type) or is_tuple_rprimitive(rvalue_reg.type))NEWLINE and target.star_idx is None):NEWLINE self.process_sequence_assignment(target, rvalue_reg, line)NEWLINE else:NEWLINE self.process_iterator_tuple_assignment(target, rvalue_reg, line)NEWLINE else:NEWLINE assert False, 'Unsupported assignment target'NEWLINENEWLINE def process_sequence_assignment(self,NEWLINE target: AssignmentTargetTuple,NEWLINE rvalue: Value,NEWLINE line: int) -> None:NEWLINE """Process assignment like 'x, y = s', where s is a variable-length list or tuple."""NEWLINE # Check the length of sequence.NEWLINE expected_len = Integer(len(target.items), c_pyssize_t_rprimitive)NEWLINE self.builder.call_c(check_unpack_count_op, [rvalue, expected_len], line)NEWLINENEWLINE # Read sequence items.NEWLINE values = []NEWLINE for i in range(len(target.items)):NEWLINE item = target.items[i]NEWLINE index = self.builder.load_int(i)NEWLINE if is_list_rprimitive(rvalue.type):NEWLINE item_value = self.call_c(list_get_item_unsafe_op, [rvalue, index], line)NEWLINE else:NEWLINE item_value = self.builder.gen_method_call(NEWLINE rvalue, '__getitem__', [index], item.type, line)NEWLINE values.append(item_value)NEWLINENEWLINE # Assign sequence items to the target lvalues.NEWLINE for lvalue, value in zip(target.items, values):NEWLINE self.assign(lvalue, value, line)NEWLINENEWLINE def process_iterator_tuple_assignment_helper(self,NEWLINE litem: AssignmentTarget,NEWLINE ritem: Value, line: int) -> None:NEWLINE error_block, ok_block = BasicBlock(), BasicBlock()NEWLINE self.add(Branch(ritem, error_block, ok_block, Branch.IS_ERROR))NEWLINENEWLINE self.activate_block(error_block)NEWLINE self.add(RaiseStandardError(RaiseStandardError.VALUE_ERROR,NEWLINE 'not enough values to unpack', line))NEWLINE self.add(Unreachable())NEWLINENEWLINE self.activate_block(ok_block)NEWLINE self.assign(litem, ritem, line)NEWLINENEWLINE def process_iterator_tuple_assignment(self,NEWLINE target: AssignmentTargetTuple,NEWLINE rvalue_reg: Value,NEWLINE line: int) -> None:NEWLINENEWLINE iterator = self.call_c(iter_op, [rvalue_reg], line)NEWLINENEWLINE # This may be the whole lvalue list if there is no starred valueNEWLINE split_idx = target.star_idx if target.star_idx is not None else len(target.items)NEWLINENEWLINE # Assign values before the first starred valueNEWLINE for litem in target.items[:split_idx]:NEWLINE ritem = self.call_c(next_op, [iterator], line)NEWLINE error_block, ok_block = BasicBlock(), BasicBlock()NEWLINE self.add(Branch(ritem, error_block, ok_block, Branch.IS_ERROR))NEWLINENEWLINE self.activate_block(error_block)NEWLINE self.add(RaiseStandardError(RaiseStandardError.VALUE_ERROR,NEWLINE 'not enough values to unpack', line))NEWLINE self.add(Unreachable())NEWLINENEWLINE self.activate_block(ok_block)NEWLINENEWLINE self.assign(litem, ritem, line)NEWLINENEWLINE # Assign the starred value and all values after itNEWLINE if target.star_idx is not None:NEWLINE post_star_vals = target.items[split_idx + 1:]NEWLINE iter_list = self.call_c(to_list, [iterator], line)NEWLINE iter_list_len = self.builtin_len(iter_list, line)NEWLINE post_star_len = Integer(len(post_star_vals))NEWLINE condition = self.binary_op(post_star_len, iter_list_len, '<=', line)NEWLINENEWLINE error_block, ok_block = BasicBlock(), BasicBlock()NEWLINE self.add(Branch(condition, ok_block, error_block, Branch.BOOL))NEWLINENEWLINE self.activate_block(error_block)NEWLINE self.add(RaiseStandardError(RaiseStandardError.VALUE_ERROR,NEWLINE 'not enough values to unpack', line))NEWLINE self.add(Unreachable())NEWLINENEWLINE self.activate_block(ok_block)NEWLINENEWLINE for litem in reversed(post_star_vals):NEWLINE ritem = self.call_c(list_pop_last, [iter_list], line)NEWLINE self.assign(litem, ritem, line)NEWLINENEWLINE # Assign the starred valueNEWLINE self.assign(target.items[target.star_idx], iter_list, line)NEWLINENEWLINE # There is no starred value, so check if there are extra values in rhs thatNEWLINE # have not been assigned.NEWLINE else:NEWLINE extra = self.call_c(next_op, [iterator], line)NEWLINE error_block, ok_block = BasicBlock(), BasicBlock()NEWLINE self.add(Branch(extra, ok_block, error_block, Branch.IS_ERROR))NEWLINENEWLINE self.activate_block(error_block)NEWLINE self.add(RaiseStandardError(RaiseStandardError.VALUE_ERROR,NEWLINE 'too many values to unpack', line))NEWLINE self.add(Unreachable())NEWLINENEWLINE self.activate_block(ok_block)NEWLINENEWLINE def push_loop_stack(self, continue_block: BasicBlock, break_block: BasicBlock) -> None:NEWLINE self.nonlocal_control.append(NEWLINE LoopNonlocalControl(self.nonlocal_control[-1], continue_block, break_block))NEWLINENEWLINE def pop_loop_stack(self) -> None:NEWLINE self.nonlocal_control.pop()NEWLINENEWLINE def spill(self, value: Value) -> AssignmentTarget:NEWLINE """Moves a given Value instance into the generator class' environment class."""NEWLINE name = '{}{}'.format(TEMP_ATTR_NAME, self.temp_counter)NEWLINE self.temp_counter += 1NEWLINE target = self.add_var_to_env_class(Var(name), value.type, self.fn_info.generator_class)NEWLINE # Shouldn't be able to fail, so -1 for lineNEWLINE self.assign(target, value, -1)NEWLINE return targetNEWLINENEWLINE def maybe_spill(self, value: Value) -> Union[Value, AssignmentTarget]:NEWLINE """NEWLINE Moves a given Value instance into the environment class for generator functions. ForNEWLINE non-generator functions, leaves the Value instance as it is.NEWLINENEWLINE Returns an AssignmentTarget associated with the Value for generator functions and theNEWLINE original Value itself for non-generator functions.NEWLINE """NEWLINE if self.fn_info.is_generator:NEWLINE return self.spill(value)NEWLINE return valueNEWLINENEWLINE def maybe_spill_assignable(self, value: Value) -> Union[Register, AssignmentTarget]:NEWLINE """NEWLINE Moves a given Value instance into the environment class for generator functions. ForNEWLINE non-generator functions, allocate a temporary Register.NEWLINENEWLINE Returns an AssignmentTarget associated with the Value for generator functions and anNEWLINE assignable Register for non-generator functions.NEWLINE """NEWLINE if self.fn_info.is_generator:NEWLINE return self.spill(value)NEWLINENEWLINE if isinstance(value, Register):NEWLINE return valueNEWLINENEWLINE # Allocate a temporary register for the assignable value.NEWLINE reg = Register(value.type)NEWLINE self.assign(reg, value, -1)NEWLINE return regNEWLINENEWLINE def extract_int(self, e: Expression) -> Optional[int]:NEWLINE if isinstance(e, IntExpr):NEWLINE return e.valueNEWLINE elif isinstance(e, UnaryExpr) and e.op == '-' and isinstance(e.expr, IntExpr):NEWLINE return -e.expr.valueNEWLINE else:NEWLINE return NoneNEWLINENEWLINE def get_sequence_type(self, expr: Expression) -> RType:NEWLINE target_type = get_proper_type(self.types[expr])NEWLINE assert isinstance(target_type, Instance)NEWLINE if target_type.type.fullname == 'builtins.str':NEWLINE return str_rprimitiveNEWLINE else:NEWLINE return self.type_to_rtype(target_type.args[0])NEWLINENEWLINE def get_dict_base_type(self, expr: Expression) -> Instance:NEWLINE """Find dict type of a dict-like expression.NEWLINENEWLINE This is useful for dict subclasses like SymbolTable.NEWLINE """NEWLINE target_type = get_proper_type(self.types[expr])NEWLINE assert isinstance(target_type, Instance)NEWLINE dict_base = next(base for base in target_type.type.mroNEWLINE if base.fullname == 'builtins.dict')NEWLINE return map_instance_to_supertype(target_type, dict_base)NEWLINENEWLINE def get_dict_key_type(self, expr: Expression) -> RType:NEWLINE dict_base_type = self.get_dict_base_type(expr)NEWLINE return self.type_to_rtype(dict_base_type.args[0])NEWLINENEWLINE def get_dict_value_type(self, expr: Expression) -> RType:NEWLINE dict_base_type = self.get_dict_base_type(expr)NEWLINE return self.type_to_rtype(dict_base_type.args[1])NEWLINENEWLINE def get_dict_item_type(self, expr: Expression) -> RType:NEWLINE key_type = self.get_dict_key_type(expr)NEWLINE value_type = self.get_dict_value_type(expr)NEWLINE return RTuple([key_type, value_type])NEWLINENEWLINE def _analyze_iterable_item_type(self, expr: Expression) -> Type:NEWLINE """Return the item type given by 'expr' in an iterable context."""NEWLINE # This logic is copied from mypy's TypeChecker.analyze_iterable_item_type.NEWLINE iterable = get_proper_type(self.types[expr])NEWLINE echk = self.graph[self.module_name].type_checker().expr_checkerNEWLINE iterator = echk.check_method_call_by_name('__iter__', iterable, [], [], expr)[0]NEWLINENEWLINE from mypy.join import join_typesNEWLINE if isinstance(iterable, TupleType):NEWLINE joined: Type = UninhabitedType()NEWLINE for item in iterable.items:NEWLINE joined = join_types(joined, item)NEWLINE return joinedNEWLINE else:NEWLINE # Non-tuple iterable.NEWLINE return echk.check_method_call_by_name('__next__', iterator, [], [], expr)[0]NEWLINENEWLINE def is_native_module(self, module: str) -> bool:NEWLINE """Is the given module one compiled by mypyc?"""NEWLINE return module in self.mapper.group_mapNEWLINENEWLINE def is_native_ref_expr(self, expr: RefExpr) -> bool:NEWLINE if expr.node is None:NEWLINE return FalseNEWLINE if '.' in expr.node.fullname:NEWLINE return self.is_native_module(expr.node.fullname.rpartition('.')[0])NEWLINE return TrueNEWLINENEWLINE def is_native_module_ref_expr(self, expr: RefExpr) -> bool:NEWLINE return self.is_native_ref_expr(expr) and expr.kind == GDEFNEWLINENEWLINE def is_synthetic_type(self, typ: TypeInfo) -> bool:NEWLINE """Is a type something other than just a class we've created?"""NEWLINE return typ.is_named_tuple or typ.is_newtype or typ.typeddict_type is not NoneNEWLINENEWLINE def get_final_ref(self, expr: MemberExpr) -> Optional[Tuple[str, Var, bool]]:NEWLINE """Check if `expr` is a final attribute.NEWLINENEWLINE This needs to be done differently for class and module attributes toNEWLINE correctly determine fully qualified name. Return a tuple that consists ofNEWLINE the qualified name, the corresponding Var node, and a flag indicating whetherNEWLINE the final name was defined in a compiled module. Return None if `expr` does notNEWLINE refer to a final attribute.NEWLINE """NEWLINE final_var = NoneNEWLINE if isinstance(expr.expr, RefExpr) and isinstance(expr.expr.node, TypeInfo):NEWLINE # a class attributeNEWLINE sym = expr.expr.node.get(expr.name)NEWLINE if sym and isinstance(sym.node, Var):NEWLINE # Enum attribute are treated as final since they are added to the global cacheNEWLINE expr_fullname = expr.expr.node.bases[0].type.fullnameNEWLINE is_final = sym.node.is_final or expr_fullname == 'enum.Enum'NEWLINE if is_final:NEWLINE final_var = sym.nodeNEWLINE fullname = '{}.{}'.format(sym.node.info.fullname, final_var.name)NEWLINE native = self.is_native_module(expr.expr.node.module_name)NEWLINE elif self.is_module_member_expr(expr):NEWLINE # a module attributeNEWLINE if isinstance(expr.node, Var) and expr.node.is_final:NEWLINE final_var = expr.nodeNEWLINE fullname = expr.node.fullnameNEWLINE native = self.is_native_ref_expr(expr)NEWLINE if final_var is not None:NEWLINE return fullname, final_var, nativeNEWLINE return NoneNEWLINENEWLINE def emit_load_final(self, final_var: Var, fullname: str,NEWLINE name: str, native: bool, typ: Type, line: int) -> Optional[Value]:NEWLINE """Emit code for loading value of a final name (if possible).NEWLINENEWLINE Args:NEWLINE final_var: Var corresponding to the final nameNEWLINE fullname: its qualified nameNEWLINE name: shorter name to show in errorsNEWLINE native: whether the name was defined in a compiled moduleNEWLINE typ: its typeNEWLINE line: line number where loading occursNEWLINE """NEWLINE if final_var.final_value is not None: # this is safe even for non-native namesNEWLINE return self.load_final_literal_value(final_var.final_value, line)NEWLINE elif native:NEWLINE return self.load_final_static(fullname, self.mapper.type_to_rtype(typ),NEWLINE line, name)NEWLINE else:NEWLINE return NoneNEWLINENEWLINE def is_module_member_expr(self, expr: MemberExpr) -> bool:NEWLINE return isinstance(expr.expr, RefExpr) and isinstance(expr.expr.node, MypyFile)NEWLINENEWLINE def call_refexpr_with_args(NEWLINE self, expr: CallExpr, callee: RefExpr, arg_values: List[Value]) -> Value:NEWLINENEWLINE # Handle data-driven special-cased primitive call ops.NEWLINE if callee.fullname is not None and expr.arg_kinds == [ARG_POS] * len(arg_values):NEWLINE call_c_ops_candidates = function_ops.get(callee.fullname, [])NEWLINE target = self.builder.matching_call_c(call_c_ops_candidates, arg_values,NEWLINE expr.line, self.node_type(expr))NEWLINE if target:NEWLINE return targetNEWLINENEWLINE # Standard native call if signature and fullname are good and all arguments are positionalNEWLINE # or named.NEWLINE callee_node = callee.nodeNEWLINE if isinstance(callee_node, OverloadedFuncDef):NEWLINE callee_node = callee_node.implNEWLINE # TODO: use native calls for any decorated functions which have all their decoratorsNEWLINE # removed, not just singledispatch functions (which we don't do now just in case thoseNEWLINE # decorated functions are callable classes or cannot be called without the python API forNEWLINE # some other reason)NEWLINE if (NEWLINE isinstance(callee_node, Decorator)NEWLINE and callee_node.func not in self.fdefs_to_decoratorsNEWLINE and callee_node.func in self.singledispatch_implsNEWLINE ):NEWLINE callee_node = callee_node.funcNEWLINE if (callee_node is not NoneNEWLINE and callee.fullname is not NoneNEWLINE and callee_node in self.mapper.func_to_declNEWLINE and all(kind in (ARG_POS, ARG_NAMED) for kind in expr.arg_kinds)):NEWLINE decl = self.mapper.func_to_decl[callee_node]NEWLINE return self.builder.call(decl, arg_values, expr.arg_kinds, expr.arg_names, expr.line)NEWLINENEWLINE # Fall back to a Python callNEWLINE function = self.accept(callee)NEWLINE return self.py_call(function, arg_values, expr.line,NEWLINE arg_kinds=expr.arg_kinds, arg_names=expr.arg_names)NEWLINENEWLINE def shortcircuit_expr(self, expr: OpExpr) -> Value:NEWLINE return self.builder.shortcircuit_helper(NEWLINE expr.op, self.node_type(expr),NEWLINE lambda: self.accept(expr.left),NEWLINE lambda: self.accept(expr.right),NEWLINE expr.lineNEWLINE )NEWLINENEWLINE # Conditional expressionsNEWLINENEWLINE def process_conditional(self, e: Expression, true: BasicBlock, false: BasicBlock) -> None:NEWLINE if isinstance(e, OpExpr) and e.op in ['and', 'or']:NEWLINE if e.op == 'and':NEWLINE # Short circuit 'and' in a conditional context.NEWLINE new = BasicBlock()NEWLINE self.process_conditional(e.left, new, false)NEWLINE self.activate_block(new)NEWLINE self.process_conditional(e.right, true, false)NEWLINE else:NEWLINE # Short circuit 'or' in a conditional context.NEWLINE new = BasicBlock()NEWLINE self.process_conditional(e.left, true, new)NEWLINE self.activate_block(new)NEWLINE self.process_conditional(e.right, true, false)NEWLINE elif isinstance(e, UnaryExpr) and e.op == 'not':NEWLINE self.process_conditional(e.expr, false, true)NEWLINE else:NEWLINE res = self.maybe_process_conditional_comparison(e, true, false)NEWLINE if res:NEWLINE returnNEWLINE # Catch-all for arbitrary expressions.NEWLINE reg = self.accept(e)NEWLINE self.add_bool_branch(reg, true, false)NEWLINENEWLINE def maybe_process_conditional_comparison(self,NEWLINE e: Expression,NEWLINE true: BasicBlock,NEWLINE false: BasicBlock) -> bool:NEWLINE """Transform simple tagged integer comparisons in a conditional context.NEWLINENEWLINE Return True if the operation is supported (and was transformed). Otherwise,NEWLINE do nothing and return False.NEWLINENEWLINE Args:NEWLINE e: Arbitrary expressionNEWLINE true: Branch target if comparison is trueNEWLINE false: Branch target if comparison is falseNEWLINE """NEWLINE if not isinstance(e, ComparisonExpr) or len(e.operands) != 2:NEWLINE return FalseNEWLINE ltype = self.node_type(e.operands[0])NEWLINE rtype = self.node_type(e.operands[1])NEWLINE if not is_tagged(ltype) or not is_tagged(rtype):NEWLINE return FalseNEWLINE op = e.operators[0]NEWLINE if op not in ('==', '!=', '<', '<=', '>', '>='):NEWLINE return FalseNEWLINE left = self.accept(e.operands[0])NEWLINE right = self.accept(e.operands[1])NEWLINE # "left op right" for two tagged integersNEWLINE self.builder.compare_tagged_condition(left, right, op, true, false, e.line)NEWLINE return TrueNEWLINENEWLINE # Basic helpersNEWLINENEWLINE def flatten_classes(self, arg: Union[RefExpr, TupleExpr]) -> Optional[List[ClassIR]]:NEWLINE """Flatten classes in isinstance(obj, (A, (B, C))).NEWLINENEWLINE If at least one item is not a reference to a native class, return None.NEWLINE """NEWLINE if isinstance(arg, RefExpr):NEWLINE if isinstance(arg.node, TypeInfo) and self.is_native_module_ref_expr(arg):NEWLINE ir = self.mapper.type_to_ir.get(arg.node)NEWLINE if ir:NEWLINE return [ir]NEWLINE return NoneNEWLINE else:NEWLINE res: List[ClassIR] = []NEWLINE for item in arg.items:NEWLINE if isinstance(item, (RefExpr, TupleExpr)):NEWLINE item_part = self.flatten_classes(item)NEWLINE if item_part is None:NEWLINE return NoneNEWLINE res.extend(item_part)NEWLINE else:NEWLINE return NoneNEWLINE return resNEWLINENEWLINE def enter(self, fn_info: Union[FuncInfo, str] = '') -> None:NEWLINE if isinstance(fn_info, str):NEWLINE fn_info = FuncInfo(name=fn_info)NEWLINE self.builder = LowLevelIRBuilder(self.current_module, self.mapper, self.options)NEWLINE self.builders.append(self.builder)NEWLINE self.symtables.append(OrderedDict())NEWLINE self.runtime_args.append([])NEWLINE self.fn_info = fn_infoNEWLINE self.fn_infos.append(self.fn_info)NEWLINE self.ret_types.append(none_rprimitive)NEWLINE if fn_info.is_generator:NEWLINE self.nonlocal_control.append(GeneratorNonlocalControl())NEWLINE else:NEWLINE self.nonlocal_control.append(BaseNonlocalControl())NEWLINE self.activate_block(BasicBlock())NEWLINENEWLINE def leave(self) -> Tuple[List[Register], List[RuntimeArg], List[BasicBlock], RType, FuncInfo]:NEWLINE builder = self.builders.pop()NEWLINE self.symtables.pop()NEWLINE runtime_args = self.runtime_args.pop()NEWLINE ret_type = self.ret_types.pop()NEWLINE fn_info = self.fn_infos.pop()NEWLINE self.nonlocal_control.pop()NEWLINE self.builder = self.builders[-1]NEWLINE self.fn_info = self.fn_infos[-1]NEWLINE return builder.args, runtime_args, builder.blocks, ret_type, fn_infoNEWLINENEWLINE def enter_method(self,NEWLINE class_ir: ClassIR,NEWLINE name: str,NEWLINE ret_type: RType,NEWLINE fn_info: Union[FuncInfo, str] = '',NEWLINE self_type: Optional[RType] = None) -> None:NEWLINE """Begin generating IR for a method.NEWLINENEWLINE If the method takes arguments, you should immediately afterwards callNEWLINE add_argument() for each non-self argument (self is created implicitly).NEWLINENEWLINE Call leave_method() to finish the generation of the method.NEWLINENEWLINE You can enter multiple methods at a time. They are maintained in aNEWLINE stack, and leave_method() leaves the topmost one.NEWLINENEWLINE Args:NEWLINE class_ir: Add method to this classNEWLINE name: Short name of the methodNEWLINE ret_type: Return type of the methodNEWLINE fn_info: Optionally, additional information about the methodNEWLINE self_type: If not None, override default type of the implicit 'self'NEWLINE argument (by default, derive type from class_ir)NEWLINE """NEWLINE self.enter(fn_info)NEWLINE self.function_name_stack.append(name)NEWLINE self.class_ir_stack.append(class_ir)NEWLINE self.ret_types[-1] = ret_typeNEWLINE if self_type is None:NEWLINE self_type = RInstance(class_ir)NEWLINE self.add_argument(SELF_NAME, self_type)NEWLINENEWLINE def add_argument(self, var: Union[str, Var], typ: RType, kind: ArgKind = ARG_POS) -> Register:NEWLINE """Declare an argument in the current function.NEWLINENEWLINE You should use this instead of directly calling add_local() in new code.NEWLINE """NEWLINE if isinstance(var, str):NEWLINE var = Var(var)NEWLINE reg = self.add_local(var, typ, is_arg=True)NEWLINE self.runtime_args[-1].append(RuntimeArg(var.name, typ, kind))NEWLINE return regNEWLINENEWLINE def leave_method(self) -> None:NEWLINE """Finish the generation of IR for a method."""NEWLINE arg_regs, args, blocks, ret_type, fn_info = self.leave()NEWLINE sig = FuncSignature(args, ret_type)NEWLINE name = self.function_name_stack.pop()NEWLINE class_ir = self.class_ir_stack.pop()NEWLINE decl = FuncDecl(name, class_ir.name, self.module_name, sig)NEWLINE ir = FuncIR(decl, arg_regs, blocks)NEWLINE class_ir.methods[name] = irNEWLINE class_ir.method_decls[name] = ir.declNEWLINE self.functions.append(ir)NEWLINENEWLINE def lookup(self, symbol: SymbolNode) -> SymbolTarget:NEWLINE return self.symtables[-1][symbol]NEWLINENEWLINE def add_local(self, symbol: SymbolNode, typ: RType, is_arg: bool = False) -> 'Register':NEWLINE """Add register that represents a symbol to the symbol table.NEWLINENEWLINE Args:NEWLINE is_arg: is this a function argumentNEWLINE """NEWLINE assert isinstance(symbol, SymbolNode)NEWLINE reg = Register(typ, symbol.name, is_arg=is_arg, line=symbol.line)NEWLINE self.symtables[-1][symbol] = AssignmentTargetRegister(reg)NEWLINE if is_arg:NEWLINE self.builder.args.append(reg)NEWLINE return regNEWLINENEWLINE def add_local_reg(self,NEWLINE symbol: SymbolNode,NEWLINE typ: RType,NEWLINE is_arg: bool = False) -> AssignmentTargetRegister:NEWLINE """Like add_local, but return an assignment target instead of value."""NEWLINE self.add_local(symbol, typ, is_arg)NEWLINE target = self.symtables[-1][symbol]NEWLINE assert isinstance(target, AssignmentTargetRegister)NEWLINE return targetNEWLINENEWLINE def add_self_to_env(self, cls: ClassIR) -> AssignmentTargetRegister:NEWLINE """Low-level function that adds a 'self' argument.NEWLINENEWLINE This is only useful if using enter() instead of enter_method().NEWLINE """NEWLINE return self.add_local_reg(Var(SELF_NAME), RInstance(cls), is_arg=True)NEWLINENEWLINE def add_target(self, symbol: SymbolNode, target: SymbolTarget) -> SymbolTarget:NEWLINE self.symtables[-1][symbol] = targetNEWLINE return targetNEWLINENEWLINE def type_to_rtype(self, typ: Optional[Type]) -> RType:NEWLINE return self.mapper.type_to_rtype(typ)NEWLINENEWLINE def node_type(self, node: Expression) -> RType:NEWLINE if isinstance(node, IntExpr):NEWLINE # TODO: Don't special case IntExprNEWLINE return int_rprimitiveNEWLINE if node not in self.types:NEWLINE return object_rprimitiveNEWLINE mypy_type = self.types[node]NEWLINE return self.type_to_rtype(mypy_type)NEWLINENEWLINE def add_var_to_env_class(self,NEWLINE var: SymbolNode,NEWLINE rtype: RType,NEWLINE base: Union[FuncInfo, ImplicitClass],NEWLINE reassign: bool = False) -> AssignmentTarget:NEWLINE # First, define the variable name as an attribute of the environment class, and thenNEWLINE # construct a target for that attribute.NEWLINE self.fn_info.env_class.attributes[var.name] = rtypeNEWLINE attr_target = AssignmentTargetAttr(base.curr_env_reg, var.name)NEWLINENEWLINE if reassign:NEWLINE # Read the local definition of the variable, and set the corresponding attribute ofNEWLINE # the environment class' variable to be that value.NEWLINE reg = self.read(self.lookup(var), self.fn_info.fitem.line)NEWLINE self.add(SetAttr(base.curr_env_reg, var.name, reg, self.fn_info.fitem.line))NEWLINENEWLINE # Override the local definition of the variable to instead point at the variable inNEWLINE # the environment class.NEWLINE return self.add_target(var, attr_target)NEWLINENEWLINE def is_builtin_ref_expr(self, expr: RefExpr) -> bool:NEWLINE assert expr.node, "RefExpr not resolved"NEWLINE return '.' in expr.node.fullname and expr.node.fullname.split('.')[0] == 'builtins'NEWLINENEWLINE def load_global(self, expr: NameExpr) -> Value:NEWLINE """Loads a Python-level global.NEWLINENEWLINE This takes a NameExpr and uses its name as a key to retrieve the corresponding PyObject *NEWLINE from the _globals dictionary in the C-generated code.NEWLINE """NEWLINE # If the global is from 'builtins', turn it into a module attr load insteadNEWLINE if self.is_builtin_ref_expr(expr):NEWLINE assert expr.node, "RefExpr not resolved"NEWLINE return self.load_module_attr_by_fullname(expr.node.fullname, expr.line)NEWLINE if (self.is_native_module_ref_expr(expr) and isinstance(expr.node, TypeInfo)NEWLINE and not self.is_synthetic_type(expr.node)):NEWLINE assert expr.fullname is not NoneNEWLINE return self.load_native_type_object(expr.fullname)NEWLINE return self.load_global_str(expr.name, expr.line)NEWLINENEWLINE def load_global_str(self, name: str, line: int) -> Value:NEWLINE _globals = self.load_globals_dict()NEWLINE reg = self.load_str(name)NEWLINE return self.call_c(dict_get_item_op, [_globals, reg], line)NEWLINENEWLINE def load_globals_dict(self) -> Value:NEWLINE return self.add(LoadStatic(dict_rprimitive, 'globals', self.module_name))NEWLINENEWLINE def load_module_attr_by_fullname(self, fullname: str, line: int) -> Value:NEWLINE module, _, name = fullname.rpartition('.')NEWLINE left = self.load_module(module)NEWLINE return self.py_get_attr(left, name, line)NEWLINENEWLINE # Lacks a good type because there wasn't a reasonable type in 3.5 :(NEWLINE def catch_errors(self, line: int) -> Any:NEWLINE return catch_errors(self.module_path, line)NEWLINENEWLINE def warning(self, msg: str, line: int) -> None:NEWLINE self.errors.warning(msg, self.module_path, line)NEWLINENEWLINE def error(self, msg: str, line: int) -> None:NEWLINE self.errors.error(msg, self.module_path, line)NEWLINENEWLINE def note(self, msg: str, line: int) -> None:NEWLINE self.errors.note(msg, self.module_path, line)NEWLINENEWLINENEWLINEdef gen_arg_defaults(builder: IRBuilder) -> None:NEWLINE """Generate blocks for arguments that have default values.NEWLINENEWLINE If the passed value is an error value, then assign the defaultNEWLINE value to the argument.NEWLINE """NEWLINE fitem = builder.fn_info.fitemNEWLINE for arg in fitem.arguments:NEWLINE if arg.initializer:NEWLINE target = builder.lookup(arg.variable)NEWLINENEWLINE def get_default() -> Value:NEWLINE assert arg.initializer is not NoneNEWLINENEWLINE # If it is constant, don't bother storing itNEWLINE if is_constant(arg.initializer):NEWLINE return builder.accept(arg.initializer)NEWLINENEWLINE # Because gen_arg_defaults runs before calculate_arg_defaults, weNEWLINE # add the static/attribute to final_names/the class here.NEWLINE elif not builder.fn_info.is_nested:NEWLINE name = fitem.fullname + '.' + arg.variable.nameNEWLINE builder.final_names.append((name, target.type))NEWLINE return builder.add(LoadStatic(target.type, name, builder.module_name))NEWLINE else:NEWLINE name = arg.variable.nameNEWLINE builder.fn_info.callable_class.ir.attributes[name] = target.typeNEWLINE return builder.add(NEWLINE GetAttr(builder.fn_info.callable_class.self_reg, name, arg.line))NEWLINE assert isinstance(target, AssignmentTargetRegister)NEWLINE builder.assign_if_null(target.register, get_default, arg.initializer.line)NEWLINE |
import numpy as npNEWLINEimport picameraxNEWLINEimport picamerax.arrayNEWLINEfrom PIL import ImageNEWLINENEWLINEwith picamerax.PiCamera() as camera:NEWLINE with picamerax.array.PiMotionArray(camera) as stream:NEWLINE camera.resolution = (640, 480)NEWLINE camera.framerate = 30NEWLINE camera.start_recording('/dev/null', format='h264', motion_output=stream)NEWLINE camera.wait_recording(10)NEWLINE camera.stop_recording()NEWLINE for frame in range(stream.array.shape[0]):NEWLINE data = np.sqrt(NEWLINE np.square(stream.array[frame]['x'].astype(np.float)) +NEWLINE np.square(stream.array[frame]['y'].astype(np.float))NEWLINE ).clip(0, 255).astype(np.uint8)NEWLINE img = Image.fromarray(data)NEWLINE filename = 'frame%03d.png' % frameNEWLINE print('Writing %s' % filename)NEWLINE img.save(filename)NEWLINE |
from time import timeNEWLINEfrom base64 import b16encodeNEWLINEfrom functools import partialNEWLINEfrom operator import __eq__, __ne__, __lt__, __le__, __gt__, __ge__NEWLINENEWLINEfrom six import (NEWLINE integer_types as _integer_types,NEWLINE text_type as _text_type)NEWLINENEWLINEfrom OpenSSL._util import (NEWLINE ffi as _ffi,NEWLINE lib as _lib,NEWLINE exception_from_error_queue as _exception_from_error_queue,NEWLINE byte_string as _byte_string,NEWLINE native as _native)NEWLINENEWLINEFILETYPE_PEM = _lib.SSL_FILETYPE_PEMNEWLINEFILETYPE_ASN1 = _lib.SSL_FILETYPE_ASN1NEWLINENEWLINE# TODO This was an API mistake. OpenSSL has no such constant.NEWLINEFILETYPE_TEXT = 2 ** 16 - 1NEWLINENEWLINETYPE_RSA = _lib.EVP_PKEY_RSANEWLINETYPE_DSA = _lib.EVP_PKEY_DSANEWLINENEWLINENEWLINEclass Error(Exception):NEWLINE """NEWLINE An error occurred in an `OpenSSL.crypto` API.NEWLINE """NEWLINENEWLINENEWLINE_raise_current_error = partial(_exception_from_error_queue, Error)NEWLINENEWLINEdef _untested_error(where):NEWLINE """NEWLINE An OpenSSL API failed somehow. Additionally, the failure which wasNEWLINE encountered isn't one that's exercised by the test suite so future behaviorNEWLINE of pyOpenSSL is now somewhat less predictable.NEWLINE """NEWLINE raise RuntimeError("Unknown %s failure" % (where,))NEWLINENEWLINENEWLINENEWLINEdef _new_mem_buf(buffer=None):NEWLINE """NEWLINE Allocate a new OpenSSL memory BIO.NEWLINENEWLINE Arrange for the garbage collector to clean it up automatically.NEWLINENEWLINE :param buffer: None or some bytes to use to put into the BIO so that theyNEWLINE can be read out.NEWLINE """NEWLINE if buffer is None:NEWLINE bio = _lib.BIO_new(_lib.BIO_s_mem())NEWLINE free = _lib.BIO_freeNEWLINE else:NEWLINE data = _ffi.new("char[]", buffer)NEWLINE bio = _lib.BIO_new_mem_buf(data, len(buffer))NEWLINE # Keep the memory alive as long as the bio is alive!NEWLINE def free(bio, ref=data):NEWLINE return _lib.BIO_free(bio)NEWLINENEWLINE if bio == _ffi.NULL:NEWLINE # TODO: This is untested.NEWLINE _raise_current_error()NEWLINENEWLINE bio = _ffi.gc(bio, free)NEWLINE return bioNEWLINENEWLINENEWLINENEWLINEdef _bio_to_string(bio):NEWLINE """NEWLINE Copy the contents of an OpenSSL BIO object into a Python byte string.NEWLINE """NEWLINE result_buffer = _ffi.new('char**')NEWLINE buffer_length = _lib.BIO_get_mem_data(bio, result_buffer)NEWLINE return _ffi.buffer(result_buffer[0], buffer_length)[:]NEWLINENEWLINENEWLINENEWLINEdef _set_asn1_time(boundary, when):NEWLINE """NEWLINE The the time value of an ASN1 time object.NEWLINENEWLINE @param boundary: An ASN1_GENERALIZEDTIME pointer (or an object safelyNEWLINE castable to that type) which will have its value set.NEWLINE @param when: A string representation of the desired time value.NEWLINENEWLINE @raise TypeError: If C{when} is not a L{bytes} string.NEWLINE @raise ValueError: If C{when} does not represent a time in the requiredNEWLINE format.NEWLINE @raise RuntimeError: If the time value cannot be set for some otherNEWLINE (unspecified) reason.NEWLINE """NEWLINE if not isinstance(when, bytes):NEWLINE raise TypeError("when must be a byte string")NEWLINENEWLINE set_result = _lib.ASN1_GENERALIZEDTIME_set_string(NEWLINE _ffi.cast('ASN1_GENERALIZEDTIME*', boundary), when)NEWLINE if set_result == 0:NEWLINE dummy = _ffi.gc(_lib.ASN1_STRING_new(), _lib.ASN1_STRING_free)NEWLINE _lib.ASN1_STRING_set(dummy, when, len(when))NEWLINE check_result = _lib.ASN1_GENERALIZEDTIME_check(NEWLINE _ffi.cast('ASN1_GENERALIZEDTIME*', dummy))NEWLINE if not check_result:NEWLINE raise ValueError("Invalid string")NEWLINE else:NEWLINE _untested_error()NEWLINENEWLINENEWLINENEWLINEdef _get_asn1_time(timestamp):NEWLINE """NEWLINE Retrieve the time value of an ASN1 time object.NEWLINENEWLINE @param timestamp: An ASN1_GENERALIZEDTIME* (or an object safely castable toNEWLINE that type) from which the time value will be retrieved.NEWLINENEWLINE @return: The time value from C{timestamp} as a L{bytes} string in a certainNEWLINE format. Or C{None} if the object contains no time value.NEWLINE """NEWLINE string_timestamp = _ffi.cast('ASN1_STRING*', timestamp)NEWLINE if _lib.ASN1_STRING_length(string_timestamp) == 0:NEWLINE return NoneNEWLINE elif _lib.ASN1_STRING_type(string_timestamp) == _lib.V_ASN1_GENERALIZEDTIME:NEWLINE return _ffi.string(_lib.ASN1_STRING_data(string_timestamp))NEWLINE else:NEWLINE generalized_timestamp = _ffi.new("ASN1_GENERALIZEDTIME**")NEWLINE _lib.ASN1_TIME_to_generalizedtime(timestamp, generalized_timestamp)NEWLINE if generalized_timestamp[0] == _ffi.NULL:NEWLINE # This may happen:NEWLINE # - if timestamp was not an ASN1_TIMENEWLINE # - if allocating memory for the ASN1_GENERALIZEDTIME failedNEWLINE # - if a copy of the time data from timestamp cannot be made forNEWLINE # the newly allocated ASN1_GENERALIZEDTIMENEWLINE #NEWLINE # These are difficult to test. cffi enforces the ASN1_TIME type.NEWLINE # Memory allocation failures are a pain to triggerNEWLINE # deterministically.NEWLINE _untested_error("ASN1_TIME_to_generalizedtime")NEWLINE else:NEWLINE string_timestamp = _ffi.cast(NEWLINE "ASN1_STRING*", generalized_timestamp[0])NEWLINE string_data = _lib.ASN1_STRING_data(string_timestamp)NEWLINE string_result = _ffi.string(string_data)NEWLINE _lib.ASN1_GENERALIZEDTIME_free(generalized_timestamp[0])NEWLINE return string_resultNEWLINENEWLINENEWLINENEWLINEclass PKey(object):NEWLINE _only_public = FalseNEWLINE _initialized = TrueNEWLINENEWLINE def __init__(self):NEWLINE pkey = _lib.EVP_PKEY_new()NEWLINE self._pkey = _ffi.gc(pkey, _lib.EVP_PKEY_free)NEWLINE self._initialized = FalseNEWLINENEWLINENEWLINE def generate_key(self, type, bits):NEWLINE """NEWLINE Generate a key of a given type, with a given number of a bitsNEWLINENEWLINE :param type: The key type (TYPE_RSA or TYPE_DSA)NEWLINE :param bits: The number of bitsNEWLINENEWLINE :return: NoneNEWLINE """NEWLINE if not isinstance(type, int):NEWLINE raise TypeError("type must be an integer")NEWLINENEWLINE if not isinstance(bits, int):NEWLINE raise TypeError("bits must be an integer")NEWLINENEWLINE # TODO Check error returnNEWLINE exponent = _lib.BN_new()NEWLINE exponent = _ffi.gc(exponent, _lib.BN_free)NEWLINE _lib.BN_set_word(exponent, _lib.RSA_F4)NEWLINENEWLINE if type == TYPE_RSA:NEWLINE if bits <= 0:NEWLINE raise ValueError("Invalid number of bits")NEWLINENEWLINE rsa = _lib.RSA_new()NEWLINENEWLINE result = _lib.RSA_generate_key_ex(rsa, bits, exponent, _ffi.NULL)NEWLINE if result == 0:NEWLINE # TODO: The test for this case is commented out. DifferentNEWLINE # builds of OpenSSL appear to have different failure modes thatNEWLINE # make it hard to test. Visual inspection of the OpenSSLNEWLINE # source reveals that a return value of 0 signals an error.NEWLINE # Manual testing on a particular build of OpenSSL suggests thatNEWLINE # this is probably the appropriate way to handle those errors.NEWLINE _raise_current_error()NEWLINENEWLINE result = _lib.EVP_PKEY_assign_RSA(self._pkey, rsa)NEWLINE if not result:NEWLINE # TODO: It appears as though this can fail if an engine is inNEWLINE # use which does not support RSA.NEWLINE _raise_current_error()NEWLINENEWLINE elif type == TYPE_DSA:NEWLINE dsa = _lib.DSA_generate_parameters(NEWLINE bits, _ffi.NULL, 0, _ffi.NULL, _ffi.NULL, _ffi.NULL, _ffi.NULL)NEWLINE if dsa == _ffi.NULL:NEWLINE # TODO: This is untested.NEWLINE _raise_current_error()NEWLINE if not _lib.DSA_generate_key(dsa):NEWLINE # TODO: This is untested.NEWLINE _raise_current_error()NEWLINE if not _lib.EVP_PKEY_assign_DSA(self._pkey, dsa):NEWLINE # TODO: This is untested.NEWLINE _raise_current_error()NEWLINE else:NEWLINE raise Error("No such key type")NEWLINENEWLINE self._initialized = TrueNEWLINENEWLINENEWLINE def check(self):NEWLINE """NEWLINE Check the consistency of an RSA private key.NEWLINENEWLINE :return: True if key is consistent.NEWLINE :raise Error: if the key is inconsistent.NEWLINE :raise TypeError: if the key is of a type which cannot be checked.NEWLINE Only RSA keys can currently be checked.NEWLINE """NEWLINE if self._only_public:NEWLINE raise TypeError("public key only")NEWLINENEWLINE if _lib.EVP_PKEY_type(self._pkey.type) != _lib.EVP_PKEY_RSA:NEWLINE raise TypeError("key type unsupported")NEWLINENEWLINE rsa = _lib.EVP_PKEY_get1_RSA(self._pkey)NEWLINE rsa = _ffi.gc(rsa, _lib.RSA_free)NEWLINE result = _lib.RSA_check_key(rsa)NEWLINE if result:NEWLINE return TrueNEWLINE _raise_current_error()NEWLINENEWLINENEWLINE def type(self):NEWLINE """NEWLINE Returns the type of the keyNEWLINENEWLINE :return: The type of the key.NEWLINE """NEWLINE return self._pkey.typeNEWLINENEWLINENEWLINE def bits(self):NEWLINE """NEWLINE Returns the number of bits of the keyNEWLINENEWLINE :return: The number of bits of the key.NEWLINE """NEWLINE return _lib.EVP_PKEY_bits(self._pkey)NEWLINEPKeyType = PKeyNEWLINENEWLINENEWLINENEWLINEclass X509Name(object):NEWLINE def __init__(self, name):NEWLINE """NEWLINE Create a new X509Name, copying the given X509Name instance.NEWLINENEWLINE :param name: An X509Name object to copyNEWLINE """NEWLINE name = _lib.X509_NAME_dup(name._name)NEWLINE self._name = _ffi.gc(name, _lib.X509_NAME_free)NEWLINENEWLINENEWLINE def __setattr__(self, name, value):NEWLINE if name.startswith('_'):NEWLINE return super(X509Name, self).__setattr__(name, value)NEWLINENEWLINE # Note: we really do not want str subclasses here, so we do not useNEWLINE # isinstance.NEWLINE if type(name) is not str:NEWLINE raise TypeError("attribute name must be string, not '%.200s'" % (NEWLINE type(value).__name__,))NEWLINENEWLINE nid = _lib.OBJ_txt2nid(_byte_string(name))NEWLINE if nid == _lib.NID_undef:NEWLINE try:NEWLINE _raise_current_error()NEWLINE except Error:NEWLINE passNEWLINE raise AttributeError("No such attribute")NEWLINENEWLINE # If there's an old entry for this NID, remove itNEWLINE for i in range(_lib.X509_NAME_entry_count(self._name)):NEWLINE ent = _lib.X509_NAME_get_entry(self._name, i)NEWLINE ent_obj = _lib.X509_NAME_ENTRY_get_object(ent)NEWLINE ent_nid = _lib.OBJ_obj2nid(ent_obj)NEWLINE if nid == ent_nid:NEWLINE ent = _lib.X509_NAME_delete_entry(self._name, i)NEWLINE _lib.X509_NAME_ENTRY_free(ent)NEWLINE breakNEWLINENEWLINE if isinstance(value, _text_type):NEWLINE value = value.encode('utf-8')NEWLINENEWLINE add_result = _lib.X509_NAME_add_entry_by_NID(NEWLINE self._name, nid, _lib.MBSTRING_UTF8, value, -1, -1, 0)NEWLINE if not add_result:NEWLINE _raise_current_error()NEWLINENEWLINENEWLINE def __getattr__(self, name):NEWLINE """NEWLINE Find attribute. An X509Name object has the following attributes:NEWLINE countryName (alias C), stateOrProvince (alias ST), locality (alias L),NEWLINE organization (alias O), organizationalUnit (alias OU), commonName (aliasNEWLINE CN) and more...NEWLINE """NEWLINE nid = _lib.OBJ_txt2nid(_byte_string(name))NEWLINE if nid == _lib.NID_undef:NEWLINE # This is a bit weird. OBJ_txt2nid indicated failure, but it seemsNEWLINE # a lower level function, a2d_ASN1_OBJECT, also feels the need toNEWLINE # push something onto the error queue. If we don't clean that upNEWLINE # now, someone else will bump into it later and be quite confused.NEWLINE # See lp#314814.NEWLINE try:NEWLINE _raise_current_error()NEWLINE except Error:NEWLINE passNEWLINE return super(X509Name, self).__getattr__(name)NEWLINENEWLINE entry_index = _lib.X509_NAME_get_index_by_NID(self._name, nid, -1)NEWLINE if entry_index == -1:NEWLINE return NoneNEWLINENEWLINE entry = _lib.X509_NAME_get_entry(self._name, entry_index)NEWLINE data = _lib.X509_NAME_ENTRY_get_data(entry)NEWLINENEWLINE result_buffer = _ffi.new("unsigned char**")NEWLINE data_length = _lib.ASN1_STRING_to_UTF8(result_buffer, data)NEWLINE if data_length < 0:NEWLINE # TODO: This is untested.NEWLINE _raise_current_error()NEWLINENEWLINE try:NEWLINE result = _ffi.buffer(result_buffer[0], data_length)[:].decode('utf-8')NEWLINE finally:NEWLINE # XXX untestedNEWLINE _lib.OPENSSL_free(result_buffer[0])NEWLINE return resultNEWLINENEWLINENEWLINE def _cmp(op):NEWLINE def f(self, other):NEWLINE if not isinstance(other, X509Name):NEWLINE return NotImplementedNEWLINE result = _lib.X509_NAME_cmp(self._name, other._name)NEWLINE return op(result, 0)NEWLINE return fNEWLINENEWLINE __eq__ = _cmp(__eq__)NEWLINE __ne__ = _cmp(__ne__)NEWLINENEWLINE __lt__ = _cmp(__lt__)NEWLINE __le__ = _cmp(__le__)NEWLINENEWLINE __gt__ = _cmp(__gt__)NEWLINE __ge__ = _cmp(__ge__)NEWLINENEWLINE def __repr__(self):NEWLINE """NEWLINE String representation of an X509NameNEWLINE """NEWLINE result_buffer = _ffi.new("char[]", 512);NEWLINE format_result = _lib.X509_NAME_oneline(NEWLINE self._name, result_buffer, len(result_buffer))NEWLINENEWLINE if format_result == _ffi.NULL:NEWLINE # TODO: This is untested.NEWLINE _raise_current_error()NEWLINENEWLINE return "<X509Name object '%s'>" % (NEWLINE _native(_ffi.string(result_buffer)),)NEWLINENEWLINENEWLINE def hash(self):NEWLINE """NEWLINE Return the hash value of this nameNEWLINENEWLINE :return: NoneNEWLINE """NEWLINE return _lib.X509_NAME_hash(self._name)NEWLINENEWLINENEWLINE def der(self):NEWLINE """NEWLINE Return the DER encoding of this nameNEWLINENEWLINE :return: A :py:class:`bytes` instance giving the DER encoded form ofNEWLINE this name.NEWLINE """NEWLINE result_buffer = _ffi.new('unsigned char**')NEWLINE encode_result = _lib.i2d_X509_NAME(self._name, result_buffer)NEWLINE if encode_result < 0:NEWLINE # TODO: This is untested.NEWLINE _raise_current_error()NEWLINENEWLINE string_result = _ffi.buffer(result_buffer[0], encode_result)[:]NEWLINE _lib.OPENSSL_free(result_buffer[0])NEWLINE return string_resultNEWLINENEWLINENEWLINE def get_components(self):NEWLINE """NEWLINE Returns the split-up components of this name.NEWLINENEWLINE :return: List of tuples (name, value).NEWLINE """NEWLINE result = []NEWLINE for i in range(_lib.X509_NAME_entry_count(self._name)):NEWLINE ent = _lib.X509_NAME_get_entry(self._name, i)NEWLINENEWLINE fname = _lib.X509_NAME_ENTRY_get_object(ent)NEWLINE fval = _lib.X509_NAME_ENTRY_get_data(ent)NEWLINENEWLINE nid = _lib.OBJ_obj2nid(fname)NEWLINE name = _lib.OBJ_nid2sn(nid)NEWLINENEWLINE result.append((NEWLINE _ffi.string(name),NEWLINE _ffi.string(NEWLINE _lib.ASN1_STRING_data(fval),NEWLINE _lib.ASN1_STRING_length(fval))))NEWLINENEWLINE return resultNEWLINEX509NameType = X509NameNEWLINENEWLINENEWLINEclass X509Extension(object):NEWLINE def __init__(self, type_name, critical, value, subject=None, issuer=None):NEWLINE """NEWLINE :param typename: The name of the extension to create.NEWLINE :type typename: :py:data:`str`NEWLINENEWLINE :param critical: A flag indicating whether this is a critical extension.NEWLINENEWLINE :param value: The value of the extension.NEWLINE :type value: :py:data:`str`NEWLINENEWLINE :param subject: Optional X509 cert to use as subject.NEWLINE :type subject: :py:class:`X509`NEWLINENEWLINE :param issuer: Optional X509 cert to use as issuer.NEWLINE :type issuer: :py:class:`X509`NEWLINENEWLINE :return: The X509Extension objectNEWLINE """NEWLINE ctx = _ffi.new("X509V3_CTX*")NEWLINENEWLINE # A context is necessary for any extension which uses the r2i conversionNEWLINE # method. That is, X509V3_EXT_nconf may segfault if passed a NULL ctx.NEWLINE # Start off by initializing most of the fields to NULL.NEWLINE _lib.X509V3_set_ctx(ctx, _ffi.NULL, _ffi.NULL, _ffi.NULL, _ffi.NULL, 0)NEWLINENEWLINE # We have no configuration database - but perhaps we should (someNEWLINE # extensions may require it).NEWLINE _lib.X509V3_set_ctx_nodb(ctx)NEWLINENEWLINE # Initialize the subject and issuer, if appropriate. ctx is a local,NEWLINE # and as far as I can tell none of the X509V3_* APIs invoked here stealNEWLINE # any references, so no need to mess with reference counts or duplicates.NEWLINE if issuer is not None:NEWLINE if not isinstance(issuer, X509):NEWLINE raise TypeError("issuer must be an X509 instance")NEWLINE ctx.issuer_cert = issuer._x509NEWLINE if subject is not None:NEWLINE if not isinstance(subject, X509):NEWLINE raise TypeError("subject must be an X509 instance")NEWLINE ctx.subject_cert = subject._x509NEWLINENEWLINE if critical:NEWLINE # There are other OpenSSL APIs which would let us pass in criticalNEWLINE # separately, but they're harder to use, and since value is alreadyNEWLINE # a pile of crappy junk smuggling a ton of utterly importantNEWLINE # structured data, what's the point of trying to avoid nasty stuffNEWLINE # with strings? (However, X509V3_EXT_i2d in particular seems like itNEWLINE # would be a better API to invoke. I do not know where to get theNEWLINE # ext_struc it desires for its last parameter, though.)NEWLINE value = b"critical," + valueNEWLINENEWLINE extension = _lib.X509V3_EXT_nconf(_ffi.NULL, ctx, type_name, value)NEWLINE if extension == _ffi.NULL:NEWLINE _raise_current_error()NEWLINE self._extension = _ffi.gc(extension, _lib.X509_EXTENSION_free)NEWLINENEWLINENEWLINE @propertyNEWLINE def _nid(self):NEWLINE return _lib.OBJ_obj2nid(self._extension.object)NEWLINENEWLINE _prefixes = {NEWLINE _lib.GEN_EMAIL: "email",NEWLINE _lib.GEN_DNS: "DNS",NEWLINE _lib.GEN_URI: "URI",NEWLINE }NEWLINENEWLINE def _subjectAltNameString(self):NEWLINE method = _lib.X509V3_EXT_get(self._extension)NEWLINE if method == _ffi.NULL:NEWLINE # TODO: This is untested.NEWLINE _raise_current_error()NEWLINE payload = self._extension.value.dataNEWLINE length = self._extension.value.lengthNEWLINENEWLINE payloadptr = _ffi.new("unsigned char**")NEWLINE payloadptr[0] = payloadNEWLINENEWLINE if method.it != _ffi.NULL:NEWLINE ptr = _lib.ASN1_ITEM_ptr(method.it)NEWLINE data = _lib.ASN1_item_d2i(_ffi.NULL, payloadptr, length, ptr)NEWLINE names = _ffi.cast("GENERAL_NAMES*", data)NEWLINE else:NEWLINE names = _ffi.cast(NEWLINE "GENERAL_NAMES*",NEWLINE method.d2i(_ffi.NULL, payloadptr, length))NEWLINENEWLINE parts = []NEWLINE for i in range(_lib.sk_GENERAL_NAME_num(names)):NEWLINE name = _lib.sk_GENERAL_NAME_value(names, i)NEWLINE try:NEWLINE label = self._prefixes[name.type]NEWLINE except KeyError:NEWLINE bio = _new_mem_buf()NEWLINE _lib.GENERAL_NAME_print(bio, name)NEWLINE parts.append(_native(_bio_to_string(bio)))NEWLINE else:NEWLINE value = _native(NEWLINE _ffi.buffer(name.d.ia5.data, name.d.ia5.length)[:])NEWLINE parts.append(label + ":" + value)NEWLINE return ", ".join(parts)NEWLINENEWLINENEWLINE def __str__(self):NEWLINE """NEWLINE :return: a nice text representation of the extensionNEWLINE """NEWLINE if _lib.NID_subject_alt_name == self._nid:NEWLINE return self._subjectAltNameString()NEWLINENEWLINE bio = _new_mem_buf()NEWLINE print_result = _lib.X509V3_EXT_print(bio, self._extension, 0, 0)NEWLINE if not print_result:NEWLINE # TODO: This is untested.NEWLINE _raise_current_error()NEWLINENEWLINE return _native(_bio_to_string(bio))NEWLINENEWLINENEWLINE def get_critical(self):NEWLINE """NEWLINE Returns the critical field of the X509ExtensionNEWLINENEWLINE :return: The critical field.NEWLINE """NEWLINE return _lib.X509_EXTENSION_get_critical(self._extension)NEWLINENEWLINENEWLINE def get_short_name(self):NEWLINE """NEWLINE Returns the short version of the type name of the X509ExtensionNEWLINENEWLINE :return: The short type name.NEWLINE """NEWLINE obj = _lib.X509_EXTENSION_get_object(self._extension)NEWLINE nid = _lib.OBJ_obj2nid(obj)NEWLINE return _ffi.string(_lib.OBJ_nid2sn(nid))NEWLINENEWLINENEWLINE def get_data(self):NEWLINE """NEWLINE Returns the data of the X509ExtensionNEWLINENEWLINE :return: A :py:data:`str` giving the X509Extension's ASN.1 encoded data.NEWLINE """NEWLINE octet_result = _lib.X509_EXTENSION_get_data(self._extension)NEWLINE string_result = _ffi.cast('ASN1_STRING*', octet_result)NEWLINE char_result = _lib.ASN1_STRING_data(string_result)NEWLINE result_length = _lib.ASN1_STRING_length(string_result)NEWLINE return _ffi.buffer(char_result, result_length)[:]NEWLINENEWLINEX509ExtensionType = X509ExtensionNEWLINENEWLINENEWLINEclass X509Req(object):NEWLINE def __init__(self):NEWLINE req = _lib.X509_REQ_new()NEWLINE self._req = _ffi.gc(req, _lib.X509_REQ_free)NEWLINENEWLINENEWLINE def set_pubkey(self, pkey):NEWLINE """NEWLINE Set the public key of the certificate requestNEWLINENEWLINE :param pkey: The public key to useNEWLINE :return: NoneNEWLINE """NEWLINE set_result = _lib.X509_REQ_set_pubkey(self._req, pkey._pkey)NEWLINE if not set_result:NEWLINE # TODO: This is untested.NEWLINE _raise_current_error()NEWLINENEWLINENEWLINE def get_pubkey(self):NEWLINE """NEWLINE Get the public key from the certificate requestNEWLINENEWLINE :return: The public keyNEWLINE """NEWLINE pkey = PKey.__new__(PKey)NEWLINE pkey._pkey = _lib.X509_REQ_get_pubkey(self._req)NEWLINE if pkey._pkey == _ffi.NULL:NEWLINE # TODO: This is untested.NEWLINE _raise_current_error()NEWLINE pkey._pkey = _ffi.gc(pkey._pkey, _lib.EVP_PKEY_free)NEWLINE pkey._only_public = TrueNEWLINE return pkeyNEWLINENEWLINENEWLINE def set_version(self, version):NEWLINE """NEWLINE Set the version subfield (RFC 2459, section 4.1.2.1) of the certificateNEWLINE request.NEWLINENEWLINE :param version: The version numberNEWLINE :return: NoneNEWLINE """NEWLINE set_result = _lib.X509_REQ_set_version(self._req, version)NEWLINE if not set_result:NEWLINE _raise_current_error()NEWLINENEWLINENEWLINE def get_version(self):NEWLINE """NEWLINE Get the version subfield (RFC 2459, section 4.1.2.1) of the certificateNEWLINE request.NEWLINENEWLINE :return: an integer giving the value of the version subfieldNEWLINE """NEWLINE return _lib.X509_REQ_get_version(self._req)NEWLINENEWLINENEWLINE def get_subject(self):NEWLINE """NEWLINE Create an X509Name object for the subject of the certificate requestNEWLINENEWLINE :return: An X509Name objectNEWLINE """NEWLINE name = X509Name.__new__(X509Name)NEWLINE name._name = _lib.X509_REQ_get_subject_name(self._req)NEWLINE if name._name == _ffi.NULL:NEWLINE # TODO: This is untested.NEWLINE _raise_current_error()NEWLINENEWLINE # The name is owned by the X509Req structure. As long as the X509NameNEWLINE # Python object is alive, keep the X509Req Python object alive.NEWLINE name._owner = selfNEWLINENEWLINE return nameNEWLINENEWLINENEWLINE def add_extensions(self, extensions):NEWLINE """NEWLINE Add extensions to the request.NEWLINENEWLINE :param extensions: a sequence of X509Extension objectsNEWLINE :return: NoneNEWLINE """NEWLINE stack = _lib.sk_X509_EXTENSION_new_null()NEWLINE if stack == _ffi.NULL:NEWLINE # TODO: This is untested.NEWLINE _raise_current_error()NEWLINENEWLINE stack = _ffi.gc(stack, _lib.sk_X509_EXTENSION_free)NEWLINENEWLINE for ext in extensions:NEWLINE if not isinstance(ext, X509Extension):NEWLINE raise ValueError("One of the elements is not an X509Extension")NEWLINENEWLINE # TODO push can fail (here and elsewhere)NEWLINE _lib.sk_X509_EXTENSION_push(stack, ext._extension)NEWLINENEWLINE add_result = _lib.X509_REQ_add_extensions(self._req, stack)NEWLINE if not add_result:NEWLINE # TODO: This is untested.NEWLINE _raise_current_error()NEWLINENEWLINENEWLINE def sign(self, pkey, digest):NEWLINE """NEWLINE Sign the certificate request using the supplied key and digestNEWLINENEWLINE :param pkey: The key to sign withNEWLINE :param digest: The message digest to useNEWLINE :return: NoneNEWLINE """NEWLINE if pkey._only_public:NEWLINE raise ValueError("Key has only public part")NEWLINENEWLINE if not pkey._initialized:NEWLINE raise ValueError("Key is uninitialized")NEWLINENEWLINE digest_obj = _lib.EVP_get_digestbyname(_byte_string(digest))NEWLINE if digest_obj == _ffi.NULL:NEWLINE raise ValueError("No such digest method")NEWLINENEWLINE sign_result = _lib.X509_REQ_sign(self._req, pkey._pkey, digest_obj)NEWLINE if not sign_result:NEWLINE # TODO: This is untested.NEWLINE _raise_current_error()NEWLINENEWLINENEWLINE def verify(self, pkey):NEWLINE """NEWLINE Verifies a certificate request using the supplied public keyNEWLINENEWLINE :param key: a public keyNEWLINE :return: True if the signature is correct.NEWLINENEWLINE :raise OpenSSL.crypto.Error: If the signature is invalid or there is aNEWLINE problem verifying the signature.NEWLINE """NEWLINE if not isinstance(pkey, PKey):NEWLINE raise TypeError("pkey must be a PKey instance")NEWLINENEWLINE result = _lib.X509_REQ_verify(self._req, pkey._pkey)NEWLINE if result <= 0:NEWLINE _raise_current_error()NEWLINENEWLINE return resultNEWLINENEWLINENEWLINEX509ReqType = X509ReqNEWLINENEWLINENEWLINENEWLINEclass X509(object):NEWLINE def __init__(self):NEWLINE # TODO Allocation failure? And why not __new__ instead of __init__?NEWLINE x509 = _lib.X509_new()NEWLINE self._x509 = _ffi.gc(x509, _lib.X509_free)NEWLINENEWLINENEWLINE def set_version(self, version):NEWLINE """NEWLINE Set version number of the certificateNEWLINENEWLINE :param version: The version numberNEWLINE :type version: :py:class:`int`NEWLINENEWLINE :return: NoneNEWLINE """NEWLINE if not isinstance(version, int):NEWLINE raise TypeError("version must be an integer")NEWLINENEWLINE _lib.X509_set_version(self._x509, version)NEWLINENEWLINENEWLINE def get_version(self):NEWLINE """NEWLINE Return version number of the certificateNEWLINENEWLINE :return: Version number as a Python integerNEWLINE """NEWLINE return _lib.X509_get_version(self._x509)NEWLINENEWLINENEWLINE def get_pubkey(self):NEWLINE """NEWLINE Get the public key of the certificateNEWLINENEWLINE :return: The public keyNEWLINE """NEWLINE pkey = PKey.__new__(PKey)NEWLINE pkey._pkey = _lib.X509_get_pubkey(self._x509)NEWLINE if pkey._pkey == _ffi.NULL:NEWLINE _raise_current_error()NEWLINE pkey._pkey = _ffi.gc(pkey._pkey, _lib.EVP_PKEY_free)NEWLINE pkey._only_public = TrueNEWLINE return pkeyNEWLINENEWLINENEWLINE def set_pubkey(self, pkey):NEWLINE """NEWLINE Set the public key of the certificateNEWLINENEWLINE :param pkey: The public keyNEWLINENEWLINE :return: NoneNEWLINE """NEWLINE if not isinstance(pkey, PKey):NEWLINE raise TypeError("pkey must be a PKey instance")NEWLINENEWLINE set_result = _lib.X509_set_pubkey(self._x509, pkey._pkey)NEWLINE if not set_result:NEWLINE _raise_current_error()NEWLINENEWLINENEWLINE def sign(self, pkey, digest):NEWLINE """NEWLINE Sign the certificate using the supplied key and digestNEWLINENEWLINE :param pkey: The key to sign withNEWLINE :param digest: The message digest to useNEWLINE :return: NoneNEWLINE """NEWLINE if not isinstance(pkey, PKey):NEWLINE raise TypeError("pkey must be a PKey instance")NEWLINENEWLINE if pkey._only_public:NEWLINE raise ValueError("Key only has public part")NEWLINENEWLINE if not pkey._initialized:NEWLINE raise ValueError("Key is uninitialized")NEWLINENEWLINE evp_md = _lib.EVP_get_digestbyname(_byte_string(digest))NEWLINE if evp_md == _ffi.NULL:NEWLINE raise ValueError("No such digest method")NEWLINENEWLINE sign_result = _lib.X509_sign(self._x509, pkey._pkey, evp_md)NEWLINE if not sign_result:NEWLINE _raise_current_error()NEWLINENEWLINENEWLINE def get_signature_algorithm(self):NEWLINE """NEWLINE Retrieve the signature algorithm used in the certificateNEWLINENEWLINE :return: A byte string giving the name of the signature algorithm used inNEWLINE the certificate.NEWLINE :raise ValueError: If the signature algorithm is undefined.NEWLINE """NEWLINE alg = self._x509.cert_info.signature.algorithmNEWLINE nid = _lib.OBJ_obj2nid(alg)NEWLINE if nid == _lib.NID_undef:NEWLINE raise ValueError("Undefined signature algorithm")NEWLINE return _ffi.string(_lib.OBJ_nid2ln(nid))NEWLINENEWLINENEWLINE def digest(self, digest_name):NEWLINE """NEWLINE Return the digest of the X509 object.NEWLINENEWLINE :param digest_name: The name of the digest algorithm to use.NEWLINE :type digest_name: :py:class:`bytes`NEWLINENEWLINE :return: The digest of the objectNEWLINE """NEWLINE digest = _lib.EVP_get_digestbyname(_byte_string(digest_name))NEWLINE if digest == _ffi.NULL:NEWLINE raise ValueError("No such digest method")NEWLINENEWLINE result_buffer = _ffi.new("char[]", _lib.EVP_MAX_MD_SIZE)NEWLINE result_length = _ffi.new("unsigned int[]", 1)NEWLINE result_length[0] = len(result_buffer)NEWLINENEWLINE digest_result = _lib.X509_digest(NEWLINE self._x509, digest, result_buffer, result_length)NEWLINENEWLINE if not digest_result:NEWLINE # TODO: This is untested.NEWLINE _raise_current_error()NEWLINENEWLINE return b":".join([NEWLINE b16encode(ch).upper() for chNEWLINE in _ffi.buffer(result_buffer, result_length[0])])NEWLINENEWLINENEWLINE def subject_name_hash(self):NEWLINE """NEWLINE Return the hash of the X509 subject.NEWLINENEWLINE :return: The hash of the subject.NEWLINE """NEWLINE return _lib.X509_subject_name_hash(self._x509)NEWLINENEWLINENEWLINE def set_serial_number(self, serial):NEWLINE """NEWLINE Set serial number of the certificateNEWLINENEWLINE :param serial: The serial numberNEWLINE :type serial: :py:class:`int`NEWLINENEWLINE :return: NoneNEWLINE """NEWLINE if not isinstance(serial, _integer_types):NEWLINE raise TypeError("serial must be an integer")NEWLINENEWLINE hex_serial = hex(serial)[2:]NEWLINE if not isinstance(hex_serial, bytes):NEWLINE hex_serial = hex_serial.encode('ascii')NEWLINENEWLINE bignum_serial = _ffi.new("BIGNUM**")NEWLINENEWLINE # BN_hex2bn stores the result in &bignum. Unless it doesn't feel likeNEWLINE # it. If bignum is still NULL after this call, then the return value isNEWLINE # actually the result. I hope. -exarkunNEWLINE small_serial = _lib.BN_hex2bn(bignum_serial, hex_serial)NEWLINENEWLINE if bignum_serial[0] == _ffi.NULL:NEWLINE set_result = _lib.ASN1_INTEGER_set(NEWLINE _lib.X509_get_serialNumber(self._x509), small_serial)NEWLINE if set_result:NEWLINE # TODO Not testedNEWLINE _raise_current_error()NEWLINE else:NEWLINE asn1_serial = _lib.BN_to_ASN1_INTEGER(bignum_serial[0], _ffi.NULL)NEWLINE _lib.BN_free(bignum_serial[0])NEWLINE if asn1_serial == _ffi.NULL:NEWLINE # TODO Not testedNEWLINE _raise_current_error()NEWLINE asn1_serial = _ffi.gc(asn1_serial, _lib.ASN1_INTEGER_free)NEWLINE set_result = _lib.X509_set_serialNumber(self._x509, asn1_serial)NEWLINE if not set_result:NEWLINE # TODO Not testedNEWLINE _raise_current_error()NEWLINENEWLINENEWLINE def get_serial_number(self):NEWLINE """NEWLINE Return serial number of the certificateNEWLINENEWLINE :return: Serial number as a Python integerNEWLINE """NEWLINE asn1_serial = _lib.X509_get_serialNumber(self._x509)NEWLINE bignum_serial = _lib.ASN1_INTEGER_to_BN(asn1_serial, _ffi.NULL)NEWLINE try:NEWLINE hex_serial = _lib.BN_bn2hex(bignum_serial)NEWLINE try:NEWLINE hexstring_serial = _ffi.string(hex_serial)NEWLINE serial = int(hexstring_serial, 16)NEWLINE return serialNEWLINE finally:NEWLINE _lib.OPENSSL_free(hex_serial)NEWLINE finally:NEWLINE _lib.BN_free(bignum_serial)NEWLINENEWLINENEWLINE def gmtime_adj_notAfter(self, amount):NEWLINE """NEWLINE Adjust the time stamp for when the certificate stops being validNEWLINENEWLINE :param amount: The number of seconds by which to adjust the endingNEWLINE validity time.NEWLINE :type amount: :py:class:`int`NEWLINENEWLINE :return: NoneNEWLINE """NEWLINE if not isinstance(amount, int):NEWLINE raise TypeError("amount must be an integer")NEWLINENEWLINE notAfter = _lib.X509_get_notAfter(self._x509)NEWLINE _lib.X509_gmtime_adj(notAfter, amount)NEWLINENEWLINENEWLINE def gmtime_adj_notBefore(self, amount):NEWLINE """NEWLINE Change the timestamp for when the certificate starts being valid to the currentNEWLINE time plus an offset.NEWLINENEWLINE :param amount: The number of seconds by which to adjust the starting validityNEWLINE time.NEWLINE :return: NoneNEWLINE """NEWLINE if not isinstance(amount, int):NEWLINE raise TypeError("amount must be an integer")NEWLINENEWLINE notBefore = _lib.X509_get_notBefore(self._x509)NEWLINE _lib.X509_gmtime_adj(notBefore, amount)NEWLINENEWLINENEWLINE def has_expired(self):NEWLINE """NEWLINE Check whether the certificate has expired.NEWLINENEWLINE :return: True if the certificate has expired, false otherwiseNEWLINE """NEWLINE now = int(time())NEWLINE notAfter = _lib.X509_get_notAfter(self._x509)NEWLINE return _lib.ASN1_UTCTIME_cmp_time_t(NEWLINE _ffi.cast('ASN1_UTCTIME*', notAfter), now) < 0NEWLINENEWLINENEWLINE def _get_boundary_time(self, which):NEWLINE return _get_asn1_time(which(self._x509))NEWLINENEWLINENEWLINE def get_notBefore(self):NEWLINE """NEWLINE Retrieve the time stamp for when the certificate starts being validNEWLINENEWLINE :return: A string giving the timestamp, in the format::NEWLINENEWLINE YYYYMMDDhhmmssZNEWLINE YYYYMMDDhhmmss+hhmmNEWLINE YYYYMMDDhhmmss-hhmmNEWLINENEWLINE or None if there is no value set.NEWLINE """NEWLINE return self._get_boundary_time(_lib.X509_get_notBefore)NEWLINENEWLINENEWLINE def _set_boundary_time(self, which, when):NEWLINE return _set_asn1_time(which(self._x509), when)NEWLINENEWLINENEWLINE def set_notBefore(self, when):NEWLINE """NEWLINE Set the time stamp for when the certificate starts being validNEWLINENEWLINE :param when: A string giving the timestamp, in the format:NEWLINENEWLINE YYYYMMDDhhmmssZNEWLINE YYYYMMDDhhmmss+hhmmNEWLINE YYYYMMDDhhmmss-hhmmNEWLINE :type when: :py:class:`bytes`NEWLINENEWLINE :return: NoneNEWLINE """NEWLINE return self._set_boundary_time(_lib.X509_get_notBefore, when)NEWLINENEWLINENEWLINE def get_notAfter(self):NEWLINE """NEWLINE Retrieve the time stamp for when the certificate stops being validNEWLINENEWLINE :return: A string giving the timestamp, in the format::NEWLINENEWLINE YYYYMMDDhhmmssZNEWLINE YYYYMMDDhhmmss+hhmmNEWLINE YYYYMMDDhhmmss-hhmmNEWLINENEWLINE or None if there is no value set.NEWLINE """NEWLINE return self._get_boundary_time(_lib.X509_get_notAfter)NEWLINENEWLINENEWLINE def set_notAfter(self, when):NEWLINE """NEWLINE Set the time stamp for when the certificate stops being validNEWLINENEWLINE :param when: A string giving the timestamp, in the format:NEWLINENEWLINE YYYYMMDDhhmmssZNEWLINE YYYYMMDDhhmmss+hhmmNEWLINE YYYYMMDDhhmmss-hhmmNEWLINE :type when: :py:class:`bytes`NEWLINENEWLINE :return: NoneNEWLINE """NEWLINE return self._set_boundary_time(_lib.X509_get_notAfter, when)NEWLINENEWLINENEWLINE def _get_name(self, which):NEWLINE name = X509Name.__new__(X509Name)NEWLINE name._name = which(self._x509)NEWLINE if name._name == _ffi.NULL:NEWLINE # TODO: This is untested.NEWLINE _raise_current_error()NEWLINENEWLINE # The name is owned by the X509 structure. As long as the X509NameNEWLINE # Python object is alive, keep the X509 Python object alive.NEWLINE name._owner = selfNEWLINENEWLINE return nameNEWLINENEWLINENEWLINE def _set_name(self, which, name):NEWLINE if not isinstance(name, X509Name):NEWLINE raise TypeError("name must be an X509Name")NEWLINE set_result = which(self._x509, name._name)NEWLINE if not set_result:NEWLINE # TODO: This is untested.NEWLINE _raise_current_error()NEWLINENEWLINENEWLINE def get_issuer(self):NEWLINE """NEWLINE Create an X509Name object for the issuer of the certificateNEWLINENEWLINE :return: An X509Name objectNEWLINE """NEWLINE return self._get_name(_lib.X509_get_issuer_name)NEWLINENEWLINENEWLINE def set_issuer(self, issuer):NEWLINE """NEWLINE Set the issuer of the certificateNEWLINENEWLINE :param issuer: The issuer nameNEWLINE :type issuer: :py:class:`X509Name`NEWLINENEWLINE :return: NoneNEWLINE """NEWLINE return self._set_name(_lib.X509_set_issuer_name, issuer)NEWLINENEWLINENEWLINE def get_subject(self):NEWLINE """NEWLINE Create an X509Name object for the subject of the certificateNEWLINENEWLINE :return: An X509Name objectNEWLINE """NEWLINE return self._get_name(_lib.X509_get_subject_name)NEWLINENEWLINENEWLINE def set_subject(self, subject):NEWLINE """NEWLINE Set the subject of the certificateNEWLINENEWLINE :param subject: The subject nameNEWLINE :type subject: :py:class:`X509Name`NEWLINE :return: NoneNEWLINE """NEWLINE return self._set_name(_lib.X509_set_subject_name, subject)NEWLINENEWLINENEWLINE def get_extension_count(self):NEWLINE """NEWLINE Get the number of extensions on the certificate.NEWLINENEWLINE :return: The number of extensions as an integer.NEWLINE """NEWLINE return _lib.X509_get_ext_count(self._x509)NEWLINENEWLINENEWLINE def add_extensions(self, extensions):NEWLINE """NEWLINE Add extensions to the certificate.NEWLINENEWLINE :param extensions: a sequence of X509Extension objectsNEWLINE :return: NoneNEWLINE """NEWLINE for ext in extensions:NEWLINE if not isinstance(ext, X509Extension):NEWLINE raise ValueError("One of the elements is not an X509Extension")NEWLINENEWLINE add_result = _lib.X509_add_ext(self._x509, ext._extension, -1)NEWLINE if not add_result:NEWLINE _raise_current_error()NEWLINENEWLINENEWLINE def get_extension(self, index):NEWLINE """NEWLINE Get a specific extension of the certificate by index.NEWLINENEWLINE :param index: The index of the extension to retrieve.NEWLINE :return: The X509Extension object at the specified index.NEWLINE """NEWLINE ext = X509Extension.__new__(X509Extension)NEWLINE ext._extension = _lib.X509_get_ext(self._x509, index)NEWLINE if ext._extension == _ffi.NULL:NEWLINE raise IndexError("extension index out of bounds")NEWLINENEWLINE extension = _lib.X509_EXTENSION_dup(ext._extension)NEWLINE ext._extension = _ffi.gc(extension, _lib.X509_EXTENSION_free)NEWLINE return extNEWLINENEWLINEX509Type = X509NEWLINENEWLINENEWLINENEWLINEclass X509Store(object):NEWLINE def __init__(self):NEWLINE store = _lib.X509_STORE_new()NEWLINE self._store = _ffi.gc(store, _lib.X509_STORE_free)NEWLINENEWLINENEWLINE def add_cert(self, cert):NEWLINE if not isinstance(cert, X509):NEWLINE raise TypeError()NEWLINENEWLINE result = _lib.X509_STORE_add_cert(self._store, cert._x509)NEWLINE if not result:NEWLINE _raise_current_error()NEWLINENEWLINENEWLINEX509StoreType = X509StoreNEWLINENEWLINENEWLINENEWLINEdef load_certificate(type, buffer):NEWLINE """NEWLINE Load a certificate from a bufferNEWLINENEWLINE :param type: The file type (one of FILETYPE_PEM, FILETYPE_ASN1)NEWLINENEWLINE :param buffer: The buffer the certificate is stored inNEWLINE :type buffer: :py:class:`bytes`NEWLINENEWLINE :return: The X509 objectNEWLINE """NEWLINE if isinstance(buffer, _text_type):NEWLINE buffer = buffer.encode("ascii")NEWLINENEWLINE bio = _new_mem_buf(buffer)NEWLINENEWLINE if type == FILETYPE_PEM:NEWLINE x509 = _lib.PEM_read_bio_X509(bio, _ffi.NULL, _ffi.NULL, _ffi.NULL)NEWLINE elif type == FILETYPE_ASN1:NEWLINE x509 = _lib.d2i_X509_bio(bio, _ffi.NULL);NEWLINE else:NEWLINE raise ValueError(NEWLINE "type argument must be FILETYPE_PEM or FILETYPE_ASN1")NEWLINENEWLINE if x509 == _ffi.NULL:NEWLINE _raise_current_error()NEWLINENEWLINE cert = X509.__new__(X509)NEWLINE cert._x509 = _ffi.gc(x509, _lib.X509_free)NEWLINE return certNEWLINENEWLINENEWLINEdef dump_certificate(type, cert):NEWLINE """NEWLINE Dump a certificate to a bufferNEWLINENEWLINE :param type: The file type (one of FILETYPE_PEM, FILETYPE_ASN1, orNEWLINE FILETYPE_TEXT)NEWLINE :param cert: The certificate to dumpNEWLINE :return: The buffer with the dumped certificate inNEWLINE """NEWLINE bio = _new_mem_buf()NEWLINENEWLINE if type == FILETYPE_PEM:NEWLINE result_code = _lib.PEM_write_bio_X509(bio, cert._x509)NEWLINE elif type == FILETYPE_ASN1:NEWLINE result_code = _lib.i2d_X509_bio(bio, cert._x509)NEWLINE elif type == FILETYPE_TEXT:NEWLINE result_code = _lib.X509_print_ex(bio, cert._x509, 0, 0)NEWLINE else:NEWLINE raise ValueError(NEWLINE "type argument must be FILETYPE_PEM, FILETYPE_ASN1, or "NEWLINE "FILETYPE_TEXT")NEWLINENEWLINE return _bio_to_string(bio)NEWLINENEWLINENEWLINENEWLINEdef dump_privatekey(type, pkey, cipher=None, passphrase=None):NEWLINE """NEWLINE Dump a private key to a bufferNEWLINENEWLINE :param type: The file type (one of FILETYPE_PEM, FILETYPE_ASN1, orNEWLINE FILETYPE_TEXT)NEWLINE :param pkey: The PKey to dumpNEWLINE :param cipher: (optional) if encrypted PEM format, the cipher toNEWLINE useNEWLINE :param passphrase: (optional) if encrypted PEM format, this can be eitherNEWLINE the passphrase to use, or a callback for providing theNEWLINE passphrase.NEWLINE :return: The buffer with the dumped key inNEWLINE :rtype: :py:data:`str`NEWLINE """NEWLINE bio = _new_mem_buf()NEWLINENEWLINE if cipher is not None:NEWLINE if passphrase is None:NEWLINE raise TypeError(NEWLINE "if a value is given for cipher "NEWLINE "one must also be given for passphrase")NEWLINE cipher_obj = _lib.EVP_get_cipherbyname(_byte_string(cipher))NEWLINE if cipher_obj == _ffi.NULL:NEWLINE raise ValueError("Invalid cipher name")NEWLINE else:NEWLINE cipher_obj = _ffi.NULLNEWLINENEWLINE helper = _PassphraseHelper(type, passphrase)NEWLINE if type == FILETYPE_PEM:NEWLINE result_code = _lib.PEM_write_bio_PrivateKey(NEWLINE bio, pkey._pkey, cipher_obj, _ffi.NULL, 0,NEWLINE helper.callback, helper.callback_args)NEWLINE helper.raise_if_problem()NEWLINE elif type == FILETYPE_ASN1:NEWLINE result_code = _lib.i2d_PrivateKey_bio(bio, pkey._pkey)NEWLINE elif type == FILETYPE_TEXT:NEWLINE rsa = _lib.EVP_PKEY_get1_RSA(pkey._pkey)NEWLINE result_code = _lib.RSA_print(bio, rsa, 0)NEWLINE # TODO RSA_free(rsa)?NEWLINE else:NEWLINE raise ValueError(NEWLINE "type argument must be FILETYPE_PEM, FILETYPE_ASN1, or "NEWLINE "FILETYPE_TEXT")NEWLINENEWLINE if result_code == 0:NEWLINE _raise_current_error()NEWLINENEWLINE return _bio_to_string(bio)NEWLINENEWLINENEWLINENEWLINEdef _X509_REVOKED_dup(original):NEWLINE copy = _lib.X509_REVOKED_new()NEWLINE if copy == _ffi.NULL:NEWLINE # TODO: This is untested.NEWLINE _raise_current_error()NEWLINENEWLINE if original.serialNumber != _ffi.NULL:NEWLINE copy.serialNumber = _lib.ASN1_INTEGER_dup(original.serialNumber)NEWLINENEWLINE if original.revocationDate != _ffi.NULL:NEWLINE copy.revocationDate = _lib.M_ASN1_TIME_dup(original.revocationDate)NEWLINENEWLINE if original.extensions != _ffi.NULL:NEWLINE extension_stack = _lib.sk_X509_EXTENSION_new_null()NEWLINE for i in range(_lib.sk_X509_EXTENSION_num(original.extensions)):NEWLINE original_ext = _lib.sk_X509_EXTENSION_value(original.extensions, i)NEWLINE copy_ext = _lib.X509_EXTENSION_dup(original_ext)NEWLINE _lib.sk_X509_EXTENSION_push(extension_stack, copy_ext)NEWLINE copy.extensions = extension_stackNEWLINENEWLINE copy.sequence = original.sequenceNEWLINE return copyNEWLINENEWLINENEWLINENEWLINEclass Revoked(object):NEWLINE # http://www.openssl.org/docs/apps/x509v3_config.html#CRL_distribution_points_NEWLINE # which differs from crl_reasons of crypto/x509v3/v3_enum.c that matchesNEWLINE # OCSP_crl_reason_str. We use the latter, just like the command lineNEWLINE # program.NEWLINE _crl_reasons = [NEWLINE b"unspecified",NEWLINE b"keyCompromise",NEWLINE b"CACompromise",NEWLINE b"affiliationChanged",NEWLINE b"superseded",NEWLINE b"cessationOfOperation",NEWLINE b"certificateHold",NEWLINE # b"removeFromCRL",NEWLINE ]NEWLINENEWLINE def __init__(self):NEWLINE revoked = _lib.X509_REVOKED_new()NEWLINE self._revoked = _ffi.gc(revoked, _lib.X509_REVOKED_free)NEWLINENEWLINENEWLINE def set_serial(self, hex_str):NEWLINE """NEWLINE Set the serial number of a revoked Revoked structureNEWLINENEWLINE :param hex_str: The new serial number.NEWLINE :type hex_str: :py:data:`str`NEWLINE :return: NoneNEWLINE """NEWLINE bignum_serial = _ffi.gc(_lib.BN_new(), _lib.BN_free)NEWLINE bignum_ptr = _ffi.new("BIGNUM**")NEWLINE bignum_ptr[0] = bignum_serialNEWLINE bn_result = _lib.BN_hex2bn(bignum_ptr, hex_str)NEWLINE if not bn_result:NEWLINE raise ValueError("bad hex string")NEWLINENEWLINE asn1_serial = _ffi.gc(NEWLINE _lib.BN_to_ASN1_INTEGER(bignum_serial, _ffi.NULL),NEWLINE _lib.ASN1_INTEGER_free)NEWLINE _lib.X509_REVOKED_set_serialNumber(self._revoked, asn1_serial)NEWLINENEWLINENEWLINE def get_serial(self):NEWLINE """NEWLINE Return the serial number of a Revoked structureNEWLINENEWLINE :return: The serial number as a stringNEWLINE """NEWLINE bio = _new_mem_buf()NEWLINENEWLINE result = _lib.i2a_ASN1_INTEGER(bio, self._revoked.serialNumber)NEWLINE if result < 0:NEWLINE # TODO: This is untested.NEWLINE _raise_current_error()NEWLINENEWLINE return _bio_to_string(bio)NEWLINENEWLINENEWLINE def _delete_reason(self):NEWLINE stack = self._revoked.extensionsNEWLINE for i in range(_lib.sk_X509_EXTENSION_num(stack)):NEWLINE ext = _lib.sk_X509_EXTENSION_value(stack, i)NEWLINE if _lib.OBJ_obj2nid(ext.object) == _lib.NID_crl_reason:NEWLINE _lib.X509_EXTENSION_free(ext)NEWLINE _lib.sk_X509_EXTENSION_delete(stack, i)NEWLINE breakNEWLINENEWLINENEWLINE def set_reason(self, reason):NEWLINE """NEWLINE Set the reason of a Revoked object.NEWLINENEWLINE If :py:data:`reason` is :py:data:`None`, delete the reason instead.NEWLINENEWLINE :param reason: The reason string.NEWLINE :type reason: :py:class:`str` or :py:class:`NoneType`NEWLINE :return: NoneNEWLINE """NEWLINE if reason is None:NEWLINE self._delete_reason()NEWLINE elif not isinstance(reason, bytes):NEWLINE raise TypeError("reason must be None or a byte string")NEWLINE else:NEWLINE reason = reason.lower().replace(b' ', b'')NEWLINE reason_code = [r.lower() for r in self._crl_reasons].index(reason)NEWLINENEWLINE new_reason_ext = _lib.ASN1_ENUMERATED_new()NEWLINE if new_reason_ext == _ffi.NULL:NEWLINE # TODO: This is untested.NEWLINE _raise_current_error()NEWLINE new_reason_ext = _ffi.gc(new_reason_ext, _lib.ASN1_ENUMERATED_free)NEWLINENEWLINE set_result = _lib.ASN1_ENUMERATED_set(new_reason_ext, reason_code)NEWLINE if set_result == _ffi.NULL:NEWLINE # TODO: This is untested.NEWLINE _raise_current_error()NEWLINENEWLINE self._delete_reason()NEWLINE add_result = _lib.X509_REVOKED_add1_ext_i2d(NEWLINE self._revoked, _lib.NID_crl_reason, new_reason_ext, 0, 0)NEWLINENEWLINE if not add_result:NEWLINE # TODO: This is untested.NEWLINE _raise_current_error()NEWLINENEWLINENEWLINE def get_reason(self):NEWLINE """NEWLINE Return the reason of a Revoked object.NEWLINENEWLINE :return: The reason as a stringNEWLINE """NEWLINE extensions = self._revoked.extensionsNEWLINE for i in range(_lib.sk_X509_EXTENSION_num(extensions)):NEWLINE ext = _lib.sk_X509_EXTENSION_value(extensions, i)NEWLINE if _lib.OBJ_obj2nid(ext.object) == _lib.NID_crl_reason:NEWLINE bio = _new_mem_buf()NEWLINENEWLINE print_result = _lib.X509V3_EXT_print(bio, ext, 0, 0)NEWLINE if not print_result:NEWLINE print_result = _lib.M_ASN1_OCTET_STRING_print(bio, ext.value)NEWLINE if print_result == 0:NEWLINE # TODO: This is untested.NEWLINE _raise_current_error()NEWLINENEWLINE return _bio_to_string(bio)NEWLINENEWLINENEWLINE def all_reasons(self):NEWLINE """NEWLINE Return a list of all the supported reason strings.NEWLINENEWLINE :return: A list of reason strings.NEWLINE """NEWLINE return self._crl_reasons[:]NEWLINENEWLINENEWLINE def set_rev_date(self, when):NEWLINE """NEWLINE Set the revocation timestampNEWLINENEWLINE :param when: A string giving the timestamp, in the format:NEWLINENEWLINE YYYYMMDDhhmmssZNEWLINE YYYYMMDDhhmmss+hhmmNEWLINE YYYYMMDDhhmmss-hhmmNEWLINENEWLINE :return: NoneNEWLINE """NEWLINE return _set_asn1_time(self._revoked.revocationDate, when)NEWLINENEWLINENEWLINE def get_rev_date(self):NEWLINE """NEWLINE Retrieve the revocation dateNEWLINENEWLINE :return: A string giving the timestamp, in the format:NEWLINENEWLINE YYYYMMDDhhmmssZNEWLINE YYYYMMDDhhmmss+hhmmNEWLINE YYYYMMDDhhmmss-hhmmNEWLINE """NEWLINE return _get_asn1_time(self._revoked.revocationDate)NEWLINENEWLINENEWLINENEWLINEclass CRL(object):NEWLINE def __init__(self):NEWLINE """NEWLINE Create a new empty CRL object.NEWLINE """NEWLINE crl = _lib.X509_CRL_new()NEWLINE self._crl = _ffi.gc(crl, _lib.X509_CRL_free)NEWLINENEWLINENEWLINE def get_revoked(self):NEWLINE """NEWLINE Return revoked portion of the CRL structure (by value not reference).NEWLINENEWLINE :return: A tuple of Revoked objects.NEWLINE """NEWLINE results = []NEWLINE revoked_stack = self._crl.crl.revokedNEWLINE for i in range(_lib.sk_X509_REVOKED_num(revoked_stack)):NEWLINE revoked = _lib.sk_X509_REVOKED_value(revoked_stack, i)NEWLINE revoked_copy = _X509_REVOKED_dup(revoked)NEWLINE pyrev = Revoked.__new__(Revoked)NEWLINE pyrev._revoked = _ffi.gc(revoked_copy, _lib.X509_REVOKED_free)NEWLINE results.append(pyrev)NEWLINE if results:NEWLINE return tuple(results)NEWLINENEWLINENEWLINE def add_revoked(self, revoked):NEWLINE """NEWLINE Add a revoked (by value not reference) to the CRL structureNEWLINENEWLINE :param revoked: The new revoked.NEWLINE :type revoked: :class:`X509`NEWLINENEWLINE :return: NoneNEWLINE """NEWLINE copy = _X509_REVOKED_dup(revoked._revoked)NEWLINE if copy == _ffi.NULL:NEWLINE # TODO: This is untested.NEWLINE _raise_current_error()NEWLINENEWLINE add_result = _lib.X509_CRL_add0_revoked(self._crl, copy)NEWLINE if add_result == 0:NEWLINE # TODO: This is untested.NEWLINE _raise_current_error()NEWLINENEWLINENEWLINE def export(self, cert, key, type=FILETYPE_PEM, days=100):NEWLINE """NEWLINE export a CRL as a stringNEWLINENEWLINE :param cert: Used to sign CRL.NEWLINE :type cert: :class:`X509`NEWLINENEWLINE :param key: Used to sign CRL.NEWLINE :type key: :class:`PKey`NEWLINENEWLINE :param type: The export format, either :py:data:`FILETYPE_PEM`, :py:data:`FILETYPE_ASN1`, or :py:data:`FILETYPE_TEXT`.NEWLINENEWLINE :param days: The number of days until the next update of this CRL.NEWLINE :type days: :py:data:`int`NEWLINENEWLINE :return: :py:data:`str`NEWLINE """NEWLINE if not isinstance(cert, X509):NEWLINE raise TypeError("cert must be an X509 instance")NEWLINE if not isinstance(key, PKey):NEWLINE raise TypeError("key must be a PKey instance")NEWLINE if not isinstance(type, int):NEWLINE raise TypeError("type must be an integer")NEWLINENEWLINE bio = _lib.BIO_new(_lib.BIO_s_mem())NEWLINE if bio == _ffi.NULL:NEWLINE # TODO: This is untested.NEWLINE _raise_current_error()NEWLINENEWLINE # A scratch time object to give different values to different CRL fieldsNEWLINE sometime = _lib.ASN1_TIME_new()NEWLINE if sometime == _ffi.NULL:NEWLINE # TODO: This is untested.NEWLINE _raise_current_error()NEWLINENEWLINE _lib.X509_gmtime_adj(sometime, 0)NEWLINE _lib.X509_CRL_set_lastUpdate(self._crl, sometime)NEWLINENEWLINE _lib.X509_gmtime_adj(sometime, days * 24 * 60 * 60)NEWLINE _lib.X509_CRL_set_nextUpdate(self._crl, sometime)NEWLINENEWLINE _lib.X509_CRL_set_issuer_name(self._crl, _lib.X509_get_subject_name(cert._x509))NEWLINENEWLINE sign_result = _lib.X509_CRL_sign(self._crl, key._pkey, _lib.EVP_md5())NEWLINE if not sign_result:NEWLINE _raise_current_error()NEWLINENEWLINE if type == FILETYPE_PEM:NEWLINE ret = _lib.PEM_write_bio_X509_CRL(bio, self._crl)NEWLINE elif type == FILETYPE_ASN1:NEWLINE ret = _lib.i2d_X509_CRL_bio(bio, self._crl)NEWLINE elif type == FILETYPE_TEXT:NEWLINE ret = _lib.X509_CRL_print(bio, self._crl)NEWLINE else:NEWLINE raise ValueError(NEWLINE "type argument must be FILETYPE_PEM, FILETYPE_ASN1, or FILETYPE_TEXT")NEWLINENEWLINE if not ret:NEWLINE # TODO: This is untested.NEWLINE _raise_current_error()NEWLINENEWLINE return _bio_to_string(bio)NEWLINECRLType = CRLNEWLINENEWLINENEWLINENEWLINEclass PKCS7(object):NEWLINE def type_is_signed(self):NEWLINE """NEWLINE Check if this NID_pkcs7_signed objectNEWLINENEWLINE :return: True if the PKCS7 is of type signedNEWLINE """NEWLINE if _lib.PKCS7_type_is_signed(self._pkcs7):NEWLINE return TrueNEWLINE return FalseNEWLINENEWLINENEWLINE def type_is_enveloped(self):NEWLINE """NEWLINE Check if this NID_pkcs7_enveloped objectNEWLINENEWLINE :returns: True if the PKCS7 is of type envelopedNEWLINE """NEWLINE if _lib.PKCS7_type_is_enveloped(self._pkcs7):NEWLINE return TrueNEWLINE return FalseNEWLINENEWLINENEWLINE def type_is_signedAndEnveloped(self):NEWLINE """NEWLINE Check if this NID_pkcs7_signedAndEnveloped objectNEWLINENEWLINE :returns: True if the PKCS7 is of type signedAndEnvelopedNEWLINE """NEWLINE if _lib.PKCS7_type_is_signedAndEnveloped(self._pkcs7):NEWLINE return TrueNEWLINE return FalseNEWLINENEWLINENEWLINE def type_is_data(self):NEWLINE """NEWLINE Check if this NID_pkcs7_data objectNEWLINENEWLINE :return: True if the PKCS7 is of type dataNEWLINE """NEWLINE if _lib.PKCS7_type_is_data(self._pkcs7):NEWLINE return TrueNEWLINE return FalseNEWLINENEWLINENEWLINE def get_type_name(self):NEWLINE """NEWLINE Returns the type name of the PKCS7 structureNEWLINENEWLINE :return: A string with the typenameNEWLINE """NEWLINE nid = _lib.OBJ_obj2nid(self._pkcs7.type)NEWLINE string_type = _lib.OBJ_nid2sn(nid)NEWLINE return _ffi.string(string_type)NEWLINENEWLINEPKCS7Type = PKCS7NEWLINENEWLINENEWLINENEWLINEclass PKCS12(object):NEWLINE def __init__(self):NEWLINE self._pkey = NoneNEWLINE self._cert = NoneNEWLINE self._cacerts = NoneNEWLINE self._friendlyname = NoneNEWLINENEWLINENEWLINE def get_certificate(self):NEWLINE """NEWLINE Return certificate portion of the PKCS12 structureNEWLINENEWLINE :return: X509 object containing the certificateNEWLINE """NEWLINE return self._certNEWLINENEWLINENEWLINE def set_certificate(self, cert):NEWLINE """NEWLINE Replace the certificate portion of the PKCS12 structureNEWLINENEWLINE :param cert: The new certificate.NEWLINE :type cert: :py:class:`X509` or :py:data:`None`NEWLINE :return: NoneNEWLINE """NEWLINE if not isinstance(cert, X509):NEWLINE raise TypeError("cert must be an X509 instance")NEWLINE self._cert = certNEWLINENEWLINENEWLINE def get_privatekey(self):NEWLINE """NEWLINE Return private key portion of the PKCS12 structureNEWLINENEWLINE :returns: PKey object containing the private keyNEWLINE """NEWLINE return self._pkeyNEWLINENEWLINENEWLINE def set_privatekey(self, pkey):NEWLINE """NEWLINE Replace or set the certificate portion of the PKCS12 structureNEWLINENEWLINE :param pkey: The new private key.NEWLINE :type pkey: :py:class:`PKey`NEWLINE :return: NoneNEWLINE """NEWLINE if not isinstance(pkey, PKey):NEWLINE raise TypeError("pkey must be a PKey instance")NEWLINE self._pkey = pkeyNEWLINENEWLINENEWLINE def get_ca_certificates(self):NEWLINE """NEWLINE Return CA certificates within of the PKCS12 objectNEWLINENEWLINE :return: A newly created tuple containing the CA certificates in the chain,NEWLINE if any are present, or None if no CA certificates are present.NEWLINE """NEWLINE if self._cacerts is not None:NEWLINE return tuple(self._cacerts)NEWLINENEWLINENEWLINE def set_ca_certificates(self, cacerts):NEWLINE """NEWLINE Replace or set the CA certificates withing the PKCS12 object.NEWLINENEWLINE :param cacerts: The new CA certificates.NEWLINE :type cacerts: :py:data:`None` or an iterable of :py:class:`X509`NEWLINE :return: NoneNEWLINE """NEWLINE if cacerts is None:NEWLINE self._cacerts = NoneNEWLINE else:NEWLINE cacerts = list(cacerts)NEWLINE for cert in cacerts:NEWLINE if not isinstance(cert, X509):NEWLINE raise TypeError("iterable must only contain X509 instances")NEWLINE self._cacerts = cacertsNEWLINENEWLINENEWLINE def set_friendlyname(self, name):NEWLINE """NEWLINE Replace or set the certificate portion of the PKCS12 structureNEWLINENEWLINE :param name: The new friendly name.NEWLINE :type name: :py:class:`bytes`NEWLINE :return: NoneNEWLINE """NEWLINE if name is None:NEWLINE self._friendlyname = NoneNEWLINE elif not isinstance(name, bytes):NEWLINE raise TypeError("name must be a byte string or None (not %r)" % (name,))NEWLINE self._friendlyname = nameNEWLINENEWLINENEWLINE def get_friendlyname(self):NEWLINE """NEWLINE Return friendly name portion of the PKCS12 structureNEWLINENEWLINE :returns: String containing the friendlynameNEWLINE """NEWLINE return self._friendlynameNEWLINENEWLINENEWLINE def export(self, passphrase=None, iter=2048, maciter=1):NEWLINE """NEWLINE Dump a PKCS12 object as a string. See also "man PKCS12_create".NEWLINENEWLINE :param passphrase: used to encrypt the PKCS12NEWLINE :type passphrase: :py:data:`bytes`NEWLINENEWLINE :param iter: How many times to repeat the encryptionNEWLINE :type iter: :py:data:`int`NEWLINENEWLINE :param maciter: How many times to repeat the MACNEWLINE :type maciter: :py:data:`int`NEWLINENEWLINE :return: The string containing the PKCS12NEWLINE """NEWLINE if self._cacerts is None:NEWLINE cacerts = _ffi.NULLNEWLINE else:NEWLINE cacerts = _lib.sk_X509_new_null()NEWLINE cacerts = _ffi.gc(cacerts, _lib.sk_X509_free)NEWLINE for cert in self._cacerts:NEWLINE _lib.sk_X509_push(cacerts, cert._x509)NEWLINENEWLINE if passphrase is None:NEWLINE passphrase = _ffi.NULLNEWLINENEWLINE friendlyname = self._friendlynameNEWLINE if friendlyname is None:NEWLINE friendlyname = _ffi.NULLNEWLINENEWLINE if self._pkey is None:NEWLINE pkey = _ffi.NULLNEWLINE else:NEWLINE pkey = self._pkey._pkeyNEWLINENEWLINE if self._cert is None:NEWLINE cert = _ffi.NULLNEWLINE else:NEWLINE cert = self._cert._x509NEWLINENEWLINE pkcs12 = _lib.PKCS12_create(NEWLINE passphrase, friendlyname, pkey, cert, cacerts,NEWLINE _lib.NID_pbe_WithSHA1And3_Key_TripleDES_CBC,NEWLINE _lib.NID_pbe_WithSHA1And3_Key_TripleDES_CBC,NEWLINE iter, maciter, 0)NEWLINE if pkcs12 == _ffi.NULL:NEWLINE _raise_current_error()NEWLINE pkcs12 = _ffi.gc(pkcs12, _lib.PKCS12_free)NEWLINENEWLINE bio = _new_mem_buf()NEWLINE _lib.i2d_PKCS12_bio(bio, pkcs12)NEWLINE return _bio_to_string(bio)NEWLINENEWLINEPKCS12Type = PKCS12NEWLINENEWLINENEWLINENEWLINEclass NetscapeSPKI(object):NEWLINE def __init__(self):NEWLINE spki = _lib.NETSCAPE_SPKI_new()NEWLINE self._spki = _ffi.gc(spki, _lib.NETSCAPE_SPKI_free)NEWLINENEWLINENEWLINE def sign(self, pkey, digest):NEWLINE """NEWLINE Sign the certificate request using the supplied key and digestNEWLINENEWLINE :param pkey: The key to sign withNEWLINE :param digest: The message digest to useNEWLINE :return: NoneNEWLINE """NEWLINE if pkey._only_public:NEWLINE raise ValueError("Key has only public part")NEWLINENEWLINE if not pkey._initialized:NEWLINE raise ValueError("Key is uninitialized")NEWLINENEWLINE digest_obj = _lib.EVP_get_digestbyname(_byte_string(digest))NEWLINE if digest_obj == _ffi.NULL:NEWLINE raise ValueError("No such digest method")NEWLINENEWLINE sign_result = _lib.NETSCAPE_SPKI_sign(self._spki, pkey._pkey, digest_obj)NEWLINE if not sign_result:NEWLINE # TODO: This is untested.NEWLINE _raise_current_error()NEWLINENEWLINENEWLINE def verify(self, key):NEWLINE """NEWLINE Verifies a certificate request using the supplied public keyNEWLINENEWLINE :param key: a public keyNEWLINE :return: True if the signature is correct.NEWLINE :raise OpenSSL.crypto.Error: If the signature is invalid or there is aNEWLINE problem verifying the signature.NEWLINE """NEWLINE answer = _lib.NETSCAPE_SPKI_verify(self._spki, key._pkey)NEWLINE if answer <= 0:NEWLINE _raise_current_error()NEWLINE return TrueNEWLINENEWLINENEWLINE def b64_encode(self):NEWLINE """NEWLINE Generate a base64 encoded string from an SPKINEWLINENEWLINE :return: The base64 encoded stringNEWLINE """NEWLINE encoded = _lib.NETSCAPE_SPKI_b64_encode(self._spki)NEWLINE result = _ffi.string(encoded)NEWLINE _lib.CRYPTO_free(encoded)NEWLINE return resultNEWLINENEWLINENEWLINE def get_pubkey(self):NEWLINE """NEWLINE Get the public key of the certificateNEWLINENEWLINE :return: The public keyNEWLINE """NEWLINE pkey = PKey.__new__(PKey)NEWLINE pkey._pkey = _lib.NETSCAPE_SPKI_get_pubkey(self._spki)NEWLINE if pkey._pkey == _ffi.NULL:NEWLINE # TODO: This is untested.NEWLINE _raise_current_error()NEWLINE pkey._pkey = _ffi.gc(pkey._pkey, _lib.EVP_PKEY_free)NEWLINE pkey._only_public = TrueNEWLINE return pkeyNEWLINENEWLINENEWLINE def set_pubkey(self, pkey):NEWLINE """NEWLINE Set the public key of the certificateNEWLINENEWLINE :param pkey: The public keyNEWLINE :return: NoneNEWLINE """NEWLINE set_result = _lib.NETSCAPE_SPKI_set_pubkey(self._spki, pkey._pkey)NEWLINE if not set_result:NEWLINE # TODO: This is untested.NEWLINE _raise_current_error()NEWLINENetscapeSPKIType = NetscapeSPKINEWLINENEWLINENEWLINEclass _PassphraseHelper(object):NEWLINE def __init__(self, type, passphrase, more_args=False, truncate=False):NEWLINE if type != FILETYPE_PEM and passphrase is not None:NEWLINE raise ValueError("only FILETYPE_PEM key format supports encryption")NEWLINE self._passphrase = passphraseNEWLINE self._more_args = more_argsNEWLINE self._truncate = truncateNEWLINE self._problems = []NEWLINENEWLINENEWLINE @propertyNEWLINE def callback(self):NEWLINE if self._passphrase is None:NEWLINE return _ffi.NULLNEWLINE elif isinstance(self._passphrase, bytes):NEWLINE return _ffi.NULLNEWLINE elif callable(self._passphrase):NEWLINE return _ffi.callback("pem_password_cb", self._read_passphrase)NEWLINE else:NEWLINE raise TypeError("Last argument must be string or callable")NEWLINENEWLINENEWLINE @propertyNEWLINE def callback_args(self):NEWLINE if self._passphrase is None:NEWLINE return _ffi.NULLNEWLINE elif isinstance(self._passphrase, bytes):NEWLINE return self._passphraseNEWLINE elif callable(self._passphrase):NEWLINE return _ffi.NULLNEWLINE else:NEWLINE raise TypeError("Last argument must be string or callable")NEWLINENEWLINENEWLINE def raise_if_problem(self, exceptionType=Error):NEWLINE try:NEWLINE _exception_from_error_queue(exceptionType)NEWLINE except exceptionType as e:NEWLINE from_queue = eNEWLINE if self._problems:NEWLINE raise self._problems[0]NEWLINE return from_queueNEWLINENEWLINENEWLINE def _read_passphrase(self, buf, size, rwflag, userdata):NEWLINE try:NEWLINE if self._more_args:NEWLINE result = self._passphrase(size, rwflag, userdata)NEWLINE else:NEWLINE result = self._passphrase(rwflag)NEWLINE if not isinstance(result, bytes):NEWLINE raise ValueError("String expected")NEWLINE if len(result) > size:NEWLINE if self._truncate:NEWLINE result = result[:size]NEWLINE else:NEWLINE raise ValueError("passphrase returned by callback is too long")NEWLINE for i in range(len(result)):NEWLINE buf[i] = result[i:i + 1]NEWLINE return len(result)NEWLINE except Exception as e:NEWLINE self._problems.append(e)NEWLINE return 0NEWLINENEWLINENEWLINENEWLINEdef load_privatekey(type, buffer, passphrase=None):NEWLINE """NEWLINE Load a private key from a bufferNEWLINENEWLINE :param type: The file type (one of FILETYPE_PEM, FILETYPE_ASN1)NEWLINE :param buffer: The buffer the key is stored inNEWLINE :param passphrase: (optional) if encrypted PEM format, this can beNEWLINE either the passphrase to use, or a callback forNEWLINE providing the passphrase.NEWLINENEWLINE :return: The PKey objectNEWLINE """NEWLINE if isinstance(buffer, _text_type):NEWLINE buffer = buffer.encode("ascii")NEWLINENEWLINE bio = _new_mem_buf(buffer)NEWLINENEWLINE helper = _PassphraseHelper(type, passphrase)NEWLINE if type == FILETYPE_PEM:NEWLINE evp_pkey = _lib.PEM_read_bio_PrivateKey(NEWLINE bio, _ffi.NULL, helper.callback, helper.callback_args)NEWLINE helper.raise_if_problem()NEWLINE elif type == FILETYPE_ASN1:NEWLINE evp_pkey = _lib.d2i_PrivateKey_bio(bio, _ffi.NULL)NEWLINE else:NEWLINE raise ValueError("type argument must be FILETYPE_PEM or FILETYPE_ASN1")NEWLINENEWLINE if evp_pkey == _ffi.NULL:NEWLINE _raise_current_error()NEWLINENEWLINE pkey = PKey.__new__(PKey)NEWLINE pkey._pkey = _ffi.gc(evp_pkey, _lib.EVP_PKEY_free)NEWLINE return pkeyNEWLINENEWLINENEWLINENEWLINEdef dump_certificate_request(type, req):NEWLINE """NEWLINE Dump a certificate request to a bufferNEWLINENEWLINE :param type: The file type (one of FILETYPE_PEM, FILETYPE_ASN1)NEWLINE :param req: The certificate request to dumpNEWLINE :return: The buffer with the dumped certificate request inNEWLINE """NEWLINE bio = _new_mem_buf()NEWLINENEWLINE if type == FILETYPE_PEM:NEWLINE result_code = _lib.PEM_write_bio_X509_REQ(bio, req._req)NEWLINE elif type == FILETYPE_ASN1:NEWLINE result_code = _lib.i2d_X509_REQ_bio(bio, req._req)NEWLINE elif type == FILETYPE_TEXT:NEWLINE result_code = _lib.X509_REQ_print_ex(bio, req._req, 0, 0)NEWLINE else:NEWLINE raise ValueError("type argument must be FILETYPE_PEM, FILETYPE_ASN1, or FILETYPE_TEXT")NEWLINENEWLINE if result_code == 0:NEWLINE # TODO: This is untested.NEWLINE _raise_current_error()NEWLINENEWLINE return _bio_to_string(bio)NEWLINENEWLINENEWLINENEWLINEdef load_certificate_request(type, buffer):NEWLINE """NEWLINE Load a certificate request from a bufferNEWLINENEWLINE :param type: The file type (one of FILETYPE_PEM, FILETYPE_ASN1)NEWLINE :param buffer: The buffer the certificate request is stored inNEWLINE :return: The X509Req objectNEWLINE """NEWLINE if isinstance(buffer, _text_type):NEWLINE buffer = buffer.encode("ascii")NEWLINENEWLINE bio = _new_mem_buf(buffer)NEWLINENEWLINE if type == FILETYPE_PEM:NEWLINE req = _lib.PEM_read_bio_X509_REQ(bio, _ffi.NULL, _ffi.NULL, _ffi.NULL)NEWLINE elif type == FILETYPE_ASN1:NEWLINE req = _lib.d2i_X509_REQ_bio(bio, _ffi.NULL)NEWLINE else:NEWLINE raise ValueError("type argument must be FILETYPE_PEM or FILETYPE_ASN1")NEWLINENEWLINE if req == _ffi.NULL:NEWLINE # TODO: This is untested.NEWLINE _raise_current_error()NEWLINENEWLINE x509req = X509Req.__new__(X509Req)NEWLINE x509req._req = _ffi.gc(req, _lib.X509_REQ_free)NEWLINE return x509reqNEWLINENEWLINENEWLINENEWLINEdef sign(pkey, data, digest):NEWLINE """NEWLINE Sign data with a digestNEWLINENEWLINE :param pkey: Pkey to sign withNEWLINE :param data: data to be signedNEWLINE :param digest: message digest to useNEWLINE :return: signatureNEWLINE """NEWLINE digest_obj = _lib.EVP_get_digestbyname(_byte_string(digest))NEWLINE if digest_obj == _ffi.NULL:NEWLINE raise ValueError("No such digest method")NEWLINENEWLINE md_ctx = _ffi.new("EVP_MD_CTX*")NEWLINE md_ctx = _ffi.gc(md_ctx, _lib.EVP_MD_CTX_cleanup)NEWLINENEWLINE _lib.EVP_SignInit(md_ctx, digest_obj)NEWLINE _lib.EVP_SignUpdate(md_ctx, data, len(data))NEWLINENEWLINE signature_buffer = _ffi.new("unsigned char[]", 512)NEWLINE signature_length = _ffi.new("unsigned int*")NEWLINE signature_length[0] = len(signature_buffer)NEWLINE final_result = _lib.EVP_SignFinal(NEWLINE md_ctx, signature_buffer, signature_length, pkey._pkey)NEWLINENEWLINE if final_result != 1:NEWLINE # TODO: This is untested.NEWLINE _raise_current_error()NEWLINENEWLINE return _ffi.buffer(signature_buffer, signature_length[0])[:]NEWLINENEWLINENEWLINENEWLINEdef verify(cert, signature, data, digest):NEWLINE """NEWLINE Verify a signatureNEWLINENEWLINE :param cert: signing certificate (X509 object)NEWLINE :param signature: signature returned by sign functionNEWLINE :param data: data to be verifiedNEWLINE :param digest: message digest to useNEWLINE :return: None if the signature is correct, raise exception otherwiseNEWLINE """NEWLINE digest_obj = _lib.EVP_get_digestbyname(_byte_string(digest))NEWLINE if digest_obj == _ffi.NULL:NEWLINE raise ValueError("No such digest method")NEWLINENEWLINE pkey = _lib.X509_get_pubkey(cert._x509)NEWLINE if pkey == _ffi.NULL:NEWLINE # TODO: This is untested.NEWLINE _raise_current_error()NEWLINE pkey = _ffi.gc(pkey, _lib.EVP_PKEY_free)NEWLINENEWLINE md_ctx = _ffi.new("EVP_MD_CTX*")NEWLINE md_ctx = _ffi.gc(md_ctx, _lib.EVP_MD_CTX_cleanup)NEWLINENEWLINE _lib.EVP_VerifyInit(md_ctx, digest_obj)NEWLINE _lib.EVP_VerifyUpdate(md_ctx, data, len(data))NEWLINE verify_result = _lib.EVP_VerifyFinal(md_ctx, signature, len(signature), pkey)NEWLINENEWLINE if verify_result != 1:NEWLINE _raise_current_error()NEWLINENEWLINENEWLINENEWLINEdef load_crl(type, buffer):NEWLINE """NEWLINE Load a certificate revocation list from a bufferNEWLINENEWLINE :param type: The file type (one of FILETYPE_PEM, FILETYPE_ASN1)NEWLINE :param buffer: The buffer the CRL is stored inNEWLINENEWLINE :return: The PKey objectNEWLINE """NEWLINE if isinstance(buffer, _text_type):NEWLINE buffer = buffer.encode("ascii")NEWLINENEWLINE bio = _new_mem_buf(buffer)NEWLINENEWLINE if type == FILETYPE_PEM:NEWLINE crl = _lib.PEM_read_bio_X509_CRL(bio, _ffi.NULL, _ffi.NULL, _ffi.NULL)NEWLINE elif type == FILETYPE_ASN1:NEWLINE crl = _lib.d2i_X509_CRL_bio(bio, _ffi.NULL)NEWLINE else:NEWLINE raise ValueError("type argument must be FILETYPE_PEM or FILETYPE_ASN1")NEWLINENEWLINE if crl == _ffi.NULL:NEWLINE _raise_current_error()NEWLINENEWLINE result = CRL.__new__(CRL)NEWLINE result._crl = crlNEWLINE return resultNEWLINENEWLINENEWLINENEWLINEdef load_pkcs7_data(type, buffer):NEWLINE """NEWLINE Load pkcs7 data from a bufferNEWLINENEWLINE :param type: The file type (one of FILETYPE_PEM or FILETYPE_ASN1)NEWLINE :param buffer: The buffer with the pkcs7 data.NEWLINE :return: The PKCS7 objectNEWLINE """NEWLINE if isinstance(buffer, _text_type):NEWLINE buffer = buffer.encode("ascii")NEWLINENEWLINE bio = _new_mem_buf(buffer)NEWLINENEWLINE if type == FILETYPE_PEM:NEWLINE pkcs7 = _lib.PEM_read_bio_PKCS7(bio, _ffi.NULL, _ffi.NULL, _ffi.NULL)NEWLINE elif type == FILETYPE_ASN1:NEWLINE passNEWLINE else:NEWLINE # TODO: This is untested.NEWLINE _raise_current_error()NEWLINE raise ValueError("type argument must be FILETYPE_PEM or FILETYPE_ASN1")NEWLINENEWLINE if pkcs7 == _ffi.NULL:NEWLINE _raise_current_error()NEWLINENEWLINE pypkcs7 = PKCS7.__new__(PKCS7)NEWLINE pypkcs7._pkcs7 = _ffi.gc(pkcs7, _lib.PKCS7_free)NEWLINE return pypkcs7NEWLINENEWLINENEWLINENEWLINEdef load_pkcs12(buffer, passphrase):NEWLINE """NEWLINE Load a PKCS12 object from a bufferNEWLINENEWLINE :param buffer: The buffer the certificate is stored inNEWLINE :param passphrase: (Optional) The password to decrypt the PKCS12 lumpNEWLINE :returns: The PKCS12 objectNEWLINE """NEWLINE if isinstance(buffer, _text_type):NEWLINE buffer = buffer.encode("ascii")NEWLINENEWLINE bio = _new_mem_buf(buffer)NEWLINENEWLINE p12 = _lib.d2i_PKCS12_bio(bio, _ffi.NULL)NEWLINE if p12 == _ffi.NULL:NEWLINE _raise_current_error()NEWLINE p12 = _ffi.gc(p12, _lib.PKCS12_free)NEWLINENEWLINE pkey = _ffi.new("EVP_PKEY**")NEWLINE cert = _ffi.new("X509**")NEWLINE cacerts = _ffi.new("Cryptography_STACK_OF_X509**")NEWLINENEWLINE parse_result = _lib.PKCS12_parse(p12, passphrase, pkey, cert, cacerts)NEWLINE if not parse_result:NEWLINE _raise_current_error()NEWLINENEWLINE cacerts = _ffi.gc(cacerts[0], _lib.sk_X509_free)NEWLINENEWLINE # openssl 1.0.0 sometimes leaves an X509_check_private_key error in theNEWLINE # queue for no particular reason. This error isn't interesting to anyoneNEWLINE # outside this function. It's not even interesting to us. Get rid of it.NEWLINE try:NEWLINE _raise_current_error()NEWLINE except Error:NEWLINE passNEWLINENEWLINE if pkey[0] == _ffi.NULL:NEWLINE pykey = NoneNEWLINE else:NEWLINE pykey = PKey.__new__(PKey)NEWLINE pykey._pkey = _ffi.gc(pkey[0], _lib.EVP_PKEY_free)NEWLINENEWLINE if cert[0] == _ffi.NULL:NEWLINE pycert = NoneNEWLINE friendlyname = NoneNEWLINE else:NEWLINE pycert = X509.__new__(X509)NEWLINE pycert._x509 = _ffi.gc(cert[0], _lib.X509_free)NEWLINENEWLINE friendlyname_length = _ffi.new("int*")NEWLINE friendlyname_buffer = _lib.X509_alias_get0(cert[0], friendlyname_length)NEWLINE friendlyname = _ffi.buffer(friendlyname_buffer, friendlyname_length[0])[:]NEWLINE if friendlyname_buffer == _ffi.NULL:NEWLINE friendlyname = NoneNEWLINENEWLINE pycacerts = []NEWLINE for i in range(_lib.sk_X509_num(cacerts)):NEWLINE pycacert = X509.__new__(X509)NEWLINE pycacert._x509 = _lib.sk_X509_value(cacerts, i)NEWLINE pycacerts.append(pycacert)NEWLINE if not pycacerts:NEWLINE pycacerts = NoneNEWLINENEWLINE pkcs12 = PKCS12.__new__(PKCS12)NEWLINE pkcs12._pkey = pykeyNEWLINE pkcs12._cert = pycertNEWLINE pkcs12._cacerts = pycacertsNEWLINE pkcs12._friendlyname = friendlynameNEWLINE return pkcs12NEWLINENEWLINENEWLINEdef _initialize_openssl_threads(get_ident, Lock):NEWLINE import _sslNEWLINE returnNEWLINENEWLINE locks = list(Lock() for n in range(_lib.CRYPTO_num_locks()))NEWLINENEWLINE def locking_function(mode, index, filename, line):NEWLINE if mode & _lib.CRYPTO_LOCK:NEWLINE locks[index].acquire()NEWLINE else:NEWLINE locks[index].release()NEWLINENEWLINE _lib.CRYPTO_set_id_callback(NEWLINE _ffi.callback("unsigned long (*)(void)", get_ident))NEWLINENEWLINE _lib.CRYPTO_set_locking_callback(NEWLINE _ffi.callback(NEWLINE "void (*)(int, int, const char*, int)", locking_function))NEWLINENEWLINENEWLINEtry:NEWLINE from thread import get_identNEWLINE from threading import LockNEWLINEexcept ImportError:NEWLINE passNEWLINEelse:NEWLINE _initialize_openssl_threads(get_ident, Lock)NEWLINE del get_ident, LockNEWLINENEWLINE# There are no direct unit tests for this initialization. It is testedNEWLINE# indirectly since it is necessary for functions like dump_privatekey whenNEWLINE# using encryption.NEWLINE#NEWLINE# Thus OpenSSL.test.test_crypto.FunctionTests.test_dump_privatekey_passphraseNEWLINE# and some other similar tests may fail without this (though they may not ifNEWLINE# the Python runtime has already done some initialization of the underlyingNEWLINE# OpenSSL library (and is linked against the same one that cryptography isNEWLINE# using)).NEWLINE_lib.OpenSSL_add_all_algorithms()NEWLINENEWLINE# This is similar but exercised mainly by exception_from_error_queue. It callsNEWLINE# both ERR_load_crypto_strings() and ERR_load_SSL_strings().NEWLINE_lib.SSL_load_error_strings()NEWLINE |
begin_unitNEWLINEcomment|'# Copyright 2011 Eldar Nugaev'NEWLINEnl|'\n'NEWLINEcomment|'# All Rights Reserved.'NEWLINEnl|'\n'NEWLINEcomment|'#'NEWLINEnl|'\n'NEWLINEcomment|'# Licensed under the Apache License, Version 2.0 (the "License"); you may'NEWLINEnl|'\n'NEWLINEcomment|'# not use this file except in compliance with the License. You may obtain'NEWLINEnl|'\n'NEWLINEcomment|'# a copy of the License at'NEWLINEnl|'\n'NEWLINEcomment|'#'NEWLINEnl|'\n'NEWLINEcomment|'# http://www.apache.org/licenses/LICENSE-2.0'NEWLINEnl|'\n'NEWLINEcomment|'#'NEWLINEnl|'\n'NEWLINEcomment|'# Unless required by applicable law or agreed to in writing, software'NEWLINEnl|'\n'NEWLINEcomment|'# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT'NEWLINEnl|'\n'NEWLINEcomment|'# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the'NEWLINEnl|'\n'NEWLINEcomment|'# License for the specific language governing permissions and limitations'NEWLINEnl|'\n'NEWLINEcomment|'# under the License.'NEWLINEnl|'\n'NEWLINEnl|'\n'NEWLINEname|'import'NEWLINEname|'string'NEWLINEnewline|'\n'NEWLINEnl|'\n'NEWLINEname|'import'NEWLINEname|'mock'NEWLINEnewline|'\n'NEWLINEname|'import'NEWLINEname|'webob'NEWLINEnewline|'\n'NEWLINEnl|'\n'NEWLINEname|'from'NEWLINEname|'nova'NEWLINEop|'.'NEWLINEname|'api'NEWLINEop|'.'NEWLINEname|'openstack'NEWLINEop|'.'NEWLINEname|'compute'NEWLINEname|'import'NEWLINEname|'console_output'NEWLINEname|'as'NEWLINEname|'console_output_v21'NEWLINEnewline|'\n'NEWLINEname|'from'NEWLINEname|'nova'NEWLINEop|'.'NEWLINEname|'compute'NEWLINEname|'import'NEWLINEname|'api'NEWLINEname|'as'NEWLINEname|'compute_api'NEWLINEnewline|'\n'NEWLINEname|'from'NEWLINEname|'nova'NEWLINEname|'import'NEWLINEname|'exception'NEWLINEnewline|'\n'NEWLINEname|'from'NEWLINEname|'nova'NEWLINEname|'import'NEWLINEname|'test'NEWLINEnewline|'\n'NEWLINEname|'from'NEWLINEname|'nova'NEWLINEop|'.'NEWLINEname|'tests'NEWLINEop|'.'NEWLINEname|'unit'NEWLINEop|'.'NEWLINEname|'api'NEWLINEop|'.'NEWLINEname|'openstack'NEWLINEname|'import'NEWLINEname|'fakes'NEWLINEnewline|'\n'NEWLINEname|'from'NEWLINEname|'nova'NEWLINEop|'.'NEWLINEname|'tests'NEWLINEop|'.'NEWLINEname|'unit'NEWLINEname|'import'NEWLINEname|'fake_instance'NEWLINEnewline|'\n'NEWLINEnl|'\n'NEWLINEnl|'\n'NEWLINEDECL|function|fake_get_console_outputNEWLINEname|'def'NEWLINEname|'fake_get_console_output'NEWLINEop|'('NEWLINEname|'self'NEWLINEop|','NEWLINEname|'_context'NEWLINEop|','NEWLINEname|'_instance'NEWLINEop|','NEWLINEname|'tail_length'NEWLINEop|')'NEWLINEop|':'NEWLINEnewline|'\n'NEWLINEindent|' 'NEWLINEname|'fixture'NEWLINEop|'='NEWLINEop|'['NEWLINEname|'str'NEWLINEop|'('NEWLINEname|'i'NEWLINEop|')'NEWLINEname|'for'NEWLINEname|'i'NEWLINEname|'in'NEWLINEname|'range'NEWLINEop|'('NEWLINEnumber|'5'NEWLINEop|')'NEWLINEop|']'NEWLINEnewline|'\n'NEWLINEnl|'\n'NEWLINEname|'if'NEWLINEname|'tail_length'NEWLINEname|'is'NEWLINEname|'None'NEWLINEop|':'NEWLINEnewline|'\n'NEWLINEindent|' 'NEWLINEname|'pass'NEWLINEnewline|'\n'NEWLINEdedent|''NEWLINEname|'elif'NEWLINEname|'tail_length'NEWLINEop|'=='NEWLINEnumber|'0'NEWLINEop|':'NEWLINEnewline|'\n'NEWLINEindent|' 'NEWLINEname|'fixture'NEWLINEop|'='NEWLINEop|'['NEWLINEop|']'NEWLINEnewline|'\n'NEWLINEdedent|''NEWLINEname|'else'NEWLINEop|':'NEWLINEnewline|'\n'NEWLINEindent|' 'NEWLINEname|'fixture'NEWLINEop|'='NEWLINEname|'fixture'NEWLINEop|'['NEWLINEop|'-'NEWLINEname|'int'NEWLINEop|'('NEWLINEname|'tail_length'NEWLINEop|')'NEWLINEop|':'NEWLINEop|']'NEWLINEnewline|'\n'NEWLINEnl|'\n'NEWLINEdedent|''NEWLINEname|'return'NEWLINEstring|"'\\n'"NEWLINEop|'.'NEWLINEname|'join'NEWLINEop|'('NEWLINEname|'fixture'NEWLINEop|')'NEWLINEnewline|'\n'NEWLINEnl|'\n'NEWLINEnl|'\n'NEWLINEDECL|function|fake_get_console_output_not_readyNEWLINEdedent|''NEWLINEname|'def'NEWLINEname|'fake_get_console_output_not_ready'NEWLINEop|'('NEWLINEname|'self'NEWLINEop|','NEWLINEname|'_context'NEWLINEop|','NEWLINEname|'_instance'NEWLINEop|','NEWLINEname|'tail_length'NEWLINEop|')'NEWLINEop|':'NEWLINEnewline|'\n'NEWLINEindent|' 'NEWLINEname|'raise'NEWLINEname|'exception'NEWLINEop|'.'NEWLINEname|'InstanceNotReady'NEWLINEop|'('NEWLINEname|'instance_id'NEWLINEop|'='NEWLINEname|'_instance'NEWLINEop|'['NEWLINEstring|'"uuid"'NEWLINEop|']'NEWLINEop|')'NEWLINEnewline|'\n'NEWLINEnl|'\n'NEWLINEnl|'\n'NEWLINEDECL|function|fake_get_console_output_all_charactersNEWLINEdedent|''NEWLINEname|'def'NEWLINEname|'fake_get_console_output_all_characters'NEWLINEop|'('NEWLINEname|'self'NEWLINEop|','NEWLINEname|'_ctx'NEWLINEop|','NEWLINEname|'_instance'NEWLINEop|','NEWLINEname|'_tail_len'NEWLINEop|')'NEWLINEop|':'NEWLINEnewline|'\n'NEWLINEindent|' 'NEWLINEname|'return'NEWLINEname|'string'NEWLINEop|'.'NEWLINEname|'printable'NEWLINEnewline|'\n'NEWLINEnl|'\n'NEWLINEnl|'\n'NEWLINEDECL|function|fake_getNEWLINEdedent|''NEWLINEname|'def'NEWLINEname|'fake_get'NEWLINEop|'('NEWLINEname|'self'NEWLINEop|','NEWLINEname|'context'NEWLINEop|','NEWLINEname|'instance_uuid'NEWLINEop|','NEWLINEname|'want_objects'NEWLINEop|'='NEWLINEname|'False'NEWLINEop|','NEWLINEnl|'\n'NEWLINEname|'expected_attrs'NEWLINEop|'='NEWLINEname|'None'NEWLINEop|')'NEWLINEop|':'NEWLINEnewline|'\n'NEWLINEindent|' 'NEWLINEname|'return'NEWLINEname|'fake_instance'NEWLINEop|'.'NEWLINEname|'fake_instance_obj'NEWLINEop|'('NEWLINEname|'context'NEWLINEop|','NEWLINEop|'**'NEWLINEop|'{'NEWLINEstring|"'uuid'"NEWLINEop|':'NEWLINEname|'instance_uuid'NEWLINEop|'}'NEWLINEop|')'NEWLINEnewline|'\n'NEWLINEnl|'\n'NEWLINEnl|'\n'NEWLINEDECL|function|fake_get_not_foundNEWLINEdedent|''NEWLINEname|'def'NEWLINEname|'fake_get_not_found'NEWLINEop|'('NEWLINEop|'*'NEWLINEname|'args'NEWLINEop|','NEWLINEop|'**'NEWLINEname|'kwargs'NEWLINEop|')'NEWLINEop|':'NEWLINEnewline|'\n'NEWLINEindent|' 'NEWLINEname|'raise'NEWLINEname|'exception'NEWLINEop|'.'NEWLINEname|'InstanceNotFound'NEWLINEop|'('NEWLINEname|'instance_id'NEWLINEop|'='NEWLINEstring|"'fake'"NEWLINEop|')'NEWLINEnewline|'\n'NEWLINEnl|'\n'NEWLINEnl|'\n'NEWLINEDECL|class|ConsoleOutputExtensionTestV21NEWLINEdedent|''NEWLINEname|'class'NEWLINEname|'ConsoleOutputExtensionTestV21'NEWLINEop|'('NEWLINEname|'test'NEWLINEop|'.'NEWLINEname|'NoDBTestCase'NEWLINEop|')'NEWLINEop|':'NEWLINEnewline|'\n'NEWLINEDECL|variable|controller_classNEWLINEindent|' 'NEWLINEname|'controller_class'NEWLINEop|'='NEWLINEname|'console_output_v21'NEWLINEnewline|'\n'NEWLINEDECL|variable|validation_errorNEWLINEname|'validation_error'NEWLINEop|'='NEWLINEname|'exception'NEWLINEop|'.'NEWLINEname|'ValidationError'NEWLINEnewline|'\n'NEWLINEnl|'\n'NEWLINEDECL|member|setUpNEWLINEname|'def'NEWLINEname|'setUp'NEWLINEop|'('NEWLINEname|'self'NEWLINEop|')'NEWLINEop|':'NEWLINEnewline|'\n'NEWLINEindent|' 'NEWLINEname|'super'NEWLINEop|'('NEWLINEname|'ConsoleOutputExtensionTestV21'NEWLINEop|','NEWLINEname|'self'NEWLINEop|')'NEWLINEop|'.'NEWLINEname|'setUp'NEWLINEop|'('NEWLINEop|')'NEWLINEnewline|'\n'NEWLINEname|'self'NEWLINEop|'.'NEWLINEname|'stubs'NEWLINEop|'.'NEWLINEname|'Set'NEWLINEop|'('NEWLINEname|'compute_api'NEWLINEop|'.'NEWLINEname|'API'NEWLINEop|','NEWLINEstring|"'get_console_output'"NEWLINEop|','NEWLINEnl|'\n'NEWLINEname|'fake_get_console_output'NEWLINEop|')'NEWLINEnewline|'\n'NEWLINEname|'self'NEWLINEop|'.'NEWLINEname|'stubs'NEWLINEop|'.'NEWLINEname|'Set'NEWLINEop|'('NEWLINEname|'compute_api'NEWLINEop|'.'NEWLINEname|'API'NEWLINEop|','NEWLINEstring|"'get'"NEWLINEop|','NEWLINEname|'fake_get'NEWLINEop|')'NEWLINEnewline|'\n'NEWLINEname|'self'NEWLINEop|'.'NEWLINEname|'controller'NEWLINEop|'='NEWLINEname|'self'NEWLINEop|'.'NEWLINEname|'controller_class'NEWLINEop|'.'NEWLINEname|'ConsoleOutputController'NEWLINEop|'('NEWLINEop|')'NEWLINEnewline|'\n'NEWLINEname|'self'NEWLINEop|'.'NEWLINEname|'req'NEWLINEop|'='NEWLINEname|'fakes'NEWLINEop|'.'NEWLINEname|'HTTPRequest'NEWLINEop|'.'NEWLINEname|'blank'NEWLINEop|'('NEWLINEstring|"''"NEWLINEop|')'NEWLINEnewline|'\n'NEWLINEnl|'\n'NEWLINEDECL|member|_get_console_outputNEWLINEdedent|''NEWLINEname|'def'NEWLINEname|'_get_console_output'NEWLINEop|'('NEWLINEname|'self'NEWLINEop|','NEWLINEname|'length_dict'NEWLINEop|'='NEWLINEname|'None'NEWLINEop|')'NEWLINEop|':'NEWLINEnewline|'\n'NEWLINEindent|' 'NEWLINEname|'length_dict'NEWLINEop|'='NEWLINEname|'length_dict'NEWLINEname|'or'NEWLINEop|'{'NEWLINEop|'}'NEWLINEnewline|'\n'NEWLINEname|'body'NEWLINEop|'='NEWLINEop|'{'NEWLINEstring|"'os-getConsoleOutput'"NEWLINEop|':'NEWLINEname|'length_dict'NEWLINEop|'}'NEWLINEnewline|'\n'NEWLINEname|'return'NEWLINEname|'self'NEWLINEop|'.'NEWLINEname|'controller'NEWLINEop|'.'NEWLINEname|'get_console_output'NEWLINEop|'('NEWLINEname|'self'NEWLINEop|'.'NEWLINEname|'req'NEWLINEop|','NEWLINEname|'fakes'NEWLINEop|'.'NEWLINEname|'FAKE_UUID'NEWLINEop|','NEWLINEnl|'\n'NEWLINEname|'body'NEWLINEop|'='NEWLINEname|'body'NEWLINEop|')'NEWLINEnewline|'\n'NEWLINEnl|'\n'NEWLINEDECL|member|_check_console_output_failureNEWLINEdedent|''NEWLINEname|'def'NEWLINEname|'_check_console_output_failure'NEWLINEop|'('NEWLINEname|'self'NEWLINEop|','NEWLINEname|'exception'NEWLINEop|','NEWLINEname|'body'NEWLINEop|')'NEWLINEop|':'NEWLINEnewline|'\n'NEWLINEindent|' 'NEWLINEname|'self'NEWLINEop|'.'NEWLINEname|'assertRaises'NEWLINEop|'('NEWLINEname|'exception'NEWLINEop|','NEWLINEnl|'\n'NEWLINEname|'self'NEWLINEop|'.'NEWLINEname|'controller'NEWLINEop|'.'NEWLINEname|'get_console_output'NEWLINEop|','NEWLINEnl|'\n'NEWLINEname|'self'NEWLINEop|'.'NEWLINEname|'req'NEWLINEop|','NEWLINEname|'fakes'NEWLINEop|'.'NEWLINEname|'FAKE_UUID'NEWLINEop|','NEWLINEname|'body'NEWLINEop|'='NEWLINEname|'body'NEWLINEop|')'NEWLINEnewline|'\n'NEWLINEnl|'\n'NEWLINEDECL|member|test_get_text_console_instance_actionNEWLINEdedent|''NEWLINEname|'def'NEWLINEname|'test_get_text_console_instance_action'NEWLINEop|'('NEWLINEname|'self'NEWLINEop|')'NEWLINEop|':'NEWLINEnewline|'\n'NEWLINEindent|' 'NEWLINEname|'output'NEWLINEop|'='NEWLINEname|'self'NEWLINEop|'.'NEWLINEname|'_get_console_output'NEWLINEop|'('NEWLINEop|')'NEWLINEnewline|'\n'NEWLINEname|'self'NEWLINEop|'.'NEWLINEname|'assertEqual'NEWLINEop|'('NEWLINEop|'{'NEWLINEstring|"'output'"NEWLINEop|':'NEWLINEstring|"'0\\n1\\n2\\n3\\n4'"NEWLINEop|'}'NEWLINEop|','NEWLINEname|'output'NEWLINEop|')'NEWLINEnewline|'\n'NEWLINEnl|'\n'NEWLINEDECL|member|test_get_console_output_with_tailNEWLINEdedent|''NEWLINEname|'def'NEWLINEname|'test_get_console_output_with_tail'NEWLINEop|'('NEWLINEname|'self'NEWLINEop|')'NEWLINEop|':'NEWLINEnewline|'\n'NEWLINEindent|' 'NEWLINEname|'output'NEWLINEop|'='NEWLINEname|'self'NEWLINEop|'.'NEWLINEname|'_get_console_output'NEWLINEop|'('NEWLINEname|'length_dict'NEWLINEop|'='NEWLINEop|'{'NEWLINEstring|"'length'"NEWLINEop|':'NEWLINEnumber|'3'NEWLINEop|'}'NEWLINEop|')'NEWLINEnewline|'\n'NEWLINEname|'self'NEWLINEop|'.'NEWLINEname|'assertEqual'NEWLINEop|'('NEWLINEop|'{'NEWLINEstring|"'output'"NEWLINEop|':'NEWLINEstring|"'2\\n3\\n4'"NEWLINEop|'}'NEWLINEop|','NEWLINEname|'output'NEWLINEop|')'NEWLINEnewline|'\n'NEWLINEnl|'\n'NEWLINEDECL|member|test_get_console_output_with_none_lengthNEWLINEdedent|''NEWLINEname|'def'NEWLINEname|'test_get_console_output_with_none_length'NEWLINEop|'('NEWLINEname|'self'NEWLINEop|')'NEWLINEop|':'NEWLINEnewline|'\n'NEWLINEindent|' 'NEWLINEname|'output'NEWLINEop|'='NEWLINEname|'self'NEWLINEop|'.'NEWLINEname|'_get_console_output'NEWLINEop|'('NEWLINEname|'length_dict'NEWLINEop|'='NEWLINEop|'{'NEWLINEstring|"'length'"NEWLINEop|':'NEWLINEname|'None'NEWLINEop|'}'NEWLINEop|')'NEWLINEnewline|'\n'NEWLINEname|'self'NEWLINEop|'.'NEWLINEname|'assertEqual'NEWLINEop|'('NEWLINEop|'{'NEWLINEstring|"'output'"NEWLINEop|':'NEWLINEstring|"'0\\n1\\n2\\n3\\n4'"NEWLINEop|'}'NEWLINEop|','NEWLINEname|'output'NEWLINEop|')'NEWLINEnewline|'\n'NEWLINEnl|'\n'NEWLINEDECL|member|test_get_console_output_with_length_as_strNEWLINEdedent|''NEWLINEname|'def'NEWLINEname|'test_get_console_output_with_length_as_str'NEWLINEop|'('NEWLINEname|'self'NEWLINEop|')'NEWLINEop|':'NEWLINEnewline|'\n'NEWLINEindent|' 'NEWLINEname|'output'NEWLINEop|'='NEWLINEname|'self'NEWLINEop|'.'NEWLINEname|'_get_console_output'NEWLINEop|'('NEWLINEname|'length_dict'NEWLINEop|'='NEWLINEop|'{'NEWLINEstring|"'length'"NEWLINEop|':'NEWLINEstring|"'3'"NEWLINEop|'}'NEWLINEop|')'NEWLINEnewline|'\n'NEWLINEname|'self'NEWLINEop|'.'NEWLINEname|'assertEqual'NEWLINEop|'('NEWLINEop|'{'NEWLINEstring|"'output'"NEWLINEop|':'NEWLINEstring|"'2\\n3\\n4'"NEWLINEop|'}'NEWLINEop|','NEWLINEname|'output'NEWLINEop|')'NEWLINEnewline|'\n'NEWLINEnl|'\n'NEWLINEDECL|member|test_get_console_output_filtered_charactersNEWLINEdedent|''NEWLINEname|'def'NEWLINEname|'test_get_console_output_filtered_characters'NEWLINEop|'('NEWLINEname|'self'NEWLINEop|')'NEWLINEop|':'NEWLINEnewline|'\n'NEWLINEindent|' 'NEWLINEname|'self'NEWLINEop|'.'NEWLINEname|'stubs'NEWLINEop|'.'NEWLINEname|'Set'NEWLINEop|'('NEWLINEname|'compute_api'NEWLINEop|'.'NEWLINEname|'API'NEWLINEop|','NEWLINEstring|"'get_console_output'"NEWLINEop|','NEWLINEnl|'\n'NEWLINEname|'fake_get_console_output_all_characters'NEWLINEop|')'NEWLINEnewline|'\n'NEWLINEname|'output'NEWLINEop|'='NEWLINEname|'self'NEWLINEop|'.'NEWLINEname|'_get_console_output'NEWLINEop|'('NEWLINEop|')'NEWLINEnewline|'\n'NEWLINEname|'expect'NEWLINEop|'='NEWLINEname|'string'NEWLINEop|'.'NEWLINEname|'digits'NEWLINEop|'+'NEWLINEname|'string'NEWLINEop|'.'NEWLINEname|'letters'NEWLINEop|'+'NEWLINEname|'string'NEWLINEop|'.'NEWLINEname|'punctuation'NEWLINEop|'+'NEWLINEstring|"' \\t\\n'"NEWLINEnewline|'\n'NEWLINEname|'self'NEWLINEop|'.'NEWLINEname|'assertEqual'NEWLINEop|'('NEWLINEop|'{'NEWLINEstring|"'output'"NEWLINEop|':'NEWLINEname|'expect'NEWLINEop|'}'NEWLINEop|','NEWLINEname|'output'NEWLINEop|')'NEWLINEnewline|'\n'NEWLINEnl|'\n'NEWLINEDECL|member|test_get_text_console_no_instanceNEWLINEdedent|''NEWLINEname|'def'NEWLINEname|'test_get_text_console_no_instance'NEWLINEop|'('NEWLINEname|'self'NEWLINEop|')'NEWLINEop|':'NEWLINEnewline|'\n'NEWLINEindent|' 'NEWLINEname|'self'NEWLINEop|'.'NEWLINEname|'stubs'NEWLINEop|'.'NEWLINEname|'Set'NEWLINEop|'('NEWLINEname|'compute_api'NEWLINEop|'.'NEWLINEname|'API'NEWLINEop|','NEWLINEstring|"'get'"NEWLINEop|','NEWLINEname|'fake_get_not_found'NEWLINEop|')'NEWLINEnewline|'\n'NEWLINEname|'body'NEWLINEop|'='NEWLINEop|'{'NEWLINEstring|"'os-getConsoleOutput'"NEWLINEop|':'NEWLINEop|'{'NEWLINEop|'}'NEWLINEop|'}'NEWLINEnewline|'\n'NEWLINEname|'self'NEWLINEop|'.'NEWLINEname|'_check_console_output_failure'NEWLINEop|'('NEWLINEname|'webob'NEWLINEop|'.'NEWLINEname|'exc'NEWLINEop|'.'NEWLINEname|'HTTPNotFound'NEWLINEop|','NEWLINEname|'body'NEWLINEop|')'NEWLINEnewline|'\n'NEWLINEnl|'\n'NEWLINEDECL|member|test_get_text_console_no_instance_on_get_outputNEWLINEdedent|''NEWLINEname|'def'NEWLINEname|'test_get_text_console_no_instance_on_get_output'NEWLINEop|'('NEWLINEname|'self'NEWLINEop|')'NEWLINEop|':'NEWLINEnewline|'\n'NEWLINEindent|' 'NEWLINEname|'self'NEWLINEop|'.'NEWLINEname|'stubs'NEWLINEop|'.'NEWLINEname|'Set'NEWLINEop|'('NEWLINEname|'compute_api'NEWLINEop|'.'NEWLINEname|'API'NEWLINEop|','NEWLINEnl|'\n'NEWLINEstring|"'get_console_output'"NEWLINEop|','NEWLINEnl|'\n'NEWLINEname|'fake_get_not_found'NEWLINEop|')'NEWLINEnewline|'\n'NEWLINEname|'body'NEWLINEop|'='NEWLINEop|'{'NEWLINEstring|"'os-getConsoleOutput'"NEWLINEop|':'NEWLINEop|'{'NEWLINEop|'}'NEWLINEop|'}'NEWLINEnewline|'\n'NEWLINEname|'self'NEWLINEop|'.'NEWLINEname|'_check_console_output_failure'NEWLINEop|'('NEWLINEname|'webob'NEWLINEop|'.'NEWLINEname|'exc'NEWLINEop|'.'NEWLINEname|'HTTPNotFound'NEWLINEop|','NEWLINEname|'body'NEWLINEop|')'NEWLINEnewline|'\n'NEWLINEnl|'\n'NEWLINEDECL|member|test_get_console_output_with_non_integer_lengthNEWLINEdedent|''NEWLINEname|'def'NEWLINEname|'test_get_console_output_with_non_integer_length'NEWLINEop|'('NEWLINEname|'self'NEWLINEop|')'NEWLINEop|':'NEWLINEnewline|'\n'NEWLINEindent|' 'NEWLINEname|'body'NEWLINEop|'='NEWLINEop|'{'NEWLINEstring|"'os-getConsoleOutput'"NEWLINEop|':'NEWLINEop|'{'NEWLINEstring|"'length'"NEWLINEop|':'NEWLINEstring|"'NaN'"NEWLINEop|'}'NEWLINEop|'}'NEWLINEnewline|'\n'NEWLINEname|'self'NEWLINEop|'.'NEWLINEname|'_check_console_output_failure'NEWLINEop|'('NEWLINEname|'self'NEWLINEop|'.'NEWLINEname|'validation_error'NEWLINEop|','NEWLINEname|'body'NEWLINEop|')'NEWLINEnewline|'\n'NEWLINEnl|'\n'NEWLINEDECL|member|test_get_text_console_bad_bodyNEWLINEdedent|''NEWLINEname|'def'NEWLINEname|'test_get_text_console_bad_body'NEWLINEop|'('NEWLINEname|'self'NEWLINEop|')'NEWLINEop|':'NEWLINEnewline|'\n'NEWLINEindent|' 'NEWLINEname|'body'NEWLINEop|'='NEWLINEop|'{'NEWLINEop|'}'NEWLINEnewline|'\n'NEWLINEname|'self'NEWLINEop|'.'NEWLINEname|'_check_console_output_failure'NEWLINEop|'('NEWLINEname|'self'NEWLINEop|'.'NEWLINEname|'validation_error'NEWLINEop|','NEWLINEname|'body'NEWLINEop|')'NEWLINEnewline|'\n'NEWLINEnl|'\n'NEWLINEDECL|member|test_get_console_output_with_length_as_floatNEWLINEdedent|''NEWLINEname|'def'NEWLINEname|'test_get_console_output_with_length_as_float'NEWLINEop|'('NEWLINEname|'self'NEWLINEop|')'NEWLINEop|':'NEWLINEnewline|'\n'NEWLINEindent|' 'NEWLINEname|'body'NEWLINEop|'='NEWLINEop|'{'NEWLINEstring|"'os-getConsoleOutput'"NEWLINEop|':'NEWLINEop|'{'NEWLINEstring|"'length'"NEWLINEop|':'NEWLINEnumber|'2.5'NEWLINEop|'}'NEWLINEop|'}'NEWLINEnewline|'\n'NEWLINEname|'self'NEWLINEop|'.'NEWLINEname|'_check_console_output_failure'NEWLINEop|'('NEWLINEname|'self'NEWLINEop|'.'NEWLINEname|'validation_error'NEWLINEop|','NEWLINEname|'body'NEWLINEop|')'NEWLINEnewline|'\n'NEWLINEnl|'\n'NEWLINEDECL|member|test_get_console_output_not_readyNEWLINEdedent|''NEWLINEname|'def'NEWLINEname|'test_get_console_output_not_ready'NEWLINEop|'('NEWLINEname|'self'NEWLINEop|')'NEWLINEop|':'NEWLINEnewline|'\n'NEWLINEindent|' 'NEWLINEname|'self'NEWLINEop|'.'NEWLINEname|'stubs'NEWLINEop|'.'NEWLINEname|'Set'NEWLINEop|'('NEWLINEname|'compute_api'NEWLINEop|'.'NEWLINEname|'API'NEWLINEop|','NEWLINEstring|"'get_console_output'"NEWLINEop|','NEWLINEnl|'\n'NEWLINEname|'fake_get_console_output_not_ready'NEWLINEop|')'NEWLINEnewline|'\n'NEWLINEname|'body'NEWLINEop|'='NEWLINEop|'{'NEWLINEstring|"'os-getConsoleOutput'"NEWLINEop|':'NEWLINEop|'{'NEWLINEop|'}'NEWLINEop|'}'NEWLINEnewline|'\n'NEWLINEname|'self'NEWLINEop|'.'NEWLINEname|'_check_console_output_failure'NEWLINEop|'('NEWLINEname|'webob'NEWLINEop|'.'NEWLINEname|'exc'NEWLINEop|'.'NEWLINEname|'HTTPConflict'NEWLINEop|','NEWLINEname|'body'NEWLINEop|')'NEWLINEnewline|'\n'NEWLINEnl|'\n'NEWLINEDECL|member|test_not_implementedNEWLINEdedent|''NEWLINEname|'def'NEWLINEname|'test_not_implemented'NEWLINEop|'('NEWLINEname|'self'NEWLINEop|')'NEWLINEop|':'NEWLINEnewline|'\n'NEWLINEindent|' 'NEWLINEname|'self'NEWLINEop|'.'NEWLINEname|'stubs'NEWLINEop|'.'NEWLINEname|'Set'NEWLINEop|'('NEWLINEname|'compute_api'NEWLINEop|'.'NEWLINEname|'API'NEWLINEop|','NEWLINEstring|"'get_console_output'"NEWLINEop|','NEWLINEnl|'\n'NEWLINEname|'fakes'NEWLINEop|'.'NEWLINEname|'fake_not_implemented'NEWLINEop|')'NEWLINEnewline|'\n'NEWLINEname|'body'NEWLINEop|'='NEWLINEop|'{'NEWLINEstring|"'os-getConsoleOutput'"NEWLINEop|':'NEWLINEop|'{'NEWLINEop|'}'NEWLINEop|'}'NEWLINEnewline|'\n'NEWLINEname|'self'NEWLINEop|'.'NEWLINEname|'_check_console_output_failure'NEWLINEop|'('NEWLINEname|'webob'NEWLINEop|'.'NEWLINEname|'exc'NEWLINEop|'.'NEWLINEname|'HTTPNotImplemented'NEWLINEop|','NEWLINEname|'body'NEWLINEop|')'NEWLINEnewline|'\n'NEWLINEnl|'\n'NEWLINEDECL|member|test_get_console_output_with_boolean_lengthNEWLINEdedent|''NEWLINEname|'def'NEWLINEname|'test_get_console_output_with_boolean_length'NEWLINEop|'('NEWLINEname|'self'NEWLINEop|')'NEWLINEop|':'NEWLINEnewline|'\n'NEWLINEindent|' 'NEWLINEname|'body'NEWLINEop|'='NEWLINEop|'{'NEWLINEstring|"'os-getConsoleOutput'"NEWLINEop|':'NEWLINEop|'{'NEWLINEstring|"'length'"NEWLINEop|':'NEWLINEname|'True'NEWLINEop|'}'NEWLINEop|'}'NEWLINEnewline|'\n'NEWLINEname|'self'NEWLINEop|'.'NEWLINEname|'_check_console_output_failure'NEWLINEop|'('NEWLINEname|'self'NEWLINEop|'.'NEWLINEname|'validation_error'NEWLINEop|','NEWLINEname|'body'NEWLINEop|')'NEWLINEnewline|'\n'NEWLINEnl|'\n'NEWLINEdedent|''NEWLINEop|'@'NEWLINEname|'mock'NEWLINEop|'.'NEWLINEname|'patch'NEWLINEop|'.'NEWLINEname|'object'NEWLINEop|'('NEWLINEname|'compute_api'NEWLINEop|'.'NEWLINEname|'API'NEWLINEop|','NEWLINEstring|"'get_console_output'"NEWLINEop|','NEWLINEnl|'\n'NEWLINEname|'side_effect'NEWLINEop|'='NEWLINEname|'exception'NEWLINEop|'.'NEWLINEname|'ConsoleNotAvailable'NEWLINEop|'('NEWLINEnl|'\n'NEWLINEname|'instance_uuid'NEWLINEop|'='NEWLINEstring|"'fake_uuid'"NEWLINEop|')'NEWLINEop|')'NEWLINEnewline|'\n'NEWLINEDECL|member|test_get_console_output_not_availableNEWLINEname|'def'NEWLINEname|'test_get_console_output_not_available'NEWLINEop|'('NEWLINEname|'self'NEWLINEop|','NEWLINEname|'mock_get_console_output'NEWLINEop|')'NEWLINEop|':'NEWLINEnewline|'\n'NEWLINEindent|' 'NEWLINEname|'body'NEWLINEop|'='NEWLINEop|'{'NEWLINEstring|"'os-getConsoleOutput'"NEWLINEop|':'NEWLINEop|'{'NEWLINEop|'}'NEWLINEop|'}'NEWLINEnewline|'\n'NEWLINEname|'self'NEWLINEop|'.'NEWLINEname|'_check_console_output_failure'NEWLINEop|'('NEWLINEname|'webob'NEWLINEop|'.'NEWLINEname|'exc'NEWLINEop|'.'NEWLINEname|'HTTPNotFound'NEWLINEop|','NEWLINEname|'body'NEWLINEop|')'NEWLINEnewline|'\n'NEWLINEnl|'\n'NEWLINEnl|'\n'NEWLINEDECL|class|ConsoleOutpuPolicyEnforcementV21NEWLINEdedent|''NEWLINEdedent|''NEWLINEname|'class'NEWLINEname|'ConsoleOutpuPolicyEnforcementV21'NEWLINEop|'('NEWLINEname|'test'NEWLINEop|'.'NEWLINEname|'NoDBTestCase'NEWLINEop|')'NEWLINEop|':'NEWLINEnewline|'\n'NEWLINEnl|'\n'NEWLINEDECL|member|setUpNEWLINEindent|' 'NEWLINEname|'def'NEWLINEname|'setUp'NEWLINEop|'('NEWLINEname|'self'NEWLINEop|')'NEWLINEop|':'NEWLINEnewline|'\n'NEWLINEindent|' 'NEWLINEname|'super'NEWLINEop|'('NEWLINEname|'ConsoleOutpuPolicyEnforcementV21'NEWLINEop|','NEWLINEname|'self'NEWLINEop|')'NEWLINEop|'.'NEWLINEname|'setUp'NEWLINEop|'('NEWLINEop|')'NEWLINEnewline|'\n'NEWLINEname|'self'NEWLINEop|'.'NEWLINEname|'controller'NEWLINEop|'='NEWLINEname|'console_output_v21'NEWLINEop|'.'NEWLINEname|'ConsoleOutputController'NEWLINEop|'('NEWLINEop|')'NEWLINEnewline|'\n'NEWLINEnl|'\n'NEWLINEDECL|member|test_get_console_output_policy_failedNEWLINEdedent|''NEWLINEname|'def'NEWLINEname|'test_get_console_output_policy_failed'NEWLINEop|'('NEWLINEname|'self'NEWLINEop|')'NEWLINEop|':'NEWLINEnewline|'\n'NEWLINEindent|' 'NEWLINEname|'rule_name'NEWLINEop|'='NEWLINEstring|'"os_compute_api:os-console-output"'NEWLINEnewline|'\n'NEWLINEname|'self'NEWLINEop|'.'NEWLINEname|'policy'NEWLINEop|'.'NEWLINEname|'set_rules'NEWLINEop|'('NEWLINEop|'{'NEWLINEname|'rule_name'NEWLINEop|':'NEWLINEstring|'"project:non_fake"'NEWLINEop|'}'NEWLINEop|')'NEWLINEnewline|'\n'NEWLINEname|'req'NEWLINEop|'='NEWLINEname|'fakes'NEWLINEop|'.'NEWLINEname|'HTTPRequest'NEWLINEop|'.'NEWLINEname|'blank'NEWLINEop|'('NEWLINEstring|"''"NEWLINEop|')'NEWLINEnewline|'\n'NEWLINEname|'body'NEWLINEop|'='NEWLINEop|'{'NEWLINEstring|"'os-getConsoleOutput'"NEWLINEop|':'NEWLINEop|'{'NEWLINEop|'}'NEWLINEop|'}'NEWLINEnewline|'\n'NEWLINEname|'exc'NEWLINEop|'='NEWLINEname|'self'NEWLINEop|'.'NEWLINEname|'assertRaises'NEWLINEop|'('NEWLINEnl|'\n'NEWLINEname|'exception'NEWLINEop|'.'NEWLINEname|'PolicyNotAuthorized'NEWLINEop|','NEWLINEnl|'\n'NEWLINEname|'self'NEWLINEop|'.'NEWLINEname|'controller'NEWLINEop|'.'NEWLINEname|'get_console_output'NEWLINEop|','NEWLINEname|'req'NEWLINEop|','NEWLINEname|'fakes'NEWLINEop|'.'NEWLINEname|'FAKE_UUID'NEWLINEop|','NEWLINEnl|'\n'NEWLINEname|'body'NEWLINEop|'='NEWLINEname|'body'NEWLINEop|')'NEWLINEnewline|'\n'NEWLINEname|'self'NEWLINEop|'.'NEWLINEname|'assertEqual'NEWLINEop|'('NEWLINEnl|'\n'NEWLINEstring|'"Policy doesn\'t allow %s to be performed."'NEWLINEop|'%'NEWLINEname|'rule_name'NEWLINEop|','NEWLINEnl|'\n'NEWLINEname|'exc'NEWLINEop|'.'NEWLINEname|'format_message'NEWLINEop|'('NEWLINEop|')'NEWLINEop|')'NEWLINEnewline|'\n'NEWLINEdedent|''NEWLINEdedent|''NEWLINEendmarker|''NEWLINEend_unitNEWLINE |
# Owner(s): ["oncall: quantization"]NEWLINENEWLINEimport torchNEWLINEimport torch.nn as nnNEWLINEimport torch.nn.intrinsic as nniNEWLINEimport torch.nn.intrinsic.quantized as nniqNEWLINEimport torch.nn.quantized as nnqNEWLINEimport torch.nn.quantized.dynamic as nnqdNEWLINEimport torch.nn.quantized._reference as nnqrNEWLINEimport torch.ao.quantizationNEWLINENEWLINEfrom torch.ao.quantization import (NEWLINE get_default_static_quant_module_mappings,NEWLINE default_float_qparams_observer,NEWLINE PerChannelMinMaxObserver,NEWLINE)NEWLINEfrom torch.package import PackageExporter, PackageImporterNEWLINEfrom torch.testing._internal.common_quantization import (NEWLINE QuantizationTestCase,NEWLINE prepare_dynamic,NEWLINE _make_conv_test_input,NEWLINE skipIfNoFBGEMM,NEWLINE lengths_to_offsetsNEWLINE)NEWLINEfrom torch.testing._internal.common_quantized import (NEWLINE _calculate_dynamic_qparams,NEWLINE override_quantized_engine,NEWLINE override_qengines,NEWLINE qengine_is_qnnpack,NEWLINE)NEWLINEfrom hypothesis import assume, givenNEWLINEfrom hypothesis import strategies as stNEWLINEimport torch.testing._internal.hypothesis_utils as huNEWLINEhu.assert_deadline_disabled()NEWLINENEWLINEimport copyNEWLINEimport ioNEWLINEimport numpy as npNEWLINEimport itertoolsNEWLINENEWLINE"""NEWLINENote that tests in this file are just API test, to make sure we wrapped theNEWLINEquantized operator implementations correctly in the user facing APIs, these areNEWLINEnot correctness test for the underlying quantized operators. For correctnessNEWLINEtest please see `test/quantization/test_quantized_op.py`.NEWLINE"""NEWLINENEWLINEclass TestStaticQuantizedModule(QuantizationTestCase):NEWLINE def test_relu(self):NEWLINE relu_module = nn.ReLU()NEWLINE relu6_module = nnq.ReLU6()NEWLINENEWLINE x = torch.arange(-10, 10, dtype=torch.float)NEWLINE y_ref = torch.relu(x)NEWLINE y6_ref = torch.nn.modules.ReLU6()(x)NEWLINENEWLINE qx = torch.quantize_per_tensor(x, 1.0, 0, dtype=torch.qint32)NEWLINE qy = relu_module(qx)NEWLINE qy6 = relu6_module(qx)NEWLINENEWLINE self.assertEqual(y_ref, qy.dequantize(),NEWLINE msg="ReLU module API failed")NEWLINE self.assertEqual(y6_ref, qy6.dequantize(),NEWLINE msg="ReLU6 module API failed")NEWLINENEWLINE @override_qenginesNEWLINE def test_linear_api(self):NEWLINE """test API functionality for nn.quantized.linear and nn.intrinsic.quantized.linear_relu"""NEWLINE options = itertools.product(NEWLINE [1, 5],NEWLINE [16, 32],NEWLINE [4, 8],NEWLINE [True, False],NEWLINE [True, False],NEWLINE [True, False])NEWLINE for (batch_size, in_features, out_features, use_bias,NEWLINE use_fused, per_channel) in options:NEWLINE self._test_linear_api_impl(NEWLINE batch_size, in_features, out_features, use_bias, use_fused,NEWLINE per_channel)NEWLINENEWLINE def _test_linear_api_impl(self, batch_size, in_features, out_features, use_bias, use_fused, per_channel):NEWLINE if torch.backends.quantized.engine == 'qnnpack':NEWLINE per_channel = FalseNEWLINENEWLINE # use_fused -> quantized classNEWLINE class_map = {NEWLINE True: nniq.LinearReLU,NEWLINE False: nnq.Linear,NEWLINE }NEWLINENEWLINE W = torch.rand(out_features, in_features).float()NEWLINE if per_channel:NEWLINE scale_tensor = torch.ones(out_features, dtype=torch.double)NEWLINE zero_point_tensor = torch.zeros(out_features, dtype=torch.long)NEWLINE for i in range(len(scale_tensor)):NEWLINE scale_tensor[i] = (i + 1.0) / 255.0NEWLINE W_q = torch.quantize_per_channel(W, scales=scale_tensor,NEWLINE zero_points=zero_point_tensor,NEWLINE axis=0, dtype=torch.qint8)NEWLINE else:NEWLINE W_q = torch.quantize_per_tensor(W, 0.1, 4, torch.qint8)NEWLINENEWLINE X = torch.rand(batch_size, in_features).float()NEWLINE X_q = torch.quantize_per_tensor(X, 0.2, 10, torch.quint8)NEWLINE B = torch.rand(out_features).float() if use_bias else NoneNEWLINE scale = 0.5NEWLINE zero_point = 3NEWLINE qlinear = class_map[use_fused](in_features, out_features)NEWLINENEWLINE qlinear_copy = copy.deepcopy(qlinear)NEWLINE # set random quantized weight and bias before test torch scriptableNEWLINE qlinear_copy.set_weight_bias(W_q, B)NEWLINE self.checkScriptable(qlinear_copy, [[X_q]], check_save_load=True)NEWLINE # Run module with default-initialized parameters.NEWLINE # This tests that the constructor is correct.NEWLINE qlinear(X_q)NEWLINENEWLINE qlinear.set_weight_bias(W_q, B)NEWLINE # Simple round-trip test to ensure weight()/set_weight() APINEWLINE self.assertEqual(qlinear.weight(), W_q, atol=1e-5, rtol=0)NEWLINENEWLINE # testing packed param implementationNEWLINE qlinear.scale = float(scale)NEWLINE qlinear.zero_point = int(zero_point)NEWLINE Z_q = qlinear(X_q)NEWLINENEWLINE # Check if the module implementation matches calling theNEWLINE # ops directlyNEWLINE W_pack = qlinear._packed_params._packed_paramsNEWLINE if use_fused:NEWLINE Z_ref = torch.ops.quantized.linear_relu(X_q, W_pack, scale, zero_point)NEWLINE else:NEWLINE Z_ref = torch.ops.quantized.linear(X_q, W_pack, scale, zero_point)NEWLINENEWLINE self.assertEqual(Z_ref, Z_q)NEWLINE self.assertTrue(NEWLINE ("QuantizedLinearReLU" if use_fused else "QuantizedLinear") in str(qlinear))NEWLINENEWLINE # Test serialization of quantized Linear Module using state_dictNEWLINE model_dict = qlinear.state_dict()NEWLINE b = io.BytesIO()NEWLINE torch.save(model_dict, b)NEWLINE b.seek(0)NEWLINE loaded_dict = torch.load(b)NEWLINE for key in model_dict:NEWLINE if isinstance(model_dict[key], torch._C.ScriptObject):NEWLINE assert isinstance(loaded_dict[key], torch._C.ScriptObject)NEWLINE w_model, b_model = torch.ops.quantized.linear_unpack(model_dict[key])NEWLINE w_loaded, b_loaded = torch.ops.quantized.linear_unpack(loaded_dict[key])NEWLINE self.assertEqual(w_model, w_loaded)NEWLINE self.assertEqual(b_model, b_loaded)NEWLINE else:NEWLINE self.assertEqual(model_dict[key], loaded_dict[key])NEWLINENEWLINE loaded_qlinear = class_map[use_fused](NEWLINE in_features, out_features)NEWLINE loaded_qlinear.load_state_dict(loaded_dict)NEWLINE linear_unpack = torch.ops.quantized.linear_unpackNEWLINE self.assertEqual(linear_unpack(qlinear._packed_params._packed_params),NEWLINE linear_unpack(loaded_qlinear._packed_params._packed_params))NEWLINE self.assertEqual(qlinear.scale, loaded_qlinear.scale)NEWLINE self.assertEqual(qlinear.zero_point, loaded_qlinear.zero_point)NEWLINE # scripting will add __overloads__ to __dict__, which is why we script a copyNEWLINE # to be able to do the check in the next lineNEWLINE self.checkScriptable(copy.deepcopy(loaded_qlinear), [[X_q]], check_save_load=True)NEWLINE self.assertTrue(dir(qlinear) == dir(loaded_qlinear))NEWLINE self.assertEqual(qlinear._weight_bias(), loaded_qlinear._weight_bias())NEWLINE self.assertEqual(qlinear._weight_bias(), torch.ops.quantized.linear_unpack(qlinear._packed_params._packed_params))NEWLINE Z_q2 = loaded_qlinear(X_q)NEWLINE self.assertEqual(Z_q, Z_q2)NEWLINENEWLINE # Test serializationNEWLINE b = io.BytesIO()NEWLINE torch.save(qlinear, b)NEWLINE b.seek(0)NEWLINE loaded = torch.load(b)NEWLINE self.assertEqual(qlinear.weight(), loaded.weight())NEWLINE self.assertEqual(qlinear.scale, loaded.scale)NEWLINE self.assertEqual(qlinear.zero_point, loaded.zero_point)NEWLINENEWLINE # Test torch.packageNEWLINE buffer = io.BytesIO()NEWLINE with PackageExporter(buffer) as pe:NEWLINE pe.save_pickle("module", "qlinear.pkl", qlinear)NEWLINE buffer.seek(0)NEWLINENEWLINE importer = PackageImporter(buffer)NEWLINE loaded_from_package = importer.load_pickle("module", "qlinear.pkl")NEWLINE self.assertEqual(qlinear.weight(), loaded_from_package.weight())NEWLINE self.assertEqual(qlinear.scale, loaded_from_package.scale)NEWLINE self.assertEqual(qlinear.zero_point, loaded_from_package.zero_point)NEWLINENEWLINE for name, module in loaded_from_package.named_modules():NEWLINE # noop, just make sure attribute "_modules" is restored correctly during torch.package importNEWLINE assert(name is not None)NEWLINENEWLINE # Test copy and deepcopyNEWLINE copied_linear = copy.copy(qlinear)NEWLINE self.assertEqual(copied_linear.bias(), qlinear.bias())NEWLINE self.assertEqual(copied_linear.scale, qlinear.scale)NEWLINE self.assertEqual(copied_linear.zero_point,NEWLINE qlinear.zero_point)NEWLINE Y_copied = copied_linear(X_q)NEWLINE np.testing.assert_array_almost_equal(NEWLINE Z_q.int_repr().numpy(), Y_copied.int_repr().numpy(), decimal=0)NEWLINENEWLINE deepcopied_linear = copy.deepcopy(qlinear)NEWLINE self.assertEqual(deepcopied_linear.bias(), qlinear.bias())NEWLINE self.assertEqual(deepcopied_linear.scale, qlinear.scale)NEWLINE self.assertEqual(deepcopied_linear.zero_point,NEWLINE qlinear.zero_point)NEWLINE Y_deepcopied = copied_linear(X_q)NEWLINE np.testing.assert_array_almost_equal(NEWLINE Z_q.int_repr().numpy(), Y_deepcopied.int_repr().numpy(), decimal=0)NEWLINENEWLINE # Test JITNEWLINE self.checkScriptable(qlinear, [[X_q]], check_save_load=True)NEWLINENEWLINE # Make sure `from_float` works for all linear variantsNEWLINE modules_under_test = [torch.nn.Linear, torch.nn.modules.linear.NonDynamicallyQuantizableLinear]NEWLINENEWLINE for mut in modules_under_test:NEWLINE # Test from_float.NEWLINE float_linear = mut(in_features, out_features).float()NEWLINE float_linear.qconfig = torch.ao.quantization.default_qconfigNEWLINE torch.ao.quantization.prepare(float_linear, inplace=True)NEWLINE float_linear(X.float())NEWLINE # Sequential allows swapping using "convert".NEWLINE quantized_float_linear = torch.nn.Sequential(float_linear)NEWLINE quantized_float_linear = torch.ao.quantization.convert(quantized_float_linear, inplace=True)NEWLINENEWLINE # Smoke test to make sure the module actually runsNEWLINE quantized_float_linear(X_q)NEWLINENEWLINE # Smoke test extra_reprNEWLINE self.assertTrue('QuantizedLinear' in str(quantized_float_linear))NEWLINENEWLINE def test_quant_dequant_api(self):NEWLINE r = torch.tensor([[1., -1.], [1., -1.]], dtype=torch.float)NEWLINE scale, zero_point, dtype = 1.0, 2, torch.qint8NEWLINE # testing Quantize APINEWLINE qr = torch.quantize_per_tensor(r, scale, zero_point, dtype)NEWLINE quant_m = nnq.Quantize(scale, zero_point, dtype)NEWLINE qr2 = quant_m(r)NEWLINE self.assertEqual(qr, qr2)NEWLINE # testing Dequantize APINEWLINE rqr = qr.dequantize()NEWLINE dequant_m = nnq.DeQuantize()NEWLINE rqr2 = dequant_m(qr2)NEWLINE self.assertEqual(rqr, rqr2)NEWLINENEWLINE def _test_conv_api_impl(NEWLINE self, module_name, qconv_module, conv_module, batch_size,NEWLINE in_channels_per_group, input_feature_map_size, out_channels_per_group,NEWLINE groups, kernel_size, stride, padding, padding_mode, dilation,NEWLINE X_scale, X_zero_point, W_scale, W_zero_point, Y_scale, Y_zero_point,NEWLINE use_bias, use_fused, use_channelwise):NEWLINE for i in range(len(kernel_size)):NEWLINE assume(input_feature_map_size[i] + 2 * padding[i]NEWLINE >= dilation[i] * (kernel_size[i] - 1) + 1)NEWLINENEWLINE in_channels = in_channels_per_group * groupsNEWLINE out_channels = out_channels_per_group * groupsNEWLINE (X, X_q, W, W_q, b) = _make_conv_test_input(NEWLINE batch_size, in_channels_per_group, input_feature_map_size,NEWLINE out_channels_per_group, groups, kernel_size, X_scale, X_zero_point,NEWLINE W_scale, W_zero_point, use_bias, use_channelwise)NEWLINE # Make sure the weight shape is correctNEWLINE self.assertTrue(qconv_module.weight().shape == W_q.shape)NEWLINENEWLINE qconv_module.set_weight_bias(W_q, b)NEWLINE qconv_module.scale = Y_scaleNEWLINE qconv_module.zero_point = Y_zero_pointNEWLINENEWLINE if use_fused:NEWLINE conv_module[0].weight.data = WNEWLINE if use_bias:NEWLINE conv_module[0].bias.data = bNEWLINE else:NEWLINE conv_module.weight.data = WNEWLINE if use_bias:NEWLINE conv_module.bias.data = bNEWLINENEWLINE # Test membersNEWLINE self.assertTrue(module_name == qconv_module._get_name(), module_name + " " + qconv_module._get_name())NEWLINE self.assertTrue(hasattr(qconv_module, '_packed_params'))NEWLINE self.assertTrue(hasattr(qconv_module, 'scale'))NEWLINE self.assertTrue(hasattr(qconv_module, 'zero_point'))NEWLINENEWLINE # Test propertiesNEWLINE self.assertEqual(W_q, qconv_module.weight())NEWLINE if use_bias:NEWLINE self.assertEqual(b, qconv_module.bias())NEWLINE self.assertEqual(Y_scale, qconv_module.scale)NEWLINE self.assertEqual(Y_zero_point, qconv_module.zero_point)NEWLINENEWLINE # Test forwardNEWLINE Y_exp = conv_module(X)NEWLINE Y_exp = torch.quantize_per_tensor(NEWLINE Y_exp, scale=Y_scale, zero_point=Y_zero_point, dtype=torch.quint8)NEWLINE Y_act = qconv_module(X_q)NEWLINENEWLINE # Make sure the results matchNEWLINE # assert_array_almost_equal compares using the following formula:NEWLINE # abs(desired-actual) < 1.5 * 10**(-decimal)NEWLINE # (https://docs.scipy.org/doc/numpy/reference/generated/numpy.testing.assert_almost_equal.html)NEWLINE # We use decimal = 0 to ignore off-by-1 differences between referenceNEWLINE # and test. Off-by-1 differences arise due to the order of round andNEWLINE # zero_point addition operation, i.e., if addition followed by round isNEWLINE # used by reference and round followed by addition is used by test, theNEWLINE # results may differ by 1.NEWLINE # For example, the result of round(2.5) + 1 is 3 while round(2.5 + 1) isNEWLINE # 4 assuming the rounding mode is round-to-nearest, ties-to-even.NEWLINE # skip numerics checking for reference moduleNEWLINE np.testing.assert_array_almost_equal(NEWLINE Y_exp.int_repr().numpy(), Y_act.int_repr().numpy(), decimal=0)NEWLINENEWLINE # Test serialization of quantized Conv Module using state_dictNEWLINE model_dict = qconv_module.state_dict()NEWLINE self.assertEqual(model_dict['weight'], W_q)NEWLINE if use_bias:NEWLINE self.assertEqual(model_dict['bias'], b)NEWLINE bytes_io = io.BytesIO()NEWLINE torch.save(model_dict, bytes_io)NEWLINE bytes_io.seek(0)NEWLINE loaded_dict = torch.load(bytes_io)NEWLINE for key in loaded_dict:NEWLINE self.assertEqual(model_dict[key], loaded_dict[key])NEWLINE loaded_qconv_module = type(qconv_module)(NEWLINE in_channels, out_channels, kernel_size, stride, padding, dilation,NEWLINE groups, use_bias, padding_mode=padding_mode)NEWLINE loaded_qconv_module.load_state_dict(loaded_dict)NEWLINENEWLINE self.assertTrue(dir(loaded_qconv_module) == dir(qconv_module))NEWLINE self.assertTrue(module_name == loaded_qconv_module._get_name())NEWLINE self.assertTrue(hasattr(loaded_qconv_module, '_packed_params'))NEWLINE self.assertTrue(hasattr(loaded_qconv_module, '_weight_bias'))NEWLINENEWLINE self.assertEqual(qconv_module.weight(), loaded_qconv_module.weight())NEWLINE if use_bias:NEWLINE self.assertEqual(qconv_module.bias(), loaded_qconv_module.bias())NEWLINE self.assertEqual(qconv_module.scale, loaded_qconv_module.scale)NEWLINE self.assertEqual(qconv_module.zero_point,NEWLINE loaded_qconv_module.zero_point)NEWLINE Y_loaded = loaded_qconv_module(X_q)NEWLINE np.testing.assert_array_almost_equal(NEWLINE Y_exp.int_repr().numpy(), Y_loaded.int_repr().numpy(), decimal=0)NEWLINENEWLINE # Test serializationNEWLINE b = io.BytesIO()NEWLINE torch.save(qconv_module, b)NEWLINE b.seek(0)NEWLINE loaded_conv = torch.load(b)NEWLINENEWLINE self.assertEqual(loaded_conv.bias(), qconv_module.bias())NEWLINE self.assertEqual(loaded_conv.scale, qconv_module.scale)NEWLINE self.assertEqual(loaded_conv.zero_point,NEWLINE qconv_module.zero_point)NEWLINENEWLINE # Test copy and deepcopyNEWLINE copied_conv = copy.copy(qconv_module)NEWLINE self.assertEqual(copied_conv.bias(), qconv_module.bias())NEWLINE self.assertEqual(copied_conv.scale, qconv_module.scale)NEWLINE self.assertEqual(copied_conv.zero_point,NEWLINE qconv_module.zero_point)NEWLINE Y_copied = copied_conv(X_q)NEWLINE np.testing.assert_array_almost_equal(NEWLINE Y_exp.int_repr().numpy(), Y_copied.int_repr().numpy(), decimal=0)NEWLINENEWLINE deepcopied_conv = copy.deepcopy(qconv_module)NEWLINE self.assertEqual(deepcopied_conv.bias(), qconv_module.bias())NEWLINE self.assertEqual(deepcopied_conv.scale, qconv_module.scale)NEWLINE self.assertEqual(deepcopied_conv.zero_point,NEWLINE qconv_module.zero_point)NEWLINE Y_deepcopied = copied_conv(X_q)NEWLINE np.testing.assert_array_almost_equal(NEWLINE Y_exp.int_repr().numpy(), Y_deepcopied.int_repr().numpy(), decimal=0)NEWLINENEWLINE # JIT testingNEWLINE self.checkScriptable(NEWLINE qconv_module, [[X_q]],NEWLINE check_save_load=True)NEWLINENEWLINE # Test from_floatNEWLINE fused_conv_module = torch.nn.intrinsic._FusedModule(conv_module)NEWLINE fused_conv_module.qconfig = torch.ao.quantization.default_qconfigNEWLINE torch.ao.quantization.prepare(fused_conv_module, inplace=True)NEWLINE fused_conv_module(X.float())NEWLINE converted_qconv_module = fused_conv_moduleNEWLINE reference_mapping = get_default_static_quant_module_mappings()NEWLINE reference_mapping[type(conv_module)] = type(qconv_module)NEWLINE torch.ao.quantization.convert(converted_qconv_module, mapping=reference_mapping, inplace=True)NEWLINENEWLINE # Smoke test to make sure the module actually runsNEWLINE if use_bias:NEWLINE if use_fused:NEWLINE self.assertEqual(conv_module[0].bias,NEWLINE converted_qconv_module[0].bias())NEWLINE else:NEWLINE self.assertEqual(conv_module.bias,NEWLINE converted_qconv_module[0].bias())NEWLINE # Smoke test extra_reprNEWLINE self.assertTrue(module_name == converted_qconv_module[0]._get_name())NEWLINENEWLINE @override_qenginesNEWLINE def test_conv1d_api(self):NEWLINE options = itertools.product(NEWLINE ["zeros", "reflect"], # pad_modeNEWLINE [True, False], # use_biasNEWLINE [True, False], # use_fusedNEWLINE [True, False], # use_channelwiseNEWLINE )NEWLINE for pad_mode, use_bias, use_fused, use_channelwise in options:NEWLINE if torch.backends.quantized.engine == "qnnpack":NEWLINE use_channelwise = FalseNEWLINE batch_size = 2NEWLINE in_channels_per_group = 2NEWLINE length = 8NEWLINE out_channels_per_group = 2NEWLINE groups = 3NEWLINE kernel = 3NEWLINE stride = 2NEWLINE pad = 1NEWLINE dilation = 1NEWLINE # Tests the correctness of the conv2d module.NEWLINE in_channels = in_channels_per_group * groupsNEWLINE out_channels = out_channels_per_group * groupsNEWLINE input_feature_map_size = (length,)NEWLINE kernel_size = (kernel, )NEWLINE stride = (stride, )NEWLINE pad = (pad, )NEWLINE dilation = (dilation, )NEWLINE X_scale = 1.3NEWLINE X_zero_point = 2NEWLINE W_scale = [0.5]NEWLINE W_zero_point = [3]NEWLINE Y_scale = 5.0NEWLINE Y_zero_point = 4NEWLINE if torch.backends.quantized.engine == 'qnnpack':NEWLINE use_channelwise = FalseNEWLINE # use_fused -> quantized classNEWLINE class_map = {NEWLINE True: (nniq.ConvReLU1d, "QuantizedConvReLU1d"),NEWLINE False: (nnq.Conv1d, "QuantizedConv1d")NEWLINE }NEWLINENEWLINE qconv_cls, module_name = class_map[use_fused]NEWLINE qconv_module = qconv_cls(NEWLINE in_channels, out_channels, kernel, stride, pad,NEWLINE dilation, groups, use_bias, padding_mode=pad_modeNEWLINE )NEWLINENEWLINE conv_module = nn.Conv1d(NEWLINE in_channels, out_channels, kernel, stride, pad,NEWLINE dilation, groups, use_bias, padding_mode=pad_mode)NEWLINE if use_fused:NEWLINE relu_module = nn.ReLU()NEWLINE conv_module = nni.ConvReLU1d(conv_module, relu_module)NEWLINE conv_module = conv_module.float()NEWLINENEWLINE self._test_conv_api_impl(NEWLINE module_name, qconv_module, conv_module, batch_size,NEWLINE in_channels_per_group, input_feature_map_size,NEWLINE out_channels_per_group, groups, kernel_size, stride, pad, pad_mode,NEWLINE dilation, X_scale, X_zero_point, W_scale, W_zero_point, Y_scale,NEWLINE Y_zero_point, use_bias, use_fused, use_channelwise)NEWLINENEWLINE @override_qenginesNEWLINE def test_conv2d_api(self):NEWLINE options = itertools.product(NEWLINE ["zeros", "reflect"], # pad_modeNEWLINE [True, False], # use_biasNEWLINE [True, False], # use_fusedNEWLINE [True, False], # use_channelwiseNEWLINE )NEWLINE for pad_mode, use_bias, use_fused, use_channelwise in options:NEWLINE if torch.backends.quantized.engine == "qnnpack":NEWLINE use_channelwise = FalseNEWLINE batch_size = 2NEWLINE in_channels_per_group = 2NEWLINE H = 8NEWLINE W = 8NEWLINE out_channels_per_group = 2NEWLINE groups = 3NEWLINE kernel_h = 3NEWLINE kernel_w = 3NEWLINE stride_h = 2NEWLINE stride_w = 2NEWLINE pad_h = 1NEWLINE pad_w = 1NEWLINE dilation = 1NEWLINE # Tests the correctness of the conv2d module.NEWLINE in_channels = in_channels_per_group * groupsNEWLINE out_channels = out_channels_per_group * groupsNEWLINE input_feature_map_size = (H, W)NEWLINE kernel_size = (kernel_h, kernel_w)NEWLINE stride = (stride_h, stride_w)NEWLINE padding = (pad_h, pad_w)NEWLINE dilation = (dilation, dilation)NEWLINE X_scale = 1.3NEWLINE X_zero_point = 2NEWLINE W_scale = [0.5]NEWLINE W_zero_point = [3]NEWLINE Y_scale = 5.0NEWLINE Y_zero_point = 4NEWLINE # use_fused -> quantized classNEWLINE class_map = {NEWLINE True: (nniq.ConvReLU2d, "QuantizedConvReLU2d"),NEWLINE False: (nnq.Conv2d, "QuantizedConv2d")NEWLINE }NEWLINENEWLINE qconv_cls, module_name = class_map[use_fused]NEWLINE qconv_module = qconv_cls(NEWLINE in_channels, out_channels, kernel_size, stride, padding,NEWLINE dilation, groups, use_bias, padding_mode=pad_modeNEWLINE )NEWLINENEWLINE conv_module = nn.Conv2d(NEWLINE in_channels, out_channels, kernel_size, stride, padding,NEWLINE dilation, groups, use_bias, padding_mode=pad_mode)NEWLINE if use_fused:NEWLINE relu_module = nn.ReLU()NEWLINE conv_module = nni.ConvReLU2d(conv_module, relu_module)NEWLINE conv_module = conv_module.float()NEWLINENEWLINE self._test_conv_api_impl(NEWLINE module_name, qconv_module, conv_module, batch_size,NEWLINE in_channels_per_group, input_feature_map_size,NEWLINE out_channels_per_group, groups, kernel_size, stride, padding,NEWLINE pad_mode, dilation, X_scale, X_zero_point, W_scale, W_zero_point,NEWLINE Y_scale, Y_zero_point, use_bias, use_fused, use_channelwise)NEWLINENEWLINE @skipIfNoFBGEMMNEWLINE def test_conv3d_api(self):NEWLINE options = itertools.product(NEWLINE [True, False], # use_biasNEWLINE [True, False], # use_fusedNEWLINE [True, False], # use_channelwiseNEWLINE )NEWLINE for use_bias, use_fused, use_channelwise in options:NEWLINE if torch.backends.quantized.engine == "qnnpack":NEWLINE use_channelwise = FalseNEWLINE batch_size = 2NEWLINE in_channels_per_group = 2NEWLINE H = 8NEWLINE W = 8NEWLINE D = 8NEWLINE out_channels_per_group = 2NEWLINE groups = 3NEWLINE kernel_h = 3NEWLINE kernel_w = 3NEWLINE kernel_d = 3NEWLINE stride_h = 2NEWLINE stride_w = 2NEWLINE stride_d = 2NEWLINE pad_mode = "zeros" # 3d doesn't support reflect paddingNEWLINE pad_h = 1NEWLINE pad_w = 1NEWLINE pad_d = 1NEWLINE dilation = 1NEWLINE # Tests the correctness of the conv3d module.NEWLINE in_channels = in_channels_per_group * groupsNEWLINE out_channels = out_channels_per_group * groupsNEWLINE input_feature_map_size = (D, H, W)NEWLINE kernel_size = (kernel_d, kernel_h, kernel_w)NEWLINE stride = (stride_d, stride_h, stride_w)NEWLINE padding = (pad_d, pad_h, pad_w)NEWLINE dilation = (dilation, dilation, dilation)NEWLINE X_scale = 1.3NEWLINE X_zero_point = 2NEWLINE W_scale = [0.5]NEWLINE W_zero_point = [3]NEWLINE Y_scale = 5.0NEWLINE Y_zero_point = 4NEWLINE # use_fused -> quantized classNEWLINE class_map = {NEWLINE True: (nniq.ConvReLU3d, "QuantizedConvReLU3d"),NEWLINE False: (nnq.Conv3d, "QuantizedConv3d")NEWLINE }NEWLINENEWLINE with override_quantized_engine('fbgemm'):NEWLINE qconv_cls, module_name = class_map[use_fused]NEWLINE qconv_module = qconv_cls(NEWLINE in_channels, out_channels, kernel_size, stride, padding,NEWLINE dilation, groups, use_bias, padding_mode=pad_modeNEWLINE )NEWLINENEWLINE conv_module = nn.Conv3d(NEWLINE in_channels, out_channels, kernel_size, stride, padding,NEWLINE dilation, groups, use_bias, padding_mode=pad_mode)NEWLINE if use_fused:NEWLINE relu_module = nn.ReLU()NEWLINE conv_module = nni.ConvReLU3d(conv_module, relu_module)NEWLINE conv_module = conv_module.float()NEWLINENEWLINE self._test_conv_api_impl(NEWLINE module_name, qconv_module, conv_module, batch_size,NEWLINE in_channels_per_group, input_feature_map_size,NEWLINE out_channels_per_group, groups, kernel_size, stride, padding,NEWLINE pad_mode, dilation, X_scale, X_zero_point, W_scale,NEWLINE W_zero_point, Y_scale, Y_zero_point, use_bias, use_fused,NEWLINE use_channelwise)NEWLINENEWLINE def test_pool_api(self):NEWLINE """Tests the correctness of the pool module.NEWLINE The correctness is defined against the functional implementation.NEWLINE """NEWLINE N, C, H, W = 10, 10, 10, 3NEWLINE kwargs = {NEWLINE 'kernel_size': 2,NEWLINE 'stride': None,NEWLINE 'padding': 0,NEWLINE 'dilation': 1NEWLINE }NEWLINENEWLINE scale, zero_point = 1.0 / 255, 128NEWLINENEWLINE X = torch.randn(N, C, H, W, dtype=torch.float32)NEWLINE qX = torch.quantize_per_tensor(X, scale=scale, zero_point=zero_point,NEWLINE dtype=torch.quint8)NEWLINE qX_expect = torch.nn.functional.max_pool2d(qX, **kwargs)NEWLINENEWLINE pool_under_test = torch.nn.quantized.MaxPool2d(**kwargs)NEWLINE qX_hat = pool_under_test(qX)NEWLINE self.assertEqual(qX_expect, qX_hat)NEWLINENEWLINE # JIT TestingNEWLINE self.checkScriptable(pool_under_test, [[X]])NEWLINENEWLINE def test_dropout(self):NEWLINE """Tests the correctness of the dropout module.NEWLINE The correctness is defined against the functional implementation.NEWLINE """NEWLINE x = torch.randn((2, 4, 6, 8), dtype=torch.float)NEWLINE float_mod = torch.nn.Dropout(p=0.5)NEWLINE float_mod.training = FalseNEWLINENEWLINE y_ref = float_mod(x)NEWLINE quant_ref = torch.quantize_per_tensor(y_ref, 1.0, 0, dtype=torch.quint8)NEWLINENEWLINE quant_mod = nnq.Dropout(p=0.5)NEWLINE qx = torch.quantize_per_tensor(x, 1.0, 0, dtype=torch.quint8)NEWLINE qy = quant_mod(qx)NEWLINENEWLINE self.assertEqual(quant_ref.int_repr().numpy(), qy.int_repr().numpy(),NEWLINE msg="Dropout module API failed")NEWLINENEWLINE def _test_dropout_serialization(self, get_model, data1, data2):NEWLINE m1 = get_model()NEWLINE m1.qconfig = torch.ao.quantization.default_qconfigNEWLINE mp1 = torch.ao.quantization.prepare(m1)NEWLINE mp1(data1)NEWLINE mq1 = torch.ao.quantization.convert(mp1)NEWLINE ref1 = mq1(data2)NEWLINENEWLINE m2 = get_model()NEWLINE m2.qconfig = torch.quantization.default_qconfigNEWLINE mp2 = torch.ao.quantization.prepare(m2)NEWLINE mq2 = torch.ao.quantization.convert(mp2)NEWLINENEWLINE mq2.load_state_dict(mq1.state_dict())NEWLINE ref2 = mq2(data2)NEWLINENEWLINE self.assertTrue(torch.allclose(ref1, ref2))NEWLINENEWLINE def test_dropout_serialization(self):NEWLINE data1 = torch.randn(2, 4, 6, 8)NEWLINE data2 = torch.randn(2, 4, 6, 8)NEWLINENEWLINE def _get_model():NEWLINE return nn.Sequential(NEWLINE torch.ao.quantization.QuantStub(),NEWLINE nn.Dropout(p=0.5),NEWLINE torch.ao.quantization.DeQuantStub()NEWLINE ).eval()NEWLINENEWLINE self._test_dropout_serialization(_get_model, data1, data2)NEWLINENEWLINENEWLINENEWLINE def test_batch_norm2d(self):NEWLINE """Tests the correctness of the batchnorm2d module.NEWLINE The correctness is defined against the functional implementation.NEWLINE """NEWLINE x = torch.randn((2, 4, 6, 8), dtype=torch.float)NEWLINE float_mod = torch.nn.BatchNorm2d(4)NEWLINE float_mod.training = FalseNEWLINENEWLINE y_ref = float_mod(x)NEWLINE quant_ref = torch.quantize_per_tensor(y_ref, 1.0, 0, dtype=torch.quint8)NEWLINENEWLINE quant_mod = nnq.BatchNorm2d(4)NEWLINE qx = torch.quantize_per_tensor(x, 1.0, 0, dtype=torch.quint8)NEWLINE qy = quant_mod(qx)NEWLINENEWLINE self.assertEqual(quant_ref.int_repr().numpy(), qy.int_repr().numpy(),NEWLINE msg="BatchNorm2d module API failed")NEWLINENEWLINE def test_batch_norm3d(self):NEWLINE """Tests the correctness of the batchnorm3d module.NEWLINE The correctness is defined against the functional implementation.NEWLINE """NEWLINE x = torch.randn((2, 4, 6, 8, 10), dtype=torch.float)NEWLINE float_mod = torch.nn.BatchNorm3d(4)NEWLINE float_mod.training = FalseNEWLINENEWLINE y_ref = float_mod(x)NEWLINE quant_ref = torch.quantize_per_tensor(y_ref, 1.0, 0, dtype=torch.quint8)NEWLINENEWLINE quant_mod = nnq.BatchNorm3d(4)NEWLINE qx = torch.quantize_per_tensor(x, 1.0, 0, dtype=torch.quint8)NEWLINE qy = quant_mod(qx)NEWLINENEWLINE self.assertEqual(quant_ref.int_repr().numpy(), qy.int_repr().numpy(),NEWLINE msg="BatchNorm3d module API failed")NEWLINENEWLINE def _test_batch_norm_serialization(self, get_model, data1, data2):NEWLINE m1 = get_model()NEWLINE m1.qconfig = torch.ao.quantization.default_qconfigNEWLINE mp1 = torch.ao.quantization.prepare(m1)NEWLINE mp1(data1)NEWLINE mq1 = torch.ao.quantization.convert(mp1)NEWLINE ref1 = mq1(data2)NEWLINENEWLINE m2 = get_model()NEWLINE m2.qconfig = torch.quantization.default_qconfigNEWLINE mp2 = torch.ao.quantization.prepare(m2)NEWLINE mq2 = torch.ao.quantization.convert(mp2)NEWLINENEWLINE mq2.load_state_dict(mq1.state_dict())NEWLINE ref2 = mq2(data2)NEWLINENEWLINE self.assertTrue(torch.allclose(ref1, ref2))NEWLINENEWLINE def test_batch_norm2d_serialization(self):NEWLINE data1 = torch.randn(2, 4, 6, 8)NEWLINE data2 = torch.randn(2, 4, 6, 8)NEWLINENEWLINE def _get_model():NEWLINE return nn.Sequential(NEWLINE torch.ao.quantization.QuantStub(),NEWLINE nn.BatchNorm2d(4),NEWLINE torch.ao.quantization.DeQuantStub()NEWLINE ).eval()NEWLINENEWLINE self._test_batch_norm_serialization(_get_model, data1, data2)NEWLINENEWLINE def test_batch_norm3d_serialization(self):NEWLINE data1 = torch.randn(2, 4, 6, 8, 1)NEWLINE data2 = torch.randn(2, 4, 6, 8, 1)NEWLINENEWLINE def _get_model():NEWLINE return nn.Sequential(NEWLINE torch.ao.quantization.QuantStub(),NEWLINE nn.BatchNorm3d(4),NEWLINE torch.ao.quantization.DeQuantStub()NEWLINE ).eval()NEWLINENEWLINE self._test_batch_norm_serialization(_get_model, data1, data2)NEWLINENEWLINE def test_layer_norm(self):NEWLINE """Tests the correctness of the layernorm module.NEWLINE The correctness is defined against the functional implementation.NEWLINE """NEWLINE x_scale = 10.0 / 256NEWLINE x_zero_point = 0NEWLINE y_scale = 5.0 / 256NEWLINE y_zero_point = 127NEWLINENEWLINE dims = (1, 4, 8)NEWLINENEWLINE X = (torch.randn(dims, dtype=torch.float) - 0.5) * 10NEWLINE qX = torch.quantize_per_tensor(X, x_scale, x_zero_point, dtype=torch.quint8)NEWLINE dqX = qX.dequantize()NEWLINENEWLINE float_mod = torch.nn.LayerNorm(dqX.size()[1:]).float()NEWLINE float_mod.weight = torch.nn.Parameter(torch.rand(*dims[1:]))NEWLINE float_mod.bias = torch.nn.Parameter(torch.rand(*dims[1:]))NEWLINENEWLINE dqY_ref = float_mod(dqX)NEWLINE qY_ref = torch.quantize_per_tensor(NEWLINE dqY_ref, y_scale, y_zero_point, dtype=torch.quint8)NEWLINENEWLINE quant_mod = nnq.LayerNorm(NEWLINE qX.size()[1:], float_mod.weight, float_mod.bias, y_scale, y_zero_point)NEWLINE qY = quant_mod(qX)NEWLINENEWLINE self.assertEqual(qY_ref.int_repr().numpy(), qY.int_repr().numpy(),NEWLINE msg="LayerNorm module API failed, qY_ref\n{} vs qY\n{}"NEWLINE .format(qY_ref, qY))NEWLINENEWLINE def test_group_norm(self):NEWLINE """Tests the correctness of the groupnorm module.NEWLINE The correctness is defined against the functional implementation.NEWLINE """NEWLINE x_scale = 10.0 / 256NEWLINE x_zero_point = 0NEWLINE y_scale = 5.0 / 256NEWLINE y_zero_point = 127NEWLINENEWLINE dims = (1, 4, 8)NEWLINENEWLINE X = (torch.randn(dims, dtype=torch.float) - 0.5) * 10NEWLINE qX = torch.quantize_per_tensor(X, x_scale, x_zero_point, dtype=torch.quint8)NEWLINE dqX = qX.dequantize()NEWLINENEWLINE float_mod = torch.nn.GroupNorm(2, 4).float()NEWLINE float_mod.weight = torch.nn.Parameter(torch.rand(dims[1]))NEWLINE float_mod.bias = torch.nn.Parameter(torch.rand(dims[1]))NEWLINENEWLINE dqY_ref = float_mod(dqX)NEWLINE qY_ref = torch.quantize_per_tensor(NEWLINE dqY_ref, y_scale, y_zero_point, dtype=torch.quint8)NEWLINENEWLINE quant_mod = nnq.GroupNorm(NEWLINE 2, 2, float_mod.weight, float_mod.bias, y_scale, y_zero_point)NEWLINE qY = quant_mod(qX)NEWLINENEWLINE self.assertEqual(qY_ref.int_repr().numpy(), qY.int_repr().numpy(),NEWLINE msg="GroupNorm module API failed, qY_ref\n{} vs qY\n{}"NEWLINE .format(qY_ref, qY))NEWLINENEWLINE def test_instance_norm(self):NEWLINE """Tests the correctness of the instancenorm{n}d modules.NEWLINE The correctness is defined against the functional implementation.NEWLINE """NEWLINE x_scale = 10.0 / 256NEWLINE x_zero_point = 0NEWLINE y_scale = 5.0 / 256NEWLINE y_zero_point = 127NEWLINENEWLINE dims_to_modules = [NEWLINE ((1, 4, 8), torch.nn.InstanceNorm1d, nnq.InstanceNorm1d),NEWLINE ((1, 4, 8, 1), torch.nn.InstanceNorm2d, nnq.InstanceNorm2d),NEWLINE ((1, 4, 8, 1, 1), torch.nn.InstanceNorm3d, nnq.InstanceNorm3d),NEWLINE ]NEWLINENEWLINE for dim_to_modules in dims_to_modules:NEWLINE dims, float_cls, q_cls = dim_to_modulesNEWLINENEWLINE X = (torch.randn(dims, dtype=torch.float) - 0.5) * 10NEWLINE qX = torch.quantize_per_tensor(NEWLINE X, x_scale, x_zero_point, dtype=torch.quint8)NEWLINE dqX = qX.dequantize()NEWLINENEWLINE float_mod = float_cls(dims[1]).float()NEWLINE float_mod.weight = torch.nn.Parameter(torch.rand(dims[1]))NEWLINE float_mod.bias = torch.nn.Parameter(torch.rand(dims[1]))NEWLINENEWLINE dqY_ref = float_mod(dqX)NEWLINE qY_ref = torch.quantize_per_tensor(NEWLINE dqY_ref, y_scale, y_zero_point, dtype=torch.quint8)NEWLINENEWLINE quant_mod = q_cls(NEWLINE dims[1], float_mod.weight, float_mod.bias, y_scale,NEWLINE y_zero_point)NEWLINE qY = quant_mod(qX)NEWLINENEWLINE self.assertEqual(NEWLINE qY_ref.int_repr().numpy(), qY.int_repr().numpy(),NEWLINE msg="InstanceNorm module API failed, qY_ref\n{} vs qY\n{}"NEWLINE .format(qY_ref, qY))NEWLINENEWLINE def _test_activation_module_impl(self, name, float_module_class, quantized_module_class, extra_kwargs):NEWLINE """Tests the correctness of the ELU module.NEWLINE The correctness is defined against the functional implementation.NEWLINE """NEWLINE x_scale = 10.0 / 256NEWLINE x_zero_point = 0NEWLINE y_scale = 5.0 / 256NEWLINE y_zero_point = 127NEWLINE alpha = 1.5NEWLINENEWLINE dims = (1, 4, 8)NEWLINENEWLINE X = (torch.randn(dims, dtype=torch.float) - 0.5) * 10NEWLINE qX = torch.quantize_per_tensor(X, x_scale, x_zero_point, dtype=torch.quint8)NEWLINE dqX = qX.dequantize()NEWLINENEWLINE float_mod = float_module_class(**extra_kwargs).float()NEWLINENEWLINE dqY_ref = float_mod(dqX)NEWLINE qY_ref = torch.quantize_per_tensor(NEWLINE dqY_ref, y_scale, y_zero_point, dtype=torch.quint8)NEWLINENEWLINE quant_mod = quantized_module_class(y_scale, y_zero_point, **extra_kwargs)NEWLINE qY = quant_mod(qX)NEWLINE self.assertEqual(qY_ref.int_repr().numpy(), qY.int_repr().numpy(),NEWLINE msg="{} module API failed, qY_ref\n{} vs qY\n{}"NEWLINE .format(name, qY_ref, qY))NEWLINENEWLINE def _test_leaky_relu_serialization(self):NEWLINE scale_original = 10.0 / 256NEWLINE zero_point_original = 1.0NEWLINENEWLINE quant_mod_original = nnq.LeakyReLU(scale_original, zero_point_original)NEWLINE state_dict = quant_mod_original.state_dict()NEWLINENEWLINE scale_new = 5.0 / 256NEWLINE zero_point_new = 2.0NEWLINE quant_mod_new = nnq.LeakyReLU(scale_new, zero_point_new)NEWLINE quant_mod_new.load_state_dict(state_dict)NEWLINENEWLINE self.assertEqual(quant_mod_original.scale, quant_mod_new.scale)NEWLINE self.assertEqual(quant_mod_original.zero_point, quant_mod_new.zero_point)NEWLINENEWLINE def test_elu(self):NEWLINE """Tests the correctness of the ELU module.NEWLINE The correctness is defined against the functional implementation.NEWLINE """NEWLINE self._test_activation_module_impl("ELU", nn.ELU, nnq.ELU, {"alpha": 1.5})NEWLINENEWLINE def test_leaky_relu(self):NEWLINE self._test_activation_module_impl("LeakyReLU", nn.LeakyReLU, nnq.LeakyReLU, {"negative_slope": 0.2})NEWLINE self._test_leaky_relu_serialization()NEWLINENEWLINE def test_sigmoid(self):NEWLINE self._test_activation_module_impl("Sigmoid", nn.Sigmoid, nnq.Sigmoid, {})NEWLINENEWLINE @given(NEWLINE num_embeddings=st.integers(10, 50),NEWLINE embedding_dim=st.integers(5, 50).filter(lambda x: x % 4 == 0),NEWLINE set_qconfig=st.booleans(),NEWLINE )NEWLINE @skipIfNoFBGEMMNEWLINE def test_embedding_api(self, num_embeddings, embedding_dim, set_qconfig):NEWLINE num_lengths = np.random.randint(1, 6)NEWLINE lengths = np.random.randint(0, 21, size=num_lengths).astype(np.int32)NEWLINE num_indices = np.sum(lengths)NEWLINE indices = torch.from_numpy(np.random.randint(low=0, high=num_embeddings, size=num_indices, dtype=np.int64))NEWLINE weights = torch.from_numpy((np.random.random_sample((num_embeddings, embedding_dim)) + 1).astype(np.float32))NEWLINENEWLINE obs = default_float_qparams_observer()NEWLINE obs(weights)NEWLINE qparams = obs.calculate_qparams()NEWLINENEWLINE dtypes = [torch.quint4x2, torch.quint8]NEWLINE embedding_funcs = [torch.ops.quantized.embedding_4bit, torch.ops.quantized.embedding_byte]NEWLINENEWLINE for dtype, embedding_func in zip(dtypes, embedding_funcs):NEWLINE # Quantize the weightsNEWLINE qweight = torch.quantize_per_channel(weights, qparams[0], qparams[1], axis=0, dtype=dtype)NEWLINE qemb = nnq.Embedding(num_embeddings=num_embeddings, embedding_dim=embedding_dim, dtype=dtype)NEWLINE qemb.set_weight(qweight)NEWLINE qemb(indices)NEWLINENEWLINE # Ensure the module has the correct weightsNEWLINE self.assertEqual(qweight, qemb.weight())NEWLINE w_packed = qemb._packed_params._packed_weightNEWLINE module_out = qemb(indices)NEWLINENEWLINE # Call the bit qembedding operator directlyNEWLINE ref = embedding_func(w_packed, indices, pruned_weights=False)NEWLINE self.assertEqual(module_out, ref)NEWLINE self.checkEmbeddingSerialization(qemb, num_embeddings, embedding_dim, indices, None, set_qconfig=False,NEWLINE is_emb_bag=False, dtype=dtype)NEWLINENEWLINE @given(NEWLINE num_embeddings=st.integers(10, 50),NEWLINE embedding_dim=st.integers(5, 50).filter(lambda x: x % 4 == 0),NEWLINE num_offsets=st.integers(1, 20),NEWLINE set_qconfig=st.booleans(),NEWLINE )NEWLINE @skipIfNoFBGEMMNEWLINE def test_embedding_bag_api(self, num_embeddings, embedding_dim, num_offsets, set_qconfig):NEWLINE r"""Test execution and serialization for dynamic quantized embedding_bag modules on int8NEWLINE """NEWLINENEWLINE num_lengths = np.random.randint(1, 6)NEWLINE lengths = np.random.randint(0, 21, size=num_lengths).astype(np.int32)NEWLINE num_indices = np.sum(lengths)NEWLINE indices = torch.from_numpy(np.random.randint(low=0, high=num_embeddings, size=num_indices, dtype=np.int64))NEWLINENEWLINE offsets = lengths_to_offsets(lengths)NEWLINE # include the last offsetNEWLINE offsets = torch.cat((offsets, torch.tensor([indices.size(0)], dtype=torch.long)), 0)NEWLINE weights = torch.from_numpy((np.random.random_sample((num_embeddings, embedding_dim)) + 1).astype(np.float32))NEWLINENEWLINE for qdtype in [torch.quint8, torch.quint4x2]:NEWLINE obs = PerChannelMinMaxObserver(dtype=qdtype, qscheme=torch.per_channel_affine_float_qparams, ch_axis=0)NEWLINE obs(weights)NEWLINE # Get the scale and zero point for the weight tensorNEWLINE qparams = obs.calculate_qparams()NEWLINE # Quantize the weights to 8bitsNEWLINE qweight = torch.quantize_per_channel(weights, qparams[0], qparams[1], axis=0, dtype=qdtype)NEWLINE qemb = nnq.EmbeddingBag(num_embeddings=num_embeddings, embedding_dim=embedding_dim,NEWLINE include_last_offset=True, mode='sum', _weight=qweight, dtype=qdtype)NEWLINE qemb(indices, offsets)NEWLINENEWLINE # Ensure the module has the correct weightsNEWLINE self.assertEqual(qweight, qemb.weight())NEWLINENEWLINE w_packed = qemb._packed_params._packed_weightNEWLINE module_out = qemb(indices, offsets)NEWLINENEWLINE # Call the qembedding_bag operator directlyNEWLINE if qdtype == torch.quint8:NEWLINE ref = torch.ops.quantized.embedding_bag_byte(w_packed, indices, offsets, mode=0,NEWLINE per_sample_weights=None,NEWLINE include_last_offset=True)NEWLINE else:NEWLINE ref = torch.ops.quantized.embedding_bag_4bit(w_packed, indices, offsets, mode=0,NEWLINE per_sample_weights=None,NEWLINE include_last_offset=True)NEWLINENEWLINE self.assertEqual(module_out, ref)NEWLINE self.checkEmbeddingSerialization(qemb, num_embeddings, embedding_dim, indices,NEWLINE offsets, set_qconfig, is_emb_bag=True, dtype=qdtype)NEWLINENEWLINENEWLINEclass TestDynamicQuantizedModule(QuantizationTestCase):NEWLINE def _test_qconv_impl(self, q_mod, dq_mod, dim, dtype, bias):NEWLINE in_channels = 3NEWLINE out_channels = 10NEWLINE kernel_size = 2NEWLINE stride = 1NEWLINE padding = 0NEWLINE dilation = 1NEWLINE groups = 1NEWLINE padding_mode = 'zeros'NEWLINENEWLINE if qengine_is_qnnpack():NEWLINE reduce_range = FalseNEWLINE else:NEWLINE reduce_range = TrueNEWLINENEWLINE X_fp32 = torch.randn(*([in_channels] * dim))NEWLINE s, z = _calculate_dynamic_qparams(X_fp32, dtype, reduce_range)NEWLINE X_q = torch.quantize_per_tensor(X_fp32, s, z, dtype)NEWLINE X_dq = torch.dequantize(X_q)NEWLINENEWLINE quantized_module = q_mod(in_channels, out_channels, kernel_size, stride=stride, padding=padding,NEWLINE dilation=dilation, groups=groups, bias=bias, padding_mode=padding_mode)NEWLINE dynamic_module = dq_mod(in_channels, out_channels, kernel_size, stride=stride, padding=padding,NEWLINE dilation=dilation, groups=groups, bias=bias, padding_mode=padding_mode)NEWLINENEWLINE quantized_module.scale, quantized_module.zero_point = s, zNEWLINE dynamic_module.set_weight_bias(*quantized_module._weight_bias())NEWLINENEWLINE Y_q_ref = quantized_module(X_q)NEWLINE Y_ref = torch.dequantize(Y_q_ref)NEWLINENEWLINE Y = dynamic_module(X_dq, reduce_range)NEWLINENEWLINE self.assertEqual(Y, Y_ref)NEWLINENEWLINE # Test serialization of quantized Conv Module using state_dictNEWLINE W_q, b = dynamic_module._weight_bias()NEWLINE model_dict = dynamic_module.state_dict()NEWLINE self.assertEqual(model_dict['weight'], W_q)NEWLINE self.assertEqual(model_dict['bias'], b)NEWLINE bytes_io = io.BytesIO()NEWLINE torch.save(model_dict, bytes_io)NEWLINE bytes_io.seek(0)NEWLINE loaded_dict = torch.load(bytes_io)NEWLINE for key in loaded_dict:NEWLINE self.assertEqual(model_dict[key], loaded_dict[key])NEWLINE loaded_qconv_module = type(dynamic_module)(NEWLINE in_channels, out_channels, kernel_size, stride=stride, padding=padding,NEWLINE dilation=dilation, groups=groups, bias=bias, padding_mode=padding_mode)NEWLINE loaded_qconv_module.load_state_dict(loaded_dict)NEWLINENEWLINE self.assertTrue(dir(loaded_qconv_module) == dir(dynamic_module))NEWLINE self.assertTrue(dynamic_module._get_name() == loaded_qconv_module._get_name())NEWLINE self.assertTrue(hasattr(loaded_qconv_module, '_packed_params'))NEWLINE self.assertTrue(hasattr(loaded_qconv_module, '_weight_bias'))NEWLINENEWLINE self.assertEqual(dynamic_module.weight(), loaded_qconv_module.weight())NEWLINE if bias:NEWLINE self.assertEqual(dynamic_module.bias(), loaded_qconv_module.bias())NEWLINE self.assertEqual(dynamic_module.scale, loaded_qconv_module.scale)NEWLINE self.assertEqual(dynamic_module.zero_point,NEWLINE loaded_qconv_module.zero_point)NEWLINE Y_loaded = loaded_qconv_module(X_fp32, reduce_range)NEWLINE np.testing.assert_array_almost_equal(NEWLINE Y.numpy(), Y_loaded.numpy(), decimal=0)NEWLINENEWLINE # Test serializationNEWLINE b = io.BytesIO()NEWLINE torch.save(dynamic_module, b)NEWLINE b.seek(0)NEWLINE loaded_conv = torch.load(b)NEWLINENEWLINE self.assertEqual(loaded_conv.bias(), dynamic_module.bias())NEWLINE self.assertEqual(loaded_conv.scale, dynamic_module.scale)NEWLINE self.assertEqual(loaded_conv.zero_point,NEWLINE dynamic_module.zero_point)NEWLINENEWLINE # Test copy and deepcopyNEWLINE copied_conv = copy.copy(dynamic_module)NEWLINE self.assertEqual(copied_conv.bias(), dynamic_module.bias())NEWLINE self.assertEqual(copied_conv.scale, dynamic_module.scale)NEWLINE self.assertEqual(copied_conv.zero_point,NEWLINE dynamic_module.zero_point)NEWLINE Y_copied = copied_conv(X_fp32, reduce_range)NEWLINE np.testing.assert_array_almost_equal(NEWLINE Y.numpy(), Y_copied.numpy(), decimal=0)NEWLINENEWLINE deepcopied_conv = copy.deepcopy(dynamic_module)NEWLINE self.assertEqual(deepcopied_conv.bias(), dynamic_module.bias())NEWLINE self.assertEqual(deepcopied_conv.scale, dynamic_module.scale)NEWLINE self.assertEqual(deepcopied_conv.zero_point,NEWLINE dynamic_module.zero_point)NEWLINE Y_deepcopied = copied_conv(X_fp32, reduce_range)NEWLINE np.testing.assert_array_almost_equal(NEWLINE Y.numpy(), Y_deepcopied.numpy(), decimal=0)NEWLINENEWLINE # need to fix thisNEWLINE # JIT testingNEWLINE self.checkScriptable(NEWLINE dynamic_module, [[X_dq]],NEWLINE check_save_load=True)NEWLINENEWLINE # Test from_floatNEWLINE conv_module = dynamic_module._FLOAT_MODULE(in_channels, out_channels, kernel_size)NEWLINE conv_module.qconfig = torch.ao.quantization.default_dynamic_qconfig # type: ignore[assignment]NEWLINE prepare_dynamic(conv_module)NEWLINE conv_module(X_dq)NEWLINE quantized_conv_module = dq_mod.from_float(conv_module)NEWLINENEWLINE # Smoke test to make sure the module actually runsNEWLINE quantized_conv_module(X_dq)NEWLINENEWLINE # Smoke test extra_reprNEWLINE self.assertEqual(dynamic_module._get_name(), quantized_conv_module._get_name())NEWLINENEWLINE @override_qenginesNEWLINE def test_dynamic_conv1d(self):NEWLINE q_mod = torch.nn.quantized.Conv1dNEWLINE dq_mod = torch.nn.quantized.dynamic.Conv1dNEWLINE dim = 3NEWLINE dtype = torch.quint8NEWLINENEWLINE for bias in [True, False]:NEWLINE self._test_qconv_impl(q_mod, dq_mod, dim, dtype, bias)NEWLINENEWLINE @override_qenginesNEWLINE def test_dynamic_conv2d(self):NEWLINE q_mod = torch.nn.quantized.Conv2dNEWLINE dq_mod = torch.nn.quantized.dynamic.Conv2dNEWLINE dim = 4NEWLINE dtype = torch.quint8NEWLINENEWLINE for bias in [True, False]:NEWLINE self._test_qconv_impl(q_mod, dq_mod, dim, dtype, bias)NEWLINENEWLINE @override_qenginesNEWLINE def test_dynamic_conv3d(self):NEWLINE q_mod = torch.nn.quantized.Conv3dNEWLINE dq_mod = torch.nn.quantized.dynamic.Conv3dNEWLINE dim = 5NEWLINE dtype = torch.quint8NEWLINENEWLINE if qengine_is_qnnpack():NEWLINE return # qnnpack doesn't support unpacking conv3dNEWLINE for bias in [True, False]:NEWLINE self._test_qconv_impl(q_mod, dq_mod, dim, dtype, bias)NEWLINENEWLINE @override_qenginesNEWLINE def test_dynamic_convtranspose1d(self):NEWLINE q_mod = torch.nn.quantized.ConvTranspose1dNEWLINE dq_mod = torch.nn.quantized.dynamic.ConvTranspose1dNEWLINE dim = 3NEWLINE dtype = torch.quint8NEWLINENEWLINE for bias in [True, False]:NEWLINE self._test_qconv_impl(q_mod, dq_mod, dim, dtype, bias)NEWLINENEWLINE @override_qenginesNEWLINE def test_dynamic_convtranspose2d(self):NEWLINE q_mod = torch.nn.quantized.ConvTranspose2dNEWLINE dq_mod = torch.nn.quantized.dynamic.ConvTranspose2dNEWLINE dim = 4NEWLINE dtype = torch.quint8NEWLINENEWLINE for bias in [True, False]:NEWLINE self._test_qconv_impl(q_mod, dq_mod, dim, dtype, bias)NEWLINENEWLINE @override_qenginesNEWLINE def test_dynamic_convtranspose3d(self):NEWLINE q_mod = torch.nn.quantized.ConvTranspose3dNEWLINE dq_mod = torch.nn.quantized.dynamic.ConvTranspose3dNEWLINE dim = 5NEWLINE dtype = torch.quint8NEWLINENEWLINE if qengine_is_qnnpack():NEWLINE return # qnnpack doesn't support unpacking conv3dNEWLINE for bias in [True, False]:NEWLINE self._test_qconv_impl(q_mod, dq_mod, dim, dtype, bias)NEWLINENEWLINE @given(NEWLINE batch_size=st.integers(1, 5),NEWLINE in_features=st.integers(16, 32),NEWLINE out_features=st.integers(4, 8),NEWLINE use_bias=st.booleans(),NEWLINE use_default_observer=st.booleans(),NEWLINE )NEWLINE @override_qenginesNEWLINE def test_linear_api(self, batch_size, in_features, out_features, use_bias, use_default_observer):NEWLINE """test API functionality for nn.quantized.dynamic.Linear"""NEWLINE W = torch.rand(out_features, in_features).float()NEWLINE W_scale, W_zp = _calculate_dynamic_qparams(W, torch.qint8)NEWLINE W_q = torch.quantize_per_tensor(W, W_scale, W_zp, torch.qint8)NEWLINE X = torch.rand(batch_size, in_features).float()NEWLINE B = torch.rand(out_features).float() if use_bias else NoneNEWLINE qlinear = nnqd.Linear(in_features, out_features)NEWLINE # Run module with default-initialized parameters.NEWLINE # This tests that the constructor is correct.NEWLINE qlinear.set_weight_bias(W_q, B)NEWLINE qlinear(X)NEWLINENEWLINE # Simple round-trip test to ensure weight()/set_weight() APINEWLINE self.assertEqual(qlinear.weight(), W_q)NEWLINE W_pack = qlinear._packed_params._packed_paramsNEWLINE Z_dq = qlinear(X)NEWLINENEWLINE # Check if the module implementation matches calling theNEWLINE # ops directlyNEWLINE Z_ref = torch.ops.quantized.linear_dynamic(X, W_pack, reduce_range=True)NEWLINE self.assertEqual(Z_ref, Z_dq)NEWLINENEWLINE # Test serialization of dynamic quantized Linear Module using state_dictNEWLINE model_dict = qlinear.state_dict()NEWLINE b = io.BytesIO()NEWLINE torch.save(model_dict, b)NEWLINE b.seek(0)NEWLINE loaded_dict = torch.load(b)NEWLINE for key in model_dict:NEWLINE if isinstance(model_dict[key], torch._C.ScriptObject):NEWLINE assert isinstance(loaded_dict[key], torch._C.ScriptObject)NEWLINE w_model, b_model = torch.ops.quantized.linear_unpack(model_dict[key])NEWLINE w_loaded, b_loaded = torch.ops.quantized.linear_unpack(loaded_dict[key])NEWLINE self.assertEqual(w_model, w_loaded)NEWLINE self.assertEqual(b_model, b_loaded)NEWLINE else:NEWLINE self.assertEqual(model_dict[key], loaded_dict[key])NEWLINE loaded_qlinear = nnqd.Linear(in_features, out_features)NEWLINE loaded_qlinear.load_state_dict(loaded_dict)NEWLINENEWLINE linear_unpack = torch.ops.quantized.linear_unpackNEWLINE self.assertEqual(linear_unpack(qlinear._packed_params._packed_params),NEWLINE linear_unpack(loaded_qlinear._packed_params._packed_params))NEWLINE if use_bias:NEWLINE self.assertEqual(qlinear.bias(), loaded_qlinear.bias())NEWLINE self.assertTrue(dir(qlinear) == dir(loaded_qlinear))NEWLINE self.assertTrue(hasattr(qlinear, '_packed_params'))NEWLINE self.assertTrue(hasattr(loaded_qlinear, '_packed_params'))NEWLINE self.assertTrue(hasattr(qlinear, '_weight_bias'))NEWLINE self.assertTrue(hasattr(loaded_qlinear, '_weight_bias'))NEWLINENEWLINE self.assertEqual(qlinear._weight_bias(), loaded_qlinear._weight_bias())NEWLINE self.assertEqual(qlinear._weight_bias(), torch.ops.quantized.linear_unpack(qlinear._packed_params._packed_params))NEWLINE Z_dq2 = qlinear(X)NEWLINE self.assertEqual(Z_dq, Z_dq2)NEWLINENEWLINE b = io.BytesIO()NEWLINE torch.save(qlinear, b)NEWLINE b.seek(0)NEWLINE loaded = torch.load(b)NEWLINE self.assertEqual(qlinear.weight(), loaded.weight())NEWLINE self.assertEqual(qlinear.zero_point, loaded.zero_point)NEWLINENEWLINE # Test JITNEWLINE self.checkScriptable(qlinear, [[X]], check_save_load=True)NEWLINENEWLINE modules_under_test = [torch.nn.Linear, torch.nn.modules.linear.NonDynamicallyQuantizableLinear]NEWLINE for mut in modules_under_test:NEWLINE # Test from_floatNEWLINE float_linear = mut(in_features, out_features).float()NEWLINE if use_default_observer:NEWLINE float_linear.qconfig = torch.ao.quantization.default_dynamic_qconfigNEWLINE prepare_dynamic(float_linear)NEWLINE float_linear(X.float())NEWLINE quantized_float_linear = nnqd.Linear.from_float(float_linear)NEWLINENEWLINE # Smoke test to make sure the module actually runsNEWLINE quantized_float_linear(X)NEWLINENEWLINE # Smoke test extra_reprNEWLINE self.assertTrue('QuantizedLinear' in str(quantized_float_linear))NEWLINENEWLINE @given(NEWLINE dtype=st.sampled_from([torch.qint8, torch.float16]),NEWLINE bidirectional=st.booleans(),NEWLINE )NEWLINE @override_qenginesNEWLINE def test_lstm_api(self, dtype, bidirectional):NEWLINE r"""Test execution and serialization for dynamic quantized lstm modules on int8 and fp16NEWLINE """NEWLINE # Check that module matches the numerics of the op and ensure that module can beNEWLINE # instantiated for all engines and dtypesNEWLINE seq_len = 4NEWLINE batch = 2NEWLINE input_size = 3NEWLINE hidden_size = 7NEWLINE num_layers = 2NEWLINE bias = TrueNEWLINE weight_keys = []NEWLINE bias_keys = []NEWLINE num_directions = 2 if bidirectional else 1NEWLINE for layer in range(num_layers):NEWLINE for direction in range(num_directions):NEWLINE suffix = '_reverse' if direction == 1 else ''NEWLINE key_name1 = 'weight_ih_l{layer_idx}{suffix}'.format(layer_idx=layer, suffix=suffix)NEWLINE key_name2 = 'weight_hh_l{layer_idx}{suffix}'.format(layer_idx=layer, suffix=suffix)NEWLINE weight_keys.append(key_name1)NEWLINE weight_keys.append(key_name2)NEWLINE key_name1 = 'bias_ih_l{layer_idx}{suffix}'.format(layer_idx=layer, suffix=suffix)NEWLINE key_name2 = 'bias_hh_l{layer_idx}{suffix}'.format(layer_idx=layer, suffix=suffix)NEWLINE bias_keys.append(key_name1)NEWLINE bias_keys.append(key_name2)NEWLINENEWLINE if not (dtype == torch.float16 and torch.backends.quantized.engine == "qnnpack"):NEWLINE # fp16 dynamic quant is not supported for qnnpackNEWLINE x = torch.randn(seq_len, batch, input_size)NEWLINE h = torch.randn(num_layers * (bidirectional + 1), batch, hidden_size)NEWLINE c = torch.randn(num_layers * (bidirectional + 1), batch, hidden_size)NEWLINE cell_dq = torch.nn.quantized.dynamic.LSTM(input_size=input_size,NEWLINE hidden_size=hidden_size,NEWLINE num_layers=num_layers,NEWLINE bias=bias,NEWLINE batch_first=False,NEWLINE dropout=0.0,NEWLINE bidirectional=bidirectional,NEWLINE dtype=dtype)NEWLINE ref_dq = torch.nn.quantized.dynamic.LSTM(input_size=input_size,NEWLINE hidden_size=hidden_size,NEWLINE num_layers=num_layers,NEWLINE bias=bias,NEWLINE batch_first=False,NEWLINE dropout=0.0,NEWLINE bidirectional=bidirectional,NEWLINE dtype=dtype)NEWLINENEWLINE _all_params = ([m.param for m in cell_dq._all_weight_values])NEWLINE result = torch.quantized_lstm(x, (h, c),NEWLINE _all_params,NEWLINE cell_dq.bias,NEWLINE cell_dq.num_layers,NEWLINE float(cell_dq.dropout),NEWLINE False,NEWLINE bidirectional,NEWLINE False,NEWLINE dtype=dtype,NEWLINE use_dynamic=True)NEWLINENEWLINENEWLINE y, (h, c) = cell_dq(x, (h, c))NEWLINE self.assertEqual(result[0], y)NEWLINE self.assertEqual(result[1], h)NEWLINE self.assertEqual(result[2], c)NEWLINE x = torch.randn(10, 20, 3)NEWLINE self.check_eager_serialization(cell_dq, ref_dq, [x])NEWLINE self.check_weight_bias_api(cell_dq, weight_keys, bias_keys)NEWLINENEWLINE @override_qenginesNEWLINE def test_gru_api(self):NEWLINE r"""Test execution and serialization for dynamic quantized lstm modules on int8 and fp16NEWLINE """NEWLINE # Check that module matches the numerics of the op and ensure that module can beNEWLINE # instantiated for all engines and dtypesNEWLINENEWLINE for dtype in [torch.qint8, torch.float16]:NEWLINE if dtype == torch.float16 and torch.backends.quantized.engine == "qnnpack":NEWLINE # fp16 dynamic quant is not supported for qnnpackNEWLINE continueNEWLINE # Test default instantiationNEWLINE seq_len = 4NEWLINE batch = 2NEWLINE input_size = 3NEWLINE hidden_size = 7NEWLINE num_layers = 2NEWLINE bias = TrueNEWLINE bidirectional = FalseNEWLINENEWLINE x = torch.rand(seq_len, batch, input_size)NEWLINE h = torch.rand(num_layers * (bidirectional + 1), batch, hidden_size)NEWLINENEWLINENEWLINE cell_dq = torch.nn.quantized.dynamic.GRU(input_size=input_size,NEWLINE hidden_size=hidden_size,NEWLINE num_layers=num_layers,NEWLINE bias=bias,NEWLINE batch_first=False,NEWLINE dropout=0.0,NEWLINE bidirectional=bidirectional,NEWLINE dtype=dtype)NEWLINENEWLINE _all_params = ([m.param for m in cell_dq._all_weight_values])NEWLINE result = torch.quantized_gru(x,NEWLINE h,NEWLINE _all_params,NEWLINE cell_dq.bias,NEWLINE cell_dq.num_layers,NEWLINE float(cell_dq.dropout),NEWLINE False,NEWLINE bidirectional,NEWLINE False)NEWLINENEWLINENEWLINE y, h = cell_dq(x, h)NEWLINE self.assertEqual(result[0], y, msg="GRU module API failed")NEWLINE self.assertEqual(result[1], h, msg="GRU module API failed")NEWLINENEWLINE @given(NEWLINE dtype=st.sampled_from([torch.qint8, torch.float16]),NEWLINE )NEWLINE @override_qenginesNEWLINE def test_cell_api(self, dtype):NEWLINE r"""Test execution and serialization for dynamic quantized lstm modules on int8 and fp16NEWLINE """NEWLINE # Check that module matches the numerics of the op and ensure that module can beNEWLINE # instantiated for all engines and dtypesNEWLINE batch = 7NEWLINE input_size = 3NEWLINE hidden_size = 7NEWLINE bias = TrueNEWLINENEWLINE x = torch.rand(batch, input_size)NEWLINE h = torch.rand(batch, hidden_size)NEWLINE cell_dict = {'LSTMCell': torch.nn.quantized.dynamic.LSTMCell,NEWLINE 'GRUCell': torch.nn.quantized.dynamic.GRUCell,NEWLINE 'RNNTanh': torch.nn.quantized.dynamic.RNNCell,NEWLINE 'RNNReLU': torch.nn.quantized.dynamic.RNNCellNEWLINE }NEWLINE state = {'LSTMCell': (h, h),NEWLINE 'GRUCell': h,NEWLINE 'RNNTanh': h,NEWLINE 'RNNReLU': h}NEWLINENEWLINE qfn_dict = {'LSTMCell': torch.ops.quantized.quantized_lstm_cell_dynamic,NEWLINE 'GRUCell': torch.ops.quantized.quantized_gru_cell_dynamic,NEWLINE 'RNNTanh': torch.ops.quantized.quantized_rnn_tanh_cell_dynamic,NEWLINE 'RNNReLU': torch.ops.quantized.quantized_rnn_relu_cell_dynamic}NEWLINENEWLINE for rnn_type in cell_dict.keys():NEWLINE if not (dtype == torch.float16 and torch.backends.quantized.engine == "qnnpack"):NEWLINE # fp16 dynamic quant is not supported for qnnpackNEWLINE kwargs = {'input_size': input_size, 'hidden_size': hidden_size, 'bias': bias, 'dtype': dtype}NEWLINE if rnn_type == 'RNNReLU':NEWLINE kwargs['nonlinearity'] = "relu"NEWLINE elif rnn_type == 'RNNTanh':NEWLINE kwargs['nonlinearity'] = "tanh"NEWLINENEWLINE cell_dq = cell_dict[rnn_type](**kwargs)NEWLINE result = qfn_dict[rnn_type](x, state[rnn_type],NEWLINE cell_dq._packed_weight_ih, cell_dq._packed_weight_hh,NEWLINE cell_dq.bias_ih, cell_dq.bias_hh)NEWLINE result_module = cell_dq(x, state[rnn_type])NEWLINE self.assertEqual(result[0], result_module[0], msg="RNNCell module API failed")NEWLINE self.assertEqual(result[1], result_module[1], msg="RNNCell module API failed")NEWLINE weight_keys = ['weight_ih', 'weight_hh']NEWLINE bias_keys = ['bias_ih', 'bias_hh']NEWLINE self.check_eager_serialization(cell_dq, cell_dict[rnn_type](**kwargs), [x])NEWLINE self.check_weight_bias_api(cell_dq, weight_keys, bias_keys)NEWLINENEWLINEclass TestReferenceQuantizedModule(QuantizationTestCase):NEWLINE def _quant_dequant_weight(self, weight, weight_qparams):NEWLINE qscheme = weight_qparams["qscheme"]NEWLINE scale = weight_qparams["scale"]NEWLINE zero_point = weight_qparams["zero_point"]NEWLINE dtype = weight_qparams["dtype"]NEWLINE if qscheme == torch.per_tensor_affine:NEWLINE weight = torch.quantize_per_tensor(weight, scale, zero_point, dtype)NEWLINE else:NEWLINE # per channel affineNEWLINE axis = weight_qparams["axis"]NEWLINE weight = torch.quantize_per_channel(weight, scale, zero_point, axis, dtype)NEWLINE weight = weight.dequantize()NEWLINE return weightNEWLINENEWLINE # TODO: add tests for conv and linearNEWLINE def test_rnn_cell(self):NEWLINE """ Checks the rnn cell reference quantized modules has correct numericsNEWLINE This includes LSTMCell, GRUCell, RNNCellNEWLINE """NEWLINE batch = 7NEWLINE input_size = 3NEWLINE hidden_size = 7NEWLINE bias = TrueNEWLINENEWLINE x = torch.rand(batch, input_size)NEWLINE h = torch.rand(batch, hidden_size)NEWLINE cell_dict = {'LSTMCell': torch.nn.LSTMCell,NEWLINE 'GRUCell': torch.nn.GRUCell,NEWLINE 'RNNTanh': torch.nn.RNNCell,NEWLINE 'RNNReLU': torch.nn.RNNCellNEWLINE }NEWLINE state = {'LSTMCell': (h, h),NEWLINE 'GRUCell': h,NEWLINE 'RNNTanh': h,NEWLINE 'RNNReLU': h}NEWLINENEWLINE qfn_dict = {'LSTMCell': nnqr.LSTMCell,NEWLINE 'GRUCell': nnqr.GRUCell,NEWLINE 'RNNTanh': nnqr.RNNCell,NEWLINE 'RNNReLU': nnqr.RNNCell}NEWLINENEWLINE for rnn_type in cell_dict.keys():NEWLINE kwargs = {'input_size': input_size, 'hidden_size': hidden_size, 'bias': bias}NEWLINE if rnn_type == 'RNNReLU':NEWLINE kwargs['nonlinearity'] = "relu"NEWLINE elif rnn_type == 'RNNTanh':NEWLINE kwargs['nonlinearity'] = "tanh"NEWLINENEWLINE fp_cell = cell_dict[rnn_type](**kwargs)NEWLINE # initialize ref rnn cell moduleNEWLINE weight_qparams = {NEWLINE 'qscheme': torch.per_tensor_affine,NEWLINE 'dtype': torch.quint8,NEWLINE 'scale': 2.0,NEWLINE 'zero_point': 5NEWLINE }NEWLINE weight_qparams_dict = {NEWLINE "weight_ih": weight_qparams,NEWLINE "weight_hh": weight_qparams,NEWLINE }NEWLINE ref_kwargs = kwargs.copy()NEWLINE ref_kwargs["weight_qparams_dict"] = weight_qparams_dictNEWLINE ref_cell = qfn_dict[rnn_type](**ref_kwargs)NEWLINE # reassign the weights from fp32 rnn cell moduleaNEWLINE ref_cell.weight_ih = fp_cell.weight_ihNEWLINE ref_cell.weight_hh = fp_cell.weight_hhNEWLINE ref_cell.bias_ih = fp_cell.bias_ihNEWLINE ref_cell.bias_hh = fp_cell.bias_hhNEWLINENEWLINE ref_res = ref_cell(x, state[rnn_type])NEWLINENEWLINE # change the weight of fp_res, we first want to run a quantie andNEWLINE # dequantize on the weightNEWLINE fp_cell.weight_ih = torch.nn.Parameter(self._quant_dequant_weight(fp_cell.weight_ih, weight_qparams_dict["weight_ih"]))NEWLINE fp_cell.weight_hh = torch.nn.Parameter(self._quant_dequant_weight(fp_cell.weight_hh, weight_qparams_dict["weight_hh"]))NEWLINE fp_res = fp_cell(x, state[rnn_type])NEWLINE self.assertEqual(ref_res[0], fp_res[0], msg="RNNCell module API failed")NEWLINE self.assertEqual(ref_res[1], fp_res[1], msg="RNNCell module API failed")NEWLINENEWLINE def test_rnn(self):NEWLINE """ Checks the rnn reference quantized modules has correct numericsNEWLINE This includes LSTMNEWLINE """NEWLINE seq_len = 4NEWLINE batch = 2NEWLINE input_size = 3NEWLINE hidden_size = 7NEWLINE num_layers = 2NEWLINE bias = TrueNEWLINE weight_keys = []NEWLINE bias_keys = []NEWLINE for bidirectional in [True, False]:NEWLINE num_directions = 2 if bidirectional else 1NEWLINE for layer in range(num_layers):NEWLINE for direction in range(num_directions):NEWLINE suffix = '_reverse' if direction == 1 else ''NEWLINE key_name1 = 'weight_ih_l{layer_idx}{suffix}'.format(layer_idx=layer, suffix=suffix)NEWLINE key_name2 = 'weight_hh_l{layer_idx}{suffix}'.format(layer_idx=layer, suffix=suffix)NEWLINE weight_keys.append(key_name1)NEWLINE weight_keys.append(key_name2)NEWLINE key_name1 = 'bias_ih_l{layer_idx}{suffix}'.format(layer_idx=layer, suffix=suffix)NEWLINE key_name2 = 'bias_hh_l{layer_idx}{suffix}'.format(layer_idx=layer, suffix=suffix)NEWLINE bias_keys.append(key_name1)NEWLINE bias_keys.append(key_name2)NEWLINENEWLINE x = torch.randn(seq_len, batch, input_size)NEWLINE h = torch.randn(num_layers * (bidirectional + 1), batch, hidden_size)NEWLINE c = torch.randn(num_layers * (bidirectional + 1), batch, hidden_size)NEWLINE fp32_rnn = torch.nn.LSTM(NEWLINE input_size=input_size,NEWLINE hidden_size=hidden_size,NEWLINE num_layers=num_layers,NEWLINE bias=bias,NEWLINE batch_first=False,NEWLINE dropout=0.0,NEWLINE bidirectional=bidirectional)NEWLINE # initialize ref rnn moduleNEWLINE weight_qparams = {NEWLINE 'qscheme': torch.per_tensor_affine,NEWLINE 'dtype': torch.quint8,NEWLINE 'scale': 2.0,NEWLINE 'zero_point': 5NEWLINE }NEWLINE weight_qparams_dict = {key: weight_qparams for key in fp32_rnn._flat_weights_names}NEWLINE ref_rnn = nnqr.LSTM(NEWLINE input_size=input_size,NEWLINE hidden_size=hidden_size,NEWLINE num_layers=num_layers,NEWLINE bias=bias,NEWLINE batch_first=False,NEWLINE dropout=0.0,NEWLINE bidirectional=bidirectional,NEWLINE weight_qparams_dict=weight_qparams_dict)NEWLINE ref_rnn._flat_weights = fp32_rnn._flat_weightsNEWLINENEWLINE # quantize and dequantize the weights for fp32_rnn moduleNEWLINE fp32_rnn._flat_weights = [self._quant_dequant_weight(w, weight_qparams) for w in fp32_rnn._flat_weights]NEWLINENEWLINE fp32_res = fp32_rnn(x, (h, c))NEWLINE ref_res = ref_rnn(x, (h, c))NEWLINE self.assertEqual(fp32_res, ref_res)NEWLINENEWLINE def test_sparse(self):NEWLINE """ Embedding and EmbeddingBagNEWLINE """NEWLINE num_embeddings = 10NEWLINE embedding_dim = 3NEWLINE # embedding inputNEWLINE ex = torch.LongTensor([[1, 2, 4, 5], [4, 3, 2, 9]])NEWLINENEWLINE # embedding bag inputNEWLINE ebx = torch.tensor([1, 2, 4, 5, 4, 3, 2, 9], dtype=torch.long)NEWLINE offsets = torch.tensor([0, 4], dtype=torch.long)NEWLINENEWLINE fp_to_ref = {NEWLINE nn.Embedding: (nnqr.Embedding, (ex,)),NEWLINE nn.EmbeddingBag: (nnqr.EmbeddingBag, (ebx, offsets)),NEWLINE }NEWLINENEWLINE per_tensor_weight_qparams = {NEWLINE 'qscheme': torch.per_tensor_affine,NEWLINE 'dtype': torch.quint8,NEWLINE 'scale': 2.0,NEWLINE 'zero_point': 5,NEWLINE }NEWLINENEWLINE per_channel_weight_qparams = {NEWLINE 'qscheme': torch.per_channel_affine,NEWLINE 'dtype': torch.quint8,NEWLINE 'scale': torch.randn(10),NEWLINE 'zero_point': torch.randint(0, 255, (10,)),NEWLINE 'axis': 0,NEWLINE }NEWLINENEWLINE per_channel_weight_qparams_quint4x2 = {NEWLINE 'qscheme': torch.per_channel_affine_float_qparams,NEWLINE 'dtype': torch.quint4x2,NEWLINE 'scale': torch.randn(10),NEWLINE 'zero_point': torch.randint(0, 255, (10,)),NEWLINE 'axis': 0,NEWLINE }NEWLINENEWLINE weight_qparams_options = [NEWLINE per_tensor_weight_qparams,NEWLINE per_channel_weight_qparams,NEWLINE per_channel_weight_qparams_quint4x2,NEWLINE ]NEWLINE for fp_cls, weight_qparams in itertools.product([nn.Embedding, nn.EmbeddingBag], weight_qparams_options):NEWLINE # TODO: torch.quint4x2 not supported in quantize_per_channel, need to add supportNEWLINE if weight_qparams['dtype'] == torch.quint4x2:NEWLINE continueNEWLINE ref_cls, args = fp_to_ref[fp_cls]NEWLINENEWLINE fp32_embedding = fp_cls(num_embeddings, embedding_dim)NEWLINENEWLINE ref_embedding = ref_cls(num_embeddings, embedding_dim, weight_qparams=weight_qparams)NEWLINE ref_embedding.weight = fp32_embedding.weightNEWLINENEWLINE # quantize and dequantize the weight for fp32 moduleNEWLINE fp32_embedding.weight = torch.nn.Parameter(self._quant_dequant_weight(fp32_embedding.weight, weight_qparams))NEWLINENEWLINE fp32_res = fp32_embedding(*args)NEWLINE ref_res = ref_embedding(*args)NEWLINE self.assertEqual(fp32_res, ref_res)NEWLINE |
import open3d as o3dNEWLINENEWLINENEWLINEFilterScope=o3d.geometry.FilterScopeNEWLINENEWLINEdef removePCDOutlier(pcd,voxel_size=0.001,nb_points=32,radius=0.004):NEWLINE '''NEWLINE 尝试除去点云离群点NEWLINE '''NEWLINE downpcd=pcd.voxel_down_sample(voxel_size=voxel_size)NEWLINE inlierPcd,idxs=downpcd.remove_radius_outlier(nb_points=nb_points,radius=radius)NEWLINE return inlierPcd,idxsNEWLINENEWLINEdef smoothMeshSimple(mesh,iterTimes=1):NEWLINE return mesh.filter_smooth_simple(number_of_iterations=iterTimes,filter_scope=FilterScope.Vertex)NEWLINENEWLINEdef smoothMeshLaplacian(mesh,iterTimes=10,nLambda=0.85):NEWLINE return mesh.filter_smooth_laplacian(NEWLINE number_of_iterations=iterTimes,filter_scope=FilterScope.Vertex,NEWLINE **{"lambda":nLambda}NEWLINE )NEWLINENEWLINEdef smoothMeshTaubin(mesh,iterTimes=30,nLambda=0.85,nMu=-0.25):NEWLINE return mesh.filter_smooth_taubin(number_of_iterations=iterTimes,filter_scope=FilterScope.Vertex,NEWLINE **{"lambda":nLambda,"mu":nMu}NEWLINE )NEWLINENEWLINEdef postProcessMesh(mesh,smoothFunc,*args,**kw):NEWLINE mesh=mesh.remove_non_manifold_edges()NEWLINE mesh=mesh.remove_degenerate_triangles()NEWLINE mesh=mesh.remove_duplicated_triangles()NEWLINE mesh=mesh.remove_unreferenced_vertices()NEWLINE mesh=mesh.remove_duplicated_vertices()NEWLINE meshf=mesh.filter_sharpen(number_of_iterations=1,strength=0.05,filter_scope=FilterScope.Color)NEWLINE mesh.vertex_colors=meshf.vertex_colorsNEWLINE mesh=smoothFunc(mesh,*args,**kw)NEWLINE mesh.compute_vertex_normals()NEWLINE return meshNEWLINE |
# -*- coding: utf-8 -*-NEWLINE"""NEWLINECreated on Tue Dec 13 01:25:12 2017NEWLINEComplete document analysis:NEWLINE1) Fuzzy String compare for file similarityNEWLINE2) Word frequency counterNEWLINE3) Phrase frequency counterNEWLINE@author: MStattelmanNEWLINE"""NEWLINENEWLINE#ImportsNEWLINEimport pandas as pdNEWLINEimport globNEWLINEimport reNEWLINEimport osNEWLINEimport nltkNEWLINEimport collectionsNEWLINEfrom collections import CounterNEWLINEfrom nltk import ngramsNEWLINEimport sysNEWLINEfrom math import logNEWLINEimport timeNEWLINEimport difflibNEWLINEimport itertoolsNEWLINEimport uuidNEWLINEfrom functools import reduceNEWLINEfrom statistics import mean, stdevNEWLINENEWLINENEWLINENEWLINE#--------------Set up directories and VariablesNEWLINE#Set start time to calculate time of processingNEWLINEstart = time.time()NEWLINE#Set file extension for specific filetypesNEWLINEfileext = '.txt'NEWLINE#Set directory of files for processingNEWLINEcompdir = 'datafiles/'NEWLINE#Create a output directory based on a UIDNEWLINEgui = os.path.join(str(uuid.uuid4().hex))NEWLINEoutdir = gui +'/'NEWLINEif not os.path.exists(outdir):NEWLINE os.makedirs(outdir)NEWLINENEWLINE#get all of the files in the directory into a listNEWLINEtxt_files = list(filter(lambda x: x.endswith(fileext), os.listdir(compdir)))NEWLINENEWLINEdef geo_mean_calc(n):NEWLINE """NEWLINE Calculate the GeomaenNEWLINE """NEWLINE geomean = lambda n: reduce(lambda x,y: x*y, n) ** (1.0 / len(n))NEWLINE return geomean(n)NEWLINENEWLINENEWLINEdef compareEach(x,y):NEWLINE """NEWLINE Compare the 2 files passed in using fuzzy string compareNEWLINE """NEWLINE with open(compdir + x, 'r') as myfile:NEWLINE data=myfile.read().replace('\n', '').lower()NEWLINE myfile.close()NEWLINE with open(compdir + y, 'r') as myfile2:NEWLINE data2=myfile2.read().replace('\n', '').lower() NEWLINE myfile2.close()NEWLINE NEWLINE return difflib.SequenceMatcher(None, data, data2).ratio()NEWLINE NEWLINE#Set up lists for file names and Fuzzy logic calculationsNEWLINEaList = []NEWLINEf1 = []NEWLINEf2 = []NEWLINEbList = []NEWLINE#Loop through each list item and compare it against the other itemsNEWLINEfor a, b in itertools.combinations(txt_files, 2):NEWLINE aList.append("File ["+a+"] and file ["+b+"] has a similarity of ");NEWLINE f1.append(a)NEWLINE f2.append(b)NEWLINE bList.append(compareEach(a,b));NEWLINE NEWLINENEWLINE#Combine both lists into a corolary dictionaryNEWLINEd= dict(zip(aList, bList))NEWLINENEWLINE#Save sorted dict as new dictionary from most similar to leastNEWLINEd1 = dict(sorted(d.items(), key=lambda x: x[1], reverse=True))NEWLINENEWLINE#Save results to file:NEWLINEfo = open(outdir+'datafile-comparison.txt', "w")NEWLINE#Print Headers to fileNEWLINEfo.write('File similarity ranked from most to least similar:\n\n')NEWLINEfo.write('Geometric Mean:'+str(geo_mean_calc(bList))+'\n\n')NEWLINEfo.write('Arithmatic Mean:'+str(mean(bList))+'\n\n')NEWLINE#Print Output to fileNEWLINEfor k, v in d1.items():NEWLINE fo.write(str(k) + ' >>> '+ str(v) + '\n\n')NEWLINEfo.close()NEWLINENEWLINENEWLINENEWLINE#Use tweet tokenizer to prevent contracted words from splitingNEWLINEfrom nltk.tokenize import TweetTokenizerNEWLINENEWLINEdef remove_punctuation(text):NEWLINE # Removes all punctuation and conotation from the string and returns a 'plain' stringNEWLINE punctuation2 = '-&'+'®©™€â´‚³©¥ã¼•ž®è±äüöž!@#“§$%^*()î_+€$=¿{”}[]:«;"»\â¢|<>,.?/~`0123456789'NEWLINE for sign in punctuation2:NEWLINE text = text.replace(sign, " ")NEWLINE return textNEWLINENEWLINENEWLINE#Set length of word combinations for use in counters.NEWLINEphrase_len = 4NEWLINEterm_len = 1NEWLINENEWLINEcorpus = []NEWLINEpath = compdirNEWLINENEWLINEfile_list = []NEWLINEos.chdir(path)NEWLINE#Get all files in the directory loaded into the corpusNEWLINEfor file in glob.glob("*.txt"):NEWLINE file_list.append(file)NEWLINE f = open(file)NEWLINE corpus.append(remove_punctuation(f.read()))NEWLINE f.close()NEWLINENEWLINEfrequencies0 = Counter([])NEWLINEfrequencies = Counter([])NEWLINE#Cycle through corpus to generate frequencies metricsNEWLINEfor text in corpus:NEWLINE tknzr = TweetTokenizer()NEWLINE token = tknzr.tokenize(text)NEWLINE #Frequency for wordsNEWLINE single = ngrams(token, term_len)NEWLINE frequencies0 += Counter(single)NEWLINE #Frequency for phrasesNEWLINE quadgrams = ngrams(token, phrase_len)NEWLINE frequencies += Counter(quadgrams)NEWLINENEWLINEod0 = collections.OrderedDict(frequencies0.most_common())NEWLINEod = collections.OrderedDict(frequencies.most_common())NEWLINENEWLINE#Build dataframesNEWLINEos.chdir('..')NEWLINENEWLINE#Create output for fuzzy string compare as dataframeNEWLINEdfz = pd.DataFrame(list(zip(f1, f2, bList)),NEWLINE columns=['File #1','File #2', 'Similarity'])NEWLINEdfz.sort_values(["Similarity"], inplace=True, ascending=False)NEWLINEdfz.index = pd.RangeIndex(len(dfz.index))NEWLINENEWLINE#Create output for word frequency dataframeNEWLINEdf0 = pd.DataFrame.from_dict(od0, orient='index').reset_index()NEWLINEdf0 = df0.rename(columns={'index':'Word', 0:'Count'})NEWLINENEWLINENEWLINE#Create output for Phrase frequency as dataframeNEWLINEdf = pd.DataFrame.from_dict(od, orient='index').reset_index()NEWLINEdf = df.rename(columns={'index':'Phrase', 0:'Count'})NEWLINENEWLINENEWLINE#Get a count of all words and phrasesNEWLINECount_Words=df0.shape[0]NEWLINECount_Phrase=df.shape[0]NEWLINENEWLINE#Generate html files from dataframesNEWLINEdfz.to_html(open(outdir +'Sim.html', 'a'))NEWLINEdf0.to_html(open(outdir +'Word.html', 'a'))NEWLINEdf.to_html(open(outdir +'Phrase.html', 'a'))NEWLINENEWLINENEWLINE#Write File list to FileNEWLINEwith open (outdir+"complete.txt","a")as fp1:NEWLINE fp1.write("Execution time: " + str(time.time() - start) +"s\n\n")NEWLINE fp1.write("With a total unique word count of:"+str(Count_Words)+"\n\n")NEWLINE fp1.write("With a total unique phrase count of:"+str(Count_Phrase)+"\n\n")NEWLINE fp1.write("The following files ("+str(len(file_list))+") were processed in the comparisons:\n\n")NEWLINE for line in file_list:NEWLINE fp1.write(line+"\n\n")NEWLINE fp1.close()NEWLINENEWLINE#Generate Analysis pdf form files collectionNEWLINEimport pdfkitNEWLINEpdfkit.from_file([outdir+"complete.txt",outdir+'Sim.html',outdir +'Word.html',outdir +'Phrase.html'], outdir +' Task-'+gui+'-Document-Analysis.pdf') |
import gymNEWLINEimport randomNEWLINEimport numpy as npNEWLINEimport argparseNEWLINEfrom arguments import get_argsNEWLINEfrom actorcritic import Actor, second, act, actorNEWLINEimport torchNEWLINEfrom torch.autograd import VariableNEWLINEimport torch.nn.functional as FNEWLINEimport torch.optim as optimNEWLINEimport torch.cudaNEWLINEimport matplotlib.pyplot as pltNEWLINEfrom torch.distributions import NormalNEWLINEimport osNEWLINEimport randomNEWLINEimport torch.nn as nnNEWLINEfrom itertools import countNEWLINEimport timeNEWLINEimport csvNEWLINENEWLINEdef ensure_shared_grads(model, shared_model):NEWLINE for param, shared_param in zip(model.parameters(),shared_model.parameters()):NEWLINE if shared_param.grad is not None:NEWLINE returnNEWLINE shared_param._grad = param.gradNEWLINENEWLINE# process the inputsNEWLINEdef process_inputs(o, g, o_mean, o_std, g_mean, g_std, args):NEWLINE o_clip = np.clip(o, -args.clip_obs, args.clip_obs)NEWLINE g_clip = np.clip(g, -args.clip_obs, args.clip_obs)NEWLINE o_norm = np.clip((o_clip - o_mean) / (o_std), -args.clip_range, args.clip_range)NEWLINE g_norm = np.clip((g_clip - g_mean) / (g_std), -args.clip_range, args.clip_range)NEWLINE inputs = np.concatenate([o_norm, g_norm])NEWLINE inputs = torch.tensor(inputs, dtype=torch.float32)NEWLINE return inputsNEWLINENEWLINENEWLINENEWLINEdef train(rank, args, shared_model, counter, lock, optimizer=None):NEWLINE NEWLINE args2 = get_args()NEWLINE # load the model paramNEWLINE model_path_approach = args2.save_dir + args2.env_name + '/approach.pt'NEWLINE o_mean_approach, o_std_approach, g_mean_approach, g_std_approach, model_approach = torch.load(model_path_approach, map_location=lambda storage, loc: storage)NEWLINE model_path_manipulate = args2.save_dir + args2.env_name + '/manipulate.pt'NEWLINE o_mean_manipulate, o_std_manipulate, g_mean_manipulate, g_std_manipulate, model_manipulate = torch.load(model_path_manipulate, map_location=lambda storage, loc: storage)NEWLINE model_path_retract = args2.save_dir + args2.env_name + '/retract.pt'NEWLINE o_mean_retract, o_std_retract, g_mean_retract, g_std_retract, model_retract = torch.load(model_path_retract, map_location=lambda storage, loc: storage)NEWLINENEWLINE FloatTensor = torch.cuda.FloatTensor if args.use_cuda else torch.FloatTensorNEWLINE NEWLINE env = gym.make("FetchPickAndPlace-v1")NEWLINE env2 = gym.wrappers.FlattenDictWrapper(env, dict_keys=['observation', 'desired_goal'])NEWLINE observation = env.reset()NEWLINENEWLINE env_params = {'obs': observation['observation'].shape[0], NEWLINE 'goal': observation['desired_goal'].shape[0], NEWLINE 'action': env.action_space.shape[0], NEWLINE 'action_max': env.action_space.high[0],NEWLINE }NEWLINE hlc = Actor()NEWLINE # create the actor networkNEWLINE actor_network_approach = actor(env_params)NEWLINE actor_network_approach.load_state_dict(model_approach)NEWLINE actor_network_approach.eval()NEWLINE actor_network_manipulate = actor(env_params)NEWLINE actor_network_manipulate.load_state_dict(model_manipulate)NEWLINE actor_network_manipulate.eval()NEWLINE actor_network_retract = actor(env_params)NEWLINE actor_network_retract.load_state_dict(model_retract)NEWLINE actor_network_retract.eval()NEWLINENEWLINE if args.use_cuda:NEWLINE hlc.cuda()NEWLINENEWLINENEWLINE NEWLINE for p in hlc.fc1.parameters():NEWLINE p.requires_grad = FalseNEWLINE for p in hlc.fc2.parameters():NEWLINE p.requires_grad = FalseNEWLINE NEWLINE if optimizer is None:NEWLINE optimizer = optim.Adam(shared_model.parameters(), lr=args.lr)NEWLINE NEWLINE hlc.train()NEWLINE NEWLINE done = True NEWLINE for num_iter in count():NEWLINE with lock:NEWLINE counter.value += 1NEWLINE #print(num_iter, counter.value)NEWLINE observation = env.reset()NEWLINE NEWLINE goal = observation['desired_goal']NEWLINE objectPos = observation['observation'][3:6]NEWLINE object_rel_pos = observation['observation'][6:9]NEWLINE object_oriented_goal = object_rel_pos.copy()NEWLINE object_oriented_goal[2] += 0.03 # first make the gripper go slightly above the object NEWLINE timeStep = 0 #count the total number of timestepsNEWLINE grip_pos = -object_rel_pos + objectPosNEWLINE NEWLINE object_pos_goal = objectPos.copy()NEWLINE if grip_pos[0] > objectPos[0]:NEWLINE object_pos_goal[0] += 0.003NEWLINE else:NEWLINE object_pos_goal[0] -= 0.003NEWLINENEWLINE if grip_pos[1] > objectPos[1]:NEWLINE object_pos_goal[1] += 0.002NEWLINE else:NEWLINE object_pos_goal[1] -= 0.002NEWLINENEWLINE object_pos_goal[2] -= -0.031NEWLINENEWLINE if rank == 0:NEWLINENEWLINE if num_iter % args.save_interval == 0 and num_iter > 0:NEWLINE #print ("Saving model at :" + args.save_path) NEWLINE torch.save(shared_model.state_dict(), args.save_path1)NEWLINENEWLINE if num_iter % (args.save_interval * 2.5) == 0 and num_iter > 0 and rank == 1: # Second saver in-case first processes crashes NEWLINE #print ("Saving model for process 1 at :" + args.save_path) NEWLINE torch.save(shared_model.state_dict(), args.save_path1)NEWLINE NEWLINE hlc.load_state_dict(shared_model.state_dict())NEWLINE values, log_probs, rewards, entropies = [], [], [], []NEWLINE if done:NEWLINE cx = Variable(torch.zeros(1, 32)).type(FloatTensor)NEWLINE hx = Variable(torch.zeros(1, 32)).type(FloatTensor)NEWLINE else:NEWLINE cx = Variable(cx.data).type(FloatTensor)NEWLINE hx = Variable(hx.data).type(FloatTensor)NEWLINENEWLINE state_inp = torch.from_numpy(env2.observation(observation)).type(FloatTensor)NEWLINE #criterion = nn.MSELoss()NEWLINE value, y, (hx, cx) = hlc(state_inp, hx, cx)NEWLINE prob = F.softmax(y)NEWLINE log_prob = F.log_softmax(y, dim=-1)NEWLINE act_model = prob.max(-1, keepdim=True)[1].dataNEWLINE entropy = -(log_prob * prob).sum(-1, keepdim=True)NEWLINE log_prob = log_prob.gather(-1, Variable(act_model))NEWLINE action_out = act_model.to(torch.device("cpu"))NEWLINE #action_out = torch.tensor([[0]])NEWLINE entropies.append(entropy), log_probs.append(log_prob), values.append(value)NEWLINE #print(action_out)NEWLINE obs = observation["observation"]NEWLINE observation_new = observationNEWLINENEWLINE while np.linalg.norm(grip_pos - object_pos_goal) >= 0.031 and timeStep <= 20:NEWLINE actions = [0, 0, 0, 0]NEWLINE if action_out == 0:NEWLINE with torch.no_grad():NEWLINE #input_tensor = _preproc_inputs(obs, objectPos)NEWLINE input_tensor = process_inputs(obs, object_pos_goal, o_mean_approach, o_std_approach, g_mean_approach, g_std_approach, args2)NEWLINE pi = actor_network_approach(input_tensor)NEWLINE # convert the actionsNEWLINE actions = pi.detach().cpu().numpy().squeeze()NEWLINENEWLINE elif action_out == 1:NEWLINENEWLINE with torch.no_grad():NEWLINE #input_tensor = _preproc_inputs(obs, objectPos)NEWLINE input_tensor = process_inputs(obs, objectPos, o_mean_manipulate, o_std_manipulate, g_mean_manipulate, g_std_manipulate, args2)NEWLINE pi = actor_network_manipulate(input_tensor)NEWLINE # convert the actionsNEWLINE actions = pi.detach().cpu().numpy().squeeze()NEWLINE NEWLINE else: NEWLINENEWLINE with torch.no_grad():NEWLINE #input_tensor = _preproc_inputs(obs, objectPos)NEWLINE input_tensor = process_inputs(obs, goal, o_mean_retract, o_std_retract, g_mean_retract, g_std_retract, args2)NEWLINE pi = actor_network_retract(input_tensor)NEWLINE # convert the actionsNEWLINE actions = pi.detach().cpu().numpy().squeeze()NEWLINENEWLINE actions[3] = 0.05NEWLINE observation_new, _, _, info = env.step(actions)NEWLINE obs = observation_new["observation"]NEWLINE g = observation_new["desired_goal"]NEWLINENEWLINE objectPos_new = observation_new["observation"][3:6]NEWLINE object_rel_pos_new = observation_new["observation"][6:9]NEWLINE objectPos = objectPos_newNEWLINE grip_pos_new = -object_rel_pos_new.copy() + objectPos_new.copy()NEWLINENEWLINE grip_pos = grip_pos_newNEWLINE object_oriented_goal = object_rel_pos_newNEWLINE NEWLINE timeStep += 1NEWLINE state_inp = torch.from_numpy(env2.observation(observation_new)).type(FloatTensor)NEWLINE if timeStep >= 21: NEWLINE breakNEWLINE NEWLINE NEWLINE reward = torch.Tensor([-1.0]).type(FloatTensor)NEWLINE rewards.append(reward)NEWLINE NEWLINE value, y, (hx, cx) = hlc(state_inp, hx, cx)NEWLINE prob = F.softmax(y)NEWLINE log_prob = F.log_softmax(y, dim=-1)NEWLINE act_model = prob.max(-1, keepdim=True)[1].dataNEWLINE entropy = -(log_prob * prob).sum(-1, keepdim=True)NEWLINE log_prob = log_prob.gather(-1, Variable(act_model))NEWLINE action_out = act_model.to(torch.device("cpu"))NEWLINE entropies.append(entropy), log_probs.append(log_prob), values.append(value)NEWLINE #action_out = torch.tensor([[1]])NEWLINENEWLINE NEWLINE while np.linalg.norm(grip_pos - objectPos) >= 0.015 and timeStep < env._max_episode_steps:NEWLINE actions = [0, 0, 0, 0]NEWLINE if action_out == 0:NEWLINE with torch.no_grad():NEWLINE #input_tensor = _preproc_inputs(obs, objectPos)NEWLINE input_tensor = process_inputs(obs, object_pos_goal, o_mean_approach, o_std_approach, g_mean_approach, g_std_approach, args2)NEWLINE pi = actor_network_approach(input_tensor)NEWLINE # convert the actionsNEWLINE actions = pi.detach().cpu().numpy().squeeze()NEWLINENEWLINE elif action_out == 1:NEWLINENEWLINE with torch.no_grad():NEWLINE #input_tensor = _preproc_inputs(obs, objectPos)NEWLINE input_tensor = process_inputs(obs, objectPos, o_mean_manipulate, o_std_manipulate, g_mean_manipulate, g_std_manipulate, args2)NEWLINE pi = actor_network_manipulate(input_tensor)NEWLINE # convert the actionsNEWLINE actions = pi.detach().cpu().numpy().squeeze()NEWLINE NEWLINE else: NEWLINENEWLINE with torch.no_grad():NEWLINE #input_tensor = _preproc_inputs(obs, objectPos)NEWLINE input_tensor = process_inputs(obs, goal, o_mean_retract, o_std_retract, g_mean_retract, g_std_retract, args2)NEWLINE pi = actor_network_retract(input_tensor)NEWLINE # convert the actionsNEWLINE actions = pi.detach().cpu().numpy().squeeze()NEWLINE NEWLINE actions[3] = -0.01NEWLINE NEWLINE observation_new, _, _, info = env.step(actions)NEWLINE obs = observation_new["observation"]NEWLINE objectPos = observation_new["observation"][3:6]NEWLINE object_rel_pos = observation_new["observation"][6:9]NEWLINE NEWLINE grip_pos_new = -object_rel_pos + objectPosNEWLINE grip_pos = grip_pos_newNEWLINENEWLINE timeStep += 1NEWLINE state_inp = torch.from_numpy(env2.observation(observation_new)).type(FloatTensor)NEWLINE if timeStep >= env._max_episode_steps: NEWLINE breakNEWLINE NEWLINE NEWLINE reward = torch.Tensor([-1.0]).type(FloatTensor)NEWLINE rewards.append(reward)NEWLINENEWLINE value, y, (hx, cx) = hlc(state_inp, hx, cx)NEWLINE prob = F.softmax(y)NEWLINE log_prob = F.log_softmax(y, dim=-1)NEWLINE act_model = prob.max(-1, keepdim=True)[1].dataNEWLINE entropy = -(log_prob * prob).sum(-1, keepdim=True)NEWLINE log_prob = log_prob.gather(-1, Variable(act_model))NEWLINE action_out = act_model.to(torch.device("cpu"))NEWLINE entropies.append(entropy), log_probs.append(log_prob), values.append(value)NEWLINE #action_out = torch.tensor([[2]])NEWLINENEWLINE while np.linalg.norm(goal - objectPos) >= 0.01 and timeStep < env._max_episode_steps:NEWLINE actions = [0, 0, 0, 0]NEWLINE if action_out == 0:NEWLINE with torch.no_grad():NEWLINE #input_tensor = _preproc_inputs(obs, objectPos)NEWLINE input_tensor = process_inputs(obs, object_pos_goal, o_mean_approach, o_std_approach, g_mean_approach, g_std_approach, args2)NEWLINE pi = actor_network_approach(input_tensor)NEWLINE # convert the actionsNEWLINE actions = pi.detach().cpu().numpy().squeeze()NEWLINENEWLINE elif action_out == 1:NEWLINENEWLINE with torch.no_grad():NEWLINE #input_tensor = _preproc_inputs(obs, objectPos)NEWLINE input_tensor = process_inputs(obs, objectPos, o_mean_manipulate, o_std_manipulate, g_mean_manipulate, g_std_manipulate, args2)NEWLINE pi = actor_network_manipulate(input_tensor)NEWLINE # convert the actionsNEWLINE actions = pi.detach().cpu().numpy().squeeze()NEWLINE NEWLINE else: NEWLINENEWLINE with torch.no_grad():NEWLINE #input_tensor = _preproc_inputs(obs, objectPos)NEWLINE input_tensor = process_inputs(obs, goal, o_mean_retract, o_std_retract, g_mean_retract, g_std_retract, args2)NEWLINE pi = actor_network_retract(input_tensor)NEWLINE # convert the actionsNEWLINE actions = pi.detach().cpu().numpy().squeeze()NEWLINE actions[3] = -0.01NEWLINENEWLINE # put actions into the environmentNEWLINE observation_new, _, _, info = env.step(actions)NEWLINE obs = observation_new['observation']NEWLINE #inputs = process_inputs(obs, g, o_mean_manipulate, o_std_manipulate, g_mean_manipulate, g_std_manipulate, args)NEWLINE timeStep += 1NEWLINE state_inp = torch.from_numpy(env2.observation(observation_new)).type(FloatTensor)NEWLINE objectPos = observation_new['observation'][3:6]NEWLINE object_rel_pos = observation_new['observation'][6:9]NEWLINE if timeStep >= env._max_episode_steps: NEWLINE breakNEWLINENEWLINE while True: #limit the number of timesteps in the episode to a fixed durationNEWLINE #env.render()NEWLINE action = [0, 0, 0, 0]NEWLINE action[3] = -0.01 # keep the gripper closedNEWLINENEWLINE obsDataNew, reward, done, info = env.step(action)NEWLINE timeStep += 1NEWLINENEWLINE objectPos = obsDataNew['observation'][3:6]NEWLINE object_rel_pos = obsDataNew['observation'][6:9]NEWLINENEWLINE if timeStep >= env._max_episode_steps: breakNEWLINE NEWLINE if info['is_success'] == 1.0:NEWLINE reward = torch.Tensor([10.0]).type(FloatTensor)NEWLINE else:NEWLINE reward = torch.Tensor([-1.0]).type(FloatTensor)NEWLINE rewards.append(reward)NEWLINE NEWLINE R = torch.zeros(1, 1)NEWLINE values.append(Variable(R).type(FloatTensor))NEWLINE policy_loss = 0NEWLINE value_loss = 0NEWLINE R = Variable(R).type(FloatTensor)NEWLINE gae = torch.zeros(1, 1).type(FloatTensor)NEWLINENEWLINE for i in reversed(range(len(rewards))):NEWLINE R = args.gamma * R + rewards[i]NEWLINE advantage = R - values[i]NEWLINE value_loss = value_loss + 0.5 * advantage.pow(2)NEWLINENEWLINE delta_t = rewards[i] + args.gamma * values[i + 1].data - values[i].dataNEWLINE gae = gae * args.gamma * args.tau + delta_tNEWLINENEWLINE policy_loss = policy_loss - log_probs[i] * Variable(gae).type(FloatTensor)NEWLINENEWLINE total_loss = policy_loss + args.value_loss_coef * value_lossNEWLINE optimizer.zero_grad()NEWLINENEWLINE (total_loss).backward(retain_graph=True)NEWLINE torch.nn.utils.clip_grad_norm_(hlc.parameters(), args.max_grad_norm)NEWLINENEWLINE ensure_shared_grads(hlc, shared_model)NEWLINE optimizer.step()NEWLINENEWLINEdef test(rank, args, shared_model, counter):NEWLINE NEWLINE args2 = get_args()NEWLINE # load the model paramNEWLINE model_path_approach = args2.save_dir + args2.env_name + '/approach.pt'NEWLINE o_mean_approach, o_std_approach, g_mean_approach, g_std_approach, model_approach = torch.load(model_path_approach, map_location=lambda storage, loc: storage)NEWLINE model_path_manipulate = args2.save_dir + args2.env_name + '/manipulate.pt'NEWLINE o_mean_manipulate, o_std_manipulate, g_mean_manipulate, g_std_manipulate, model_manipulate = torch.load(model_path_manipulate, map_location=lambda storage, loc: storage)NEWLINE model_path_retract = args2.save_dir + args2.env_name + '/retract.pt'NEWLINE o_mean_retract, o_std_retract, g_mean_retract, g_std_retract, model_retract = torch.load(model_path_retract, map_location=lambda storage, loc: storage)NEWLINENEWLINE FloatTensor = torch.cuda.FloatTensor if args.use_cuda else torch.FloatTensorNEWLINE NEWLINE env = gym.make("FetchPickAndPlace-v1")NEWLINE env2 = gym.wrappers.FlattenDictWrapper(env, dict_keys=['observation', 'desired_goal'])NEWLINE observation = env.reset()NEWLINENEWLINE env_params = {'obs': observation['observation'].shape[0], NEWLINE 'goal': observation['desired_goal'].shape[0], NEWLINE 'action': env.action_space.shape[0], NEWLINE 'action_max': env.action_space.high[0],NEWLINE }NEWLINE hlc = Actor()NEWLINE # create the actor networkNEWLINE actor_network_approach = actor(env_params)NEWLINE actor_network_approach.load_state_dict(model_approach)NEWLINE actor_network_approach.eval()NEWLINE actor_network_manipulate = actor(env_params)NEWLINE actor_network_manipulate.load_state_dict(model_manipulate)NEWLINE actor_network_manipulate.eval()NEWLINE actor_network_retract = actor(env_params)NEWLINE actor_network_retract.load_state_dict(model_retract)NEWLINE actor_network_retract.eval()NEWLINE if args.use_cuda:NEWLINE hlc.cuda()NEWLINE NEWLINE done = True NEWLINENEWLINE savefile = os.getcwd() + '/train/mario_curves.csv'NEWLINE title = ['No. episodes', 'No. of success']NEWLINE with open(savefile, 'a', newline='') as sfile:NEWLINE writer = csv.writer(sfile)NEWLINE writer.writerow(title) NEWLINENEWLINE hlc.eval()NEWLINE while True:NEWLINE hlc.load_state_dict(shared_model.state_dict())NEWLINE hlc.eval()NEWLINE ep_num = 0NEWLINE success = 0NEWLINE num_ep = counter.valueNEWLINE while ep_num < 50:NEWLINE ep_num +=1NEWLINE observation = env.reset() NEWLINE #lastObs = observationNEWLINE goal = observation['desired_goal']NEWLINE objectPos = observation['observation'][3:6]NEWLINE object_rel_pos = observation['observation'][6:9]NEWLINE object_oriented_goal = object_rel_pos.copy()NEWLINE object_oriented_goal[2] += 0.03 # first make the gripper go slightly above the object NEWLINE timeStep = 0NEWLINE grip_pos = -object_rel_pos + objectPosNEWLINE NEWLINE object_pos_goal = objectPos.copy()NEWLINE if grip_pos[0] > objectPos[0]:NEWLINE object_pos_goal[0] += 0.003NEWLINE else:NEWLINE object_pos_goal[0] -= 0.003NEWLINENEWLINE if grip_pos[1] > objectPos[1]:NEWLINE object_pos_goal[1] += 0.002NEWLINE else:NEWLINE object_pos_goal[1] -= 0.002NEWLINENEWLINE object_pos_goal[2] -= -0.031NEWLINENEWLINE if done:NEWLINE cx = Variable(torch.zeros(1, 32)).type(FloatTensor)NEWLINE hx = Variable(torch.zeros(1, 32)).type(FloatTensor)NEWLINE else:NEWLINE cx = Variable(cx.data).type(FloatTensor)NEWLINE hx = Variable(hx.data).type(FloatTensor)NEWLINENEWLINE state_inp = torch.from_numpy(env2.observation(observation)).type(FloatTensor)NEWLINE value, y, (hx, cx) = hlc(state_inp, hx, cx)NEWLINE prob = F.softmax(y)NEWLINE act_model = prob.max(-1, keepdim=True)[1].dataNEWLINE action_out = act_model.to(torch.device("cpu"))NEWLINENEWLINENEWLINE #print('action_out before approach:', action_out)NEWLINE obs = observation["observation"]NEWLINE while np.linalg.norm(grip_pos - object_pos_goal) >= 0.031 and timeStep <= 20:NEWLINE #env.render()NEWLINE actions = [0, 0, 0, 0]NEWLINE if action_out == 0:NEWLINE with torch.no_grad():NEWLINE #input_tensor = _preproc_inputs(obs, objectPos)NEWLINE input_tensor = process_inputs(obs, object_pos_goal, o_mean_approach, o_std_approach, g_mean_approach, g_std_approach, args2)NEWLINE pi = actor_network_approach(input_tensor)NEWLINE # convert the actionsNEWLINE actions = pi.detach().cpu().numpy().squeeze()NEWLINENEWLINE elif action_out == 1:NEWLINENEWLINE with torch.no_grad():NEWLINE #input_tensor = _preproc_inputs(obs, objectPos)NEWLINE input_tensor = process_inputs(obs, objectPos, o_mean_manipulate, o_std_manipulate, g_mean_manipulate, g_std_manipulate, args2)NEWLINE pi = actor_network_manipulate(input_tensor)NEWLINE # convert the actionsNEWLINE actions = pi.detach().cpu().numpy().squeeze()NEWLINE NEWLINE else: NEWLINENEWLINE with torch.no_grad():NEWLINE #input_tensor = _preproc_inputs(obs, objectPos)NEWLINE input_tensor = process_inputs(obs, goal, o_mean_retract, o_std_retract, g_mean_retract, g_std_retract, args2)NEWLINE pi = actor_network_retract(input_tensor)NEWLINE # convert the actionsNEWLINE actions = pi.detach().cpu().numpy().squeeze()NEWLINE NEWLINENEWLINE actions[3] = 0.05NEWLINENEWLINE observation_new, _, _, info = env.step(actions)NEWLINE obs = observation_new["observation"]NEWLINE g = observation_new["desired_goal"]NEWLINENEWLINE objectPos_new = observation_new["observation"][3:6]NEWLINE object_rel_pos_new = observation_new["observation"][6:9]NEWLINE objectPos = objectPos_newNEWLINE grip_pos_new = -object_rel_pos_new + objectPos_newNEWLINENEWLINE grip_pos = grip_pos_newNEWLINE object_oriented_goal = object_rel_pos_newNEWLINE NEWLINE #print('timestep: {},reward eval: {}'.format(timeStep, reward))NEWLINE timeStep += 1NEWLINE state_inp = torch.from_numpy(env2.observation(observation_new)).type(FloatTensor)NEWLINE NEWLINE NEWLINENEWLINE value, y, (hx, cx) = hlc(state_inp, hx, cx)NEWLINE prob = F.softmax(y)NEWLINE act_model = prob.max(-1, keepdim=True)[1].dataNEWLINE action_out = act_model.to(torch.device("cpu"))NEWLINE NEWLINE while np.linalg.norm(grip_pos - objectPos) >= 0.015 and timeStep < env._max_episode_steps:NEWLINE #env.render()NEWLINE actions = [0, 0, 0, 0]NEWLINE if action_out == 0:NEWLINE with torch.no_grad():NEWLINE #input_tensor = _preproc_inputs(obs, objectPos)NEWLINE input_tensor = process_inputs(obs, object_pos_goal, o_mean_approach, o_std_approach, g_mean_approach, g_std_approach, args2)NEWLINE pi = actor_network_approach(input_tensor)NEWLINE # convert the actionsNEWLINE actions = pi.detach().cpu().numpy().squeeze()NEWLINENEWLINE elif action_out == 1:NEWLINENEWLINE with torch.no_grad():NEWLINE #input_tensor = _preproc_inputs(obs, objectPos)NEWLINE input_tensor = process_inputs(obs, objectPos, o_mean_manipulate, o_std_manipulate, g_mean_manipulate, g_std_manipulate, args2)NEWLINE pi = actor_network_manipulate(input_tensor)NEWLINE # convert the actionsNEWLINE actions = pi.detach().cpu().numpy().squeeze()NEWLINE NEWLINE else: NEWLINENEWLINE with torch.no_grad():NEWLINE #input_tensor = _preproc_inputs(obs, objectPos)NEWLINE input_tensor = process_inputs(obs, goal, o_mean_retract, o_std_retract, g_mean_retract, g_std_retract, args2)NEWLINE pi = actor_network_retract(input_tensor)NEWLINE # convert the actionsNEWLINE actions = pi.detach().cpu().numpy().squeeze()NEWLINE NEWLINE NEWLINE actions[3] = -0.01NEWLINE NEWLINE observation_new, _, _, info = env.step(actions)NEWLINE obs = observation_new["observation"]NEWLINE objectPos = observation_new["observation"][3:6]NEWLINE object_rel_pos = observation_new["observation"][6:9]NEWLINE NEWLINE grip_pos_new = -object_rel_pos + objectPosNEWLINE grip_pos = grip_pos_newNEWLINENEWLINE timeStep += 1NEWLINE state_inp = torch.from_numpy(env2.observation(observation_new)).type(FloatTensor)NEWLINE if timeStep >= env._max_episode_steps: NEWLINE breakNEWLINE NEWLINE value, y, (hx, cx) = hlc(state_inp, hx, cx)NEWLINE prob = F.softmax(y) NEWLINE act_model = prob.max(-1, keepdim=True)[1].data NEWLINE action_out = act_model.to(torch.device("cpu"))NEWLINE NEWLINE NEWLINE while np.linalg.norm(goal - objectPos) >= 0.01 and timeStep < env._max_episode_steps:NEWLINE #env.render()NEWLINE actions = [0, 0, 0, 0]NEWLINE if action_out == 0:NEWLINE with torch.no_grad():NEWLINE #input_tensor = _preproc_inputs(obs, objectPos)NEWLINE input_tensor = process_inputs(obs, object_pos_goal, o_mean_approach, o_std_approach, g_mean_approach, g_std_approach, args2)NEWLINE pi = actor_network_approach(input_tensor)NEWLINE # convert the actionsNEWLINE actions = pi.detach().cpu().numpy().squeeze()NEWLINENEWLINE elif action_out == 1:NEWLINENEWLINE with torch.no_grad():NEWLINE #input_tensor = _preproc_inputs(obs, objectPos)NEWLINE input_tensor = process_inputs(obs, objectPos, o_mean_manipulate, o_std_manipulate, g_mean_manipulate, g_std_manipulate, args2)NEWLINE pi = actor_network_manipulate(input_tensor)NEWLINE # convert the actionsNEWLINE actions = pi.detach().cpu().numpy().squeeze()NEWLINE NEWLINE else: NEWLINENEWLINE with torch.no_grad():NEWLINE #input_tensor = _preproc_inputs(obs, objectPos)NEWLINE input_tensor = process_inputs(obs, goal, o_mean_retract, o_std_retract, g_mean_retract, g_std_retract, args2)NEWLINE pi = actor_network_retract(input_tensor)NEWLINE # convert the actionsNEWLINE actions = pi.detach().cpu().numpy().squeeze()NEWLINE NEWLINE actions[3] = -0.01NEWLINENEWLINE # put actions into the environmentNEWLINE observation_new, _, _, info = env.step(actions)NEWLINE obs = observation_new['observation']NEWLINE NEWLINE timeStep += 1NEWLINE state_inp = torch.from_numpy(env2.observation(observation_new)).type(FloatTensor)NEWLINE objectPos = observation_new['observation'][3:6]NEWLINE object_rel_pos = observation_new['observation'][6:9]NEWLINE if timeStep >= env._max_episode_steps: NEWLINE breakNEWLINE NEWLINE while True: #limit the number of timesteps in the episode to a fixed durationNEWLINE #env.render()NEWLINE action = [0, 0, 0, 0]NEWLINE action[3] = -0.01 # keep the gripper closedNEWLINENEWLINE obsDataNew, reward, done, info = env.step(action)NEWLINE timeStep += 1NEWLINENEWLINE objectPos = obsDataNew['observation'][3:6]NEWLINE object_rel_pos = obsDataNew['observation'][6:9]NEWLINE if timeStep >= env._max_episode_steps: breakNEWLINE NEWLINE if info['is_success'] == 1.0:NEWLINE success +=1NEWLINE NEWLINE if ep_num % 49==0: NEWLINE print("num episodes {}, success {}".format(num_ep, success*2))NEWLINE data = [counter.value, success*2]NEWLINE with open(savefile, 'a', newline='') as sfile:NEWLINE writer = csv.writer(sfile)NEWLINE writer.writerows([data])NEWLINE #time.sleep(15)NEWLINE |
import pytestNEWLINEimport mockNEWLINEimport jsonNEWLINEfrom functools import wrapsNEWLINEfrom unittest.mock import patchNEWLINENEWLINEfrom app import storageNEWLINEfrom data.registry_model.blobuploader import upload_blob, BlobUploadSettingsNEWLINEfrom image.docker.schema2.manifest import DockerSchema2ManifestBuilderNEWLINEfrom data.registry_model import registry_modelNEWLINEfrom data.registry_model.datatypes import RepositoryReferenceNEWLINEfrom data.model.test.test_repo_mirroring import create_mirror_repo_robotNEWLINEfrom data.model.user import retrieve_robot_tokenNEWLINEfrom data.database import Manifest, RepoMirrorConfig, RepoMirrorStatusNEWLINENEWLINEfrom workers.repomirrorworker import delete_obsolete_tagsNEWLINEfrom workers.repomirrorworker.repomirrorworker import RepoMirrorWorkerNEWLINEfrom io import BytesIONEWLINEfrom util.repomirror.skopeomirror import SkopeoResults, SkopeoMirrorNEWLINENEWLINEfrom test.fixtures import *NEWLINENEWLINENEWLINEdef disable_existing_mirrors(func):NEWLINE @wraps(func)NEWLINE def wrapper(*args, **kwargs):NEWLINE for mirror in RepoMirrorConfig.select():NEWLINE mirror.is_enabled = FalseNEWLINE mirror.save()NEWLINENEWLINE func(*args, **kwargs)NEWLINENEWLINE for mirror in RepoMirrorConfig.select():NEWLINE mirror.is_enabled = TrueNEWLINE mirror.save()NEWLINENEWLINE return wrapperNEWLINENEWLINENEWLINEdef _create_tag(repo, name):NEWLINE repo_ref = RepositoryReference.for_repo_obj(repo)NEWLINENEWLINE with upload_blob(repo_ref, storage, BlobUploadSettings(500, 500)) as upload:NEWLINE app_config = {"TESTING": True}NEWLINE config_json = json.dumps(NEWLINE {NEWLINE "config": {NEWLINE "author": "Repo Mirror",NEWLINE },NEWLINE "rootfs": {"type": "layers", "diff_ids": []},NEWLINE "history": [NEWLINE {NEWLINE "created": "2019-07-30T18:37:09.284840891Z",NEWLINE "created_by": "base",NEWLINE "author": "Repo Mirror",NEWLINE },NEWLINE ],NEWLINE }NEWLINE )NEWLINE upload.upload_chunk(app_config, BytesIO(config_json.encode("utf-8")))NEWLINE blob = upload.commit_to_blob(app_config)NEWLINE assert blobNEWLINENEWLINE builder = DockerSchema2ManifestBuilder()NEWLINE builder.set_config_digest(blob.digest, blob.compressed_size)NEWLINE builder.add_layer("sha256:abcd", 1234, urls=["http://hello/world"])NEWLINE manifest = builder.build()NEWLINENEWLINE manifest, tag = registry_model.create_manifest_and_retarget_tag(NEWLINE repo_ref, manifest, name, storage, raise_on_error=TrueNEWLINE )NEWLINE assert tagNEWLINE assert tag.name == nameNEWLINENEWLINENEWLINE@disable_existing_mirrorsNEWLINE@mock.patch("util.repomirror.skopeomirror.SkopeoMirror.run_skopeo")NEWLINEdef test_successful_mirror(run_skopeo_mock, initialized_db, app):NEWLINE """NEWLINE Basic test of successful mirror.NEWLINE """NEWLINENEWLINE mirror, repo = create_mirror_repo_robot(NEWLINE ["latest", "7.1"], external_registry_config={"verify_tls": False}NEWLINE )NEWLINENEWLINE skopeo_calls = [NEWLINE {NEWLINE "args": [NEWLINE "/usr/bin/skopeo",NEWLINE "inspect",NEWLINE "--tls-verify=False",NEWLINE "docker://registry.example.com/namespace/repository:latest",NEWLINE ],NEWLINE "results": SkopeoResults(True, [], '{"RepoTags": ["latest"]}', ""),NEWLINE },NEWLINE {NEWLINE "args": [NEWLINE "/usr/bin/skopeo",NEWLINE "copy",NEWLINE "--all",NEWLINE "--remove-signatures",NEWLINE "--src-tls-verify=False",NEWLINE "--dest-tls-verify=True",NEWLINE "--dest-creds",NEWLINE "%s:%s"NEWLINE % (mirror.internal_robot.username, retrieve_robot_token(mirror.internal_robot)),NEWLINE "docker://registry.example.com/namespace/repository:latest",NEWLINE "docker://localhost:5000/mirror/repo:latest",NEWLINE ],NEWLINE "results": SkopeoResults(True, [], "stdout", "stderr"),NEWLINE },NEWLINE ]NEWLINENEWLINE def skopeo_test(args, proxy):NEWLINE try:NEWLINE skopeo_call = skopeo_calls.pop(0)NEWLINE assert args == skopeo_call["args"]NEWLINE assert proxy == {}NEWLINENEWLINE return skopeo_call["results"]NEWLINE except Exception as e:NEWLINE skopeo_calls.append(skopeo_call)NEWLINE raise eNEWLINENEWLINE run_skopeo_mock.side_effect = skopeo_testNEWLINENEWLINE worker = RepoMirrorWorker()NEWLINE worker._process_mirrors()NEWLINENEWLINE assert [] == skopeo_callsNEWLINENEWLINENEWLINE@disable_existing_mirrorsNEWLINE@mock.patch("util.repomirror.skopeomirror.SkopeoMirror.run_skopeo")NEWLINEdef test_mirror_unsigned_images(run_skopeo_mock, initialized_db, app):NEWLINE """NEWLINE Test whether the insecure-policy option is added when a repository is passed with unsigned_images.NEWLINE """NEWLINENEWLINE mirror, repo = create_mirror_repo_robot(NEWLINE ["latest"], external_registry_config={"verify_tls": False, "unsigned_images": True}NEWLINE )NEWLINENEWLINE skopeo_calls = [NEWLINE {NEWLINE "args": [NEWLINE "/usr/bin/skopeo",NEWLINE "inspect",NEWLINE "--tls-verify=False",NEWLINE "docker://registry.example.com/namespace/repository:latest",NEWLINE ],NEWLINE "results": SkopeoResults(True, [], '{"RepoTags": ["latest"]}', ""),NEWLINE },NEWLINE {NEWLINE "args": [NEWLINE "/usr/bin/skopeo",NEWLINE "--insecure-policy",NEWLINE "copy",NEWLINE "--all",NEWLINE "--remove-signatures",NEWLINE "--src-tls-verify=False",NEWLINE "--dest-tls-verify=True",NEWLINE "--dest-creds",NEWLINE "%s:%s"NEWLINE % (mirror.internal_robot.username, retrieve_robot_token(mirror.internal_robot)),NEWLINE "docker://registry.example.com/namespace/repository:latest",NEWLINE "docker://localhost:5000/mirror/repo:latest",NEWLINE ],NEWLINE "results": SkopeoResults(True, [], "stdout", "stderr"),NEWLINE },NEWLINE ]NEWLINENEWLINE def skopeo_test(args, proxy):NEWLINE try:NEWLINE skopeo_call = skopeo_calls.pop(0)NEWLINE assert args == skopeo_call["args"]NEWLINE assert proxy == {}NEWLINENEWLINE return skopeo_call["results"]NEWLINE except Exception as e:NEWLINE skopeo_calls.append(skopeo_call)NEWLINE raise eNEWLINENEWLINE run_skopeo_mock.side_effect = skopeo_testNEWLINENEWLINE worker = RepoMirrorWorker()NEWLINE worker._process_mirrors()NEWLINENEWLINE assert [] == skopeo_callsNEWLINENEWLINENEWLINE@disable_existing_mirrorsNEWLINE@mock.patch("util.repomirror.skopeomirror.SkopeoMirror.run_skopeo")NEWLINEdef test_successful_disabled_sync_now(run_skopeo_mock, initialized_db, app):NEWLINE """NEWLINE Disabled mirrors still allow "sync now".NEWLINE """NEWLINENEWLINE mirror, repo = create_mirror_repo_robot(["latest", "7.1"])NEWLINE mirror.is_enabled = FalseNEWLINE mirror.sync_status = RepoMirrorStatus.SYNC_NOWNEWLINE mirror.save()NEWLINENEWLINE skopeo_calls = [NEWLINE {NEWLINE "args": [NEWLINE "/usr/bin/skopeo",NEWLINE "inspect",NEWLINE "--tls-verify=True",NEWLINE "docker://registry.example.com/namespace/repository:latest",NEWLINE ],NEWLINE "results": SkopeoResults(True, [], '{"RepoTags": ["latest"]}', ""),NEWLINE },NEWLINE {NEWLINE "args": [NEWLINE "/usr/bin/skopeo",NEWLINE "copy",NEWLINE "--all",NEWLINE "--remove-signatures",NEWLINE "--src-tls-verify=True",NEWLINE "--dest-tls-verify=True",NEWLINE "--dest-creds",NEWLINE "%s:%s"NEWLINE % (mirror.internal_robot.username, retrieve_robot_token(mirror.internal_robot)),NEWLINE "docker://registry.example.com/namespace/repository:latest",NEWLINE "docker://localhost:5000/mirror/repo:latest",NEWLINE ],NEWLINE "results": SkopeoResults(True, [], "stdout", "stderr"),NEWLINE },NEWLINE ]NEWLINENEWLINE def skopeo_test(args, proxy):NEWLINE try:NEWLINE skopeo_call = skopeo_calls.pop(0)NEWLINE assert args == skopeo_call["args"]NEWLINE assert proxy == {}NEWLINENEWLINE return skopeo_call["results"]NEWLINE except Exception as e:NEWLINE skopeo_calls.append(skopeo_call)NEWLINE raise eNEWLINENEWLINE run_skopeo_mock.side_effect = skopeo_testNEWLINENEWLINE worker = RepoMirrorWorker()NEWLINE worker._process_mirrors()NEWLINENEWLINE assert [] == skopeo_callsNEWLINENEWLINENEWLINE@disable_existing_mirrorsNEWLINE@mock.patch("util.repomirror.skopeomirror.SkopeoMirror.run_skopeo")NEWLINEdef test_successful_mirror_verbose_logs(run_skopeo_mock, initialized_db, app, monkeypatch):NEWLINE """NEWLINE Basic test of successful mirror with verbose logs turned on.NEWLINE """NEWLINENEWLINE mirror, repo = create_mirror_repo_robot(["latest", "7.1"])NEWLINENEWLINE skopeo_calls = [NEWLINE {NEWLINE "args": [NEWLINE "/usr/bin/skopeo",NEWLINE "--debug",NEWLINE "inspect",NEWLINE "--tls-verify=True",NEWLINE "docker://registry.example.com/namespace/repository:latest",NEWLINE ],NEWLINE "results": SkopeoResults(True, [], '{"RepoTags": ["latest"]}', ""),NEWLINE },NEWLINE {NEWLINE "args": [NEWLINE "/usr/bin/skopeo",NEWLINE "--debug",NEWLINE "copy",NEWLINE "--all",NEWLINE "--remove-signatures",NEWLINE "--src-tls-verify=True",NEWLINE "--dest-tls-verify=True",NEWLINE "--dest-creds",NEWLINE "%s:%s"NEWLINE % (mirror.internal_robot.username, retrieve_robot_token(mirror.internal_robot)),NEWLINE "docker://registry.example.com/namespace/repository:latest",NEWLINE "docker://localhost:5000/mirror/repo:latest",NEWLINE ],NEWLINE "results": SkopeoResults(True, [], "Success", ""),NEWLINE },NEWLINE ]NEWLINENEWLINE def skopeo_test(args, proxy):NEWLINE try:NEWLINE skopeo_call = skopeo_calls.pop(0)NEWLINE assert args == skopeo_call["args"]NEWLINE assert proxy == {}NEWLINENEWLINE return skopeo_call["results"]NEWLINE except Exception as e:NEWLINE skopeo_calls.append(skopeo_call)NEWLINE raise eNEWLINENEWLINE run_skopeo_mock.side_effect = skopeo_testNEWLINENEWLINE monkeypatch.setenv("DEBUGLOG", "true")NEWLINE worker = RepoMirrorWorker()NEWLINE worker._process_mirrors()NEWLINENEWLINE assert [] == skopeo_callsNEWLINENEWLINENEWLINE@disable_existing_mirrorsNEWLINE@mock.patch("util.repomirror.skopeomirror.SkopeoMirror.run_skopeo")NEWLINE@mock.patch("workers.repomirrorworker.retarget_tag")NEWLINE@mock.patch("workers.repomirrorworker.delete_tag")NEWLINEdef test_rollback(delete_tag_mock, retarget_tag_mock, run_skopeo_mock, initialized_db, app):NEWLINE """NEWLINE Tags in the repo:NEWLINENEWLINE "updated" - this tag will be updated during the mirrorNEWLINE "removed" - this tag will be removed during the mirrorNEWLINE "created" - this tag will be created during the mirrorNEWLINE """NEWLINENEWLINE mirror, repo = create_mirror_repo_robot(["updated", "created", "zzerror"])NEWLINE _create_tag(repo, "updated")NEWLINE _create_tag(repo, "deleted")NEWLINENEWLINE skopeo_calls = [NEWLINE {NEWLINE "args": [NEWLINE "/usr/bin/skopeo",NEWLINE "inspect",NEWLINE "--tls-verify=True",NEWLINE "docker://registry.example.com/namespace/repository:updated",NEWLINE ],NEWLINE "results": SkopeoResults(NEWLINE True, [], '{"RepoTags": ["latest", "zzerror", "created", "updated"]}', ""NEWLINE ),NEWLINE },NEWLINE {NEWLINE "args": [NEWLINE "/usr/bin/skopeo",NEWLINE "copy",NEWLINE "--all",NEWLINE "--remove-signatures",NEWLINE "--src-tls-verify=True",NEWLINE "--dest-tls-verify=True",NEWLINE "--dest-creds",NEWLINE "%s:%s"NEWLINE % (mirror.internal_robot.username, retrieve_robot_token(mirror.internal_robot)),NEWLINE "docker://registry.example.com/namespace/repository:created",NEWLINE "docker://localhost:5000/mirror/repo:created",NEWLINE ],NEWLINE "results": SkopeoResults(True, [], "Success", ""),NEWLINE },NEWLINE {NEWLINE "args": [NEWLINE "/usr/bin/skopeo",NEWLINE "copy",NEWLINE "--all",NEWLINE "--remove-signatures",NEWLINE "--src-tls-verify=True",NEWLINE "--dest-tls-verify=True",NEWLINE "--dest-creds",NEWLINE "%s:%s"NEWLINE % (mirror.internal_robot.username, retrieve_robot_token(mirror.internal_robot)),NEWLINE "docker://registry.example.com/namespace/repository:updated",NEWLINE "docker://localhost:5000/mirror/repo:updated",NEWLINE ],NEWLINE "results": SkopeoResults(True, [], "Success", ""),NEWLINE },NEWLINE {NEWLINE "args": [NEWLINE "/usr/bin/skopeo",NEWLINE "copy",NEWLINE "--all",NEWLINE "--remove-signatures",NEWLINE "--src-tls-verify=True",NEWLINE "--dest-tls-verify=True",NEWLINE "--dest-creds",NEWLINE "%s:%s"NEWLINE % (mirror.internal_robot.username, retrieve_robot_token(mirror.internal_robot)),NEWLINE "docker://registry.example.com/namespace/repository:zzerror",NEWLINE "docker://localhost:5000/mirror/repo:zzerror",NEWLINE ],NEWLINE "results": SkopeoResults(False, [], "", "ERROR"),NEWLINE },NEWLINE ]NEWLINENEWLINE retarget_tag_calls = [NEWLINE "updated",NEWLINE ]NEWLINENEWLINE delete_tag_calls = [NEWLINE "deleted",NEWLINE "updated",NEWLINE "created",NEWLINE ]NEWLINENEWLINE def skopeo_test(args, proxy):NEWLINE try:NEWLINE skopeo_call = skopeo_calls.pop(0)NEWLINE assert args == skopeo_call["args"]NEWLINE assert proxy == {}NEWLINENEWLINE if args[1] == "copy" and args[8].endswith(":updated"):NEWLINE _create_tag(repo, "updated")NEWLINE elif args[1] == "copy" and args[8].endswith(":created"):NEWLINE _create_tag(repo, "created")NEWLINENEWLINE return skopeo_call["results"]NEWLINE except Exception as e:NEWLINE skopeo_calls.append(skopeo_call)NEWLINE raise eNEWLINENEWLINE def retarget_tag_test(name, manifest, is_reversion=False):NEWLINE assert retarget_tag_calls.pop(0) == nameNEWLINE assert is_reversionNEWLINENEWLINE def delete_tag_test(repository_id, tag_name):NEWLINE assert delete_tag_calls.pop(0) == tag_nameNEWLINENEWLINE run_skopeo_mock.side_effect = skopeo_testNEWLINE retarget_tag_mock.side_effect = retarget_tag_testNEWLINE delete_tag_mock.side_effect = delete_tag_testNEWLINE worker = RepoMirrorWorker()NEWLINE worker._process_mirrors()NEWLINENEWLINE assert [] == skopeo_callsNEWLINE assert [] == retarget_tag_callsNEWLINE assert [] == delete_tag_callsNEWLINENEWLINENEWLINEdef test_remove_obsolete_tags(initialized_db):NEWLINE """NEWLINE As part of the mirror, the set of tags on the remote repository is compared to the localNEWLINE existing tags.NEWLINENEWLINE Those not present on the remote are removed locally.NEWLINE """NEWLINENEWLINE mirror, repository = create_mirror_repo_robot(["updated", "created"], repo_name="removed")NEWLINENEWLINE _create_tag(repository, "oldtag")NEWLINENEWLINE incoming_tags = ["one", "two"]NEWLINE deleted_tags = delete_obsolete_tags(mirror, incoming_tags)NEWLINENEWLINE assert [tag.name for tag in deleted_tags] == ["oldtag"]NEWLINENEWLINENEWLINE@disable_existing_mirrorsNEWLINE@mock.patch("util.repomirror.skopeomirror.SkopeoMirror.run_skopeo")NEWLINEdef test_mirror_config_server_hostname(run_skopeo_mock, initialized_db, app, monkeypatch):NEWLINE """NEWLINE Set REPO_MIRROR_SERVER_HOSTNAME to override SERVER_HOSTNAME config.NEWLINE """NEWLINENEWLINE mirror, repo = create_mirror_repo_robot(["latest", "7.1"])NEWLINENEWLINE skopeo_calls = [NEWLINE {NEWLINE "args": [NEWLINE "/usr/bin/skopeo",NEWLINE "--debug",NEWLINE "inspect",NEWLINE "--tls-verify=True",NEWLINE "docker://registry.example.com/namespace/repository:latest",NEWLINE ],NEWLINE "results": SkopeoResults(True, [], '{"RepoTags": ["latest"]}', ""),NEWLINE },NEWLINE {NEWLINE "args": [NEWLINE "/usr/bin/skopeo",NEWLINE "--debug",NEWLINE "copy",NEWLINE "--all",NEWLINE "--remove-signatures",NEWLINE "--src-tls-verify=True",NEWLINE "--dest-tls-verify=True",NEWLINE "--dest-creds",NEWLINE "%s:%s"NEWLINE % (mirror.internal_robot.username, retrieve_robot_token(mirror.internal_robot)),NEWLINE "docker://registry.example.com/namespace/repository:latest",NEWLINE "docker://config_server_hostname/mirror/repo:latest",NEWLINE ],NEWLINE "results": SkopeoResults(True, [], "Success", ""),NEWLINE },NEWLINE ]NEWLINENEWLINE def skopeo_test(args, proxy):NEWLINE try:NEWLINE skopeo_call = skopeo_calls.pop(0)NEWLINE assert args == skopeo_call["args"]NEWLINE assert proxy == {}NEWLINENEWLINE return skopeo_call["results"]NEWLINE except Exception as e:NEWLINE skopeo_calls.append(skopeo_call)NEWLINE raise eNEWLINENEWLINE run_skopeo_mock.side_effect = skopeo_testNEWLINENEWLINE monkeypatch.setenv("DEBUGLOG", "true")NEWLINE with patch.dict(NEWLINE "data.model.config.app_config", {"REPO_MIRROR_SERVER_HOSTNAME": "config_server_hostname"}NEWLINE ):NEWLINE worker = RepoMirrorWorker()NEWLINE worker._process_mirrors()NEWLINENEWLINE assert [] == skopeo_callsNEWLINENEWLINENEWLINE@disable_existing_mirrorsNEWLINE@mock.patch("util.repomirror.skopeomirror.SkopeoMirror.run_skopeo")NEWLINEdef test_quote_params(run_skopeo_mock, initialized_db, app):NEWLINE """NEWLINE Basic test of successful mirror.NEWLINE """NEWLINENEWLINE mirror, repo = create_mirror_repo_robot(["latest", "7.1"])NEWLINE mirror.external_reference = "& rm -rf /;/namespace/repository"NEWLINE mirror.external_registry_username = "`rm -rf /`"NEWLINE mirror.save()NEWLINENEWLINE skopeo_calls = [NEWLINE {NEWLINE "args": [NEWLINE "/usr/bin/skopeo",NEWLINE "inspect",NEWLINE "--tls-verify=True",NEWLINE "--creds",NEWLINE "`rm -rf /`",NEWLINE "'docker://& rm -rf /;/namespace/repository:latest'",NEWLINE ],NEWLINE "results": SkopeoResults(True, [], '{"RepoTags": ["latest"]}', ""),NEWLINE },NEWLINE {NEWLINE "args": [NEWLINE "/usr/bin/skopeo",NEWLINE "copy",NEWLINE "--all",NEWLINE "--remove-signatures",NEWLINE "--src-tls-verify=True",NEWLINE "--dest-tls-verify=True",NEWLINE "--dest-creds",NEWLINE "%s:%s"NEWLINE % (mirror.internal_robot.username, retrieve_robot_token(mirror.internal_robot)),NEWLINE "--src-creds",NEWLINE "`rm -rf /`",NEWLINE "'docker://& rm -rf /;/namespace/repository:latest'",NEWLINE "docker://localhost:5000/mirror/repo:latest",NEWLINE ],NEWLINE "results": SkopeoResults(True, [], "stdout", "stderr"),NEWLINE },NEWLINE ]NEWLINENEWLINE def skopeo_test(args, proxy):NEWLINE try:NEWLINE skopeo_call = skopeo_calls.pop(0)NEWLINE assert args == skopeo_call["args"]NEWLINE assert proxy == {}NEWLINENEWLINE return skopeo_call["results"]NEWLINE except Exception as e:NEWLINE skopeo_calls.append(skopeo_call)NEWLINE raise eNEWLINENEWLINE run_skopeo_mock.side_effect = skopeo_testNEWLINENEWLINE worker = RepoMirrorWorker()NEWLINE worker._process_mirrors()NEWLINENEWLINE assert [] == skopeo_callsNEWLINENEWLINENEWLINE@disable_existing_mirrorsNEWLINE@mock.patch("util.repomirror.skopeomirror.SkopeoMirror.run_skopeo")NEWLINEdef test_quote_params_password(run_skopeo_mock, initialized_db, app):NEWLINE """NEWLINE Basic test of successful mirror.NEWLINE """NEWLINENEWLINE mirror, repo = create_mirror_repo_robot(["latest", "7.1"])NEWLINE mirror.external_reference = "& rm -rf /;/namespace/repository"NEWLINE mirror.external_registry_username = "`rm -rf /`"NEWLINE mirror.external_registry_password = '""$PATH\\"'NEWLINE mirror.save()NEWLINENEWLINE skopeo_calls = [NEWLINE {NEWLINE "args": [NEWLINE "/usr/bin/skopeo",NEWLINE "inspect",NEWLINE "--tls-verify=True",NEWLINE "--creds",NEWLINE '`rm -rf /`:""$PATH\\"',NEWLINE "'docker://& rm -rf /;/namespace/repository:latest'",NEWLINE ],NEWLINE "results": SkopeoResults(True, [], '{"RepoTags": ["latest"]}', ""),NEWLINE },NEWLINE {NEWLINE "args": [NEWLINE "/usr/bin/skopeo",NEWLINE "copy",NEWLINE "--all",NEWLINE "--remove-signatures",NEWLINE "--src-tls-verify=True",NEWLINE "--dest-tls-verify=True",NEWLINE "--dest-creds",NEWLINE "%s:%s"NEWLINE % (mirror.internal_robot.username, retrieve_robot_token(mirror.internal_robot)),NEWLINE "--src-creds",NEWLINE '`rm -rf /`:""$PATH\\"',NEWLINE "'docker://& rm -rf /;/namespace/repository:latest'",NEWLINE "docker://localhost:5000/mirror/repo:latest",NEWLINE ],NEWLINE "results": SkopeoResults(True, [], "stdout", "stderr"),NEWLINE },NEWLINE ]NEWLINENEWLINE def skopeo_test(args, proxy):NEWLINE try:NEWLINE skopeo_call = skopeo_calls.pop(0)NEWLINE assert args == skopeo_call["args"]NEWLINE assert proxy == {}NEWLINENEWLINE return skopeo_call["results"]NEWLINE except Exception as e:NEWLINE skopeo_calls.append(skopeo_call)NEWLINE raise eNEWLINENEWLINE run_skopeo_mock.side_effect = skopeo_testNEWLINENEWLINE worker = RepoMirrorWorker()NEWLINE worker._process_mirrors()NEWLINENEWLINE assert [] == skopeo_callsNEWLINENEWLINENEWLINE@disable_existing_mirrorsNEWLINE@mock.patch("util.repomirror.skopeomirror.SkopeoMirror.run_skopeo")NEWLINEdef test_inspect_error_mirror(run_skopeo_mock, initialized_db, app):NEWLINE """NEWLINE Test for no tag for skopeo inspect.NEWLINENEWLINE The mirror is processed four times, asserting that the remaining syncs decrement until next syncNEWLINE is bumped to the future, confirming the fourth is never processed.NEWLINE """NEWLINENEWLINE def skopeo_test(args, proxy):NEWLINE try:NEWLINE skopeo_call = skopeo_calls.pop(0)NEWLINE assert args == skopeo_call["args"]NEWLINE assert proxy == {}NEWLINENEWLINE return skopeo_call["results"]NEWLINE except Exception as e:NEWLINE skopeo_calls.append(skopeo_call)NEWLINE raise eNEWLINENEWLINE run_skopeo_mock.side_effect = skopeo_testNEWLINE worker = RepoMirrorWorker()NEWLINENEWLINE mirror, repo = create_mirror_repo_robot(["7.1"])NEWLINENEWLINE # Call number 1NEWLINE skopeo_calls = [NEWLINE {NEWLINE "args": [NEWLINE "/usr/bin/skopeo",NEWLINE "inspect",NEWLINE "--tls-verify=True",NEWLINE "docker://registry.example.com/namespace/repository:7.1",NEWLINE ],NEWLINE "results": SkopeoResults(NEWLINE False,NEWLINE [],NEWLINE "",NEWLINE 'time="2019-09-18T13:29:40Z" level=fatal msg="Error reading manifest 7.1 in registry.example.com/namespace/repository: manifest unknown: manifest unknown"',NEWLINE ),NEWLINE },NEWLINE {NEWLINE "args": [NEWLINE "/usr/bin/skopeo",NEWLINE "inspect",NEWLINE "--tls-verify=True",NEWLINE "docker://registry.example.com/namespace/repository:latest",NEWLINE ],NEWLINE "results": SkopeoResults(NEWLINE False,NEWLINE [],NEWLINE "",NEWLINE 'time="2019-09-18T13:29:40Z" level=fatal msg="Error reading manifest latest in registry.example.com/namespace/repository: manifest unknown: manifest unknown"',NEWLINE ),NEWLINE },NEWLINE ]NEWLINE worker._process_mirrors()NEWLINE mirror = RepoMirrorConfig.get_by_id(mirror.id)NEWLINE assert [] == skopeo_callsNEWLINE assert 2 == mirror.sync_retries_remainingNEWLINENEWLINE # Call number 2NEWLINE skopeo_calls = [NEWLINE {NEWLINE "args": [NEWLINE "/usr/bin/skopeo",NEWLINE "inspect",NEWLINE "--tls-verify=True",NEWLINE "docker://registry.example.com/namespace/repository:7.1",NEWLINE ],NEWLINE "results": SkopeoResults(NEWLINE False,NEWLINE [],NEWLINE "",NEWLINE 'time="2019-09-18T13:29:40Z" level=fatal msg="Error reading manifest 7.1 in registry.example.com/namespace/repository: manifest unknown: manifest unknown"',NEWLINE ),NEWLINE },NEWLINE {NEWLINE "args": [NEWLINE "/usr/bin/skopeo",NEWLINE "inspect",NEWLINE "--tls-verify=True",NEWLINE "docker://registry.example.com/namespace/repository:latest",NEWLINE ],NEWLINE "results": SkopeoResults(NEWLINE False,NEWLINE [],NEWLINE "",NEWLINE 'time="2019-09-18T13:29:40Z" level=fatal msg="Error reading manifest latest in registry.example.com/namespace/repository: manifest unknown: manifest unknown"',NEWLINE ),NEWLINE },NEWLINE ]NEWLINE worker._process_mirrors()NEWLINE mirror = RepoMirrorConfig.get_by_id(mirror.id)NEWLINE assert [] == skopeo_callsNEWLINE assert 1 == mirror.sync_retries_remainingNEWLINENEWLINE # Call number 3NEWLINE skopeo_calls = [NEWLINE {NEWLINE "args": [NEWLINE "/usr/bin/skopeo",NEWLINE "inspect",NEWLINE "--tls-verify=True",NEWLINE "docker://registry.example.com/namespace/repository:7.1",NEWLINE ],NEWLINE "results": SkopeoResults(NEWLINE False,NEWLINE [],NEWLINE "",NEWLINE 'time="2019-09-18T13:29:40Z" level=fatal msg="Error reading manifest 7.1 in registry.example.com/namespace/repository: manifest unknown: manifest unknown"',NEWLINE ),NEWLINE },NEWLINE {NEWLINE "args": [NEWLINE "/usr/bin/skopeo",NEWLINE "inspect",NEWLINE "--tls-verify=True",NEWLINE "docker://registry.example.com/namespace/repository:latest",NEWLINE ],NEWLINE "results": SkopeoResults(NEWLINE False,NEWLINE [],NEWLINE "",NEWLINE 'time="2019-09-18T13:29:40Z" level=fatal msg="Error reading manifest latest in registry.example.com/namespace/repository: manifest unknown: manifest unknown"',NEWLINE ),NEWLINE },NEWLINE ]NEWLINE worker._process_mirrors()NEWLINE mirror = RepoMirrorConfig.get_by_id(mirror.id)NEWLINE assert [] == skopeo_callsNEWLINE assert 3 == mirror.sync_retries_remainingNEWLINENEWLINE # Call number 4NEWLINE skopeo_calls = [NEWLINE {NEWLINE "args": [NEWLINE "/usr/bin/skopeo",NEWLINE "inspect",NEWLINE "--tls-verify=True",NEWLINE "docker://registry.example.com/namespace/repository:7.1",NEWLINE ],NEWLINE "results": SkopeoResults(NEWLINE False,NEWLINE [],NEWLINE "",NEWLINE 'time="2019-09-18T13:29:40Z" level=fatal msg="Error reading manifest 7.1 in registry.example.com/namespace/repository: manifest unknown: manifest unknown"',NEWLINE ),NEWLINE },NEWLINE {NEWLINE "args": [NEWLINE "/usr/bin/skopeo",NEWLINE "inspect",NEWLINE "--tls-verify=True",NEWLINE "docker://registry.example.com/namespace/repository:latest",NEWLINE ],NEWLINE "results": SkopeoResults(NEWLINE False,NEWLINE [],NEWLINE "",NEWLINE 'time="2019-09-18T13:29:40Z" level=fatal msg="Error reading manifest latest in registry.example.com/namespace/repository: manifest unknown: manifest unknown"',NEWLINE ),NEWLINE },NEWLINE ]NEWLINE worker._process_mirrors()NEWLINE mirror = RepoMirrorConfig.get_by_id(mirror.id)NEWLINE assert 2 == len(skopeo_calls)NEWLINE assert 3 == mirror.sync_retries_remainingNEWLINE |