content
stringlengths
1
1.04M
input_ids
listlengths
1
774k
ratio_char_token
float64
0.38
22.9
token_count
int64
1
774k
# Copyright (c) 2016 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or # implied. # See the License for the specific language governing permissions and # limitations under the License. from oslo_log import log as logging from sahara import conductor as c from sahara import context from sahara import exceptions as ex from sahara.i18n import _LE from sahara.service import api from sahara.service.edp import job_manager as manager from sahara.utils import edp from sahara.utils import proxy as p conductor = c.API LOG = logging.getLogger(__name__)
[ 2, 15069, 357, 66, 8, 1584, 2297, 10983, 11, 3457, 13, 198, 2, 198, 2, 49962, 739, 262, 24843, 13789, 11, 10628, 362, 13, 15, 357, 1169, 366, 34156, 15341, 198, 2, 345, 743, 407, 779, 428, 2393, 2845, 287, 11846, 351, 262, 13789, ...
3.48
275
import torch import torchvision import testing.config as config import torch.utils.data as data_utils transform = torchvision.transforms.Compose( [torchvision.transforms.ToTensor(), torchvision.transforms.RandomHorizontalFlip(), torchvision.transforms.Normalize((0.5, 0.5, 0.5), (0.5, 0.5, 0.5))]) transform_test = torchvision.transforms.Compose( [torchvision.transforms.ToTensor(), torchvision.transforms.Normalize((0.5, 0.5, 0.5), (0.5, 0.5, 0.5))]) train = torchvision.datasets.CIFAR10( config.TESTING, train=True, download=True, transform=transform) test = torchvision.datasets.CIFAR10( config.TESTING, train=False, download=True, transform=transform_test) idx = torch.arange(1000) trainx = data_utils.Subset(train, idx) testx = data_utils.Subset(test, idx) train_loader = torch.utils.data.DataLoader( trainx, batch_size=config.batch_size_train, shuffle=True ) test_loader = torch.utils.data.DataLoader( testx, batch_size=config.batch_size_test, shuffle=True )
[ 11748, 28034, 198, 11748, 28034, 10178, 198, 11748, 4856, 13, 11250, 355, 4566, 198, 11748, 28034, 13, 26791, 13, 7890, 355, 1366, 62, 26791, 198, 198, 35636, 796, 28034, 10178, 13, 7645, 23914, 13, 7293, 577, 7, 198, 220, 220, 220, 6...
2.009569
627
import asyncio import logging import re from asyncio import Queue, Event from dataclasses import dataclass from typing import Tuple from urllib.parse import urljoin, urlparse import html2text from aiohttp import ClientSession from asyncio_throttle import Throttler @dataclass
[ 11748, 30351, 952, 198, 11748, 18931, 198, 11748, 302, 198, 6738, 30351, 952, 1330, 4670, 518, 11, 8558, 198, 6738, 4818, 330, 28958, 1330, 4818, 330, 31172, 198, 6738, 19720, 1330, 309, 29291, 198, 6738, 2956, 297, 571, 13, 29572, 1330...
3.556962
79
#from .jtest import get_2014_nuggets #from .submissions import Updates from .judgements import ( get_2013_nuggets, get_2014_nuggets, get_2013_matches, get_2014_matches ) from .data import Resource, get_resource_manager from .misc import stringify_corenlp_doc, stringify_streamcorpus_sentence import os import signal import Queue import wtmf import gzip import re from sklearn.externals import joblib import streamcorpus as sc import corenlp.server from itertools import izip import pandas as pd from sklearn.metrics.pairwise import cosine_similarity import numpy as np from .geo import get_loc_sequences # for job in jobs: # articles_chunk, tsv_path = job # sentence_meta = [] # sentence_strings = [] # for si in sc.Chunk(path=articles_chunk, message=corpus.sc_msg()): # si.stream_id # # sentences = corpus.get_sentences(si) # str2idx = {} # for idx, sentence in enumerate(sentences): # key = ' '.join(token.token for token in sentence.tokens) # str2idx[key] = idx # # for sentence in si.body.sentences[u'article-clf']: # key = ' '.join(token.token for token in sentence.tokens) # idx = str2idx[key] # #print idx, ")", key # doc = cnlp.annotate(key) # norm_tokens = [] # for sent in doc: # for token in sent: # if token.ne == 'O': # words = token.lem.split(u'_') # for word in words: # if word != u'': # norm_tokens.append(word.lower()) # else: # norm_tokens.append( # u'__{}__'.format(token.ne.lower())) # sentence_strings.append( # (u' '.join(norm_tokens)).encode(u'utf-8')) # sentence_meta.append((si.stream_id, idx))
[ 2, 6738, 764, 73, 9288, 1330, 651, 62, 4967, 62, 77, 26550, 198, 2, 6738, 764, 7266, 8481, 1330, 28090, 198, 6738, 764, 10456, 43547, 1330, 357, 198, 220, 220, 220, 651, 62, 6390, 62, 77, 26550, 11, 651, 62, 4967, 62, 77, 26550, ...
1.769416
1,249
import pytest from acheron.workflows import over_11mer_matrix
[ 11748, 12972, 9288, 198, 6738, 936, 372, 261, 13, 1818, 44041, 1330, 625, 62, 1157, 647, 62, 6759, 8609, 628 ]
3.15
20
import datetime import json from unittest import mock import requests_mock from django.core import management from django.http import Http404 from django.test import RequestFactory, TestCase from django_hosts.resolvers import reverse from .models import ( METRIC_PERIOD_DAILY, METRIC_PERIOD_WEEKLY, GithubItemCountMetric, GitHubSearchCountMetric, Metric, TracTicketMetric, ) from .views import index, metric_detail, metric_json
[ 11748, 4818, 8079, 198, 11748, 33918, 198, 6738, 555, 715, 395, 1330, 15290, 198, 198, 11748, 7007, 62, 76, 735, 198, 6738, 42625, 14208, 13, 7295, 1330, 4542, 198, 6738, 42625, 14208, 13, 4023, 1330, 367, 29281, 26429, 198, 6738, 42625...
3.148936
141
import unittest from SQLite import SQLite if __name__ == "__main__": unittest.main()
[ 11748, 555, 715, 395, 198, 6738, 16363, 578, 1330, 16363, 578, 628, 198, 220, 220, 220, 220, 198, 361, 11593, 3672, 834, 6624, 366, 834, 12417, 834, 1298, 198, 220, 220, 220, 555, 715, 395, 13, 12417, 3419 ]
2.5
38
from django.contrib import messages from django.contrib.auth.decorators import login_required from django.core.urlresolvers import reverse from django.http import HttpResponseRedirect, HttpResponseForbidden from django.shortcuts import get_object_or_404, render from package.models import Project from timeline.models import TimelineEvent, TimelineEventInserterRulebook, TimelineEventInserterRule from timeline.forms import ( TimelineEventFormSet, TimelineEventInserterRulebookForm, TimelineEventInserterRuleFormSet, TimelineManagementForm, ) @login_required @login_required @login_required @login_required
[ 6738, 42625, 14208, 13, 3642, 822, 1330, 6218, 198, 6738, 42625, 14208, 13, 3642, 822, 13, 18439, 13, 12501, 273, 2024, 1330, 17594, 62, 35827, 198, 6738, 42625, 14208, 13, 7295, 13, 6371, 411, 349, 690, 1330, 9575, 198, 6738, 42625, ...
3.497238
181
# Copyright 2021 DeepMind Technologies Limited. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS-IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. """Reward targets that return target+actual.""" import abc import math from typing import List, Optional, Sequence, Tuple import dataclasses import numpy as np import scipy from fusion_tcv import fge_state from fusion_tcv import named_array from fusion_tcv import shape from fusion_tcv import tcv_common class TargetError(Exception): """For when a target can't be computed.""" @dataclasses.dataclass(frozen=True) class AbstractTarget(abc.ABC): """Measure something about the simulation, with a target and actual value.""" @property def name(self) -> str: """Returns a name for the target.""" return self.__class__.__name__ @abc.abstractproperty def outputs(self) -> int: """Return the number of outputs this produces.""" @abc.abstractmethod def __call__( self, voltages: np.ndarray, state: fge_state.FGEState, references: named_array.NamedArray) -> List[Target]: """Returns a list of targets.""" @dataclasses.dataclass(frozen=True) class AbstractSingleValuePerDomainTarget(AbstractTarget): """Base class for single value per plasma domain targets.""" target: Optional[Sequence[float]] = None indices: List[int] = dataclasses.field(default_factory=lambda: [0]) @property @property @dataclasses.dataclass(frozen=True) class R(AbstractSingleValuePerDomainTarget): """Target for R.""" @dataclasses.dataclass(frozen=True) class Z(AbstractSingleValuePerDomainTarget): """Target for Z.""" @dataclasses.dataclass(frozen=True) class Ip(AbstractSingleValuePerDomainTarget): """Target for Ip.""" class OHCurrentsClose(AbstractTarget): """Target for keeping OH currents close.""" @property class EFCurrents(AbstractTarget): """EFCurrents, useful for avoiding stuck coils.""" @property @dataclasses.dataclass(frozen=True) class VoltageOOB(AbstractTarget): """Target for how much the voltages exceed the bounds.""" relative: bool = True @property @dataclasses.dataclass(frozen=True) class ShapeElongation(AbstractSingleValuePerDomainTarget): """Try to keep the elongation close to the references.""" @dataclasses.dataclass(frozen=True) class ShapeTriangularity(AbstractSingleValuePerDomainTarget): """Try to keep the triangularity close to the references.""" @dataclasses.dataclass(frozen=True) class ShapeRadius(AbstractSingleValuePerDomainTarget): """Try to keep the shape radius close to the references.""" @dataclasses.dataclass(frozen=True) class AbstractPointsTarget(AbstractTarget): """Base class for shape point targets.""" points: Optional[shape.ShapePoints] = None ref_name: Optional[str] = None num_points: Optional[int] = None @property def splined_lcfs_points( state: fge_state.FGEState, num_points: int, domain: int = 0) -> shape.ShapePoints: """Return a smooth lcfs, cleaning FGE x-point artifacts.""" points = state.get_lcfs_points(domain) x_point = (shape.Point(*state.limit_point_d[domain]) if state.is_diverted_d[domain] else None) if x_point is not None: x_points = [x_point] # Drop points near the x-point due to noise in the shape projection near # the x-point. points = [p for p in points if shape.dist(p, x_point) > 0.1] points.append(x_point) points = shape.sort_by_angle(points) else: x_points = [] return shape.spline_interpolate_points(points, num_points, x_points) @dataclasses.dataclass(frozen=True) class ShapeLCFSDistance(AbstractPointsTarget): """Try to keep the shape close to the references. Check the distance from the target shape points to the smooth LCFS. """ ref_name: str = dataclasses.field(default="shape", init=False) domain: int = dataclasses.field(default=0, init=False) def flux_at_points(state: fge_state.FGEState, points: np.ndarray) -> np.ndarray: """Return the normalized interpolated flux values at a set of points.""" # Normalized flux such that the LCFS has a value of 1, 0 in the middle, # and bigger than 1 farther out. normalized_flux = ( # (LY.Fx - LY.FA) / (LY.FB - LY.FA) (state.flux - state.magnetic_axis_flux_strength) / (state.lcfs_flux_strength - state.magnetic_axis_flux_strength)).T smooth_flux = scipy.interpolate.RectBivariateSpline( np.squeeze(state.r_coordinates), np.squeeze(state.z_coordinates), normalized_flux) return smooth_flux(points[:, 0], points[:, 1], grid=False) @dataclasses.dataclass(frozen=True) class ShapeNormalizedLCFSFlux(AbstractPointsTarget): """Try to keep the shape close to the references using flux. Check the normalized flux values at points along the target shape. This works in flux space, not linear distance, so may encourage smaller plasmas than the distance based shape rewards. """ ref_name: str = dataclasses.field(default="shape1", init=False) @dataclasses.dataclass(frozen=True) class LegsNormalizedFlux(ShapeNormalizedLCFSFlux): """Try to keep the legs references close to the LCFS.""" ref_name: str = dataclasses.field(default="legs", init=False) @dataclasses.dataclass(frozen=True) class AbstractXPointTarget(AbstractPointsTarget): """Base class for x-point targets.""" ref_name: str = dataclasses.field(default="x_points", init=False) @dataclasses.dataclass(frozen=True) class XPointFluxGradient(AbstractXPointTarget): """Keep target points as an X point by attempting 0 flux gradient.""" @dataclasses.dataclass(frozen=True) class XPointDistance(AbstractXPointTarget): """Keep target points as an X point by attempting to minimize distance. This assigns the x-points to targets without replacement. The first target will get the distance to the nearest x-point. The second target will get the closest, but ignoring the one assigned to the first target point. If none are within `max_dist`, then no x-point is assigned and that distance will be returned. It may be worth switching to a fancier algorithm that tries to minimize the total distance between targets and x-points, but that's slower, and we may actually care about some x-points more (eg a diverted point is more important than one farther away). """ max_dist: float = 0.2 @dataclasses.dataclass(frozen=True) class XPointFar(AbstractXPointTarget): """Keep extraneous x-points far away from the LCFS. Returns the distance from the LCFS to any true x-point that is far from a target x-point. This assigns the x-points to targets without replacement. The first target will get the distance to the nearest x-point. The second target will get the closest, but ignoring the one assigned to the first target point. If none are within `max_dist`, then no x-point is assigned and that distance will be returned. It may be worth switching to a fancier algorithm that tries to minimize the total distance between targets and x-points, but that's slower, and we may actually care about some x-points more (eg a diverted point is more important than one farther away). """ max_dist: float = 0.2 domain: int = 0 diverted: Optional[shape.Diverted] = None @dataclasses.dataclass(frozen=True) class XPointNormalizedFlux(AbstractXPointTarget): """Keep the actual X points close to the LCFS. Choose the x-points based on their distance to the target x-points. """ max_dist: float = 0.2 diverted: Optional[shape.Diverted] = None @dataclasses.dataclass(frozen=True) class XPointCount(AbstractTarget): """Target for number of x-points. Useful to avoid more than you want.""" target: Optional[int] = None @property @dataclasses.dataclass(frozen=True) class Diverted(AbstractTarget): """Target for whether the plasma is diverted by an x-point.""" diverted: Optional[shape.Diverted] = None @property @dataclasses.dataclass(frozen=True) class LimitPoint(AbstractPointsTarget): """Target for where the plasma is limited, either on the wall or x-point.""" ref_name: str = dataclasses.field(default="limit_point", init=False) num_points: int = dataclasses.field(default=1, init=False) diverted: Optional[shape.Diverted] = None max_dist: float = 1
[ 2, 15069, 33448, 10766, 28478, 21852, 15302, 13, 198, 2, 198, 2, 49962, 739, 262, 24843, 13789, 11, 10628, 362, 13, 15, 357, 1169, 366, 34156, 15341, 198, 2, 345, 743, 407, 779, 428, 2393, 2845, 287, 11846, 351, 262, 13789, 13, 198,...
3.237687
2,680
from bs4 import BeautifulSoup import requests import re import json URL = 'https://www.espn.com/nhl/scoreboard/_/date/DATE'
[ 6738, 275, 82, 19, 1330, 23762, 50, 10486, 198, 11748, 7007, 198, 11748, 302, 198, 11748, 33918, 198, 198, 21886, 796, 705, 5450, 1378, 2503, 13, 9774, 77, 13, 785, 14, 77, 18519, 14, 26675, 3526, 47835, 14, 4475, 14, 35, 6158, 6 ]
2.883721
43
import os import sys MRPARSE_DIR = os.path.join(os.path.abspath(os.path.dirname(__file__)),'..') sys.path.insert(0, MRPARSE_DIR)
[ 11748, 28686, 198, 11748, 25064, 198, 198, 13599, 27082, 5188, 62, 34720, 796, 28686, 13, 6978, 13, 22179, 7, 418, 13, 6978, 13, 397, 2777, 776, 7, 418, 13, 6978, 13, 15908, 3672, 7, 834, 7753, 834, 36911, 6, 492, 11537, 198, 17597,...
2.280702
57
""" Custom integration to integrate victorsmartkill with Home Assistant. For more details about this integration, please refer to https://github.com/toreamun/victorsmartkill-homeassistant """ import asyncio from dataclasses import dataclass, field from datetime import timedelta import logging from typing import Callable, List from homeassistant.config_entries import ConfigEntry from homeassistant.const import CONF_PASSWORD, CONF_SCAN_INTERVAL, CONF_USERNAME from homeassistant.core import CALLBACK_TYPE, Config, callback from homeassistant.exceptions import ConfigEntryNotReady from homeassistant.helpers.typing import EventType, HomeAssistantType from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed from victor_smart_kill import Trap, VictorApi, VictorAsyncClient from custom_components.victorsmartkill.const import ( DEFAULT_UPDATE_INTERVAL_MINUTES, DOMAIN, EVENT_TRAP_LIST_CHANGED, PLATFORMS, STARTUP_MESSAGE, ) _LOGGER = logging.getLogger(__name__) @dataclass(frozen=True) class IntegrationContext: """Integration context needed by platforms and/or unload.""" coordinator: DataUpdateCoordinator unsubscribe_list: List[CALLBACK_TYPE] = field(default_factory=list) async def async_setup(hass: HomeAssistantType, config: Config) -> bool: """Set up this integration using YAML is not supported.""" # pylint: disable=unused-argument return True async def async_setup_entry(hass: HomeAssistantType, entry: ConfigEntry) -> bool: """Set up this integration using UI.""" _LOGGER.debug("async_setup_entry %s.", entry.title) if hass.data.get(DOMAIN) is None: hass.data.setdefault(DOMAIN, {}) _LOGGER.info(STARTUP_MESSAGE) coordinator = await _async_initialize_coordinator(hass, entry) context = IntegrationContext(coordinator=coordinator) hass.data[DOMAIN][entry.entry_id] = context await _async_forward_platform_setup(hass, entry, coordinator) _setup_reload(hass, entry, context) return True async def async_unload_entry(hass: HomeAssistantType, entry: ConfigEntry): """Handle removal of an entry.""" _LOGGER.debug("async_unload_entry %s.", entry.title) context: IntegrationContext = hass.data[DOMAIN][entry.entry_id] is_unloaded = all( await asyncio.gather( *[ hass.config_entries.async_forward_entry_unload(entry, platform) for platform in context.coordinator.platforms ] ) ) if is_unloaded: hass.data[DOMAIN].pop(entry.entry_id) await context.coordinator.async_close() for unsubscribe in context.unsubscribe_list: unsubscribe() return is_unloaded class VictorSmartKillDataUpdateCoordinator(DataUpdateCoordinator[List[Trap]]): """Class to manage fetching data from the API.""" def __init__( self, hass: HomeAssistantType, logger: logging.Logger, update_interval: timedelta, username: str, password: str, platforms: List[str], ) -> None: """Initialize.""" self.platforms: List[str] = platforms self._client = VictorAsyncClient(username, password) self._api = VictorApi(self._client) self._close = False super().__init__( hass, logger, update_method=self.async_update_data, name=DOMAIN, update_interval=update_interval, ) logger.info( ( "Data update coordinator for Victor Smart-Kill account %s " "initialized with %s platforms and update interval %s." ), username, platforms, update_interval, ) async def async_update_data(self) -> List[Trap]: """Update data via Victor Smart-Kill API.""" try: if not self.data: traps = await self._get_traps() else: previous_trap_ids = sorted([trap.id for trap in self.data]) traps = await self._get_traps() current_trap_ids = sorted([trap.id for trap in traps]) if previous_trap_ids != current_trap_ids: self.logger.debug( "List of traps has changed from %s to %s.", previous_trap_ids, current_trap_ids, ) self.hass.bus.async_fire( EVENT_TRAP_LIST_CHANGED, event_data={ "previous_traps": previous_trap_ids, "current_traps": current_trap_ids, }, ) return traps except Exception as exception: raise UpdateFailed(exception) from exception @callback def async_add_listener( self, update_callback: Callable[[], None] ) -> Callable[[], None]: """Listen for data updates. Called by CoordinatorEntity.""" # Overrided to add debug logging remove_listener_callback = super().async_add_listener(update_callback) self.logger.debug("Listener %s added to coordinator.", update_callback.__name__) return remove_listener_callback async def async_refresh(self) -> None: """Refresh data.""" if self._close: self.logger.debug("Coordinator is closed or closing. Ignore refresh.") else: await super().async_refresh() async def async_close(self) -> None: """Close resources.""" self.logger.debug("Close API client.") self._close = True await self._client.aclose() async def _get_traps(self) -> List[Trap]: """Get list of traps from API.""" try: traps = await self._api.get_traps() self.logger.debug( "Received traps list %s from Victor Smart-Kill API.", sorted([trap.id for trap in traps]), ) return traps except Exception: self.logger.debug( "Error getting traps from Victor Smart-Kill API.", exc_info=True ) raise async def _async_forward_platform_setup( hass: HomeAssistantType, entry: ConfigEntry, coodinator: VictorSmartKillDataUpdateCoordinator, ): """Forward setup to each platform.""" for platform in coodinator.platforms: _LOGGER.debug("Forward setup to %s platform.", platform) # Use `hass.async_create_task` to avoid a circular # dependency between the platform and the component hass.async_create_task( hass.config_entries.async_forward_entry_setup(entry, platform) ) @callback def _setup_reload( hass: HomeAssistantType, entry: ConfigEntry, context: IntegrationContext ): """Set up listeners of reload triggers.""" # Listen for config entry changes and reload when changed. context.unsubscribe_list.append( entry.add_update_listener(_async_config_entry_changed) ) @callback # Listen for trap list changes and reload when changed (new traps etc.) hass.bus.async_listen_once(EVENT_TRAP_LIST_CHANGED, async_trap_list_changed)
[ 37811, 201, 198, 15022, 11812, 284, 19386, 2210, 669, 13822, 12728, 351, 5995, 15286, 13, 201, 198, 201, 198, 1890, 517, 3307, 546, 428, 11812, 11, 3387, 3522, 284, 201, 198, 5450, 1378, 12567, 13, 785, 14, 83, 382, 321, 403, 14, 32...
2.248208
3,348
# Copyright (c) 2015 Stephen Warren # Copyright (c) 2015-2016, NVIDIA CORPORATION. All rights reserved. # # SPDX-License-Identifier: GPL-2.0 # Logic to interact with U-Boot running on real hardware, typically via a # physical serial port. import sys from u_boot_spawn import Spawn from u_boot_console_base import ConsoleBase class ConsoleExecAttach(ConsoleBase): """Represents a physical connection to a U-Boot console, typically via a serial port. This implementation executes a sub-process to attach to the console, expecting that the stdin/out of the sub-process will be forwarded to/from the physical hardware. This approach isolates the test infra- structure from the user-/installation-specific details of how to communicate with, and the identity of, serial ports etc.""" def __init__(self, log, config): """Initialize a U-Boot console connection. Args: log: A multiplexed_log.Logfile instance. config: A "configuration" object as defined in conftest.py. Returns: Nothing. """ # The max_fifo_fill value might need tweaking per-board/-SoC? # 1 would be safe anywhere, but is very slow (a pexpect issue?). # 16 is a common FIFO size. # HW flow control would mean this could be infinite. super(ConsoleExecAttach, self).__init__(log, config, max_fifo_fill=16) with self.log.section('flash'): self.log.action('Flashing U-Boot') cmd = ['u-boot-test-flash', config.board_type, config.board_identity] runner = self.log.get_runner(cmd[0], sys.stdout) runner.run(cmd) runner.close() self.log.status_pass('OK') def get_spawn(self): """Connect to a fresh U-Boot instance. The target board is reset, so that U-Boot begins running from scratch. Args: None. Returns: A u_boot_spawn.Spawn object that is attached to U-Boot. """ args = [self.config.board_type, self.config.board_identity] s = Spawn(['u-boot-test-console'] + args) self.log.action('Resetting board') cmd = ['u-boot-test-reset'] + args runner = self.log.get_runner(cmd[0], sys.stdout) runner.run(cmd) runner.close() return s
[ 2, 15069, 357, 66, 8, 1853, 7970, 11328, 198, 2, 15069, 357, 66, 8, 1853, 12, 5304, 11, 15127, 23929, 44680, 6234, 13, 1439, 2489, 10395, 13, 198, 2, 198, 2, 30628, 55, 12, 34156, 12, 33234, 7483, 25, 38644, 12, 17, 13, 15, 198,...
2.555071
917
from django.shortcuts import render from django.http import HttpResponse import helloWorld import HTMLmaker import graph_maker
[ 6738, 42625, 14208, 13, 19509, 23779, 1330, 8543, 198, 6738, 42625, 14208, 13, 4023, 1330, 367, 29281, 31077, 198, 11748, 23748, 10603, 198, 11748, 11532, 10297, 198, 11748, 4823, 62, 10297, 628, 628 ]
3.939394
33
import os import sys from pprint import pprint from operator import add import pyspark from pyspark.context import SparkContext sc = SparkContext() file = "SampleData3.txt" wordcounts = sc.textFile(file) \ .map(lambda l: ((l.split(" ")[0], len([x for x in l.split(" ")[1:] if ("gene_" in x or "disease_" in x)])), [x for x in l.split(" ")[1:] if ("gene_" in x or "disease_" in x)]))\ \ .flatMap(lambda x: x.split()) \ .map(lambda x: (x, 1)) \ .reduceByKey(lambda x,y:x+y) \ .map(lambda x:(x[1],x[0])) \ .sortByKey(False)
[ 11748, 28686, 198, 11748, 25064, 198, 6738, 279, 4798, 1330, 279, 4798, 198, 6738, 10088, 1330, 751, 198, 11748, 279, 893, 20928, 198, 6738, 279, 893, 20928, 13, 22866, 1330, 17732, 21947, 198, 198, 1416, 796, 17732, 21947, 3419, 198, 7...
2.207692
260
from alipay import AliPay from django.shortcuts import render # Create your views here. from rest_framework import status from mall import settings from rest_framework.permissions import IsAuthenticated from rest_framework.response import Response from rest_framework.views import APIView from orders.models import OrderInfo """ 1. 第一步:创建应用 (创建appid) 2. 第二步:配置密钥 (2对 我们的服务器一对,支付宝的一对) 2.1 我们生成的公钥和私钥 私钥放在我们自己服务器上 公钥放在 支付宝的平台上 2.2 把支付宝的公钥复制下来, 需要放到一个 以 ---public begin--- ---end-- 的文件中 3. 第三步:搭建和配置开发环境 (下载/安装 SDK) (SDK 就是 支付宝封装好的库) 4. 第四步:接口调用(开发, 看支付宝的API(接口文档)) 买家账号axirmj7487@sandbox.com 登录密码111111 """ """ 当用户点击去支付的时候,需要让前端将订单id传递过来 该接口必须是登陆用户 1. 接收订单id 2. 根据订单id查询订单 3. 生成alipay实例对象 4. 调用支付接口生成order_string 5. 拼接url 6. 返回url GET /orders/(?P<order_id>\d+)/payment/ """
[ 6738, 435, 541, 323, 1330, 12104, 19197, 198, 6738, 42625, 14208, 13, 19509, 23779, 1330, 8543, 198, 198, 2, 13610, 534, 5009, 994, 13, 198, 6738, 1334, 62, 30604, 1330, 3722, 198, 6738, 17374, 1330, 6460, 198, 6738, 1334, 62, 30604, ...
1.155396
695
#! -*- coding: utf-8 -*- """ Global Configuration """ # Author: DengBoCong <bocongdeng@gmail.com> # # License: Apache-2.0 License from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import uuid from configs.configs import config from configs.constant import * from flask import Flask from flask_caching import Cache from flask_login import LoginManager from flask_mail import Mail from flask_socketio import SocketIO from flask_sqlalchemy import SQLAlchemy mail = Mail() db = SQLAlchemy() socket_io = SocketIO() login_manager = LoginManager() login_manager.session_protection = "strong" login_manager.login_view = "views.login" login_manager.login_message = "Token is invalid, please regain permissions" @login_manager.user_loader def load_user(user_id): """ Activate session """ return {"ID": "null"} basedir = os.path.abspath(os.path.dirname(__file__)) def create_app(config_name): """ Server app related configuration """ app = Flask(__name__, template_folder="../app/templates", static_folder="../app/static") app.config.from_object(config[config_name]) config[config_name].init_app(app=app) app.secret_key = uuid.uuid1().__str__() app.jinja_env.variable_start_string = "[[" app.jinja_env.variable_end_string = "]]" cache = Cache(config={"CACHE_TYPE": "simple"}) db.init_app(app=app) mail.init_app(app=app) cache.init_app(app=app) login_manager.init_app(app=app) socket_io.init_app(app=app) from app.view import views from dialogue.pytorch.apis import apis app.register_blueprint(views) app.register_blueprint(apis) return app
[ 2, 0, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 37811, 8060, 28373, 198, 37811, 198, 2, 6434, 25, 41985, 16635, 18649, 1279, 65, 420, 506, 67, 1516, 31, 14816, 13, 785, 29, 198, 2, 198, 2, 13789, 25, 24843, 12,...
2.844221
597
#!/usr/bin/env python3 from setuptools import setup fuse_reqs = [ 'fuse-python >= 0.3.1; python_version < "3"', 'fuse-python >= 1.0.0; python_version > "3"', ] readme = open('README.md', 'r').read() readme = readme.replace( '(FUSE.md)', '(https://github.com/drougge/wellpapp-pyclient/blob/master/FUSE.md)' ) setup( name='wellpapp', version='CHANGEME.dev', # set this for each release packages=[ 'wellpapp', 'wellpapp.shell', ], entry_points={ 'console_scripts': [ 'wp = wellpapp.__main__:main', ], }, install_requires=[ 'Pillow >= 3.1.2', 'PyGObject >= 3.20', ], extras_require={ 'fuse': fuse_reqs, 'all': fuse_reqs, }, python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*', author='Carl Drougge', author_email='bearded@longhaired.org', url='https://github.com/drougge/wellpapp-pyclient', license='MIT', description='Client library and application for the wellpapp image tagging system.', long_description=readme, long_description_content_type='text/markdown', )
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 198, 6738, 900, 37623, 10141, 1330, 9058, 198, 198, 69, 1904, 62, 42180, 82, 796, 685, 198, 197, 6, 69, 1904, 12, 29412, 18189, 657, 13, 18, 13, 16, 26, 21015, 62, 9641, 1279, ...
2.31377
443
#!/usr/bin/env python """Unit tests for opscore.utility.html """ # Created 28-Jun-2008 by David Kirkby (dkirkby@uci.edu) import unittest from html.parser import HTMLParser import opscore.utility.html as utilHtml if __name__ == "__main__": unittest.main()
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 37811, 26453, 5254, 329, 39628, 7295, 13, 315, 879, 13, 6494, 198, 37811, 198, 198, 2, 15622, 2579, 12, 22396, 12, 11528, 416, 3271, 13855, 1525, 357, 34388, 14232, 1525, 31, 42008, 13...
2.778947
95
import pathlib import numpy as np import pytest from numpy.testing import assert_allclose import pygeems FPATH_DATA = pathlib.Path(__file__).parent / "data" @pytest.mark.parametrize( "yield_coef,pga,mag,pgv,expected", [ # Examples from Rathje et. al (2014) (0.1, 0.54, 6.75, None, 43), (0.1, 0.54, None, 42, 29), (0.1, 0.88, 6.75, None, 113), (0.1, 0.88, None, 71, 81), # Examples from Rathje & Antonakos (2011) # These do not work... # (0.1, 0.38, 8.0, None, 63.1), # (0.1, 0.38, None, 80, 36.9), ], ) @pytest.mark.parametrize( "yield_coef,pga,period_slide,period_mean,mag,pgv,expected", [ # Examples from Rathje et. al (2014) # Values read from Figure 8c (0.05, 0.35, 0.2, 0.45, 7.0, None, 87.5), (0.10, 0.35, 0.2, 0.45, 7.0, None, 22.0), (0.05, 0.35, 0.2, 0.45, None, 30, 43.5), (0.10, 0.35, 0.2, 0.45, None, 30, 10.5), # Examples from Rathje & Antonakos (2011) # These do not work... # (0.1, 0.48, 0.2, 0.46, 8.0, None, 126), # (0.1, 0.48, 0.2, 0.46, None, 74, 49) ], ) # Test values from Table 1 in BT07 @pytest.mark.parametrize( "yield_coef,period_slide,psa_dts,expected", [ (0.35, 0.45, 0.43, 0.85), (0.08, 0.00, 0.24, 0.1), (0.14, 0.33, 0.94, 0.0), ], ) # Test values from Table 1 in BT07. Authors provided a range of values, which are # interpreted to be log-normally distributed. The median is computed and tested against @pytest.mark.parametrize( "yield_coef,period_slide,psa_dts,expected", [ (0.08, 0.00, 0.24, np.sqrt(4 * 15)), (0.14, 0.33, 0.94, np.sqrt(20 * 70)), ], ) @pytest.mark.parametrize( "invert,yield_coef,expected", [ (False, 0.05, 69.4), (True, 0.05, 66.1), (False, 0.10, 28.5), (True, 0.10, 30.5), ], ) # Test values from Table 2 of Bray et al. (2018). Coastline slope and Nishigo dam @pytest.mark.parametrize( "yield_coef,period_slide,psa_dts,mag,expected", [ (0.10, 0.6, 0.25, 8.0, np.sqrt(3 * 12)), (0.26, 0.15, 1.51, 9.0, np.sqrt(14 * 58)), ], ) # Test values from Table 2 of Bray et al. (2018). Esperanza and Tutuven dams. @pytest.mark.parametrize( "yield_coef,period_slide,psa_dts,expected", [ (0.24, 0.40, 0.43, 0.50), (0.39, 0.15, 0.75, 0.60), ], )
[ 11748, 3108, 8019, 198, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 12972, 9288, 198, 6738, 299, 32152, 13, 33407, 1330, 6818, 62, 439, 19836, 198, 198, 11748, 12972, 469, 5232, 628, 198, 5837, 12599, 62, 26947, 796, 3108, 8019, 13,...
1.894574
1,290
#<Tommil> There is one particular detail in session forming which may not be obvious. The answering party needs to send ack to the connection request message as the very first message #<Tommil> the calling party is using this ack to bind together upstream and downstream session session ids import datetime from collections import deque from threading import Lock from aether.mxp import * from aether.collections import * #Enumeration of the various states our session could be in. #Structure for keeping track of how many frames have been completed on a message we are building. #This class in responsible for multiplexing a number of messages into packets.
[ 2, 27, 51, 2002, 346, 29, 1318, 318, 530, 1948, 3703, 287, 6246, 14583, 543, 743, 407, 307, 3489, 13, 383, 18877, 2151, 2476, 284, 3758, 257, 694, 284, 262, 4637, 2581, 3275, 355, 262, 845, 717, 3275, 198, 2, 27, 51, 2002, 346, ...
3.791209
182
"""Entry point to start service.""" from pro_tes.api.register_openapi import register_openapi from pro_tes.config.app_config import parse_app_config from pro_tes.config.config_parser import (get_conf, get_conf_type) from pro_tes.config.log_config import configure_logging from pro_tes.database.register_mongodb import register_mongodb from pro_tes.errors.errors import register_error_handlers from pro_tes.factories.connexion_app import create_connexion_app from pro_tes.tasks.register_celery import register_task_service from pro_tes.security.cors import enable_cors if __name__ == '__main__': connexion_app, config = run_server() # Run app connexion_app.run( use_reloader=get_conf(config, 'server', 'use_reloader') )
[ 37811, 30150, 966, 284, 923, 2139, 526, 15931, 198, 198, 6738, 386, 62, 4879, 13, 15042, 13, 30238, 62, 9654, 15042, 1330, 7881, 62, 9654, 15042, 198, 6738, 386, 62, 4879, 13, 11250, 13, 1324, 62, 11250, 1330, 21136, 62, 1324, 62, 1...
2.929412
255
# Copyright 2020-present the HuggingFace Inc. team. # Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # Notice, most of this file is modified from # https://github.com/huggingface/transformers/blob/main/src/transformers # Thanks a lot. import paddle import paddle.distributed as dist from typing import Any, Callable, Dict, List, Optional, Tuple, Union def paddle_pad_and_concatenate(tensor1, tensor2, padding_index=-100): """Concatenates `tensor1` and `tensor2` on first axis, applying padding on the second if necessary.""" if len(tensor1.shape) == 1 or tensor1.shape[1] == tensor2.shape[1]: return paddle.concat((tensor1, tensor2), axis=0) # raise ValueError("Error") # Let's figure out the new shape new_shape = (tensor1.shape[0] + tensor2.shape[0], max( tensor1.shape[1], tensor2.shape[1])) + tuple(tensor1.shape[2:]) # Now let's fill the result tensor # result = tensor1.new_full(new_shape, padding_index) result = paddle.full(new_shape, padding_index, dtype=tensor1.dtype) result[:tensor1.shape[0], :tensor1.shape[1]] = tensor1 result[tensor1.shape[0]:, :tensor2.shape[1]] = tensor2 return result def nested_concat(tensors, new_tensors, padding_index=-100): """ Concat the `new_tensors` to `tensors` on the first dim and pad them on the second if needed. Works for tensors or nested list/tuples of tensors. """ assert type(tensors) == type( new_tensors ), f"Expected `tensors` and `new_tensors` to have the same type but found {type(tensors)} and {type(new_tensors)}." if isinstance(tensors, (list, tuple)): return type(tensors)(nested_concat( t, n, padding_index=padding_index) for t, n in zip(tensors, new_tensors)) elif isinstance(tensors, paddle.Tensor): return paddle_pad_and_concatenate( tensors, new_tensors, padding_index=padding_index) elif isinstance(tensors, np.ndarray): return numpy_pad_and_concatenate( tensors, new_tensors, padding_index=padding_index) else: raise TypeError( f"Unsupported type for concatenation: got {type(tensors)}") def nested_detach(tensors): "Detach `tensors` (even if it's a nested list/tuple of tensors)." if isinstance(tensors, (list, tuple)): return type(tensors)(nested_detach(t) for t in tensors) return tensors.detach() def nested_numpify(tensors): "Numpify `tensors` (even if it's a nested list/tuple of tensors)." if isinstance(tensors, (list, tuple)): return type(tensors)(nested_numpify(t) for t in tensors) t = tensors.cpu() if t.dtype == paddle.float16: t = t.cast(paddle.float32) return t.numpy() def nested_truncate(tensors, limit): "Truncate `tensors` at `limit` (even if it's a nested list/tuple of tensors)." if isinstance(tensors, (list, tuple)): return type(tensors)(nested_truncate(t, limit) for t in tensors) return tensors[:limit]
[ 2, 15069, 12131, 12, 25579, 262, 12905, 2667, 32388, 3457, 13, 1074, 13, 198, 2, 15069, 357, 66, 8, 33160, 350, 37382, 47, 37382, 46665, 13, 1439, 6923, 33876, 13, 198, 2, 198, 2, 49962, 739, 262, 24843, 13789, 11, 10628, 362, 13, ...
2.57318
1,387
# COMMAND 14 BACK AND FRONT CAMERA - NO FLIGHT from pyparrot.Minidrone import Mambo from ground_inspector.ftp_download import ftp_download from ground_inspector.ground_vision import ground_vision from shelf_detector.simple_qr_scan import qr_scan_image from pyparrot.DroneVision import DroneVision import threading import cv2 import time import os mamboAddr = "e0:14:d0:63:3d:d0" os.path.join(os.path.dirname(__file__)) mambo = Mambo(mamboAddr, use_wifi=True) print("trying to connect") success = mambo.connect(num_retries=3) print("connected: %s" % success) if (success): print("sleeping") mambo.smart_sleep(1) mambo.ask_for_state_update() mambo.smart_sleep(2) print("Preparing to open vision") mamboVision = DroneVision(mambo, is_bebop=False, buffer_size=30) userVision = UserVision(mamboVision) mamboVision.set_user_callback_function(userVision.save_pictures, user_callback_args=None) success = mamboVision.open_video() print("Success in opening vision is %s" % success) mambo.smart_sleep(2) if (mambo.sensors.flying_state != "emergency"): for i in range(3): mambo.smart_sleep(2) pic_success = mambo.take_picture() mambo.smart_sleep(1) ftp_download() ground_coordinates_value = ground_vision() mambo.smart_sleep(2) print("Ending the sleep and vision") mamboVision.close_video() mambo.smart_sleep(2) print("disconnect") mambo.disconnect()
[ 2, 22240, 6981, 1478, 28767, 5357, 8782, 35830, 32421, 46461, 532, 8005, 9977, 9947, 198, 6738, 12972, 1845, 10599, 13, 9452, 312, 33171, 1330, 337, 22651, 198, 6738, 2323, 62, 1040, 806, 273, 13, 701, 79, 62, 15002, 1330, 10117, 79, ...
2.473597
606
# -*- coding: utf-8 -*- # Copyright (c) 2020. Distributed under the terms of the MIT License. from argparse import Namespace from copy import deepcopy from pathlib import Path import yaml from pymatgen.core import Structure from pymatgen.ext.matproj import MPRester from pymatgen.io.vasp import Vasprun, Outcar from vise.analyzer.plot_absorption_coeff import AbsorptionCoeffMplPlotter from vise.analyzer.plot_band import BandPlotter from vise.analyzer.plot_dos import DosPlotter from vise.analyzer.vasp.band_edge_properties import VaspBandEdgeProperties from vise.analyzer.vasp.dos_data import DosDataFromVasp from vise.analyzer.vasp.make_diele_func import make_diele_func from vise.analyzer.vasp.make_effective_mass import make_effective_mass from vise.analyzer.vasp.plot_band import BandPlotInfoFromVasp from vise.atom_energies.make_atom_vasp_set import make_atom_poscar_dirs from vise.cli.main_tools import potcar_str2dict, list2dict from vise.defaults import defaults from vise.input_set.datasets.dataset_util import all_incar_flags from vise.input_set.input_options import CategorizedInputOptions, \ assignable_option_set from vise.input_set.kpoints_mode import KpointsMode from vise.input_set.prior_info import prior_info_from_calc_dir, PriorInfo from vise.input_set.task import Task from vise.input_set.vasp_input_files import VaspInputFiles from vise.util.file_transfer import FileTransfers from vise.util.logger import get_logger from vise.util.structure_symmetrizer import StructureSymmetrizer logger = get_logger(__name__)
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 2, 220, 15069, 357, 66, 8, 12131, 13, 4307, 6169, 739, 262, 2846, 286, 262, 17168, 13789, 13, 198, 198, 6738, 1822, 29572, 1330, 28531, 10223, 198, 6738, 4866, 1330, 2...
2.941176
527
from sutree.display.valueutil import ValueUtil from sutree.display.bintreeparser import BinTreeParser
[ 6738, 264, 315, 631, 13, 13812, 13, 8367, 22602, 1330, 11052, 18274, 346, 198, 6738, 264, 315, 631, 13, 13812, 13, 65, 600, 260, 538, 28198, 1330, 20828, 27660, 46677, 628, 628 ]
3.28125
32
# AppLogger : The application logger for python # Useful in auditing actions/variables and storing everything to a log file. # Git repo: https://github.com/codarrenvelvindron/AppLogger-python # By Codarren Velvindron # Contact: devildron@gmail.com # 25/02/2021 # Licence: MIT import os from datetime import datetime
[ 2, 2034, 11187, 1362, 1058, 383, 3586, 49706, 329, 21015, 198, 2, 49511, 287, 2709, 1780, 4028, 14, 25641, 2977, 290, 23069, 2279, 284, 257, 2604, 2393, 13, 198, 2, 15151, 29924, 25, 3740, 1378, 12567, 13, 785, 14, 19815, 283, 918, ...
3.268041
97
import os import json import facebook from graphipy.graph.graph_base import BaseNode as Node, BaseEdge as Edge
[ 11748, 28686, 198, 11748, 33918, 198, 11748, 23960, 198, 6738, 4823, 541, 88, 13, 34960, 13, 34960, 62, 8692, 1330, 7308, 19667, 355, 19081, 11, 7308, 37021, 355, 13113, 628, 628, 628, 628 ]
3.575758
33
# encoding: utf-8 # module Autodesk.Civil calls itself Civil # from Civil3DNodes, Version=13.2.2161.0, Culture=neutral, PublicKeyToken=null # by generator 1.145 # no doc # no imports # no functions # no classes # variables with complex values
[ 2, 21004, 25, 3384, 69, 12, 23, 198, 2, 8265, 5231, 4147, 74, 13, 32610, 3848, 2346, 7511, 198, 2, 422, 7511, 18, 35504, 4147, 11, 10628, 28, 1485, 13, 17, 13, 20666, 16, 13, 15, 11, 17346, 28, 29797, 11, 5094, 9218, 30642, 28, ...
3.181818
77
#!/usr/bin/env python #-*- coding:utf-8 -*- # author:jingtongyu # datetime:2020/6/7 10:14 下午 # software: PyCharm import string import flask_restful from flask import Flask, abort, jsonify, request from hashids import Hashids from models import db from common import code, pretty_result # 添加请求钩子 from common.middlewares import jwt_authentication from flask_mail import Mail from config import config app = Flask(__name__) hash_ids = Hashids(salt='hvwptlmj129d5quf', min_length=8, alphabet=string.ascii_lowercase + string.digits) # 保留flask原生异常处理 handle_exception = app.handle_exception handle_user_exception = app.handle_user_exception def _custom_abort(http_status_code, **kwargs): """ 自定义abort 400响应数据格式 """ if http_status_code == 400: message = kwargs.get('message') if isinstance(message, dict): param, info = list(message.items())[0] data = '{}:{}!'.format(param, info) return abort(jsonify(pretty_result(code.PARAM_ERROR, data=data))) else: return abort(jsonify(pretty_result(code.PARAM_ERROR, data=message))) return abort(http_status_code) def _access_control(response): """ 解决跨域请求 """ response.headers['Access-Control-Allow-Origin'] = '*' response.headers['Access-Control-Allow-Methods'] = 'GET,HEAD,PUT,PATCH,POST,DELETE' response.headers['Access-Control-Allow-Headers'] = 'Content-Type' response.headers['Access-Control-Max-Age'] = 86400 return response def create_app(config): """ 创建app """ # 添加配置 app.config.from_object(config) # 解决跨域 app.after_request(_access_control) # 自定义abort 400 响应数据格式 flask_restful.abort = _custom_abort @app.before_request @app.after_request # 数据库初始化 db.init_app(app) # 注册蓝图 from routes import api_v1 app.register_blueprint(api_v1, url_prefix='/api/v1') # 使用flask原生异常处理程序 app.handle_exception = handle_exception app.handle_user_exception = handle_user_exception # app.config.update( # MAIL_SERVER=app.config.get('MAIL_SERVER'), # MAIL_PORT=app.config.get('MAIL_PORT'), # MAIL_USE_SSL=app.config.get('MAIL_USE_SSL'), # MAIL_USE_TLS=app.config.get('MAIL_USE_TLS'), # MAIL_USERNAME=app.config.get('MAIL_USERNAME'), # MAIL_PASSWORD=app.config.get('MAIL_PASSWORD'), # ) return app # mail = Mail(app)
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 2, 12, 9, 12, 19617, 25, 40477, 12, 23, 532, 9, 12, 198, 2, 1772, 25, 49940, 83, 506, 24767, 198, 2, 4818, 8079, 25, 42334, 14, 21, 14, 22, 838, 25, 1415, 220, 10310, 233, 3935...
2.125553
1,131
from .async_vec_env import AsyncVectorEnv
[ 6738, 764, 292, 13361, 62, 35138, 62, 24330, 1330, 1081, 13361, 38469, 4834, 85, 198 ]
2.8
15
#!/usr/bin/python # -*- coding: utf-8 -*- # https://github.com/mikolak-net/ansible-raspi-config/blob/master/library/expand_fs.py from ansible.module_utils.basic import * MAIN_PARTITION_NAME = "/dev/mmcblk0p2" main()
[ 2, 48443, 14629, 14, 8800, 14, 29412, 198, 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 2, 3740, 1378, 12567, 13, 785, 14, 76, 1134, 349, 461, 12, 3262, 14, 504, 856, 12, 81, 5126, 72, 12, 11250, 14, 2436, 67...
2.268041
97
#!/usr/bin/env python # Copyright 2015 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from __future__ import with_statement import os import string import sys FILE_TEMPLATE = \ """<?xml version="1.0" encoding="utf-8"?> <!-- This file is generated. Please use 'src/tools/polymer/polymer_grdp_to_txt.py' and 'src/tools/polymer/txt_to_polymer_grdp.py' to modify it, if possible. 'polymer_grdp_to_txt.py' converts 'polymer_resources.grdp' to a plain list of used Polymer components: ... iron-iron-iconset/iron-iconset-extracted.js iron-iron-iconset/iron-iconset.html ... 'txt_to_polymer_grdp.py' converts list back to GRDP file. Usage: $ polymer_grdp_to_txt.py polymer_resources.grdp > /tmp/list.txt $ vim /tmp/list.txt $ txt_to_polymer_grdp.py /tmp/list.txt > polymer_resources.grdp --> <grit-part> <!-- Polymer 1.0 --> %(v_1_0)s <structure name="IDR_POLYMER_1_0_WEB_ANIMATIONS_JS_WEB_ANIMATIONS_NEXT_LITE_MIN_JS" file="../../../third_party/web-animations-js/sources/web-animations-next-lite.min.js" type="chrome_html" compress="gzip" /> </grit-part> """ DEFINITION_TEMPLATE_1_0 = \ """ <structure name="%s" file="../../../third_party/polymer/v1_0/components-chromium/%s" type="chrome_html" compress="gzip" />""" _HERE = os.path.dirname(os.path.realpath(__file__)) _POLYMER_DIR = os.path.join(_HERE, os.pardir, os.pardir, 'third_party', 'polymer', 'v1_0', 'components-chromium') if __name__ == '__main__': sys.exit(main(sys.argv))
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 2, 15069, 1853, 383, 18255, 1505, 46665, 13, 1439, 2489, 10395, 13, 198, 2, 5765, 286, 428, 2723, 2438, 318, 21825, 416, 257, 347, 10305, 12, 7635, 5964, 326, 460, 307, 198, 2, 1043,...
2.343137
714
from dataclasses import dataclass, field from datetime import datetime from rubicon.domain.utils import uuid DIRECTIONALITY_VALUES = ["score", "loss"] @dataclass(frozen=True)
[ 6738, 4818, 330, 28958, 1330, 4818, 330, 31172, 11, 2214, 198, 6738, 4818, 8079, 1330, 4818, 8079, 198, 198, 6738, 6437, 4749, 13, 27830, 13, 26791, 1330, 334, 27112, 198, 198, 17931, 23988, 2849, 1847, 9050, 62, 23428, 35409, 796, 1463...
3.033898
59
# # PySNMP MIB module RAID-Adapter-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/RAID-Adapter-MIB # Produced by pysmi-0.3.4 at Wed May 1 14:51:41 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # ObjectIdentifier, Integer, OctetString = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "Integer", "OctetString") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") SingleValueConstraint, ConstraintsUnion, ValueRangeConstraint, ValueSizeConstraint, ConstraintsIntersection = mibBuilder.importSymbols("ASN1-REFINEMENT", "SingleValueConstraint", "ConstraintsUnion", "ValueRangeConstraint", "ValueSizeConstraint", "ConstraintsIntersection") NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance") MibIdentifier, NotificationType, Integer32, Unsigned32, ObjectIdentity, IpAddress, NotificationType, Counter64, enterprises, ModuleIdentity, TimeTicks, iso, MibScalar, MibTable, MibTableRow, MibTableColumn, Gauge32, Counter32, Bits = mibBuilder.importSymbols("SNMPv2-SMI", "MibIdentifier", "NotificationType", "Integer32", "Unsigned32", "ObjectIdentity", "IpAddress", "NotificationType", "Counter64", "enterprises", "ModuleIdentity", "TimeTicks", "iso", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Gauge32", "Counter32", "Bits") DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention") lsi = MibIdentifier((1, 3, 6, 1, 4, 1, 3582)) megaRaid = MibIdentifier((1, 3, 6, 1, 4, 1, 3582, 1)) megaRaidMib = MibIdentifier((1, 3, 6, 1, 4, 1, 3582, 1, 1)) adapterTable = MibTable((1, 3, 6, 1, 4, 1, 3582, 1, 1, 1), ) if mibBuilder.loadTexts: adapterTable.setStatus('optional') if mibBuilder.loadTexts: adapterTable.setDescription('A List of Adapter Entries containing Information/Properties about the Adapters in the System.') adapterEntry = MibTableRow((1, 3, 6, 1, 4, 1, 3582, 1, 1, 1, 1), ).setIndexNames((0, "RAID-Adapter-MIB", "adpAdapterNumber")) if mibBuilder.loadTexts: adapterEntry.setStatus('optional') if mibBuilder.loadTexts: adapterEntry.setDescription('An entry in the Adapter Table. Each Entry corresponds to one Adapter in the System.') adpAdapterNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 1, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: adpAdapterNumber.setStatus('optional') if mibBuilder.loadTexts: adpAdapterNumber.setDescription('The Adapter Number for this Instance of Adapter Object. This Entry in the Table, contains Information about the Adapter Number specified by this variable.') numLogicalDrives = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 1, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 8))).setMaxAccess("readonly") if mibBuilder.loadTexts: numLogicalDrives.setStatus('optional') if mibBuilder.loadTexts: numLogicalDrives.setDescription('Number of Logical Drives Configured on this Adapter.') firmwareVersion = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 1, 1, 3), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: firmwareVersion.setStatus('optional') if mibBuilder.loadTexts: firmwareVersion.setDescription('The Firmware Version of the Firmware running on this Adapter.') biosVersion = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 1, 1, 4), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: biosVersion.setStatus('optional') if mibBuilder.loadTexts: biosVersion.setDescription('The Bios Version of the BIOS Present in the Flash ROM on this Adapter.') dramSizeInMB = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 1, 1, 5), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: dramSizeInMB.setStatus('optional') if mibBuilder.loadTexts: dramSizeInMB.setDescription('Amount of DRAM in Mega Bytes present on this Adapter.') rebuildRateInPercent = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 1, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readwrite") if mibBuilder.loadTexts: rebuildRateInPercent.setStatus('optional') if mibBuilder.loadTexts: rebuildRateInPercent.setDescription('Rebuild Rate for this Adapter. This determines the Priority of Rebuild/Check-Consistency/Reconstruct Operations versus the Read-Write Operations.') flushInterval = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 1, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(2, 4, 6, 8, 10))).clone(namedValues=NamedValues(("twoSec", 2), ("fourSec", 4), ("sixSec", 6), ("eightSec", 8), ("tenSec", 10)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: flushInterval.setStatus('optional') if mibBuilder.loadTexts: flushInterval.setDescription('Internal Cache Flush Interval for Logical Drives in WriteBack Mode.') maxConcurrentCmds = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 1, 1, 8), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: maxConcurrentCmds.setStatus('optional') if mibBuilder.loadTexts: maxConcurrentCmds.setDescription('Maximum Concurrent Commands Supported by the Adapter.') spinupDelay = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 1, 1, 9), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: spinupDelay.setStatus('optional') if mibBuilder.loadTexts: spinupDelay.setDescription('This is the Spinup Delay for Spinning Up Physical Drives at Firmware Initialization Time. The Physical Drives are divided into Groups, each containing the number of drives indicated by the spinupCount variable. spinupDelay variable is the amount of delay used before the drives in the next group are issued a SPINUP Command.') spinupCount = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 1, 1, 10), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: spinupCount.setStatus('optional') if mibBuilder.loadTexts: spinupCount.setDescription('This is the Spinup Count for Spinning up Physical Drives at Firmware Initialization Time. The Physical Drives are divided into Groups, each containing the number of drives indicated by this variable. All the drives in a group are issued SPINUP Command without any delay. Next group is given SPINUP Commands after a delay indicated by the spinupDelay variable.') adpIOReadsPerSec = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 1, 1, 11), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: adpIOReadsPerSec.setStatus('optional') if mibBuilder.loadTexts: adpIOReadsPerSec.setDescription('Number of IO Reads/sec statistics for this adapter.') adpIOWritesPerSec = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 1, 1, 12), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: adpIOWritesPerSec.setStatus('optional') if mibBuilder.loadTexts: adpIOWritesPerSec.setDescription('Number of IO Writes/sec statistics for this adapter.') adpReadKBsPerSec = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 1, 1, 13), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: adpReadKBsPerSec.setStatus('optional') if mibBuilder.loadTexts: adpReadKBsPerSec.setDescription('Amount of Data Transferred in KBs/sec due to READ Transfers.') adpWriteKBsPerSec = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 1, 1, 14), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: adpWriteKBsPerSec.setStatus('optional') if mibBuilder.loadTexts: adpWriteKBsPerSec.setDescription('Amount of Data Transferred in KBs/sec due to WRITE Transfers.') adpReadFailuresPerSec = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 1, 1, 15), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: adpReadFailuresPerSec.setStatus('optional') if mibBuilder.loadTexts: adpReadFailuresPerSec.setDescription('Number of Read-Failures/sec statistics for this adapter.') adpWriteFailuresPerSec = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 1, 1, 16), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: adpWriteFailuresPerSec.setStatus('optional') if mibBuilder.loadTexts: adpWriteFailuresPerSec.setDescription('Number of Write-Failures/sec statistics for this adapter.') scanChannels = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 1, 1, 17), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("scanOver", 1), ("startScan", 2), ("scanInProg", 3)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: scanChannels.setStatus('optional') if mibBuilder.loadTexts: scanChannels.setDescription('Use this Variable to Discover the Non-Disk Devices attached to the Adapter. Set this Variable to startscan (an integer value of 2) to start the Channel Scanning.') adpBasePort = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 1, 1, 18), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: adpBasePort.setStatus('optional') if mibBuilder.loadTexts: adpBasePort.setDescription('Maximum Concurrent Commands Supported by the Adapter.') numSCSIChannels = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 1, 1, 19), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: numSCSIChannels.setStatus('optional') if mibBuilder.loadTexts: numSCSIChannels.setDescription('Maximum number of SCSI Channels Supported by the Adapter.') numFCLoops = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 1, 1, 20), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: numFCLoops.setStatus('optional') if mibBuilder.loadTexts: numFCLoops.setDescription('Number of Fibre channel loops Supported by the Adapter.') subSystemID = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 1, 1, 21), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: subSystemID.setStatus('optional') if mibBuilder.loadTexts: subSystemID.setDescription('The PCI sub system ID of this controller') subSystemVendorID = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 1, 1, 22), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: subSystemVendorID.setStatus('optional') if mibBuilder.loadTexts: subSystemVendorID.setDescription('The PCI sub system vendor ID of this controller') productName = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 1, 1, 23), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: productName.setStatus('optional') if mibBuilder.loadTexts: productName.setDescription('The enriched formation of the controller retrieved from the firmware') adpSpeed = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 1, 1, 24), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 20))).clone(namedValues=NamedValues(("fiveMB", 1), ("tenMB", 2), ("twentyMB", 3), ("fortyMB", 4), ("eightyMB", 5), ("oneHundredSixtyMB", 6), ("threeHundredTwentyMB", 7), ("unAvailable", 20)))).setMaxAccess("readonly") if mibBuilder.loadTexts: adpSpeed.setStatus('optional') if mibBuilder.loadTexts: adpSpeed.setDescription('Maximum transfer speed of the adapter.') logicaldriveTable = MibTable((1, 3, 6, 1, 4, 1, 3582, 1, 1, 2), ) if mibBuilder.loadTexts: logicaldriveTable.setStatus('optional') if mibBuilder.loadTexts: logicaldriveTable.setDescription('A List of Logical Drive Entries containing Information/Properties about the Logical Drives Configured in the System.') logicaldriveEntry = MibTableRow((1, 3, 6, 1, 4, 1, 3582, 1, 1, 2, 1), ).setIndexNames((0, "RAID-Adapter-MIB", "ldAdapterNumber"), (0, "RAID-Adapter-MIB", "logicalDriveNumber")) if mibBuilder.loadTexts: logicaldriveEntry.setStatus('optional') if mibBuilder.loadTexts: logicaldriveEntry.setDescription('An Entry in the Logical Drive Table.') ldAdapterNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 2, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ldAdapterNumber.setStatus('optional') if mibBuilder.loadTexts: ldAdapterNumber.setDescription('The Adapter Number for this Instance of Adapter/LogicalDrive object.') logicalDriveNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 2, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: logicalDriveNumber.setStatus('optional') if mibBuilder.loadTexts: logicalDriveNumber.setDescription('Logical Drive Number for this Logical Drive Entry.') status = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 2, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4))).clone(namedValues=NamedValues(("offLine", 0), ("degraded", 1), ("optimal", 2), ("initialize", 3), ("checkConsistency", 4)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: status.setStatus('optional') if mibBuilder.loadTexts: status.setDescription('The Status of this Logical Drive.') sizeInMB = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 2, 1, 4), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: sizeInMB.setStatus('optional') if mibBuilder.loadTexts: sizeInMB.setDescription('The Configured Size of this Logical Drive.') raidLevel = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 2, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 3, 5))).clone(namedValues=NamedValues(("rAID0", 0), ("rAID1", 1), ("rAID3", 3), ("rAID5", 5)))).setMaxAccess("readonly") if mibBuilder.loadTexts: raidLevel.setStatus('optional') if mibBuilder.loadTexts: raidLevel.setDescription('Configured Raid Level for this Logical Drive.') stripeSize = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 2, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 4, 8, 16, 32, 64, 128))).clone(namedValues=NamedValues(("oneKB", 1), ("twoKB", 2), ("fourKB", 4), ("eightKB", 8), ("sixteenKB", 16), ("thirtyTwoKB", 32), ("sixtyFourKB", 64), ("oneTwentyEightKB", 128)))).setMaxAccess("readonly") if mibBuilder.loadTexts: stripeSize.setStatus('optional') if mibBuilder.loadTexts: stripeSize.setDescription('Configured Stripe Size for this Logical Drive.') readPolicy = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 2, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("normal", 0), ("readAhead", 1), ("adaptive", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: readPolicy.setStatus('optional') if mibBuilder.loadTexts: readPolicy.setDescription('Configured Read Policy for this Logical Drive.') writePolicy = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 2, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("writeThru", 0), ("writeBack", 1)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: writePolicy.setStatus('optional') if mibBuilder.loadTexts: writePolicy.setDescription('Configured Write Policy for this Logical Drive.') cachePolicy = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 2, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("cachedIO", 0), ("directIO", 1)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: cachePolicy.setStatus('optional') if mibBuilder.loadTexts: cachePolicy.setDescription('Configured Cache Policy for this Logical Drive.') enquiryString = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 2, 1, 10), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(29, 29)).setFixedLength(29)).setMaxAccess("readonly") if mibBuilder.loadTexts: enquiryString.setStatus('optional') if mibBuilder.loadTexts: enquiryString.setDescription('SCSI Inquiry String for this Logical Drive.') numberOfSpans = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 2, 1, 11), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 4))).setMaxAccess("readonly") if mibBuilder.loadTexts: numberOfSpans.setStatus('optional') if mibBuilder.loadTexts: numberOfSpans.setDescription('Number of Arrays across which this Logical Drive is Spanning.') numberOfStripes = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 2, 1, 12), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 8))).setMaxAccess("readonly") if mibBuilder.loadTexts: numberOfStripes.setStatus('optional') if mibBuilder.loadTexts: numberOfStripes.setDescription('Configured Number of Stripes for this Logical Drive.') checkConsistencyOrInitializeProgress = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 2, 1, 13), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 20))).setMaxAccess("readonly") if mibBuilder.loadTexts: checkConsistencyOrInitializeProgress.setStatus('optional') if mibBuilder.loadTexts: checkConsistencyOrInitializeProgress.setDescription('Check Consistency or Initialize Progress for this Logical Drive if the Logical Drive Status is checkconsistencyinprogress or initializeinprogress.') ldIOReadsPerSec = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 2, 1, 14), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ldIOReadsPerSec.setStatus('optional') if mibBuilder.loadTexts: ldIOReadsPerSec.setDescription('Number of IO Reads/sec Statistics for this Logical Drive.') ldIOWritesPerSec = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 2, 1, 15), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ldIOWritesPerSec.setStatus('optional') if mibBuilder.loadTexts: ldIOWritesPerSec.setDescription('Number of IO Writes/sec Statistics for this Logical Drive.') ldReadKBsPerSec = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 2, 1, 16), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ldReadKBsPerSec.setStatus('optional') if mibBuilder.loadTexts: ldReadKBsPerSec.setDescription('Amount of Data Transferred in KBs/sec due to READ Transfers.') ldWriteKBsPerSec = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 2, 1, 17), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ldWriteKBsPerSec.setStatus('optional') if mibBuilder.loadTexts: ldWriteKBsPerSec.setDescription('Amount of Data Transferred in KBs/sec due to WRITE Transfers.') ldReadFailuresPerSec = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 2, 1, 18), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ldReadFailuresPerSec.setStatus('optional') if mibBuilder.loadTexts: ldReadFailuresPerSec.setDescription('Number of Read-Failures/sec Statistics for this Logical Drive.') ldWriteFailuresPerSec = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 2, 1, 19), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ldWriteFailuresPerSec.setStatus('optional') if mibBuilder.loadTexts: ldWriteFailuresPerSec.setDescription('Number of Write-Failures/sec Statistics for this Logical Drive.') physicaldriveTable = MibTable((1, 3, 6, 1, 4, 1, 3582, 1, 1, 3), ) if mibBuilder.loadTexts: physicaldriveTable.setStatus('optional') if mibBuilder.loadTexts: physicaldriveTable.setDescription('A List of Physical Device Entries containing Information about the Physical Devices in the System.') physicaldriveEntry = MibTableRow((1, 3, 6, 1, 4, 1, 3582, 1, 1, 3, 1), ).setIndexNames((0, "RAID-Adapter-MIB", "physAdapterNumber"), (0, "RAID-Adapter-MIB", "physChannel"), (0, "RAID-Adapter-MIB", "targetID"), (0, "RAID-Adapter-MIB", "lunNumber")) if mibBuilder.loadTexts: physicaldriveEntry.setStatus('optional') if mibBuilder.loadTexts: physicaldriveEntry.setDescription('An Entry in the Physical Drive Table.') physAdapterNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 3, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 4))).setMaxAccess("readonly") if mibBuilder.loadTexts: physAdapterNumber.setStatus('optional') if mibBuilder.loadTexts: physAdapterNumber.setDescription('The Adapter Number for this Instance of Adapter/Physical-Drive Instance.') physChannel = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 3, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 3))).setMaxAccess("readonly") if mibBuilder.loadTexts: physChannel.setStatus('optional') if mibBuilder.loadTexts: physChannel.setDescription('Channel Number at Which this Physical Drive is Present.') targetID = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 3, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 15))).setMaxAccess("readonly") if mibBuilder.loadTexts: targetID.setStatus('optional') if mibBuilder.loadTexts: targetID.setDescription('SCSI Target ID at Which This Physical Drive is Present.') state = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 3, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 3, 4, 5, 6, 20))).clone(namedValues=NamedValues(("ready", 1), ("online", 3), ("failed", 4), ("rebuild", 5), ("hotSpare", 6), ("nonDisk", 20)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: state.setStatus('optional') if mibBuilder.loadTexts: state.setDescription('Current State of this Physical Drive.') arrayPosition = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 3, 1, 5), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(4, 20))).setMaxAccess("readonly") if mibBuilder.loadTexts: arrayPosition.setStatus('optional') if mibBuilder.loadTexts: arrayPosition.setDescription('Array is a group of Physical Drives used to Configure Logical Drives. This String Variable has values of the type Ai-j. Example: A1-2 implies that this drive is 2nd member of Array-1.') sizeMB = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 3, 1, 6), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: sizeMB.setStatus('optional') if mibBuilder.loadTexts: sizeMB.setDescription('Actual Size of this Physical Drive.') deviceType = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 3, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12))).clone(namedValues=NamedValues(("disk", 0), ("tape", 1), ("printer", 2), ("processor", 3), ("wORM", 4), ("cDROM", 5), ("scanner", 6), ("optical", 7), ("changer", 8), ("communication", 9), ("asynchronousLow", 10), ("asynchronousHigh", 11), ("reservedLow", 12)))).setMaxAccess("readonly") if mibBuilder.loadTexts: deviceType.setStatus('optional') if mibBuilder.loadTexts: deviceType.setDescription('Device Type of this Physical Drive.') inquiryString = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 3, 1, 8), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(29, 29)).setFixedLength(29)).setMaxAccess("readonly") if mibBuilder.loadTexts: inquiryString.setStatus('optional') if mibBuilder.loadTexts: inquiryString.setDescription('SCSI Inquiry String for this Device.') scsiLevel = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 3, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("sCSI1", 1), ("sCSI2", 2), ("sCSI3", 3), ("sCSI4", 4)))).setMaxAccess("readonly") if mibBuilder.loadTexts: scsiLevel.setStatus('optional') if mibBuilder.loadTexts: scsiLevel.setDescription('ANSI SCSI Level Conformance of this Device.') maximumQueueDepth = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 3, 1, 10), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: maximumQueueDepth.setStatus('optional') if mibBuilder.loadTexts: maximumQueueDepth.setDescription('The maximum queue depth of this Device.') rebuildProgress = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 3, 1, 11), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 25))).setMaxAccess("readonly") if mibBuilder.loadTexts: rebuildProgress.setStatus('optional') if mibBuilder.loadTexts: rebuildProgress.setDescription('Rebuild Progress for this Physical Drive if the Physical Drive State is Rebuild.') mediumErrors = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 3, 1, 12), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: mediumErrors.setStatus('optional') if mibBuilder.loadTexts: mediumErrors.setDescription('Medium Errors Occurred on this Drive Since it was Configured.') physSlotStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 3, 1, 13), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 7))).setMaxAccess("readonly") if mibBuilder.loadTexts: physSlotStatus.setStatus('optional') if mibBuilder.loadTexts: physSlotStatus.setDescription('Indicates the status of interest on the drive slot') physSlotNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 3, 1, 14), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 15))).setMaxAccess("readonly") if mibBuilder.loadTexts: physSlotNumber.setStatus('optional') if mibBuilder.loadTexts: physSlotNumber.setDescription('SCSI Target Slot Number at Which This Physical Drive is Present.') otherErrors = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 3, 1, 15), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: otherErrors.setStatus('optional') if mibBuilder.loadTexts: otherErrors.setDescription('Other Errors Occurred on this Drive Since it was Configured.') physTermination = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 3, 1, 16), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 20))).clone(namedValues=NamedValues(("wide", 0), ("narrow", 1), ("notSupported", 20)))).setMaxAccess("readonly") if mibBuilder.loadTexts: physTermination.setStatus('optional') if mibBuilder.loadTexts: physTermination.setDescription('Negotiation Information of the physical drive. This field is applicable only to drives.') physSpeed = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 3, 1, 17), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6, 7, 8, 20))).clone(namedValues=NamedValues(("maximum", 0), ("asynchronous", 1), ("fiveMB", 2), ("tenMB", 3), ("twentyMB", 4), ("fortyMB", 5), ("eightyMB", 6), ("oneHundredSixtyMB", 7), ("threeHundredTwentyMB", 8), ("notSupported", 20)))).setMaxAccess("readonly") if mibBuilder.loadTexts: physSpeed.setStatus('optional') if mibBuilder.loadTexts: physSpeed.setDescription('Transfer speed of the physical drive. This field is applicable only to drives.') lunNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 3, 1, 18), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 7))).setMaxAccess("readonly") if mibBuilder.loadTexts: lunNumber.setStatus('optional') if mibBuilder.loadTexts: lunNumber.setDescription('SCSI LUN ID of this Physical Device') channelTable = MibTable((1, 3, 6, 1, 4, 1, 3582, 1, 1, 4), ) if mibBuilder.loadTexts: channelTable.setStatus('optional') if mibBuilder.loadTexts: channelTable.setDescription('A List of Channel Entries containing Information/Properties about the Channels on the Adapter.') channelEntry = MibTableRow((1, 3, 6, 1, 4, 1, 3582, 1, 1, 4, 1), ).setIndexNames((0, "RAID-Adapter-MIB", "chanAdapterNumber"), (0, "RAID-Adapter-MIB", "channel")) if mibBuilder.loadTexts: channelEntry.setStatus('optional') if mibBuilder.loadTexts: channelEntry.setDescription('An Entry in the channel table.') chanAdapterNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 4, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: chanAdapterNumber.setStatus('optional') if mibBuilder.loadTexts: chanAdapterNumber.setDescription('The Adapter Number for this Instance of Adapter/Channel Instance.') channel = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 4, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: channel.setStatus('optional') if mibBuilder.loadTexts: channel.setDescription('Channel Number for this Channel.') terminations = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 4, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("disabled", 0), ("higher8Bits", 1), ("wideTerminations", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: terminations.setStatus('optional') if mibBuilder.loadTexts: terminations.setDescription('Current Terminations Effective on this Channel') channelStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 4, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("quiet", 1), ("active", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: channelStatus.setStatus('optional') if mibBuilder.loadTexts: channelStatus.setDescription('Current Activity Status (QUIET/ACTIVE) for this Channel.') channelType = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 4, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("sCSI", 0), ("rAID", 1)))).setMaxAccess("readonly") if mibBuilder.loadTexts: channelType.setStatus('mandatory') if mibBuilder.loadTexts: channelType.setDescription('Type of the channel(RAID/SCSI).') fcDeviceTable = MibTable((1, 3, 6, 1, 4, 1, 3582, 1, 1, 5), ) if mibBuilder.loadTexts: fcDeviceTable.setStatus('optional') if mibBuilder.loadTexts: fcDeviceTable.setDescription('A List of Entries containing Information about the FC Devices in the System.') fcDeviceEntry = MibTableRow((1, 3, 6, 1, 4, 1, 3582, 1, 1, 5, 1), ).setIndexNames((0, "RAID-Adapter-MIB", "fcPhysAdapterNumber"), (0, "RAID-Adapter-MIB", "fcPhysChannel"), (0, "RAID-Adapter-MIB", "fcTargetId")) if mibBuilder.loadTexts: fcDeviceEntry.setStatus('optional') if mibBuilder.loadTexts: fcDeviceEntry.setDescription('An Entry in the FC Device Table.') fcPhysAdapterNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 5, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 4))).setMaxAccess("readonly") if mibBuilder.loadTexts: fcPhysAdapterNumber.setStatus('optional') if mibBuilder.loadTexts: fcPhysAdapterNumber.setDescription('The Adapter Number for this Instance of Adapter/Physical-Drive Instance.') fcPhysChannel = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 5, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 15))).setMaxAccess("readonly") if mibBuilder.loadTexts: fcPhysChannel.setStatus('optional') if mibBuilder.loadTexts: fcPhysChannel.setDescription('The Channel Number for this Instance of Adapter/Physical-Drive ') fcTargetId = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 5, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 15))).setMaxAccess("readonly") if mibBuilder.loadTexts: fcTargetId.setStatus('optional') if mibBuilder.loadTexts: fcTargetId.setDescription('The Target Number for this Instance of Adapter/Physical-Drive') fcLoopID_0 = MibScalar((1, 3, 6, 1, 4, 1, 3582, 1, 1, 5, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 255))).clone(namedValues=NamedValues(("inLoop0", 1), ("inLoop1", 2), ("notInTheLoop", 255)))).setLabel("fcLoopID-0").setMaxAccess("readonly") if mibBuilder.loadTexts: fcLoopID_0.setStatus('optional') if mibBuilder.loadTexts: fcLoopID_0.setDescription('Loop ID of this FC Drive.') fcLoopID_1 = MibScalar((1, 3, 6, 1, 4, 1, 3582, 1, 1, 5, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 255))).clone(namedValues=NamedValues(("inLoop0", 1), ("inLoop1", 2), ("notInTheLoop", 255)))).setLabel("fcLoopID-1").setMaxAccess("readonly") if mibBuilder.loadTexts: fcLoopID_1.setStatus('optional') if mibBuilder.loadTexts: fcLoopID_1.setDescription('Loop ID of this FC Drive.') fcWwn = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 5, 1, 6), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(4, 20))).setMaxAccess("readonly") if mibBuilder.loadTexts: fcWwn.setStatus('optional') if mibBuilder.loadTexts: fcWwn.setDescription('WWN is the World Wide Name of this FC device') fcState = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 5, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 3, 4, 5, 6, 20))).clone(namedValues=NamedValues(("ready", 1), ("online", 3), ("failed", 4), ("rebuild", 5), ("hotspare", 6), ("nonDisk", 20)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: fcState.setStatus('optional') if mibBuilder.loadTexts: fcState.setDescription('Current State of this Physical Drive.') fcArrayPosition = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 5, 1, 8), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(4, 20))).setMaxAccess("readonly") if mibBuilder.loadTexts: fcArrayPosition.setStatus('optional') if mibBuilder.loadTexts: fcArrayPosition.setDescription('Array is a group of Physical Drives used to Configure Logical Drives. This String Variable has values of the type Ai-j. Example: A1-2 implies that this drive is 2nd member of Array-1.') fcSizeMB = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 5, 1, 9), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: fcSizeMB.setStatus('optional') if mibBuilder.loadTexts: fcSizeMB.setDescription('Actual Size of this Physical Drive.') fcInquiryString = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 5, 1, 10), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(29, 29)).setFixedLength(29)).setMaxAccess("readonly") if mibBuilder.loadTexts: fcInquiryString.setStatus('optional') if mibBuilder.loadTexts: fcInquiryString.setDescription('SCSI Inquiry String for this Device.') fcScsiLevel = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 5, 1, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("sCSI1", 1), ("sCSI2", 2), ("sCSI3", 3), ("sCSI4", 4)))).setMaxAccess("readonly") if mibBuilder.loadTexts: fcScsiLevel.setStatus('optional') if mibBuilder.loadTexts: fcScsiLevel.setDescription('ANSI SCSI Level Conformance of this Device.') fcRebuildProgress = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 5, 1, 12), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 25))).setMaxAccess("readonly") if mibBuilder.loadTexts: fcRebuildProgress.setStatus('optional') if mibBuilder.loadTexts: fcRebuildProgress.setDescription('Rebuild Progress for this Physical Drive if the Physical Drive State is Rebuild.') fcMediumErrors = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 5, 1, 13), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: fcMediumErrors.setStatus('optional') if mibBuilder.loadTexts: fcMediumErrors.setDescription('Medium Errors Occurred on this Drive Since it was Configured.') fcOtherErrors = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 5, 1, 14), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: fcOtherErrors.setStatus('optional') if mibBuilder.loadTexts: fcOtherErrors.setDescription('Other Errors Occurred on this Drive Since it was Configured.') fcChannelTable = MibTable((1, 3, 6, 1, 4, 1, 3582, 1, 1, 6), ) if mibBuilder.loadTexts: fcChannelTable.setStatus('optional') if mibBuilder.loadTexts: fcChannelTable.setDescription('A List of FC Channel Entries containing Information about the FC Channels on the Adapter.') fcChannelEntry = MibTableRow((1, 3, 6, 1, 4, 1, 3582, 1, 1, 6, 1), ).setIndexNames((0, "RAID-Adapter-MIB", "fcChanAdapterNumber"), (0, "RAID-Adapter-MIB", "fcChannel")) if mibBuilder.loadTexts: fcChannelEntry.setStatus('optional') if mibBuilder.loadTexts: fcChannelEntry.setDescription('An Entry in the FC channel table.') fcChanAdapterNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 6, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: fcChanAdapterNumber.setStatus('optional') if mibBuilder.loadTexts: fcChanAdapterNumber.setDescription('The Adapter Number for this Instance of Adapter/fc-Channel Instance.') fcChannel = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 6, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: fcChannel.setStatus('optional') if mibBuilder.loadTexts: fcChannel.setDescription('The Channel Number for this Instance ') fcLoopNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 6, 1, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: fcLoopNumber.setStatus('optional') if mibBuilder.loadTexts: fcLoopNumber.setDescription('Loop Index for this fcChannel.') fcLoopStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 6, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("quiet", 1), ("active", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: fcLoopStatus.setStatus('optional') if mibBuilder.loadTexts: fcLoopStatus.setDescription('Current Activity Status (QUIET/ACTIVE) for this fcChannel.') fcNumberofDevices = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 6, 1, 5), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: fcNumberofDevices.setStatus('optional') if mibBuilder.loadTexts: fcNumberofDevices.setDescription('The number of FC devices in this fcChannel') fcProcessorType = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 6, 1, 6), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: fcProcessorType.setStatus('optional') if mibBuilder.loadTexts: fcProcessorType.setDescription('The processor type on this fcChannel') ioReadsPerSec = MibScalar((1, 3, 6, 1, 4, 1, 3582, 1, 1, 9), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ioReadsPerSec.setStatus('optional') if mibBuilder.loadTexts: ioReadsPerSec.setDescription('The Total IO-Reads/Sec Statistics on all Adapters.') ioWritesPerSec = MibScalar((1, 3, 6, 1, 4, 1, 3582, 1, 1, 10), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ioWritesPerSec.setStatus('optional') if mibBuilder.loadTexts: ioWritesPerSec.setDescription('The Total IO-Writes/Sec Statistics on all Adapters.') readKBsPerSec = MibScalar((1, 3, 6, 1, 4, 1, 3582, 1, 1, 11), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: readKBsPerSec.setStatus('optional') if mibBuilder.loadTexts: readKBsPerSec.setDescription('The Total Read KBs Per Second Statistics on all Adapters.') writeKBsPerSec = MibScalar((1, 3, 6, 1, 4, 1, 3582, 1, 1, 12), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: writeKBsPerSec.setStatus('optional') if mibBuilder.loadTexts: writeKBsPerSec.setDescription('The Total Write KBs Per Second Statistics on all Adapters.') readFailuresPerSec = MibScalar((1, 3, 6, 1, 4, 1, 3582, 1, 1, 13), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: readFailuresPerSec.setStatus('optional') if mibBuilder.loadTexts: readFailuresPerSec.setDescription('The Total Read Failures Per Second Statistics on all Adapters.') writeFailuresPerSec = MibScalar((1, 3, 6, 1, 4, 1, 3582, 1, 1, 14), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: writeFailuresPerSec.setStatus('optional') if mibBuilder.loadTexts: writeFailuresPerSec.setDescription('The Total Write Failures Per Second Statistics on all Adapters.') enclConfigurationTable = MibTable((1, 3, 6, 1, 4, 1, 3582, 1, 1, 15), ) if mibBuilder.loadTexts: enclConfigurationTable.setStatus('optional') if mibBuilder.loadTexts: enclConfigurationTable.setDescription('A List of Enclosure Configuration Entries containing Information about the SAF-TE Enclosures in the System.') enclConfigurationEntry = MibTableRow((1, 3, 6, 1, 4, 1, 3582, 1, 1, 15, 1), ).setIndexNames((0, "RAID-Adapter-MIB", "enclNumber")) if mibBuilder.loadTexts: enclConfigurationEntry.setStatus('optional') if mibBuilder.loadTexts: enclConfigurationEntry.setDescription('An Entry in the Enclosure Configuration Table.') enclAdapterNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 15, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 4))).setMaxAccess("readonly") if mibBuilder.loadTexts: enclAdapterNumber.setStatus('optional') if mibBuilder.loadTexts: enclAdapterNumber.setDescription('The Adapter Number for this Instance of Adapter/Enclosure Instance.') enclNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 15, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 3))).setMaxAccess("readonly") if mibBuilder.loadTexts: enclNumber.setStatus('optional') if mibBuilder.loadTexts: enclNumber.setDescription('Indicates the enclosure number for this Enclosure. The numbering is w.r.t adapter and not w.r.t Channel') enclChannel = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 15, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 3))).setMaxAccess("readonly") if mibBuilder.loadTexts: enclChannel.setStatus('optional') if mibBuilder.loadTexts: enclChannel.setDescription('Channel Number at Which this Enclosure is Present.') enclNumDeviceSlots = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 15, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 15))).setMaxAccess("readonly") if mibBuilder.loadTexts: enclNumDeviceSlots.setStatus('optional') if mibBuilder.loadTexts: enclNumDeviceSlots.setDescription('Total number of device slots on the channel for this Enclosure') enclNumFans = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 15, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 15))).setMaxAccess("readonly") if mibBuilder.loadTexts: enclNumFans.setStatus('optional') if mibBuilder.loadTexts: enclNumFans.setDescription('Total number SEP manageable of fans for this Enclosure') enclNumTempSensors = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 15, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 15))).setMaxAccess("readonly") if mibBuilder.loadTexts: enclNumTempSensors.setStatus('optional') if mibBuilder.loadTexts: enclNumTempSensors.setDescription('Number of SEP manageable Temperature Sensors for this Enclosure') enclNumPowerSupplies = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 15, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 15))).setMaxAccess("readonly") if mibBuilder.loadTexts: enclNumPowerSupplies.setStatus('optional') if mibBuilder.loadTexts: enclNumPowerSupplies.setDescription('Maximum number of SEP manageable Power Supplies for this Enclosure') enclDoorLockStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 15, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("notInstalled", 0), ("unlocked", 1), ("locked", 2), ("other", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: enclDoorLockStatus.setStatus('optional') if mibBuilder.loadTexts: enclDoorLockStatus.setDescription('Indicates whether this enclosure has door lock installed/locked/unlocked') enclAudibleAlarm = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 15, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("noAudibleAlarm", 0), ("audibleAlarm", 1), ("other", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: enclAudibleAlarm.setStatus('optional') if mibBuilder.loadTexts: enclAudibleAlarm.setDescription('Indicates the availability of Audible Alarm with this Enclosure') enclAlarmStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 15, 1, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("off", 0), ("on", 1), ("other", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: enclAlarmStatus.setStatus('optional') if mibBuilder.loadTexts: enclAlarmStatus.setDescription('Indicates whether this Enclosure speaker is ON or OFF') enclTemperatureScale = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 15, 1, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("fahrenheit", 0), ("celsius", 1)))).setMaxAccess("readonly") if mibBuilder.loadTexts: enclTemperatureScale.setStatus('optional') if mibBuilder.loadTexts: enclTemperatureScale.setDescription('Indicates whether this Enclosure reports temperature in Celsius or Fahrenheit') enclTotalPowerOnMins = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 15, 1, 12), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 4294967295))).setMaxAccess("readonly") if mibBuilder.loadTexts: enclTotalPowerOnMins.setStatus('optional') if mibBuilder.loadTexts: enclTotalPowerOnMins.setDescription('This indicates the total time in minutes that the RAID device has been powered ON. It is cumulative over the life of the device') enclTotalPowerOnCycles = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 15, 1, 13), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 4294967295))).setMaxAccess("readonly") if mibBuilder.loadTexts: enclTotalPowerOnCycles.setStatus('optional') if mibBuilder.loadTexts: enclTotalPowerOnCycles.setDescription('This indicates the count of number of times that the RAID device has been powered ON. It is cumulative over the life of the device') enclFanTable = MibTable((1, 3, 6, 1, 4, 1, 3582, 1, 1, 16), ) if mibBuilder.loadTexts: enclFanTable.setStatus('optional') if mibBuilder.loadTexts: enclFanTable.setDescription('A List of SAF-TE Enclosure Fan Entries') enclFanEntry = MibTableRow((1, 3, 6, 1, 4, 1, 3582, 1, 1, 16, 1), ).setIndexNames((0, "RAID-Adapter-MIB", "enclNumberFan"), (0, "RAID-Adapter-MIB", "enclFanIndex")) if mibBuilder.loadTexts: enclFanEntry.setStatus('optional') if mibBuilder.loadTexts: enclFanEntry.setDescription('An Entry in the Enclosure Fan Table.') enclNumberFan = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 16, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 3))).setMaxAccess("readonly") if mibBuilder.loadTexts: enclNumberFan.setStatus('optional') if mibBuilder.loadTexts: enclNumberFan.setDescription('Enclosure Number at Which this Enclosure with the Fan is Present.') enclFanIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 16, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: enclFanIndex.setStatus('optional') if mibBuilder.loadTexts: enclFanIndex.setDescription('The instance of the fan in the enclosure for the adapter/channel') enclFanStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 16, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 128))).clone(namedValues=NamedValues(("operational", 0), ("malfunction", 1), ("notInstalled", 2), ("unknown", 128)))).setMaxAccess("readonly") if mibBuilder.loadTexts: enclFanStatus.setStatus('optional') if mibBuilder.loadTexts: enclFanStatus.setDescription('The Status of this fan') enclPowerSupplyTable = MibTable((1, 3, 6, 1, 4, 1, 3582, 1, 1, 17), ) if mibBuilder.loadTexts: enclPowerSupplyTable.setStatus('optional') if mibBuilder.loadTexts: enclPowerSupplyTable.setDescription('A List of SAF-TE Enclosure Power Supply Entries') enclPowerSupplyEntry = MibTableRow((1, 3, 6, 1, 4, 1, 3582, 1, 1, 17, 1), ).setIndexNames((0, "RAID-Adapter-MIB", "enclNumberPower"), (0, "RAID-Adapter-MIB", "enclPowerSupplyIndex")) if mibBuilder.loadTexts: enclPowerSupplyEntry.setStatus('optional') if mibBuilder.loadTexts: enclPowerSupplyEntry.setDescription('An Entry in the Enclosure Power Supply Table.') enclNumberPower = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 17, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 3))).setMaxAccess("readonly") if mibBuilder.loadTexts: enclNumberPower.setStatus('optional') if mibBuilder.loadTexts: enclNumberPower.setDescription('enclosure number at Which this Enclosure with the Power Supply is Present.') enclPowerSupplyIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 17, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: enclPowerSupplyIndex.setStatus('optional') if mibBuilder.loadTexts: enclPowerSupplyIndex.setDescription('The instance of the PowerSupply in the enclosure for the adapter/channel') enclPowerSupplyStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 17, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 128))).clone(namedValues=NamedValues(("operationalON", 0), ("operationalOFF", 1), ("malfunctionON", 2), ("malfunctionOFF", 3), ("notPresent", 4), ("present", 5), ("unknown", 128)))).setMaxAccess("readonly") if mibBuilder.loadTexts: enclPowerSupplyStatus.setStatus('optional') if mibBuilder.loadTexts: enclPowerSupplyStatus.setDescription('The Status of this PowerSupply') enclTempSensorsTable = MibTable((1, 3, 6, 1, 4, 1, 3582, 1, 1, 18), ) if mibBuilder.loadTexts: enclTempSensorsTable.setStatus('optional') if mibBuilder.loadTexts: enclTempSensorsTable.setDescription('A List of SAF-TE Enclosure Temperature Sensor Entries') enclTempSensorsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 3582, 1, 1, 18, 1), ).setIndexNames((0, "RAID-Adapter-MIB", "enclNumberTemp"), (0, "RAID-Adapter-MIB", "enclTempSensorIndex")) if mibBuilder.loadTexts: enclTempSensorsEntry.setStatus('optional') if mibBuilder.loadTexts: enclTempSensorsEntry.setDescription('An Entry in the Enclosure Temperature Sensor Table.') enclNumberTemp = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 18, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 3))).setMaxAccess("readonly") if mibBuilder.loadTexts: enclNumberTemp.setStatus('optional') if mibBuilder.loadTexts: enclNumberTemp.setDescription('enclosure number at Which this Enclosure with the temperature sensor is Present.') enclTempSensorIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 18, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 15))).setMaxAccess("readonly") if mibBuilder.loadTexts: enclTempSensorIndex.setStatus('optional') if mibBuilder.loadTexts: enclTempSensorIndex.setDescription('The instance of the temperature sensor indices in the enclosure for the adapter/channel') enclTemperature = MibTableColumn((1, 3, 6, 1, 4, 1, 3582, 1, 1, 18, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-10, 245))).setMaxAccess("readonly") if mibBuilder.loadTexts: enclTemperature.setStatus('optional') if mibBuilder.loadTexts: enclTemperature.setDescription('Indicates the temperature reported by the sensor in degree Fahrenheit') raidTraps = MibIdentifier((1, 3, 6, 1, 4, 1, 3582, 1, 1, 200)) rtAdapterNumber = MibScalar((1, 3, 6, 1, 4, 1, 3582, 1, 1, 200, 1001), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rtAdapterNumber.setStatus('optional') if mibBuilder.loadTexts: rtAdapterNumber.setDescription('Adapter Number for which Trap is generated.') rtLogicalDriveNumber = MibScalar((1, 3, 6, 1, 4, 1, 3582, 1, 1, 200, 1002), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rtLogicalDriveNumber.setStatus('optional') if mibBuilder.loadTexts: rtLogicalDriveNumber.setDescription('Logical Drive Number for which Trap is generated.') rtChannelNumber = MibScalar((1, 3, 6, 1, 4, 1, 3582, 1, 1, 200, 1003), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rtChannelNumber.setStatus('optional') if mibBuilder.loadTexts: rtChannelNumber.setDescription('Channel Number on the Adapter for which Trap is Generated.') rtTargetID = MibScalar((1, 3, 6, 1, 4, 1, 3582, 1, 1, 200, 1004), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rtTargetID.setStatus('optional') if mibBuilder.loadTexts: rtTargetID.setDescription('Device ID of the Physical Drive for which Trap is Generated.') rtOldDriveState = MibScalar((1, 3, 6, 1, 4, 1, 3582, 1, 1, 200, 1005), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: rtOldDriveState.setStatus('optional') if mibBuilder.loadTexts: rtOldDriveState.setDescription('Old State of Logical/Physical Drive, when a State Change Trap is Generated.') rtNewDriveState = MibScalar((1, 3, 6, 1, 4, 1, 3582, 1, 1, 200, 1006), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: rtNewDriveState.setStatus('optional') if mibBuilder.loadTexts: rtNewDriveState.setDescription('New State of Logical/Physical Drive, when a State Change Trap is Generated.') rtSenseKey = MibScalar((1, 3, 6, 1, 4, 1, 3582, 1, 1, 200, 1007), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rtSenseKey.setStatus('optional') if mibBuilder.loadTexts: rtSenseKey.setDescription('Check Condition Sense-Key reported by Physical Drive for which Trap is Generated.') rtASC = MibScalar((1, 3, 6, 1, 4, 1, 3582, 1, 1, 200, 1008), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rtASC.setStatus('optional') if mibBuilder.loadTexts: rtASC.setDescription('Check Condition Additional Sense Code (ASC) reported by Physical Drive for which Trap is Generated.') rtASCQ = MibScalar((1, 3, 6, 1, 4, 1, 3582, 1, 1, 200, 1009), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rtASCQ.setStatus('optional') if mibBuilder.loadTexts: rtASCQ.setDescription('Check Condition Additional Sense Code Qualifier (ASCQ) reported by Physical Drive for which Trap is Generated.') rtDriveVendor = MibScalar((1, 3, 6, 1, 4, 1, 3582, 1, 1, 200, 1010), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: rtDriveVendor.setStatus('optional') if mibBuilder.loadTexts: rtDriveVendor.setDescription('Vendor Identification String from the SCSI Inquiry Data for the Drive.') rtEnclNumber = MibScalar((1, 3, 6, 1, 4, 1, 3582, 1, 1, 200, 1011), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rtEnclNumber.setStatus('optional') if mibBuilder.loadTexts: rtEnclNumber.setDescription('Enclosure Number reported by the RAID Controller.') rtEnclTempSensorIndex = MibScalar((1, 3, 6, 1, 4, 1, 3582, 1, 1, 200, 1012), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rtEnclTempSensorIndex.setStatus('optional') if mibBuilder.loadTexts: rtEnclTempSensorIndex.setDescription('Enclosure Temperature Sensor Number reported by the SEP device') rtEnclTemperature = MibScalar((1, 3, 6, 1, 4, 1, 3582, 1, 1, 200, 1013), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rtEnclTemperature.setStatus('optional') if mibBuilder.loadTexts: rtEnclTemperature.setDescription('Enclosure Temperature in Fahrenheit reported by the SEP device') rtEnclFanIndex = MibScalar((1, 3, 6, 1, 4, 1, 3582, 1, 1, 200, 1014), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rtEnclFanIndex.setStatus('optional') if mibBuilder.loadTexts: rtEnclFanIndex.setDescription('Enclosure Fan Number reported by the SEP device') rtEnclPowerSupplyIndex = MibScalar((1, 3, 6, 1, 4, 1, 3582, 1, 1, 200, 1015), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rtEnclPowerSupplyIndex.setStatus('optional') if mibBuilder.loadTexts: rtEnclPowerSupplyIndex.setDescription('Enclosure Power Supply Number reported by the SEP device') rtWWN = MibScalar((1, 3, 6, 1, 4, 1, 3582, 1, 1, 200, 1016), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: rtWWN.setStatus('optional') if mibBuilder.loadTexts: rtWWN.setDescription('The World Wide Name of the FC device whose loop ID or State changes') rtOldLoopID = MibScalar((1, 3, 6, 1, 4, 1, 3582, 1, 1, 200, 1017), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rtOldLoopID.setStatus('optional') if mibBuilder.loadTexts: rtOldLoopID.setDescription('Index of the loop before its state changed') rtNewLoopID = MibScalar((1, 3, 6, 1, 4, 1, 3582, 1, 1, 200, 1018), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rtNewLoopID.setStatus('optional') if mibBuilder.loadTexts: rtNewLoopID.setDescription('Index of the loop after its state changed') rtConfigUpdated = NotificationType((1, 3, 6, 1, 4, 1, 3582, 1, 1, 200) + (0,9001)).setObjects(("RAID-Adapter-MIB", "rtAdapterNumber")) if mibBuilder.loadTexts: rtConfigUpdated.setDescription('Adapter-%d: A New Configuration has been written.') rtPhysicalDriveStateChange = NotificationType((1, 3, 6, 1, 4, 1, 3582, 1, 1, 200) + (0,9002)).setObjects(("RAID-Adapter-MIB", "rtAdapterNumber"), ("RAID-Adapter-MIB", "rtChannelNumber"), ("RAID-Adapter-MIB", "rtTargetID"), ("RAID-Adapter-MIB", "rtOldDriveState"), ("RAID-Adapter-MIB", "rtNewDriveState")) if mibBuilder.loadTexts: rtPhysicalDriveStateChange.setDescription('Adapter-%d, Channel-%d, Target-%d: Drive State Changed from %s to %s.') rtLogicalDriveStateChange = NotificationType((1, 3, 6, 1, 4, 1, 3582, 1, 1, 200) + (0,9003)).setObjects(("RAID-Adapter-MIB", "rtAdapterNumber"), ("RAID-Adapter-MIB", "rtLogicalDriveNumber"), ("RAID-Adapter-MIB", "rtOldDriveState"), ("RAID-Adapter-MIB", "rtNewDriveState")) if mibBuilder.loadTexts: rtLogicalDriveStateChange.setDescription('Adapter-%d, Logical Drive-%d: State Changed from %s to %s.') rtInitializeStarted = NotificationType((1, 3, 6, 1, 4, 1, 3582, 1, 1, 200) + (0,9004)).setObjects(("RAID-Adapter-MIB", "rtAdapterNumber"), ("RAID-Adapter-MIB", "rtLogicalDriveNumber")) if mibBuilder.loadTexts: rtInitializeStarted.setDescription('Adapter-%d, Logical Drive-%d: Initialization Started.') rtInitializeCompleted = NotificationType((1, 3, 6, 1, 4, 1, 3582, 1, 1, 200) + (0,9005)).setObjects(("RAID-Adapter-MIB", "rtAdapterNumber"), ("RAID-Adapter-MIB", "rtLogicalDriveNumber")) if mibBuilder.loadTexts: rtInitializeCompleted.setDescription('Adapter-%d, Logical Drive-%d: Initialization Completed Successfully.') rtInitializeAborted = NotificationType((1, 3, 6, 1, 4, 1, 3582, 1, 1, 200) + (0,9006)).setObjects(("RAID-Adapter-MIB", "rtAdapterNumber"), ("RAID-Adapter-MIB", "rtLogicalDriveNumber")) if mibBuilder.loadTexts: rtInitializeAborted.setDescription('Adapter-%d, Logical Drive-%d: Initialization Aborted by User.') rtInitializeFailed = NotificationType((1, 3, 6, 1, 4, 1, 3582, 1, 1, 200) + (0,9007)).setObjects(("RAID-Adapter-MIB", "rtAdapterNumber"), ("RAID-Adapter-MIB", "rtLogicalDriveNumber")) if mibBuilder.loadTexts: rtInitializeFailed.setDescription('Adapter-%d, Logical Drive-%d: Initialization Failed.') rtCheckConsistencyStarted = NotificationType((1, 3, 6, 1, 4, 1, 3582, 1, 1, 200) + (0,9008)).setObjects(("RAID-Adapter-MIB", "rtAdapterNumber"), ("RAID-Adapter-MIB", "rtLogicalDriveNumber")) if mibBuilder.loadTexts: rtCheckConsistencyStarted.setDescription('Adapter-%d, Logical Drive-%d: Check Consistency Started.') rtCheckConsistencyCompleted = NotificationType((1, 3, 6, 1, 4, 1, 3582, 1, 1, 200) + (0,9009)).setObjects(("RAID-Adapter-MIB", "rtAdapterNumber"), ("RAID-Adapter-MIB", "rtLogicalDriveNumber")) if mibBuilder.loadTexts: rtCheckConsistencyCompleted.setDescription('Adapter-%d, Logical Drive-%d: Check Consistency Completed. No Inconsistencies Found.') rtCheckConsistencyAborted = NotificationType((1, 3, 6, 1, 4, 1, 3582, 1, 1, 200) + (0,9010)).setObjects(("RAID-Adapter-MIB", "rtAdapterNumber"), ("RAID-Adapter-MIB", "rtLogicalDriveNumber")) if mibBuilder.loadTexts: rtCheckConsistencyAborted.setDescription('Adapter-%d, Logical Drive-%d: Check Consistency Aborted by User.') rtConsistencyCorrected = NotificationType((1, 3, 6, 1, 4, 1, 3582, 1, 1, 200) + (0,9011)).setObjects(("RAID-Adapter-MIB", "rtAdapterNumber"), ("RAID-Adapter-MIB", "rtLogicalDriveNumber")) if mibBuilder.loadTexts: rtConsistencyCorrected.setDescription('Adapter-%d, Logical Drive-%d: Check Consistency Operation Completed. Inconsistencies have been Cured.') rtCheckConsistencyFailed = NotificationType((1, 3, 6, 1, 4, 1, 3582, 1, 1, 200) + (0,9012)).setObjects(("RAID-Adapter-MIB", "rtAdapterNumber"), ("RAID-Adapter-MIB", "rtLogicalDriveNumber")) if mibBuilder.loadTexts: rtCheckConsistencyFailed.setDescription('Adapter-%d, Logical Drive-%d: Check Consistency Failed.') rtReconstructionStarted = NotificationType((1, 3, 6, 1, 4, 1, 3582, 1, 1, 200) + (0,9013)).setObjects(("RAID-Adapter-MIB", "rtAdapterNumber"), ("RAID-Adapter-MIB", "rtLogicalDriveNumber")) if mibBuilder.loadTexts: rtReconstructionStarted.setDescription('Adapter-%d, Logical Drive-%d: Reconstruction Started.') rtReconstructionCompleted = NotificationType((1, 3, 6, 1, 4, 1, 3582, 1, 1, 200) + (0,9014)).setObjects(("RAID-Adapter-MIB", "rtAdapterNumber"), ("RAID-Adapter-MIB", "rtLogicalDriveNumber")) if mibBuilder.loadTexts: rtReconstructionCompleted.setDescription('Adapter-%d, Logical Drive-%d: Reconstruction Completed Successfully.') rtReconstructionFailed = NotificationType((1, 3, 6, 1, 4, 1, 3582, 1, 1, 200) + (0,9015)).setObjects(("RAID-Adapter-MIB", "rtAdapterNumber"), ("RAID-Adapter-MIB", "rtLogicalDriveNumber")) if mibBuilder.loadTexts: rtReconstructionFailed.setDescription('Adapter-%d, Logical Drive-%d: Reconstruction Failed.') rtPredictiveFailuresExceeded = NotificationType((1, 3, 6, 1, 4, 1, 3582, 1, 1, 200) + (0,9016)).setObjects(("RAID-Adapter-MIB", "rtAdapterNumber"), ("RAID-Adapter-MIB", "rtChannelNumber"), ("RAID-Adapter-MIB", "rtTargetID"), ("RAID-Adapter-MIB", "rtDriveVendor"), ("RAID-Adapter-MIB", "rtSenseKey"), ("RAID-Adapter-MIB", "rtASC"), ("RAID-Adapter-MIB", "rtASCQ")) if mibBuilder.loadTexts: rtPredictiveFailuresExceeded.setDescription('Adapter-%d, Channel-%d, Target-%d: Reported Predictive Failure. Drive Identification String = %s Sense Key = 0x%x, ASC = 0x%x, ASCQ = 0x%x.') rtPredictiveFailuresFalse = NotificationType((1, 3, 6, 1, 4, 1, 3582, 1, 1, 200) + (0,9017)).setObjects(("RAID-Adapter-MIB", "rtAdapterNumber"), ("RAID-Adapter-MIB", "rtChannelNumber"), ("RAID-Adapter-MIB", "rtTargetID"), ("RAID-Adapter-MIB", "rtDriveVendor"), ("RAID-Adapter-MIB", "rtSenseKey"), ("RAID-Adapter-MIB", "rtASC"), ("RAID-Adapter-MIB", "rtASCQ")) if mibBuilder.loadTexts: rtPredictiveFailuresFalse.setDescription('Adapter-%d, Channel-%d, Target-%d: Reported Failure Prediction Threshold Exceeded [FALSE]. Drive Identification String = %s Sense Key = 0x%x, ASC = 0x%x, ASCQ = 0x%x.') rtCheckConditionStatus = NotificationType((1, 3, 6, 1, 4, 1, 3582, 1, 1, 200) + (0,9018)).setObjects(("RAID-Adapter-MIB", "rtAdapterNumber"), ("RAID-Adapter-MIB", "rtChannelNumber"), ("RAID-Adapter-MIB", "rtTargetID"), ("RAID-Adapter-MIB", "rtSenseKey"), ("RAID-Adapter-MIB", "rtASC"), ("RAID-Adapter-MIB", "rtASCQ")) if mibBuilder.loadTexts: rtCheckConditionStatus.setDescription('Adapter-%d, Channel-%d, Target-%d: Command Completed with Sense-Key-0x%x ASC-0x%x ASCQ-0x%x.') rtNewDriveInserted = NotificationType((1, 3, 6, 1, 4, 1, 3582, 1, 1, 200) + (0,9019)).setObjects(("RAID-Adapter-MIB", "rtAdapterNumber"), ("RAID-Adapter-MIB", "rtChannelNumber"), ("RAID-Adapter-MIB", "rtTargetID")) if mibBuilder.loadTexts: rtNewDriveInserted.setDescription('Adapter-%d, Channel-%d, Target-%d: New Device Inserted.') rtBatteryMissing = NotificationType((1, 3, 6, 1, 4, 1, 3582, 1, 1, 200) + (0,9020)).setObjects(("RAID-Adapter-MIB", "rtAdapterNumber")) if mibBuilder.loadTexts: rtBatteryMissing.setDescription('Adapter-%d: Battery Module is missing.') rtBatteryVolatageLow = NotificationType((1, 3, 6, 1, 4, 1, 3582, 1, 1, 200) + (0,9021)).setObjects(("RAID-Adapter-MIB", "rtAdapterNumber")) if mibBuilder.loadTexts: rtBatteryVolatageLow.setDescription('Adapter-%d: Battery Module Voltage is Low.') rtBatteryTemperatureHigh = NotificationType((1, 3, 6, 1, 4, 1, 3582, 1, 1, 200) + (0,9022)).setObjects(("RAID-Adapter-MIB", "rtAdapterNumber")) if mibBuilder.loadTexts: rtBatteryTemperatureHigh.setDescription('Adapter-%d: Battery Module Temperature Exceeded Danger Threshold.') rtPhysicalDriveStateReady = NotificationType((1, 3, 6, 1, 4, 1, 3582, 1, 1, 200) + (0,9023)).setObjects(("RAID-Adapter-MIB", "rtAdapterNumber"), ("RAID-Adapter-MIB", "rtChannelNumber"), ("RAID-Adapter-MIB", "rtTargetID"), ("RAID-Adapter-MIB", "rtOldDriveState"), ("RAID-Adapter-MIB", "rtNewDriveState")) if mibBuilder.loadTexts: rtPhysicalDriveStateReady.setDescription('Adapter-%d, Channel-%d, Target-%d: Drive State Changed from %s to %s.') rtPhysicalDriveStateOnline = NotificationType((1, 3, 6, 1, 4, 1, 3582, 1, 1, 200) + (0,9024)).setObjects(("RAID-Adapter-MIB", "rtAdapterNumber"), ("RAID-Adapter-MIB", "rtChannelNumber"), ("RAID-Adapter-MIB", "rtTargetID"), ("RAID-Adapter-MIB", "rtOldDriveState"), ("RAID-Adapter-MIB", "rtNewDriveState")) if mibBuilder.loadTexts: rtPhysicalDriveStateOnline.setDescription('Adapter-%d, Channel-%d, Target-%d: Drive State Changed from %s to %s.') rtPhysicalDriveStateFailed = NotificationType((1, 3, 6, 1, 4, 1, 3582, 1, 1, 200) + (0,9025)).setObjects(("RAID-Adapter-MIB", "rtAdapterNumber"), ("RAID-Adapter-MIB", "rtChannelNumber"), ("RAID-Adapter-MIB", "rtTargetID"), ("RAID-Adapter-MIB", "rtOldDriveState"), ("RAID-Adapter-MIB", "rtNewDriveState")) if mibBuilder.loadTexts: rtPhysicalDriveStateFailed.setDescription('Adapter-%d, Channel-%d, Target-%d: Drive State Changed from %s to %s.') rtPhysicalDriveStateRebuild = NotificationType((1, 3, 6, 1, 4, 1, 3582, 1, 1, 200) + (0,9026)).setObjects(("RAID-Adapter-MIB", "rtAdapterNumber"), ("RAID-Adapter-MIB", "rtChannelNumber"), ("RAID-Adapter-MIB", "rtTargetID"), ("RAID-Adapter-MIB", "rtOldDriveState"), ("RAID-Adapter-MIB", "rtNewDriveState")) if mibBuilder.loadTexts: rtPhysicalDriveStateRebuild.setDescription('Adapter-%d, Channel-%d, Target-%d: Drive State Changed from %s to %s.') rtPhysicalDriveStateHotspare = NotificationType((1, 3, 6, 1, 4, 1, 3582, 1, 1, 200) + (0,9027)).setObjects(("RAID-Adapter-MIB", "rtAdapterNumber"), ("RAID-Adapter-MIB", "rtChannelNumber"), ("RAID-Adapter-MIB", "rtTargetID"), ("RAID-Adapter-MIB", "rtOldDriveState"), ("RAID-Adapter-MIB", "rtNewDriveState")) if mibBuilder.loadTexts: rtPhysicalDriveStateHotspare.setDescription('Adapter-%d, Channel-%d, Target-%d: Drive State Changed from %s to %s.') rtLogicalDriveStateOffline = NotificationType((1, 3, 6, 1, 4, 1, 3582, 1, 1, 200) + (0,9028)).setObjects(("RAID-Adapter-MIB", "rtAdapterNumber"), ("RAID-Adapter-MIB", "rtLogicalDriveNumber"), ("RAID-Adapter-MIB", "rtOldDriveState"), ("RAID-Adapter-MIB", "rtNewDriveState")) if mibBuilder.loadTexts: rtLogicalDriveStateOffline.setDescription('Adapter-%d, Logical Drive-%d: State Changed from %s to %s.') rtLogicalDriveStateDegraded = NotificationType((1, 3, 6, 1, 4, 1, 3582, 1, 1, 200) + (0,9029)).setObjects(("RAID-Adapter-MIB", "rtAdapterNumber"), ("RAID-Adapter-MIB", "rtLogicalDriveNumber"), ("RAID-Adapter-MIB", "rtOldDriveState"), ("RAID-Adapter-MIB", "rtNewDriveState")) if mibBuilder.loadTexts: rtLogicalDriveStateDegraded.setDescription('Adapter-%d, Logical Drive-%d: State Changed from %s to %s.') rtLogicalDriveStateOptimal = NotificationType((1, 3, 6, 1, 4, 1, 3582, 1, 1, 200) + (0,9030)).setObjects(("RAID-Adapter-MIB", "rtAdapterNumber"), ("RAID-Adapter-MIB", "rtLogicalDriveNumber"), ("RAID-Adapter-MIB", "rtOldDriveState"), ("RAID-Adapter-MIB", "rtNewDriveState")) if mibBuilder.loadTexts: rtLogicalDriveStateOptimal.setDescription('Adapter-%d, Logical Drive-%d: State Changed from %s to %s.') rtLogicalDriveStateInitialize = NotificationType((1, 3, 6, 1, 4, 1, 3582, 1, 1, 200) + (0,9031)).setObjects(("RAID-Adapter-MIB", "rtAdapterNumber"), ("RAID-Adapter-MIB", "rtLogicalDriveNumber"), ("RAID-Adapter-MIB", "rtOldDriveState"), ("RAID-Adapter-MIB", "rtNewDriveState")) if mibBuilder.loadTexts: rtLogicalDriveStateInitialize.setDescription('Adapter-%d, Logical Drive-%d: State Changed from %s to %s.') rtLogicalDriveStateChkConsist = NotificationType((1, 3, 6, 1, 4, 1, 3582, 1, 1, 200) + (0,9032)).setObjects(("RAID-Adapter-MIB", "rtAdapterNumber"), ("RAID-Adapter-MIB", "rtLogicalDriveNumber"), ("RAID-Adapter-MIB", "rtOldDriveState"), ("RAID-Adapter-MIB", "rtNewDriveState")) if mibBuilder.loadTexts: rtLogicalDriveStateChkConsist.setDescription('Adapter-%d, Logical Drive-%d: State Changed from %s to %s.') rtEnclTemperatureOutofRange = NotificationType((1, 3, 6, 1, 4, 1, 3582, 1, 1, 200) + (0,9033)).setObjects(("RAID-Adapter-MIB", "rtAdapterNumber"), ("RAID-Adapter-MIB", "rtChannelNumber"), ("RAID-Adapter-MIB", "rtEnclNumber"), ("RAID-Adapter-MIB", "rtEnclTempSensorIndex"), ("RAID-Adapter-MIB", "rtEnclTemperature")) if mibBuilder.loadTexts: rtEnclTemperatureOutofRange.setDescription('Adapter-%d, Channel-%d, Enclosure-%d, Temperature Sensor -%d: Temperature %d is out of Range') rtEnclTemperatureNormal = NotificationType((1, 3, 6, 1, 4, 1, 3582, 1, 1, 200) + (0,9034)).setObjects(("RAID-Adapter-MIB", "rtAdapterNumber"), ("RAID-Adapter-MIB", "rtChannelNumber"), ("RAID-Adapter-MIB", "rtEnclNumber"), ("RAID-Adapter-MIB", "rtEnclTempSensorIndex"), ("RAID-Adapter-MIB", "rtEnclTemperature")) if mibBuilder.loadTexts: rtEnclTemperatureNormal.setDescription('Adapter-%d, Channel-%d, Enclosure-%d, Temperature Sensor -%d: Temperature %d is Normal') rtEnclFanMalfunction = NotificationType((1, 3, 6, 1, 4, 1, 3582, 1, 1, 200) + (0,9035)).setObjects(("RAID-Adapter-MIB", "rtAdapterNumber"), ("RAID-Adapter-MIB", "rtChannelNumber"), ("RAID-Adapter-MIB", "rtEnclNumber"), ("RAID-Adapter-MIB", "rtEnclFanIndex")) if mibBuilder.loadTexts: rtEnclFanMalfunction.setDescription('Adapter-%d, Channel-%d, Enclosure-%d, Fan-%d: Fan is Malfunctioning') rtEnclFanOk = NotificationType((1, 3, 6, 1, 4, 1, 3582, 1, 1, 200) + (0,9036)).setObjects(("RAID-Adapter-MIB", "rtAdapterNumber"), ("RAID-Adapter-MIB", "rtChannelNumber"), ("RAID-Adapter-MIB", "rtEnclNumber"), ("RAID-Adapter-MIB", "rtEnclFanIndex")) if mibBuilder.loadTexts: rtEnclFanOk.setDescription('Adapter-%d, Channel-%d, Enclosure-%d, Fan-%d: Fan is operating properly') rtEnclPowerSupplyMalfunction = NotificationType((1, 3, 6, 1, 4, 1, 3582, 1, 1, 200) + (0,9037)).setObjects(("RAID-Adapter-MIB", "rtAdapterNumber"), ("RAID-Adapter-MIB", "rtChannelNumber"), ("RAID-Adapter-MIB", "rtEnclNumber"), ("RAID-Adapter-MIB", "rtEnclPowerSupplyIndex")) if mibBuilder.loadTexts: rtEnclPowerSupplyMalfunction.setDescription('Adapter-%d, Channel-%d, Enclosure-%d, Power Supply-%d: Power Supply is Malfunctioning') rtEnclPowerSupplyOk = NotificationType((1, 3, 6, 1, 4, 1, 3582, 1, 1, 200) + (0,9038)).setObjects(("RAID-Adapter-MIB", "rtAdapterNumber"), ("RAID-Adapter-MIB", "rtChannelNumber"), ("RAID-Adapter-MIB", "rtEnclNumber"), ("RAID-Adapter-MIB", "rtEnclPowerSupplyIndex")) if mibBuilder.loadTexts: rtEnclPowerSupplyOk.setDescription('Adapter-%d, Channel-%d, Enclosure-%d, Power Supply-%d: Power Supply is operating properly') rtFCLooplStateChange = NotificationType((1, 3, 6, 1, 4, 1, 3582, 1, 1, 200) + (0,9040)).setObjects(("RAID-Adapter-MIB", "rtAdapterNumber"), ("RAID-Adapter-MIB", "rtOldLoopID"), ("RAID-Adapter-MIB", "rtOldDriveState"), ("RAID-Adapter-MIB", "rtNewDriveState")) if mibBuilder.loadTexts: rtFCLooplStateChange.setDescription('Adapter-%d, LoopId-%d: Loop State Changed from %s to %s.') mibBuilder.exportSymbols("RAID-Adapter-MIB", channelType=channelType, fcState=fcState, spinupCount=spinupCount, productName=productName, fcWwn=fcWwn, fcOtherErrors=fcOtherErrors, ioWritesPerSec=ioWritesPerSec, rtInitializeAborted=rtInitializeAborted, adpIOReadsPerSec=adpIOReadsPerSec, rtEnclPowerSupplyMalfunction=rtEnclPowerSupplyMalfunction, physSlotStatus=physSlotStatus, fcLoopStatus=fcLoopStatus, enclFanEntry=enclFanEntry, enclNumberTemp=enclNumberTemp, fcChannelEntry=fcChannelEntry, channelEntry=channelEntry, fcMediumErrors=fcMediumErrors, rtLogicalDriveStateChange=rtLogicalDriveStateChange, fcTargetId=fcTargetId, enclNumTempSensors=enclNumTempSensors, rtLogicalDriveNumber=rtLogicalDriveNumber, adapterEntry=adapterEntry, rtEnclTemperature=rtEnclTemperature, adpWriteFailuresPerSec=adpWriteFailuresPerSec, terminations=terminations, enclConfigurationEntry=enclConfigurationEntry, rtPhysicalDriveStateHotspare=rtPhysicalDriveStateHotspare, deviceType=deviceType, numFCLoops=numFCLoops, enclNumber=enclNumber, rtWWN=rtWWN, spinupDelay=spinupDelay, numberOfSpans=numberOfSpans, rtDriveVendor=rtDriveVendor, enclNumberPower=enclNumberPower, rtLogicalDriveStateOptimal=rtLogicalDriveStateOptimal, rtNewDriveInserted=rtNewDriveInserted, enclNumFans=enclNumFans, rtBatteryVolatageLow=rtBatteryVolatageLow, rtPhysicalDriveStateRebuild=rtPhysicalDriveStateRebuild, readFailuresPerSec=readFailuresPerSec, logicalDriveNumber=logicalDriveNumber, rtPhysicalDriveStateFailed=rtPhysicalDriveStateFailed, fcChanAdapterNumber=fcChanAdapterNumber, fcNumberofDevices=fcNumberofDevices, scsiLevel=scsiLevel, status=status, raidTraps=raidTraps, biosVersion=biosVersion, adpWriteKBsPerSec=adpWriteKBsPerSec, enclPowerSupplyStatus=enclPowerSupplyStatus, subSystemVendorID=subSystemVendorID, enclNumberFan=enclNumberFan, rtCheckConsistencyCompleted=rtCheckConsistencyCompleted, enclTotalPowerOnMins=enclTotalPowerOnMins, rtEnclTemperatureOutofRange=rtEnclTemperatureOutofRange, fcScsiLevel=fcScsiLevel, numLogicalDrives=numLogicalDrives, logicaldriveTable=logicaldriveTable, fcRebuildProgress=fcRebuildProgress, rtTargetID=rtTargetID, rtInitializeFailed=rtInitializeFailed, rtReconstructionCompleted=rtReconstructionCompleted, physSpeed=physSpeed, rtConsistencyCorrected=rtConsistencyCorrected, rtAdapterNumber=rtAdapterNumber, firmwareVersion=firmwareVersion, rtLogicalDriveStateOffline=rtLogicalDriveStateOffline, rtBatteryTemperatureHigh=rtBatteryTemperatureHigh, rtPhysicalDriveStateReady=rtPhysicalDriveStateReady, channelTable=channelTable, rtReconstructionFailed=rtReconstructionFailed, lsi=lsi, ldAdapterNumber=ldAdapterNumber, enclConfigurationTable=enclConfigurationTable, raidLevel=raidLevel, channelStatus=channelStatus, ldIOReadsPerSec=ldIOReadsPerSec, readPolicy=readPolicy, stripeSize=stripeSize, enclFanTable=enclFanTable, enclTemperature=enclTemperature, rtPhysicalDriveStateChange=rtPhysicalDriveStateChange, rtEnclPowerSupplyOk=rtEnclPowerSupplyOk, checkConsistencyOrInitializeProgress=checkConsistencyOrInitializeProgress, adpIOWritesPerSec=adpIOWritesPerSec, adpSpeed=adpSpeed, enclNumDeviceSlots=enclNumDeviceSlots, rtPhysicalDriveStateOnline=rtPhysicalDriveStateOnline, rtOldLoopID=rtOldLoopID, adpReadFailuresPerSec=adpReadFailuresPerSec, rtReconstructionStarted=rtReconstructionStarted, adpBasePort=adpBasePort, rtLogicalDriveStateChkConsist=rtLogicalDriveStateChkConsist, sizeInMB=sizeInMB, physicaldriveTable=physicaldriveTable, rtOldDriveState=rtOldDriveState, rebuildProgress=rebuildProgress, fcSizeMB=fcSizeMB, rtEnclFanMalfunction=rtEnclFanMalfunction, enclChannel=enclChannel, fcPhysAdapterNumber=fcPhysAdapterNumber, rtNewLoopID=rtNewLoopID, fcChannel=fcChannel, adpReadKBsPerSec=adpReadKBsPerSec, fcInquiryString=fcInquiryString, enclTotalPowerOnCycles=enclTotalPowerOnCycles, rtEnclTemperatureNormal=rtEnclTemperatureNormal, maxConcurrentCmds=maxConcurrentCmds, fcChannelTable=fcChannelTable, physTermination=physTermination, ldWriteKBsPerSec=ldWriteKBsPerSec, rtConfigUpdated=rtConfigUpdated, mediumErrors=mediumErrors, writePolicy=writePolicy, rtNewDriveState=rtNewDriveState, physSlotNumber=physSlotNumber, rtASC=rtASC, rtSenseKey=rtSenseKey, chanAdapterNumber=chanAdapterNumber, dramSizeInMB=dramSizeInMB, enclNumPowerSupplies=enclNumPowerSupplies, rtASCQ=rtASCQ, rtLogicalDriveStateDegraded=rtLogicalDriveStateDegraded, enclPowerSupplyTable=enclPowerSupplyTable, subSystemID=subSystemID, maximumQueueDepth=maximumQueueDepth, physChannel=physChannel, adapterTable=adapterTable, enclPowerSupplyIndex=enclPowerSupplyIndex, rtEnclFanOk=rtEnclFanOk, ldIOWritesPerSec=ldIOWritesPerSec, rtBatteryMissing=rtBatteryMissing, writeKBsPerSec=writeKBsPerSec, enclTempSensorsTable=enclTempSensorsTable, rtInitializeCompleted=rtInitializeCompleted, rtLogicalDriveStateInitialize=rtLogicalDriveStateInitialize, enclPowerSupplyEntry=enclPowerSupplyEntry, fcLoopNumber=fcLoopNumber, megaRaidMib=megaRaidMib, logicaldriveEntry=logicaldriveEntry, otherErrors=otherErrors, ldReadKBsPerSec=ldReadKBsPerSec, rtPredictiveFailuresExceeded=rtPredictiveFailuresExceeded, arrayPosition=arrayPosition, ldWriteFailuresPerSec=ldWriteFailuresPerSec, rtCheckConsistencyAborted=rtCheckConsistencyAborted, targetID=targetID, fcArrayPosition=fcArrayPosition, enclDoorLockStatus=enclDoorLockStatus, enclFanIndex=enclFanIndex, numberOfStripes=numberOfStripes, fcProcessorType=fcProcessorType, sizeMB=sizeMB, inquiryString=inquiryString, readKBsPerSec=readKBsPerSec, rtChannelNumber=rtChannelNumber, enquiryString=enquiryString, enclAlarmStatus=enclAlarmStatus, enclAdapterNumber=enclAdapterNumber, rtCheckConditionStatus=rtCheckConditionStatus, cachePolicy=cachePolicy, rebuildRateInPercent=rebuildRateInPercent, flushInterval=flushInterval, adpAdapterNumber=adpAdapterNumber, fcDeviceEntry=fcDeviceEntry, rtEnclTempSensorIndex=rtEnclTempSensorIndex, scanChannels=scanChannels, physAdapterNumber=physAdapterNumber, writeFailuresPerSec=writeFailuresPerSec, megaRaid=megaRaid, state=state, fcLoopID_0=fcLoopID_0, rtInitializeStarted=rtInitializeStarted, lunNumber=lunNumber, enclTempSensorIndex=enclTempSensorIndex, enclTempSensorsEntry=enclTempSensorsEntry, fcPhysChannel=fcPhysChannel, physicaldriveEntry=physicaldriveEntry, ioReadsPerSec=ioReadsPerSec, enclTemperatureScale=enclTemperatureScale, fcDeviceTable=fcDeviceTable, rtCheckConsistencyFailed=rtCheckConsistencyFailed, rtFCLooplStateChange=rtFCLooplStateChange, channel=channel, fcLoopID_1=fcLoopID_1, rtEnclFanIndex=rtEnclFanIndex, rtPredictiveFailuresFalse=rtPredictiveFailuresFalse, enclFanStatus=enclFanStatus, ldReadFailuresPerSec=ldReadFailuresPerSec, rtEnclNumber=rtEnclNumber, rtCheckConsistencyStarted=rtCheckConsistencyStarted, enclAudibleAlarm=enclAudibleAlarm, rtEnclPowerSupplyIndex=rtEnclPowerSupplyIndex, numSCSIChannels=numSCSIChannels)
[ 2, 198, 2, 9485, 15571, 7378, 337, 9865, 8265, 37450, 12, 47307, 12, 8895, 33, 357, 4023, 1378, 16184, 76, 489, 8937, 13, 785, 14, 79, 893, 11632, 8, 198, 2, 7054, 45, 13, 16, 2723, 2393, 1378, 14, 14490, 14, 67, 615, 47562, 19,...
2.91268
26,111
from livereload.django.template.observers import DjangoTemplateDirectoriesObserver from livereload.server.notifiers import LivereloadServerNotifier from livereload.event.handlers import LivereloadFileEventHandler from django.conf import settings if 'django.contrib.staticfiles' in settings.INSTALLED_APPS: from django.contrib.staticfiles.management.commands.runserver import Command as RunserverCommand else: from django.core.management.commands.runserver import Command as RunserverCommand
[ 6738, 2107, 260, 2220, 13, 28241, 14208, 13, 28243, 13, 672, 2655, 690, 1330, 37770, 30800, 13470, 1749, 31310, 18497, 198, 6738, 2107, 260, 2220, 13, 15388, 13, 1662, 13350, 1330, 7547, 260, 2220, 10697, 3673, 7483, 198, 6738, 2107, 26...
3.578571
140
import sys sys.path.append(r"C:\Users\ahadrauf\Desktop\Research\dxf_stl_renderer") from pattern import * from settings import * import numpy as np from datetime import datetime if __name__ == '__main__': now = datetime.now() name_clarifier = "_test_cut_silhouette_curio_v2" timestamp = now.strftime("%Y%m%d_%H_%M_%S") + name_clarifier print(timestamp) p = generate_test_cut_curio() # p.generate_svg('../patterns/' + timestamp + '.svg', save=True, default_linewidth=1) p.generate_dxf('../patterns/' + timestamp + '.dxf', save=True)
[ 11748, 25064, 198, 17597, 13, 6978, 13, 33295, 7, 81, 1, 34, 7479, 14490, 59, 993, 49456, 3046, 59, 36881, 59, 25104, 59, 67, 26152, 62, 301, 75, 62, 10920, 11882, 4943, 198, 198, 6738, 3912, 1330, 1635, 198, 6738, 6460, 1330, 1635,...
2.473684
228
"""This script will run all unit test for the project. It was taken from https://github.com/ralf-meyer/NeuralNetworks/tests/run_all_tests.py. Author: - Ralf Meyer, QCIEP, TU Graz """ import os import sys import unittest from SCFInitialGuess.utilities.usermessages import Messenger as msg if __name__ == '__main__': msg.print_level = 0 testsuite = unittest.TestLoader().discover(os.path.dirname(os.path.abspath(__file__))) test_runner = unittest.TextTestRunner(verbosity=1).run(testsuite) if len(test_runner.failures) > 0 or len(test_runner.errors) > 0: sys.exit(1)
[ 37811, 1212, 4226, 481, 1057, 477, 4326, 1332, 329, 262, 1628, 13, 198, 1026, 373, 2077, 422, 220, 198, 5450, 1378, 12567, 13, 785, 14, 1373, 69, 12, 48794, 14, 8199, 1523, 7934, 5225, 14, 41989, 14, 5143, 62, 439, 62, 41989, 13, ...
2.634361
227
import numpy as np import matplotlib.pyplot as plt import seaborn as sns import scipy.stats import bootcamp_utils as booU x = np.random.random(size=100000) x_ecdf, y_ecdf = booU.ecdf(x) plt.plot(x_ecdf[::1000], y_ecdf[::1000], marker='.', linestyle='none', markersize=10) x = np.random.random(size=20) heads = x <=0.5
[ 11748, 299, 32152, 355, 45941, 198, 11748, 2603, 29487, 8019, 13, 9078, 29487, 355, 458, 83, 198, 11748, 384, 397, 1211, 355, 3013, 82, 198, 11748, 629, 541, 88, 13, 34242, 198, 11748, 6297, 16544, 62, 26791, 355, 22513, 52, 198, 198,...
2.406015
133
# # Darknet Darknet19 model # Copyright EAVISE # import functools from collections import OrderedDict import torch.nn as nn import lightnet.network as lnn __all__ = ['Darknet19'] class Darknet19(lnn.module.Darknet): """ Darknet19 implementation :cite:`yolo_v2`. Args: num_classes (Number, optional): Number of classes; Default **1000** input_channels (Number, optional): Number of input channels; Default **3** Attributes: self.inner_stride: Maximal internal subsampling factor of the network (input dimension should be a multiple of this) """ inner_stride = 32
[ 2, 198, 2, 220, 220, 3801, 3262, 3801, 3262, 1129, 2746, 198, 2, 220, 220, 15069, 412, 10116, 24352, 198, 2, 198, 198, 11748, 1257, 310, 10141, 198, 6738, 17268, 1330, 14230, 1068, 35, 713, 198, 11748, 28034, 13, 20471, 355, 299, 77...
2.90566
212
#!/usr/bin/env python __author__ = 'Sergei F. Kliver' import argparse from RouToolPa.Routines import EnsemblRoutines parser = argparse.ArgumentParser() parser.add_argument("-i", "--input", action="store", dest="input", required=True, help="Input file with protein annotations generated from Biomart") parser.add_argument("-o", "--output", action="store", dest="output", required=True, help="Output gff file") parser.add_argument("-s", "--separator", action="store", dest="separator", default="\t", help="Column separator in input file. Default: '\t'") parser.add_argument("-e", "--extraction_mode", action="store", dest="extraction_mode", default="pfam", help="Type of annotation to extract. Allowed: pfam(default).") args = parser.parse_args() EnsemblRoutines.convert_biomart_protein_annotation_to_gff(args.input, args.output, separator=args.separator, extraction_mode=args.extraction_mode)
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 834, 9800, 834, 796, 705, 7089, 469, 72, 376, 13, 14770, 1428, 6, 198, 198, 11748, 1822, 29572, 198, 6738, 13876, 25391, 28875, 13, 49, 448, 1127, 1330, 2039, 4428, 75, 49, 448, 1127...
2.441038
424
from transformers import BertTokenizer, BertModel, BertConfig import torch device = torch.device('cuda' if torch.cuda.is_available() else 'cpu') # print(device)
[ 6738, 6121, 364, 1330, 22108, 30642, 7509, 11, 22108, 17633, 11, 22108, 16934, 198, 11748, 28034, 198, 198, 25202, 796, 28034, 13, 25202, 10786, 66, 15339, 6, 611, 28034, 13, 66, 15339, 13, 271, 62, 15182, 3419, 2073, 705, 36166, 11537,...
3.211538
52
def get_{{customize_name}}_dataloader(dataset_path, input_size, batch_size, num_workers, train_portion=1): """ Prepare dataset for training and evaluating pipeline Args: dataset_path (str) input_size (int) batch_size (int) num_workers (int) train_portion (float) Return: train_loader (torch.utils.data.DataLoader) val_loader (torch.utils.data.DataLoader) test_loader (torch.utils.data.DataLoader) """ # Write your code here return train_loader, val_loader, test_loader
[ 4299, 651, 23330, 90, 23144, 1096, 62, 3672, 11709, 62, 67, 10254, 1170, 263, 7, 19608, 292, 316, 62, 6978, 11, 5128, 62, 7857, 11, 15458, 62, 7857, 11, 997, 62, 22896, 11, 4512, 62, 16864, 28, 16, 2599, 198, 220, 220, 220, 37227,...
2.419913
231
from django.conf.urls import url from .views import * urlpatterns = [ url(r"^home$",home,name="home"), url(r"^market$",market,name="market"), url(r"^cart$",cart,name="cart"), url(r"mine$",mine,name="mine"), url(r"market_with_params/(\d+)/(\d+)/(\d+)",market_with_params,name="market_params"), url(r"register$",RegisterAPI.as_view(),name="register"), url(r"^login$",LoginAPI.as_view(),name="login"), url(r"^logout$",Logout.as_view(),name="logout"), url(r"^confirm/(.*)",confirm), url(r"^check_uname$",check_uname), url(r"^cart_api$",CartAPI.as_view()), url(r"^cart_status$",CartStatusAPI.as_view()), url(r"^cart_all_status$",CartAllAPI.as_view()), url(r"^cart_item$",CartItemAPI.as_view()), url(r"^order_detail$",OrderAPI.as_view(),name="order"), ]
[ 6738, 42625, 14208, 13, 10414, 13, 6371, 82, 1330, 19016, 201, 198, 6738, 764, 33571, 1330, 1635, 201, 198, 201, 198, 6371, 33279, 82, 796, 685, 201, 198, 220, 220, 220, 19016, 7, 81, 1, 61, 11195, 3, 1600, 11195, 11, 3672, 2625, ...
2.175393
382
''' Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. NVIDIA CORPORATION and its licensors retain all intellectual property and proprietary rights in and to this software, related documentation and any modifications thereto. Any use, reproduction, disclosure or distribution of this software and related documentation without an express license agreement from NVIDIA CORPORATION is strictly prohibited. ''' from isaac import Cask from pathlib import Path from matplotlib import pyplot as plt import argparse import datetime import json import matplotlib.animation as animation import numpy as np import os import quaternion import shutil import uuid from packages.cask.apps import multi_cask_processing from pose_evaluation_utils import * def get_image_cask_uuid_raci_metadata(roots): """ Retrieve the image_cask_uuids for a list of logs from their associated metadata. Returns None if the metadata json files are not found to extract uuids. """ image_cask_uuids = [] for root in roots: metadata_path = root + "_md.json" metadata = {} if (not os.path.isfile(metadata_path)): return None with open(metadata_path) as f: metadata = json.load(f) image_cask_uuids.append(metadata["Image_Cask_File"]) return image_cask_uuids def make_clean_dir(path): """Clears a directory and creates it on disk. Args: path: The path on disk where the directory should be located. """ # Clean up by deleting the directory if it already exists if os.path.exists(path): shutil.rmtree(path) # Create the directory os.makedirs(path) def get_message_idx(cask, acqtime, start_idx): """ Returns index of cask channel with matching timestamp. Returns -1, if the message was not found. cask - cask channel acqtime - acquisition timestamp to search for in cask start_idx - starting index to search from in the list of cask messages """ for i in range(start_idx, len(cask)): if cask[i].acqtime == acqtime: return i # Return -1 if matching time stamp is not found. return -1 def main(args): """ The entry point of the application. The function reads the json file containing the ground truth and predicted pose labels, computes evaluation metrics and save the plots of translationa and rotation errors. """ # Create uuid eval_uuid = uuid.uuid4() # ----------------------- LOAD CONFIG -------------------------------------- # load evaluation config config = {} config_path = os.fspath(Path(args.config).resolve()) with open(config_path) as f: config = json.load(f) # read cask paths image_cask_dir_path = args.image_cask_dir gt_cask_dir_path = args.gt_cask_dir pred_cask_dir_path = args.predicted_cask_dir image_cask_list = multi_cask_processing.load_roots(image_cask_dir_path, "") gt_poses_cask_list = multi_cask_processing.load_roots(gt_cask_dir_path, "") predicted_poses_cask_list = multi_cask_processing.load_roots(pred_cask_dir_path, "") pred_cask_root_list = [os.path.split(root)[0] for root in predicted_poses_cask_list] gt_cask_root_list = [os.path.split(root)[0] for root in gt_poses_cask_list] pred_image_cask_uuids = get_image_cask_uuid_raci_metadata(pred_cask_root_list) assert (pred_image_cask_uuids is not None), "Unable to find the metadata files for prediction casks." # Check for image cask uuids in the ground truth cask list (for simulation) or # roots of the cask list (for real data ground truth casks) gt_image_cask_uuids = get_image_cask_uuid_raci_metadata(gt_poses_cask_list) if (gt_image_cask_uuids is None): gt_image_cask_uuids = get_image_cask_uuid_raci_metadata(gt_cask_root_list) assert (gt_image_cask_uuids is not None), "Unable to find the metadata files for ground truth casks." # List of predicted poses images = [] predicted_poses = [] gt_poses = [] predicted_detections = [] # Read all the json objects into a string if (not (len(predicted_poses_cask_list) == len(gt_poses_cask_list) or not (len(predicted_poses_cask_list) == len(image_cask_list)))): raiseError("Length of image, ground truth and predicted labels list must be equal") # ------------------------- AGGREGATE IMAGE, PREDICTIONS, LABELS DATA -------------------- for image_cask_path in image_cask_list: _, image_cask_tail = os.path.split(image_cask_path) try: # get associated gt cask and pred casks gt_cask_idx = gt_image_cask_uuids.index(image_cask_tail) pred_cask_idx = pred_image_cask_uuids.index(image_cask_tail) except (ValueError): print("Associated ground truth or predicted cask is not \ available for image cask {}".format(image_cask_path)) continue gt_cask_path = gt_poses_cask_list[gt_cask_idx] pred_cask_path = predicted_poses_cask_list[pred_cask_idx] #read image cask images_channel = Cask(image_cask_path)[config['image_channel']] #read ground truth cask gt_poses_channel = Cask(gt_cask_path)[config['gt_pose_channel']] # read predictions cask pred_poses_channel = Cask(pred_cask_path)[config['pred_pose_channel']] if (args.use_2d_detections): # read predcited detections cask if the channel is not empty pred_detections_channel = Cask(pred_cask_path)[config['pred_detection_channel']] # Reset indices before synching casks prev_image_idx = 0 prev_gt_pose_idx = 0 prev_pred_detection_idx = 0 # ----------------------- SYNC CASKS -------------------------------------- # Sync image, gt pose message, and predicted pose message channels by acqtime for prediction_pose in pred_poses_channel: #TODO:[Sravya] - Extend the evaluation to multiple objects in an image scenario if (len(prediction_pose.proto.poses) == 0 or len(prediction_pose.proto.poses) > 1): continue acqtime = prediction_pose.acqtime gt_pose_idx = get_message_idx(gt_poses_channel, acqtime, prev_gt_pose_idx) image_idx = get_message_idx(images_channel, acqtime, prev_image_idx) # Skip the message if the matching timestamp is not found in either casks if (image_idx != -1 and gt_pose_idx != -1): if (len(gt_poses_channel[gt_pose_idx].proto.poses) == 0): continue images.append(images_channel[image_idx].tensor) gt_poses.append(pose_capnp_to_list(gt_poses_channel[gt_pose_idx].proto.poses[0])) predicted_poses.append(pose_capnp_to_list(prediction_pose.proto.poses[0])) prev_image_idx = image_idx prev_gt_pose_idx = gt_pose_idx if (args.use_2d_detections): detection_idx = get_message_idx(pred_detections_channel, acqtime, prev_pred_detection_idx) prev_pred_detection_idx = detection_idx # If detection sample is missing, add a zero size bbox instead of # ignoring the sample. if ((detection_idx < 0) or (not pred_detections_channel[detection_idx].proto.boundingBoxes)): predicted_detections.append([0, 0, 0, 0]) continue bbox = pred_detections_channel[detection_idx].proto.boundingBoxes[0] predicted_detections.append([bbox.min.x, bbox.min.y, bbox.max.x, bbox.max.y]) # --------- Compute and plot evaluation metrics and outliers -------- # Parse json objects and populate the pose statistics predicted_poses = np.asarray(predicted_poses) gt_poses = np.asarray(gt_poses) num_samples = gt_poses.shape[0] if (num_samples == 0): return if (args.use_2d_detections): predicted_detections = np.asarray(predicted_detections) # Setup folders to save eval metrics/plots. results_dir = args.results_dir make_clean_dir(results_dir) # Translation error along x, y a nd z axes in meters in the depth region of interest. translation_err = compute_roi_abs_translation_error(predicted_poses, gt_poses) # Rotation error between quaternions of ground truth and predicted pose (in deg) rotation_err = compute_roi_rotation_error(predicted_poses, gt_poses, config['symmetry_axis'], config['num_rotation_symmetry']) # ----------------------- COMPUTE AND OUTPUT KPIS -------------------------------------- # Indices in the depth range of interest roi = np.where((gt_poses[:, 6] > config['depth_roi'][0]) & (gt_poses[:, 6] <= config['depth_roi'][1]))[0].tolist() # Median metrics in the region of interest in terms of distance from camera median_metrics = compute_median_pose_errors(rotation_err[roi], translation_err[roi, :]) median_metrics = [round(elem, 3) for elem in median_metrics] translation_metrics_txt = "Median translation error in the depth roi [{}, {}] in m = {}\n".\ format(config['depth_roi'][0], config['depth_roi'][1], median_metrics[1:]) rotation_metrics_txt = "Median rotation error in the depth roi [{}, {}] = {} deg \n".\ format(config['depth_roi'][0], config['depth_roi'][1], median_metrics[0]) # Mean Precision in Pose Estimation metric # Reference: https://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=6130367 accuracy = compute_accuracy(translation_err[roi, :], rotation_err[roi], config['translation_err_threshold'], config['rotation_err_threshold']) accuracy = round(accuracy, 2) # Check if the KPIs meet the minimum thresholds and determine pass/fail kpi_pass = (accuracy >= config['KPI_accuracy_threshold'] and median_metrics[0] <= config['rotation_err_threshold'] and median_metrics[1] <= config['translation_err_threshold'][0] and median_metrics[2] <= config['translation_err_threshold'][1] and median_metrics[3] <= config['translation_err_threshold'][2]) # Write KPI metrics to JSON file evaluation_report = config evaluation_report["translation_x_err_threshold"] = config['translation_err_threshold'][0] evaluation_report["translation_y_err_threshold"] = config['translation_err_threshold'][1] evaluation_report["translation_z_err_threshold"] = config['translation_err_threshold'][2] evaluation_report["date"] = str(datetime.datetime.now().strftime("%Y-%m-%d")) evaluation_report["num_frames"] = num_samples evaluation_report["KPI_roi_median_translation_x_error"] = median_metrics[1] evaluation_report["KPI_roi_median_translation_y_error"] = median_metrics[2] evaluation_report["KPI_roi_median_translation_z_error"] = median_metrics[3] evaluation_report["KPI_roi_median_rotation_error_deg"] = median_metrics[0] evaluation_report["KPI_roi_accuracy"] = accuracy evaluation_report["KPI_pass"] = bool(kpi_pass) # Write the JSON to file json_output_path = os.path.join(results_dir, "pose_estimation_evaluation_" + str(eval_uuid) + ".json") with open(json_output_path, 'w') as f: json.dump(evaluation_report, f, indent=2) # Save outlier images (above the error thresholds above) as animation # List of indices common across roi, translation and rotation positive indices positive_ind = (np.where((gt_poses[:, 6] > config['depth_roi'][0]) & (gt_poses[:, 6] <= config['depth_roi'][1]) & (translation_err[:, 0] < config['translation_err_threshold'][0]) & (translation_err[:, 1] < config['translation_err_threshold'][1]) & (translation_err[:, 2] < config['translation_err_threshold'][2]) & (rotation_err < config['rotation_err_threshold'])))[0].tolist() outlier_ind = [x for x in roi if x not in positive_ind] non_relevant_ind = [x for x in range(num_samples) if x not in outlier_ind] for index in sorted(non_relevant_ind, reverse=True): del images[index] camera_matrix = get_camera_matrix(config["camera_focal"], config["image_center"]) save_animation_path = os.path.join("{}/{}.mp4".format(results_dir, 'outlier_images_with_predicted_poses')) for i in range(len(images)): # Update the image pixels with 3D bbox of the pose images[i] = visualize_3Dboundingbox(config["object_size"], config["object_center"], camera_matrix, predicted_poses[outlier_ind[i], :], images[i]) if (args.use_2d_detections): images[i] = visualize_2Dboundingbox(predicted_detections[outlier_ind[i], :], images[i]) # Save the outlier images with 2D and 3D predicted bounding boxes as animation save_animation_from_image_list(images, save_animation_path) # Box-whisker plot to analyze the distribution of errors at various camera distances) # Bins of errors based on distance from camera [rotation_err_bins, trans_err_x_bins, trans_err_y_bins, trans_err_z_bins, dist_values_bins] = compute_pose_error_depth_bins(rotation_err, translation_err, gt_poses, config['box_plot_camera_distance_bins']) plt.figure() plt.boxplot(trans_err_x_bins) plt.ylim([0, config['translation_box_plot_y_limit'][0]]) plt.title('Absolute of x position error for different camera distance intervals') plt.xlabel('Distance from camera in m') plt.ylabel('Absolute x position error in m') plt.savefig(os.path.join("{}/{}.png".format(results_dir, 'box_plot_abs_x_err'))) plt.figure() plt.boxplot(trans_err_y_bins) plt.ylim([0, config['translation_box_plot_y_limit'][1]]) plt.title('Absolute of y position error for different camera distance intervals') plt.xlabel('Distance from camera in m') plt.ylabel('Absolute y position error in m') plt.savefig(os.path.join("{}/{}.png".format(results_dir, 'box_plot_abs_y_err'))) plt.figure() plt.boxplot(trans_err_z_bins) plt.ylim([0, config['translation_box_plot_y_limit'][2]]) plt.title('Absolute of z error for different camera distance intervals') plt.xlabel('Distance from camera in m') plt.ylabel('Absolute z position error in m') plt.savefig(os.path.join("{}/{}.png".format(results_dir, 'box_plot_abs_z_err'))) plt.figure() plt.boxplot(rotation_err_bins) plt.ylim([0, config['rotation_box_plot_y_limit']]) plt.title('Rotation error in deg for different camera distance intervals') plt.xlabel('distance from camera in m') plt.ylabel('rotation error angle in deg') plt.savefig(os.path.join("{}/{}.png".format(results_dir, 'box_plot_rotation_err'))) # Rotation angle threshold vs accuracy # Ref: PoseCNN: https://arxiv.org/pdf/1711.00199.pdf z_min = config['depth_roi'][0] z_max = config['depth_roi'][1] rot_threshold_bins = np.linspace(0, 180, 180) # Total number of samples within the camera distances range rotation_accuracy = [] for rot_threshold in rot_threshold_bins: positive_ind = (np.where((gt_poses[:, 6] > z_min) & (gt_poses[:, 6] <= z_max) & (rotation_err < rot_threshold)))[0].tolist() rotation_accuracy.append(len(positive_ind) / len(roi)) # Translation threshold vs accuracy # Ref: PoseCNN: https://arxiv.org/pdf/1711.00199.pdf # Plotting accuracy till translation error threshold of 30% body diameter body_diameter = np.linalg.norm(config['object_size']) trans_threshold_bins = np.linspace(0, 0.3 * body_diameter, 100) # Total number of samples within the camera distances range translation_accuracy = [] for trans_threshold in trans_threshold_bins: positive_ind = (np.where((gt_poses[:, 6] > z_min) & (gt_poses[:, 6] <= z_max) & (translation_err[:, 0] < trans_threshold) & (translation_err[:, 1] < trans_threshold) & (translation_err[:, 2] < trans_threshold)))[0].tolist() translation_accuracy.append(len(positive_ind) / len(roi)) # Plot of accuracy vs rotation threshold plt.figure() plt.plot(rot_threshold_bins, rotation_accuracy) plt.ylim([0, 1.0]) plt.xlabel('Rotationangle threshold (in deg)') plt.ylabel('Accuracy') plt.savefig(os.path.join("{}/{}.png".format(results_dir, 'rotation_accuracy'))) # Plot of accuracy vs translation threshold plt.figure() plt.plot(trans_threshold_bins, translation_accuracy) plt.xlabel('Translation threshold (in m)') plt.ylabel('Accuracy') plt.ylim([0, 1.0]) plt.savefig(os.path.join("{}/{}.png".format(results_dir, 'translation_accuracy'))) if __name__ == '__main__': parser = argparse.ArgumentParser(description='Pose Estimation Cask Evaluation') parser.add_argument( '--config', dest='config', default= "packages/object_pose_estimation/apps/pose_cnn_decoder/evaluation/evaluation_config.json", help='Config file to load.') parser.add_argument( '--use_2d_detections', dest='use_2d_detections', default=True, help='If set to true, predicted 2D detections are assumed to be one of the channels of the \ predicted poses cask. The detections are visualized for the outliers.') parser.add_argument( '--results_dir', dest='results_dir', default="/tmp/pose_evaluation_results", help= 'Path to store the evaluation results. The directory is created if not already present.') parser.add_argument('--image_cask_dir', dest='image_cask_dir', default="/tmp/data/raw", help='Path to the image cask directory') parser.add_argument('--gt_cask_dir', dest='gt_cask_dir', default="/tmp/data/ground_truth", help='Path to the ground truth pose cask directory') parser.add_argument( '--predicted_cask_dir', dest='predicted_cask_dir', default="/tmp/data/predictions", help='Path to the predicted pose cask directory. It is expected to contain 2D detection\ as well if use_2d_detections is set to True') args, _ = parser.parse_known_args() main(args)
[ 7061, 6, 198, 15269, 357, 66, 8, 12131, 11, 15127, 23929, 44680, 6234, 13, 1439, 2489, 10395, 13, 198, 198, 38021, 23929, 44680, 6234, 290, 663, 8240, 669, 12377, 477, 9028, 3119, 198, 392, 20622, 2489, 287, 290, 284, 428, 3788, 11, ...
2.3666
8,036
celsius = [0.7, 2.1, 4.2, 8.2, 12.5, 15.6, 16.9, 16.3, 13.6, 9.5, 4.6, 2.3] # Alle Temperaturen größer gleich 15 gefiltert = [] for month in celsius: if month >= 15: gefiltert.append(month) print(gefiltert)
[ 5276, 82, 3754, 796, 685, 15, 13, 22, 11, 362, 13, 16, 11, 604, 13, 17, 11, 807, 13, 17, 11, 1105, 13, 20, 11, 1315, 13, 21, 11, 1467, 13, 24, 11, 1467, 13, 18, 11, 1511, 13, 21, 11, 860, 13, 20, 11, 604, 13, 21, 11, 3...
1.826772
127
# coding=utf-8 # # BSD 3-Clause License # # Copyright (c) 2016-21, University of Liverpool # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this # list of conditions and the following disclaimer. # # * Redistributions in binary form must reproduce the above copyright notice, # this list of conditions and the following disclaimer in the documentation # and/or other materials provided with the distribution. # # * Neither the name of the copyright holder nor the names of its # contributors may be used to endorse or promote products derived from # this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. """Python wrappers for common command line applications""" __author__ = "Felix Simkovic" __date__ = "20 Oct 2016" __version__ = "0.13.3"
[ 2, 19617, 28, 40477, 12, 23, 198, 2, 198, 2, 347, 10305, 513, 12, 2601, 682, 13789, 198, 2, 198, 2, 15069, 357, 66, 8, 1584, 12, 2481, 11, 2059, 286, 11761, 198, 2, 1439, 2489, 10395, 13, 198, 2, 198, 2, 2297, 396, 3890, 290, ...
3.510081
496
# Copyright 2016-2019 The Van Valen Lab at the California Institute of # Technology (Caltech), with support from the Paul Allen Family Foundation, # Google, & National Institutes of Health (NIH) under Grant U24CA224309-01. # All rights reserved. # # Licensed under a modified Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.github.com/vanvalenlab/deepcell-tf/LICENSE # # The Work provided may be used for non-commercial academic purposes only. # For any other use of the Work, including commercial use, please contact: # vanvalenlab@gmail.com # # Neither the name of Caltech nor the names of its contributors may be used # to endorse or promote products derived from this software without specific # prior written permission. # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== """Feature pyramid network utility functions""" from __future__ import absolute_import from __future__ import print_function from __future__ import division import re from tensorflow.python.keras import backend as K from tensorflow.python.keras.models import Model from tensorflow.python.keras.layers import Conv2D, Conv3D from tensorflow.python.keras.layers import Softmax from tensorflow.python.keras.layers import Input, Add from tensorflow.python.keras.layers import Reshape from tensorflow.python.keras.layers import Activation from tensorflow.python.keras.layers import UpSampling2D, UpSampling3D from tensorflow.python.keras.layers import BatchNormalization from deepcell.layers import UpsampleLike from deepcell.layers import TensorProduct, ImageNormalization2D from deepcell.utils.backbone_utils import get_backbone from deepcell.utils.misc_utils import get_sorted_keys def create_pyramid_level(backbone_input, upsamplelike_input=None, addition_input=None, level=5, ndim=2, feature_size=256): """Create a pyramid layer from a particular backbone input layer. Args: backbone_input (layer): Backbone layer to use to create they pyramid layer upsamplelike_input ([type], optional): Defaults to None. Input to use as a template for shape to upsample to addition_input (layer, optional): Defaults to None. Layer to add to pyramid layer after conv and upsample level (int, optional): Defaults to 5. Level to use in layer names feature_size (int, optional): Defaults to 256. Number of filters for convolutional layer ndim: The spatial dimensions of the input data. Default is 2, but it also works with 3 Returns: (pyramid final, pyramid upsample): Pyramid layer after processing, upsampled pyramid layer """ acceptable_ndims = {2, 3} if ndim not in acceptable_ndims: raise ValueError('Only 2 and 3 dimensional networks are supported') reduced_name = 'C%s_reduced' % level upsample_name = 'P%s_upsampled' % level addition_name = 'P%s_merged' % level final_name = 'P%s' % level # Apply 1x1 conv to backbone layer if ndim == 2: pyramid = Conv2D(feature_size, (1, 1), strides=(1, 1), padding='same', name=reduced_name)(backbone_input) else: pyramid = Conv3D(feature_size, (1, 1, 1), strides=(1, 1, 1), padding='same', name=reduced_name)(backbone_input) # Upsample pyramid input if upsamplelike_input is not None: pyramid_upsample = UpsampleLike(name=upsample_name)( [pyramid, upsamplelike_input]) else: pyramid_upsample = None # Add and then 3x3 conv if addition_input is not None: pyramid = Add(name=addition_name)([pyramid, addition_input]) if ndim == 2: pyramid_final = Conv2D(feature_size, (3, 3), strides=(1, 1), padding='same', name=final_name)(pyramid) else: pyramid_final = Conv3D(feature_size, (3, 3, 3), strides=(1, 1, 1), padding='same', name=final_name)(pyramid) return pyramid_final, pyramid_upsample def __create_pyramid_features(backbone_dict, ndim=2, feature_size=256, include_final_layers=True): """Creates the FPN layers on top of the backbone features. Args: backbone_dict (dictionary): A dictionary of the backbone layers, with the names as keys, e.g. {'C0': C0, 'C1': C1, 'C2': C2, ...} feature_size (int, optional): Defaults to 256. The feature size to use for the resulting feature levels. include_final_layers: Defaults to True. Option to add two coarser pyramid levels ndim: The spatial dimensions of the input data. Default is 2, but it also works with 3 Returns: A dictionary with the feature pyramid names and levels, e.g. {'P3': P3, 'P4': P4, ...} Each backbone layer gets a pyramid level, and two additional levels are added, e.g. [C3, C4, C5] --> [P3, P4, P5, P6, P7] """ acceptable_ndims = [2, 3] if ndim not in acceptable_ndims: raise ValueError('Only 2 and 3 dimensional networks are supported') # Get names of the backbone levels and place in ascending order backbone_names = get_sorted_keys(backbone_dict) backbone_features = [backbone_dict[name] for name in backbone_names] pyramid_names = [] pyramid_finals = [] pyramid_upsamples = [] # Reverse lists backbone_names.reverse() backbone_features.reverse() for i in range(len(backbone_names)): N = backbone_names[i] level = int(re.findall(r'\d+', N)[0]) p_name = 'P' + str(level) pyramid_names.append(p_name) backbone_input = backbone_features[i] # Don't add for the bottom of the pyramid if i == 0: if len(backbone_features) > 1: upsamplelike_input = backbone_features[i + 1] else: upsamplelike_input = None addition_input = None # Don't upsample for the top of the pyramid elif i == len(backbone_names) - 1: upsamplelike_input = None addition_input = pyramid_upsamples[-1] # Otherwise, add and upsample else: upsamplelike_input = backbone_features[i + 1] addition_input = pyramid_upsamples[-1] pf, pu = create_pyramid_level(backbone_input, upsamplelike_input=upsamplelike_input, addition_input=addition_input, level=level) pyramid_finals.append(pf) pyramid_upsamples.append(pu) # Add the final two pyramid layers if include_final_layers: # "Second to last pyramid layer is obtained via a # 3x3 stride-2 conv on the coarsest backbone" N = backbone_names[0] F = backbone_features[0] level = int(re.findall(r'\d+', N)[0]) + 1 P_minus_2_name = 'P%s' % level if ndim == 2: P_minus_2 = Conv2D(feature_size, kernel_size=(3, 3), strides=(2, 2), padding='same', name=P_minus_2_name)(F) else: P_minus_2 = Conv3D(feature_size, kernel_size=(3, 3, 3), strides=(2, 2, 2), padding='same', name=P_minus_2_name)(F) pyramid_names.insert(0, P_minus_2_name) pyramid_finals.insert(0, P_minus_2) # "Last pyramid layer is computed by applying ReLU # followed by a 3x3 stride-2 conv on second to last layer" level = int(re.findall(r'\d+', N)[0]) + 2 P_minus_1_name = 'P' + str(level) P_minus_1 = Activation('relu', name=N + '_relu')(P_minus_2) if ndim == 2: P_minus_1 = Conv2D(feature_size, kernel_size=(3, 3), strides=(2, 2), padding='same', name=P_minus_1_name)(P_minus_1) else: P_minus_1 = Conv3D(feature_size, kernel_size=(3, 3, 3), strides=(2, 2, 2), padding='same', name=P_minus_1_name)(P_minus_1) pyramid_names.insert(0, P_minus_1_name) pyramid_finals.insert(0, P_minus_1) pyramid_names.reverse() pyramid_finals.reverse() # Reverse lists backbone_names.reverse() backbone_features.reverse() pyramid_dict = {} for name, feature in zip(pyramid_names, pyramid_finals): pyramid_dict[name] = feature return pyramid_dict def semantic_upsample(x, n_upsample, n_filters=64, ndim=2, target=None): """ Performs iterative rounds of 2x upsampling and convolutions with a 3x3 filter to remove aliasing effects Args: x (tensor): The input tensor to be upsampled n_upsample (int): The number of 2x upsamplings n_filters (int, optional): Defaults to 256. The number of filters for the 3x3 convolution target (tensor, optional): Defaults to None. A tensor with the target shape. If included, then the final upsampling layer will reshape to the target tensor's size ndim: The spatial dimensions of the input data. Default is 2, but it also works with 3 Returns: The upsampled tensor """ acceptable_ndims = [2, 3] if ndim not in acceptable_ndims: raise ValueError('Only 2 and 3 dimensional networks are supported') for i in range(n_upsample): if ndim == 2: x = Conv2D(n_filters, (3, 3), strides=(1, 1), padding='same', data_format='channels_last')(x) if i == n_upsample - 1 and target is not None: x = UpsampleLike()([x, target]) else: x = UpSampling2D(size=(2, 2))(x) else: x = Conv3D(n_filters, (3, 3, 3), strides=(1, 1, 1), padding='same', data_format='channels_last')(x) if i == n_upsample - 1 and target is not None: x = UpsampleLike()([x, target]) else: x = UpSampling3D(size=(2, 2, 2))(x) if n_upsample == 0: if ndim == 2: x = Conv2D(n_filters, (3, 3), strides=(1, 1), padding='same', data_format='channels_last')(x) else: x = Conv3D(n_filters, (3, 3, 3), strides=(1, 1, 1), padding='same', data_format='channels_last')(x) if target is not None: x = UpsampleLike()([x, target]) return x def semantic_prediction(semantic_names, semantic_features, target_level=0, input_target=None, n_filters=64, n_dense=64, ndim=2, n_classes=3, semantic_id=0): """ Creates the prediction head from a list of semantic features Args: semantic_names (list): A list of the names of the semantic feature layers semantic_features (list): A list of semantic features NOTE: The semantic_names and semantic features should be in decreasing order e.g. [Q6, Q5, Q4, ...] target_level (int, optional): Defaults to 0. The level we need to reach. Performs 2x upsampling until we're at the target level input_target (tensor, optional): Defaults to None. Tensor with the input image. n_dense (int, optional): Defaults to 256. The number of filters for dense layers. n_classes (int, optional): Defaults to 3. The number of classes to be predicted. semantic_id (int): Defaults to 0. An number to name the final layer. Allows for multiple semantic heads. Returns: The softmax prediction for the semantic segmentation head """ acceptable_ndims = [2, 3] if ndim not in acceptable_ndims: raise ValueError('Only 2 and 3 dimensional networks are supported') if K.image_data_format() == 'channels_first': channel_axis = 1 else: channel_axis = -1 # Add all the semantic layers semantic_sum = semantic_features[0] for semantic_feature in semantic_features[1:]: semantic_sum = Add()([semantic_sum, semantic_feature]) # Final upsampling min_level = int(re.findall(r'\d+', semantic_names[-1])[0]) n_upsample = min_level - target_level x = semantic_upsample(semantic_sum, n_upsample, target=input_target) # First tensor product x = TensorProduct(n_dense)(x) x = BatchNormalization(axis=-1)(x) x = Activation('relu')(x) # Apply tensor product and softmax layer x = TensorProduct(n_classes)(x) x = Softmax(axis=channel_axis, name='semantic_' + str(semantic_id))(x) return x def __create_semantic_head(pyramid_dict, input_target=None, target_level=2, n_classes=3, n_filters=128, semantic_id=0): """ Creates a semantic head from a feature pyramid network Args: pyramid_names (list): A list of the names of the pyramid levels, e.g ['P3', 'P4', 'P5', 'P6'] in increasing order pyramid_features (list): A list with the pyramid level tensors in the same order as pyramid names input_target (tensor, optional): Defaults to None. Tensor with the input image. target_level (int, optional): Defaults to 2. Upsampling level. Level 1 = 1/2^1 size, Level 2 = 1/2^2 size, Level 3 = 1/2^3 size, etc. n_classes (int, optional): Defaults to 3. The number of classes to be predicted n_filters (int, optional): Defaults to 128. The number of convolutional filters. Returns: The semantic segmentation head """ # Get pyramid names and features into list form pyramid_names = get_sorted_keys(pyramid_dict) pyramid_features = [pyramid_dict[name] for name in pyramid_names] # Reverse pyramid names and features pyramid_names.reverse() pyramid_features.reverse() semantic_features = [] semantic_names = [] # for P in pyramid_features: # print(P.get_shape()) for N, P in zip(pyramid_names, pyramid_features): # Get level and determine how much to upsample level = int(re.findall(r'\d+', N)[0]) n_upsample = level - target_level target = semantic_features[-1] if len(semantic_features) > 0 else None # Use semantic upsample to get semantic map semantic_features.append(semantic_upsample( P, n_upsample, n_filters=n_filters, target=target)) semantic_names.append('Q' + str(level)) # Combine all of the semantic features x = semantic_prediction(semantic_names, semantic_features, n_classes=n_classes, input_target=input_target, semantic_id=semantic_id) return x def FPNet(backbone, input_shape, inputs=None, norm_method='whole_image', use_imagenet=False, pooling=None, required_channels=3, n_classes=3, name='fpnet', **kwargs): """ Creates a Feature Pyramid Network with a semantic segmentation head Args: backbone (str): A name of a supported backbone from [deepcell, resnet50] input_shape (tuple): Shape of the input image input (keras layer, optional): Defaults to None. Method to pass in preexisting layers norm_method (str, optional): Defaults to 'whole_image'. Normalization method weights (str, optional): Defaults to None. one of `None` (random initialization), 'imagenet' (pre-training on ImageNet), or the path to the weights file to be loaded. pooling (str, optional): Defaults to None. optional pooling mode for feature extraction when `include_top` is `False`. - `None` means that the output of the model will be the 4D tensor output of the last convolutional layer. - `avg` means that global average pooling will be applied to the output of the last convolutional layer, and thus the output of the model will be a 2D tensor. - `max` means that global max pooling will be applied. required_channels (int, optional): Defaults to 3. The required number of channels of the backbone. 3 is the default for all current backbones. n_classes (int, optional): Defaults to 3. The number of classes to be predicted name (str, optional): Defaults to 'fpnet'. Name to use for the model. Returns: Model with a feature pyramid network with a semantic segmentation head as the output """ if inputs is None: inputs = Input(shape=input_shape) # force the channel size for backbone input to be `required_channels` norm = ImageNormalization2D(norm_method=norm_method)(inputs) fixed_inputs = TensorProduct(required_channels)(norm) # force the input shape fixed_input_shape = list(input_shape) fixed_input_shape[-1] = required_channels fixed_input_shape = tuple(fixed_input_shape) model_kwargs = { 'include_top': False, 'weights': None, 'input_shape': fixed_input_shape, 'pooling': pooling } # Get backbone outputs backbone_dict = get_backbone( backbone, fixed_inputs, use_imagenet=use_imagenet, **model_kwargs) # Construct feature pyramid network pyramid_dict = __create_pyramid_features(backbone_dict) levels = [int(re.findall(r'\d+', k)[0]) for k in pyramid_dict] target_level = min(levels) x = __create_semantic_head(pyramid_dict, n_classes=n_classes, input_target=inputs, target_level=target_level) return Model(inputs=inputs, outputs=x, name=name)
[ 2, 15069, 1584, 12, 23344, 383, 6656, 3254, 268, 3498, 379, 262, 3442, 5136, 286, 198, 2, 8987, 357, 9771, 13670, 828, 351, 1104, 422, 262, 3362, 9659, 7884, 5693, 11, 198, 2, 3012, 11, 1222, 2351, 33656, 286, 3893, 357, 22125, 39, ...
2.363348
7,874
import logging from inspect import getmembers, isfunction import configargparse import ipv4_providers from prometheus_client import start_http_server from dyndns_updater import UpdateDetector from notifier import UpdateNotifier from persistence import FilePersistence def read_config(): """ Parse CLI args. """ parser = configargparse.ArgumentParser(prog='dns_client') parser.add_argument('-u', '--url', dest="url", action="store", env_var="DNSCLIENT_URL", required=True, help="The URL of the server component") parser.add_argument('-r', '--record', dest="record", action="store", env_var="DNSCLIENT_RECORD", required=True, help="The full DNS record to update. It should end with a dot") parser.add_argument('-s', '--secret', dest="shared_secret", action="store", env_var="DNSCLIENT_SECRET", required=True, help="The secret that's associated with the appropriate record") parser.add_argument('--debug', dest="debug", action="store_true", env_var="DNSCLIENT_DEBUG", default=False, help="Print debug messages") parser.add_argument('--prometheus_port', dest='promport', action="store", env_var="DNSCLIENT_PROMPORT", type=int, default=0, help="Start a prometheus metrics server on the given port. To disable this feature, supply 0 as port. (Defaults to 0)") parser.add_argument('-i', '--interval', dest="interval", action="store", type=int, env_var="DNSCLIENT_INTERVAL", default=60, help="The interval in seconds to check a random IP provider. Defaults to 60") parser.add_argument('-f', '--file', dest="file", action="store", env_var="DNSCLIENT_FILE", required=False, help="Save resolved IP to a file to preserve the status across service restarts.") return parser.parse_args() def get_ipv4_providers(): """ Return all configured IP providers """ logging.info("Loading IP providers") return [f for f in getmembers(ipv4_providers, isfunction)] def init_logging(debug=False): """ Setup logging """ loglevel = logging.INFO if debug: loglevel = logging.DEBUG logging.basicConfig(format='%(asctime)s [%(levelname)s] %(message)s', level=loglevel) logging.getLogger("requests").setLevel(logging.WARNING) logging.getLogger("urllib3").setLevel(logging.WARNING) def print_config(args, ipv4_providers): """ Print configuration after startup """ logging.info("Using the following parameters") logging.info("url=%s", args.url) logging.info("record=%s", args.record) logging.info("interval=%d", args.interval) logging.info("prometheus_port=%d", args.promport) if "file" in args: logging.info("file=%s", args.file) logging.info("providers=%s", [x[0] for x in ipv4_providers]) def initialize(): """ Start up """ args = read_config() persistence_provider = None if args.file: persistence_provider = FilePersistence(args.file) init_logging(args.debug) ip_providers = get_ipv4_providers() print_config(args, ip_providers) prometheus_server(args) notifier = UpdateNotifier( dns_record=args.record, host=args.url, shared_secret=args.shared_secret, ) detector = UpdateDetector( update_notifier=notifier, ip_providers=ip_providers, interval=args.interval, persistence=persistence_provider) detector.start() if __name__ == "__main__": initialize()
[ 11748, 18931, 198, 6738, 10104, 1330, 651, 30814, 11, 318, 8818, 198, 198, 11748, 4566, 853, 29572, 198, 11748, 20966, 85, 19, 62, 15234, 4157, 198, 198, 6738, 1552, 36916, 62, 16366, 1330, 923, 62, 4023, 62, 15388, 198, 6738, 20268, ...
2.864751
1,183
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Oct 18 17:29:22 2017 @author: dimitris """ import numpy as np import h5py np.random.seed(1) #################################### ##############################3 train_x_orig, train_y, test_x_orig, test_y, classes = load_data() # Reshape the training and test examples train_x_flatten = train_x_orig.reshape(train_x_orig.shape[0], -1).T # The "-1" makes reshape flatten the remaining dimensions test_x_flatten = test_x_orig.reshape(test_x_orig.shape[0], -1).T # Standardize data to have feature values between 0 and 1. train_x = train_x_flatten/255. test_x = test_x_flatten/255. #######Global layers = [12288, 20, 7, 5, 1] # 4-layer model (layer_dims) #layers = [12288, 20, 20, 20, 1] # 4-layer model # The input layer is the 0 layer. So actually the above NN is a 4 layer network. ############# ############################ ########################### ################### ############################ L_model(train_x,train_y, iterations=2500, lr=0.009 )
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 37811, 198, 41972, 319, 3300, 2556, 1248, 1596, 25, 1959, 25, 1828, 2177, 198, 198, 31, 9800, 25, 5391, 270, 2442...
2.793651
378
# token.py """ Holds different grammar and syntax token classes """ # regexes from library to recognize numbers from tokenize import Floatnumber, Intnumber, Name, group, _compile from dataclasses import dataclass as struct from dataclasses import field op_token_types = { '.': 'DOT', '..': 'RANGE_INCL', '...': 'RANGE_EXCL', '-': 'MINUS', '+': 'PLUS', '->': 'RARROW' } @struct if __name__ == "__main__": print(Token('->', op_token_types.get('->', TokenType.OP)))
[ 2, 11241, 13, 9078, 198, 198, 37811, 198, 39, 10119, 1180, 23491, 290, 15582, 11241, 6097, 198, 37811, 198, 198, 2, 40364, 274, 422, 5888, 284, 7564, 3146, 198, 6738, 11241, 1096, 1330, 48436, 17618, 11, 2558, 17618, 11, 6530, 11, 144...
2.60733
191
"""Test suite for the bioidtracker package."""
[ 37811, 14402, 18389, 329, 262, 13401, 312, 2213, 10735, 5301, 526, 15931, 198 ]
3.615385
13
''' Copyright 2017 Linyi Cheng Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ''' from flask import Flask from flask import render_template # required to return templates from flask import request # required to receive form data app = Flask(__name__) @app.route('/') @app.route('/html') @app.route('/template') @app.route('/form') @app.route('/postForm', methods=['POST']) @app.route('/prettyForm') if __name__ == '__main__': app.run()
[ 7061, 6, 198, 15269, 2177, 406, 3541, 72, 27692, 198, 198, 5990, 3411, 318, 29376, 7520, 11, 1479, 286, 3877, 11, 284, 597, 1048, 16727, 257, 4866, 286, 428, 3788, 290, 3917, 10314, 3696, 357, 1169, 366, 25423, 12340, 284, 1730, 287, ...
3.759894
379
# -*- coding: utf-8 -*- from .fritzconnection import ( FritzConnection, FritzInspection, print_servicenames, print_api, ) from .fritzhosts import ( FritzHosts, print_hosts, ) from .fritzstatus import ( FritzStatus, print_status, )
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 198, 6738, 764, 69, 29574, 38659, 1330, 357, 198, 220, 220, 220, 45954, 32048, 11, 198, 220, 220, 220, 45954, 818, 31308, 11, 198, 220, 220, 220, 3601, 62, 3168, 291, ...
2.357143
112
from __future__ import print_function import argparse import sys import torch import torch.utils.data from torch import nn, optim from torch.nn import functional as F import scipy.io as sio import numpy as np from torch.utils.data.dataset import Dataset import matplotlib.pyplot as plt import matplotlib import scipy.linalg as spalg # Argument parser # Post-Nonlinear Multiview Model #input_dims: array, each element is the feature size of the corresponding view #f_size: array, network structure of f_{NN} function #g_size: array, network structure of g_{NN} function #latent_d: scalar, the latent dimision # encoding function # decoding function # Loss function # Training function # Normalize for better visualization # Dataset class if __name__ == "__main__": main(sys.argv[1:])
[ 6738, 11593, 37443, 834, 1330, 3601, 62, 8818, 198, 11748, 1822, 29572, 198, 11748, 25064, 198, 11748, 28034, 198, 11748, 28034, 13, 26791, 13, 7890, 198, 6738, 28034, 1330, 299, 77, 11, 6436, 198, 6738, 28034, 13, 20471, 1330, 10345, 3...
3.153257
261
import sys,os # import the nielsenreader import nielsenreader as nielsen from nielsenreader import read_all_data_new # where to read and write from read_dir = os.path.abspath(os.path.expanduser('~') + '/Cereal/') outfile=read_dir+'/raw-cereal-all' # Specify which dmas /modules /columns to keep dmas=[506,517,556, 602, 751,753] module_code=1344 our_cols=['dma_code','retailer_code','store_code_uc','week_end','upc','upc_ver_uc','units','price','feature','display'] # process all of the data and write the parquet and HDF5 files read_all_data_new(read_dir,outfile,statelist=None,dmalist=dmas,module_code=module_code,channel_filter=['F'],cols=our_cols) # read in the data frame df=nielsen.read_parquet_groups(outfile+'.parquet',col_list=our_cols) # read in with a custom read function # this collapses each row_group to chain level before combining some_cols=['dma_code','retailer_code','week_end','upc','upc_ver_uc','units','price'] df_chain=nielsen.read_parquet_groups(outfile+'.parquet',col_list=some_cols,read_func=wrapper_read_chain_prices)
[ 11748, 25064, 11, 418, 198, 198, 2, 1330, 262, 37628, 25328, 46862, 198, 11748, 37628, 25328, 46862, 355, 37628, 25328, 198, 6738, 37628, 25328, 46862, 1330, 1100, 62, 439, 62, 7890, 62, 3605, 198, 198, 2, 810, 284, 1100, 290, 3551, 4...
2.722798
386
import os import sys import random import string import bosk from bosk.management.commands.base import BaseCommand class Command(BaseCommand): """ """
[ 11748, 28686, 198, 11748, 25064, 198, 11748, 4738, 198, 11748, 4731, 198, 198, 11748, 37284, 74, 198, 6738, 37284, 74, 13, 27604, 13, 9503, 1746, 13, 8692, 1330, 7308, 21575, 628, 198, 4871, 9455, 7, 14881, 21575, 2599, 198, 220, 220, ...
2.932203
59
# -*- coding: utf-8 -*- """ Created on Sat Apr 20 23:39:43 2019 @author: Syed Waleed Hyder """ timeA = int(input("Enter hours for Person A completes the task: ")) timeB = int(input("Enter hours for Person B completes the task: ")) print("Person A completes the task in {} hours".format(timeA)) print("Person B completes the task in {} hours".format(timeB)) total_time =round(time_work_together(timeA, timeB), 3) print("Person A and B complete the task in {} hours".format(total_time))
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 37811, 198, 41972, 319, 7031, 2758, 1160, 2242, 25, 2670, 25, 3559, 13130, 198, 198, 31, 9800, 25, 1632, 276, 370, 1000, 276, 47660, 198, 37811, 198, 198, 2435, 32, 79...
3.141935
155
try: import uasyncio as asyncio except ImportError: import asyncio # Condition class # from primitives.condition import Condition
[ 28311, 25, 198, 220, 220, 220, 1330, 334, 292, 13361, 952, 355, 30351, 952, 198, 16341, 17267, 12331, 25, 198, 220, 220, 220, 1330, 30351, 952, 198, 198, 2, 24295, 1398, 198, 2, 422, 2684, 20288, 13, 31448, 1330, 24295, 198 ]
3.390244
41
from profiles.models import QuotaBinding from Squest.utils.squest_filter import SquestFilter
[ 6738, 16545, 13, 27530, 1330, 2264, 4265, 33, 6020, 198, 6738, 5056, 395, 13, 26791, 13, 82, 6138, 62, 24455, 1330, 5056, 395, 22417, 628 ]
3.76
25
import argparse import bot3 import datetime import praw3 as praw import random import sqlite3 import string import subprocess import sys import time import tkinter import traceback import types from voussoirkit import betterhelp from voussoirkit import mutables from voussoirkit import operatornotify from voussoirkit import pipeable from voussoirkit import sqlhelpers from voussoirkit import vlogging log = vlogging.getLogger(__name__, 'sb') USERAGENT = ''' /u/GoldenSights SubredditBirthdays data collection: Gathering the creation dates of subreddits for visualization. More at https://github.com/voussoir/reddit/tree/master/SubredditBirthdays '''.replace('\n', ' ').strip() LOWERBOUND_STR = '2qh0j' LOWERBOUND_INT = 4594339 FORMAT_MEMBER = '{idstr:>5s}, {human}, {nsfw}, {name:<25s} {subscribers:>10,}' FORMAT_MESSAGE_NEW = 'New: {idstr:>5s} : {human} : {nsfw} : {name} : {subscribers}' FORMAT_MESSAGE_UPDATE = 'Upd: {idstr:>5s} : {human} : {nsfw} : {name} : {subscribers} ({subscriber_diff})' RANKS_UP_TO = 20000 # For the files sorted by subscriber count, display ranks up to this many. GOODCHARS = string.ascii_letters + string.digits + '_' DB_INIT = ''' BEGIN; -------------------------------------------------------------------------------- CREATE TABLE IF NOT EXISTS subreddits( idint INT, idstr TEXT, created INT, human TEXT, name TEXT, nsfw INT, subscribers INT, jumble INT, subreddit_type INT, submission_type INT, last_scanned INT ); CREATE INDEX IF NOT EXISTS index_subreddits_idstr ON subreddits(idstr); CREATE INDEX IF NOT EXISTS index_subreddits_name ON subreddits(name); CREATE INDEX IF NOT EXISTS index_subreddits_created ON subreddits(created); CREATE INDEX IF NOT EXISTS index_subreddits_subscribers ON subreddits(subscribers); --CREATE INDEX IF NOT EXISTS index_subreddits_idint ON subreddits(idint); --CREATE INDEX IF NOT EXISTS index_subreddits_last_scanned ON subreddits(last_scanned); -------------------------------------------------------------------------------- CREATE TABLE IF NOT EXISTS suspicious( idint INT, idstr TEXT, name TEXT, subscribers INT, noticed INT ); -------------------------------------------------------------------------------- CREATE TABLE IF NOT EXISTS popular( idstr TEXT, last_seen INT ); CREATE INDEX IF NOT EXISTS index_popular_idstr on popular(idstr); CREATE INDEX IF NOT EXISTS index_popular_last_seen on popular(last_seen); -------------------------------------------------------------------------------- CREATE TABLE IF NOT EXISTS jumble( idstr TEXT, last_seen INT ); CREATE INDEX IF NOT EXISTS index_jumble_idstr on jumble(idstr); CREATE INDEX IF NOT EXISTS index_jumble_last_seen on jumble(last_seen); -------------------------------------------------------------------------------- COMMIT; ''' sql = sqlite3.connect('D:\\git\\reddit\\subredditbirthdays\\sb.db') sqlhelpers.executescript(conn=sql, script=DB_INIT) cur = sql.cursor() # These numbers are used for interpreting the tuples that come from SELECT SQL_SUBREDDIT_COLUMNS = [ 'idint', 'idstr', 'created', 'human', 'name', 'nsfw', 'subscribers', 'subreddit_type', 'submission_type', 'last_scanned', ] SQL_SUSPICIOUS_COLUMNS = [ 'idint', 'idstr', 'name', 'subscribers', 'noticed', ] SQL_SUBREDDIT = {key: index for (index, key) in enumerate(SQL_SUBREDDIT_COLUMNS)} noinfolist = [] monthnumbers = { 'Jan': '01', 'Feb': '02', 'Mar': '03', 'Apr': '04', 'May': '05', 'Jun': '06', 'Jul': '07', 'Aug': '08', 'Sep': '09', 'Oct': '10', 'Nov': '11', 'Dec': '12', } SUBREDDIT_TYPE = { 'public': 0, 'restricted': 1, 'private': 2, 'archived': 3, None: 4, 'employees_only': 5, 'gold_restricted': 6, 'gold_only': 7, 'user': 8, } SUBMISSION_TYPE = { 'any': 0, 'link': 1, 'self': 2, None: 3, } SUBREDDIT_TYPE_REVERSE = {v: k for (k, v) in SUBREDDIT_TYPE.items()} SUBMISSION_TYPE_REVERSE = {v: k for (k, v) in SUBMISSION_TYPE.items()} SUBMISSION_OBJ = praw.objects.Submission SUBREDDIT_OBJ = praw.objects.Subreddit COMMENT_OBJ = praw.objects.Comment r = None def base36encode(number, alphabet='0123456789abcdefghijklmnopqrstuvwxyz'): '''Converts an integer to a base36 string.''' if not isinstance(number, (int)): raise TypeError('number must be an integer') base36 = '' sign = '' if number < 0: sign = '-' number = -number if 0 <= number < len(alphabet): return sign + alphabet[number] while number != 0: number, i = divmod(number, len(alphabet)) base36 = alphabet[i] + base36 return sign + base36 def normalize_subreddit_object(thing): ''' Given a string, Subreddit, Submission, or Comment object, return a Subreddit object. ''' if isinstance(thing, SUBREDDIT_OBJ): return thing if isinstance(thing, str): return r.get_subreddit(thing) if isinstance(thing, (SUBMISSION_OBJ, COMMENT_OBJ)): return thing.subreddit raise ValueError('Dont know how to normalize', type(thing)) def process( subreddit, commit=True, ): ''' Retrieve the API info for the subreddit and save it to the database subreddit: The subreddit(s) to process. Can be an individual or list of: strings or Subreddit, Submission, or Comment objects. ''' subreddits = [] processed_subreddits = [] if isinstance(subreddit, (tuple, list, set, types.GeneratorType)): subreddits = iter(subreddit) else: subreddits = [subreddit] for subreddit in subreddits: subreddit = normalize_subreddit_object(subreddit) processed_subreddits.append(subreddit) created = subreddit.created_utc created_human = humanize(subreddit.created_utc) idstr = subreddit.id is_nsfw = int(subreddit.over18 or 0) name = subreddit.display_name subscribers = subreddit.subscribers or 0 subreddit_type = SUBREDDIT_TYPE[subreddit.subreddit_type] submission_type = SUBMISSION_TYPE[subreddit.submission_type] now = int(get_now()) cur.execute('SELECT * FROM subreddits WHERE idstr == ?', [idstr]) f = cur.fetchone() if f is None: message = FORMAT_MESSAGE_NEW.format( idstr=idstr, human=created_human, nsfw=is_nsfw, name=name, subscribers=subscribers, ) print(message) data = { 'idint': b36(idstr), 'idstr': idstr, 'created': created, 'human': created_human, 'nsfw': is_nsfw, 'name': name, 'subscribers': subscribers, 'subreddit_type': subreddit_type, 'submission_type': submission_type, 'last_scanned': now, } (qmarks, bindings) = sqlhelpers.insert_filler(SQL_SUBREDDIT_COLUMNS, data) query = 'INSERT INTO subreddits VALUES(%s)' % qmarks cur.execute(query, bindings) else: old_subscribers = f[SQL_SUBREDDIT['subscribers']] subscriber_diff = subscribers - old_subscribers if subscribers == 0 and old_subscribers > 2 and subreddit_type != SUBREDDIT_TYPE['private']: print('SUSPICIOUS %s' % name) data = { 'idint': b36(idstr), 'idstr': idstr, 'name': name, 'subscribers': old_subscribers, 'noticed': int(get_now()), } (qmarks, bindings) = sqlhelpers.insert_filler(SQL_SUSPICIOUS_COLUMNS, data) query = 'INSERT INTO suspicious VALUES(%s)' % qmarks cur.execute(query, bindings) message = FORMAT_MESSAGE_UPDATE.format( idstr=idstr, human=created_human, nsfw=is_nsfw, name=name, subscribers=subscribers, subscriber_diff=subscriber_diff ) print(message) data = { 'idstr': idstr, 'subscribers': subscribers, 'subreddit_type': subreddit_type, 'submission_type': submission_type, 'last_scanned': now, } (query, bindings) = sqlhelpers.update_filler(data, where_key='idstr') query = 'UPDATE subreddits %s' % query cur.execute(query, bindings) #cur.execute(''' # UPDATE subreddits SET # subscribers = @subscribers, # subreddit_type = @subreddit_type, # submission_type = @submission_type, # last_scanned = @last_scanned # WHERE idstr == @idstr # ''', data) processed_subreddits.append(subreddit) if commit: sql.commit() return processed_subreddits def processmega(srinput, isrealname=False, chunksize=100, docrash=False, commit=True): ''' `srinput` can be a list of subreddit IDs or fullnames, or display names if `isrealname` is also True. isrealname: Interpret `srinput` as a list of actual subreddit names, not IDs. chunksize: The number of fullnames to get from api/info at once. docrash: If False, ignore HTTPExceptions and keep moving forward. ''' global noinfolist if type(srinput) == str: srinput = srinput.replace(' ', '') srinput = srinput.split(',') if isrealname: for subname in srinput: process(subname) return processed_subreddits = [] remaining = len(srinput) for x in range(len(srinput)): if 't5_' not in srinput[x]: srinput[x] = 't5_' + srinput[x] srinput = chunklist(srinput, chunksize) for subset in srinput: try: print(subset[0] + ' - ' + subset[-1], remaining) subreddits = r.get_info(thing_id=subset) try: for sub in subreddits: processed_subreddits.extend(process(sub, commit=commit)) except TypeError: traceback.print_exc() noinfolist = subset[:] if len(noinfolist) == 1: print('Received no info. See variable `noinfolist`') else: #for item in noinfolist: # processmega([item]) pass remaining -= len(subset) except praw.errors.HTTPException as e: traceback.print_exc() print(vars(e)) if docrash: raise return processed_subreddits def processrand(count, doublecheck=False, sleepy=0): ''' Gets random IDs between a known lower bound and the newest collection, and pass them into processmega(). count: How many you want doublecheck: Should it reroll duplicates before running sleepy: Used to sleep longer than the required 2 seconds ''' lower = LOWERBOUND_INT cur.execute('SELECT * FROM subreddits ORDER BY idstr DESC LIMIT 1') upper = cur.fetchone()[SQL_SUBREDDIT['idstr']] print('<' + b36(lower) + ',', upper + '>', end=', ') upper = b36(upper) totalpossible = upper - lower print(totalpossible, 'possible') rands = set() for x in range(count): rand = random.randint(lower, upper) rand = b36(rand) if doublecheck: while rand in rands: rand = random.randint(lower, upper) rand = b36(rand) rands.add(rand) processmega(rands) def search( query='', casesense=False, filterout=[], subscribers=0, nsfwmode=2, doreturn=False, sort=None, ): ''' Search for a subreddit by name *str query = The search query "query" = results where "query" is in the name "*query" = results where "query" is at the end of the name "query*" = results where "query" is at the beginning of the name "*query*" = results where "query" is in the middle of the name bool casesense = is the search case sensitive list filterout = [list, of, words] to omit from search. Follows casesense int subscribers = minimum number of subscribers int nsfwmode = 0 - Clean only 1 - Dirty only 2 - All int sort = The integer representing the sql column to sort by. Defaults to no sort. ''' querys = ''.join([c for c in query if c in GOODCHARS]) queryx = '%%{term}%%'.format(term=querys) if '!' in query: cur.execute('SELECT * FROM subreddits WHERE name LIKE ?', [querys]) return cur.fetchone() if nsfwmode in [0, 1]: cur.execute('SELECT * FROM subreddits WHERE name LIKE ? AND subscribers > ? AND nsfw=?', [queryx, subscribers, nsfwmode]) else: cur.execute('SELECT * FROM subreddits WHERE name LIKE ? AND subscribers > ?', [queryx, subscribers]) results = [] if casesense is False: querys = querys.lower() filterout = [x.lower() for x in filterout] if '*' in query: positional = True front = query[-1] == '*' back = query[0] == '*' if front and back: mid = True front = False back = False else: mid = False else: positional = False lenq = len(querys) for item in fetchgenerator(cur): name = item[SQL_SUBREDDIT['name']] if casesense is False: name = name.lower() if querys not in name: #print('%s not in %s' % (querys, name)) continue if (positional and front) and (name[:lenq] != querys): #print('%s not front %s (%s)' % (querys, name, name[:lenq])) continue if (positional and back) and (name[-lenq:] != querys): #print('%s not back %s (%s)' % (querys, name, name[-lenq:])) continue if (positional and mid) and (querys not in name[1:-1]): #print('%s not mid %s (%s)' % (querys, name, name[1:-1])) continue if any(filters in name for filters in filterout): #print('%s not filter %s' % (querys, name)) continue results.append(item) if len(results) == 0: if doreturn: return [] else: return if sort is not None: is_numeric = isinstance(results[0][sort], int) if is_numeric: results.sort(key=lambda x: x[sort], reverse=True) else: results.sort(key=lambda x: x[sort].lower()) if doreturn is True: return results else: for item in results: print(item) def plotbars( filename, inputdata, upperlabel='Subreddits created', colorbg="#fff", colorfg="#000", colormid="#888", forcezero=False, ): ''' Create postscript vectors of data filename = Name of the file without extension inputdata = A list of two lists. First list has the x axis labels, second list has the y axis data. x label 14 coresponds to y datum 14, etc. ''' print(' Printing', filename) t=tkinter.Tk() canvas = tkinter.Canvas(t, width=3840, height=2160, bg=colorbg) canvas.pack() #Y axis canvas.create_line(430, 250, 430, 1755, width=10, fill=colorfg) #X axis canvas.create_line(430, 1750, 3590, 1750, width=10, fill=colorfg) dkeys = inputdata[0] dvals = inputdata[1] entrycount = len(dkeys) availablespace = 3140 availableheight= 1490 entrywidth = availablespace / entrycount #print(dkeys, dvals, "Width:", entrywidth) smallest = min(dvals) bottom = int(smallest*0.75) - 5 bottom = 0 if bottom < 8 else rounded(bottom, 10) if forcezero: bottom = 0 largest = max(dvals) top = int(largest + (largest / 5)) top = rounded(top, 10) print(bottom, top) span = top - bottom perpixel = span / availableheight curx = 445 cury = 1735 labelx = 420 labely = 255 #canvas.create_text(labelx, labely, text=str(top), font=("Consolas", 72), anchor="e") labelspan = 130 canvas.create_text(175, 100, text=upperlabel, font=("Consolas", 72), anchor="w", fill=colorfg) for x in range(12): value = int(top -((labely - 245) * perpixel)) value = rounded(value, 10) value = '{0:,}'.format(value) canvas.create_text(labelx, labely, text=value, font=("Consolas", 72), anchor="e", fill=colorfg) canvas.create_line(430, labely, 3590, labely, width=2, fill=colormid) labely += labelspan for entrypos in range(entrycount): entry = dkeys[entrypos] entryvalue = dvals[entrypos] entryx0 = curx + 10 entryx1 = entryx0 + (entrywidth-10) curx += entrywidth entryy0 = cury entryy1 = entryvalue - bottom entryy1 = entryy1/perpixel #entryy1 -= bottom #entryy1 /= perpixel entryy1 = entryy0 - entryy1 #print(perpixel, entryy1) #print(entry, entryx0,entryy0, entryx1, entryy1) canvas.create_rectangle(entryx0, entryy0, entryx1, entryy1, fill=colorfg, outline=colorfg) font0x = entryx0 + (entrywidth / 2) font0y = entryy1 - 5 font1y = 1760 entryvalue = round(entryvalue) fontsize0 = len(str(entryvalue)) fontsize0 = round(entrywidth / fontsize0) + 3 fontsize0 = 100 if fontsize0 > 100 else fontsize0 fontsize1 = len(str(entry)) fontsize1 = round(1.5 * entrywidth / fontsize1) + 5 fontsize1 = 60 if fontsize1 > 60 else fontsize1 canvas.create_text(font0x, font0y, text=entryvalue, font=("Consolas", fontsize0), anchor="s", fill=colorfg) canvas.create_text(font0x, font1y, text=entry, font=("Consolas", fontsize1), anchor="n", fill=colorfg) canvas.update() print(' Done') canvas.postscript(file=f'spooky\\{filename}.ps', width=3840, height=2160) t.geometry("1x1+1+1") t.update() t.destroy() # Command line ##################################################################################### DOCSTRING = ''' Subreddit Birthdays =================== {modernize_forever} {modernize_once} ''' SUB_DOCSTRINGS = dict( modernize_forever=''' modernize_forever: Gather new subreddits forever. ''', modernize_once=''' modernize_once: Gather new subreddits once. ''', ) DOCSTRING = betterhelp.add_previews(DOCSTRING, SUB_DOCSTRINGS) NOTIFY_EVERY_LINE = mutables.Boolean(False) @pipeable.ctrlc_return1 @pipeable.ctrlc_return1 @operatornotify.main_decorator(subject='sb', notify_every_line=NOTIFY_EVERY_LINE) @vlogging.main_decorator if __name__ == '__main__': raise SystemExit(main(sys.argv[1:]))
[ 11748, 1822, 29572, 198, 11748, 10214, 18, 198, 11748, 4818, 8079, 198, 11748, 279, 1831, 18, 355, 279, 1831, 198, 11748, 4738, 198, 11748, 44161, 578, 18, 198, 11748, 4731, 198, 11748, 850, 14681, 198, 11748, 25064, 198, 11748, 640, 19...
2.264918
8,463
from django.conf import settings
[ 6738, 42625, 14208, 13, 10414, 1330, 6460, 628 ]
4.25
8
# Generated by Django 3.2.3 on 2021-05-16 17:47 from django.db import migrations
[ 2, 2980, 515, 416, 37770, 513, 13, 17, 13, 18, 319, 33448, 12, 2713, 12, 1433, 1596, 25, 2857, 198, 198, 6738, 42625, 14208, 13, 9945, 1330, 15720, 602, 628 ]
2.766667
30
#!/usr/bin/env python # # Copyright 2020 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import argparse import os import shutil import subprocess import sys import zipfile from util import build_utils if __name__ == '__main__': main(sys.argv[1:])
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 2, 198, 2, 15069, 12131, 383, 18255, 1505, 46665, 13, 1439, 2489, 10395, 13, 198, 2, 5765, 286, 428, 2723, 2438, 318, 21825, 416, 257, 347, 10305, 12, 7635, 5964, 326, 460, 307, 198,...
3.247706
109
import tensorflow as tf import numpy as np from data_generator import DataGenerator import argparse as ap from AttentionLayer import Attention parser = ap.ArgumentParser() parser.add_argument('--train_data', type=str, default="data/interim/SQuAD-v1.1-train_sBERT_embeddings-T.json") parser.add_argument('--val_data', type=str, default="data/interim/SQuAD-v1.1-train_sBERT_embeddings-D.json") parser.add_argument('--checkpoint', type=str, default="data/saved_models/att_model_1") parser.add_argument('--dropout', type=float, default=0.4) parser.add_argument('--batch_size', type=int, default=500) parser.add_argument('--pos_noise', type=float, default=0.03) parser.add_argument('--learn_rate', type=float, default=0.001) parser.add_argument('--neg_samples', type=float, default=0.5) parser.add_argument('--pos_aug_rate', type=int, default=3) parser.add_argument('--pos_sample_weight', type=int, default=3) parser.add_argument('--early_stopping', type=int, default=5) parser.add_argument('--epochs', type=int, default=50) parser.add_argument('--question_noise', type=float, default=0.05) args = parser.parse_args() q_input = tf.keras.layers.Input(shape=(768), name="Question_Input") p_input = tf.keras.layers.Input(shape=(40,768), name="Paragraph_Input") ent_input = tf.keras.layers.Input(shape=(40,1), name="Entity_Score_Input") root_input = tf.keras.layers.Input(shape=(40,1), name="Root_Score_input") q = tf.keras.layers.GaussianNoise(args.question_noise)(q_input) q = tf.keras.backend.l2_normalize(q, axis=1) p = tf.keras.backend.l2_normalize(p_input, axis=2) q = tf.keras.layers.Reshape((1,768))(q) q = tf.keras.layers.Masking(mask_value=-100., name="Question_Masking")(q) p = tf.keras.layers.Masking(mask_value=0., name="Paragraph_Masking")(p) ent = tf.keras.layers.Masking(mask_value=0., name="Entity_Masking")(ent_input) root = tf.keras.layers.Masking(mask_value=0., name="Root_Masking")(root_input) p, scores = Attention(name="Query-Question_Value-Paragraphs", use_scale=True)([q, p]) # scores = tf.where( tf.equal( 0., scores ), -np.inf * tf.ones_like( scores ), scores ) distribution = tf.nn.softmax(scores) q = tf.keras.backend.squeeze(q, axis=1) p = tf.keras.backend.squeeze(p, axis=1) similarity = tf.keras.layers.dot([q, p], axes=1, normalize=True) # similarity = tf.keras.layers.Lambda(lambda x: (x + 1) / 2)(similarity) # temp = tf.keras.backend.placeholder(shape=(None, 1, 1)) # temp = ent[:,0,:] # ent, _ = Attention(name="Entity_Attention", scores=scores)([temp, ent]) # root, _ = Attention(name="Root_Attention", scores=scores)([temp, root]) ent = tf.matmul(distribution, ent) root = tf.matmul(distribution, root) ent = tf.keras.backend.squeeze(ent, axis=1) root = tf.keras.backend.squeeze(root, axis=1) combined = tf.keras.layers.Concatenate()([similarity, ent, root]) pred = tf.keras.layers.Dense(1, activation='sigmoid', input_shape=(3,), name="Output", use_bias=True)(combined) model = tf.keras.Model(inputs=[q_input, p_input, ent_input, root_input], outputs=pred) THRES = 0.5 METRICS = [ tf.keras.metrics.Precision(name='precision', thresholds=THRES), tf.keras.metrics.Recall(name='recall', thresholds=THRES), tf.keras.metrics.TruePositives(name='tp', thresholds=THRES), tf.keras.metrics.FalsePositives(name='fp', thresholds=THRES), tf.keras.metrics.TrueNegatives(name='tn', thresholds=THRES), tf.keras.metrics.FalseNegatives(name='fn', thresholds=THRES), tf.keras.metrics.BinaryAccuracy(name='accuracy', threshold=THRES), ] model.compile(loss=tf.keras.losses.BinaryCrossentropy(), optimizer=tf.keras.optimizers.Adam(learning_rate=args.learn_rate), metrics=METRICS) model.run_eagerly = True model.summary() tf.keras.utils.plot_model(model, show_shapes=True) BATCH_SIZE = args.batch_size train_data = DataGenerator(args.train_data, neg_rate=args.neg_samples, batch_size=BATCH_SIZE, noise=args.pos_noise, pos_aug=args.pos_aug_rate, pos_weight=args.pos_sample_weight) val_data = DataGenerator(args.val_data, neg_rate=args.neg_samples, batch_size=BATCH_SIZE, noise=args.pos_noise, pos_aug=args.pos_aug_rate, pos_weight=args.pos_sample_weight) ckpt = tf.keras.callbacks.ModelCheckpoint(args.checkpoint, verbose=1, save_best_only=True) stopping = tf.keras.callbacks.EarlyStopping(patience=args.early_stopping, verbose=1) model.fit(x=data_gen(train_data), epochs=args.epochs, verbose=1, validation_data=data_gen( val_data), steps_per_epoch=len(train_data), validation_steps=len(val_data), callbacks=[ckpt, stopping])
[ 11748, 11192, 273, 11125, 355, 48700, 198, 11748, 299, 32152, 355, 45941, 198, 6738, 1366, 62, 8612, 1352, 1330, 6060, 8645, 1352, 198, 11748, 1822, 29572, 355, 2471, 198, 6738, 47406, 49925, 1330, 47406, 628, 198, 48610, 796, 2471, 13, ...
2.552795
1,771
from a10sdk.common.A10BaseClass import A10BaseClass class Interface(A10BaseClass): """ :param tunnel_list: {"minItems": 1, "items": {"type": "tunnel"}, "uniqueItems": true, "array": [{"required": ["ifnum"], "properties": {"ip": {"type": "object", "properties": {"generate-membership-query": {"default": 0, "type": "number", "description": "Enable Membership Query", "format": "flag"}, "max-resp-time": {"description": "Max Response Time (Default is 100)", "format": "number", "default": 100, "maximum": 255, "minimum": 1, "type": "number"}, "uuid": {"description": "uuid of the object", "format": "string", "minLength": 1, "modify-not-allowed": 1, "maxLength": 64, "type": "string"}, "generate-membership-query-val": {"description": "1 - 255 (Default is 125)", "format": "number", "default": 125, "maximum": 255, "minimum": 1, "type": "number"}, "address": {"type": "object", "properties": {"ip-cfg": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"ipv4-address": {"type": "string", "description": "IP address", "format": "ipv4-address"}, "optional": true, "ipv4-netmask": {"type": "string", "description": "IP subnet mask", "format": "ipv4-netmask"}}}]}, "dhcp": {"default": 0, "type": "number", "description": "Use DHCP to configure IP address", "format": "flag"}}}}, "$ref": "/axapi/v3/interface/tunnel/{ifnum}/ip"}, "ifnum": {"description": "Tunnel interface number", "format": "number", "type": "number", "maximum": 128, "minimum": 1, "optional": false}, "uuid": {"description": "uuid of the object", "format": "string", "minLength": 1, "modify-not-allowed": 1, "optional": true, "maxLength": 64, "type": "string"}, "ipv6": {"type": "object", "properties": {"address-cfg": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"link-local": {"default": 0, "type": "number", "description": "Configure an IPv6 link local address", "format": "flag"}, "anycast": {"default": 0, "type": "number", "description": "Configure an IPv6 anycast address", "format": "flag"}, "ipv6-addr": {"type": "string", "description": "Set the IPv6 address of an interface", "format": "ipv6-address-plen"}, "optional": true}}]}, "ipv6-enable": {"default": 0, "type": "number", "description": "Enable IPv6 processing", "format": "flag"}, "uuid": {"description": "uuid of the object", "format": "string", "minLength": 1, "modify-not-allowed": 1, "maxLength": 64, "type": "string"}}, "$ref": "/axapi/v3/interface/tunnel/{ifnum}/ipv6"}}}], "type": "array", "$ref": "/axapi/v3/interface/tunnel/{ifnum}"} :param trunk_list: {"minItems": 1, "items": {"type": "trunk"}, "uniqueItems": true, "array": [{"required": ["ifnum"], "properties": {"icmp-rate-limit": {"type": "object", "properties": {"lockup": {"description": "Enter lockup state when ICMP rate exceeds lockup rate limit (Maximum rate limit. If exceeds this limit, drop all ICMP packet for a time period)", "minimum": 1, "type": "number", "maximum": 65535, "format": "number"}, "lockup-period": {"description": "Maximum rate limit. If exceeds this limit, drop all ICMP packet for a time period", "minimum": 1, "type": "number", "maximum": 16383, "format": "number"}, "normal": {"description": "Normal rate limit. If exceeds this limit, drop the ICMP packet that goes over the limit", "minimum": 1, "type": "number", "maximum": 65535, "format": "number"}}}, "isis": {"type": "object", "properties": {"priority-list": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"priority": {"description": "Set priority for Designated Router election (Priority value)", "format": "number", "default": 64, "maximum": 127, "minimum": 0, "type": "number"}, "optional": true, "level": {"enum": ["level-1", "level-2"], "type": "string", "description": "'level-1': Specify priority for level-1 routing; 'level-2': Specify priority for level-2 routing; ", "format": "enum"}}}]}, "retransmit-interval": {"description": "Set per-LSP retransmission interval (Interval between retransmissions of the same LSP (seconds))", "format": "number", "default": 5, "maximum": 65535, "minimum": 0, "type": "number"}, "hello-interval-minimal-list": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"hello-interval-minimal": {"default": 0, "type": "number", "description": "Set Hello holdtime 1 second, interval depends on multiplier", "format": "flag"}, "optional": true, "level": {"enum": ["level-1", "level-2"], "type": "string", "description": "'level-1': Specify hello-interval for level-1 IIHs; 'level-2': Specify hello-interval for level-2 IIHs; ", "format": "enum"}}}]}, "mesh-group": {"type": "object", "properties": {"value": {"description": "Mesh group number", "format": "number", "maximum": 4294967295, "minimum": 1, "not": "blocked", "type": "number"}, "blocked": {"default": 0, "not": "value", "type": "number", "description": "Block LSPs on this interface", "format": "flag"}}}, "network": {"enum": ["broadcast", "point-to-point"], "type": "string", "description": "'broadcast': Specify IS-IS broadcast multi-access network; 'point-to-point': Specify IS-IS point-to-point network; ", "format": "enum"}, "bfd-cfg": {"type": "object", "properties": {"disable": {"default": 0, "type": "number", "description": "Disable BFD", "format": "flag"}, "bfd": {"default": 0, "type": "number", "description": "Bidirectional Forwarding Detection (BFD)", "format": "flag"}}}, "lsp-interval": {"description": "Set LSP transmission interval (LSP transmission interval (milliseconds))", "format": "number", "default": 33, "maximum": 4294967295, "minimum": 1, "type": "number"}, "padding": {"default": 1, "type": "number", "description": "Add padding to IS-IS hello packets", "format": "flag"}, "password-list": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"password": {"minLength": 1, "maxLength": 254, "type": "string", "description": "Configure the authentication password for interface", "format": "string-rlx"}, "optional": true, "level": {"enum": ["level-1", "level-2"], "type": "string", "description": "'level-1': Specify password for level-1 PDUs; 'level-2': Specify password for level-2 PDUs; ", "format": "enum"}}}]}, "authentication": {"type": "object", "properties": {"key-chain-list": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"key-chain": {"minLength": 1, "maxLength": 128, "type": "string", "description": "Authentication key-chain (Name of key-chain)", "format": "string"}, "optional": true, "level": {"enum": ["level-1", "level-2"], "type": "string", "description": "'level-1': Specify authentication key-chain for level-1 PDUs; 'level-2': Specify authentication key-chain for level-2 PDUs; ", "format": "enum"}}}]}, "mode-list": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"optional": true, "mode": {"enum": ["md5"], "type": "string", "description": "'md5': Keyed message digest; ", "format": "enum"}, "level": {"enum": ["level-1", "level-2"], "type": "string", "description": "'level-1': Specify authentication mode for level-1 PDUs; 'level-2': Specify authentication mode for level-2 PDUs; ", "format": "enum"}}}]}, "send-only-list": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"send-only": {"default": 0, "type": "number", "description": "Authentication send-only", "format": "flag"}, "optional": true, "level": {"enum": ["level-1", "level-2"], "type": "string", "description": "'level-1': Specify authentication send-only for level-1 PDUs; 'level-2': Specify authentication send-only for level-2 PDUs; ", "format": "enum"}}}]}}}, "wide-metric-list": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"optional": true, "wide-metric": {"description": "Configure the wide metric for interface", "format": "number", "default": 10, "maximum": 16777214, "minimum": 1, "type": "number"}, "level": {"enum": ["level-1", "level-2"], "type": "string", "description": "'level-1': Apply metric to level-1 links; 'level-2': Apply metric to level-2 links; ", "format": "enum"}}}]}, "hello-interval-list": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"optional": true, "hello-interval": {"description": "Set Hello interval in seconds (Hello interval value)", "format": "number", "default": 10, "maximum": 65535, "minimum": 1, "type": "number"}, "level": {"enum": ["level-1", "level-2"], "type": "string", "description": "'level-1': Specify hello-interval for level-1 IIHs; 'level-2': Specify hello-interval for level-2 IIHs; ", "format": "enum"}}}]}, "circuit-type": {"default": "level-1-2", "enum": ["level-1", "level-1-2", "level-2-only"], "type": "string", "description": "'level-1': Level-1 only adjacencies are formed; 'level-1-2': Level-1-2 adjacencies are formed; 'level-2-only': Level-2 only adjacencies are formed; ", "format": "enum"}, "hello-multiplier-list": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"optional": true, "hello-multiplier": {"description": "Set multiplier for Hello holding time (Hello multiplier value)", "format": "number", "default": 3, "maximum": 100, "minimum": 2, "type": "number"}, "level": {"enum": ["level-1", "level-2"], "type": "string", "description": "'level-1': Specify hello multiplier for level-1 IIHs; 'level-2': Specify hello multiplier for level-2 IIHs; ", "format": "enum"}}}]}, "metric-list": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"metric": {"description": "Configure the metric for interface (Default metric)", "format": "number", "default": 10, "maximum": 63, "minimum": 1, "type": "number"}, "optional": true, "level": {"enum": ["level-1", "level-2"], "type": "string", "description": "'level-1': Apply metric to level-1 links; 'level-2': Apply metric to level-2 links; ", "format": "enum"}}}]}, "csnp-interval-list": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"level": {"enum": ["level-1", "level-2"], "type": "string", "description": "'level-1': Speficy interval for level-1 CSNPs; 'level-2': Specify interval for level-2 CSNPs; ", "format": "enum"}, "optional": true, "csnp-interval": {"description": "Set CSNP interval in seconds (CSNP interval value)", "format": "number", "default": 10, "maximum": 65535, "minimum": 1, "type": "number"}}}]}, "uuid": {"description": "uuid of the object", "format": "string", "minLength": 1, "modify-not-allowed": 1, "maxLength": 64, "type": "string"}}, "$ref": "/axapi/v3/interface/trunk/{ifnum}/isis"}, "name": {"description": "Name for the interface", "format": "string-rlx", "minLength": 1, "optional": true, "maxLength": 32, "type": "string"}, "trap-source": {"description": "The trap source", "partition-visibility": "shared", "default": 0, "type": "number", "format": "flag", "optional": true}, "bfd": {"type": "object", "properties": {"uuid": {"description": "uuid of the object", "format": "string", "minLength": 1, "modify-not-allowed": 1, "maxLength": 64, "type": "string"}, "authentication": {"type": "object", "properties": {"encrypted": {"type": "encrypted", "description": "Do NOT use this option manually. (This is an A10 reserved keyword.) (The ENCRYPTED password string)", "format": "encrypted"}, "password": {"minLength": 1, "maxLength": 16, "type": "string", "description": "Key String", "format": "password"}, "method": {"enum": ["md5", "meticulous-md5", "meticulous-sha1", "sha1", "simple"], "type": "string", "description": "'md5': Keyed MD5; 'meticulous-md5': Meticulous Keyed MD5; 'meticulous-sha1': Meticulous Keyed SHA1; 'sha1': Keyed SHA1; 'simple': Simple Password; ", "format": "enum"}, "key-id": {"description": "Key ID", "minimum": 0, "type": "number", "maximum": 255, "format": "number"}}}, "demand": {"default": 0, "type": "number", "description": "Demand mode", "format": "flag"}, "interval-cfg": {"type": "object", "properties": {"interval": {"description": "Transmit interval between BFD packets (Milliseconds)", "minimum": 48, "type": "number", "maximum": 1000, "format": "number"}, "min-rx": {"description": "Minimum receive interval capability (Milliseconds)", "minimum": 48, "type": "number", "maximum": 1000, "format": "number"}, "multiplier": {"description": "Multiplier value used to compute holddown (value used to multiply the interval)", "minimum": 3, "type": "number", "maximum": 50, "format": "number"}}}, "echo": {"default": 0, "type": "number", "description": "Enable BFD Echo", "format": "flag"}}, "$ref": "/axapi/v3/interface/trunk/{ifnum}/bfd"}, "ip": {"type": "object", "properties": {"uuid": {"description": "uuid of the object", "format": "string", "minLength": 1, "modify-not-allowed": 1, "maxLength": 64, "type": "string"}, "generate-membership-query": {"default": 0, "type": "number", "description": "Enable Membership Query", "format": "flag"}, "cache-spoofing-port": {"default": 0, "type": "number", "description": "This interface connects to spoofing cache", "format": "flag"}, "router": {"type": "object", "properties": {"isis": {"type": "object", "properties": {"tag": {"description": "ISO routing area tag", "format": "string", "minLength": 1, "modify-not-allowed": 1, "maxLength": 128, "type": "string"}, "uuid": {"description": "uuid of the object", "format": "string", "minLength": 1, "modify-not-allowed": 1, "maxLength": 64, "type": "string"}}, "$ref": "/axapi/v3/interface/trunk/{ifnum}/ip/router/isis"}}, "$ref": "/axapi/v3/interface/trunk/{ifnum}/ip/router"}, "allow-promiscuous-vip": {"default": 0, "type": "number", "description": "Allow traffic to be associated with promiscuous VIP", "format": "flag"}, "max-resp-time": {"description": "Maximum Response Time (Max Response Time (Default is 100))", "format": "number", "default": 100, "maximum": 255, "minimum": 1, "type": "number"}, "query-interval": {"description": "1 - 255 (Default is 125)", "format": "number", "default": 125, "maximum": 255, "minimum": 1, "type": "number"}, "helper-address-list": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"helper-address": {"type": "string", "description": "Helper address for DHCP packets (IP address)", "format": "ipv4-address"}, "optional": true}}]}, "stateful-firewall": {"type": "object", "properties": {"access-list": {"default": 0, "type": "number", "description": "Access-list for traffic from the outside", "format": "flag"}, "inside": {"default": 0, "type": "number", "description": "Inside (private) interface for stateful firewall", "format": "flag"}, "acl-id": {"description": "ACL id", "minimum": 1, "type": "number", "maximum": 199, "format": "number"}, "outside": {"default": 0, "type": "number", "description": "Outside (public) interface for stateful firewall", "format": "flag"}, "uuid": {"description": "uuid of the object", "format": "string", "minLength": 1, "modify-not-allowed": 1, "maxLength": 64, "type": "string"}}, "$ref": "/axapi/v3/interface/trunk/{ifnum}/ip/stateful-firewall"}, "rip": {"type": "object", "properties": {"receive-cfg": {"type": "object", "properties": {"receive": {"default": 0, "type": "number", "description": "Advertisement reception", "format": "flag"}, "version": {"enum": ["1", "2", "1-2"], "type": "string", "description": "'1': RIP version 1; '2': RIP version 2; '1-2': RIP version 1 & 2; ", "format": "enum"}}}, "uuid": {"description": "uuid of the object", "format": "string", "minLength": 1, "modify-not-allowed": 1, "maxLength": 64, "type": "string"}, "receive-packet": {"default": 1, "type": "number", "description": "Enable receiving packet through the specified interface", "format": "flag"}, "split-horizon-cfg": {"type": "object", "properties": {"state": {"default": "poisoned", "enum": ["poisoned", "disable", "enable"], "type": "string", "description": "'poisoned': Perform split horizon with poisoned reverse; 'disable': Disable split horizon; 'enable': Perform split horizon without poisoned reverse; ", "format": "enum"}}}, "authentication": {"type": "object", "properties": {"key-chain": {"type": "object", "properties": {"key-chain": {"type": "string", "description": "Authentication key-chain (Name of key-chain)", "format": "string-rlx"}}}, "mode": {"type": "object", "properties": {"mode": {"default": "text", "enum": ["md5", "text"], "type": "string", "description": "'md5': Keyed message digest; 'text': Clear text authentication; ", "format": "enum"}}}, "str": {"type": "object", "properties": {"string": {"minLength": 1, "maxLength": 16, "type": "string", "description": "The RIP authentication string", "format": "string-rlx"}}}}}, "send-cfg": {"type": "object", "properties": {"version": {"enum": ["1", "2", "1-compatible", "1-2"], "type": "string", "description": "'1': RIP version 1; '2': RIP version 2; '1-compatible': RIPv1-compatible; '1-2': RIP version 1 & 2; ", "format": "enum"}, "send": {"default": 0, "type": "number", "description": "Advertisement transmission", "format": "flag"}}}, "send-packet": {"default": 1, "type": "number", "description": "Enable sending packets through the specified interface", "format": "flag"}}, "$ref": "/axapi/v3/interface/trunk/{ifnum}/ip/rip"}, "nat": {"type": "object", "properties": {"inside": {"default": 0, "type": "number", "description": "Configure interface as inside", "format": "flag"}, "outside": {"default": 0, "type": "number", "description": "Configure interface as outside", "format": "flag"}}}, "address-list": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"ipv4-address": {"type": "string", "description": "IP address", "format": "ipv4-address"}, "optional": true, "ipv4-netmask": {"type": "string", "description": "IP subnet mask", "format": "ipv4-netmask"}}}]}, "dhcp": {"default": 0, "type": "number", "description": "Use DHCP to configure IP address", "format": "flag"}, "ospf": {"type": "object", "properties": {"ospf-ip-list": {"minItems": 1, "items": {"type": "ospf-ip"}, "uniqueItems": true, "array": [{"required": ["ip-addr"], "properties": {"dead-interval": {"description": "Interval after which a neighbor is declared dead (Seconds)", "format": "number", "default": 40, "optional": true, "maximum": 65535, "minimum": 1, "type": "number"}, "authentication-key": {"description": "Authentication password (key) (The OSPF password (key))", "format": "string-rlx", "minLength": 1, "optional": true, "maxLength": 8, "type": "string"}, "uuid": {"description": "uuid of the object", "format": "string", "minLength": 1, "modify-not-allowed": 1, "optional": true, "maxLength": 64, "type": "string"}, "mtu-ignore": {"default": 0, "optional": true, "type": "number", "description": "Ignores the MTU in DBD packets", "format": "flag"}, "priority": {"description": "Router priority", "format": "number", "default": 1, "optional": true, "maximum": 255, "minimum": 0, "type": "number"}, "transmit-delay": {"description": "Link state transmit delay (Seconds)", "format": "number", "default": 1, "optional": true, "maximum": 65535, "minimum": 1, "type": "number"}, "value": {"optional": true, "enum": ["message-digest", "null"], "type": "string", "description": "'message-digest': Use message-digest authentication; 'null': Use no authentication; ", "format": "enum"}, "hello-interval": {"description": "Time between HELLO packets (Seconds)", "format": "number", "default": 10, "optional": true, "maximum": 65535, "minimum": 1, "type": "number"}, "authentication": {"default": 0, "optional": true, "type": "number", "description": "Enable authentication", "format": "flag"}, "cost": {"description": "Interface cost", "format": "number", "type": "number", "maximum": 65535, "minimum": 1, "optional": true}, "database-filter": {"optional": true, "enum": ["all"], "type": "string", "description": "'all': Filter all LSA; ", "format": "enum"}, "ip-addr": {"optional": false, "type": "string", "description": "Address of interface", "format": "ipv4-address"}, "retransmit-interval": {"description": "Time between retransmitting lost link state advertisements (Seconds)", "format": "number", "default": 5, "optional": true, "maximum": 65535, "minimum": 1, "type": "number"}, "message-digest-cfg": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"md5-value": {"minLength": 1, "maxLength": 16, "type": "string", "description": "The OSPF password (1-16)", "format": "password"}, "message-digest-key": {"description": "Message digest authentication password (key) (Key id)", "minimum": 1, "type": "number", "maximum": 255, "format": "number"}, "optional": true, "encrypted": {"type": "encrypted", "description": "Do NOT use this option manually. (This is an A10 reserved keyword.) (The ENCRYPTED password string)", "format": "encrypted"}}}]}, "out": {"default": 0, "optional": true, "type": "number", "description": "Outgoing LSA", "format": "flag"}}}], "type": "array", "$ref": "/axapi/v3/interface/trunk/{ifnum}/ip/ospf/ospf-ip/{ip-addr}"}, "ospf-global": {"type": "object", "properties": {"dead-interval": {"description": "Interval after which a neighbor is declared dead (Seconds)", "format": "number", "default": 40, "maximum": 65535, "minimum": 1, "type": "number"}, "authentication-key": {"minLength": 1, "maxLength": 8, "type": "string", "description": "Authentication password (key) (The OSPF password (key))", "format": "string-rlx"}, "network": {"type": "object", "properties": {"broadcast": {"default": 0, "not-list": ["non-broadcast", "point-to-point", "point-to-multipoint"], "type": "number", "description": "Specify OSPF broadcast multi-access network", "format": "flag"}, "point-to-multipoint": {"default": 0, "not-list": ["broadcast", "non-broadcast", "point-to-point"], "type": "number", "description": "Specify OSPF point-to-multipoint network", "format": "flag"}, "non-broadcast": {"default": 0, "not-list": ["broadcast", "point-to-point", "point-to-multipoint"], "type": "number", "description": "Specify OSPF NBMA network", "format": "flag"}, "point-to-point": {"default": 0, "not-list": ["broadcast", "non-broadcast", "point-to-multipoint"], "type": "number", "description": "Specify OSPF point-to-point network", "format": "flag"}, "p2mp-nbma": {"default": 0, "type": "number", "description": "Specify non-broadcast point-to-multipoint network", "format": "flag"}}}, "mtu-ignore": {"default": 0, "type": "number", "description": "Ignores the MTU in DBD packets", "format": "flag"}, "retransmit-interval": {"description": "Time between retransmitting lost link state advertisements (Seconds)", "format": "number", "default": 5, "maximum": 65535, "minimum": 1, "type": "number"}, "transmit-delay": {"description": "Link state transmit delay (Seconds)", "format": "number", "default": 1, "maximum": 65535, "minimum": 1, "type": "number"}, "uuid": {"description": "uuid of the object", "format": "string", "minLength": 1, "modify-not-allowed": 1, "maxLength": 64, "type": "string"}, "disable": {"enum": ["all"], "type": "string", "description": "'all': All functionality; ", "format": "enum"}, "authentication-cfg": {"type": "object", "properties": {"authentication": {"default": 0, "type": "number", "description": "Enable authentication", "format": "flag"}, "value": {"enum": ["message-digest", "null"], "type": "string", "description": "'message-digest': Use message-digest authentication; 'null': Use no authentication; ", "format": "enum"}}}, "database-filter-cfg": {"type": "object", "properties": {"database-filter": {"enum": ["all"], "type": "string", "description": "'all': Filter all LSA; ", "format": "enum"}, "out": {"default": 0, "type": "number", "description": "Outgoing LSA", "format": "flag"}}}, "bfd-cfg": {"type": "object", "properties": {"disable": {"default": 0, "type": "number", "description": "Disable BFD", "format": "flag"}, "bfd": {"default": 0, "type": "number", "description": "Bidirectional Forwarding Detection (BFD)", "format": "flag"}}}, "cost": {"description": "Interface cost", "minimum": 1, "type": "number", "maximum": 65535, "format": "number"}, "hello-interval": {"description": "Time between HELLO packets (Seconds)", "format": "number", "default": 10, "maximum": 65535, "minimum": 1, "type": "number"}, "mtu": {"description": "OSPF interface MTU (MTU size)", "minimum": 576, "type": "number", "maximum": 65535, "format": "number"}, "message-digest-cfg": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"message-digest-key": {"description": "Message digest authentication password (key) (Key id)", "minimum": 1, "type": "number", "maximum": 255, "format": "number"}, "optional": true, "md5": {"type": "object", "properties": {"md5-value": {"minLength": 1, "maxLength": 16, "type": "string", "description": "The OSPF password (1-16)", "format": "password"}, "encrypted": {"type": "encrypted", "description": "Do NOT use this option manually. (This is an A10 reserved keyword.) (The ENCRYPTED password string)", "format": "encrypted"}}}}}]}, "priority": {"description": "Router priority", "format": "number", "default": 1, "maximum": 255, "minimum": 0, "type": "number"}}, "$ref": "/axapi/v3/interface/trunk/{ifnum}/ip/ospf/ospf-global"}}, "$ref": "/axapi/v3/interface/trunk/{ifnum}/ip/ospf"}, "slb-partition-redirect": {"default": 0, "type": "number", "description": "Redirect SLB traffic across partition", "format": "flag"}}, "$ref": "/axapi/v3/interface/trunk/{ifnum}/ip"}, "access-list": {"type": "object", "properties": {"acl-name": {"minLength": 1, "maxLength": 16, "type": "string", "description": "Apply an access list (Named Access List)", "format": "string"}, "acl-id": {"description": "ACL id", "format": "number", "maximum": 199, "$ref-list": ["/axapi/v3/access-list/standard", "/axapi/v3/access-list/extended"], "minimum": 1, "type": "number"}}}, "icmpv6-rate-limit": {"type": "object", "properties": {"lockup-period-v6": {"description": "Lockup period (second)", "minimum": 1, "type": "number", "maximum": 16383, "format": "number"}, "normal-v6": {"description": "Normal rate limit. If exceeds this limit, drop the ICMP packet that goes over the limit", "minimum": 1, "type": "number", "maximum": 65535, "format": "number"}, "lockup-v6": {"description": "Enter lockup state when ICMP rate exceeds lockup rate limit (Maximum rate limit. If exceeds this limit, drop all ICMP packet for a time period)", "minimum": 1, "type": "number", "maximum": 65535, "format": "number"}}}, "timer": {"description": "Timer to re-check the threshold under certain conditions (Time in seconds (Default: 10))", "format": "number", "default": 10, "optional": true, "maximum": 300, "minimum": 1, "type": "number"}, "mtu": {"platform-specific-range": 1, "platform-specific-default": 1, "description": "Interface mtu (Interface MTU, default 1500 (min MTU is 1280 for IPv6))", "format": "number", "optional": true, "type": "number"}, "ports-threshold": {"platform-specific-range": 1, "platform-specific-default": 1, "description": "Threshold for the minimum number of ports that need to be UP for the trunk to remain UP", "format": "number", "optional": true, "type": "number"}, "ifnum": {"optional": false, "type": "number", "description": "Trunk interface number", "format": "number"}, "lw-4o6": {"type": "object", "properties": {"outside": {"default": 0, "type": "number", "description": "Configure LW-4over6 inside interface", "format": "flag"}, "inside": {"default": 0, "type": "number", "description": "Configure LW-4over6 outside interface", "format": "flag"}, "uuid": {"description": "uuid of the object", "format": "string", "minLength": 1, "modify-not-allowed": 1, "maxLength": 64, "type": "string"}}, "$ref": "/axapi/v3/interface/trunk/{ifnum}/lw-4o6"}, "do-auto-recovery": {"default": 0, "optional": true, "type": "number", "description": "(Only for LACP trunks) Attempt auto-recovery after ports-treshold is triggered", "format": "flag"}, "ipv6": {"type": "object", "properties": {"uuid": {"description": "uuid of the object", "format": "string", "minLength": 1, "modify-not-allowed": 1, "maxLength": 64, "type": "string"}, "address-list": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"address-type": {"enum": ["anycast", "link-local"], "type": "string", "description": "'anycast': Configure an IPv6 anycast address; 'link-local': Configure an IPv6 link local address; ", "format": "enum"}, "ipv6-addr": {"type": "string", "description": "Set the IPv6 address of an interface", "format": "ipv6-address-plen"}, "optional": true}}]}, "router-adver": {"type": "object", "properties": {"max-interval": {"description": "Set Router Advertisement Max Interval (default: 600) (Min Router Advertisement Interval (seconds))", "format": "number", "default": 600, "maximum": 1800, "minimum": 4, "type": "number"}, "default-lifetime": {"description": "Set Router Advertisement Default Lifetime (default: 1800) (Default Lifetime (seconds))", "format": "number", "default": 1800, "maximum": 9000, "minimum": 0, "type": "number"}, "reachable-time": {"description": "Set Router Advertisement Reachable ime (default: 0) (Reachable Time (milliseconds))", "format": "number", "default": 0, "maximum": 3600000, "minimum": 0, "type": "number"}, "vrid": {"type": "object", "properties": {"use-floating-ip-default-vrid": {"default": 0, "type": "number", "description": "Use a floating IP as the source address for Router advertisements", "format": "flag"}, "adver-vrid": {"description": "Specify ha VRRP-A vrid", "format": "number", "maximum": 31, "minimum": 1, "not": "adver-vrid-default", "type": "number"}, "floating-ip-default-vrid": {"type": "string", "description": "Use a floating IP as the source address for Router advertisements", "format": "ipv6-address"}, "adver-vrid-default": {"default": 0, "not": "adver-vrid", "type": "number", "description": "Default VRRP-A vrid", "format": "flag"}, "floating-ip": {"type": "string", "description": "Use a floating IP as the source address for Router advertisements", "format": "ipv6-address"}, "use-floating-ip": {"default": 0, "type": "number", "description": "Use a floating IP as the source address for Router advertisements", "format": "flag"}}}, "prefix-list": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"not-autonomous": {"default": 0, "type": "number", "description": "Specify that the Prefix is not usable for autoconfiguration (default:autonomous)", "format": "flag"}, "valid-lifetime": {"description": "Specify Valid Lifetime (default:2592000) (Prefix Advertised Valid Lifetime (default: 2592000))", "format": "number", "default": 2592000, "maximum": 4294967295, "minimum": 0, "type": "number"}, "not-on-link": {"default": 0, "type": "number", "description": "Specify that the Prefix is not On-Link (default: on-link)", "format": "flag"}, "prefix": {"type": "string", "description": "Set Router Advertisement On-Link Prefix (IPv6 On-Link Prefix)", "format": "ipv6-address-plen"}, "preferred-lifetime": {"description": "Specify Prefix Preferred Lifetime (default:604800) (Prefix Advertised Preferred Lifetime (default: 604800))", "format": "number", "default": 604800, "maximum": 4294967295, "minimum": 0, "type": "number"}, "optional": true}}]}, "rate-limit": {"description": "Rate Limit the processing of incoming Router Solicitations (Max Number of Router Solicitations to process per second)", "format": "number", "default": 100000, "maximum": 100000, "minimum": 1, "type": "number"}, "mtu": {"type": "object", "properties": {"adver-mtu": {"platform-specific-range": 1, "platform-specific-default": 1, "description": "Set Router Advertisement MTU Option", "format": "number", "not": "adver-mtu-disable", "type": "number"}, "adver-mtu-disable": {"default": 0, "not": "adver-mtu", "type": "number", "description": "Disable Router Advertisement MTU Option", "format": "flag"}}}, "min-interval": {"description": "Set Router Advertisement Min Interval (default: 200) (Max Number of Router Solicitations to process per second)", "format": "number", "default": 200, "maximum": 1350, "minimum": 3, "type": "number"}, "action": {"default": "enable", "enum": ["enable", "disable"], "type": "string", "description": "'enable': Enable Router Advertisements on this interface; 'disable': Disable Router Advertisements on this interface; ", "format": "enum"}, "retransmit-timer": {"description": "Set Router Advertisement Retransmit Timer (default: 0)", "format": "number", "default": 0, "maximum": 4294967295, "minimum": 0, "type": "number"}, "ha-group-id": {"type": "object", "properties": {"ha-use-floating-ip": {"default": 0, "type": "number", "description": "Use a floating IP as the source address for Router advertisements", "format": "flag"}, "adver-ha-group-id": {"description": "HA Group ID", "minimum": 1, "type": "number", "maximum": 31, "format": "number"}, "ha-floating-ip": {"type": "string", "description": "Use a floating IP as the source address for Router advertisements", "format": "ipv6-address"}}}, "hop-limit": {"description": "Set Router Advertisement Hop Limit (default: 255) (Max Router Advertisement Interval (seconds))", "format": "number", "default": 255, "maximum": 255, "minimum": 0, "type": "number"}}}, "rip": {"type": "object", "properties": {"split-horizon-cfg": {"type": "object", "properties": {"state": {"default": "poisoned", "enum": ["poisoned", "disable", "enable"], "type": "string", "description": "'poisoned': Perform split horizon with poisoned reverse; 'disable': Disable split horizon; 'enable': Perform split horizon without poisoned reverse; ", "format": "enum"}}}, "uuid": {"description": "uuid of the object", "format": "string", "minLength": 1, "modify-not-allowed": 1, "maxLength": 64, "type": "string"}}, "$ref": "/axapi/v3/interface/trunk/{ifnum}/ipv6/rip"}, "ipv6-enable": {"default": 0, "type": "number", "description": "Enable IPv6 processing", "format": "flag"}, "stateful-firewall": {"type": "object", "properties": {"access-list": {"default": 0, "type": "number", "description": "Access-list for traffic from the outside", "format": "flag"}, "acl-name": {"minLength": 1, "maxLength": 16, "type": "string", "description": "Access-list Name", "format": "string"}, "inside": {"default": 0, "type": "number", "description": "Inside (private) interface for stateful firewall", "format": "flag"}, "outside": {"default": 0, "type": "number", "description": "Outside (public) interface for stateful firewall", "format": "flag"}, "uuid": {"description": "uuid of the object", "format": "string", "minLength": 1, "modify-not-allowed": 1, "maxLength": 64, "type": "string"}}, "$ref": "/axapi/v3/interface/trunk/{ifnum}/ipv6/stateful-firewall"}, "nat": {"type": "object", "properties": {"inside": {"default": 0, "type": "number", "description": "Configure interface as NAT inside", "format": "flag"}, "outside": {"default": 0, "type": "number", "description": "Configure interface as NAT outside", "format": "flag"}}}, "router": {"type": "object", "properties": {"ripng": {"type": "object", "properties": {"uuid": {"description": "uuid of the object", "format": "string", "minLength": 1, "modify-not-allowed": 1, "maxLength": 64, "type": "string"}, "rip": {"default": 0, "type": "number", "description": "RIP Routing for IPv6", "format": "flag"}}, "$ref": "/axapi/v3/interface/trunk/{ifnum}/ipv6/router/ripng"}, "ospf": {"type": "object", "properties": {"area-list": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"area-id-addr": {"type": "string", "description": "OSPF area ID in IP address format", "format": "ipv4-address"}, "tag": {"minLength": 1, "maxLength": 128, "type": "string", "description": "Set the OSPFv3 process tag", "format": "string"}, "optional": true, "instance-id": {"description": "Set the interface instance ID", "format": "number", "default": 0, "maximum": 255, "minimum": 0, "type": "number"}, "area-id-num": {"description": "OSPF area ID as a decimal value", "minimum": 0, "type": "number", "maximum": 4294967295, "format": "number"}}}]}, "uuid": {"description": "uuid of the object", "format": "string", "minLength": 1, "modify-not-allowed": 1, "maxLength": 64, "type": "string"}}, "$ref": "/axapi/v3/interface/trunk/{ifnum}/ipv6/router/ospf"}, "isis": {"type": "object", "properties": {"tag": {"description": "ISO routing area tag", "format": "string", "minLength": 1, "modify-not-allowed": 1, "maxLength": 128, "type": "string"}, "uuid": {"description": "uuid of the object", "format": "string", "minLength": 1, "modify-not-allowed": 1, "maxLength": 64, "type": "string"}}, "$ref": "/axapi/v3/interface/trunk/{ifnum}/ipv6/router/isis"}}, "$ref": "/axapi/v3/interface/trunk/{ifnum}/ipv6/router"}, "access-list-cfg": {"type": "object", "properties": {"inbound": {"default": 0, "type": "number", "description": "ACL applied on incoming packets to this interface", "format": "flag"}, "v6-acl-name": {"description": "Apply ACL rules to incoming packets on this interface (Named Access List)", "format": "string", "minLength": 1, "maxLength": 16, "type": "string", "$ref": "/axapi/v3/ipv6/access-list"}}}, "ospf": {"type": "object", "properties": {"bfd": {"default": 0, "type": "number", "description": "Bidirectional Forwarding Detection (BFD)", "format": "flag"}, "cost-cfg": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"cost": {"description": "Interface cost", "minimum": 1, "type": "number", "maximum": 65535, "format": "number"}, "optional": true, "instance-id": {"description": "Specify the interface instance ID", "format": "number", "default": 0, "maximum": 255, "minimum": 0, "type": "number"}}}]}, "hello-interval-cfg": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"optional": true, "hello-interval": {"description": "Time between HELLO packets (Seconds)", "format": "number", "default": 10, "maximum": 65535, "minimum": 1, "type": "number"}, "instance-id": {"description": "Specify the interface instance ID", "format": "number", "default": 0, "maximum": 255, "minimum": 0, "type": "number"}}}]}, "disable": {"default": 0, "type": "number", "description": "Disable BFD", "format": "flag"}, "priority-cfg": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"priority": {"description": "Router priority", "format": "number", "default": 1, "maximum": 255, "minimum": 0, "type": "number"}, "optional": true, "instance-id": {"description": "Specify the interface instance ID", "format": "number", "default": 0, "maximum": 255, "minimum": 0, "type": "number"}}}]}, "mtu-ignore-cfg": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"mtu-ignore": {"default": 0, "type": "number", "description": "Ignores the MTU in DBD packets", "format": "flag"}, "optional": true, "instance-id": {"description": "Specify the interface instance ID", "format": "number", "default": 0, "maximum": 255, "minimum": 0, "type": "number"}}}]}, "retransmit-interval-cfg": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"retransmit-interval": {"description": "Time between retransmitting lost link state advertisements (Seconds)", "format": "number", "default": 5, "maximum": 65535, "minimum": 1, "type": "number"}, "optional": true, "instance-id": {"description": "Specify the interface instance ID", "format": "number", "default": 0, "maximum": 255, "minimum": 0, "type": "number"}}}]}, "network-list": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"broadcast-type": {"enum": ["broadcast", "non-broadcast", "point-to-point", "point-to-multipoint"], "type": "string", "description": "'broadcast': Specify OSPF broadcast multi-access network; 'non-broadcast': Specify OSPF NBMA network; 'point-to-point': Specify OSPF point-to-point network; 'point-to-multipoint': Specify OSPF point-to-multipoint network; ", "format": "enum"}, "optional": true, "p2mp-nbma": {"default": 0, "type": "number", "description": "Specify non-broadcast point-to-multipoint network", "format": "flag"}, "network-instance-id": {"description": "Specify the interface instance ID", "format": "number", "default": 0, "maximum": 255, "minimum": 0, "type": "number"}}}]}, "transmit-delay-cfg": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"optional": true, "transmit-delay": {"description": "Link state transmit delay (Seconds)", "format": "number", "default": 1, "maximum": 65535, "minimum": 1, "type": "number"}, "instance-id": {"description": "Specify the interface instance ID", "format": "number", "default": 0, "maximum": 255, "minimum": 0, "type": "number"}}}]}, "neighbor-cfg": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"neighbor-priority": {"description": "OSPF priority of non-broadcast neighbor", "minimum": 0, "type": "number", "maximum": 255, "format": "number"}, "neig-inst": {"description": "Specify the interface instance ID", "format": "number", "default": 0, "maximum": 255, "minimum": 0, "type": "number"}, "neighbor-poll-interval": {"description": "OSPF dead-router polling interval (Seconds)", "minimum": 0, "type": "number", "maximum": 4294967295, "format": "number"}, "neighbor-cost": {"description": "OSPF cost for point-to-multipoint neighbor (metric)", "minimum": 1, "type": "number", "maximum": 65535, "format": "number"}, "neighbor": {"default": "::", "type": "string", "description": "OSPFv3 neighbor (Neighbor IPv6 address)", "format": "ipv6-address"}, "optional": true}}]}, "dead-interval-cfg": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"dead-interval": {"description": "Interval after which a neighbor is declared dead (Seconds)", "format": "number", "default": 40, "maximum": 65535, "minimum": 1, "type": "number"}, "optional": true, "instance-id": {"description": "Specify the interface instance ID", "format": "number", "default": 0, "maximum": 255, "minimum": 0, "type": "number"}}}]}}, "$ref": "/axapi/v3/interface/trunk/{ifnum}/ipv6/ospf"}}, "$ref": "/axapi/v3/interface/trunk/{ifnum}/ipv6"}, "action": {"optional": true, "enum": ["enable", "disable"], "type": "string", "description": "'enable': Enable; 'disable': Disable; ", "format": "enum"}, "l3-vlan-fwd-disable": {"default": 0, "optional": true, "type": "number", "description": "Disable L3 forwarding between VLANs", "format": "flag"}, "ddos": {"type": "object", "properties": {"outside": {"default": 0, "type": "number", "description": "DDoS inside (trusted) or outside (untrusted) interface", "format": "flag"}, "inside": {"default": 0, "type": "number", "description": "DDoS inside (trusted) or outside (untrusted) interface", "format": "flag"}, "uuid": {"description": "uuid of the object", "format": "string", "minLength": 1, "modify-not-allowed": 1, "maxLength": 64, "type": "string"}}, "$ref": "/axapi/v3/interface/trunk/{ifnum}/ddos"}, "uuid": {"description": "uuid of the object", "format": "string", "minLength": 1, "modify-not-allowed": 1, "optional": true, "maxLength": 64, "type": "string"}}}], "type": "array", "$ref": "/axapi/v3/interface/trunk/{ifnum}"} :param ve_list: {"minItems": 1, "items": {"type": "ve"}, "uniqueItems": true, "array": [{"required": ["ifnum"], "properties": {"icmp-rate-limit": {"type": "object", "properties": {"lockup": {"description": "Enter lockup state when ICMP rate exceeds lockup rate limit (Maximum rate limit. If exceeds this limit, drop all ICMP packet for a time period)", "minimum": 1, "type": "number", "maximum": 65535, "format": "number"}, "lockup-period": {"description": "Maximum rate limit. If exceeds this limit, drop all ICMP packet for a time period", "minimum": 1, "type": "number", "maximum": 16383, "format": "number"}, "normal": {"description": "Normal rate limit. If exceeds this limit, drop the ICMP packet that goes over the limit", "minimum": 1, "type": "number", "maximum": 65535, "format": "number"}}}, "isis": {"type": "object", "properties": {"priority-list": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"priority": {"description": "Set priority for Designated Router election (Priority value)", "format": "number", "default": 64, "maximum": 127, "minimum": 0, "type": "number"}, "optional": true, "level": {"enum": ["level-1", "level-2"], "type": "string", "description": "'level-1': Specify priority for level-1 routing; 'level-2': Specify priority for level-2 routing; ", "format": "enum"}}}]}, "retransmit-interval": {"description": "Set per-LSP retransmission interval (Interval between retransmissions of the same LSP (seconds))", "format": "number", "default": 5, "maximum": 65535, "minimum": 0, "type": "number"}, "hello-interval-minimal-list": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"hello-interval-minimal": {"default": 0, "type": "number", "description": "Set Hello holdtime 1 second, interval depends on multiplier", "format": "flag"}, "optional": true, "level": {"enum": ["level-1", "level-2"], "type": "string", "description": "'level-1': Specify hello-interval for level-1 IIHs; 'level-2': Specify hello-interval for level-2 IIHs; ", "format": "enum"}}}]}, "mesh-group": {"type": "object", "properties": {"value": {"description": "Mesh group number", "format": "number", "maximum": 4294967295, "minimum": 1, "not": "blocked", "type": "number"}, "blocked": {"default": 0, "not": "value", "type": "number", "description": "Block LSPs on this interface", "format": "flag"}}}, "network": {"enum": ["broadcast", "point-to-point"], "type": "string", "description": "'broadcast': Specify IS-IS broadcast multi-access network; 'point-to-point': Specify IS-IS point-to-point network; ", "format": "enum"}, "bfd-cfg": {"type": "object", "properties": {"disable": {"default": 0, "type": "number", "description": "Disable BFD", "format": "flag"}, "bfd": {"default": 0, "type": "number", "description": "Bidirectional Forwarding Detection (BFD)", "format": "flag"}}}, "lsp-interval": {"description": "Set LSP transmission interval (LSP transmission interval (milliseconds))", "format": "number", "default": 33, "maximum": 4294967295, "minimum": 1, "type": "number"}, "padding": {"default": 1, "type": "number", "description": "Add padding to IS-IS hello packets", "format": "flag"}, "password-list": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"password": {"minLength": 1, "maxLength": 254, "type": "string", "description": "Configure the authentication password for interface", "format": "string-rlx"}, "optional": true, "level": {"enum": ["level-1", "level-2"], "type": "string", "description": "'level-1': Specify password for level-1 PDUs; 'level-2': Specify password for level-2 PDUs; ", "format": "enum"}}}]}, "authentication": {"type": "object", "properties": {"key-chain-list": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"key-chain": {"minLength": 1, "maxLength": 128, "type": "string", "description": "Authentication key-chain (Name of key-chain)", "format": "string"}, "optional": true, "level": {"enum": ["level-1", "level-2"], "type": "string", "description": "'level-1': Specify authentication key-chain for level-1 PDUs; 'level-2': Specify authentication key-chain for level-2 PDUs; ", "format": "enum"}}}]}, "mode-list": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"optional": true, "mode": {"enum": ["md5"], "type": "string", "description": "'md5': Keyed message digest; ", "format": "enum"}, "level": {"enum": ["level-1", "level-2"], "type": "string", "description": "'level-1': Specify authentication mode for level-1 PDUs; 'level-2': Specify authentication mode for level-2 PDUs; ", "format": "enum"}}}]}, "send-only-list": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"send-only": {"default": 0, "type": "number", "description": "Authentication send-only", "format": "flag"}, "optional": true, "level": {"enum": ["level-1", "level-2"], "type": "string", "description": "'level-1': Specify authentication send-only for level-1 PDUs; 'level-2': Specify authentication send-only for level-2 PDUs; ", "format": "enum"}}}]}}}, "wide-metric-list": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"optional": true, "wide-metric": {"description": "Configure the wide metric for interface", "format": "number", "default": 10, "maximum": 16777214, "minimum": 1, "type": "number"}, "level": {"enum": ["level-1", "level-2"], "type": "string", "description": "'level-1': Apply metric to level-1 links; 'level-2': Apply metric to level-2 links; ", "format": "enum"}}}]}, "hello-interval-list": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"optional": true, "hello-interval": {"description": "Set Hello interval in seconds (Hello interval value)", "format": "number", "default": 10, "maximum": 65535, "minimum": 1, "type": "number"}, "level": {"enum": ["level-1", "level-2"], "type": "string", "description": "'level-1': Specify hello-interval for level-1 IIHs; 'level-2': Specify hello-interval for level-2 IIHs; ", "format": "enum"}}}]}, "circuit-type": {"default": "level-1-2", "enum": ["level-1", "level-1-2", "level-2-only"], "type": "string", "description": "'level-1': Level-1 only adjacencies are formed; 'level-1-2': Level-1-2 adjacencies are formed; 'level-2-only': Level-2 only adjacencies are formed; ", "format": "enum"}, "hello-multiplier-list": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"optional": true, "hello-multiplier": {"description": "Set multiplier for Hello holding time (Hello multiplier value)", "format": "number", "default": 3, "maximum": 100, "minimum": 2, "type": "number"}, "level": {"enum": ["level-1", "level-2"], "type": "string", "description": "'level-1': Specify hello multiplier for level-1 IIHs; 'level-2': Specify hello multiplier for level-2 IIHs; ", "format": "enum"}}}]}, "metric-list": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"metric": {"description": "Configure the metric for interface (Default metric)", "format": "number", "default": 10, "maximum": 63, "minimum": 1, "type": "number"}, "optional": true, "level": {"enum": ["level-1", "level-2"], "type": "string", "description": "'level-1': Apply metric to level-1 links; 'level-2': Apply metric to level-2 links; ", "format": "enum"}}}]}, "csnp-interval-list": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"level": {"enum": ["level-1", "level-2"], "type": "string", "description": "'level-1': Speficy interval for level-1 CSNPs; 'level-2': Specify interval for level-2 CSNPs; ", "format": "enum"}, "optional": true, "csnp-interval": {"description": "Set CSNP interval in seconds (CSNP interval value)", "format": "number", "default": 10, "maximum": 65535, "minimum": 1, "type": "number"}}}]}, "uuid": {"description": "uuid of the object", "format": "string", "minLength": 1, "modify-not-allowed": 1, "maxLength": 64, "type": "string"}}, "$ref": "/axapi/v3/interface/ve/{ifnum}/isis"}, "name": {"description": "Name for the interface", "format": "string-rlx", "minLength": 1, "optional": true, "maxLength": 32, "type": "string"}, "trap-source": {"description": "The trap source", "partition-visibility": "shared", "default": 0, "type": "number", "format": "flag", "optional": true}, "bfd": {"type": "object", "properties": {"uuid": {"description": "uuid of the object", "format": "string", "minLength": 1, "modify-not-allowed": 1, "maxLength": 64, "type": "string"}, "authentication": {"type": "object", "properties": {"encrypted": {"type": "encrypted", "description": "Do NOT use this option manually. (This is an A10 reserved keyword.) (The ENCRYPTED password string)", "format": "encrypted"}, "password": {"minLength": 1, "maxLength": 16, "type": "string", "description": "Key String", "format": "password"}, "method": {"enum": ["md5", "meticulous-md5", "meticulous-sha1", "sha1", "simple"], "type": "string", "description": "'md5': Keyed MD5; 'meticulous-md5': Meticulous Keyed MD5; 'meticulous-sha1': Meticulous Keyed SHA1; 'sha1': Keyed SHA1; 'simple': Simple Password; ", "format": "enum"}, "key-id": {"description": "Key ID", "minimum": 0, "type": "number", "maximum": 255, "format": "number"}}}, "demand": {"default": 0, "type": "number", "description": "Demand mode", "format": "flag"}, "interval-cfg": {"type": "object", "properties": {"interval": {"description": "Transmit interval between BFD packets (Milliseconds)", "minimum": 48, "type": "number", "maximum": 1000, "format": "number"}, "min-rx": {"description": "Minimum receive interval capability (Milliseconds)", "minimum": 48, "type": "number", "maximum": 1000, "format": "number"}, "multiplier": {"description": "Multiplier value used to compute holddown (value used to multiply the interval)", "minimum": 3, "type": "number", "maximum": 50, "format": "number"}}}, "echo": {"default": 0, "type": "number", "description": "Enable BFD Echo", "format": "flag"}}, "$ref": "/axapi/v3/interface/ve/{ifnum}/bfd"}, "ip": {"type": "object", "properties": {"uuid": {"description": "uuid of the object", "format": "string", "minLength": 1, "modify-not-allowed": 1, "maxLength": 64, "type": "string"}, "generate-membership-query": {"default": 0, "type": "number", "description": "Enable Membership Query", "format": "flag"}, "address-list": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"ipv4-address": {"type": "string", "description": "IP address", "format": "ipv4-address"}, "optional": true, "ipv4-netmask": {"type": "string", "description": "IP subnet mask", "format": "ipv4-netmask"}}}]}, "inside": {"default": 0, "type": "number", "description": "Configure interface as inside", "format": "flag"}, "allow-promiscuous-vip": {"default": 0, "type": "number", "description": "Allow traffic to be associated with promiscuous VIP", "format": "flag"}, "max-resp-time": {"description": "Maximum Response Time (Max Response Time (Default is 100))", "format": "number", "default": 100, "maximum": 255, "minimum": 1, "type": "number"}, "query-interval": {"description": "1 - 255 (Default is 125)", "format": "number", "default": 125, "maximum": 255, "minimum": 1, "type": "number"}, "outside": {"default": 0, "type": "number", "description": "Configure interface as outside", "format": "flag"}, "helper-address-list": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"helper-address": {"type": "string", "description": "Helper address for DHCP packets (IP address)", "format": "ipv4-address"}, "optional": true}}]}, "stateful-firewall": {"type": "object", "properties": {"access-list": {"default": 0, "type": "number", "description": "Access-list for traffic from the outside", "format": "flag"}, "inside": {"default": 0, "type": "number", "description": "Inside (private) interface for stateful firewall", "format": "flag"}, "acl-id": {"description": "ACL id", "minimum": 1, "type": "number", "maximum": 199, "format": "number"}, "outside": {"default": 0, "type": "number", "description": "Outside (public) interface for stateful firewall", "format": "flag"}, "uuid": {"description": "uuid of the object", "format": "string", "minLength": 1, "modify-not-allowed": 1, "maxLength": 64, "type": "string"}}, "$ref": "/axapi/v3/interface/ve/{ifnum}/ip/stateful-firewall"}, "rip": {"type": "object", "properties": {"receive-cfg": {"type": "object", "properties": {"receive": {"default": 0, "type": "number", "description": "Advertisement reception", "format": "flag"}, "version": {"enum": ["1", "2", "1-2"], "type": "string", "description": "'1': RIP version 1; '2': RIP version 2; '1-2': RIP version 1 & 2; ", "format": "enum"}}}, "uuid": {"description": "uuid of the object", "format": "string", "minLength": 1, "modify-not-allowed": 1, "maxLength": 64, "type": "string"}, "receive-packet": {"default": 1, "type": "number", "description": "Enable receiving packet through the specified interface", "format": "flag"}, "split-horizon-cfg": {"type": "object", "properties": {"state": {"default": "poisoned", "enum": ["poisoned", "disable", "enable"], "type": "string", "description": "'poisoned': Perform split horizon with poisoned reverse; 'disable': Disable split horizon; 'enable': Perform split horizon without poisoned reverse; ", "format": "enum"}}}, "authentication": {"type": "object", "properties": {"key-chain": {"type": "object", "properties": {"key-chain": {"type": "string", "description": "Authentication key-chain (Name of key-chain)", "format": "string-rlx"}}}, "mode": {"type": "object", "properties": {"mode": {"default": "text", "enum": ["md5", "text"], "type": "string", "description": "'md5': Keyed message digest; 'text': Clear text authentication; ", "format": "enum"}}}, "str": {"type": "object", "properties": {"string": {"minLength": 1, "maxLength": 16, "type": "string", "description": "The RIP authentication string", "format": "string-rlx"}}}}}, "send-cfg": {"type": "object", "properties": {"version": {"enum": ["1", "2", "1-compatible", "1-2"], "type": "string", "description": "'1': RIP version 1; '2': RIP version 2; '1-compatible': RIPv1-compatible; '1-2': RIP version 1 & 2; ", "format": "enum"}, "send": {"default": 0, "type": "number", "description": "Advertisement transmission", "format": "flag"}}}, "send-packet": {"default": 1, "type": "number", "description": "Enable sending packets through the specified interface", "format": "flag"}}, "$ref": "/axapi/v3/interface/ve/{ifnum}/ip/rip"}, "router": {"type": "object", "properties": {"isis": {"type": "object", "properties": {"tag": {"description": "ISO routing area tag", "format": "string", "minLength": 1, "modify-not-allowed": 1, "maxLength": 128, "type": "string"}, "uuid": {"description": "uuid of the object", "format": "string", "minLength": 1, "modify-not-allowed": 1, "maxLength": 64, "type": "string"}}, "$ref": "/axapi/v3/interface/ve/{ifnum}/ip/router/isis"}}, "$ref": "/axapi/v3/interface/ve/{ifnum}/ip/router"}, "dhcp": {"default": 0, "type": "number", "description": "Use DHCP to configure IP address", "format": "flag"}, "ospf": {"type": "object", "properties": {"ospf-ip-list": {"minItems": 1, "items": {"type": "ospf-ip"}, "uniqueItems": true, "array": [{"required": ["ip-addr"], "properties": {"dead-interval": {"description": "Interval after which a neighbor is declared dead (Seconds)", "format": "number", "default": 40, "optional": true, "maximum": 65535, "minimum": 1, "type": "number"}, "authentication-key": {"description": "Authentication password (key) (The OSPF password (key))", "format": "string-rlx", "minLength": 1, "optional": true, "maxLength": 8, "type": "string"}, "uuid": {"description": "uuid of the object", "format": "string", "minLength": 1, "modify-not-allowed": 1, "optional": true, "maxLength": 64, "type": "string"}, "mtu-ignore": {"default": 0, "optional": true, "type": "number", "description": "Ignores the MTU in DBD packets", "format": "flag"}, "priority": {"description": "Router priority", "format": "number", "default": 1, "optional": true, "maximum": 255, "minimum": 0, "type": "number"}, "transmit-delay": {"description": "Link state transmit delay (Seconds)", "format": "number", "default": 1, "optional": true, "maximum": 65535, "minimum": 1, "type": "number"}, "value": {"optional": true, "enum": ["message-digest", "null"], "type": "string", "description": "'message-digest': Use message-digest authentication; 'null': Use no authentication; ", "format": "enum"}, "hello-interval": {"description": "Time between HELLO packets (Seconds)", "format": "number", "default": 10, "optional": true, "maximum": 65535, "minimum": 1, "type": "number"}, "authentication": {"default": 0, "optional": true, "type": "number", "description": "Enable authentication", "format": "flag"}, "cost": {"description": "Interface cost", "format": "number", "type": "number", "maximum": 65535, "minimum": 1, "optional": true}, "database-filter": {"optional": true, "enum": ["all"], "type": "string", "description": "'all': Filter all LSA; ", "format": "enum"}, "ip-addr": {"optional": false, "type": "string", "description": "Address of interface", "format": "ipv4-address"}, "retransmit-interval": {"description": "Time between retransmitting lost link state advertisements (Seconds)", "format": "number", "default": 5, "optional": true, "maximum": 65535, "minimum": 1, "type": "number"}, "message-digest-cfg": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"md5-value": {"minLength": 1, "maxLength": 16, "type": "string", "description": "The OSPF password (1-16)", "format": "password"}, "message-digest-key": {"description": "Message digest authentication password (key) (Key id)", "minimum": 1, "type": "number", "maximum": 255, "format": "number"}, "optional": true, "encrypted": {"type": "encrypted", "description": "Do NOT use this option manually. (This is an A10 reserved keyword.) (The ENCRYPTED password string)", "format": "encrypted"}}}]}, "out": {"default": 0, "optional": true, "type": "number", "description": "Outgoing LSA", "format": "flag"}}}], "type": "array", "$ref": "/axapi/v3/interface/ve/{ifnum}/ip/ospf/ospf-ip/{ip-addr}"}, "ospf-global": {"type": "object", "properties": {"dead-interval": {"description": "Interval after which a neighbor is declared dead (Seconds)", "format": "number", "default": 40, "maximum": 65535, "minimum": 1, "type": "number"}, "authentication-key": {"minLength": 1, "maxLength": 8, "type": "string", "description": "Authentication password (key) (The OSPF password (key))", "format": "string-rlx"}, "network": {"type": "object", "properties": {"broadcast": {"default": 0, "not-list": ["non-broadcast", "point-to-point", "point-to-multipoint"], "type": "number", "description": "Specify OSPF broadcast multi-access network", "format": "flag"}, "point-to-multipoint": {"default": 0, "not-list": ["broadcast", "non-broadcast", "point-to-point"], "type": "number", "description": "Specify OSPF point-to-multipoint network", "format": "flag"}, "non-broadcast": {"default": 0, "not-list": ["broadcast", "point-to-point", "point-to-multipoint"], "type": "number", "description": "Specify OSPF NBMA network", "format": "flag"}, "point-to-point": {"default": 0, "not-list": ["broadcast", "non-broadcast", "point-to-multipoint"], "type": "number", "description": "Specify OSPF point-to-point network", "format": "flag"}, "p2mp-nbma": {"default": 0, "type": "number", "description": "Specify non-broadcast point-to-multipoint network", "format": "flag"}}}, "mtu-ignore": {"default": 0, "type": "number", "description": "Ignores the MTU in DBD packets", "format": "flag"}, "retransmit-interval": {"description": "Time between retransmitting lost link state advertisements (Seconds)", "format": "number", "default": 5, "maximum": 65535, "minimum": 1, "type": "number"}, "transmit-delay": {"description": "Link state transmit delay (Seconds)", "format": "number", "default": 1, "maximum": 65535, "minimum": 1, "type": "number"}, "uuid": {"description": "uuid of the object", "format": "string", "minLength": 1, "modify-not-allowed": 1, "maxLength": 64, "type": "string"}, "disable": {"enum": ["all"], "type": "string", "description": "'all': All functionality; ", "format": "enum"}, "authentication-cfg": {"type": "object", "properties": {"authentication": {"default": 0, "type": "number", "description": "Enable authentication", "format": "flag"}, "value": {"enum": ["message-digest", "null"], "type": "string", "description": "'message-digest': Use message-digest authentication; 'null': Use no authentication; ", "format": "enum"}}}, "database-filter-cfg": {"type": "object", "properties": {"database-filter": {"enum": ["all"], "type": "string", "description": "'all': Filter all LSA; ", "format": "enum"}, "out": {"default": 0, "type": "number", "description": "Outgoing LSA", "format": "flag"}}}, "bfd-cfg": {"type": "object", "properties": {"disable": {"default": 0, "type": "number", "description": "Disable BFD", "format": "flag"}, "bfd": {"default": 0, "type": "number", "description": "Bidirectional Forwarding Detection (BFD)", "format": "flag"}}}, "cost": {"description": "Interface cost", "minimum": 1, "type": "number", "maximum": 65535, "format": "number"}, "hello-interval": {"description": "Time between HELLO packets (Seconds)", "format": "number", "default": 10, "maximum": 65535, "minimum": 1, "type": "number"}, "mtu": {"description": "OSPF interface MTU (MTU size)", "minimum": 576, "type": "number", "maximum": 65535, "format": "number"}, "message-digest-cfg": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"message-digest-key": {"description": "Message digest authentication password (key) (Key id)", "minimum": 1, "type": "number", "maximum": 255, "format": "number"}, "optional": true, "md5": {"type": "object", "properties": {"md5-value": {"minLength": 1, "maxLength": 16, "type": "string", "description": "The OSPF password (1-16)", "format": "password"}, "encrypted": {"type": "encrypted", "description": "Do NOT use this option manually. (This is an A10 reserved keyword.) (The ENCRYPTED password string)", "format": "encrypted"}}}}}]}, "priority": {"description": "Router priority", "format": "number", "default": 1, "maximum": 255, "minimum": 0, "type": "number"}}, "$ref": "/axapi/v3/interface/ve/{ifnum}/ip/ospf/ospf-global"}}, "$ref": "/axapi/v3/interface/ve/{ifnum}/ip/ospf"}, "slb-partition-redirect": {"default": 0, "type": "number", "description": "Redirect SLB traffic across partition", "format": "flag"}}, "$ref": "/axapi/v3/interface/ve/{ifnum}/ip"}, "icmpv6-rate-limit": {"type": "object", "properties": {"lockup-period-v6": {"description": "Lockup period (second)", "minimum": 1, "type": "number", "maximum": 16383, "format": "number"}, "normal-v6": {"description": "Normal rate limit. If exceeds this limit, drop the ICMP packet that goes over the limit", "minimum": 1, "type": "number", "maximum": 65535, "format": "number"}, "lockup-v6": {"description": "Enter lockup state when ICMP rate exceeds lockup rate limit (Maximum rate limit. If exceeds this limit, drop all ICMP packet for a time period)", "minimum": 1, "type": "number", "maximum": 65535, "format": "number"}}}, "mtu": {"platform-specific-range": 1, "platform-specific-default": 1, "description": "Interface mtu (Interface MTU, default 1500 (min MTU is 1280 for IPv6))", "format": "number", "optional": true, "type": "number"}, "access-list": {"type": "object", "properties": {"acl-name": {"minLength": 1, "maxLength": 16, "type": "string", "description": "Named Access List", "format": "string"}, "acl-id": {"description": "ACL id", "format": "number", "maximum": 199, "$ref-list": ["/axapi/v3/access-list/standard", "/axapi/v3/access-list/extended"], "minimum": 1, "type": "number"}}}, "ifnum": {"optional": false, "$ref": "/axapi/v3/network/vlan", "type": "number", "description": "Virtual ethernet interface number", "format": "number"}, "sampling-enable": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"optional": true, "counters1": {"enum": ["all", "num_pkts", "num_total_bytes", "num_unicast_pkts", "num_broadcast_pkts", "num_multicast_pkts", "num_tx_pkts", "num_total_tx_bytes", "num_unicast_tx_pkts", "num_broadcast_tx_pkts", "num_multicast_tx_pkts", "rate_pkt_sent", "rate_byte_sent", "rate_pkt_rcvd", "rate_byte_rcvd", "load_interval"], "type": "string", "description": "'all': all; 'num_pkts': Input packets; 'num_total_bytes': Input bytes; 'num_unicast_pkts': Received unicasts; 'num_broadcast_pkts': Received braodcasts; 'num_multicast_pkts': Received multicasts; 'num_tx_pkts': Transmitted packtes; 'num_total_tx_bytes': Transmitte bytes; 'num_unicast_tx_pkts': Trasnmitted unicasts; 'num_broadcast_tx_pkts': Transmitted broadcasts; 'num_multicast_tx_pkts': Transmitted multicasts; 'rate_pkt_sent': Packet sent rate packets/sec; 'rate_byte_sent': Byte sent rate bits/sec; 'rate_pkt_rcvd': Packet received rate packets/sec; 'rate_byte_rcvd': Byte received rate bits/sec; 'load_interval': Load Interval; ", "format": "enum"}}}]}, "lw-4o6": {"type": "object", "properties": {"outside": {"default": 0, "type": "number", "description": "Configure LW-4over6 inside interface", "format": "flag"}, "inside": {"default": 0, "type": "number", "description": "Configure LW-4over6 outside interface", "format": "flag"}, "uuid": {"description": "uuid of the object", "format": "string", "minLength": 1, "modify-not-allowed": 1, "maxLength": 64, "type": "string"}}, "$ref": "/axapi/v3/interface/ve/{ifnum}/lw-4o6"}, "ipv6": {"type": "object", "properties": {"uuid": {"description": "uuid of the object", "format": "string", "minLength": 1, "modify-not-allowed": 1, "maxLength": 64, "type": "string"}, "inbound": {"default": 0, "type": "number", "description": "ACL applied on incoming packets to this interface", "format": "flag"}, "address-list": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"address-type": {"enum": ["anycast", "link-local"], "type": "string", "description": "'anycast': Configure an IPv6 anycast address; 'link-local': Configure an IPv6 link local address; ", "format": "enum"}, "ipv6-addr": {"type": "string", "description": "Set the IPv6 address of an interface", "format": "ipv6-address-plen"}, "optional": true}}]}, "inside": {"default": 0, "type": "number", "description": "Configure interface as NAT inside", "format": "flag"}, "outside": {"default": 0, "type": "number", "description": "Configure interface as NAT outside", "format": "flag"}, "rip": {"type": "object", "properties": {"split-horizon-cfg": {"type": "object", "properties": {"state": {"default": "poisoned", "enum": ["poisoned", "disable", "enable"], "type": "string", "description": "'poisoned': Perform split horizon with poisoned reverse; 'disable': Disable split horizon; 'enable': Perform split horizon without poisoned reverse; ", "format": "enum"}}}, "uuid": {"description": "uuid of the object", "format": "string", "minLength": 1, "modify-not-allowed": 1, "maxLength": 64, "type": "string"}}, "$ref": "/axapi/v3/interface/ve/{ifnum}/ipv6/rip"}, "ipv6-enable": {"default": 0, "type": "number", "description": "Enable IPv6 processing", "format": "flag"}, "stateful-firewall": {"type": "object", "properties": {"access-list": {"default": 0, "type": "number", "description": "Access-list for traffic from the outside", "format": "flag"}, "acl-name": {"minLength": 1, "maxLength": 16, "type": "string", "description": "Access-list Name", "format": "string"}, "inside": {"default": 0, "type": "number", "description": "Inside (private) interface for stateful firewall", "format": "flag"}, "outside": {"default": 0, "type": "number", "description": "Outside (public) interface for stateful firewall", "format": "flag"}, "uuid": {"description": "uuid of the object", "format": "string", "minLength": 1, "modify-not-allowed": 1, "maxLength": 64, "type": "string"}}, "$ref": "/axapi/v3/interface/ve/{ifnum}/ipv6/stateful-firewall"}, "v6-acl-name": {"description": "Apply ACL rules to incoming packets on this interface (Named Access List)", "format": "string", "minLength": 1, "maxLength": 16, "type": "string", "$ref": "/axapi/v3/ipv6/access-list"}, "router": {"type": "object", "properties": {"ripng": {"type": "object", "properties": {"uuid": {"description": "uuid of the object", "format": "string", "minLength": 1, "modify-not-allowed": 1, "maxLength": 64, "type": "string"}, "rip": {"default": 0, "type": "number", "description": "RIP Routing for IPv6", "format": "flag"}}, "$ref": "/axapi/v3/interface/ve/{ifnum}/ipv6/router/ripng"}, "ospf": {"type": "object", "properties": {"area-list": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"area-id-addr": {"type": "string", "description": "OSPF area ID in IP address format", "format": "ipv4-address"}, "tag": {"minLength": 1, "maxLength": 128, "type": "string", "description": "Set the OSPFv3 process tag", "format": "string"}, "optional": true, "instance-id": {"description": "Set the interface instance ID", "format": "number", "default": 0, "maximum": 255, "minimum": 0, "type": "number"}, "area-id-num": {"description": "OSPF area ID as a decimal value", "minimum": 0, "type": "number", "maximum": 4294967295, "format": "number"}}}]}, "uuid": {"description": "uuid of the object", "format": "string", "minLength": 1, "modify-not-allowed": 1, "maxLength": 64, "type": "string"}}, "$ref": "/axapi/v3/interface/ve/{ifnum}/ipv6/router/ospf"}, "isis": {"type": "object", "properties": {"tag": {"description": "ISO routing area tag", "format": "string", "minLength": 1, "modify-not-allowed": 1, "maxLength": 128, "type": "string"}, "uuid": {"description": "uuid of the object", "format": "string", "minLength": 1, "modify-not-allowed": 1, "maxLength": 64, "type": "string"}}, "$ref": "/axapi/v3/interface/ve/{ifnum}/ipv6/router/isis"}}, "$ref": "/axapi/v3/interface/ve/{ifnum}/ipv6/router"}, "ospf": {"type": "object", "properties": {"bfd": {"default": 0, "type": "number", "description": "Bidirectional Forwarding Detection (BFD)", "format": "flag"}, "cost-cfg": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"cost": {"description": "Interface cost", "minimum": 1, "type": "number", "maximum": 65535, "format": "number"}, "optional": true, "instance-id": {"description": "Specify the interface instance ID", "format": "number", "default": 0, "maximum": 255, "minimum": 0, "type": "number"}}}]}, "hello-interval-cfg": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"optional": true, "hello-interval": {"description": "Time between HELLO packets (Seconds)", "format": "number", "default": 10, "maximum": 65535, "minimum": 1, "type": "number"}, "instance-id": {"description": "Specify the interface instance ID", "format": "number", "default": 0, "maximum": 255, "minimum": 0, "type": "number"}}}]}, "disable": {"default": 0, "type": "number", "description": "Disable BFD", "format": "flag"}, "priority-cfg": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"priority": {"description": "Router priority", "format": "number", "default": 1, "maximum": 255, "minimum": 0, "type": "number"}, "optional": true, "instance-id": {"description": "Specify the interface instance ID", "format": "number", "default": 0, "maximum": 255, "minimum": 0, "type": "number"}}}]}, "mtu-ignore-cfg": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"mtu-ignore": {"default": 0, "type": "number", "description": "Ignores the MTU in DBD packets", "format": "flag"}, "optional": true, "instance-id": {"description": "Specify the interface instance ID", "format": "number", "default": 0, "maximum": 255, "minimum": 0, "type": "number"}}}]}, "retransmit-interval-cfg": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"retransmit-interval": {"description": "Time between retransmitting lost link state advertisements (Seconds)", "format": "number", "default": 5, "maximum": 65535, "minimum": 1, "type": "number"}, "optional": true, "instance-id": {"description": "Specify the interface instance ID", "format": "number", "default": 0, "maximum": 255, "minimum": 0, "type": "number"}}}]}, "network-list": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"broadcast-type": {"enum": ["broadcast", "non-broadcast", "point-to-point", "point-to-multipoint"], "type": "string", "description": "'broadcast': Specify OSPF broadcast multi-access network; 'non-broadcast': Specify OSPF NBMA network; 'point-to-point': Specify OSPF point-to-point network; 'point-to-multipoint': Specify OSPF point-to-multipoint network; ", "format": "enum"}, "optional": true, "p2mp-nbma": {"default": 0, "type": "number", "description": "Specify non-broadcast point-to-multipoint network", "format": "flag"}, "network-instance-id": {"description": "Specify the interface instance ID", "format": "number", "default": 0, "maximum": 255, "minimum": 0, "type": "number"}}}]}, "transmit-delay-cfg": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"optional": true, "transmit-delay": {"description": "Link state transmit delay (Seconds)", "format": "number", "default": 1, "maximum": 65535, "minimum": 1, "type": "number"}, "instance-id": {"description": "Specify the interface instance ID", "format": "number", "default": 0, "maximum": 255, "minimum": 0, "type": "number"}}}]}, "neighbor-cfg": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"neighbor-priority": {"description": "OSPF priority of non-broadcast neighbor", "minimum": 0, "type": "number", "maximum": 255, "format": "number"}, "neig-inst": {"description": "Specify the interface instance ID", "format": "number", "default": 0, "maximum": 255, "minimum": 0, "type": "number"}, "neighbor-poll-interval": {"description": "OSPF dead-router polling interval (Seconds)", "minimum": 0, "type": "number", "maximum": 4294967295, "format": "number"}, "neighbor-cost": {"description": "OSPF cost for point-to-multipoint neighbor (metric)", "minimum": 1, "type": "number", "maximum": 65535, "format": "number"}, "neighbor": {"default": "::", "type": "string", "description": "OSPFv3 neighbor (Neighbor IPv6 address)", "format": "ipv6-address"}, "optional": true}}]}, "dead-interval-cfg": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"dead-interval": {"description": "Interval after which a neighbor is declared dead (Seconds)", "format": "number", "default": 40, "maximum": 65535, "minimum": 1, "type": "number"}, "optional": true, "instance-id": {"description": "Specify the interface instance ID", "format": "number", "default": 0, "maximum": 255, "minimum": 0, "type": "number"}}}]}}, "$ref": "/axapi/v3/interface/ve/{ifnum}/ipv6/ospf"}, "router-adver": {"type": "object", "properties": {"max-interval": {"description": "Set Router Advertisement Max Interval (default: 600) (Max Router Advertisement Interval (seconds))", "format": "number", "default": 600, "maximum": 1800, "minimum": 4, "type": "number"}, "default-lifetime": {"description": "Set Router Advertisement Default Lifetime (default: 1800) (Default Lifetime (seconds))", "format": "number", "default": 1800, "maximum": 9000, "minimum": 0, "type": "number"}, "ha-use-floating-ip": {"default": 0, "type": "number", "description": "Use a floating IP as the source address for Router advertisements", "format": "flag"}, "reachable-time": {"description": "Set Router Advertisement Reachable ime (default: 0) (Reachable Time (milliseconds))", "format": "number", "default": 0, "maximum": 3600000, "minimum": 0, "type": "number"}, "floating-ip-default-vrid": {"type": "string", "description": "Use a floating IP as the source address for Router advertisements", "format": "ipv6-address"}, "adver-ha-group-id": {"description": "HA Group ID", "minimum": 1, "type": "number", "maximum": 31, "format": "number"}, "ha-floating-ip": {"type": "string", "description": "Floating Point IPv6 address", "format": "ipv6-address"}, "prefix-list": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"not-autonomous": {"default": 0, "type": "number", "description": "Specify that the Prefix is not usable for autoconfiguration (default:autonomous)", "format": "flag"}, "valid-lifetime": {"description": "Specify Valid Lifetime (default:2592000) (Prefix Advertised Valid Lifetime (default: 2592000))", "format": "number", "default": 2592000, "maximum": 4294967295, "minimum": 0, "type": "number"}, "not-on-link": {"default": 0, "type": "number", "description": "Specify that the Prefix is not On-Link (default: on-link)", "format": "flag"}, "prefix": {"type": "string", "description": "Set Router Advertisement On-Link Prefix (IPv6 On-Link Prefix)", "format": "ipv6-address-plen"}, "preferred-lifetime": {"description": "Specify Prefix Preferred Lifetime (default:604800) (Prefix Advertised Preferred Lifetime (default: 604800))", "format": "number", "default": 604800, "maximum": 4294967295, "minimum": 0, "type": "number"}, "optional": true}}]}, "rate-limit": {"description": "Rate Limit the processing of incoming Router Solicitations (Max Number of Router Solicitations to process per second)", "format": "number", "default": 100000, "maximum": 100000, "minimum": 1, "type": "number"}, "adver-mtu-disable": {"default": 0, "not": "adver-mtu", "type": "number", "description": "Disable Router Advertisement MTU Option", "format": "flag"}, "min-interval": {"description": "Set Router Advertisement Min Interval (default: 200) (Min Router Advertisement Interval (seconds))", "format": "number", "default": 200, "maximum": 1350, "minimum": 3, "type": "number"}, "floating-ip": {"type": "string", "description": "Use a floating IP as the source address for Router advertisements", "format": "ipv6-address"}, "adver-vrid": {"description": "Vrid", "format": "number", "maximum": 31, "minimum": 1, "not": "adver-vrid-default", "type": "number"}, "use-floating-ip-default-vrid": {"default": 0, "type": "number", "description": "Use a floating IP as the source address for Router advertisements", "format": "flag"}, "action": {"default": "enable", "enum": ["enable", "disable"], "type": "string", "description": "'enable': Enable Router Advertisements on this interface; 'disable': Disable Router Advertisements on this interface; ", "format": "enum"}, "adver-vrid-default": {"default": 0, "not": "adver-vrid", "type": "number", "description": "Default VRRP-A vrid", "format": "flag"}, "adver-mtu": {"platform-specific-range": 1, "platform-specific-default": 1, "description": "Set Router Advertisement MTU Option", "format": "number", "not": "adver-mtu-disable", "type": "number"}, "retransmit-timer": {"description": "Set Router Advertisement Retransmit Timer (default: 0)", "format": "number", "default": 0, "maximum": 4294967295, "minimum": 0, "type": "number"}, "hop-limit": {"description": "Set Router Advertisement Hop Limit (default: 255)", "format": "number", "default": 255, "maximum": 255, "minimum": 0, "type": "number"}, "use-floating-ip": {"default": 0, "type": "number", "description": "Use a floating IP as the source address for Router advertisements", "format": "flag"}}}}, "$ref": "/axapi/v3/interface/ve/{ifnum}/ipv6"}, "action": {"optional": true, "enum": ["enable", "disable"], "type": "string", "description": "'enable': Enable; 'disable': Disable; ", "format": "enum"}, "l3-vlan-fwd-disable": {"default": 0, "optional": true, "type": "number", "description": "Disable L3 forwarding between VLANs for incoming packets on this interface", "format": "flag"}, "ddos": {"type": "object", "properties": {"outside": {"default": 0, "type": "number", "description": "DDoS inside (trusted) or outside (untrusted) interface", "format": "flag"}, "inside": {"default": 0, "type": "number", "description": "DDoS inside (trusted) or outside (untrusted) interface", "format": "flag"}, "uuid": {"description": "uuid of the object", "format": "string", "minLength": 1, "modify-not-allowed": 1, "maxLength": 64, "type": "string"}}, "$ref": "/axapi/v3/interface/ve/{ifnum}/ddos"}, "uuid": {"description": "uuid of the object", "format": "string", "minLength": 1, "modify-not-allowed": 1, "optional": true, "maxLength": 64, "type": "string"}}}], "type": "array", "$ref": "/axapi/v3/interface/ve/{ifnum}"} :param ethernet_list: {"minItems": 1, "items": {"type": "ethernet"}, "uniqueItems": true, "array": [{"required": ["ifnum"], "properties": {"trap-source": {"description": "The trap source", "partition-visibility": "shared", "default": 0, "type": "number", "format": "flag", "optional": true}, "ip": {"type": "object", "properties": {"uuid": {"description": "uuid of the object", "format": "string", "minLength": 1, "modify-not-allowed": 1, "maxLength": 64, "type": "string"}, "generate-membership-query": {"default": 0, "type": "number", "description": "Enable Membership Query", "format": "flag"}, "cache-spoofing-port": {"default": 0, "type": "number", "description": "This interface connects to spoofing cache", "format": "flag"}, "inside": {"default": 0, "type": "number", "description": "Configure interface as inside", "format": "flag"}, "router": {"type": "object", "properties": {"isis": {"type": "object", "properties": {"tag": {"description": "ISO routing area tag", "format": "string", "minLength": 1, "modify-not-allowed": 1, "maxLength": 128, "type": "string"}, "uuid": {"description": "uuid of the object", "format": "string", "minLength": 1, "modify-not-allowed": 1, "maxLength": 64, "type": "string"}}, "$ref": "/axapi/v3/interface/ethernet/{ifnum}/ip/router/isis"}}, "$ref": "/axapi/v3/interface/ethernet/{ifnum}/ip/router"}, "allow-promiscuous-vip": {"default": 0, "type": "number", "description": "Allow traffic to be associated with promiscuous VIP", "format": "flag"}, "max-resp-time": {"description": "Maximum Response Time (Max Response Time (Default is 100))", "format": "number", "default": 100, "maximum": 255, "minimum": 1, "type": "number"}, "query-interval": {"description": "1 - 255 (Default is 125)", "format": "number", "default": 125, "maximum": 255, "minimum": 1, "type": "number"}, "outside": {"default": 0, "type": "number", "description": "Configure interface as outside", "format": "flag"}, "helper-address-list": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"helper-address": {"type": "string", "description": "Helper address for DHCP packets (IP address)", "format": "ipv4-address"}, "optional": true}}]}, "stateful-firewall": {"type": "object", "properties": {"access-list": {"default": 0, "type": "number", "description": "Access-list for traffic from the outside", "format": "flag"}, "inside": {"default": 0, "type": "number", "description": "Inside (private) interface for stateful firewall", "format": "flag"}, "acl-id": {"description": "ACL id", "minimum": 1, "type": "number", "maximum": 199, "format": "number"}, "outside": {"default": 0, "type": "number", "description": "Outside (public) interface for stateful firewall", "format": "flag"}, "uuid": {"description": "uuid of the object", "format": "string", "minLength": 1, "modify-not-allowed": 1, "maxLength": 64, "type": "string"}}, "$ref": "/axapi/v3/interface/ethernet/{ifnum}/ip/stateful-firewall"}, "rip": {"type": "object", "properties": {"receive-cfg": {"type": "object", "properties": {"receive": {"default": 0, "type": "number", "description": "Advertisement reception", "format": "flag"}, "version": {"enum": ["1", "2", "1-2"], "type": "string", "description": "'1': RIP version 1; '2': RIP version 2; '1-2': RIP version 1 & 2; ", "format": "enum"}}}, "uuid": {"description": "uuid of the object", "format": "string", "minLength": 1, "modify-not-allowed": 1, "maxLength": 64, "type": "string"}, "receive-packet": {"default": 1, "type": "number", "description": "Enable receiving packet through the specified interface", "format": "flag"}, "split-horizon-cfg": {"type": "object", "properties": {"state": {"default": "poisoned", "enum": ["poisoned", "disable", "enable"], "type": "string", "description": "'poisoned': Perform split horizon with poisoned reverse; 'disable': Disable split horizon; 'enable': Perform split horizon without poisoned reverse; ", "format": "enum"}}}, "authentication": {"type": "object", "properties": {"key-chain": {"type": "object", "properties": {"key-chain": {"type": "string", "description": "Authentication key-chain (Name of key-chain)", "format": "string-rlx"}}}, "mode": {"type": "object", "properties": {"mode": {"default": "text", "enum": ["md5", "text"], "type": "string", "description": "'md5': Keyed message digest; 'text': Clear text authentication; ", "format": "enum"}}}, "str": {"type": "object", "properties": {"string": {"minLength": 1, "maxLength": 16, "type": "string", "description": "The RIP authentication string", "format": "string-rlx"}}}}}, "send-cfg": {"type": "object", "properties": {"version": {"enum": ["1", "2", "1-compatible", "1-2"], "type": "string", "description": "'1': RIP version 1; '2': RIP version 2; '1-compatible': RIPv1-compatible; '1-2': RIP version 1 & 2; ", "format": "enum"}, "send": {"default": 0, "type": "number", "description": "Advertisement transmission", "format": "flag"}}}, "send-packet": {"default": 1, "type": "number", "description": "Enable sending packets through the specified interface", "format": "flag"}}, "$ref": "/axapi/v3/interface/ethernet/{ifnum}/ip/rip"}, "address-list": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"ipv4-address": {"type": "string", "description": "IP address", "format": "ipv4-address"}, "optional": true, "ipv4-netmask": {"type": "string", "description": "IP subnet mask", "format": "ipv4-netmask"}}}]}, "dhcp": {"default": 0, "type": "number", "description": "Use DHCP to configure IP address", "format": "flag"}, "ospf": {"type": "object", "properties": {"ospf-ip-list": {"minItems": 1, "items": {"type": "ospf-ip"}, "uniqueItems": true, "array": [{"required": ["ip-addr"], "properties": {"dead-interval": {"description": "Interval after which a neighbor is declared dead (Seconds)", "format": "number", "default": 40, "optional": true, "maximum": 65535, "minimum": 1, "type": "number"}, "authentication-key": {"description": "Authentication password (key) (The OSPF password (key))", "format": "string-rlx", "minLength": 1, "optional": true, "maxLength": 8, "type": "string"}, "uuid": {"description": "uuid of the object", "format": "string", "minLength": 1, "modify-not-allowed": 1, "optional": true, "maxLength": 64, "type": "string"}, "mtu-ignore": {"default": 0, "optional": true, "type": "number", "description": "Ignores the MTU in DBD packets", "format": "flag"}, "priority": {"description": "Router priority", "format": "number", "default": 1, "optional": true, "maximum": 255, "minimum": 0, "type": "number"}, "transmit-delay": {"description": "Link state transmit delay (Seconds)", "format": "number", "default": 1, "optional": true, "maximum": 65535, "minimum": 1, "type": "number"}, "value": {"optional": true, "enum": ["message-digest", "null"], "type": "string", "description": "'message-digest': Use message-digest authentication; 'null': Use no authentication; ", "format": "enum"}, "hello-interval": {"description": "Time between HELLO packets (Seconds)", "format": "number", "default": 10, "optional": true, "maximum": 65535, "minimum": 1, "type": "number"}, "authentication": {"default": 0, "optional": true, "type": "number", "description": "Enable authentication", "format": "flag"}, "cost": {"description": "Interface cost", "format": "number", "type": "number", "maximum": 65535, "minimum": 1, "optional": true}, "database-filter": {"optional": true, "enum": ["all"], "type": "string", "description": "'all': Filter all LSA; ", "format": "enum"}, "ip-addr": {"optional": false, "type": "string", "description": "Address of interface", "format": "ipv4-address"}, "retransmit-interval": {"description": "Time between retransmitting lost link state advertisements (Seconds)", "format": "number", "default": 5, "optional": true, "maximum": 65535, "minimum": 1, "type": "number"}, "message-digest-cfg": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"md5-value": {"minLength": 1, "maxLength": 16, "type": "string", "description": "The OSPF password (1-16)", "format": "password"}, "message-digest-key": {"description": "Message digest authentication password (key) (Key id)", "minimum": 1, "type": "number", "maximum": 255, "format": "number"}, "optional": true, "encrypted": {"type": "encrypted", "description": "Do NOT use this option manually. (This is an A10 reserved keyword.) (The ENCRYPTED password string)", "format": "encrypted"}}}]}, "out": {"default": 0, "optional": true, "type": "number", "description": "Outgoing LSA", "format": "flag"}}}], "type": "array", "$ref": "/axapi/v3/interface/ethernet/{ifnum}/ip/ospf/ospf-ip/{ip-addr}"}, "ospf-global": {"type": "object", "properties": {"dead-interval": {"description": "Interval after which a neighbor is declared dead (Seconds)", "format": "number", "default": 40, "maximum": 65535, "minimum": 1, "type": "number"}, "authentication-key": {"minLength": 1, "maxLength": 8, "type": "string", "description": "Authentication password (key) (The OSPF password (key))", "format": "string-rlx"}, "network": {"type": "object", "properties": {"broadcast": {"default": 0, "not-list": ["non-broadcast", "point-to-point", "point-to-multipoint"], "type": "number", "description": "Specify OSPF broadcast multi-access network", "format": "flag"}, "point-to-multipoint": {"default": 0, "not-list": ["broadcast", "non-broadcast", "point-to-point"], "type": "number", "description": "Specify OSPF point-to-multipoint network", "format": "flag"}, "non-broadcast": {"default": 0, "not-list": ["broadcast", "point-to-point", "point-to-multipoint"], "type": "number", "description": "Specify OSPF NBMA network", "format": "flag"}, "point-to-point": {"default": 0, "not-list": ["broadcast", "non-broadcast", "point-to-multipoint"], "type": "number", "description": "Specify OSPF point-to-point network", "format": "flag"}, "p2mp-nbma": {"default": 0, "type": "number", "description": "Specify non-broadcast point-to-multipoint network", "format": "flag"}}}, "mtu-ignore": {"default": 0, "type": "number", "description": "Ignores the MTU in DBD packets", "format": "flag"}, "retransmit-interval": {"description": "Time between retransmitting lost link state advertisements (Seconds)", "format": "number", "default": 5, "maximum": 65535, "minimum": 1, "type": "number"}, "transmit-delay": {"description": "Link state transmit delay (Seconds)", "format": "number", "default": 1, "maximum": 65535, "minimum": 1, "type": "number"}, "uuid": {"description": "uuid of the object", "format": "string", "minLength": 1, "modify-not-allowed": 1, "maxLength": 64, "type": "string"}, "disable": {"enum": ["all"], "type": "string", "description": "'all': All functionality; ", "format": "enum"}, "authentication-cfg": {"type": "object", "properties": {"authentication": {"default": 0, "type": "number", "description": "Enable authentication", "format": "flag"}, "value": {"enum": ["message-digest", "null"], "type": "string", "description": "'message-digest': Use message-digest authentication; 'null': Use no authentication; ", "format": "enum"}}}, "database-filter-cfg": {"type": "object", "properties": {"database-filter": {"enum": ["all"], "type": "string", "description": "'all': Filter all LSA; ", "format": "enum"}, "out": {"default": 0, "type": "number", "description": "Outgoing LSA", "format": "flag"}}}, "bfd-cfg": {"type": "object", "properties": {"disable": {"default": 0, "type": "number", "description": "Disable BFD", "format": "flag"}, "bfd": {"default": 0, "type": "number", "description": "Bidirectional Forwarding Detection (BFD)", "format": "flag"}}}, "cost": {"description": "Interface cost", "minimum": 1, "type": "number", "maximum": 65535, "format": "number"}, "hello-interval": {"description": "Time between HELLO packets (Seconds)", "format": "number", "default": 10, "maximum": 65535, "minimum": 1, "type": "number"}, "mtu": {"description": "OSPF interface MTU (MTU size)", "minimum": 576, "type": "number", "maximum": 65535, "format": "number"}, "message-digest-cfg": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"message-digest-key": {"description": "Message digest authentication password (key) (Key id)", "minimum": 1, "type": "number", "maximum": 255, "format": "number"}, "optional": true, "md5": {"type": "object", "properties": {"md5-value": {"minLength": 1, "maxLength": 16, "type": "string", "description": "The OSPF password (1-16)", "format": "password"}, "encrypted": {"type": "encrypted", "description": "Do NOT use this option manually. (This is an A10 reserved keyword.) (The ENCRYPTED password string)", "format": "encrypted"}}}}}]}, "priority": {"description": "Router priority", "format": "number", "default": 1, "maximum": 255, "minimum": 0, "type": "number"}}, "$ref": "/axapi/v3/interface/ethernet/{ifnum}/ip/ospf/ospf-global"}}, "$ref": "/axapi/v3/interface/ethernet/{ifnum}/ip/ospf"}, "slb-partition-redirect": {"default": 0, "type": "number", "description": "Redirect SLB traffic across partition", "format": "flag"}}, "$ref": "/axapi/v3/interface/ethernet/{ifnum}/ip"}, "ddos": {"type": "object", "properties": {"outside": {"default": 0, "type": "number", "description": "DDoS outside (untrusted) interface", "format": "flag"}, "inside": {"default": 0, "type": "number", "description": "DDoS inside (trusted) interface", "format": "flag"}, "uuid": {"description": "uuid of the object", "format": "string", "minLength": 1, "modify-not-allowed": 1, "maxLength": 64, "type": "string"}}, "$ref": "/axapi/v3/interface/ethernet/{ifnum}/ddos"}, "access-list": {"type": "object", "properties": {"acl-name": {"minLength": 1, "maxLength": 16, "type": "string", "description": "Apply an access list (Named Access List)", "format": "string"}, "acl-id": {"description": "ACL id", "format": "number", "maximum": 199, "$ref-list": ["/axapi/v3/access-list/standard", "/axapi/v3/access-list/extended"], "minimum": 1, "type": "number"}}}, "speed": {"description": "'10': 10; '100': 100; '1000': 1000; 'auto': auto; ", "format": "enum", "default": "auto", "optional": true, "enum": ["10", "100", "1000", "auto"], "type": "string", "plat-neg-list": ["soft-ax"]}, "lldp": {"type": "object", "properties": {"tx-dot1-cfg": {"type": "object", "properties": {"link-aggregation": {"default": 0, "type": "number", "description": "Interface link aggregation information", "format": "flag"}, "vlan": {"default": 0, "type": "number", "description": "Interface vlan information", "format": "flag"}, "tx-dot1-tlvs": {"default": 0, "type": "number", "description": "Interface lldp tx IEEE 802.1 Organizationally specific TLVs configuration", "format": "flag"}}}, "notification-cfg": {"type": "object", "properties": {"notification": {"default": 0, "type": "number", "description": "Interface lldp notification configuration", "format": "flag"}, "notif-enable": {"default": 0, "type": "number", "description": "Interface lldp notification enable", "format": "flag"}}}, "tx-tlvs-cfg": {"type": "object", "properties": {"system-capabilities": {"default": 0, "type": "number", "description": "Interface lldp system capabilities", "format": "flag"}, "system-description": {"default": 0, "type": "number", "description": "Interface lldp system description", "format": "flag"}, "management-address": {"default": 0, "type": "number", "description": "Interface lldp management address", "format": "flag"}, "tx-tlvs": {"default": 0, "type": "number", "description": "Interface lldp tx TLVs configuration", "format": "flag"}, "exclude": {"default": 0, "type": "number", "description": "Configure which TLVs excluded. All basic TLVs will be included by default", "format": "flag"}, "port-description": {"default": 0, "type": "number", "description": "Interface lldp port description", "format": "flag"}, "system-name": {"default": 0, "type": "number", "description": "Interface lldp system name", "format": "flag"}}}, "enable-cfg": {"type": "object", "properties": {"rx": {"default": 0, "type": "number", "description": "Enable lldp rx", "format": "flag"}, "tx": {"default": 0, "type": "number", "description": "Enable lldp tx", "format": "flag"}, "rt-enable": {"default": 0, "type": "number", "description": "Interface lldp enable/disable", "format": "flag"}}}, "uuid": {"description": "uuid of the object", "format": "string", "minLength": 1, "modify-not-allowed": 1, "maxLength": 64, "type": "string"}}, "$ref": "/axapi/v3/interface/ethernet/{ifnum}/lldp"}, "uuid": {"description": "uuid of the object", "format": "string", "minLength": 1, "modify-not-allowed": 1, "optional": true, "maxLength": 64, "type": "string"}, "bfd": {"type": "object", "properties": {"uuid": {"description": "uuid of the object", "format": "string", "minLength": 1, "modify-not-allowed": 1, "maxLength": 64, "type": "string"}, "authentication": {"type": "object", "properties": {"encrypted": {"type": "encrypted", "description": "Do NOT use this option manually. (This is an A10 reserved keyword.) (The ENCRYPTED password string)", "format": "encrypted"}, "password": {"minLength": 1, "maxLength": 16, "type": "string", "description": "Key String", "format": "password"}, "method": {"enum": ["md5", "meticulous-md5", "meticulous-sha1", "sha1", "simple"], "type": "string", "description": "'md5': Keyed MD5; 'meticulous-md5': Meticulous Keyed MD5; 'meticulous-sha1': Meticulous Keyed SHA1; 'sha1': Keyed SHA1; 'simple': Simple Password; ", "format": "enum"}, "key-id": {"description": "Key ID", "minimum": 0, "type": "number", "maximum": 255, "format": "number"}}}, "demand": {"default": 0, "type": "number", "description": "Demand mode", "format": "flag"}, "interval-cfg": {"type": "object", "properties": {"interval": {"description": "Transmit interval between BFD packets (Milliseconds)", "minimum": 48, "type": "number", "maximum": 1000, "format": "number"}, "min-rx": {"description": "Minimum receive interval capability (Milliseconds)", "minimum": 48, "type": "number", "maximum": 1000, "format": "number"}, "multiplier": {"description": "Multiplier value used to compute holddown (value used to multiply the interval)", "minimum": 3, "type": "number", "maximum": 50, "format": "number"}}}, "echo": {"default": 0, "type": "number", "description": "Enable BFD Echo", "format": "flag"}}, "$ref": "/axapi/v3/interface/ethernet/{ifnum}/bfd"}, "media-type-copper": {"description": "Set the media type to copper", "format": "flag", "default": 0, "type": "number", "optional": true, "plat-neg-list": ["non-fpga", "soft-ax", "pure-fpga"]}, "sampling-enable": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"optional": true, "counters1": {"enum": ["all", "packets_input", "bytes_input", "received_broadcasts", "received_multicasts", "received_unicasts", "input_errors", "crc", "frame", "runts", "giants", "packets_output", "bytes_output", "transmitted_broadcasts", "transmitted_multicasts", "transmitted_unicasts", "output_errors", "collisions"], "type": "string", "description": "'all': all; 'packets_input': Input packets; 'bytes_input': Input bytes; 'received_broadcasts': Received broadcasts; 'received_multicasts': Received multicasts; 'received_unicasts': Received unicasts; 'input_errors': Input errors; 'crc': CRC; 'frame': Frames; 'runts': Runts; 'giants': Giants; 'packets_output': Output packets; 'bytes_output': Output bytes; 'transmitted_broadcasts': Transmitted braodcasts; 'transmitted_multicasts': Transmitted multicasts; 'transmitted_unicasts': Transmitted unicasts; 'output_errors': Output errors; 'collisions': Collisions; ", "format": "enum"}}}]}, "remove-vlan-tag": {"description": "Remove the vlan tag for egressing packets", "format": "flag", "default": 0, "type": "number", "optional": true, "plat-neg-list": ["non-fpga", "soft-ax", "pure-fpga"]}, "load-interval": {"description": "Configure Load Interval (Seconds (5-300, Multiple of 5), default 300)", "format": "number", "default": 300, "optional": true, "maximum": 300, "minimum": 5, "type": "number"}, "cpu-process": {"description": "All Packets to this port are processed by CPU", "format": "flag", "default": 0, "type": "number", "optional": true, "plat-neg-list": ["non-fpga", "soft-ax", "pure-fpga"]}, "ipv6": {"type": "object", "properties": {"uuid": {"description": "uuid of the object", "format": "string", "minLength": 1, "modify-not-allowed": 1, "maxLength": 64, "type": "string"}, "address-list": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"address-type": {"enum": ["anycast", "link-local"], "type": "string", "description": "'anycast': Configure an IPv6 anycast address; 'link-local': Configure an IPv6 link local address; ", "format": "enum"}, "ipv6-addr": {"type": "string", "description": "Set the IPv6 address of an interface", "format": "ipv6-address-plen"}, "optional": true}}]}, "router-adver": {"type": "object", "properties": {"max-interval": {"description": "Set Router Advertisement Max Interval (default: 600) (Max Router Advertisement Interval (seconds))", "format": "number", "default": 600, "maximum": 1800, "minimum": 4, "type": "number"}, "default-lifetime": {"description": "Set Router Advertisement Default Lifetime (default: 1800) (Default Lifetime (seconds))", "format": "number", "default": 1800, "maximum": 9000, "minimum": 0, "type": "number"}, "ha-use-floating-ip": {"default": 0, "type": "number", "description": "Use a floating IP as the source address for Router advertisements", "format": "flag"}, "reachable-time": {"description": "Set Router Advertisement Reachable ime (default: 0) (Reachable Time (milliseconds))", "format": "number", "default": 0, "maximum": 3600000, "minimum": 0, "type": "number"}, "floating-ip-default-vrid": {"type": "string", "description": "Use a floating IP as the source address for Router advertisements", "format": "ipv6-address"}, "adver-ha-group-id": {"description": "HA Group ID", "minimum": 1, "type": "number", "maximum": 31, "format": "number"}, "ha-floating-ip": {"type": "string", "description": "Use a floating IP as the source address for Router advertisements", "format": "ipv6-address"}, "prefix-list": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"not-autonomous": {"default": 0, "type": "number", "description": "Specify that the Prefix is not usable for autoconfiguration (default:autonomous)", "format": "flag"}, "valid-lifetime": {"description": "Specify Valid Lifetime (default:2592000) (Prefix Advertised Valid Lifetime (default: 2592000))", "format": "number", "default": 2592000, "maximum": 4294967295, "minimum": 0, "type": "number"}, "not-on-link": {"default": 0, "type": "number", "description": "Specify that the Prefix is not On-Link (default: on-link)", "format": "flag"}, "prefix": {"type": "string", "description": "Set Router Advertisement On-Link Prefix (IPv6 On-Link Prefix)", "format": "ipv6-address-plen"}, "preferred-lifetime": {"description": "Specify Prefix Preferred Lifetime (default:604800) (Prefix Advertised Preferred Lifetime (default: 604800))", "format": "number", "default": 604800, "maximum": 4294967295, "minimum": 0, "type": "number"}, "optional": true}}]}, "rate-limit": {"description": "Rate Limit the processing of incoming Router Solicitations (Max Number of Router Solicitations to process per second)", "format": "number", "default": 100000, "maximum": 100000, "minimum": 1, "type": "number"}, "adver-mtu-disable": {"default": 0, "not": "adver-mtu", "type": "number", "description": "Disable Router Advertisement MTU Option", "format": "flag"}, "min-interval": {"description": "Set Router Advertisement Min Interval (default: 200) (Min Router Advertisement Interval (seconds))", "format": "number", "default": 200, "maximum": 1350, "minimum": 3, "type": "number"}, "floating-ip": {"type": "string", "description": "Use a floating IP as the source address for Router advertisements", "format": "ipv6-address"}, "adver-vrid": {"description": "Specify ha VRRP-A vrid", "partition-visibility": "shared", "format": "number", "maximum": 31, "minimum": 1, "not": "adver-vrid-default", "type": "number"}, "use-floating-ip-default-vrid": {"default": 0, "type": "number", "description": "Use a floating IP as the source address for Router advertisements", "format": "flag"}, "action": {"default": "enable", "enum": ["enable", "disable"], "type": "string", "description": "'enable': Enable Router Advertisements on this interface; 'disable': Disable Router Advertisements on this interface; ", "format": "enum"}, "adver-vrid-default": {"default": 0, "not": "adver-vrid", "type": "number", "description": "Default VRRP-A vrid", "format": "flag"}, "adver-mtu": {"platform-specific-range": 1, "platform-specific-default": 1, "description": "Set Router Advertisement MTU Option", "format": "number", "not": "adver-mtu-disable", "type": "number"}, "retransmit-timer": {"description": "Set Router Advertisement Retransmit Timer (default: 0)", "format": "number", "default": 0, "maximum": 4294967295, "minimum": 0, "type": "number"}, "hop-limit": {"description": "Set Router Advertisement Hop Limit (default: 255)", "format": "number", "default": 255, "maximum": 255, "minimum": 0, "type": "number"}, "use-floating-ip": {"default": 0, "partition-visibility": "shared", "type": "number", "description": "Use a floating IP as the source address for Router advertisements", "format": "flag"}}}, "outside": {"default": 0, "type": "number", "description": "Configure interface as outside", "format": "flag"}, "rip": {"type": "object", "properties": {"split-horizon-cfg": {"type": "object", "properties": {"state": {"default": "poisoned", "enum": ["poisoned", "disable", "enable"], "type": "string", "description": "'poisoned': Perform split horizon with poisoned reverse; 'disable': Disable split horizon; 'enable': Perform split horizon without poisoned reverse; ", "format": "enum"}}}, "uuid": {"description": "uuid of the object", "format": "string", "minLength": 1, "modify-not-allowed": 1, "maxLength": 64, "type": "string"}}, "$ref": "/axapi/v3/interface/ethernet/{ifnum}/ipv6/rip"}, "ipv6-enable": {"default": 0, "type": "number", "description": "Enable IPv6 processing", "format": "flag"}, "stateful-firewall": {"type": "object", "properties": {"access-list": {"default": 0, "type": "number", "description": "Access-list for traffic from the outside", "format": "flag"}, "acl-name": {"minLength": 1, "maxLength": 16, "type": "string", "description": "Access-list Name", "format": "string"}, "inside": {"default": 0, "type": "number", "description": "Inside (private) interface for stateful firewall", "format": "flag"}, "outside": {"default": 0, "type": "number", "description": "Outside (public) interface for stateful firewall", "format": "flag"}, "uuid": {"description": "uuid of the object", "format": "string", "minLength": 1, "modify-not-allowed": 1, "maxLength": 64, "type": "string"}}, "$ref": "/axapi/v3/interface/ethernet/{ifnum}/ipv6/stateful-firewall"}, "router": {"type": "object", "properties": {"ripng": {"type": "object", "properties": {"uuid": {"description": "uuid of the object", "format": "string", "minLength": 1, "modify-not-allowed": 1, "maxLength": 64, "type": "string"}, "rip": {"default": 0, "type": "number", "description": "RIP Routing for IPv6", "format": "flag"}}, "$ref": "/axapi/v3/interface/ethernet/{ifnum}/ipv6/router/ripng"}, "ospf": {"type": "object", "properties": {"area-list": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"area-id-addr": {"type": "string", "description": "OSPF area ID in IP address format", "format": "ipv4-address"}, "tag": {"minLength": 1, "maxLength": 128, "type": "string", "description": "Set the OSPFv3 process tag", "format": "string"}, "optional": true, "instance-id": {"description": "Set the interface instance ID", "format": "number", "default": 0, "maximum": 255, "minimum": 0, "type": "number"}, "area-id-num": {"description": "OSPF area ID as a decimal value", "minimum": 0, "type": "number", "maximum": 4294967295, "format": "number"}}}]}, "uuid": {"description": "uuid of the object", "format": "string", "minLength": 1, "modify-not-allowed": 1, "maxLength": 64, "type": "string"}}, "$ref": "/axapi/v3/interface/ethernet/{ifnum}/ipv6/router/ospf"}, "isis": {"type": "object", "properties": {"tag": {"description": "ISO routing area tag", "format": "string", "minLength": 1, "modify-not-allowed": 1, "maxLength": 128, "type": "string"}, "uuid": {"description": "uuid of the object", "format": "string", "minLength": 1, "modify-not-allowed": 1, "maxLength": 64, "type": "string"}}, "$ref": "/axapi/v3/interface/ethernet/{ifnum}/ipv6/router/isis"}}, "$ref": "/axapi/v3/interface/ethernet/{ifnum}/ipv6/router"}, "access-list-cfg": {"type": "object", "properties": {"inbound": {"default": 0, "type": "number", "description": "ACL applied on incoming packets to this interface", "format": "flag"}, "v6-acl-name": {"description": "Apply ACL rules to incoming packets on this interface (Named Access List)", "format": "string", "minLength": 1, "maxLength": 16, "type": "string", "$ref": "/axapi/v3/ipv6/access-list"}}}, "ospf": {"type": "object", "properties": {"bfd": {"default": 0, "type": "number", "description": "Bidirectional Forwarding Detection (BFD)", "format": "flag"}, "cost-cfg": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"cost": {"description": "Interface cost", "minimum": 1, "type": "number", "maximum": 65535, "format": "number"}, "optional": true, "instance-id": {"description": "Specify the interface instance ID", "format": "number", "default": 0, "maximum": 255, "minimum": 0, "type": "number"}}}]}, "hello-interval-cfg": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"optional": true, "hello-interval": {"description": "Time between HELLO packets (Seconds)", "format": "number", "default": 10, "maximum": 65535, "minimum": 1, "type": "number"}, "instance-id": {"description": "Specify the interface instance ID", "format": "number", "default": 0, "maximum": 255, "minimum": 0, "type": "number"}}}]}, "disable": {"default": 0, "type": "number", "description": "Disable BFD", "format": "flag"}, "priority-cfg": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"priority": {"description": "Router priority", "format": "number", "default": 1, "maximum": 255, "minimum": 0, "type": "number"}, "optional": true, "instance-id": {"description": "Specify the interface instance ID", "format": "number", "default": 0, "maximum": 255, "minimum": 0, "type": "number"}}}]}, "mtu-ignore-cfg": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"mtu-ignore": {"default": 0, "type": "number", "description": "Ignores the MTU in DBD packets", "format": "flag"}, "optional": true, "instance-id": {"description": "Specify the interface instance ID", "format": "number", "default": 0, "maximum": 255, "minimum": 0, "type": "number"}}}]}, "retransmit-interval-cfg": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"retransmit-interval": {"description": "Time between retransmitting lost link state advertisements (Seconds)", "format": "number", "default": 5, "maximum": 65535, "minimum": 1, "type": "number"}, "optional": true, "instance-id": {"description": "Specify the interface instance ID", "format": "number", "default": 0, "maximum": 255, "minimum": 0, "type": "number"}}}]}, "network-list": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"broadcast-type": {"enum": ["broadcast", "non-broadcast", "point-to-point", "point-to-multipoint"], "type": "string", "description": "'broadcast': Specify OSPF broadcast multi-access network; 'non-broadcast': Specify OSPF NBMA network; 'point-to-point': Specify OSPF point-to-point network; 'point-to-multipoint': Specify OSPF point-to-multipoint network; ", "format": "enum"}, "optional": true, "p2mp-nbma": {"default": 0, "type": "number", "description": "Specify non-broadcast point-to-multipoint network", "format": "flag"}, "network-instance-id": {"description": "Specify the interface instance ID", "format": "number", "default": 0, "maximum": 255, "minimum": 0, "type": "number"}}}]}, "transmit-delay-cfg": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"optional": true, "transmit-delay": {"description": "Link state transmit delay (Seconds)", "format": "number", "default": 1, "maximum": 65535, "minimum": 1, "type": "number"}, "instance-id": {"description": "Specify the interface instance ID", "format": "number", "default": 0, "maximum": 255, "minimum": 0, "type": "number"}}}]}, "neighbor-cfg": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"neighbor-priority": {"description": "OSPF priority of non-broadcast neighbor", "minimum": 0, "type": "number", "maximum": 255, "format": "number"}, "neig-inst": {"description": "Specify the interface instance ID", "format": "number", "default": 0, "maximum": 255, "minimum": 0, "type": "number"}, "neighbor-poll-interval": {"description": "OSPF dead-router polling interval (Seconds)", "minimum": 0, "type": "number", "maximum": 4294967295, "format": "number"}, "neighbor-cost": {"description": "OSPF cost for point-to-multipoint neighbor (metric)", "minimum": 1, "type": "number", "maximum": 65535, "format": "number"}, "neighbor": {"default": "::", "type": "string", "description": "OSPFv3 neighbor (Neighbor IPv6 address)", "format": "ipv6-address"}, "optional": true}}]}, "dead-interval-cfg": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"dead-interval": {"description": "Interval after which a neighbor is declared dead (Seconds)", "format": "number", "default": 40, "maximum": 65535, "minimum": 1, "type": "number"}, "optional": true, "instance-id": {"description": "Specify the interface instance ID", "format": "number", "default": 0, "maximum": 255, "minimum": 0, "type": "number"}}}]}}, "$ref": "/axapi/v3/interface/ethernet/{ifnum}/ipv6/ospf"}, "inside": {"default": 0, "type": "number", "description": "Configure interface as inside", "format": "flag"}}, "$ref": "/axapi/v3/interface/ethernet/{ifnum}/ipv6"}, "trunk-group-list": {"minItems": 1, "items": {"type": "trunk-group"}, "uniqueItems": true, "array": [{"required": ["trunk-number"], "properties": {"uuid": {"description": "uuid of the object", "format": "string", "minLength": 1, "modify-not-allowed": 1, "optional": true, "maxLength": 64, "type": "string"}, "trunk-number": {"description": "Trunk Number", "format": "number", "type": "number", "maximum": 16, "minimum": 1, "optional": false}, "udld-timeout-cfg": {"type": "object", "properties": {"slow": {"description": "slow timeout in unit of seconds", "format": "number", "default": 1, "maximum": 60, "minimum": 1, "not": "fast", "type": "number"}, "fast": {"description": "fast timeout in unit of milli-seconds", "format": "number", "default": 1000, "maximum": 1000, "minimum": 100, "not": "slow", "type": "number"}}}, "mode": {"description": "'active': enable initiation of LACP negotiation on a port(default); 'passive': disable initiation of LACP negotiation on a port; ", "format": "enum", "default": "active", "type": "string", "enum": ["active", "passive"], "optional": true}, "timeout": {"description": "'long': Set LACP long timeout (default); 'short': Set LACP short timeout; ", "format": "enum", "default": "long", "type": "string", "enum": ["long", "short"], "optional": true}, "type": {"description": "'static': Static (default); 'lacp': lacp; 'lacp-udld': lacp-udld; ", "format": "enum", "default": "static", "optional": true, "enum": ["static", "lacp", "lacp-udld"], "modify-not-allowed": 1, "type": "string"}, "admin-key": {"description": "LACP admin key (Admin key value)", "format": "number", "type": "number", "maximum": 65535, "minimum": 10000, "optional": true}, "port-priority": {"description": "Set LACP priority for a port (LACP port priority)", "format": "number", "type": "number", "maximum": 65535, "minimum": 1, "optional": true}}}], "type": "array", "$ref": "/axapi/v3/interface/ethernet/{ifnum}/trunk-group/{trunk-number}"}, "l3-vlan-fwd-disable": {"default": 0, "optional": true, "type": "number", "format": "flag"}, "isis": {"type": "object", "properties": {"priority-list": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"priority": {"description": "Set priority for Designated Router election (Priority value)", "format": "number", "default": 64, "maximum": 127, "minimum": 0, "type": "number"}, "optional": true, "level": {"enum": ["level-1", "level-2"], "type": "string", "description": "'level-1': Specify priority for level-1 routing; 'level-2': Specify priority for level-2 routing; ", "format": "enum"}}}]}, "retransmit-interval": {"description": "Set per-LSP retransmission interval (Interval between retransmissions of the same LSP (seconds))", "format": "number", "default": 5, "maximum": 65535, "minimum": 0, "type": "number"}, "hello-interval-minimal-list": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"hello-interval-minimal": {"default": 0, "type": "number", "description": "Set Hello holdtime 1 second, interval depends on multiplier", "format": "flag"}, "optional": true, "level": {"enum": ["level-1", "level-2"], "type": "string", "description": "'level-1': Specify hello-interval for level-1 IIHs; 'level-2': Specify hello-interval for level-2 IIHs; ", "format": "enum"}}}]}, "mesh-group": {"type": "object", "properties": {"value": {"description": "Mesh group number", "format": "number", "maximum": 4294967295, "minimum": 1, "not": "blocked", "type": "number"}, "blocked": {"default": 0, "not": "value", "type": "number", "description": "Block LSPs on this interface", "format": "flag"}}}, "network": {"enum": ["broadcast", "point-to-point"], "type": "string", "description": "'broadcast': Specify IS-IS broadcast multi-access network; 'point-to-point': Specify IS-IS point-to-point network; ", "format": "enum"}, "bfd-cfg": {"type": "object", "properties": {"disable": {"default": 0, "type": "number", "description": "Disable BFD", "format": "flag"}, "bfd": {"default": 0, "type": "number", "description": "Bidirectional Forwarding Detection (BFD)", "format": "flag"}}}, "lsp-interval": {"description": "Set LSP transmission interval (LSP transmission interval (milliseconds))", "format": "number", "default": 33, "maximum": 4294967295, "minimum": 1, "type": "number"}, "padding": {"default": 1, "type": "number", "description": "Add padding to IS-IS hello packets", "format": "flag"}, "password-list": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"password": {"minLength": 1, "maxLength": 254, "type": "string", "description": "Configure the authentication password for interface", "format": "string-rlx"}, "optional": true, "level": {"enum": ["level-1", "level-2"], "type": "string", "description": "'level-1': Specify password for level-1 PDUs; 'level-2': Specify password for level-2 PDUs; ", "format": "enum"}}}]}, "authentication": {"type": "object", "properties": {"key-chain-list": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"key-chain": {"minLength": 1, "maxLength": 128, "type": "string", "description": "Authentication key-chain (Name of key-chain)", "format": "string"}, "optional": true, "level": {"enum": ["level-1", "level-2"], "type": "string", "description": "'level-1': Specify authentication key-chain for level-1 PDUs; 'level-2': Specify authentication key-chain for level-2 PDUs; ", "format": "enum"}}}]}, "mode-list": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"optional": true, "mode": {"enum": ["md5"], "type": "string", "description": "'md5': Keyed message digest; ", "format": "enum"}, "level": {"enum": ["level-1", "level-2"], "type": "string", "description": "'level-1': Specify authentication mode for level-1 PDUs; 'level-2': Specify authentication mode for level-2 PDUs; ", "format": "enum"}}}]}, "send-only-list": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"send-only": {"default": 0, "type": "number", "description": "Authentication send-only", "format": "flag"}, "optional": true, "level": {"enum": ["level-1", "level-2"], "type": "string", "description": "'level-1': Specify authentication send-only for level-1 PDUs; 'level-2': Specify authentication send-only for level-2 PDUs; ", "format": "enum"}}}]}}}, "wide-metric-list": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"optional": true, "wide-metric": {"description": "Configure the wide metric for interface", "format": "number", "default": 10, "maximum": 16777214, "minimum": 1, "type": "number"}, "level": {"enum": ["level-1", "level-2"], "type": "string", "description": "'level-1': Apply metric to level-1 links; 'level-2': Apply metric to level-2 links; ", "format": "enum"}}}]}, "hello-interval-list": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"optional": true, "hello-interval": {"description": "Set Hello interval in seconds (Hello interval value)", "format": "number", "default": 10, "maximum": 65535, "minimum": 1, "type": "number"}, "level": {"enum": ["level-1", "level-2"], "type": "string", "description": "'level-1': Specify hello-interval for level-1 IIHs; 'level-2': Specify hello-interval for level-2 IIHs; ", "format": "enum"}}}]}, "circuit-type": {"default": "level-1-2", "enum": ["level-1", "level-1-2", "level-2-only"], "type": "string", "description": "'level-1': Level-1 only adjacencies are formed; 'level-1-2': Level-1-2 adjacencies are formed; 'level-2-only': Level-2 only adjacencies are formed; ", "format": "enum"}, "hello-multiplier-list": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"optional": true, "hello-multiplier": {"description": "Set multiplier for Hello holding time (Hello multiplier value)", "format": "number", "default": 3, "maximum": 100, "minimum": 2, "type": "number"}, "level": {"enum": ["level-1", "level-2"], "type": "string", "description": "'level-1': Specify hello multiplier for level-1 IIHs; 'level-2': Specify hello multiplier for level-2 IIHs; ", "format": "enum"}}}]}, "metric-list": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"metric": {"description": "Configure the metric for interface (Default metric)", "format": "number", "default": 10, "maximum": 63, "minimum": 1, "type": "number"}, "optional": true, "level": {"enum": ["level-1", "level-2"], "type": "string", "description": "'level-1': Apply metric to level-1 links; 'level-2': Apply metric to level-2 links; ", "format": "enum"}}}]}, "csnp-interval-list": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"level": {"enum": ["level-1", "level-2"], "type": "string", "description": "'level-1': Speficy interval for level-1 CSNPs; 'level-2': Specify interval for level-2 CSNPs; ", "format": "enum"}, "optional": true, "csnp-interval": {"description": "Set CSNP interval in seconds (CSNP interval value)", "format": "number", "default": 10, "maximum": 65535, "minimum": 1, "type": "number"}}}]}, "uuid": {"description": "uuid of the object", "format": "string", "minLength": 1, "modify-not-allowed": 1, "maxLength": 64, "type": "string"}}, "$ref": "/axapi/v3/interface/ethernet/{ifnum}/isis"}, "name": {"description": "Name for the interface", "format": "string-rlx", "minLength": 1, "optional": true, "maxLength": 32, "type": "string"}, "duplexity": {"description": "'Full': Full; 'Half': Half; 'auto': auto; ", "format": "enum", "default": "auto", "optional": true, "enum": ["Full", "Half", "auto"], "type": "string", "plat-neg-list": ["soft-ax"]}, "icmpv6-rate-limit": {"type": "object", "properties": {"lockup-period-v6": {"description": "Lockup period (second)", "minimum": 1, "type": "number", "maximum": 16383, "format": "number"}, "normal-v6": {"description": "Normal rate limit. If exceeds this limit, drop the ICMP packet that goes over the limit", "minimum": 1, "type": "number", "maximum": 65535, "format": "number"}, "lockup-v6": {"description": "Enter lockup state when ICMP rate exceeds lockup rate limit (Maximum rate limit. If exceeds this limit, drop all ICMP packet for a time period)", "minimum": 1, "type": "number", "maximum": 65535, "format": "number"}}}, "mtu": {"platform-specific-range": 1, "platform-specific-default": 1, "description": "Interface mtu (Interface MTU, default 1500 (min MTU is 1280 for IPv6))", "format": "number", "optional": true, "type": "number"}, "ifnum": {"optional": false, "type": "number", "description": "Ethernet interface number", "format": "interface"}, "monitor-list": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"optional": true, "monitor-vlan": {"description": "VLAN number", "format": "number", "maximum": 4094, "minimum": 2, "type": "number", "plat-neg-list": ["non-fpga", "pure-fpga"]}, "monitor": {"description": "'input': Incoming packets; 'output': Outgoing packets; 'both': Both incoming and outgoing packets; ", "partition-visibility": "shared", "format": "enum", "enum": ["input", "output", "both"], "type": "string", "plat-neg-list": ["soft-ax"]}, "mirror-index": {"description": "Mirror index", "partition-visibility": "shared", "format": "number", "maximum": 4, "minimum": 1, "type": "number", "plat-neg-list": ["soft-ax"], "$ref": "/axapi/v3/mirror-port"}}}]}, "lw-4o6": {"type": "object", "properties": {"outside": {"default": 0, "type": "number", "description": "Configure LW-4over6 inside interface", "format": "flag"}, "inside": {"default": 0, "type": "number", "description": "Configure LW-4over6 outside interface", "format": "flag"}, "uuid": {"description": "uuid of the object", "format": "string", "minLength": 1, "modify-not-allowed": 1, "maxLength": 64, "type": "string"}}, "$ref": "/axapi/v3/interface/ethernet/{ifnum}/lw-4o6"}, "action": {"description": "'enable': Enable; 'disable': Disable; ", "format": "enum", "default": "disable", "type": "string", "enum": ["enable", "disable"], "optional": true}, "icmp-rate-limit": {"type": "object", "properties": {"lockup": {"description": "Enter lockup state when ICMP rate exceeds lockup rate limit (Maximum rate limit. If exceeds this limit, drop all ICMP packet for a time period)", "minimum": 1, "type": "number", "maximum": 65535, "format": "number"}, "lockup-period": {"description": "Lockup period (second)", "minimum": 1, "type": "number", "maximum": 16383, "format": "number"}, "normal": {"description": "Normal rate limit. If exceeds this limit, drop the ICMP packet that goes over the limit", "minimum": 1, "type": "number", "maximum": 65535, "format": "number"}}}, "flow-control": {"description": "Enable 802.3x flow control on full duplex port", "format": "flag", "default": 0, "type": "number", "optional": true, "plat-neg-list": ["soft-ax"]}}}], "type": "array", "$ref": "/axapi/v3/interface/ethernet/{ifnum}"} :param lif_list: {"minItems": 1, "items": {"type": "lif"}, "uniqueItems": true, "array": [{"required": ["ifnum"], "properties": {"isis": {"type": "object", "properties": {"priority-list": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"priority": {"description": "Set priority for Designated Router election (Priority value)", "format": "number", "default": 64, "maximum": 127, "minimum": 0, "type": "number"}, "optional": true, "level": {"enum": ["level-1", "level-2"], "type": "string", "description": "'level-1': Specify priority for level-1 routing; 'level-2': Specify priority for level-2 routing; ", "format": "enum"}}}]}, "retransmit-interval": {"description": "Set per-LSP retransmission interval (Interval between retransmissions of the same LSP (seconds))", "format": "number", "default": 5, "maximum": 65535, "minimum": 0, "type": "number"}, "hello-interval-minimal-list": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"hello-interval-minimal": {"default": 0, "type": "number", "description": "Set Hello holdtime 1 second, interval depends on multiplier", "format": "flag"}, "optional": true, "level": {"enum": ["level-1", "level-2"], "type": "string", "description": "'level-1': Specify hello-interval for level-1 IIHs; 'level-2': Specify hello-interval for level-2 IIHs; ", "format": "enum"}}}]}, "mesh-group": {"type": "object", "properties": {"value": {"description": "Mesh group number", "format": "number", "maximum": 4294967295, "minimum": 1, "not": "blocked", "type": "number"}, "blocked": {"default": 0, "not": "value", "type": "number", "description": "Block LSPs on this interface", "format": "flag"}}}, "network": {"enum": ["broadcast", "point-to-point"], "type": "string", "description": "'broadcast': Specify IS-IS broadcast multi-access network; 'point-to-point': Specify IS-IS point-to-point network; ", "format": "enum"}, "bfd-cfg": {"type": "object", "properties": {"disable": {"default": 0, "type": "number", "description": "Disable BFD", "format": "flag"}, "bfd": {"default": 0, "type": "number", "description": "Bidirectional Forwarding Detection (BFD)", "format": "flag"}}}, "lsp-interval": {"description": "Set LSP transmission interval (LSP transmission interval (milliseconds))", "format": "number", "default": 33, "maximum": 4294967295, "minimum": 1, "type": "number"}, "padding": {"default": 1, "type": "number", "description": "Add padding to IS-IS hello packets", "format": "flag"}, "password-list": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"password": {"minLength": 1, "maxLength": 254, "type": "string", "description": "Configure the authentication password for interface", "format": "string-rlx"}, "optional": true, "level": {"enum": ["level-1", "level-2"], "type": "string", "description": "'level-1': Specify password for level-1 PDUs; 'level-2': Specify password for level-2 PDUs; ", "format": "enum"}}}]}, "authentication": {"type": "object", "properties": {"key-chain-list": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"key-chain": {"minLength": 1, "maxLength": 128, "type": "string", "description": "Authentication key-chain (Name of key-chain)", "format": "string"}, "optional": true, "level": {"enum": ["level-1", "level-2"], "type": "string", "description": "'level-1': Specify authentication key-chain for level-1 PDUs; 'level-2': Specify authentication key-chain for level-2 PDUs; ", "format": "enum"}}}]}, "mode-list": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"optional": true, "mode": {"enum": ["md5"], "type": "string", "description": "'md5': Keyed message digest; ", "format": "enum"}, "level": {"enum": ["level-1", "level-2"], "type": "string", "description": "'level-1': Specify authentication mode for level-1 PDUs; 'level-2': Specify authentication mode for level-2 PDUs; ", "format": "enum"}}}]}, "send-only-list": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"send-only": {"default": 0, "type": "number", "description": "Authentication send-only", "format": "flag"}, "optional": true, "level": {"enum": ["level-1", "level-2"], "type": "string", "description": "'level-1': Specify authentication send-only for level-1 PDUs; 'level-2': Specify authentication send-only for level-2 PDUs; ", "format": "enum"}}}]}}}, "wide-metric-list": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"optional": true, "wide-metric": {"description": "Configure the wide metric for interface", "format": "number", "default": 10, "maximum": 16777214, "minimum": 1, "type": "number"}, "level": {"enum": ["level-1", "level-2"], "type": "string", "description": "'level-1': Apply metric to level-1 links; 'level-2': Apply metric to level-2 links; ", "format": "enum"}}}]}, "hello-interval-list": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"optional": true, "hello-interval": {"description": "Set Hello interval in seconds (Hello interval value)", "format": "number", "default": 10, "maximum": 65535, "minimum": 1, "type": "number"}, "level": {"enum": ["level-1", "level-2"], "type": "string", "description": "'level-1': Specify hello-interval for level-1 IIHs; 'level-2': Specify hello-interval for level-2 IIHs; ", "format": "enum"}}}]}, "circuit-type": {"default": "level-1-2", "enum": ["level-1", "level-1-2", "level-2-only"], "type": "string", "description": "'level-1': Level-1 only adjacencies are formed; 'level-1-2': Level-1-2 adjacencies are formed; 'level-2-only': Level-2 only adjacencies are formed; ", "format": "enum"}, "hello-multiplier-list": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"optional": true, "hello-multiplier": {"description": "Set multiplier for Hello holding time (Hello multiplier value)", "format": "number", "default": 3, "maximum": 100, "minimum": 2, "type": "number"}, "level": {"enum": ["level-1", "level-2"], "type": "string", "description": "'level-1': Specify hello multiplier for level-1 IIHs; 'level-2': Specify hello multiplier for level-2 IIHs; ", "format": "enum"}}}]}, "metric-list": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"metric": {"description": "Configure the metric for interface (Default metric)", "format": "number", "default": 10, "maximum": 63, "minimum": 1, "type": "number"}, "optional": true, "level": {"enum": ["level-1", "level-2"], "type": "string", "description": "'level-1': Apply metric to level-1 links; 'level-2': Apply metric to level-2 links; ", "format": "enum"}}}]}, "csnp-interval-list": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"level": {"enum": ["level-1", "level-2"], "type": "string", "description": "'level-1': Speficy interval for level-1 CSNPs; 'level-2': Specify interval for level-2 CSNPs; ", "format": "enum"}, "optional": true, "csnp-interval": {"description": "Set CSNP interval in seconds (CSNP interval value)", "format": "number", "default": 10, "maximum": 65535, "minimum": 1, "type": "number"}}}]}, "uuid": {"description": "uuid of the object", "format": "string", "minLength": 1, "modify-not-allowed": 1, "maxLength": 64, "type": "string"}}, "$ref": "/axapi/v3/interface/lif/{ifnum}/isis"}, "uuid": {"description": "uuid of the object", "format": "string", "minLength": 1, "modify-not-allowed": 1, "optional": true, "maxLength": 64, "type": "string"}, "bfd": {"type": "object", "properties": {"uuid": {"description": "uuid of the object", "format": "string", "minLength": 1, "modify-not-allowed": 1, "maxLength": 64, "type": "string"}, "authentication": {"type": "object", "properties": {"encrypted": {"type": "encrypted", "description": "Do NOT use this option manually. (This is an A10 reserved keyword.) (The ENCRYPTED password string)", "format": "encrypted"}, "password": {"minLength": 1, "maxLength": 16, "type": "string", "description": "Key String", "format": "password"}, "method": {"enum": ["md5", "meticulous-md5", "meticulous-sha1", "sha1", "simple"], "type": "string", "description": "'md5': Keyed MD5; 'meticulous-md5': Meticulous Keyed MD5; 'meticulous-sha1': Meticulous Keyed SHA1; 'sha1': Keyed SHA1; 'simple': Simple Password; ", "format": "enum"}, "key-id": {"description": "Key ID", "minimum": 0, "type": "number", "maximum": 255, "format": "number"}}}, "demand": {"default": 0, "type": "number", "description": "Demand mode", "format": "flag"}, "interval-cfg": {"type": "object", "properties": {"interval": {"description": "Transmit interval between BFD packets (Milliseconds)", "minimum": 48, "type": "number", "maximum": 1000, "format": "number"}, "min-rx": {"description": "Minimum receive interval capability (Milliseconds)", "minimum": 48, "type": "number", "maximum": 1000, "format": "number"}, "multiplier": {"description": "Multiplier value used to compute holddown (value used to multiply the interval)", "minimum": 3, "type": "number", "maximum": 50, "format": "number"}}}, "echo": {"default": 0, "type": "number", "description": "Enable BFD Echo", "format": "flag"}}, "$ref": "/axapi/v3/interface/lif/{ifnum}/bfd"}, "ip": {"type": "object", "properties": {"uuid": {"description": "uuid of the object", "format": "string", "minLength": 1, "modify-not-allowed": 1, "maxLength": 64, "type": "string"}, "generate-membership-query": {"default": 0, "type": "number", "description": "Enable Membership Query", "format": "flag"}, "cache-spoofing-port": {"default": 0, "type": "number", "description": "This interface connects to spoofing cache", "format": "flag"}, "inside": {"default": 0, "type": "number", "description": "Configure interface as inside", "format": "flag"}, "router": {"type": "object", "properties": {"isis": {"type": "object", "properties": {"tag": {"description": "ISO routing area tag", "format": "string", "minLength": 1, "modify-not-allowed": 1, "maxLength": 128, "type": "string"}, "uuid": {"description": "uuid of the object", "format": "string", "minLength": 1, "modify-not-allowed": 1, "maxLength": 64, "type": "string"}}, "$ref": "/axapi/v3/interface/lif/{ifnum}/ip/router/isis"}}, "$ref": "/axapi/v3/interface/lif/{ifnum}/ip/router"}, "allow-promiscuous-vip": {"default": 0, "type": "number", "description": "Allow traffic to be associated with promiscuous VIP", "format": "flag"}, "max-resp-time": {"description": "Maximum Response Time (Max Response Time (Default is 100))", "format": "number", "default": 100, "maximum": 255, "minimum": 1, "type": "number"}, "query-interval": {"description": "1 - 255 (Default is 125)", "format": "number", "default": 125, "maximum": 255, "minimum": 1, "type": "number"}, "outside": {"default": 0, "type": "number", "description": "Configure interface as outside", "format": "flag"}, "rip": {"type": "object", "properties": {"receive-cfg": {"type": "object", "properties": {"receive": {"default": 0, "type": "number", "description": "Advertisement reception", "format": "flag"}, "version": {"enum": ["1", "2", "1-2"], "type": "string", "description": "'1': RIP version 1; '2': RIP version 2; '1-2': RIP version 1 & 2; ", "format": "enum"}}}, "uuid": {"description": "uuid of the object", "format": "string", "minLength": 1, "modify-not-allowed": 1, "maxLength": 64, "type": "string"}, "receive-packet": {"default": 1, "type": "number", "description": "Enable receiving packet through the specified interface", "format": "flag"}, "split-horizon-cfg": {"type": "object", "properties": {"state": {"default": "poisoned", "enum": ["poisoned", "disable", "enable"], "type": "string", "description": "'poisoned': Perform split horizon with poisoned reverse; 'disable': Disable split horizon; 'enable': Perform split horizon without poisoned reverse; ", "format": "enum"}}}, "authentication": {"type": "object", "properties": {"key-chain": {"type": "object", "properties": {"key-chain": {"type": "string", "description": "Authentication key-chain (Name of key-chain)", "format": "string-rlx"}}}, "mode": {"type": "object", "properties": {"mode": {"default": "text", "enum": ["md5", "text"], "type": "string", "description": "'md5': Keyed message digest; 'text': Clear text authentication; ", "format": "enum"}}}, "str": {"type": "object", "properties": {"string": {"minLength": 1, "maxLength": 16, "type": "string", "description": "The RIP authentication string", "format": "string-rlx"}}}}}, "send-cfg": {"type": "object", "properties": {"version": {"enum": ["1", "2", "1-compatible", "1-2"], "type": "string", "description": "'1': RIP version 1; '2': RIP version 2; '1-compatible': RIPv1-compatible; '1-2': RIP version 1 & 2; ", "format": "enum"}, "send": {"default": 0, "type": "number", "description": "Advertisement transmission", "format": "flag"}}}, "send-packet": {"default": 1, "type": "number", "description": "Enable sending packets through the specified interface", "format": "flag"}}, "$ref": "/axapi/v3/interface/lif/{ifnum}/ip/rip"}, "address-list": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"ipv4-address": {"type": "string", "description": "IP address", "format": "ipv4-address"}, "optional": true, "ipv4-netmask": {"type": "string", "description": "IP subnet mask", "format": "ipv4-netmask"}}}]}, "dhcp": {"default": 0, "type": "number", "description": "Use DHCP to configure IP address", "format": "flag"}, "ospf": {"type": "object", "properties": {"ospf-ip-list": {"minItems": 1, "items": {"type": "ospf-ip"}, "uniqueItems": true, "array": [{"required": ["ip-addr"], "properties": {"dead-interval": {"description": "Interval after which a neighbor is declared dead (Seconds)", "format": "number", "default": 40, "optional": true, "maximum": 65535, "minimum": 1, "type": "number"}, "authentication-key": {"description": "Authentication password (key) (The OSPF password (key))", "format": "string-rlx", "minLength": 1, "optional": true, "maxLength": 8, "type": "string"}, "uuid": {"description": "uuid of the object", "format": "string", "minLength": 1, "modify-not-allowed": 1, "optional": true, "maxLength": 64, "type": "string"}, "mtu-ignore": {"default": 0, "optional": true, "type": "number", "description": "Ignores the MTU in DBD packets", "format": "flag"}, "priority": {"description": "Router priority", "format": "number", "default": 1, "optional": true, "maximum": 255, "minimum": 0, "type": "number"}, "transmit-delay": {"description": "Link state transmit delay (Seconds)", "format": "number", "default": 1, "optional": true, "maximum": 65535, "minimum": 1, "type": "number"}, "value": {"optional": true, "enum": ["message-digest", "null"], "type": "string", "description": "'message-digest': Use message-digest authentication; 'null': Use no authentication; ", "format": "enum"}, "hello-interval": {"description": "Time between HELLO packets (Seconds)", "format": "number", "default": 10, "optional": true, "maximum": 65535, "minimum": 1, "type": "number"}, "authentication": {"default": 0, "optional": true, "type": "number", "description": "Enable authentication", "format": "flag"}, "cost": {"description": "Interface cost", "format": "number", "type": "number", "maximum": 65535, "minimum": 1, "optional": true}, "database-filter": {"optional": true, "enum": ["all"], "type": "string", "description": "'all': Filter all LSA; ", "format": "enum"}, "ip-addr": {"optional": false, "type": "string", "description": "Address of interface", "format": "ipv4-address"}, "retransmit-interval": {"description": "Time between retransmitting lost link state advertisements (Seconds)", "format": "number", "default": 5, "optional": true, "maximum": 65535, "minimum": 1, "type": "number"}, "message-digest-cfg": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"md5-value": {"minLength": 1, "maxLength": 16, "type": "string", "description": "The OSPF password (1-16)", "format": "password"}, "message-digest-key": {"description": "Message digest authentication password (key) (Key id)", "minimum": 1, "type": "number", "maximum": 255, "format": "number"}, "optional": true, "encrypted": {"type": "encrypted", "description": "Do NOT use this option manually. (This is an A10 reserved keyword.) (The ENCRYPTED password string)", "format": "encrypted"}}}]}, "out": {"default": 0, "optional": true, "type": "number", "description": "Outgoing LSA", "format": "flag"}}}], "type": "array", "$ref": "/axapi/v3/interface/lif/{ifnum}/ip/ospf/ospf-ip/{ip-addr}"}, "ospf-global": {"type": "object", "properties": {"dead-interval": {"description": "Interval after which a neighbor is declared dead (Seconds)", "format": "number", "default": 40, "maximum": 65535, "minimum": 1, "type": "number"}, "authentication-key": {"minLength": 1, "maxLength": 8, "type": "string", "description": "Authentication password (key) (The OSPF password (key))", "format": "string-rlx"}, "network": {"type": "object", "properties": {"broadcast": {"default": 0, "not-list": ["non-broadcast", "point-to-point", "point-to-multipoint"], "type": "number", "description": "Specify OSPF broadcast multi-access network", "format": "flag"}, "point-to-multipoint": {"default": 0, "not-list": ["broadcast", "non-broadcast", "point-to-point"], "type": "number", "description": "Specify OSPF point-to-multipoint network", "format": "flag"}, "non-broadcast": {"default": 0, "not-list": ["broadcast", "point-to-point", "point-to-multipoint"], "type": "number", "description": "Specify OSPF NBMA network", "format": "flag"}, "point-to-point": {"default": 0, "not-list": ["broadcast", "non-broadcast", "point-to-multipoint"], "type": "number", "description": "Specify OSPF point-to-point network", "format": "flag"}, "p2mp-nbma": {"default": 0, "type": "number", "description": "Specify non-broadcast point-to-multipoint network", "format": "flag"}}}, "mtu-ignore": {"default": 0, "type": "number", "description": "Ignores the MTU in DBD packets", "format": "flag"}, "retransmit-interval": {"description": "Time between retransmitting lost link state advertisements (Seconds)", "format": "number", "default": 5, "maximum": 65535, "minimum": 1, "type": "number"}, "transmit-delay": {"description": "Link state transmit delay (Seconds)", "format": "number", "default": 1, "maximum": 65535, "minimum": 1, "type": "number"}, "uuid": {"description": "uuid of the object", "format": "string", "minLength": 1, "modify-not-allowed": 1, "maxLength": 64, "type": "string"}, "disable": {"enum": ["all"], "type": "string", "description": "'all': All functionality; ", "format": "enum"}, "authentication-cfg": {"type": "object", "properties": {"authentication": {"default": 0, "type": "number", "description": "Enable authentication", "format": "flag"}, "value": {"enum": ["message-digest", "null"], "type": "string", "description": "'message-digest': Use message-digest authentication; 'null': Use no authentication; ", "format": "enum"}}}, "database-filter-cfg": {"type": "object", "properties": {"database-filter": {"enum": ["all"], "type": "string", "description": "'all': Filter all LSA; ", "format": "enum"}, "out": {"default": 0, "type": "number", "description": "Outgoing LSA", "format": "flag"}}}, "bfd-cfg": {"type": "object", "properties": {"disable": {"default": 0, "type": "number", "description": "Disable BFD", "format": "flag"}, "bfd": {"default": 0, "type": "number", "description": "Bidirectional Forwarding Detection (BFD)", "format": "flag"}}}, "cost": {"description": "Interface cost", "minimum": 1, "type": "number", "maximum": 65535, "format": "number"}, "hello-interval": {"description": "Time between HELLO packets (Seconds)", "format": "number", "default": 10, "maximum": 65535, "minimum": 1, "type": "number"}, "mtu": {"description": "OSPF interface MTU (MTU size)", "minimum": 576, "type": "number", "maximum": 65535, "format": "number"}, "message-digest-cfg": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"message-digest-key": {"description": "Message digest authentication password (key) (Key id)", "minimum": 1, "type": "number", "maximum": 255, "format": "number"}, "optional": true, "md5": {"type": "object", "properties": {"md5-value": {"minLength": 1, "maxLength": 16, "type": "string", "description": "The OSPF password (1-16)", "format": "password"}, "encrypted": {"type": "encrypted", "description": "Do NOT use this option manually. (This is an A10 reserved keyword.) (The ENCRYPTED password string)", "format": "encrypted"}}}}}]}, "priority": {"description": "Router priority", "format": "number", "default": 1, "maximum": 255, "minimum": 0, "type": "number"}}, "$ref": "/axapi/v3/interface/lif/{ifnum}/ip/ospf/ospf-global"}}, "$ref": "/axapi/v3/interface/lif/{ifnum}/ip/ospf"}}, "$ref": "/axapi/v3/interface/lif/{ifnum}/ip"}, "sampling-enable": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"optional": true, "counters1": {"enum": ["all", "num_pkts", "num_total_bytes", "num_unicast_pkts", "num_broadcast_pkts", "num_multicast_pkts", "num_tx_pkts", "num_total_tx_bytes", "num_unicast_tx_pkts", "num_broadcast_tx_pkts", "num_multicast_tx_pkts", "dropped_dis_rx_pkts", "dropped_rx_pkts", "dropped_dis_tx_pkts", "dropped_tx_pkts"], "type": "string", "description": "'all': all; 'num_pkts': num_pkts; 'num_total_bytes': num_total_bytes; 'num_unicast_pkts': num_unicast_pkts; 'num_broadcast_pkts': num_broadcast_pkts; 'num_multicast_pkts': num_multicast_pkts; 'num_tx_pkts': num_tx_pkts; 'num_total_tx_bytes': num_total_tx_bytes; 'num_unicast_tx_pkts': num_unicast_tx_pkts; 'num_broadcast_tx_pkts': num_broadcast_tx_pkts; 'num_multicast_tx_pkts': num_multicast_tx_pkts; 'dropped_dis_rx_pkts': dropped_dis_rx_pkts; 'dropped_rx_pkts': dropped_rx_pkts; 'dropped_dis_tx_pkts': dropped_dis_tx_pkts; 'dropped_tx_pkts': dropped_tx_pkts; ", "format": "enum"}}}]}, "mtu": {"platform-specific-range": 1, "platform-specific-default": 1, "description": "Interface mtu (Interface MTU, default 1500 (min MTU is 1280 for IPv6))", "format": "number", "optional": true, "type": "number"}, "access-list": {"type": "object", "properties": {"acl-name": {"minLength": 1, "maxLength": 16, "type": "string", "description": "Apply an access list (Named Access List)", "format": "string"}, "acl-id": {"description": "ACL id", "format": "number", "maximum": 199, "$ref-list": ["/axapi/v3/access-list/standard", "/axapi/v3/access-list/extended"], "minimum": 1, "type": "number"}}}, "ifnum": {"description": "Lif interface number", "format": "number", "type": "number", "maximum": 128, "minimum": 1, "optional": false}, "action": {"description": "'enable': Enable; 'disable': Disable; ", "format": "enum", "default": "enable", "type": "string", "enum": ["enable", "disable"], "optional": true}}}], "type": "array", "$ref": "/axapi/v3/interface/lif/{ifnum}"} :param loopback_list: {"minItems": 1, "items": {"type": "loopback"}, "uniqueItems": true, "array": [{"required": ["ifnum"], "properties": {"isis": {"type": "object", "properties": {"priority-list": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"priority": {"description": "Set priority for Designated Router election (Priority value)", "format": "number", "default": 64, "maximum": 127, "minimum": 0, "type": "number"}, "optional": true, "level": {"enum": ["level-1", "level-2"], "type": "string", "description": "'level-1': Specify priority for level-1 routing; 'level-2': Specify priority for level-2 routing; ", "format": "enum"}}}]}, "retransmit-interval": {"description": "Set per-LSP retransmission interval (Interval between retransmissions of the same LSP (seconds))", "format": "number", "default": 5, "maximum": 65535, "minimum": 0, "type": "number"}, "hello-interval-minimal-list": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"hello-interval-minimal": {"default": 0, "type": "number", "description": "Set Hello holdtime 1 second, interval depends on multiplier", "format": "flag"}, "optional": true, "level": {"enum": ["level-1", "level-2"], "type": "string", "description": "'level-1': Specify hello-interval for level-1 IIHs; 'level-2': Specify hello-interval for level-2 IIHs; ", "format": "enum"}}}]}, "mesh-group": {"type": "object", "properties": {"value": {"description": "Mesh group number", "format": "number", "maximum": 4294967295, "minimum": 1, "not": "blocked", "type": "number"}, "blocked": {"default": 0, "not": "value", "type": "number", "description": "Block LSPs on this interface", "format": "flag"}}}, "uuid": {"description": "uuid of the object", "format": "string", "minLength": 1, "modify-not-allowed": 1, "maxLength": 64, "type": "string"}, "bfd-cfg": {"type": "object", "properties": {"disable": {"default": 0, "type": "number", "description": "Disable BFD", "format": "flag"}, "bfd": {"default": 0, "type": "number", "description": "Bidirectional Forwarding Detection (BFD)", "format": "flag"}}}, "lsp-interval": {"description": "Set LSP transmission interval (LSP transmission interval (milliseconds))", "format": "number", "default": 33, "maximum": 4294967295, "minimum": 1, "type": "number"}, "padding": {"default": 1, "type": "number", "description": "Add padding to IS-IS hello packets", "format": "flag"}, "password-list": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"password": {"minLength": 1, "maxLength": 254, "type": "string", "description": "Configure the authentication password for interface", "format": "string-rlx"}, "optional": true, "level": {"enum": ["level-1", "level-2"], "type": "string", "description": "'level-1': Specify password for level-1 PDUs; 'level-2': Specify password for level-2 PDUs; ", "format": "enum"}}}]}, "authentication": {"type": "object", "properties": {"key-chain-list": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"key-chain": {"minLength": 1, "maxLength": 128, "type": "string", "description": "Authentication key-chain (Name of key-chain)", "format": "string"}, "optional": true, "level": {"enum": ["level-1", "level-2"], "type": "string", "description": "'level-1': Specify authentication key-chain for level-1 PDUs; 'level-2': Specify authentication key-chain for level-2 PDUs; ", "format": "enum"}}}]}, "mode-list": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"optional": true, "mode": {"enum": ["md5"], "type": "string", "description": "'md5': Keyed message digest; ", "format": "enum"}, "level": {"enum": ["level-1", "level-2"], "type": "string", "description": "'level-1': Specify authentication mode for level-1 PDUs; 'level-2': Specify authentication mode for level-2 PDUs; ", "format": "enum"}}}]}, "send-only-list": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"send-only": {"default": 0, "type": "number", "description": "Authentication send-only", "format": "flag"}, "optional": true, "level": {"enum": ["level-1", "level-2"], "type": "string", "description": "'level-1': Specify authentication send-only for level-1 PDUs; 'level-2': Specify authentication send-only for level-2 PDUs; ", "format": "enum"}}}]}}}, "wide-metric-list": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"optional": true, "wide-metric": {"description": "Configure the wide metric for interface", "format": "number", "default": 10, "maximum": 16777214, "minimum": 1, "type": "number"}, "level": {"enum": ["level-1", "level-2"], "type": "string", "description": "'level-1': Apply metric to level-1 links; 'level-2': Apply metric to level-2 links; ", "format": "enum"}}}]}, "hello-interval-list": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"optional": true, "hello-interval": {"description": "Set Hello interval in seconds (Hello interval value)", "format": "number", "default": 10, "maximum": 65535, "minimum": 1, "type": "number"}, "level": {"enum": ["level-1", "level-2"], "type": "string", "description": "'level-1': Specify hello-interval for level-1 IIHs; 'level-2': Specify hello-interval for level-2 IIHs; ", "format": "enum"}}}]}, "circuit-type": {"default": "level-1-2", "enum": ["level-1", "level-1-2", "level-2-only"], "type": "string", "description": "'level-1': Level-1 only adjacencies are formed; 'level-1-2': Level-1-2 adjacencies are formed; 'level-2-only': Level-2 only adjacencies are formed; ", "format": "enum"}, "hello-multiplier-list": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"optional": true, "hello-multiplier": {"description": "Set multiplier for Hello holding time (Hello multiplier value)", "format": "number", "default": 3, "maximum": 100, "minimum": 2, "type": "number"}, "level": {"enum": ["level-1", "level-2"], "type": "string", "description": "'level-1': Specify hello multiplier for level-1 IIHs; 'level-2': Specify hello multiplier for level-2 IIHs; ", "format": "enum"}}}]}, "metric-list": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"metric": {"description": "Configure the metric for interface (Default metric)", "format": "number", "default": 10, "maximum": 63, "minimum": 1, "type": "number"}, "optional": true, "level": {"enum": ["level-1", "level-2"], "type": "string", "description": "'level-1': Apply metric to level-1 links; 'level-2': Apply metric to level-2 links; ", "format": "enum"}}}]}, "csnp-interval-list": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"level": {"enum": ["level-1", "level-2"], "type": "string", "description": "'level-1': Speficy interval for level-1 CSNPs; 'level-2': Specify interval for level-2 CSNPs; ", "format": "enum"}, "optional": true, "csnp-interval": {"description": "Set CSNP interval in seconds (CSNP interval value)", "format": "number", "default": 10, "maximum": 65535, "minimum": 1, "type": "number"}}}]}}, "$ref": "/axapi/v3/interface/loopback/{ifnum}/isis"}, "uuid": {"description": "uuid of the object", "format": "string", "minLength": 1, "modify-not-allowed": 1, "optional": true, "maxLength": 64, "type": "string"}, "snmp-server": {"type": "object", "properties": {"trap-source": {"default": 0, "partition-visibility": "shared", "type": "number", "description": "The trap source", "format": "flag"}}}, "ip": {"type": "object", "properties": {"address-list": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"ipv4-address": {"type": "string", "description": "IP address", "format": "ipv4-address"}, "optional": true, "ipv4-netmask": {"type": "string", "description": "IP subnet mask", "format": "ipv4-netmask"}}}]}, "ospf": {"type": "object", "properties": {"ospf-ip-list": {"minItems": 1, "items": {"type": "ospf-ip"}, "uniqueItems": true, "array": [{"required": ["ip-addr"], "properties": {"dead-interval": {"description": "Interval after which a neighbor is declared dead (Seconds)", "format": "number", "default": 40, "optional": true, "maximum": 65535, "minimum": 1, "type": "number"}, "authentication-key": {"description": "Authentication password (key) (The OSPF password (key))", "format": "string-rlx", "minLength": 1, "optional": true, "maxLength": 8, "type": "string"}, "uuid": {"description": "uuid of the object", "format": "string", "minLength": 1, "modify-not-allowed": 1, "optional": true, "maxLength": 64, "type": "string"}, "mtu-ignore": {"default": 0, "optional": true, "type": "number", "description": "Ignores the MTU in DBD packets", "format": "flag"}, "priority": {"description": "Router priority", "format": "number", "default": 1, "optional": true, "maximum": 255, "minimum": 0, "type": "number"}, "transmit-delay": {"description": "Link state transmit delay (Seconds)", "format": "number", "default": 1, "optional": true, "maximum": 65535, "minimum": 1, "type": "number"}, "value": {"optional": true, "enum": ["message-digest", "null"], "type": "string", "description": "'message-digest': Use message-digest authentication; 'null': Use no authentication; ", "format": "enum"}, "hello-interval": {"description": "Time between HELLO packets (Seconds)", "format": "number", "default": 10, "optional": true, "maximum": 65535, "minimum": 1, "type": "number"}, "authentication": {"default": 0, "optional": true, "type": "number", "description": "Enable authentication", "format": "flag"}, "cost": {"description": "Interface cost", "format": "number", "type": "number", "maximum": 65535, "minimum": 1, "optional": true}, "database-filter": {"optional": true, "enum": ["all"], "type": "string", "description": "'all': Filter all LSA; ", "format": "enum"}, "ip-addr": {"optional": false, "type": "string", "description": "Address of interface", "format": "ipv4-address"}, "retransmit-interval": {"description": "Time between retransmitting lost link state advertisements (Seconds)", "format": "number", "default": 5, "optional": true, "maximum": 65535, "minimum": 1, "type": "number"}, "message-digest-cfg": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"md5-value": {"minLength": 1, "maxLength": 16, "type": "string", "description": "The OSPF password (1-16)", "format": "password"}, "message-digest-key": {"description": "Message digest authentication password (key) (Key id)", "minimum": 1, "type": "number", "maximum": 255, "format": "number"}, "optional": true, "encrypted": {"type": "encrypted", "description": "Do NOT use this option manually. (This is an A10 reserved keyword.) (The ENCRYPTED password string)", "format": "encrypted"}}}]}, "out": {"default": 0, "optional": true, "type": "number", "description": "Outgoing LSA", "format": "flag"}}}], "type": "array", "$ref": "/axapi/v3/interface/loopback/{ifnum}/ip/ospf/ospf-ip/{ip-addr}"}, "ospf-global": {"type": "object", "properties": {"dead-interval": {"description": "Interval after which a neighbor is declared dead (Seconds)", "format": "number", "default": 40, "maximum": 65535, "minimum": 1, "type": "number"}, "authentication-key": {"minLength": 1, "maxLength": 8, "type": "string", "description": "Authentication password (key) (The OSPF password (key))", "format": "string-rlx"}, "uuid": {"description": "uuid of the object", "format": "string", "minLength": 1, "modify-not-allowed": 1, "maxLength": 64, "type": "string"}, "mtu-ignore": {"default": 0, "type": "number", "description": "Ignores the MTU in DBD packets", "format": "flag"}, "retransmit-interval": {"description": "Time between retransmitting lost link state advertisements (Seconds)", "format": "number", "default": 5, "maximum": 65535, "minimum": 1, "type": "number"}, "transmit-delay": {"description": "Link state transmit delay (Seconds)", "format": "number", "default": 1, "maximum": 65535, "minimum": 1, "type": "number"}, "disable": {"enum": ["all"], "type": "string", "description": "'all': All functionality; ", "format": "enum"}, "authentication-cfg": {"type": "object", "properties": {"authentication": {"default": 0, "type": "number", "description": "Enable authentication", "format": "flag"}, "value": {"enum": ["message-digest", "null"], "type": "string", "description": "'message-digest': Use message-digest authentication; 'null': Use no authentication; ", "format": "enum"}}}, "database-filter-cfg": {"type": "object", "properties": {"database-filter": {"enum": ["all"], "type": "string", "description": "'all': Filter all LSA; ", "format": "enum"}, "out": {"default": 0, "type": "number", "description": "Outgoing LSA", "format": "flag"}}}, "bfd-cfg": {"type": "object", "properties": {"disable": {"default": 0, "type": "number", "description": "Disable BFD", "format": "flag"}, "bfd": {"default": 0, "type": "number", "description": "Bidirectional Forwarding Detection (BFD)", "format": "flag"}}}, "cost": {"description": "Interface cost", "minimum": 1, "type": "number", "maximum": 65535, "format": "number"}, "hello-interval": {"description": "Time between HELLO packets (Seconds)", "format": "number", "default": 10, "maximum": 65535, "minimum": 1, "type": "number"}, "mtu": {"description": "OSPF interface MTU (MTU size)", "minimum": 576, "type": "number", "maximum": 65535, "format": "number"}, "message-digest-cfg": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"message-digest-key": {"description": "Message digest authentication password (key) (Key id)", "minimum": 1, "type": "number", "maximum": 255, "format": "number"}, "optional": true, "md5": {"type": "object", "properties": {"md5-value": {"minLength": 1, "maxLength": 16, "type": "string", "description": "The OSPF password (1-16)", "format": "password"}, "encrypted": {"type": "encrypted", "description": "Do NOT use this option manually. (This is an A10 reserved keyword.) (The ENCRYPTED password string)", "format": "encrypted"}}}}}]}, "priority": {"description": "Router priority", "format": "number", "default": 1, "maximum": 255, "minimum": 0, "type": "number"}}, "$ref": "/axapi/v3/interface/loopback/{ifnum}/ip/ospf/ospf-global"}}, "$ref": "/axapi/v3/interface/loopback/{ifnum}/ip/ospf"}, "uuid": {"description": "uuid of the object", "format": "string", "minLength": 1, "modify-not-allowed": 1, "maxLength": 64, "type": "string"}, "rip": {"type": "object", "properties": {"receive-cfg": {"type": "object", "properties": {"receive": {"default": 0, "type": "number", "description": "Advertisement reception", "format": "flag"}, "version": {"enum": ["1", "2", "1-2"], "type": "string", "description": "'1': RIP version 1; '2': RIP version 2; '1-2': RIP version 1 & 2; ", "format": "enum"}}}, "uuid": {"description": "uuid of the object", "format": "string", "minLength": 1, "modify-not-allowed": 1, "maxLength": 64, "type": "string"}, "receive-packet": {"default": 1, "type": "number", "description": "Enable receiving packet through the specified interface", "format": "flag"}, "split-horizon-cfg": {"type": "object", "properties": {"state": {"default": "poisoned", "enum": ["poisoned", "disable", "enable"], "type": "string", "description": "'poisoned': Perform split horizon with poisoned reverse; 'disable': Disable split horizon; 'enable': Perform split horizon without poisoned reverse; ", "format": "enum"}}}, "authentication": {"type": "object", "properties": {"key-chain": {"type": "object", "properties": {"key-chain": {"type": "string", "description": "Authentication key-chain (Name of key-chain)", "format": "string-rlx"}}}, "mode": {"type": "object", "properties": {"mode": {"default": "text", "enum": ["md5", "text"], "type": "string", "description": "'md5': Keyed message digest; 'text': Clear text authentication; ", "format": "enum"}}}, "str": {"type": "object", "properties": {"string": {"minLength": 1, "maxLength": 16, "type": "string", "description": "The RIP authentication string", "format": "string-rlx"}}}}}, "send-cfg": {"type": "object", "properties": {"version": {"enum": ["1", "2", "1-compatible", "1-2"], "type": "string", "description": "'1': RIP version 1; '2': RIP version 2; '1-compatible': RIPv1-compatible; '1-2': RIP version 1 & 2; ", "format": "enum"}, "send": {"default": 0, "type": "number", "description": "Advertisement transmission", "format": "flag"}}}, "send-packet": {"default": 1, "type": "number", "description": "Enable sending packets through the specified interface", "format": "flag"}}, "$ref": "/axapi/v3/interface/loopback/{ifnum}/ip/rip"}, "router": {"type": "object", "properties": {"isis": {"type": "object", "properties": {"tag": {"description": "ISO routing area tag", "format": "string", "minLength": 1, "modify-not-allowed": 1, "maxLength": 128, "type": "string"}, "uuid": {"description": "uuid of the object", "format": "string", "minLength": 1, "modify-not-allowed": 1, "maxLength": 64, "type": "string"}}, "$ref": "/axapi/v3/interface/loopback/{ifnum}/ip/router/isis"}}, "$ref": "/axapi/v3/interface/loopback/{ifnum}/ip/router"}}, "$ref": "/axapi/v3/interface/loopback/{ifnum}/ip"}, "ifnum": {"description": "Loopback interface number", "format": "number", "type": "number", "maximum": 10, "minimum": 0, "optional": false}, "ipv6": {"type": "object", "properties": {"uuid": {"description": "uuid of the object", "format": "string", "minLength": 1, "modify-not-allowed": 1, "maxLength": 64, "type": "string"}, "address-list": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"link-local": {"default": 0, "type": "number", "description": "Configure an IPv6 link local address", "format": "flag"}, "anycast": {"default": 0, "type": "number", "description": "Configure an IPv6 anycast address", "format": "flag"}, "ipv6-addr": {"type": "string", "description": "Set the IPv6 address of an interface", "format": "ipv6-address-plen"}, "optional": true}}]}, "rip": {"type": "object", "properties": {"split-horizon-cfg": {"type": "object", "properties": {"state": {"default": "poisoned", "enum": ["poisoned", "disable", "enable"], "type": "string", "description": "'poisoned': Perform split horizon with poisoned reverse; 'disable': Disable split horizon; 'enable': Perform split horizon without poisoned reverse; ", "format": "enum"}}}, "uuid": {"description": "uuid of the object", "format": "string", "minLength": 1, "modify-not-allowed": 1, "maxLength": 64, "type": "string"}}, "$ref": "/axapi/v3/interface/loopback/{ifnum}/ipv6/rip"}, "ipv6-enable": {"default": 0, "type": "number", "description": "Enable IPv6 processing", "format": "flag"}, "router": {"type": "object", "properties": {"ripng": {"type": "object", "properties": {"uuid": {"description": "uuid of the object", "format": "string", "minLength": 1, "modify-not-allowed": 1, "maxLength": 64, "type": "string"}, "rip": {"default": 0, "type": "number", "description": "RIP Routing for IPv6", "format": "flag"}}, "$ref": "/axapi/v3/interface/loopback/{ifnum}/ipv6/router/ripng"}, "ospf": {"type": "object", "properties": {"area-list": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"area-id-addr": {"type": "string", "description": "OSPF area ID in IP address format", "format": "ipv4-address"}, "tag": {"minLength": 1, "maxLength": 128, "type": "string", "description": "Set the OSPFv3 process tag", "format": "string"}, "optional": true, "instance-id": {"description": "Set the interface instance ID", "format": "number", "default": 0, "maximum": 255, "minimum": 0, "type": "number"}, "area-id-num": {"description": "OSPF area ID as a decimal value", "minimum": 0, "type": "number", "maximum": 4294967295, "format": "number"}}}]}, "uuid": {"description": "uuid of the object", "format": "string", "minLength": 1, "modify-not-allowed": 1, "maxLength": 64, "type": "string"}}, "$ref": "/axapi/v3/interface/loopback/{ifnum}/ipv6/router/ospf"}, "isis": {"type": "object", "properties": {"tag": {"description": "ISO routing area tag", "format": "string", "minLength": 1, "modify-not-allowed": 1, "maxLength": 128, "type": "string"}, "uuid": {"description": "uuid of the object", "format": "string", "minLength": 1, "modify-not-allowed": 1, "maxLength": 64, "type": "string"}}, "$ref": "/axapi/v3/interface/loopback/{ifnum}/ipv6/router/isis"}}, "$ref": "/axapi/v3/interface/loopback/{ifnum}/ipv6/router"}, "ospf": {"type": "object", "properties": {"uuid": {"description": "uuid of the object", "format": "string", "minLength": 1, "modify-not-allowed": 1, "maxLength": 64, "type": "string"}, "bfd": {"default": 0, "type": "number", "description": "Bidirectional Forwarding Detection (BFD)", "format": "flag"}, "cost-cfg": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"cost": {"description": "Interface cost", "minimum": 1, "type": "number", "maximum": 65535, "format": "number"}, "optional": true, "instance-id": {"description": "Specify the interface instance ID", "format": "number", "default": 0, "maximum": 255, "minimum": 0, "type": "number"}}}]}, "hello-interval-cfg": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"optional": true, "hello-interval": {"description": "Time between HELLO packets (Seconds)", "format": "number", "default": 10, "maximum": 65535, "minimum": 1, "type": "number"}, "instance-id": {"description": "Specify the interface instance ID", "format": "number", "default": 0, "maximum": 255, "minimum": 0, "type": "number"}}}]}, "priority-cfg": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"priority": {"description": "Router priority", "format": "number", "default": 1, "maximum": 255, "minimum": 0, "type": "number"}, "optional": true, "instance-id": {"description": "Specify the interface instance ID", "format": "number", "default": 0, "maximum": 255, "minimum": 0, "type": "number"}}}]}, "mtu-ignore-cfg": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"mtu-ignore": {"default": 0, "type": "number", "description": "Ignores the MTU in DBD packets", "format": "flag"}, "optional": true, "instance-id": {"description": "Specify the interface instance ID", "format": "number", "default": 0, "maximum": 255, "minimum": 0, "type": "number"}}}]}, "retransmit-interval-cfg": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"retransmit-interval": {"description": "Time between retransmitting lost link state advertisements (Seconds)", "format": "number", "default": 5, "maximum": 65535, "minimum": 1, "type": "number"}, "optional": true, "instance-id": {"description": "Specify the interface instance ID", "format": "number", "default": 0, "maximum": 255, "minimum": 0, "type": "number"}}}]}, "disable": {"default": 0, "type": "number", "description": "Disable BFD", "format": "flag"}, "transmit-delay-cfg": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"optional": true, "transmit-delay": {"description": "Link state transmit delay (Seconds)", "format": "number", "default": 1, "maximum": 65535, "minimum": 1, "type": "number"}, "instance-id": {"description": "Specify the interface instance ID", "format": "number", "default": 0, "maximum": 255, "minimum": 0, "type": "number"}}}]}, "dead-interval-cfg": {"minItems": 1, "items": {"type": "object"}, "uniqueItems": true, "type": "array", "array": [{"properties": {"dead-interval": {"description": "Interval after which a neighbor is declared dead (Seconds)", "format": "number", "default": 40, "maximum": 65535, "minimum": 1, "type": "number"}, "optional": true, "instance-id": {"description": "Specify the interface instance ID", "format": "number", "default": 0, "maximum": 255, "minimum": 0, "type": "number"}}}]}}, "$ref": "/axapi/v3/interface/loopback/{ifnum}/ipv6/ospf"}}, "$ref": "/axapi/v3/interface/loopback/{ifnum}/ipv6"}}}], "type": "array", "$ref": "/axapi/v3/interface/loopback/{ifnum}"} :param DeviceProxy: The device proxy for REST operations and session handling. Refer to `common/device_proxy.py` Class Description:: Select an interface to configure. Class interface supports CRUD Operations and inherits from `common/A10BaseClass`. This class is the `"PARENT"` class for this module.` URL for this object:: `https://<Hostname|Ip address>//axapi/v3/interface`. """
[ 6738, 257, 940, 21282, 74, 13, 11321, 13, 32, 940, 14881, 9487, 1330, 317, 940, 14881, 9487, 628, 198, 4871, 26491, 7, 32, 940, 14881, 9487, 2599, 198, 220, 220, 220, 220, 198, 220, 220, 220, 37227, 220, 220, 220, 1058, 17143, 13275...
3.233933
55,952
import badge, gc, uos badge.mount_root() uos.mount(uos.VfsNative(None), '/') try: uos.mkdir('/lib') except: pass gc.collect()
[ 11748, 23009, 11, 308, 66, 11, 334, 418, 198, 198, 14774, 469, 13, 14948, 62, 15763, 3419, 198, 84, 418, 13, 14948, 7, 84, 418, 13, 53, 9501, 31272, 7, 14202, 828, 31051, 11537, 198, 198, 28311, 25, 198, 197, 84, 418, 13, 28015, ...
2.112903
62
import collections import logging import urllib.parse from structlog import wrap_logger from secure_message.constants import MESSAGE_BY_ID_ENDPOINT, MESSAGE_LIST_ENDPOINT, MESSAGE_QUERY_LIMIT from secure_message.services.service_toggles import party, internal_user_service logger = wrap_logger(logging.getLogger(__name__)) MessageArgs = collections.namedtuple( 'MessageArgs', 'page limit business_id surveys cc label desc ce is_closed my_conversations new_respondent_conversations all_conversation_types unread_conversations') def get_options(args): # NOQA pylint:disable=too-complex """extract options from request , allow label to be set by caller :param args: contains search arguments. Not all end points support all args :returns: MessageArgs named tuple containing the args for the search business_id If set , restricts search to conversations regarding this specific party id surveys If set allows the count to be restricted by a list of survey_ids cc If set , allows the count to be restricted by a particular case ce If set, alows the count to be restricted by a particular collection exercise is_closed If set to 'true' only counts closed conversations, else only open conversations my_conversations If set to 'true only counts my conversations. I.e conversations where the current user id is the to actor id new_respondent_conversations If set to 'true'only counts conversations where the to actor is set to 'GROUP' all_conversation_types If set 'true', overrides is_closed, my_conversations and new_respondent_conversations and returns 4 counts 1 for each of , open , closed, my_conversations and new_respondent_conversations page If set requests the specific page of information to return limit If set it sets the maximum number of results to return desc If present, requests the information in descending order """ fields = {'page': 1, 'limit': MESSAGE_QUERY_LIMIT, 'business_id': None, 'surveys': None, 'desc': True, 'cc': None, 'label': None, 'ce': None, 'is_closed': False, 'my_conversations': False, 'new_respondent_conversations': False, 'all_conversation_types': False, 'unread_conversations': False} for field in ['cc', 'ce', 'business_id', 'label']: if args.get(field): fields[field] = str(args.get(field)) fields['surveys'] = args.getlist('survey') for field in ['limit', 'page']: if args.get(field): fields[field] = int(args.get(field)) if args.get('desc') == 'false': fields['desc'] = False if args.get('is_closed') == 'true': fields['is_closed'] = True if args.get('my_conversations') == 'true': fields['my_conversations'] = True if args.get('new_respondent_conversations') == 'true': fields['new_respondent_conversations'] = True if args.get('all_conversation_types') == 'true': fields['all_conversation_types'] = True if args.get('unread_conversations') == 'true': fields['unread_conversations'] = True return MessageArgs(page=fields['page'], limit=fields['limit'], business_id=fields['business_id'], surveys=fields['surveys'], cc=fields['cc'], label=fields['label'], desc=fields['desc'], ce=fields['ce'], is_closed=fields['is_closed'], my_conversations=fields['my_conversations'], new_respondent_conversations=fields['new_respondent_conversations'], all_conversation_types=fields['all_conversation_types'], unread_conversations=fields['unread_conversations']) def set_conversation_type_args(existing_args, is_closed=False, my_conversations=False, new_conversations=False, all_types=False, unread_conversations=False): """Returns a new set of args based on the existing args which are a named tuple, but allow the conversation type only to be changed""" return MessageArgs(page=existing_args.page, limit=existing_args.limit, business_id=existing_args.business_id, surveys=existing_args.surveys, cc=existing_args.cc, label=existing_args.label, desc=existing_args.desc, ce=existing_args.ce, is_closed=is_closed, my_conversations=my_conversations, new_respondent_conversations=new_conversations, all_conversation_types=all_types, unread_conversations=unread_conversations) def process_paginated_list(paginated_list, host_url, user, message_args, endpoint=MESSAGE_LIST_ENDPOINT, body_summary=True): """used to change a pagination object to json format with links""" messages = [] string_query_args = generate_string_query_args(message_args) for message in paginated_list.items: msg = message.serialize(user, body_summary=body_summary) msg['_links'] = {"self": {"href": f"{host_url}{MESSAGE_BY_ID_ENDPOINT}/{msg['msg_id']}"}} messages.append(msg) links = {'first': {"href": f"{host_url}{endpoint}"}, 'self': {"href": f"{host_url}{endpoint}?{string_query_args}&page={message_args.page}"}} if paginated_list.has_next: links['next'] = { "href": f"{host_url}{endpoint}?{string_query_args}&page={message_args.page + 1}"} if paginated_list.has_prev: links['prev'] = { "href": f"{host_url}{endpoint}?{string_query_args}&page={message_args.page - 1}"} return messages, links def add_to_details(messages): """Adds a @msg_to key to every message in a list of messages. Every msg_to uuid is resolved to include details of the user. If the call for the internal user id fails, an exception will be thrown. If the external user id cannot be found in the list that we got from the party service. There won't be a @msg_to value returned in the payload. The API documentation notes that these elements aren't guaranteed to be provided so we're not breaking the contract by doing this. Note: Several of these lines of code could be combined into a more succinct view, spreading them out is deliberate so that log stack traces are better able to identify the cause of log errors """ external_user_details = {} for user in party.get_users_details(get_external_user_uuid_list(messages)): external_user_details[user['id']] = user for message in messages: try: msg_to = message["msg_to"][0] from_internal = message["from_internal"] if not from_internal: msg_to_details = internal_user_service.get_user_details(msg_to) message.update({"@msg_to": [msg_to_details]}) else: msg_to_details = external_user_details.get(msg_to) if msg_to_details: message.update({'@msg_to': [msg_to_details]}) else: logger.info("No details found for the message recipient", msg_to=msg_to) except IndexError: logger.exception("Exception adding to details", msg_to=msg_to, from_internal=from_internal) raise return messages def add_from_details(messages): """Adds a @msg_from key to every message in a list of messages. Every msg_to uuid is resolved to include details of the user. If the call for the internal user id fails, an exception will be thrown. If the external user id cannot be found in the list that we got from the party service. There won't be a @msg_from value returned in the payload. The API documentation notes that these elements aren't guaranteed to be provided so we're not breaking the contract by doing this. """ external_user_details = {} for user in party.get_users_details(get_external_user_uuid_list(messages)): external_user_details[user['id']] = user for message in messages: try: msg_from = message["msg_from"] from_internal = message["from_internal"] if from_internal: message.update({"@msg_from": internal_user_service.get_user_details(msg_from)}) else: if external_user_details.get(message['msg_from']): message.update({'@msg_from': external_user_details.get(msg_from)}) except IndexError: logger.exception("Exception adding from details message", msg_from=msg_from, from_internal=from_internal) raise return messages def get_external_user_uuid_list(messages): """Compiles a list of all unique the external user (respondent) uuids from a list of messages""" external_user_uuids = set() external_msgs = [message for message in messages if message['from_internal'] is False] for message in external_msgs: external_user_uuids.add(message["msg_from"]) internal_messages = [message for message in messages if message['from_internal'] is True] for uuid in internal_messages: external_user_uuids.add(uuid["msg_to"][0]) return external_user_uuids def add_business_details(messages): """Adds a @business_details key to every message in a list of messages.""" business_ids = set() for message in messages: business_ids.add(message['business_id']) business_details = party.get_business_details(business_ids) for message in messages: message['@business_details'] = next((business for business in business_details if business["id"] == message['business_id']), None) return messages def add_users_and_business_details(messages): """Add both user and business details to messages based on data from party service""" if not messages: raise ValueError('messages is a required parameter and must not be empty') messages = add_to_details(messages) messages = add_from_details(messages) logger.info("Successfully added to and from details") messages = add_business_details(messages) logger.info("Successfully added business details") return messages
[ 11748, 17268, 198, 11748, 18931, 198, 11748, 2956, 297, 571, 13, 29572, 198, 198, 6738, 2878, 6404, 1330, 14441, 62, 6404, 1362, 198, 198, 6738, 5713, 62, 20500, 13, 9979, 1187, 1330, 337, 1546, 4090, 8264, 62, 17513, 62, 2389, 62, 16...
2.615677
3,942
import pytest from lhotse.cut import CutSet from lhotse.dataset import SpeechRecognitionDataset @pytest.fixture
[ 11748, 12972, 9288, 198, 198, 6738, 300, 8940, 325, 13, 8968, 1330, 9712, 7248, 198, 6738, 300, 8940, 325, 13, 19608, 292, 316, 1330, 24709, 6690, 2360, 653, 27354, 292, 316, 628, 198, 31, 9078, 9288, 13, 69, 9602, 628 ]
2.9
40
# Count letters using a dictionary text='The quick brown fox jumped over the lazy dog' text=text.upper() counter=dict() for i in text: counter[i]=text.count(i) print(counter)
[ 2, 2764, 7475, 1262, 257, 22155, 198, 5239, 11639, 464, 2068, 7586, 21831, 11687, 625, 262, 16931, 3290, 6, 198, 5239, 28, 5239, 13, 45828, 3419, 198, 24588, 28, 11600, 3419, 198, 1640, 1312, 287, 2420, 25, 198, 220, 220, 220, 3753, ...
3.178571
56
import os import sys import pickle import numpy as np from astrodash.download_data_files import download_all_files from astrodash.restore_model import LoadInputSpectra, BestTypesListSingleRedshift, get_training_parameters, \ classification_split from astrodash.false_positive_rejection import RlapCalc, combined_prob from astrodash.read_binned_templates import load_templates, get_templates from astrodash.calculate_redshift import get_median_redshift from astrodash.read_from_catalog import catalogDict try: from PyQt5 import QtWidgets from astrodash.gui_main import MainApp except ImportError: print("Warning: You will need to install 'PyQt5' if you want to use the graphical interface. " "Using the automatic library will continue to work.") # # EXAMPLE USAGE: # classification = Classify(filenames=['/Users/dmuthukrishna/Users/dmuthukrishna/DES16E1dic_E1_combined_161125_v10_b00.dat', # '/Users/dmuthukrishna/Users/dmuthukrishna/DES16E1dic_E1_combined_161125_v10_b00.dat'], # redshifts=[0.34, 0.13]) # print(classification.list_best_matches())
[ 11748, 28686, 198, 11748, 25064, 198, 11748, 2298, 293, 198, 11748, 299, 32152, 355, 45941, 198, 6738, 6468, 14892, 1077, 13, 15002, 62, 7890, 62, 16624, 1330, 4321, 62, 439, 62, 16624, 198, 6738, 6468, 14892, 1077, 13, 2118, 382, 62, ...
2.608696
437
''' Created by auto_sdk on 2020.07.28 ''' from dingtalk.api.base import RestApi
[ 7061, 6, 198, 41972, 416, 8295, 62, 21282, 74, 319, 12131, 13, 2998, 13, 2078, 198, 7061, 6, 198, 6738, 44852, 16620, 13, 15042, 13, 8692, 1330, 8324, 32, 14415, 198 ]
2.580645
31
from __future__ import annotations import typing as t if t.TYPE_CHECKING: from swagger_marshmallow_codegen.driver import Driver if __name__ == "__main__": from swagger_marshmallow_codegen.cmd import main main(setup)
[ 6738, 11593, 37443, 834, 1330, 37647, 198, 11748, 19720, 355, 256, 198, 198, 361, 256, 13, 25216, 62, 50084, 2751, 25, 198, 220, 220, 220, 422, 1509, 7928, 62, 76, 5406, 42725, 62, 8189, 5235, 13, 26230, 1330, 12434, 628, 198, 198, ...
2.949367
79
# coding: utf-8 # In[4]: import getopt import itertools import json import sys # In[2]: # In[5]: if __name__ == "__main__": try: opts,args = getopt.getopt(sys.argv[1:],'i:o:m:',['input','output','model']) except getopt.GetoptError as err: # print help information and exit: print(err) # will print something like "option -a not recognized" usage() sys.exit(2) data_file_in,data_file_out,model_file = None,None,None for o,a in opts: if o in ['-i', '--input']: data_file_in = a if o in ['-o', '--output']: data_file_out = a if o in ['-m', '--model']: model_file = a if data_file_in and data_file_out and model_file: apply_model(model_file,data_file_in,data_file_out) else: usage() # In[ ]:
[ 198, 2, 19617, 25, 3384, 69, 12, 23, 198, 198, 2, 554, 58, 19, 5974, 198, 198, 11748, 651, 8738, 198, 11748, 340, 861, 10141, 198, 11748, 33918, 198, 11748, 25064, 628, 198, 2, 554, 58, 17, 5974, 628, 198, 2, 554, 58, 20, 5974, ...
2.061275
408
from setuptools import setup from setuptools import find_packages long_description = ''' Python module to Convert a PDF file to a JSON format The goal is to be able to quickly extract all the available information in the document to a python dictionay. The dictionay can then be stored in a database or a csv file (for a later Machine Learning processing). The extracted information can be : * Document metadata : title, format, versino, creation date, author * Page images * Page texts (in Unicode) and attirbutes (fonts etc) This tool uses the excellent [poppler](https://poppler.freedesktop.org/) library. It is initially intended for multilingual PDF document processing. ''' setup(name='pdf_to_json', version='0.1', description='Convert a PDF file to a JSON format', long_description=long_description, author='Antoine CARME', author_email='Antoine.Carme@laposte.net', url='https://github.com/antoinecarme/pdf_to_json', license='BSD', install_requires=['PyGObject'], extras_require={ }, classifiers=[ 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Programming Language :: Python :: 3.6', 'Topic :: Software Development :: Libraries', 'Topic :: Software Development :: Libraries :: Python Modules' ], packages=find_packages())
[ 6738, 900, 37623, 10141, 1330, 9058, 198, 6738, 900, 37623, 10141, 1330, 1064, 62, 43789, 198, 198, 6511, 62, 11213, 796, 705, 7061, 198, 37906, 8265, 284, 38240, 257, 220, 12960, 2393, 284, 257, 19449, 5794, 198, 198, 464, 3061, 318, ...
3.034783
460
from core.services import postgres from werkzeug.security import generate_password_hash from werkzeug.security import check_password_hash
[ 6738, 4755, 13, 30416, 1330, 1281, 34239, 198, 6738, 266, 9587, 2736, 1018, 13, 12961, 1330, 7716, 62, 28712, 62, 17831, 198, 6738, 266, 9587, 2736, 1018, 13, 12961, 1330, 2198, 62, 28712, 62, 17831, 628 ]
3.861111
36
from spyd.registry_manager import register @register('client_message_handler')
[ 6738, 599, 5173, 13, 2301, 4592, 62, 37153, 1330, 7881, 628, 198, 31, 30238, 10786, 16366, 62, 20500, 62, 30281, 11537, 198 ]
3.681818
22
""" Click commands for ``bob.bio.base`` """ import click from . import figure as bio_figure from bob.bio.base.score import iscsv import bob.measure.script.figure as measure_figure from ..score import load from bob.measure.script import common_options from bob.extension.scripts.click_helper import verbosity_option SCORE_FORMAT = ( "Files must be 4- or 5- columns format, see " ":py:func:`bob.bio.base.score.load.four_column` and " ":py:func:`bob.bio.base.score.load.five_column` for details." ) CRITERIA = ("eer", "min-hter", "far", "mindcf", "cllr", "rr") def rank_option(**kwargs): """Get option for rank parameter""" return custom_rank_option @common_options.metrics_command( common_options.METRICS_HELP.format( names="FtA, FAR, FRR, FMR, FMNR, HTER", criteria=CRITERIA, score_format=SCORE_FORMAT, hter_note="Note that FAR = FMR * (1 - FtA), FRR = FtA + FMNR * (1 - FtA) " "and HTER = (FMR + FMNR) / 2", command="bob bio metrics", ), criteria=CRITERIA, ) @common_options.cost_option() @common_options.roc_command( common_options.ROC_HELP.format(score_format=SCORE_FORMAT, command="bob bio roc") ) @common_options.det_command( common_options.DET_HELP.format(score_format=SCORE_FORMAT, command="bob bio det") ) @common_options.epc_command( common_options.EPC_HELP.format(score_format=SCORE_FORMAT, command="bob bio epc") ) @common_options.hist_command( common_options.HIST_HELP.format(score_format=SCORE_FORMAT, command="bob bio hist") ) @common_options.evaluate_command( common_options.EVALUATE_HELP.format( score_format=SCORE_FORMAT, command="bob bio evaluate" ), criteria=CRITERIA, ) @common_options.cost_option() @common_options.multi_metrics_command( common_options.MULTI_METRICS_HELP.format( names="FtA, FAR, FRR, FMR, FMNR, HTER", criteria=CRITERIA, score_format=SCORE_FORMAT, command="bob bio multi-metrics", ), criteria=CRITERIA, ) @click.command() @common_options.scores_argument(nargs=-1) @common_options.titles_option() @common_options.legends_option() @common_options.sep_dev_eval_option() @common_options.output_plot_file_option(default_out="cmc.pdf") @common_options.eval_option() @common_options.semilogx_option(True) @common_options.axes_val_option(dflt=None) @common_options.x_rotation_option() @common_options.const_layout_option() @common_options.style_option() @common_options.linestyles_option() @common_options.figsize_option() @verbosity_option() @click.pass_context def cmc(ctx, scores, evaluation, **kargs): """Plot CMC (cumulative match characteristic curve). graphical presentation of results of an identification task eval, plotting rank values on the x-axis and the probability of correct identification at or below that rank on the y-axis. The values for the axis will be computed using :py:func:`bob.measure.cmc`. You need to provide one or more development score file(s) for each experiment. You can also provide eval files along with dev files. If eval-scores are used, the flag `--eval` must be used. is required in that case. Files must be 4- or 5- columns format, see :py:func:`bob.bio.base.score.load.four_column` and :py:func:`bob.bio.base.score.load.five_column` for details. Examples: $ bob bio cmc -v dev-scores $ bob bio cmc -v dev-scores1 eval-scores1 dev-scores2 eval-scores2 $ bob bio cmc -v -o my_roc.pdf dev-scores1 eval-scores1 """ process = bio_figure.Cmc(ctx, scores, evaluation, load.cmc) process.run() @click.command() @common_options.scores_argument(nargs=-1) @common_options.titles_option() @common_options.legends_option() @common_options.sep_dev_eval_option() @common_options.output_plot_file_option(default_out="dir.pdf") @common_options.eval_option() @common_options.semilogx_option(True) @common_options.axes_val_option(dflt=None) @common_options.x_rotation_option() @rank_option() @common_options.const_layout_option() @common_options.style_option() @common_options.linestyles_option() @common_options.figsize_option() @common_options.min_far_option() @verbosity_option() @click.pass_context def dir(ctx, scores, evaluation, **kargs): """Plots the Detection & Identification Rate curve over the FAR. This curve is designed to be used in an open set identification protocol, and defined in Chapter 14.1 of [LiJain2005]_. It requires to have at least one open set probe item, i.e., with no corresponding gallery, such that the positives for that pair are ``None``. The detection and identification curve first computes FAR thresholds based on the out-of-set probe scores (negative scores). For each probe item, the **maximum** negative score is used. Then, it plots the detection and identification rates for those thresholds, which are based on the in-set probe scores only. See [LiJain2005]_ for more details. .. [LiJain2005] **Stan Li and Anil K. Jain**, *Handbook of Face Recognition*, Springer, 2005 You need to provide one or more development score file(s) for each experiment. You can also provide eval files along with dev files. If eval-scores are used, the flag `--eval` must be used. is required in that case. Files must be 4- or 5- columns format, see :py:func:`bob.bio.base.score.load.four_column` and :py:func:`bob.bio.base.score.load.five_column` for details. Examples: $ bob bio dir -e -v dev-scores $ bob bio dir -v dev-scores1 eval-scores1 dev-scores2 eval-scores2 $ bob bio dir -v -o my_roc.pdf dev-scores1 eval-scores1 """ process = bio_figure.Dir(ctx, scores, evaluation, load.cmc) process.run()
[ 37811, 6914, 9729, 329, 7559, 65, 672, 13, 65, 952, 13, 8692, 15506, 37227, 198, 198, 11748, 3904, 198, 6738, 764, 1330, 3785, 355, 13401, 62, 26875, 198, 6738, 29202, 13, 65, 952, 13, 8692, 13, 26675, 1330, 318, 40664, 198, 11748, ...
2.69195
2,149
#Import modules from tkinter import * from tkinter.ttk import * import tkinter as tk #Variables #window = tk.Tk() # Window tabs #tab_control = Notebook(window) #apps_tab = Frame(tab_control) #tree = Treeview(apps_tab) #Functions
[ 2, 20939, 13103, 198, 6738, 256, 74, 3849, 1330, 1635, 198, 6738, 256, 74, 3849, 13, 926, 74, 1330, 1635, 198, 11748, 256, 74, 3849, 355, 256, 74, 198, 198, 2, 23907, 2977, 198, 2, 17497, 796, 256, 74, 13, 51, 74, 3419, 198, 2, ...
2.655172
87
import argparse import subprocess def run_original(args: argparse.Namespace) -> None: """Runs quality measurements using the original algorithms. Parameters ---------- args : argparse.Namespace Metrics configuration arguments. """ metrics = [] if args.crossings: metrics.append('cr') if args.edge_uniformity: metrics.append('ue') if args.stress: metrics.append('st') if args.neighbor_preservation: metrics.append('np') if args.bounding_box: metrics.append('bb') if args.upward_flow: metrics.append('upflow') if args.label_bounding_box: metrics.append('lblbb') if args.label_area: metrics.append('lblarea') prog = 'python3' module = '-msrc.quality_measurement.original.metricscomputer' prog_args = [args.input, args.output, ','.join(metrics)] subprocess.run([prog, module] + prog_args) def setup_cmdline() -> argparse.ArgumentParser: """Setup command line argument parser. Returns ------- argparse.ArgumentParser Fully initialized argument parser. """ parser = argparse.ArgumentParser(prog='quality_measurement', description='Run quality measurements') parser.add_argument('input', help='File to measure') parser.add_argument('output', help='File to write results') group = parser.add_argument_group('metrics') group.add_argument('--crossings', '--cr', action='store_true', help='Measure # crossings') group.add_argument('--edge-uniformity', '--eu', action='store_true', help='Measure edge length uniformity') group.add_argument('--stress', '--st', action='store_true', help='Measure stress') group.add_argument('--neighbor-preservation', '--np', action='store_true', help='Measure neighbor preservations') group.add_argument('--bounding-box', '--bb', action='store_true', help='Measure bounding box') group.add_argument('--upward-flow', '--uf', action='store_true', help='Measure upwards flow') group.add_argument('--label-bounding-box', '--lbb', action='store_true', help='Measure label bounding box ratios') group.add_argument('--label-area', '--la', action='store_true', help='Measure label area') return parser # Main execution flow if __name__ == '__main__': args = setup_cmdline().parse_args() run_original(args)
[ 11748, 1822, 29572, 198, 11748, 850, 14681, 628, 198, 4299, 1057, 62, 14986, 7, 22046, 25, 1822, 29572, 13, 36690, 10223, 8, 4613, 6045, 25, 198, 220, 220, 220, 37227, 10987, 82, 3081, 13871, 1262, 262, 2656, 16113, 13, 628, 220, 220,...
2.448341
1,055
# Some comment
[ 198, 2, 2773, 2912, 198 ]
3.2
5
import pandas
[ 11748, 19798, 292, 628 ]
3.75
4
import pandas as pd import trackintel as ti @pd.api.extensions.register_dataframe_accessor("as_positionfixes") class PositionfixesAccessor(object): """A pandas accessor to treat (Geo)DataFrames as collections of positionfixes. This will define certain methods and accessors, as well as make sure that the DataFrame adheres to some requirements. Requires at least the following columns: ``['user_id', 'tracked_at']`` Requires valid ``point geometries``; the ``index`` of the GeoDataFrame will be treated as unique identifier of the `Positionfixes` For several usecases, the following additional columns are required: ``['elevation', 'accuracy', 'tracking_tech', 'context', 'staypoint_id', 'tripleg_id']`` Notes ------- In GPS based movement data analysis `Positionfixes` are the smallest unit of tracking and represent timestamped locations. ``tracked_at`` is a timezone aware pandas datetime object. Examples -------- >>> df.as_positionfixes.generate_staypoints() """ required_columns = ['user_id', 'tracked_at'] @staticmethod @property def center(self): """Returns the center coordinate of this collection of positionfixes.""" lat = self._obj.geometry.y lon = self._obj.geometry.x return (float(lon.mean()), float(lat.mean())) def generate_staypoints(self, *args, **kwargs): """Generates staypoints from this collection of positionfixes. See :func:`trackintel.preprocessing.positionfixes.generate_staypoints`.""" return ti.preprocessing.positionfixes.generate_staypoints(self._obj, *args, **kwargs) def generate_triplegs(self, staypoints=None, *args, **kwargs): """Generates triplegs from this collection of positionfixes. See :func:`trackintel.preprocessing.positionfixes.generate_triplegs`. """ return ti.preprocessing.positionfixes.generate_triplegs(self._obj, staypoints, *args, **kwargs) def generate_staypoints_and_triplegs(self, *args, **kwargs): """Generates staypoints, uses them to build triplegs, and builds all associations with the original positionfixes (i.e., returning everything in accordance with the trackintel :doc:`/content/data_model_sql`). Might never be implemented as you can just manually first call ``extract_staypoints`` and then ``extract_triplegs``. Returns ------- tuple A tuple consisting of (positionfixes, staypoints, triplegs). """ return NotImplementedError def plot(self, *args, **kwargs): """Plots this collection of positionfixes. See :func:`trackintel.visualization.positionfixes.plot_positionfixes`.""" ti.visualization.positionfixes.plot_positionfixes(self._obj, *args, **kwargs) def to_csv(self, filename, *args, **kwargs): """Stores this collection of trackpoints as a CSV file. See :func:`trackintel.io.file.write_positionfixes_csv`.""" ti.io.file.write_positionfixes_csv(self._obj, filename, *args, **kwargs) def to_postgis(self, conn_string, table_name, schema=None, sql_chunksize=None, if_exists='replace'): """Stores this collection of positionfixes to PostGIS. See :func:`trackintel.io.postgis.write_positionfixes_postgis`.""" ti.io.postgis.write_positionfixes_postgis(self._obj, conn_string, table_name, schema, sql_chunksize, if_exists) def similarity_matrix(self, method, field='tripleg_id', trsh=None, eps=None, dist=False, **kwargs): """Calculates Similarity (/distance) matrix. See: func: 'trackintel.similarity.detection.similarity_matrix' """ return ti.similarity.similarity_matrix(self._obj, method, field, trsh, eps, dist, **kwargs)
[ 11748, 19798, 292, 355, 279, 67, 198, 198, 11748, 2610, 48779, 355, 46668, 628, 198, 31, 30094, 13, 15042, 13, 2302, 5736, 13, 30238, 62, 7890, 14535, 62, 15526, 273, 7203, 292, 62, 9150, 42624, 4943, 198, 4871, 23158, 42624, 15457, 2...
2.718991
1,427
from __future__ import absolute_import, unicode_literals from django import forms from .models import EventCategory from .utils import today class GridFilterForm(forms.Form): """ Collection of fields to filter EventDateTimes in the grid view. """ categories = forms.ModelMultipleChoiceField( queryset=EventCategory.objects.all(), widget=forms.widgets.CheckboxSelectMultiple, required=False, ) def filter(self, qs): """ Filter Events according to the field values. """ categories = self.cleaned_data["categories"] if categories: qs = qs.filter(event__categories__in=categories) return qs class ListFilterForm(GridFilterForm): """ Collection of fields to filter EventDateTimes in the list view. This is used to determine the start and end of the events shown. """ start_day = forms.DateField(input_formats=["%m/%d/%Y"], required=False) end_day = forms.DateField(input_formats=["%m/%d/%Y"], required=False) field_order = ("start_day", "end_day", "categories") # Set order def clean(self): """ Validate start/end days. Ideally start_day should always be defined no matter what the user enters to ensure the list view doesn't display all events ever. """ cleaned_data = super(ListFilterForm, self).clean() # Always set a value for start_day start = cleaned_data.get("start_day") or today() end = cleaned_data.get("end_day") if end is not None and end < start: end = None cleaned_data.update({"start_day": start, "end_day": end}) return cleaned_data
[ 6738, 11593, 37443, 834, 1330, 4112, 62, 11748, 11, 28000, 1098, 62, 17201, 874, 198, 198, 6738, 42625, 14208, 1330, 5107, 198, 198, 6738, 764, 27530, 1330, 8558, 27313, 198, 6738, 764, 26791, 1330, 1909, 628, 198, 4871, 24846, 22417, 8...
2.642415
646
# DataviewQueryQuery.py # # Copyright (C) 2018 OSIsoft, LLC. All rights reserved. # # THIS SOFTWARE CONTAINS CONFIDENTIAL INFORMATION AND TRADE SECRETS OF # OSIsoft, LLC. USE, DISCLOSURE, OR REPRODUCTION IS PROHIBITED WITHOUT # THE PRIOR EXPRESS WRITTEN PERMISSION OF OSIsoft, LLC. # # RESTRICTED RIGHTS LEGEND # Use, duplication, or disclosure by the Government is subject to restrictions # as set forth in subparagraph (c)(1)(ii) of the Rights in Technical Data and # Computer Software clause at DFARS 252.227.7013 # # OSIsoft, LLC # 1600 Alvarado St, San Leandro, CA 94577 import json class DataviewQueryQuery(object): """ dataview query definition """ @property @Type.setter @property @Value.setter @property @Operator.setter @staticmethod @staticmethod
[ 2, 16092, 615, 769, 20746, 20746, 13, 9078, 198, 2, 198, 2, 15069, 357, 34, 8, 2864, 7294, 40, 4215, 11, 11419, 13, 1439, 2489, 10395, 13, 198, 2, 198, 2, 12680, 47466, 7102, 5603, 20913, 7102, 37, 25256, 12576, 38044, 5357, 7579, ...
2.863158
285
#!/usr/bin/env python3 help_text=""" This program takes a Rekorxdbox XML and adds beatmarkers every 8 beats. This is useful to convert later to traktor, that lacks dynamic beatgrids """ help_text2="" import sys, os, glob, string, marshal import string, re # base libraries import argparse import os import re from collections import defaultdict from functools import partial from pathlib import Path import glob #import xml.etree.ElementTree as ET # https://docs.python.org/3.4/library/xml.etree.elementtree.html import lxml.etree as ET import os, sys import pandas as pd import glob, os import copy, math from urllib.parse import urlparse from yapu.imports.internal import * import re def lreplace(pattern, sub, string): """ Replaces 'pattern' in 'string' with 'sub' if 'pattern' starts 'string'. """ return re.sub('^%s' % pattern, sub, string) def rreplace(pattern, sub, string): """ Replaces 'pattern' in 'string' with 'sub' if 'pattern' ends 'string'. """ return re.sub('%s$' % pattern, sub, string) #class DebuggedArgumentParser(ArgumentParser): # def __init__ ######### parser = argparse.ArgumentParser(description='clone traktor cues based on number of cues') parser.add_argument('-i', "--file_in", dest="file_in", required=True, type=str, help='Input file') parser.add_argument('-o', "--file_out", dest="file_out", required=False, type=str, help='Output file. If not given, adds "enriched" to the input file') parser.add_argument('-b', "--beats_window",dest="beats_window", default=4, type=int, help='Maximum sequential beats WITHOUT a beatmarker') parser.add_argument('-m', "--min_number_cues", dest="min_number_cues", default=15, type=int, help='minimum numbe of cues to consider track as dynamic') parser.add_argument('-g', "--grep", dest="grep", type=str, default="", help='optional string to grep. Shows verbosity for that entry. Still processes that entry') parser.add_argument('-G', "--grep_only", dest="grep_only", type=str, default="", help='same, but skips processing of other entries') parser.add_argument('-f', "--force", dest="save_output", action="store_true", default=False, help='Actualy do save the final file') parser.add_argument('-n', "--max_process", dest="max_process", default=None, type=int, help='Max tracks to process') parser.add_argument('-N', "--max_cues", dest="limit_cues", default=None, type=int, help='Max cues to process') parser.add_argument('-r', "--remove_unreadable_files", dest="remove_unreadable_files", default=False, action="store_true", help='Remove files that cannot be read (WSL style)') parser.add_argument('-F', "--set_bpm_to_first_entry", dest="set_bpm_to_first_entry", default=False, action="store_true", help='Sets BPM to first entry (instead of the default AVG)') parser.add_argument('-B', "--keep_bpm_swings", dest="keep_bpm_swings", default=False, action="store_true", help='Keeps BPM swings "as-is" in the output. By default, these are filtered out and the average BPM value is used') parser=add_debug_arguments(parser) ########### opts = parser.parse_args() opts = parse_debug_arguments(opts) if(opts.grep_only): opts.grep = True opts.single_pass = True if(opts.grep): opts.report_folders = True add_regular_beatmarkers(opts ) ### Steps: """ rekordbox_add_beatmarkers.py -f -i s2\ -\ from_Rekordbox\ -\ small.xml -o s3\ -\ from_Rekordbox\ -\ enriched.xml dj-data-converter-linux -w s3\ -\ from_Rekordbox\ -\ enriched.xml mv collection.nml s4\ -\ converted\ collection.nml xml_pretty_print.sh s4\ -\ converted\ collection.nml traktor_clone_cues.py s4\ -\ converted\ collection.nml -c ../collection.nml -M -f todo: - final part - add detailed phase to jogs - disable sync when pitch bend (add option to it) - prepare transtions """
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 628, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 198, 16794, 62, 5239, 2625, 15931, 198, 198, 1212, 1430, 2753, 257, 797, 74, 273, 24954, 3524, 23735, ...
2.289758
1,943
import numpy as np
[ 11748, 299, 32152, 355, 45941, 628 ]
3.333333
6
# -*- coding: utf-8 -*- """ FileUploads database models -------------------- """ import logging import uuid import os import shutil from flask import current_app from PIL import Image from app.extensions import db, HoustonModel log = logging.getLogger(__name__) class FileUpload(db.Model, HoustonModel): """ FileUploads database model. """ guid = db.Column( db.GUID, default=uuid.uuid4, primary_key=True ) # pylint: disable=invalid-name mime_type = db.Column(db.String, index=True, nullable=False) # this is singular, so single (tus)path required # note: this is 'path' from { transaction_id, path } in tus args. sorry so many things called path. @classmethod # plural paths is optional (will do all files in dir if skipped) @classmethod @classmethod # default behavior is to *move* # note: this may not exist (we may just need it as a target for copy/move) @property # this is relative path, based on first 4 chars of guid, e.g. 'ab/cd' for 'abcdef01-2345-6789-abcd-ef0123456789' @classmethod
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 37811, 198, 8979, 41592, 82, 6831, 4981, 198, 19351, 198, 37811, 198, 11748, 18931, 198, 11748, 334, 27112, 198, 11748, 28686, 198, 11748, 4423, 346, 198, 198, 6738, 42903...
2.825974
385
import re from string import punctuation from common import common_util """ 去除中英文标点符号 """ text = "he is good, Hello, world! 这里,苹果:我;第!一个程序\?()()<>《》【】 "+"\sA-Za-z~()()【】%*#+-\.\\\/:=:__,,。、;;“”""''’‘??!!<《》>^&{}|=……" punc2=r"""~`!#$%^&*()_+-=|\'\\;":/.,?><~·!@#¥%……&*()——+-=“:’;、。,?》《{}!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~“”?,!【】()、。:;’‘……¥·""" text=text+punc2 print(common_util.trim_with_space_flag(text,True)) # punctuation =punctuation+ r"""~`!#$%^&*()_+-=|\'\\;":/.,?><~·!@#¥%……&*()——+-=“:’;、。,?》《{}!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~“”?,!【】()、。:;’‘……¥·""" # s =text # punc = punctuation + r'··.,;\\《》?!“”‘’@#¥%…&×()——+【】{};;●,。&~、|\s::' # dicts={i:'' for i in punc} # punc_table=str.maketrans(dicts) # new_s=s.translate(punc_table) print(common_util.trim_with_str_translate(text)) # pattern=re.compile(common_util.punc2) res=re.sub(r"[{}]+".format(common_util.punc2), '', text) print(res) # text= re.sub(r"[{}]+".format(punc)," ",text) # print(text) # file_pre='F:\\00-data\\data\\' # file1=file_pre+'1business.seg.cln.txt' # with open(file1,mode='r',encoding='utf-8') as f: # content=f.read() # # 去除标点 # content=common_util.trim_with_str_translate(content) # from sklearn.feature_extraction.text import CountVectorizer,TfidfVectorizer,TfidfTransformer # corpus = ["我 来到 北京 清华大学", # "他 来到 了 网易 杭研 大厦", # "小明 硕士 毕业 与 中国 科学院", # "我 爱 北京 天安门"] # # #将文本中的词语转换为词频矩阵 # vectorizer = CountVectorizer(token_pattern='\\b\\w+\\b') # #计算个词语出现的次数 # X = vectorizer.fit_transform(corpus) # word = vectorizer.get_feature_names() # print(word) # #查看词频结果 # print('X.toarray():',X.toarray()) # # # # norm=None对词频结果不归一化 # # use_idf=False, 因为使用的是计算tfidf的函数, 所以要忽略idf的计算 # ''' # norm='l1'表示 x/(sum(abs(x)) 即x/各特征的绝对值之和 # norm='l2'表示 x/sqrt(sum(x^2)) 即x/sqrt(各特征的平方和) # ''' # transformer = TfidfTransformer( use_idf=True,norm=None) # tf = transformer.fit_transform(X) # word = vectorizer.get_feature_names() # weight = tf.toarray() # # print(weight) # print('----------------------------------------------------') # tfidfvec=TfidfVectorizer(token_pattern='\\b\\w+\\b',norm='l2') # res=tfidfvec.fit_transform(corpus) # print(res.toarray())
[ 11748, 302, 198, 6738, 4731, 1330, 21025, 2288, 198, 6738, 2219, 1330, 2219, 62, 22602, 198, 37811, 198, 43889, 119, 165, 247, 97, 40792, 164, 233, 109, 23877, 229, 43718, 229, 163, 224, 117, 163, 105, 99, 20998, 115, 198, 37811, 198,...
1.483115
1,451
# -*- coding: utf-8 -*- from django.shortcuts import render from django.http import HttpResponse, JsonResponse from django.contrib.auth.decorators import login_required from django.views.decorators.http import require_GET from hostlist.models import DzhUser, DataCenter, HostList import logging log = logging.getLogger('dzhops') @login_required def asset_list(request): """ 展示所有服务器信息; :param request: :return: """ # user = request.user.username dc_dict = {} engi_dict = {} dc = DataCenter.objects.all() for i in dc: dc_dict[i.dcen] = i.dccn eg = DzhUser.objects.all() for j in eg: engi_dict[j.username] = j.engineer db_result = HostList.objects.all() srv_list = filter_data(db_result) return render( request, 'asset_list.html', { 'dc_dict': dc_dict, 'engi_dict': engi_dict, 'serv_list': srv_list } ) @login_required @require_GET def asset_list_api(request): """ 当前端选择机房与维护人员的时候,通过该接口提交请求并返回数据; :param request: :return: """ user = request.user.username dc = request.GET.get('dcen', '') eg = request.GET.get('engi', '') result = [] if dc == 'All_DC' and eg == 'ALL_ENGI': result = HostList.objects.all() elif dc == 'All_DC' and eg != 'ALL_ENGI': eg_result = DzhUser.objects.get(username=eg) result = HostList.objects.filter(engineer=eg_result.engineer) elif dc != 'All_DC' and eg == 'ALL_ENGI': dc_result = DataCenter.objects.get(dcen=dc) result = HostList.objects.filter(dccn=dc_result.dccn) elif dc != 'All_DC' and eg != 'ALL_ENGI': eg_result = DzhUser.objects.get(username=eg) dc_result = DataCenter.objects.get(dcen=dc) result = HostList.objects.filter(dccn=dc_result.dccn, engineer=eg_result.engineer) else: log.error('Unexpected execution here.') srv_list = filter_data(result) return JsonResponse(srv_list)
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 6738, 42625, 14208, 13, 19509, 23779, 1330, 8543, 198, 6738, 42625, 14208, 13, 4023, 1330, 367, 29281, 31077, 11, 449, 1559, 31077, 198, 6738, 42625, 14208, 13, 3642, 822,...
2.075413
968
from django.conf import settings from django.contrib import auth, messages from django.contrib.auth import views as django_views from django.contrib.auth.decorators import login_required from django.contrib.auth.tokens import default_token_generator from django.http import Http404, HttpResponseRedirect from django.shortcuts import get_object_or_404, redirect from django.template.response import TemplateResponse from django.urls import reverse, reverse_lazy from django.utils.translation import pgettext, ugettext_lazy as _ from django.views.decorators.http import require_POST from django.http import HttpResponseForbidden from ..account import events as account_events from ..checkout.utils import find_and_assign_anonymous_checkout from ..core.utils import get_paginator_items from .emails import send_account_delete_confirmation_email from ..product.models import Product from .forms import ( ChangePasswordForm, LoginForm, NameForm, PasswordResetForm, SignupForm, get_address_form, logout_on_password_change, ) from .models import User @find_and_assign_anonymous_checkout() @login_required @login_required @login_required @login_required @login_required @login_required @login_required @require_POST @login_required
[ 6738, 42625, 14208, 13, 10414, 1330, 6460, 198, 6738, 42625, 14208, 13, 3642, 822, 1330, 6284, 11, 6218, 198, 6738, 42625, 14208, 13, 3642, 822, 13, 18439, 1330, 5009, 355, 42625, 14208, 62, 33571, 198, 6738, 42625, 14208, 13, 3642, 822...
3.219144
397
# Obtain the size of the array sD = np.shape(data) # Obtain the dimensions Dim = sD[0:-1] # Obtain the number of dimensions D = len(Dim) # Obtain the number of subjects nsubj = sD[-1] # Get the mean and stanard deviation along the number of subjects xbar = data.mean(D) # Remember in python D is the last dimension of a D+1 array # Calculate the standard deviation (multiplying to ensure the population std is used!) std_dev = data.std(D)*np.sqrt((nsubj/(nsubj-1.))) # Compute Cohen's d cohensd = xbar/std_dev tstat = np.sqrt(nsubj)*cohensd return(tstat, xbar, std_dev)
[ 220, 1303, 1835, 3153, 262, 2546, 286, 262, 7177, 201, 198, 220, 264, 35, 796, 45941, 13, 43358, 7, 7890, 8, 201, 198, 220, 220, 201, 198, 220, 1303, 1835, 3153, 262, 15225, 201, 198, 220, 14048, 796, 264, 35, 58, 15, 21912, 16, ...
2.476923
260
# This file is part of the Reference Data Repository (refdata). # # Copyright (C) 2021 New York University. # # refdata is free software; you can redistribute it and/or modify it under the # terms of the MIT License; see LICENSE file for more details. """Custom error classes raised by different components of the package.""" class RefDataError(Exception): """Base class for all custom package errors.""" pass class InvalidFormatError(RefDataError): """Error that indicates the the format specification for a dataset is invalid. The error message contains more details about the cause for this error. """ def __init__(self, message: str): """Initialize the error message. Parameters ---------- message: string Detailed error message. """ super(InvalidFormatError, self).__init__(message) class NotDownloadedError(RefDataError): """Error that is raised if an attempt is made to access a dataset has not yet been downloaded to the local store. """ def __init__(self, key: str): """Initialize the error message. Parameters ---------- key: string Unique external key for the dataset. """ msg = "dataset '{}' has not been downloaded".format(key) super(NotDownloadedError, self).__init__(msg) class UnknownDatasetError(RefDataError): """Error that is raised if an attempt is made to access a dataset that is not included in the repository index. """ def __init__(self, key: str): """Initialize the error message. Parameters ---------- key: string Unique external key for the dataset. """ msg = "unknown dataset '{}'".format(key) super(UnknownDatasetError, self).__init__(msg)
[ 2, 770, 2393, 318, 636, 286, 262, 20984, 6060, 1432, 13264, 357, 5420, 7890, 737, 198, 2, 198, 2, 15069, 357, 34, 8, 33448, 968, 1971, 2059, 13, 198, 2, 198, 2, 1006, 7890, 318, 1479, 3788, 26, 345, 460, 17678, 4163, 340, 290, 1...
2.858476
643
# -*- coding: utf-8 -*- # # Copyright (C) 2016 Hewlett Packard Enterprise Development LP # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. import re from ipaddress import ip_address, IPv4Address, IPv6Address from time import sleep from random import choice, randrange from acl_classifier_common_lib import configure_acl_l3 from acl_classifier_common_lib import apply_acl from acl_classifier_common_lib import unconfigure_acl from acl_classifier_common_lib import create_and_verify_traffic from acl_classifier_common_lib import reboot_switch
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 2, 198, 2, 15069, 357, 34, 8, 1584, 30446, 15503, 6400, 446, 14973, 7712, 18470, 198, 2, 198, 2, 49962, 739, 262, 24843, 13789, 11, 10628, 362, 13, 15, 357, 1169, 36...
3.552901
293
import os from jrdb.models import Race from jrdb.templates import BAC from jrdb.tests.base import JRDBTestCase, SAMPLES_DIR
[ 11748, 28686, 198, 198, 6738, 474, 4372, 65, 13, 27530, 1330, 12588, 198, 6738, 474, 4372, 65, 13, 11498, 17041, 1330, 347, 2246, 198, 6738, 474, 4372, 65, 13, 41989, 13, 8692, 1330, 32598, 11012, 14402, 20448, 11, 28844, 6489, 1546, ...
2.863636
44
import sys print('Python version') print(sys.version)
[ 11748, 25064, 198, 4798, 10786, 37906, 2196, 11537, 198, 4798, 7, 17597, 13, 9641, 8 ]
3.533333
15
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (c) 2021 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. from .op import Operator, operator_registry from .tensor import Tensor # The inputs must be two-dimensional matrices @operator_registry(operator_type='Gemm')
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 2, 198, 2, 15069, 357, 66, 8, 33448, 8180, 10501, 198, 2, 198, 2, 49962, 739, 262, 24843, 13789, 11, 10628, 362, 13...
3.58371
221
# Copyright 2017 CodiLime # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # I believe # Some things can't be explained # They are hidden in the mist # And in the silver rain import asyncio import logging from collections import defaultdict from veles.util.future import done_future, bad_future from veles.db.tracker import DbTracker from veles.proto import check from veles.proto.node import PosFilter from veles.proto.connection import Connection from veles.proto.exceptions import ( VelesException, RegistryNoMatchError, RegistryMultiMatchError, ) from veles.async_conn.plugin import ( MethodHandler, QueryHandler, BroadcastHandler, TriggerHandler ) from veles.async_conn.subscriber import ( BaseSubscriberQueryRaw, BaseSubscriberConnections ) from veles.async_conn.conn import AsyncConnection from .query import QueryManager logger = logging.getLogger('veles.server') # getters # subscribers
[ 2, 15069, 2177, 18720, 72, 43, 524, 198, 2, 198, 2, 49962, 739, 262, 24843, 13789, 11, 10628, 362, 13, 15, 357, 1169, 366, 34156, 15341, 198, 2, 345, 743, 407, 779, 428, 2393, 2845, 287, 11846, 351, 262, 13789, 13, 198, 2, 921, ...
3.497549
408
import os import csv csvpath = os.path.join(".", "Resources", "election_data.csv") output = os.path.join('.', 'analysis', 'election_results.txt') candidate =[] candidate_list = [] votecount = {} winning_candidate = "" winning_count = 0 # def print_poll_results(candidate_name): # The total number of votes cast # A complete list of candidates who received votes # The percentage of votes each candidate won # The total number of votes each candidate won # The winner of the election based on popular vote. # Initialize rowcount rowcount = 0 with open(csvpath) as election_data: csvreader = csv.reader(election_data,delimiter=",") csvheader = next(csvreader) for row in csvreader: # count the number of rows to get the he total number of votes cast rowcount += 1 candidate_name = row[2] # append any new candidates not already in the candidate list if row[2] not in candidate_list: candidate_list.append(row[2]) votecount[candidate_name] = 0 votecount[candidate_name] +=1 # number_of_candidates = len(candidate_list) # print(number_of_candidates) # print(rowcount) # print(votecount) election_results=( f"\nElection Results\n" f"-----------------------------\n" f"Total votes: {rowcount}\n" f"-----------------------------\n" ) print(election_results, end ="") with open (output, "w") as txt_file: txt_file.write(election_results) for candidate in votecount: votes = votecount.get(candidate) vote_percentage = float(votes)/float(rowcount) * 100 voter_output = f"{candidate}: {vote_percentage:.3f}% ({votes})\n" print(voter_output, end ="") txt_file.write(voter_output) if (votes > winning_count): winning_count = votes winning_candidate = candidate winner_summary=( f"-----------------------------\n" f"Winner: {winning_candidate}\n" f"-----------------------------\n" ) txt_file.write(winner_summary) print(winner_summary, end = "")
[ 11748, 28686, 198, 11748, 269, 21370, 198, 40664, 6978, 796, 28686, 13, 6978, 13, 22179, 7203, 33283, 366, 33236, 1600, 366, 14300, 62, 7890, 13, 40664, 4943, 198, 22915, 796, 28686, 13, 6978, 13, 22179, 10786, 2637, 11, 705, 20930, 325...
2.301829
984
from datetime import datetime, timedelta class CalWeek: """ Class providing arithmetic operations for year-week date format """ if __name__ == '__main__': yw = CalWeek('2019-01') print(yw) print(str(yw)) print(yw + 200) print(200 + yw) print(yw + (-100)) print(yw - 100) print(yw - CalWeek('1000-01'))
[ 6738, 4818, 8079, 1330, 4818, 8079, 11, 28805, 12514, 628, 198, 4871, 2199, 20916, 25, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 5016, 4955, 34768, 4560, 329, 614, 12, 10464, 3128, 5794, 198, 220, 220, 220, 37227, 628, 198, 361, ...
2.364865
148