content stringlengths 7 1.05M |
|---|
class Solution:
def corpFlightBookings(self, bookings: List[List[int]], n: int) -> List[int]:
dp = [0]*n
for i,j,k in bookings:
dp[i-1]+=k
if j!=n:
dp[j]-=k
for i in range(1,n):
dp[i]+=dp[i-1]
return dp |
def buildFibonacciSequence(items):
actual = 0
next = 1
sequence = []
for index in range(items):
sequence.append(actual)
actual, next = next, actual+next
return sequence
|
"""
Given two strings str1 and str2 of the same length, determine whether you can transform str1 into str2 by doing zero
or more conversions.
In one conversion you can convert all occurrences of one character in str1 to any other lowercase English character.
Return true if and only if you can transform str1 into str2.
Example 1:
Input: str1 = "aabcc", str2 = "ccdee"
Output: true
Explanation: Convert 'c' to 'e' then 'b' to 'd' then 'a' to 'c'. Note that the order of conversions matter.
Example 2:
Input: str1 = "leetcode", str2 = "codeleet"
Output: false
Explanation: There is no way to transform str1 to str2.
Constraints:
1 <= str1.length == str2.length <= 104
str1 and str2 contain only lowercase English letters.
"""
class Solution:
"""
Runtime: 32 ms, faster than 50.63% of Python3
Memory Usage: 14.4 MB, less than 58.68% of Python3
Time/Space complexity: O(n)
"""
def canConvert(self, str1: str, str2: str) -> bool:
if str1 == str2:
return True
conv_tbl = dict() # conversion table
for i in range(len(str1)):
if str1[i] not in conv_tbl:
conv_tbl[str1[i]] = str2[i]
else:
if str2[i] != conv_tbl[str1[i]]:
return False
return len(set(str2)) < 26 # if all 26 characters are represented, there are no characters available to use
# for temporary conversions, and the transformation is impossible. The only exception to this is if str1 is
# equal to str2, so we handle this case at the start of the function.
if __name__ == '__main__':
solutions = [Solution()]
tc = (
("aabcc", "ccdee", True),
("leetcode", "codeleet", False),
("abcdefghijklmnopqrstuvwxyz", "bcadefghijklmnopqrstuvwxzz", True),
("abcdefghijklmnopqrstuvwxyz", "bcdefghijklmnopqrstuvwxyza", False),
)
for sol in solutions:
for inp_s1, inp_s2, expected_res in tc:
assert sol.canConvert(inp_s1, inp_s2) is expected_res, f"{sol.__class__.__name__}"
|
class Animation:
def __init__(self, sprites, time_interval):
self.sprites = tuple(sprites)
self.time_interval = time_interval
self.index = 0
self.time = 0
def restart_at(self, index):
self.time = 0
self.index = index % len(self.sprites)
def update(self, dt):
self.time += dt
if self.time >= self.time_interval:
self.time = self.time - self.time_interval
self.index = (self.index + 1) % len(self.sprites)
return self.sprites[self.index]
class OneTimeAnimation:
def __init__(self, sprites, time_interval):
self.sprites = tuple(sprites)
self.time_interval = time_interval
self.index = 0
self.time = 0
self.dead = False
def restart_at(self, index):
self.time = 0
self.index = index % len(self.sprites)
def update(self, dt):
if self.dead:
return None
self.time += dt
if self.time >= self.time_interval:
self.time = self.time - self.time_interval
self.index += 1
if self.index >= len(self.sprites) - 1:
self.dead = True
return self.sprites[self.index]
class ConditionalAnimation:
def __init__(self, sprites, condition):
self.sprites = sprites
self.condition = condition
def update(self, argument):
return self.sprites[self.condition(argument)]
|
NoOfLines=int(input())
for Row in range(0,NoOfLines):
for Column in range(0,NoOfLines):
if(Row%2==0 and Column+1==NoOfLines)or(Row%2==1 and Column==0):
print("%2d"%(Row+2),end=" ")
else:
print("%2d"%(Row+1),end=" ")
else:
print(end="\n")
#second code
NoOfLines=int(input())
for Row in range(1,NoOfLines+1):
for Column in range(1,NoOfLines+1):
if(Row%2==1 and Column==NoOfLines)or(Row%2==0 and Column==1):
print("%2d"%(Row+1),end=" ")
else:
print("%2d"%(Row),end=" ")
else:
print(end="\n")
|
# Module: FeatureEngineering
# Author: Adrian Antico <adrianantico@gmail.com>
# License: MIT
# Release: retrofit 0.1.7
# Last modified : 2021-09-21
class FeatureEngineering:
"""
Base class that the library specific classes inherit from.
"""
def __init__(self) -> None:
self.lag_args = {}
self.roll_args = {}
self.diff_args = {}
self.calendar_args = {}
self.dummy_args = {}
self.model_data_prep_args = {}
self.partition_args = {}
self._last_lag_args = {}
self._last_roll_args = {}
self._last_diff_args = {}
self._last_calendar_args = {}
self._last_dummy_args = {}
self._last_partition_args = {}
self._last_model_data_prep_args = {}
def save_args(self) -> None:
self.lag_args = self._last_lag_args
self.roll_args = self._last_roll_args
self.diff_args = self._last_diff_args
self.calendar_args = self._last_calendar_args
self.dummy_args = self._last_dummy_args
self.model_data_prep_args = self._last_model_data_prep_args
self.partition_args = self._last_partition_args
def FE0_AutoLags(
self,
data=None,
LagColumnNames=None,
DateColumnName=None,
ByVariables=None,
LagPeriods=1,
ImputeValue=-1,
Sort=True,
use_saved_args=False,
):
raise NotImplementedError
def FE0_AutoRollStats(
data=None,
ArgsList=None,
RollColumnNames=None,
DateColumnName=None,
ByVariables=None,
MovingAvg_Periods=None,
MovingSD_Periods=None,
MovingMin_Periods=None,
MovingMax_Periods=None,
ImputeValue=-1,
Sort=True,
use_saved_args=False,
):
raise NotImplementedError
def FE0_AutoDiff(
data=None,
ArgsList=None,
DateColumnName=None,
ByVariables=None,
DiffNumericVariables=None,
DiffDateVariables=None,
DiffGroupVariables=None,
NLag1=0,
NLag2=1,
Sort=True,
use_saved_args=False,
):
raise NotImplementedError
def FE1_AutoCalendarVariables(
data=None,
ArgsList=None,
DateColumnNames=None,
CalendarVariables=None,
use_saved_args=False
):
raise NotImplementedError
def FE1_DummyVariables(
data=None,
ArgsList=None,
CategoricalColumnNames=None,
use_saved_args=False
):
raise NotImplementedError
def FE2_ColTypeConversions(
self,
data=None,
Int2Float=False,
Bool2Float=False,
RemoveDateCols=False,
RemoveStrCols=False,
SkipCols=None,
use_saved_args=False
):
raise NotImplementedError
def FE2_AutoDataPartition(
data = None,
ArgsList = None,
DateColumnName = None,
PartitionType = 'random',
Ratios = None,
ByVariables = None,
Sort = False,
use_saved_args = False
):
raise NotImplementedError
|
'''
* Exercício: Desconto progressivo
* Repositório: Lógica de Programação e Algoritmos em Python
* GitHub: @michelelozada
Para este exercício, procurei os preços de uma loja de produtos do ramo de lembrancinhas/souvenirs, que trabalhasse com
o chamado desconto progressivo à medida que a quantidade encomendada aumenta (atacado). Uma das promoções encontradas foi
a seguinte:
-------------------------------
ITEM - COD. 3021
Preço unitário: R$ 1,25
Tabela de preços - Atacado*:
Quantidade (un.) Desconto
de 60 a 99 -
de 100 a 249 4%
de 250 a 499 12%
de 500 a 749 20%
de 750 a 999 28%
acima de 1000 32%
* Pedido mínimo de 60 unidades
-------------------------------
O algoritmo abaixo é para registro do vendedor da encomenda feita pelo cliente.
'''
while True:
item = "Souvenir Código 3021"
print('\nPRODUTO: ' + item)
try:
quantidade = int(input(' Qual a quantidade deste produto a ser encomendada (em unidades)? '))
# definição dos intervalos
if (quantidade < 60):
print(f'\n> Aviso: Vendas somente acima de 60 unidades. Por favor, comece novamente.\n')
continue;
elif (quantidade >= 60 and quantidade <= 99):
percentual = 0
elif (quantidade >= 100 and quantidade <= 249):
percentual = 4
elif (quantidade >= 250 and quantidade <= 499):
percentual = 12
elif (quantidade >= 500 and quantidade <= 749):
percentual = 20
elif (quantidade >= 750 and quantidade <= 999):
percentual = 28
elif (quantidade >= 1000):
percentual = 32
# atribuição e cálculo dos valores
preco = 1.25
abatimento = quantidade * preco * (percentual / 100)
total = quantidade * preco - abatimento
print(
f'\nREGISTRO DA ENCOMENDA \n Item escolhido: {item} \n Quantidade encomendada: {quantidade} unidades \n Valor do pedido: R$ {quantidade * preco:.2f} \n Desconto promocional: R$ {abatimento:.2f}\n Total a pagar: R$ {total:.2f}\n')
# tratamento de exceções
except ValueError:
print('\n> Aviso: O valor digitado precisa ser um número. Por gentileza, tente novamente.\n')
continue
sair = input('Deseja encerrar o programa? Digite S para sair e qualquer outra tecla para continuar. ')
if(sair.upper() == 'S' or sair=='sim'):
print('Programa encerrado...')
break
else:
continue
"""
PRODUTO: Souvenir Código 3021
Qual a quantidade deste produto a ser encomendada (em unidades)? 350
REGISTRO DA ENCOMENDA
Item escolhido: Souvenir Código 3021
Quantidade encomendada: 350 unidades
Valor do pedido: R$ 437.50
Desconto promocional: R$ 52.50
Total a pagar: R$ 385.00
Deseja encerrar o programa? Digite S para sair e qualquer outra tecla para continuar. s
Programa encerrado...
""" |
particles_file = "particles.txt"
particle_coords = []
with open(particles_file, 'r') as pf:
for y, line in enumerate(pf.readlines()):
for x, char in enumerate(line):
if char == '•':
particle_coords.append((x, y))
def manhattan_distance(p1, p2):
return abs(p1[0]-p2[0]) + abs(p1[1]-p2[1])
center = (51,26)
sum = 0
for p in particle_coords:
sum += manhattan_distance(p, center)
print(sum)
|
# ---------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# ---------------------------------------------------------
def get_workspace_dependent_resource_location(location):
if location == "centraluseuap":
return "eastus"
return location
|
# 1.5 One Away
# There are three types of edits that can be performed on strings:
# insert a character, remove a character, or replace a character.
# Given two strings, write a function to check if they are one edit (or zero edits) away.
def one_away(string_1, string_2):
if string_1 == string_2:
return True
# Check if inserting a character creates equality
if one_insert_away(string_1, string_2):
return True
# Check if removing a character creates equality
if one_removal_away(string_1, string_2):
return True
# Check if replaceing a character creates equality
if one_replacement_away(string_1, string_2):
return True
return False
def one_insert_away(string_1, string_2):
if (len(string_1) + 1) != len(string_2):
return False
index_1 = 0
index_2 = 0
for i in range(len(string_1)):
if string_1[index_1] != string_2[index_2]:
index_2 += 1
if index_2 - index_1 > 1:
return False
else:
index_1 += 1
index_2 += 1
return True
def one_removal_away(string_1, string_2):
if (len(string_1) - 1) != len(string_2):
return False
index_1 = 0
index_2 = 0
for i in range(len(string_2)):
if string_1[index_1] != string_2[index_2]:
index_1 += 1
if index_1 - index_2 > 1:
return False
else:
index_1 += 1
index_2 += 1
return True
def one_replacement_away(string_1, string_2):
if len(string_1) != len(string_2):
return False
replaced = False
for i in range(len(string_2)):
if string_1[i] != string_2[i]:
if replaced:
return False
replaced = True
return True
print(one_away('hello', 'hello')) # True
print(one_away('hell', 'hello')) # True
print(one_away('hello', 'hell')) # True
print(one_away('hello', 'heldo')) # True
print(one_away('h', 'hello')) # False |
def permune(orignal, chosen):
if not orignal:
print(chosen)
else:
for i in range(len(orignal)):
c=orignal[i]
chosen+=c
lt=list(orignal)
lt.pop(i)
orignal=''.join(lt)
permune(orignal,chosen)
orignal=orignal[:i]+c+orignal[i:]
chosen=chosen[:len(chosen)-1]
permune('lit','') |
entity_id = 'sensor.next_train_to_wim'
attributes = hass.states.get(entity_id).attributes
my_early_train_current_status = hass.states.get('sensor.my_early_train').state
scheduled = False # Check if train scheduled
for train in attributes['next_trains']:
if train['scheduled'] == '07:15':
scheduled = True
if train['status'] != my_early_train_current_status:
hass.states.set('sensor.my_early_train', train['status'])
if not scheduled:
hass.states.set('sensor.my_early_train', 'No data') # check no data
|
#!/usr/bin/env python3
## Algorithm:
#
# We have ZSUM = Z(n) + Z(n-1) - Z(n-2), where:
# - Z(n) = S(n) + P(n)
# - S(n) = 1^k + 2^k + 3^k + … + n^k
# - P(n) = 1^1 + 2^2 + 3^3 + … + n^n
# The elements of Z(n-2) are also present in Z(n) and Z(n-1).
# Hence, in ZSUM we effectively have the last element of Z(n) and Z(n-1)
# Therefore, ZSUM = (n^k + n^n) + ([n-1]^k + [n-1]^n)
# Now for computing each component of this expression, we can use binary exponentiation.
#
# ## Time complexity:
#
# - O(log((max(n,k)))))
#
# ## Space complexity:
#
# - O(1) since we are not using any extra space
#
# ## Code:
# To prevent overflow
M = 10**9+7
def bin_exp(x:int, y:int) -> int:
if y == 0:
return 1
if y == 0:
return x
res = 1
while y > 0:
# If the power is odd, multiply the result with x
if y & 1:
res *= x%M
# Square the base
x *= x%M
# Reduce the power by 2
y >>= 1
return res
T = int(input())
for _ in range(T):
n, k = map(int, input().split())
a = bin_exp(n, k)
b = bin_exp(n, n)
c = bin_exp(n-1, k)
d = bin_exp(n-1, n-1) |
def obter_dados_canal(lista):
for _ in range(lista):
nome,inscritos,monetizacao,ehpremium = input().split(';')
inscritos = int(inscritos)
monetizacao = float(monetizacao)
ehpremium = ehpremium == 'sim'
canais.append([nome, inscritos, monetizacao, ehpremium])
def calcular_bonificacao(valor_premium, valor_nao_premium):
lista_de_bonificacao = []
for canal in canais:
nome = canal[0]
incrito = canal[1]
valor_da_monetizacao = canal[2]
ehpremium = canal[3]
if (ehpremium):
valor_da_monetizacao += incrito // 1000 * valor_premium
else:
valor_da_monetizacao += incrito // 1000 * valor_nao_premium
lista_de_bonificacao.append([nome, valor_da_monetizacao])
return lista_de_bonificacao
def exibir_bonificacao(bonus):
print('-----')
print('BÔNUS')
print('-----')
for bonificacao in bonus:
nome = bonificacao[0]
valor = bonificacao[1]
print(f'{nome}: R$ {valor:.2f}')
canais = []
quantidade_de_canais = int(input())
if (1 <= quantidade_de_canais <= 200):
obter_dados_canal(quantidade_de_canais)
valor_premium = float(input())
valor_nao_premium = float(input())
exibir_bonificacao(calcular_bonificacao(valor_premium, valor_nao_premium)) |
# ------------------------------
# 300. Longest Increasing Subsequence
#
# Description:
# Given an unsorted array of integers, find the length of longest increasing subsequence.
#
# Example:
# Input: [10,9,2,5,3,7,101,18]
# Output: 4
# Explanation: The longest increasing subsequence is [2,3,7,101], therefore the length is 4.
#
# Note:
# There may be more than one LIS combination, it is only necessary for you to return the length.
# Your algorithm should run in O(n2) complexity.
# Follow up: Could you improve it to O(n log n) time complexity?
#
# Version: 1.0
# 12/15/18 by Jianfa
# ------------------------------
class Solution:
def lengthOfLIS(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
if not nums:
return 0
dp = [1]
maxLen = 1
for i in range(1, len(nums)):
maxval = 0 # max length between dp[0:i] (i excluded)
for j in range(0, i):
if nums[i] > nums[j]:
maxval = max(maxval, dp[j])
dp.append(maxval+1)
maxLen = max(maxLen, dp[i])
return maxLen
# Used for testing
if __name__ == "__main__":
test = Solution()
# ------------------------------
# Summary:
# Dynamic Programming solution from Solution section. |
#print('\033[34mOlá, mundo!\033[m')
'''a = 3
b = 5
print('Os valores são \033[32m{}\033[m e \033[31m{}\033[m!!!'.format(a,b))'''
'''nome = 'Guanabara'
print('Olá ! Muito prazer em te conhecer, {}{}{}!!!'.format('\033[30m',nome,'\033[m'))'''
nome = 'Guanabara'
cores = {'limpa':'\033[m',
'azul':'\033[34m',
'amarelo':'\033[33m',
'pretoebranco':'\033[0;30;44m'}
print('Olá ! Muito prazer em te conhecer, {}{}{}!!!'.format(cores['pretoebranco'], nome, cores['limpa'])) |
class Node:
def __init__(self,key=None,val=None,nxt=None,prev=None):
self.key = key
self.val = val
self.nxt = nxt
self.prev = prev
class DLL:
def __init__(self):
self.head = Node()
self.tail = Node()
self.head.nxt = self.tail
self.tail.prev = self.head
def pop(self):
return self.delete(self.tail.prev)
def delete(self,node):
node.prev.nxt = node.nxt
node.nxt.prev = node.prev
return node
def appendleft(self,node):
node.nxt = self.head.nxt
node.prev = self.head
self.head.nxt.prev = node
self.head.nxt = node
return node
class LRUCache:
def __init__(self, capacity):
self.maps = dict()
self.dll = DLL()
self.capacity = capacity
def get(self, key):
if key not in self.maps: return -1
self.dll.appendleft(self.dll.delete(self.maps[key]))
return self.maps[key].val
def set(self, key, val):
if key not in self.maps:
if len(self.maps) == self.capacity: self.maps.pop(self.dll.pop().key)
self.maps[key] = self.dll.appendleft(Node(key,val))
else:
self.get(key)
self.maps[key].val = val
|
class Command(object):
def get_option(self, name):
pass
def run(self, ):
raise NotImplementedError
|
a, b, c, d = map(int, input().split())
if a+b > c+d:
print("Left")
elif a+b < c+d:
print("Right")
else:
print("Balanced")
|
# pyre-ignore-all-errors
# TODO: Change `pyre-ignore-all-errors` to `pyre-strict` on line 1, so we get
# to see all type errors in this file.
# A (hypothetical) Python developer is having trouble with a typing-related
# issue. Here is what the code looks like:
class ConfigA:
pass
class ConfigB:
some_attribute: int = 1
class HelperBase:
def __init__(self, config: ConfigA | ConfigB) -> None:
self.config = config
def common_fn(self) -> None:
pass
class HelperA(HelperBase):
def __init__(self, config: ConfigA) -> None:
super().__init__(config)
class HelperB(HelperBase):
def __init__(self, config: ConfigB) -> None:
super().__init__(config)
def some_fn(self) -> int:
return self.config.some_attribute
# The developer is confused about why Pyre reports a type error on `HelperB.some_fn`.
# Question: Is the reported type error a false positive or not?
# Question: How would you suggest changing the code to avoid the type error?
# Question: Is it a good idea to have `HelperA` and `HelperB` share the same base class?
|
""" Euclid's algorithm """
def modinv(a0, n0):
""" Modular inverse algorithm """
(a, b) = (a0, n0)
(aa, ba) = (1, 0)
while True:
q = a // b
if a == (b * q):
if b != 1:
print("modinv({}, {}) = fail".format(a0, n0))
return -1
else:
if(ba < 0):
ba += n0
print("modinv({}, {}) = {}".format(a0, n0, ba))
return ba
(a, b) = (b, a - (b * q))
(aa, ba) = (ba, aa - (q * ba))
def main():
""" The main method """
modinv(806515533049393, 1304969544928657)
modinv(4505490,7290036)
modinv(892302390667940581330701, 1208925819614629174706111)
if __name__ == "__main__":
main()
|
# 10 Crie um programa que leia quanto dinheiro uma pessoa tem na carteira e mostre quantos Dólares ela pode comprar.
# Considere US$ 1,00 = R$ 3,27 ;( *2017 , R$ 5,36 em 2020.
r = float(input('Digite um valor em Reais: '))
d = float(input('Digite o valor do Dólar na cotação atual: '))
e = float(input('Digite o valor do Euro na cotação atual: '))
print('Valor de R${:.2f} é equivalente a US${:.2F} e a €{:.2f}'.format(r, r / d, r / e))
|
#
# PySNMP MIB module CISCO-LWAPP-LOCAL-AUTH-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCO-LWAPP-LOCAL-AUTH-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 17:48:42 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, ConstraintsUnion, ConstraintsIntersection, SingleValueConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueSizeConstraint", "ValueRangeConstraint", "ConstraintsUnion", "ConstraintsIntersection", "SingleValueConstraint")
cLWlanIndex, = mibBuilder.importSymbols("CISCO-LWAPP-WLAN-MIB", "cLWlanIndex")
ciscoMgmt, = mibBuilder.importSymbols("CISCO-SMI", "ciscoMgmt")
ObjectGroup, ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ObjectGroup", "ModuleCompliance", "NotificationGroup")
TimeTicks, IpAddress, Gauge32, iso, MibIdentifier, ObjectIdentity, Integer32, ModuleIdentity, MibScalar, MibTable, MibTableRow, MibTableColumn, Bits, Unsigned32, Counter32, NotificationType, Counter64 = mibBuilder.importSymbols("SNMPv2-SMI", "TimeTicks", "IpAddress", "Gauge32", "iso", "MibIdentifier", "ObjectIdentity", "Integer32", "ModuleIdentity", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Bits", "Unsigned32", "Counter32", "NotificationType", "Counter64")
TextualConvention, DisplayString, RowStatus, TruthValue = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString", "RowStatus", "TruthValue")
ciscoLwappLocalAuthMIB = ModuleIdentity((1, 3, 6, 1, 4, 1, 9, 9, 619))
ciscoLwappLocalAuthMIB.setRevisions(('2010-02-09 00:00', '2009-11-24 00:00', '2007-03-15 00:00',))
if mibBuilder.loadTexts: ciscoLwappLocalAuthMIB.setLastUpdated('201002090000Z')
if mibBuilder.loadTexts: ciscoLwappLocalAuthMIB.setOrganization('Cisco Systems Inc.')
ciscoLwappLocalAuthMIBNotifs = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 619, 0))
ciscoLwappLocalAuthMIBObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 619, 1))
ciscoLwappLocalAuthMIBConform = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 619, 2))
cllaConfig = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1))
cllaLocalAuth = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 1))
cllaActiveTimeout = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 1, 1), Unsigned32()).setUnits('seconds').setMaxAccess("readwrite")
if mibBuilder.loadTexts: cllaActiveTimeout.setStatus('current')
cllaEapIdentityReqTimeout = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 1, 2), Unsigned32()).setUnits('seconds').setMaxAccess("readwrite")
if mibBuilder.loadTexts: cllaEapIdentityReqTimeout.setStatus('current')
cllaEapIdentityReqMaxRetries = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 1, 3), Unsigned32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: cllaEapIdentityReqMaxRetries.setStatus('current')
cllaEapDynamicWepKeyIndex = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 1, 4), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 3))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: cllaEapDynamicWepKeyIndex.setStatus('current')
cllaEapReqTimeout = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 1, 5), Unsigned32()).setUnits('seconds').setMaxAccess("readwrite")
if mibBuilder.loadTexts: cllaEapReqTimeout.setStatus('current')
cllaEapReqMaxRetries = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 1, 6), Unsigned32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: cllaEapReqMaxRetries.setStatus('current')
cllaEapMaxLoginIgnIdResp = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 1, 7), TruthValue().clone('true')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: cllaEapMaxLoginIgnIdResp.setStatus('current')
cllaEapKeyTimeout = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 1, 8), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(200, 5000)).clone(1000)).setUnits('milliseconds').setMaxAccess("readwrite")
if mibBuilder.loadTexts: cllaEapKeyTimeout.setStatus('current')
cllaEapKeyMaxRetries = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 1, 9), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 4)).clone(2)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: cllaEapKeyMaxRetries.setStatus('current')
cllaEapProfileTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 2), )
if mibBuilder.loadTexts: cllaEapProfileTable.setStatus('current')
cllaEapProfileEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 2, 1), ).setIndexNames((0, "CISCO-LWAPP-LOCAL-AUTH-MIB", "cllaEapProfileName"))
if mibBuilder.loadTexts: cllaEapProfileEntry.setStatus('current')
cllaEapProfileName = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 2, 1, 1), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 63)))
if mibBuilder.loadTexts: cllaEapProfileName.setStatus('current')
cllaEapProfileMethods = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 2, 1, 2), Bits().clone(namedValues=NamedValues(("none", 0), ("leap", 1), ("eapFast", 2), ("tls", 3), ("peap", 4)))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cllaEapProfileMethods.setStatus('current')
cllaEapProfileCertIssuer = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 2, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("cisco", 1), ("vendor", 2))).clone('cisco')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cllaEapProfileCertIssuer.setStatus('current')
cllaEapProfileCaCertificationCheck = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 2, 1, 4), TruthValue().clone('true')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cllaEapProfileCaCertificationCheck.setStatus('current')
cllaEapProfileCnCertificationIdVerify = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 2, 1, 5), TruthValue().clone('false')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cllaEapProfileCnCertificationIdVerify.setStatus('current')
cllaEapProfileDateValidityEnabled = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 2, 1, 6), TruthValue().clone('true')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cllaEapProfileDateValidityEnabled.setStatus('current')
cllaEapProfileLocalCertificateRequired = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 2, 1, 7), TruthValue().clone('false')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cllaEapProfileLocalCertificateRequired.setStatus('current')
cllaEapProfileClientCertificateRequired = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 2, 1, 8), TruthValue().clone('false')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cllaEapProfileClientCertificateRequired.setStatus('current')
cllaEapProfileRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 2, 1, 9), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cllaEapProfileRowStatus.setStatus('current')
cllaWlanProfileTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 3), )
if mibBuilder.loadTexts: cllaWlanProfileTable.setStatus('current')
cllaWlanProfileEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 3, 1), ).setIndexNames((0, "CISCO-LWAPP-WLAN-MIB", "cLWlanIndex"))
if mibBuilder.loadTexts: cllaWlanProfileEntry.setStatus('current')
cllaWlanProfileName = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 3, 1, 1), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 63))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: cllaWlanProfileName.setStatus('current')
cllaWlanProfileState = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 3, 1, 2), TruthValue()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: cllaWlanProfileState.setStatus('current')
cllaUserPriorityTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 4), )
if mibBuilder.loadTexts: cllaUserPriorityTable.setStatus('current')
cllaUserPriorityEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 4, 1), ).setIndexNames((0, "CISCO-LWAPP-LOCAL-AUTH-MIB", "cllaUserCredential"))
if mibBuilder.loadTexts: cllaUserPriorityEntry.setStatus('current')
cllaUserCredential = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 4, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("local", 1), ("ldap", 2))))
if mibBuilder.loadTexts: cllaUserCredential.setStatus('current')
cllaUserPriorityNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 4, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: cllaUserPriorityNumber.setStatus('current')
cllaEapParams = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 5))
cllaEapMethodPacTtl = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 5, 1), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 1000)).clone(10)).setUnits('days').setMaxAccess("readwrite")
if mibBuilder.loadTexts: cllaEapMethodPacTtl.setStatus('current')
cllaEapAnonymousProvEnabled = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 5, 2), TruthValue().clone('true')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: cllaEapAnonymousProvEnabled.setStatus('current')
cllaEapAuthorityId = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 5, 3), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 128))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: cllaEapAuthorityId.setStatus('current')
cllaEapAuthorityInfo = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 5, 4), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 32))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: cllaEapAuthorityInfo.setStatus('current')
cllaEapServerKey = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 5, 5), OctetString().subtype(subtypeSpec=ValueSizeConstraint(1, 32))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: cllaEapServerKey.setStatus('current')
cllaEapAuthorityIdLength = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 5, 6), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 128)).clone(32)).setMaxAccess("readonly")
if mibBuilder.loadTexts: cllaEapAuthorityIdLength.setStatus('current')
ciscoLwappLocalAuthMIBCompliances = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 619, 2, 1))
ciscoLwappLocalAuthMIBGroups = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 619, 2, 2))
ciscoLwappLocalAuthMIBCompliance = ModuleCompliance((1, 3, 6, 1, 4, 1, 9, 9, 619, 2, 1, 1)).setObjects(("CISCO-LWAPP-LOCAL-AUTH-MIB", "ciscoLwappLocalAuthMIBConfigGroup"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoLwappLocalAuthMIBCompliance = ciscoLwappLocalAuthMIBCompliance.setStatus('deprecated')
ciscoLwappLocalAuthMIBComplianceRev1 = ModuleCompliance((1, 3, 6, 1, 4, 1, 9, 9, 619, 2, 1, 2)).setObjects(("CISCO-LWAPP-LOCAL-AUTH-MIB", "ciscoLwappLocalAuthMIBConfigGroupSup1"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoLwappLocalAuthMIBComplianceRev1 = ciscoLwappLocalAuthMIBComplianceRev1.setStatus('current')
ciscoLwappLocalAuthMIBConfigGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 619, 2, 2, 1)).setObjects(("CISCO-LWAPP-LOCAL-AUTH-MIB", "cllaActiveTimeout"), ("CISCO-LWAPP-LOCAL-AUTH-MIB", "cllaEapProfileMethods"), ("CISCO-LWAPP-LOCAL-AUTH-MIB", "cllaEapProfileCertIssuer"), ("CISCO-LWAPP-LOCAL-AUTH-MIB", "cllaEapProfileCaCertificationCheck"), ("CISCO-LWAPP-LOCAL-AUTH-MIB", "cllaEapProfileCnCertificationIdVerify"), ("CISCO-LWAPP-LOCAL-AUTH-MIB", "cllaEapProfileDateValidityEnabled"), ("CISCO-LWAPP-LOCAL-AUTH-MIB", "cllaEapProfileLocalCertificateRequired"), ("CISCO-LWAPP-LOCAL-AUTH-MIB", "cllaEapProfileClientCertificateRequired"), ("CISCO-LWAPP-LOCAL-AUTH-MIB", "cllaEapProfileRowStatus"), ("CISCO-LWAPP-LOCAL-AUTH-MIB", "cllaWlanProfileName"), ("CISCO-LWAPP-LOCAL-AUTH-MIB", "cllaWlanProfileState"), ("CISCO-LWAPP-LOCAL-AUTH-MIB", "cllaUserPriorityNumber"), ("CISCO-LWAPP-LOCAL-AUTH-MIB", "cllaEapMethodPacTtl"), ("CISCO-LWAPP-LOCAL-AUTH-MIB", "cllaEapAnonymousProvEnabled"), ("CISCO-LWAPP-LOCAL-AUTH-MIB", "cllaEapAuthorityId"), ("CISCO-LWAPP-LOCAL-AUTH-MIB", "cllaEapAuthorityInfo"), ("CISCO-LWAPP-LOCAL-AUTH-MIB", "cllaEapServerKey"), ("CISCO-LWAPP-LOCAL-AUTH-MIB", "cllaEapAuthorityIdLength"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoLwappLocalAuthMIBConfigGroup = ciscoLwappLocalAuthMIBConfigGroup.setStatus('deprecated')
ciscoLwappLocalAuthMIBConfigGroupSup1 = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 619, 2, 2, 2)).setObjects(("CISCO-LWAPP-LOCAL-AUTH-MIB", "cllaActiveTimeout"), ("CISCO-LWAPP-LOCAL-AUTH-MIB", "cllaEapIdentityReqTimeout"), ("CISCO-LWAPP-LOCAL-AUTH-MIB", "cllaEapIdentityReqMaxRetries"), ("CISCO-LWAPP-LOCAL-AUTH-MIB", "cllaEapDynamicWepKeyIndex"), ("CISCO-LWAPP-LOCAL-AUTH-MIB", "cllaEapReqTimeout"), ("CISCO-LWAPP-LOCAL-AUTH-MIB", "cllaEapReqMaxRetries"), ("CISCO-LWAPP-LOCAL-AUTH-MIB", "cllaEapProfileMethods"), ("CISCO-LWAPP-LOCAL-AUTH-MIB", "cllaEapProfileCertIssuer"), ("CISCO-LWAPP-LOCAL-AUTH-MIB", "cllaEapProfileCaCertificationCheck"), ("CISCO-LWAPP-LOCAL-AUTH-MIB", "cllaEapProfileCnCertificationIdVerify"), ("CISCO-LWAPP-LOCAL-AUTH-MIB", "cllaEapProfileDateValidityEnabled"), ("CISCO-LWAPP-LOCAL-AUTH-MIB", "cllaEapProfileLocalCertificateRequired"), ("CISCO-LWAPP-LOCAL-AUTH-MIB", "cllaEapProfileClientCertificateRequired"), ("CISCO-LWAPP-LOCAL-AUTH-MIB", "cllaEapProfileRowStatus"), ("CISCO-LWAPP-LOCAL-AUTH-MIB", "cllaWlanProfileName"), ("CISCO-LWAPP-LOCAL-AUTH-MIB", "cllaWlanProfileState"), ("CISCO-LWAPP-LOCAL-AUTH-MIB", "cllaUserPriorityNumber"), ("CISCO-LWAPP-LOCAL-AUTH-MIB", "cllaEapMethodPacTtl"), ("CISCO-LWAPP-LOCAL-AUTH-MIB", "cllaEapAnonymousProvEnabled"), ("CISCO-LWAPP-LOCAL-AUTH-MIB", "cllaEapAuthorityId"), ("CISCO-LWAPP-LOCAL-AUTH-MIB", "cllaEapAuthorityInfo"), ("CISCO-LWAPP-LOCAL-AUTH-MIB", "cllaEapServerKey"), ("CISCO-LWAPP-LOCAL-AUTH-MIB", "cllaEapAuthorityIdLength"), ("CISCO-LWAPP-LOCAL-AUTH-MIB", "cllaEapMaxLoginIgnIdResp"), ("CISCO-LWAPP-LOCAL-AUTH-MIB", "cllaEapKeyTimeout"), ("CISCO-LWAPP-LOCAL-AUTH-MIB", "cllaEapKeyMaxRetries"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoLwappLocalAuthMIBConfigGroupSup1 = ciscoLwappLocalAuthMIBConfigGroupSup1.setStatus('current')
mibBuilder.exportSymbols("CISCO-LWAPP-LOCAL-AUTH-MIB", cllaEapProfileName=cllaEapProfileName, cllaLocalAuth=cllaLocalAuth, cllaEapProfileLocalCertificateRequired=cllaEapProfileLocalCertificateRequired, cllaUserCredential=cllaUserCredential, cllaEapProfileClientCertificateRequired=cllaEapProfileClientCertificateRequired, cllaWlanProfileTable=cllaWlanProfileTable, cllaActiveTimeout=cllaActiveTimeout, cllaUserPriorityTable=cllaUserPriorityTable, cllaEapServerKey=cllaEapServerKey, cllaEapProfileCnCertificationIdVerify=cllaEapProfileCnCertificationIdVerify, cllaEapAnonymousProvEnabled=cllaEapAnonymousProvEnabled, cllaEapKeyTimeout=cllaEapKeyTimeout, cllaConfig=cllaConfig, cllaWlanProfileName=cllaWlanProfileName, cllaEapMethodPacTtl=cllaEapMethodPacTtl, ciscoLwappLocalAuthMIBObjects=ciscoLwappLocalAuthMIBObjects, cllaEapReqTimeout=cllaEapReqTimeout, cllaEapIdentityReqMaxRetries=cllaEapIdentityReqMaxRetries, cllaEapProfileDateValidityEnabled=cllaEapProfileDateValidityEnabled, cllaEapParams=cllaEapParams, cllaEapAuthorityId=cllaEapAuthorityId, ciscoLwappLocalAuthMIBComplianceRev1=ciscoLwappLocalAuthMIBComplianceRev1, cllaEapIdentityReqTimeout=cllaEapIdentityReqTimeout, cllaEapAuthorityInfo=cllaEapAuthorityInfo, ciscoLwappLocalAuthMIB=ciscoLwappLocalAuthMIB, cllaEapKeyMaxRetries=cllaEapKeyMaxRetries, cllaEapAuthorityIdLength=cllaEapAuthorityIdLength, cllaUserPriorityNumber=cllaUserPriorityNumber, cllaEapProfileMethods=cllaEapProfileMethods, ciscoLwappLocalAuthMIBConfigGroup=ciscoLwappLocalAuthMIBConfigGroup, cllaEapProfileTable=cllaEapProfileTable, PYSNMP_MODULE_ID=ciscoLwappLocalAuthMIB, cllaWlanProfileState=cllaWlanProfileState, ciscoLwappLocalAuthMIBCompliances=ciscoLwappLocalAuthMIBCompliances, cllaEapProfileCaCertificationCheck=cllaEapProfileCaCertificationCheck, cllaEapProfileRowStatus=cllaEapProfileRowStatus, cllaEapDynamicWepKeyIndex=cllaEapDynamicWepKeyIndex, cllaEapMaxLoginIgnIdResp=cllaEapMaxLoginIgnIdResp, cllaEapProfileCertIssuer=cllaEapProfileCertIssuer, cllaUserPriorityEntry=cllaUserPriorityEntry, ciscoLwappLocalAuthMIBNotifs=ciscoLwappLocalAuthMIBNotifs, ciscoLwappLocalAuthMIBConfigGroupSup1=ciscoLwappLocalAuthMIBConfigGroupSup1, ciscoLwappLocalAuthMIBGroups=ciscoLwappLocalAuthMIBGroups, ciscoLwappLocalAuthMIBCompliance=ciscoLwappLocalAuthMIBCompliance, cllaWlanProfileEntry=cllaWlanProfileEntry, ciscoLwappLocalAuthMIBConform=ciscoLwappLocalAuthMIBConform, cllaEapProfileEntry=cllaEapProfileEntry, cllaEapReqMaxRetries=cllaEapReqMaxRetries)
|
class Human:
def method(self):
return print(f'Hello - {self}')
@classmethod
def classmethod(cls):
return print('it is a species of "Homo sapiens"')
@staticmethod
def staticmethod():
return print('Congratulations')
name_human = input('Enter your name: ')
Human.method(name_human)
Human.classmethod()
Human.staticmethod()
|
"""
Created on Oct 13, 2019
@author: majdukovic
"""
class UrlGenerator:
"""
This class builds urls
"""
def __init__(self):
self.urls_map = {
'POST_TOKEN': 'auth',
'GET_BOOKING': 'booking',
'POST_BOOKING': 'booking',
'PUT_BOOKING': 'booking',
'PATCH_BOOKING': 'booking',
'DELETE_BOOKING': 'booking'
}
def get_url(self, api_key):
"""
Return the url registered for the api_key informed.
@param api_key: The key used to register the url in the url_generator.py
"""
# Check the api alias is valid or registered already
if api_key not in self.urls_map:
raise Exception(f'API alias {api_key} is not registered in known endpoints.')
# endpoint = f'https://restful-booker.herokuapp.com/{self.urls_map[api_key]}'
endpoint = f'http://localhost:3001/{self.urls_map[api_key]}'
return endpoint
|
class DeviceBaseException(Exception):
'''
device base exception for device info
'''
message_base = 'device exception'
class DeviceNotFoundException(DeviceBaseException):
def __init__(self, device_name=None):
self.message = f'device {device_name} not found!'
def __str__(self):
return self.message
class DeviceDisconnectedException(DeviceBaseException):
def __init__(self, device_name=None):
self.message = f'device {device_name} disconnected!'
def __str__(self):
return self.message
class DeviceNotAuthException(DeviceBaseException):
def __init__(self, device_name=None):
self.message = f'device {device_name} not auth!'
def __str__(self):
return self.message
class LocalPackageNotFoundException(Exception):
def __init__(self, package=None):
self.message = f'package {package} not found on local!'
def __str__(self):
return self.message
class SetUpErrorException(Exception):
def __init__(self, err=None):
self.message = str(err)
def __str__(self):
return self.message
class InstallAppException(Exception):
def __init__(self, err=None):
self.message = f'install app error : {err}'
def __str__(self):
return self.message
class CheckScreenLockedFailed(Exception):
def __init__(self, err=None):
self.message = f'screen lock error : {err}'
def __str__(self):
return self.message
class ArgsMissingFailed(Exception):
def __init__(self, param):
self.message = f'缺少参数 {param}'
def __str__(self):
return self.message
|
"""
Views for the admin interface
"""
def includeme(config):
config.scan("admin.views")
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
SUCCESS = "0"
NEED_SMS = "1"
SMS_FAIL = "2"
|
#Vigenere cipher + b64 - substitution
'''
method = sys.argv[1]
key = sys.argv[2]
string = sys.argv[3]
'''
def encode(key, string) :
encoded_chars = []
for i in range(len(string)) :
key_c = key[i % len(key)]
encoded_c = chr(ord(string[i]) + ord(key_c) % 256)
encoded_chars.append(encoded_c)
encoded_string = "".join(encoded_chars)
return encoded_string
def decode(key, string) :
decoded_chars = []
for i in range(len(string)) :
key_c = key[i % len(key)]
decoded_c = chr(ord(string[i]) - ord(key_c) % 256)
decoded_chars.append(decoded_c)
decoded_string = "".join(decoded_chars)
return decoded_string
def mainFunc(plaintext, key, method):
if method == 'e' or method == 'E' :
print (encode(key, plaintext))
else :
print (decode(key, plaintext))
|
"""TCS module"""
#def hello(who):
# """function that greats"""
# return "hello " + who
def tcs(d):
"""TCS test function"""
return d
|
def ForceDefaultLocale(get_response):
"""
Ignore Accept-Language HTTP headers
This will force the I18N machinery to always choose settings.LANGUAGE_CODE
as the default initial language, unless another one is set via sessions or cookies
Should be installed *before* any middleware that checks request.META['HTTP_ACCEPT_LANGUAGE'],
namely django.middleware.locale.LocaleMiddleware
"""
def process_request(request):
if 'HTTP_ACCEPT_LANGUAGE' in request.META:
del request.META['HTTP_ACCEPT_LANGUAGE']
response = get_response(request)
return response
return process_request
|
def mult_by_two(num):
return num * 2
def mult_by_five(num):
return num * 5
def square(num):
return num * num
def add_one(num):
return num + 1
def apply(num, func):
return func(num)
result = apply(10, mult_by_two)
print(result)
print(apply(10, mult_by_five))
print(apply(10, square))
print(apply(10, add_one))
print(apply(10, mult_by_two))
|
class BisectionMap(object):
__slots__ = ('nodes')
#//-------------------------------------------------------//
def __init__(self, dict = {} ):
self.nodes = []
for key, value in dict.iteritems():
self[ key ] = value
#//-------------------------------------------------------//
def __findPosition( self, key ):
nodes = self.nodes
pos = 0
end = len(nodes)
while pos < end:
mid = (pos + end) // 2
if nodes[mid][0] < key:
pos = mid + 1
else:
end = mid
try:
node = nodes[pos]
if not (key < node[0]):
return pos, node
except IndexError:
pass
return pos, None
#//-------------------------------------------------------//
def __getitem__(self, key ):
pos, node = self.__findPosition( key )
if node is None:
raise KeyError(str(key))
return node[1]
#//-------------------------------------------------------//
def __setitem__(self, key, value ):
pos, node = self.__findPosition( key )
if node is not None:
node[1] = value
else:
self.nodes.insert( pos, [ key, value ] )
#//-------------------------------------------------------//
def setdefault(self, key, value = None ):
pos, node = self.__findPosition( key )
if node is not None:
return node[1]
self.nodes.insert( pos, [key, value] )
return value
#//-------------------------------------------------------//
def __delitem__(self, key):
pos, node = self.__findPosition( key )
if node is not None:
del nodes[pos]
raise KeyError(str(key))
#//-------------------------------------------------------//
def __contains__(self, key):
return self.__findPosition( key )[1] is not None
#//-------------------------------------------------------//
def has_key(self, key):
return self.__findPosition( key )[1] is not None
#//-------------------------------------------------------//
def get(self, key, default = None):
try:
return self[key]
except KeyError:
return default
#//-------------------------------------------------------//
def keys(self):
return tuple( self.iterkeys() )
#//-------------------------------------------------------//
def values(self):
return tuple( self.itervalues() )
#//-------------------------------------------------------//
def items(self):
return tuple( self.iteritems() )
#//-------------------------------------------------------//
def itervalues(self):
for node in self.nodes:
yield node[1]
#//-------------------------------------------------------//
def iterkeys(self):
for node in self.nodes:
yield node[0]
#//-------------------------------------------------------//
def iteritems(self):
for node in self.nodes:
yield ( node[0], node[1] )
#//-------------------------------------------------------//
def __iter__(self):
return self.iterkeys()
#//-------------------------------------------------------//
def clear(self):
self.nodes = []
#//-------------------------------------------------------//
def copy(self):
clone = BisectionMap()
clone.nodes = list(self.nodes)
return clone
#//-------------------------------------------------------//
def update(self, other):
for key in other.iterkeys():
self[key] = other[key]
#//-------------------------------------------------------//
def __str__(self):
return '{'+ ', '.join( map(lambda node: repr(node[0]) + ': ' + repr(node[1]), self.nodes) ) + '}'
#//-------------------------------------------------------//
def __repr__(self):
return self.__str__()
|
# YASS, Yet Another Subdomainer Software
# Copyright 2015-2019 Francesco Marano (@mrnfrancesco) and individual contributors.
#
# 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 without_duplicates(args):
"""
Removes duplicated items from an iterable.
:param args: the iterable to remove duplicates from
:type args: iterable
:return: the same iterable without duplicated items
:rtype: iterable
:raise TypeError: if *args* is not iterable
"""
if hasattr(args, '__iter__') and not isinstance(args, str):
if args:
return type(args)(set(args))
else:
return args
else:
raise TypeError("Expected iterable, got {args_type} insted".format(args_type=type(args)))
|
# Copyright 2017 The Bazel Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Support functions used when processing resources in Apple bundles."""
load("@bazel_skylib//lib:paths.bzl",
"paths")
def _bundle_relative_path(f):
"""Returns the portion of `f`'s path relative to its containing `.bundle`.
This function fails if `f` does not have an ancestor directory named with the
`.bundle` extension.
Args:
f: A file.
Returns:
The `.bundle`-relative path to the file.
"""
return paths.relativize(
f.short_path, _farthest_directory_matching(f.short_path, "bundle"))
def _farthest_directory_matching(path, extension):
"""Returns the part of a path with the given extension closest to the root.
For example, if `path` is `"foo/bar.bundle/baz.bundle"`, passing `".bundle"`
as the extension will return `"foo/bar.bundle"`.
Args:
path: The path.
extension: The extension of the directory to find.
Returns:
The portion of the path that ends in the given extension that is closest
to the root of the path.
"""
prefix, ext, _ = path.partition("." + extension)
if ext:
return prefix + ext
fail("Expected path %r to contain %r, but it did not" % (
path, "." + extension))
def _owner_relative_path(f):
"""Returns the portion of `f`'s path relative to its owner.
Args:
f: A file.
Returns:
The owner-relative path to the file.
"""
return paths.relativize(f.short_path, f.owner.package)
# Define the loadable module that lists the exported symbols in this file.
resource_support = struct(
bundle_relative_path=_bundle_relative_path,
owner_relative_path=_owner_relative_path,
)
|
# -*- coding: utf-8 -*-
test = 0
while True:
test += 1
deposits = int(input())
if deposits == 0:
break
delta = 0
print("Teste %d" % test)
for i in range(deposits):
values = input().split()
a = int(values[0])
b = int(values[1])
delta += a - b
print(delta)
print("") |
#LEETOCDE: 104. Maximum Depth of Binary Tree
class TreeNode:
def __init__(self, x):
self.val = x
self.left = None
self.right = None
def maxDepth(root: TreeNode) -> int:
if not root: return 0
else: return max(1+maxDepth(root.left), 1+maxDepth(root.right))
#TODO: Implement iterative way for a O(1) space solution
def maxDepthII(root: TreeNode) -> int:
print("PLACEHODLER")
if __name__ == "__main__":
n1 = TreeNode(1)
n2 = TreeNode(2)
n3 = TreeNode(3)
n1.left = n2
n2.left = n3
print(maxDepth(n1)) |
# Definition for a binary tree node.
# from typing import List
# class TreeNode:
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution:
def solve(self, preorder: List[int], inorder: List[int]) -> TreeNode:
if not preorder:
return None
root = TreeNode(preorder[0])
if len(inorder) == 1:
return root
root_idx_inorder = inorder.index(preorder[0])
lchild = self.solve(preorder[1:root_idx_inorder + 1], inorder[:root_idx_inorder])
rchild = self.solve(preorder[root_idx_inorder + 1:], inorder[root_idx_inorder + 1:])
root.left = lchild
root.right = rchild
return root
def buildTree(self, preorder: List[int], inorder: List[int]) -> TreeNode:
return self.solve(preorder, inorder)
|
#Tuplas, variável composta entre parenteses, são imutáveis
lanche = ('hambúrger', 'suco', 'pizza', 'pudim')
print(lanche) #todos os itens
print(lanche[3]) #item na posição 4 (item 3)
print(lanche[-1])#de trás p frente
print(lanche[:2]) #vai do 0 até o 1, ignorando o ultimo elemente, neste caso o 2
print(lanche[1:3])#vai do 1 até o 2 , ignorando o ultimo elemento, neste caso o 3
print(len(lanche))
print('-'*30)
for c in lanche:
print(f'Como {c}')
print('-'*30)
for cont in range(0, len(lanche)):
print(f'Eu comi {lanche[cont]} na posição {cont}')
print('-'*30)
for pos, comida in enumerate(lanche):
print(f'Eu vou comer {comida} na posição {pos}')
print('-'*30)
print(sorted(lanche)) #sorted, deixar em ordem
print(lanche) #deixar na ordem natural
print('-'*30)
a = (2,5,4)
b = (5,8,1,2)
d = a + b
print(d)
print(d.count(5)) #quantas vezes o 5 aparece em d
print(d.index(5)) #em que posição o 5 está, mostra o primeiro 5 que aparece |
# sorting algorithms
# mergeSort
def merge_sort(a):
n = len(a)
if n < 2:
return a
q = int(n / 2)
left = a[:q]
right = a[q:]
# print("left : {%s} , right : {%s}, A : {%s}" % (left, right, a))
merge_sort(left)
merge_sort(right)
a = merge(a, left, right)
# print("Result A ", a)
return a
def merge(a, left, right):
l = len(left)
r = len(right)
i, j, k = 0, 0, 0
# print("In merge function left : {%s} , right : {%s}, A : {%s}" % (left, right, a))
while i < l and j < r:
if left[i] <= right[j]:
a[k] = left[i]
k = k + 1
i = i + 1
else:
a[k] = right[j]
k = k + 1
j = j + 1
while i < l:
a[k] = left[i]
k = k + 1
i = i + 1
while j < r:
a[k] = right[j]
k = k + 1
j = j + 1
return a
# A=[8.01203212, 7, 6.2, 4.123122, 3-3, 43, 432, -2, 43, 42, 224, 2432, -432.0102, -42.4, -242342, -242342, 24234232,
# -4, 0, 20, 0.0001, 00.2, 00.32, -0.41, 2, 432, 2, -224223423]
A = ['A', 'B', 'C', 'EF', 'ALPHA', 'ZOOM', 'AAPPLE', 'COMP', 'JAGA', 'KKDAL']
# A = [8, 7, 6, 3, 9, -2, 19, 21, -2]
print("UnSorted list : ", A)
merge_sort(A)
print("Sorted list : ", A)
|
# AUTOGENERATED BY NBDEV! DO NOT EDIT!
__all__ = ["index", "modules", "custom_doc_links", "git_url"]
index = {"file_exists": "01_data.ipynb",
"ds_file_exists": "01_data.ipynb",
"filter_for_exists": "01_data.ipynb",
"drop_missing_files": "01_data.ipynb",
"add_ds": "01_data.ipynb",
"merge_ds": "01_data.ipynb",
"remove_special_characters": "01_data.ipynb",
"chars_to_ignore_regex": "01_data.ipynb",
"extract_all_chars": "01_data.ipynb",
"get_char_vocab": "01_data.ipynb",
"process_vocab": "01_data.ipynb",
"extract_vocab": "01_data.ipynb",
"speech_file_to_array": "01_data.ipynb",
"DataCollatorCTCWithPadding": "03_training.ipynb",
"wer_metric": "04_evaluation.ipynb",
"compute_wer_metric": "03_training.ipynb",
"evaluate_xlsr": "04_evaluation.ipynb",
"setup_wandb": "05_wandb_utils.ipynb"}
modules = ["data.py",
"augmentation.py",
"training.py",
"evaluation.py",
"wandbutils.py"]
doc_url = "https://morganmcg1.github.io/xlsr_finetune/"
git_url = "https://github.com/morganmcg1/xlsr_finetune/tree/master/"
def custom_doc_links(name): return None
|
# Copyright 2021 Jason Rumney
#
# 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
#
# https://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.
DOMAIN = "metlink"
ATTRIBUTION = "Data provided by Greater Wellington Regional Council"
CONF_STOPS = "stops"
CONF_STOP_ID = "stop_id"
CONF_DEST = "destination"
CONF_ROUTE = "route"
CONF_NUM_DEPARTURES = "num_departures"
ATTR_ACCESSIBLE = "wheelchair_accessible"
ATTR_AIMED = "aimed"
ATTR_ARRIVAL = "arrival"
ATTR_CLOSED = "closed"
ATTR_DELAY = "delay"
ATTR_DEPARTURE = "departure"
ATTR_DEPARTURES = "departures"
ATTR_DESCRIPTION = "description"
ATTR_DESTINATION = "destination"
ATTR_DESTINATION_ID = "destination_id"
ATTR_DIRECTION = "direction"
ATTR_EXPECTED = "expected"
ATTR_FAREZONE = "farezone"
ATTR_MONITORED = "monitored"
ATTR_NAME = "name"
ATTR_OPERATOR = "operator"
ATTR_ORIGIN = "origin"
ATTR_SERVICE = "service_id"
ATTR_STATUS = "status"
ATTR_STOP = "stop_id"
ATTR_STOP_NAME = "stop_name"
ATTR_VEHICLE = "vehicle_id"
|
def cria_matriz(linhas, colunas, valor):
matriz = []
for i in range(linhas):
lin = []
for j in range(colunas):
lin.append(valor)
matriz.append(lin)
return matriz
def le_matriz():
linhas = int(input("Digite a quantidade de linhas: "))
colunas = int(input("Digite a quantidade de colunas: "))
return cria_matriz(linhas, colunas)
def imprime_matriz(tabela):
for i in tabela:
print(i) |
def check(s):
if s:
print(s)
else:
print('文字列 s は None または 空文字 です。')
check('')
check(None)
check('abcdefg')
|
ELECTION_HOME="election@home"
ELECTION_VIEW="election@view"
ELECTION_META="election@meta"
ELECTION_EDIT="election@edit"
ELECTION_SCHEDULE="election@schedule"
ELECTION_EXTEND="election@extend"
ELECTION_ARCHIVE="election@archive"
ELECTION_COPY="election@copy"
ELECTION_BADGE="election@badge"
ELECTION_TRUSTEES_HOME="election@trustees"
ELECTION_TRUSTEES_VIEW="election@trustees@view"
ELECTION_TRUSTEES_NEW="election@trustees@new"
ELECTION_TRUSTEES_ADD_HELIOS="election@trustees@add-helios"
ELECTION_TRUSTEES_DELETE="election@trustees@delete"
ELECTION_TRUSTEE_HOME="election@trustee"
ELECTION_TRUSTEE_SEND_URL="election@trustee@send-url"
ELECTION_TRUSTEE_KEY_GENERATOR="election@trustee@key-generator"
ELECTION_TRUSTEE_CHECK_SK="election@trustee@check-sk"
ELECTION_TRUSTEE_UPLOAD_PK="election@trustee@upload-pk"
ELECTION_TRUSTEE_DECRYPT_AND_PROVE="election@trustee@decrypt-and-prove"
ELECTION_TRUSTEE_UPLOAD_DECRYPTION="election@trustee@upload-decryption"
ELECTION_RESULT="election@result"
ELECTION_RESULT_PROOF="election@result@proof"
ELECTION_BBOARD="election@bboard"
ELECTION_AUDITED_BALLOTS="election@audited-ballots"
ELECTION_GET_RANDOMNESS="election@get-randomness"
ELECTION_ENCRYPT_BALLOT="election@encrypt-ballot"
ELECTION_QUESTIONS="election@questions"
ELECTION_SET_REG="election@set-reg"
ELECTION_SET_FEATURED="election@set-featured"
ELECTION_SAVE_QUESTIONS="election@save-questions"
ELECTION_REGISTER="election@register"
ELECTION_FREEZE="election@freeze"
ELECTION_COMPUTE_TALLY="election@compute-tally"
ELECTION_COMBINE_DECRYPTIONS="election@combine-decryptions"
ELECTION_RELEASE_RESULT="election@release-result"
ELECTION_CAST="election@cast"
ELECTION_CAST_CONFIRM="election@cast-confirm"
ELECTION_PASSWORD_VOTER_LOGIN="election@password-voter-login"
ELECTION_CAST_DONE="election@cast-done"
ELECTION_POST_AUDITED_BALLOT="election@post-audited-ballot"
ELECTION_VOTERS_HOME="election@voters"
ELECTION_VOTERS_UPLOAD="election@voters@upload"
ELECTION_VOTERS_UPLOAD_CANCEL="election@voters@upload-cancel"
ELECTION_VOTERS_LIST="election@voters@list"
ELECTION_VOTERS_LIST_PRETTY="election@voters@list-pretty"
ELECTION_VOTERS_ELIGIBILITY="election@voters@eligibility"
ELECTION_VOTERS_EMAIL="election@voters@email"
ELECTION_VOTER="election@voter"
ELECTION_VOTER_DELETE="election@voter@delete"
ELECTION_BALLOTS_LIST="election@ballots@list"
ELECTION_BALLOTS_VOTER="election@ballots@voter"
ELECTION_BALLOTS_VOTER_LAST="election@ballots@voter@last"
|
class IdentifierLabels:
ID = "CMPLNT_NUM"
class DateTimeEventLabels:
EVENT_START_TIMESTAMP = "CMPLNT_FR_DT"
EVENT_END_TIMESTAMP = "CMPLNT_TO_DT"
class DateTimeSubmissionLabels:
SUBMISSION_TO_POLICE_TIMESTAMP = "RPT_DT"
class LawBreakingLabels:
KEY_CODE = "KY_CD"
PD_CODE = "PD_CD"
LAW_BREAKING_LEVEL = "LAW_CAT_CD"
class EventStatusLabels:
EVENT_STATUS = "CRM_ATPT_CPTD_CD"
class EventSurroundingsLabels:
PLACE_TYPE = "PREM_TYP_DESC"
PLACE_TYPE_POSITION = "LOC_OF_OCCUR_DESC"
class EventLocationLabels:
PRECINCT_CODE = "ADDR_PCT_CD"
BOROUGH_NAME = "BORO_NM"
LATITUDE = "Latitude"
LONGITUDE = "Longitude"
class SuspectLabels:
SUSPECT_AGE_GROUP = "SUSP_AGE_GROUP"
SUSPECT_RACE = "SUSP_RACE"
SUSPECT_SEX = "SUSP_SEX"
class VictimLabels:
VICTIM_AGE_GROUP = "VIC_AGE_GROUP"
VICTIM_RACE = "VIC_RACE"
VICTIM_SEX = "VIC_SEX"
|
class Solution:
def longestArithSeqLength(self, A: List[int]) -> int:
if len(A) <= 2:
return len(A)
ans = 2
dp = collections.defaultdict(set)
for i, num in enumerate(A):
if num in dp:
for d, cnt in dp.pop(num):
dp[num + d].add((d, cnt + 1))
ans = max(ans, cnt + 1)
for j in range(i):
first = A[j]
dp[num * 2 - first].add((num - first, 2))
return ans
|
"""
- Os valores podem ser formatados utilizando a função format ou até mesmo com f strings
- As formatações obedecem as regras
- :s -> Texto(strings)
- :d -> Inteiros(int)
- :f -> Números de pinto flutuante
"""
number1 = 10
number2 = 3
divison = number1 / number2
# Formatando em casas decimais com format
print('{:.2f}'.format(divison))
# Formatando em casas decimais com fstring
print(f'{divison:.2f}')
# Podemos formatar contando digitos / caracter e preencher com zeros ou caracter
# > (Esquerda); < (Direita); ^ (Centro)
number3 = 1
print(f'{number3:0<10d}') |
H, W = map(int, input().split())
A = [list(map(int, input().split())) for _ in range(H)]
for i1 in range(H):
for i2 in range(i1 + 1, H):
for j1 in range(W):
for j2 in range(j1 + 1, W):
if A[i1][j1] + A[i2][j2] > A[i2][j1] + A[i1][j2]:
print('No')
exit()
print('Yes')
|
# s.remove(0)
s = {1, 2, 3}
s.remove(0)
print(s)
# bug as it should return a KeyError exception !!!
|
#! /usr/bin/python3
# -*- coding: utf-8 -*-
# @Time : 2019/3/9 2:26 PM
# @Author : xiaoliji
# @Email : yutian9527@gmail.com
"""
替换空格
>>> s = 'We are happy.'
>>> replace_space(s)
'We%20are%20happy.'
>>> s1 = 'We are very happy!'
>>> replace_space(s1)
'We%20are%20very%20%20happy!'
"""
def replace_space(s: str) -> str:
return ''.join(c if c!=' ' else '%20' for c in s)
|
""" Créations d'un dictionnaire vide"""
d = dict()
d = {}
""" Création d'un dictionnaire avec des clés et valeurs"""
d1 = {"P1" : ["Marie", "Smith"], "P2": ["John", "Smith"]}
""" ajout d'un couple clé/valeur"""
d1["P3"]= ["John", "Doe"]
d1[-13]= "Hello world" # les clés et valeur peuvent être de n'importe quel type
""" accès à l'ensembe des clés/ valeurs"""
d1.keys()
d1.values()
""" affichage """
print(d1) |
# NÃO ESTÁ COMPLETO E NEM GARANTO CERTEZA EM TODOS OS VALORES
LUCRO_LIQUIDO = {
'ambev_2019_1T.pdf': 2749.1,
'engie_2019_2T.pdf': 385.4,
'engie_2020_2T.pdf': 765.8,
'fleury_2019_3T.pdf': 94.8,
'fleury_2020_2T.pdf': -73.3,
'gerdau20153T': -193,
'gerdau_2017_1T.pdf': 824.0,
'gerdau_2018_4T.pdf': 389.0,
'gerdau_2019_2T.pdf': 373.0,
'weg_2010_2T.pdf': 116.1,
'weg_2015_1T.pdf': 245.9,
'weg_2017_2T.pdf': 272.2,
'weg_2019_2T.pdf': 389.0
}
PATRIMONIO_LIQUIDO = {
'ambev_2019_1T.pdf': 60490.0,
'engie_2019_2T.pdf': 7194673.0,
'engie_2020_2T.pdf': 7434743,
'fleury_2019_3T.pdf': 1750.1,
'fleury_2020_2T.pdf': 1549453.0,
'gerdau_2015_3T.pdf': 36012381.0,
'gerdau_2017_1T.pdf': 24916345.0,
'gerdau_2018_4T.pdf': 25938571.0,
'gerdau_2019_2T.pdf': 26568445.0,
'weg_2010_2T.pdf': 2445405.0,
'weg_2015_1T.pdf': 5302661.0,
'weg_2017_2T.pdf': 6348046.0,
'weg_2019_2T.pdf': 8017
}
ROE = {
'ambev_2019_1T.pdf': 4.566043974210613,
'engie_2019_2T.pdf': 0.005356741022142354,
'engie_2020_2T.pdf': 0.010300288792766609,
'fleury_2019_3T.pdf': 5.416833323810068,
'fleury_2020_2T.pdf': -0.004730701737968173,
'gerdau20153T': -0.53,
'gerdau_2017_1T.pdf': 3.33,
'gerdau20184T': 1.49,
'gerdau_2019_2T.pdf': 1.403921080063210,
'weg_2010_2T.pdf': 0.004747679832175038, # diff from fundamentus.com.br
'weg_2015_1T.pdf': 4.63,
'weg_2017_2T.pdf': 0.0042879336413126174,
'weg_2019_2T.pdf': 4.85
}
|
class Contacts:
def __init__(self, first_name=None, last_name=None, id=None, email_1=None, email_2=None, email_3=None,
home_phone=None, mobile_phone=None, work_phone=None):
self.first_name = first_name
self.last_name = last_name
self.mobile_phone = mobile_phone
self.home_phone = home_phone
self.work_phone = work_phone
self.id = id
self.email_1 = email_1
self.email_2 = email_2
self.email_3 = email_3
def __eq__(self, other):
return (self.id == other.id or self.id is None or other.id is None) \
and self.first_name == other.first_name and self.last_name==other.last_name |
# Given a 2D matrix matrix, find the sum of the elements inside the rectangle defined by its upper left corner (row1, col1)
# and lower right corner (row2, col2).
# Range Sum Query 2D
# The above rectangle (with the red border) is defined by (row1, col1) = (2, 1) and (row2, col2) = (4, 3),
# which contains sum = 8.
# Example:
# Given matrix = [
# [3, 0, 1, 4, 2],
# [5, 6, 3, 2, 1],
# [1, 2, 0, 1, 5],
# [4, 1, 0, 1, 7],
# [1, 0, 3, 0, 5]
# ]
# sumRegion(2, 1, 4, 3) -> 8
# update(3, 2, 2)
# sumRegion(2, 1, 4, 3) -> 10
# Note:
# The matrix is only modifiable by the update function.
# You may assume the number of calls to update and sumRegion function is distributed evenly.
# You may assume that row1 ≤ row2 and col1 ≤ col2.
class NumMatrix(object):
# 行之和 前缀数组
def __init__(self, matrix):
"""
:type matrix: List[List[int]]
"""
self.matrix = matrix
self.rows = []
for row in matrix:
acc = []
curr_acc = 0
for ele in row:
curr_acc += ele
acc.append(curr_acc)
self.rows.append(acc)
def update(self, row, col, val):
"""
:type row: int
:type col: int
:type val: int
:rtype: None
"""
target_row = self.rows[row]
dif = val - self.matrix[row][col]
self.matrix[row][col] = val
for i in range(col, len(self.rows[row])):
target_row[i] += dif
def sumRegion(self, row1, col1, row2, col2):
"""
:type row1: int
:type col1: int
:type row2: int
:type col2: int
:rtype: int
"""
if col1 != 0:
return sum([self.rows[i][col2] - self.rows[i][col1 - 1] for i in range(row1, row2 + 1)])
else:
return sum([self.rows[i][col2] for i in range(row1, row2 + 1)])
# Your NumMatrix object will be instantiated and called as such:
# obj = NumMatrix(matrix)
# obj.update(row,col,val)
# param_2 = obj.sumRegion(row1,col1,row2,col2) |
"""
CRUD system for Task
Create, Read, Update, Delete
"""
# Create Task
def create_task():
"""
Create a task into the database
""" |
'''
The rows of levels in the .azr file are converted to list of strings. These
indices make it more convenient to access the desired parameter.
'''
J_INDEX = 0
PI_INDEX = 1
ENERGY_INDEX = 2
ENERGY_FIXED_INDEX = 3
CHANNEL_INDEX = 5
WIDTH_INDEX = 11
WIDTH_FIXED_INDEX = 10
SEPARATION_ENERGY_INDEX = 21
CHANNEL_RADIUS_INDEX = 27
OUTPUT_DIR_INDEX = 2
DATA_FILEPATH_INDEX = 11
LEVEL_INCLUDE_INDEX = 9
'''
Data-related constants.
'''
INCLUDE_INDEX = 0
IN_CHANNEL_INDEX = 1
OUT_CHANNEL_INDEX = 2
NORM_FACTOR_INDEX = 8
VARY_NORM_FACTOR_INDEX = 9
FILEPATH_INDEX = 11
|
class ModelMinxi:
def to_dict(self,*exclude):
attr_dict = {}
for field in self._meta.fields:
name = field.attname
if name not in exclude:
attr_dict[name] = getattr(self,name)
return attr_dict |
"""
**********
LESSON 1A
**********
In the following code (lines 12-17), change x to 10, and then print out whether
or not x is 10.
"""
x = 5
if x == 5:
print("x is five!")
else:
print("x is not five...")
"""
Expected solution:
x = 10
if x == 10:
print("x is ten!")
else:
print("x is not ten...")
""" |
# in not in 重载
# contains
class MyList:
def __init__(self, iterator):
self.data = [x for x in iterator]
def __repr__(self):
return "MyList(%r)" % self.data
def __contains__(self, e):
return e in self.data
l1 = MyList([1, 2, 3])
print(1 in l1) # True
print(1 not in l1) # False
print(4 in l1) # False
|
"""248-Get current file name and path.
Download all snippets so far:
https://wp.me/Pa5TU8-1yg
Blog: stevepython.wordpress.com
requirements: None.
origin: Various.
"""
# To get the name and path of the current file in use:
print(__file__)
|
numbers = []
for i in range(1,101) :
numbers.append(i)
prime_number = []
for number in numbers :
zero_mod = []
if number == 1 :
continue
else :
for divider in range(1,number+1) :
remain = number % divider
if remain == 0 :
zero_mod.append(divider)
if len(zero_mod) == 2 :
prime_number.append(number)
print(prime_number)
|
def get_data():
data = []
data_file = open("data.txt")
# data_file = open("test.txt")
for val in data_file:
data.append(val.strip())
data_file.close()
cubes = {}
for row in range(len(data)):
for col in range(len(data[row])):
if data[row][col] == '#':
cubes[f'{row}|{col}|0|0'] = 1
print(f"read {len(data)} lines\n")
return cubes
def print_state(cube_active_neighbor_counts, active_cubes):
for z in range(-7, 8):
print(f'z:{z}')
for x in range(-7, 8):
count_line = ''
active_line = ''
for y in range(-7, 8):
cube_location = f'{x}|{y}|{z}'
spacer = ' '
if cube_location == '0|0|0':
spacer = '<'
if cube_location in cube_active_neighbor_counts:
count_line += str(
cube_active_neighbor_counts[cube_location]) + spacer
else:
count_line += ' '
active = '#'
inactive = '.'
if cube_location == '0|0|0':
active = '*'
inactive = '+'
if cube_location in active_cubes:
active_line += active
else:
active_line += inactive
print(active_line, ' ', count_line)
def check_data(active_cubes):
for cycle in range(6):
print(f'\nCycle: {cycle + 1}')
cube_active_neighbor_counts = {}
for cube in active_cubes:
cx, cy, cz, cw = [int(c) for c in cube.split('|')]
# set neighbor counts
# print(cube)
for x in range(cx-1, cx+2):
for y in range(cy-1, cy+2):
for z in range(cz-1, cz+2):
for w in range(cw-1, cw+2):
cube_location = f'{x}|{y}|{z}|{w}'
if not (cube_location == cube):
if cube_location in cube_active_neighbor_counts:
cube_active_neighbor_counts[cube_location] += 1
else:
cube_active_neighbor_counts[cube_location] = 1
else:
if cube_location not in cube_active_neighbor_counts:
cube_active_neighbor_counts[cube_location] = 0
# print(cube_location,
# cube_active_neighbor_counts[cube_location])
# now make new cubes
new_cubes = {}
for cube_location in cube_active_neighbor_counts:
is_active = False
if cube_location in active_cubes:
is_active = active_cubes[cube_location]
if is_active and (cube_active_neighbor_counts[cube_location] == 2 or
cube_active_neighbor_counts[cube_location] == 3):
new_cubes[cube_location] = 1
if not (is_active) and cube_active_neighbor_counts[cube_location] == 3:
new_cubes[cube_location] = 1
active_cubes = new_cubes
print(f'Active Cube Count: {len(active_cubes)}')
# print_state(cube_active_neighbor_counts, active_cubes)
print(len(active_cubes))
def main():
data = get_data()
check_data(data)
main()
# track only live cubes
# track them as x-y-z strings in a hash
# so '1-2-1' in the hash means that cube is live.
|
# Write a python program to get a single string from two givan string, separated by a space
# and swap a first two char of each string
# Simple string = "abc", "xyz"
# Expected result = "xyc", "abz"
# st = "abc", "xyz"
# print(st[1][:2] + st[0][-1:])
# print(st[0][:2] + st[1][-1:])
def char_swap(a, b):
x = b[:2] + a[2:]
y = a[:2] + b[2:]
return x + " " + y
if __name__ == "__main__":
print(char_swap("abc", "xyz"))
|
'''
Write a function that takes variable number of arguments and returns the sum , sum of squares, sum of
cubes, average, multiplication, multiplication of squares, multiplication of cubes of that numbers.
'''
def calc(*a):
sum = 0
mul = 1
sumSQR = 0
sumCubes = 0
mulSQR = 1
mulCubes = 1
for i in a:
sum = sum+i
mul = mul*i
sumSQR = sumSQR+(i**2)
sumCubes = sumCubes+ (i**3)
mulSQR = mulSQR*(i**2)
mulCubes = mulCubes*(i**3)
return sum,mul,sumSQR,sumCubes,mulSQR,mulCubes
#Call
sum,mul,sumSQR,sumCubes,mulSQR,mulCubes=calc(1,2,4,5,6,7,8)
print("sum = {},mul= {},sumSQR= {},sumCubes={},mulSQR={},mulCubes={}".format(sum,mul,sumSQR,sumCubes,mulSQR,mulCubes))
|
# URLs
MEXC_BASE_URL = "https://www.mexc.com"
MEXC_SYMBOL_URL = '/open/api/v2/market/symbols'
MEXC_TICKERS_URL = '/open/api/v2/market/ticker'
MEXC_DEPTH_URL = '/open/api/v2/market/depth?symbol={trading_pair}&depth=200'
MEXC_PRICE_URL = '/open/api/v2/market/ticker?symbol={trading_pair}'
MEXC_PING_URL = '/open/api/v2/common/ping'
MEXC_PLACE_ORDER = "/open/api/v2/order/place"
MEXC_ORDER_DETAILS_URL = '/open/api/v2/order/query'
MEXC_ORDER_CANCEL = '/open/api/v2/order/cancel'
MEXC_BATCH_ORDER_CANCEL = '/open/api/v2/order/cancel'
MEXC_BALANCE_URL = '/open/api/v2/account/info'
MEXC_DEAL_DETAIL = '/open/api/v2/order/deal_detail'
# WS
MEXC_WS_URL_PUBLIC = 'wss://wbs.mexc.com/raw/ws'
|
CONFUSION_MATRIX = "confusion_matrix"
AP = "ap"
DETECTION_AP = "detection_mAP"
DETECTION_APS = "detection_APs"
MOTA = "MOTA"
MOTP = "MOTP"
FALSE_POSITIVES = "false_positives"
FALSE_NEGATIVES = "false_negatives"
ID_SWITCHES = "id_switches"
AP_INTERPOLATED = "ap_interpolated"
ERRORS = "errors"
IOU = "iou"
BINARY_IOU = "binary_IOU"
RANKS = "ranks"
DT_NEG = "u0"
DT_POS = "u1"
CLICKS = "clicks"
FORWARD_INTERACTIVE = "forward_interactive"
FORWARD_RECURSIVE = "forward_recursive"
ONESHOT_INTERACTIVE = "oneshot_interactive"
ITERATIVE_FORWARD = "iterative_forward"
INTERACTIVE_DT_METHOD = "dt_method"
DT_NEG_PARAMS = "dt_neg_params"
DT_POS_PARAMS = "dt_pos_params"
USE_CLICKS = "use_clicks"
OLD_LABEL_AS_DT = "old_label_as_distance_transform"
STRATEGY = "STRATEGY"
IGNORE_CLASSES = "ignore_classes"
DT_FN_ARGS = "distance_transform_fn_args"
# Train recursively - add a click based on the previous output mask for the interactive correction network.
RECURSIVE_TRAINING = "recursive_training"
YS_ARGMAX = "ys_argmax"
TAGS = "tags"
BBOXES = "bboxes"
IGNORE_REGIONS = "ignore_regions"
CLASSES = "classes"
IDS = "ids"
UNNORMALIZED_IMG = "unnormalized_img"
IMG_IDS = "img_ids"
ORIGINAL_SIZES = "original_size"
RESIZED_SIZES = "resized_size"
CLUSTER_IDS = "cluster_ids"
ORIGINAL_LABELS = "original_labels"
ADJUSTED_MUTUAL_INFORMATION = "AMI"
HOMOGENEITY = "homogeneity"
COMPLETENESS = "completeness"
EMBEDDING = "embedding"
PREV_NEG_CLICKS = 'prev_neg_clicks'
PREV_POS_CLICKS = 'prev_pos_clicks'
SCENE_INFOS = "scene_infos"
LABELS = "labels"
INPUTS = "inputs"
BYPASS_MASKS_FLAG = "bypass_masks_flag"
|
class GitRequire(object):
def __init__(self, git_url=None, branch=None, submodule=False):
self.git_url = git_url
self.submodule = submodule
self.branch = branch
def clone_params(self):
clone_params = {"single_branch": True}
if self.branch is not None:
clone_params["branch"] = self.branch
return clone_params
def __eq__(self, other):
return (
self.git_url == other.git_url
and self.submodule == other.submodule
and self.branch == other.branch
)
def __repr__(self):
return "%s,%s,%s" % (self.git_url, self.branch, self.submodule)
|
# Object in Python do not have a fixed layout.
class X:
def __init__(self, a):
self.a = a
x = X(1)
print(x.a) # 1
# For example, we can add new attributes to objects:
x.b = 5
print(x.b) # 5
# Or even new methods into a class:
X.foo = lambda self: 10
print(x.foo()) # 10
# Or even changing base classes during runtime (this is just for illustration,
# I do not recommend doing this in practice):
class A:
def foo(self):
return 1
class B(A):
pass
class C:
def foo(self):
return 2
b = B()
print(b.foo(), B.__bases__) # 1 (<class '__main__.A'>,)
B.__bases__ = (C,)
print(b.foo(), B.__bases__) # 2 (<class '__main__.C'>,)
|
# encoding: utf-8
# module _locale
# from (built-in)
# by generator 1.145
""" Support for POSIX locales. """
# no imports
# Variables with simple values
ABDAY_1 = 131072
ABDAY_2 = 131073
ABDAY_3 = 131074
ABDAY_4 = 131075
ABDAY_5 = 131076
ABDAY_6 = 131077
ABDAY_7 = 131078
ABMON_1 = 131086
ABMON_10 = 131095
ABMON_11 = 131096
ABMON_12 = 131097
ABMON_2 = 131087
ABMON_3 = 131088
ABMON_4 = 131089
ABMON_5 = 131090
ABMON_6 = 131091
ABMON_7 = 131092
ABMON_8 = 131093
ABMON_9 = 131094
ALT_DIGITS = 131119
AM_STR = 131110
CHAR_MAX = 127
CODESET = 14
CRNCYSTR = 262159
DAY_1 = 131079
DAY_2 = 131080
DAY_3 = 131081
DAY_4 = 131082
DAY_5 = 131083
DAY_6 = 131084
DAY_7 = 131085
D_FMT = 131113
D_T_FMT = 131112
ERA = 131116
ERA_D_FMT = 131118
ERA_D_T_FMT = 131120
ERA_T_FMT = 131121
LC_ALL = 6
LC_COLLATE = 3
LC_CTYPE = 0
LC_MESSAGES = 5
LC_MONETARY = 4
LC_NUMERIC = 1
LC_TIME = 2
MON_1 = 131098
MON_10 = 131107
MON_11 = 131108
MON_12 = 131109
MON_2 = 131099
MON_3 = 131100
MON_4 = 131101
MON_5 = 131102
MON_6 = 131103
MON_7 = 131104
MON_8 = 131105
MON_9 = 131106
NOEXPR = 327681
PM_STR = 131111
RADIXCHAR = 65536
THOUSEP = 65537
T_FMT = 131114
T_FMT_AMPM = 131115
YESEXPR = 327680
_DATE_FMT = 131180
# functions
def bindtextdomain(domain, dir): # real signature unknown; restored from __doc__
"""
bindtextdomain(domain, dir) -> string
Bind the C library's domain to dir.
"""
return ""
def bind_textdomain_codeset(domain, codeset): # real signature unknown; restored from __doc__
"""
bind_textdomain_codeset(domain, codeset) -> string
Bind the C library's domain to codeset.
"""
return ""
def dcgettext(domain, msg, category): # real signature unknown; restored from __doc__
"""
dcgettext(domain, msg, category) -> string
Return translation of msg in domain and category.
"""
return ""
def dgettext(domain, msg): # real signature unknown; restored from __doc__
"""
dgettext(domain, msg) -> string
Return translation of msg in domain.
"""
return ""
def gettext(msg): # real signature unknown; restored from __doc__
"""
gettext(msg) -> string
Return translation of msg.
"""
return ""
def localeconv(*args, **kwargs): # real signature unknown
""" () -> dict. Returns numeric and monetary locale-specific parameters. """
pass
def nl_langinfo(key): # real signature unknown; restored from __doc__
"""
nl_langinfo(key) -> string
Return the value for the locale information associated with key.
"""
return ""
def setlocale(*args, **kwargs): # real signature unknown
""" (integer,string=None) -> string. Activates/queries locale processing. """
pass
def strcoll(*args, **kwargs): # real signature unknown
""" string,string -> int. Compares two strings according to the locale. """
pass
def strxfrm(string): # real signature unknown; restored from __doc__
"""
strxfrm(string) -> string.
Return a string that can be used as a key for locale-aware comparisons.
"""
pass
def textdomain(domain): # real signature unknown; restored from __doc__
"""
textdomain(domain) -> string
Set the C library's textdmain to domain, returning the new domain.
"""
return ""
# classes
class Error(Exception):
# no doc
def __init__(self, *args, **kwargs): # real signature unknown
pass
__weakref__ = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""list of weak references to the object (if defined)"""
class __loader__(object):
"""
Meta path import for built-in modules.
All methods are either class or static methods to avoid the need to
instantiate the class.
"""
@classmethod
def create_module(cls, *args, **kwargs): # real signature unknown
""" Create a built-in module """
pass
@classmethod
def exec_module(cls, *args, **kwargs): # real signature unknown
""" Exec a built-in module """
pass
@classmethod
def find_module(cls, *args, **kwargs): # real signature unknown
"""
Find the built-in module.
If 'path' is ever specified then the search is considered a failure.
This method is deprecated. Use find_spec() instead.
"""
pass
@classmethod
def find_spec(cls, *args, **kwargs): # real signature unknown
pass
@classmethod
def get_code(cls, *args, **kwargs): # real signature unknown
""" Return None as built-in modules do not have code objects. """
pass
@classmethod
def get_source(cls, *args, **kwargs): # real signature unknown
""" Return None as built-in modules do not have source code. """
pass
@classmethod
def is_package(cls, *args, **kwargs): # real signature unknown
""" Return False as built-in modules are never packages. """
pass
@classmethod
def load_module(cls, *args, **kwargs): # real signature unknown
"""
Load the specified module into sys.modules and return it.
This method is deprecated. Use loader.exec_module instead.
"""
pass
def module_repr(module): # reliably restored by inspect
"""
Return repr for the module.
The method is deprecated. The import machinery does the job itself.
"""
pass
def __init__(self, *args, **kwargs): # real signature unknown
pass
__weakref__ = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""list of weak references to the object (if defined)"""
__dict__ = None # (!) real value is ''
# variables with complex values
__spec__ = None # (!) real value is ''
|
class Solution:
# @param A : list of strings
# @return a strings
def longestCommonPrefix(self, A):
common_substring = ""
if A:
common_substring = A[0]
for s in A[1:]:
i = 0
l = len(min(common_substring, s))
while i < l:
if s[i] != common_substring[i]:
break
else:
i += 1
common_substring = common_substring[:i]
return common_substring
s = Solution()
print(s.longestCommonPrefix(["abcdefgh", "abefghijk", "abcefgh"]))
print(s.longestCommonPrefix([ "aaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" ])) |
# Link to the problem: https://www.codechef.com/LTIME63B/problems/EID
def EID():
_ = input()
A = list(map(int, input().split()))
A.sort()
size = len(A)
diff = A[size - 1]
for i in range(size - 1):
tempDiff = A[i + 1] - A[i]
if tempDiff < diff:
diff = tempDiff
return diff
def main():
T = int(input())
while T:
T -= 1
res = EID()
print(res)
if __name__ == "__main__":
main() |
monster = ['fairy', 'goblin', 'ogre', 'werewolf',
'vampire', 'gargoyle', 'pirate', 'undead']
weapon1 = ['dagger', 'stone', 'pistol', 'knife']
weapon2 = ['sword', 'war hammer', 'machine gun', 'battle axe', 'war scythe']
scene = ['grass and yellow wildflowers.',
'sand and sea shells',
'sand and cactus']
place = ['field', 'beach', 'jungle', 'dessert', 'rainforest', 'city']
|
# if-elif-else ladder
'''
if is a conditional statement that is used to perform different actions based on different conditions.
'''
if (5 < 6):
print('5 is less than 6')
print()
print()
a = 6
if (a == 5):
print('a is equal to 5')
else:
print('a is not equal to 5')
print()
print()
a = 6
b = 5
if (a < b):
print('a is less than b')
elif (a == b):
print('a is equal to b')
else:
print('a is greater than b')
# elif stands for `else if`
'''
On comaparing 2 numbers, we get one of the following 3 results:
- a is less than b
- a is equal to b
- a is greater than b
'''
print()
print()
if (a < b):
print('a is less than b')
elif (a == b):
print('a is equal to b')
elif (a > b):
print('a is greater than b')
'''
Conclusion:
- An if statement states whether to execute some code or not.
- An elif statement states the same as if, but is executed only if the previous if statement is not true.
- An else statement is executed if all the previous conditions are not true.
'''
'''
NOTE:
If a if condition is true, then the code under the if block is executed and the successive elif and else blocks are not executed.
''' |
def conta_votos(lista_candidatos_numeros, lista_votos, numeros):
brancos = 0
nulos = 0
contagem_geral = []
for i in range(len(lista_candidatos_numeros)):
contagem_individual = [lista_candidatos_numeros[i][0], numeros[i], 0]
contagem_geral.append(contagem_individual)
for v in votos:
if v in numeros:
for c in range(len(lista_candidatos_numeros)):
if v == lista_candidatos_numeros[c][1]:
contagem_geral[c][2] += 1
elif v == 0:
brancos += 1
else:
nulos += 1
print("-----------------------------")
for candidato in contagem_geral:
print(candidato[0], "-", candidato[1], "- com ", candidato[2], " voto(s)")
print("Brancos - com ", brancos, " voto(s)")
print("Nulos - com ", nulos, " voto(s)")
print("-----------------------------")
n = int(input())
cadidatos_numeros = []
numeros = []
for i in range(n):
nome_numero = []
x = input().split("#")
nome_numero.append(x[0])
nome_numero.append(int(x[1]))
numeros.append(int(x[1]))
cadidatos_numeros.append(nome_numero)
voto = int(input())
votos = []
while voto >= 0:
votos.append(voto)
voto = int(input())
conta_votos(cadidatos_numeros, votos, numeros) |
global T_D,EPS,MU,ETA,dt
T_D = 12.0
L0 = 1.0
EPS = 0.05
# Osborne 2017 params
MU = -50.
ETA = 1.0
dt = 0.005 #hours
|
class Solution:
def numberOfArithmeticSlices(self, nums: List[int]) -> int:
if len(nums)<3:
return 0
output=[]
slices=[nums[0], nums[1]]
for num in nums[2:]:
if num-slices[-1]==slices[1]-slices[0]:
slices.append(num)
else:
if len(slices)>=3:
output.append(slices)
slices=[slices[-1], num]
output.append(slices)
result = 0
for o in output:
result+= int((len(o)-2)*(len(o)-1)/2)
return result |
# Definition for a binary tree node.
class TreeNode:
def __init__(self, x):
self.val = x
self.left = None
self.right = None
class Solution:
def isSymmetric(self, root: TreeNode) -> bool:
if not root:
return True
return self.isSymmetricHelper(root.left, root.right)
def isSymmetricHelper(self, leftNode: TreeNode, rightNode: TreeNode) -> bool:
if not leftNode and not rightNode:
return True
if not leftNode or not rightNode:
return False
if leftNode.val != rightNode.val:
return False
return self.isSymmetricHelper(leftNode.left, rightNode.right) and self.isSymmetricHelper(leftNode.right, rightNode.left) |
value = int(input("请输入你的成绩:"))
if value > 60:
print("你的成绩及格了")
else:
print("你的成绩有待重新确认")
|
# Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by 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 preprocess_input(x, data_format=None, mode=None):
if mode == 'tf':
x /= 127.5
x -= 1.
return x
elif mode == 'torch':
x /= 255.
mean = [0.485, 0.456, 0.406]
std = [0.229, 0.224, 0.225]
elif mode == 'caffe':
if data_format == 'channels_first':
# 'RGB'->'BGR'
if x.ndim == 3:
x = x[::-1, ...]
else:
x = x[:, ::-1, ...]
else:
# 'RGB'->'BGR'
x = x[..., ::-1]
mean = [103.939, 116.779, 123.68]
std = None
elif mode == 'tfhub':
x /= 255.
return x
else:
return x
# Zero-center by mean pixel
if data_format == 'channels_first':
if x.ndim == 3:
x[0, :, :] -= mean[0]
x[1, :, :] -= mean[1]
x[2, :, :] -= mean[2]
if std is not None:
x[0, :, :] /= std[0]
x[1, :, :] /= std[1]
x[2, :, :] /= std[2]
else:
x[:, 0, :, :] -= mean[0]
x[:, 1, :, :] -= mean[1]
x[:, 2, :, :] -= mean[2]
if std is not None:
x[:, 0, :, :] /= std[0]
x[:, 1, :, :] /= std[1]
x[:, 2, :, :] /= std[2]
else:
x[..., 0] -= mean[0]
x[..., 1] -= mean[1]
x[..., 2] -= mean[2]
if std is not None:
x[..., 0] /= std[0]
x[..., 1] /= std[1]
x[..., 2] /= std[2]
return x
|
### Insertion Sort - Part 2 - Solution
def insertionSort2(nums):
for i in range(1, len(nums)):
comp, prev = nums[i], i-1
while (prev >= 0) and (nums[prev] > comp):
nums[prev+1] = nums[prev]
prev -= 1
nums[prev+1] = comp
print(*nums)
n = int(input())
nums = list(map(int, input().split()[:n]))
insertionSort2(nums) |
### CLASSES
class TrackPoint:
def __init__(self, time, coordinates, alt):
self.time = time
self.coordinates = coordinates
self.alt = alt
def __repr__(self):
return "%s %s %dm" % (self.time.strftime("%H:%m:%S"), self.coordinates, self.alt)
|
VARS = [
{'name': 'script_name',
'required': True,
'example': 'fancy_script'},
{'name': 'description',
'example': 'Super fancy script'}
]
|
# Programação Orientada a Objetos
# AC01 ADS-EaD - Números especiais
#
# Email Impacta: lucas.2103070@aluno.faculdadeimpacta.com.br
def eh_primo(n):
qtd_divisores = 0
candidato = 1
while candidato <= n:
if n % candidato == 0:
qtd_divisores += 1
candidato += 1
if qtd_divisores == 2:
return True
else:
return False
def lista_primos(n):
lista = []
for i in range(2, n):
if eh_primo(i):
lista.append(i)
return lista
def conta_primos(s):
dicionario = {}
for item in s:
if eh_primo(item):
if item in dicionario:
dicionario[item] += 1
else:
dicionario[item] = 1
return dicionario
def eh_armstrong(n):
n = str(n)
soma = 0
for i in range(len(n)):
soma += int(n[i])**len(n)
if soma == int(n):
return True
else:
return False
def eh_quase_armstrong(n):
n = str(n)
soma = 0
for i in range(len(n)):
soma += int(n[i])**len(n)
if soma == int(n) + 1 or soma == int(n)-1:
return True
else:
return False
def lista_armstrong(n):
lista = []
for i in range(0, n):
if eh_armstrong(i):
lista.append(i)
return lista
def eh_perfeito(n):
soma = 0
for i in range (1, n):
if n % i == 0:
soma += i
if soma == n:
return True
else:
return False
def lista_perfeitos(n):
lista = []
for i in range(1,n):
if eh_perfeito(i):
lista.append(i)
return lista
|
def test_api_docs(api_client):
rv = api_client.get("/apidocs", follow_redirects=True)
assert rv.status_code == 200
assert b"JournalsDB API Docs" in rv.data
|
# Solution A
class Solution:
def isLongPressedName(self, name: str, typed: str) -> bool:
i = 0
name += "1"
for s in typed:
if s == name[i]:
i += 1
elif s != name[i - 1]:
return False
return i == len(name) - 1
# Solution B
class Solution:
def isLongPressedName(self, name: str, typed: str) -> bool:
i, j = 0, 0
m, n = len(name), len(typed)
while j < n:
if i < m and name[i] == typed[j]:
i += 1
elif j == 0 or typed[j - 1] != typed[j]:
return False
j += 1
return i == m
|
#!/usr/bin/env python
# coding: utf-8
# # Re-implement some Python built-in functions
# In[1]:
def my_max(l1):
max_number = l1[0]
for number in l1:
if number > max_number:
max_number = number
return max_number
# In[2]:
def my_min(l1):
min_number = l1[0]
for number in l1:
if number < min_number:
min_number = number
return min_number
# In[3]:
def my_sum(l1):
total = 0
for number in l1:
total += number
return total
# In[4]:
def my_len(l1):
count = 0
for i in l1:
count += 1
return count
# In[5]:
def my_divmod(x, y):
result = x // y
reminder = x % y
return result, reminder
# In[6]:
def my_power(x, y):
return x ** y
# In[7]:
def my_abs(x):
if x >= 0:
return x
else:
return x * -1
# # # calls
#
# # In[8]:
#
#
# print(my_max([1, 2, 5]))
#
#
# # In[9]:
#
#
# print(my_min([1, 2, 5]))
#
#
# # In[10]:
#
#
# print(my_sum([1, 2, 5]))
#
#
# # In[11]:
#
#
# print(my_len([1, 2, 5]))
#
#
# # In[12]:
#
#
# print(my_divmod(23, 5))
#
#
# # In[13]:
#
#
# print(my_power(23, 5))
#
#
# # In[14]:
#
#
# print(my_abs(-12))
|
dinheiro = int(input('Quanto será sacado? '))
total = dinheiro
contar_as_cedulas = 0
cedula = 50
while True:
if total >= cedula:
total -= cedula
contar_as_cedulas += 1
else:
if contar_as_cedulas > 0:
print('Serão {} cedulas de {}'.format(contar_as_cedulas, cedula))
if cedula == 50:
cedula = 20
elif cedula == 20:
cedula = 10
elif cedula == 10:
cedula = 1
if cedula == 0:
break
print('tchauuuuuu! ')
#tio j esse ta impossivel |
# Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution(object):
def __init__(self):
self.maxval=0
def countbst(self,root,minval,maxval):
if not root: return 0
if root.val<minval or root.val>maxval: return -1
left=self.countbst(root.left,minval,root.val)
if left==-1:return -1
right=self.countbst(root.right,root.val,maxval)
if right==-1: return -1
return left+right+1
def dfs(self,root):
cnt=self.countbst(root,-1<<31,(1<<31)-1)
if cnt!=-1:
self.maxval=max(self.maxval,cnt)
return
# otherwise try left
self.dfs(root.left)
# try right
self.dfs(root.right)
def bottomup(self,root,parent):
# return (size,minval,maxval)
if not root: return (0,parent.val,parent.val)
left=self.bottomup(root.left,root)
right=self.bottomup(root.right,root)
if root.val<left[2] or root.val>right[1] or left[0]==-1 or right[0]==-1:
return (-1,0,0)
newsize=left[0]+right[0]+1
self.maxval=max(self.maxval,newsize)
return (newsize,left[1],right[2])
def largestBSTSubtree(self, root):
"""
:type root: TreeNode
:rtype: int
"""
# up-bottom
# self.dfs(root)
# bottom-up
# O(n) solution
if not root: return 0
self.bottomup(root,None)
return self.maxval
|
#!/usr/bin/python
""" Custom counting functions """
def ptcount(particledatalist, ptypelist, ptsums, ypoint=0.0, deltay=2.0):
""" Particle pT counter for mean pT calculation.
Input:
particledatalist -- List of ParticleData objects
ptypelist -- List of particle types for which to do the count
ptsums -- Dictionary of pT sums for given particle type
ypoint -- Center point of rapidity bin
deltay -- Width of rapidity bin
"""
for particle in particledatalist:
if particle.ptype in ptypelist:
if abs(particle.rap - ypoint) < deltay / 2.:
try:
ptsum = ptsums[particle.ptype][0] + particle.pt
npart = ptsums[particle.ptype][1] + 1
ptsums[particle.ptype] = (ptsum, npart)
except IndexError:
continue
|
print('\033[1m>>> CALCULADORA DE JUROS <<<\033[m')
parcela = float(input('- VALOR DA PARCELA: R$ '))
dias = int(input('- DIAS DE ATRASO: '))
juros = float(input('- JUROS AO DIA: '))
acrescimo = ((juros*dias) * parcela) / 100
total = parcela + acrescimo
print('\033[1mRESULTADO:\033[m\n'
f'ACRÉSCIMO: R$ {acrescimo:.2f}\n'
f'ATRASO: {dias} dias\n'
f'TOTAL A PAGAR: R$ {total:.2f}')
|
# Copyright 2021 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
register_npcx_project(
project_name="herobrine_npcx9",
zephyr_board="herobrine_npcx9",
dts_overlays=[
"gpio.dts",
"battery.dts",
"i2c.dts",
"motionsense.dts",
"switchcap.dts",
"usbc.dts",
],
)
|
class No:
def __init__(self, valor):
self.valor = valor
self.esquerda = None
self.direita = None
def mostra_no(self):
print(self.valor)
class ArvoreBinariaBusca:
def __init__(self):
self.raiz = None
self.ligacoes = []
def inserir(self, valor):
novo = No(valor)
# Se a árvore estiver vazia
if self.raiz == None:
self.raiz = novo
else:
atual = self.raiz
while True:
pai = atual
# Esquerda
if valor < atual.valor:
atual = atual.esquerda
if atual == None:
pai.esquerda = novo
return
# Direita
else:
atual = atual.direita
if atual == None:
pai.direita = novo
return
def pesquisar(self, valor):
atual = self.raiz
while atual.valor != valor:
if valor < atual.valor:
atual = atual.esquerda
else:
atual = atual.direita
if atual == None:
return None
return atual
# Raiz, esquerda, direita
def pre_ordem(self, no):
if no != None:
print(no.valor)
self.pre_ordem(no.esquerda)
self.pre_ordem(no.direita)
# Esquerda, raiz, direita
def em_ordem(self, no):
if no != None:
self.em_ordem(no.esquerda)
print(no.valor)
self.em_ordem(no.direita)
# Esquerda, direita, raiz
def pos_ordem(self, no):
if no != None:
self.pos_ordem(no.esquerda)
self.pos_ordem(no.direita)
print(no.valor)
def excluir(self, valor):
if self.raiz == None:
print('A árvore está vazia')
return
# Encontrar o nó
atual = self.raiz
pai = self.raiz
e_esquerda = True
while atual.valor != valor:
pai = atual
# Esquerda
if valor < atual.valor:
e_esquerda = True
atual = atual.esquerda
# Direita
else:
e_esquerda = False
atual = atual.direita
if atual == None:
return False
# O nó a ser apagado é uma folha
if atual.esquerda == None and atual.direita == None:
if atual == self.raiz:
self.raiz = None
elif e_esquerda == True:
pai.esquerda = None
else:
pai.direita = None
# O nó a ser apagado não possui filho na direita
elif atual.direita == None:
if atual == self.raiz:
self.raiz = atual.esquerda
elif e_esquerda == True:
pai.esquerda = atual.esquerda
else:
pai.direita = atual.esquerda
# O nó a ser apagado não possui filho na esquerda
elif atual.esquerda == None:
if atual == self.raiz:
self.raiz = atual.direita
elif e_esquerda == True:
pai.esquerda = atual.direita
else:
pai.direita = atual.direita
# O nó possui dois filhos
else:
sucessor = self.get_sucessor(atual)
if atual == self.raiz:
self.raiz = sucessor
elif e_esquerda == True:
pai.esquerda = sucessor
else:
pai.direita = sucessor
sucessor.esquerda = atual.esquerda
return True
def get_sucessor(self, no):
pai_sucessor = no
sucessor = no
atual = no.direita
while atual != None:
pai_sucessor = sucessor
sucessor = atual
atual = atual.esquerda
if sucessor != no.direita:
pai_sucessor.esquerda = sucessor.direita
sucessor.direita = no.direita
return sucessor
arvore = ArvoreBinariaBusca()
arvore.inserir(53)
arvore.inserir(30)
arvore.inserir(14)
arvore.inserir(39)
arvore.inserir(9)
arvore.inserir(23)
arvore.inserir(34)
arvore.inserir(49)
arvore.inserir(72)
arvore.inserir(61)
arvore.inserir(84)
arvore.inserir(79)
arvore.pesquisar(39)
arvore.pesquisar(84)
arvore.pesquisar(100)
arvore.excluir(9)
arvore.excluir(14)
arvore.excluir(72) |
num1=num2=res=0
def cn():
global canal
canal="CFB Cursos"
cn()
print(canal) |
SPARK_SESSION = {"default": {}}
"""
PySpark session definition
Local Session::
SPARK_SESSION = {
"default": {
"master": "local",
"appName": "Word Count",
"config": {
"spark.some.config.option": "some-value",
}
}
}
Cluster::
SPARK_SESSION = {
"default": {
"master": "spark://master:7077",
"appName": "Word Count",
"config": {
"spark.some.config.option": "some-value",
}
}
}
"""
|
class Db:
def __init__(self):
self._db = None
self._connection = None
@property
def db(self):
return self._db
@db.setter
def db(self, db):
self._db = db
async def _make_connection(self):
self._connection = await self.db.acquire()
async def _close_connection(self):
await self.db.release(self._connection)
|
# -*- coding: utf-8 -*-
# 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.
# All hardware-specific features are prefixed with this namespace
_HW_NS = 'hw:'
# All CPU-specific features are prefixed with this namespace
_CPU_NS = _HW_NS + 'cpu:'
_CPU_X86_NS = _CPU_NS + 'x86:'
# ref: https://en.wikipedia.org/wiki/Streaming_SIMD_Extensions
HW_CPU_X86_AVX = _CPU_X86_NS + 'avx'
HW_CPU_X86_AVX2 = _CPU_X86_NS + 'avx2'
HW_CPU_X86_CLMUL = _CPU_X86_NS + 'clmul'
HW_CPU_X86_FMA3 = _CPU_X86_NS + 'fma3'
HW_CPU_X86_FMA4 = _CPU_X86_NS + 'fma4'
HW_CPU_X86_F16C = _CPU_X86_NS + 'f16c'
HW_CPU_X86_MMX = _CPU_X86_NS + 'mmx'
HW_CPU_X86_SSE = _CPU_X86_NS + 'sse'
HW_CPU_X86_SSE2 = _CPU_X86_NS + 'sse2'
HW_CPU_X86_SSE3 = _CPU_X86_NS + 'sse3'
HW_CPU_X86_SSSE3 = _CPU_X86_NS + 'ssse3'
HW_CPU_X86_SSE41 = _CPU_X86_NS + 'sse41'
HW_CPU_X86_SSE42 = _CPU_X86_NS + 'sse42'
HW_CPU_X86_SSE4A = _CPU_X86_NS + 'sse4a'
HW_CPU_X86_XOP = _CPU_X86_NS + 'xop'
HW_CPU_X86_3DNOW = _CPU_X86_NS + '3dnow'
# ref: https://en.wikipedia.org/wiki/AVX-512
HW_CPU_X86_AVX512F = _CPU_X86_NS + 'avx512f' # foundation
HW_CPU_X86_AVX512CD = _CPU_X86_NS + 'avx512cd' # conflict detection
HW_CPU_X86_AVX512PF = _CPU_X86_NS + 'avx512pf' # prefetch
HW_CPU_X86_AVX512ER = _CPU_X86_NS + 'avx512er' # exponential + reciprocal
HW_CPU_X86_AVX512VL = _CPU_X86_NS + 'avx512vl' # vector length extensions
HW_CPU_X86_AVX512BW = _CPU_X86_NS + 'avx512bw' # byte + word
HW_CPU_X86_AVX512DQ = _CPU_X86_NS + 'avx512dq' # double word + quad word
# ref: https://en.wikipedia.org/wiki/Bit_Manipulation_Instruction_Sets
HW_CPU_X86_ABM = _CPU_X86_NS + 'abm'
HW_CPU_X86_BMI = _CPU_X86_NS + 'bmi'
HW_CPU_X86_BMI2 = _CPU_X86_NS + 'bmi2'
HW_CPU_X86_TBM = _CPU_X86_NS + 'tbm'
# ref: https://en.wikipedia.org/wiki/AES_instruction_set
HW_CPU_X86_AESNI = _CPU_X86_NS + 'aes-ni'
# ref: https://en.wikipedia.org/wiki/Intel_SHA_extensions
HW_CPU_X86_SHA = _CPU_X86_NS + 'sha'
# ref: https://en.wikipedia.org/wiki/Intel_MPX
HW_CPU_X86_MPX = _CPU_X86_NS + 'mpx'
# ref: https://en.wikipedia.org/wiki/Software_Guard_Extensions
HW_CPU_X86_SGX = _CPU_X86_NS + 'sgx'
# ref: https://en.wikipedia.org/wiki/Transactional_Synchronization_Extensions
HW_CPU_X86_TSX = _CPU_X86_NS + 'tsx'
# ref: https://en.wikipedia.org/wiki/Advanced_Synchronization_Facility
HW_CPU_X86_ASF = _CPU_X86_NS + 'asf'
# ref: https://en.wikipedia.org/wiki/VT-x
HW_CPU_X86_VMX = _CPU_X86_NS + 'vmx'
# ref: https://en.wikipedia.org/wiki/AMD-V
HW_CPU_X86_SVM = _CPU_X86_NS + 'svm'
NAMESPACES = {
'hardware': _HW_NS,
'hw': _HW_NS,
'cpu': _CPU_NS,
'x86': _CPU_X86_NS,
}
|
"""A string is good if there are no repeated characters.
Given a string s, return the number of good substrings of length three in s.
Note that if there are multiple occurrences of the same substring, every occurrence should be counted.
A substring is a contiguous sequence of characters in a string.
Example 1:
Input: s = "xyzzaz"
Output: 1
Explanation: There are 4 substrings of size 3: "xyz", "yzz", "zza", and "zaz".
The only good substring of length 3 is "xyz"."""
s = "aababcabc"
# Brute Force
c = 0
for i in range(len(s)):
for j in range(i + 1, len(s)):
substring = s[i : j + 1]
if len((substring)) == 3 and len(set(substring)) == len(substring):
c += 1
print(c)
# Better Solution
# Time Complexity: O(n)
# Space Complexity: O(1)
# window = 3
# count = 0
# for i in range(len(s) - window + 1):
# if len(set(s[i : i + window])) == window:
# count += 1
# print(count)
|
#
# PySNMP MIB module CISCO-MEDIATRACE-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCO-MEDIATRACE-MIB
# Produced by pysmi-0.3.4 at Wed May 1 12:07:08 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)
#
Integer, OctetString, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "Integer", "OctetString", "ObjectIdentifier")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ValueRangeConstraint, ConstraintsIntersection, ConstraintsUnion, SingleValueConstraint, ValueSizeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueRangeConstraint", "ConstraintsIntersection", "ConstraintsUnion", "SingleValueConstraint", "ValueSizeConstraint")
FlowMetricValue, = mibBuilder.importSymbols("CISCO-FLOW-MONITOR-TC-MIB", "FlowMetricValue")
ciscoMgmt, = mibBuilder.importSymbols("CISCO-SMI", "ciscoMgmt")
InterfaceIndexOrZero, = mibBuilder.importSymbols("IF-MIB", "InterfaceIndexOrZero")
InetPortNumber, InetAddress, InetAddressType = mibBuilder.importSymbols("INET-ADDRESS-MIB", "InetPortNumber", "InetAddress", "InetAddressType")
VlanId, = mibBuilder.importSymbols("Q-BRIDGE-MIB", "VlanId")
SnmpAdminString, = mibBuilder.importSymbols("SNMP-FRAMEWORK-MIB", "SnmpAdminString")
ModuleCompliance, NotificationGroup, ObjectGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup", "ObjectGroup")
Counter32, MibScalar, MibTable, MibTableRow, MibTableColumn, IpAddress, MibIdentifier, Counter64, ModuleIdentity, Gauge32, iso, Bits, Integer32, NotificationType, Unsigned32, ObjectIdentity, TimeTicks = mibBuilder.importSymbols("SNMPv2-SMI", "Counter32", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "IpAddress", "MibIdentifier", "Counter64", "ModuleIdentity", "Gauge32", "iso", "Bits", "Integer32", "NotificationType", "Unsigned32", "ObjectIdentity", "TimeTicks")
TruthValue, TimeStamp, DisplayString, RowStatus, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "TruthValue", "TimeStamp", "DisplayString", "RowStatus", "TextualConvention")
ciscoMediatraceMIB = ModuleIdentity((1, 3, 6, 1, 4, 1, 9, 9, 800))
ciscoMediatraceMIB.setRevisions(('2012-08-23 00:00',))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
if mibBuilder.loadTexts: ciscoMediatraceMIB.setRevisionsDescriptions(('Initial version of this MIB module.',))
if mibBuilder.loadTexts: ciscoMediatraceMIB.setLastUpdated('201208230000Z')
if mibBuilder.loadTexts: ciscoMediatraceMIB.setOrganization('Cisco Systems, Inc.')
if mibBuilder.loadTexts: ciscoMediatraceMIB.setContactInfo('Cisco Systems Customer Service Postal: 170 W Tasman Drive San Jose, CA 95134 USA Tel: +1 800 553-NETS E-mail: cs-mediatrace@cisco.com')
if mibBuilder.loadTexts: ciscoMediatraceMIB.setDescription("Mediatrace helps to isolate and troubleshoot network degradation problems by enabling a network administrator to discover an Internet Protocol (IP) flow's path, dynamically enable monitoring capabilities on the nodes along the path, and collect information on a hop-by-hop basis. This information includes, among other things, flow statistics, and utilization information for incoming and outgoing interfaces, CPUs, and memory, as well as any changes to IP routes. This information can be retrieved by configuring Cisco Mediatrace to start a recurring monitoring session at a specific time and on specific days. The session can be configured to specify which metrics to collect, and how frequently they are collected. The hops along the path are automatically discovered as part of the operation. This module defines a MIB for the features of configuring Mediatrace sessions and obtain statistics data for a particular hop at a specific time. INITIATOR/RESPONDER ==================== At the top level, this MIB module describes the initiator and responder roles for the device. The scalar objects corresponding to each role are used to enable and set parameters like maximum sessions supported, IP address used for enabling the initiator,etc. Some of the scalar objects are used to obtain information about a particular role for the device. At a time the device supports a single initiator and/or single responder. The following scalar objects are used for enabling the initiator, +---------> cMTInitiatorEnable +---------> cMTInitiatorSourceInterface +---------> cMTInitiatorSourceAddressType +---------> cMTInitiatorSourceAddress +---------> cMTInitiatorMaxSessions In addition to the above objects, the following objects are used for obtaining information about the initiator role on the device, +---------> cMTInitiatorSoftwareVersionMajor +---------> cMTInitiatorSoftwareVersionMinor +---------> cMTInitiatorProtocolVersionMajor +---------> cMTInitiatorProtocolVersionMinor +---------> cMTInitiatorConfiguredSessions +---------> cMTInitiatorPendingSessions +---------> cMTInitiatorInactiveSessions +---------> cMTInitiatorActiveSessions The following scalar objects are used for enabling the responder, +---------> cMTResponderEnable +---------> cMTResponderMaxSessions In addition to the above objects, the following object is used for obtaining information about the responder role on the device, +---------> cMTResponderActiveSessions CONTROL TABLES =============== At the next level, this MIB module describes the entities - path specifier, flow specifier, session params and profile. This section also includes the session and scheduling entities. Each row in the cMTSessionTable corresponds to a single session. The session is a container and hence the path specifier, flow specifier, session params and profile objects for each session point to the corresponding entities in the cMTPathSpecifierTable, cMTFlowSpecifierTable, cMTSessionParamsTable, cMTMediaMonitorProfileTable and cMTSystemProfileTable tables. o cMTPathSpecifierTable - describes path specifiers. o cMTFlowSpecifierTable - describes flow specifiers. o cMTSessionParamsTable - describes session params entities. o cMTMediaMonitorProfileTable - describes media monitor profile. o cMTSystemProfileTable - describes system profiles. The cMTSessionTable has a sparse dependent relationship with each of these tables, as there exist situations when data from those tables may not be used for a particular session, including : 1) The session using system profile does not need flow specifier. 2) The session using media monitor profile may not need optional flow specifier. 3) The session may only use one of the two profiles, system or media monitor. o cMTSessionTable - describes sessions. o cMTScheduleTable - describes scheduling entities for the sessions. The cMTScheduleTable has sparse dependent relationship on the cMTSessionTable, as there exist situations when the a session is not available for scheduling, including - a session is created but is not yet scheduled. +----------------------+ | cMTPathSpecifierTable| | | +-----------------------------+ | cMTPathSpecifierName = ps1 | +-----------------------------+ | | +-----------------------------+ | cMTPathSpecifierName = ps2 | +-----------------------------+ : : : : +-----------------------------+ | cMTPathSpecifierName = ps6 | +-----------------------------+ | | +----------------------+ +----------------------+ | cMTFlowSpecifierTable| | | +-----------------------------+ | cMTFlowSpecifierName = fs1 | +-----------------------------+ | | +-----------------------------+ | cMTFlowSpecifierName = fs2 | +-----------------------------+ : : : : +-----------------------------+ | cMTFlowSpecifierName = fs6 | +-----------------------------+ | | +----------------------+ +-------------------------+ +----------------------+ | cMTSessionTable | | cMTSessionParamsTable| | | | | +-------------------------------------+ +--------------------------+ | cMTSessionNumber = 1 | |cMTSessionParamsName = sp1| | +---------------------------------+ | +--------------------------+ | |cMTSessionPathSpecifierName = ps1| | | | | +---------------------------------+ | +--------------------------+ | | |cMTSessionParamsName = sp2| | +---------------------------------+ | +--------------------------+ | |cMTSessionParamName = sp1 | | : : | +---------------------------------+ | : : | | +--------------------------+ | +---------------------------------+ | |cMTSessionParamsName = sp5| | |cMTSessionProfileName = rtp1 | | +--------------------------+ | +---------------------------------+ | | | | | +-----------------------+ | +---------------------------------+ | | |cMTSessionFlowSpecifierName = fs1| | | +---------------------------------+ | | | | +---------------------------------+ | | |cMTSessionTraceRouteEnabled = T | | | +---------------------------------+ | | | +-------------------------------------+ | | | | +-------------------------------------+ | cMTSessionNumber = 2 | | +---------------------------------+ | +---------------------------+ | |cMTSessionPathSpecifierName = ps2| | |cMTMediaMonitorProfileTable| | +---------------------------------+ | | | | | +-----------------------------+ | +---------------------------------+ | |cMTMediaMonitorProfileName | | |cMTSessionParamName = sp5 | | | =rtp1 | | +---------------------------------+ | +-----------------------------+ | | | | | +---------------------------------+ | +-----------------------------+ | |cMTSessionProfileName = intf1 | | |cMTMediaMonitorProfileName | | +---------------------------------+ | | =rtp1 | | | +-----------------------------+ | +---------------------------------+ | : : | |cMTSessionTraceRouteEnabled = T | | : : | +---------------------------------+ | +-----------------------------+ | | |cMTMediaMonitorProfileName | +-------------------------------------+ | =tcp1 | : : +-----------------------------+ : : | | +-------------------------------------+ +---------------------------+ | cMTSessionNumber = 10 | | +---------------------------------+ | | |cMTSessionPathSpecifierName = ps1| | | +---------------------------------+ | | | | +---------------------------------+ | | |cMTSessionParamName = sp1 | | | +---------------------------------+ | | | | +---------------------------------+ | | |cMTSessionProfileName = tcp1 | | | +---------------------------------+ | | | | +---------------------------------+ | | |cMTSessionTraceRouteEnabled = T | | | +---------------------------------+ | | | +-------------------------------------+ | | | | +-------------------------+ +----------------------+ | cMTSystemProfileTable| | | +-----------------------------+ | cMTSystemProfileName = intf1| +-----------------------------+ | | +-----------------------------+ | cMTSystemProfileName = cpu1 | +-----------------------------+ : : : : +-----------------------------+ | cMTSystemProfileName = intf2| +-----------------------------+ | | +----------------------+ DEFINITIONS =============== Mediatrace Initiator - This is the entity that supports creation of periodic sessions using global session id. Initiator can send request, collects the responses to those request and processes them for reporting. Henceforth, it will be referred as initiator. Mediatrace Responder - This is the entity that queries local database and features to obtain information based on the request sent by the Initiator as part of a session. The collected information is sent as response to the initiator to match the session. Henceforth, it will be referred as responder. Meta-data - Meta information about the flow not contained in the data packet. Examples of such information are global session id, multi party session id, type of application that is generating this flow e.g., telepresence. Meta-data global session identifier - it is one of the meta-data attributes which uniquely identifies a flow globally and is used to query the meta-data database for obtaining the corresponding 5-tuple (destination address, destination port, source address, source port and IP protocol) for path specifier or flow specifier. Path - This specifies the route taken by the Mediatrace request for a particular session. This can be specified in terms of single or multiple 5-tuple parameters - destination address, destination port, source address, source port and IP protocol. Gateway address and VLAN are required in cases where the path starts from network element without IP address. This is specified using path specifier entity. Path Specifier - The path specifier is generally specified using complete or partial 5-tuple (destination address, destination port, source address, source port and IP protocol) for Layer 3 initiator. Gateway and VLAN ID are required for a Layer 2 initiator. It can also use the meta-data Global session Id to specify the 5-tuple. A single row corresponds to a path specifier which is created or destroyed when a path specifier is added or removed. Each path specifier entry is uniquely identified by cMTPathSpecifierName. Examples of a path specifier are as follows, path-specifier (ps1)+-------> destination address (10.10.10.2) +-------> destination port (12344) +-------> source address (10.10.12.2) +-------> source port (12567) +-------> IP protocol (UDP) +-------> gateway (10.10.11.2) +-------> VLAN ID (601) path-specifier (ps2)+-------> meta-data global identifier (345123456) Flow - A unidirectional stream of packets conforming to a classifier. For example, packets having a particular source IP address, destination IP address, protocol type, source port number, and destination port number. This is specified using a flow specifier entity. Flow Specifier - The flow specifier is generally specified using complete or partial 5-tuple (destination address, destination port, source address, source port and IP protocol). It can also use the meta-data Global session Id to specify the 5-tuple. A single row corresponds to a flow specifier which is created or destroyed when a flow specifier is added or removed. Each flow specifier entry is uniquely identified by cMTFlowSpecifierName. Examples of a flow specifier is as follows, flow-specifier (fs1)+-------> destination address(10.11.10.2) +-------> destination port (12344) +-------> source address (10.11.12.2) +-------> source port (12567) +-------> IP protocol (UDP) flow-specifier (fs2)+-------> meta-data global identifier (345123456) Metric - It defines a measurement that reflects the quality of a traffic flow or a resource on a hop or along the path e.g. number of packets for a flow, memory utilization on a hop, number of dropped packets on an interface, etc. Metric-list - It defines logical grouping of related metrics e.g. Metric-list CPU has 1% and 2% CPU utilization metric, Metric-list interface has ingress interface speed, egress interface speed, etc. Profile - It defines the set of metric-lists to be collected from the devices along the path. It can also include additional parameters which are required for collecting the metric e.g., sampling interval (also referred as monitor interval), etc. A Profile can include a set of related metric-lists along with related configuration parameters. The metrics could be the media monitoring (also referred as performance monitoring) metrics such as jitter, packet loss, bit rate etc., or system resource utilization metrics or interface counters. Two profiles, System profile and Media Monitoring (Performance Monitoring) Profile are supported. The different profiles, metric-lists and metrics are listed below, +-----> Profile +---> Metric-list +--------> one min CPU utilization | System | CPU | | | +--------> five min CPU utilization | | | +---> Metric-list +-----> memory utilization Memory | | | +---> Metric-list +------> octets input at ingress | Interface | | +------> octets output at egress | |------> packets received with error | | at ingress | +------> packets with error at egress | +------> packets discarded at ingress | +------> packets discarded at egress | +------> ingress interface speed | +------> egress interface speed | +--> Profile +--> Metric-list +--> Common +--> loss of Media Monitor | TCP | IP | measurement confidence | | metrics | | | +--> media stop event occurred | | +--> IP packet drop count | | +--> IP byte count | | +--> IP byte rate | | +--> IP DSCP | | +--> IP TTL | | +--> IP protocol | | +---> media byte | | count | | | +--> TCP +--> TCP connect round trip | specific | delay | metrics | | +--> TCP lost event count | +--> Metric-list +--> Common +--> loss of measurement RTP | IP | confidence | metrics | | +--> media stop event occurred | +--> IP packet drop count | +--> IP byte count | +--> IP byte rate | +--> IP DSCP | +--> IP TTL | +--> IP protocol | +---> media byte count | +--> RTP +--> RTP inter arrival jitter specific | delay metrics | +--> RTP packets lost +--> RTP packets expected +--> RTP packets lost event | count +---> RTP loss percent Examples of the profiles are as follows, profile system - metric-list interface (sys1) profile media-monitor - metric-list rtp (rtp1) +-------> monitor interval (60 seconds) Session parameter Profile - These correspond to the various parameters related to session such as frequency of data collection, timeout for request, etc. These are specified using the session params entity. This is the entity that executes via a conceptual session/schedule control row and populates a conceptual statistics row. Example session parameter profile is as follows, Session-params (sp1)+-------> response timeout (10 seconds) +-------> frequency (60 seconds) +-------> history data sets (2) +-------> route change reaction time (10 seconds) +-------> inactivity timeout (180 seconds) Session - The session is a grouping of various configurable entities such as profiles, session parameters and path specifiers. Flow specifier is optional and required for media monitor profile only. Once these parameters for a mediatrace session are defined through these entities, they are combined into a mediatrace session. Example of sessions are as follows, session (1) +--------> path-specifier (ps1) +--------> session-params (sp1) +--------> profile system (sys1) metric-list interface session (2) +--------> path-specifier (ps1) +--------> session-params (sp2) +--------> profile media-monitor (rtp1) | metric-list rtp +--------> flow-specifier (fs1) A session cycles through various states in its lifetime. The different states are, Active state : A session is said to be in active state when it is requesting and collecting data from the responders. Inactive state : A session becomes inactive when it is either stopped by unscheduling or life expires. In this state it will no longer collect or request data. Pending state: A session is in pending state when the session is created but not yet scheduled to be active. Based on the state and history of a session it can be classified as configured or scheduled session. Configured session : A session which is created and is in pending or inactive state is called a configured session. It can also be a newly created session which has not been scheduled (made active) yet. Scheduled session : A session which is in active state or pending state which is already requesting and collecting data or has set a time in future to start requesting or collecting data. Responder: The responder is in active state when it is able to process the requests from the initiator, collect the data locally and send the Response back to the initiator. Reachability Address: It is the address of the interface on a responder which is used to send the response to the initiator. Statistics row - This conceptual row is indexed based on the session index, session life index, bucket number and hop information (Hop address type and Hop address). This identifies the statistics for a particular session with specific life, at a particular time and for a specific hop.")
class CiscoNTPTimeStamp(TextualConvention, OctetString):
reference = "D.L. Mills, 'Network Time Protocol (Version 3)', RFC-1305, March 1992, Section 3.1"
description = 'CiscoNTP timestamps are represented as a 64-bit unsigned fixed-point number, in seconds relative to 00:00 on 1 January 1900. The integer part is in the first 32 bits and the fraction part is in the last 32 bits.'
status = 'current'
displayHint = '4d.4d'
subtypeSpec = OctetString.subtypeSpec + ValueSizeConstraint(8, 8)
fixedLength = 8
class CiscoMediatraceSupportProtocol(TextualConvention, Integer32):
description = 'Represents different types of layer 3 protocols supported by by Mediatrace for path and flow specification. Currently two protocols - TCP and UDP are supported.'
status = 'current'
subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(6, 17))
namedValues = NamedValues(("tcp", 6), ("udp", 17))
class CiscoMediatraceDiscoveryProtocol(TextualConvention, Integer32):
description = 'Represents different types of protocols used by Mediatrace to discover the path based on the path specifier.'
status = 'current'
subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(46))
namedValues = NamedValues(("rsvp", 46))
ciscoMediatraceMIBNotifs = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 800, 0))
ciscoMediatraceMIBObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 800, 1))
ciscoMediatraceMIBConform = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 800, 2))
cMTCtrl = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 1))
cMTStats = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2))
cMTInitiatorEnable = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 1, 2), TruthValue()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: cMTInitiatorEnable.setStatus('current')
if mibBuilder.loadTexts: cMTInitiatorEnable.setDescription('This object specifies the whether the Mediatrace initiator is enabled on the network element.')
cMTInitiatorSourceInterface = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 1, 3), InterfaceIndexOrZero()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: cMTInitiatorSourceInterface.setStatus('current')
if mibBuilder.loadTexts: cMTInitiatorSourceInterface.setDescription('This object specifies the interface whose IP or IPv6 address will be used as initiator address. The Initiator address is used by layer 2 mediatrace responder to unicast the response message to initiator. This address is also reachability address for mediatrace hop 0. The value of this object should be set to ifIndex value of the desired interface from the ifTable.')
cMTInitiatorSourceAddressType = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 1, 4), InetAddressType()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: cMTInitiatorSourceAddressType.setStatus('current')
if mibBuilder.loadTexts: cMTInitiatorSourceAddressType.setDescription('Address type (IP or IPv6) of the initiator address specified in cMTInitiatorSourceAddress object. The value should be set to unknown (0) if source interface object is non zero.')
cMTInitiatorSourceAddress = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 1, 5), InetAddress()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: cMTInitiatorSourceAddress.setStatus('current')
if mibBuilder.loadTexts: cMTInitiatorSourceAddress.setDescription('This object specifies the IP address used by the initiator when obtaining the reachability address from a downstream responder.')
cMTInitiatorMaxSessions = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 1, 6), Unsigned32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: cMTInitiatorMaxSessions.setStatus('current')
if mibBuilder.loadTexts: cMTInitiatorMaxSessions.setDescription('This object specifies the maximum number of mediatrace sessions that can be active simultaneously on the initiator.')
cMTInitiatorSoftwareVersionMajor = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 1, 7), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cMTInitiatorSoftwareVersionMajor.setStatus('current')
if mibBuilder.loadTexts: cMTInitiatorSoftwareVersionMajor.setDescription('This object indicates the major version number of Mediatrace application.')
cMTInitiatorSoftwareVersionMinor = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 1, 8), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cMTInitiatorSoftwareVersionMinor.setStatus('current')
if mibBuilder.loadTexts: cMTInitiatorSoftwareVersionMinor.setDescription('This object indicates the minor version number of Mediatrace application.')
cMTInitiatorProtocolVersionMajor = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 1, 9), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cMTInitiatorProtocolVersionMajor.setStatus('current')
if mibBuilder.loadTexts: cMTInitiatorProtocolVersionMajor.setDescription('This object indicates the major version number of Mediatrace protocol.')
cMTInitiatorProtocolVersionMinor = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 1, 10), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cMTInitiatorProtocolVersionMinor.setStatus('current')
if mibBuilder.loadTexts: cMTInitiatorProtocolVersionMinor.setDescription('This object indicates the minor version number of Mediatrace protocol.')
cMTInitiatorConfiguredSessions = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 1, 11), Gauge32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cMTInitiatorConfiguredSessions.setStatus('current')
if mibBuilder.loadTexts: cMTInitiatorConfiguredSessions.setDescription('This object indicates number of mediatrace sessions configured. The session may or may not be active.')
cMTInitiatorPendingSessions = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 1, 12), Gauge32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cMTInitiatorPendingSessions.setStatus('current')
if mibBuilder.loadTexts: cMTInitiatorPendingSessions.setDescription('This object indicates the current number of sessions in pending state on the initiator.')
cMTInitiatorInactiveSessions = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 1, 13), Gauge32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cMTInitiatorInactiveSessions.setStatus('current')
if mibBuilder.loadTexts: cMTInitiatorInactiveSessions.setDescription('This object indicates the current number of sessions in inactive state on the initiator.')
cMTInitiatorActiveSessions = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 1, 14), Gauge32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cMTInitiatorActiveSessions.setStatus('current')
if mibBuilder.loadTexts: cMTInitiatorActiveSessions.setDescription('This object indicates the current number of sessions in active state on the initiator.')
cMTResponderEnable = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 1, 15), TruthValue()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: cMTResponderEnable.setStatus('current')
if mibBuilder.loadTexts: cMTResponderEnable.setDescription("This object specifies the whether the Mediatrace responder is enabled. If set to 'true' the responder will be enabled. If set to false then mediatrace responder process will be stopped and the device will no longer be discovered as mediatrace capable hop along the flow path.")
cMTResponderMaxSessions = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 1, 16), Unsigned32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: cMTResponderMaxSessions.setStatus('current')
if mibBuilder.loadTexts: cMTResponderMaxSessions.setDescription('This object specifies the maximum number of sessions that a responder can accept from initiator.')
cMTResponderActiveSessions = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 1, 17), Gauge32()).setUnits('sessions').setMaxAccess("readonly")
if mibBuilder.loadTexts: cMTResponderActiveSessions.setStatus('current')
if mibBuilder.loadTexts: cMTResponderActiveSessions.setDescription('This object indicates the current number of sessions that are in active state on the responder.')
cMTFlowSpecifierTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 1, 18), )
if mibBuilder.loadTexts: cMTFlowSpecifierTable.setStatus('current')
if mibBuilder.loadTexts: cMTFlowSpecifierTable.setDescription('This table lists the flow specifiers contained by the device.')
cMTFlowSpecifierEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 1, 18, 1), ).setIndexNames((0, "CISCO-MEDIATRACE-MIB", "cMTFlowSpecifierName"))
if mibBuilder.loadTexts: cMTFlowSpecifierEntry.setStatus('current')
if mibBuilder.loadTexts: cMTFlowSpecifierEntry.setDescription("An entry represents a flow specifier which can be associated with a Mediatrace session contained by the cMTSessionTable. Each entry is uniquely identified by name specified by cMTFlowSpecifierName object. A row created in this table will be shown in 'show running' command and it will not be saved into non-volatile memory.")
cMTFlowSpecifierName = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 1, 18, 1, 1), SnmpAdminString())
if mibBuilder.loadTexts: cMTFlowSpecifierName.setStatus('current')
if mibBuilder.loadTexts: cMTFlowSpecifierName.setDescription('A unique identifier for the flow specifier.')
cMTFlowSpecifierRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 1, 18, 1, 2), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cMTFlowSpecifierRowStatus.setStatus('current')
if mibBuilder.loadTexts: cMTFlowSpecifierRowStatus.setDescription("This object specifies the status of the flow specifier. Only CreateAndGo and active status is supported. The following columns must be valid before activating the flow specifier: - cMTFlowSpecifierDestAddrType and cMTFlowSpecifierDestAddr OR - cMTFlowSpecifierMetadataGlobalId All other objects can assume default values. Once the flow specifier is activated no column can be modified. Setting this object to 'delete' will destroy the flow specifier. The flow specifier can be deleted only if it is not attached to any session.")
cMTFlowSpecifierMetadataGlobalId = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 1, 18, 1, 3), SnmpAdminString()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cMTFlowSpecifierMetadataGlobalId.setStatus('current')
if mibBuilder.loadTexts: cMTFlowSpecifierMetadataGlobalId.setDescription('This object specifies the meta-data Global ID of the flow specifier. Maximum of 24 characters can be specified for this field.')
cMTFlowSpecifierDestAddrType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 1, 18, 1, 4), InetAddressType()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cMTFlowSpecifierDestAddrType.setStatus('current')
if mibBuilder.loadTexts: cMTFlowSpecifierDestAddrType.setDescription('This object specifies the type of IP address specified by the corresponding instance of cMTFlowSpecifierDestAddr.')
cMTFlowSpecifierDestAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 1, 18, 1, 5), InetAddress()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cMTFlowSpecifierDestAddr.setStatus('current')
if mibBuilder.loadTexts: cMTFlowSpecifierDestAddr.setDescription('Address of the destination of the flow to be monitored.')
cMTFlowSpecifierDestPort = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 1, 18, 1, 6), InetPortNumber()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cMTFlowSpecifierDestPort.setStatus('current')
if mibBuilder.loadTexts: cMTFlowSpecifierDestPort.setDescription('This object specifies the destination port for the flow.')
cMTFlowSpecifierSourceAddrType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 1, 18, 1, 7), InetAddressType()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cMTFlowSpecifierSourceAddrType.setStatus('current')
if mibBuilder.loadTexts: cMTFlowSpecifierSourceAddrType.setDescription('This object specifies the type of IP address specified by the corresponding instance of cMTFlowSpecifierSourceAddr.')
cMTFlowSpecifierSourceAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 1, 18, 1, 8), InetAddress()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cMTFlowSpecifierSourceAddr.setStatus('current')
if mibBuilder.loadTexts: cMTFlowSpecifierSourceAddr.setDescription('This object specifies the source address for the flow to be monitored.')
cMTFlowSpecifierSourcePort = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 1, 18, 1, 9), InetPortNumber()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cMTFlowSpecifierSourcePort.setStatus('current')
if mibBuilder.loadTexts: cMTFlowSpecifierSourcePort.setDescription('This object specifies the source port for the flow.')
cMTFlowSpecifierIpProtocol = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 1, 18, 1, 10), CiscoMediatraceSupportProtocol().clone('udp')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cMTFlowSpecifierIpProtocol.setStatus('current')
if mibBuilder.loadTexts: cMTFlowSpecifierIpProtocol.setDescription('This is transport protocol type for the flow. Flow of this type between specified source and and destination will be monitored.')
cMTPathSpecifierTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 1, 19), )
if mibBuilder.loadTexts: cMTPathSpecifierTable.setStatus('current')
if mibBuilder.loadTexts: cMTPathSpecifierTable.setDescription('This table lists the path specifiers contained by the device.')
cMTPathSpecifierEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 1, 19, 1), ).setIndexNames((0, "CISCO-MEDIATRACE-MIB", "cMTPathSpecifierName"))
if mibBuilder.loadTexts: cMTPathSpecifierEntry.setStatus('current')
if mibBuilder.loadTexts: cMTPathSpecifierEntry.setDescription("This entry defines path specifier that can be used in mediatrace session. Each entry is uniquely identified by name specified by cMTPathSpecifierName object. A row created in this table will be shown in 'show running' command and it will not be saved into non-volatile memory.")
cMTPathSpecifierName = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 1, 19, 1, 1), SnmpAdminString())
if mibBuilder.loadTexts: cMTPathSpecifierName.setStatus('current')
if mibBuilder.loadTexts: cMTPathSpecifierName.setDescription('A unique identifier for the path specifier.')
cMTPathSpecifierRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 1, 19, 1, 2), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cMTPathSpecifierRowStatus.setStatus('current')
if mibBuilder.loadTexts: cMTPathSpecifierRowStatus.setDescription("This object specifies the status of the path specifier. Only CreateAndGo and active status is supported. The following columns must be valid before activating the path specifier: - cMTPathSpecifierDestAddrType and cMTPathSpecifierDestAddr OR - cMTPathSpecifierMetadataGlobalId All other objects can assume default values. Once the path specifier is activated no column can be modified. Setting this object to 'delete' will destroy the path specifier. The path specifier can be deleted only if it is not attached to any session.")
cMTPathSpecifierMetadataGlobalId = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 1, 19, 1, 3), SnmpAdminString()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cMTPathSpecifierMetadataGlobalId.setStatus('current')
if mibBuilder.loadTexts: cMTPathSpecifierMetadataGlobalId.setDescription('Metadata global session id can be used as path specifier. This object should be populated when this is desired. Mediatrace software will query the Metadata database for five tuple to be used for establishing the path.')
cMTPathSpecifierDestAddrType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 1, 19, 1, 4), InetAddressType()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cMTPathSpecifierDestAddrType.setStatus('current')
if mibBuilder.loadTexts: cMTPathSpecifierDestAddrType.setDescription('This object specifies the type of IP address specified by the corresponding instance of cMTPathSpecifierDestAddr.')
cMTPathSpecifierDestAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 1, 19, 1, 5), InetAddress()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cMTPathSpecifierDestAddr.setStatus('current')
if mibBuilder.loadTexts: cMTPathSpecifierDestAddr.setDescription('This object specifies the destination address for the path specifier.')
cMTPathSpecifierDestPort = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 1, 19, 1, 6), InetPortNumber()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cMTPathSpecifierDestPort.setStatus('current')
if mibBuilder.loadTexts: cMTPathSpecifierDestPort.setDescription('This object specifies the destination port for the path specifier.')
cMTPathSpecifierSourceAddrType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 1, 19, 1, 7), InetAddressType()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cMTPathSpecifierSourceAddrType.setStatus('current')
if mibBuilder.loadTexts: cMTPathSpecifierSourceAddrType.setDescription('This object specifies the type of IP address specified by the corresponding instance of cMTFlowSpecifierSourceAddr.')
cMTPathSpecifierSourceAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 1, 19, 1, 8), InetAddress()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cMTPathSpecifierSourceAddr.setStatus('current')
if mibBuilder.loadTexts: cMTPathSpecifierSourceAddr.setDescription('This object specifies the source address for the path specifier.')
cMTPathSpecifierSourcePort = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 1, 19, 1, 9), InetPortNumber()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cMTPathSpecifierSourcePort.setStatus('current')
if mibBuilder.loadTexts: cMTPathSpecifierSourcePort.setDescription('This object specifies the source port for the path specifier.')
cMTPathSpecifierProtocolForDiscovery = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 1, 19, 1, 10), CiscoMediatraceDiscoveryProtocol().clone('rsvp')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cMTPathSpecifierProtocolForDiscovery.setStatus('current')
if mibBuilder.loadTexts: cMTPathSpecifierProtocolForDiscovery.setDescription('This object specifies the protocol used for path discovery on Mediatrace. Currently, only RSVP is used by default.')
cMTPathSpecifierGatewayAddrType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 1, 19, 1, 11), InetAddressType()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cMTPathSpecifierGatewayAddrType.setStatus('current')
if mibBuilder.loadTexts: cMTPathSpecifierGatewayAddrType.setDescription('This object specifies the type of IP address specified by the corresponding instance of cMTPathSpecifierGatewayAddr.')
cMTPathSpecifierGatewayAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 1, 19, 1, 12), InetAddress()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cMTPathSpecifierGatewayAddr.setStatus('current')
if mibBuilder.loadTexts: cMTPathSpecifierGatewayAddr.setDescription('When the mediatrace session is originated on layer-2 switch the address of gateway is required to establish the session. This object specifies address of this gateway.')
cMTPathSpecifierGatewayVlanId = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 1, 19, 1, 13), VlanId().subtype(subtypeSpec=ValueRangeConstraint(1, 4094))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cMTPathSpecifierGatewayVlanId.setStatus('current')
if mibBuilder.loadTexts: cMTPathSpecifierGatewayVlanId.setDescription('This object specifies the Vlan ID associated with the gateway for path specifier.')
cMTPathSpecifierIpProtocol = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 1, 19, 1, 14), CiscoMediatraceSupportProtocol().clone('udp')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cMTPathSpecifierIpProtocol.setStatus('current')
if mibBuilder.loadTexts: cMTPathSpecifierIpProtocol.setDescription('This object specifies which metrics are monitored for a path specifier. Currently, only TCP and UDP are supported.')
cMTSessionParamsTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 1, 20), )
if mibBuilder.loadTexts: cMTSessionParamsTable.setStatus('current')
if mibBuilder.loadTexts: cMTSessionParamsTable.setDescription('This table is collection of session parameter profiles.')
cMTSessionParamsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 1, 20, 1), ).setIndexNames((0, "CISCO-MEDIATRACE-MIB", "cMTSessionParamsName"))
if mibBuilder.loadTexts: cMTSessionParamsEntry.setStatus('current')
if mibBuilder.loadTexts: cMTSessionParamsEntry.setDescription("An entry represents session parameters that can be associated with a Mediatrace session contained by the cMTSessionTable. Each entry is uniquely identified by name specified by cMTSessionParamsName object. A row created in this table will be shown in 'show running' command and it will not be saved into non-volatile memory.")
cMTSessionParamsName = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 1, 20, 1, 1), SnmpAdminString())
if mibBuilder.loadTexts: cMTSessionParamsName.setStatus('current')
if mibBuilder.loadTexts: cMTSessionParamsName.setDescription('This object specifies the name of this set of session parameters.')
cMTSessionParamsRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 1, 20, 1, 2), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cMTSessionParamsRowStatus.setStatus('current')
if mibBuilder.loadTexts: cMTSessionParamsRowStatus.setDescription("This object specifies the status of the session parameters. Only CreateAndGo and active status is supported. In order for this object to become active cMTSessionParamsName must be defined. The value of cMTSessionParamsInactivityTimeout needs to be at least 3 times of the value of cMTSessionParamsFrequency. All other objects assume the default value. Once the session parameters is activated no column can be modified. Setting this object to 'delete' will destroy the session parameters. The session parameters can be deleted only if it is not attached to any session.")
cMTSessionParamsResponseTimeout = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 1, 20, 1, 3), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setUnits('seconds').setMaxAccess("readcreate")
if mibBuilder.loadTexts: cMTSessionParamsResponseTimeout.setStatus('current')
if mibBuilder.loadTexts: cMTSessionParamsResponseTimeout.setDescription('This object specifies the amount of time a session should wait for the responses after sending out a Mediatrace request. The initiator will discard any responses to a particular request after this timeout.')
cMTSessionParamsFrequency = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 1, 20, 1, 4), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(10, 3600)).clone(120)).setUnits('seconds').setMaxAccess("readcreate")
if mibBuilder.loadTexts: cMTSessionParamsFrequency.setStatus('current')
if mibBuilder.loadTexts: cMTSessionParamsFrequency.setDescription('Duration between two successive data fetch requests.')
cMTSessionParamsInactivityTimeout = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 1, 20, 1, 5), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 10800))).setUnits('sconds').setMaxAccess("readcreate")
if mibBuilder.loadTexts: cMTSessionParamsInactivityTimeout.setStatus('current')
if mibBuilder.loadTexts: cMTSessionParamsInactivityTimeout.setDescription('This object specifies the interval that the responder wait without any requests from the initiator before removing a particular session. The inactivity timeout needs to be at least 3 times of the session frequency.')
cMTSessionParamsHistoryBuckets = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 1, 20, 1, 6), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 10)).clone(3)).setUnits('buckets').setMaxAccess("readcreate")
if mibBuilder.loadTexts: cMTSessionParamsHistoryBuckets.setStatus('current')
if mibBuilder.loadTexts: cMTSessionParamsHistoryBuckets.setDescription('This object specifies the number of buckets of statistics retained. Each bucket will contain complete set of metrics collected for all hops in one iteration.')
cMTSessionParamsRouteChangeReactiontime = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 1, 20, 1, 7), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 60))).setUnits('seconds').setMaxAccess("readcreate")
if mibBuilder.loadTexts: cMTSessionParamsRouteChangeReactiontime.setStatus('current')
if mibBuilder.loadTexts: cMTSessionParamsRouteChangeReactiontime.setDescription('This object specifies the amount of time the initiator should wait after receiving the first route change, before reacting to further route change notifications. Range is from 0 to 60.')
cMTMediaMonitorProfileTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 1, 21), )
if mibBuilder.loadTexts: cMTMediaMonitorProfileTable.setStatus('current')
if mibBuilder.loadTexts: cMTMediaMonitorProfileTable.setDescription('This table lists the media monitor profiles configured on the device.')
cMTMediaMonitorProfileEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 1, 21, 1), ).setIndexNames((0, "CISCO-MEDIATRACE-MIB", "cMTMediaMonitorProfileName"))
if mibBuilder.loadTexts: cMTMediaMonitorProfileEntry.setStatus('current')
if mibBuilder.loadTexts: cMTMediaMonitorProfileEntry.setDescription("An entry represents a media monitor profile that can be associated with a Mediatrace session contained by the cMTSessionTable. The entry is uniquely identified by cMTMediaMonitorProfileName. A row created in this table will be shown in 'show running' command and it will not be saved into non-volatile memory.")
cMTMediaMonitorProfileName = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 1, 21, 1, 1), SnmpAdminString())
if mibBuilder.loadTexts: cMTMediaMonitorProfileName.setStatus('current')
if mibBuilder.loadTexts: cMTMediaMonitorProfileName.setDescription('This object specifies the name of the Mediatrace media monitor profile.')
cMTMediaMonitorProfileRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 1, 21, 1, 2), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cMTMediaMonitorProfileRowStatus.setStatus('current')
if mibBuilder.loadTexts: cMTMediaMonitorProfileRowStatus.setDescription("This object specifies the status of the media monitor profile. Only CreateAndGo and active status is supported. In order for this object to become active cMTMediaMonitorProfileName must be defined. All other objects assume the default value. Once the media monitor profile is activated no column can be modified. Setting this object to 'delete' will destroy the media monitor. The media monitor profile can be deleted only if it is not attached to any session.")
cMTMediaMonitorProfileMetric = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 1, 21, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("rtp", 1), ("tcp", 2)))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cMTMediaMonitorProfileMetric.setStatus('current')
if mibBuilder.loadTexts: cMTMediaMonitorProfileMetric.setDescription("This object specifies the type of metrics group to be collected in addition to basic IP metrics. Specify value as RTP if metrics from 'Metric-List RTP' are desired and 'TCP' if metrics in 'Metric-List TCP' is desired.")
cMTMediaMonitorProfileInterval = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 1, 21, 1, 4), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(10, 120))).setUnits('seconds').setMaxAccess("readcreate")
if mibBuilder.loadTexts: cMTMediaMonitorProfileInterval.setStatus('current')
if mibBuilder.loadTexts: cMTMediaMonitorProfileInterval.setDescription('This object specifies the sampling interval for the media monitor profile.')
cMTMediaMonitorProfileRtpMaxDropout = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 1, 21, 1, 5), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 20)).clone(10)).setUnits('packets').setMaxAccess("readcreate")
if mibBuilder.loadTexts: cMTMediaMonitorProfileRtpMaxDropout.setStatus('current')
if mibBuilder.loadTexts: cMTMediaMonitorProfileRtpMaxDropout.setDescription('This object specifies the maximum number of dropouts allowed when sampling RTP monitoring metrics.')
cMTMediaMonitorProfileRtpMaxReorder = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 1, 21, 1, 6), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 20)).clone(5)).setUnits('packets').setMaxAccess("readcreate")
if mibBuilder.loadTexts: cMTMediaMonitorProfileRtpMaxReorder.setStatus('current')
if mibBuilder.loadTexts: cMTMediaMonitorProfileRtpMaxReorder.setDescription('This object specifies the maximum number of reorders allowed when sampling RTP monitoring metrics.')
cMTMediaMonitorProfileRtpMinimalSequential = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 1, 21, 1, 7), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(2, 10))).setUnits('packets').setMaxAccess("readcreate")
if mibBuilder.loadTexts: cMTMediaMonitorProfileRtpMinimalSequential.setStatus('current')
if mibBuilder.loadTexts: cMTMediaMonitorProfileRtpMinimalSequential.setDescription('This object specifies the minimum number of sequental packets required to identify a stream as being an RTP flow.')
cMTSystemProfileTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 1, 22), )
if mibBuilder.loadTexts: cMTSystemProfileTable.setStatus('current')
if mibBuilder.loadTexts: cMTSystemProfileTable.setDescription('This table lists the system profiles configured on the device.')
cMTSystemProfileEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 1, 22, 1), ).setIndexNames((0, "CISCO-MEDIATRACE-MIB", "cMTSystemProfileName"))
if mibBuilder.loadTexts: cMTSystemProfileEntry.setStatus('current')
if mibBuilder.loadTexts: cMTSystemProfileEntry.setDescription("An entry represents a system profile that can be associated with a Mediatrace session contained by the cMTSessionTable. Each entry is uniquely identified by name specified by cMTSystemProfileName object. A row created in this table will be shown in 'show running' command and it will not be saved into non-volatile memory.")
cMTSystemProfileName = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 1, 22, 1, 1), SnmpAdminString())
if mibBuilder.loadTexts: cMTSystemProfileName.setStatus('current')
if mibBuilder.loadTexts: cMTSystemProfileName.setDescription('This object specifies the name of the Mediatrace system profile.')
cMTSystemProfileRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 1, 22, 1, 2), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cMTSystemProfileRowStatus.setStatus('current')
if mibBuilder.loadTexts: cMTSystemProfileRowStatus.setDescription("This object specifies the status of the system profile. Only CreateAndGo and active status is supported. In order for this object to become active cMTSystemProfileName must be defined. All other objects assume the default value. Once the system profile is activated no column can be modified. Setting this object to 'delete' will destroy the system profile. The system prifile can be deleted only if it is not attached to any session.")
cMTSystemProfileMetric = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 1, 22, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("interface", 1), ("cpu", 2), ("memory", 3)))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cMTSystemProfileMetric.setStatus('current')
if mibBuilder.loadTexts: cMTSystemProfileMetric.setDescription("This object specifies the type of metrics group to be collected in addition to basic IP metrics. Specify 'interface' if metrics from 'Metric-List-Interface' are desired. Specify 'cpu' if metrics in 'Metric-List-CPU' is desired. Specify 'memory' if metrics in 'Metric-List-Memory' is desired.")
cMTSessionTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 1, 23), )
if mibBuilder.loadTexts: cMTSessionTable.setStatus('current')
if mibBuilder.loadTexts: cMTSessionTable.setDescription('This table lists the Mediatrace sessions configured on the device.')
cMTSessionEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 1, 23, 1), ).setIndexNames((0, "CISCO-MEDIATRACE-MIB", "cMTSessionNumber"))
if mibBuilder.loadTexts: cMTSessionEntry.setReference('An entry in cMTSessionTable')
if mibBuilder.loadTexts: cMTSessionEntry.setStatus('current')
if mibBuilder.loadTexts: cMTSessionEntry.setDescription("A list of objects that define specific configuration for the session of Mediatrace. The entry is uniquely identified by cMTSessionNumber. A row created in this table will be shown in 'show running' command and it will not be saved into non-volatile memory.")
cMTSessionNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 1, 23, 1, 2), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647)))
if mibBuilder.loadTexts: cMTSessionNumber.setStatus('current')
if mibBuilder.loadTexts: cMTSessionNumber.setDescription('This object specifies an arbitrary integer-value that uniquely identifies a Mediatrace session.')
cMTSessionRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 1, 23, 1, 3), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cMTSessionRowStatus.setStatus('current')
if mibBuilder.loadTexts: cMTSessionRowStatus.setDescription("This object indicates the status of Mediatrace session. Only CreateAndGo and active status is supported. Following columns must be specified in order to activate the session: - cMTSessionPathSpecifierName - cMTSessionProfileName All other objects can assume default values. None of the properties of session can be modified once it is in 'active' state. Setting the value of 'destroy' for this object will delete the session. The session can be deleted only if the corresponding schedule (row in cMTScheduleTable ) not exist.")
cMTSessionPathSpecifierName = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 1, 23, 1, 4), SnmpAdminString()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cMTSessionPathSpecifierName.setStatus('current')
if mibBuilder.loadTexts: cMTSessionPathSpecifierName.setDescription('This object specifies the name of the Mediatrace path specifier profile associated with the session.')
cMTSessionParamName = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 1, 23, 1, 5), SnmpAdminString()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cMTSessionParamName.setStatus('current')
if mibBuilder.loadTexts: cMTSessionParamName.setDescription('This object specifies the name of Mediatrace session parameter associated with the session.')
cMTSessionProfileName = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 1, 23, 1, 6), SnmpAdminString()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cMTSessionProfileName.setStatus('current')
if mibBuilder.loadTexts: cMTSessionProfileName.setDescription('This object specifies the name of the Mediatrace metric profile associated with the session.')
cMTSessionFlowSpecifierName = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 1, 23, 1, 7), SnmpAdminString()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cMTSessionFlowSpecifierName.setStatus('current')
if mibBuilder.loadTexts: cMTSessionFlowSpecifierName.setDescription('This object specifies the name of the Mediatrace flow specifier profile associated with the session. Flow specifier is not required if system profile is attached to the session. In this case, media monitor profile is attached to the session. Flow specifier is optional and the 5-tuple from the path-specifier is used instead.')
cMTSessionTraceRouteEnabled = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 1, 23, 1, 8), TruthValue()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cMTSessionTraceRouteEnabled.setStatus('current')
if mibBuilder.loadTexts: cMTSessionTraceRouteEnabled.setDescription('This object specifies if traceroute is enabled for this session.')
cMTScheduleTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 1, 24), )
if mibBuilder.loadTexts: cMTScheduleTable.setStatus('current')
if mibBuilder.loadTexts: cMTScheduleTable.setDescription('A table of Mediatrace scheduling specific definitions. Each entry in this table schedules a cMTSessionEntry created via the cMTSessionTable object.')
cMTScheduleEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 1, 24, 1), ).setIndexNames((0, "CISCO-MEDIATRACE-MIB", "cMTSessionNumber"))
if mibBuilder.loadTexts: cMTScheduleEntry.setReference('An entry in cMTScheduleTable')
if mibBuilder.loadTexts: cMTScheduleEntry.setStatus('current')
if mibBuilder.loadTexts: cMTScheduleEntry.setDescription("A list of objects that define specific configuration for the scheduling of Mediatrace operations. A row is created when a session is scheduled to make it active. Likewise, a row is destroyed when the session is unscheduled. A row created in this table will be shown in 'show running' command and it will not be saved into non-volatile memory.")
cMTScheduleRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 1, 24, 1, 1), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cMTScheduleRowStatus.setStatus('current')
if mibBuilder.loadTexts: cMTScheduleRowStatus.setDescription("This objects specifies the status of Mediatrace session schedule. Only CreateAndGo and destroy operations are permitted on the row. All objects can assume default values. The schedule start time (column cMTScheduleStartTime) must be specified in order to activate the schedule. Once activated none of the properties of the schedule can be changed. The schedule can be destroyed any time by setting the value of this object to 'destroy'. Destroying the schedule will stop the Mediatrace session but the session will not be destroyed.")
cMTScheduleStartTime = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 1, 24, 1, 2), TimeStamp()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cMTScheduleStartTime.setStatus('current')
if mibBuilder.loadTexts: cMTScheduleStartTime.setDescription('This object specifies the start time of the scheduled session.')
cMTScheduleLife = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 1, 24, 1, 3), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 2147483647)).clone(3600)).setUnits('seconds').setMaxAccess("readcreate")
if mibBuilder.loadTexts: cMTScheduleLife.setStatus('current')
if mibBuilder.loadTexts: cMTScheduleLife.setDescription('This object specifies the duration of the session in seconds.')
cMTScheduleEntryAgeout = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 1, 24, 1, 4), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 2073600)).clone(3600)).setUnits('seconds').setMaxAccess("readcreate")
if mibBuilder.loadTexts: cMTScheduleEntryAgeout.setStatus('current')
if mibBuilder.loadTexts: cMTScheduleEntryAgeout.setDescription('This object specifies the amount of time after which mediatrace session entry will be removed once the life of session is over and session is inactive.')
cMTScheduleRecurring = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 1, 24, 1, 5), TruthValue()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: cMTScheduleRecurring.setStatus('current')
if mibBuilder.loadTexts: cMTScheduleRecurring.setDescription('This object specifies whether the schedule is recurring schedule. This object can be used when a periodic session is to be executed everyday at certain time and for certain life.')
cMTPathTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 1), )
if mibBuilder.loadTexts: cMTPathTable.setStatus('current')
if mibBuilder.loadTexts: cMTPathTable.setDescription('List of paths discovered by a mediatrace session.')
cMTPathEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 1, 1), ).setIndexNames((0, "CISCO-MEDIATRACE-MIB", "cMTSessionNumber"), (0, "CISCO-MEDIATRACE-MIB", "cMTSessionLifeNumber"), (0, "CISCO-MEDIATRACE-MIB", "cMTBucketNumber"), (0, "CISCO-MEDIATRACE-MIB", "cMTPathHopNumber"))
if mibBuilder.loadTexts: cMTPathEntry.setStatus('current')
if mibBuilder.loadTexts: cMTPathEntry.setDescription('An entry in cMTPathTable represents a Mediatrace path discovered by a session. This table contains information about the hops (Mediatrace or non-Mediatrace) discovered during a specific request. The Path table is used to find the hop address (Address type - IPv4 or IPv6 and Address) and hop type (currently Mediatrace or Traceroute) to use as index for other statistics tables. A row is created when a Mediatrace scheduled session discovers a path to the specified destination during a request. Likewise, a row is destroyed when the path is no longer avilable. A single row corresponds to a Mediatrace path discovered for a session and is uniquely identified by cMTSessionNumber, cMTSessionLifeNumber, cMTBucketNumber and cMTPathHopNumber. The created rows are destroyed when the device undergoes a restart.')
cMTSessionLifeNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 1, 1, 1), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 2)))
if mibBuilder.loadTexts: cMTSessionLifeNumber.setStatus('current')
if mibBuilder.loadTexts: cMTSessionLifeNumber.setDescription('This object specifies a life for a conceptual statistics row. For a particular value of cMTSessionLifeNumber, the agent assigns the first value of 0 to the current (latest) life, with 1 being the next latest and so on. The sequence keeps incrementing, despite older (lower) values being removed from the table.')
cMTBucketNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 1, 1, 2), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 10)))
if mibBuilder.loadTexts: cMTBucketNumber.setStatus('current')
if mibBuilder.loadTexts: cMTBucketNumber.setDescription('This object is index of the list of statistics buckets stored. A statistics bucket corresponds to data collected from each hop in one run of the periodic mediatrace session. Bucket with Index value of 0 is the bucket for latest completed run. Index 1 is one run prior to latest completed run, index 2 is two runs prior to latest completed run, and so on.')
cMTPathHopNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 1, 1, 3), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 255)))
if mibBuilder.loadTexts: cMTPathHopNumber.setStatus('current')
if mibBuilder.loadTexts: cMTPathHopNumber.setDescription('This object specifies the hop number for a Mediatrace Path. This hop can be either Mediatrace or Non-Mediatrace node. The hop number is relative to the initiator with 0 being used to identify initiator itself, 1 for next farther node, etc. This hop number is always unique i.e., two hops cannot have same hop number.')
cMTPathHopAddrType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 1, 1, 4), InetAddressType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cMTPathHopAddrType.setStatus('current')
if mibBuilder.loadTexts: cMTPathHopAddrType.setDescription('This object specifies the type of IP address specified by the corresponding instance of cMTPathHopAddrType.')
cMTPathHopAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 1, 1, 5), InetAddress()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cMTPathHopAddr.setStatus('current')
if mibBuilder.loadTexts: cMTPathHopAddr.setDescription('This object indicates IP Address type of the hop on a Mediatrace Path.')
cMTPathHopType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 1, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("mediatrace", 1), ("traceroute", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: cMTPathHopType.setStatus('current')
if mibBuilder.loadTexts: cMTPathHopType.setDescription("This object indicates the type of the hop on a Mediatrace path. Currently, only two types are present - mediatrace(1) and traceroute(2). A hop is of type 'mediatrace' if it is discovered by only mediatrace or by both mediatrace and trace-route. The hop is 'trace route' if it is discovered by trace route only.")
cMTPathHopAlternate1AddrType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 1, 1, 7), InetAddressType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cMTPathHopAlternate1AddrType.setStatus('current')
if mibBuilder.loadTexts: cMTPathHopAlternate1AddrType.setDescription('This object specifies the type of IP address specified by the corresponding instance of cMTPathHopAlternate1AddrType.')
cMTPathHopAlternate1Addr = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 1, 1, 8), InetAddress()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cMTPathHopAlternate1Addr.setStatus('current')
if mibBuilder.loadTexts: cMTPathHopAlternate1Addr.setDescription('This object indicates the IP Address of the first alternate hop on a traceroute path.')
cMTPathHopAlternate2AddrType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 1, 1, 9), InetAddressType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cMTPathHopAlternate2AddrType.setStatus('current')
if mibBuilder.loadTexts: cMTPathHopAlternate2AddrType.setDescription('This object specifies the type of IP address specified by the corresponding instance of cMTPathHopAlternate2AddrType.')
cMTPathHopAlternate2Addr = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 1, 1, 10), InetAddress()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cMTPathHopAlternate2Addr.setStatus('current')
if mibBuilder.loadTexts: cMTPathHopAlternate2Addr.setDescription('This object indicates the IP Address of the second alternate hop on a traceroute path.')
cMTPathHopAlternate3AddrType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 1, 1, 11), InetAddressType()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cMTPathHopAlternate3AddrType.setStatus('current')
if mibBuilder.loadTexts: cMTPathHopAlternate3AddrType.setDescription('This object specifies the type of IP address specified by the corresponding instance of cMTPathHopAlternate3AddrType.')
cMTPathHopAlternate3Addr = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 1, 1, 12), InetAddress()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cMTPathHopAlternate3Addr.setStatus('current')
if mibBuilder.loadTexts: cMTPathHopAlternate3Addr.setDescription('This object indicates the IP Address of the third alternate hop on a traceroute path.')
cMTHopStatsTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 2), )
if mibBuilder.loadTexts: cMTHopStatsTable.setStatus('current')
if mibBuilder.loadTexts: cMTHopStatsTable.setDescription('An entry in cMTHopStatsTable represents a hop on the path associated to a Mediatrace session. This table contains information about particular hop (Mediatrace or non-Mediatrace) such as the address, type of hop, etc. A single row corresponds to a hop on the Mediatrace path discovered for a session and is uniquely identified by cMTSessionNumber, cMTSessionLifeNumber, cMTBucketNumber,cMTHopStatsAddrType and cMTHopStatsAddr. The created rows are destroyed when the device undergoes a restart.')
cMTHopStatsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 2, 1), ).setIndexNames((0, "CISCO-MEDIATRACE-MIB", "cMTSessionNumber"), (0, "CISCO-MEDIATRACE-MIB", "cMTSessionLifeNumber"), (0, "CISCO-MEDIATRACE-MIB", "cMTBucketNumber"), (0, "CISCO-MEDIATRACE-MIB", "cMTHopStatsAddrType"), (0, "CISCO-MEDIATRACE-MIB", "cMTHopStatsAddr"))
if mibBuilder.loadTexts: cMTHopStatsEntry.setStatus('current')
if mibBuilder.loadTexts: cMTHopStatsEntry.setDescription('An entry in cMTHopStatsTable')
cMTHopStatsMaskBitmaps = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 2, 1, 1), Bits().clone(namedValues=NamedValues(("mediatraceTtlUnsupported", 0), ("mediatraceTtlUncollected", 1), ("collectionStatsUnsupported", 2), ("collectionStatsUncollected", 3), ("ingressInterfaceUnsupported", 4), ("ingressInterfaceUncollected", 5), ("egressInterfaceUnsupported", 6), ("egressInterfaceUncollected", 7)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: cMTHopStatsMaskBitmaps.setStatus('current')
if mibBuilder.loadTexts: cMTHopStatsMaskBitmaps.setDescription('This object indicates whether the corresponding instances of these statistics fields in the table are supported. It also indicates if the statistics data are collected. There are 2 bits for each corresponding field.')
cMTHopStatsAddrType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 2, 1, 2), InetAddressType())
if mibBuilder.loadTexts: cMTHopStatsAddrType.setStatus('current')
if mibBuilder.loadTexts: cMTHopStatsAddrType.setDescription('This object specifies the type of IP address specified by the corresponding instance of cMTHopStatsAddr.')
cMTHopStatsAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 2, 1, 3), InetAddress())
if mibBuilder.loadTexts: cMTHopStatsAddr.setStatus('current')
if mibBuilder.loadTexts: cMTHopStatsAddr.setDescription('This object specifies the IP Address of the hop on a Mediatrace Path. This value is obtained from CMTPathHopAddr in cMTPathTable.')
cMTHopStatsName = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 2, 1, 4), SnmpAdminString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cMTHopStatsName.setStatus('current')
if mibBuilder.loadTexts: cMTHopStatsName.setDescription('This object indicates the name for this hop. This can be either the hostname or the IP address for the hop.')
cMTHopStatsMediatraceTtl = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 2, 1, 5), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setMaxAccess("readonly")
if mibBuilder.loadTexts: cMTHopStatsMediatraceTtl.setReference("J. Postel, 'Internet Protocol', RFC-791, September 1981. J. Deering and R. Hinden, 'Internet Protocol, Version 6 (IPv6) Specification', RFC-2460, December 1998.")
if mibBuilder.loadTexts: cMTHopStatsMediatraceTtl.setStatus('current')
if mibBuilder.loadTexts: cMTHopStatsMediatraceTtl.setDescription("This object indicates the hop limit of the corresponding traffic flow. If version 4 of the IP carries the traffic flow, then the value of this column corresponds to the 'Time to Live' field of the IP header contained by packets in the Mediatrace request. If version 6 of the IP carries the traffic flow, then the value of this column corresponds to the 'Hop Limit' field of the IP header contained by packets in the Mediatrace request.")
cMTHopStatsCollectionStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 2, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("success", 1), ("notSuccess", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: cMTHopStatsCollectionStatus.setStatus('current')
if mibBuilder.loadTexts: cMTHopStatsCollectionStatus.setDescription("This object indicates the operational status of data being collected on the hop for a specific session: 'success' The hop is actively collecting and responding with data. 'notsuccess' The hop is not collecting or responding with data.")
cMTHopStatsIngressInterface = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 2, 1, 7), SnmpAdminString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cMTHopStatsIngressInterface.setStatus('current')
if mibBuilder.loadTexts: cMTHopStatsIngressInterface.setDescription('This object indicates the interface on the responder that receives the Mediatrace request from the initiator.')
cMTHopStatsEgressInterface = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 2, 1, 8), SnmpAdminString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cMTHopStatsEgressInterface.setStatus('current')
if mibBuilder.loadTexts: cMTHopStatsEgressInterface.setDescription("This object indicates the interface on the responder which is used to forward the Mediatrace request from the initiator towards destination in the path specifier. Value of 'None' will be shown if the destination address in path specifier terminates on this hop.")
cMTTraceRouteTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 3), )
if mibBuilder.loadTexts: cMTTraceRouteTable.setStatus('current')
if mibBuilder.loadTexts: cMTTraceRouteTable.setDescription('This table lists the hops discovered by traceroute executed from the initiator. These are the hops which are on media flow path but on which mediatrace is not enabled or is not supported.')
cMTTraceRouteEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 3, 1), ).setIndexNames((0, "CISCO-MEDIATRACE-MIB", "cMTSessionNumber"), (0, "CISCO-MEDIATRACE-MIB", "cMTSessionLifeNumber"), (0, "CISCO-MEDIATRACE-MIB", "cMTBucketNumber"), (0, "CISCO-MEDIATRACE-MIB", "cMTHopStatsAddrType"), (0, "CISCO-MEDIATRACE-MIB", "cMTHopStatsAddr"))
if mibBuilder.loadTexts: cMTTraceRouteEntry.setStatus('current')
if mibBuilder.loadTexts: cMTTraceRouteEntry.setDescription('An entry in cMTTraceRouteTable represents a Traceroute hop on the path associated to a Mediatrace session. The created rows are destroyed when the device undergoes a restart.')
cMTTraceRouteHopNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 3, 1, 1), Gauge32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cMTTraceRouteHopNumber.setStatus('current')
if mibBuilder.loadTexts: cMTTraceRouteHopNumber.setDescription('This object indicates the hop number of Traceroute host relative to the Initiator. It start with 1 and increments as we go farther from the Initiator.')
cMTTraceRouteHopRtt = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 3, 1, 2), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cMTTraceRouteHopRtt.setStatus('current')
if mibBuilder.loadTexts: cMTTraceRouteHopRtt.setDescription('This object indicates RTT. The time it takes for a packet to get to a hop and back, displayed in milliseconds. (ms).')
cMTSessionStatusTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 4), )
if mibBuilder.loadTexts: cMTSessionStatusTable.setStatus('current')
if mibBuilder.loadTexts: cMTSessionStatusTable.setDescription('This table contains aggregate data maintained by Mediatrace for session status.')
cMTSessionStatusEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 4, 1), ).setIndexNames((0, "CISCO-MEDIATRACE-MIB", "cMTSessionNumber"))
if mibBuilder.loadTexts: cMTSessionStatusEntry.setStatus('current')
if mibBuilder.loadTexts: cMTSessionStatusEntry.setDescription('An entry in cMTSessionStatusTable represents information about a Mediatrace session. This table contains information about particular session such as global session identifier, operation state and time to live. A single row corresponds to status of a Mediatrace session and is uniquely identified by cMTSessionNumber. The created rows are destroyed when the device undergoes a restart.')
cMTSessionStatusBitmaps = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 4, 1, 1), Bits().clone(namedValues=NamedValues(("globalSessionIdUusupport", 0), ("globalSessionIdUncollected", 1), ("operationStateUusupport", 2), ("operationStateUncollected", 3), ("operationTimeToLiveUusupport", 4), ("operationTimeToLiveUncollected", 5)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: cMTSessionStatusBitmaps.setStatus('current')
if mibBuilder.loadTexts: cMTSessionStatusBitmaps.setDescription('This object indicates whether the corresponding instances of these statistics fields in the table are supported. It also indicates if the statistics are collected. There are 2 bits for each field.')
cMTSessionStatusGlobalSessionId = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 4, 1, 2), Unsigned32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cMTSessionStatusGlobalSessionId.setStatus('current')
if mibBuilder.loadTexts: cMTSessionStatusGlobalSessionId.setDescription('This object indicates a globally unique Id to identify a session throughout the network.')
cMTSessionStatusOperationState = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 4, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("pending", 1), ("active", 2), ("inactive", 3), ("sleep", 4)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: cMTSessionStatusOperationState.setStatus('current')
if mibBuilder.loadTexts: cMTSessionStatusOperationState.setDescription('This object indicates the operation status of the session. pending - Session is not currently active. active - Session is in active state. inactive - Session is not active but it has not aged out. sleep - Session is in sleep state.')
cMTSessionStatusOperationTimeToLive = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 4, 1, 4), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cMTSessionStatusOperationTimeToLive.setStatus('current')
if mibBuilder.loadTexts: cMTSessionStatusOperationTimeToLive.setDescription('This object indicates how long the session operation will last.')
cMTSessionRequestStatsTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 5), )
if mibBuilder.loadTexts: cMTSessionRequestStatsTable.setStatus('current')
if mibBuilder.loadTexts: cMTSessionRequestStatsTable.setDescription('This table contains aggregate data maintained by Mediatrace for session request status.')
cMTSessionRequestStatsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 5, 1), ).setIndexNames((0, "CISCO-MEDIATRACE-MIB", "cMTSessionNumber"), (0, "CISCO-MEDIATRACE-MIB", "cMTSessionLifeNumber"), (0, "CISCO-MEDIATRACE-MIB", "cMTBucketNumber"))
if mibBuilder.loadTexts: cMTSessionRequestStatsEntry.setStatus('current')
if mibBuilder.loadTexts: cMTSessionRequestStatsEntry.setDescription('An entry in cMTSessionRequestStatsTable represents status for each request for a particular session. A single row corresponds to a request sent by a particular Mediatrace session and is uniquely identified by cMTSessionNumber, cMTSessionLifeNumber and cMTBucketNumber. The created rows are destroyed when the device undergoes a restart.')
cMTSessionRequestStatsBitmaps = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 5, 1, 1), Bits().clone(namedValues=NamedValues(("requestTimestampUnsupport", 0), ("requestTimestampUncollected", 1), ("requestStatusUnsupport", 2), ("requestStatusUncollected", 3), ("tracerouteStatusUnsupport", 4), ("tracerouteStatusUncollected", 5), ("routeIndexUnsupport", 6), ("routeIndexUncollected", 7), ("numberOfMediatraceHopsUnsupport", 8), ("numberOfMediatraceHopsUncollected", 9), ("numberOfNonMediatraceHopsUnsupport", 10), ("numberOfNonMediatraceHopsUncollected", 11), ("numberOfValidHopsUnsupport", 12), ("numberOfValidHopsUncollected", 13), ("numberOfErrorHopsUnsupport", 14), ("numberOfErrorHopsUncollected", 15), ("numberOfNoDataRecordHopsUnsupport", 16), ("numberOfNoDataRecordHopsUncollected", 17), ("metaGlobalIdUnsupport", 18), ("metaGlobalIdUncollected", 19), ("metaMultiPartySessionIdUnsupport", 20), ("metaMultiPartySessionIdUncollected", 21), ("metaAppNameUnsupport", 22), ("metaAppNameUncollected", 23)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: cMTSessionRequestStatsBitmaps.setStatus('current')
if mibBuilder.loadTexts: cMTSessionRequestStatsBitmaps.setDescription('This object indicates whether the corresponding instances of these stats fields in the table are supported. It also indicates if the stats data are collected. There are 2 bits for each corresponding field.')
cMTSessionRequestStatsRequestTimestamp = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 5, 1, 2), TimeStamp()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cMTSessionRequestStatsRequestTimestamp.setStatus('current')
if mibBuilder.loadTexts: cMTSessionRequestStatsRequestTimestamp.setDescription('This object indicates the value of request time when the request was sent our by the initiator for this particular session.')
cMTSessionRequestStatsRequestStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 5, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("completed", 1), ("notCompleted", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: cMTSessionRequestStatsRequestStatus.setStatus('current')
if mibBuilder.loadTexts: cMTSessionRequestStatsRequestStatus.setDescription('This object indicates the status of request for the session.')
cMTSessionRequestStatsTracerouteStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 5, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("completed", 1), ("notCompleted", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: cMTSessionRequestStatsTracerouteStatus.setStatus('current')
if mibBuilder.loadTexts: cMTSessionRequestStatsTracerouteStatus.setDescription('This object indicates the status of traceroute for the session.')
cMTSessionRequestStatsRouteIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 5, 1, 5), Gauge32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cMTSessionRequestStatsRouteIndex.setStatus('current')
if mibBuilder.loadTexts: cMTSessionRequestStatsRouteIndex.setDescription('This object indicates the route index for the session request. It signifies the number of times a route has changed for a particular session. 0 signifies no route change.')
cMTSessionRequestStatsNumberOfMediatraceHops = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 5, 1, 6), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cMTSessionRequestStatsNumberOfMediatraceHops.setStatus('current')
if mibBuilder.loadTexts: cMTSessionRequestStatsNumberOfMediatraceHops.setDescription('This object indicates the number of Mediatrace hops in the path.')
cMTSessionRequestStatsNumberOfNonMediatraceHops = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 5, 1, 7), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cMTSessionRequestStatsNumberOfNonMediatraceHops.setStatus('current')
if mibBuilder.loadTexts: cMTSessionRequestStatsNumberOfNonMediatraceHops.setDescription('This object indicates the number of non-Mediatrace hops in the path.')
cMTSessionRequestStatsNumberOfValidHops = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 5, 1, 8), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cMTSessionRequestStatsNumberOfValidHops.setStatus('current')
if mibBuilder.loadTexts: cMTSessionRequestStatsNumberOfValidHops.setDescription('This object indicates the number of hops with valid data report.')
cMTSessionRequestStatsNumberOfErrorHops = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 5, 1, 9), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cMTSessionRequestStatsNumberOfErrorHops.setStatus('current')
if mibBuilder.loadTexts: cMTSessionRequestStatsNumberOfErrorHops.setDescription('This object indicates the number of hops with error report. These hops are not able to return the statistics due to some issue.')
cMTSessionRequestStatsNumberOfNoDataRecordHops = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 5, 1, 10), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cMTSessionRequestStatsNumberOfNoDataRecordHops.setStatus('current')
if mibBuilder.loadTexts: cMTSessionRequestStatsNumberOfNoDataRecordHops.setDescription('This object indicates the number of hops with no data record.')
cMTSessionRequestStatsMDGlobalId = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 5, 1, 11), OctetString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cMTSessionRequestStatsMDGlobalId.setStatus('current')
if mibBuilder.loadTexts: cMTSessionRequestStatsMDGlobalId.setDescription('This object indicates the meta-data global Id for this session.')
cMTSessionRequestStatsMDMultiPartySessionId = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 5, 1, 12), OctetString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cMTSessionRequestStatsMDMultiPartySessionId.setStatus('current')
if mibBuilder.loadTexts: cMTSessionRequestStatsMDMultiPartySessionId.setDescription('This object indicates the meta-data Multi Party Session Id for this session.')
cMTSessionRequestStatsMDAppName = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 5, 1, 13), OctetString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cMTSessionRequestStatsMDAppName.setStatus('current')
if mibBuilder.loadTexts: cMTSessionRequestStatsMDAppName.setDescription('This object indicates the meta-data AppName for this session.')
cMTCommonMetricStatsTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 6), )
if mibBuilder.loadTexts: cMTCommonMetricStatsTable.setStatus('current')
if mibBuilder.loadTexts: cMTCommonMetricStatsTable.setDescription('This table contains the list of entries representing common IP metrics values for a particular mediatrace session on particular hop.')
cMTCommonMetricStatsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 6, 1), ).setIndexNames((0, "CISCO-MEDIATRACE-MIB", "cMTSessionNumber"), (0, "CISCO-MEDIATRACE-MIB", "cMTSessionLifeNumber"), (0, "CISCO-MEDIATRACE-MIB", "cMTBucketNumber"), (0, "CISCO-MEDIATRACE-MIB", "cMTHopStatsAddrType"), (0, "CISCO-MEDIATRACE-MIB", "cMTHopStatsAddr"))
if mibBuilder.loadTexts: cMTCommonMetricStatsEntry.setStatus('current')
if mibBuilder.loadTexts: cMTCommonMetricStatsEntry.setDescription('An entry in cMTCommonMetricStatsTable represents common media monitor profile information of a hop on the path associated to a Mediatrace session such as flow sampling time stamp, packets dropped, IP TTL, etc. The devices creates a row in the cMTCommonMetricStatsTable when a Mediatrace session starts collecting a traffic metrics data and has been configured to compute common IP metrics. Likewise, the device destroys a row in the cMTCommonMetricStatsTable when the corresponding Mediatrace session has ceased collecting the traffic metrics data (e.g., when a scheduled session has timed out). A single row corresponds to a common media monitor profile information of a hop on the path discovered for a session and is uniquely identified by cMTSessionNumber, cMTSessionLifeNumber, cMTBucketNumber,cMTHopStatsAddrType and cMTHopStatsAddr. The created rows are destroyed when the device undergoes a restart.')
cMTCommonMetricsBitmaps = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 6, 1, 2), Bits().clone(namedValues=NamedValues(("flowSamplingStartTimeUnsupported", 0), ("flowSamplingStartTimeUncollected", 1), ("ipPktDroppedUnsupported", 2), ("ipPktDroppedUncollected", 3), ("ipPktCountUnsupported", 4), ("ipPktCountUncollected", 5), ("ipOctetsUnsupported", 6), ("ipOctetsUncollected", 7), ("ipByteRateUnsupported", 8), ("ipByteRateUncollected", 9), ("ipDscpUnsupported", 10), ("ipDscpUncollected", 11), ("ipTtlUnsupported", 12), ("ipTtlUncollected", 13), ("flowCounterUnsupported", 14), ("flowCounterUncollected", 15), ("flowDirectionUnsupported", 16), ("flowDirectionUncollected", 17), ("lossMeasurementUnsupported", 18), ("lossMeasurementUncollected", 19), ("mediaStopOccurredUnsupported", 20), ("mediaStopOccurredUncollected", 21), ("routeForwardUnsupported", 22), ("routeForwardUncollected", 23), ("ipProtocolUnsupported", 24), ("ipProtocolUncollected", 25)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: cMTCommonMetricsBitmaps.setStatus('current')
if mibBuilder.loadTexts: cMTCommonMetricsBitmaps.setDescription('This object indicates whether the corresponding instances of these stats fields in the table are supported. It also indicates if the stats data are collected. There are 2 bits for each field.')
cMTCommonMetricsFlowSamplingStartTime = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 6, 1, 3), CiscoNTPTimeStamp()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cMTCommonMetricsFlowSamplingStartTime.setStatus('current')
if mibBuilder.loadTexts: cMTCommonMetricsFlowSamplingStartTime.setDescription('This object defines the the timestamp when the statistics were collected on the responder.')
cMTCommonMetricsIpPktDropped = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 6, 1, 4), Counter64()).setUnits('packets').setMaxAccess("readonly")
if mibBuilder.loadTexts: cMTCommonMetricsIpPktDropped.setStatus('current')
if mibBuilder.loadTexts: cMTCommonMetricsIpPktDropped.setDescription("This object indicates number of packet drops observed on the flow being monitored on this hop from flow sampling start time in window of 'sample interval' length.")
cMTCommonMetricsIpOctets = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 6, 1, 5), Counter64()).setUnits('octets').setMaxAccess("readonly")
if mibBuilder.loadTexts: cMTCommonMetricsIpOctets.setStatus('current')
if mibBuilder.loadTexts: cMTCommonMetricsIpOctets.setDescription('This object indicates the total number of octets contained by the packets processed by the Mediatrace request for the corresponding traffic flow.')
cMTCommonMetricsIpPktCount = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 6, 1, 6), Counter64()).setUnits('packets').setMaxAccess("readonly")
if mibBuilder.loadTexts: cMTCommonMetricsIpPktCount.setStatus('current')
if mibBuilder.loadTexts: cMTCommonMetricsIpPktCount.setDescription('This object indicates the total number of packets processed by the Mediatrace request for the corresponding traffic flow.')
cMTCommonMetricsIpByteRate = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 6, 1, 7), Gauge32()).setUnits('packets per second').setMaxAccess("readonly")
if mibBuilder.loadTexts: cMTCommonMetricsIpByteRate.setStatus('current')
if mibBuilder.loadTexts: cMTCommonMetricsIpByteRate.setDescription('This object indicates the average packet rate at which the Mediatrace request is processing data for the corresponding traffic flow. This value is cumulative over the lifetime of the traffic flow.')
cMTCommonMetricsIpDscp = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 6, 1, 8), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 64))).setMaxAccess("readonly")
if mibBuilder.loadTexts: cMTCommonMetricsIpDscp.setStatus('current')
if mibBuilder.loadTexts: cMTCommonMetricsIpDscp.setDescription("This object indicates the DSCP value of the corresponding traffic flow. If version 4 of the IP carries the traffic flow, then the value of this column corresponds to the DSCP part of 'Type of Service' field of the IP header contained by packets in the traffic flow. If version 6 of the IP carries the traffic flow, then the value of this column corresponds to DSCP part of the 'Traffic Class' field of the IP header contained by packets in the traffic flow.")
cMTCommonMetricsIpTtl = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 6, 1, 9), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setMaxAccess("readonly")
if mibBuilder.loadTexts: cMTCommonMetricsIpTtl.setReference("J. Postel, 'Internet Protocol', RFC-791, September 1981. J. Deering and R. Hinden, 'Internet Protocol, Version 6 (IPv6) Specification', RFC-2460, December 1998.")
if mibBuilder.loadTexts: cMTCommonMetricsIpTtl.setStatus('current')
if mibBuilder.loadTexts: cMTCommonMetricsIpTtl.setDescription("This object indicates the hop limit of the corresponding traffic flow. If version 4 of the IP carries the traffic flow, then the value of this column corresponds to the 'Time to Live' field of the IP header contained by packets in the Mediatrace request. If version 6 of the IP carries the traffic flow, then the value of this column corresponds to the 'Hop Limit' field of the IP header contained by packets in the Mediatrace request.")
cMTCommonMetricsFlowCounter = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 6, 1, 10), Gauge32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cMTCommonMetricsFlowCounter.setStatus('current')
if mibBuilder.loadTexts: cMTCommonMetricsFlowCounter.setDescription('This object indicates the number of traffic flows currently monitored by the Mediatrace request.')
cMTCommonMetricsFlowDirection = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 6, 1, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("unknown", 1), ("ingress", 2), ("egress", 3)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: cMTCommonMetricsFlowDirection.setStatus('current')
if mibBuilder.loadTexts: cMTCommonMetricsFlowDirection.setDescription("This object indicates the direction of the traffic flow where the data is monitored : 'unknown' The SNMP entity does not know the direction of the traffic flow at the point data is collected. 'ingress' Data is collected at the point where the traffic flow enters the devices 'egress' Data is colected at the point where the traffic flow leaves the device.")
cMTCommonMetricsLossMeasurement = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 6, 1, 12), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("true", 1), ("false", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: cMTCommonMetricsLossMeasurement.setStatus('current')
if mibBuilder.loadTexts: cMTCommonMetricsLossMeasurement.setDescription('This object indicates the loss measurement.')
cMTCommonMetricsMediaStopOccurred = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 6, 1, 13), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("true", 1), ("false", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: cMTCommonMetricsMediaStopOccurred.setStatus('current')
if mibBuilder.loadTexts: cMTCommonMetricsMediaStopOccurred.setDescription('This object indicates the media stop occurred.')
cMTCommonMetricsRouteForward = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 6, 1, 14), SnmpAdminString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cMTCommonMetricsRouteForward.setStatus('current')
if mibBuilder.loadTexts: cMTCommonMetricsRouteForward.setDescription('This object indicates routing or forwarding status i.e. whether the packet is forwarded or dropped for the flow.')
cMTCommonMetricsIpProtocol = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 6, 1, 15), CiscoMediatraceSupportProtocol()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cMTCommonMetricsIpProtocol.setStatus('current')
if mibBuilder.loadTexts: cMTCommonMetricsIpProtocol.setDescription('This table contains entry to specify the media Metric-list for the particular Mmediatrace session on the hop.')
cMTRtpMetricStatsTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 7), )
if mibBuilder.loadTexts: cMTRtpMetricStatsTable.setStatus('current')
if mibBuilder.loadTexts: cMTRtpMetricStatsTable.setDescription('This table contains aggregate data maintained by Mediatrace for traffic flows for which it is computing RTP metrics.')
cMTRtpMetricStatsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 7, 1), )
cMTCommonMetricStatsEntry.registerAugmentions(("CISCO-MEDIATRACE-MIB", "cMTRtpMetricStatsEntry"))
cMTRtpMetricStatsEntry.setIndexNames(*cMTCommonMetricStatsEntry.getIndexNames())
if mibBuilder.loadTexts: cMTRtpMetricStatsEntry.setStatus('current')
if mibBuilder.loadTexts: cMTRtpMetricStatsEntry.setDescription('An entry in cMTRtpMetricStatsTable represents RTP related information of a hop on the path associated to a Mediatrace session such as bit rate, octets, etc. The devices creates a row in the cMTRtpMetricStatsTable when a Mediatrace session starts collecting a traffic metrics data and has been configured to compute RTP metrics for the same traffic metrics data. Likewise, the device destroys a row in the cMTRtpMetricStatsTable when the corresponding Mediatrace session has ceased collecting the traffic metrics data (e.g., when a scheduled session has timed out). A single row corresponds to a RTP information of a hop on the path discovered for a Mediatrace session and is uniquely identified by cMTSessionNumber, cMTSessionLifeNumber, cMTBucketNumber,cMTHopStatsAddrType and cMTHopStatsAddr. The created rows are destroyed when the device undergoes a restart.')
cMTRtpMetricsBitmaps = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 7, 1, 2), Bits().clone(namedValues=NamedValues(("bitRateunSupport", 0), ("bitRateunCollected", 1), ("octetsunSupport", 2), ("octetsunCollected", 3), ("pktsunSupport", 4), ("pktsunCollected", 5), ("jitterunSupport", 6), ("jitterunCollected", 7), ("lostPktsunSupport", 8), ("lostPktsunCollected", 9), ("expectedPktsunSupport", 10), ("expectedPktsunCollected", 11), ("lostPktEventsunSupport", 12), ("lostPktEventsunCollected", 13), ("losspercentUnsupport", 14), ("losspercentUncollected", 15)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: cMTRtpMetricsBitmaps.setStatus('current')
if mibBuilder.loadTexts: cMTRtpMetricsBitmaps.setDescription('This object indicates whether the corresponding instances of these statistics fields in the table are supported. It also indicates if the stats data are collected. There are 2 bits for each field.')
cMTRtpMetricsBitRate = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 7, 1, 3), Gauge32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cMTRtpMetricsBitRate.setStatus('current')
if mibBuilder.loadTexts: cMTRtpMetricsBitRate.setDescription('This object indicates the average bit rate at which the corresponding Mediatrace request is processing data for the corresponding traffic flow. This value is cumulative over the lifetime of the traffic flow.')
cMTRtpMetricsOctets = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 7, 1, 4), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cMTRtpMetricsOctets.setStatus('current')
if mibBuilder.loadTexts: cMTRtpMetricsOctets.setDescription('This object indicates the total number of octets contained by the packets processed by the Mediatrace request for the corresponding traffic flow.')
cMTRtpMetricsPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 7, 1, 5), Counter64()).setUnits('packets').setMaxAccess("readonly")
if mibBuilder.loadTexts: cMTRtpMetricsPkts.setStatus('current')
if mibBuilder.loadTexts: cMTRtpMetricsPkts.setDescription('This object indicates the total number of packets processed by the corresponding Mediatrace request for the corresponding traffic flow.')
cMTRtpMetricsJitter = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 7, 1, 6), FlowMetricValue()).setUnits('seconds').setMaxAccess("readonly")
if mibBuilder.loadTexts: cMTRtpMetricsJitter.setStatus('current')
if mibBuilder.loadTexts: cMTRtpMetricsJitter.setDescription('This object indicates the inter-arrival jitter for the traffic flow.')
cMTRtpMetricsLostPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 7, 1, 7), Counter64()).setUnits('packets').setMaxAccess("readonly")
if mibBuilder.loadTexts: cMTRtpMetricsLostPkts.setStatus('current')
if mibBuilder.loadTexts: cMTRtpMetricsLostPkts.setDescription('This object indicates the number of RTP packets lost for the traffic flow.')
cMTRtpMetricsExpectedPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 7, 1, 8), Counter64()).setUnits('packets').setMaxAccess("readonly")
if mibBuilder.loadTexts: cMTRtpMetricsExpectedPkts.setStatus('current')
if mibBuilder.loadTexts: cMTRtpMetricsExpectedPkts.setDescription('This object indicates the number of RTP packets expected for the traffic flow.')
cMTRtpMetricsLostPktEvents = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 7, 1, 9), Counter64()).setUnits('packets').setMaxAccess("readonly")
if mibBuilder.loadTexts: cMTRtpMetricsLostPktEvents.setStatus('current')
if mibBuilder.loadTexts: cMTRtpMetricsLostPktEvents.setDescription('This object indicates the number of packet loss events observed by the Mediatrace request for the corresponding traffic flow.')
cMTRtpMetricsLossPercent = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 7, 1, 10), Gauge32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: cMTRtpMetricsLossPercent.setStatus('current')
if mibBuilder.loadTexts: cMTRtpMetricsLossPercent.setDescription('This object indicates the percentage of packages are lost per ten thousand packets in a traffic flow.')
cMTTcpMetricStatsTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 8), )
if mibBuilder.loadTexts: cMTTcpMetricStatsTable.setStatus('current')
if mibBuilder.loadTexts: cMTTcpMetricStatsTable.setDescription('This table contains aggregate data maintained by Mediatrace for traffic flows for which it is computing TCP metrics.')
cMTTcpMetricStatsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 8, 1), )
cMTCommonMetricStatsEntry.registerAugmentions(("CISCO-MEDIATRACE-MIB", "cMTTcpMetricStatsEntry"))
cMTTcpMetricStatsEntry.setIndexNames(*cMTCommonMetricStatsEntry.getIndexNames())
if mibBuilder.loadTexts: cMTTcpMetricStatsEntry.setStatus('current')
if mibBuilder.loadTexts: cMTTcpMetricStatsEntry.setDescription('An entry in cMTTcpMetricStatsTable represents TCP information of a hop on the path associated to a Mediatrace session such as byte count, round trip delay, etc. The devices creates a row in the cMTTcpMetricStatsTable when a Mediatrace session starts collecting a traffic metrics data and has been configured to compute TCP metrics for the same traffic metrics data. Likewise, the device destroys a row in the cMTTcpMetricStatsTable when the corresponding Mediatrace session has ceased collecting the traffic metrics data (e.g., when a scheduled session has timed out). A single row corresponds to TCP information of a hop on the path discovered for a Mediatrace session and is uniquely identified by cMTSessionNumber, cMTSessionLifeNumber, cMTBucketNumber,cMTHopStatsAddrType and cMTHopStatsAddr. The created rows are destroyed when the device undergoes a restart.')
cMTTcpMetricBitmaps = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 8, 1, 2), Bits().clone(namedValues=NamedValues(("mediaByteCountUnsupport", 0), ("mediaByteCountUncollected", 1), ("connectRoundTripDelayUnsupport", 2), ("connectRoundTripDelayUncollected", 3), ("lostEventCountUnsupport", 4), ("lostEventCountUncollected", 5)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: cMTTcpMetricBitmaps.setStatus('current')
if mibBuilder.loadTexts: cMTTcpMetricBitmaps.setDescription('This object indicates whether the corresponding instances of these stats fields in the table are supported. It also indicates if the stats data are collected. There are 2 bits for each field.')
cMTTcpMetricMediaByteCount = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 8, 1, 3), FlowMetricValue()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cMTTcpMetricMediaByteCount.setStatus('current')
if mibBuilder.loadTexts: cMTTcpMetricMediaByteCount.setDescription('This object indicates the number of bytes for the packets observed by the Mediatrace session for the corresponding flow.')
cMTTcpMetricConnectRoundTripDelay = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 8, 1, 4), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cMTTcpMetricConnectRoundTripDelay.setStatus('current')
if mibBuilder.loadTexts: cMTTcpMetricConnectRoundTripDelay.setDescription('This object indicates the round trip time for the packets observed by the Mediatrace session for the corresponding flow. The round trip time is defined as the length of time it takes for a TCP segment transmission and receipt of acknowledgement. This object indicates the connect round trip delay.')
cMTTcpMetricLostEventCount = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 8, 1, 5), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cMTTcpMetricLostEventCount.setStatus('current')
if mibBuilder.loadTexts: cMTTcpMetricLostEventCount.setDescription('This object indicates the number of packets lost for the traffic flow.')
cMTSystemMetricStatsTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 9), )
if mibBuilder.loadTexts: cMTSystemMetricStatsTable.setStatus('current')
if mibBuilder.loadTexts: cMTSystemMetricStatsTable.setDescription('A list of objects which accumulate the system metrics results of a particular node for that path.')
cMTSystemMetricStatsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 9, 1), ).setIndexNames((0, "CISCO-MEDIATRACE-MIB", "cMTSessionNumber"), (0, "CISCO-MEDIATRACE-MIB", "cMTSessionLifeNumber"), (0, "CISCO-MEDIATRACE-MIB", "cMTBucketNumber"), (0, "CISCO-MEDIATRACE-MIB", "cMTHopStatsAddrType"), (0, "CISCO-MEDIATRACE-MIB", "cMTHopStatsAddr"))
if mibBuilder.loadTexts: cMTSystemMetricStatsEntry.setStatus('current')
if mibBuilder.loadTexts: cMTSystemMetricStatsEntry.setDescription('An entry in cMTSystemMetricStatsTable represents CPU or memory utilization information of a hop on the path associated to a Mediatrace session such as five minutes CPU utilization, memory utilization, etc. The devices creates a row in the cMTSystemMetricStatsTable when a Mediatrace session starts collecting a system metrics data and has been configured to compute system metrics. Likewise, the device destroys a row in the cMTSystemMetricStatsTable when the corresponding Mediatrace session has ceased collecting the system metrics data (e.g., when a scheduled session has timed out). A single row corresponds to a CPU or memory utilization information of a hop on the path discovered for a Mediatrace session and is uniquely identified by cMTSessionNumber, cMTSessionLifeNumber, cMTBucketNumber,cMTHopStatsAddrType and cMTHopStatsAddr. The created rows are destroyed when the device undergoes a restart.')
cMTSystemMetricBitmaps = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 9, 1, 1), Bits().clone(namedValues=NamedValues(("cpuOneMinuteUtilizationUnsupport", 0), ("cpuOneMinuteUtilizationUncollected", 1), ("cpuFiveMinutesUtilizationUnsupport", 2), ("cpuFiveMinutesUtilizationUncollected", 3), ("memoryMetricsUnsupport", 4), ("memoryMetricsUncollected", 5)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: cMTSystemMetricBitmaps.setStatus('current')
if mibBuilder.loadTexts: cMTSystemMetricBitmaps.setDescription('This object indicates whether the corresponding instances of these stats fields in the table are supported. It also indicates if the stats data are collected. There are 2 bits for each field.')
cMTSystemMetricCpuOneMinuteUtilization = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 9, 1, 2), Gauge32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: cMTSystemMetricCpuOneMinuteUtilization.setStatus('current')
if mibBuilder.loadTexts: cMTSystemMetricCpuOneMinuteUtilization.setDescription('This object indicates the overall CPU busy percentage in the last 1 minute period for the network element')
cMTSystemMetricCpuFiveMinutesUtilization = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 9, 1, 3), Gauge32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: cMTSystemMetricCpuFiveMinutesUtilization.setStatus('current')
if mibBuilder.loadTexts: cMTSystemMetricCpuFiveMinutesUtilization.setDescription('This object indicates the overall CPU busy percentage in the last 5 minute period for the network element')
cMTSystemMetricMemoryUtilization = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 9, 1, 4), Gauge32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly")
if mibBuilder.loadTexts: cMTSystemMetricMemoryUtilization.setStatus('current')
if mibBuilder.loadTexts: cMTSystemMetricMemoryUtilization.setDescription('This object indicates the overall memory usage percentage for the node.')
cMTInterfaceMetricStatsTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 10), )
if mibBuilder.loadTexts: cMTInterfaceMetricStatsTable.setStatus('current')
if mibBuilder.loadTexts: cMTInterfaceMetricStatsTable.setDescription('This table contains aggregate data of interface information for the network nodes.')
cMTInterfaceMetricStatsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 10, 1), ).setIndexNames((0, "CISCO-MEDIATRACE-MIB", "cMTSessionNumber"), (0, "CISCO-MEDIATRACE-MIB", "cMTSessionLifeNumber"), (0, "CISCO-MEDIATRACE-MIB", "cMTBucketNumber"), (0, "CISCO-MEDIATRACE-MIB", "cMTHopStatsAddrType"), (0, "CISCO-MEDIATRACE-MIB", "cMTHopStatsAddr"))
if mibBuilder.loadTexts: cMTInterfaceMetricStatsEntry.setStatus('current')
if mibBuilder.loadTexts: cMTInterfaceMetricStatsEntry.setDescription('An entry in cMTInterfaceMetricStatsTable represents interface information of a hop on the path associated to a Mediatrace session such as ingress interface speed, egress interface speed, etc. The devices creates a row in the cMTInterfaceMetricStatsTable when a Mediatrace session starts collecting an interface metrics data and has been configured to compute interface metrics. Likewise, the device destroys a row in the cMTInterfaceMetricStatsTable when the corresponding Mediatrace session has ceased collecting the interface metrics data (e.g., when a scheduled session has timed out). A single row corresponds to a interface information of a hop on the path discovered for a session and is uniquely identified by cMTSessionNumber, cMTSessionLifeNumber, cMTBucketNumber, cMTHopStatsAddrType and cMTHopStatsAddr. The created rows are destroyed when the device undergoes a restart.')
cMTInterfaceBitmaps = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 10, 1, 2), Bits().clone(namedValues=NamedValues(("inSpeedUnsupport", 0), ("inSpeedUncollected", 1), ("outSpeedUnsupport", 2), ("outSpeedUncollected", 3), ("outDiscardsUnsupport", 4), ("outDiscardsUncollected", 5), ("inDiscardsUnsupport", 6), ("inDiscardsUncollected", 7), ("outErrorsUnsupport", 8), ("outErrorsUncollected", 9), ("inErrorsUnsupport", 10), ("inErrorsUncollected", 11), ("outOctetsUnsupport", 12), ("outOctetsUncollected", 13), ("inOctetsUnsupport", 14), ("inOctetsUncollected", 15)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: cMTInterfaceBitmaps.setStatus('current')
if mibBuilder.loadTexts: cMTInterfaceBitmaps.setDescription('This object indicates whether the corresponding instances of these stats fields in the table are supported. It also indicates if the stats data are collected. There are 2 bits for each field.')
cMTInterfaceOutSpeed = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 10, 1, 3), Gauge32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cMTInterfaceOutSpeed.setStatus('current')
if mibBuilder.loadTexts: cMTInterfaceOutSpeed.setDescription("This object indicates the egress interface's current bandwidth in bits per second. For interfaces which do not vary in bandwidth or for those where no accurate estimation can be made, this object should contain the nominal bandwidth. Currently bandwidth above the maximum value 4,294,967,295 is not supported and it will show the maximum for this condition.")
cMTInterfaceInSpeed = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 10, 1, 4), Gauge32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cMTInterfaceInSpeed.setStatus('current')
if mibBuilder.loadTexts: cMTInterfaceInSpeed.setDescription("This object indicates an estimate of the ingress interface's current bandwidth in bits per second. Currently bandwidth above the maximum value 4,294,967,295 is not supported and it will show the maximum for this condition.")
cMTInterfaceOutDiscards = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 10, 1, 5), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cMTInterfaceOutDiscards.setStatus('current')
if mibBuilder.loadTexts: cMTInterfaceOutDiscards.setDescription('This object indicates the number of outbound packets which were chosen to be discarded even though no errors had been detected to prevent their being transmitted. One possible reason for discarding such a packet could be to free up buffer space.')
cMTInterfaceInDiscards = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 10, 1, 6), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cMTInterfaceInDiscards.setStatus('current')
if mibBuilder.loadTexts: cMTInterfaceInDiscards.setDescription('This object indicates the number of inbound packets which were chosen to be discarded even though no errors had been detected to prevent their being deliverable to a higher-layer protocol. One possible reason for discarding such a packet could be to free up buffer space. Discontinuities in the value of this counter can occur at re-initialization of the management system, and at other times as indicated by the value of ifCounterDiscontinuityTime.')
cMTInterfaceOutErrors = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 10, 1, 7), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cMTInterfaceOutErrors.setStatus('current')
if mibBuilder.loadTexts: cMTInterfaceOutErrors.setDescription('This object indicates the error packet number. For packet-oriented interfaces, the number of outbound packets that could not be transmitted because of errors. For character-oriented or fixed-length interfaces, the number of outbound transmission units that could not be transmitted because of errors. Discontinuities in the value of this counter can occur at re-initialization of the management system, and at other times as indicated by the value of ifCounterDiscontinuityTime.')
cMTInterfaceInErrors = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 10, 1, 8), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cMTInterfaceInErrors.setStatus('current')
if mibBuilder.loadTexts: cMTInterfaceInErrors.setDescription('This object indicates the error packet number. For packet-oriented interfaces, the number of inbound packets that contained errors preventing them from being deliverable to a higher-layer protocol. For character-oriented or fixed-length interfaces, the number of inbound transmission units that contained errors preventing them from being deliverable to a higher-layer protocol. Discontinuities in the value of this counter can occur at re-initialization of the management system, and at other times as indicated by the value of ifCounterDiscontinuityTime.')
cMTInterfaceOutOctets = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 10, 1, 9), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cMTInterfaceOutOctets.setStatus('current')
if mibBuilder.loadTexts: cMTInterfaceOutOctets.setDescription('This object indicates the total number of octets transmitted out of the interface, including framing characters. Discontinuities in the value of this counter can occur at re-initialization of the management system, and at other times as indicated by the value of ifCounterDiscontinuityTime.')
cMTInterfaceInOctets = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 800, 1, 2, 10, 1, 10), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cMTInterfaceInOctets.setStatus('current')
if mibBuilder.loadTexts: cMTInterfaceInOctets.setDescription('This object indicates the total number of octets received on the interface, including framing characters. Discontinuities in the value of this counter can occur at re-initialization of the management system, and at other times as indicated by the value of ifCounterDiscontinuityTime.')
ciscoMediatraceMIBCompliances = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 800, 2, 1))
ciscoMediatraceMIBGroups = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 800, 2, 2))
ciscoMediatraceMIBCompliance = ModuleCompliance((1, 3, 6, 1, 4, 1, 9, 9, 800, 2, 1, 1)).setObjects(("CISCO-MEDIATRACE-MIB", "ciscoMediatraceMIBMainObjectGroup"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoMediatraceMIBCompliance = ciscoMediatraceMIBCompliance.setStatus('current')
if mibBuilder.loadTexts: ciscoMediatraceMIBCompliance.setDescription('This is a default module-compliance containing default object groups.')
ciscoMediatraceMIBMainObjectGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 800, 2, 2, 1)).setObjects(("CISCO-MEDIATRACE-MIB", "cMTFlowSpecifierRowStatus"), ("CISCO-MEDIATRACE-MIB", "cMTFlowSpecifierDestAddrType"), ("CISCO-MEDIATRACE-MIB", "cMTFlowSpecifierDestAddr"), ("CISCO-MEDIATRACE-MIB", "cMTFlowSpecifierDestPort"), ("CISCO-MEDIATRACE-MIB", "cMTFlowSpecifierSourceAddrType"), ("CISCO-MEDIATRACE-MIB", "cMTFlowSpecifierSourceAddr"), ("CISCO-MEDIATRACE-MIB", "cMTFlowSpecifierSourcePort"), ("CISCO-MEDIATRACE-MIB", "cMTFlowSpecifierIpProtocol"), ("CISCO-MEDIATRACE-MIB", "cMTPathSpecifierRowStatus"), ("CISCO-MEDIATRACE-MIB", "cMTPathSpecifierDestAddrType"), ("CISCO-MEDIATRACE-MIB", "cMTPathSpecifierDestAddr"), ("CISCO-MEDIATRACE-MIB", "cMTPathSpecifierDestPort"), ("CISCO-MEDIATRACE-MIB", "cMTPathSpecifierSourceAddrType"), ("CISCO-MEDIATRACE-MIB", "cMTPathSpecifierSourceAddr"), ("CISCO-MEDIATRACE-MIB", "cMTPathSpecifierSourcePort"), ("CISCO-MEDIATRACE-MIB", "cMTPathSpecifierProtocolForDiscovery"), ("CISCO-MEDIATRACE-MIB", "cMTPathSpecifierGatewayAddrType"), ("CISCO-MEDIATRACE-MIB", "cMTPathSpecifierGatewayAddr"), ("CISCO-MEDIATRACE-MIB", "cMTPathSpecifierGatewayVlanId"), ("CISCO-MEDIATRACE-MIB", "cMTPathSpecifierIpProtocol"), ("CISCO-MEDIATRACE-MIB", "cMTSessionParamsResponseTimeout"), ("CISCO-MEDIATRACE-MIB", "cMTSessionParamsFrequency"), ("CISCO-MEDIATRACE-MIB", "cMTSessionParamsHistoryBuckets"), ("CISCO-MEDIATRACE-MIB", "cMTSessionParamsInactivityTimeout"), ("CISCO-MEDIATRACE-MIB", "cMTSessionParamsRouteChangeReactiontime"), ("CISCO-MEDIATRACE-MIB", "cMTSessionParamsRowStatus"), ("CISCO-MEDIATRACE-MIB", "cMTSessionPathSpecifierName"), ("CISCO-MEDIATRACE-MIB", "cMTMediaMonitorProfileRtpMaxDropout"), ("CISCO-MEDIATRACE-MIB", "cMTMediaMonitorProfileRtpMaxReorder"), ("CISCO-MEDIATRACE-MIB", "cMTMediaMonitorProfileRtpMinimalSequential"), ("CISCO-MEDIATRACE-MIB", "cMTMediaMonitorProfileInterval"), ("CISCO-MEDIATRACE-MIB", "cMTMediaMonitorProfileRowStatus"), ("CISCO-MEDIATRACE-MIB", "cMTSessionFlowSpecifierName"), ("CISCO-MEDIATRACE-MIB", "cMTSessionParamName"), ("CISCO-MEDIATRACE-MIB", "cMTSessionProfileName"), ("CISCO-MEDIATRACE-MIB", "cMTSessionRequestStatsRouteIndex"), ("CISCO-MEDIATRACE-MIB", "cMTSessionRequestStatsTracerouteStatus"), ("CISCO-MEDIATRACE-MIB", "cMTSessionRowStatus"), ("CISCO-MEDIATRACE-MIB", "cMTScheduleLife"), ("CISCO-MEDIATRACE-MIB", "cMTScheduleStartTime"), ("CISCO-MEDIATRACE-MIB", "cMTScheduleEntryAgeout"), ("CISCO-MEDIATRACE-MIB", "cMTScheduleRowStatus"), ("CISCO-MEDIATRACE-MIB", "cMTSystemProfileMetric"), ("CISCO-MEDIATRACE-MIB", "cMTSystemProfileRowStatus"), ("CISCO-MEDIATRACE-MIB", "cMTHopStatsMediatraceTtl"), ("CISCO-MEDIATRACE-MIB", "cMTHopStatsName"), ("CISCO-MEDIATRACE-MIB", "cMTHopStatsCollectionStatus"), ("CISCO-MEDIATRACE-MIB", "cMTHopStatsIngressInterface"), ("CISCO-MEDIATRACE-MIB", "cMTHopStatsEgressInterface"), ("CISCO-MEDIATRACE-MIB", "cMTPathHopType"), ("CISCO-MEDIATRACE-MIB", "cMTPathHopAddrType"), ("CISCO-MEDIATRACE-MIB", "cMTPathHopAddr"), ("CISCO-MEDIATRACE-MIB", "cMTPathHopAlternate1AddrType"), ("CISCO-MEDIATRACE-MIB", "cMTPathHopAlternate1Addr"), ("CISCO-MEDIATRACE-MIB", "cMTPathHopAlternate2AddrType"), ("CISCO-MEDIATRACE-MIB", "cMTPathHopAlternate2Addr"), ("CISCO-MEDIATRACE-MIB", "cMTPathHopAlternate3AddrType"), ("CISCO-MEDIATRACE-MIB", "cMTPathHopAlternate3Addr"), ("CISCO-MEDIATRACE-MIB", "cMTTraceRouteHopNumber"), ("CISCO-MEDIATRACE-MIB", "cMTTraceRouteHopRtt"), ("CISCO-MEDIATRACE-MIB", "cMTSessionRequestStatsRequestTimestamp"), ("CISCO-MEDIATRACE-MIB", "cMTSessionRequestStatsRequestStatus"), ("CISCO-MEDIATRACE-MIB", "cMTSessionRequestStatsNumberOfMediatraceHops"), ("CISCO-MEDIATRACE-MIB", "cMTSessionRequestStatsNumberOfValidHops"), ("CISCO-MEDIATRACE-MIB", "cMTSessionRequestStatsNumberOfErrorHops"), ("CISCO-MEDIATRACE-MIB", "cMTSessionRequestStatsNumberOfNoDataRecordHops"), ("CISCO-MEDIATRACE-MIB", "cMTSessionRequestStatsNumberOfNonMediatraceHops"), ("CISCO-MEDIATRACE-MIB", "cMTCommonMetricsIpPktDropped"), ("CISCO-MEDIATRACE-MIB", "cMTCommonMetricsIpOctets"), ("CISCO-MEDIATRACE-MIB", "cMTCommonMetricsIpPktCount"), ("CISCO-MEDIATRACE-MIB", "cMTCommonMetricsIpByteRate"), ("CISCO-MEDIATRACE-MIB", "cMTCommonMetricsIpDscp"), ("CISCO-MEDIATRACE-MIB", "cMTCommonMetricsIpTtl"), ("CISCO-MEDIATRACE-MIB", "cMTCommonMetricsFlowCounter"), ("CISCO-MEDIATRACE-MIB", "cMTCommonMetricsFlowDirection"), ("CISCO-MEDIATRACE-MIB", "cMTCommonMetricsLossMeasurement"), ("CISCO-MEDIATRACE-MIB", "cMTCommonMetricsMediaStopOccurred"), ("CISCO-MEDIATRACE-MIB", "cMTCommonMetricsRouteForward"), ("CISCO-MEDIATRACE-MIB", "cMTCommonMetricsIpProtocol"), ("CISCO-MEDIATRACE-MIB", "cMTRtpMetricsBitRate"), ("CISCO-MEDIATRACE-MIB", "cMTRtpMetricsOctets"), ("CISCO-MEDIATRACE-MIB", "cMTRtpMetricsPkts"), ("CISCO-MEDIATRACE-MIB", "cMTRtpMetricsJitter"), ("CISCO-MEDIATRACE-MIB", "cMTRtpMetricsLostPkts"), ("CISCO-MEDIATRACE-MIB", "cMTRtpMetricsExpectedPkts"), ("CISCO-MEDIATRACE-MIB", "cMTRtpMetricsLostPktEvents"), ("CISCO-MEDIATRACE-MIB", "cMTRtpMetricsLossPercent"), ("CISCO-MEDIATRACE-MIB", "cMTTcpMetricMediaByteCount"), ("CISCO-MEDIATRACE-MIB", "cMTTcpMetricConnectRoundTripDelay"), ("CISCO-MEDIATRACE-MIB", "cMTTcpMetricLostEventCount"), ("CISCO-MEDIATRACE-MIB", "cMTSystemMetricCpuOneMinuteUtilization"), ("CISCO-MEDIATRACE-MIB", "cMTSystemMetricCpuFiveMinutesUtilization"), ("CISCO-MEDIATRACE-MIB", "cMTSystemMetricMemoryUtilization"), ("CISCO-MEDIATRACE-MIB", "cMTInterfaceOutSpeed"), ("CISCO-MEDIATRACE-MIB", "cMTInterfaceInSpeed"), ("CISCO-MEDIATRACE-MIB", "cMTInterfaceOutDiscards"), ("CISCO-MEDIATRACE-MIB", "cMTInterfaceInDiscards"), ("CISCO-MEDIATRACE-MIB", "cMTInterfaceOutErrors"), ("CISCO-MEDIATRACE-MIB", "cMTInterfaceInErrors"), ("CISCO-MEDIATRACE-MIB", "cMTInterfaceOutOctets"), ("CISCO-MEDIATRACE-MIB", "cMTInterfaceInOctets"), ("CISCO-MEDIATRACE-MIB", "cMTMediaMonitorProfileMetric"), ("CISCO-MEDIATRACE-MIB", "cMTSessionTraceRouteEnabled"), ("CISCO-MEDIATRACE-MIB", "cMTScheduleRecurring"), ("CISCO-MEDIATRACE-MIB", "cMTFlowSpecifierMetadataGlobalId"), ("CISCO-MEDIATRACE-MIB", "cMTPathSpecifierMetadataGlobalId"), ("CISCO-MEDIATRACE-MIB", "cMTHopStatsMaskBitmaps"), ("CISCO-MEDIATRACE-MIB", "cMTSessionStatusBitmaps"), ("CISCO-MEDIATRACE-MIB", "cMTCommonMetricsBitmaps"), ("CISCO-MEDIATRACE-MIB", "cMTRtpMetricsBitmaps"), ("CISCO-MEDIATRACE-MIB", "cMTTcpMetricBitmaps"), ("CISCO-MEDIATRACE-MIB", "cMTSystemMetricBitmaps"), ("CISCO-MEDIATRACE-MIB", "cMTInterfaceBitmaps"), ("CISCO-MEDIATRACE-MIB", "cMTSessionStatusOperationState"), ("CISCO-MEDIATRACE-MIB", "cMTSessionStatusOperationTimeToLive"), ("CISCO-MEDIATRACE-MIB", "cMTSessionStatusGlobalSessionId"), ("CISCO-MEDIATRACE-MIB", "cMTSessionRequestStatsBitmaps"), ("CISCO-MEDIATRACE-MIB", "cMTSessionRequestStatsMDGlobalId"), ("CISCO-MEDIATRACE-MIB", "cMTSessionRequestStatsMDMultiPartySessionId"), ("CISCO-MEDIATRACE-MIB", "cMTSessionRequestStatsMDAppName"), ("CISCO-MEDIATRACE-MIB", "cMTInitiatorEnable"), ("CISCO-MEDIATRACE-MIB", "cMTInitiatorSourceInterface"), ("CISCO-MEDIATRACE-MIB", "cMTInitiatorSourceAddressType"), ("CISCO-MEDIATRACE-MIB", "cMTInitiatorSourceAddress"), ("CISCO-MEDIATRACE-MIB", "cMTInitiatorMaxSessions"), ("CISCO-MEDIATRACE-MIB", "cMTInitiatorSoftwareVersionMajor"), ("CISCO-MEDIATRACE-MIB", "cMTInitiatorProtocolVersionMajor"), ("CISCO-MEDIATRACE-MIB", "cMTInitiatorConfiguredSessions"), ("CISCO-MEDIATRACE-MIB", "cMTInitiatorPendingSessions"), ("CISCO-MEDIATRACE-MIB", "cMTInitiatorInactiveSessions"), ("CISCO-MEDIATRACE-MIB", "cMTInitiatorActiveSessions"), ("CISCO-MEDIATRACE-MIB", "cMTResponderEnable"), ("CISCO-MEDIATRACE-MIB", "cMTResponderMaxSessions"), ("CISCO-MEDIATRACE-MIB", "cMTResponderActiveSessions"), ("CISCO-MEDIATRACE-MIB", "cMTInitiatorSoftwareVersionMinor"), ("CISCO-MEDIATRACE-MIB", "cMTInitiatorProtocolVersionMinor"), ("CISCO-MEDIATRACE-MIB", "cMTCommonMetricsFlowSamplingStartTime"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoMediatraceMIBMainObjectGroup = ciscoMediatraceMIBMainObjectGroup.setStatus('current')
if mibBuilder.loadTexts: ciscoMediatraceMIBMainObjectGroup.setDescription('The is a object group.')
mibBuilder.exportSymbols("CISCO-MEDIATRACE-MIB", cMTResponderActiveSessions=cMTResponderActiveSessions, cMTFlowSpecifierSourcePort=cMTFlowSpecifierSourcePort, cMTSessionRequestStatsNumberOfNoDataRecordHops=cMTSessionRequestStatsNumberOfNoDataRecordHops, cMTRtpMetricStatsTable=cMTRtpMetricStatsTable, cMTRtpMetricsLossPercent=cMTRtpMetricsLossPercent, cMTPathHopAddrType=cMTPathHopAddrType, cMTSessionStatusGlobalSessionId=cMTSessionStatusGlobalSessionId, cMTInitiatorActiveSessions=cMTInitiatorActiveSessions, cMTSessionRequestStatsNumberOfNonMediatraceHops=cMTSessionRequestStatsNumberOfNonMediatraceHops, cMTSessionParamsHistoryBuckets=cMTSessionParamsHistoryBuckets, cMTHopStatsEgressInterface=cMTHopStatsEgressInterface, cMTMediaMonitorProfileName=cMTMediaMonitorProfileName, cMTPathHopAlternate1Addr=cMTPathHopAlternate1Addr, cMTHopStatsEntry=cMTHopStatsEntry, cMTPathSpecifierEntry=cMTPathSpecifierEntry, cMTTraceRouteEntry=cMTTraceRouteEntry, cMTSessionFlowSpecifierName=cMTSessionFlowSpecifierName, cMTSessionStatusBitmaps=cMTSessionStatusBitmaps, cMTInitiatorSourceAddressType=cMTInitiatorSourceAddressType, cMTRtpMetricsBitRate=cMTRtpMetricsBitRate, cMTSessionRequestStatsMDGlobalId=cMTSessionRequestStatsMDGlobalId, cMTInterfaceOutSpeed=cMTInterfaceOutSpeed, cMTFlowSpecifierRowStatus=cMTFlowSpecifierRowStatus, cMTSystemProfileEntry=cMTSystemProfileEntry, cMTInitiatorSourceAddress=cMTInitiatorSourceAddress, cMTSessionParamsEntry=cMTSessionParamsEntry, cMTSessionParamsFrequency=cMTSessionParamsFrequency, cMTInitiatorProtocolVersionMinor=cMTInitiatorProtocolVersionMinor, CiscoNTPTimeStamp=CiscoNTPTimeStamp, cMTSystemMetricBitmaps=cMTSystemMetricBitmaps, cMTTcpMetricMediaByteCount=cMTTcpMetricMediaByteCount, cMTSessionRequestStatsRequestStatus=cMTSessionRequestStatsRequestStatus, cMTRtpMetricsBitmaps=cMTRtpMetricsBitmaps, ciscoMediatraceMIB=ciscoMediatraceMIB, cMTInterfaceInSpeed=cMTInterfaceInSpeed, cMTInitiatorConfiguredSessions=cMTInitiatorConfiguredSessions, cMTHopStatsMediatraceTtl=cMTHopStatsMediatraceTtl, cMTPathSpecifierDestPort=cMTPathSpecifierDestPort, cMTHopStatsCollectionStatus=cMTHopStatsCollectionStatus, cMTSessionParamsResponseTimeout=cMTSessionParamsResponseTimeout, ciscoMediatraceMIBNotifs=ciscoMediatraceMIBNotifs, cMTTcpMetricStatsEntry=cMTTcpMetricStatsEntry, cMTInterfaceMetricStatsTable=cMTInterfaceMetricStatsTable, cMTSessionParamName=cMTSessionParamName, cMTSessionLifeNumber=cMTSessionLifeNumber, cMTScheduleLife=cMTScheduleLife, cMTTcpMetricStatsTable=cMTTcpMetricStatsTable, cMTBucketNumber=cMTBucketNumber, cMTResponderMaxSessions=cMTResponderMaxSessions, cMTScheduleTable=cMTScheduleTable, cMTSessionRequestStatsRequestTimestamp=cMTSessionRequestStatsRequestTimestamp, cMTPathTable=cMTPathTable, cMTRtpMetricsLostPkts=cMTRtpMetricsLostPkts, ciscoMediatraceMIBGroups=ciscoMediatraceMIBGroups, cMTFlowSpecifierDestAddrType=cMTFlowSpecifierDestAddrType, cMTCommonMetricsMediaStopOccurred=cMTCommonMetricsMediaStopOccurred, cMTCommonMetricStatsTable=cMTCommonMetricStatsTable, cMTPathEntry=cMTPathEntry, cMTInitiatorMaxSessions=cMTInitiatorMaxSessions, cMTInterfaceInOctets=cMTInterfaceInOctets, cMTFlowSpecifierTable=cMTFlowSpecifierTable, cMTHopStatsMaskBitmaps=cMTHopStatsMaskBitmaps, cMTSessionRequestStatsMDAppName=cMTSessionRequestStatsMDAppName, cMTSessionPathSpecifierName=cMTSessionPathSpecifierName, cMTMediaMonitorProfileRowStatus=cMTMediaMonitorProfileRowStatus, cMTPathSpecifierProtocolForDiscovery=cMTPathSpecifierProtocolForDiscovery, cMTCtrl=cMTCtrl, cMTFlowSpecifierEntry=cMTFlowSpecifierEntry, cMTCommonMetricsBitmaps=cMTCommonMetricsBitmaps, cMTInitiatorPendingSessions=cMTInitiatorPendingSessions, cMTSystemProfileTable=cMTSystemProfileTable, CiscoMediatraceDiscoveryProtocol=CiscoMediatraceDiscoveryProtocol, cMTFlowSpecifierName=cMTFlowSpecifierName, cMTCommonMetricsIpOctets=cMTCommonMetricsIpOctets, cMTSystemProfileMetric=cMTSystemProfileMetric, cMTHopStatsIngressInterface=cMTHopStatsIngressInterface, cMTHopStatsAddr=cMTHopStatsAddr, cMTPathSpecifierGatewayAddrType=cMTPathSpecifierGatewayAddrType, CiscoMediatraceSupportProtocol=CiscoMediatraceSupportProtocol, cMTPathSpecifierIpProtocol=cMTPathSpecifierIpProtocol, cMTSessionRowStatus=cMTSessionRowStatus, cMTFlowSpecifierIpProtocol=cMTFlowSpecifierIpProtocol, cMTTcpMetricBitmaps=cMTTcpMetricBitmaps, cMTSystemMetricCpuFiveMinutesUtilization=cMTSystemMetricCpuFiveMinutesUtilization, cMTSessionNumber=cMTSessionNumber, cMTPathSpecifierSourceAddrType=cMTPathSpecifierSourceAddrType, cMTInitiatorSoftwareVersionMajor=cMTInitiatorSoftwareVersionMajor, cMTSessionRequestStatsNumberOfErrorHops=cMTSessionRequestStatsNumberOfErrorHops, cMTMediaMonitorProfileRtpMaxReorder=cMTMediaMonitorProfileRtpMaxReorder, cMTSessionParamsRowStatus=cMTSessionParamsRowStatus, cMTHopStatsAddrType=cMTHopStatsAddrType, cMTMediaMonitorProfileEntry=cMTMediaMonitorProfileEntry, cMTInterfaceOutDiscards=cMTInterfaceOutDiscards, cMTSessionParamsRouteChangeReactiontime=cMTSessionParamsRouteChangeReactiontime, cMTRtpMetricsPkts=cMTRtpMetricsPkts, cMTSessionParamsName=cMTSessionParamsName, cMTResponderEnable=cMTResponderEnable, cMTSessionTable=cMTSessionTable, cMTTraceRouteHopNumber=cMTTraceRouteHopNumber, cMTPathSpecifierDestAddr=cMTPathSpecifierDestAddr, cMTInitiatorProtocolVersionMajor=cMTInitiatorProtocolVersionMajor, cMTPathHopAddr=cMTPathHopAddr, cMTSessionStatusTable=cMTSessionStatusTable, cMTSystemMetricStatsTable=cMTSystemMetricStatsTable, cMTInterfaceMetricStatsEntry=cMTInterfaceMetricStatsEntry, cMTTraceRouteHopRtt=cMTTraceRouteHopRtt, cMTSessionRequestStatsNumberOfMediatraceHops=cMTSessionRequestStatsNumberOfMediatraceHops, cMTSessionParamsInactivityTimeout=cMTSessionParamsInactivityTimeout, cMTSystemProfileRowStatus=cMTSystemProfileRowStatus, cMTFlowSpecifierSourceAddrType=cMTFlowSpecifierSourceAddrType, cMTPathHopNumber=cMTPathHopNumber, cMTSessionRequestStatsNumberOfValidHops=cMTSessionRequestStatsNumberOfValidHops, cMTScheduleRowStatus=cMTScheduleRowStatus, cMTCommonMetricsIpTtl=cMTCommonMetricsIpTtl, cMTSessionTraceRouteEnabled=cMTSessionTraceRouteEnabled, cMTSessionRequestStatsTracerouteStatus=cMTSessionRequestStatsTracerouteStatus, cMTRtpMetricsOctets=cMTRtpMetricsOctets, cMTSystemMetricCpuOneMinuteUtilization=cMTSystemMetricCpuOneMinuteUtilization, cMTSessionStatusOperationState=cMTSessionStatusOperationState, ciscoMediatraceMIBCompliances=ciscoMediatraceMIBCompliances, cMTPathSpecifierRowStatus=cMTPathSpecifierRowStatus, cMTCommonMetricsIpPktCount=cMTCommonMetricsIpPktCount, cMTPathSpecifierGatewayAddr=cMTPathSpecifierGatewayAddr, cMTInterfaceBitmaps=cMTInterfaceBitmaps, cMTFlowSpecifierMetadataGlobalId=cMTFlowSpecifierMetadataGlobalId, cMTPathHopAlternate2AddrType=cMTPathHopAlternate2AddrType, cMTSessionRequestStatsRouteIndex=cMTSessionRequestStatsRouteIndex, cMTPathSpecifierName=cMTPathSpecifierName, cMTTcpMetricConnectRoundTripDelay=cMTTcpMetricConnectRoundTripDelay, cMTCommonMetricsRouteForward=cMTCommonMetricsRouteForward, cMTSessionRequestStatsTable=cMTSessionRequestStatsTable, cMTSystemMetricStatsEntry=cMTSystemMetricStatsEntry, cMTPathHopAlternate3Addr=cMTPathHopAlternate3Addr, cMTPathHopAlternate1AddrType=cMTPathHopAlternate1AddrType, cMTCommonMetricsIpDscp=cMTCommonMetricsIpDscp, ciscoMediatraceMIBObjects=ciscoMediatraceMIBObjects, cMTPathSpecifierGatewayVlanId=cMTPathSpecifierGatewayVlanId, cMTTraceRouteTable=cMTTraceRouteTable, cMTPathSpecifierMetadataGlobalId=cMTPathSpecifierMetadataGlobalId, cMTPathSpecifierDestAddrType=cMTPathSpecifierDestAddrType, cMTSessionRequestStatsMDMultiPartySessionId=cMTSessionRequestStatsMDMultiPartySessionId, cMTPathHopType=cMTPathHopType, cMTPathHopAlternate3AddrType=cMTPathHopAlternate3AddrType, cMTMediaMonitorProfileMetric=cMTMediaMonitorProfileMetric, cMTPathSpecifierTable=cMTPathSpecifierTable, cMTStats=cMTStats, cMTSessionStatusEntry=cMTSessionStatusEntry, cMTPathSpecifierSourcePort=cMTPathSpecifierSourcePort, cMTSessionRequestStatsEntry=cMTSessionRequestStatsEntry, ciscoMediatraceMIBMainObjectGroup=ciscoMediatraceMIBMainObjectGroup, cMTCommonMetricsFlowCounter=cMTCommonMetricsFlowCounter, cMTHopStatsName=cMTHopStatsName, cMTSystemMetricMemoryUtilization=cMTSystemMetricMemoryUtilization, cMTFlowSpecifierSourceAddr=cMTFlowSpecifierSourceAddr, PYSNMP_MODULE_ID=ciscoMediatraceMIB, cMTMediaMonitorProfileTable=cMTMediaMonitorProfileTable, ciscoMediatraceMIBConform=ciscoMediatraceMIBConform, cMTMediaMonitorProfileInterval=cMTMediaMonitorProfileInterval, cMTCommonMetricStatsEntry=cMTCommonMetricStatsEntry, cMTRtpMetricsExpectedPkts=cMTRtpMetricsExpectedPkts, cMTFlowSpecifierDestAddr=cMTFlowSpecifierDestAddr, cMTCommonMetricsFlowSamplingStartTime=cMTCommonMetricsFlowSamplingStartTime, cMTInitiatorSoftwareVersionMinor=cMTInitiatorSoftwareVersionMinor, cMTPathHopAlternate2Addr=cMTPathHopAlternate2Addr, cMTSessionProfileName=cMTSessionProfileName, cMTCommonMetricsIpProtocol=cMTCommonMetricsIpProtocol, cMTFlowSpecifierDestPort=cMTFlowSpecifierDestPort, cMTPathSpecifierSourceAddr=cMTPathSpecifierSourceAddr, cMTCommonMetricsFlowDirection=cMTCommonMetricsFlowDirection, cMTSessionStatusOperationTimeToLive=cMTSessionStatusOperationTimeToLive, cMTSessionRequestStatsBitmaps=cMTSessionRequestStatsBitmaps, cMTInterfaceInErrors=cMTInterfaceInErrors, cMTHopStatsTable=cMTHopStatsTable, cMTInterfaceInDiscards=cMTInterfaceInDiscards, cMTScheduleRecurring=cMTScheduleRecurring, cMTSessionParamsTable=cMTSessionParamsTable, cMTCommonMetricsIpByteRate=cMTCommonMetricsIpByteRate, cMTInitiatorInactiveSessions=cMTInitiatorInactiveSessions, cMTSystemProfileName=cMTSystemProfileName, cMTInterfaceOutOctets=cMTInterfaceOutOctets, cMTScheduleEntryAgeout=cMTScheduleEntryAgeout, cMTCommonMetricsLossMeasurement=cMTCommonMetricsLossMeasurement, cMTRtpMetricsJitter=cMTRtpMetricsJitter, cMTInterfaceOutErrors=cMTInterfaceOutErrors, cMTRtpMetricStatsEntry=cMTRtpMetricStatsEntry, cMTScheduleEntry=cMTScheduleEntry, cMTInitiatorSourceInterface=cMTInitiatorSourceInterface, cMTTcpMetricLostEventCount=cMTTcpMetricLostEventCount, cMTSessionEntry=cMTSessionEntry, cMTMediaMonitorProfileRtpMaxDropout=cMTMediaMonitorProfileRtpMaxDropout, ciscoMediatraceMIBCompliance=ciscoMediatraceMIBCompliance, cMTMediaMonitorProfileRtpMinimalSequential=cMTMediaMonitorProfileRtpMinimalSequential, cMTInitiatorEnable=cMTInitiatorEnable, cMTScheduleStartTime=cMTScheduleStartTime, cMTCommonMetricsIpPktDropped=cMTCommonMetricsIpPktDropped, cMTRtpMetricsLostPktEvents=cMTRtpMetricsLostPktEvents)
|
# DFS
class Solution:
def numIslands(self, grid: List[List[str]]) -> int:
if not grid:
return 0
m, n = len(grid), len(grid[0])
dirs = [(0,1), (0,-1), (1,0), (-1,0)]
res = 0
for i in range(m):
for j in range(n):
if grid[i][j] == '1':
res += 1
stack = [(i,j)]
grid[i][j] = '#'
while stack:
x, y = stack.pop()
for dx, dy in dirs:
nx = dx + x
ny = dy + y
if 0<=nx<m and 0<=ny<n and grid[nx][ny] == '1':
stack.append((nx,ny))
grid[nx][ny] = '#'
return res
# BFS
class Solution:
def numIslands(self, grid: List[List[str]]) -> int:
if not grid: return 0
m, n = len(grid), len(grid[0])
q = collections.deque()
res = 0
dirs = [(0,1), (0,-1), (1,0), (-1,0)]
for i in range(m):
for j in range(n):
if grid[i][j] == "1":
res += 1
q.append((i,j))
grid[i][j] = "#"
while q:
x, y = q.popleft()
for dx, dy in dirs:
nx = x + dx
ny = y + dy
if 0<=nx<m and 0<=ny<n and grid[nx][ny]=="1":
q.append((nx,ny))
grid[nx][ny]="#"
return res
# Recursive
class Solution:
def numIslands(self, grid: List[List[str]]) -> int:
if not grid:
return 0
m, n = len(grid), len(grid[0])
res = 0
dirs = [(1,0),(-1,0), (0,1),(0,-1)]
visited = set()
for i in range(m):
for j in range(n):
if grid[i][j] == '1' and (i,j) not in visited:
res += 1
self.helper(grid, i, j, visited)
return res
def helper(self, grid, x, y,visited):
m, n = len(grid), len(grid[0])
if 0<=x<m and 0<=y<n and (x,y) not in visited and grid[x][y] == '1':
visited.add((x,y))
self.helper(grid, x+1, y, visited)
self.helper(grid, x-1, y, visited)
self.helper(grid, x, y+1, visited)
self.helper(grid, x, y-1, visited)
#helper两种写法
# def helper(self, grid, x, y,visited ):
# visited.add((x,y))
# dirs = [(0,1),(0,-1),(1,0),(-1,0)]
# m, n = len(grid), len(grid[0])
# for dx, dy in dirs:
# nx = dx + x
# ny = dy + y
# if 0<=nx<m and 0<=ny<n and (nx,ny) not in visited and grid[nx][ny] == '1':
# self.helper(grid, nx, ny, visited) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.