content
stringlengths 7
1.05M
|
|---|
def even(n):
return n/2
def odd(n):
return (3*n)+1
if __name__ == '__main__':
appeared = []
z = 0
x = 0
for i in range(1,1000000):
y = 0
a = i
while a != 1:
if i not in appeared:
if a % 2 == 0:
a = even(a)
y += 1
else:
a = odd(a)
y += 1
#appeared.append(i)
if y > x:
x = y
z = i
print(z)
|
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
def arm_toolchains_repositories():
rules_pkg()
org_linaro_components_toolchain_gcc_5_3_1()
raspi_components_toolchain_gcc_4_8_3()
def org_linaro_components_toolchain_gcc_5_3_1():
http_archive(
name = 'org_linaro_components_toolchain_gcc_5_3_1',
build_file = '@site_colatkinson_arm_toolchain//:compilers/linaro_linux_gcc_5.3.1.BUILD',
url = 'https://bazel-mirror.storage.googleapis.com/releases.linaro.org/components/toolchain/binaries/latest-5/arm-linux-gnueabihf/gcc-linaro-5.3.1-2016.05-x86_64_arm-linux-gnueabihf.tar.xz',
strip_prefix = 'gcc-linaro-5.3.1-2016.05-x86_64_arm-linux-gnueabihf',
patches = ['@site_colatkinson_arm_toolchain//:patches/linaro_arm_linux.patch'],
patch_args = ["-p1"],
sha256 = "987941c9fffdf56ffcbe90e8984673c16648c477b537fcf43add22fa62f161cd",
)
def raspi_components_toolchain_gcc_4_8_3():
toolchain_commit = '4a335520900ce55e251ac4f420f52bf0b2ab6b1f'
http_archive(
name = 'raspi_components_toolchain_gcc_4_8_3',
build_file = '@site_colatkinson_arm_toolchain//:compilers/raspi_linux_gcc_4.8.3.BUILD',
url = 'https://github.com/raspberrypi/tools/archive/%s.zip' % toolchain_commit,
strip_prefix = 'tools-%s/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64' % toolchain_commit,
patches = ['@site_colatkinson_arm_toolchain//:patches/raspi_linux_gcc.patch'],
patch_args = ["-p1"],
sha256 = "55ce12ae5246fa1f77410f730551cb63c8977cbf21828dddc99ebcba0b53530f",
)
def rules_pkg():
http_archive(
name = "rules_pkg",
url = "https://github.com/bazelbuild/rules_pkg/releases/download/0.2.4/rules_pkg-0.2.4.tar.gz",
sha256 = "4ba8f4ab0ff85f2484287ab06c0d871dcb31cc54d439457d28fd4ae14b18450a",
)
|
class Solution:
def solve(self, a, b):
def bin_sum(x,y,c):
x = int(x)
y = int(y)
c = int(c)
si = (x+y+c)%2
c = (x+y+c)//2
if c:
c = 1
return str(si),str(c)
n , m = len(a),len(b)
i,j = n-1,m-1
ans = ''
c = '0'
while i >= 0 and j >= 0:
si,c = bin_sum(a[i],b[j],c)
ans = si + ans
i -= 1
j -= 1
while i >= 0:
if c:
si,c = bin_sum(0,a[i],c)
ans = si + ans
else:
ans = a[:i+1] + ans
i -= 1
while j >= 0:
if c:
si , c = bin_sum(0,b[j],c)
ans = si + ans
else:
ans = b[:j+1] + ans
j -= 1
ans = c + ans
ans = str(int(ans))
return ans
|
# Copyright 2009-2017 Ram Rachum.
# This program is distributed under the MIT license.
'''Defines exceptions.'''
class CuteBaseException(BaseException):
'''
Base exception that uses its first docstring line in lieu of a message.
'''
def __init__(self, message=None):
# We use `None` as the default for `message`, so the user can input ''
# to force an empty message.
if message is None:
if self.__doc__ and \
(type(self) not in (CuteBaseException, CuteException)):
message = self.__doc__.strip().split('\n')[0]
# Getting the first line of the documentation
else:
message = ''
BaseException.__init__(self, message)
self.message = message
'''
The message of the exception, detailing what went wrong.
We provide this `.message` attribute despite `BaseException.message`
being deprecated in Python. The message can also be accessed as the
Python-approved `BaseException.args[0]`.
'''
class CuteException(CuteBaseException, Exception):
'''Exception that uses its first docstring line in lieu of a message.'''
|
"""
Top-level package for Python AvSong.
"""
__app_name__ = "pyavsong"
__version__ = "0.1"
|
class RoutingRulesList:
TITLE = "Maintain case routing rules"
CREATE_BUTTON = "Create new routing rule"
NO_CONTENT_NOTICE = "There are no registered routing rules at the moment."
ACTIVE = "Active"
DEACTIVATED = "Deactivated"
DEACTIVATE = "Deactivate"
REACTIVATE = "Reactivate"
EDIT = "Edit"
class Table:
TEAM = "Team"
CASE_STATUS = "Case Status"
TIER = "Tier"
CASE_TYPES = "Case types"
FLAGS = "Flags"
COUNTRY = "Country"
QUEUE = "Queue"
USERS = "Users"
STATUS = "Status"
ACTIONS = "Actions"
class Filter:
CASE_STATUS = "case status"
TEAM = "team"
QUEUE = "queue"
TIER = "tier number"
ACTIVE_ONLY = "Only show active rules"
class AdditionalRules:
CASE_TYPES = "Case Types"
FLAGS = "Flags"
COUNTRY = "Destinations"
USERS = "Users"
class Forms:
CREATE_TITLE = "Routing rule parameters"
EDIT_TITLE = "Edit the routing rule"
CASE_STATUS = "Select a case status"
TEAM = "Select a team to create a rule for"
QUEUE = "Select a team work queue"
TIER = "Enter a tier number"
ADDITIONAL_RULES = "Select the combination of options you need to create the case routing rule"
CASE_TYPES = "Select case types"
FLAGS = "Select flags"
COUNTRY = "Select a country"
USER = "Select a team member to assign the case to"
BACK_BUTTON = "Back to routing rules"
CONFIRM_FORM_ERROR = "Select to confirm or not"
class DeactivateForm:
TITLE = "Are you sure you want to deactivate this routing rule?"
DESCRIPTION = "You are deactivating the routing rule"
YES_LABEL = "Deactivate this routing rule"
NO_LABEL = "Cancel"
class ActivateForm:
TITLE = "Are you sure you want to activate this routing rule?"
DESCRIPTION = "You are deactivating the routing rule"
YES_LABEL = "Activate this routing rule"
NO_LABEL = "Cancel"
|
__all__ = ["_nsgroup", "association_api", "association_service_api", "codesystem_api",
"codesystem_service_api", "codesystemversion_api", "codesystemversion_service_api", "conceptdomain_api",
"conceptdomain_service_api", "conceptdomainbinding_api", "conceptdomainbinding_service_api",
"core_api", "core_service_api", "entity_api", "entity_service_api", "exceptions_api",
"map_api", "map_service_api", "mapentry_service_api", "mapversion_api",
"mapversion_service_api", "statement_api", "statement_service_api", "updates_api", "valueset_api",
"valueset_service_api", "valuesetdefinition_api", "valuesetdefinition_service_api"]
|
"""
A `Command` is something that causes a change of state to
a persistant store.
"""
class Command(object):
"""
Inherit `Command` for specific commands that cause a chage
of state in a persisted database.
"""
def __init__(self, *args, **kwargs):
pass
def run(self):
"""
Override `run` in each subclass; this is called by the
`JobExecutor`. It must be defined for each subclass
"""
raise NotImplementedError(
'Override the `run` method in every subclass of `Job`.')
def __repr__(self):
"""
We'll replace this. Just here to get hashes.
"""
return self.__class__.__name__ + ' ' + '|'.join(
[str(getattr(self, attribute)) for attribute in
sorted(self.__dict__.keys())])
class RecalculateCommand(Command):
"""
Command to recalculate a specific value, triggered by ingesting
information that could change its value.
"""
def __init__(self, snippet=None, snippet_function=None,
triggering_entity=None, updating_entity=None,
updating_attribute=None):
self.snippet = snippet
self.snippet_function = snippet_function
self.triggering_entity = triggering_entity
self.updating_entity = updating_entity
self.updating_attribute = updating_attribute
class UpsertCommand(Command):
"""
An `UpsertCommand` will take an entity and upsert a row (or
whatever) into storage which contains all the represented
attributes about that entity.
"""
def __init__(self, entity):
self.entity = entity
super(UpsertCommand, self).__init__()
|
# webex integration credentials
webex_integration_client_id = ""
webex_integration_client_secret= ""
webex_integration_redirect_uri = "http://localhost:5000/webexoauth"
webex_integration_scope = "spark:all meeting:schedules_write"
|
"""Top-level package for openapi-to-markdown."""
__author__ = """Shinji Matsumoto"""
__email__ = 'shinji.mtsmt@gmail.com'
__version__ = '0.1.0'
|
# Advent of Code - Day 6 - Part Two
class LanterFishPopulation:
def __init__(self, initial_state):
self.population = initial_state
def tick(self, reset, gestation):
spawn_count = self.population[0]
# decrement all lantern fish timers
for k in self.population.keys():
if k < gestation:
self.population[k] = self.population[k + 1]
# deal with regenerating lantern fish
self.population[reset] += spawn_count
# spawn the new generation
self.population[gestation] = spawn_count
def parse(line):
return [int(num) for num in line[0].split(",")]
def result(input, reset=6, gestation=8, cycles=256):
initial_state = dict.fromkeys(range(gestation + 1), 0)
periods = parse(input)
for n in periods:
initial_state[n] += 1
lfp = LanterFishPopulation(initial_state)
for n in range(cycles):
lfp.tick(reset, gestation)
return sum(lfp.population.values())
sample_input = ["3,4,3,1,2"]
input = sample_input
print(result(input, cycles=18))
# print(result(input, cycles = 80))
# print(result(input, cycles = 256))
|
#conexoes entre pontos
conexoes = {}
conexoes["Casa"] = {"Santo Amaro"}
conexoes["Santo Amaro"] = {"Pinheiros","Santa Cruz"}
conexoes["Santa Cruz"] = {"Santo Amaro", "Sé"}
conexoes["Pinheiros"] = {"República", "Luz","Presidente Altino"}
conexoes["Presidente Altino"] = {"Barra Funda"}
conexoes["República"] = {"Barra Funda"}
conexoes["Luz"] = {"Sé"}
conexoes["Sé"] = {"Barra Funda"}
conexoes["Barra Funda"] = {"Impacta"}
conexoes["Impacta"] = {"Barra Funda"}
#localização de todos os lugares
localizacao = {}
localizacao["Casa"] = [2,8]
localizacao["Santo Amaro"] = [7,2]
localizacao["Santa Cruz"] = [4,5]
localizacao["Presidente Altino"]=[1,4]
localizacao["Pinheiros"] = [2,6]
localizacao["República"] = [2,5]
localizacao["Luz"] = [3,5]
localizacao["Sé"] = [4,4]
localizacao["Barra Funda"] = [2,4]
localizacao["Impacta"] = [2,3]
|
nombreACalculer = str(2**1000)
somme=0
for i in nombreACalculer:
somme += int(i)
print(somme)
input()
|
# --------------
print(bool)
# --------------
print(bool)
|
pytest_plugins = ("pytester",)
def test_help_message(testdir):
result = testdir.runpytest("--help")
# fnmatch_lines does an assertion internally
result.stdout.fnmatch_lines(
[
"stress:",
"*--delay=DELAY*The amount of time to wait between each test loop.",
"*--hours=HOURS*The number of hours to loop the tests for.",
"*--minutes=MINUTES*The number of minutes to loop the tests for.",
"*--seconds=SECONDS*The number of seconds to loop the tests for.",
]
)
def test_ini_file(testdir):
testdir.makeini(
"""
[pytest]
addopts = --delay=0 --hours=0 --minutes=0 --seconds=0
"""
)
testdir.makepyfile(
"""
import pytest
@pytest.fixture
def addopts(request):
return request.config.getini('addopts')
def test_ini(addopts):
assert addopts[0] == "--delay=0"
assert addopts[1] == "--hours=0"
assert addopts[2] == "--minutes=0"
assert addopts[3] == "--seconds=0"
"""
)
result = testdir.runpytest("-v")
# fnmatch_lines does an assertion internally
result.stdout.fnmatch_lines(
["*::test_ini PASSED*", ]
)
# Make sure that that we get a '0' exit code for the testsuite
assert result.ret == 0
|
class Solution:
def nextClosestTime(self, time):
t = sorted(set(time))[:-1]
nex = {a: b for a, b in zip(t, t[1:])}
for i, d in enumerate(time[::-1]):
if d in nex:
if i == 0:
return time[:4] + nex[d]
elif i == 1 and nex[d] < '6':
return time[:3] + nex[d] + t[0]
elif i == 3 and int(time[0] + nex[d]) < 24:
return time[0] + nex[d] + ':' + t[0] * 2
return t[0] * 2 + ':' + t[0] * 2
|
"""
******
######
******
######
"""
# 4 6
for r in range(4): # 0 1 2 3
for c in range(6):
if r % 2 == 0:
print("*", end="")
else:
print("#", end="")
print()
|
class Solution:
#Function to return a list containing the DFS traversal of the graph.
def dfs(self,i,vis,q,adj):
vis[i]=1
q.append(i)
for i in adj[i]:
if(vis[i]==0):
self.dfs(i,vis,q,adj)
def dfsOfGraph(self, V, adj):
vis=[0 for i in range(V)]
q=[]
self.dfs(0,vis,q,adj)
return q
# code here
#{
# Driver Code Starts
if __name__ == '__main__':
T=int(input())
for i in range(T):
V, E = map(int, input().split())
adj = [[] for i in range(V)]
for _ in range(E):
u, v = map(int, input().split())
adj[u].append(v)
adj[v].append(u)
ob = Solution()
ans = ob.dfsOfGraph(V, adj)
for i in range(len(ans)):
print(ans[i], end = " ")
print()
# } Driver Code Ends
|
# -*- coding: utf-8 -*-
timeout = 8
keysize = 512
operator_root_path="/api/1.2"
operator_cr_path="/cr"
operator_slr_path="/slr"
account_management_url="http://myaccount.dy.fi/"
account_management_username="test_sdk"
account_management_password="test_sdk_pw"
operator_url="http://localhost:5000"
service_url ="http://localhost:2000"
cert_path = "./service_key.jwk"
cert_key_path = "./service_key.jwk"
cert_password_path = "./cert_pw"
|
def in1to10(n, outside_mode):
if not outside_mode and n>=1 and n<=10:
return True
elif outside_mode:
if n<=1 or n>=10:
return True
else:
return False
else:
return False
|
''' Serialize objects into SQLITE database calls. '''
class Serializable:
''' Serializable class that implements methods for objects wishing to
serialize to SQLITE tables. This is done with a serialize table that maps
property names to SQLITE table columns. When insert_into is called it takes
the properties listed in serialize table and the corresponding table column
names, building an SQLITE query to use on the database. '''
def __init__(self, serialize_table):
''' Initialize the Serializable class'''
self.serialize_table = serialize_table
def deserialize_from(self, row):
''' Deserialize object from the result of an sqlite SELECT call.
Example:
>>> class DeserializeMe(Serializable):
>>> def __init__(self, name):
>>> self.name = name
>>> self.seiralize_table = {'name_column': 'name'}
>>>
>>> result = ['jake'] # SELECT name_column FROM names
>>> test_class = DeserializeMe(None)
>>> test_class.deserialize_from(result)
>>> assertEquals(test_class.name, 'jake') '''
properties = [prop for _, prop in self.serialize_table]
for prop, value in zip(properties, row):
setattr(self, prop, value)
def insert_into(self, sqlite_table):
''' Serialize object into a sqlite INSERT call.
Example:
>>> class SerializeMe(Serializable):
>>> def __init__(self, name):
>>> self.name = name
>>> self.seiralize_table = {'name': 'name'}
>>>
>>> test = SerializeMe('jack')
>>> query = test.insert_into('names')
>>> assertEquals(query, ('INSERT INTO names (name) VALUES (?)', 'jack')) '''
keys = ', '.join(column for column, _ in self.serialize_table)
values = [getattr(self, prop) for _, prop in self.serialize_table]
placeholders = ', '.join('?' for value in values)
sqlite_query_format = f'INSERT INTO {sqlite_table} ({keys}) VALUES ({placeholders})'
return sqlite_query_format, values
|
# FMSPy - Copyright (c) 2009 Andrey Smirnov.
#
# See COPYRIGHT for details.
"""
RTMP (Real Time Messaging Protocol) implementation.
U{http://en.wikipedia.org/wiki/Real_Time_Messaging_Protocol}
"""
|
#!/usr/bin/env python3
SLIDE_WINDOWS = 3
f = open("input.txt", "r")
window = []
for i in range(SLIDE_WINDOWS):
window.append(int(f.readline()))
count = 0
for cur in f:
#print(f'current: {cur}')
window.append(int(cur))
if sum(window[1:]) > sum(window[0:-1]):
count +=1
window.pop(0)
print(f'increase: {count}')
|
# Copyright (c) 2017 StackHPC Ltd.
#
# 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.
def parse_mappings(mapping_list):
"""Parse a list of mapping strings into a dictionary.
Adapted from neutron_lib.utils.helpers.parse_mappings.
:param mapping_list: A list of strings of the form '<key>:<value>'.
:returns: A dict mapping keys to values or to list of values.
:raises ValueError: Upon malformed data or duplicate keys.
"""
mappings = {}
for mapping in mapping_list:
mapping = mapping.strip()
if not mapping:
continue
split_result = mapping.split(':')
if len(split_result) != 2:
raise ValueError("Invalid mapping: '%s'" % mapping)
key = split_result[0].strip()
if not key:
raise ValueError("Missing key in mapping: '%s'" % mapping)
value = split_result[1].strip()
if not value:
raise ValueError("Missing value in mapping: '%s'" % mapping)
if key in mappings:
raise ValueError("Key %(key)s in mapping: '%(mapping)s' not "
"unique" % {'key': key, 'mapping': mapping})
mappings[key] = value
return mappings
|
def scale_01(feature,n_feature):
for i in range(n_feature):
feature_i=feature[:,i]
feature[:,i]=0+(feature_i-min(feature_i))/(max(feature_i)-min(feature_i))
return feature
|
# -*- coding: utf-8 -*-
"""Module defining Interval model and operations"""
# ActiveState recipe 576816
class Interval(object):
"""
Represents an interval.
Defined as closed interval [start,end), which includes the start and
end positions.
Start and end do not have to be numeric types.
"""
__slots__ = ('_start', '_end')
def __init__(self, start, end):
"Construct, start must be <= end."
if start > end:
raise ValueError('Start (%s) must not be greater than end (%s)' % (start, end))
self._start = start
self._end = end
@property
def start(self):
"""The interval's start"""
return self._start
@property
def end(self):
"""The interval's end"""
return self._end
def __str__(self):
"As string."
return '[%s,%s]' % (self.start, self.end)
def __repr__(self):
"String representation."
return '[%s,%s]' % (self.start, self.end)
def __cmp__(self, other):
"Compare."
if None == other:
return 1
start_cmp = cmp(self.start, other.start)
if 0 != start_cmp:
return start_cmp
else:
return cmp(self.end, other.end)
def __hash__(self):
"Hash."
return hash(self.start) ^ hash(self.end)
def intersection(self, other):
"Intersection. @return: An empty intersection if there is none."
if self > other:
other, self = self, other
if self.end <= other.start:
return Interval(self.start, self.start)
return Interval(other.start, min(self.end, other.end))
def hull(self, other):
"@return: Interval containing both self and other."
if self > other:
other, self = self, other
return Interval(self.start, max(self.end, other.end))
def overlap(self, other):
"@return: True iff self intersects other."
if self > other:
other, self = self, other
return self.end > other.start
def overlapm(self, other):
"@return: True iff selfs overlaps or meets other."
if self > other:
other, self = self, other
return self.end >= other.start
def move(self, offset):
"@return: Interval displaced offset to start and end"
return Interval(self.start + offset, self.end + offset)
def __contains__(self, item):
"@return: True iff item in self."
return self.start <= item and item <= self.end
@property
def zero_in(self):
"@return: True iff 0 in self."
return self.start <= 0 and 0 <= self.end
def subset(self, other):
"@return: True iff self is subset of other."
return self.start >= other.start and self.end <= other.end
def proper_subset(self, other):
"@return: True iff self is proper subset of other."
return self.start > other.start and self.end < other.end
@property
def empty(self):
"@return: True iff self is empty."
return self.start == self.end
@property
def length(self):
"""@return: Difference between end and start"""
return self.end - self.start
@property
def singleton(self):
"@return: True iff self.end - self.start == 1."
return self.end - self.start == 1
def separation(self, other):
"@return: The distance between self and other."
if self > other:
other, self = self, other
if self.end > other.start:
return 0
else:
return other.start - self.end
|
class DriverBase(object):
def __init__(self, wheel_radius=0.06, wheel_track=0.33):
self.wheel_speeds = [0.0, 0.0, 0.0, 0.0]
self.wheel_radius = wheel_radius
self.wheel_track = wheel_track
def set_motors(self, linear, angular):
raise NotImplementedError()
class DriverStraight(DriverBase):
def set_motors(self, linear, angular):
if abs(linear) >= abs(angular):
wheel_speed = linear / self.wheel_radius
self.wheel_speeds = [wheel_speed] * 4
else:
wheel_left_speed = (-angular * (self.wheel_track / 2)) / self.wheel_radius
wheel_right_speed = (angular * (self.wheel_track / 2)) / self.wheel_radius
self.wheel_speeds = [wheel_left_speed, wheel_right_speed] * 2
class DriverDifferential(DriverBase):
def set_motors(self, linear, angular):
wheel_left_speed = (linear - angular * (self.wheel_track / 2)) / self.wheel_radius
wheel_right_speed = (linear + angular * (self.wheel_track / 2)) / self.wheel_radius
self.wheel_speeds = [wheel_left_speed, wheel_right_speed] * 2
|
# -*- coding: utf-8 -*-
#
# Custom package settings
#
# Copyright (C)
# Honda Research Institute Europe GmbH
# Carl-Legien-Str. 30
# 63073 Offenbach/Main
# Germany
#
# UNPUBLISHED PROPRIETARY MATERIAL.
# ALL RIGHTS RESERVED.
#
#
name = 'ToolBOSCore'
package = 'ToolBOSCore'
version = '4.0'
section = 'DevelopmentTools'
category = 'DevelopmentTools'
patchlevel = 0
maintainer = ( 'mstein', 'Marijke Stein' )
gitBranch = 'TBCORE-2231-GitLabCI'
gitCommitID = '020950dfc0913a1a18b80335f25dd7b1335b0d48'
gitOrigin = 'https://github.com/HRI-EU/ToolBOSCore.git'
gitRelPath = ''
gitOriginForCIA = 'git@dmz-gitlab.honda-ri.de:ToolBOS/ToolBOSCore.git'
recommends = [ 'deb://git',
'sit://External/CMake/3.4',
'sit://External/git/2.18',
'sit://External/wine/3.5' ]
# EOF
|
INSTALLED_APPS = (
'automatica_prometheus',
)
TELEGRAM_BOT_NAME = 'name_bot'
|
#Exercise 5.2.1
def check_fermat(a,b,c,n):
a = int(a)
b = int(b)
c = int(c)
n = int(n)
if n>2 and a>0 and b>0 and c>0 and a**n + b**n == c**n:
print('Holy smokes, Fermat was wrong!')
else:
print("No, that doesn't work")
#Exercise 5.2.2
def prompting_fermat():
a = int(input('Type a and hit enter\n'))
b = int(input('Type b and hit enter\n'))
c = int(input('Type c and hit enter\n'))
n = int(input('Type n and hit enter\n'))
check_fermat(a,b,c,n)
prompting_fermat()
|
a,b,c=map(int,input().split())
x,d=0,0
while x<c:
d+=1
x+=a
if d%7==0: x+=b
print(d)
|
load("//csharp:csharp_grpc_compile.bzl", "csharp_grpc_compile")
load("//:compile.bzl", "invoke_transitive")
load("@io_bazel_rules_dotnet//dotnet:defs.bzl", "core_library")
def csharp_grpc_library(**kwargs):
kwargs["srcs"] = [invoke_transitive(csharp_grpc_compile, "_pb", kwargs)]
kwargs["deps"] = [
"@google.protobuf//:core",
"@grpc.core//:core",
"@io_bazel_rules_dotnet//dotnet/stdlib.core:system.io.dll",
"@system.interactive.async//:core",
]
kwargs["verbose"] = None
core_library(**kwargs)
name = kwargs.get("name")
deps = kwargs.get("deps")
visibility = kwargs.get("visibility")
|
# Programa baseado no algoritmo de Zeller, que calcula o dia da semana em que uma determinada data caiu (ou cairá).
year = 2017
month = 1
day = 9
def zellerAlgorithm(year, month, day):
if month in [1, 2]:
y1 = year - 1
m1 = month + 12
else:
y1 = year
m1 = month
y2 = y1 % 100
c = int(y1 / 100)
return (day + int((13 * (m1 + 1)) / 5) + y2 + int(y2 / 4) + int(c / 4) - 2 * c) % 7
out = zellerAlgorithm(year, month, day)
print(out)
|
# Definition for singly-linked list.
# class ListNode(object):
# def __init__(self, x):
# self.val = x
# self.next = None
class Solution(object):
def reorderList(self, head):
"""
:type head: ListNode
:rtype: void Do not return anything, modify head in-place instead.
"""
# 起码需要两个点
if head == None or head.next == None:
return
slow, fast = head, head
while fast.next != None and fast.next.next != None:
fast = fast.next.next
slow = slow.next
# 1->2->3->4->5
# low = 3
# 1->2->3->4->5->6
# low = 3
# 1->2->3->6->5->4
prevMiddle = slow
prevCurrent = prevMiddle.next
while prevCurrent.next != None:
current = prevCurrent.next
prevCurrent.next = current.next
current.next = prevMiddle.next
prevMiddle.next = current
# 1->6->2->5->3->4
p1 = head
p2 = prevMiddle.next
# 跳出条件
while p1 != prevMiddle:
prevMiddle.next = p2.next
p2.next = p1.next
p1.next = p2
p1 = p2.next
p2 = prevMiddle.next
|
def is_number(s):
"""
Take a string and determin if it is a number
Arguments:
s (str): A string
Returns:
bool: True if it is a number, False otherwise
"""
try:
float(s)
return True
except ValueError:
return False
def check_info_annotation(annotation, info, extra_info, alternatives, individuals=[]):
"""
Check if the info annotation corresponds to the metadata specification
Arguments:
annotation (list): The annotation from the vcf file
info (str): Name of the info field
extra_info (dict): The metadata specification
alternatives (list): A list with the alternative variants
individuals (list): a list with the individuals
Returns:
bool: If the annotation is correct or not
"""
number = extra_info['Number']
if is_number(number):
number_of_entrys = float(number)
if number_of_entrys != 0:
if len(annotation) != number_of_entrys:
raise SyntaxError("Info field {0} has the wrong "\
"number of entrys according to the vcf header."\
" Vcf header specifies {1} should have {2} entry(s)".format(
'='.join([info, ','.join(annotation)]),
info,
number
))
elif number == 'A':
if len(annotation) != len(alternatives):
raise SyntaxError("Info field {0} has the wrong "\
"number of entrys according to the vcf header."\
"Vcf header specifies {1} should have {2} entry(s)".format(
'='.join([info, ','.join(annotation)]),
info,
number
))
elif number == 'R':
if len(annotation) != (len(alternatives) + 1):
raise SyntaxError("Info field {0} has the wrong "\
"number of entrys according to the vcf header."\
"Vcf header specifies {1} should have {2} entry(s)".format(
'='.join([info, ','.join(annotation)]),
info,
number
))
elif number == 'G':
if len(annotation) != len(individuals):
raise SyntaxError("Info field {0} has the wrong "\
"number of entrys according to the vcf header."\
"Vcf header specifies {1} should have {2} entry(s)".format(
'='.join([info, ','.join(annotation)]),
info,
number
))
return True
|
class TrieNode:
def __init__(self):
self.children = [None] * 26
self.isEndOfWord = False
class Trie:
def __init__(self):
self.root_node = self.TrieNode()
def getNewNode(self):
return TrieNode()
def char_to_index(self, char):
return ord(char) - ord('a')
def add(self, msg: str):
for char in range(len(str)):
ordinal = self.char_to_index(char)
if ordinal not in self.root_node[msg[char]]:
self.root_node[msg[char]] = self.getNewNode()
self.root_node = self.root_node.children[char]
self.root_node.isEndOfWord = True
def search(self, msg: str):
char = 0
node = self.root_node
for counter in range(len(msg)):
ordinal = self.char_to_index(msg[counter])
if ordinal not in node.children[counter]:
return False
node = self.children[counter]
return self.root_node.isEndOfWord
# if(self.node ==)
if __name__ == '__main__':
data = [
'moto',
'nokia',
'samsung',
'appple',
'google',
'facebook',
'cognizant',
'Mango',
'Papaya',
'GameOfthrone',
'Hp'
]
trie = Trie()
for d in data:
trie.insert(d)
|
def reverseWords(string: str) -> str:
words = " ".join(string.split())
words = [word for word in words.split(' ')]
left, right = 0, len(words) - 1
while left < right:
temp = words[left]
words[left] = words[right]
words[right] = temp
left += 1
right -= 1
return ' '.join(words)
string = " Hello World! "
print(reverseWords(string))
|
pessoasmaisdezoito=0
quanthomens=0
mulheresmensvinte=0
print('-'*23)
print('- CADASTRO DE PESSOAS -')
print('-'*23)
while True:
idade = int(input('Informe sua idade: '))
while True:
sexo = str(input('Informe o sexo [M/F] ')).strip().upper()[0]
if sexo in 'FM':
break
print('-' * 20)
if idade > 18:
pessoasmaisdezoito+=1
if sexo=='F' and idade <20:
mulheresmensvinte+=1
if sexo=='M':
quanthomens+=1
while True:
continua = str(input('Quer continuar? [S/N]')).strip().upper()[0]
if continua in 'SsNn':
break
if continua=='N':
break
print(f'Dos dados lidos, {pessoasmaisdezoito} são pessoas maires de 18 anos, {quanthomens} são homens e {mulheresmensvinte} mulheres com mais de 20 anos. ')
|
# -*- coding: utf-8 -*-
"""Dork Game main module.
"""
__version__ = '0.1.0'
__author__ = ", ".join([
"Luke Smith",
])
|
bind = "0.0.0.0:5000"
workers = 1
worker_class = "eventlet"
reload = True
|
'''
http://pythontutor.ru/lessons/ifelse/problems/chess_board/
Заданы две клетки шахматной доски.
Если они покрашены в один цвет, то выведите слово YES, а если в разные цвета — то NO.
Программа получает на вход четыре числа от 1 до 8 каждое, задающие номер столбца и номер строки сначала для первой клетки, потом для второй клетки.
'''
a_x = int(input())
b_y = int(input())
c_x = int(input())
d_y = int(input())
if (a_x + b_y + c_x + d_y) % 2 == 0:
print('YES')
else:
print('NO')
'''
# before taking the pattern
cell_01_col = int(input())
cell_01_row = int(input())
cell_02_col = int(input())
cell_02_row = int(input())
cell_01_is_colored = ((cell_01_col % 2 == 1) and (cell_01_row % 2 == 1)) or ((cell_01_col % 2 == 0) and (cell_01_row % 2 == 0))
cell_02_is_colored = ((cell_02_col % 2 == 1) and (cell_02_row % 2 == 1)) or ((cell_02_col % 2 == 0) and (cell_02_row % 2 == 0))
cell_01_is_uncolored = ((cell_01_col % 2 == 0) and (cell_01_row % 2 == 1)) or ((cell_01_col % 2 == 1) and (cell_01_row % 2 == 0))
cell_02_is_uncolored = ((cell_02_col % 2 == 0) and (cell_02_row % 2 == 1)) or ((cell_02_col % 2 == 1) and (cell_02_row % 2 == 0))
if cell_01_is_colored and cell_02_is_colored:
print('YES')
elif cell_01_is_uncolored and cell_02_is_uncolored:
print('YES')
else:
print('NO')
'''
|
class Timespan:
def __init__(
self,
days: int = 0,
hours: int = 0,
minutes: int = 0,
seconds: int = 0,
milliseconds: int = 0):
conv_days = days * 3600 * 24 * 1000
conv_hours = hours * 3600000
conv_minutes = minutes * 60000
conv_seconds = seconds * 1000
self._time = conv_days + conv_hours + conv_minutes + conv_seconds + milliseconds
@property
def milliseconds(self) -> int:
return self._time
@property
def seconds(self) -> int:
return int(self._time / 1000)
@property
def minutes(self) -> int:
return int(self._time / 60000)
@property
def hours(self) -> int:
return int(self._time / 3600000)
@property
def days(self) -> int:
return int(self._time / (3600 * 24 * 1000))
@classmethod
def from_days(cls, days: int):
return cls(days=days)
@classmethod
def from_hours(cls, hours: int):
return cls(hours=hours)
@classmethod
def from_minutes(cls, minutes: int):
return cls(minutes=minutes)
@classmethod
def from_seconds(cls, seconds: int):
return cls(seconds=seconds)
@classmethod
def from_milliseconds(cls, milliseconds: int):
return cls(milliseconds=milliseconds)
|
def merge(alist):
if len(alist) > 1:
mid = len(alist)//2
left = alist[:mid]
right = alist[mid:]
merge(left)
merge(right)
i,j,k = 0, 0, 0
while i<len(left) and j<len(right):
if left[i]<right[j]:
alist[k] = left[i]
i += 1
else:
alist[k] = right[j]
j += 1
k += 1
while i<len(left):
alist[k] = left[i]
k += 1
i += 1
while j<len(right):
alist[k] = right[j]
k += 1
j += 1
def test_merge():
alist = [1,7,2,5,9,12,5]
merge(alist)
assert alist[0] == 1
assert alist[1] == 2
assert alist[6] == 12
assert alist[5] == 9
|
exp = str(input('DIgite a expressao: '))
if exp.count('(') == exp.count(')'):
print('Não a parenteses faltando')
for s in exp:
if s in '+-*/':
p = exp.index(s)
n1 = exp[p - 1]
n2 = exp[p + 1]
if not n1.isalnum() and not n2.isalnum():
print('algo de errado nao esta certo')
print(exp)
|
class MACAddress:
@staticmethod
def isValid(macAddress):
sanitizedMACAddress = macAddress.strip().upper()
if sanitizedMACAddress == "":
return False
# Ensure that we have 6 sections
items = sanitizedMACAddress.split(":")
if len(items) != 6:
return False
# Ensure that every section of the MAC Address has 2 characters
for section in items:
if len(section) != 2:
return False
# Ensure that all characters is hexadecimal
HEXADECIMAL_CHARS = ['0', '1', '2', '3', '4',
'5', '6', '7', '8', '9',
'A', 'B', 'C', 'D', 'E', 'F']
for section in items:
for character in section:
if character not in HEXADECIMAL_CHARS:
return False
return True
|
# -*- coding: utf-8 -*-
"""
Copyright ©2017. The Regents of the University of California (Regents). All Rights Reserved.
Permission to use, copy, modify, and distribute this software and its documentation for educational,
research, and not-for-profit purposes, without fee and without a signed licensing agreement, is
hereby granted, provided that the above copyright notice, this paragraph and the following two
paragraphs appear in all copies, modifications, and distributions. Contact The Office of Technology
Licensing, UC Berkeley, 2150 Shattuck Avenue, Suite 510, Berkeley, CA 94720-1620, (510) 643-
7201, otl@berkeley.edu, http://ipira.berkeley.edu/industry-info for commercial licensing opportunities.
IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL,
INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF
THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF REGENTS HAS BEEN
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED
HEREUNDER IS PROVIDED "AS IS". REGENTS HAS NO OBLIGATION TO PROVIDE
MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
"""
# Keys for easy lookups in HDF5 databases
METRICS_KEY = 'metrics'
OBJECTS_KEY = 'objects'
MESH_KEY = 'mesh'
SDF_KEY = 'sdf'
GRASPS_KEY = 'grasps'
GRIPPERS_KEY = 'grippers'
NUM_GRASPS_KEY = 'num_grasps'
LOCAL_FEATURES_KEY = 'local_features'
GLOBAL_FEATURES_KEY = 'global_features'
SHOT_FEATURES_KEY = 'shot'
RENDERED_IMAGES_KEY = 'rendered_images'
SENSOR_DATA_KEY = 'sensor_data'
STP_KEY = 'stable_poses'
CATEGORY_KEY = 'category'
MASS_KEY = 'mass'
CONVEX_PIECES_KEY = 'convex_pieces'
CREATION_KEY = 'time_created'
DATASETS_KEY = 'datasets'
DATASET_KEY = 'dataset'
# data keys for easy access
SDF_DATA_KEY = 'data'
SDF_ORIGIN_KEY = 'origin'
SDF_RES_KEY = 'resolution'
SDF_POSE_KEY = 'pose'
SDF_SCALE_KEY = 'scale'
SDF_FRAME_KEY = 'frame'
MESH_VERTICES_KEY = 'vertices'
MESH_TRIANGLES_KEY = 'triangles'
MESH_NORMALS_KEY = 'normals'
MESH_POSE_KEY = 'pose'
MESH_SCALE_KEY = 'scale'
MESH_DENSITY_KEY = 'density'
LOCAL_FEATURE_NUM_FEAT_KEY = 'num_features'
LOCAL_FEATURE_DESC_KEY = 'descriptors'
LOCAL_FEATURE_RF_KEY = 'rfs'
LOCAL_FEATURE_POINT_KEY = 'points'
LOCAL_FEATURE_NORMAL_KEY = 'normals'
SHOT_FEATURES_KEY = 'shot'
FEATURE_KEY = 'feature'
NUM_STP_KEY = 'num_stable_poses'
POSE_KEY = 'pose'
STABLE_POSE_PROB_KEY = 'p'
STABLE_POSE_ROT_KEY = 'r'
STABLE_POSE_PT_KEY = 'x0'
NUM_GRASPS_KEY = 'num_grasps'
GRASP_KEY = 'grasp'
GRASP_ID_KEY = 'id'
GRASP_TYPE_KEY = 'type'
GRASP_CONFIGURATION_KEY = 'configuration'
GRASP_RF_KEY = 'frame'
GRASP_TIMESTAMP_KEY = 'timestamp'
GRASP_METRICS_KEY = 'metrics'
GRASP_FEATURES_KEY = 'features'
GRASP_FEATURE_NAME_KEY = 'name'
GRASP_FEATURE_TYPE_KEY = 'type'
GRASP_FEATURE_VECTOR_KEY = 'vector'
NUM_IMAGES_KEY = 'num_images'
IMAGE_KEY = 'image'
IMAGE_DATA_KEY = 'image_data'
IMAGE_FRAME_KEY = 'image_frame'
CAM_POS_KEY = 'cam_pos'
CAM_ROT_KEY = 'cam_rot'
CAM_INT_PT_KEY = 'cam_int_pt'
CAM_FRAME_KEY = 'cam_frame'
# Extras
RENDERED_IMAGE_TYPES = ['segmask', 'depth', 'scaled_depth']
# Metadata
METADATA_KEY = 'metadata'
METADATA_TYPE_KEY = 'type'
METADATA_DESC_KEY = 'description'
METADATA_FUNC_KEY = 'func'
# Connected components
CONNECTED_COMPONENTS_KEY = 'connected_components'
|
# GYP file to build experimental directory.
{
'targets': [
{
'target_name': 'experimental',
'type': 'static_library',
'include_dirs': [
'../include/config',
'../include/core',
],
'sources': [
'../experimental/SkSetPoly3To3.cpp',
'../experimental/SkSetPoly3To3_A.cpp',
'../experimental/SkSetPoly3To3_D.cpp',
],
'direct_dependent_settings': {
'include_dirs': [
'../experimental',
],
},
},
{
'target_name': 'multipage_pdf_profiler',
'type': 'executable',
'sources': [
'../experimental/tools/multipage_pdf_profiler.cpp',
'../experimental/tools/PageCachingDocument.cpp',
],
'dependencies': [
'skia_lib.gyp:skia_lib',
'pdf.gyp:pdf',
'tools.gyp:proc_stats',
'tools.gyp:sk_tool_utils',
],
},
{
'target_name': 'skp_to_pdf_md5',
'type': 'executable',
'sources': [
'../experimental/tools/skp_to_pdf_md5.cpp',
'../experimental/tools/SkDmuxWStream.cpp',
],
'include_dirs': [
'../src/core',
'../tools/flags',
],
'dependencies': [
'pdf.gyp:pdf',
'skia_lib.gyp:skia_lib',
'tools.gyp:sk_tool_utils',
],
},
],
}
|
def gem_id_compat(ob):
"""Compatibility for old files from v1.5, should be removed at some point"""
if ob.type == 'MESH' and 'gem' in ob.data:
if 'gem' not in ob:
ob['gem'] = {}
for k in ('TYPE', 'type'):
if k in ob.data['gem']:
ob['gem']['stone'] = ob.data['gem'][k]
for k in ('CUT', 'cut'):
if k in ob.data['gem']:
ob['gem']['cut'] = ob.data['gem'][k]
del ob.data['gem']
|
# N stands for North
# S stands for south
# E stands for east
# W stands for west
#Oeste es West y Este es East
#NoSe == NWSE North and South are opposites, so are West and East
# N
# |
# W---+--E
# |
# S
# L stands for Left
# R stands for right
# F stands for forward
with open('E:\code\AoC\day12\input.txt', 'r') as input:
instructions = input.read().split('\n')
def degrees_to_position(action, degrees):
#degrees have to be integers and action has to be string L or R
if degrees == 90:
if action == 'L':
return 1
else:
return -1
elif degrees == 180:
return 2
else: # the last case is when it's 270 degrees
if action == 'L':
return 3
else:
return -3
points = 'NWSE'
facing_direction = 'E'
x_dist_positive, y_dist_positive = 0, 0
x_dist_negative, y_dist_negative = 0, 0
for instruction in instructions:
boat_action = instruction[0]
value_action = int(instruction[1:])
if boat_action == 'N' or boat_action == 'S':
if boat_action == 'N':
y_dist_positive+= value_action
else:
y_dist_negative+= value_action
elif boat_action == 'W' or boat_action == 'E':
if boat_action == 'E':
x_dist_positive+= value_action
else:
x_dist_negative+= value_action
elif boat_action == 'L' or boat_action == 'R':
position_index = 0
position_index = (degrees_to_position(boat_action, value_action) + \
points.find(facing_direction))%4
facing_direction = points[position_index]
else:
if facing_direction == 'N':
y_dist_positive+= value_action
elif facing_direction == 'S':
y_dist_negative+= value_action
elif facing_direction == 'E':
x_dist_positive+= value_action
elif facing_direction== 'W':
x_dist_negative+= value_action
print(abs(x_dist_positive-x_dist_negative)+abs(y_dist_positive-y_dist_negative))
|
def divisors_count(n):
count = 0
for i in range(1, n+1):
if (n % i) == 0:
count += 1
return count
def triangulate(n):
y = [int(x) for x in list(str(n))]
return sum(y)
triangle = 1
while divisors_count(triangle) <= 500:
triangle += triangulate(triangle)
print(triangle)
|
class Solution:
def countElements(self, nums: List[int]) -> int:
nums.sort()
k=0
for i in nums:
if i+1 in nums:
k=k+1
return k
|
# -*- coding: utf-8 -*-
N = int(input())
answer = " ".join(["Ho"] * N) + "!"
print(answer)
|
'''
The Stable Marriage Problem states that given N men and N women, where each person has ranked all members of the opposite sex in order of preference, marry the men and women together such that there are no two people of opposite sex who would both rather have each other than their current partners.
If there are no such people, all the marriages are “stable” (Source Wiki).
Consider the following example.
Let there be two men m1 and m2 and two women w1 and w2.
Let m1‘s list of preferences be {w1, w2}
Let m2‘s list of preferences be {w1, w2}
Let w1‘s list of preferences be {m1, m2}
Let w2‘s list of preferences be {m1, m2}
The matching { {m1, w2}, {w1, m2} } is not stable because m1 and w1 would prefer each other over their assigned partners. The matching {m1, w1} and {m2, w2} is stable because there are no two people of opposite sex that would prefer each other over their assigned partners.
SOLUTION:
The idea is to iterate through all free men while there is any free man available.
Every free man goes to all women in his preference list according to the order.
For every woman he goes to, he checks if the woman is free, if yes, they both become engaged.
If the woman is not free, then the woman chooses either says no to him or dumps her current engagement according to her preference list. So an engagement done once can be broken if a woman gets better option.
Time Complexity of Gale-Shapley Algorithm is O(n2).
Initialize all men and women to free
while there exist a free man m who still has a woman w to propose to
{
w = m's highest ranked such woman to whom he has not yet proposed
if w is free
(m, w) become engaged
else some pair (m', w) already exists
if w prefers m to m'
(m, w) become engaged
m' becomes free
else
(m', w) remain engaged
}
'''
|
for _ in range(int(input())):
n,k=map(int,input().split())
a=bin(k)[2:]
a=str(a)
a=a.zfill(n)
a=a[::-1]
print(int(a,2))
|
'''
Goals:
-Have more options
-Make code much more clean
'''
class Temperature:
def __init__(self, degrees, kind):
self.degrees = degrees
self.kind = kind
def input(self):
Player_input = float(input("How many degrees?"))
self.degrees = Player_input
def Repeat():
while True:
try:
#using a dictionary to reduce the amount of if statements.
y_or_n = input("Do you want to convert again? (Y) or (N)")
repeat = {"Y": Setup, "y":Setup, " y":Setup, " Y":Setup,
"N":exit, "n":exit, " n":exit, " N":exit}
print(repeat[y_or_n]())
break
except KeyError:
print("Enter Y or N again please.")
continue
class Fahrenheit(Temperature):
def __init__(self, degrees, kind):
super().__init__(degrees, kind)
def F_to_C(self):
# Fahrenheit to Celsius
self.input()
x = ((self.degrees -32) * (5/9))
return f'{self.degrees} degrees {self.kind} converts to {x} degrees Celsius.'
self.Repeat()
def F_to_K(self):
# Fahrenheit to Kelvin
self.input()
x = (((self.degrees-32)*(5/9))+273.15)
return f'{self.degrees} degrees {self.kind} converts to {x} Kelvin.'
self.Repeat()
def F_to_R(self):
# Fahrenheit to Rankine
self.input()
x = self.degrees + 459.67
return f'{self.degrees} degrees {self.kind} converts to {x} degrees Rankine.'
self.Repeat()
class Celsius(Temperature):
def __init__(self, degrees, kind):
super().__init__(degrees, kind)
def C_to_F(self):
# Celsius to Fahrenheit
self.input()
x = ((self.degrees * (9/5) + 32))
return f'{self.degrees} degrees {self.kind} converts to {x} degrees Fahrenheit.'
self.Repeat()
def C_to_K(self):
# Celsius to Kelvin
self.input()
x = ( self.degrees + 273.15)
return f'{self.degrees} degrees {self.kind} converts to {x} Kelvin.'
self.Repeat()
def C_to_R(self):
# Celsius to Rankine
self.input()
x = ((self.degrees * 9/5)+491.67)
return f'{self.degrees} degrees {self.kind} converts to {x} degrees Rankine.'
self.Repeat()
class Kelvin(Temperature):
def __init__(self, degrees, kind):
super().__init__(degrees, kind)
def Kelvin_input(self):
Player_input = float(input("How much Kelvin?"))
self.degrees = Player_input
def K_to_F(self):
# Kelvin to Fahrenheit
self.input()
x = ((9/5 * (self.degrees-273.15))+32)
return f'{self.degrees} {self.kind} converts to {x} degrees Fahrenheit.'
self.Repeat()
def K_to_C(self):
# Kelvin to Celsius
self.input()
x = (self.degrees - 273.15)
return f'{self.degrees} {self.kind} converts to {x} degrees Celsius.'
self.Repeat()
def K_to_R(self):
# Kelvin to Rankine
self.input()
x = (self.degrees * 1.8)
return f'{self.degrees} {self.kind} converts to {x} degrees Rankine.'
self.Repeat()
class Rankine(Temperature):
def __init__(self, degrees, kind):
super().__init__(degrees, kind)
def R_to_F(self):
# Rankine to Fahrenheit
self.input()
x = (self.degrees - 459.67)
return f'{self.degrees} degrees {self.kind} converts to {x} degrees Fahrenheit.'
self.Repeat()
def R_to_C(self):
# Rankine to Celsius
self.input()
x = ((self.degrees - 459.67)*5/9)
return f'{self.degrees} degrees {self.kind} converts to {x} degrees Celsius.'
self.Repeat()
def R_to_K(self):
# Rankine to Kelvin
self.input()
x = (self.degrees *5/9)
return f'{self.degrees} degrees {self.kind} converts to {x} Kelvin.'
self.Repeat()
#I like to call the functions that display the outputs Setup() but you can call it whatever you want.
def Setup():
print("Welcome to the Temperature converter!")
Response = """What conversion do you want to do? \nFahrenheit to Celsius (1) Fahrenheit to Kelvin (2) Fahrenheit to Rankine(3)
\nCelsius to Fahrenheit (4) Celsius to Kelvin (5) Celsius to Rankine (6) \nKelvin to Fahrenheit (7) Kelvin to Celsius (8) Kelvin to Rankine (9)
\nRankine to Celsius (10) \nRankine to Fahrenheit (11) Rankine to Kelvin (12)
"""
print(Response)
'''Temp1 is instance of the Fahrenheit class and Temp2 is an instance of the Celsius class.
I put in 0 as a placeholder for self.degrees as the person will choose the degrees anyway.
'''
Temp1 = Fahrenheit(0, "Fahrenheit")
Temp2 = Celsius(0, "Celsius")
Temp3 = Kelvin(0, "Kelvin")
Temp4 = Rankine(0, "Rankine")
while True:
try:
options ={
"1":Temp1.F_to_C, "2":Temp1.F_to_K, "3":Temp1.F_to_R, "4":Temp2.C_to_F, "5":Temp2.C_to_K,
"6":Temp2.C_to_R, "7":Temp3.K_to_F, "8":Temp3.K_to_C, "9":Temp3.K_to_R,
"10":Temp4.R_to_C, "11":Temp4.R_to_F, "12":Temp4.R_to_K
}
choice = input("Select the number of the conversion here: ")
print(options[choice]())
repeat = Temperature.Repeat()
print(repeat)
break
except KeyError:
print("Sorry, please type in the number of the conversion again.")
continue
Setup()
|
# -*- coding: utf-8 -*-
'''
This module contains basic form access control classes.
You can set permissions to form and fields like this::
class SampleForm(form.Form):
permissions = 'rwcx'
fields=[fields.Field('input',
permissions='rw')]
or define your own permission logic::
class SampleForm(form.Form):
permissions = 'rwcx'
fields=[fields.Field('input',
perm_getter=UserBasedPerm({'admin': 'rw',
'user': 'r'}))]
or pass form permissions to constructor::
>>> form = SampleForm(env, data, permissions='rw')
To access current permissions set you can use field's :attr:`permissions`
property:
>>> form.get_field('input').permissions
set(['r', 'w'])
'''
DEFAULT_PERMISSIONS = set('rwc')
class FieldPerm(object):
'''
Default permission getter for Field objects
Ancestor should override the :meth:`check` method. They can use field.env
to get any values from outside. For example::
class RoleBased(FieldPerm):
def __init__(self, role_perms):
self.role_perms = role_perms
def check(self, field):
user = field.env.user
perms = set(self.role_perms.get('*', ''))
for role in user.roles:
perms.update(self.role_perms.get(role, ''))
return perms
'''
permissions = None
def __init__(self, permissions=None):
if permissions is not None:
self.permissions = set(permissions)
def get_perms(self, obj):
'''
Returns combined Environment's and object's permissions.
Resulting condition is intersection of them.
'''
return self.available(obj) & self.check(obj)
def available(self, field):
'''
Returns permissions according environment's limiting condition.
Determined by object's context
Allows only field's parents' permissions
'''
return field.parent.permissions
def check(self, field):
'''
Returns permissions determined by object itself
'''
if self.permissions is None:
return field.parent.permissions
return self.permissions
def __repr__(self):
return '{}({})'.format(self.__class__.__name__, str(self.permissions))
|
#!/usr/bin/env python
class Link(object):
"""docstring for Link"""
def __init__(self, url):
super(Link, self).__init__()
self.url = url
self.in_link = 1
self.out_link = 0
self.visited = False
self.round = 1
self.outs = set()
self.ins = set()
self.header = ''
class MyQueue(object):
"""docstring for MyQueue"""
def __init__(self):
super(MyQueue, self).__init__()
self.list = [Link('null')] # node 0 always not used
self.index = 0 # the index of the last element
self.hash_map = {} # url -> index
def empty(self):
# check if the priority queue is empty
return len(self.list) == 1
def push(self, item):
# add item to the list
self.list.append(item)
self.index += 1
self.hash_map[item.url] = self.index
self.refresh(self.index)
def pop(self):
# this function will get the highest priority element in the queue
# if self.empty(): we should check, but I have check in the crawler
# return
res = self.list[1]
del self.hash_map[res.url]
if self.index == 1:
del self.list[-1]
self.index -= 1
return res
self.list[1] = self.list[self.index]
self.hash_map[self.list[1].url] = 1
del self.list[-1]
self.index -= 1
self.heapify(1)
return res
def update(self, item):
if item.url not in self.hash_map:
return
self.refresh(self.hash_map[item.url])
def heapify(self, kk):
k = kk
while 2 * k < self.index:
child = 2 * k
# next_elem = object
if self.compare(self.list[child], self.list[child + 1]):
# next_elem = self.list[child]
if self.compare(self.list[k], self.list[child]):
return
else:
self.swap(k, child)
k = child
else:
# next_elem = self.list[child + 1]
if self.compare(self.list[k], self.list[child + 1]):
return
else:
self.swap(k, child + 1)
k = child + 1
if 2 * k == self.index:
if not self.compare(self.list[k], self.list[2 * k]):
self.swap(k, 2 * k)
def refresh(self, k):
while k > 1 and self.compare(self.list[k], self.list[k / 2]):
self.swap(k, k / 2)
k = k / 2
pass
def swap(self, index1, index2):
temp = self.list[index1]
self.list[index1] = self.list[index2]
self.list[index2] = temp
self.hash_map[self.list[index1].url] = index1
self.hash_map[self.list[index2].url] = index2
def compare(self, item1, item2):
# return if item1 has higher priority
if item1.round == 1: # which means seed
if item2.round == 1:
if item1.in_link > item2.in_link:
return True
else:
return False
else:
return True
elif item2.round == 1:
return False
if item1.in_link > item2.in_link:
return True
elif item1.in_link < item2.in_link:
return False
elif item1.in_link == item2.in_link:
if item1.round < item2.round:
return True
else:
return False
|
# WAP in python to check the given year is leap or not.
year=int(input("Enter Year: "))
if year % 4 == 0:
if year % 100 == 0:
if year % 400 == 0:
print("{0} is a leap year".format(year))
else:
print("{0} is not a leap year".format(year))
else:
print("{0} is a leap year".format(year))
else:
print("{0} is not a leap year".format(year))
|
def power(n, m):
if m == 0:
return 1
elif m == 1:
return n
return (n*power(n, m-1))
print(power(2,3))
|
def convert_to_strsid(binsid):
if len(binsid) < 24:
return None
dashes = int(binsid[2:4])
list_sid = ["S", "1"]
range_parts = range(16, dashes*8+16, 8)
list_sid.append(str(int(binsid[4:16], 16)))
for i in range_parts:
list_sid.append(str(int(invert_endian(binsid[i:i+8]), 16)))
return "-".join(list_sid)
def convert_to_binsid(strsid):
if not strsid[0:8] == "S-1-5-21":
return None
list_strsid = strsid.split("-")[2:]
list_sid = ["01", "{:02d}".format(len(list_strsid) - 1), "{:012X}".format(int(list_strsid[0]))]
for n in list_strsid[1:]:
list_sid.append(invert_endian("{:08X}".format(int(n))))
return "".join(list_sid)
def invert_endian(number):
s = ""
for i in range(len(number) + 1 if len(number) % 2 == 1 else len(number), -1, -2):
s += number[i:i+2]
return s
def print_list(l):
if type(l).__name__ in ['list', 'tuple']:
for r in l:
print(r)
elif type(l).__name__ == 'dict':
for k, v in l:
print(f'{k} => {v}')
else:
print(l)
|
# global settings
data_root = "../../data/winequality_dataset/"
feature_save_dir = data_root + "features/"
img_save_dir = data_root + "imgs/"
# split chunk settings
split_chunk_path = data_root + 'chunk/'
raw_train_file = dict(
file_path=data_root + 'raw_data/train.csv',
size=3397,
split_mode=['train', 'valA', 'valB'],
split_ratio=[0.6, 0.2, 0.2],
chunk_size=200000,
features_names=[
dict(name='quality', type='int'),
dict(name='fixed acidity', type='float'),
dict(name='volatile acidity', type='float'),
dict(name='citric acid', type='float'),
dict(name='residual sugar', type='float'),
dict(name='chlorides', type='float'),
dict(name='free sulfur dioxide', type='float'),
dict(name='total sulfur dioxide', type='float'),
dict(name='density', type='float'),
dict(name='pH', type='float'),
dict(name='sulphates', type='float'),
dict(name='alcohol', type='float'),
]
)
raw_test_file = dict(
file_path=data_root + 'raw_data/test.csv',
size=1500,
split_mode=['test'],
split_ratio=[1.0],
chunk_size=200000,
features_names=[
dict(name='fixed acidity', type='float'),
dict(name='volatile acidity', type='float'),
dict(name='citric acid', type='float'),
dict(name='residual sugar', type='float'),
dict(name='chlorides', type='float'),
dict(name='free sulfur dioxide', type='float'),
dict(name='total sulfur dioxide', type='float'),
dict(name='density', type='float'),
dict(name='pH', type='float'),
dict(name='sulphates', type='float'),
dict(name='alcohol', type='float'),
]
)
other_train_files = []
# features settings
feature_mode = ['train']
target_name = 'quality'
id_name = 'id'
feature_dict_file = feature_save_dir + "feature_dict_train.json"
draw_feature = True
style = 'darkgrid'
# train settings
train_type = 'Regressor'
work_dirs = "./work_dirs/"
dataset_name = "alcohol"
balanced_data = False
normalization = 'none' # global, local, none
random_state = 666
train_mode = ['train', 'valA', 'valB']
val_mode = ['valA', 'valB']
train_models = [
dict(name='ABT', random_state=random_state, params=dict()),
dict(name='RF', random_state=random_state, params=dict()),
dict(name='XGB', random_state=random_state, params=dict()),
dict(name='GBT', random_state=random_state, params=dict()),
dict(name='LGB', random_state=random_state, params=dict()),
dict(name='DT', random_state=random_state, params=dict()),
dict(name='ET', random_state=random_state, params=dict()),
dict(name='KNN', random_state=random_state, params=None),
dict(name='LR', random_state=random_state, params=dict()),
# dict(name='GNB', random_state=random_state, params=dict()),
# dict(name='SVM', random_state=random_state, params=dict()),
]
|
Import("env")
src_filter = ["+<TRB_MCP23017.h>"]
env.Replace(SRC_FILTER=src_filter)
build_flags = env.ParseFlags(env['BUILD_FLAGS'])
cppdefines = build_flags.get("CPPDEFINES")
if "TRB_MCP23017_ESP_IDF" in cppdefines:
env.Append(SRC_FILTER=["+<TRB_MCP23017.c>", "+<sys/esp_idf>"])
if "TRB_MCP23017_ARDUINO_WIRE" in cppdefines:
env.Append(SRC_FILTER=["+<TRB_MCP23017.cpp>", "+<sys/arduino_wire>"])
if "TRB_MCP23017_ARDUINO_BRZO" in cppdefines:
env.Append(SRC_FILTER=["+<TRB_MCP23017.cpp>", "+<sys/arduino_brzo>"])
|
SEQUENCE_FILE = "data\\test_action_20_maxSeq15_20K.txt"
CRASH_INDEX = "1"
# SEQUENCE_FILE = "data\\activityseq_balanced_2018-02-05_2018-02-09_Excel_apphangb1_Production.tsv"
# SEQUENCE_FILE = r"C:\Users\mahajiag\Documents\tmp\crash\eventseq_balanced_2018-02-05_2018-02-09_Excel_apphangb1_Production.tsv"
ROOT_DIR = 'tfboard'
ACTIONS_TO_BE_FILTERED = ['']
# configs = { 'batchSize' : 512,
# 'maxSeqSize': 40,
# 'testSplit': .5,
# 'embeddingSize': None,
# 'epochs': 400,
# 'dedup': 0,
# 'conv1D':0,
# 'lstmSize': None,
# 'testFlag': False,
# 'p2nRatio':1,
# 'networkType':"bidirectional"}
configs = { 'batchSize' : 512,
'maxSeqSize': 17,
'testSplit': .5,
'embeddingSize': None,
'epochs': 250,
'dedup': 1,
'conv1D':0,
'lstmSize': None,
'testFlag': True,
'p2nRatio':1,
'networkType':"bidirectional"
}
classWeights = {0: .5,
1: .5}
|
major_colors = ["White", "Red", "Black", "Yellow", "Violet"]
minor_colors = ["Blue", "Orange", "Green", "Brown", "Slate"]
def color_mapping():
cp_rows = []
for i, major_color in enumerate(major_colors):
for j, minor_color in enumerate(minor_colors):
print_color_map((i * 5 + j)+1 , major_color, minor_color)
cp_rows.append(f'{(i * 5 + j)+1} | {major_color} | {minor_color}')
return len(major_colors) * len(minor_colors), cp_rows
def print_color_map(pair_number, major_color, minor_color):
print(f'{pair_number} | {major_color} | {minor_color}')
result, cp_rows = color_mapping()
assert (cp_rows[3] == '4 | White | Brown')
assert (cp_rows[7] == '8 | Red | Green')
assert (cp_rows[23] == '24 | Violet | Brown')
print("All is well (maybe!)\n")
|
'''
Nd Genie Ops Object Outputs for IOSXR.
'''
class NdOutput(object):
ShowIpv6Neighbors = {
'interfaces': {
'GigabitEthernet0/0/0/0.90': {
'interface': 'Gi0/0/0/0.90',
'neighbors': {
'fe80::f816:3eff:fe26:1224': {
'age': '131',
'ip': 'fe80::f816:3eff:fe26:1224',
'link_layer_address': 'fa16.3e26.1224',
'neighbor_state': 'REACH',
'location': '0/0/CPU0',
},
'Mcast adjacency': {
'age': '-',
'ip': 'Mcast adjacency',
'link_layer_address': '0000.0000.0000',
'neighbor_state': 'REACH',
'location': '0/0/CPU0',
},
},
},
'GigabitEthernet0/0/0/1.90': {
'interface': 'Gi0/0/0/1.90',
'neighbors': {
'fe80::5c00:40ff:fe02:7': {
'age': '144',
'ip': 'fe80::5c00:40ff:fe02:7',
'link_layer_address': '5e00.4002.0007',
'neighbor_state': 'REACH',
'location': '0/0/CPU0',
},
'Mcast adjacency': {
'age': '-',
'ip': 'Mcast adjacency',
'link_layer_address': '0000.0000.0000',
'neighbor_state': 'REACH',
'location': '0/0/CPU0',
},
},
},
'GigabitEthernet0/0/0/0.110': {
'interface': 'Gi0/0/0/0.110',
'neighbors': {
'fe80::f816:3eff:fe26:1224': {
'age': '99',
'ip': 'fe80::f816:3eff:fe26:1224',
'link_layer_address': 'fa16.3e26.1224',
'neighbor_state': 'REACH',
'location': '0/0/CPU0',
},
'Mcast adjacency': {
'age': '-',
'ip': 'Mcast adjacency',
'link_layer_address': '0000.0000.0000',
'neighbor_state': 'REACH',
'location': '0/0/CPU0',
},
},
},
'GigabitEthernet0/0/0/0.115': {
'interface': 'Gi0/0/0/0.115',
'neighbors': {
'fe80::f816:3eff:fe26:1224': {
'age': '46',
'ip': 'fe80::f816:3eff:fe26:1224',
'link_layer_address': 'fa16.3e26.1224',
'neighbor_state': 'REACH',
'location': '0/0/CPU0',
},
'Mcast adjacency': {
'age': '-',
'ip': 'Mcast adjacency',
'link_layer_address': '0000.0000.0000',
'neighbor_state': 'REACH',
'location': '0/0/CPU0',
},
},
},
'GigabitEthernet0/0/0/0.120': {
'interface': 'Gi0/0/0/0.120',
'neighbors': {
'Mcast adjacency': {
'age': '-',
'ip': 'Mcast adjacency',
'link_layer_address': '0000.0000.0000',
'neighbor_state': 'REACH',
'location': '0/0/CPU0',
},
},
},
'GigabitEthernet0/0/0/0.390': {
'interface': 'Gi0/0/0/0.390',
'neighbors': {
'fe80::f816:3eff:fe26:1224': {
'age': '137',
'ip': 'fe80::f816:3eff:fe26:1224',
'link_layer_address': 'fa16.3e26.1224',
'neighbor_state': 'REACH',
'location': '0/0/CPU0',
},
'Mcast adjacency': {
'age': '-',
'ip': 'Mcast adjacency',
'link_layer_address': '0000.0000.0000',
'neighbor_state': 'REACH',
'location': '0/0/CPU0',
},
},
},
'GigabitEthernet0/0/0/0.410': {
'interface': 'Gi0/0/0/0.410',
'neighbors': {
'Mcast adjacency': {
'age': '-',
'ip': 'Mcast adjacency',
'link_layer_address': '0000.0000.0000',
'neighbor_state': 'REACH',
'location': '0/0/CPU0',
},
},
},
'GigabitEthernet0/0/0/0.415': {
'interface': 'Gi0/0/0/0.415',
'neighbors': {
'Mcast adjacency': {
'age': '-',
'ip': 'Mcast adjacency',
'link_layer_address': '0000.0000.0000',
'neighbor_state': 'REACH',
'location': '0/0/CPU0',
},
},
},
'GigabitEthernet0/0/0/0.420': {
'interface': 'Gi0/0/0/0.420',
'neighbors': {
'Mcast adjacency': {
'age': '-',
'ip': 'Mcast adjacency',
'link_layer_address': '0000.0000.0000',
'neighbor_state': 'REACH',
'location': '0/0/CPU0',
},
},
},
'GigabitEthernet0/0/0/1.110': {
'interface': 'Gi0/0/0/1.110',
'neighbors': {
'fe80::5c00:40ff:fe02:7': {
'age': '167',
'ip': 'fe80::5c00:40ff:fe02:7',
'link_layer_address': '5e00.4002.0007',
'neighbor_state': 'REACH',
'location': '0/0/CPU0',
},
'Mcast adjacency': {
'age': '-',
'ip': 'Mcast adjacency',
'link_layer_address': '0000.0000.0000',
'neighbor_state': 'REACH',
'location': '0/0/CPU0',
},
},
},
'GigabitEthernet0/0/0/1.115': {
'interface': 'Gi0/0/0/1.115',
'neighbors': {
'fe80::5c00:40ff:fe02:7': {
'age': '137',
'ip': 'fe80::5c00:40ff:fe02:7',
'link_layer_address': '5e00.4002.0007',
'neighbor_state': 'REACH',
'location': '0/0/CPU0',
},
'Mcast adjacency': {
'age': '-',
'ip': 'Mcast adjacency',
'link_layer_address': '0000.0000.0000',
'neighbor_state': 'REACH',
'location': '0/0/CPU0',
},
},
},
'GigabitEthernet0/0/0/1.120': {
'interface': 'Gi0/0/0/1.120',
'neighbors': {
'Mcast adjacency': {
'age': '-',
'ip': 'Mcast adjacency',
'link_layer_address': '0000.0000.0000',
'neighbor_state': 'REACH',
'location': '0/0/CPU0',
},
},
},
'GigabitEthernet0/0/0/1.390': {
'interface': 'Gi0/0/0/1.390',
'neighbors': {
'fe80::5c00:40ff:fe02:7': {
'age': '101',
'ip': 'fe80::5c00:40ff:fe02:7',
'link_layer_address': '5e00.4002.0007',
'neighbor_state': 'REACH',
'location': '0/0/CPU0',
},
'Mcast adjacency': {
'age': '-',
'ip': 'Mcast adjacency',
'link_layer_address': '0000.0000.0000',
'neighbor_state': 'REACH',
'location': '0/0/CPU0',
},
},
},
'GigabitEthernet0/0/0/1.410': {
'interface': 'Gi0/0/0/1.410',
'neighbors': {
'fe80::5c00:40ff:fe02:7': {
'age': '121',
'ip': 'fe80::5c00:40ff:fe02:7',
'link_layer_address': '5e00.4002.0007',
'neighbor_state': 'REACH',
'location': '0/0/CPU0',
},
'Mcast adjacency': {
'age': '-',
'ip': 'Mcast adjacency',
'link_layer_address': '0000.0000.0000',
'neighbor_state': 'REACH',
'location': '0/0/CPU0',
},
},
},
'GigabitEthernet0/0/0/1.415': {
'interface': 'Gi0/0/0/1.415',
'neighbors': {
'Mcast adjacency': {
'age': '-',
'ip': 'Mcast adjacency',
'link_layer_address': '0000.0000.0000',
'neighbor_state': 'REACH',
'location': '0/0/CPU0',
},
},
},
'GigabitEthernet0/0/0/1.420': {
'interface': 'Gi0/0/0/1.420',
'neighbors': {
'Mcast adjacency': {
'age': '-',
'ip': 'Mcast adjacency',
'link_layer_address': '0000.0000.0000',
'neighbor_state': 'REACH',
'location': '0/0/CPU0',
},
},
},
},
}
ShowIpv6NeighborsDetail = {
'interfaces': {
'GigabitEthernet0/0/0/0.90': {
'interface': 'Gi0/0/0/0.90',
'neighbors': {
'fe80::f816:3eff:fe26:1224': {
'age': '138',
'ip': 'fe80::f816:3eff:fe26:1224',
'link_layer_address': 'fa16.3e26.1224',
'neighbor_state': 'REACH',
'location': '0/0/CPU0',
'static': '-',
'dynamic': 'Y',
'sync': '-',
'serg_flags': 'ff',
'origin': 'dynamic',
},
'Mcast adjacency': {
'age': '-',
'ip': 'Mcast adjacency',
'link_layer_address': '0000.0000.0000',
'neighbor_state': 'REACH',
'location': '0/0/CPU0',
'static': '-',
'dynamic': '-',
'sync': '-',
'serg_flags': 'ff',
'origin': 'other',
},
},
},
'GigabitEthernet0/0/0/1.90': {
'interface': 'Gi0/0/0/1.90',
'neighbors': {
'fe80::5c00:40ff:fe02:7': {
'age': '151',
'ip': 'fe80::5c00:40ff:fe02:7',
'link_layer_address': '5e00.4002.0007',
'neighbor_state': 'REACH',
'location': '0/0/CPU0',
'static': '-',
'dynamic': 'Y',
'sync': '-',
'serg_flags': 'ff',
'origin': 'dynamic',
},
'Mcast adjacency': {
'age': '-',
'ip': 'Mcast adjacency',
'link_layer_address': '0000.0000.0000',
'neighbor_state': 'REACH',
'location': '0/0/CPU0',
'static': '-',
'dynamic': '-',
'sync': '-',
'serg_flags': 'ff',
'origin': 'other',
},
},
},
'GigabitEthernet0/0/0/0.110': {
'interface': 'Gi0/0/0/0.110',
'neighbors': {
'fe80::f816:3eff:fe26:1224': {
'age': '114',
'ip': 'fe80::f816:3eff:fe26:1224',
'link_layer_address': 'fa16.3e26.1224',
'neighbor_state': 'REACH',
'location': '0/0/CPU0',
'static': '-',
'dynamic': 'Y',
'sync': '-',
'serg_flags': 'ff',
'origin': 'dynamic',
},
'Mcast adjacency': {
'age': '-',
'ip': 'Mcast adjacency',
'link_layer_address': '0000.0000.0000',
'neighbor_state': 'REACH',
'location': '0/0/CPU0',
'static': '-',
'dynamic': '-',
'sync': '-',
'serg_flags': 'ff',
'origin': 'other',
},
},
},
'GigabitEthernet0/0/0/0.115': {
'interface': 'Gi0/0/0/0.115',
'neighbors': {
'fe80::f816:3eff:fe26:1224': {
'age': '69',
'ip': 'fe80::f816:3eff:fe26:1224',
'link_layer_address': 'fa16.3e26.1224',
'neighbor_state': 'REACH',
'location': '0/0/CPU0',
'static': '-',
'dynamic': 'Y',
'sync': '-',
'serg_flags': 'ff',
'origin': 'dynamic',
},
'Mcast adjacency': {
'age': '-',
'ip': 'Mcast adjacency',
'link_layer_address': '0000.0000.0000',
'neighbor_state': 'REACH',
'location': '0/0/CPU0',
'static': '-',
'dynamic': '-',
'sync': '-',
'serg_flags': 'ff',
'origin': 'other',
},
},
},
'GigabitEthernet0/0/0/0.120': {
'interface': 'Gi0/0/0/0.120',
'neighbors': {
'Mcast adjacency': {
'age': '-',
'ip': 'Mcast adjacency',
'link_layer_address': '0000.0000.0000',
'neighbor_state': 'REACH',
'location': '0/0/CPU0',
'static': '-',
'dynamic': '-',
'sync': '-',
'serg_flags': 'ff',
'origin': 'other',
},
},
},
'GigabitEthernet0/0/0/0.390': {
'interface': 'Gi0/0/0/0.390',
'neighbors': {
'fe80::f816:3eff:fe26:1224': {
'age': '151',
'ip': 'fe80::f816:3eff:fe26:1224',
'link_layer_address': 'fa16.3e26.1224',
'neighbor_state': 'REACH',
'location': '0/0/CPU0',
'static': '-',
'dynamic': 'Y',
'sync': '-',
'serg_flags': 'ff',
'origin': 'dynamic',
},
'Mcast adjacency': {
'age': '-',
'ip': 'Mcast adjacency',
'link_layer_address': '0000.0000.0000',
'neighbor_state': 'REACH',
'location': '0/0/CPU0',
'static': '-',
'dynamic': '-',
'sync': '-',
'serg_flags': 'ff',
'origin': 'other',
},
},
},
'GigabitEthernet0/0/0/0.410': {
'interface': 'Gi0/0/0/0.410',
'neighbors': {
'Mcast adjacency': {
'age': '-',
'ip': 'Mcast adjacency',
'link_layer_address': '0000.0000.0000',
'neighbor_state': 'REACH',
'location': '0/0/CPU0',
'static': '-',
'dynamic': '-',
'sync': '-',
'serg_flags': 'ff',
'origin': 'other',
},
},
},
'GigabitEthernet0/0/0/0.415': {
'interface': 'Gi0/0/0/0.415',
'neighbors': {
'Mcast adjacency': {
'age': '-',
'ip': 'Mcast adjacency',
'link_layer_address': '0000.0000.0000',
'neighbor_state': 'REACH',
'location': '0/0/CPU0',
'static': '-',
'dynamic': '-',
'sync': '-',
'serg_flags': 'ff',
'origin': 'other',
},
},
},
'GigabitEthernet0/0/0/0.420': {
'interface': 'Gi0/0/0/0.420',
'neighbors': {
'Mcast adjacency': {
'age': '-',
'ip': 'Mcast adjacency',
'link_layer_address': '0000.0000.0000',
'neighbor_state': 'REACH',
'location': '0/0/CPU0',
'static': '-',
'dynamic': '-',
'sync': '-',
'serg_flags': 'ff',
'origin': 'other',
},
},
},
'GigabitEthernet0/0/0/1.110': {
'interface': 'Gi0/0/0/1.110',
'neighbors': {
'fe80::5c00:40ff:fe02:7': {
'age': '17',
'ip': 'fe80::5c00:40ff:fe02:7',
'link_layer_address': '5e00.4002.0007',
'neighbor_state': 'REACH',
'location': '0/0/CPU0',
'static': '-',
'dynamic': 'Y',
'sync': '-',
'serg_flags': 'ff',
'origin': 'dynamic',
},
'Mcast adjacency': {
'age': '-',
'ip': 'Mcast adjacency',
'link_layer_address': '0000.0000.0000',
'neighbor_state': 'REACH',
'location': '0/0/CPU0',
'static': '-',
'dynamic': '-',
'sync': '-',
'serg_flags': 'ff',
'origin': 'other',
},
},
},
'GigabitEthernet0/0/0/1.115': {
'interface': 'Gi0/0/0/1.115',
'neighbors': {
'fe80::5c00:40ff:fe02:7': {
'age': '165',
'ip': 'fe80::5c00:40ff:fe02:7',
'link_layer_address': '5e00.4002.0007',
'neighbor_state': 'REACH',
'location': '0/0/CPU0',
'static': '-',
'dynamic': 'Y',
'sync': '-',
'serg_flags': 'ff',
'origin': 'dynamic',
},
'Mcast adjacency': {
'age': '-',
'ip': 'Mcast adjacency',
'link_layer_address': '0000.0000.0000',
'neighbor_state': 'REACH',
'location': '0/0/CPU0',
'static': '-',
'dynamic': '-',
'sync': '-',
'serg_flags': 'ff',
'origin': 'other',
},
},
},
'GigabitEthernet0/0/0/1.120': {
'interface': 'Gi0/0/0/1.120',
'neighbors': {
'Mcast adjacency': {
'age': '-',
'ip': 'Mcast adjacency',
'link_layer_address': '0000.0000.0000',
'neighbor_state': 'REACH',
'location': '0/0/CPU0',
'static': '-',
'dynamic': '-',
'sync': '-',
'serg_flags': 'ff',
'origin': 'other',
},
},
},
'GigabitEthernet0/0/0/1.390': {
'interface': 'Gi0/0/0/1.390',
'neighbors': {
'fe80::5c00:40ff:fe02:7': {
'age': '100',
'ip': 'fe80::5c00:40ff:fe02:7',
'link_layer_address': '5e00.4002.0007',
'neighbor_state': 'REACH',
'location': '0/0/CPU0',
'static': '-',
'dynamic': 'Y',
'sync': '-',
'serg_flags': 'ff',
'origin': 'dynamic',
},
'Mcast adjacency': {
'age': '-',
'ip': 'Mcast adjacency',
'link_layer_address': '0000.0000.0000',
'neighbor_state': 'REACH',
'location': '0/0/CPU0',
'static': '-',
'dynamic': '-',
'sync': '-',
'serg_flags': 'ff',
'origin': 'other',
},
},
},
'GigabitEthernet0/0/0/1.410': {
'interface': 'Gi0/0/0/1.410',
'neighbors': {
'fe80::5c00:40ff:fe02:7': {
'age': '125',
'ip': 'fe80::5c00:40ff:fe02:7',
'link_layer_address': '5e00.4002.0007',
'neighbor_state': 'REACH',
'location': '0/0/CPU0',
'static': '-',
'dynamic': 'Y',
'sync': '-',
'serg_flags': 'ff',
'origin': 'dynamic',
},
'Mcast adjacency': {
'age': '-',
'ip': 'Mcast adjacency',
'link_layer_address': '0000.0000.0000',
'neighbor_state': 'REACH',
'location': '0/0/CPU0',
'static': '-',
'dynamic': '-',
'sync': '-',
'serg_flags': 'ff',
'origin': 'other',
},
},
},
'GigabitEthernet0/0/0/1.415': {
'interface': 'Gi0/0/0/1.415',
'neighbors': {
'Mcast adjacency': {
'age': '-',
'ip': 'Mcast adjacency',
'link_layer_address': '0000.0000.0000',
'neighbor_state': 'REACH',
'location': '0/0/CPU0',
'static': '-',
'dynamic': '-',
'sync': '-',
'serg_flags': 'ff',
'origin': 'other',
},
},
},
'GigabitEthernet0/0/0/1.420': {
'interface': 'Gi0/0/0/1.420',
'neighbors': {
'Mcast adjacency': {
'age': '-',
'ip': 'Mcast adjacency',
'link_layer_address': '0000.0000.0000',
'neighbor_state': 'REACH',
'location': '0/0/CPU0',
'static': '-',
'dynamic': '-',
'sync': '-',
'serg_flags': 'ff',
'origin': 'other',
},
},
},
},
}
ShowIpv6VrfAllInterface = {
'Bundle-Ether12': {
'ipv6_enabled': True,
'int_status': 'up',
'oper_status': 'up',
'vrf': 'default',
'vrf_id': '0x60000000',
'enabled': False,
},
'Bundle-Ether23': {
'ipv6_enabled': True,
'int_status': 'up',
'oper_status': 'up',
'vrf': 'default',
'vrf_id': '0x60000000',
'enabled': False,
},
'Loopback0': {
'ipv6_enabled': True,
'int_status': 'up',
'oper_status': 'up',
'vrf': 'default',
'vrf_id': '0x60000000',
'enabled': True,
'ipv6': {
'2001:2:2:2::2/128': {
'ipv6': '2001:2:2:2::2',
'ipv6_prefix_length': '128',
'ipv6_subnet': '2001:2:2:2::2',
},
'ipv6_link_local': 'fe80::8152:bfff:fed0:fbb5',
'ipv6_groups': ['ff02::1:ff00:2', 'ff02::1:ffd0:fbb5', 'ff02::2', 'ff02::1', 'ff02::16', 'ff02::d'],
'ipv6_mtu': '1500',
'ipv6_mtu_available': '1500',
'icmp_redirects': 'disabled',
'nd_dad': 'disabled',
'dad_attempts': '0',
'nd_reachable_time': '0',
'nd_cache_limit': '0',
'nd_adv_retrans_int': '0',
'stateless_autoconfig': True,
'table_id': '0xe0800000',
'complete_protocol_adj': '0',
'complete_glean_adj': '0',
'incomplete_protocol_adj': '0',
'incomplete_glean_adj': '0',
'dropped_protocol_req': '0',
'dropped_glean_req': '0',
},
},
'Loopback300': {
'ipv6_enabled': True,
'int_status': 'up',
'oper_status': 'up',
'vrf': 'VRF1',
'vrf_id': '0x60000001',
'enabled': True,
'ipv6': {
'2001:2:2:2::2/128': {
'ipv6': '2001:2:2:2::2',
'ipv6_prefix_length': '128',
'ipv6_subnet': '2001:2:2:2::2',
},
'ipv6_link_local': 'fe80::8152:bfff:fed0:fbb5',
'ipv6_groups': ['ff02::1:ff00:2', 'ff02::1:ffd0:fbb5', 'ff02::2', 'ff02::1', 'ff02::16', 'ff02::d'],
'ipv6_mtu': '1500',
'ipv6_mtu_available': '1500',
'icmp_redirects': 'disabled',
'nd_dad': 'disabled',
'dad_attempts': '0',
'nd_reachable_time': '0',
'nd_cache_limit': '0',
'nd_adv_retrans_int': '0',
'stateless_autoconfig': True,
'table_id': '0xe0800001',
'complete_protocol_adj': '0',
'complete_glean_adj': '0',
'incomplete_protocol_adj': '0',
'incomplete_glean_adj': '0',
'dropped_protocol_req': '0',
'dropped_glean_req': '0',
},
},
'MgmtEth0/RP0/CPU0/0': {
'ipv6_enabled': True,
'int_status': 'up',
'oper_status': 'up',
'vrf': 'management',
'vrf_id': '0x60000002',
'enabled': False,
},
'GigabitEthernet0/0/0/0': {
'ipv6_enabled': True,
'int_status': 'up',
'oper_status': 'up',
'vrf': 'default',
'vrf_id': '0x60000000',
'enabled': False,
},
'GigabitEthernet0/0/0/0.90': {
'ipv6_enabled': True,
'int_status': 'up',
'oper_status': 'up',
'vrf': 'default',
'vrf_id': '0x60000000',
'enabled': True,
'ipv6': {
'2001:10:12:90::2/64': {
'ipv6': '2001:10:12:90::2',
'ipv6_prefix_length': '64',
'ipv6_subnet': '2001:10:12:90::',
},
'ipv6_link_local': 'fe80::f816:3eff:fe0f:b2ec',
'ipv6_groups': ['ff02::1:ff00:2', 'ff02::1:ff0f:b2ec', 'ff02::2', 'ff02::1', 'ff02::a'],
'ipv6_mtu': '1518',
'ipv6_mtu_available': '1500',
'icmp_redirects': 'disabled',
'icmp_unreachables': 'enabled',
'nd_dad': 'enabled',
'dad_attempts': '1',
'nd_reachable_time': '0',
'nd_cache_limit': '1000000000',
'nd_adv_retrans_int': '0',
'stateless_autoconfig': True,
'table_id': '0xe0800000',
'complete_protocol_adj': '0',
'complete_glean_adj': '1',
'incomplete_protocol_adj': '0',
'incomplete_glean_adj': '0',
'dropped_protocol_req': '0',
'dropped_glean_req': '0',
'nd_suppress': True,
},
},
'GigabitEthernet0/0/0/0.110': {
'ipv6_enabled': True,
'int_status': 'up',
'oper_status': 'up',
'vrf': 'default',
'vrf_id': '0x60000000',
'enabled': True,
'ipv6': {
'2001:10:12:110::2/64': {
'ipv6': '2001:10:12:110::2',
'ipv6_prefix_length': '64',
'ipv6_subnet': '2001:10:12:110::',
},
'ipv6_link_local': 'fe80::f816:3eff:fe0f:b2ec',
'ipv6_groups': ['ff02::1:ff00:2', 'ff02::1:ff0f:b2ec', 'ff02::2', 'ff02::1', 'ff02::16', 'ff02::5', 'ff02::6', 'ff02::d'],
'ipv6_mtu': '1518',
'ipv6_mtu_available': '1500',
'icmp_redirects': 'disabled',
'icmp_unreachables': 'enabled',
'nd_dad': 'enabled',
'dad_attempts': '1',
'nd_reachable_time': '0',
'nd_cache_limit': '1000000000',
'nd_adv_retrans_int': '0',
'nd_adv_duration': '160-240',
'nd_router_adv': '1800',
'stateless_autoconfig': True,
'table_id': '0xe0800000',
'complete_protocol_adj': '1',
'complete_glean_adj': '0',
'incomplete_protocol_adj': '0',
'incomplete_glean_adj': '0',
'dropped_protocol_req': '0',
'dropped_glean_req': '0',
},
},
'GigabitEthernet0/0/0/0.115': {
'ipv6_enabled': True,
'int_status': 'up',
'oper_status': 'up',
'vrf': 'default',
'vrf_id': '0x60000000',
'enabled': True,
'ipv6': {
'2001:10:12:115::2/64': {
'ipv6': '2001:10:12:115::2',
'ipv6_prefix_length': '64',
'ipv6_subnet': '2001:10:12:115::',
},
'ipv6_link_local': 'fe80::f816:3eff:fe0f:b2ec',
'ipv6_groups': ['ff02::1:ff00:2', 'ff02::1:ff0f:b2ec', 'ff02::2', 'ff02::1', 'ff1e:abcd:def1:2222::1', 'ff1e:abcd:def1:2222::2'],
'ipv6_mtu': '1518',
'ipv6_mtu_available': '1500',
'icmp_redirects': 'disabled',
'icmp_unreachables': 'enabled',
'nd_dad': 'enabled',
'dad_attempts': '1',
'nd_reachable_time': '0',
'nd_cache_limit': '1000000000',
'nd_adv_retrans_int': '0',
'nd_adv_duration': '160-240',
'nd_router_adv': '1800',
'stateless_autoconfig': True,
'table_id': '0xe0800000',
'complete_protocol_adj': '1',
'complete_glean_adj': '0',
'incomplete_protocol_adj': '0',
'incomplete_glean_adj': '0',
'dropped_protocol_req': '0',
'dropped_glean_req': '0',
},
},
'GigabitEthernet0/0/0/0.120': {
'ipv6_enabled': True,
'int_status': 'up',
'oper_status': 'up',
'vrf': 'default',
'vrf_id': '0x60000000',
'enabled': True,
'ipv6': {
'2001:10:12:120::2/64': {
'ipv6': '2001:10:12:120::2',
'ipv6_prefix_length': '64',
'ipv6_subnet': '2001:10:12:120::',
},
'ipv6_link_local': 'fe80::f816:3eff:fe0f:b2ec',
'ipv6_groups': ['ff02::1:ff00:2', 'ff02::1:ff0f:b2ec', 'ff02::2', 'ff02::1'],
'ipv6_mtu': '1518',
'ipv6_mtu_available': '1500',
'icmp_redirects': 'disabled',
'icmp_unreachables': 'enabled',
'nd_dad': 'enabled',
'dad_attempts': '1',
'nd_reachable_time': '0',
'nd_cache_limit': '1000000000',
'nd_adv_retrans_int': '0',
'nd_adv_duration': '160-240',
'nd_router_adv': '1800',
'stateless_autoconfig': True,
'table_id': '0xe0800000',
'complete_protocol_adj': '0',
'complete_glean_adj': '0',
'incomplete_protocol_adj': '0',
'incomplete_glean_adj': '0',
'dropped_protocol_req': '0',
'dropped_glean_req': '0',
},
},
'GigabitEthernet0/0/0/0.390': {
'ipv6_enabled': True,
'int_status': 'up',
'oper_status': 'up',
'vrf': 'VRF1',
'vrf_id': '0x60000001',
'enabled': True,
'ipv6': {
'2001:10:12:90::2/64': {
'ipv6': '2001:10:12:90::2',
'ipv6_prefix_length': '64',
'ipv6_subnet': '2001:10:12:90::',
},
'ipv6_link_local': 'fe80::f816:3eff:fe0f:b2ec',
'ipv6_groups': ['ff02::1:ff00:2', 'ff02::1:ff0f:b2ec', 'ff02::2', 'ff02::1', 'ff02::a'],
'ipv6_mtu': '1518',
'ipv6_mtu_available': '1500',
'icmp_redirects': 'disabled',
'icmp_unreachables': 'enabled',
'nd_dad': 'enabled',
'dad_attempts': '1',
'nd_reachable_time': '0',
'nd_cache_limit': '1000000000',
'nd_adv_retrans_int': '0',
'nd_adv_duration': '160-240',
'nd_router_adv': '1800',
'stateless_autoconfig': True,
'table_id': '0xe0800001',
'complete_protocol_adj': '1',
'complete_glean_adj': '0',
'incomplete_protocol_adj': '0',
'incomplete_glean_adj': '0',
'dropped_protocol_req': '0',
'dropped_glean_req': '0',
},
},
'GigabitEthernet0/0/0/0.410': {
'ipv6_enabled': True,
'int_status': 'up',
'oper_status': 'up',
'vrf': 'VRF1',
'vrf_id': '0x60000001',
'enabled': True,
'ipv6': {
'2001:10:12:110::2/64': {
'ipv6': '2001:10:12:110::2',
'ipv6_prefix_length': '64',
'ipv6_subnet': '2001:10:12:110::',
},
'ipv6_link_local': 'fe80::f816:3eff:fe0f:b2ec',
'ipv6_groups': ['ff02::1:ff00:2', 'ff02::1:ff0f:b2ec', 'ff02::2', 'ff02::1', 'ff02::16', 'ff02::5', 'ff02::6', 'ff02::d'],
'ipv6_mtu': '1518',
'ipv6_mtu_available': '1500',
'icmp_redirects': 'disabled',
'icmp_unreachables': 'enabled',
'nd_dad': 'enabled',
'dad_attempts': '1',
'nd_reachable_time': '0',
'nd_cache_limit': '1000000000',
'nd_adv_retrans_int': '0',
'nd_adv_duration': '160-240',
'nd_router_adv': '1800',
'stateless_autoconfig': True,
'table_id': '0xe0800001',
'complete_protocol_adj': '0',
'complete_glean_adj': '0',
'incomplete_protocol_adj': '0',
'incomplete_glean_adj': '0',
'dropped_protocol_req': '0',
'dropped_glean_req': '0',
},
},
'GigabitEthernet0/0/0/0.415': {
'ipv6_enabled': True,
'int_status': 'up',
'oper_status': 'up',
'vrf': 'VRF1',
'vrf_id': '0x60000001',
'enabled': True,
'ipv6': {
'2001:10:12:115::2/64': {
'ipv6': '2001:10:12:115::2',
'ipv6_prefix_length': '64',
'ipv6_subnet': '2001:10:12:115::',
},
'ipv6_link_local': 'fe80::f816:3eff:fe0f:b2ec',
'ipv6_groups': ['ff02::1:ff00:2', 'ff02::1:ff0f:b2ec', 'ff02::2', 'ff02::1', 'ff1e:abcd:def1:2222::1', 'ff1e:abcd:def1:2222::2'],
'ipv6_mtu': '1518',
'ipv6_mtu_available': '1500',
'icmp_redirects': 'disabled',
'icmp_unreachables': 'enabled',
'nd_dad': 'enabled',
'dad_attempts': '1',
'nd_reachable_time': '0',
'nd_cache_limit': '1000000000',
'nd_adv_retrans_int': '0',
'nd_adv_duration': '160-240',
'nd_router_adv': '1800',
'stateless_autoconfig': True,
'table_id': '0xe0800001',
'complete_protocol_adj': '0',
'complete_glean_adj': '0',
'incomplete_protocol_adj': '0',
'incomplete_glean_adj': '0',
'dropped_protocol_req': '0',
'dropped_glean_req': '0',
},
},
'GigabitEthernet0/0/0/0.420': {
'ipv6_enabled': True,
'int_status': 'up',
'oper_status': 'up',
'vrf': 'VRF1',
'vrf_id': '0x60000001',
'enabled': True,
'ipv6': {
'2001:10:12:120::2/64': {
'ipv6': '2001:10:12:120::2',
'ipv6_prefix_length': '64',
'ipv6_subnet': '2001:10:12:120::',
},
'ipv6_link_local': 'fe80::f816:3eff:fe0f:b2ec',
'ipv6_groups': ['ff02::1:ff00:2', 'ff02::1:ff0f:b2ec', 'ff02::2', 'ff02::1'],
'ipv6_mtu': '1518',
'ipv6_mtu_available': '1500',
'icmp_redirects': 'disabled',
'icmp_unreachables': 'enabled',
'nd_dad': 'enabled',
'dad_attempts': '1',
'nd_reachable_time': '0',
'nd_cache_limit': '1000000000',
'nd_adv_retrans_int': '0',
'nd_adv_duration': '160-240',
'nd_router_adv': '1800',
'stateless_autoconfig': True,
'table_id': '0xe0800001',
'complete_protocol_adj': '0',
'complete_glean_adj': '0',
'incomplete_protocol_adj': '0',
'incomplete_glean_adj': '0',
'dropped_protocol_req': '0',
'dropped_glean_req': '0',
},
},
'GigabitEthernet0/0/0/1': {
'ipv6_enabled': True,
'int_status': 'up',
'oper_status': 'up',
'vrf': 'default',
'vrf_id': '0x60000000',
'enabled': False,
},
'GigabitEthernet0/0/0/1.90': {
'ipv6_enabled': True,
'int_status': 'up',
'oper_status': 'up',
'vrf': 'default',
'vrf_id': '0x60000000',
'enabled': True,
'ipv6': {
'2001:10:23:90::2/64': {
'ipv6': '2001:10:23:90::2',
'ipv6_prefix_length': '64',
'ipv6_subnet': '2001:10:23:90::',
},
'ipv6_link_local': 'fe80::f816:3eff:fe59:8f2e',
'ipv6_groups': ['ff02::1:ff00:2', 'ff02::1:ff59:8f2e', 'ff02::2', 'ff02::1', 'ff02::a'],
'ipv6_mtu': '1518',
'ipv6_mtu_available': '1500',
'icmp_redirects': 'disabled',
'icmp_unreachables': 'enabled',
'nd_dad': 'enabled',
'dad_attempts': '1',
'nd_reachable_time': '0',
'nd_cache_limit': '1000000000',
'nd_adv_retrans_int': '0',
'nd_adv_duration': '160-240',
'nd_router_adv': '1800',
'stateless_autoconfig': True,
'table_id': '0xe0800000',
'complete_protocol_adj': '1',
'complete_glean_adj': '0',
'incomplete_protocol_adj': '0',
'incomplete_glean_adj': '0',
'dropped_protocol_req': '0',
'dropped_glean_req': '0',
},
},
'GigabitEthernet0/0/0/1.110': {
'ipv6_enabled': True,
'int_status': 'up',
'oper_status': 'up',
'vrf': 'default',
'vrf_id': '0x60000000',
'enabled': True,
'ipv6': {
'2001:10:23:110::2/64': {
'ipv6': '2001:10:23:110::2',
'ipv6_prefix_length': '64',
'ipv6_subnet': '2001:10:23:110::',
},
'ipv6_link_local': 'fe80::f816:3eff:fe59:8f2e',
'ipv6_groups': ['ff02::1:ff00:2', 'ff02::1:ff59:8f2e', 'ff02::2', 'ff02::1', 'ff02::16', 'ff02::5', 'ff02::6', 'ff02::d'],
'ipv6_mtu': '1518',
'ipv6_mtu_available': '1500',
'icmp_redirects': 'disabled',
'icmp_unreachables': 'enabled',
'nd_dad': 'enabled',
'dad_attempts': '1',
'nd_reachable_time': '0',
'nd_cache_limit': '1000000000',
'nd_adv_retrans_int': '0',
'nd_adv_duration': '160-240',
'nd_router_adv': '1800',
'stateless_autoconfig': True,
'table_id': '0xe0800000',
'complete_protocol_adj': '1',
'complete_glean_adj': '0',
'incomplete_protocol_adj': '0',
'incomplete_glean_adj': '0',
'dropped_protocol_req': '0',
'dropped_glean_req': '0',
},
},
'GigabitEthernet0/0/0/1.115': {
'ipv6_enabled': True,
'int_status': 'up',
'oper_status': 'up',
'vrf': 'default',
'vrf_id': '0x60000000',
'enabled': True,
'ipv6': {
'2001:10:23:115::2/64': {
'ipv6': '2001:10:23:115::2',
'ipv6_prefix_length': '64',
'ipv6_subnet': '2001:10:23:115::',
},
'ipv6_link_local': 'fe80::f816:3eff:fe59:8f2e',
'ipv6_groups': ['ff02::1:ff00:2', 'ff02::1:ff59:8f2e', 'ff02::2', 'ff02::1'],
'ipv6_mtu': '1518',
'ipv6_mtu_available': '1500',
'icmp_redirects': 'disabled',
'icmp_unreachables': 'enabled',
'nd_dad': 'enabled',
'dad_attempts': '1',
'nd_reachable_time': '0',
'nd_cache_limit': '1000000000',
'nd_adv_retrans_int': '0',
'nd_adv_duration': '160-240',
'nd_router_adv': '1800',
'stateless_autoconfig': True,
'table_id': '0xe0800000',
'complete_protocol_adj': '1',
'complete_glean_adj': '0',
'incomplete_protocol_adj': '0',
'incomplete_glean_adj': '0',
'dropped_protocol_req': '0',
'dropped_glean_req': '0',
},
},
'GigabitEthernet0/0/0/1.120': {
'ipv6_enabled': True,
'int_status': 'up',
'oper_status': 'up',
'vrf': 'default',
'vrf_id': '0x60000000',
'enabled': True,
'ipv6': {
'2001:10:23:120::2/64': {
'ipv6': '2001:10:23:120::2',
'ipv6_prefix_length': '64',
'ipv6_subnet': '2001:10:23:120::',
},
'ipv6_link_local': 'fe80::f816:3eff:fe59:8f2e',
'ipv6_groups': ['ff02::1:ff00:2', 'ff02::1:ff59:8f2e', 'ff02::2', 'ff02::1'],
'ipv6_mtu': '1518',
'ipv6_mtu_available': '1500',
'icmp_redirects': 'disabled',
'icmp_unreachables': 'enabled',
'nd_dad': 'enabled',
'dad_attempts': '1',
'nd_reachable_time': '0',
'nd_cache_limit': '1000000000',
'nd_adv_retrans_int': '0',
'nd_adv_duration': '160-240',
'nd_router_adv': '1800',
'stateless_autoconfig': True,
'table_id': '0xe0800000',
'complete_protocol_adj': '0',
'complete_glean_adj': '0',
'incomplete_protocol_adj': '0',
'incomplete_glean_adj': '0',
'dropped_protocol_req': '0',
'dropped_glean_req': '0',
},
},
'GigabitEthernet0/0/0/1.390': {
'ipv6_enabled': True,
'int_status': 'up',
'oper_status': 'up',
'vrf': 'VRF1',
'vrf_id': '0x60000001',
'enabled': True,
'ipv6': {
'2001:10:23:90::2/64': {
'ipv6': '2001:10:23:90::2',
'ipv6_prefix_length': '64',
'ipv6_subnet': '2001:10:23:90::',
},
'ipv6_link_local': 'fe80::f816:3eff:fe59:8f2e',
'ipv6_groups': ['ff02::1:ff00:2', 'ff02::1:ff59:8f2e', 'ff02::2', 'ff02::1', 'ff02::a'],
'ipv6_mtu': '1518',
'ipv6_mtu_available': '1500',
'icmp_redirects': 'disabled',
'icmp_unreachables': 'enabled',
'nd_dad': 'enabled',
'dad_attempts': '1',
'nd_reachable_time': '0',
'nd_cache_limit': '1000000000',
'nd_adv_retrans_int': '0',
'nd_adv_duration': '160-240',
'nd_router_adv': '1800',
'stateless_autoconfig': True,
'table_id': '0xe0800001',
'complete_protocol_adj': '0',
'complete_glean_adj': '1',
'incomplete_protocol_adj': '0',
'incomplete_glean_adj': '0',
'dropped_protocol_req': '0',
'dropped_glean_req': '0',
},
},
'GigabitEthernet0/0/0/1.410': {
'ipv6_enabled': True,
'int_status': 'up',
'oper_status': 'up',
'vrf': 'VRF1',
'vrf_id': '0x60000001',
'enabled': True,
'ipv6': {
'2001:10:23:110::2/64': {
'ipv6': '2001:10:23:110::2',
'ipv6_prefix_length': '64',
'ipv6_subnet': '2001:10:23:110::',
},
'ipv6_link_local': 'fe80::f816:3eff:fe59:8f2e',
'ipv6_groups': ['ff02::1:ff00:2', 'ff02::1:ff59:8f2e', 'ff02::2', 'ff02::1', 'ff02::16', 'ff02::5', 'ff02::6', 'ff02::d'],
'ipv6_mtu': '1518',
'ipv6_mtu_available': '1500',
'icmp_redirects': 'disabled',
'icmp_unreachables': 'enabled',
'nd_dad': 'enabled',
'dad_attempts': '1',
'nd_reachable_time': '0',
'nd_cache_limit': '1000000000',
'nd_adv_retrans_int': '0',
'nd_adv_duration': '160-240',
'nd_router_adv': '1800',
'stateless_autoconfig': True,
'table_id': '0xe0800001',
'complete_protocol_adj': '0',
'complete_glean_adj': '1',
'incomplete_protocol_adj': '0',
'incomplete_glean_adj': '0',
'dropped_protocol_req': '0',
'dropped_glean_req': '0',
},
},
'GigabitEthernet0/0/0/1.415': {
'ipv6_enabled': True,
'int_status': 'up',
'oper_status': 'up',
'vrf': 'VRF1',
'vrf_id': '0x60000001',
'enabled': True,
'ipv6': {
'2001:10:23:115::2/64': {
'ipv6': '2001:10:23:115::2',
'ipv6_prefix_length': '64',
'ipv6_subnet': '2001:10:23:115::',
},
'ipv6_link_local': 'fe80::f816:3eff:fe59:8f2e',
'ipv6_groups': ['ff02::1:ff00:2', 'ff02::1:ff59:8f2e', 'ff02::2', 'ff02::1'],
'ipv6_mtu': '1518',
'ipv6_mtu_available': '1500',
'icmp_redirects': 'disabled',
'icmp_unreachables': 'enabled',
'nd_dad': 'enabled',
'dad_attempts': '1',
'nd_reachable_time': '0',
'nd_cache_limit': '1000000000',
'nd_adv_retrans_int': '0',
'nd_adv_duration': '160-240',
'nd_router_adv': '1800',
'stateless_autoconfig': True,
'table_id': '0xe0800001',
'complete_protocol_adj': '0',
'complete_glean_adj': '0',
'incomplete_protocol_adj': '0',
'incomplete_glean_adj': '0',
'dropped_protocol_req': '0',
'dropped_glean_req': '0',
},
},
'GigabitEthernet0/0/0/1.420': {
'ipv6_enabled': True,
'int_status': 'up',
'oper_status': 'up',
'vrf': 'VRF1',
'vrf_id': '0x60000001',
'enabled': True,
'ipv6': {
'2001:10:23:120::2/64': {
'ipv6': '2001:10:23:120::2',
'ipv6_prefix_length': '64',
'ipv6_subnet': '2001:10:23:120::',
},
'ipv6_link_local': 'fe80::f816:3eff:fe59:8f2e',
'ipv6_groups': ['ff02::1:ff00:2', 'ff02::1:ff59:8f2e', 'ff02::2', 'ff02::1'],
'ipv6_mtu': '1518',
'ipv6_mtu_available': '1500',
'icmp_redirects': 'disabled',
'icmp_unreachables': 'enabled',
'nd_dad': 'enabled',
'dad_attempts': '1',
'nd_reachable_time': '0',
'nd_cache_limit': '1000000000',
'nd_adv_retrans_int': '0',
'nd_adv_duration': '160-240',
'nd_router_adv': '1800',
'stateless_autoconfig': True,
'table_id': '0xe0800001',
'complete_protocol_adj': '0',
'complete_glean_adj': '0',
'incomplete_protocol_adj': '0',
'incomplete_glean_adj': '0',
'dropped_protocol_req': '0',
'dropped_glean_req': '0',
},
},
'GigabitEthernet0/0/0/2': {
'ipv6_enabled': True,
'int_status': 'up',
'oper_status': 'up',
'vrf': 'default',
'vrf_id': '0x60000000',
'enabled': False,
},
'GigabitEthernet0/0/0/3': {
'ipv6_enabled': True,
'int_status': 'up',
'oper_status': 'up',
'vrf': 'default',
'vrf_id': '0x60000000',
'enabled': False,
},
'GigabitEthernet0/0/0/4': {
'ipv6_enabled': True,
'int_status': 'up',
'oper_status': 'up',
'vrf': 'default',
'vrf_id': '0x60000000',
'enabled': False,
},
'GigabitEthernet0/0/0/5': {
'ipv6_enabled': True,
'int_status': 'up',
'oper_status': 'up',
'vrf': 'default',
'vrf_id': '0x60000000',
'enabled': False,
},
}
ShowRunInterface = '''\
interface Bundle-Ether12
!
interface Loopback0
ipv4 address 10.16.2.2 255.255.255.255
ipv6 address 2001:2:2:2::2/128
!
interface MgmtEth0/RP0/CPU0/0
vrf management
ipv4 address 172.16.1.52 255.255.255.0
!
interface GigabitEthernet0/0/0/0
cdp
!
interface GigabitEthernet0/0/0/0.90
ipv4 address 10.12.90.2 255.255.255.0
ipv6 nd ra-lifetime 2000
ipv6 nd suppress-ra
ipv6 address 2001:10:12:90::2/64
encapsulation dot1q 90
!
interface GigabitEthernet0/0/0/0.110
ipv4 address 10.12.110.2 255.255.255.0
ipv6 address 2001:10:12:110::2/64
encapsulation dot1q 110
!
'''
ndOpsOutput = {
'interfaces': {
'GigabitEthernet0/0/0/1.420': {
'interface': 'Gi0/0/0/1.420',
'router_advertisement': {
'interval': '160-240',
'lifetime': '1800',
},
'neighbors': {
'Mcast adjacency': {
'ip': 'Mcast adjacency',
'link_layer_address': '0000.0000.0000',
'neighbor_state': 'REACH',
'age': '-',
'origin': 'other',
},
},
},
'GigabitEthernet0/0/0/1.415': {
'interface': 'Gi0/0/0/1.415',
'router_advertisement': {
'interval': '160-240',
'lifetime': '1800',
},
'neighbors': {
'Mcast adjacency': {
'ip': 'Mcast adjacency',
'link_layer_address': '0000.0000.0000',
'neighbor_state': 'REACH',
'age': '-',
'origin': 'other',
},
},
},
'GigabitEthernet0/0/0/1.410': {
'interface': 'Gi0/0/0/1.410',
'router_advertisement': {
'interval': '160-240',
'lifetime': '1800',
},
'neighbors': {
'Mcast adjacency': {
'ip': 'Mcast adjacency',
'link_layer_address': '0000.0000.0000',
'neighbor_state': 'REACH',
'age': '-',
'origin': 'other',
},
'fe80::5c00:40ff:fe02:7': {
'ip': 'fe80::5c00:40ff:fe02:7',
'link_layer_address': '5e00.4002.0007',
'neighbor_state': 'REACH',
'age': '125',
'origin': 'dynamic',
},
},
},
'GigabitEthernet0/0/0/1.390': {
'interface': 'Gi0/0/0/1.390',
'router_advertisement': {
'interval': '160-240',
'lifetime': '1800',
},
'neighbors': {
'Mcast adjacency': {
'ip': 'Mcast adjacency',
'link_layer_address': '0000.0000.0000',
'neighbor_state': 'REACH',
'age': '-',
'origin': 'other',
},
'fe80::5c00:40ff:fe02:7': {
'ip': 'fe80::5c00:40ff:fe02:7',
'link_layer_address': '5e00.4002.0007',
'neighbor_state': 'REACH',
'age': '100',
'origin': 'dynamic',
},
},
},
'GigabitEthernet0/0/0/1.120': {
'interface': 'Gi0/0/0/1.120',
'router_advertisement': {
'interval': '160-240',
'lifetime': '1800',
},
'neighbors': {
'Mcast adjacency': {
'ip': 'Mcast adjacency',
'link_layer_address': '0000.0000.0000',
'neighbor_state': 'REACH',
'age': '-',
'origin': 'other',
},
},
},
'GigabitEthernet0/0/0/1.115': {
'interface': 'Gi0/0/0/1.115',
'router_advertisement': {
'interval': '160-240',
'lifetime': '1800',
},
'neighbors': {
'Mcast adjacency': {
'ip': 'Mcast adjacency',
'link_layer_address': '0000.0000.0000',
'neighbor_state': 'REACH',
'age': '-',
'origin': 'other',
},
'fe80::5c00:40ff:fe02:7': {
'ip': 'fe80::5c00:40ff:fe02:7',
'link_layer_address': '5e00.4002.0007',
'neighbor_state': 'REACH',
'age': '165',
'origin': 'dynamic',
},
},
},
'GigabitEthernet0/0/0/1.110': {
'interface': 'Gi0/0/0/1.110',
'router_advertisement': {
'interval': '160-240',
'lifetime': '1800',
},
'neighbors': {
'Mcast adjacency': {
'ip': 'Mcast adjacency',
'link_layer_address': '0000.0000.0000',
'neighbor_state': 'REACH',
'age': '-',
'origin': 'other',
},
'fe80::5c00:40ff:fe02:7': {
'ip': 'fe80::5c00:40ff:fe02:7',
'link_layer_address': '5e00.4002.0007',
'neighbor_state': 'REACH',
'age': '17',
'origin': 'dynamic',
},
},
},
'GigabitEthernet0/0/0/0.420': {
'interface': 'Gi0/0/0/0.420',
'router_advertisement': {
'interval': '160-240',
'lifetime': '1800',
},
'neighbors': {
'Mcast adjacency': {
'ip': 'Mcast adjacency',
'link_layer_address': '0000.0000.0000',
'neighbor_state': 'REACH',
'age': '-',
'origin': 'other',
},
},
},
'GigabitEthernet0/0/0/0.415': {
'interface': 'Gi0/0/0/0.415',
'router_advertisement': {
'interval': '160-240',
'lifetime': '1800',
},
'neighbors': {
'Mcast adjacency': {
'ip': 'Mcast adjacency',
'link_layer_address': '0000.0000.0000',
'neighbor_state': 'REACH',
'age': '-',
'origin': 'other',
},
},
},
'GigabitEthernet0/0/0/0.410': {
'interface': 'Gi0/0/0/0.410',
'router_advertisement': {
'interval': '160-240',
'lifetime': '1800',
},
'neighbors': {
'Mcast adjacency': {
'ip': 'Mcast adjacency',
'link_layer_address': '0000.0000.0000',
'neighbor_state': 'REACH',
'age': '-',
'origin': 'other',
},
},
},
'GigabitEthernet0/0/0/0.390': {
'interface': 'Gi0/0/0/0.390',
'router_advertisement': {
'interval': '160-240',
'lifetime': '1800',
},
'neighbors': {
'Mcast adjacency': {
'ip': 'Mcast adjacency',
'link_layer_address': '0000.0000.0000',
'neighbor_state': 'REACH',
'age': '-',
'origin': 'other',
},
'fe80::f816:3eff:fe26:1224': {
'ip': 'fe80::f816:3eff:fe26:1224',
'link_layer_address': 'fa16.3e26.1224',
'neighbor_state': 'REACH',
'age': '151',
'origin': 'dynamic',
},
},
},
'GigabitEthernet0/0/0/0.120': {
'interface': 'Gi0/0/0/0.120',
'router_advertisement': {
'interval': '160-240',
'lifetime': '1800',
},
'neighbors': {
'Mcast adjacency': {
'ip': 'Mcast adjacency',
'link_layer_address': '0000.0000.0000',
'neighbor_state': 'REACH',
'age': '-',
'origin': 'other',
},
},
},
'GigabitEthernet0/0/0/0.115': {
'interface': 'Gi0/0/0/0.115',
'router_advertisement': {
'interval': '160-240',
'lifetime': '1800',
},
'neighbors': {
'Mcast adjacency': {
'ip': 'Mcast adjacency',
'link_layer_address': '0000.0000.0000',
'neighbor_state': 'REACH',
'age': '-',
'origin': 'other',
},
'fe80::f816:3eff:fe26:1224': {
'ip': 'fe80::f816:3eff:fe26:1224',
'link_layer_address': 'fa16.3e26.1224',
'neighbor_state': 'REACH',
'age': '69',
'origin': 'dynamic',
},
},
},
'GigabitEthernet0/0/0/0.110': {
'interface': 'Gi0/0/0/0.110',
'router_advertisement': {
'interval': '160-240',
'lifetime': '1800',
},
'neighbors': {
'Mcast adjacency': {
'ip': 'Mcast adjacency',
'link_layer_address': '0000.0000.0000',
'neighbor_state': 'REACH',
'age': '-',
'origin': 'other',
},
'fe80::f816:3eff:fe26:1224': {
'ip': 'fe80::f816:3eff:fe26:1224',
'link_layer_address': 'fa16.3e26.1224',
'neighbor_state': 'REACH',
'age': '114',
'origin': 'dynamic',
},
},
},
'GigabitEthernet0/0/0/1.90': {
'interface': 'Gi0/0/0/1.90',
'router_advertisement': {
'interval': '160-240',
'lifetime': '1800',
},
'neighbors': {
'Mcast adjacency': {
'ip': 'Mcast adjacency',
'link_layer_address': '0000.0000.0000',
'neighbor_state': 'REACH',
'age': '-',
'origin': 'other',
},
'fe80::5c00:40ff:fe02:7': {
'ip': 'fe80::5c00:40ff:fe02:7',
'link_layer_address': '5e00.4002.0007',
'neighbor_state': 'REACH',
'age': '151',
'origin': 'dynamic',
},
},
},
'GigabitEthernet0/0/0/0.90': {
'interface': 'Gi0/0/0/0.90',
'router_advertisement': {
'suppress': True,
},
'neighbors': {
'Mcast adjacency': {
'ip': 'Mcast adjacency',
'link_layer_address': '0000.0000.0000',
'neighbor_state': 'REACH',
'age': '-',
'origin': 'other',
},
'fe80::f816:3eff:fe26:1224': {
'ip': 'fe80::f816:3eff:fe26:1224',
'link_layer_address': 'fa16.3e26.1224',
'neighbor_state': 'REACH',
'age': '138',
'origin': 'dynamic',
},
},
},
},
}
ShowRunInterface_custom = '''\
interface GigabitEthernet0/0/0/0.390
vrf VRF1
ipv4 address 10.12.90.2 255.255.255.0
ipv6 address 2001:10:12:90::2/64
encapsulation dot1q 390
!
'''
ndOpsOutput_custom = {
'interfaces': {
'GigabitEthernet0/0/0/0.390': {
'interface': 'Gi0/0/0/0.390',
'router_advertisement': {
'interval': '160-240',
'lifetime': '1800',
},
'neighbors': {
'Mcast adjacency': {
'ip': 'Mcast adjacency',
'link_layer_address': '0000.0000.0000',
'neighbor_state': 'REACH',
'age': '-',
'origin': 'other',
},
'fe80::f816:3eff:fe26:1224': {
'ip': 'fe80::f816:3eff:fe26:1224',
'link_layer_address': 'fa16.3e26.1224',
'neighbor_state': 'REACH',
'age': '151',
'origin': 'dynamic',
},
},
},
},
}
|
"""Transaction unit."""
class TransactionUnit:
"""Transaction unit."""
def __init__(
self: "TransactionUnit", txid: str, fee: str, weight: str, parents: str
) -> None:
"""Initialize transaction unit.
Args:
txid (str): Txn ID
fee (str): fee of txn
weight (str): weight of txn
parents (str): parents of txn
"""
self.txid = txid
self.fee = int(fee)
self.weight = int(weight)
self.parents = list(parents.split(";"))
|
def solution():
sum = 0
for i in range(0,1000):
if i % 3 == 0 or i % 5 == 0: sum += i
return sum
def test_MultiplesOf3And5():
assert solution() == 233168
|
__all__ = ["__version__", "__version_info__"]
__version__ = "0.0.3"
__version_info__ = tuple(int(x) for x in __version__.split("."))
|
@bot.message_handler(commands=['start', 'help'])
def send_welcome(message):
userid = message.from_user.id
banlist = redisserver.sismember('zigzag_banlist', '{}'.format(userid))
if banlist:
bot.reply_to(message, "You are banned!")
return
markup = types.ReplyKeyboardMarkup()
numbers = list(range(3, 3000, 3))
numbers = [0] + numbers
cline = 0
linelength = len(START_BUTTONS)
try:
while (cline < linelength):
itembtn = []
cfrom = numbers[cline]
cto = numbers[cline + 1]
cline = cline + 1
while (cfrom < cto):
itembtn.append(START_BUTTONS[cfrom])
cfrom = cfrom + 1
if len(itembtn) == 3:
markup.row(*itembtn)
except:
lolalola = 0
if message.chat.type == "private":
bot.reply_to(message, START_MSG.encode("utf-8"), reply_markup=markup, parse_mode="Markdown")
redisserver.sadd('zigzag_members',message.from_user.id)
else:
bot.reply_to(message, START_MSG.encode("utf-8"), parse_mode="Markdown")
|
src = Split('''
uart_test.c
''')
component = aos_component('uart_test', src)
component.add_cflags('-Wall')
component.add_cflags('-Werror')
|
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'ipetrash'
def pad(s: bytes, bs=8) -> bytes:
pad_size = bs - (len(s) % bs)
return s + bytes([pad_size] * pad_size)
def unpad(s: bytes) -> bytes:
pad_size = s[-1]
return s[:-pad_size]
if __name__ == '__main__':
data = b'Hello'
padded_data = pad(data)
print(padded_data) # b'Hello\x03\x03\x03'
print(unpad(padded_data)) # b'Hello'
print(unpad(padded_data).decode('utf-8')) # Hello
assert data == unpad(pad(data))
print()
assert b'123' == unpad(pad(b'123'))
assert b'123' * 9999 == unpad(pad(b'123' * 9999))
assert b'11111111' == unpad(pad(b'11111111'))
assert b'abcd123' == unpad(pad(b'abcd123'))
print(unpad(b'12\x02\x02')) # b'12'
print(unpad(b'1\x01')) # b'1'
print()
data = 'Привет!'.encode('utf-8')
padded_data = pad(data)
print(padded_data) # b'\xd0\x9f\xd1\x80\xd0\xb8\xd0\xb2\xd0\xb5\xd1\x82!\x03\x03\x03'
print(unpad(padded_data)) # b'\xd0\x9f\xd1\x80\xd0\xb8\xd0\xb2\xd0\xb5\xd1\x82!'
print(unpad(padded_data).decode('utf-8')) # Привет!
assert data == unpad(pad(data))
|
#Helpfer Function:
def create_scoring_schema(number_objects):
_field = "id*:int64,image:blob,_image_:blob,_nObjects_:double,"
for obj in range(0,number_objects):
_field += "_Object" + str(obj) + "_:string,"
_field += "_P_Object" + str(obj) + "_:double,"
_field += "_Object" + str(obj) + "_x:double,"
_field += "_Object" + str(obj) + "_y:double,"
_field += "_Object" + str(obj) + "_width:double,"
_field += "_Object" + str(obj) + "_height:double,"
return _field[:-1]
def create_scoring_schema(number_objects):
_field = "id*:int64,image:blob,_image_:blob,_nObjects_:double,"
for obj in range(0,number_objects):
_field += "_Object" + str(obj) + "_:string,"
_field += "_P_Object" + str(obj) + "_:double,"
_field += "_Object" + str(obj) + "_x:double,"
_field += "_Object" + str(obj) + "_y:double,"
_field += "_Object" + str(obj) + "_width:double,"
_field += "_Object" + str(obj) + "_height:double,"
return _field[:-1]
|
def load():
with open("input") as f:
return [int(x) for x in f.read().strip().split(",")]
def align_crabs():
crabs = load()
min_fuel = None
for pos in range(min(crabs), max(crabs) + 1):
fuel = sum(abs(c - pos) for c in crabs)
min_fuel = fuel if min_fuel is None else min(min_fuel, fuel)
return min_fuel
print(align_crabs())
|
a = [
1, 2, 3, 6, 10, 14,
]
t = 10
l = 0
r = len(a) - 1
while l != r:
c = (l + r) // 2
if a[c] < t:
l = c + 1
elif a[c] > t:
r = c - 1
else:
r = l = c
print(l, r, a[l], a[r])
|
# Runtime: 1007 ms, faster than 66.76% of Python3 online submissions for 3Sum.
# Memory Usage: 18.1 MB, less than 38.93% of Python3 online submissions for 3Sum.
class Solution:
def threeSum(self, nums: List[int]) -> List[List[int]]:
nums = sorted(nums)
res = []
for i in range(len(nums)):
if nums[i] > 0:
return res
# Want to skip all duplicates
elif i == 0 or nums[i] != nums[i - 1]:
hi = len(nums) - 1
lo = i + 1
while hi > lo:
if nums[hi] + nums[lo] == -nums[i]:
res.append([nums[i], nums[lo], nums[hi]])
lo += 1
hi -= 1
# Want the lo to skip all duplicates
while nums[lo] == nums[lo - 1] and lo < hi:
lo += 1
elif nums[hi] + nums[lo] < -nums[i]:
lo += 1
else:
hi -= 1
return res
# Unsorted Approach: gave me TLE
# pairsDict = {}
# for i in range(len(nums)):
# for j in range(i):
# # Append (i, j) to the list stored with key nums[i] + nums[j]
# pairsDict[nums[i] + nums[j]] = pairsDict.get(nums[i] + nums[j], [])
# pairsDict[nums[i] + nums[j]].append(tuple([i, j]))
# res = []
# # Go through nums again, check for matches
# for k in range(len(nums)):
# # If we have seen the negative already:
# if -nums[k] in pairsDict:
# # Iterate through list of tuples,
# # check that k is not already in a tuple there
# for pair in pairsDict[-nums[k]]:
# if k != pair[0] and k != pair[1]:
# # We probably want to sort the values.
# if sorted([nums[k], nums[pair[0]], nums[pair[1]]]) not in res:
# res.append(sorted([nums[k], nums[pair[0]], nums[pair[1]]]))
# return res
|
## Script eleminates rows that are having zero RPKM value then, divides replicate A of each damage type to corresponding XR-seq damage repair.
# If DMG_PPD_column and DMG_CPD_column column number changed to the replicate B of (6-4)PP and CPD damage, the Replicate B normalization could be performed.
### REMOVE ROWS WITH RESPECT TO DAMAGE-seq REPLICATE B ###
stock_file_path = 'D://allseq-Data//MelanomaPrediction//Stock_Only_RPKM//Subsampled//5kBTSS//'
stock_file = open(stock_file_path + 'STOCK_allseq_subsampled_5kBTSS_RPKM_woHeader.bed','r')
## Row removal and Normalization for 6-4PP Damage ##
without_zero_rows_list = []
for indiv_lines in stock_file:
splitted_lines = indiv_lines.split('\t')
DMG_PPD_column = float(splitted_lines[8]) # The Damage-seq column of Replicate B of whatever Damage type it is. In this case it is 6-4PP RepA.
PPD_three_columns = splitted_lines[0:3] # CHR name, start and end coordinates
PPD_histone_markers = splitted_lines[11:20] # The RPKM values column of ChIP-seq histone markers.
XR_seq_PPD_RepA = float(splitted_lines[3]) # The RPKM values column of XR-seq Replicate A
XR_seq_PPD_RepB = float(splitted_lines[4]) # The RPKM values column of XR-seq Replicate B
PPD_DNaseI_column = float(splitted_lines[20])
if DMG_PPD_column != 0:
#without_zero_rows_list.append(str(CPDA_three_columns).replace("'",""))
R1_one = float(XR_seq_PPD_RepA / DMG_PPD_column)
#without_zero_rows_list.append(R_one)
R1_two = float(XR_seq_PPD_RepB / DMG_PPD_column)
#without_zero_rows_list.append(R_two)
#without_zero_rows_list.append(str(CPDA_histone_markers).replace("'",""))
without_zero_rows_list.append([str(PPD_three_columns),str(R1_one),str(R1_two),str(PPD_histone_markers),str(PPD_DNaseI_column)])
else:
continue
c = 0
for Numelmnts in without_zero_rows_list:
#print(Numelmnts)
c += 1
print(c)
stock_file.close()
"""
##############################################################################################################################################
##############################################################################################################################################
# This part is exactly similar with above part except the column numbers due to the difference in damage type.
stock_file_path2 = 'D://allseq-Data//MelanomaPrediction//Stock_Only_RPKM//Subsampled//5kBTSS//'
stock_file2 = open(stock_file_path2 + 'STOCK_allseq_subsampled_5kBTSS_RPKM_woHeader.bed','r')
## Row removal and Normalization for CPD Damage ##
without_zero_rows_list2 = []
for indiv_lines2 in stock_file2:
splitted_lines2 = indiv_lines2.split('\t')
DMG_CPD_column = float(splitted_lines2[10])
CPD_three_columns = splitted_lines2[0:3]
CPD_histone_markers = splitted_lines2[11:20]
XR_seq_CPD_RepA = float(splitted_lines2[5])
XR_seq_CPD_RepB = float(splitted_lines2[6])
CPD_DNaseI_column = float(splitted_lines2[20])
if DMG_CPD_column != 0:
#without_zero_rows_list.append(str(CPDA_three_columns).replace("'",""))
R2_one = float(XR_seq_CPD_RepA / DMG_CPD_column)
#without_zero_rows_list.append(R_one)
R2_two = float(XR_seq_CPD_RepB / DMG_CPD_column)
#without_zero_rows_list.append(R_two)
#without_zero_rows_list.append(str(CPDA_histone_markers).replace("'",""))
without_zero_rows_list2.append([str(CPD_three_columns),str(R2_one),str(R2_two),str(CPD_histone_markers),str(CPD_DNaseI_column)])
else:
continue
k = 0
for Numelmnts2 in without_zero_rows_list2:
#print(Numelmnts2)
k += 1
print(k)
stock_file2.close()
"""
### CREATE FILE ###
###### Write down the remaining of zero removed rows into a file. #####
# HDA64A1_ATCACG HDA64B19_GTGAAA HDACA6_GCCAAT HDACB23_GAGTGG
# without_zero_rows_list without_zero_rows_list2
total = 0
directory = 'D://allseq-Data//MelanomaPrediction//RepB_Filtered_Normalized_allseq_Data//Subsampled//5kBTSS//'
with open(directory + 'Zero_removed_divided_5kBTSS_HDA64B19_GTGAAA_normalized_allseqs_w_ChrStartEnd.csv','w') as df:
for wr in without_zero_rows_list:
df.write('{}\n'.format(wr)) # Do not put \n front of '{}'.
total += 1
print("The newly generated file is having " , total , ' number of rows!')
# The newly created Datium Structure is #
# Chr names Chr Start Chr END 6-4PP(XR-seq RepA / DMG RepA) 6-4PP(XR-seq RepB / DMG RepA) ChIP-seq (15 columns)
# OR
# Chr names Chr Start Chr END CPD(XR-seq RepA / DMG RepA) CPD(XR-seq RepB / DMG RepA) ChIP-seq (15 columns)
|
# SPDX-FileCopyrightText: 2021 Mark Komus
# SPDX-License-Identifier: MIT
"""
LED glasses mappings
"""
# Maps to link IS31FL3741 LEDs to pixels
# Full LED glasses 18 x 5 matrix
glassesmatrix_ledmap = (
65535,
65535,
65535, # (0,0) (clipped, corner)
10,
8,
9, # (0,1) / right ring pixel 20
13,
11,
12, # (0,2) / 19
16,
14,
15, # (0,3) / 18
4,
2,
3, # (0,4) / 17
217,
215,
216, # (1,0) / right ring pixel #21
220,
218,
219, # (1,1)
223,
221,
222, # (1,2)
226,
224,
225, # (1,3)
214,
212,
213, # (1,4)
187,
185,
186, # (2,0)
190,
188,
189, # (2,1)
193,
191,
192, # (2,2)
196,
194,
195, # (2,3)
184,
182,
183, # (2,4)
37,
35,
36, # (3,0)
40,
38,
39, # (3,1)
43,
41,
42, # (3,2)
46,
44,
45, # (3,3)
34,
32,
33, # (3,4)
67,
65,
66, # (4,0)
70,
68,
69, # (4,1)
73,
71,
72, # (4,2)
76,
74,
75, # (4,3)
64,
62,
63, # (4,4)
97,
95,
96, # (5,0)
100,
98,
99, # (5,1)
103,
101,
102, # (5,2)
106,
104,
105, # (5,3)
94,
92,
93, # (5,4)
127,
125,
126, # (6,0) / right ring pixel 3
130,
128,
129, # (6,1)
133,
131,
132, # (6,2)
136,
134,
135, # (6,3)
124,
122,
123, # (6,4)
157,
155,
156, # (7,0)
160,
158,
159, # (7,1)
163,
161,
162, # (7,2) / right ring pixel 5
166,
164,
165, # (7,3) / 6
244,
242,
243, # (7,4) / 7
247,
245,
246, # (8,0)
250,
248,
249, # (8,1)
253,
251,
252, # (8,2)
256,
254,
255, # (8,3)
65535,
65535,
65535, # (8,4) (clipped, nose bridge)
345,
347,
346, # (9,0)
342,
344,
343, # (9,1)
267,
269,
268, # (9,2)
263,
265,
264, # (9,3)
65535,
65535,
65535, # (9,4) (clipped, nose bridge)
336,
338,
337, # (10,0)
333,
335,
334, # (10,1)
237,
239,
238, # (10,2) / left ring pixel 19
233,
235,
234, # (10,3) / 18
348,
262,
349, # (10,4) / 17
327,
329,
328, # (11,0) / left ring pixel 21
324,
326,
325, # (11,1)
207,
209,
208, # (11,2)
203,
205,
204, # (11,3)
330,
202,
331, # (11,4)
318,
320,
319, # (12,0)
315,
317,
316, # (12,1)
177,
179,
178, # (12,2)
173,
175,
174, # (12,3)
321,
172,
322, # (12,4)
309,
311,
310, # (13,0)
306,
308,
307, # (13,1)
147,
149,
148, # (13,2)
143,
145,
144, # (13,3)
312,
142,
313, # (13,4)
300,
302,
301, # (14,0)
297,
299,
298, # (14,1)
117,
119,
118, # (14,2)
113,
115,
114, # (14,3)
303,
112,
304, # (14,4)
291,
293,
292, # (15,0)
288,
290,
289, # (15,1)
87,
89,
88, # (15,2)
83,
85,
84, # (15,3)
294,
82,
295, # (15,4)
282,
284,
283, # (16,0) / left ring pixel 3
279,
281,
280, # (16,1)
57,
59,
58, # (16,2)
53,
55,
54, # (16,3)
285,
52,
286, # (16,4)
65535,
65535,
65535, # (17,0) (clipped, corner)
270,
272,
271, # (17,1) / left ring pixel 4
27,
29,
28, # (17,2) / 5
23,
25,
24, # (17,3) / 6
276,
22,
277, # (17,4) / 7
)
# LED glasses 18 x 5 matrix but excluding LEDs shared with the eye rings
glassesmatrix_ledmap_no_ring = (
65535,
65535,
65535, # (0,0) (clipped, corner)
65535,
65535,
65535, # (0,1) / right ring pixel 20
65535,
65535,
65535, # (0,2) / 19
65535,
65535,
65535, # (0,3) / 18
65535,
65535,
65535, # (0,4) / 17
65535,
65535,
65535, # (1,0) / right ring pixel #21
220,
218,
219, # (1,1)
223,
221,
222, # (1,2)
226,
224,
225, # (1,3)
214,
212,
213, # (1,4)
187,
185,
186, # (2,0)
190,
188,
189, # (2,1)
193,
191,
192, # (2,2)
196,
194,
195, # (2,3)
184,
182,
183, # (2,4)
37,
35,
36, # (3,0)
40,
38,
39, # (3,1)
43,
41,
42, # (3,2)
46,
44,
45, # (3,3)
34,
32,
33, # (3,4)
67,
65,
66, # (4,0)
70,
68,
69, # (4,1)
73,
71,
72, # (4,2)
76,
74,
75, # (4,3)
64,
62,
63, # (4,4)
97,
95,
96, # (5,0)
100,
98,
99, # (5,1)
103,
101,
102, # (5,2)
106,
104,
105, # (5,3)
94,
92,
93, # (5,4)
127,
125,
126, # (6,0) / right ring pixel 3
130,
128,
129, # (6,1)
133,
131,
132, # (6,2)
136,
134,
135, # (6,3)
124,
122,
123, # (6,4)
157,
155,
156, # (7,0)
160,
158,
159, # (7,1)
163,
161,
162, # (7,2) / right ring pixel 5
166,
164,
165, # (7,3) / 6
244,
242,
243, # (7,4) / 7
247,
245,
246, # (8,0)
250,
248,
249, # (8,1)
253,
251,
252, # (8,2)
256,
254,
255, # (8,3)
65535,
65535,
65535, # (8,4) (clipped, nose bridge)
345,
347,
346, # (9,0)
342,
344,
343, # (9,1)
267,
269,
268, # (9,2)
263,
265,
264, # (9,3)
65535,
65535,
65535, # (9,4) (clipped, nose bridge)
336,
338,
337, # (10,0)
333,
335,
334, # (10,1)
237,
239,
238, # (10,2) / left ring pixel 19
233,
235,
234, # (10,3) / 18
348,
262,
349, # (10,4) / 17
327,
329,
328, # (11,0) / left ring pixel 21
324,
326,
325, # (11,1)
207,
209,
208, # (11,2)
203,
205,
204, # (11,3)
330,
202,
331, # (11,4)
318,
320,
319, # (12,0)
315,
317,
316, # (12,1)
177,
179,
178, # (12,2)
173,
175,
174, # (12,3)
321,
172,
322, # (12,4)
309,
311,
310, # (13,0)
306,
308,
307, # (13,1)
147,
149,
148, # (13,2)
143,
145,
144, # (13,3)
312,
142,
313, # (13,4)
300,
302,
301, # (14,0)
297,
299,
298, # (14,1)
117,
119,
118, # (14,2)
113,
115,
114, # (14,3)
303,
112,
304, # (14,4)
291,
293,
292, # (15,0)
288,
290,
289, # (15,1)
87,
89,
88, # (15,2)
83,
85,
84, # (15,3)
294,
82,
295, # (15,4)
65535,
65535,
65535, # (16,0) / left ring pixel 3
279,
281,
280, # (16,1)
57,
59,
58, # (16,2)
53,
55,
54, # (16,3)
285,
52,
286, # (16,4)
65535,
65535,
65535, # (17,0) (clipped, corner)
65535,
65535,
65535, # (17,1) / left ring pixel 4
65535,
65535,
65535, # (17,2) / 5
65535,
65535,
65535, # (17,3) / 6
65535,
65535,
65535, # (17,4) / 7
)
# Left LED glasses eye ring
left_ring_map = (
341,
210,
211, # 0
332,
180,
181, # 1
323,
150,
151, # 2
127,
125,
126, # 3
154,
152,
153, # 4
163,
161,
162, # 5
166,
164,
165, # 6
244,
242,
243, # 7
259,
257,
258, # 8
169,
167,
168, # 9
139,
137,
138, # 10
109,
107,
108, # 11
79,
77,
78, # 12
49,
47,
48, # 13
199,
197,
198, # 14
229,
227,
228, # 15
19,
17,
18, # 16
4,
2,
3, # 17
16,
14,
15, # 18
13,
11,
12, # 19
10,
8,
9, # 20
217,
215,
216, # 21
7,
5,
6, # 22
350,
240,
241, # 23
)
# Left LED glasses eye ring excluding inner LEDs shared with the 18 x 5 matrix
left_ring_map_no_inner = (
341,
210,
211, # 0
332,
180,
181, # 1
323,
150,
151, # 2
65535,
65535,
65535, # 3
65535,
65535,
65535, # 4
65535,
65535,
65535, # 5
65535,
65535,
65535, # 6
65535,
65535,
65535, # 7
259,
257,
258, # 8
169,
167,
168, # 9
139,
137,
138, # 10
109,
107,
108, # 11
79,
77,
78, # 12
49,
47,
48, # 13
199,
197,
198, # 14
229,
227,
228, # 15
19,
17,
18, # 16
4,
2,
3, # 17
16,
14,
15, # 18
13,
11,
12, # 19
10,
8,
9, # 20
217,
215,
216, # 21
7,
5,
6, # 22
350,
240,
241, # 23
)
# Right LED glasses eye ring
right_ring_map = (
287,
30,
31, # 0
278,
0,
1, # 1
273,
275,
274, # 2
282,
284,
283, # 3
270,
272,
271, # 4
27,
29,
28, # 5
23,
25,
24, # 6
276,
22,
277, # 7
20,
26,
21, # 8
50,
56,
51, # 9
80,
86,
81, # 10
110,
116,
111, # 11
140,
146,
141, # 12
170,
176,
171, # 13
200,
206,
201, # 14
230,
236,
231, # 15
260,
266,
261, # 16
348,
262,
349, # 17
233,
235,
234, # 18
237,
239,
238, # 19
339,
232,
340, # 20
327,
329,
328, # 21
305,
90,
91, # 22
296,
60,
61, # 23
)
# Right LED glasses eye ring excluding inner LEDs shared with the 18 x 5 matrix
right_ring_map_no_inner = (
287,
30,
31, # 0
278,
0,
1, # 1
273,
275,
274, # 2
282,
284,
283, # 3
270,
272,
271, # 4
27,
29,
28, # 5
23,
25,
24, # 6
276,
22,
277, # 7
20,
26,
21, # 8
50,
56,
51, # 9
80,
86,
81, # 10
110,
116,
111, # 11
140,
146,
141, # 12
170,
176,
171, # 13
200,
206,
201, # 14
230,
236,
231, # 15
260,
266,
261, # 16
65535,
65535,
65535, # 17
65535,
65535,
65535, # 18
65535,
65535,
65535, # 19
65535,
65535,
65535, # 20
65535,
65535,
65535, # 21
305,
90,
91, # 22
296,
60,
61, # 23
)
|
# Adjusts numerical digits by a specified amount
class Offsetter:
# numericOffset is only altered by init
numericOffset=0
def __init__(self, offset):
self.numericOffset = int(offset)
# apply offset
def setOff(self, input_int):
return (( int(input_int) + self.numericOffset ) % 10)
# remove offset
def setOn(self, input_int):
return (( input_int + (10 - self.numericOffset) ) % 10)
# apply offset to each digit of a longer string
def stringOffset(self,input_string):
output_string = ''
for s in input_string:
input_int = self.char2int(s)
output_string = output_string + str(self.setOff( input_int ))
return output_string
# explicitly integer values chars
def char2int(self,input_char):
return {
'0': 0,
'1': 1,
'2': 2,
'3': 3,
'4': 4,
'5': 5,
'6': 6,
'7': 7,
'8': 8,
'9': 9,
}.get(input_char,0)
# Converts char to ascii
class Encoder:
def string2ascii (self, input_string):
return_list = []
for i in range(0,len(input_string)):
return_list.insert(i,self.char2ascii(input_string[i]))
return return_list
def char2ascii(self, input_char):
return ord(input_char)
# Converts ascii to char
class Decoder:
def string2ascii (self, input_list):
return_string = ''
for i in input_list:
return_string= return_string + self.char2ascii(i)
return return_string
def char2ascii(self, input_int):
return chr(input_int)
|
#!/usr/bin/env python3
"""
Node Class
This are the single blocks in the grid, which can be blocked or passable.
"""
class Node(object):
def __init__(self, x, y, blocked=False):
self.x = x
self.y = y
self.blocked = blocked
# calculate the distance to another node with the normal and diagonal costs
def calc_distance_to(self, other, normal_cost, diagonal_cost):
diff_x = abs(self.x - other.x)
diff_y = abs(self.y - other.y)
diff_of_diff = abs(diff_x - diff_y)
# only vertical way
if self.x == other.x:
return diff_y * normal_cost
# only horizontal way
if self.y == other.y:
return diff_x * normal_cost
# if we have diagonal ways, we do first the diagonal, and after that we calculate the straight ways
if diff_x <= diff_y:
return diff_x * diagonal_cost + diff_of_diff * normal_cost
return diff_y * diagonal_cost + diff_of_diff * normal_cost
|
## Sum of Intervals
## 4 kyu
## https://www.codewars.com/kata/52b7ed099cdc285c300001cd
def sum_of_intervals(intervals):
seen = set()
for (low,high) in intervals:
for length in range(low, high):
seen.add(length)
return len(seen)
|
produtos_prec = ("Croissant", 2.0, "Leite", 5.0, "Mix de grãos", 8.0 , "Mix de nozes", 7.55,
"Café", 3.45, "Bolo", 13.66, "Torta gelada", 6.77, "Suco", 3.27 )
print("="*38)
print(f"{'LISTAGEM DE PREÇOS':^38}")
print("="*38)
prod = 0
while prod < len(produtos_prec):
print(f'{produtos_prec[prod]:.<28}R$ {produtos_prec[prod+1]:>5.2f}')
prod +=2
|
# https://leetcode.com/problems/guess-number-higher-or-lower/
# We are playing the Guess Game. The game is as follows:
#
# I pick a number from 1 to n. You have to guess which number I picked.
#
# Every time you guess wrong, I'll tell you whether the number is higher or lower.
#
# You call a pre-defined API guess(int num) which returns 3 possible results (-1, 1, or 0):
#
# -1 : My number is lower
# 1 : My number is higher
# 0 : Congrats! You got it!
def guess(num,x):
pass
class Solution(object):
def guessNumber(self, n):
begin,end = 1,n
while True:
curNum = (begin + end) // 2
curBool = guess(curNum)
if curBool == 1:
end = curNum - 1
elif curBool == -1:
begin = curNum + 1
else:
return curNum
|
#6. 有有这样一个字典d = {"chaoqian":87, “caoxu”:90, “caohuan”:98, “wuhan”:82, “zhijia”:89}
# 1)将以上字典按成绩排名
d = {"chaoqian":87,"caoxu":90,"caohuan":98,"wuhan":82, "zhijia":89}
s = sorted(d.items(), key = lambda k:k[1],reverse = True)
print(s)
|
m,n,field = 1,1,0
while(m!= 0 and n!=0): #Salida del programa
tamaño = input("")
tamaño = tamaño.split()
m = int(tamaño[0]) #Obtenemos los datos del tamaño del buscaminas
n = int(tamaño[1])
if(n<0 or m>100): #Verificacion de dimensiones
print("dimensiones incorrectas")
m = 0
n = 0
break
lista = []
for i in range(0,m): #Obtenemos los datos del buscaminas y los añadimos a una lista.
renglon = input("")
if(len(renglon)> n):
print("Faltan o sobran datos")
break
else:
lista.append(renglon)
matriz1 = []
for i in range(0,m): #Creamos la lista de listas que se puede ver como un arreglo bidimensional.
matriz1.append(list(lista[i]))
matriz2 = []
for i in range(0,m): #Utilizamos un contador para saber cuantas veces aparece un '*' y lo añadimos a una listas
for j in range(0,n):
counter = 0
if (matriz1[i][j]=="*"): #Si el elemento es un '*' lo añade.
counter = "*"
elif(i == 0): #Hacemos todas las verificaciones de los 8 lugares adyacentes dependiendo del lugar donde se encuentre la matriz1[i][j].
if(j == 0):
if(matriz1[1][0]== "*"): #Abajo
counter+=1
if(matriz1[1][1] == "*"): #Diagonal Derecha Abajo
counter+=1
if(matriz1[0][1] == "*"): #Derecha
counter+=1
elif(j == n-1):
if(matriz1[1][n-1]=="*"): #Abajo
counter+=1
if (matriz1[1][n-2]=="*"): # Diagonal Izquierda Abajo
counter+=1
if (matriz1[0][n-2]=="*"): # Izquierda
counter+=1
else:
if(matriz1[0][j-1]=="*"): # Izquierda
counter+=1
if(matriz1[1][j]=="*"): # Abajo
counter+=1
if(matriz1[0][j+1]=="*"): # Derecha
counter+=1
if(matriz1[1][j-1]=="*"): #Diagonal Izquierda Abajo
counter+=1
if(matriz1[1][j+1]=="*"): #Diagonal Derecha Abajo
counter+=1
elif(i==m-1):
if(j == 0):
if(matriz1[m-1][1]=="*"): #Derecha
counter+=1
if(matriz1[m-2][1]=="*"): #Diagonal Derecha Arriba
counter+=1
if(matriz1[m-2][0]=="*"): #Arriba
counter+=1
elif(j == n-1):
if(matriz1[m-1][n-2]== "*"): #Izquierda
counter+=1
if(matriz1[m-2][n-2]== "*"): #Diagonal Izquierda Arriba
counter+=1
if(matriz1[m-2][n-1]=="*"): #Arriba
counter+=1
else:
if(matriz1[m-1][j-1] == "*"): #Izquierda
counter+=1
if (matriz1[m-2][j-1]=="*"): #Diagonal Izquierda Arriba
counter+=1
if(matriz1[m-2][j] == "*"): #Arriba
counter+=1
if(matriz1[m-2][j+1] == "*"): #Diagonal Derecha Arriba
counter+=1
if(matriz1[m-1][j+1] == "*"): # Derecha
counter+=1
else:
if(j == 0):
if(matriz1[i-1][0] == "*"): # Arriba
counter+=1
if(matriz1[i-1][1] =="*"): #Diagonal Derecha Arriba
counter+=1
if(matriz1[i][1] == "*"): #Derecha
counter+=1
if(matriz1[i+1][1]=="*"): #Diagonal Derecha Abajo
counter+=1
if (matriz1[i+1][0] == "*"): #Abajo
counter+=1
elif(j == n-1):
if(matriz1[i-1][n-1]=="*"): #Arriba
counter+=1
if(matriz1[i-1][n-2]=="*"): #Diagonal Izquierda Arriba
counter+=1
if(matriz1[i][n-2] =="*"): #Izquierda
counter+=1
if(matriz1[i+1][n-2] == "*"): #Diagonal Izquierda Abajo
counter+=1
if(matriz1[i+1][n-1] == "*"): #Abajo
counter+=1
else:
if(matriz1[i][j+1] == "*"): #Derecha
counter+=1
if (matriz1[i+1][j+1] == "*"): #Diagonal Derecha Abajo
counter+=1
if(matriz1[i+1][j]=="*"):#Abajo
counter+=1
if(matriz1[i+1][j-1]=="*"): # Diagonal Izquierda Abajo
counter+=1
if(matriz1[i][j-1]=="*"): #Izquierda
counter+=1
if(matriz1[i-1][j-1]=="*"): #Diagonal Izquierda Arriba
counter+=1
if(matriz1[i-1][j]=="*"): #Arriba
counter+=1
if(matriz1[i-1][j+1]=="*"): # Diagonal Arriba Derecha
counter+=1
matriz2.append(str(counter))
field+=1 #Contador de campos.
s = "".join(matriz2)
if(n == 0 and m==0):
break
else:
print("\nField #"+str(field)+":")
while(len(s)!=0): #Para mostrar los valores obtenidos a partir de los datos ingresados por el usuario.
print(s[0:n])
s=s[n::]
print("\n")
|
def isPalindrome(number):
ispalindrome = True
list = intToList(number)
#if list is not an even number it can't be a palindrome
if len(list) % 2 != 0:
ispalindrome = False
for x in range(0,int(len(list)/2)):
if(ispalindrome):
ispalindrome = (list[x] == list[len(list)-(x+1)])
return ispalindrome
def intToList(number):
digits = []
number = str(number)
for digit in number:
digits.append(int(digit))
return digits
#largest_palindrome
largest_palindrome = 0
#For loop to generate multiples
for i in range(1000,100,-1):
for j in range(1000,100,-1):
number = i*j
if number > largest_palindrome and isPalindrome(number):
largest_palindrome = number
print(largest_palindrome)
|
sites = [
'https://yii2-menu.pceuropa.net/',
'https://pceuropa.net',
]
smtp = {
'server': 'smtp@example.com:587',
'login': 'info@example.com',
'password': 'pass',
'From': 'info@example.com',
'to': 'info@example.com',
}
|
broker_url = 'amqp://guest:guest@localhost:5672//'
accept_content = ['application/json']
result_serializer = 'pickle'
task_serializer = 'pickle'
|
word = "bottles"
for beer_num in range(99, 0, -1):
print(beer_num, word, " of beer on the wall,")
print(beer_num, word, " bottles of beer.")
print("You take one down,")
print("You pass it around,")
if (beer_num == 1):
print("No more bottles of beer on the wall.")
else:
new_num = beer_num - 1
if new_num == 1:
word = "bottle"
print(new_num, word, "of beer on the wall.")
print()
|
"""This problem was asked by Oracle.
Given a binary search tree, find the floor and ceiling of a given integer.
The floor is the highest element in the tree less than or equal to an integer,
while the ceiling is the lowest element in the tree greater than or equal to an integer.
If either value does not exist, return None.
"""
|
## Mel-filterbank
mel_n_channels = 80
win_length = 512
hop_length = 128
n_fft = 512
mel_window_length = 25 # In milliseconds
mel_window_step = 10 # In milliseconds
## Audio
sampling_rate = 24000
# Number of spectrogram frames in a partial utterance
partials_n_frames = 240 # 2400 ms
# Number of spectrogram frames at inference
inference_n_frames = 120 # 1200 ms
## Voice Activation Detection
# Window size of the VAD. Must be either 10, 20 or 30 milliseconds.
# This sets the granularity of the VAD. Should not need to be changed.
vad_window_length = 20 # In milliseconds
# Number of frames to average together when performing the moving average smoothing.
# The larger this value, the larger the VAD variations must be to not get smoothed out.
vad_moving_average_width = 8
# Maximum number of consecutive silent frames a segment can have.
vad_max_silence_length = 6
## Audio volume normalization
audio_norm_target_dBFS = -30
|
class CollapseRenderMixin:
render_template = "djangocms_frontend/bootstrap5/collapse.html"
class CollapseContainerRenderMixin:
render_template = "djangocms_frontend/bootstrap5/collapse-container.html"
def render(self, context, instance, placeholder):
instance.add_classes("collapse")
return super().render(context, instance, placeholder)
class CollapseTriggerRenderMixin:
render_template = "djangocms_frontend/bootstrap5/collapse-trigger.html"
|
#
# PySNMP MIB module AtiL2-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/AtiL2-MIB
# Produced by pysmi-0.3.4 at Wed May 1 11:33:22 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")
ValueSizeConstraint, ValueRangeConstraint, ConstraintsIntersection, ConstraintsUnion, SingleValueConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueSizeConstraint", "ValueRangeConstraint", "ConstraintsIntersection", "ConstraintsUnion", "SingleValueConstraint")
NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance")
enterprises, Counter32, ModuleIdentity, iso, TimeTicks, IpAddress, Integer32, Counter64, MibIdentifier, NotificationType, Gauge32, Bits, Unsigned32, ObjectIdentity, NotificationType, MibScalar, MibTable, MibTableRow, MibTableColumn = mibBuilder.importSymbols("SNMPv2-SMI", "enterprises", "Counter32", "ModuleIdentity", "iso", "TimeTicks", "IpAddress", "Integer32", "Counter64", "MibIdentifier", "NotificationType", "Gauge32", "Bits", "Unsigned32", "ObjectIdentity", "NotificationType", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn")
TextualConvention, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString")
class MacAddress(OctetString):
subtypeSpec = OctetString.subtypeSpec + ValueSizeConstraint(6, 6)
fixedLength = 6
class BridgeId(OctetString):
subtypeSpec = OctetString.subtypeSpec + ValueSizeConstraint(8, 8)
fixedLength = 8
class Timeout(Integer32):
pass
alliedTelesyn = MibIdentifier((1, 3, 6, 1, 4, 1, 207))
atiProduct = MibIdentifier((1, 3, 6, 1, 4, 1, 207, 1))
swhub = MibIdentifier((1, 3, 6, 1, 4, 1, 207, 1, 4))
at_8324 = MibIdentifier((1, 3, 6, 1, 4, 1, 207, 1, 4, 37)).setLabel("at-8324")
at_8124XL_V2 = MibIdentifier((1, 3, 6, 1, 4, 1, 207, 1, 4, 52)).setLabel("at-8124XL-V2")
at_8326GB = MibIdentifier((1, 3, 6, 1, 4, 1, 207, 1, 4, 72)).setLabel("at-8326GB")
at_9410GB = MibIdentifier((1, 3, 6, 1, 4, 1, 207, 1, 4, 73)).setLabel("at-9410GB")
at_8350GB = MibIdentifier((1, 3, 6, 1, 4, 1, 207, 1, 4, 74)).setLabel("at-8350GB")
at_8316F = MibIdentifier((1, 3, 6, 1, 4, 1, 207, 1, 4, 77)).setLabel("at-8316F")
mibObject = MibIdentifier((1, 3, 6, 1, 4, 1, 207, 8))
atiL2Mib = MibIdentifier((1, 3, 6, 1, 4, 1, 207, 8, 33))
atiL2GlobalGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 207, 8, 33, 1))
atiL2IpGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 207, 8, 33, 2))
atiL2NMGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 207, 8, 33, 3))
atiL2DHCPGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 207, 8, 33, 4))
atiL2DeviceGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 207, 8, 33, 5))
atiL2EthernetStatsGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 207, 8, 33, 6))
atiL2DevicePortConfigGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 207, 8, 33, 7))
atiL2VlanConfigGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 207, 8, 33, 8))
atiL2IfExt = MibIdentifier((1, 3, 6, 1, 4, 1, 207, 8, 33, 9))
atiL2BridgeMib = MibIdentifier((1, 3, 6, 1, 4, 1, 207, 8, 33, 10))
atiL2BrBase = MibIdentifier((1, 3, 6, 1, 4, 1, 207, 8, 33, 10, 1))
atiL2BrStp = MibIdentifier((1, 3, 6, 1, 4, 1, 207, 8, 33, 10, 2))
atiL2BrTp = MibIdentifier((1, 3, 6, 1, 4, 1, 207, 8, 33, 10, 3))
atiL2TrapAttrGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 207, 8, 33, 11))
atiL2QOSConfigGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 207, 8, 33, 12))
atiL2SwProduct = MibScalar((1, 3, 6, 1, 4, 1, 207, 8, 33, 1, 1), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2SwProduct.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2SwProduct.setDescription('Identifies the software product the device is running.')
atiL2SwVersion = MibScalar((1, 3, 6, 1, 4, 1, 207, 8, 33, 1, 2), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2SwVersion.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2SwVersion.setDescription(' Identifies the version number of the present release.')
atiL2Reset = MibScalar((1, 3, 6, 1, 4, 1, 207, 8, 33, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("switch-no-reset", 1), ("switch-reset", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: atiL2Reset.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2Reset.setDescription(' Object use to reset all the Modules globally.')
atiL2MirroringSourceModule = MibScalar((1, 3, 6, 1, 4, 1, 207, 8, 33, 1, 4), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: atiL2MirroringSourceModule.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2MirroringSourceModule.setDescription(" This is the mirror source module number. If the atiL2EthConfigMirrorState is Enabled then the mirror source module/port data gets routed to the mirror destination module/port. Both transmitted and recieved source activity is mirrored to the destination. This arrangement is to put an RMON Probe on the destination port to probe the traffic on the Source port. This object will return a '0' if the MirrorState is not enabled.")
atiL2MirroringSourcePort = MibScalar((1, 3, 6, 1, 4, 1, 207, 8, 33, 1, 5), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: atiL2MirroringSourcePort.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2MirroringSourcePort.setDescription(" This is the Source port number for which there is another mirror port.If the atiL2EthConfigMirrorState is Enabled then the mirror portgets routed with all the packets going in and out of Source port. This arrangement is to put an RMON Probe on mirrored port to Probe the traffic on the Source port. One of the port is dedicated to this so that for any port as source port, this dedicated port can be a mirrored port. This object will return a '0' if the MirrorState is not enabled.")
atiL2MirroringDestinationModule = MibScalar((1, 3, 6, 1, 4, 1, 207, 8, 33, 1, 6), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: atiL2MirroringDestinationModule.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2MirroringDestinationModule.setDescription(" This is the mirror destination module number. If the atiL2EthConfigMirrorState is Enabled then the mirror source module/port data gets routed to the mirror destination module/port. Both transmitted and recieved source activity is mirrored to the destination. This arrangement is to put an RMON Probe on the destination port to probe the traffic on the Source port. This object will return a '0' if the MirrorState is not enabled.")
atiL2MirroringDestinationPort = MibScalar((1, 3, 6, 1, 4, 1, 207, 8, 33, 1, 7), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: atiL2MirroringDestinationPort.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2MirroringDestinationPort.setDescription(" This is the Destination port number for which there is another mirror port.If the atiL2EthConfigMirrorState is Enabled then,the mirror portgets routed with all the packets going in and out of Destination port. This arrangement is to put an RMON Probe on mirrored port to Probe the traffic on the Destination port. One of the port is dedicated to this so that for any port as destination port, this dedicated port can be a mirrored port. This object will return a '0' if the MirrorState is not enabled.")
atiL2MirrorState = MibScalar((1, 3, 6, 1, 4, 1, 207, 8, 33, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("receive-and-transmit", 1), ("disabled", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: atiL2MirrorState.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2MirrorState.setDescription(' if the state of Mirroring is enabled by selecting one of the two values , then the Mirroring explained above works. If disabled, port operation works normally. No Traffic gets routed from MirroringSourcePort to Destination Mirrored Port.')
atiL2IGMPState = MibScalar((1, 3, 6, 1, 4, 1, 207, 8, 33, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: atiL2IGMPState.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2IGMPState.setDescription('This attribute allows an administrative request to configure IGMP')
atiL2DeviceNumber = MibScalar((1, 3, 6, 1, 4, 1, 207, 8, 33, 1, 10), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2DeviceNumber.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2DeviceNumber.setDescription('The total number of devices in the stack.')
atiL2CurrentIpAddress = MibScalar((1, 3, 6, 1, 4, 1, 207, 8, 33, 2, 1), IpAddress()).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2CurrentIpAddress.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2CurrentIpAddress.setDescription(' The Current IP address is the one which is currently used and is obtained dynamically through one of the protocols interaction.( DHCP or Bootp.) This address is NULL if the Address is Statically configured.')
atiL2ConfiguredIpAddress = MibScalar((1, 3, 6, 1, 4, 1, 207, 8, 33, 2, 2), IpAddress()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: atiL2ConfiguredIpAddress.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2ConfiguredIpAddress.setDescription(' The Configured IP address of the device. This is the address configured through Network or Local Omega. ')
atiL2ConfiguredSubnetMask = MibScalar((1, 3, 6, 1, 4, 1, 207, 8, 33, 2, 3), IpAddress()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: atiL2ConfiguredSubnetMask.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2ConfiguredSubnetMask.setDescription(' The Configured Subnet Mask of the device.')
atiL2ConfiguredRouter = MibScalar((1, 3, 6, 1, 4, 1, 207, 8, 33, 2, 4), IpAddress()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: atiL2ConfiguredRouter.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2ConfiguredRouter.setDescription(' The Configured Gateway/Router address of the device')
atiL2IPAddressStatus = MibScalar((1, 3, 6, 1, 4, 1, 207, 8, 33, 2, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("from-dhcp", 1), ("from-bootp", 2), ("from-psuedoip", 3), ("from-Omega", 4)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2IPAddressStatus.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2IPAddressStatus.setDescription(' The IP Address can be obtained/configured by any of the above different ways. This object specifies how IP address currently on the switch Box, was configured/obtained.')
atiL2DNServer = MibScalar((1, 3, 6, 1, 4, 1, 207, 8, 33, 2, 6), IpAddress()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: atiL2DNServer.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2DNServer.setDescription(' The Configured DNS Server address of the device')
atiL2DefaultDomainName = MibScalar((1, 3, 6, 1, 4, 1, 207, 8, 33, 2, 7), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: atiL2DefaultDomainName.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2DefaultDomainName.setDescription(' This Object defines the Default Domain where this switch can be belong to.')
atiL2NwMgrTable = MibTable((1, 3, 6, 1, 4, 1, 207, 8, 33, 3, 1), )
if mibBuilder.loadTexts: atiL2NwMgrTable.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2NwMgrTable.setDescription('A list of SNMP Trap Manager stations Entries. The number of entries is given by the switchNwMgrTotal mib object.')
atiL2NwMgrEntry = MibTableRow((1, 3, 6, 1, 4, 1, 207, 8, 33, 3, 1, 1), ).setIndexNames((0, "AtiL2-MIB", "atiL2NwMgrIndex"))
if mibBuilder.loadTexts: atiL2NwMgrEntry.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2NwMgrEntry.setDescription("Trap receipt Manager Entry containing ipaddress of the configured NMS's to which Traps are sent.")
atiL2NwMgrIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 3, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 4))).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2NwMgrIndex.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2NwMgrIndex.setDescription('The Index of the Managers Ip address.')
atiL2NwMgrIpAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 3, 1, 1, 2), IpAddress()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: atiL2NwMgrIpAddr.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2NwMgrIpAddr.setDescription('The IP Address of the NMS host configured.')
atiL2DHCPSysGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 207, 8, 33, 4, 1))
atiL2DHCPTimerGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 207, 8, 33, 4, 2))
atiL2DHCPCurrentDHCPClientAddress = MibScalar((1, 3, 6, 1, 4, 1, 207, 8, 33, 4, 1, 1), IpAddress()).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2DHCPCurrentDHCPClientAddress.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2DHCPCurrentDHCPClientAddress.setDescription('Current IP address of the client. To start with,it might be null. This is filled by the server when sending a DHCPOFFER and the client uses the most comfortable offer from offers sent by different DHCP servers. A DHCPREQUEST packet is sent with the Client address agreed upon to the selected server ( Broadcast). Server Acks back this packet which is where Client/Server moves to the Bound state. Once reached into Bound state, the client address is made the official address on the client.')
atiL2DHCPSubnetMask = MibScalar((1, 3, 6, 1, 4, 1, 207, 8, 33, 4, 1, 2), IpAddress()).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2DHCPSubnetMask.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2DHCPSubnetMask.setDescription('When the client/server reaches the BOUND state, this is one of the parameters set by the server.')
atiL2DHCPCurrentRelayAgentAddress = MibScalar((1, 3, 6, 1, 4, 1, 207, 8, 33, 4, 1, 3), IpAddress()).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2DHCPCurrentRelayAgentAddress.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2DHCPCurrentRelayAgentAddress.setDescription('The IP address of the DHCP relay Agent on the same subnet. Normally there will be no DHCP server on each of the subnet and this Relay Agent will act in sending server across the subnets. There might not be any relay agent. This depends on the network Toplogy like where is the DHCP server and DHCP client.')
atiL2DHCPNextDHCPServerAddress = MibScalar((1, 3, 6, 1, 4, 1, 207, 8, 33, 4, 1, 4), IpAddress()).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2DHCPNextDHCPServerAddress.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2DHCPNextDHCPServerAddress.setDescription('The IP address of the next DHCP server to be used during bootstrap. This address is sent by the DHCP server in the messages DHCPOFFER, DHCPACK,DHCPNACK.')
atiL2DHCPLeaseTimer = MibScalar((1, 3, 6, 1, 4, 1, 207, 8, 33, 4, 2, 1), TimeTicks()).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2DHCPLeaseTimer.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2DHCPLeaseTimer.setDescription('When the client/server reaches the BOUND state, this is one of the parameters set by the server. The lease time period in seconds for the DHCP client for using IP address on lease from the server. At the end of 50% of this timer a renewal request is sent by the client . This is the next Object atiL2DHCPReacquisitionTimer.')
atiL2DHCPReacquisitionTimer = MibScalar((1, 3, 6, 1, 4, 1, 207, 8, 33, 4, 2, 2), TimeTicks()).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2DHCPReacquisitionTimer.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2DHCPReacquisitionTimer.setDescription("When the client/server reaches the BOUND state, this is one of the parameters set by the server. Mentioned in RFC2131 4.4.5 as T1, this renewal time period in secs for the DHCP client is for using IP address on lease from the server Once the Reacquisition Timer period in secs after the lease period is reached, the client sends a DHCPREQUEST to the DHCP server requesting for renewal of the lease. Default would be 50% of the Lease timer which is represeneted by the above object. The client moves from BOUND to RENEW state once the DHCPREQUEST is sent after time T1 secs is passed from the start of to release time. T1 is always less than T2 ( see below for 'T2') which is less than the lease Timer period.")
atiL2DHCPExpirationTimer = MibScalar((1, 3, 6, 1, 4, 1, 207, 8, 33, 4, 2, 3), TimeTicks()).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2DHCPExpirationTimer.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2DHCPExpirationTimer.setDescription('When the client/server reaches the BOUND state, this is one of the parameters set by the server. Mentioned in RFC2131 4.4.5 as T2,this Expiration time period in secs is the time period in secs during which DHCP has gone through the BOUND->RENEWAL state. After T1 secs and when the state machine reaches T2 secs, ( T1 < T2 < lease period), DHCP client sends another DHCPREQUEST to the server asking the server to renew the lease for the IP parameters. By default it would be 87.5% of the Lease timer .If there is DHCPACK then the DHCP client moves from REBIND to BOUND. Else it moves to INIT state where it starts all over again sending a request for DHCPDISCOVER.')
atiL2deviceTable = MibTable((1, 3, 6, 1, 4, 1, 207, 8, 33, 5, 1), )
if mibBuilder.loadTexts: atiL2deviceTable.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2deviceTable.setDescription('The table contains the mapping of all devices in the chassis.')
atiL2deviceEntry = MibTableRow((1, 3, 6, 1, 4, 1, 207, 8, 33, 5, 1, 1), ).setIndexNames((0, "AtiL2-MIB", "atiL2deviceIndex"))
if mibBuilder.loadTexts: atiL2deviceEntry.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2deviceEntry.setDescription('The device entry in the DeviceTable.')
atiL2deviceIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 5, 1, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 8))).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2deviceIndex.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2deviceIndex.setDescription('The Slot number in the chassis where the device is installed.')
atiL2deviceDescr = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 5, 1, 1, 3), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2deviceDescr.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2deviceDescr.setDescription('A textual description of the device.')
atiL2deviceProductType = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 5, 1, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 20))).clone(namedValues=NamedValues(("at-8324", 1), ("at-8316F", 2), ("at-8124XL-V2", 3), ("at-8326GB", 4), ("at-9410GB", 5), ("at-8350GB", 6), ("other", 20)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2deviceProductType.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2deviceProductType.setDescription('This object will return Product Type.')
atiL2devicePortCount = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 5, 1, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 1024))).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2devicePortCount.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2devicePortCount.setDescription('The number of ports contained within the device. Valid range is 1-32. Within each device, the ports are uniquely numbered in the range from 1 to maxportCapacity.')
atiL2deviceSecurityConfig = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 5, 1, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("disabled", 1), ("enabled-with-learning-locked", 2), ("limited-enabled", 3)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: atiL2deviceSecurityConfig.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2deviceSecurityConfig.setDescription('Security feature configuration Object.The Security disable would let the device carry on the learn-new-address-as-it-comes-in mode as usual.When security is enabled-with-learning-locked, the learning of new address is stopped and the addresses locked in the device is used as the security Database. If an address comes in which is not present in the Device Security Database, then any of the atiL2SecurityAction Configured is triggered. When limited-enabled is selected, a per-port atiL2PortSecurityNumberOfAddresses specify the max number of MACs to be learned.')
atiL2deviceSecurityAction = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 5, 1, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("send-trap-only", 1), ("disable-port-only", 2), ("disable-port-and-send-trap", 3), ("do-nothing", 4)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: atiL2deviceSecurityAction.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2deviceSecurityAction.setDescription('Security Action to be carried when the atiL2SecurityConfig is enabled-with-learning-locked or limted-enabled.')
atiL2deviceDebugAvailableBytes = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 5, 1, 1, 8), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2deviceDebugAvailableBytes.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2deviceDebugAvailableBytes.setDescription('This is strictly for Debug reason and this object should not be believed as the correct number.')
atiL2deviceMDA1Type = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 5, 1, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("ten-100rj45-mii", 1), ("hundredfiber-mii", 2), ("oneGb-rj45", 3), ("oneGb-Fiber", 4), ("none", 5)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2deviceMDA1Type.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2deviceMDA1Type.setDescription("This object returns the MDA type of the Uplink port. The values of 1 and 2 are the only one present in 81XX. 82XX has all the values supported. This object returns the MDA type of the Uplink Port named 'A'. It returns 'none' if a 'A' MDA slot is not installed.")
atiL2deviceMDA2Type = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 5, 1, 1, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("ten-100rj45-mii", 1), ("hundredfiber-mii", 2), ("oneGb-rj45", 3), ("oneGb-Fiber", 4), ("none", 5)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2deviceMDA2Type.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2deviceMDA2Type.setDescription("This Object is supported in 81XX 82XX product lines. The values of 1 and 2 are the only one present in 81XX. 82XX has all the values supported. This object returns the MDA type of the Uplink Port named 'B'. It returns 'none' if a 'B' MDA slot is not installed.")
atiL2deviceReset = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 5, 1, 1, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("switch-no-reset", 1), ("switch-reset", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: atiL2deviceReset.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2deviceReset.setDescription("Setting this object to 'switch-reset' will cause the switch to perform a hardware reset within approximately 4-6 seconds. Setting this object to 'switch-no-reset will have no effect. The value 'no-reset' will be returned whenever this object is retrieved.")
atiL2EthMonStatsGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 207, 8, 33, 6, 1))
atiL2EthErrStatsGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 207, 8, 33, 6, 2))
atiL2EthMonStatsTable = MibTable((1, 3, 6, 1, 4, 1, 207, 8, 33, 6, 1, 1), )
if mibBuilder.loadTexts: atiL2EthMonStatsTable.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2EthMonStatsTable.setDescription('A list of statistics entries.')
atiL2EthMonStatsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 207, 8, 33, 6, 1, 1, 1), ).setIndexNames((0, "AtiL2-MIB", "atiL2EthMonModuleId"))
if mibBuilder.loadTexts: atiL2EthMonStatsEntry.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2EthMonStatsEntry.setDescription('A collection of statistics kept for a particular port.')
atiL2EthMonModuleId = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 6, 1, 1, 1, 1), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2EthMonModuleId.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2EthMonModuleId.setDescription('This Object Identifies the Module Id for which the Statistics is collected.')
atiL2EthMonRxGoodFrames = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 6, 1, 1, 1, 2), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2EthMonRxGoodFrames.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2EthMonRxGoodFrames.setDescription('The total number of Good Frames received on this module.')
atiL2EthMonTxGoodFrames = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 6, 1, 1, 1, 3), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2EthMonTxGoodFrames.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2EthMonTxGoodFrames.setDescription('The total number of Good Frames Transmitted by this module.')
atiL2EthMonTxTotalBytes = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 6, 1, 1, 1, 4), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2EthMonTxTotalBytes.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2EthMonTxTotalBytes.setDescription('The total number of Bytes transmitted from this module.')
atiL2EthMonTxDeferred = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 6, 1, 1, 1, 5), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2EthMonTxDeferred.setStatus('deprecated')
if mibBuilder.loadTexts: atiL2EthMonTxDeferred.setDescription('This is the count of first time Transmission attempt which failed on an interface due to medium being busy.')
atiL2EthMonTxCollisions = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 6, 1, 1, 1, 6), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2EthMonTxCollisions.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2EthMonTxCollisions.setDescription('The total number of collisions while switching on an interface.')
atiL2EthMonTxBroadcastFrames = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 6, 1, 1, 1, 7), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2EthMonTxBroadcastFrames.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2EthMonTxBroadcastFrames.setDescription('The total number of Transmit Broadcast Frames while switching on an interface.')
atiL2EthMonTxMulticastFrames = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 6, 1, 1, 1, 8), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2EthMonTxMulticastFrames.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2EthMonTxMulticastFrames.setDescription('The total number of Transmit Multicast while switching on an interface.')
atiL2EthMonRxOverruns = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 6, 1, 1, 1, 9), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2EthMonRxOverruns.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2EthMonRxOverruns.setDescription('The total number of Recieved Overrun Frames while switching on an interface.')
atiL2EthPortMonStatsTable = MibTable((1, 3, 6, 1, 4, 1, 207, 8, 33, 6, 1, 2), )
if mibBuilder.loadTexts: atiL2EthPortMonStatsTable.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2EthPortMonStatsTable.setDescription('A list of statistics entries per Port on a Module.')
atiL2EthPortMonStatsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 207, 8, 33, 6, 1, 2, 1), ).setIndexNames((0, "AtiL2-MIB", "atiL2EthPortMonModuleId"), (0, "AtiL2-MIB", "atiL2EthPortMonPortId"))
if mibBuilder.loadTexts: atiL2EthPortMonStatsEntry.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2EthPortMonStatsEntry.setDescription('A collection of statistics kept for a particular port.')
atiL2EthPortMonModuleId = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 6, 1, 2, 1, 1), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2EthPortMonModuleId.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2EthPortMonModuleId.setDescription('This Object Identifies the Module Id for which the Statistics is collected.')
atiL2EthPortMonPortId = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 6, 1, 2, 1, 2), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2EthPortMonPortId.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2EthPortMonPortId.setDescription('This Object Identifies the Port on the Module recognised by EthMonPortModuleId for which the Statistics is collected.')
atiL2EthPortMonRxGoodFrames = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 6, 1, 2, 1, 3), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2EthPortMonRxGoodFrames.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2EthPortMonRxGoodFrames.setDescription('The total number of Good Frames received on this module.')
atiL2EthPortMonTxGoodFrames = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 6, 1, 2, 1, 4), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2EthPortMonTxGoodFrames.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2EthPortMonTxGoodFrames.setDescription('The total number of Good Frames Transmitted by this module.')
atiL2EthPortMonTxTotalBytes = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 6, 1, 2, 1, 5), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2EthPortMonTxTotalBytes.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2EthPortMonTxTotalBytes.setDescription('The total number of Bytes transmitted from this module.')
atiL2EthPortMonTxDeferred = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 6, 1, 2, 1, 6), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2EthPortMonTxDeferred.setStatus('deprecated')
if mibBuilder.loadTexts: atiL2EthPortMonTxDeferred.setDescription('This is the count of first time Transmission attempt which failed on an interface due to medium being busy.')
atiL2EthPortMonTxCollisions = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 6, 1, 2, 1, 7), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2EthPortMonTxCollisions.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2EthPortMonTxCollisions.setDescription('The total number of collisions while switching on an interface.')
atiL2EthPortMonTxBroadcastFrames = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 6, 1, 2, 1, 8), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2EthPortMonTxBroadcastFrames.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2EthPortMonTxBroadcastFrames.setDescription('The total number of Transmit Broadcast Frames on this port and Module while switching on an interface.')
atiL2EthPortMonTxMulticastFrames = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 6, 1, 2, 1, 9), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2EthPortMonTxMulticastFrames.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2EthPortMonTxMulticastFrames.setDescription('The total number of Transmit Multicast on this port and Module while switching on an interface.')
atiL2EthPortMonRxOverruns = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 6, 1, 2, 1, 10), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2EthPortMonRxOverruns.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2EthPortMonRxOverruns.setDescription('The total number of Recieved Overrun Frames on this port and Module while switching on an interface.')
atiL2EthErrStatsTable = MibTable((1, 3, 6, 1, 4, 1, 207, 8, 33, 6, 2, 1), )
if mibBuilder.loadTexts: atiL2EthErrStatsTable.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2EthErrStatsTable.setDescription('A list of statistics entries.')
atiL2EthErrorStatsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 207, 8, 33, 6, 2, 1, 1), ).setIndexNames((0, "AtiL2-MIB", "atiL2EthErrModuleId"))
if mibBuilder.loadTexts: atiL2EthErrorStatsEntry.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2EthErrorStatsEntry.setDescription('A collection of statistics kept for a particular port.')
atiL2EthErrModuleId = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 6, 2, 1, 1, 1), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2EthErrModuleId.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2EthErrModuleId.setDescription('This Object Identifies the Module Id for which the Statistics is collected.')
atiL2EthErrorCRC = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 6, 2, 1, 1, 2), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2EthErrorCRC.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2EthErrorCRC.setDescription('The total number of CRC errors on received packets.')
atiL2EthErrorAlignment = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 6, 2, 1, 1, 3), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2EthErrorAlignment.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2EthErrorAlignment.setDescription('The total number of packets received that has alignment errors.')
atiL2EthErrorRxBadFrames = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 6, 2, 1, 1, 4), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2EthErrorRxBadFrames.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2EthErrorRxBadFrames.setDescription('The counter is incremented when a bad frame was received.')
atiL2EthErrorLateCollisions = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 6, 2, 1, 1, 5), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2EthErrorLateCollisions.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2EthErrorLateCollisions.setDescription('This object counts the number of times the collison was detected in the port.')
atiL2EthErrorTxTotal = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 6, 2, 1, 1, 6), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2EthErrorTxTotal.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2EthErrorTxTotal.setDescription('Total number of error resulted from transfer operations.')
atiL2EthPortErrStatsTable = MibTable((1, 3, 6, 1, 4, 1, 207, 8, 33, 6, 2, 2), )
if mibBuilder.loadTexts: atiL2EthPortErrStatsTable.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2EthPortErrStatsTable.setDescription('A list of statistics entries.')
atiL2EthPortErrorStatsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 207, 8, 33, 6, 2, 2, 1), ).setIndexNames((0, "AtiL2-MIB", "atiL2EthPortErrModuleId"), (0, "AtiL2-MIB", "atiL2EthPortErrPortId"))
if mibBuilder.loadTexts: atiL2EthPortErrorStatsEntry.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2EthPortErrorStatsEntry.setDescription('A collection of statistics kept for a particular port.')
atiL2EthPortErrModuleId = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 6, 2, 2, 1, 1), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2EthPortErrModuleId.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2EthPortErrModuleId.setDescription('This Object Identifies the Module Id for which the Statistics is collected.')
atiL2EthPortErrPortId = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 6, 2, 2, 1, 2), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2EthPortErrPortId.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2EthPortErrPortId.setDescription('This Object Identifies the Port on the Module recognised by the above Object for which the Statistics is collected.')
atiL2EthPortErrorCRC = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 6, 2, 2, 1, 3), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2EthPortErrorCRC.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2EthPortErrorCRC.setDescription('The total number of CRC errors on received packets.')
atiL2EthPortErrorAlignment = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 6, 2, 2, 1, 4), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2EthPortErrorAlignment.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2EthPortErrorAlignment.setDescription('The total number of packets received that has alignment errors.')
atiL2EthPortErrorRxBadFrames = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 6, 2, 2, 1, 5), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2EthPortErrorRxBadFrames.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2EthPortErrorRxBadFrames.setDescription('The counter is incremented when a bad frame was received.')
atiL2EthPortErrorLateCollisions = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 6, 2, 2, 1, 6), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2EthPortErrorLateCollisions.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2EthPortErrorLateCollisions.setDescription('This object counts the number of times the collison was detected in the port.')
atiL2EthPortErrorTxTotal = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 6, 2, 2, 1, 7), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2EthPortErrorTxTotal.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2EthPortErrorTxTotal.setDescription('Total number of error resulted from transfer operations.')
atiL2DevicePortTable = MibTable((1, 3, 6, 1, 4, 1, 207, 8, 33, 7, 1), )
if mibBuilder.loadTexts: atiL2DevicePortTable.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2DevicePortTable.setDescription('Table of basic port configuration information.')
atiL2DevicePortEntry = MibTableRow((1, 3, 6, 1, 4, 1, 207, 8, 33, 7, 1, 1), ).setIndexNames((0, "AtiL2-MIB", "atiL2DeviceId"), (0, "AtiL2-MIB", "atiL2DevicePortNumber"))
if mibBuilder.loadTexts: atiL2DevicePortEntry.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2DevicePortEntry.setDescription('An entry in the port config table.')
atiL2DeviceId = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 7, 1, 1, 1), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2DeviceId.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2DeviceId.setDescription('This object identifies the Module Id of the switch Stack.')
atiL2DevicePortNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 7, 1, 1, 2), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2DevicePortNumber.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2DevicePortNumber.setDescription('This object identifies the Port on atiL2ModuleId of the switch Stack.')
atiL2DevicePortName = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 7, 1, 1, 3), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 20))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: atiL2DevicePortName.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2DevicePortName.setDescription('This attribute associates a user defined string name with the port.')
atiL2DevicePortAutosenseOrHalfDuplex = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 7, 1, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7))).clone(namedValues=NamedValues(("portAutoSense", 1), ("forceHalfDuplex-10M", 2), ("forceHalfDuplex-100M", 3), ("forceFullDuplex-10M", 4), ("forceFullDuplex-100M", 5), ("forceHalfDuplex-1G", 6), ("forceFullDuplex-1G", 7)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: atiL2DevicePortAutosenseOrHalfDuplex.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2DevicePortAutosenseOrHalfDuplex.setDescription('This attribute allows an administrative request to configure whether this port can Autosense or Force the Half Duplex or Full Duplex on different Port Speeds.')
atiL2DevicePortLinkState = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 7, 1, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("online", 1), ("offline", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2DevicePortLinkState.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2DevicePortLinkState.setDescription('This attribute allows an administrative request to read the status of link state on this port.')
atiL2DevicePortDuplexStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 7, 1, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("fullDuplex", 1), ("halfDuplex", 2), ("autosense", 3)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2DevicePortDuplexStatus.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2DevicePortDuplexStatus.setDescription('This attribute allows an administrative request to read the status of Duplex on this port.')
atiL2DevicePortSpeed = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 7, 1, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("tenMBits", 1), ("hundredMBits", 2), ("gigaBits", 3), ("unknown", 4)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2DevicePortSpeed.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2DevicePortSpeed.setDescription("This attribute allows an administrative request to read or write the speed of this port. This Object is valid only for 10/100Mbits and gigaBits ports. The only gigabit port that can be set is that of AT-A14 and it's values can be either 2 or 3.")
atiL2DevicePortState = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 7, 1, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2), ("blocking", 3), ("listening", 4), ("learning", 5)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: atiL2DevicePortState.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2DevicePortState.setDescription('This attribute allows an administrative request to disable or enable communications on this port.It also responds with the status of the port .Except enabled(1) and disabled(2), all values are read-only status.')
atiL2DevicePortTransmitPacingConfig = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 7, 1, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: atiL2DevicePortTransmitPacingConfig.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2DevicePortTransmitPacingConfig.setDescription('This Object is supported on at36XX product line Only. This attribute allows the transmit Pacing to be enabled or disabled.')
atiL2DevicePortSTPConfig = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 7, 1, 1, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: atiL2DevicePortSTPConfig.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2DevicePortSTPConfig.setDescription('This attribute allows a bridging Mode to be configured with either Spanning Tree enabled or disabled. When Spanning tree is enabled, make sure that this port is belonging to a valid Bridge_id. Spanning Tree is enabled only when a valid Bridge_id is set.')
atiL2DevicePortBridgeid = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 7, 1, 1, 11), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 64))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: atiL2DevicePortBridgeid.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2DevicePortBridgeid.setDescription(' The Bridge to which this port belongs to.')
atiL2DevicePortSTPCost = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 7, 1, 1, 12), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: atiL2DevicePortSTPCost.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2DevicePortSTPCost.setDescription('The Cost of the Spanning Tree Protocol.This object is valid only when STP is enabled.')
atiL2DevicePortSTPPriority = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 7, 1, 1, 13), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: atiL2DevicePortSTPPriority.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2DevicePortSTPPriority.setDescription(' The Priority of the spanning Tree Protocol. This object is valid when STP is enabled.')
atiL2DevicePortFlowControlEnable = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 7, 1, 1, 14), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("disable", 1), ("enable", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: atiL2DevicePortFlowControlEnable.setStatus('deprecated')
if mibBuilder.loadTexts: atiL2DevicePortFlowControlEnable.setDescription('This per-port attribute describes whether the port identified has flow Control Enabled or not. Flow Control on Full Duplex and Half Duplex is detected and automatically, flow control accordingly is taken care of. By Default, Flow Control is Disabled.')
atiL2DevicePortBackPressureEnable = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 7, 1, 1, 15), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("disable", 1), ("enable", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: atiL2DevicePortBackPressureEnable.setStatus('deprecated')
if mibBuilder.loadTexts: atiL2DevicePortBackPressureEnable.setDescription('This per-port attribute describes whether the port identified has Back Pressure Enabled or not. By Default, Back Pressure is Disabled.')
atiL2DevicePortVlanTagPriorityConfig = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 7, 1, 1, 16), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("use-vlan-priority", 1), ("override-vlan-priority", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: atiL2DevicePortVlanTagPriorityConfig.setStatus('deprecated')
if mibBuilder.loadTexts: atiL2DevicePortVlanTagPriorityConfig.setDescription('This per-port attribute allows the configuration of the Tag Priority to be Override or Use the Tag Priority. By Default, all ports use Vlan Tag priority.')
atiL2DevicePortQOSPriorityConfig = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 7, 1, 1, 17), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("high-priority", 1), ("normal-priority", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: atiL2DevicePortQOSPriorityConfig.setStatus('deprecated')
if mibBuilder.loadTexts: atiL2DevicePortQOSPriorityConfig.setDescription('This per-port attribute is applicable only to at-8324, at-8124XL-V2 and at-8316 and it allows for the configuration of the Priority of the port to be high or Low. In a switch environment, Ports with high Priority and traffic from and to the ports get more priority when compared with those with normal priority. By Default, all ports have Normal Priority.')
atiL2BasicVlanTable = MibTable((1, 3, 6, 1, 4, 1, 207, 8, 33, 8, 1), )
if mibBuilder.loadTexts: atiL2BasicVlanTable.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2BasicVlanTable.setDescription('Table of Virtual LAN configured.')
atiL2BasicVlanEntry = MibTableRow((1, 3, 6, 1, 4, 1, 207, 8, 33, 8, 1, 1), ).setIndexNames((0, "AtiL2-MIB", "atiL2BeVlanIndex"))
if mibBuilder.loadTexts: atiL2BasicVlanEntry.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2BasicVlanEntry.setDescription('An entry in the table, containing VLAN information.')
atiL2BeVlanIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 8, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 64))).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2BeVlanIndex.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2BeVlanIndex.setDescription('This object identifies the VLAN.')
atiL2BeVlanName = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 8, 1, 1, 2), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 20))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: atiL2BeVlanName.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2BeVlanName.setDescription("This attribute associates a user defined string with the Virtual LAN. To configure a new VLAN, do 'set' operation on this object with the VLAN name. To delete a VLAN, do 'set' operation with string '*<module_num>', where <module_num> is the module number (1..8) from which the delete request is being sent. If a vlan is being created or modified, before configuring any of the objects in this row, set atiL2VlanStatus to 'under-construction' and once configured with all the information, set the same object to operational. This step is not required when deleting a vlan.")
atiL2BeVlanTagId = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 8, 1, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 4095))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: atiL2BeVlanTagId.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2BeVlanTagId.setDescription("This object configures the VId in the Tag Information header in accordance with 802.1q spec. Before configuring any of the objects in this row , set the atiL2VlanStatus to 'under-construction' and once configured with all the information, please set the same object to operational.")
atiL2BeVlanModule1UntaggedPorts = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 8, 1, 1, 4), DisplayString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: atiL2BeVlanModule1UntaggedPorts.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2BeVlanModule1UntaggedPorts.setDescription("This Object builds the Output Ports on the Module that participate in the Vlan with the atiL2BeVlanName. The Format of the input string would be like '1,2,5,7,12..15,18-22,26'. Before configuring any of the objects in this row , set the atiL2VlanStatus to 'under-construction' and once configured with all the information, please set the same object to operational.")
atiL2BeVlanModule1TaggedPorts = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 8, 1, 1, 5), DisplayString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: atiL2BeVlanModule1TaggedPorts.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2BeVlanModule1TaggedPorts.setDescription("This Object builds the Output Ports on the Module atiL2BeVlanModuleId that participate in the Vlan with the atiL2BeVlanName. The Format of the input string would be like '1,2,5,7,12'. Please select the Module by setting the atiL2BeVlanModuleId with the Module Id and then set the port mask. If this is not set, by default this will be set to 1. Before configuring any of the objects in this row , set the atiL2VlanStatus to 'under-construction' and once configured with all the information, please set the same object to operational.")
atiL2BeVlanModule2UntaggedPorts = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 8, 1, 1, 6), DisplayString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: atiL2BeVlanModule2UntaggedPorts.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2BeVlanModule2UntaggedPorts.setDescription("This Object builds the Output Ports on the Module atiL2BeVlanModuleId that participate in the Vlan with the atiL2BeVlanName. The Format of the input string would be like '1,2,5,7,12'. Please select the Module by setting the atiL2BeVlanModuleId with the Module Id and then set the port mask. If this is not set, by default this will be set to 1. Before configuring any of the objects in this row , set the atiL2VlanStatus to 'under-construction' and once configured with all the information, please set the same object to operational.")
atiL2BeVlanModule2TaggedPorts = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 8, 1, 1, 7), DisplayString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: atiL2BeVlanModule2TaggedPorts.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2BeVlanModule2TaggedPorts.setDescription("This Object builds the Output Ports on the Module atiL2BeVlanModuleId that participate in the Vlan with the atiL2BeVlanName. The Format of the input string would be like '1,2,5,7,12'. Please select the Module by setting the atiL2BeVlanModuleId with the Module Id and then set the port mask. If this is not set, by default this will be set to 1. Before configuring any of the objects in this row , set the atiL2VlanStatus to 'under-construction' and once configured with all the information, please set the same object to operational.")
atiL2BeVlanModule3UntaggedPorts = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 8, 1, 1, 8), DisplayString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: atiL2BeVlanModule3UntaggedPorts.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2BeVlanModule3UntaggedPorts.setDescription("This Object builds the Output Ports on the Module atiL2BeVlanModuleId that participate in the Vlan with the atiL2BeVlanName. The Format of the input string would be like '1,2,5,7,12'. Please select the Module by setting the atiL2BeVlanModuleId with the Module Id and then set the port mask. If this is not set, by default this will be set to 1. Before configuring any of the objects in this row , set the atiL2VlanStatus to 'under-construction' and once configured with all the information, please set the same object to operational.")
atiL2BeVlanModule3TaggedPorts = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 8, 1, 1, 9), DisplayString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: atiL2BeVlanModule3TaggedPorts.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2BeVlanModule3TaggedPorts.setDescription("This Object builds the Output Ports on the Module atiL2BeVlanModuleId that participate in the Vlan with the atiL2BeVlanName. The Format of the input string would be like '1,2,5,7,12'. Please select the Module by setting the atiL2BeVlanModuleId with the Module Id and then set the port mask. If this is not set, by default this will be set to 1. Before configuring any of the objects in this row , set the atiL2VlanStatus to 'under-construction' and once configured with all the information, please set the same object to operational.")
atiL2BeVlanModule4UntaggedPorts = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 8, 1, 1, 10), DisplayString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: atiL2BeVlanModule4UntaggedPorts.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2BeVlanModule4UntaggedPorts.setDescription("This Object builds the Output Ports on the Module atiL2BeVlanModuleId that participate in the Vlan with the atiL2BeVlanName. The Format of the input string would be like '1,2,5,7,12'. Please select the Module by setting the atiL2BeVlanModuleId with the Module Id and then set the port mask. If this is not set, by default this will be set to 1. Before configuring any of the objects in this row , set the atiL2VlanStatus to 'under-construction' and once configured with all the information, please set the same object to operational.")
atiL2BeVlanModule4TaggedPorts = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 8, 1, 1, 11), DisplayString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: atiL2BeVlanModule4TaggedPorts.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2BeVlanModule4TaggedPorts.setDescription("This Object builds the Output Ports on the Module atiL2BeVlanModuleId that participate in the Vlan with the atiL2BeVlanName. The Format of the input string would be like '1,2,5,7,12'. Please select the Module by setting the atiL2BeVlanModuleId with the Module Id and then set the port mask. If this is not set, by default this will be set to 1. Before configuring any of the objects in this row , set the atiL2VlanStatus to 'under-construction' and once configured with all the information, please set the same object to operational.")
atiL2BeVlanModule5UntaggedPorts = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 8, 1, 1, 12), DisplayString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: atiL2BeVlanModule5UntaggedPorts.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2BeVlanModule5UntaggedPorts.setDescription("This Object builds the Output Ports on the Module atiL2BeVlanModuleId that participate in the Vlan with the atiL2BeVlanName. The Format of the input string would be like '1,2,5,7,12'. Please select the Module by setting the atiL2BeVlanModuleId with the Module Id and then set the port mask. If this is not set, by default this will be set to 1. Before configuring any of the objects in this row , set the atiL2VlanStatus to 'under-construction' and once configured with all the information, please set the same object to operational.")
atiL2BeVlanModule5TaggedPorts = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 8, 1, 1, 13), DisplayString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: atiL2BeVlanModule5TaggedPorts.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2BeVlanModule5TaggedPorts.setDescription("This Object builds the Output Ports on the Module atiL2BeVlanModuleId that participate in the Vlan with the atiL2BeVlanName. The Format of the input string would be like '1,2,5,7,12'. Please select the Module by setting the atiL2BeVlanModuleId with the Module Id and then set the port mask. If this is not set, by default this will be set to 1. Before configuring any of the objects in this row , set the atiL2VlanStatus to 'under-construction' and once configured with all the information, please set the same object to operational.")
atiL2BeVlanModule6UntaggedPorts = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 8, 1, 1, 14), DisplayString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: atiL2BeVlanModule6UntaggedPorts.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2BeVlanModule6UntaggedPorts.setDescription("This Object builds the Output Ports on the Module atiL2BeVlanModuleId that participate in the Vlan with the atiL2BeVlanName. The Format of the input string would be like '1,2,5,7,12'. Please select the Module by setting the atiL2BeVlanModuleId with the Module Id and then set the port mask. If this is not set, by default this will be set to 1. Before configuring any of the objects in this row , set the atiL2VlanStatus to 'under-construction' and once configured with all the information, please set the same object to operational.")
atiL2BeVlanModule6TaggedPorts = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 8, 1, 1, 15), DisplayString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: atiL2BeVlanModule6TaggedPorts.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2BeVlanModule6TaggedPorts.setDescription("This Object builds the Output Ports on the Module atiL2BeVlanModuleId that participate in the Vlan with the atiL2BeVlanName. The Format of the input string would be like '1,2,5,7,12'. Please select the Module by setting the atiL2BeVlanModuleId with the Module Id and then set the port mask. If this is not set, by default this will be set to 1. Before configuring any of the objects in this row , set the atiL2VlanStatus to 'under-construction' and once configured with all the information, please set the same object to operational.")
atiL2BeVlanModule7UntaggedPorts = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 8, 1, 1, 16), DisplayString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: atiL2BeVlanModule7UntaggedPorts.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2BeVlanModule7UntaggedPorts.setDescription("This Object builds the Output Ports on the Module atiL2BeVlanModuleId that participate in the Vlan with the atiL2BeVlanName. The Format of the input string would be like '1,2,5,7,12'. Please select the Module by setting the atiL2BeVlanModuleId with the Module Id and then set the port mask. If this is not set, by default this will be set to 1. Before configuring any of the objects in this row , set the atiL2VlanStatus to 'under-construction' and once configured with all the information, please set the same object to operational.")
atiL2BeVlanModule7TaggedPorts = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 8, 1, 1, 17), DisplayString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: atiL2BeVlanModule7TaggedPorts.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2BeVlanModule7TaggedPorts.setDescription("This Object builds the Output Ports on the Module atiL2BeVlanModuleId that participate in the Vlan with the atiL2BeVlanName. The Format of the input string would be like '1,2,5,7,12'. Please select the Module by setting the atiL2BeVlanModuleId with the Module Id and then set the port mask. If this is not set, by default this will be set to 1. Before configuring any of the objects in this row , set the atiL2VlanStatus to 'under-construction' and once configured with all the information, please set the same object to operational.")
atiL2BeVlanModule8UntaggedPorts = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 8, 1, 1, 18), DisplayString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: atiL2BeVlanModule8UntaggedPorts.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2BeVlanModule8UntaggedPorts.setDescription("This Object builds the Output Ports on the Module atiL2BeVlanModuleId that participate in the Vlan with the atiL2BeVlanName. The Format of the input string would be like '1,2,5,7,12'. Please select the Module by setting the atiL2BeVlanModuleId with the Module Id and then set the port mask. If this is not set, by default this will be set to 1. Before configuring any of the objects in this row , set the atiL2VlanStatus to 'under-construction' and once configured with all the information, please set the same object to operational.")
atiL2BeVlanModule8TaggedPorts = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 8, 1, 1, 19), DisplayString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: atiL2BeVlanModule8TaggedPorts.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2BeVlanModule8TaggedPorts.setDescription("This Object builds the Output Ports on the Module atiL2BeVlanModuleId that participate in the Vlan with the atiL2BeVlanName. The Format of the input string would be like '1,2,5,7,12'. Please select the Module by setting the atiL2BeVlanModuleId with the Module Id and then set the port mask. If this is not set, by default this will be set to 1. Before configuring any of the objects in this row , set the atiL2VlanStatus to 'under-construction' and once configured with all the information, please set the same object to operational.")
atiL2BeVlanRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 8, 1, 1, 20), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("idle", 1), ("operational", 2), ("under-construction", 3), ("not-operational", 4)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: atiL2BeVlanRowStatus.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2BeVlanRowStatus.setDescription('This object is used to create or modify a vlan. The user should first set this object to under-construction. After the vlan name, the tag Id and the ports belonging to the vlan are configured/modified, this object should be set to operational. If it is not set to operational, the whole row will be lost and the vlan will not be configured in the switch.')
atiL2Port2VlanTable = MibTable((1, 3, 6, 1, 4, 1, 207, 8, 33, 8, 2), )
if mibBuilder.loadTexts: atiL2Port2VlanTable.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2Port2VlanTable.setDescription('Table of per port Virtual LAN configuration.')
atiL2Port2VlanEntry = MibTableRow((1, 3, 6, 1, 4, 1, 207, 8, 33, 8, 2, 1), ).setIndexNames((0, "AtiL2-MIB", "atiL2PvModuleId"), (0, "AtiL2-MIB", "atiL2PvPortNumber"))
if mibBuilder.loadTexts: atiL2Port2VlanEntry.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2Port2VlanEntry.setDescription('An entry in the table, containing per port VLAN information.')
atiL2PvModuleId = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 8, 2, 1, 1), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2PvModuleId.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2PvModuleId.setDescription('This object identifies the Module Id on the switching Stack.')
atiL2PvPortNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 8, 2, 1, 2), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2PvPortNumber.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2PvPortNumber.setDescription('This object identifies the port on the Module atiL2PvModuleId .')
atiL2PvVlanName = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 8, 2, 1, 3), DisplayString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: atiL2PvVlanName.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2PvVlanName.setDescription('This attribute associates a user defined string with the Virtual LAN. This Object is the same as atiL2BeVlanName. Please make sure to give the same string as atiL2BeVlanName.')
atiL2IfExtensions = MibIdentifier((1, 3, 6, 1, 4, 1, 207, 8, 33, 9, 1))
atiIfExtnTable = MibTable((1, 3, 6, 1, 4, 1, 207, 8, 33, 9, 1, 1), )
if mibBuilder.loadTexts: atiIfExtnTable.setStatus('mandatory')
if mibBuilder.loadTexts: atiIfExtnTable.setDescription('A list of interface entries. The number of entries is given by the value of ifNumber.')
atiIfExtnEntry = MibTableRow((1, 3, 6, 1, 4, 1, 207, 8, 33, 9, 1, 1, 1), ).setIndexNames((0, "AtiL2-MIB", "atiIfExtnIndex"))
if mibBuilder.loadTexts: atiIfExtnEntry.setStatus('mandatory')
if mibBuilder.loadTexts: atiIfExtnEntry.setDescription('An interface entry containing objects at the subnetwork layer and below for a particular interface.')
atiIfExtnIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 9, 1, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 256))).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiIfExtnIndex.setStatus('mandatory')
if mibBuilder.loadTexts: atiIfExtnIndex.setDescription('A unique value for each interface corresponding to the ifIndex value for the same interface.')
atiIfExtnModuleId = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 9, 1, 1, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 8))).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiIfExtnModuleId.setStatus('mandatory')
if mibBuilder.loadTexts: atiIfExtnModuleId.setDescription('The unit number associated with this particular interface.')
atiIfExtnPort = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 9, 1, 1, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 32))).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiIfExtnPort.setStatus('mandatory')
if mibBuilder.loadTexts: atiIfExtnPort.setDescription('The port number within a unit or slot.')
atiL2BrBaseTable = MibTable((1, 3, 6, 1, 4, 1, 207, 8, 33, 10, 1, 1), )
if mibBuilder.loadTexts: atiL2BrBaseTable.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2BrBaseTable.setDescription('Table of basic bridge information.')
atiL2BrBaseEntry = MibTableRow((1, 3, 6, 1, 4, 1, 207, 8, 33, 10, 1, 1, 1), ).setIndexNames((0, "AtiL2-MIB", "atiL2BrBaseLanId"))
if mibBuilder.loadTexts: atiL2BrBaseEntry.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2BrBaseEntry.setDescription('An entry in the atiL2BrBaseTable.')
atiL2BrBaseLanId = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 10, 1, 1, 1, 1), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2BrBaseLanId.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2BrBaseLanId.setDescription('This object uniquely identifies the lan or Virtual lan.')
atiL2BrBaseBridgeAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 10, 1, 1, 1, 2), MacAddress()).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2BrBaseBridgeAddress.setReference('IEEE 802.1D-1990: Sections 6.4.1.1.3 and 3.12.5')
if mibBuilder.loadTexts: atiL2BrBaseBridgeAddress.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2BrBaseBridgeAddress.setDescription('The MAC address used by this bridge when it must be referred to in a unique fashion. It is recommended that this be the numerically smallest MAC address of all ports that belong to this bridge. However it is only required to be unique. When concatenated with atiL2BrStpPriority a unique BridgeIdentifier is formed which is used in the Spanning Tree Protocol.')
atiL2BrBaseNumPorts = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 10, 1, 1, 1, 3), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2BrBaseNumPorts.setReference('IEEE 802.1D-1990: Section 6.4.1.1.3')
if mibBuilder.loadTexts: atiL2BrBaseNumPorts.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2BrBaseNumPorts.setDescription('The number of ports controlled by this bridging entity.')
atiL2BrBaseType = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 10, 1, 1, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("unknown", 1), ("transparent-only", 2), ("sourceroute-only", 3), ("srt", 4)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2BrBaseType.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2BrBaseType.setDescription('Indicates what type of bridging this bridge can perform. If a bridge is actually performing a certain type of bridging this will be indicated by entries in the port table for the given type.')
atiL2BrBasePortTable = MibTable((1, 3, 6, 1, 4, 1, 207, 8, 33, 10, 1, 4), )
if mibBuilder.loadTexts: atiL2BrBasePortTable.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2BrBasePortTable.setDescription('A table that contains generic information about every port that is associated with this bridge. Transparent, source-route, and srt ports are included.')
atiL2BrBasePortEntry = MibTableRow((1, 3, 6, 1, 4, 1, 207, 8, 33, 10, 1, 4, 1), ).setIndexNames((0, "AtiL2-MIB", "atiL2BrBasePortLanId"), (0, "AtiL2-MIB", "atiL2BrBasePort"))
if mibBuilder.loadTexts: atiL2BrBasePortEntry.setReference('IEEE 802.1D-1990: Section 6.4.2, 6.6.1')
if mibBuilder.loadTexts: atiL2BrBasePortEntry.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2BrBasePortEntry.setDescription('A list of information for each port of the bridge.')
atiL2BrBasePortLanId = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 10, 1, 4, 1, 1), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2BrBasePortLanId.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2BrBasePortLanId.setDescription('This object uniquely identifies the lan or Virtual lan.')
atiL2BrBasePort = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 10, 1, 4, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2BrBasePort.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2BrBasePort.setDescription('The port number of the port for which this entry contains bridge management information.')
atiL2BrBasePortIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 10, 1, 4, 1, 3), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2BrBasePortIfIndex.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2BrBasePortIfIndex.setDescription('The value of the instance of the ifIndex object, defined in MIB-II, for the interface corresponding to this port.')
atiL2BrBasePortCircuit = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 10, 1, 4, 1, 4), ObjectIdentifier()).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2BrBasePortCircuit.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2BrBasePortCircuit.setDescription('For a port which (potentially) has the same value of atiL2BrBasePortIfIndex as another port on the same bridge, this object contains the name of an object instance unique to this port. For example, in the case where multiple ports correspond one- to-one with multiple X.25 virtual circuits, this value might identify an (e.g., the first) object instance associated with the X.25 virtual circuit corresponding to this port. For a port which has a unique value of atiL2BrBasePortIfIndex, this object can have the value { 0 0 }.')
atiL2BrBasePortDelayExceededDiscards = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 10, 1, 4, 1, 5), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2BrBasePortDelayExceededDiscards.setReference('IEEE 802.1D-1990: Section 6.6.1.1.3')
if mibBuilder.loadTexts: atiL2BrBasePortDelayExceededDiscards.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2BrBasePortDelayExceededDiscards.setDescription('The number of frames discarded by this port due to excessive transit delay through the bridge. It is incremented by both transparent and source route bridges.')
atiL2BrBasePortMtuExceededDiscards = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 10, 1, 4, 1, 6), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2BrBasePortMtuExceededDiscards.setReference('IEEE 802.1D-1990: Section 6.6.1.1.3')
if mibBuilder.loadTexts: atiL2BrBasePortMtuExceededDiscards.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2BrBasePortMtuExceededDiscards.setDescription('The number of frames discarded by this port due to an excessive size. It is incremented by both transparent and source route bridges.')
atiL2BrStpTable = MibTable((1, 3, 6, 1, 4, 1, 207, 8, 33, 10, 2, 1), )
if mibBuilder.loadTexts: atiL2BrStpTable.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2BrStpTable.setDescription('Table of bridge spanning tree information.')
atiL2BrStpEntry = MibTableRow((1, 3, 6, 1, 4, 1, 207, 8, 33, 10, 2, 1, 1), ).setIndexNames((0, "AtiL2-MIB", "atiL2BrStpLanId"))
if mibBuilder.loadTexts: atiL2BrStpEntry.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2BrStpEntry.setDescription('An entry in the atiL2BrStpTable.')
atiL2BrStpLanId = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 10, 2, 1, 1, 1), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2BrStpLanId.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2BrStpLanId.setDescription('This object uniquely identifies the lan or Virtual lan.')
atiL2BrStpProtocolSpecification = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 10, 2, 1, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("unknown", 1), ("decLb100", 2), ("ieee8021d", 3)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2BrStpProtocolSpecification.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2BrStpProtocolSpecification.setDescription("An indication of what version of the Spanning Tree Protocol is being run. The value 'decLb100(2)' indicates the DEC LANbridge 100 Spanning Tree protocol. IEEE 802.1d implementations will return 'ieee8021d(3)'. If future versions of the IEEE Spanning Tree Protocol are released that are incompatible with the current version a new value will be defined.")
atiL2BrStpPriority = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 10, 2, 1, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: atiL2BrStpPriority.setReference('IEEE 802.1D-1990: Section 4.5.3.7')
if mibBuilder.loadTexts: atiL2BrStpPriority.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2BrStpPriority.setDescription('The value of the write-able portion of the Bridge ID, i.e., the first two octets of the (8 octet long) Bridge ID. The other (last) 6 octets of the Bridge ID are given by the value of atiL2BrBaseBridgeAddress.')
atiL2BrStpTimeSinceTopologyChange = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 10, 2, 1, 1, 4), TimeTicks()).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2BrStpTimeSinceTopologyChange.setReference('IEEE 802.1D-1990: Section 6.8.1.1.3')
if mibBuilder.loadTexts: atiL2BrStpTimeSinceTopologyChange.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2BrStpTimeSinceTopologyChange.setDescription('The time (in hundredths of a second) since the last time a topology change was detected by the bridge entity.')
atiL2BrStpTopChanges = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 10, 2, 1, 1, 5), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2BrStpTopChanges.setReference('IEEE 802.1D-1990: Section 6.8.1.1.3')
if mibBuilder.loadTexts: atiL2BrStpTopChanges.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2BrStpTopChanges.setDescription('The total number of topology changes detected by this bridge since the management entity was last reset or initialized.')
atiL2BrStpDesignatedRoot = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 10, 2, 1, 1, 6), BridgeId()).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2BrStpDesignatedRoot.setReference('IEEE 802.1D-1990: Section 4.5.3.1')
if mibBuilder.loadTexts: atiL2BrStpDesignatedRoot.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2BrStpDesignatedRoot.setDescription('The bridge identifier of the root of the spanning tree as determined by the Spanning Tree Protocol as executed by this node. This value is used as the Root Identifier parameter in all Configuration Bridge PDUs originated by this node.')
atiL2BrStpRootCost = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 10, 2, 1, 1, 7), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2BrStpRootCost.setReference('IEEE 802.1D-1990: Section 4.5.3.2')
if mibBuilder.loadTexts: atiL2BrStpRootCost.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2BrStpRootCost.setDescription('The cost of the path to the root as seen from this bridge.')
atiL2BrStpRootPort = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 10, 2, 1, 1, 8), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2BrStpRootPort.setReference('IEEE 802.1D-1990: Section 4.5.3.3')
if mibBuilder.loadTexts: atiL2BrStpRootPort.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2BrStpRootPort.setDescription('The port number of the port which offers the lowest cost path from this bridge to the root bridge.')
atiL2BrStpMaxAge = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 10, 2, 1, 1, 9), Timeout()).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2BrStpMaxAge.setReference('IEEE 802.1D-1990: Section 4.5.3.4')
if mibBuilder.loadTexts: atiL2BrStpMaxAge.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2BrStpMaxAge.setDescription('The maximum age of Spanning Tree Protocol information learned from the network on any port before it is discarded, in units of hundredths of a second. This is the actual value that this bridge is currently using.')
atiL2BrStpHelloTime = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 10, 2, 1, 1, 10), Timeout()).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2BrStpHelloTime.setReference('IEEE 802.1D-1990: Section 4.5.3.5')
if mibBuilder.loadTexts: atiL2BrStpHelloTime.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2BrStpHelloTime.setDescription('The amount of time between the transmission of Configuration bridge PDUs by this node on any port when it is the root of the spanning tree or trying to become so, in units of hundredths of a second. This is the actual value that this bridge is currently using.')
atiL2BrStpHoldTime = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 10, 2, 1, 1, 11), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2BrStpHoldTime.setReference('IEEE 802.1D-1990: Section 4.5.3.14')
if mibBuilder.loadTexts: atiL2BrStpHoldTime.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2BrStpHoldTime.setDescription('This time value determines the interval length during which no more than two Configuration bridge PDUs shall be transmitted by this node, in units of hundredths of a second.')
atiL2BrStpForwardDelay = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 10, 2, 1, 1, 12), Timeout()).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2BrStpForwardDelay.setReference('IEEE 802.1D-1990: Section 4.5.3.6')
if mibBuilder.loadTexts: atiL2BrStpForwardDelay.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2BrStpForwardDelay.setDescription('This time value, measured in units of hundredths of a second, controls how fast a port changes its spanning state when moving towards the Forwarding state. The value determines how long the port stays in each of the Listening and Learning states, which precede the Forwarding state. This value is also used, when a topology change has been detected and is underway, to age all dynamic entries in the Forwarding Database. [Note that this value is the one that this bridge is currently using, in contrast to atiL2BrStpBridgeForwardDelay which is the value that this bridge and all others would start using if/when this bridge were to become the root.]')
atiL2BrStpBridgeMaxAge = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 10, 2, 1, 1, 13), Timeout().subtype(subtypeSpec=ValueRangeConstraint(600, 4000))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: atiL2BrStpBridgeMaxAge.setReference('IEEE 802.1D-1990: Section 4.5.3.8')
if mibBuilder.loadTexts: atiL2BrStpBridgeMaxAge.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2BrStpBridgeMaxAge.setDescription('The value that all bridges use for MaxAge when this bridge is acting as the root. Note that 802.1D-1990 specifies that the range for this parameter is related to the value of atiL2BrStpBridgeHelloTime. The granularity of this timer is specified by 802.1D-1990 to be 1 second. An agent may return a badValue error if a set is attempted to a value which is not a whole number of seconds.')
atiL2BrStpBridgeHelloTime = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 10, 2, 1, 1, 14), Timeout().subtype(subtypeSpec=ValueRangeConstraint(100, 1000))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: atiL2BrStpBridgeHelloTime.setReference('IEEE 802.1D-1990: Section 4.5.3.9')
if mibBuilder.loadTexts: atiL2BrStpBridgeHelloTime.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2BrStpBridgeHelloTime.setDescription('The value that all bridges use for HelloTime when this bridge is acting as the root. The granularity of this timer is specified by 802.1D- 1990 to be 1 second. An agent may return a badValue error if a set is attempted to a value which is not a whole number of seconds.')
atiL2BrStpBridgeForwardDelay = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 10, 2, 1, 1, 15), Timeout().subtype(subtypeSpec=ValueRangeConstraint(400, 3000))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: atiL2BrStpBridgeForwardDelay.setReference('IEEE 802.1D-1990: Section 4.5.3.10')
if mibBuilder.loadTexts: atiL2BrStpBridgeForwardDelay.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2BrStpBridgeForwardDelay.setDescription('The value that all bridges use for ForwardDelay when this bridge is acting as the root. Note that 802.1D-1990 specifies that the range for this parameter is related to the value of atiL2BrStpBridgeMaxAge. The granularity of this timer is specified by 802.1D-1990 to be 1 second. An agent may return a badValue error if a set is attempted to a value which is not a whole number of seconds.')
atiL2BrStpPortTable = MibTable((1, 3, 6, 1, 4, 1, 207, 8, 33, 10, 2, 15), )
if mibBuilder.loadTexts: atiL2BrStpPortTable.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2BrStpPortTable.setDescription('A table that contains port-specific information for the Spanning Tree Protocol.')
atiL2BrStpPortEntry = MibTableRow((1, 3, 6, 1, 4, 1, 207, 8, 33, 10, 2, 15, 1), ).setIndexNames((0, "AtiL2-MIB", "atiL2BrStpPortLanId"), (0, "AtiL2-MIB", "atiL2BrStpPort"))
if mibBuilder.loadTexts: atiL2BrStpPortEntry.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2BrStpPortEntry.setDescription('A list of information maintained by every port about the Spanning Tree Protocol state for that port.')
atiL2BrStpPortLanId = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 10, 2, 15, 1, 1), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2BrStpPortLanId.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2BrStpPortLanId.setDescription('This object uniquely identifies the lan or Virtual lan.')
atiL2BrStpPort = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 10, 2, 15, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2BrStpPort.setReference('IEEE 802.1D-1990: Section 6.8.2.1.2')
if mibBuilder.loadTexts: atiL2BrStpPort.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2BrStpPort.setDescription('The port number of the port for which this entry contains Spanning Tree Protocol management information.')
atiL2BrStpPortPriority = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 10, 2, 15, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: atiL2BrStpPortPriority.setReference('IEEE 802.1D-1990: Section 4.5.5.1')
if mibBuilder.loadTexts: atiL2BrStpPortPriority.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2BrStpPortPriority.setDescription('The value of the priority field which is contained in the first (in network byte order) octet of the (2 octet long) Port ID. The other octet of the Port ID is given by the value of atiL2BrStpPort.')
atiL2BrStpPortState = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 10, 2, 15, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6))).clone(namedValues=NamedValues(("disabled", 1), ("blocking", 2), ("listening", 3), ("learning", 4), ("forwarding", 5), ("broken", 6)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2BrStpPortState.setReference('IEEE 802.1D-1990: Section 4.5.5.2')
if mibBuilder.loadTexts: atiL2BrStpPortState.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2BrStpPortState.setDescription("The port's current state as defined by application of the Spanning Tree Protocol. This state controls what action a port takes on reception of a frame. If the bridge has detected a port that is malfunctioning it will place that port into the broken(6) state. For ports which are disabled (see atiL2BrStpPortEnable), this object will have a value of disabled(1).")
atiL2BrStpPortEnable = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 10, 2, 15, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: atiL2BrStpPortEnable.setReference('IEEE 802.1D-1990: Section 4.5.5.2')
if mibBuilder.loadTexts: atiL2BrStpPortEnable.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2BrStpPortEnable.setDescription('The enabled/disabled status of the port.')
atiL2BrStpPortPathCost = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 10, 2, 15, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: atiL2BrStpPortPathCost.setReference('IEEE 802.1D-1990: Section 4.5.5.3')
if mibBuilder.loadTexts: atiL2BrStpPortPathCost.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2BrStpPortPathCost.setDescription('The contribution of this port to the path cost of paths towards the spanning tree root which include this port. 802.1D-1990 recommends that the default value of this parameter be in inverse proportion to the speed of the attached LAN.')
atiL2BrStpPortDesignatedRoot = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 10, 2, 15, 1, 7), BridgeId()).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2BrStpPortDesignatedRoot.setReference('IEEE 802.1D-1990: Section 4.5.5.4')
if mibBuilder.loadTexts: atiL2BrStpPortDesignatedRoot.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2BrStpPortDesignatedRoot.setDescription('The unique Bridge Identifier of the Bridge recorded as the Root in the Configuration BPDUs transmitted by the Designated Bridge for the segment to which the port is attached.')
atiL2BrStpPortDesignatedCost = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 10, 2, 15, 1, 8), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2BrStpPortDesignatedCost.setReference('IEEE 802.1D-1990: Section 4.5.5.5')
if mibBuilder.loadTexts: atiL2BrStpPortDesignatedCost.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2BrStpPortDesignatedCost.setDescription('The path cost of the Designated Port of the segment connected to this port. This value is compared to the Root Path Cost field in received bridge PDUs.')
atiL2BrStpPortDesignatedBridge = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 10, 2, 15, 1, 9), BridgeId()).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2BrStpPortDesignatedBridge.setReference('IEEE 802.1D-1990: Section 4.5.5.6')
if mibBuilder.loadTexts: atiL2BrStpPortDesignatedBridge.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2BrStpPortDesignatedBridge.setDescription("The Bridge Identifier of the bridge which this port considers to be the Designated Bridge for this port's segment.")
atiL2BrStpPortDesignatedPort = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 10, 2, 15, 1, 10), OctetString().subtype(subtypeSpec=ValueSizeConstraint(2, 2)).setFixedLength(2)).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2BrStpPortDesignatedPort.setReference('IEEE 802.1D-1990: Section 4.5.5.7')
if mibBuilder.loadTexts: atiL2BrStpPortDesignatedPort.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2BrStpPortDesignatedPort.setDescription("The Port Identifier of the port on the Designated Bridge for this port's segment.")
atiL2BrStpPortForwardTransitions = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 10, 2, 15, 1, 11), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2BrStpPortForwardTransitions.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2BrStpPortForwardTransitions.setDescription('The number of times this port has transitioned from the Learning state to the Forwarding state.')
atiL2BrTpTable = MibTable((1, 3, 6, 1, 4, 1, 207, 8, 33, 10, 3, 1), )
if mibBuilder.loadTexts: atiL2BrTpTable.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2BrTpTable.setDescription('Table of transparent bridging information.')
atiL2BrTpEntry = MibTableRow((1, 3, 6, 1, 4, 1, 207, 8, 33, 10, 3, 1, 1), ).setIndexNames((0, "AtiL2-MIB", "atiL2BrTpLanId"))
if mibBuilder.loadTexts: atiL2BrTpEntry.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2BrTpEntry.setDescription('An entry in the atiL2BrTpTable.')
atiL2BrTpLanId = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 10, 3, 1, 1, 1), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2BrTpLanId.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2BrTpLanId.setDescription('This object uniquely identifies the lan or Virtual lan.')
atiL2BrTpLearnedEntryDiscards = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 10, 3, 1, 1, 2), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2BrTpLearnedEntryDiscards.setReference('IEEE 802.1D-1990: Section 6.7.1.1.3')
if mibBuilder.loadTexts: atiL2BrTpLearnedEntryDiscards.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2BrTpLearnedEntryDiscards.setDescription('The total number of Forwarding Database entries, which have been or would have been learnt, but have been discarded due to a lack of space to store them in the Forwarding Database. If this counter is increasing, it indicates that the Forwarding Database is regularly becoming full (a condition which has unpleasant performance effects on the subnetwork). If this counter has a significant value but is not presently increasing, it indicates that the problem has been occurring but is not persistent.')
atiL2BrTpAgingTime = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 10, 3, 1, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(10, 1000000))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: atiL2BrTpAgingTime.setReference('IEEE 802.1D-1990: Section 6.7.1.1.3')
if mibBuilder.loadTexts: atiL2BrTpAgingTime.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2BrTpAgingTime.setDescription('The timeout period in seconds for aging out dynamically learned forwarding information. 802.1D-1990 recommends a default of 300 seconds.')
atiL2BrTpFdbTable = MibTable((1, 3, 6, 1, 4, 1, 207, 8, 33, 10, 3, 3), )
if mibBuilder.loadTexts: atiL2BrTpFdbTable.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2BrTpFdbTable.setDescription('A table that contains information about unicast entries for which the bridge has forwarding and/or filtering information. This information is used by the transparent bridging function in determining how to propagate a received frame.')
atiL2BrTpFdbEntry = MibTableRow((1, 3, 6, 1, 4, 1, 207, 8, 33, 10, 3, 3, 1), ).setIndexNames((0, "AtiL2-MIB", "atiL2BrTpFdbLanId"), (0, "AtiL2-MIB", "atiL2BrTpFdbAddress"))
if mibBuilder.loadTexts: atiL2BrTpFdbEntry.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2BrTpFdbEntry.setDescription('Information about a specific unicast MAC address for which the bridge has some forwarding and/or filtering information.')
atiL2BrTpFdbLanId = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 10, 3, 3, 1, 1), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2BrTpFdbLanId.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2BrTpFdbLanId.setDescription('This object uniquely identifies the lan or Virtual lan.')
atiL2BrTpFdbAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 10, 3, 3, 1, 2), MacAddress()).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2BrTpFdbAddress.setReference('IEEE 802.1D-1990: Section 3.9.1, 3.9.2')
if mibBuilder.loadTexts: atiL2BrTpFdbAddress.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2BrTpFdbAddress.setDescription('A unicast MAC address for which the bridge has forwarding and/or filtering information.')
atiL2BrTpFdbPort = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 10, 3, 3, 1, 3), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2BrTpFdbPort.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2BrTpFdbPort.setDescription("Either the value '0', or the port number of the port on which a frame having a source address equal to the value of the corresponding instance of atiL2BrTpFdbAddress has been seen. A value of '0' indicates that the port number has not been learned but that the bridge does have some forwarding/filtering information about this address . Implementors are encouraged to assign the port value to this object whenever it is learned even for addresses for which the corresponding value of atiL2BrTpFdbStatus is not learned(3).")
atiL2BrTpFdbStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 10, 3, 3, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("inactive", 1), ("active", 2), ("other", 3)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2BrTpFdbStatus.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2BrTpFdbStatus.setDescription('The status of this entry. The meanings of the values are: inactive(1) : this entry is not longer valid (e.g., it was learned but has since aged-out), but has not yet been flushed from the table. active(2) : the value of the corresponding instance of atiL2BrTpFdbPort was active, and is being used. other(3) : none of the following. This would include the case where some other MIB object (not the corresponding instance of atiL2BrTpFdbPort ) is being used to determine if and how frames addressed to the value of the corresponding instance of atiL2BrTpFdbAddress are being forwarded.')
atiL2BrTpPortTable = MibTable((1, 3, 6, 1, 4, 1, 207, 8, 33, 10, 3, 4), )
if mibBuilder.loadTexts: atiL2BrTpPortTable.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2BrTpPortTable.setDescription('A table that contains information about every port that is associated with this transparent bridge.')
atiL2BrTpPortEntry = MibTableRow((1, 3, 6, 1, 4, 1, 207, 8, 33, 10, 3, 4, 1), ).setIndexNames((0, "AtiL2-MIB", "atiL2BrTpPortLanId"), (0, "AtiL2-MIB", "atiL2BrTpPort"))
if mibBuilder.loadTexts: atiL2BrTpPortEntry.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2BrTpPortEntry.setDescription('A list of information for each port of a transparent bridge.')
atiL2BrTpPortLanId = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 10, 3, 4, 1, 1), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2BrTpPortLanId.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2BrTpPortLanId.setDescription('This object uniquely identifies the lan or Virtual lan.')
atiL2BrTpPort = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 10, 3, 4, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2BrTpPort.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2BrTpPort.setDescription('The port number of the port for which this entry contains Transparent bridging management information.')
atiL2BrTpPortMaxInfo = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 10, 3, 4, 1, 3), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2BrTpPortMaxInfo.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2BrTpPortMaxInfo.setDescription('The maximum size of the INFO (non-MAC) field that this port will receive or transmit.')
atiL2BrTpPortInFrames = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 10, 3, 4, 1, 4), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2BrTpPortInFrames.setReference('IEEE 802.1D-1990: Section 6.6.1.1.3')
if mibBuilder.loadTexts: atiL2BrTpPortInFrames.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2BrTpPortInFrames.setDescription('The number of frames that have been received by this port from its segment. Note that a frame received on the interface corresponding to this port is only counted by this object if and only if it is for a protocol being processed by the local bridging function, including bridge management frames.')
atiL2BrTpPortOutFrames = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 10, 3, 4, 1, 5), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2BrTpPortOutFrames.setReference('IEEE 802.1D-1990: Section 6.6.1.1.3')
if mibBuilder.loadTexts: atiL2BrTpPortOutFrames.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2BrTpPortOutFrames.setDescription('The number of frames that have been transmitted by this port to its segment. Note that a frame transmitted on the interface corresponding to this port is only counted by this object if and only if it is for a protocol being processed by the local bridging function, including bridge management frames.')
atiL2BrTpPortInDiscards = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 10, 3, 4, 1, 6), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2BrTpPortInDiscards.setReference('IEEE 802.1D-1990: Section 6.6.1.1.3')
if mibBuilder.loadTexts: atiL2BrTpPortInDiscards.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2BrTpPortInDiscards.setDescription('Count of valid frames received which were discarded (i.e., filtered) by the Forwarding Process.')
atiL2TrapAttrModuleId = MibScalar((1, 3, 6, 1, 4, 1, 207, 8, 33, 11, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 8)))
if mibBuilder.loadTexts: atiL2TrapAttrModuleId.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2TrapAttrModuleId.setDescription('This attribute is the Module Numver used when Traps pertinent to Module is sent.')
atiL2TrapAttrPortId = MibScalar((1, 3, 6, 1, 4, 1, 207, 8, 33, 11, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 32)))
if mibBuilder.loadTexts: atiL2TrapAttrPortId.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2TrapAttrPortId.setDescription('This attribute is the Port Number used when Traps pertinent to Ports are sent.')
newRoot = NotificationType((1, 3, 6, 1, 4, 1, 207) + (0,101))
if mibBuilder.loadTexts: newRoot.setDescription('The newRoot trap indicates that the sending agent has become the new root of the Spanning Tree; the trap is sent by a bridge soon after its election as the new root, e.g., upon expiration of the Topology Change Timer immediately subsequent to its election. Implementation of this trap is optional.')
topologyChange = NotificationType((1, 3, 6, 1, 4, 1, 207) + (0,102))
if mibBuilder.loadTexts: topologyChange.setDescription('A topologyChange trap is sent by a bridge when any of its configured ports transitions from the Learning state to the Forwarding state, or from the Forwarding state to the Blocking state. The trap is not sent if a newRoot trap is sent for the same transition. Implementation of this trap is optional.')
atiL2FanStopTrap = NotificationType((1, 3, 6, 1, 4, 1, 207) + (0,103)).setObjects(("AtiL2-MIB", "atiL2TrapAttrModuleId"))
if mibBuilder.loadTexts: atiL2FanStopTrap.setDescription(' A Trap sent from the Module defined by the varable above when a fan from that Module stops.')
atiL2TemperatureAbnormalTrap = NotificationType((1, 3, 6, 1, 4, 1, 207) + (0,104)).setObjects(("AtiL2-MIB", "atiL2TrapAttrModuleId"))
if mibBuilder.loadTexts: atiL2TemperatureAbnormalTrap.setDescription(' A Trap sent from the Module defined by the varable above when temperature of the Module is abnormal.')
atiL2PowerSupplyOutage = NotificationType((1, 3, 6, 1, 4, 1, 207) + (0,105)).setObjects(("AtiL2-MIB", "atiL2TrapAttrModuleId"))
if mibBuilder.loadTexts: atiL2PowerSupplyOutage.setDescription(' A Trap sent from the Module defined by the varable above when one of the power supply goes down.')
atiL2IntruderAlert = NotificationType((1, 3, 6, 1, 4, 1, 207) + (0,106)).setObjects(("AtiL2-MIB", "atiL2TrapAttrModuleId"), ("AtiL2-MIB", "atiL2TrapAttrPortId"))
if mibBuilder.loadTexts: atiL2IntruderAlert.setDescription(' A Trap sent from the specified module and specified port when an intruder has been detected.')
atiL2QOSStatus = MibScalar((1, 3, 6, 1, 4, 1, 207, 8, 33, 12, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: atiL2QOSStatus.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2QOSStatus.setDescription('If the QOS status is enabled, then QOS packets will be assigned to high or low priority queue. If it is disabled, packets works normally.(Applicable only to at-8326GB, at-9410GB and at-8350GB)')
atiL2TrafficMappingTable = MibTable((1, 3, 6, 1, 4, 1, 207, 8, 33, 12, 2), )
if mibBuilder.loadTexts: atiL2TrafficMappingTable.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2TrafficMappingTable.setDescription('It contains the mapping of all traffic classes and their priority assignments.(Applicable only to at-8326GB, at-9410GB and at-8350GB)')
atiL2TrafficMappingEntry = MibTableRow((1, 3, 6, 1, 4, 1, 207, 8, 33, 12, 2, 1), ).setIndexNames((0, "AtiL2-MIB", "atiL2TrafficClassIndex"))
if mibBuilder.loadTexts: atiL2TrafficMappingEntry.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2TrafficMappingEntry.setDescription("Each entry maps a traffic class to the priority queue to be used for it's packets. (Applicable only to at-8326GB, at-9410GB and at-8350GB)")
atiL2TrafficClassIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 12, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 7))).setMaxAccess("readonly")
if mibBuilder.loadTexts: atiL2TrafficClassIndex.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2TrafficClassIndex.setDescription('The Index of the traffic class. It is obtained from the packet format.(Applicable only to at-8326GB, at-9410GB and at-8350GB)')
atiL2PriorityQueue = MibTableColumn((1, 3, 6, 1, 4, 1, 207, 8, 33, 12, 2, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("highest", 0), ("lowest", 1)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: atiL2PriorityQueue.setStatus('mandatory')
if mibBuilder.loadTexts: atiL2PriorityQueue.setDescription('The priority queue to be used to forward packets. (Applicable only to at-8326GB, at-9410GB and at-8350GB)')
mibBuilder.exportSymbols("AtiL2-MIB", atiL2DHCPGroup=atiL2DHCPGroup, atiL2BrStp=atiL2BrStp, atiL2BeVlanModule6UntaggedPorts=atiL2BeVlanModule6UntaggedPorts, atiL2BrTpPortLanId=atiL2BrTpPortLanId, atiL2PriorityQueue=atiL2PriorityQueue, atiL2EthErrorStatsEntry=atiL2EthErrorStatsEntry, atiL2EthMonTxBroadcastFrames=atiL2EthMonTxBroadcastFrames, atiL2FanStopTrap=atiL2FanStopTrap, atiL2BrStpPortTable=atiL2BrStpPortTable, atiL2EthPortMonModuleId=atiL2EthPortMonModuleId, atiL2deviceIndex=atiL2deviceIndex, atiL2EthPortMonTxMulticastFrames=atiL2EthPortMonTxMulticastFrames, atiL2EthPortErrorCRC=atiL2EthPortErrorCRC, atiL2BrStpTopChanges=atiL2BrStpTopChanges, atiL2BrTpPortEntry=atiL2BrTpPortEntry, atiL2BrStpBridgeHelloTime=atiL2BrStpBridgeHelloTime, atiL2BrTpPortInDiscards=atiL2BrTpPortInDiscards, atiL2DevicePortAutosenseOrHalfDuplex=atiL2DevicePortAutosenseOrHalfDuplex, atiL2TrafficMappingEntry=atiL2TrafficMappingEntry, atiIfExtnModuleId=atiIfExtnModuleId, atiL2DHCPLeaseTimer=atiL2DHCPLeaseTimer, atiL2BrTpLearnedEntryDiscards=atiL2BrTpLearnedEntryDiscards, atiL2DevicePortEntry=atiL2DevicePortEntry, atiL2DevicePortState=atiL2DevicePortState, atiL2EthPortErrorStatsEntry=atiL2EthPortErrorStatsEntry, atiL2DevicePortVlanTagPriorityConfig=atiL2DevicePortVlanTagPriorityConfig, atiL2BrStpDesignatedRoot=atiL2BrStpDesignatedRoot, atiL2EthPortMonRxGoodFrames=atiL2EthPortMonRxGoodFrames, at_8316F=at_8316F, atiL2SwVersion=atiL2SwVersion, atiL2DHCPSysGroup=atiL2DHCPSysGroup, atiL2DeviceId=atiL2DeviceId, atiL2BrStpRootPort=atiL2BrStpRootPort, mibObject=mibObject, atiL2EthPortMonTxGoodFrames=atiL2EthPortMonTxGoodFrames, atiL2EthPortErrorLateCollisions=atiL2EthPortErrorLateCollisions, topologyChange=topologyChange, at_9410GB=at_9410GB, atiL2BrStpPortState=atiL2BrStpPortState, atiL2DevicePortName=atiL2DevicePortName, atiL2BrStpLanId=atiL2BrStpLanId, atiL2BrBaseLanId=atiL2BrBaseLanId, atiL2BeVlanModule8TaggedPorts=atiL2BeVlanModule8TaggedPorts, atiL2NwMgrIpAddr=atiL2NwMgrIpAddr, newRoot=newRoot, atiL2TemperatureAbnormalTrap=atiL2TemperatureAbnormalTrap, atiL2EthMonTxTotalBytes=atiL2EthMonTxTotalBytes, atiL2BrStpPortForwardTransitions=atiL2BrStpPortForwardTransitions, atiL2DevicePortSTPCost=atiL2DevicePortSTPCost, atiL2BrStpTimeSinceTopologyChange=atiL2BrStpTimeSinceTopologyChange, atiL2deviceDescr=atiL2deviceDescr, atiL2BeVlanModule5TaggedPorts=atiL2BeVlanModule5TaggedPorts, atiL2NwMgrEntry=atiL2NwMgrEntry, atiL2TrapAttrPortId=atiL2TrapAttrPortId, atiL2GlobalGroup=atiL2GlobalGroup, atiL2BeVlanModule5UntaggedPorts=atiL2BeVlanModule5UntaggedPorts, atiL2PvPortNumber=atiL2PvPortNumber, atiL2BrTpPortInFrames=atiL2BrTpPortInFrames, atiL2deviceSecurityAction=atiL2deviceSecurityAction, alliedTelesyn=alliedTelesyn, atiL2EthPortMonRxOverruns=atiL2EthPortMonRxOverruns, atiL2BeVlanModule2UntaggedPorts=atiL2BeVlanModule2UntaggedPorts, atiL2BrStpMaxAge=atiL2BrStpMaxAge, atiL2DHCPTimerGroup=atiL2DHCPTimerGroup, atiL2QOSStatus=atiL2QOSStatus, atiL2TrafficMappingTable=atiL2TrafficMappingTable, atiL2BrBasePortCircuit=atiL2BrBasePortCircuit, atiL2DNServer=atiL2DNServer, atiL2DevicePortQOSPriorityConfig=atiL2DevicePortQOSPriorityConfig, atiL2ConfiguredRouter=atiL2ConfiguredRouter, atiL2ConfiguredSubnetMask=atiL2ConfiguredSubnetMask, atiL2EthPortErrPortId=atiL2EthPortErrPortId, atiL2DevicePortTable=atiL2DevicePortTable, atiL2IfExt=atiL2IfExt, atiL2DevicePortSTPPriority=atiL2DevicePortSTPPriority, atiL2IntruderAlert=atiL2IntruderAlert, atiL2VlanConfigGroup=atiL2VlanConfigGroup, atiL2EthErrorAlignment=atiL2EthErrorAlignment, atiL2BrStpPortDesignatedCost=atiL2BrStpPortDesignatedCost, atiL2BeVlanModule2TaggedPorts=atiL2BeVlanModule2TaggedPorts, atiIfExtnEntry=atiIfExtnEntry, atiL2BrBasePortTable=atiL2BrBasePortTable, atiL2SwProduct=atiL2SwProduct, atiL2BrStpBridgeForwardDelay=atiL2BrStpBridgeForwardDelay, atiL2Reset=atiL2Reset, atiL2PvModuleId=atiL2PvModuleId, atiL2BridgeMib=atiL2BridgeMib, atiL2BeVlanModule1TaggedPorts=atiL2BeVlanModule1TaggedPorts, atiL2deviceDebugAvailableBytes=atiL2deviceDebugAvailableBytes, atiL2BrTpAgingTime=atiL2BrTpAgingTime, atiL2IPAddressStatus=atiL2IPAddressStatus, atiL2DeviceGroup=atiL2DeviceGroup, at_8350GB=at_8350GB, atiL2CurrentIpAddress=atiL2CurrentIpAddress, atiL2BrTpFdbAddress=atiL2BrTpFdbAddress, atiL2BeVlanModule4UntaggedPorts=atiL2BeVlanModule4UntaggedPorts, atiL2DevicePortSTPConfig=atiL2DevicePortSTPConfig, atiL2BeVlanTagId=atiL2BeVlanTagId, atiL2BrBaseNumPorts=atiL2BrBaseNumPorts, atiL2BrTpFdbEntry=atiL2BrTpFdbEntry, atiL2BrStpTable=atiL2BrStpTable, atiL2BrTpPortTable=atiL2BrTpPortTable, atiL2BrStpHelloTime=atiL2BrStpHelloTime, atiL2BrBasePortMtuExceededDiscards=atiL2BrBasePortMtuExceededDiscards, atiL2EthPortMonStatsTable=atiL2EthPortMonStatsTable, atiL2DHCPSubnetMask=atiL2DHCPSubnetMask, atiL2BeVlanModule8UntaggedPorts=atiL2BeVlanModule8UntaggedPorts, atiL2PowerSupplyOutage=atiL2PowerSupplyOutage, atiL2BrTpPortMaxInfo=atiL2BrTpPortMaxInfo, atiL2deviceSecurityConfig=atiL2deviceSecurityConfig, atiL2DevicePortNumber=atiL2DevicePortNumber, atiL2BrBasePortLanId=atiL2BrBasePortLanId, atiL2BasicVlanEntry=atiL2BasicVlanEntry, atiL2BrStpEntry=atiL2BrStpEntry, atiL2deviceTable=atiL2deviceTable, atiL2DevicePortConfigGroup=atiL2DevicePortConfigGroup, atiL2BrStpPortDesignatedBridge=atiL2BrStpPortDesignatedBridge, atiL2BeVlanModule7UntaggedPorts=atiL2BeVlanModule7UntaggedPorts, atiL2IpGroup=atiL2IpGroup, atiL2QOSConfigGroup=atiL2QOSConfigGroup, atiL2DHCPCurrentRelayAgentAddress=atiL2DHCPCurrentRelayAgentAddress, atiL2EthErrStatsTable=atiL2EthErrStatsTable, atiL2EthErrorLateCollisions=atiL2EthErrorLateCollisions, atiProduct=atiProduct, atiL2EthPortErrModuleId=atiL2EthPortErrModuleId, atiL2BrTp=atiL2BrTp, atiL2BeVlanIndex=atiL2BeVlanIndex, atiL2BrStpPort=atiL2BrStpPort, atiL2BrBaseTable=atiL2BrBaseTable, atiL2BrBasePortIfIndex=atiL2BrBasePortIfIndex, at_8124XL_V2=at_8124XL_V2, atiL2DeviceNumber=atiL2DeviceNumber, atiL2DevicePortSpeed=atiL2DevicePortSpeed, atiL2BeVlanModule6TaggedPorts=atiL2BeVlanModule6TaggedPorts, atiL2TrapAttrGroup=atiL2TrapAttrGroup, atiL2NMGroup=atiL2NMGroup, atiL2EthErrStatsGroup=atiL2EthErrStatsGroup, atiL2EthErrorTxTotal=atiL2EthErrorTxTotal, atiL2BrBase=atiL2BrBase, atiL2BrTpTable=atiL2BrTpTable, atiL2deviceMDA2Type=atiL2deviceMDA2Type, atiL2ConfiguredIpAddress=atiL2ConfiguredIpAddress, atiL2BeVlanModule3UntaggedPorts=atiL2BeVlanModule3UntaggedPorts, at_8326GB=at_8326GB, atiL2BeVlanName=atiL2BeVlanName, atiL2MirroringDestinationPort=atiL2MirroringDestinationPort, at_8324=at_8324, atiL2MirrorState=atiL2MirrorState, atiL2EthPortMonPortId=atiL2EthPortMonPortId, atiL2PvVlanName=atiL2PvVlanName, atiIfExtnPort=atiIfExtnPort, atiL2BrBasePortEntry=atiL2BrBasePortEntry, atiL2TrapAttrModuleId=atiL2TrapAttrModuleId, atiL2BrStpPortDesignatedPort=atiL2BrStpPortDesignatedPort, atiL2BrStpPortPathCost=atiL2BrStpPortPathCost, atiL2BrTpFdbStatus=atiL2BrTpFdbStatus, atiL2DevicePortBackPressureEnable=atiL2DevicePortBackPressureEnable, atiL2EthMonStatsGroup=atiL2EthMonStatsGroup, atiIfExtnIndex=atiIfExtnIndex, atiL2EthMonModuleId=atiL2EthMonModuleId, MacAddress=MacAddress, atiL2BrBaseBridgeAddress=atiL2BrBaseBridgeAddress, atiL2BrTpPort=atiL2BrTpPort, atiL2deviceMDA1Type=atiL2deviceMDA1Type, atiL2BrTpLanId=atiL2BrTpLanId, atiL2EthMonTxCollisions=atiL2EthMonTxCollisions, atiL2deviceProductType=atiL2deviceProductType, atiL2MirroringSourceModule=atiL2MirroringSourceModule, atiL2DevicePortTransmitPacingConfig=atiL2DevicePortTransmitPacingConfig, atiL2IfExtensions=atiL2IfExtensions, atiL2DHCPExpirationTimer=atiL2DHCPExpirationTimer, atiL2EthMonTxGoodFrames=atiL2EthMonTxGoodFrames, atiL2EthPortMonTxTotalBytes=atiL2EthPortMonTxTotalBytes, atiL2BrBaseEntry=atiL2BrBaseEntry, Timeout=Timeout, atiL2deviceEntry=atiL2deviceEntry, atiL2EthPortErrorTxTotal=atiL2EthPortErrorTxTotal, atiL2EthMonTxDeferred=atiL2EthMonTxDeferred, atiL2DevicePortFlowControlEnable=atiL2DevicePortFlowControlEnable, atiL2BrStpRootCost=atiL2BrStpRootCost, atiL2BeVlanModule7TaggedPorts=atiL2BeVlanModule7TaggedPorts, atiL2IGMPState=atiL2IGMPState, atiL2BeVlanModule1UntaggedPorts=atiL2BeVlanModule1UntaggedPorts, atiL2BeVlanModule3TaggedPorts=atiL2BeVlanModule3TaggedPorts, atiL2DHCPReacquisitionTimer=atiL2DHCPReacquisitionTimer, atiL2BrTpPortOutFrames=atiL2BrTpPortOutFrames, atiL2EthPortMonTxCollisions=atiL2EthPortMonTxCollisions, atiL2BrStpPortEntry=atiL2BrStpPortEntry, atiL2BrStpPortDesignatedRoot=atiL2BrStpPortDesignatedRoot, atiL2DHCPCurrentDHCPClientAddress=atiL2DHCPCurrentDHCPClientAddress, atiL2MirroringSourcePort=atiL2MirroringSourcePort, atiL2EthMonRxOverruns=atiL2EthMonRxOverruns, atiL2BrBasePortDelayExceededDiscards=atiL2BrBasePortDelayExceededDiscards, atiL2BrStpHoldTime=atiL2BrStpHoldTime, atiL2NwMgrTable=atiL2NwMgrTable, atiL2BrStpPortEnable=atiL2BrStpPortEnable, atiL2BeVlanRowStatus=atiL2BeVlanRowStatus, atiL2EthPortMonStatsEntry=atiL2EthPortMonStatsEntry, atiL2EthPortErrorRxBadFrames=atiL2EthPortErrorRxBadFrames, atiIfExtnTable=atiIfExtnTable, atiL2BrStpPortLanId=atiL2BrStpPortLanId, atiL2BrStpProtocolSpecification=atiL2BrStpProtocolSpecification, atiL2BrTpFdbLanId=atiL2BrTpFdbLanId, atiL2BeVlanModule4TaggedPorts=atiL2BeVlanModule4TaggedPorts, atiL2NwMgrIndex=atiL2NwMgrIndex, atiL2Port2VlanTable=atiL2Port2VlanTable, atiL2EthPortMonTxDeferred=atiL2EthPortMonTxDeferred, atiL2EthErrorCRC=atiL2EthErrorCRC, atiL2BrStpBridgeMaxAge=atiL2BrStpBridgeMaxAge, atiL2BrStpPortPriority=atiL2BrStpPortPriority, atiL2EthPortMonTxBroadcastFrames=atiL2EthPortMonTxBroadcastFrames, atiL2EthErrorRxBadFrames=atiL2EthErrorRxBadFrames, atiL2DefaultDomainName=atiL2DefaultDomainName, BridgeId=BridgeId, atiL2EthPortErrorAlignment=atiL2EthPortErrorAlignment, atiL2BrBaseType=atiL2BrBaseType, atiL2BrBasePort=atiL2BrBasePort, atiL2EthPortErrStatsTable=atiL2EthPortErrStatsTable, atiL2BrTpFdbTable=atiL2BrTpFdbTable, atiL2BrTpEntry=atiL2BrTpEntry, atiL2BrStpForwardDelay=atiL2BrStpForwardDelay, atiL2devicePortCount=atiL2devicePortCount, atiL2BrStpPriority=atiL2BrStpPriority, swhub=swhub, atiL2DHCPNextDHCPServerAddress=atiL2DHCPNextDHCPServerAddress, atiL2EthernetStatsGroup=atiL2EthernetStatsGroup, atiL2EthMonStatsEntry=atiL2EthMonStatsEntry, atiL2EthMonRxGoodFrames=atiL2EthMonRxGoodFrames, atiL2EthErrModuleId=atiL2EthErrModuleId, atiL2Port2VlanEntry=atiL2Port2VlanEntry, atiL2TrafficClassIndex=atiL2TrafficClassIndex, atiL2deviceReset=atiL2deviceReset, atiL2EthMonStatsTable=atiL2EthMonStatsTable, atiL2Mib=atiL2Mib, atiL2DevicePortDuplexStatus=atiL2DevicePortDuplexStatus, atiL2EthMonTxMulticastFrames=atiL2EthMonTxMulticastFrames, atiL2BasicVlanTable=atiL2BasicVlanTable, atiL2DevicePortLinkState=atiL2DevicePortLinkState, atiL2DevicePortBridgeid=atiL2DevicePortBridgeid, atiL2MirroringDestinationModule=atiL2MirroringDestinationModule, atiL2BrTpFdbPort=atiL2BrTpFdbPort)
|
TEST_CHANGES = {
('+1', '+1', '+1'): 3,
('+1', '+1', '-2'): 0,
('-1', '-2', '-3'): -6,
}
TEST_CHANGES_2 = {
('+1', '-1'): 0,
('+3', '+3', '+4', '-2', '-4'): 10,
('-6', '+3', '+8', '+5', '-6'): 5,
('+7', '+7', '-2', '-7', '-4'): 14,
}
def calibrate(deltas):
frequency = 0
for delta in deltas:
frequency += int(delta)
return frequency
def calibrate_2(deltas):
current_frequency = 0
frequency_history = {0}
while True:
for delta in deltas:
current_frequency += int(delta)
if current_frequency in frequency_history:
return current_frequency
frequency_history.add(current_frequency)
def test_calibrate(test_data, calibration_fn):
for deltas, expected_frequency in test_data.items():
frequency = calibration_fn(deltas)
assert frequency == expected_frequency, '{} != {}'.format(
frequency, expected_frequency
)
def get_input():
with open('input.txt') as input_file:
data = input_file.read()
lines = data.split('\n')
return list(filter(None, lines))
if __name__ == '__main__':
deltas = get_input()
test_calibrate(TEST_CHANGES, calibrate)
frequency = calibrate(deltas)
print(frequency)
test_calibrate(TEST_CHANGES_2, calibrate_2)
frequency = calibrate_2(deltas)
print(frequency)
|
"""
* Assignment: Protocol Descriptor ValueRange
* Complexity: easy
* Lines of code: 9 lines
* Time: 13 min
English:
1. Define descriptor class `ValueRange` with attributes:
a. `name: str`
b. `min: float`
c. `max: float`
d. `value: float`
2. Define class `Astronaut` with attributes:
a. `age = ValueRange('Age', min=28, max=42)`
b. `height = ValueRange('Height', min=150, max=200)`
3. Setting `Astronaut` attribute should invoke boundary check of `ValueRange`
4. Run doctests - all must succeed
Polish:
1. Zdefiniuj klasę-deskryptor `ValueRange` z atrybutami:
a. `name: str`
b. `min: float`
c. `max: float`
d. `value: float`
2. Zdefiniuj klasę `Astronaut` z atrybutami:
a. `age = ValueRange('Age', min=28, max=42)`
b. `height = ValueRange('Height', min=150, max=200)`
3. Ustawianie atrybutu `Astronaut` powinno wywołać sprawdzanie zakresu z `ValueRange`
6. Uruchom doctesty - wszystkie muszą się powieść
Tests:
>>> import sys; sys.tracebacklimit = 0
>>> mark = Astronaut('Mark Watney', 36, 170)
>>> melissa = Astronaut('Melissa Lewis', 44, 170)
Traceback (most recent call last):
ValueError: Age is not between 28 and 42
>>> alex = Astronaut('Alex Vogel', 40, 201)
Traceback (most recent call last):
ValueError: Height is not between 150 and 200
"""
class ValueRange:
name: str
min: float
max: float
value: float
def __init__(self, name, min, max):
pass
class Astronaut:
age = ValueRange('Age', min=28, max=42)
height = ValueRange('Height', min=150, max=200)
|
if __name__ == '__main__':
"""
https://archive.ics.uci.edu/ml/datasets/Ecoli
"""
replacement = ""
with open('ecoli.data') as file:
line = file.readline()
i = 1
while line:
i += 1
elements = [el.strip() for el in line.split(' ')][1:]
elements[-1] = f'"{elements[-1]}"'
replacement = replacement + ','.join(elements) + "\n"
line = file.readline()
if i > 167:
break
with open('sets/ecoli_half.csv', 'w') as file:
file.write(replacement)
|
# Crie um programa que leia um numero qualquer pelo teclado e mostre na tela a sua porção inteira.
''' from math import floor, trunc
num = float(input('Digite um número com casas decimais: '))
print(f'\nA porção inteira de {num} é {floor(num)}.')'''
# ou
num = float(input('Digite um número com casas decimais: '))
print(f'\nA porção inteira de {num} é {int(num)}.')
|
years = (1990, 1991, 1993, 1991, 1993, 1993, 1993)
print("Years: ", years)
print("\n")
# Trả về số lần xuất hiện của 1993
print("years.count(1993): ", years.count(1993))
# Tìm vị trí xuất hiện 1993
print("years.index(1993): ", years.index(1993))
# Tìm vị trí xuất hiện 1993, bắt đầu từ chỉ số 3
print("years.index(1993, 3): ", years.index(1993, 3))
# Tìm vị trí xuất hiện 1993, bắt đầu từ chỉ số 4 tới 5 (Không bao gồm 6)
print("years.index(1993, 4, 6): ", years.index(1993, 4, 6))
|
class Solution:
def reinitializePermutation(self, n: int) -> int:
perm = []
for i in range(n):
perm.append(i)
def op(perm):
arr = [0] * len(perm)
for i in range(len(perm)):
if i % 2 == 0:
arr[i] = perm[int(i / 2)]
else:
arr[i] = perm[int(len(perm) / 2 + (i - 1) / 2)]
return arr
count = 0
arr_list = []
temp = [0] * n
for i in range(n):
temp[i] = perm[i]
while True:
arr = op(temp)
# print(arr, perm)
count += 1
if arr == perm:
return count
# else:
# if arr in arr_list:
# return -1
# arr_list.append(arr)
for i in range(n):
temp[i] = arr[i]
n = 2
n = 4
n = 6
n = 8
s = Solution()
print(s.reinitializePermutation(n))
for i in range(2, 1000, 2):
print(i, s.reinitializePermutation(i))
|
"""
zhushi
python组成
程序由模块组成
模块由语句,函数,类,数据
语句包含表达式
表达式建立并处理数据对象
python核心类型
数字:int-- 0和负数,float,布尔True/值为1,False/值为0
字符串:str
列表
字典
查看变量类型:type()
算数运算符+,-,*,/,//(地板除--取整),**(幂运算 --求次方),%(取余) 除数不能为0
+ 一,数值运算(同类型相加)
二,字符类-拼接字符串
- 一,数值运算
* 一,数值运算
二,字符类-重复输出目标字符串
/ 一,数值运算
// 一,作用 除法取整 ,格式 a//b
= 一,赋值操作a=5
a,b = 4,5
a=b=c=5
二,交换
复合赋值运算符
+=
-=
*=
/=
//=
**=
%=
比较运算
> ,<,>=,<=,!=,==
返回值是布尔类型
注意:如果是数值,直接比较数值大小
如果是字符,比较ASCII
字符,整型无法比较
a 97
A 65
0 48
格式化输入:
%d 整数占位
%f 浮点数数占位
%s 字符串占位
基本输入函数
input:从标准输入设备上读取一个字符串
返回值:用户输入的字符串
input接收的都是字符串,如果要数值运算,用函数强制转换
int :转为整型
float :转为浮点型
eval :保持原本输入数字的类型
python-if语句
if 真值表达式:
elif 真值表达式:
else:
1.不需要括号来控制格式和范围,用缩进
2.elif语句可以有一个或多个,也可以没有
3.else语句只能有一个,可以没有
条件表达式:表达式1 if 真值判断 else 表达式2
作用:根据真值表达式的值来决定表达式1还是表达式2,并返回结果
pass语句 作用:填充语法空白
布尔操作 and, or, not
not: 去反,对布尔值取反 用法: not 表达式(布尔值)
and: 与操作,优先返回假值对象 用法: 表达式1 and 表达式2
or: 或操作 ,优先返回真值对象 用法: 表达式1 or 表达式2
内建的数值型函数
abs(x) 取x绝对值
round(x, y) 对数值进行四舍五入, y是小数向右取整的位数,负数代表向左取整的数
pow(x, y, z=None) 相当于x**y,如果z不为None,则x**y%z
help(函数名) 用于查看函数帮助文档
"""
# ctrl+/ 选中多行注释或直接单行注释
# ctrl+d 复制上一行到下行
# a = 5
# b = 6
# a, b = b, a
# print(a)
# print(b)
# print('AB' > 'ABC') # False A-A B-B null<C
# print('C' > 'ABC') # True C>A
# name = input('输入姓名:')
# age = eval(input('输入age:'))
# gra = int(float(input('输入gra:')))
# print('%s今年%.2f岁,%.2f' % (name, age, gra))
# num = eval(input('输入整数:'))
# if num % 2 == 0:
# print('偶数')
# else:
# print('奇数')
# num = eval(input('输入整数:'))
# if num >= 1 & num <= 100 & num == 5:
# print('在')
# else:
# print('不在')
# num = eval(input('输入季度(1-4):'))
# if 1 <= num <= 4:
# print("这个月有:%d,%d,%d" % ((num-1) * 3+1, (num-1) * 3+2, (num-1) * 3+3,))
# else:
# print('输入错误')
# e = input('输入执行类型:')
# num1 = eval(input('输入整数1:'))
# num2 = eval(input('输入整数2:'))
# if e == '+':
# print(num1+num2)
# elif e == '-':
# print(num1-num2)
# elif e == '*':
# print(num1*num2)
# elif e == '/':
# if num2 != 0:
# print(int(num1/num2))
# else:
# print('被除数不应为零')
# else:
# print('该功能正在开发')
# e = eval(input('输入购物金额:'))
# print('需付款%.2f' % (e-20)) if not 0 < e >= 100 else print('需付款%.2f' % e)
# import random
# cus = eval(input('1:石头,2:剪刀,3:布:'))
# com = random.randint(1, 3)
# print('电脑是:%d' % com)
# if (cus == 1 and com == 2) or (cus == 2 and com == 3) or (cus == 3 and com == 1):
# print('你赢了')
# elif (cus == 1 and com == 3) or (cus == 2 and com == 1) or (cus == 3 and com == 2):
# print('你输了')
# elif (cus == 1 and com == 1) or (cus == 2 and com == 2) or (cus == 3 and com == 3):
# print('再来')
# else:
# print('你的输入不规范')
# num = eval(input('输入一个数:'))
# print(abs(num)) if num < 0 else print(num)
# k = eval(input('输入公里数:'))
# if 0 < k <= 3:
# print('应收费13元')
# elif 3 <= k <= 15:
# print('应收费%.2f元' % round((k-3)*2.3+13, 2))
# elif k <= 0:
# print('输入不合法')
# else:
# print('应收费%.2f元' % round(12*2.3+(k-15)*2.3*1.5+13, 2))
# s1 = float(input('请输入第1科成绩:'))
# s2 = float(input('请输入第2科成绩:'))
# s3 = float(input('请输入第3科成绩:'))
# print("最高成绩是:%.2f" % max(s1, s2, s3))
# print('最低成绩是:%.2f' % min(s1, s2, s3))
# print('平均成绩是:%.2f' % ((s1+s2+s3)/3.0))
# y = int(input('请输入年份: '))
# print(y, '是闰年') if (y % 400 == 0) or (y % 4 == 0 and y % 100 != 0) else print(y, '不是闰年')
# ti = eval(input('输入体重(公斤):'))
# sh = eval(input('输入身高(米):'))
# bmi = ti/sh**2
# if 0 < bmi < 18.5:
# print('体重过轻')
# elif 18.5 <= bmi <= 24:
# print('正常范围')
# elif bmi > 24:
# print('体重过重')
# else:
# print('bmi值异常')
|
E_HOOK_ALREADY_EXISTS = u'Hook already exists on this repository'
def matches_github_exception(e, description, code=422):
"""Returns True if a GithubException was raised for a single error
matching the provided dict.
The error code needs to be equal to `code`, unless code is
None. For each field in `description`, the error must have an
identical field. The error can have extraneous fields too. If
multiple errors are present, this function returns False.
"""
if e.status != code:
return False
if not e.data or u'errors' not in e.data or len(e.data[u'errors']) != 1:
return False
error = e.data['errors'][0]
for k, v in description.iteritems():
if k not in error or error[k] != v:
return False
return True
def is_github_exception_message(e, message):
"""Returns True if a GithubException was raised for a single error
matching the provided message.
"""
return matches_github_exception(e, {u'message': message})
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.